@streamlayer/react 1.14.0 → 1.14.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/advertisement.js +45 -45
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/index2.js +5 -5
- package/lib/cjs/masters2.js +3 -3
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +13 -13
- package/lib/cjs/useStreamLayerApp2.js +7 -7
- package/lib/classic/cjs/advertisement.js +45 -45
- package/lib/classic/cjs/bet-pack.js +1 -1
- package/lib/classic/cjs/index2.js +5 -5
- package/lib/classic/cjs/masters2.js +3 -3
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +13 -13
- package/lib/classic/cjs/useStreamLayerApp2.js +7 -7
- package/lib/classic/es/advertisement.js +37744 -39730
- package/lib/classic/es/bet-pack.js +1 -1
- package/lib/classic/es/index.js +1 -1
- package/lib/classic/es/index2.js +1023 -1014
- package/lib/classic/es/masters2.js +281 -287
- package/lib/classic/es/notification.js +40 -40
- package/lib/classic/es/points.js +5 -5
- package/lib/classic/es/provider.js +2406 -2387
- package/lib/classic/es/useStreamLayerApp2.js +1579 -1568
- package/lib/classic/style.css +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/masters.js +30 -30
- package/lib/dist/es/gamification-feature2.js +1 -1
- package/lib/dist/es/masters.js +5961 -5929
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +37744 -39730
- package/lib/es/bet-pack.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/index2.js +1023 -1014
- package/lib/es/masters2.js +281 -287
- package/lib/es/notification.js +40 -40
- package/lib/es/points.js +5 -5
- package/lib/es/provider.js +2404 -2385
- package/lib/es/useStreamLayerApp2.js +1579 -1568
- package/lib/style.css +1 -1
- package/package.json +14 -14
package/lib/cjs/masters2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),s=require("./provider.js"),d=require("react"),B=require("./index2.js"),L=require("./useStreamLayerApp2.js"),P=s.styled_default("div")({name:"SDKContainer",class:"s8zgqze",propsAsIs:!1}),H=s.styled_default("div")({name:"SDKScrollContainer",class:"s6t897k",propsAsIs:!1}),b=s.styled_default("div")({name:"SDKContentContainer",class:"sw7pkvp",propsAsIs:!1}),$=()=>b,M=s.styled_default($())({name:"SDKWhiteContainer",class:"s14gkn7u",propsAsIs:!0}),U=s.styled_default("div")({name:"TabsContainer",class:"t1yxstm9",propsAsIs:!1}),G=s.styled_default("div")({name:"UserSummaryContainer",class:"udpty1s",propsAsIs:!1}),O=(t,e,n)=>{const o=e>=s.A.lg&&e<s.A.xl?75:52;t.current&&window.scrollTo({top:t.current.offsetTop-o,...n})},K=15,q=(t,e)=>{const n=d.useRef(null),o=d.useRef(0),[i]=d.useState(s.v({scrollPosition:0,tabsShown:!0,scrollDirection:"forward"})),l=s.useStore(e);return d.useEffect(()=>{const a=window.innerWidth<s.A.xl?window:n.current;if(!a)return()=>{};const C=s.A$1(p=>{var c;const u=p.target;if(!u)return;let f=0;l.screen.size<s.A.xl?f=((c=t.current)==null?void 0:c.getBoundingClientRect().y)||0:f=u.scrollTop;const S=o.current-f;if(K>Math.abs(S))return;const m=o.current<f?"forward":"backward";o.current=f,i.set({scrollPosition:Math.round(f),scrollDirection:m,tabsShown:i.get().tabsShown})},200);return a.addEventListener("scroll",C),()=>{a.removeEventListener("scroll",C)}},[i,t,l.screen]),[n,i]},T=s.styled_default("div")({name:"LoadingContainer",class:"l7wseip",propsAsIs:!1}),Q=({feature:t,sdk:e,children:n,className:o,noWait:i})=>{const l=s.useStore(t.status),a=s.useStore(e.sdkStore.slStreamId);if(!i){if(a!=null&&a.loading&&!a.data)return r.jsx(T,{className:o,children:"Event is loading..."});if(!(a!=null&&a.data))return r.jsx(T,{className:o,children:"Event is forbidden..."});if(l!==s.FeatureStatus.Ready)return r.jsx(T,{className:o,children:"Wait feature..."})}return n},F=d.createContext({sdk:null}),R=()=>d.useContext(F),z=s.styled_default("div")({name:"QuestionContainer",class:"qwgkhsv",propsAsIs:!1}),Z=({openedQuestion:t})=>{var e,n;const{sdk:o}=R();return((e=t==null?void 0:t.attributes)==null?void 0:e.attributes.case)==="insight"?r.jsx(s.p,{...t.attributes.attributes.value,controlVideo:o==null?void 0:o.controlVideoPlayer}):((n=t==null?void 0:t.attributes)==null?void 0:n.attributes.case)==="tweet"?r.jsx(s.a,{...t.attributes.attributes.value,controlVideo:o==null?void 0:o.controlVideoPlayer}):null},Y=({extendedQuestion:t,vote:e,close:n})=>{const{loading:o,data:i}=t;return i?r.jsx(s.Ht,{vote:e,close:n,openedQuestion:i,isLoading:!!o}):r.jsx(s.jt,{})},W=({gamification:t})=>{var e;const n=s.useStore(t.openedQuestion.$store),o=s.useStore(t.openedQuestion.$extendedStore);if(!n)return null;const i=n.type;return r.jsxs(z,{children:[r.jsx(s.b,{close:t.closeQuestion,type:((e=n.attributes)==null?void 0:e.type)||L.QuestionType.UNSET}),i==="question"&&r.jsx(Y,{vote:t.submitAnswer,close:t.closeQuestion,extendedQuestion:o}),i!=="question"&&r.jsx(Z,{openedQuestion:n}),r.jsx(s.i,{mastersApp:!0})]})},X=({store:t,openQuestion:e})=>{const{sdk:n}=R(),o=s.useStore(t);return r.jsx(s.k,{openQuestion:e,questions:o.data,controlVideo:n==null?void 0:n.controlVideoPlayer})},J=({userSummary:t})=>{var e;const n=s.useStore(t.$store);return r.jsx(s.z$1,{hideFriendsRank:!0,loading:!(n!=null&&n.summary),...n==null?void 0:n.summary,successRate:(e=n==null?void 0:n.percentage)==null?void 0:e.correct})},e2=({gamification:t,className:e,style:n})=>r.jsxs(U,{className:e,style:n,children:[r.jsx(M,{style:{paddingTop:"8px"},children:r.jsx(G,{children:r.jsx(J,{userSummary:t.userSummary})})}),r.jsx(b,{style:{flex:1},children:r.jsx(X,{openQuestion:t.openQuestion,store:t.feedList.getStore()})})]}),s2=()=>s.f,t2=s.styled_default(s2())({name:"OpenedContainer",class:"o1seszvt",propsAsIs:!0}),n2=({gamification:t,className:e})=>r.jsx(e2,{className:e,gamification:t}),r2=({gamification:t,className:e,appNode:n,responsiveStore:o})=>{const i=s.useStore(t.openedQuestion.$store),{sdkInDesktopView:l}=s.useStore(o,{keys:["sdkInDesktopView"]}),{hiding:a,onAnimationEnd:C}=s.S();return!n.current||!i?null:r.jsx(s.x,{container:n,useContainer:!l,children:r.jsx(t2,{className:e,hiding:a,onAnimationEnd:C,children:r.jsx(W,{gamification:t})})})},o2=d.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature2.js"))),i2=({sdk:t,feature:e,className:n})=>{const o=d.useMemo(()=>e&&e.featureConfig.get().type===L.SdkOverlayType.GAMES?r.jsx(Q,{className:n,sdk:t,feature:e,children:r.jsx(o2,{className:n,gamification:e})}):null,[t,e,n]);return r.jsx(d.Suspense,{fallback:r.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:o})},l2=({feature:t,className:e,appNode:n,responsiveStore:o})=>t&&t.featureConfig.get().type===L.SdkOverlayType.GAMES?r.jsx(r2,{className:e,appNode:n,responsiveStore:o,gamification:t}):null,a2=s.styled_default("div")({name:"Navigation",class:"n1o1tw60",propsAsIs:!1}),d2=s.styled_default("div")({name:"Container",class:"co2rstw",propsAsIs:!1}),c2=s.styled_default("div")({name:"Title",class:"t1bqnx9c",propsAsIs:!1}),u2=()=>s.u1,C2=s.styled_default(u2())({name:"HeaderIcon",class:"hlc2pcy",propsAsIs:!0}),p2="h1aqxe8k",f2=d.forwardRef(({className:t},e)=>r.jsxs(a2,{className:s.cx_default(t,p2),children:[r.jsx(d2,{children:r.jsxs(c2,{children:[r.jsx(C2,{name:"icon-trivia-transparent"}),"Game Center"]})}),r.jsx("div",{ref:e})]})),v2=s.styled_default("div")({name:"Container",class:"czz4rjk",propsAsIs:!1}),S2=s.styled_default("div")({name:"CloseIconWrap",class:"cxmojsy",propsAsIs:!1}),m2=()=>s.u1,E2=s.styled_default(m2())({name:"CloseIcon",class:"c1urm3yx",propsAsIs:!0}),_2=s.styled_default("div")({name:"Title",class:"tme976v",propsAsIs:!1}),L2=s.styled_default("img")({name:"SponsorLogo",class:"s1lal9yz",propsAsIs:!1}),h2=s.styled_default("div")({name:"PresentsTitle",class:"pnn1sv1",propsAsIs:!1}),g2=s.styled_default("div")({name:"Subtitle",class:"s1hjj1y8",propsAsIs:!1}),N2=s.styled_default("div")({name:"Description",class:"dz7yjzw",propsAsIs:!1}),y2=s.styled_default("button")({name:"ActionButton",class:"avpowqk",propsAsIs:!1}),A=({close:t,action:e,onboarding:n})=>{var o,i,l,a,C,p,c,u;return r.jsxs(v2,{children:[r.jsx(S2,{onClick:t,children:r.jsx(E2,{name:"icon-cross"})}),((i=(o=n==null?void 0:n.titleCard)==null?void 0:o.media)==null?void 0:i.sponsorLogo)&&r.jsxs(_2,{children:[r.jsx(L2,{alt:"sponsor-logo",src:(a=(l=n==null?void 0:n.titleCard)==null?void 0:l.media)==null?void 0:a.sponsorLogo}),r.jsx(h2,{children:"PRESENTS"})]}),((C=n==null?void 0:n.titleCard)==null?void 0:C.title)&&r.jsx(g2,{children:(p=n==null?void 0:n.titleCard)==null?void 0:p.title}),((c=n==null?void 0:n.titleCard)==null?void 0:c.subtitle)&&r.jsx(N2,{children:(u=n==null?void 0:n.titleCard)==null?void 0:u.subtitle}),r.jsx(y2,{onClick:e,children:"Play Now"})]})},T2="data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200%2092%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.1701%200.953996C13.9047%200.873145%2013.6393%201.0177%2013.3739%201.1647C13.2797%201.21615%2013.2127%201.3068%2013.1904%201.4097L12.7736%203.33298C12.7588%203.40404%2012.8233%203.46774%2012.8952%203.45304C13.3342%203.35504%2013.7509%202.97528%2014.19%203.10758C14.6811%203.25703%2015.1722%202.64207%2015.6634%202.64942V0.429688C15.1698%200.432138%2014.6613%201.10345%2014.1701%200.953996Z'%20fill='%23006747'/%3e%3cpath%20d='M20.4404%206.84786C20.3362%206.77681%2020.2717%206.66166%2020.2717%206.53671V6.18635C20.2717%205.87275%2020.0138%205.61549%2019.6938%205.61549H19.4631C19.1878%205.61549%2018.9348%205.75269%2018.7859%205.98055L18.0418%207.11492C17.9674%207.22762%2017.8434%207.29377%2017.7094%207.29377H17.2084C16.9603%207.29377%2016.7321%207.42852%2016.6131%207.64412C16.4915%207.86708%2016.2757%208.02143%2016.0302%208.07288V0.181303C16.0302%200.0808513%2015.9483%200%2015.8466%200C15.7449%200%2015.663%200.0808513%2015.663%200.181303V0.426307V2.64604V8.07778C15.4175%208.02633%2015.2017%207.87198%2015.0801%207.64657C14.9636%207.43097%2014.7354%207.29622%2014.4848%207.29622H14.1475C13.8796%207.29622%2013.639%207.45057%2013.5298%207.69312L13.2496%208.31299C13.2049%208.41099%2013.1057%208.47469%2012.9965%208.47469C12.8874%208.47469%2012.7882%208.41099%2012.7435%208.31299L12.4633%207.69312C12.3541%207.45302%2012.1135%207.29622%2011.8456%207.29622H2.33802C2.26113%207.29622%202.19911%207.35747%202.19911%207.43342C2.19911%207.59512%202.06517%207.72498%201.90394%207.72498H1.49218C1.41529%207.72498%201.35328%207.78623%201.35328%207.86218V8.33504C1.35328%208.77849%201.26646%209.2097%201.09283%209.61886L0.842303%2010.2142C0.60914%2010.7655%200.5%2011.3363%200.5%2011.8974V13.2694C0.5%2013.6394%200.55457%2014.0142%200.66371%2014.3793C0.968807%2015.4034%201.66334%2016.2413%202.61831%2016.7362L4.13883%2017.5276C4.15868%2017.5374%204.181%2017.5423%204.20332%2017.5423L5.32697%2017.5521C5.5899%2017.5545%205.84787%2017.6207%206.07855%2017.7481L6.6813%2018.0813C6.70115%2018.0935%206.72595%2018.0984%206.75076%2018.0984H7.5569C7.83968%2018.0984%208.11997%2018.1744%208.36057%2018.3189C8.36057%2018.3189%208.75497%2018.5566%208.88891%2018.6326C9.10223%2018.7551%209.3602%2018.8727%209.80916%2018.8972C9.91086%2018.9021%2010.0126%2018.8653%2010.0895%2018.7943C10.1639%2018.7232%2010.2085%2018.6228%2010.2085%2018.5223V17.9882C10.2085%2017.6011%2010.4392%2017.2483%2010.7989%2017.0939L12.0317%2016.5598C12.2003%2016.4863%2012.3888%2016.4741%2012.5649%2016.528L13.0263%2016.6627C13.2223%2016.7191%2013.4306%2016.7215%2013.6266%2016.6627L14.718%2016.3418C14.8619%2016.3001%2015.0156%2016.3001%2015.162%2016.3442L15.606%2016.4667C15.8119%2016.5231%2015.9582%2016.7142%2015.9582%2016.9249V17.9931C15.9582%2018.4905%2016.3675%2018.8972%2016.871%2018.8972C17.2481%2018.8972%2017.578%2018.6595%2017.6921%2018.3042C17.8979%2017.6648%2018.0021%2016.9984%2018.0021%2016.3271V15.8714C18.0021%2015.548%2018.1385%2015.2368%2018.3767%2015.0138L18.8306%2014.59C19.1357%2014.3033%2019.3118%2013.8966%2019.3118%2013.4801V10.9468C19.3118%2010.5548%2019.4309%2010.175%2019.6591%209.85161C19.6764%209.82956%2019.6839%209.80016%2019.6839%209.77321V9.1754C19.6839%208.78584%2019.8029%208.40854%2020.0262%208.08758L20.4751%207.44322C20.4925%207.42117%2020.4999%207.39422%2020.4999%207.36482V6.96056C20.5024%206.88461%2020.4553%206.85766%2020.4404%206.84786ZM16.0302%2012.8554C16.3352%2012.9019%2016.5634%2013.0563%2016.5634%2013.2425C16.5634%2013.4287%2016.3377%2013.583%2016.0302%2013.6296V12.8554ZM2.98046%2016.6137L2.74978%2016.4937C2.12222%2016.1678%201.62117%2015.6827%201.27886%2015.0922V14.3523C1.67078%2014.9134%202.20407%2015.3912%202.85644%2015.7317L2.98046%2015.7954V16.6137ZM4.14131%2017.2189L3.52616%2016.9004V16.0821L4.13883%2016.4006H4.14131V17.2189ZM6.70115%2017.775L6.21498%2017.5055C5.94957%2017.3585%205.65191%2017.2801%205.34682%2017.2752V16.4226C5.6023%2016.4275%205.85531%2016.4937%206.07855%2016.6162L6.6813%2016.9494C6.68626%2016.9518%206.6937%2016.9518%206.70115%2016.9543V17.775ZM9.92822%2017.9882V18.4047V18.5223C9.92822%2018.5493%209.91582%2018.5762%209.89598%2018.5958C9.87613%2018.6154%209.85133%2018.6228%209.82404%2018.6228C9.43461%2018.6032%209.21137%2018.5027%209.0303%2018.3973C8.89883%2018.3214%208.50692%2018.0862%208.50444%2018.0862C8.25887%2017.9392%207.98106%2017.8583%207.69581%2017.8363V16.9788C7.92897%2017.0008%208.15718%2017.0694%208.36057%2017.1895L8.7004%2017.3904C9.07246%2017.6109%209.49662%2017.7358%209.92822%2017.7603V17.9882ZM13.2868%2016.4275C13.2272%2016.4251%2013.1652%2016.4153%2013.1057%2016.3981L12.6443%2016.2609C12.5451%2016.2315%2012.4434%2016.2217%2012.3417%2016.2217V15.3667C12.4161%2015.3667%2012.4905%2015.374%2012.5649%2015.3961L13.0263%2015.5308C13.1107%2015.5553%2013.1999%2015.5676%2013.2868%2015.5725V16.4275ZM16.1765%2016.6333C16.0872%2016.4275%2015.9111%2016.2634%2015.6854%2016.2021L15.2438%2016.0796C15.1397%2016.0478%2015.0305%2016.0355%2014.9214%2016.0355V15.1829C15.0057%2015.1804%2015.0901%2015.1902%2015.1719%2015.2172L15.5341%2015.3299C15.9185%2015.45%2016.1765%2015.7979%2016.1765%2016.1948V16.6333ZM17.449%2018.1474C17.4415%2018.1719%2017.4366%2018.1964%2017.4291%2018.2209C17.3522%2018.4611%2017.129%2018.6203%2016.876%2018.6203C16.8537%2018.6203%2016.8313%2018.6154%2016.809%2018.613V17.7628C16.8264%2017.7652%2016.8413%2017.7677%2016.8586%2017.7677C17.1067%2017.7677%2017.3324%2017.6305%2017.4515%2017.4222V18.1474H17.449ZM19.8302%207.48242C19.5524%207.87933%2019.4061%208.34484%2019.4061%208.82749V9.2489L19.1903%209.5576C18.91%209.95696%2018.7611%2010.4249%2018.7611%2010.91V13.0342C18.7611%2013.3772%2018.6173%2013.7129%2018.3643%2013.9481L17.9103%2014.3744C17.6052%2014.661%2017.4366%2015.0628%2017.449%2015.4794L17.4515%2015.5749C17.4688%2016.1262%2017.3969%2016.675%2017.2406%2017.2042C17.191%2017.3732%2017.0323%2017.4908%2016.8561%2017.4908C16.6354%2017.4908%2016.4543%2017.3144%2016.4543%2017.0939V16.1948C16.4543%2015.6754%2016.117%2015.2221%2015.6159%2015.0677L15.2538%2014.955C15.0528%2014.8938%2014.842%2014.8913%2014.6386%2014.9501L13.5472%2015.2686C13.4033%2015.3103%2013.2496%2015.3103%2013.1057%2015.2686L12.6443%2015.1339C12.4062%2015.0628%2012.1482%2015.08%2011.92%2015.178L10.9502%2015.5994C10.3301%2015.8689%209.9307%2016.4741%209.9307%2017.1429V17.4884C9.54871%2017.4663%209.17664%2017.3536%208.84674%2017.1576L8.50692%2016.9567C8.21919%2016.7877%207.89177%2016.697%207.5569%2016.697H6.78548L6.21498%2016.381C5.94461%2016.2315%205.63951%2016.1531%205.32945%2016.1507L4.23805%2016.1433L2.98542%2015.4916C1.08539%2014.5042%200.274278%2012.2821%201.10027%2010.322L1.3508%209.72666C1.53683%209.28565%201.63357%208.81769%201.63357%208.33749V8.00428H1.90394C2.17183%208.00428%202.40003%207.82053%202.46204%207.57307H11.8481C12.0044%207.57307%2012.1482%207.66372%2012.2102%207.80583L12.4905%208.42569C12.5798%208.62414%2012.7783%208.75154%2012.999%208.75154C13.2173%208.75154%2013.4182%208.62414%2013.5075%208.42569L13.7878%207.80338C13.8523%207.66127%2013.9937%207.57062%2014.15%207.57062H14.4873C14.6337%207.57062%2014.7676%207.64902%2014.837%207.77643C15.0082%208.09003%2015.3158%208.30074%2015.6655%208.35709V12.2575C15.1025%2012.3188%2014.6709%2012.6496%2014.6709%2013.0514C14.6709%2013.4973%2015.1967%2013.8574%2015.8466%2013.8574C16.4965%2013.8574%2017.0223%2013.4973%2017.0223%2013.0514C17.0223%2012.6496%2016.5907%2012.3163%2016.0277%2012.2575V8.35464C16.3774%208.29828%2016.685%208.08758%2016.8561%207.77398C16.9256%207.64657%2017.0595%207.56817%2017.2059%207.56817H17.7069C17.9376%207.56817%2018.1485%207.45302%2018.275%207.26192L19.0191%206.12755C19.1158%205.9781%2019.282%205.8899%2019.4631%205.8899H19.6938C19.8575%205.8899%2019.9914%206.0222%2019.9914%206.1839V6.53426C19.9914%206.70331%2020.0584%206.86501%2020.175%206.98506L19.8302%207.48242ZM15.663%2012.8554V13.6296C15.3579%2013.583%2015.1322%2013.4287%2015.1322%2013.2425C15.1322%2013.0563%2015.3579%2012.8995%2015.663%2012.8554Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M43.6355%2014.2212L45.783%206.63627C46.0175%205.80901%2046.629%205.14498%2047.4288%204.848L47.4874%204.60107H44.5028L39.434%2010.6989L37.4942%204.60107H34.7636L34.6978%204.848C35.1653%205.08213%2035.423%205.78176%2035.423%206.35097V6.38628C35.423%209.63469%2033.0443%2015.2183%2029.6984%2015.2183C28.3982%2015.2183%2027.7242%2014.2901%2027.7242%2013.5165C27.7242%2012.5794%2028.5003%2011.9129%2029.3191%2011.9129C30.112%2011.9129%2030.2342%2012.211%2030.6909%2012.211C30.9696%2012.211%2031.2366%2012.0667%2031.3701%2011.8195C31.5797%2011.4313%2031.4208%2010.9572%2031.0376%2010.7714L30.8283%2010.6705C28.8775%209.72228%2026.6152%2011.1582%2026.6152%2013.3453V13.3756C26.6152%2014.9675%2027.8525%2016.2989%2029.4275%2016.3545C33.4867%2016.4983%2036.2019%2010.9661%2036.6338%206.91684L36.9458%208.01243L38.5448%2012.8545H39.1504L44.1452%206.83425L42.0498%2014.229C41.8094%2015.0773%2041.1437%2015.7344%2040.2985%2015.958L40.2399%2016.2049H44.2561L44.3216%2015.958C43.7283%2015.6043%2043.4461%2014.8902%2043.6355%2014.2212Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M51.9847%2012.6335H50.0625C50.2808%2012.034%2050.4898%2011.4617%2050.5603%2011.2743C51.0465%209.97682%2051.971%209.45183%2052.8665%209.37842L52.8572%209.3862L51.9847%2012.6335ZM53.7159%208.72607H53.6817C51.8071%208.7283%2049.7916%208.91155%2048.719%2011.9903C47.8179%2014.5767%2047.5745%2015.6481%2046.8705%2015.6481C46.4204%2015.6481%2046.5297%2014.763%2045.8549%2014.763C45.5509%2014.763%2045.2332%2015.0093%2045.2104%2015.3661C45.1705%2015.9826%2045.9909%2016.3555%2046.6092%2016.3555C48.4929%2016.3555%2049.2148%2014.9671%2049.4505%2014.3203C49.481%2014.2358%2049.6473%2013.778%2049.8436%2013.2386H51.8231L51.4878%2014.4866C51.3107%2015.145%2050.9465%2015.6839%2050.3304%2015.9595L50.2772%2016.2062H53.5154L53.5755%2015.9595C53.1372%2015.5941%2052.9469%2015.0082%2053.089%2014.4627L54.3075%209.78302C54.4011%209.42403%2054.6472%209.12789%2054.9809%208.973L55.0338%208.72607H53.9785H53.7159Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M70.056%209.26026C70.1601%209.08619%2070.2595%208.82035%2070.2595%208.67186L70.2597%208.67103C70.2741%208.39018%2070.0208%208.17273%2069.7488%208.23196H69.7482C69.5304%208.27951%2069.373%208.47499%2069.3771%208.70023C69.3807%208.93436%2069.3341%209.18574%2069.2353%209.30836C69.0082%209.59116%2068.645%209.56697%2066.9717%209.08174V9.07896C66.8186%209.03363%2066.6504%208.98414%2066.4731%208.93492C66.4637%208.93241%2066.4549%208.92963%2066.4453%208.92657L66.4456%208.92741C65.6106%208.698%2064.5732%208.4875%2063.8929%208.82869C63.8874%208.83148%2063.8816%208.83453%2063.8764%208.83704C63.2118%209.17406%2062.7479%209.81223%2062.6086%2010.5502C62.5879%2010.6587%2062.5728%2010.7468%2062.5711%2010.7788V10.7799C62.5513%2011.1675%2062.9009%2011.4679%2063.2767%2011.3864L63.2773%2011.3858C63.5821%2011.3196%2063.7965%2011.0441%2063.7902%2010.7296C63.7836%2010.4117%2063.7205%209.98741%2063.8918%209.70267C64.1674%209.31059%2064.4537%209.28278%2065.7361%209.71462L64.3436%2014.4877C64.1514%2015.1456%2063.6812%2015.6848%2063.059%2015.9601L63.0001%2016.2073H66.3319L66.3977%2015.9601C65.9679%2015.595%2065.7906%2015.0088%2065.9453%2014.4635L67.1628%2010.1637C67.6969%2010.276%2068.2381%2010.305%2068.7651%2010.1531L68.9548%2010.0986C69.3787%209.97629%2069.8129%209.6668%2070.056%209.26026Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M71.3889%208.72607L71.3234%208.97328C71.736%209.26108%2071.9219%209.78079%2071.7886%2010.2671L70.5506%2014.4816C70.3584%2015.14%2069.8882%2015.6789%2069.2659%2015.9542L69.207%2016.2011H70.9696H71.1306H75.1868L75.7226%2014.2252H75.4709L75.3806%2014.4145C75.0447%2015.1206%2074.3372%2015.5699%2073.5614%2015.5699H71.8415L72.7572%2012.2623L73.4878%2012.2615C73.9807%2012.2612%2074.3512%2012.7153%2074.2568%2013.2036H74.5084L75.1094%2010.9679H74.8578C74.7122%2011.3814%2074.3253%2011.6578%2073.8904%2011.658L72.9243%2011.6592L73.5597%209.36341L75.3825%209.36202C75.9775%209.36146%2076.4229%209.9126%2076.304%2010.5015H76.5556L77.033%208.72607H71.3889Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M82.8655%2010.5324C82.6668%2011.2028%2082.0564%2011.6627%2081.3632%2011.6627L80.3076%2011.6636L80.9466%209.36726L82.0055%209.3667C82.6067%209.36642%2083.0379%209.9512%2082.8655%2010.5324ZM82.7978%208.72998H78.7711L78.7053%208.97691C79.0919%209.24636%2079.2791%209.71935%2079.1921%2010.1779L77.9311%2014.4846C77.739%2015.1431%2077.269%2015.682%2076.6465%2015.9573L76.5879%2016.2048H79.9164L79.9822%2015.9573C79.5524%2015.5922%2079.3754%2015.006%2079.5296%2014.4607L80.14%2012.2662H80.3944C80.7787%2012.2665%2081.1014%2012.5584%2081.1438%2012.9444C81.1578%2013.069%2081.3505%2014.5947%2081.5044%2015.1195C81.7059%2015.8052%2081.9705%2016.205%2082.5729%2016.205H84.0788L84.1375%2015.9578L83.9219%2015.8288C83.4966%2015.5738%2083.1885%2015.1773%2083.0508%2014.6531C82.9203%2014.1585%2082.677%2013.2372%2082.5578%2012.7495C82.4961%2012.4981%2082.1866%2012.2654%2081.8667%2012.2654L82.3741%2012.2651C83.284%2012.2645%2084.0827%2011.6525%2084.328%2010.7671C84.611%209.74382%2083.8495%208.72998%2082.7978%208.72998Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M60.6842%209.10931C60.576%209.10931%2060.3431%209.03478%2059.9858%208.88463C59.6281%208.73447%2059.2669%208.65967%2058.9027%208.65967C58.1467%208.65967%2057.5157%208.90687%2056.9997%209.4352C56.5703%209.87483%2056.3795%2010.3628%2056.3795%2010.7852C56.3795%2011.2349%2056.6399%2011.7635%2057.1616%2012.1909C57.6542%2012.5949%2058.1668%2012.982%2058.68%2013.3771C59.2196%2013.8134%2059.4897%2014.2158%2059.4897%2014.5431C59.4897%2015.2616%2059.0269%2015.6481%2058.0688%2015.6481C57.0953%2015.6481%2056.4221%2014.9276%2056.2063%2013.5782H55.9431L55.1777%2016.2045H55.4203C55.7366%2015.9807%2055.9615%2015.8366%2056.4202%2015.8366C56.858%2015.8366%2057.3257%2016.3558%2058.3229%2016.3558C59.1191%2016.3558%2059.7493%2016.189%2060.2892%2015.6434C60.7481%2015.1668%2060.9775%2014.4994%2060.9775%2013.9538C60.9775%2013.4494%2060.6644%2012.8613%2060.1174%2012.4375C59.648%2012.0741%2059.1453%2011.7496%2058.6596%2011.3948C58.1332%2010.9993%2057.87%2010.6637%2057.87%2010.2956C57.87%2010.0906%2057.9713%209.88651%2058.174%209.68213C58.43%209.42325%2058.773%209.36596%2059.232%209.36596C60.1529%209.36596%2060.7974%209.88429%2060.8516%2010.9746H61.0945L61.7368%208.65967H61.4939C61.2373%208.95971%2060.9675%209.10931%2060.6842%209.10931Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M89.1717%209.36569C90.0926%209.36569%2090.7374%209.88401%2090.7914%2010.9743H91.0345L91.6765%208.65967H91.4334C91.1771%208.95915%2090.9075%209.10903%2090.6237%209.10903C90.5158%209.10903%2090.2829%209.03423%2089.9252%208.88435C89.5676%208.73447%2089.2067%208.65967%2088.8422%208.65967C88.0864%208.65967%2087.4554%208.90687%2086.9395%209.43493C86.51%209.87455%2086.3192%2010.3628%2086.3192%2010.785C86.3192%2011.2351%2086.5796%2011.7629%2087.1014%2012.1909C87.5939%2012.5949%2088.1065%2012.9817%2088.6197%2013.3768C89.159%2013.8134%2089.4294%2014.2158%2089.4294%2014.5428C89.4294%2015.2613%2088.9666%2015.6478%2088.0085%2015.6478C87.035%2015.6478%2086.3619%2014.9274%2086.1458%2013.5782H85.8826L85.1172%2016.2045H85.3603C85.6763%2015.9807%2085.9013%2015.8366%2086.3597%2015.8366C86.7977%2015.8366%2087.2652%2016.3558%2088.2626%2016.3558C89.0588%2016.3558%2089.689%2016.1884%2090.2289%2015.6434C90.6878%2015.1662%2090.9172%2014.4991%2090.9172%2013.9538C90.9172%2013.4494%2090.6041%2012.8613%2090.0574%2012.4375C89.5877%2012.0738%2089.0853%2011.7493%2088.5996%2011.3945C88.0729%2010.9993%2087.8097%2010.6632%2087.8097%2010.295C87.8097%2010.0909%2087.911%209.88623%2088.1134%209.68185C88.3697%209.42297%2088.7128%209.36569%2089.1717%209.36569Z'%20fill='%23006747'/%3e%3c/svg%3e",I=[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",tagline:"Featured groups+ experience",headline:r.jsxs(r.Fragment,{children:["Welcome to ",r.jsx("br",{})," Featured Groups +"]})},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",headline:"Get real-time insights"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_3.png",headline:"Predictions, trivia & polls synced to match play"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_4.png",headline:"Win points for every answer you get right"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",headline:"Compete against friends on the leaderboard"}],I2=s.styled_default("div")({name:"OnboardingContainer",class:"on59ra",propsAsIs:!1}),R2=()=>s.f,x2=s.styled_default(R2())({name:"OnboardingNotificationContainer",class:"op1wk5d",propsAsIs:!0}),k=s.styled_default("div")({name:"InnerContainer",class:"i1i1g2vj",propsAsIs:!1}),A2=({deepLink:t,onboardingOpts:e,notification:n,gamification:o,loading:i,sdk:l})=>{var a,C,p,c,u,f,S;const m=s.useStore(o.friends.getStore()),[g,N]=d.useState(void 0),y=d.useMemo(()=>{var v,E;const x=l.getInviter();return x?(E=(v=m.data)==null?void 0:v.find(({slId:w})=>w===x))==null?void 0:E.name:""},[m.data,l]);return d.useEffect(()=>{const v=t.$store.subscribe(E=>{E&&N(E.data)});return()=>{v()}},[t.$store]),r.jsx(I2,{children:r.jsx(s.rn,{loading:i,rules:[{label:"Answer as many questions as you like.",icon:"icon-btn-feature-groups"},{label:"Win points for each correct trivia or prediction answer.",icon:"icon-thumb-up"},{label:"Top the leader board and best your friends.",icon:"icon-trophy"}],rulesBtnLabel:(a=e.rules)==null?void 0:a.buttonLabel,rulesTitle:(C=e.rules)==null?void 0:C.heading,termsTitle:"Terms and Conditions",termsText:(p=e.rules)==null?void 0:p.terms,steps:I,primaryColor:(c=e.inviteCard)==null?void 0:c.iconColor,inviteLink:g,inviteCardTitle:(u=e.inviteCard)==null?void 0:u.heading,inviteCardSubtext:(f=e.inviteCard)==null?void 0:f.subtext,inviteCardBtnLabel:(S=e.inviteCard)==null?void 0:S.buttonLabel,onClose:()=>{var v;(v=n.close)==null||v.call(n)},gamification:o,sdk:l,inviterName:y})})},k2=({sdk:t,notification:e,saveHeight:n,style:o,appNode:i,sdkInDesktopView:l,responsiveStore:a})=>{var C;const p=d.useRef(null),c=e.data.onboarding,[u,f]=d.useState(c==null?void 0:c.instantOpen),S=t.getFeature(L.SdkOverlayType.GAMES),m=d.useMemo(()=>I==null?void 0:I.map(({graphicSrc:v})=>v),[]),{screen:g}=s.useStore(a,{keys:["screen"]});(C=c==null?void 0:c.titleCard)!=null&&C.media&&(c.titleCard.media.sponsorLogo=T2),d.useLayoutEffect(()=>{var v;n(((v=p.current)==null?void 0:v.getBoundingClientRect().height)||0)},[n]);const{loading:N,throttled:y}=s.I(m);return u&&S&&c&&i.current&&!y?r.jsx(s.x,{container:i,useContainer:!l,children:r.jsx(A2,{notification:e,setOpened:f,gamification:S,onboardingOpts:c,deepLink:S.deepLink,loading:N,sdk:t})}):r.jsxs(r.Fragment,{children:[r.jsx(k,{ref:p,style:{position:"absolute",visibility:"hidden"},children:r.jsx(A,{close:()=>{},action:()=>{},onboarding:c})}),r.jsx(x2,{style:o,hiding:e.hiding,children:r.jsx(k,{children:r.jsx(A,{close:e.close,action:()=>{var v;f(!0),(((v=i.current)==null?void 0:v.getBoundingClientRect().y)||0)<0&&O(i,g.size,{behavior:"smooth"})},onboarding:c})})})]})},j2=()=>s.f,D2=s.styled_default(j2())({name:"Container",class:"c1f0y7nw",propsAsIs:!0}),V=s.styled_default("div")({name:"InnerContainer",class:"i1qa3p7a",propsAsIs:!1}),b2=()=>V,O2=s.styled_default(b2())({name:"HiddenContainer",class:"hrthymv",propsAsIs:!0}),F2=s.styled_default("div")({name:"NotificationRefreshing",class:"n13rok4i",propsAsIs:!1}),V2=()=>s.h$2,w2=s.styled_default(V2())({name:"Pill",class:"pht79xf",propsAsIs:!0}),B2=t=>{const[e,n]=d.useState(0),o=d.useRef(null),i=d.useCallback(a=>{o.current=a},[]);d.useEffect(()=>{var a;const C=(a=o.current)==null?void 0:a.getBoundingClientRect();C&&n(C.height)},[t]);const l=d.useCallback(a=>{n(a)},[]);return[i,e,l]},P2=({sdk:t,notification:e,appNode:n,responsiveStore:o})=>{var i,l;const{sdkInDesktopView:a}=s.useStore(o,{keys:["sdkInDesktopView"]}),{sdk:C}=R(),[p,c,u]=B2(e.id);return e.type===s.NotificationType.QUESTION?r.jsxs(r.Fragment,{children:[r.jsx(O2,{ref:p,children:r.jsx(s.w,{...e})}),r.jsxs(D2,{style:{height:e.hiding?0:c},hiding:e.hiding,children:[r.jsx(V,{style:{height:"100%"},children:r.jsx(s.w,{...e,controlVideo:C==null?void 0:C.controlVideoPlayer})}),r.jsx(F2,{},e.id)]})]}):e.type===s.NotificationType.QUESTION_RESOLVED&&(l=(i=e.data)==null?void 0:i.question)!=null&&l.predictionResult?r.jsx(s.z$2,{style:{height:e.hiding?0:c},saveHeight:u,close:e.close,hiding:e.hiding,...e.data.question,mastersApp:!0}):e.type===s.NotificationType.ONBOARDING?r.jsx(k2,{style:{height:e.hiding?0:c},saveHeight:u,sdk:t,notification:e,sdkInDesktopView:a,appNode:n,responsiveStore:o}):null},H2="p1co32q0",$2=({pill:t,setPill:e,appNode:n,headerNode:o,scrollNode:i,responsiveStore:l,scrollStore:a})=>{var C,p;const{screen:c}=s.useStore(l,{keys:["screen"]}),{tabsShown:u,scrollPosition:f}=s.useStore(a,{keys:["tabsShown","scrollPosition"]});d.useEffect(()=>{l.get().sdkInDesktopView?f<50&&e(null):f>-50&&e(null)},[f,l,e]);const S=l.get().sdkInDesktopView?n:o;return!t||!S.current?null:s.Df.createPortal(r.jsx(w2,{title:t.type===s.NotificationType.QUESTION_RESOLVED?"Prediction result":`New ${((p=s.e[(C=t.data)==null?void 0:C.questionType])==null?void 0:p.label)||"notification"}`,onClick:()=>{var m;l.get().sdkInDesktopView?(m=i.current)==null||m.scrollTo({top:0,behavior:"smooth"}):O(n,c.size,{behavior:"smooth"}),e(null)},className:s.cx_default(u&&H2,"sl-pill-button")}),S.current)},M2=({sdk:t,headerNode:e,scrollNode:n,responsiveStore:o,appNode:i,scrollStore:l})=>{const[a]=d.useState(t.getNotificationsStore()),C=s.useStore(a),[p,c]=d.useState(null),u=d.useMemo(()=>t.getActiveNotification(),[t,C]);return d.useEffect(()=>{u&&s.eventBus.emit("notification",{action:"rendered",payload:{questionId:u.data.questionId,questionType:u.data.questionType}})},[u]),d.useEffect(()=>{u&&(o.get().sdkInDesktopView||o.get().sdkInView)&&(!o.get().sdkInDesktopView&&o.get().sdkInView&&c(u),o.get().sdkInDesktopView&&window.requestAnimationFrame(()=>{l.get().scrollPosition!==0&&c(u)}))},[u]),d.useEffect(()=>{u||c(null)},[u]),r.jsxs(r.Fragment,{children:[!p&&u&&r.jsx(P2,{headerNode:e,appNode:i,sdk:t,notification:u,responsiveStore:o}),p&&r.jsx($2,{pill:p,setPill:c,appNode:i,notification:u,headerNode:e,scrollNode:n,scrollStore:l,responsiveStore:o})]})},j=Object.keys(s.A),_=()=>{const t=window.innerWidth;let e="sm";for(let n=j.length-1;n>0;n--){const o=j[n];if(!(t<s.A[o])&&t>=s.A[o]){e=o;break}}return{name:e,size:s.A[e]}},D=t=>{var e;return(((e=t.current)==null?void 0:e.getBoundingClientRect().y)||0)<-68},h=t=>t>=s.A.xl,U2=t=>{const[e]=d.useState(()=>{const n=_();return s.v({screen:_(),sdkInView:D(t),sdkInDesktopView:h(n.size)})});return d.useEffect(()=>{const n=s.A$1(()=>{e.setKey("sdkInView",D(t))},200),o=s.A$1(()=>{const i=_();e.setKey("screen",i),e.setKey("sdkInDesktopView",h(i.size))},200);return window.addEventListener("scroll",n),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",n),window.removeEventListener("resize",o)}},[e,t]),[e]},G2={...s.R,BG_TRANSPARENT:"rgba(0,0,0, .8)",BLUE_QUESTION_ACTION_BTN:"#1589ee",WHITE:"#FFFFFF",BLUE:"#2d6ffd",GREY_PRIMARY_ONBOARDING_INAPP:"#B5B7B8",GREY_PRIMARY:"#909395",PRIMARY_1:"#107D57",PRIMARY_2:"#006747",PRIMARY_TEXT:"#25282A",QUESTION_TYPE_ICON:"#107D57",SUCCESS:"#107D57",UNSUCCESS:"#DF2F3B",SECONDARY_RED1:"#DF2F3B",NEUTRALS_WHITE:"#FFFFFF",NEUTRALS_WHITE1:"#FFFFFF",NEUTRALS_GRAY1:"#F7F7F7",NEUTRALS_GRAY2:"#F2F2F1",NEUTRALS_GRAY3:"#E8E8E8",NEUTRALS_GRAY4:"#D9D9D6",NEUTRALS_GRAY5:"#B1B3B3",NEUTRALS_GRAY6:"#888B8D",NEUTRALS_GRAY7:"#6B6F73",NEUTRALS_GRAY9:"#25282A",SDK_CONTAINER_BG:"#F7F7F7",SDK_WHITE_CONTAINER_BG:"#fff",SDK_DARK_CONTAINER_BG:"#fff",SDK_PREDICTION_RESULT_SUCCESS_BG:"#fff",SDK_PREDICTION_RESULT_INCORRECT_BG:"#fff",SDK_PREDICTION_RESULT_SUCCESS_TEXT:"#107D57",SDK_PREDICTION_RESULT_ERROR_TITLE:"#090E13",SDK_PREDICTION_RESULT_ERROR_SUBTITLE:"#DF2F3B",SDK_PREDICTION_RESULT_CLOSE_ICON:"#6B6F73",SDK_PREDICTION_FEEDBACK_SUCCESS_ICON:"#107D57",SDK_PREDICTION_FEEDBACK_INCORRECT_RECT1:"#CD2525",SDK_PREDICTION_FEEDBACK_INCORRECT_RECT2:"#fff",PREDICTION_BG_LINES_CORRECT:"#01AB58",PREDICTION_BG_LINES_INCORRECT:"#888B8D",SKELETON_COLOR_1:"#f1efef",SKELETON_COLOR_2:"#f9f8f8",TABS_CONTAINER_BG:"#F2F2F1",TABS_ACTIVE_BG:"#FFFFFF",TABS_COLOR:"#6B6F73",TABS_ACTIVE_COLOR:"#107D57",CARD_BG:"#FFFFFF",CARD_BORDER:"#fff",BORDER:"#E8E8E8",VOTE_BTN_BG:"#F7F7F7",VOTE_BTN_BORDER:"rgb(232, 232, 232)",VOTE_BTN_DISABLED_BORDER:"#B1B3B3",VOTE_BTN_SELECTED_BORDER:"#25282A",VOTE_BTN_NOT_SELECTED_BORDER:"#E8E8E8",VOTE_BTN_SELECTED_BG:"#FFFFFF",VOTE_BTN_NOT_SELECTED_BG:"#FFFFFF",VOTE_BTN_NOT_SELECTED_BG_UNSET:"rgb(196, 196, 196)",VOTED_ANSWER_BG:"rgba(16, 125, 87, 0.10)",VOTED_BTN_RCT_BG:"rgba(16, 125, 87, 0.30)",IN_APP_BG:"rgba(255, 255, 255, 0.90)",IN_APP_QUESTION_TYPE_ICON:"#1D7BFF",IN_APP_QUESTION_TYPE_LABEL:"#82899E",IN_APP_QUESTION_QUOTE:"rgba(10, 14, 19, 0.70)",IN_APP_QUESTION_RESULT_SUBTITLE_BG:"#1D7BFF",IN_APP_QUESTION_RESULT_LINE:"#babfc5"};Object.entries(G2).reduce((t,[e,n])=>`
|
|
2
|
-
${
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),t=require("./provider.js"),a=require("react"),B=require("./index2.js"),L=require("./useStreamLayerApp2.js"),P=t.styled_default("div")({name:"SDKContainer",class:"s8zgqze",propsAsIs:!1}),H=t.styled_default("div")({name:"SDKScrollContainer",class:"s6t897k",propsAsIs:!1}),b=t.styled_default("div")({name:"SDKContentContainer",class:"sw7pkvp",propsAsIs:!1}),$=()=>b,M=t.styled_default($())({name:"SDKWhiteContainer",class:"s14gkn7u",propsAsIs:!0}),U=t.styled_default("div")({name:"TabsContainer",class:"t1yxstm9",propsAsIs:!1}),G=t.styled_default("div")({name:"UserSummaryContainer",class:"udpty1s",propsAsIs:!1}),O=(s,e,n)=>{const o=e>=t.A.lg&&e<t.A.xl?75:52;s.current&&window.scrollTo({top:s.current.offsetTop-o,...n})},K=15,Q=(s,e)=>{const n=a.useRef(null),o=a.useRef(0),[i]=a.useState(t.i({scrollPosition:0,tabsShown:!0,scrollDirection:"forward"})),d=t.useStore(e);return a.useEffect(()=>{const l=window.innerWidth<t.A.lg?window:n.current;if(!l)return()=>{};const u=t.x(c=>{var p;const C=c.target;if(!C)return;let f=0;d.screen.size<t.A.lg?f=((p=s.current)==null?void 0:p.getBoundingClientRect().y)||0:f=C.scrollTop;const v=o.current-f;if(K>Math.abs(v))return;const S=o.current<f?"forward":"backward";o.current=f,i.set({scrollPosition:Math.round(f),scrollDirection:S,tabsShown:i.get().tabsShown})},200);return l.addEventListener("scroll",u),()=>{l.removeEventListener("scroll",u)}},[i,s,d.screen]),[n,i]},T=t.styled_default("div")({name:"LoadingContainer",class:"l7wseip",propsAsIs:!1}),q=({feature:s,sdk:e,children:n,className:o,noWait:i})=>{const d=t.useStore(s.status),l=t.useStore(e.sdkStore.slStreamId);if(!i){if(l!=null&&l.loading&&!l.data)return r.jsx(T,{className:o,children:"Event is loading..."});if(!(l!=null&&l.data))return r.jsx(T,{className:o,children:"Event is forbidden..."});if(d!==t.FeatureStatus.Ready)return r.jsx(T,{className:o,children:"Wait feature..."})}return n},F=a.createContext({sdk:null}),R=()=>a.useContext(F),z=t.styled_default("div")({name:"QuestionContainer",class:"qwgkhsv",propsAsIs:!1}),Z=({openedQuestion:s})=>{var e,n;const{sdk:o}=R();return((e=s==null?void 0:s.attributes)==null?void 0:e.attributes.case)==="insight"?r.jsx(t.p,{...s.attributes.attributes.value,controlVideo:o==null?void 0:o.controlVideoPlayer}):((n=s==null?void 0:s.attributes)==null?void 0:n.attributes.case)==="tweet"?r.jsx(t.a,{...s.attributes.attributes.value,controlVideo:o==null?void 0:o.controlVideoPlayer}):null},Y=({extendedQuestion:s,vote:e,close:n})=>{const{loading:o,data:i}=s;return i?r.jsx(t.Ft,{vote:e,close:n,openedQuestion:i,isLoading:!!o}):r.jsx(t.Ht,{})},W=({gamification:s})=>{var e;const n=t.useStore(s.openedQuestion.$store),o=t.useStore(s.openedQuestion.$extendedStore);if(!n)return null;const i=n.type;return r.jsxs(z,{children:[r.jsx(t.b,{close:s.closeQuestion,type:((e=n.attributes)==null?void 0:e.type)||L.QuestionType.UNSET}),i==="question"&&r.jsx(Y,{vote:s.submitAnswer,close:s.closeQuestion,extendedQuestion:o}),i!=="question"&&r.jsx(Z,{openedQuestion:n}),r.jsx(t.i$1,{mastersApp:!0})]})},X=({store:s,openQuestion:e})=>{const{sdk:n}=R(),o=t.useStore(s);return r.jsx(t.k,{openQuestion:e,questions:o.data,controlVideo:n==null?void 0:n.controlVideoPlayer})},J=({userSummary:s})=>{var e;const n=t.useStore(s.$store);return r.jsx(t.z$1,{hideFriendsRank:!0,loading:!(n!=null&&n.summary),...n==null?void 0:n.summary,successRate:(e=n==null?void 0:n.percentage)==null?void 0:e.correct})},e2=({gamification:s,className:e,style:n})=>r.jsxs(U,{className:e,style:n,children:[r.jsx(M,{style:{paddingTop:"8px"},children:r.jsx(G,{children:r.jsx(J,{userSummary:s.userSummary})})}),r.jsx(b,{style:{flex:1},children:r.jsx(X,{openQuestion:s.openQuestion,store:s.feedList.getStore()})})]}),s2=()=>t.f,t2=t.styled_default(s2())({name:"OpenedContainer",class:"o1seszvt",propsAsIs:!0}),n2=({gamification:s,className:e})=>r.jsx(e2,{className:e,gamification:s}),r2=({gamification:s,responsiveStore:e,className:n,appNode:o})=>{const i=t.useStore(s.openedQuestion.$store),{sdkInDesktopView:d}=t.useStore(e,{keys:["sdkInDesktopView"]}),{hiding:l,onAnimationEnd:u}=t.S();return!o.current||!i?null:r.jsx(t.g,{container:o,useContainer:!d,children:r.jsx(t2,{className:n,hiding:l,onAnimationEnd:u,children:r.jsx(W,{gamification:s})})})},o2=a.lazy(()=>Promise.resolve().then(()=>require("./gamification-feature2.js"))),i2=({sdk:s,feature:e,className:n})=>{const o=a.useMemo(()=>e&&e.featureConfig.get().type===L.SdkOverlayType.GAMES?r.jsx(q,{className:n,sdk:s,feature:e,children:r.jsx(o2,{className:n,gamification:e})}):null,[s,e,n]);return r.jsx(a.Suspense,{fallback:r.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"page loading..."}),children:o})},l2=({feature:s,className:e,appNode:n,responsiveStore:o})=>s&&s.featureConfig.get().type===L.SdkOverlayType.GAMES?r.jsx(r2,{responsiveStore:o,className:e,appNode:n,gamification:s}):null,a2=t.styled_default("div")({name:"Navigation",class:"n1o1tw60",propsAsIs:!1}),d2=t.styled_default("div")({name:"Container",class:"co2rstw",propsAsIs:!1}),c2=t.styled_default("div")({name:"Title",class:"t1bqnx9c",propsAsIs:!1}),u2="hlc2pcy",C2=a.forwardRef(({className:s},e)=>r.jsxs(a2,{className:t.cx_default(s,u2),children:[r.jsx(d2,{children:r.jsxs(c2,{children:[r.jsx(t.k1,{name:"fgIcon"}),"FG+ Game Center"," "]})}),r.jsx("div",{ref:e})]})),p2=t.styled_default("div")({name:"Container",class:"czz4rjk",propsAsIs:!1}),f2=t.styled_default("div")({name:"CloseIconWrap",class:"cxmojsy",propsAsIs:!1}),v2=()=>t.k1,S2=t.styled_default(v2())({name:"CloseIcon",class:"c1urm3yx",propsAsIs:!0}),m2=t.styled_default("div")({name:"Title",class:"tme976v",propsAsIs:!1}),E2=t.styled_default("img")({name:"SponsorLogo",class:"s1lal9yz",propsAsIs:!1}),L2=t.styled_default("div")({name:"PresentsTitle",class:"pnn1sv1",propsAsIs:!1}),_2=t.styled_default("div")({name:"Subtitle",class:"s1hjj1y8",propsAsIs:!1}),h2=t.styled_default("div")({name:"Description",class:"dz7yjzw",propsAsIs:!1}),g2=t.styled_default("button")({name:"ActionButton",class:"avpowqk",propsAsIs:!1}),A=({close:s,action:e,onboarding:n})=>{var o,i,d,l,u,c,p,C;return r.jsxs(p2,{children:[r.jsx(f2,{onClick:s,children:r.jsx(S2,{name:"icon-cross"})}),((i=(o=n==null?void 0:n.titleCard)==null?void 0:o.media)==null?void 0:i.sponsorLogo)&&r.jsxs(m2,{children:[r.jsx(E2,{alt:"sponsor-logo",src:(l=(d=n==null?void 0:n.titleCard)==null?void 0:d.media)==null?void 0:l.sponsorLogo}),r.jsx(L2,{children:"PRESENTS"})]}),((u=n==null?void 0:n.titleCard)==null?void 0:u.title)&&r.jsx(_2,{children:(c=n==null?void 0:n.titleCard)==null?void 0:c.title}),((p=n==null?void 0:n.titleCard)==null?void 0:p.subtitle)&&r.jsx(h2,{children:(C=n==null?void 0:n.titleCard)==null?void 0:C.subtitle}),r.jsx(g2,{onClick:e,children:"Play Now"})]})},N2="data:image/svg+xml,%3csvg%20width='92'%20height='19'%20viewBox='0%200%2092%2019'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.1701%200.953996C13.9047%200.873145%2013.6393%201.0177%2013.3739%201.1647C13.2797%201.21615%2013.2127%201.3068%2013.1904%201.4097L12.7736%203.33298C12.7588%203.40404%2012.8233%203.46774%2012.8952%203.45304C13.3342%203.35504%2013.7509%202.97528%2014.19%203.10758C14.6811%203.25703%2015.1722%202.64207%2015.6634%202.64942V0.429688C15.1698%200.432138%2014.6613%201.10345%2014.1701%200.953996Z'%20fill='%23006747'/%3e%3cpath%20d='M20.4404%206.84786C20.3362%206.77681%2020.2717%206.66166%2020.2717%206.53671V6.18635C20.2717%205.87275%2020.0138%205.61549%2019.6938%205.61549H19.4631C19.1878%205.61549%2018.9348%205.75269%2018.7859%205.98055L18.0418%207.11492C17.9674%207.22762%2017.8434%207.29377%2017.7094%207.29377H17.2084C16.9603%207.29377%2016.7321%207.42852%2016.6131%207.64412C16.4915%207.86708%2016.2757%208.02143%2016.0302%208.07288V0.181303C16.0302%200.0808513%2015.9483%200%2015.8466%200C15.7449%200%2015.663%200.0808513%2015.663%200.181303V0.426307V2.64604V8.07778C15.4175%208.02633%2015.2017%207.87198%2015.0801%207.64657C14.9636%207.43097%2014.7354%207.29622%2014.4848%207.29622H14.1475C13.8796%207.29622%2013.639%207.45057%2013.5298%207.69312L13.2496%208.31299C13.2049%208.41099%2013.1057%208.47469%2012.9965%208.47469C12.8874%208.47469%2012.7882%208.41099%2012.7435%208.31299L12.4633%207.69312C12.3541%207.45302%2012.1135%207.29622%2011.8456%207.29622H2.33802C2.26113%207.29622%202.19911%207.35747%202.19911%207.43342C2.19911%207.59512%202.06517%207.72498%201.90394%207.72498H1.49218C1.41529%207.72498%201.35328%207.78623%201.35328%207.86218V8.33504C1.35328%208.77849%201.26646%209.2097%201.09283%209.61886L0.842303%2010.2142C0.60914%2010.7655%200.5%2011.3363%200.5%2011.8974V13.2694C0.5%2013.6394%200.55457%2014.0142%200.66371%2014.3793C0.968807%2015.4034%201.66334%2016.2413%202.61831%2016.7362L4.13883%2017.5276C4.15868%2017.5374%204.181%2017.5423%204.20332%2017.5423L5.32697%2017.5521C5.5899%2017.5545%205.84787%2017.6207%206.07855%2017.7481L6.6813%2018.0813C6.70115%2018.0935%206.72595%2018.0984%206.75076%2018.0984H7.5569C7.83968%2018.0984%208.11997%2018.1744%208.36057%2018.3189C8.36057%2018.3189%208.75497%2018.5566%208.88891%2018.6326C9.10223%2018.7551%209.3602%2018.8727%209.80916%2018.8972C9.91086%2018.9021%2010.0126%2018.8653%2010.0895%2018.7943C10.1639%2018.7232%2010.2085%2018.6228%2010.2085%2018.5223V17.9882C10.2085%2017.6011%2010.4392%2017.2483%2010.7989%2017.0939L12.0317%2016.5598C12.2003%2016.4863%2012.3888%2016.4741%2012.5649%2016.528L13.0263%2016.6627C13.2223%2016.7191%2013.4306%2016.7215%2013.6266%2016.6627L14.718%2016.3418C14.8619%2016.3001%2015.0156%2016.3001%2015.162%2016.3442L15.606%2016.4667C15.8119%2016.5231%2015.9582%2016.7142%2015.9582%2016.9249V17.9931C15.9582%2018.4905%2016.3675%2018.8972%2016.871%2018.8972C17.2481%2018.8972%2017.578%2018.6595%2017.6921%2018.3042C17.8979%2017.6648%2018.0021%2016.9984%2018.0021%2016.3271V15.8714C18.0021%2015.548%2018.1385%2015.2368%2018.3767%2015.0138L18.8306%2014.59C19.1357%2014.3033%2019.3118%2013.8966%2019.3118%2013.4801V10.9468C19.3118%2010.5548%2019.4309%2010.175%2019.6591%209.85161C19.6764%209.82956%2019.6839%209.80016%2019.6839%209.77321V9.1754C19.6839%208.78584%2019.8029%208.40854%2020.0262%208.08758L20.4751%207.44322C20.4925%207.42117%2020.4999%207.39422%2020.4999%207.36482V6.96056C20.5024%206.88461%2020.4553%206.85766%2020.4404%206.84786ZM16.0302%2012.8554C16.3352%2012.9019%2016.5634%2013.0563%2016.5634%2013.2425C16.5634%2013.4287%2016.3377%2013.583%2016.0302%2013.6296V12.8554ZM2.98046%2016.6137L2.74978%2016.4937C2.12222%2016.1678%201.62117%2015.6827%201.27886%2015.0922V14.3523C1.67078%2014.9134%202.20407%2015.3912%202.85644%2015.7317L2.98046%2015.7954V16.6137ZM4.14131%2017.2189L3.52616%2016.9004V16.0821L4.13883%2016.4006H4.14131V17.2189ZM6.70115%2017.775L6.21498%2017.5055C5.94957%2017.3585%205.65191%2017.2801%205.34682%2017.2752V16.4226C5.6023%2016.4275%205.85531%2016.4937%206.07855%2016.6162L6.6813%2016.9494C6.68626%2016.9518%206.6937%2016.9518%206.70115%2016.9543V17.775ZM9.92822%2017.9882V18.4047V18.5223C9.92822%2018.5493%209.91582%2018.5762%209.89598%2018.5958C9.87613%2018.6154%209.85133%2018.6228%209.82404%2018.6228C9.43461%2018.6032%209.21137%2018.5027%209.0303%2018.3973C8.89883%2018.3214%208.50692%2018.0862%208.50444%2018.0862C8.25887%2017.9392%207.98106%2017.8583%207.69581%2017.8363V16.9788C7.92897%2017.0008%208.15718%2017.0694%208.36057%2017.1895L8.7004%2017.3904C9.07246%2017.6109%209.49662%2017.7358%209.92822%2017.7603V17.9882ZM13.2868%2016.4275C13.2272%2016.4251%2013.1652%2016.4153%2013.1057%2016.3981L12.6443%2016.2609C12.5451%2016.2315%2012.4434%2016.2217%2012.3417%2016.2217V15.3667C12.4161%2015.3667%2012.4905%2015.374%2012.5649%2015.3961L13.0263%2015.5308C13.1107%2015.5553%2013.1999%2015.5676%2013.2868%2015.5725V16.4275ZM16.1765%2016.6333C16.0872%2016.4275%2015.9111%2016.2634%2015.6854%2016.2021L15.2438%2016.0796C15.1397%2016.0478%2015.0305%2016.0355%2014.9214%2016.0355V15.1829C15.0057%2015.1804%2015.0901%2015.1902%2015.1719%2015.2172L15.5341%2015.3299C15.9185%2015.45%2016.1765%2015.7979%2016.1765%2016.1948V16.6333ZM17.449%2018.1474C17.4415%2018.1719%2017.4366%2018.1964%2017.4291%2018.2209C17.3522%2018.4611%2017.129%2018.6203%2016.876%2018.6203C16.8537%2018.6203%2016.8313%2018.6154%2016.809%2018.613V17.7628C16.8264%2017.7652%2016.8413%2017.7677%2016.8586%2017.7677C17.1067%2017.7677%2017.3324%2017.6305%2017.4515%2017.4222V18.1474H17.449ZM19.8302%207.48242C19.5524%207.87933%2019.4061%208.34484%2019.4061%208.82749V9.2489L19.1903%209.5576C18.91%209.95696%2018.7611%2010.4249%2018.7611%2010.91V13.0342C18.7611%2013.3772%2018.6173%2013.7129%2018.3643%2013.9481L17.9103%2014.3744C17.6052%2014.661%2017.4366%2015.0628%2017.449%2015.4794L17.4515%2015.5749C17.4688%2016.1262%2017.3969%2016.675%2017.2406%2017.2042C17.191%2017.3732%2017.0323%2017.4908%2016.8561%2017.4908C16.6354%2017.4908%2016.4543%2017.3144%2016.4543%2017.0939V16.1948C16.4543%2015.6754%2016.117%2015.2221%2015.6159%2015.0677L15.2538%2014.955C15.0528%2014.8938%2014.842%2014.8913%2014.6386%2014.9501L13.5472%2015.2686C13.4033%2015.3103%2013.2496%2015.3103%2013.1057%2015.2686L12.6443%2015.1339C12.4062%2015.0628%2012.1482%2015.08%2011.92%2015.178L10.9502%2015.5994C10.3301%2015.8689%209.9307%2016.4741%209.9307%2017.1429V17.4884C9.54871%2017.4663%209.17664%2017.3536%208.84674%2017.1576L8.50692%2016.9567C8.21919%2016.7877%207.89177%2016.697%207.5569%2016.697H6.78548L6.21498%2016.381C5.94461%2016.2315%205.63951%2016.1531%205.32945%2016.1507L4.23805%2016.1433L2.98542%2015.4916C1.08539%2014.5042%200.274278%2012.2821%201.10027%2010.322L1.3508%209.72666C1.53683%209.28565%201.63357%208.81769%201.63357%208.33749V8.00428H1.90394C2.17183%208.00428%202.40003%207.82053%202.46204%207.57307H11.8481C12.0044%207.57307%2012.1482%207.66372%2012.2102%207.80583L12.4905%208.42569C12.5798%208.62414%2012.7783%208.75154%2012.999%208.75154C13.2173%208.75154%2013.4182%208.62414%2013.5075%208.42569L13.7878%207.80338C13.8523%207.66127%2013.9937%207.57062%2014.15%207.57062H14.4873C14.6337%207.57062%2014.7676%207.64902%2014.837%207.77643C15.0082%208.09003%2015.3158%208.30074%2015.6655%208.35709V12.2575C15.1025%2012.3188%2014.6709%2012.6496%2014.6709%2013.0514C14.6709%2013.4973%2015.1967%2013.8574%2015.8466%2013.8574C16.4965%2013.8574%2017.0223%2013.4973%2017.0223%2013.0514C17.0223%2012.6496%2016.5907%2012.3163%2016.0277%2012.2575V8.35464C16.3774%208.29828%2016.685%208.08758%2016.8561%207.77398C16.9256%207.64657%2017.0595%207.56817%2017.2059%207.56817H17.7069C17.9376%207.56817%2018.1485%207.45302%2018.275%207.26192L19.0191%206.12755C19.1158%205.9781%2019.282%205.8899%2019.4631%205.8899H19.6938C19.8575%205.8899%2019.9914%206.0222%2019.9914%206.1839V6.53426C19.9914%206.70331%2020.0584%206.86501%2020.175%206.98506L19.8302%207.48242ZM15.663%2012.8554V13.6296C15.3579%2013.583%2015.1322%2013.4287%2015.1322%2013.2425C15.1322%2013.0563%2015.3579%2012.8995%2015.663%2012.8554Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M43.6355%2014.2212L45.783%206.63627C46.0175%205.80901%2046.629%205.14498%2047.4288%204.848L47.4874%204.60107H44.5028L39.434%2010.6989L37.4942%204.60107H34.7636L34.6978%204.848C35.1653%205.08213%2035.423%205.78176%2035.423%206.35097V6.38628C35.423%209.63469%2033.0443%2015.2183%2029.6984%2015.2183C28.3982%2015.2183%2027.7242%2014.2901%2027.7242%2013.5165C27.7242%2012.5794%2028.5003%2011.9129%2029.3191%2011.9129C30.112%2011.9129%2030.2342%2012.211%2030.6909%2012.211C30.9696%2012.211%2031.2366%2012.0667%2031.3701%2011.8195C31.5797%2011.4313%2031.4208%2010.9572%2031.0376%2010.7714L30.8283%2010.6705C28.8775%209.72228%2026.6152%2011.1582%2026.6152%2013.3453V13.3756C26.6152%2014.9675%2027.8525%2016.2989%2029.4275%2016.3545C33.4867%2016.4983%2036.2019%2010.9661%2036.6338%206.91684L36.9458%208.01243L38.5448%2012.8545H39.1504L44.1452%206.83425L42.0498%2014.229C41.8094%2015.0773%2041.1437%2015.7344%2040.2985%2015.958L40.2399%2016.2049H44.2561L44.3216%2015.958C43.7283%2015.6043%2043.4461%2014.8902%2043.6355%2014.2212Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M51.9847%2012.6335H50.0625C50.2808%2012.034%2050.4898%2011.4617%2050.5603%2011.2743C51.0465%209.97682%2051.971%209.45183%2052.8665%209.37842L52.8572%209.3862L51.9847%2012.6335ZM53.7159%208.72607H53.6817C51.8071%208.7283%2049.7916%208.91155%2048.719%2011.9903C47.8179%2014.5767%2047.5745%2015.6481%2046.8705%2015.6481C46.4204%2015.6481%2046.5297%2014.763%2045.8549%2014.763C45.5509%2014.763%2045.2332%2015.0093%2045.2104%2015.3661C45.1705%2015.9826%2045.9909%2016.3555%2046.6092%2016.3555C48.4929%2016.3555%2049.2148%2014.9671%2049.4505%2014.3203C49.481%2014.2358%2049.6473%2013.778%2049.8436%2013.2386H51.8231L51.4878%2014.4866C51.3107%2015.145%2050.9465%2015.6839%2050.3304%2015.9595L50.2772%2016.2062H53.5154L53.5755%2015.9595C53.1372%2015.5941%2052.9469%2015.0082%2053.089%2014.4627L54.3075%209.78302C54.4011%209.42403%2054.6472%209.12789%2054.9809%208.973L55.0338%208.72607H53.9785H53.7159Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M70.056%209.26026C70.1601%209.08619%2070.2595%208.82035%2070.2595%208.67186L70.2597%208.67103C70.2741%208.39018%2070.0208%208.17273%2069.7488%208.23196H69.7482C69.5304%208.27951%2069.373%208.47499%2069.3771%208.70023C69.3807%208.93436%2069.3341%209.18574%2069.2353%209.30836C69.0082%209.59116%2068.645%209.56697%2066.9717%209.08174V9.07896C66.8186%209.03363%2066.6504%208.98414%2066.4731%208.93492C66.4637%208.93241%2066.4549%208.92963%2066.4453%208.92657L66.4456%208.92741C65.6106%208.698%2064.5732%208.4875%2063.8929%208.82869C63.8874%208.83148%2063.8816%208.83453%2063.8764%208.83704C63.2118%209.17406%2062.7479%209.81223%2062.6086%2010.5502C62.5879%2010.6587%2062.5728%2010.7468%2062.5711%2010.7788V10.7799C62.5513%2011.1675%2062.9009%2011.4679%2063.2767%2011.3864L63.2773%2011.3858C63.5821%2011.3196%2063.7965%2011.0441%2063.7902%2010.7296C63.7836%2010.4117%2063.7205%209.98741%2063.8918%209.70267C64.1674%209.31059%2064.4537%209.28278%2065.7361%209.71462L64.3436%2014.4877C64.1514%2015.1456%2063.6812%2015.6848%2063.059%2015.9601L63.0001%2016.2073H66.3319L66.3977%2015.9601C65.9679%2015.595%2065.7906%2015.0088%2065.9453%2014.4635L67.1628%2010.1637C67.6969%2010.276%2068.2381%2010.305%2068.7651%2010.1531L68.9548%2010.0986C69.3787%209.97629%2069.8129%209.6668%2070.056%209.26026Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M71.3889%208.72607L71.3234%208.97328C71.736%209.26108%2071.9219%209.78079%2071.7886%2010.2671L70.5506%2014.4816C70.3584%2015.14%2069.8882%2015.6789%2069.2659%2015.9542L69.207%2016.2011H70.9696H71.1306H75.1868L75.7226%2014.2252H75.4709L75.3806%2014.4145C75.0447%2015.1206%2074.3372%2015.5699%2073.5614%2015.5699H71.8415L72.7572%2012.2623L73.4878%2012.2615C73.9807%2012.2612%2074.3512%2012.7153%2074.2568%2013.2036H74.5084L75.1094%2010.9679H74.8578C74.7122%2011.3814%2074.3253%2011.6578%2073.8904%2011.658L72.9243%2011.6592L73.5597%209.36341L75.3825%209.36202C75.9775%209.36146%2076.4229%209.9126%2076.304%2010.5015H76.5556L77.033%208.72607H71.3889Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M82.8655%2010.5324C82.6668%2011.2028%2082.0564%2011.6627%2081.3632%2011.6627L80.3076%2011.6636L80.9466%209.36726L82.0055%209.3667C82.6067%209.36642%2083.0379%209.9512%2082.8655%2010.5324ZM82.7978%208.72998H78.7711L78.7053%208.97691C79.0919%209.24636%2079.2791%209.71935%2079.1921%2010.1779L77.9311%2014.4846C77.739%2015.1431%2077.269%2015.682%2076.6465%2015.9573L76.5879%2016.2048H79.9164L79.9822%2015.9573C79.5524%2015.5922%2079.3754%2015.006%2079.5296%2014.4607L80.14%2012.2662H80.3944C80.7787%2012.2665%2081.1014%2012.5584%2081.1438%2012.9444C81.1578%2013.069%2081.3505%2014.5947%2081.5044%2015.1195C81.7059%2015.8052%2081.9705%2016.205%2082.5729%2016.205H84.0788L84.1375%2015.9578L83.9219%2015.8288C83.4966%2015.5738%2083.1885%2015.1773%2083.0508%2014.6531C82.9203%2014.1585%2082.677%2013.2372%2082.5578%2012.7495C82.4961%2012.4981%2082.1866%2012.2654%2081.8667%2012.2654L82.3741%2012.2651C83.284%2012.2645%2084.0827%2011.6525%2084.328%2010.7671C84.611%209.74382%2083.8495%208.72998%2082.7978%208.72998Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M60.6842%209.10931C60.576%209.10931%2060.3431%209.03478%2059.9858%208.88463C59.6281%208.73447%2059.2669%208.65967%2058.9027%208.65967C58.1467%208.65967%2057.5157%208.90687%2056.9997%209.4352C56.5703%209.87483%2056.3795%2010.3628%2056.3795%2010.7852C56.3795%2011.2349%2056.6399%2011.7635%2057.1616%2012.1909C57.6542%2012.5949%2058.1668%2012.982%2058.68%2013.3771C59.2196%2013.8134%2059.4897%2014.2158%2059.4897%2014.5431C59.4897%2015.2616%2059.0269%2015.6481%2058.0688%2015.6481C57.0953%2015.6481%2056.4221%2014.9276%2056.2063%2013.5782H55.9431L55.1777%2016.2045H55.4203C55.7366%2015.9807%2055.9615%2015.8366%2056.4202%2015.8366C56.858%2015.8366%2057.3257%2016.3558%2058.3229%2016.3558C59.1191%2016.3558%2059.7493%2016.189%2060.2892%2015.6434C60.7481%2015.1668%2060.9775%2014.4994%2060.9775%2013.9538C60.9775%2013.4494%2060.6644%2012.8613%2060.1174%2012.4375C59.648%2012.0741%2059.1453%2011.7496%2058.6596%2011.3948C58.1332%2010.9993%2057.87%2010.6637%2057.87%2010.2956C57.87%2010.0906%2057.9713%209.88651%2058.174%209.68213C58.43%209.42325%2058.773%209.36596%2059.232%209.36596C60.1529%209.36596%2060.7974%209.88429%2060.8516%2010.9746H61.0945L61.7368%208.65967H61.4939C61.2373%208.95971%2060.9675%209.10931%2060.6842%209.10931Z'%20fill='%23006747'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M89.1717%209.36569C90.0926%209.36569%2090.7374%209.88401%2090.7914%2010.9743H91.0345L91.6765%208.65967H91.4334C91.1771%208.95915%2090.9075%209.10903%2090.6237%209.10903C90.5158%209.10903%2090.2829%209.03423%2089.9252%208.88435C89.5676%208.73447%2089.2067%208.65967%2088.8422%208.65967C88.0864%208.65967%2087.4554%208.90687%2086.9395%209.43493C86.51%209.87455%2086.3192%2010.3628%2086.3192%2010.785C86.3192%2011.2351%2086.5796%2011.7629%2087.1014%2012.1909C87.5939%2012.5949%2088.1065%2012.9817%2088.6197%2013.3768C89.159%2013.8134%2089.4294%2014.2158%2089.4294%2014.5428C89.4294%2015.2613%2088.9666%2015.6478%2088.0085%2015.6478C87.035%2015.6478%2086.3619%2014.9274%2086.1458%2013.5782H85.8826L85.1172%2016.2045H85.3603C85.6763%2015.9807%2085.9013%2015.8366%2086.3597%2015.8366C86.7977%2015.8366%2087.2652%2016.3558%2088.2626%2016.3558C89.0588%2016.3558%2089.689%2016.1884%2090.2289%2015.6434C90.6878%2015.1662%2090.9172%2014.4991%2090.9172%2013.9538C90.9172%2013.4494%2090.6041%2012.8613%2090.0574%2012.4375C89.5877%2012.0738%2089.0853%2011.7493%2088.5996%2011.3945C88.0729%2010.9993%2087.8097%2010.6632%2087.8097%2010.295C87.8097%2010.0909%2087.911%209.88623%2088.1134%209.68185C88.3697%209.42297%2088.7128%209.36569%2089.1717%209.36569Z'%20fill='%23006747'/%3e%3c/svg%3e",I=[{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",tagline:"Featured groups+ experience",headline:r.jsxs(r.Fragment,{children:["Welcome to ",r.jsx("br",{})," Featured Groups +"]})},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",headline:"Get real-time insights"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_3.png",headline:"Predictions, trivia & polls synced to match play"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_4.png",headline:"Win points for every answer you get right"},{graphicSrc:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",headline:"Compete against friends on the leaderboard"}],y2=t.styled_default("div")({name:"OnboardingContainer",class:"on59ra",propsAsIs:!1}),T2=()=>t.f,I2=t.styled_default(T2())({name:"OnboardingNotificationContainer",class:"op1wk5d",propsAsIs:!0}),k=t.styled_default("div")({name:"InnerContainer",class:"i1i1g2vj",propsAsIs:!1}),R2=({deepLink:s,onboardingOpts:e,notification:n,gamification:o,loading:i,sdk:d})=>{var l,u,c,p,C,f,v;const S=t.useStore(o.friends.getStore()),[N,y]=a.useState(void 0),m=a.useMemo(()=>{var E,_;const x=d.getInviter();return x?(_=(E=S.data)==null?void 0:E.find(({slId:w})=>w===x))==null?void 0:_.name:""},[S.data,d]);return a.useEffect(()=>{const E=s.$store.subscribe(_=>{_&&y(_.data)});return()=>{E()}},[s.$store]),r.jsx(y2,{children:r.jsx(t.rn,{loading:i,rules:[{label:"Answer as many questions as you like.",icon:"icon-btn-feature-groups"},{label:"Win points for each correct trivia or prediction answer.",icon:"icon-thumb-up"},{label:"Top the leader board and best your friends.",icon:"icon-trophy"}],rulesBtnLabel:(l=e.rules)==null?void 0:l.buttonLabel,rulesTitle:(u=e.rules)==null?void 0:u.heading,termsTitle:"Terms and Conditions",termsText:(c=e.rules)==null?void 0:c.terms,steps:I,primaryColor:(p=e.inviteCard)==null?void 0:p.iconColor,inviteLink:N,inviteCardTitle:(C=e.inviteCard)==null?void 0:C.heading,inviteCardSubtext:(f=e.inviteCard)==null?void 0:f.subtext,inviteCardBtnLabel:(v=e.inviteCard)==null?void 0:v.buttonLabel,onClose:()=>{var E;(E=n.close)==null||E.call(n)},gamification:o,sdk:d,inviterName:m})})},x2=({sdk:s,notification:e,saveHeight:n,style:o,appNode:i,responsiveStore:d})=>{var l;const u=a.useRef(null),c=e.data.onboarding,[p,C]=a.useState(c==null?void 0:c.instantOpen),f=s.getFeature(L.SdkOverlayType.GAMES),v=a.useMemo(()=>I==null?void 0:I.map(({graphicSrc:m})=>m),[]),{screen:S}=t.useStore(d,{keys:["screen"]});(l=c==null?void 0:c.titleCard)!=null&&l.media&&(c.titleCard.media.sponsorLogo=N2),a.useLayoutEffect(()=>{var m;n(((m=u.current)==null?void 0:m.getBoundingClientRect().height)||0)},[n]);const{loading:N,throttled:y}=t.I(v);return p&&f&&c&&i.current&&!y?r.jsx(t.g,{container:i,useContainer:!1,children:r.jsx(R2,{notification:e,setOpened:C,gamification:f,onboardingOpts:c,deepLink:f.deepLink,loading:N,sdk:s})}):r.jsxs(r.Fragment,{children:[r.jsx(k,{ref:u,style:{position:"absolute",visibility:"hidden"},children:r.jsx(A,{close:()=>{},action:()=>{},onboarding:c})}),r.jsx(I2,{style:o,hiding:e.hiding,children:r.jsx(k,{children:r.jsx(A,{close:e.close,action:()=>{var m;C(!0),(((m=i.current)==null?void 0:m.getBoundingClientRect().y)||0)<0&&O(i,S.size,{behavior:"smooth"})},onboarding:c})})})]})},A2=()=>t.f,k2=t.styled_default(A2())({name:"Container",class:"c1f0y7nw",propsAsIs:!0}),V=t.styled_default("div")({name:"InnerContainer",class:"i1qa3p7a",propsAsIs:!1}),j2=()=>V,D2=t.styled_default(j2())({name:"HiddenContainer",class:"hrthymv",propsAsIs:!0}),b2=t.styled_default("div")({name:"NotificationRefreshing",class:"n13rok4i",propsAsIs:!1}),O2=()=>t.h$2,F2=t.styled_default(O2())({name:"Pill",class:"pht79xf",propsAsIs:!0}),V2=s=>{const[e,n]=a.useState(0),o=a.useRef(null),i=a.useCallback(l=>{o.current=l},[]);a.useEffect(()=>{var l;const u=(l=o.current)==null?void 0:l.getBoundingClientRect();u&&n(u.height)},[s]);const d=a.useCallback(l=>{n(l)},[]);return[i,e,d]},w2=({sdk:s,notification:e,appNode:n,responsiveStore:o})=>{var i,d;const{sdk:l}=R(),[u,c,p]=V2(e.id);return e.type===t.NotificationType.QUESTION?r.jsxs(r.Fragment,{children:[r.jsx(D2,{ref:u,children:r.jsx(t.w,{...e})}),r.jsxs(k2,{style:{height:e.hiding?0:c},hiding:e.hiding,children:[r.jsx(V,{style:{height:"100%"},children:r.jsx(t.w,{...e,controlVideo:l==null?void 0:l.controlVideoPlayer})}),r.jsx(b2,{},e.id)]})]}):e.type===t.NotificationType.QUESTION_RESOLVED&&(d=(i=e.data)==null?void 0:i.question)!=null&&d.predictionResult?r.jsx(t.z$2,{style:{height:e.hiding?0:c},saveHeight:p,close:e.close,hiding:e.hiding,...e.data.question,mastersApp:!0}):e.type===t.NotificationType.ONBOARDING?r.jsx(x2,{style:{height:e.hiding?0:c},saveHeight:p,sdk:s,notification:e,appNode:n,responsiveStore:o}):null},B2="p1co32q0",P2=({pill:s,setPill:e,appNode:n,headerNode:o,scrollNode:i,responsiveStore:d,scrollStore:l})=>{var u,c;const{screen:p}=t.useStore(d,{keys:["screen"]}),{tabsShown:C,scrollPosition:f}=t.useStore(l,{keys:["tabsShown","scrollPosition"]});a.useEffect(()=>{d.get().sdkInDesktopView?f<50&&e(null):f>-50&&e(null)},[f,d,e]);const v=d.get().sdkInDesktopView?n:o;return!s||!v.current?null:t.Df.createPortal(r.jsx(F2,{title:s.type===t.NotificationType.QUESTION_RESOLVED?"Prediction result":`New ${((c=t.e[(u=s.data)==null?void 0:u.questionType])==null?void 0:c.label)||"notification"}`,onClick:()=>{var S;d.get().sdkInDesktopView?(S=i.current)==null||S.scrollTo({top:0,behavior:"smooth"}):O(n,p.size,{behavior:"smooth"}),e(null)},className:t.cx_default(C&&B2,"sl-pill-button")}),v.current)},H2=({sdk:s,headerNode:e,scrollNode:n,responsiveStore:o,appNode:i,scrollStore:d})=>{const[l]=a.useState(s.getNotificationsStore()),u=t.useStore(l),[c,p]=a.useState(null),C=a.useMemo(()=>s.getActiveNotification(),[s,u]);return a.useEffect(()=>{C&&t.eventBus.emit("notification",{action:"rendered",payload:{questionId:C.data.questionId,questionType:C.data.questionType}})},[C]),a.useEffect(()=>{C&&(o.get().sdkInDesktopView||o.get().sdkInView)&&(!o.get().sdkInDesktopView&&o.get().sdkInView&&p(C),o.get().sdkInDesktopView&&window.requestAnimationFrame(()=>{d.get().scrollPosition!==0&&p(C)}))},[C]),a.useEffect(()=>{C||p(null)},[C]),r.jsxs(r.Fragment,{children:[!c&&C&&r.jsx(w2,{headerNode:e,appNode:i,sdk:s,notification:C,responsiveStore:o}),c&&r.jsx(P2,{pill:c,setPill:p,appNode:i,notification:C,headerNode:e,scrollNode:n,scrollStore:d,responsiveStore:o})]})},j=Object.keys(t.A),h=()=>{const s=window.innerWidth;let e="sm";for(let n=j.length-1;n>0;n--){const o=j[n];if(!(s<t.A[o])&&s>=t.A[o]){e=o;break}}return{name:e,size:t.A[e]}},D=s=>{var e;return(((e=s.current)==null?void 0:e.getBoundingClientRect().y)||0)<-68},g=s=>s>=t.A.lg,$2=s=>{const[e]=a.useState(()=>{const n=h();return t.i({screen:h(),sdkInView:D(s),sdkInDesktopView:g(n.size)})});return a.useEffect(()=>{const n=t.x(()=>{e.setKey("sdkInView",D(s))},200),o=t.x(()=>{const i=h();e.setKey("screen",i),e.setKey("sdkInDesktopView",g(i.size))},200);return window.addEventListener("scroll",n),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",n),window.removeEventListener("resize",o)}},[e,s]),[e]},M2={...t.R,BG_TRANSPARENT:"rgba(0,0,0, .8)",BLUE_QUESTION_ACTION_BTN:"#1589ee",WHITE:"#FFFFFF",BLUE:"#2d6ffd",GREY_PRIMARY_ONBOARDING_INAPP:"#B5B7B8",GREY_PRIMARY:"#909395",PRIMARY_1:"#107D57",PRIMARY_2:"#006747",PRIMARY_TEXT:"#25282A",QUESTION_TYPE_ICON:"#107D57",SUCCESS:"#107D57",UNSUCCESS:"#DF2F3B",SECONDARY_RED1:"#DF2F3B",NEUTRALS_WHITE:"#FFFFFF",NEUTRALS_WHITE1:"#FFFFFF",NEUTRALS_GRAY1:"#F7F7F7",NEUTRALS_GRAY2:"#F2F2F1",NEUTRALS_GRAY3:"#E8E8E8",NEUTRALS_GRAY4:"#D9D9D6",NEUTRALS_GRAY5:"#B1B3B3",NEUTRALS_GRAY6:"#888B8D",NEUTRALS_GRAY7:"#6B6F73",NEUTRALS_GRAY9:"#25282A",SDK_CONTAINER_BG:"#F7F7F7",SDK_WHITE_CONTAINER_BG:"#fff",SDK_DARK_CONTAINER_BG:"#fff",SDK_PREDICTION_RESULT_SUCCESS_BG:"#fff",SDK_PREDICTION_RESULT_INCORRECT_BG:"#fff",SDK_PREDICTION_RESULT_SUCCESS_TEXT:"#107D57",SDK_PREDICTION_RESULT_ERROR_TITLE:"#090E13",SDK_PREDICTION_RESULT_ERROR_SUBTITLE:"#DF2F3B",SDK_PREDICTION_RESULT_CLOSE_ICON:"#6B6F73",SDK_PREDICTION_FEEDBACK_SUCCESS_ICON:"#107D57",SDK_PREDICTION_FEEDBACK_INCORRECT_RECT1:"#CD2525",SDK_PREDICTION_FEEDBACK_INCORRECT_RECT2:"#fff",PREDICTION_BG_LINES_CORRECT:"#01AB58",PREDICTION_BG_LINES_INCORRECT:"#888B8D",SKELETON_COLOR_1:"#f1efef",SKELETON_COLOR_2:"#f9f8f8",TABS_CONTAINER_BG:"#F2F2F1",TABS_ACTIVE_BG:"#FFFFFF",TABS_COLOR:"#6B6F73",TABS_ACTIVE_COLOR:"#107D57",CARD_BG:"#FFFFFF",CARD_BORDER:"#fff",BORDER:"#E8E8E8",VOTE_BTN_BG:"#F7F7F7",VOTE_BTN_BORDER:"rgb(232, 232, 232)",VOTE_BTN_DISABLED_BORDER:"#B1B3B3",VOTE_BTN_SELECTED_BORDER:"#25282A",VOTE_BTN_NOT_SELECTED_BORDER:"#E8E8E8",VOTE_BTN_SELECTED_BG:"#FFFFFF",VOTE_BTN_NOT_SELECTED_BG:"#FFFFFF",VOTE_BTN_NOT_SELECTED_BG_UNSET:"rgb(196, 196, 196)",VOTED_ANSWER_BG:"rgba(16, 125, 87, 0.10)",VOTED_BTN_RCT_BG:"rgba(16, 125, 87, 0.30)",IN_APP_BG:"rgba(255, 255, 255, 0.90)",IN_APP_QUESTION_TYPE_ICON:"#1D7BFF",IN_APP_QUESTION_TYPE_LABEL:"#82899E",IN_APP_QUESTION_QUOTE:"rgba(10, 14, 19, 0.70)",IN_APP_QUESTION_RESULT_SUBTITLE_BG:"#1D7BFF",IN_APP_QUESTION_RESULT_LINE:"#babfc5"};Object.entries(M2).reduce((s,[e,n])=>`
|
|
2
|
+
${s}
|
|
3
3
|
--color-${e.toLowerCase().replaceAll("_","-")}: ${n};
|
|
4
|
-
`,"");const
|
|
4
|
+
`,"");const U2="m1ojpy2l",G2=({children:s,style:e})=>r.jsx("div",{className:"StreamLayerSDKTheme",children:r.jsx("div",{className:t.cx_default("masters-theme",U2),style:e,children:s})}),K2=({sdk:s,className:e})=>{const[,n]=t.p$1(s);return r.jsx(i2,{className:e,feature:n,sdk:s})},Q2=({sdk:s,className:e,appNode:n,responsiveStore:o})=>{const i=t.useStore(s.featuresList.getStore());return i?Array.from(i,d=>{const l=s.getFeature(d);return l?r.jsx(l2,{responsiveStore:o,className:e,appNode:n,feature:l,sdk:s},d):null}):null},q2=s=>{const[e,n]=a.useState(!g(h().size)),o=a.useRef(null);return a.useEffect(()=>{const i=t.x(()=>{const d=h();n(!g(d.size))},200);return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),t.y(o,{enabled:!0,event:"click",listener:t.v}),r.jsx(B.ur,{ref:o,...s,isMobile:e})},z2=({sdk:s})=>{const e=a.useRef(null),n=t.useStore(s.status),o=t.useStore(s.sdkStore.slStreamId),i=a.useRef(null),[d]=$2(e),[l,u]=Q(e,d),c=n==="ready"&&!!o.data;return a.useEffect(()=>{window.requestAnimationFrame(()=>{s.initializeApp().then(()=>{s.openFeature(L.SdkOverlayType.GAMES)})})},[s]),t.y(e,{enabled:!0,event:"click",listener:t.v}),a.useEffect(()=>{Promise.resolve().then(()=>require("./gamification-feature2.js"))},[]),r.jsxs(P,{ref:e,children:[r.jsx(C2,{className:t.cx_default(t.h$1),ref:i}),r.jsxs(H,{className:"sl-hide-on-modal",ref:l,children:[c&&r.jsx(H2,{sdk:s,scrollNode:l,headerNode:i,appNode:e,scrollStore:u,responsiveStore:d}),c&&r.jsx(K2,{className:t.h$1,sdk:s}),c&&r.jsx(Q2,{responsiveStore:d,appNode:e,className:t.h$1,sdk:s})]})]})},Z2=({sdk:s,betPack:e})=>{const[n,o]=a.useState(e),i=!!t.useStore(s.userId()),d=a.useMemo(()=>({sdk:s}),[s]),l=a.useCallback(()=>{o(!1);const u=s==null?void 0:s.getFeature(L.SdkOverlayType.GAMES);u==null||u.closeQuestion()},[s]);return r.jsxs(F.Provider,{value:d,children:[n&&i&&r.jsx(q2,{sdk:s,onEvent:({type:u})=>u==="slOpenGameCenter"?l():()=>{},close:()=>l()}),!n&&r.jsx(z2,{sdk:s})]})},Y2=({sdkKey:s,plugins:e,children:n,event:o,onDeepLinkHandled:i,videoPlayerController:d,production:l=!0})=>r.jsxs(t.StreamLayerProvider,{sdkKey:s,plugins:e,production:l,autoEnable:!0,onDeepLinkHandled:i,videoPlayerController:d,friendsTab:"disabled",skipOnboarding:!0,hideFriends:!0,children:[r.jsx(t.StreamLayerSDKEvent,{event:o}),n]}),W2=({betPack:s})=>{const{sdk:e,status:n}=a.useContext(t.StreamLayerContext);return n===t.StreamLayerStatus.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),null):e?r.jsx("div",{className:"StreamLayerSDK",children:r.jsx(G2,{style:{height:"100%"},children:r.jsx(Z2,{sdk:e,betPack:s})})}):null};class X2 extends a.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){console.error(e,n.componentStack)}render(){return this.state.hasError?null:r.jsx(W2,{...this.props})}}exports.A=n2;exports.MastersStreamLayerProvider=Y2;exports.MastersStreamLayerSDKReact=X2;
|
package/lib/cjs/notification.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./provider.js"),c=require("./useStreamLayerApp2.js"),s=require("react/jsx-runtime"),p=require("react"),x=e.styled_default("div")({name:"Media",class:"m1bcvojl",propsAsIs:!1}),w=()=>x,q=e.styled_default(w())({name:"MediaImgBottom",class:"m58gin0",propsAsIs:!0}),E=()=>x,h=e.styled_default(E())({name:"MediaImgSolid",class:"m1atm8do",propsAsIs:!0}),M=()=>x,Q=e.styled_default(M())({name:"MediaImgRounded",class:"myx3xoi",propsAsIs:!0}),L=()=>x,R=e.styled_default(L())({name:"MediaImgCentered",class:"m1bwv0gx",propsAsIs:!0}),D=()=>x,z=e.styled_default(D())({name:"MediaImgInsight",class:"mntjanp",propsAsIs:!0}),O=e.styled_default("div")({name:"VideoIcon",class:"v1kofb47",propsAsIs:!1}),B={[c.QuestionImages.UNSET]:h,[c.QuestionImages.NONE]:h,[c.QuestionImages.ROUNDED]:Q,[c.QuestionImages.CENTERED]:R,[c.QuestionImages.TRANSPARENT]:q},A=({src:n,imageMode:a=c.QuestionImages.UNSET,withVideo:i,fromInsight:o})=>{if(a===c.QuestionImages.NONE)return null;const t=o?z:B[a];return s.jsxs(t,{children:[s.jsx("img",{src:n,alt:""}),i&&s.jsx(O,{children:s.jsx(e.u1,{name:"icon-play"})})]})},P=e.styled_default("div")({name:"NotificationContent",class:"nuraq9m",propsAsIs:!1}),U=e.styled_default("div")({name:"NotificationContainer",class:"ns1nzpg",propsAsIs:!1}),N=e.styled_default("div")({name:"Body",class:"b1j59nzs",propsAsIs:!1}),V=e.styled_default("div")({name:"Title",class:"t9vmnpp",propsAsIs:!1}),F=e.styled_default("button")({name:"Button",class:"b14ivj5k",propsAsIs:!1}),W=()=>e.u1,K=e.styled_default(W())({name:"StyledChevronRight",class:"s1atci8n",propsAsIs:!0}),G=e.styled_default("div")({name:"QuoteWrap",class:"q4w8jgs",propsAsIs:!1}),Y=e.styled_default("blockquote")({name:"Quote",class:"qaa0kez",propsAsIs:!1}),H=e.styled_default("div")({name:"Body",class:"b1wvd52w",propsAsIs:!1}),J=e.styled_default("div")({name:"Container",class:"ccvukea",propsAsIs:!1}),X=({image:n,tweet:a,account:i,accountVerified:o,body:t,title:r})=>{var d;return s.jsxs(J,{children:[r&&s.jsx(G,{children:s.jsx(Y,{children:r})}),s.jsx(e.D,{image:n,name:(d=a==null?void 0:a.meta)==null?void 0:d.accountName,userName:i,verified:o,createdTweet:a==null?void 0:a.date}),s.jsx(H,{children:e.S$1(t)})]})},Z=({title:n,questionType:a,questionTypeData:i})=>s.jsxs(N,{children:[s.jsx(e.x$1,{questionTypeData:i,questionType:a,questionStatus:c.QuestionStatus.UNSET}),n&&s.jsx(V,{children:n})]}),ss=({tweet:n})=>n?s.jsx(N,{children:s.jsx(X,{...n,controlVideo:()=>{}})}):null,es=({action:n,questionType:a,inApp:i,insight:o,tweet:t})=>{var r;const d=e.e[a],l=e.o[a];if(!d||!i||!i.notification)return null;const{title:u,image:m,imageMode:y}=i.notification;let f=m;a===c.QuestionType.TWEET&&t!=null&&t.tweetMedia&&(f=t.tweetMedia.image),y===c.QuestionImages.NONE&&(f="");const j=i.useMediaFromContent&&(o==null?void 0:o.image),v=a===c.QuestionType.TWEET&&((r=t==null?void 0:t.tweetMedia)==null?void 0:r.video)||a===c.QuestionType.FACTOID&&(o==null?void 0:o.video);return s.jsx(U,{className:"SL_InApp",onClick:n,children:s.jsxs(P,{style:f?{}:{paddingLeft:"1.5rem"},children:[f&&!j&&s.jsx(A,{src:f,imageMode:y,withVideo:!!v}),j&&s.jsx(A,{src:j,fromInsight:!0,withVideo:!!v}),a===c.QuestionType.TWEET?s.jsx(ss,{tweet:t}):s.jsx(Z,{questionTypeData:d,questionType:a,title:u}),s.jsx(F,{name:"inapp-button",children:l||"Open"}),s.jsx(K,{name:"chevronRight"})]})})},ts=e.styled_default("div")({name:"NotificationContainer",class:"n11jcrxe",propsAsIs:!1}),g=e.styled_default("img")({name:"Icon",class:"i1vmpt6u",propsAsIs:!1}),ns=e.styled_default("div")({name:"IconContainer",class:"i180665s",propsAsIs:!1}),as=()=>e.u1,is=e.styled_default(as())({name:"TitleIcon",class:"t16zzzei",propsAsIs:!0}),os=()=>e.y$1,ls=e.styled_default(os())({name:"Close",class:"c1sur0q2",propsAsIs:!0}),ds=e.styled_default("div")({name:"Body",class:"bai9j52",propsAsIs:!1}),cs=e.styled_default("div")({name:"Title",class:"t1bnt25p",propsAsIs:!1}),rs=e.styled_default("div")({name:"Description",class:"dmixjec",propsAsIs:!1}),us=e.styled_default("button")({name:"Button",class:"b1ubkw1q",propsAsIs:!1}),ps=({open:n,close:a,...i})=>{var o,t;return s.jsxs(ts,{onClick:()=>{n==null||n(),i&&(i.instantOpen=!0)},children:[s.jsxs(ns,{children:[s.jsx(g,{className:"on-light",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png"}),s.jsx(g,{className:"on-dark",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"})]}),s.jsxs(ds,{children:[s.jsxs(cs,{children:[s.jsx(is,{name:"icon-trophy-solid"}),(o=i==null?void 0:i.titleCard)==null?void 0:o.title]}),s.jsxs(rs,{children:[s.jsx("span",{children:(t=i==null?void 0:i.titleCard)==null?void 0:t.subtitle}),s.jsx(us,{name:"inapp-button",children:"Play Now"})]})]}),s.jsx(ls,{close:r=>{r==null||r.stopPropagation(),a==null||a()}})]})},ms=e.styled_default("div")({name:"Container",class:"cef8huz",propsAsIs:!1}),ys=()=>e.u1,fs=e.styled_default(ys())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:!0}),xs=()=>e.u1,js=e.styled_default(xs())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:!0}),Is=e.styled_default("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:!1}),vs=e.styled_default("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:!1}),hs=e.styled_default("div")({name:"Body",class:"barrbyu",propsAsIs:!1}),As=e.styled_default("div")({name:"Subtitle",class:"sz7237i",propsAsIs:!1}),gs=({step:n,children:a,answer:i,state:o="pending"})=>{const[t,r]=p.useState(0),[d]=p.useState(()=>new ResizeObserver(u=>{var m,y;r((y=(m=u==null?void 0:u[0])==null?void 0:m.contentRect)==null?void 0:y.width)})),l=p.useCallback(u=>{u||d.disconnect(),d.observe(u)},[d]);return p.useMemo(()=>()=>{d.disconnect()},[d]),s.jsxs(ms,{children:[s.jsx(Is,{children:s.jsx(js,{name:"icon-prediction"})}),s.jsx(vs,{style:{minWidth:`${t}px`},children:s.jsx(hs,{children:a},n)}),s.jsx(As,{ref:l,className:o,children:s.jsxs("div",{children:[s.jsx(fs,{name:"icon-check"}),"Your Pick: ",i]})})]})},$s=e.styled_default("div")({name:"Container",class:"ckyzolp",propsAsIs:!1}),I=e.styled_default("div")({name:"Line",class:"l16t1zr7",propsAsIs:!1}),_s=()=>I,Ts=e.styled_default(_s())({name:"Line1",class:"le78kvg",propsAsIs:!0}),Ns=()=>I,bs=e.styled_default(Ns())({name:"Line2",class:"l1o7966d",propsAsIs:!0}),Cs=()=>I,Ss=e.styled_default(Cs())({name:"Line3",class:"lu9lyxq",propsAsIs:!0}),ks=()=>s.jsxs($s,{children:[s.jsx(Ts,{children:s.jsx("div",{})}),s.jsx(bs,{children:s.jsx("div",{})}),s.jsx(Ss,{children:s.jsx("div",{})})]}),ws=e.styled_default("div")({name:"Container",class:"c10jy6zf",propsAsIs:!1}),qs=()=>e.u1,Es=e.styled_default(qs())({name:"CheckIcon",class:"c1c7scay",propsAsIs:!0}),Ms=()=>s.jsxs(ws,{children:[s.jsx(Es,{name:"icon-check"})," Prediction results are in!"]}),Qs=e.styled_default("div")({name:"Container",class:"cf6k2yy",propsAsIs:!1}),Ls=e.styled_default("div")({name:"Caption",class:"c1c8xjus",propsAsIs:!1}),Rs=e.styled_default("div")({name:"Title",class:"t1d1uekn",propsAsIs:!1}),Ds=({title:n})=>s.jsxs(Qs,{children:[s.jsx(Ls,{children:"Results for"}),s.jsx(Rs,{children:n})]}),b=e.styled_default("div")({name:"Container",class:"c181a1as",propsAsIs:!1}),C=e.styled_default("div")({name:"Title",class:"t1cduox6",propsAsIs:!1}),zs=()=>e.u1,S=e.styled_default(zs())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:!0}),Os=()=>S,Bs=e.styled_default(Os())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:!0}),Ps=()=>s.jsxs(b,{children:[s.jsxs(C,{children:["Congratulations!",s.jsx("br",{}),"You answered correctly."]}),s.jsx(S,{name:"icon-check"})]}),Us=({title:n})=>s.jsxs(b,{children:[s.jsxs(C,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",n]}),s.jsx(Bs,{name:"icon-cross"})]}),Vs=e.styled_default("div")({name:"Container",class:"cnxgcs2",propsAsIs:!1}),Fs=e.styled_default("div")({name:"Title",class:"t903f8n",propsAsIs:!1}),Ws=()=>e.u1,Ks=e.styled_default(Ws())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:!0}),Gs=({points:n})=>s.jsxs(Vs,{children:[s.jsxs(Fs,{children:["You won ",s.jsx(e.d,{delay:.5,prefix:"+",suffix:" points",value:n})]}),s.jsx(Ks,{name:"icon-trophy-solid"})]}),$=e.styled_default("div")({name:"Container",class:"cq3agu2",propsAsIs:!1}),_=e.styled_default("div")({name:"Body",class:"b16qj0do",propsAsIs:!1}),T={1:3e3,2:4e3,3:4e3,4:4e3},Ys=({close:n,action:a,setStep:i,votedAnswer:o,correct:t,correctAnswerTitle:r,questionTitle:d,step:l})=>{if(p.useEffect(()=>{if(i){const m=setTimeout(()=>{T[l+1]&&(t||l<3)?i(l+1):n==null||n()},T[l]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,l,n,t]),l===1)return s.jsx($,{children:s.jsx(_,{children:s.jsx(Ms,{})})});let u="pending";return(l===3||l===4)&&(u=t?"correct":"incorrect"),s.jsx($,{onClick:()=>a==null?void 0:a(),children:s.jsxs(_,{children:[l!==1&&s.jsx(ks,{},l),s.jsxs(gs,{state:u,step:l,answer:(o==null?void 0:o.title)||"unknown",children:[l===2&&s.jsx(Ds,{title:d||"unknown"}),l===3&&t&&s.jsx(Ps,{}),l===3&&!t&&s.jsx(Us,{title:r||"unknown"}),l===4&&s.jsx(Gs,{points:(o==null?void 0:o.points)||0})]})]})})},Hs=({close:n,action:a,votedAnswer:i,correct:o,correctAnswerTitle:t,questionTitle:r})=>{const[d,l]=p.useState(1);return s.jsx(Ys,{close:n,action:a,votedAnswer:i,correct:o,correctAnswerTitle:t,questionTitle:r,setStep:l,step:d,title:""})},Js=e.styled_default("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:!1}),Xs=n=>s.jsx(Js,{children:s.jsx(Hs,{...n})}),k=({sdk:n})=>{const[a]=p.useState(n.getNotificationsStore()),i=e.useStore(a),o=n.getFeature(c.SdkOverlayType.GAMES),t=p.useMemo(()=>n.getActiveNotification(),[n,i]);return p.useEffect(()=>{t&&e.eventBus.emit("notification",{action:"rendered",payload:{questionId:t.data.questionId,questionType:t.data.questionType}})},[t]),t&&t.type===e.NotificationType.QUESTION_RESOLVED?t.data.question&&t.data.questionType===c.QuestionType.PREDICTION?s.jsx(Xs,{action:t.action,close:t.close,...t.data.question}):null:t&&t.type===e.NotificationType.ONBOARDING?t.data.onboarding?s.jsx(ps,{open:o==null?void 0:o.openFeature,close:t.close,...t.data.onboarding}):null:t&&s.jsx(es,{...t.data,action:t.action})},Zs=({theme:n})=>{const a=e.useStreamLayer(),i=e.useStreamLayerTheme(),o=e.useStreamLayerUI();return a&&(o.appNotification||o.onboardingNotification)?o.app&&!o.onboardingNotification?null:s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(e.h,{customTheme:n??i.theme,themeMode:i.themeMode,children:s.jsx(k,{sdk:a})})}):null};exports.StreamLayerSDKNotification=Zs;exports.StreamLayerSDKNotificationUI=k;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./provider.js"),c=require("./useStreamLayerApp2.js"),s=require("react/jsx-runtime"),p=require("react"),x=e.styled_default("div")({name:"Media",class:"m1bcvojl",propsAsIs:!1}),w=()=>x,q=e.styled_default(w())({name:"MediaImgBottom",class:"m58gin0",propsAsIs:!0}),E=()=>x,h=e.styled_default(E())({name:"MediaImgSolid",class:"m1atm8do",propsAsIs:!0}),M=()=>x,Q=e.styled_default(M())({name:"MediaImgRounded",class:"myx3xoi",propsAsIs:!0}),L=()=>x,R=e.styled_default(L())({name:"MediaImgCentered",class:"m1bwv0gx",propsAsIs:!0}),D=()=>x,z=e.styled_default(D())({name:"MediaImgInsight",class:"mntjanp",propsAsIs:!0}),O=e.styled_default("div")({name:"VideoIcon",class:"v1kofb47",propsAsIs:!1}),B={[c.QuestionImages.UNSET]:h,[c.QuestionImages.NONE]:h,[c.QuestionImages.ROUNDED]:Q,[c.QuestionImages.CENTERED]:R,[c.QuestionImages.TRANSPARENT]:q},A=({src:n,imageMode:a=c.QuestionImages.UNSET,withVideo:i,fromInsight:o})=>{if(a===c.QuestionImages.NONE)return null;const t=o?z:B[a];return s.jsxs(t,{children:[s.jsx("img",{src:n,alt:""}),i&&s.jsx(O,{children:s.jsx(e.k1,{name:"icon-play"})})]})},P=e.styled_default("div")({name:"NotificationContent",class:"nuraq9m",propsAsIs:!1}),U=e.styled_default("div")({name:"NotificationContainer",class:"ns1nzpg",propsAsIs:!1}),k=e.styled_default("div")({name:"Body",class:"b1j59nzs",propsAsIs:!1}),V=e.styled_default("div")({name:"Title",class:"t9vmnpp",propsAsIs:!1}),F=e.styled_default("button")({name:"Button",class:"b14ivj5k",propsAsIs:!1}),W=()=>e.k1,K=e.styled_default(W())({name:"StyledChevronRight",class:"s1atci8n",propsAsIs:!0}),G=e.styled_default("div")({name:"QuoteWrap",class:"q4w8jgs",propsAsIs:!1}),Y=e.styled_default("blockquote")({name:"Quote",class:"qaa0kez",propsAsIs:!1}),H=e.styled_default("div")({name:"Body",class:"b1wvd52w",propsAsIs:!1}),J=e.styled_default("div")({name:"Container",class:"ccvukea",propsAsIs:!1}),X=({image:n,tweet:a,account:i,accountVerified:o,body:t,title:r})=>{var d;return s.jsxs(J,{children:[r&&s.jsx(G,{children:s.jsx(Y,{children:r})}),s.jsx(e.D,{image:n,name:(d=a==null?void 0:a.meta)==null?void 0:d.accountName,userName:i,verified:o,createdTweet:a==null?void 0:a.date}),s.jsx(H,{children:e.S$1(t)})]})},Z=({title:n,questionType:a,questionTypeData:i})=>s.jsxs(k,{children:[s.jsx(e.x$1,{questionTypeData:i,questionType:a,questionStatus:c.QuestionStatus.UNSET}),n&&s.jsx(V,{children:n})]}),ss=({tweet:n})=>n?s.jsx(k,{children:s.jsx(X,{...n,controlVideo:()=>{}})}):null,es=({action:n,questionType:a,inApp:i,insight:o,tweet:t})=>{var r;const d=e.e[a],l=e.o[a];if(!d||!i||!i.notification)return null;const{title:u,image:m,imageMode:y}=i.notification;let f=m;a===c.QuestionType.TWEET&&t!=null&&t.tweetMedia&&(f=t.tweetMedia.image),y===c.QuestionImages.NONE&&(f="");const j=i.useMediaFromContent&&(o==null?void 0:o.image),v=a===c.QuestionType.TWEET&&((r=t==null?void 0:t.tweetMedia)==null?void 0:r.video)||a===c.QuestionType.FACTOID&&(o==null?void 0:o.video);return s.jsx(U,{className:"SL_InApp",onClick:n,children:s.jsxs(P,{style:f?{}:{paddingLeft:"1.5rem"},children:[f&&!j&&s.jsx(A,{src:f,imageMode:y,withVideo:!!v}),j&&s.jsx(A,{src:j,fromInsight:!0,withVideo:!!v}),a===c.QuestionType.TWEET?s.jsx(ss,{tweet:t}):s.jsx(Z,{questionTypeData:d,questionType:a,title:u}),s.jsx(F,{name:"inapp-button",children:l||"Open"}),s.jsx(K,{name:"chevronRight"})]})})},ts=e.styled_default("div")({name:"NotificationContainer",class:"n11jcrxe",propsAsIs:!1}),g=e.styled_default("img")({name:"Icon",class:"i1vmpt6u",propsAsIs:!1}),ns=e.styled_default("div")({name:"IconContainer",class:"i180665s",propsAsIs:!1}),as=()=>e.k1,is=e.styled_default(as())({name:"TitleIcon",class:"t16zzzei",propsAsIs:!0}),os=()=>e.y$1,ls=e.styled_default(os())({name:"Close",class:"c1sur0q2",propsAsIs:!0}),ds=e.styled_default("div")({name:"Body",class:"bai9j52",propsAsIs:!1}),cs=e.styled_default("div")({name:"Title",class:"t1bnt25p",propsAsIs:!1}),rs=e.styled_default("div")({name:"Description",class:"dmixjec",propsAsIs:!1}),us=e.styled_default("button")({name:"Button",class:"b1ubkw1q",propsAsIs:!1}),ps=({open:n,close:a,...i})=>{var o,t;return s.jsxs(ts,{onClick:()=>{n==null||n(),i&&(i.instantOpen=!0)},children:[s.jsxs(ns,{children:[s.jsx(g,{className:"on-light",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png"}),s.jsx(g,{className:"on-dark",src:"https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"})]}),s.jsxs(ds,{children:[s.jsxs(cs,{children:[s.jsx(is,{name:"icon-trophy-solid"}),(o=i==null?void 0:i.titleCard)==null?void 0:o.title]}),s.jsxs(rs,{children:[s.jsx("span",{children:(t=i==null?void 0:i.titleCard)==null?void 0:t.subtitle}),s.jsx(us,{name:"inapp-button",children:"Play Now"})]})]}),s.jsx(ls,{close:r=>{r==null||r.stopPropagation(),a==null||a()}})]})},ms=e.styled_default("div")({name:"Container",class:"cef8huz",propsAsIs:!1}),ys=()=>e.k1,fs=e.styled_default(ys())({name:"CheckIcon",class:"c1mo15kk",propsAsIs:!0}),xs=()=>e.k1,js=e.styled_default(xs())({name:"PredictionIcon",class:"p16zkqnm",propsAsIs:!0}),Is=e.styled_default("div")({name:"PredictionIconContainer",class:"pjszi7a",propsAsIs:!1}),vs=e.styled_default("div")({name:"BodyContainer",class:"bftbmo3",propsAsIs:!1}),hs=e.styled_default("div")({name:"Body",class:"barrbyu",propsAsIs:!1}),As=e.styled_default("div")({name:"Subtitle",class:"sz7237i",propsAsIs:!1}),gs=({step:n,children:a,answer:i,state:o="pending"})=>{const[t,r]=p.useState(0),[d]=p.useState(()=>new ResizeObserver(u=>{var m,y;r((y=(m=u==null?void 0:u[0])==null?void 0:m.contentRect)==null?void 0:y.width)})),l=p.useCallback(u=>{u||d.disconnect(),d.observe(u)},[d]);return p.useMemo(()=>()=>{d.disconnect()},[d]),s.jsxs(ms,{children:[s.jsx(Is,{children:s.jsx(js,{name:"icon-prediction"})}),s.jsx(vs,{style:{minWidth:`${t}px`},children:s.jsx(hs,{children:a},n)}),s.jsx(As,{ref:l,className:o,children:s.jsxs("div",{children:[s.jsx(fs,{name:"icon-check"}),"Your Pick: ",i]})})]})},$s=e.styled_default("div")({name:"Container",class:"ckyzolp",propsAsIs:!1}),I=e.styled_default("div")({name:"Line",class:"l16t1zr7",propsAsIs:!1}),_s=()=>I,Ts=e.styled_default(_s())({name:"Line1",class:"le78kvg",propsAsIs:!0}),ks=()=>I,Ns=e.styled_default(ks())({name:"Line2",class:"l1o7966d",propsAsIs:!0}),bs=()=>I,Cs=e.styled_default(bs())({name:"Line3",class:"lu9lyxq",propsAsIs:!0}),Ss=()=>s.jsxs($s,{children:[s.jsx(Ts,{children:s.jsx("div",{})}),s.jsx(Ns,{children:s.jsx("div",{})}),s.jsx(Cs,{children:s.jsx("div",{})})]}),ws=e.styled_default("div")({name:"Container",class:"c10jy6zf",propsAsIs:!1}),qs=()=>e.k1,Es=e.styled_default(qs())({name:"CheckIcon",class:"c1c7scay",propsAsIs:!0}),Ms=()=>s.jsxs(ws,{children:[s.jsx(Es,{name:"icon-check"})," Prediction results are in!"]}),Qs=e.styled_default("div")({name:"Container",class:"cf6k2yy",propsAsIs:!1}),Ls=e.styled_default("div")({name:"Caption",class:"c1c8xjus",propsAsIs:!1}),Rs=e.styled_default("div")({name:"Title",class:"t1d1uekn",propsAsIs:!1}),Ds=({title:n})=>s.jsxs(Qs,{children:[s.jsx(Ls,{children:"Results for"}),s.jsx(Rs,{children:n})]}),N=e.styled_default("div")({name:"Container",class:"c181a1as",propsAsIs:!1}),b=e.styled_default("div")({name:"Title",class:"t1cduox6",propsAsIs:!1}),zs=()=>e.k1,C=e.styled_default(zs())({name:"CorrectIcon",class:"c1onrv6j",propsAsIs:!0}),Os=()=>C,Bs=e.styled_default(Os())({name:"InCorrectIcon",class:"i17n9o7e",propsAsIs:!0}),Ps=()=>s.jsxs(N,{children:[s.jsxs(b,{children:["Congratulations!",s.jsx("br",{}),"You answered correctly."]}),s.jsx(C,{name:"icon-check"})]}),Us=({title:n})=>s.jsxs(N,{children:[s.jsxs(b,{children:["Better luck next time!",s.jsx("br",{}),"Correct: ",n]}),s.jsx(Bs,{name:"icon-cross"})]}),Vs=e.styled_default("div")({name:"Container",class:"cnxgcs2",propsAsIs:!1}),Fs=e.styled_default("div")({name:"Title",class:"t903f8n",propsAsIs:!1}),Ws=()=>e.k1,Ks=e.styled_default(Ws())({name:"CheckIcon",class:"ceyu3qj",propsAsIs:!0}),Gs=({points:n})=>s.jsxs(Vs,{children:[s.jsxs(Fs,{children:["You won ",s.jsx(e.d,{delay:.5,prefix:"+",suffix:" points",value:n})]}),s.jsx(Ks,{name:"icon-trophy-solid"})]}),$=e.styled_default("div")({name:"Container",class:"cq3agu2",propsAsIs:!1}),_=e.styled_default("div")({name:"Body",class:"b16qj0do",propsAsIs:!1}),T={1:3e3,2:4e3,3:4e3,4:4e3},Ys=({close:n,action:a,setStep:i,votedAnswer:o,correct:t,correctAnswerTitle:r,questionTitle:d,step:l})=>{if(p.useEffect(()=>{if(i){const m=setTimeout(()=>{T[l+1]&&(t||l<3)?i(l+1):n==null||n()},T[l]);return()=>{m&&clearTimeout(m)}}return()=>{}},[i,l,n,t]),l===1)return s.jsx($,{children:s.jsx(_,{children:s.jsx(Ms,{})})});let u="pending";return(l===3||l===4)&&(u=t?"correct":"incorrect"),s.jsx($,{onClick:()=>a==null?void 0:a(),children:s.jsxs(_,{children:[l!==1&&s.jsx(Ss,{},l),s.jsxs(gs,{state:u,step:l,answer:(o==null?void 0:o.title)||"unknown",children:[l===2&&s.jsx(Ds,{title:d||"unknown"}),l===3&&t&&s.jsx(Ps,{}),l===3&&!t&&s.jsx(Us,{title:r||"unknown"}),l===4&&s.jsx(Gs,{points:(o==null?void 0:o.points)||0})]})]})})},Hs=({close:n,action:a,votedAnswer:i,correct:o,correctAnswerTitle:t,questionTitle:r})=>{const[d,l]=p.useState(1);return s.jsx(Ys,{close:n,action:a,votedAnswer:i,correct:o,correctAnswerTitle:t,questionTitle:r,setStep:l,step:d,title:""})},Js=e.styled_default("div")({name:"NotificationContainer",class:"n1i4h28u",propsAsIs:!1}),Xs=n=>s.jsx(Js,{children:s.jsx(Hs,{...n})}),S=({sdk:n})=>{const[a]=p.useState(n.getNotificationsStore()),i=e.useStore(a),o=n.getFeature(c.SdkOverlayType.GAMES),t=p.useMemo(()=>n.getActiveNotification(),[n,i]);return p.useEffect(()=>{t&&e.eventBus.emit("notification",{action:"rendered",payload:{questionId:t.data.questionId,questionType:t.data.questionType}})},[t]),t&&t.type===e.NotificationType.QUESTION_RESOLVED?t.data.question&&t.data.questionType===c.QuestionType.PREDICTION?s.jsx(Xs,{action:t.action,close:t.close,...t.data.question}):null:t&&t.type===e.NotificationType.ONBOARDING?t.data.onboarding?s.jsx(ps,{open:o==null?void 0:o.openFeature,close:t.close,...t.data.onboarding}):null:t&&s.jsx(es,{...t.data,action:t.action})},Zs=({theme:n})=>{const a=e.useStreamLayer(),i=e.useStreamLayerTheme(),o=e.useStreamLayerUI();return a&&(o.appNotification||o.onboardingNotification)?o.app&&!o.onboardingNotification?null:s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(e.h,{customTheme:n??i.theme,themeMode:i.themeMode,children:s.jsx(S,{sdk:a})})}):null};exports.StreamLayerSDKNotification=Zs;exports.StreamLayerSDKNotificationUI=S;
|
package/lib/cjs/points.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),e=require("./provider.js"),c=require("./useStreamLayerApp2.js"),d=e.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),p=e.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),m=()=>e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),e=require("./provider.js"),c=require("./useStreamLayerApp2.js"),d=e.styled_default("div")({name:"PointsContainer",class:"psiob9b",propsAsIs:!1}),p=e.styled_default("div")({name:"PointsIcon",class:"p1gqe4lh",propsAsIs:!1}),m=()=>e.k1,y=e.styled_default(m())({name:"PointsSvg",class:"p15syg2y",propsAsIs:!0}),S=e.styled_default("div")({name:"PointsBody",class:"p12n4f2h",propsAsIs:!1}),h=e.styled_default("div")({name:"PointsTitle",class:"poqmx89",propsAsIs:!1}),v=e.styled_default("div")({name:"PointsValue",class:"prj9b3v",propsAsIs:!1}),f=({points:t,onClick:n})=>s.jsxs(d,{className:e.h$1,onClick:n,children:[s.jsx(p,{children:s.jsx(y,{name:"icon-trophy-solid"})}),s.jsxs(S,{children:[s.jsx(h,{children:"Total points"}),s.jsx(v,{children:s.jsx(e.d,{value:t})})]})]}),j=({gamification:t})=>{const n=t.userSummary.$store,[r,u]=l.useState(0);return l.useEffect(()=>{const a=n.subscribe(o=>{var i;(i=o==null?void 0:o.summary)!=null&&i.points&&u(o.summary.points)});return()=>{a()}},[n]),s.jsx(f,{points:r,onClick:()=>{const a=t.status.get();a===e.FeatureStatus.Suspended?(t.openFeature(),e.eventBus.emit("app",{action:"open",payload:{}})):a===e.FeatureStatus.Ready&&(t.closeFeature(!1),e.eventBus.emit("app",{action:"close",payload:{}}))}})},x=({sdk:t})=>{if(!e.useStore(t.featuresList.getStore()))return null;const n=t.getFeature(c.SdkOverlayType.GAMES);return n?s.jsx(j,{gamification:n}):null},g=({theme:t})=>{const n=e.useStreamLayer(),r=e.useStreamLayerTheme();return n?s.jsx("div",{className:"StreamLayerSDK",children:s.jsx(e.h,{customTheme:t??r.theme,themeMode:r.themeMode,children:s.jsx(x,{sdk:n})})}):null};exports.StreamLayerSDKPoints=g;
|