@streamlayer/react 1.9.6 → 1.9.7

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),t=require("./index2.js"),u=require("./useStreamLayerApp2.js"),pe=t.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),ye="a1rlj479",ve="s35f1di",fe="sj4471g",Ae="b12050d8",ge="b1d5ybek",Ie=e=>e==="left"||e==="right"?ve:Ae,xe=e=>e==="left"||e==="right"?fe:ge,he=e=>e==="left"?"avdxyl3":e==="right"?"a1bisd08":e==="top"?"a1u9y2aj":"a1qqaks",B=({children:e,style:s,className:l,enabled:n=!0,hiding:r,direction:a="left",onAnimationEnd:c})=>o.jsx(pe,{style:s,className:t.cx_default(l,ye,he(a),n&&!r&&Ie(a),n&&r&&xe(a)),onAnimationEnd:c,children:e}),je=t.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),_e=t.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),be=()=>je,Ne=t.styled_default(be())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Pe=({promotion:e,promotionId:s,hiding:l,direction:n="bottom"})=>{var r,a;if(!((r=e.additionalBanner)!=null&&r.imageUrl))return null;let c=(a=e.additionalBanner)==null?void 0:a.url;return c&&c.indexOf("http")!==0&&(c=`https://${c}`),o.jsx(B,{direction:n,hiding:l,children:o.jsx(_e,{className:"BannerContainer",children:o.jsx(Ne,{as:c?"a":"span",className:"BannerLink",href:c,style:{backgroundImage:`url(${e.additionalBanner.imageUrl})`,cursor:c?"pointer":"default"},"data-promo-id":s,"data-promo-type":e.type,"data-analytics":"banner",target:"_blank"})})})},Se=t.styled_default("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:!1}),Te=t.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),$e=t.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),Ee=t.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),R=t.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Ce=()=>R,Le=t.styled_default(Ce())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),Me=t.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),ke=t.styled_default("button")({name:"Button",class:"bgl6boa",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),Be=t.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Re=t.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),De=t.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),qe={[u.NotificationPromotionImagePosition.BOTTOM]:R,[u.NotificationPromotionImagePosition.MIDDLE]:Le},we=({src:e,imagePosition:s})=>{const l=qe[s]||R;return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},Ve=({notification:e,open:s})=>{if(!e||!e.promotion||e.enabled!==u.NotificationEnabled.NOTIFICATION_ENABLED)return null;const{title:l,body:n,image:r,promotion:a}=e,{sponsorLogo:c,sponsorLogoMode:p,imagePosition:v,ctaButton:i}=a;return o.jsxs(De,{className:"SL_Lower_Third_Notification",onClick:s,children:[o.jsxs(Se,{children:[o.jsx(we,{src:r,imagePosition:v}),o.jsxs(Te,{children:[l&&o.jsx($e,{children:l}),n&&o.jsx(Ee,{children:n})]})]}),o.jsxs(Be,{children:[p!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsxs(o.Fragment,{children:[o.jsx(Oe,{children:o.jsx("img",{src:c,alt:l})}),o.jsx(Re,{})]}),o.jsxs(ke,{name:"promo-button",style:{color:i==null?void 0:i.textColor,backgroundColor:i==null?void 0:i.color},children:[(i==null?void 0:i.ctaIcon)&&(i==null?void 0:i.ctaIconMode)===u.CtaIconMode.CTA_ICON_TRANSPARENT&&o.jsx(Me,{src:i==null?void 0:i.ctaIcon,alt:"cta-icon"}),(i==null?void 0:i.label)||"Open"]})]})]})},Fe=t.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Ue=t.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),ze=t.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),Ge=t.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Ke=t.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),C=t.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),We=()=>C,Z=t.styled_default(We())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),He=()=>C,te=t.styled_default(He())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),Ye=()=>te,Je=t.styled_default(Ye())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Ze=()=>C,Qe=t.styled_default(Ze())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),Xe=()=>C,eo=t.styled_default(Xe())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),oo=t.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),to=t.styled_default("button")({name:"Button",class:"bis90pl",propsAsIs:!1}),so=()=>t.h1,no=t.styled_default(so())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),lo=t.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),io={[u.NotificationPromotionImagePosition.UNSET]:Z,[u.NotificationPromotionImagePosition.FIT]:Z,[u.NotificationPromotionImagePosition.CENTERED]:te,[u.NotificationPromotionImagePosition.BOTTOM]:Je,[u.NotificationPromotionImagePosition.SOLID]:Qe,[u.NotificationPromotionImagePosition.MIDDLE]:eo},ao=({src:e,imagePosition:s})=>{const l=io[s];return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},ro=({notification:e,open:s,promotionId:l,hiding:n,direction:r="left"})=>{if(!e||!e.promotion||e.enabled!==u.NotificationEnabled.NOTIFICATION_ENABLED)return null;if(e.promotion.mode===u.NotificationPromotionMode.LOWER_THIRD)return o.jsx(Ve,{notification:e,open:s});const{title:a,body:c,image:p,promotion:v}=e,{sponsorLogo:i,sponsorLogoMode:f,imagePosition:y,ctaButton:m}=v;return o.jsx(B,{className:"SL_Rich_Notification",direction:r,hiding:n,children:o.jsxs(Ue,{onClick:s,children:[f!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsx(lo,{children:o.jsx("img",{src:i,alt:a})}),o.jsxs(Fe,{children:[o.jsx(ao,{src:p,imagePosition:y}),o.jsxs(ze,{children:[a&&o.jsx(Ge,{children:a}),c&&o.jsx(Ke,{children:c})]}),o.jsxs(to,{name:"promo-button",style:{color:m==null?void 0:m.textColor,backgroundColor:m==null?void 0:m.color},children:[(m==null?void 0:m.ctaIcon)&&(m==null?void 0:m.ctaIconMode)===u.CtaIconMode.CTA_ICON_TRANSPARENT&&o.jsx(oo,{src:m==null?void 0:m.ctaIcon,alt:"cta-icon"}),(m==null?void 0:m.label)||"Open"]}),o.jsx(no,{name:"chevronRight"})]})]})})},co=t.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),se=t.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),ne=t.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),le=t.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),ie="h10toh7",Q=t.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),mo=t.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),ae=t.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),uo=t.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),po="s1nmch9k",X=t.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),yo=t.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),vo=t.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),fo=t.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),re=t.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),Ao=t.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),go=t.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),Io=t.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),xo=t.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),ho="h17rwbtk",jo=t.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),ee=t.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),_o=t.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),bo=({time:e,adCount:s,adPosition:l})=>{const n=Math.floor(e/60),r=e-n*60;return n===0&&r===0&&s===l?null:o.jsxs(jo,{children:[s>1&&o.jsxs(o.Fragment,{children:[o.jsxs(ee,{children:[l," of ",s]}),o.jsx(_o,{})]}),o.jsxs(ee,{children:[n,":",r<10?`0${r}`:r]})]})},No=(e,s,{onPlay:l,onStop:n,onProgress:r})=>{const a=google.ima;let c=new a.AdDisplayContainer(e),p=new a.AdsLoader(c),v=new a.AdsRequest,i;p.addEventListener(a.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,y=>{i=y.getAdsManager(e),l&&i.addEventListener(a.AdEvent.Type.STARTED,l),n&&i.addEventListener(a.AdEvent.Type.COMPLETE,n),r&&i.addEventListener(a.AdEvent.Type.AD_PROGRESS,m=>r(m.getAdData())),i.init(e.clientWidth,e.clientHeight,a.ViewMode.NORMAL),i.start()},!1),p.addEventListener(a.AdErrorEvent.Type.AD_ERROR,()=>{console.log("ad error"),n==null||n()},!1),v.linearAdSlotWidth=e.clientWidth,v.linearAdSlotHeight=e.clientHeight,v.adTagUrl=s,p.requestAds(v);const f=()=>{i==null||i.destroy(),p==null||p.destroy(),c==null||c.destroy(),c=void 0,p=void 0,v=void 0,i=void 0};return()=>{try{c.initialize()}catch(y){n==null||n(),console.log("AdsManager could not be started",y)}return f}},Po=t.styled_default("div")({name:"Container",class:"c4q6dw1",propsAsIs:!1}),So=t.styled_default("div")({name:"ControlsContainer",class:"c1la67r",propsAsIs:!1}),To="m3guev",$o="m7099mt",Eo="mmm6o5s",Co=({promotion:e,controlVideo:s,promotionId:l,onClose:n,externalAd:r,skipAutoClose:a})=>{var c;const p=g.useRef(null),[v,i]=g.useState(!1),[f,y]=g.useState(0),[m,I]=g.useState(0),[_,A]=g.useState(0),x=g.useRef(),h=g.useCallback(()=>{y(0),I(0),A(0),i(!1),s==null||s({muted:!1})},[s]);g.useEffect(()=>{if(r!=null&&r.url&&p.current){h();const j=No(p.current,r.url,{onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:l,type:e.type}}),s==null||s({muted:!0}),i(!0)},onStop:()=>{n==null||n(),h()},onProgress:b=>{y(Math.round(b.duration-b.currentTime)),I(b.totalAds),A(b.adPosition)}})();return x.current=j,()=>{x.current=void 0,j()}}},[r==null?void 0:r.url,s,h,l,e.type,n]);const S=((c=e.sponsor)==null?void 0:c.logo)&&e.logoMode===u.PromotionLogoMode.CENTER;return o.jsxs(se,{className:"PromoOverlay",children:[o.jsxs(ne,{children:[o.jsx(le,{className:t.cx_default(!S&&ie),children:o.jsx(re,{style:{transform:"scale(1.5)"},children:"Ad"})}),o.jsxs(So,{children:[o.jsx(bo,{time:f,adCount:m,adPosition:_}),a&&o.jsx(t.b,{className:"ClosePromoIcon",close:()=>{var j;(j=x.current)==null||j.call(x),n==null||n(),h()}})]})]}),o.jsx(ae,{className:t.cx_default(To,v&&$o,!v&&Eo),children:o.jsx(Po,{ref:p})})]})},oe=e=>{var s,l,n,r,a,c,p,v,i,f,y,m,I,_,A,x,h,S,j,b,D,q,w,V,F,U,z,G,K,W;const{promotion:d,open:H,advertisementPaused:ce,togglePause:N,controlVideo:T,skipAutoClose:me,promotionId:$,onClose:ue,markAsViewed:L,externalAd:Y}=e,M=d.type===u.PromotionType.INGAME_IAB11_LBAR||d.type===u.PromotionType.INGAME_IAB11,k=((s=d.sponsor)==null?void 0:s.logo)&&d.logoMode===u.PromotionLogoMode.CENTER,J=!!((n=(l=d.banner)==null?void 0:l.video)!=null&&n.url),E=d.autoPlayVideo===u.AutoPlayVideo.ENABLED;if(g.useEffect(()=>{N==null||N(J||E),H==null||H()},[]),g.useEffect(()=>{$&&d.type&&L&&L()},[$,d.type,L]),g.useEffect(()=>()=>{T==null||T({muted:!1})},[T]),Y)return o.jsx(Co,{...e,externalAd:Y});let P=(r=d.banner)==null?void 0:r.url;P&&P.indexOf("http")!==0&&(P=`https://${P}`);let O=!0;return J&&(!ce||!E?O=!0:O=!1),o.jsxs(se,{className:"PromoOverlay",children:[o.jsxs(ne,{children:[o.jsxs(le,{className:t.cx_default(!k&&ie),children:[((a=d.sponsor)==null?void 0:a.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(Q,{src:(c=d.sponsor)==null?void 0:c.logo,alt:"promo"}),o.jsxs(vo,{style:{paddingLeft:(p=d.sponsor)!=null&&p.logo&&d.logoMode===u.PromotionLogoMode.LEFT?"0px":"8px"},children:[((v=d.sponsor)==null?void 0:v.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(mo,{children:(i=d.sponsor)==null?void 0:i.name}),o.jsxs(fo,{className:"SponsorText",children:[o.jsx(re,{children:"AD"}),o.jsx(Ao,{children:"SPONSORED"})]})]})]}),o.jsx(t.b,{className:"ClosePromoIcon",close:ue,autoClose:(f=d.closeTimer)==null?void 0:f.auto,duration:me?0:(y=d.closeTimer)==null?void 0:y.seconds,isPlaying:O})]}),o.jsxs(ae,{children:[k&&o.jsx(Q,{className:po,src:(m=d.sponsor)==null?void 0:m.logo,alt:"promo"}),o.jsx(X,{children:(_=(I=d.banner)==null?void 0:I.video)!=null&&_.url?o.jsx(t.Y,{source:(x=(A=d.banner)==null?void 0:A.video)==null?void 0:x.url,poster:(S=(h=d.banner)==null?void 0:h.video)==null?void 0:S.thumbnailUrl,aspectRatio:M?"1/1":"16/9",onPause:()=>{E&&(N==null||N(!0))},onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:$,type:d.type}}),N==null||N(!1)},controlVideo:T,autoPlay:E}):(j=d.banner)!=null&&j.imageUrl?o.jsx(uo,{style:M?{aspectRatio:"1/1"}:{},src:(b=d.banner)==null?void 0:b.imageUrl,alt:"promo"}):null}),!M&&o.jsxs(X,{children:[((D=d.banner)==null?void 0:D.title)&&o.jsx(xo,{className:t.cx_default("AdvTitle",k&&ho),children:(q=d.banner)==null?void 0:q.title}),((w=d.banner)==null?void 0:w.body)&&o.jsx(yo,{className:"AdvDescription",children:(V=d.banner)==null?void 0:V.body})]})]}),d.buttonType!==u.PromotionButtonType.NO_BUTTON&&o.jsx(go,{children:o.jsx(Io,{href:P,style:{backgroundColor:((U=(F=d.banner)==null?void 0:F.ctaButton)==null?void 0:U.color)||"#009dc4",color:((G=(z=d.banner)==null?void 0:z.ctaButton)==null?void 0:G.textColor)||"#fff"},"data-analytics":"button","data-promo-id":$,"data-promo-type":d.type,target:"_blank",children:(W=(K=d.banner)==null?void 0:K.ctaButton)==null?void 0:W.label})})]})},Lo=t.styled_default("div")({name:"SidebarContainer",class:"s1abskp8",propsAsIs:!1}),Mo=({children:e,direction:s,style:l,className:n,hiding:r})=>o.jsx(B,{direction:s,style:l,hiding:r,className:n,children:o.jsx(Lo,{children:e})}),ko=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11_LBAR||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21_LBAR,Oo=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21,Bo=({advertisement:e,close:s,skipTypeCheck:l,skipAutoClose:n,layoutMode:r="side-by-side",sidebar:a,isNotification:c,banner:p,markAsViewed:v,open:i,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:I})=>e.promotion?c&&e.notification?o.jsx(ro,{open:()=>i==null?void 0:i({fromNotification:!0}),notification:e.notification,promotionId:e.question.id}):!a&&!p&&(l||Oo(e.promotion))?o.jsx(co,{className:"PromoOverlayContainer",children:o.jsx(oe,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,onClose:s,open:i,skipAutoClose:n,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:I})}):a&&(l||ko(e.promotion))?o.jsx(Mo,{className:"PromoSidebarContainer",direction:a,hiding:!1,children:o.jsx(oe,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,externalAd:f,onClose:s,open:i,controlVideo:y,skipAutoClose:n,advertisementPaused:m,togglePause:I})}):p?o.jsx(Pe,{promotionId:e.question.id,hiding:!1,promotion:e.promotion,direction:p}):null:null,Ro=t.styled_default("div")({name:"AdvertisementUIWrap",class:"aa6pjif",propsAsIs:!1}),Do=e=>{const s=e.target;if(s instanceof HTMLAnchorElement&&s.target==="_blank"){const l=s.getAttribute("data-promo-id")||"",n=s.getAttribute("data-promo-type")||u.PromotionType.UNSET;s.getAttribute("data-analytics")==="button"&&t.eventBus.emit("advertisement",{action:"buttonSelect",payload:{id:l,type:n}}),s.getAttribute("data-analytics")==="banner"&&t.eventBus.emit("advertisement",{action:"bannerSelect",payload:{id:l,type:n}})}},qo=({gamification:e,layoutMode:s,skipAutoClose:l,skipTypeCheck:n,sidebar:r,banner:a,notification:c,isMobileScreen:p,persistent:v,externalAd:i,controlVideo:f})=>{var y,m,I;const _=g.useRef(null),A=t.useStore(e.advertisement.$store);t.L(_,{enabled:!!A.data,event:"click",listener:Do});const x=!a&&!r;if(A.data===void 0||!v&&A.isViewed)return null;const h=((I=(m=(y=A==null?void 0:A.data)==null?void 0:y.notification)==null?void 0:m.promotion)==null?void 0:I.mode)===u.NotificationPromotionMode.LOWER_THIRD;return o.jsx(Ro,{ref:_,style:{height:x?"auto":"100%"},className:t.cx_default("SL-AdvertisementUIWrap",p&&"mobile-view",h&&"SL-AdvertisementUIWrap--lower-third"),children:o.jsx(Bo,{skipTypeCheck:n,sidebar:r,banner:a,advertisement:A.data,advertisementPaused:A.isPaused,togglePause:A.togglePause,close:A.close,externalAd:i?A.externalAd:void 0,markAsViewed:e.advertisement.markAsViewed,open:e.advertisement.open,layoutMode:s,isNotification:c,skipAutoClose:l,controlVideo:f})})},de=({sdk:e,sidebar:s,externalAd:l,banner:n,skipAutoClose:r,skipTypeCheck:a,layoutMode:c,isMobileScreen:p,persistent:v,notification:i})=>{const f=t.useStore(e.featuresList.getStore());if(g.useEffect(()=>{if(l){const m=document.createElement("script");m.async=!0,m.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",document.body.appendChild(m)}},[l]),s&&n)return o.jsx("div",{style:{color:"red"},children:"define either sidebar or banner, not both."});if(n&&l)return o.jsx("div",{style:{color:"red"},children:"externalAd is not supported with banner"});if(!f)return null;const y=e.getFeature(u.SdkOverlayType.GAMES);return y?o.jsx(qo,{gamification:y,sidebar:s,banner:n,layoutMode:c,isMobileScreen:p,persistent:v,notification:i,skipTypeCheck:a,skipAutoClose:r,externalAd:l,controlVideo:e.controlVideoPlayer}):null},wo=({event:e,sidebar:s,banner:l,isMobileScreen:n,skipAutoClose:r,persistent:a,theme:c,notification:p,skipTypeCheck:v,externalAd:i})=>{const f=t.useStreamLayer(),y=t.useStreamLayerUI(),m=t.useStreamLayerTheme();return f?i&&!y.promotionExternalAd?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):!i&&y.promotionExternalAd?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):s&&!y.promotionSidebar?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):l&&!y.promotionBanner?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):p&&!y.promotionNotification?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):!l&&!s&&!p&&!y.promotionOverlay?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):o.jsxs("div",{className:"StreamLayerSDK",children:[o.jsx(t.d,{customTheme:c??m,children:o.jsx(de,{sdk:f,sidebar:s,banner:l,isMobileScreen:n,persistent:a,notification:p,skipTypeCheck:v,skipAutoClose:r,layoutMode:"side-by-side",externalAd:i})}),e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e})]}):null};exports.StreamLayerSDKAdvertisement=wo;exports.StreamLayerSDKAdvertisementUI=de;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),g=require("react"),t=require("./index2.js"),u=require("./useStreamLayerApp2.js"),pe=t.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),ye="a1rlj479",ve="s35f1di",fe="sj4471g",Ae="b12050d8",ge="b1d5ybek",Ie=e=>e==="left"||e==="right"?ve:Ae,xe=e=>e==="left"||e==="right"?fe:ge,he=e=>e==="left"?"avdxyl3":e==="right"?"a1bisd08":e==="top"?"a1u9y2aj":"a1qqaks",B=({children:e,style:s,className:l,enabled:n=!0,hiding:r,direction:a="left",onAnimationEnd:c})=>o.jsx(pe,{style:s,className:t.cx_default(l,ye,he(a),n&&!r&&Ie(a),n&&r&&xe(a)),onAnimationEnd:c,children:e}),je=t.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),_e=t.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),be=()=>je,Ne=t.styled_default(be())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Pe=({promotion:e,promotionId:s,hiding:l,direction:n="bottom"})=>{var r,a;if(!((r=e.additionalBanner)!=null&&r.imageUrl))return null;let c=(a=e.additionalBanner)==null?void 0:a.url;return c&&c.indexOf("http")!==0&&(c=`https://${c}`),o.jsx(B,{direction:n,hiding:l,children:o.jsx(_e,{className:"BannerContainer",children:o.jsx(Ne,{as:c?"a":"span",className:"BannerLink",href:c,style:{backgroundImage:`url(${e.additionalBanner.imageUrl})`,cursor:c?"pointer":"default"},"data-promo-id":s,"data-promo-type":e.type,"data-analytics":"banner",target:"_blank"})})})},Se=t.styled_default("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:!1}),Te=t.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),$e=t.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),Ee=t.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),R=t.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Ce=()=>R,Le=t.styled_default(Ce())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),Me=t.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),ke=t.styled_default("button")({name:"Button",class:"bgl6boa",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),Be=t.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Re=t.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),De=t.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),qe={[u.NotificationPromotionImagePosition.BOTTOM]:R,[u.NotificationPromotionImagePosition.MIDDLE]:Le},we=({src:e,imagePosition:s})=>{const l=qe[s]||R;return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},Ve=({notification:e,open:s})=>{if(!e||!e.promotion||e.enabled!==u.NotificationEnabled.NOTIFICATION_ENABLED)return null;const{title:l,body:n,image:r,promotion:a}=e,{sponsorLogo:c,sponsorLogoMode:p,imagePosition:v,ctaButton:i}=a;return o.jsxs(De,{className:"SL_Lower_Third_Notification",onClick:s,children:[o.jsxs(Se,{children:[o.jsx(we,{src:r,imagePosition:v}),o.jsxs(Te,{children:[l&&o.jsx($e,{children:l}),n&&o.jsx(Ee,{children:n})]})]}),o.jsxs(Be,{children:[p!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsxs(o.Fragment,{children:[o.jsx(Oe,{children:o.jsx("img",{src:c,alt:l})}),o.jsx(Re,{})]}),o.jsxs(ke,{name:"promo-button",style:{color:i==null?void 0:i.textColor,backgroundColor:i==null?void 0:i.color},children:[(i==null?void 0:i.ctaIcon)&&(i==null?void 0:i.ctaIconMode)===u.CtaIconMode.CTA_ICON_TRANSPARENT&&o.jsx(Me,{src:i==null?void 0:i.ctaIcon,alt:"cta-icon"}),(i==null?void 0:i.label)||"Open"]})]})]})},Fe=t.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Ue=t.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),ze=t.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),Ge=t.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Ke=t.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),C=t.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),We=()=>C,Z=t.styled_default(We())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),He=()=>C,te=t.styled_default(He())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),Ye=()=>te,Je=t.styled_default(Ye())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Ze=()=>C,Qe=t.styled_default(Ze())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),Xe=()=>C,eo=t.styled_default(Xe())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),oo=t.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),to=t.styled_default("button")({name:"Button",class:"bis90pl",propsAsIs:!1}),so=()=>t.h1,no=t.styled_default(so())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),lo=t.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),io={[u.NotificationPromotionImagePosition.UNSET]:Z,[u.NotificationPromotionImagePosition.FIT]:Z,[u.NotificationPromotionImagePosition.CENTERED]:te,[u.NotificationPromotionImagePosition.BOTTOM]:Je,[u.NotificationPromotionImagePosition.SOLID]:Qe,[u.NotificationPromotionImagePosition.MIDDLE]:eo},ao=({src:e,imagePosition:s})=>{const l=io[s];return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},ro=({notification:e,open:s,promotionId:l,hiding:n,direction:r="left"})=>{if(!e||!e.promotion||e.enabled!==u.NotificationEnabled.NOTIFICATION_ENABLED)return null;if(e.promotion.mode===u.NotificationPromotionMode.LOWER_THIRD)return o.jsx(Ve,{notification:e,open:s});const{title:a,body:c,image:p,promotion:v}=e,{sponsorLogo:i,sponsorLogoMode:f,imagePosition:y,ctaButton:m}=v;return o.jsx(B,{className:"SL_Rich_Notification",direction:r,hiding:n,children:o.jsxs(Ue,{onClick:s,children:[f!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsx(lo,{children:o.jsx("img",{src:i,alt:a})}),o.jsxs(Fe,{children:[o.jsx(ao,{src:p,imagePosition:y}),o.jsxs(ze,{children:[a&&o.jsx(Ge,{children:a}),c&&o.jsx(Ke,{children:c})]}),o.jsxs(to,{name:"promo-button",style:{color:m==null?void 0:m.textColor,backgroundColor:m==null?void 0:m.color},children:[(m==null?void 0:m.ctaIcon)&&(m==null?void 0:m.ctaIconMode)===u.CtaIconMode.CTA_ICON_TRANSPARENT&&o.jsx(oo,{src:m==null?void 0:m.ctaIcon,alt:"cta-icon"}),(m==null?void 0:m.label)||"Open"]}),o.jsx(no,{name:"chevronRight"})]})]})})},co=t.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),se=t.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),ne=t.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),le=t.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),ie="h10toh7",Q=t.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),mo=t.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),ae=t.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),uo=t.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),po="s1nmch9k",X=t.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),yo=t.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),vo=t.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),fo=t.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),re=t.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),Ao=t.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),go=t.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),Io=t.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),xo=t.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),ho="h17rwbtk",jo=t.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),ee=t.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),_o=t.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),bo=({time:e,adCount:s,adPosition:l})=>{const n=Math.floor(e/60),r=e-n*60;return n===0&&r===0&&s===l?null:o.jsxs(jo,{children:[s>1&&o.jsxs(o.Fragment,{children:[o.jsxs(ee,{children:[l," of ",s]}),o.jsx(_o,{})]}),o.jsxs(ee,{children:[n,":",r<10?`0${r}`:r]})]})},No=(e,s,{onPlay:l,onStop:n,onProgress:r})=>{const a=google.ima;let c=new a.AdDisplayContainer(e),p=new a.AdsLoader(c),v=new a.AdsRequest,i;p.addEventListener(a.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,y=>{i=y.getAdsManager(e),l&&i.addEventListener(a.AdEvent.Type.STARTED,l),n&&i.addEventListener(a.AdEvent.Type.COMPLETE,n),r&&i.addEventListener(a.AdEvent.Type.AD_PROGRESS,m=>r(m.getAdData())),i.init(e.clientWidth,e.clientHeight,a.ViewMode.NORMAL),i.start()},!1),p.addEventListener(a.AdErrorEvent.Type.AD_ERROR,()=>{console.log("ad error"),n==null||n()},!1),v.linearAdSlotWidth=e.clientWidth,v.linearAdSlotHeight=e.clientHeight,v.adTagUrl=s,p.requestAds(v);const f=()=>{i==null||i.destroy(),p==null||p.destroy(),c==null||c.destroy(),c=void 0,p=void 0,v=void 0,i=void 0};return()=>{try{c.initialize()}catch(y){n==null||n(),console.log("AdsManager could not be started",y)}return f}},Po=t.styled_default("div")({name:"Container",class:"c4q6dw1",propsAsIs:!1}),So=t.styled_default("div")({name:"ControlsContainer",class:"c1la67r",propsAsIs:!1}),To="m3guev",$o="m7099mt",Eo="mmm6o5s",Co=({promotion:e,controlVideo:s,promotionId:l,onClose:n,externalAd:r,skipAutoClose:a})=>{var c;const p=g.useRef(null),[v,i]=g.useState(!1),[f,y]=g.useState(0),[m,I]=g.useState(0),[_,A]=g.useState(0),x=g.useRef(),h=g.useCallback(()=>{y(0),I(0),A(0),i(!1),s==null||s({muted:!1})},[s]);g.useEffect(()=>{if(r!=null&&r.url&&p.current){h();const j=No(p.current,r.url,{onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:l,type:e.type}}),s==null||s({muted:!0}),i(!0)},onStop:()=>{n==null||n(),h()},onProgress:b=>{y(Math.round(b.duration-b.currentTime)),I(b.totalAds),A(b.adPosition)}})();return x.current=j,()=>{x.current=void 0,j()}}},[r==null?void 0:r.url,s,h,l,e.type,n]);const S=((c=e.sponsor)==null?void 0:c.logo)&&e.logoMode===u.PromotionLogoMode.CENTER;return o.jsxs(se,{className:"PromoOverlay",children:[o.jsxs(ne,{children:[o.jsx(le,{className:t.cx_default(!S&&ie),children:o.jsx(re,{style:{transform:"scale(1.5)"},children:"Ad"})}),o.jsxs(So,{children:[o.jsx(bo,{time:f,adCount:m,adPosition:_}),a&&o.jsx(t.b,{className:"ClosePromoIcon",close:()=>{var j;(j=x.current)==null||j.call(x),n==null||n(),h()}})]})]}),o.jsx(ae,{className:t.cx_default(To,v&&$o,!v&&Eo),children:o.jsx(Po,{ref:p})})]})},oe=e=>{var s,l,n,r,a,c,p,v,i,f,y,m,I,_,A,x,h,S,j,b,D,q,w,V,F,U,z,G,K,W;const{promotion:d,open:H,advertisementPaused:ce,togglePause:N,controlVideo:T,skipAutoClose:me,promotionId:$,onClose:ue,markAsViewed:L,externalAd:Y}=e,M=d.type===u.PromotionType.INGAME_IAB11_LBAR||d.type===u.PromotionType.INGAME_IAB11,k=((s=d.sponsor)==null?void 0:s.logo)&&d.logoMode===u.PromotionLogoMode.CENTER,J=!!((n=(l=d.banner)==null?void 0:l.video)!=null&&n.url),E=d.autoPlayVideo===u.AutoPlayVideo.ENABLED;if(g.useEffect(()=>{N==null||N(J||E),H==null||H()},[]),g.useEffect(()=>{$&&d.type&&L&&L()},[$,d.type,L]),g.useEffect(()=>()=>{T==null||T({muted:!1})},[T]),Y)return o.jsx(Co,{...e,externalAd:Y});let P=(r=d.banner)==null?void 0:r.url;P&&P.indexOf("http")!==0&&(P=`https://${P}`);let O=!0;return J&&(!ce||!E?O=!0:O=!1),o.jsxs(se,{className:"PromoOverlay",children:[o.jsxs(ne,{children:[o.jsxs(le,{className:t.cx_default(!k&&ie),children:[((a=d.sponsor)==null?void 0:a.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(Q,{className:"PromoSponsorLogo",src:(c=d.sponsor)==null?void 0:c.logo,alt:"promo"}),o.jsxs(vo,{style:{paddingLeft:(p=d.sponsor)!=null&&p.logo&&d.logoMode===u.PromotionLogoMode.LEFT?"0px":"8px"},children:[((v=d.sponsor)==null?void 0:v.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(mo,{children:(i=d.sponsor)==null?void 0:i.name}),o.jsxs(fo,{className:"SponsorText",children:[o.jsx(re,{children:"AD"}),o.jsx(Ao,{children:"SPONSORED"})]})]})]}),o.jsx(t.b,{className:"ClosePromoIcon",close:ue,autoClose:(f=d.closeTimer)==null?void 0:f.auto,duration:me?0:(y=d.closeTimer)==null?void 0:y.seconds,isPlaying:O})]}),o.jsxs(ae,{children:[k&&o.jsx(Q,{className:po,src:(m=d.sponsor)==null?void 0:m.logo,alt:"promo"}),o.jsx(X,{children:(_=(I=d.banner)==null?void 0:I.video)!=null&&_.url?o.jsx(t.Y,{source:(x=(A=d.banner)==null?void 0:A.video)==null?void 0:x.url,poster:(S=(h=d.banner)==null?void 0:h.video)==null?void 0:S.thumbnailUrl,aspectRatio:M?"1/1":"16/9",onPause:()=>{E&&(N==null||N(!0))},onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:$,type:d.type}}),N==null||N(!1)},controlVideo:T,autoPlay:E}):(j=d.banner)!=null&&j.imageUrl?o.jsx(uo,{style:M?{aspectRatio:"1/1"}:{},src:(b=d.banner)==null?void 0:b.imageUrl,alt:"promo"}):null}),!M&&o.jsxs(X,{children:[((D=d.banner)==null?void 0:D.title)&&o.jsx(xo,{className:t.cx_default("AdvTitle",k&&ho),children:(q=d.banner)==null?void 0:q.title}),((w=d.banner)==null?void 0:w.body)&&o.jsx(yo,{className:"AdvDescription",children:(V=d.banner)==null?void 0:V.body})]})]}),d.buttonType!==u.PromotionButtonType.NO_BUTTON&&o.jsx(go,{children:o.jsx(Io,{href:P,style:{backgroundColor:((U=(F=d.banner)==null?void 0:F.ctaButton)==null?void 0:U.color)||"#009dc4",color:((G=(z=d.banner)==null?void 0:z.ctaButton)==null?void 0:G.textColor)||"#fff"},"data-analytics":"button","data-promo-id":$,"data-promo-type":d.type,target:"_blank",children:(W=(K=d.banner)==null?void 0:K.ctaButton)==null?void 0:W.label})})]})},Lo=t.styled_default("div")({name:"SidebarContainer",class:"s1abskp8",propsAsIs:!1}),Mo=({children:e,direction:s,style:l,className:n,hiding:r})=>o.jsx(B,{direction:s,style:l,hiding:r,className:n,children:o.jsx(Lo,{children:e})}),ko=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11_LBAR||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21_LBAR,Oo=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21,Bo=({advertisement:e,close:s,skipTypeCheck:l,skipAutoClose:n,layoutMode:r="side-by-side",sidebar:a,isNotification:c,banner:p,markAsViewed:v,open:i,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:I})=>e.promotion?c&&e.notification?o.jsx(ro,{open:()=>i==null?void 0:i({fromNotification:!0}),notification:e.notification,promotionId:e.question.id}):!a&&!p&&(l||Oo(e.promotion))?o.jsx(co,{className:"PromoOverlayContainer",children:o.jsx(oe,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,onClose:s,open:i,skipAutoClose:n,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:I})}):a&&(l||ko(e.promotion))?o.jsx(Mo,{className:"PromoSidebarContainer",direction:a,hiding:!1,children:o.jsx(oe,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,externalAd:f,onClose:s,open:i,controlVideo:y,skipAutoClose:n,advertisementPaused:m,togglePause:I})}):p?o.jsx(Pe,{promotionId:e.question.id,hiding:!1,promotion:e.promotion,direction:p}):null:null,Ro=t.styled_default("div")({name:"AdvertisementUIWrap",class:"aa6pjif",propsAsIs:!1}),Do=e=>{const s=e.target;if(s instanceof HTMLAnchorElement&&s.target==="_blank"){const l=s.getAttribute("data-promo-id")||"",n=s.getAttribute("data-promo-type")||u.PromotionType.UNSET;s.getAttribute("data-analytics")==="button"&&t.eventBus.emit("advertisement",{action:"buttonSelect",payload:{id:l,type:n}}),s.getAttribute("data-analytics")==="banner"&&t.eventBus.emit("advertisement",{action:"bannerSelect",payload:{id:l,type:n}})}},qo=({gamification:e,layoutMode:s,skipAutoClose:l,skipTypeCheck:n,sidebar:r,banner:a,notification:c,isMobileScreen:p,persistent:v,externalAd:i,controlVideo:f})=>{var y,m,I;const _=g.useRef(null),A=t.useStore(e.advertisement.$store);t.L(_,{enabled:!!A.data,event:"click",listener:Do});const x=!a&&!r;if(A.data===void 0||!v&&A.isViewed)return null;const h=((I=(m=(y=A==null?void 0:A.data)==null?void 0:y.notification)==null?void 0:m.promotion)==null?void 0:I.mode)===u.NotificationPromotionMode.LOWER_THIRD;return o.jsx(Ro,{ref:_,style:{height:x?"auto":"100%"},className:t.cx_default("SL-AdvertisementUIWrap",p&&"mobile-view",h&&"SL-AdvertisementUIWrap--lower-third"),children:o.jsx(Bo,{skipTypeCheck:n,sidebar:r,banner:a,advertisement:A.data,advertisementPaused:A.isPaused,togglePause:A.togglePause,close:A.close,externalAd:i?A.externalAd:void 0,markAsViewed:e.advertisement.markAsViewed,open:e.advertisement.open,layoutMode:s,isNotification:c,skipAutoClose:l,controlVideo:f})})},de=({sdk:e,sidebar:s,externalAd:l,banner:n,skipAutoClose:r,skipTypeCheck:a,layoutMode:c,isMobileScreen:p,persistent:v,notification:i})=>{const f=t.useStore(e.featuresList.getStore());if(g.useEffect(()=>{if(l){const m=document.createElement("script");m.async=!0,m.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",document.body.appendChild(m)}},[l]),s&&n)return o.jsx("div",{style:{color:"red"},children:"define either sidebar or banner, not both."});if(n&&l)return o.jsx("div",{style:{color:"red"},children:"externalAd is not supported with banner"});if(!f)return null;const y=e.getFeature(u.SdkOverlayType.GAMES);return y?o.jsx(qo,{gamification:y,sidebar:s,banner:n,layoutMode:c,isMobileScreen:p,persistent:v,notification:i,skipTypeCheck:a,skipAutoClose:r,externalAd:l,controlVideo:e.controlVideoPlayer}):null},wo=({event:e,sidebar:s,banner:l,isMobileScreen:n,skipAutoClose:r,persistent:a,theme:c,notification:p,skipTypeCheck:v,externalAd:i})=>{const f=t.useStreamLayer(),y=t.useStreamLayerUI(),m=t.useStreamLayerTheme();return f?i&&!y.promotionExternalAd?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):!i&&y.promotionExternalAd?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):s&&!y.promotionSidebar?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):l&&!y.promotionBanner?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):p&&!y.promotionNotification?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):!l&&!s&&!p&&!y.promotionOverlay?e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e}):o.jsxs("div",{className:"StreamLayerSDK",children:[o.jsx(t.d,{customTheme:c??m,children:o.jsx(de,{sdk:f,sidebar:s,banner:l,isMobileScreen:n,persistent:a,notification:p,skipTypeCheck:v,skipAutoClose:r,layoutMode:"side-by-side",externalAd:i})}),e!==void 0&&o.jsx(t.StreamLayerSDKEvent,{event:e})]}):null};exports.StreamLayerSDKAdvertisement=wo;exports.StreamLayerSDKAdvertisementUI=de;
@@ -14,4 +14,4 @@
14
14
  `),c=`
15
15
  `+n+(o.length?s("│"):" ")+" ";return n+r.join(c)+`
16
16
  `+o.map(function(l,m){var u=m===o.length-1,d=l.nodes&&l.nodes.length,f=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,f,a).slice(n.length+2)}).join("")};const N_=b_,Ir=Symbol("avvio.TimeTree.untrackNode"),Aa=Symbol("avvio.TimeTree.trackNode"),Or=Symbol("avvio.TimeTree.getParent"),vr=Symbol("avvio.TimeTree.getNode"),Ar=Symbol("avvio.TimeTree.addNode");let I_=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Aa](e){this.tableId.set(e.id,e),this.tableLabel.has(e.label)?this.tableLabel.get(e.label).push(e):this.tableLabel.set(e.label,[e])}[Ir](e){this.tableId.delete(e.id);const t=this.tableLabel.get(e.label);if(t.id){this.tableLabel.delete(e.label);return}t.pop(),t.length===0&&this.tableLabel.delete(e.label)}[Or](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[vr](e){return this.tableId.get(e)}[Ar](e,t,n){if(e===null)return this.root={id:"root",label:t,start:n,nodes:[]},this[Aa](this.root),this.root.id;const a=this[Or](e),s=`${t}-${Math.random()}`,o={id:s,parent:e,start:n,label:t,nodes:[]};return a.nodes.push(o),this[Aa](o),s}start(e,t,n=Date.now()){return this[Ar](e,t,n)}stop(e,t=Date.now()){const n=this[vr](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[Ir](n))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const e=n=>(n.label=`${n.label} ${n.diff} ms`,n.nodes.length>0&&(n.nodes=n.nodes.map(a=>e(a))),n),t=e(this.toJSON());return N_(t)}};var O_=I_,qs={exports:{}},is={exports:{}},wa,wr;function v_(){if(wr)return wa;wr=1;var e=1e3,t=e*60,n=t*60,a=n*24,s=a*7,o=a*365.25;wa=function(u,d){d=d||{};var f=typeof u;if(f==="string"&&u.length>0)return r(u);if(f==="number"&&isFinite(u))return d.long?l(u):c(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var f=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*s;case"days":case"day":case"d":return f*a;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function c(u){var d=Math.abs(u);return d>=a?Math.round(u/a)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=a?m(u,d,a,"day"):d>=n?m(u,d,n,"hour"):d>=t?m(u,d,t,"minute"):d>=e?m(u,d,e,"second"):u+" ms"}function m(u,d,f,T){var y=d>=f*1.5;return Math.round(u/f)+" "+T+(y?"s":"")}return wa}function A_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=v_(),n.destroy=m,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let f=0;f<u.length;f++)d=(d<<5)-d+u.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,f=null,T,y;function k(...N){if(!k.enabled)return;const h=k,A=Number(new Date),w=A-(d||A);h.diff=w,h.prev=d,h.curr=A,d=A,N[0]=n.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let b=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(v,R)=>{if(v==="%%")return"%";b++;const I=n.formatters[R];if(typeof I=="function"){const M=N[b];v=I.call(h,M),N.splice(b,1),b--}return v}),n.formatArgs.call(h,N),(h.log||n.log).apply(h,N)}return k.namespace=u,k.useColors=n.useColors(),k.color=n.selectColor(u),k.extend=a,k.destroy=n.destroy,Object.defineProperty(k,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(T!==n.namespaces&&(T=n.namespaces,y=n.enabled(u)),y),set:N=>{f=N}}),typeof n.init=="function"&&n.init(k),k}function a(u,d){const f=n(this.namespace+(typeof d>"u"?":":d)+u);return f.log=this.log,f}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const f=(typeof u=="string"?u:"").split(/[\s,]+/),T=f.length;for(d=0;d<T;d++)f[d]&&(u=f[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(c),...n.skips.map(c).map(d=>"-"+d)].join(",");return n.enable(""),u}function r(u){if(u[u.length-1]==="*")return!0;let d,f;for(d=0,f=n.skips.length;d<f;d++)if(n.skips[d].test(u))return!1;for(d=0,f=n.names.length;d<f;d++)if(n.names[d].test(u))return!0;return!1}function c(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var w_=A_;(function(e,t){t.formatArgs=a,t.save=s,t.load=o,t.useColors=n,t.storage=r(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;l.splice(1,0,m,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(u++,f==="%c"&&(d=u))}),l.splice(d,0,m)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof D<"u"&&"env"in D&&(l=D.env.DEBUG),l}function r(){try{return localStorage}catch{}}e.exports=w_(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(is,is.exports);var Bc=is.exports;const R_=uc,L_=Sc.EventEmitter,M_=ea.inherits,de=Bc("avvio"),{AVV_ERR_READY_TIMEOUT:P_}=Fc,Ra=Symbol.for("plugin-meta");function C_(e,t){return e[Ra]&&e[Ra].name?e[Ra].name:typeof t<"u"&&typeof t!="function"&&t.name?t.name:e.name?e.name:e.toString().split(`
17
- `).slice(0,2).map(n=>n.trim()).join(" -- ")}function D_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=C_(t,n),this.isAfter=a,this.q=R_(e,U_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}M_(qt,L_);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){de("skipping loading of plugin as parent errored and it is not an after",s),D.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return de("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,de("exec",s);let o;const r=l=>{if(a){de("loading complete",s);return}this._error=l,de(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(de("setting up timeout",s,this.timeout),o=setTimeout(function(){de("timed out",s),o=null;const l=new P_(s);l.fn=n,r(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,r);c&&typeof c.then=="function"&&(de("exec: resolving promise",s),c.then(()=>D.nextTick(r),l=>D.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(de("rejecting promise",this.name,n),this._promise.reject(n)):(de("resolving promise",this.name),this._promise.resolve()),this._promise=null,D.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=D_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){de("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){de("finish",this.name,e);const n=()=>{this.loaded||(de("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const a=()=>{if(de("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{de("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else de("delayed",this.name),this.q.drain=()=>{de("drain",this.name),this.q.drain=F_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function U_(e,t){const n=this;D.nextTick(xs.bind(n),e,t)}function xs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,xs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function F_(){}qs.exports=qt;qs.exports.loadPlugin=xs;var B_=qs.exports;const Rr=uc,G_=Sc.EventEmitter,V_=ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:La,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:q_,AVV_ERR_ROOT_PLG_BOOTED:x_,AVV_ERR_READY_TIMEOUT:H_}=Fc,Q_=O_,cs=B_,Bt=Bc("avvio"),xn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function Y_(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new La(s);if(e[o])throw new La(o);if(e[r])throw new La(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Gc.bind(n)}),e[xn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Pa(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Pa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(z_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Pa(m,this)),this):n.close()}}function le(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof le)){const a=new le(e,t,n);return e&&Y_(e,t,a),a}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new Q_,this._readyQ=Rr(this,Vc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Lr},this._closeQ=Rr(this,W_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Lr},this._doStart=null,this._root=new cs(this,j_.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function j_(e,t,n){this._doStart=n,t.autostart&&this.start()}V_(le,G_);le.prototype.start=function(){return this.started=!0,D.nextTick(this._doStart),this};le.prototype.override=function(e,t,n){return e};function $_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new q_(typeof e);return e}le.prototype[xn]=!0;le.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};le.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&D.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(le.prototype,"then",{get:Gc});le.prototype._addPlugin=function(e,t,n){if(e=$_(e),t=t||{},this.booted)throw new x_;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};le.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Vc.call(this,e,s)}return this};le.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};le.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),D.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};le.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),D.nextTick(c)}})};le.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};le.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Lr(){}function Gc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function Vc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>D.nextTick(t),o=>D.nextTick(t,o)):D.nextTick(t);else if(e.length===1)s=e(a),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>D.nextTick(t),o=>D.nextTick(t,o)):D.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else K_.call(this,e,a,n,t)}function K_(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new H_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function W_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>D.nextTick(t),o=>D.nextTick(t,o))):D.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function z_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){D.nextTick(s)},s):D.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){D.nextTick(s)},s):D.nextTick(s)):e(this,s)}}function Pa(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){D.nextTick(s,a)},s):D.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){D.nextTick(s)},s):D.nextTick(s)):e.length===2?e(a,s):e(a,this,s):D.nextTick(s)}}Rs.exports=le;Rs.exports.express=function(e){return le(e,{expose:{use:"load"}})};var J_=Rs.exports;const X_=Oh(J_);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function Z_(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=X_(Object.create({}),{autostart:!1});return r.use(nh,{friendsTab:a.friendsTab}),r.use(Wk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Zk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(th,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Tk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(hk),r.use(Xk),r.use(yh),r.use(Gk),r.use(Ih),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const eE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Qs.useState(null);return Qs.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=Z_(e,n,a,{version:"1.9.6",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Qn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ri;exports.InvitationFrom=Pn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=si;exports.NotificationPromotionMode=ai;exports.NotificationSponsorLogoMode=oi;exports.PickHistoryStatus=It;exports.PromotionButtonType=ci;exports.PromotionLogoMode=li;exports.PromotionType=Te;exports.QuestionImages=ot;exports.QuestionStatus=ce;exports.QuestionType=C;exports.SdkOverlayType=Q;exports.createContextKey=Qa;exports.global=Ya;exports.pino_1=Br;exports.useStreamLayerApp=eE;
17
+ `).slice(0,2).map(n=>n.trim()).join(" -- ")}function D_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function qt(e,t,n,a,s){this.started=!1,this.func=t,this.opts=n,this.onFinish=null,this.parent=e,this.timeout=s===void 0?e._timeout:s,this.name=C_(t,n),this.isAfter=a,this.q=R_(e,U_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}M_(qt,L_);qt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){de("skipping loading of plugin as parent errored and it is not an after",s),D.nextTick(t);return}if(this.isAfter)this.server=e;else try{this.server=this.parent.override(e,n,this.opts)}catch(l){return de("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,de("exec",s);let o;const r=l=>{if(a){de("loading complete",s);return}this._error=l,de(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(de("setting up timeout",s,this.timeout),o=setTimeout(function(){de("timed out",s),o=null;const l=new P_(s);l.fn=n,r(l)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const c=n(this.server,this.opts,r);c&&typeof c.then=="function"&&(de("exec: resolving promise",s),c.then(()=>D.nextTick(r),l=>D.nextTick(r,l)))};qt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(de("rejecting promise",this.name,n),this._promise.reject(n)):(de("resolving promise",this.name),this._promise.resolve()),this._promise=null,D.nextTick(a,n)}),this.q.resume()};let t;return this._promise?t=Promise.resolve():(this._promise=D_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};qt.prototype.enqueue=function(e,t){de("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};qt.prototype.finish=function(e,t){de("finish",this.name,e);const n=()=>{this.loaded||(de("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,t(e))};if(e){this._promise&&(this._promise.reject(e),this._promise=null),n();return}const a=()=>{if(de("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{de("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else de("delayed",this.name),this.q.drain=()=>{de("drain",this.name),this.q.drain=F_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function U_(e,t){const n=this;D.nextTick(xs.bind(n),e,t)}function xs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,xs.call(this,e,t)},t);return}const n=this._current[0];this._current.unshift(e),e.exec(n&&n.server||this._server,a=>{e.finish(a,s=>{this._current.shift(),t(s)})})}function F_(){}qs.exports=qt;qs.exports.loadPlugin=xs;var B_=qs.exports;const Rr=uc,G_=Sc.EventEmitter,V_=ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:La,AVV_ERR_CALLBACK_NOT_FN:zt,AVV_ERR_PLUGIN_NOT_VALID:q_,AVV_ERR_ROOT_PLG_BOOTED:x_,AVV_ERR_READY_TIMEOUT:H_}=Fc,Q_=O_,cs=B_,Bt=Bc("avvio"),xn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function Y_(e,t,n){const a=t.expose||{},s=a.use||"use",o=a.after||"after",r=a.ready||"ready",c=a.onClose||"onClose",l=a.close||"close";if(e[s])throw new La(s);if(e[o])throw new La(o);if(e[r])throw new La(r);e[s]=function(m,u){return n.use(m,u),this},Object.defineProperty(e,"then",{get:Gc.bind(n)}),e[xn]=!0,e[o]=function(m){return typeof m!="function"?n._loadRegistered():(n.after(Pa(m,this)),this)},e[r]=function(m){if(m&&typeof m!="function")throw new zt(r,typeof m);return n.ready(m?Pa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new zt(c,typeof m);return n.onClose(z_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new zt(l,typeof m);return m?(n.close(Pa(m,this)),this):n.close()}}function le(e,t,n){if(typeof e=="function"&&arguments.length===1&&(n=e,t={},e=null),typeof t=="function"&&(n=t,t={}),t=t||{},!(this instanceof le)){const a=new le(e,t,n);return e&&Y_(e,t,a),a}t.autostart!==!1&&(t.autostart=!0),e=e||this,this._timeout=Number(t.timeout)||0,this._server=e,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),n&&this.once("start",n),this.started=!1,this.booted=!1,this.pluginTree=new Q_,this._readyQ=Rr(this,Vc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=Lr},this._closeQ=Rr(this,W_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=Lr},this._doStart=null,this._root=new cs(this,j_.bind(this),t,!1,0),this._root.once("start",(a,s,o)=>{const r=this.pluginTree.start(null,s,o);this._root.once("loaded",(c,l,m)=>{this.pluginTree.stop(r,m)})}),cs.loadPlugin.call(this,this._root,a=>{Bt("root plugin ready");try{this.emit("preReady"),this._root=null}catch(s){a=a||this._error||s}if(a){if(this._error=a,this._readyQ.length()===0)throw a}else this.booted=!0;this._readyQ.resume()})}function j_(e,t,n){this._doStart=n,t.autostart&&this.start()}V_(le,G_);le.prototype.start=function(){return this.started=!0,D.nextTick(this._doStart),this};le.prototype.override=function(e,t,n){return e};function $_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new q_(typeof e);return e}le.prototype[xn]=!0;le.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};le.prototype._loadRegistered=function(){const e=this._current[0];return!this.started&&!this.booted&&D.nextTick(()=>this._root.q.resume()),e?e.loadedSoFar():Promise.resolve()};Object.defineProperty(le.prototype,"then",{get:Gc});le.prototype._addPlugin=function(e,t,n){if(e=$_(e),t=t||{},this.booted)throw new x_;const a=this._current[0],s=new cs(this,e,t,n);if(s.once("start",(o,r,c)=>{const l=this.pluginTree.start(a.name,r,c);s.once("loaded",(m,u,d)=>{this.pluginTree.stop(l,d)})}),a.loaded)throw new Error(s.name,a.name);return a.enqueue(s,o=>{o&&(this._error=o)}),s};le.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Vc.call(this,e,s)}return this};le.prototype.onClose=function(e){if(typeof e!="function")throw new Error("not a function");e[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(e,t.bind(this));function t(n){n&&(this._error=n)}return this};le.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new zt("close",typeof e)}else t=new Promise(function(n,a){e=function(s){if(s)return a(s);n()}});return this.ready(()=>{this._error=null,this._closeQ.push(e),D.nextTick(this._closeQ.resume.bind(this._closeQ))}),t};le.prototype.ready=function(e){if(e){if(typeof e!="function")throw new zt("ready",typeof e);this._readyQ.push(e),queueMicrotask(this.start.bind(this));return}return new Promise((t,n)=>{this._readyQ.push(s),this.start();const a=this._current[0].server;function s(o,r,c){o?n(o):t(a),D.nextTick(c)}})};le.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};le.prototype.toJSON=function(){return this.pluginTree.toJSON()};function Lr(){}function Gc(){if(this.booted){Bt("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Bt("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function Vc(e,t){const n=this._server,a=this._error;let s;if(this._error=null,e.length===0)this._error=a,s=e(),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>D.nextTick(t),o=>D.nextTick(t,o)):D.nextTick(t);else if(e.length===1)s=e(a),s&&!s[xn]&&typeof s.then=="function"?s.then(()=>D.nextTick(t),o=>D.nextTick(t,o)):D.nextTick(t);else if(this._timeout===0){const o=r=>{this._error=r,t(this._error)};e.length===2?e(a,o):e(a,n,o)}else K_.call(this,e,a,n,t)}function K_(e,t,n,a){const s=e.name;Bt("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Bt("timed out",s),o=null;const c=new H_(s);c.fn=e,this._error=c,a(c)},this._timeout);e.length===2?e(t,r.bind(this)):e(t,n,r.bind(this));function r(c){o&&(clearTimeout(o),this._error=c,a(this._error))}}function W_(e,t){const n=this._server,a=e[this._isOnCloseHandlerKey];if(e.length===0||e.length===1){let s;a?s=e(n):s=e(this._error),s&&typeof s.then=="function"?(Bt("resolving close/onClose promise"),s.then(()=>D.nextTick(t),o=>D.nextTick(t,o))):D.nextTick(t)}else e.length===2?e(a?n:this._error,t):a?e(n,t):e(this._error,n,t)}function z_(e,t){return n.bind(t);function n(a,s){let o;e.length===0?(o=e(),o&&o.then?o.then(function(){D.nextTick(s)},s):D.nextTick(s)):e.length===1?(o=e(this),o&&o.then?o.then(function(){D.nextTick(s)},s):D.nextTick(s)):e(this,s)}}function Pa(e,t){return n.bind(t);function n(a,s){let o;e?e.length===0?(o=e(),o&&o.then?o.then(function(){D.nextTick(s,a)},s):D.nextTick(s,a)):e.length===1?(o=e(a),o&&o.then?o.then(function(){D.nextTick(s)},s):D.nextTick(s)):e.length===2?e(a,s):e(a,this,s):D.nextTick(s)}}Rs.exports=le;Rs.exports.express=function(e){return le(e,{expose:{use:"load"}})};var J_=Rs.exports;const X_=Oh(J_);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const e=["webkit","moz","ms","o"];for(const t of e)window.requestAnimationFrame=window.requestAnimationFrame||window[`${t}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${t}CancelAnimationFrame`]||window[`${t}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let t=0;const n=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(a){const s=n?window.performance.now():new Date().getTime(),o=Math.max(0,16-(s-t)),r=window.setTimeout(function(){a(s+o)},o);return t=s+o,r},window.cancelAnimationFrame=clearTimeout}})();function Z_(e,t=!0,n=!0,a={friendsTab:"enabled"}){const s=t?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",o=t?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",r=X_(Object.create({}),{autostart:!1});return r.use(nh,{friendsTab:a.friendsTab}),r.use(Wk,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Zk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(th,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(Tk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(hk),r.use(Xk),r.use(yh),r.use(Gk),r.use(Ih),r.after((c,l,m)=>{if(c)throw c;l.ready(),m()}),n&&r.after(async(c,l,m)=>{if(c)throw c;await l.sdk.initializeApp(),m()}),r.onClose(()=>{console.log("close")}),r}const eE=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Qs.useState(null);return Qs.useEffect(()=>{let f=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(y=>(y!==null&&typeof y.disableApp=="function"&&y.disableApp(),null)),()=>{f=!0};const T=Z_(e,n,a,{version:"1.9.7",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const y of t)T.use(y);return T.ready().then(y=>{f||(d(y.sdk),typeof window<"u")}).catch(y=>console.log(y)),()=>{f=!0,T.close(function(y){if(y)throw y})}},[e,n]),u};exports.AutoPlayVideo=Qn;exports.CloseTimerAuto=ui;exports.CtaIconMode=ri;exports.InvitationFrom=Pn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=si;exports.NotificationPromotionMode=ai;exports.NotificationSponsorLogoMode=oi;exports.PickHistoryStatus=It;exports.PromotionButtonType=ci;exports.PromotionLogoMode=li;exports.PromotionType=Te;exports.QuestionImages=ot;exports.QuestionStatus=ce;exports.QuestionType=C;exports.SdkOverlayType=Q;exports.createContextKey=Qa;exports.global=Ya;exports.pino_1=Br;exports.useStreamLayerApp=eE;
@@ -208,4 +208,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
208
208
  `),y=`
209
209
  `+o+(p.length?c("│"):" ")+" ";return o+f.join(y)+`
210
210
  `+p.map(function(b,C){var _=C===p.length-1,N=b.nodes&&b.nodes.length,O=o+(_?" ":c("│"))+" ";return o+c(_?"└":"├")+c("─")+c(N?"┬":"─")+" "+n(b,O,l).slice(o.length+2)}).join("")};const wte=Ste,KS=Symbol("avvio.TimeTree.untrackNode"),Z5=Symbol("avvio.TimeTree.trackNode"),ZS=Symbol("avvio.TimeTree.getParent"),XS=Symbol("avvio.TimeTree.getNode"),JS=Symbol("avvio.TimeTree.addNode");let Cte=class{constructor(){this.root=null,this.tableId=new Map,this.tableLabel=new Map}[Z5](n){this.tableId.set(n.id,n),this.tableLabel.has(n.label)?this.tableLabel.get(n.label).push(n):this.tableLabel.set(n.label,[n])}[KS](n){this.tableId.delete(n.id);const a=this.tableLabel.get(n.label);if(a.id){this.tableLabel.delete(n.label);return}a.pop(),a.length===0&&this.tableLabel.delete(n.label)}[ZS](n){if(n===null)return this.root;const a=this.tableLabel.get(n);return a.id?a:a[a.length-1]}[XS](n){return this.tableId.get(n)}[JS](n,a,o){if(n===null)return this.root={id:"root",label:a,start:o,nodes:[]},this[Z5](this.root),this.root.id;const l=this[ZS](n),c=`${a}-${Math.random()}`,p={id:c,parent:n,start:o,label:a,nodes:[]};return l.nodes.push(p),this[Z5](p),c}start(n,a,o=Date.now()){return this[JS](n,a,o)}stop(n,a=Date.now()){const o=this[XS](n);o&&(o.stop=a,o.diff=o.stop-o.start||0,this[KS](o))}toJSON(){return Object.assign({},this.root)}prittyPrint(){const n=o=>(o.label=`${o.label} ${o.diff} ms`,o.nodes.length>0&&(o.nodes=o.nodes.map(l=>n(l))),o),a=n(this.toJSON());return wte(a)}};var Ete=Cte,Ay={exports:{}},V9={exports:{}},X5,ew;function _te(){if(ew)return X5;ew=1;var n=1e3,a=n*60,o=a*60,l=o*24,c=l*7,p=l*365.25;X5=function(_,N){N=N||{};var O=typeof _;if(O==="string"&&_.length>0)return f(_);if(O==="number"&&isFinite(_))return N.long?b(_):y(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function f(_){if(_=String(_),!(_.length>100)){var N=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(N){var O=parseFloat(N[1]),L=(N[2]||"ms").toLowerCase();switch(L){case"years":case"year":case"yrs":case"yr":case"y":return O*p;case"weeks":case"week":case"w":return O*c;case"days":case"day":case"d":return O*l;case"hours":case"hour":case"hrs":case"hr":case"h":return O*o;case"minutes":case"minute":case"mins":case"min":case"m":return O*a;case"seconds":case"second":case"secs":case"sec":case"s":return O*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return O;default:return}}}}function y(_){var N=Math.abs(_);return N>=l?Math.round(_/l)+"d":N>=o?Math.round(_/o)+"h":N>=a?Math.round(_/a)+"m":N>=n?Math.round(_/n)+"s":_+"ms"}function b(_){var N=Math.abs(_);return N>=l?C(_,N,l,"day"):N>=o?C(_,N,o,"hour"):N>=a?C(_,N,a,"minute"):N>=n?C(_,N,n,"second"):_+" ms"}function C(_,N,O,L){var x=N>=O*1.5;return Math.round(_/O)+" "+L+(x?"s":"")}return X5}function Ite(n){o.debug=o,o.default=o,o.coerce=b,o.disable=p,o.enable=c,o.enabled=f,o.humanize=_te(),o.destroy=C,Object.keys(n).forEach(_=>{o[_]=n[_]}),o.names=[],o.skips=[],o.formatters={};function a(_){let N=0;for(let O=0;O<_.length;O++)N=(N<<5)-N+_.charCodeAt(O),N|=0;return o.colors[Math.abs(N)%o.colors.length]}o.selectColor=a;function o(_){let N,O=null,L,x;function D(...j){if(!D.enabled)return;const V=D,Y=Number(new Date),Z=Y-(N||Y);V.diff=Z,V.prev=N,V.curr=Y,N=Y,j[0]=o.coerce(j[0]),typeof j[0]!="string"&&j.unshift("%O");let Q=0;j[0]=j[0].replace(/%([a-zA-Z%])/g,(te,ie)=>{if(te==="%%")return"%";Q++;const ae=o.formatters[ie];if(typeof ae=="function"){const Ce=j[Q];te=ae.call(V,Ce),j.splice(Q,1),Q--}return te}),o.formatArgs.call(V,j),(V.log||o.log).apply(V,j)}return D.namespace=_,D.useColors=o.useColors(),D.color=o.selectColor(_),D.extend=l,D.destroy=o.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>O!==null?O:(L!==o.namespaces&&(L=o.namespaces,x=o.enabled(_)),x),set:j=>{O=j}}),typeof o.init=="function"&&o.init(D),D}function l(_,N){const O=o(this.namespace+(typeof N>"u"?":":N)+_);return O.log=this.log,O}function c(_){o.save(_),o.namespaces=_,o.names=[],o.skips=[];let N;const O=(typeof _=="string"?_:"").split(/[\s,]+/),L=O.length;for(N=0;N<L;N++)O[N]&&(_=O[N].replace(/\*/g,".*?"),_[0]==="-"?o.skips.push(new RegExp("^"+_.slice(1)+"$")):o.names.push(new RegExp("^"+_+"$")))}function p(){const _=[...o.names.map(y),...o.skips.map(y).map(N=>"-"+N)].join(",");return o.enable(""),_}function f(_){if(_[_.length-1]==="*")return!0;let N,O;for(N=0,O=o.skips.length;N<O;N++)if(o.skips[N].test(_))return!1;for(N=0,O=o.names.length;N<O;N++)if(o.names[N].test(_))return!0;return!1}function y(_){return _.toString().substring(2,_.toString().length-2).replace(/\.\*\?$/,"*")}function b(_){return _ instanceof Error?_.stack||_.message:_}function C(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}var Nte=Ite;(function(n,a){a.formatArgs=l,a.save=c,a.load=p,a.useColors=o,a.storage=f(),a.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function o(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;b.splice(1,0,C,"color: inherit");let _=0,N=0;b[0].replace(/%[a-zA-Z%]/g,O=>{O!=="%%"&&(_++,O==="%c"&&(N=_))}),b.splice(N,0,C)}a.log=console.debug||console.log||(()=>{});function c(b){try{b?a.storage.setItem("debug",b):a.storage.removeItem("debug")}catch{}}function p(){let b;try{b=a.storage.getItem("debug")}catch{}return!b&&typeof St<"u"&&"env"in St&&(b=St.env.DEBUG),b}function f(){try{return localStorage}catch{}}n.exports=Nte(a);const{formatters:y}=n.exports;y.j=function(b){try{return JSON.stringify(b)}catch(C){return"[UnexpectedJSONParseError]: "+C.message}}})(V9,V9.exports);var QE=V9.exports;const Rte=kE,Ote=OE.EventEmitter,Lte=P6.inherits,Va=QE("avvio"),{AVV_ERR_READY_TIMEOUT:Ate}=WE,J5=Symbol.for("plugin-meta");function xte(n,a){return n[J5]&&n[J5].name?n[J5].name:typeof a<"u"&&typeof a!="function"&&a.name?a.name:n.name?n.name:n.toString().split(`
211
- `).slice(0,2).map(o=>o.trim()).join(" -- ")}function Pte(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function Rm(n,a,o,l,c){this.started=!1,this.func=a,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=xte(a,o),this.isAfter=l,this.q=Rte(n,Mte,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Lte(Rm,Ote);Rm.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Va("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(a);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Va("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Va("exec",c);let p;const f=b=>{if(l){Va("loading complete",c);return}this._error=b,Va(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Va("setting up timeout",c,this.timeout),p=setTimeout(function(){Va("timed out",c),p=null;const b=new Ate(c);b.fn=o,f(b)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const y=o(this.server,this.opts,f);y&&typeof y.then=="function"&&(Va("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};Rm.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Va("rejecting promise",this.name,o),this._promise.reject(o)):(Va("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let a;return this._promise?a=Promise.resolve():(this._promise=Pte(),a=this._promise.promise,this.server?n():this.on("start",n)),a};Rm.prototype.enqueue=function(n,a){Va("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};Rm.prototype.finish=function(n,a){Va("finish",this.name,n);const o=()=>{this.loaded||(Va("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,a(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Va("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Va("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Va("delayed",this.name),this.q.drain=()=>{Va("drain",this.name),this.q.drain=Dte,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Mte(n,a){const o=this;St.nextTick(xy.bind(o),n,a)}function xy(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,xy.call(this,n,a)},a);return}const o=this._current[0];this._current.unshift(n),n.exec(o&&o.server||this._server,l=>{n.finish(l,c=>{this._current.shift(),a(c)})})}function Dte(){}Ay.exports=Rm;Ay.exports.loadPlugin=xy;var Ute=Ay.exports;const tw=kE,Fte=OE.EventEmitter,Vte=P6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:e9,AVV_ERR_CALLBACK_NOT_FN:i2,AVV_ERR_PLUGIN_NOT_VALID:jte,AVV_ERR_ROOT_PLG_BOOTED:Bte,AVV_ERR_READY_TIMEOUT:$te}=WE,zte=Ete,j9=Ute,Sm=QE("avvio"),T6=Symbol("kAvvio"),t9=Symbol("kThenifyDoNotWrap");function Hte(n,a,o){const l=a.expose||{},c=l.use||"use",p=l.after||"after",f=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new e9(c);if(n[p])throw new e9(p);if(n[f])throw new e9(f);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:YE.bind(o)}),n[T6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(n9(C,this)),this)},n[f]=function(C){if(C&&typeof C!="function")throw new i2(f,typeof C);return o.ready(C?n9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new i2(y,typeof C);return o.onClose(Yte(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new i2(b,typeof C);return C?(o.close(n9(C,this)),this):o.close()}}function Ca(n,a,o){if(typeof n=="function"&&arguments.length===1&&(o=n,a={},n=null),typeof a=="function"&&(o=a,a={}),a=a||{},!(this instanceof Ca)){const l=new Ca(n,a,o);return n&&Hte(n,a,l),l}a.autostart!==!1&&(a.autostart=!0),n=n||this,this._timeout=Number(a.timeout)||0,this._server=n,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),o&&this.once("start",o),this.started=!1,this.booted=!1,this.pluginTree=new zte,this._readyQ=tw(this,KE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=nw},this._closeQ=tw(this,Qte,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=nw},this._doStart=null,this._root=new j9(this,qte.bind(this),a,!1,0),this._root.once("start",(l,c,p)=>{const f=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(f,C)})}),j9.loadPlugin.call(this,this._root,l=>{Sm("root plugin ready");try{this.emit("preReady"),this._root=null}catch(c){l=l||this._error||c}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function qte(n,a,o){this._doStart=o,a.autostart&&this.start()}Vte(Ca,Fte);Ca.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};Ca.prototype.override=function(n,a,o){return n};function Gte(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new jte(typeof n);return n}Ca.prototype[T6]=!0;Ca.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};Ca.prototype._loadRegistered=function(){const n=this._current[0];return!this.started&&!this.booted&&St.nextTick(()=>this._root.q.resume()),n?n.loadedSoFar():Promise.resolve()};Object.defineProperty(Ca.prototype,"then",{get:YE});Ca.prototype._addPlugin=function(n,a,o){if(n=Gte(n),a=a||{},this.booted)throw new Bte;const l=this._current[0],c=new j9(this,n,a,o);if(c.once("start",(p,f,y)=>{const b=this.pluginTree.start(l.name,f,y);c.once("loaded",(C,_,N)=>{this.pluginTree.stop(b,N)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};Ca.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){KE.call(this,n,c)}return this};Ca.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,a.bind(this));function a(o){o&&(this._error=o)}return this};Ca.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new i2("close",typeof n)}else a=new Promise(function(o,l){n=function(c){if(c)return l(c);o()}});return this.ready(()=>{this._error=null,this._closeQ.push(n),St.nextTick(this._closeQ.resume.bind(this._closeQ))}),a};Ca.prototype.ready=function(n){if(n){if(typeof n!="function")throw new i2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((a,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,f,y){p?o(p):a(l),St.nextTick(y)}})};Ca.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ca.prototype.toJSON=function(){return this.pluginTree.toJSON()};function nw(){}function YE(){if(this.booted){Sm("thenify returning null because we are already booted");return}if(this[t9]){this[t9]=!1;return}return Sm("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[t9]=!0,n(this._server)),a)}function KE(n,a){const o=this._server,l=this._error;let c;if(this._error=null,n.length===0)this._error=l,c=n(),c&&!c[T6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(n.length===1)c=n(l),c&&!c[T6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(this._timeout===0){const p=f=>{this._error=f,a(this._error)};n.length===2?n(l,p):n(l,o,p)}else Wte.call(this,n,l,o,a)}function Wte(n,a,o,l){const c=n.name;Sm("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{Sm("timed out",c),p=null;const y=new $te(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(a,f.bind(this)):n(a,o,f.bind(this));function f(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function Qte(n,a){const o=this._server,l=n[this._isOnCloseHandlerKey];if(n.length===0||n.length===1){let c;l?c=n(o):c=n(this._error),c&&typeof c.then=="function"?(Sm("resolving close/onClose promise"),c.then(()=>St.nextTick(a),p=>St.nextTick(a,p))):St.nextTick(a)}else n.length===2?n(l?o:this._error,a):l?n(o,a):n(this._error,o,a)}function Yte(n,a){return o.bind(a);function o(l,c){let p;n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===1?(p=n(this),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n(this,c)}}function n9(n,a){return o.bind(a);function o(l,c){let p;n?n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c,l)},c):St.nextTick(c,l)):n.length===1?(p=n(l),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===2?n(l,c):n(l,this,c):St.nextTick(c)}}ky.exports=Ca;ky.exports.express=function(n){return Ca(n,{expose:{use:"load"}})};var Kte=ky.exports;const Zte=EJ(Kte);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const a of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${a}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${a}CancelAnimationFrame`]||window[`${a}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let a=0;const o=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const c=o?window.performance.now():new Date().getTime(),p=Math.max(0,16-(c-a)),f=window.setTimeout(function(){l(c+p)},p);return a=c+p,f},window.cancelAnimationFrame=clearTimeout}})();function Xte(n,a=!0,o=!0,l={friendsTab:"enabled"}){const c=a?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=a?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=Zte(Object.create({}),{autostart:!1});return f.use(tJ,{friendsTab:l.friendsTab}),f.use(QX,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(XX,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(eJ,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),f.use(fX,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(vX),f.use(ZX),f.use(pJ),f.use(FX),f.use(CJ),f.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&f.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),f.onClose(()=>{console.log("close")}),f}const Jte=({sdkKey:n,plugins:a,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C})=>{const[_,N]=W.useState(null);return W.useEffect(()=>{let O=!1;if(!n)return console.error("streamlayer sdk key should be provided"),N(x=>(x!==null&&typeof x.disableApp=="function"&&x.disableApp(),null)),()=>{O=!0};const L=Xte(n,o,l,{version:"1.9.6",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C});if(a)for(const x of a)L.use(x);return L.ready().then(x=>{O||(N(x.sdk),typeof window<"u")}).catch(x=>console.log(x)),()=>{O=!0,L.close(function(x){if(x)throw x})}},[n,o]),_},ene=({event:n})=>{const a=Py(),o=ane();return W.useEffect(()=>(a&&(n&&(a.createEventSession(n),o&&(o.current=n)),!n&&(o!=null&&o.current)&&(a.createEventSession(""),o.current="")),()=>{a&&a.disableApp()}),[n,o,a]),null};var ZE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(ZE||{});const tne={status:0,sdk:null},V6=W.createContext(tne),nne=({sdkKey:n,theme:a,plugins:o,children:l,event:c,production:p=!0,autoEnable:f=!0,withAdNotification:y,withAd:b=!0,friendsTab:C="enabled",onDeepLinkHandled:_,videoPlayerController:N,onContentActivate:O})=>{const L=Jte({sdkKey:n,plugins:o,production:p,autoEnable:f,onDeepLinkHandled:_,videoPlayerController:N,onContentActivate:O,withAdNotification:y,withAd:b,friendsTab:C}),x=W.useRef(""),D=W.useMemo(()=>L?{sdk:L,status:2,event:x,theme:a}:{status:1,sdk:null,event:x,theme:a},[L]);return W.useEffect(()=>{L&&L.options.setKey("friendsTab",C)},[L,C]),W.useEffect(()=>()=>{_&&(L==null||L.removeDeepLinkHandler(_)),N&&(L==null||L.removeVideoPlayerController(N))},[L]),W.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!_,videoPlayerController:!!N})},[n,_,N]),w.jsxs(V6.Provider,{value:D,children:[c!==void 0&&w.jsx(ene,{event:c}),l]})},Py=()=>{const{sdk:n}=W.useContext(V6);return n},ane=()=>{const{event:n}=W.useContext(V6);return n},rne=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(nne,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),one=({children:n,overlays:a})=>{const{sdk:o,status:l}=W.useContext(V6);return l===ZE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(UC,{style:{height:"100%"},children:w.jsx(LG,{sdk:o,overlays:a,children:n})})}):n({})};class sne extends W.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,o){console.error(a,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(one,{...this.props})}}const ine=({token:n,schema:a})=>{const o=Py();return W.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n),o&&(o.withAuth=!0)},[n,a,o]),null},lne=()=>{const n=Py();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(UC,{children:w.jsx(BG,{sdk:n})})}):null};exports.C=IC;exports.C$1=WV;exports.M=fy;exports.MastersStreamLayerProvider=rne;exports.MastersStreamLayerSDKReact=sne;exports.N=ca;exports.O=oy;exports.S=LC;exports.S$1=YV;exports.StreamLayerLogin=ine;exports.StreamLayerSDKPoints=lne;exports.T=my;exports.b=_C;exports.cx_default=Su;exports.d=KV;exports.k=xC;exports.l=qV;exports.m=r2;exports.m$1=HV;exports.n=iy;exports.p=zG;exports.styled_default=P;exports.useStore=Ut;exports.z=Cz;
211
+ `).slice(0,2).map(o=>o.trim()).join(" -- ")}function Pte(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function Rm(n,a,o,l,c){this.started=!1,this.func=a,this.opts=o,this.onFinish=null,this.parent=n,this.timeout=c===void 0?n._timeout:c,this.name=xte(a,o),this.isAfter=l,this.q=Rte(n,Mte,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Lte(Rm,Ote);Rm.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Va("skipping loading of plugin as parent errored and it is not an after",c),St.nextTick(a);return}if(this.isAfter)this.server=n;else try{this.server=this.parent.override(n,o,this.opts)}catch(b){return Va("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Va("exec",c);let p;const f=b=>{if(l){Va("loading complete",c);return}this._error=b,Va(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Va("setting up timeout",c,this.timeout),p=setTimeout(function(){Va("timed out",c),p=null;const b=new Ate(c);b.fn=o,f(b)},this.timeout)),this.started=!0,this.emit("start",this.server?this.server.name:null,this.name,Date.now());const y=o(this.server,this.opts,f);y&&typeof y.then=="function"&&(Va("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};Rm.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Va("rejecting promise",this.name,o),this._promise.reject(o)):(Va("resolving promise",this.name),this._promise.resolve()),this._promise=null,St.nextTick(l,o)}),this.q.resume()};let a;return this._promise?a=Promise.resolve():(this._promise=Pte(),a=this._promise.promise,this.server?n():this.on("start",n)),a};Rm.prototype.enqueue=function(n,a){Va("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};Rm.prototype.finish=function(n,a){Va("finish",this.name,n);const o=()=>{this.loaded||(Va("loaded",this.name),this.emit("loaded",this.server?this.server.name:null,this.name,Date.now()),this.loaded=!0,a(n))};if(n){this._promise&&(this._promise.reject(n),this._promise=null),o();return}const l=()=>{if(Va("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Va("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Va("delayed",this.name),this.q.drain=()=>{Va("drain",this.name),this.q.drain=Dte,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function Mte(n,a){const o=this;St.nextTick(xy.bind(o),n,a)}function xy(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,xy.call(this,n,a)},a);return}const o=this._current[0];this._current.unshift(n),n.exec(o&&o.server||this._server,l=>{n.finish(l,c=>{this._current.shift(),a(c)})})}function Dte(){}Ay.exports=Rm;Ay.exports.loadPlugin=xy;var Ute=Ay.exports;const tw=kE,Fte=OE.EventEmitter,Vte=P6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:e9,AVV_ERR_CALLBACK_NOT_FN:i2,AVV_ERR_PLUGIN_NOT_VALID:jte,AVV_ERR_ROOT_PLG_BOOTED:Bte,AVV_ERR_READY_TIMEOUT:$te}=WE,zte=Ete,j9=Ute,Sm=QE("avvio"),T6=Symbol("kAvvio"),t9=Symbol("kThenifyDoNotWrap");function Hte(n,a,o){const l=a.expose||{},c=l.use||"use",p=l.after||"after",f=l.ready||"ready",y=l.onClose||"onClose",b=l.close||"close";if(n[c])throw new e9(c);if(n[p])throw new e9(p);if(n[f])throw new e9(f);n[c]=function(C,_){return o.use(C,_),this},Object.defineProperty(n,"then",{get:YE.bind(o)}),n[T6]=!0,n[p]=function(C){return typeof C!="function"?o._loadRegistered():(o.after(n9(C,this)),this)},n[f]=function(C){if(C&&typeof C!="function")throw new i2(f,typeof C);return o.ready(C?n9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new i2(y,typeof C);return o.onClose(Yte(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new i2(b,typeof C);return C?(o.close(n9(C,this)),this):o.close()}}function Ca(n,a,o){if(typeof n=="function"&&arguments.length===1&&(o=n,a={},n=null),typeof a=="function"&&(o=a,a={}),a=a||{},!(this instanceof Ca)){const l=new Ca(n,a,o);return n&&Hte(n,a,l),l}a.autostart!==!1&&(a.autostart=!0),n=n||this,this._timeout=Number(a.timeout)||0,this._server=n,this._current=[],this._error=null,this._isOnCloseHandlerKey=Symbol("isOnCloseHandler"),this._lastUsed=null,this.setMaxListeners(0),o&&this.once("start",o),this.started=!1,this.booted=!1,this.pluginTree=new zte,this._readyQ=tw(this,KE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=nw},this._closeQ=tw(this,Qte,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=nw},this._doStart=null,this._root=new j9(this,qte.bind(this),a,!1,0),this._root.once("start",(l,c,p)=>{const f=this.pluginTree.start(null,c,p);this._root.once("loaded",(y,b,C)=>{this.pluginTree.stop(f,C)})}),j9.loadPlugin.call(this,this._root,l=>{Sm("root plugin ready");try{this.emit("preReady"),this._root=null}catch(c){l=l||this._error||c}if(l){if(this._error=l,this._readyQ.length()===0)throw l}else this.booted=!0;this._readyQ.resume()})}function qte(n,a,o){this._doStart=o,a.autostart&&this.start()}Vte(Ca,Fte);Ca.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};Ca.prototype.override=function(n,a,o){return n};function Gte(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new jte(typeof n);return n}Ca.prototype[T6]=!0;Ca.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};Ca.prototype._loadRegistered=function(){const n=this._current[0];return!this.started&&!this.booted&&St.nextTick(()=>this._root.q.resume()),n?n.loadedSoFar():Promise.resolve()};Object.defineProperty(Ca.prototype,"then",{get:YE});Ca.prototype._addPlugin=function(n,a,o){if(n=Gte(n),a=a||{},this.booted)throw new Bte;const l=this._current[0],c=new j9(this,n,a,o);if(c.once("start",(p,f,y)=>{const b=this.pluginTree.start(l.name,f,y);c.once("loaded",(C,_,N)=>{this.pluginTree.stop(b,N)})}),l.loaded)throw new Error(c.name,l.name);return l.enqueue(c,p=>{p&&(this._error=p)}),c};Ca.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){KE.call(this,n,c)}return this};Ca.prototype.onClose=function(n){if(typeof n!="function")throw new Error("not a function");n[this._isOnCloseHandlerKey]=!0,this._closeQ.unshift(n,a.bind(this));function a(o){o&&(this._error=o)}return this};Ca.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new i2("close",typeof n)}else a=new Promise(function(o,l){n=function(c){if(c)return l(c);o()}});return this.ready(()=>{this._error=null,this._closeQ.push(n),St.nextTick(this._closeQ.resume.bind(this._closeQ))}),a};Ca.prototype.ready=function(n){if(n){if(typeof n!="function")throw new i2("ready",typeof n);this._readyQ.push(n),queueMicrotask(this.start.bind(this));return}return new Promise((a,o)=>{this._readyQ.push(c),this.start();const l=this._current[0].server;function c(p,f,y){p?o(p):a(l),St.nextTick(y)}})};Ca.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};Ca.prototype.toJSON=function(){return this.pluginTree.toJSON()};function nw(){}function YE(){if(this.booted){Sm("thenify returning null because we are already booted");return}if(this[t9]){this[t9]=!1;return}return Sm("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[t9]=!0,n(this._server)),a)}function KE(n,a){const o=this._server,l=this._error;let c;if(this._error=null,n.length===0)this._error=l,c=n(),c&&!c[T6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(n.length===1)c=n(l),c&&!c[T6]&&typeof c.then=="function"?c.then(()=>St.nextTick(a),p=>St.nextTick(a,p)):St.nextTick(a);else if(this._timeout===0){const p=f=>{this._error=f,a(this._error)};n.length===2?n(l,p):n(l,o,p)}else Wte.call(this,n,l,o,a)}function Wte(n,a,o,l){const c=n.name;Sm("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{Sm("timed out",c),p=null;const y=new $te(c);y.fn=n,this._error=y,l(y)},this._timeout);n.length===2?n(a,f.bind(this)):n(a,o,f.bind(this));function f(y){p&&(clearTimeout(p),this._error=y,l(this._error))}}function Qte(n,a){const o=this._server,l=n[this._isOnCloseHandlerKey];if(n.length===0||n.length===1){let c;l?c=n(o):c=n(this._error),c&&typeof c.then=="function"?(Sm("resolving close/onClose promise"),c.then(()=>St.nextTick(a),p=>St.nextTick(a,p))):St.nextTick(a)}else n.length===2?n(l?o:this._error,a):l?n(o,a):n(this._error,o,a)}function Yte(n,a){return o.bind(a);function o(l,c){let p;n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===1?(p=n(this),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n(this,c)}}function n9(n,a){return o.bind(a);function o(l,c){let p;n?n.length===0?(p=n(),p&&p.then?p.then(function(){St.nextTick(c,l)},c):St.nextTick(c,l)):n.length===1?(p=n(l),p&&p.then?p.then(function(){St.nextTick(c)},c):St.nextTick(c)):n.length===2?n(l,c):n(l,this,c):St.nextTick(c)}}ky.exports=Ca;ky.exports.express=function(n){return Ca(n,{expose:{use:"load"}})};var Kte=ky.exports;const Zte=EJ(Kte);(function(){if(window.requestAnimationFrame&&window.cancelAnimationFrame)return;const n=["webkit","moz","ms","o"];for(const a of n)window.requestAnimationFrame=window.requestAnimationFrame||window[`${a}RequestAnimationFrame`],window.cancelAnimationFrame=window.cancelAnimationFrame||window[`${a}CancelAnimationFrame`]||window[`${a}CancelRequestAnimationFrame`];if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){let a=0;const o=!!(window.performance&&window.performance.now);window.requestAnimationFrame=function(l){const c=o?window.performance.now():new Date().getTime(),p=Math.max(0,16-(c-a)),f=window.setTimeout(function(){l(c+p)},p);return a=c+p,f},window.cancelAnimationFrame=clearTimeout}})();function Xte(n,a=!0,o=!0,l={friendsTab:"enabled"}){const c=a?"https://grpc-sdk.streamlayer.io:443":"https://grpc-sdk.next.streamlayer.io:443",p=a?"https://grpc.streamlayer.io:443":"https://grpc.next.streamlayer.io:443",f=Zte(Object.create({}),{autostart:!1});return f.use(tJ,{friendsTab:l.friendsTab}),f.use(QX,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(XX,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(eJ,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),f.use(fX,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(vX),f.use(ZX),f.use(pJ),f.use(FX),f.use(CJ),f.after((y,b,C)=>{if(y)throw y;b.ready(),C()}),o&&f.after(async(y,b,C)=>{if(y)throw y;await b.sdk.initializeApp(),C()}),f.onClose(()=>{console.log("close")}),f}const Jte=({sdkKey:n,plugins:a,production:o,autoEnable:l,onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C})=>{const[_,N]=W.useState(null);return W.useEffect(()=>{let O=!1;if(!n)return console.error("streamlayer sdk key should be provided"),N(x=>(x!==null&&typeof x.disableApp=="function"&&x.disableApp(),null)),()=>{O=!0};const L=Xte(n,o,l,{version:"1.9.7",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C});if(a)for(const x of a)L.use(x);return L.ready().then(x=>{O||(N(x.sdk),typeof window<"u")}).catch(x=>console.log(x)),()=>{O=!0,L.close(function(x){if(x)throw x})}},[n,o]),_},ene=({event:n})=>{const a=Py(),o=ane();return W.useEffect(()=>(a&&(n&&(a.createEventSession(n),o&&(o.current=n)),!n&&(o!=null&&o.current)&&(a.createEventSession(""),o.current="")),()=>{a&&a.disableApp()}),[n,o,a]),null};var ZE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(ZE||{});const tne={status:0,sdk:null},V6=W.createContext(tne),nne=({sdkKey:n,theme:a,plugins:o,children:l,event:c,production:p=!0,autoEnable:f=!0,withAdNotification:y,withAd:b=!0,friendsTab:C="enabled",onDeepLinkHandled:_,videoPlayerController:N,onContentActivate:O})=>{const L=Jte({sdkKey:n,plugins:o,production:p,autoEnable:f,onDeepLinkHandled:_,videoPlayerController:N,onContentActivate:O,withAdNotification:y,withAd:b,friendsTab:C}),x=W.useRef(""),D=W.useMemo(()=>L?{sdk:L,status:2,event:x,theme:a}:{status:1,sdk:null,event:x,theme:a},[L]);return W.useEffect(()=>{L&&L.options.setKey("friendsTab",C)},[L,C]),W.useEffect(()=>()=>{_&&(L==null||L.removeDeepLinkHandler(_)),N&&(L==null||L.removeVideoPlayerController(N))},[L]),W.useEffect(()=>{localStorage.getItem("SL_DEBUG")&&console.log("StreamLayerProvider mounted with props:",{sdkKey:!!n,onDeepLinkHandled:!!_,videoPlayerController:!!N})},[n,_,N]),w.jsxs(V6.Provider,{value:D,children:[c!==void 0&&w.jsx(ene,{event:c}),l]})},Py=()=>{const{sdk:n}=W.useContext(V6);return n},ane=()=>{const{event:n}=W.useContext(V6);return n},rne=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(nne,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),one=({children:n,overlays:a})=>{const{sdk:o,status:l}=W.useContext(V6);return l===ZE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(UC,{style:{height:"100%"},children:w.jsx(LG,{sdk:o,overlays:a,children:n})})}):n({})};class sne extends W.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(a,o){console.error(a,o.componentStack)}render(){return this.state.hasError?this.props.children({}):w.jsx(one,{...this.props})}}const ine=({token:n,schema:a})=>{const o=Py();return W.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n),o&&(o.withAuth=!0)},[n,a,o]),null},lne=()=>{const n=Py();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(UC,{children:w.jsx(BG,{sdk:n})})}):null};exports.C=IC;exports.C$1=WV;exports.M=fy;exports.MastersStreamLayerProvider=rne;exports.MastersStreamLayerSDKReact=sne;exports.N=ca;exports.O=oy;exports.S=LC;exports.S$1=YV;exports.StreamLayerLogin=ine;exports.StreamLayerSDKPoints=lne;exports.T=my;exports.b=_C;exports.cx_default=Su;exports.d=KV;exports.k=xC;exports.l=qV;exports.m=r2;exports.m$1=HV;exports.n=iy;exports.p=zG;exports.styled_default=P;exports.useStore=Ut;exports.z=Cz;
@@ -42461,7 +42461,7 @@ const une = ({
42461
42461
  O = !0;
42462
42462
  };
42463
42463
  const L = lne(n, o, l, {
42464
- version: "1.9.6",
42464
+ version: "1.9.7",
42465
42465
  onDeepLinkHandled: c,
42466
42466
  videoPlayerController: p,
42467
42467
  onContentActivate: f,