@streamlayer/react 1.9.3 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/advertisement.js
CHANGED
|
@@ -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"),ue=t.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),pe="a1rlj479",ye="s35f1di",ve="sj4471g",fe="b12050d8",Ae="b1d5ybek",ge=e=>e==="left"||e==="right"?ye:fe,xe=e=>e==="left"||e==="right"?ve:Ae,Ie=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(ue,{style:s,className:t.cx_default(l,pe,Ie(a),n&&!r&&ge(a),n&&r&&xe(a)),onAnimationEnd:c,children:e}),he=t.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),je=t.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),be=()=>he,_e=t.styled_default(be())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Ne=({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.banner)==null?void 0:a.url;return c&&c.indexOf("http")!==0&&(c=`https://${c}`),o.jsx(B,{direction:n,hiding:l,children:o.jsx(je,{className:"BannerContainer",children:o.jsx(_e,{className:"BannerLink",href:c,style:{backgroundImage:`url(${e.additionalBanner.imageUrl})`},"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}),Pe=t.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),$e=t.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),Te=t.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),D=t.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Ee=()=>D,Ce=t.styled_default(Ee())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),Le=t.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),Me=t.styled_default("button")({name:"Button",class:"bgl6boa",propsAsIs:!1}),ke=t.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Be=t.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),De=t.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),Re={[u.NotificationPromotionImagePosition.BOTTOM]:D,[u.NotificationPromotionImagePosition.MIDDLE]:Ce},qe=({src:e,imagePosition:s})=>{const l=Re[s]||D;return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},we=({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(qe,{src:r,imagePosition:v}),o.jsxs(Pe,{children:[l&&o.jsx($e,{children:l}),n&&o.jsx(Te,{children:n})]})]}),o.jsxs(Oe,{children:[p!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsxs(o.Fragment,{children:[o.jsx(ke,{children:o.jsx("img",{src:c,alt:l})}),o.jsx(Be,{})]}),o.jsxs(Me,{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(Le,{src:i==null?void 0:i.ctaIcon,alt:"cta-icon"}),(i==null?void 0:i.label)||"Open"]})]})]})},Ve=t.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Fe=t.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),Ue=t.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),ze=t.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Ge=t.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),C=t.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),Ke=()=>C,J=t.styled_default(Ke())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),We=()=>C,oe=t.styled_default(We())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),He=()=>oe,Ye=t.styled_default(He())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Je=()=>C,Xe=t.styled_default(Je())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),Ze=()=>C,Qe=t.styled_default(Ze())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),eo=t.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),oo=t.styled_default("button")({name:"Button",class:"bis90pl",propsAsIs:!1}),to=()=>t.h1,so=t.styled_default(to())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),no=t.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),lo={[u.NotificationPromotionImagePosition.UNSET]:J,[u.NotificationPromotionImagePosition.FIT]:J,[u.NotificationPromotionImagePosition.CENTERED]:oe,[u.NotificationPromotionImagePosition.BOTTOM]:Ye,[u.NotificationPromotionImagePosition.SOLID]:Xe,[u.NotificationPromotionImagePosition.MIDDLE]:Qe},io=({src:e,imagePosition:s})=>{const l=lo[s];return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},ao=({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(we,{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(Fe,{onClick:s,children:[f!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsx(no,{children:o.jsx("img",{src:i,alt:a})}),o.jsxs(Ve,{children:[o.jsx(io,{src:p,imagePosition:y}),o.jsxs(Ue,{children:[a&&o.jsx(ze,{children:a}),c&&o.jsx(Ge,{children:c})]}),o.jsxs(oo,{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(eo,{src:m==null?void 0:m.ctaIcon,alt:"cta-icon"}),(m==null?void 0:m.label)||"Open"]}),o.jsx(so,{name:"chevronRight"})]})]})})},ro=t.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),te=t.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),se=t.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),ne=t.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),le="h10toh7",X=t.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),co=t.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),ie=t.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),mo=t.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),uo="s1nmch9k",Z=t.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),po=t.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),yo=t.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),vo=t.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),ae=t.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),fo=t.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),Ao=t.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),go=t.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),xo=t.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),Io="h17rwbtk",ho=t.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),Q=t.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),jo=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(ho,{children:[s>1&&o.jsxs(o.Fragment,{children:[o.jsxs(Q,{children:[l," of ",s]}),o.jsx(jo,{})]}),o.jsxs(Q,{children:[n,":",r<10?`0${r}`:r]})]})},_o=(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}},No=t.styled_default("div")({name:"Container",class:"c4q6dw1",propsAsIs:!1}),So=t.styled_default("div")({name:"ControlsContainer",class:"c1la67r",propsAsIs:!1}),Po="m3guev",$o="m7099mt",To="mmm6o5s",Eo=({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,x]=g.useState(0),[b,A]=g.useState(0),I=g.useRef(),h=g.useCallback(()=>{y(0),x(0),A(0),i(!1),s==null||s({muted:!1})},[s]);g.useEffect(()=>{if(r!=null&&r.url&&p.current){h();const j=_o(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:_=>{y(Math.round(_.duration-_.currentTime)),x(_.totalAds),A(_.adPosition)}})();return I.current=j,()=>{I.current=void 0,j()}}},[r==null?void 0:r.url,s,h,l,e.type,n]);const P=((c=e.sponsor)==null?void 0:c.logo)&&e.logoMode===u.PromotionLogoMode.CENTER;return o.jsxs(te,{className:"PromoOverlay",children:[o.jsxs(se,{children:[o.jsx(ne,{className:t.cx_default(!P&&le),children:o.jsx(ae,{style:{transform:"scale(1.5)"},children:"Ad"})}),o.jsxs(So,{children:[o.jsx(bo,{time:f,adCount:m,adPosition:b}),a&&o.jsx(t.b,{className:"ClosePromoIcon",close:()=>{var j;(j=I.current)==null||j.call(I),n==null||n(),h()}})]})]}),o.jsx(ie,{className:t.cx_default(Po,v&&$o,!v&&To),children:o.jsx(No,{ref:p})})]})},ee=e=>{var s,l,n,r,a,c,p,v,i,f,y,m,x,b,A,I,h,P,j,_,R,q,w,V,F,U,z,G,K,W;const{promotion:d,advertisementPaused:de,togglePause:N,controlVideo:$,skipAutoClose:ce,promotionId:T,onClose:me,markAsViewed:L,externalAd:H}=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,Y=!!((n=(l=d.banner)==null?void 0:l.video)!=null&&n.url),E=d.autoPlayVideo===u.AutoPlayVideo.ENABLED;if(g.useEffect(()=>{N==null||N(Y||E)},[]),g.useEffect(()=>{T&&d.type&&L&&L()},[T,d.type,L]),g.useEffect(()=>()=>{$==null||$({muted:!1})},[$]),H)return o.jsx(Eo,{...e,externalAd:H});let S=(r=d.banner)==null?void 0:r.url;S&&S.indexOf("http")!==0&&(S=`https://${S}`);let O=!0;return Y&&(!de||!E?O=!0:O=!1),o.jsxs(te,{className:"PromoOverlay",children:[o.jsxs(se,{children:[o.jsxs(ne,{className:t.cx_default(!k&&le),children:[((a=d.sponsor)==null?void 0:a.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(X,{src:(c=d.sponsor)==null?void 0:c.logo,alt:"promo"}),o.jsxs(yo,{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(co,{children:(i=d.sponsor)==null?void 0:i.name}),o.jsxs(vo,{className:"SponsorText",children:[o.jsx(ae,{children:"AD"}),o.jsx(fo,{children:"SPONSORED"})]})]})]}),o.jsx(t.b,{className:"ClosePromoIcon",close:me,autoClose:(f=d.closeTimer)==null?void 0:f.auto,duration:ce?0:(y=d.closeTimer)==null?void 0:y.seconds,isPlaying:O})]}),o.jsxs(ie,{children:[k&&o.jsx(X,{className:uo,src:(m=d.sponsor)==null?void 0:m.logo,alt:"promo"}),o.jsx(Z,{children:(b=(x=d.banner)==null?void 0:x.video)!=null&&b.url?o.jsx(t.Y,{source:(I=(A=d.banner)==null?void 0:A.video)==null?void 0:I.url,poster:(P=(h=d.banner)==null?void 0:h.video)==null?void 0:P.thumbnailUrl,aspectRatio:M?"1/1":"16/9",onPause:()=>{E&&(N==null||N(!0))},onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:T,type:d.type}}),N==null||N(!1)},controlVideo:$,autoPlay:E}):(j=d.banner)!=null&&j.imageUrl?o.jsx(mo,{style:M?{aspectRatio:"1/1"}:{},src:(_=d.banner)==null?void 0:_.imageUrl,alt:"promo"}):null}),!M&&o.jsxs(Z,{children:[((R=d.banner)==null?void 0:R.title)&&o.jsx(xo,{className:t.cx_default("AdvTitle",k&&Io),children:(q=d.banner)==null?void 0:q.title}),((w=d.banner)==null?void 0:w.body)&&o.jsx(po,{className:"AdvDescription",children:(V=d.banner)==null?void 0:V.body})]})]}),d.buttonType!==u.PromotionButtonType.NO_BUTTON&&o.jsx(Ao,{children:o.jsx(go,{href:S,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":T,"data-promo-type":d.type,target:"_blank",children:(W=(K=d.banner)==null?void 0:K.ctaButton)==null?void 0:W.label})})]})},Co=t.styled_default("div")({name:"SidebarContainer",class:"s1abskp8",propsAsIs:!1}),Lo=({children:e,direction:s,style:l,className:n,hiding:r})=>o.jsx(B,{direction:s,style:l,hiding:r,className:n,children:o.jsx(Co,{children:e})}),Mo=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11_LBAR||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21_LBAR,ko=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21,Oo=({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:x})=>e.promotion?c&&e.notification?o.jsx(ao,{open:i,notification:e.notification,promotionId:e.question.id}):!a&&!p&&(l||ko(e.promotion))?o.jsx(ro,{className:"PromoOverlayContainer",children:o.jsx(ee,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,onClose:s,skipAutoClose:n,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:x})}):a&&(l||Mo(e.promotion))?o.jsx(Lo,{className:"PromoSidebarContainer",direction:a,hiding:!1,children:o.jsx(ee,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,externalAd:f,onClose:s,controlVideo:y,skipAutoClose:n,advertisementPaused:m,togglePause:x})}):p?o.jsx(Ne,{promotionId:e.question.id,hiding:!1,promotion:e.promotion,direction:p}):null:null,Bo=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}})}},Ro=({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,x;const b=g.useRef(null),A=t.useStore(e.advertisement.$store);t.L(b,{enabled:!!A.data,event:"click",listener:Do});const I=!a&&!r;if(A.data===void 0||!v&&A.isViewed)return null;const h=((x=(m=(y=A==null?void 0:A.data)==null?void 0:y.notification)==null?void 0:m.promotion)==null?void 0:x.mode)===u.NotificationPromotionMode.LOWER_THIRD;return o.jsx(Bo,{ref:b,style:{height:I?"auto":"100%"},className:t.cx_default("SL-AdvertisementUIWrap",p&&"mobile-view",h&&"SL-AdvertisementUIWrap--lower-third"),children:o.jsx(Oo,{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})})},re=({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(Ro,{gamification:y,sidebar:s,banner:n,layoutMode:c,isMobileScreen:p,persistent:v,notification:i,skipTypeCheck:a,skipAutoClose:r,externalAd:l,controlVideo:e.controlVideoPlayer}):null},qo=({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(re,{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=qo;exports.StreamLayerSDKAdvertisementUI=re;
|
|
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"),ue=t.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),pe="a1rlj479",ye="s35f1di",ve="sj4471g",fe="b12050d8",Ae="b1d5ybek",ge=e=>e==="left"||e==="right"?ye:fe,xe=e=>e==="left"||e==="right"?ve:Ae,Ie=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(ue,{style:s,className:t.cx_default(l,pe,Ie(a),n&&!r&&ge(a),n&&r&&xe(a)),onAnimationEnd:c,children:e}),he=t.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),je=t.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),_e=()=>he,be=t.styled_default(_e())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Ne=({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(je,{className:"BannerContainer",children:o.jsx(be,{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}),Pe=t.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),$e=t.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),Te=t.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),D=t.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),Ee=()=>D,Ce=t.styled_default(Ee())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),Le=t.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),Me=t.styled_default("button")({name:"Button",class:"bgl6boa",propsAsIs:!1}),ke=t.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),Oe=t.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Be=t.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),De=t.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),Re={[u.NotificationPromotionImagePosition.BOTTOM]:D,[u.NotificationPromotionImagePosition.MIDDLE]:Ce},qe=({src:e,imagePosition:s})=>{const l=Re[s]||D;return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},we=({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(qe,{src:r,imagePosition:v}),o.jsxs(Pe,{children:[l&&o.jsx($e,{children:l}),n&&o.jsx(Te,{children:n})]})]}),o.jsxs(Oe,{children:[p!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsxs(o.Fragment,{children:[o.jsx(ke,{children:o.jsx("img",{src:c,alt:l})}),o.jsx(Be,{})]}),o.jsxs(Me,{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(Le,{src:i==null?void 0:i.ctaIcon,alt:"cta-icon"}),(i==null?void 0:i.label)||"Open"]})]})]})},Ve=t.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Fe=t.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),Ue=t.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),ze=t.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Ge=t.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),C=t.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),Ke=()=>C,J=t.styled_default(Ke())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),We=()=>C,oe=t.styled_default(We())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),He=()=>oe,Ye=t.styled_default(He())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Je=()=>C,Xe=t.styled_default(Je())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),Ze=()=>C,Qe=t.styled_default(Ze())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),eo=t.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),oo=t.styled_default("button")({name:"Button",class:"bis90pl",propsAsIs:!1}),to=()=>t.h1,so=t.styled_default(to())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),no=t.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),lo={[u.NotificationPromotionImagePosition.UNSET]:J,[u.NotificationPromotionImagePosition.FIT]:J,[u.NotificationPromotionImagePosition.CENTERED]:oe,[u.NotificationPromotionImagePosition.BOTTOM]:Ye,[u.NotificationPromotionImagePosition.SOLID]:Xe,[u.NotificationPromotionImagePosition.MIDDLE]:Qe},io=({src:e,imagePosition:s})=>{const l=lo[s];return o.jsx(l,{children:o.jsx("img",{src:e,alt:""})})},ao=({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(we,{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(Fe,{onClick:s,children:[f!==u.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&o.jsx(no,{children:o.jsx("img",{src:i,alt:a})}),o.jsxs(Ve,{children:[o.jsx(io,{src:p,imagePosition:y}),o.jsxs(Ue,{children:[a&&o.jsx(ze,{children:a}),c&&o.jsx(Ge,{children:c})]}),o.jsxs(oo,{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(eo,{src:m==null?void 0:m.ctaIcon,alt:"cta-icon"}),(m==null?void 0:m.label)||"Open"]}),o.jsx(so,{name:"chevronRight"})]})]})})},ro=t.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),te=t.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),se=t.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),ne=t.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),le="h10toh7",X=t.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),co=t.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),ie=t.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),mo=t.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),uo="s1nmch9k",Z=t.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),po=t.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),yo=t.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),vo=t.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),ae=t.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),fo=t.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),Ao=t.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),go=t.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),xo=t.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),Io="h17rwbtk",ho=t.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),Q=t.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),jo=t.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),_o=({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(ho,{children:[s>1&&o.jsxs(o.Fragment,{children:[o.jsxs(Q,{children:[l," of ",s]}),o.jsx(jo,{})]}),o.jsxs(Q,{children:[n,":",r<10?`0${r}`:r]})]})},bo=(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}},No=t.styled_default("div")({name:"Container",class:"c4q6dw1",propsAsIs:!1}),So=t.styled_default("div")({name:"ControlsContainer",class:"c1la67r",propsAsIs:!1}),Po="m3guev",$o="m7099mt",To="mmm6o5s",Eo=({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,x]=g.useState(0),[_,A]=g.useState(0),I=g.useRef(),h=g.useCallback(()=>{y(0),x(0),A(0),i(!1),s==null||s({muted:!1})},[s]);g.useEffect(()=>{if(r!=null&&r.url&&p.current){h();const j=bo(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)),x(b.totalAds),A(b.adPosition)}})();return I.current=j,()=>{I.current=void 0,j()}}},[r==null?void 0:r.url,s,h,l,e.type,n]);const P=((c=e.sponsor)==null?void 0:c.logo)&&e.logoMode===u.PromotionLogoMode.CENTER;return o.jsxs(te,{className:"PromoOverlay",children:[o.jsxs(se,{children:[o.jsx(ne,{className:t.cx_default(!P&&le),children:o.jsx(ae,{style:{transform:"scale(1.5)"},children:"Ad"})}),o.jsxs(So,{children:[o.jsx(_o,{time:f,adCount:m,adPosition:_}),a&&o.jsx(t.b,{className:"ClosePromoIcon",close:()=>{var j;(j=I.current)==null||j.call(I),n==null||n(),h()}})]})]}),o.jsx(ie,{className:t.cx_default(Po,v&&$o,!v&&To),children:o.jsx(No,{ref:p})})]})},ee=e=>{var s,l,n,r,a,c,p,v,i,f,y,m,x,_,A,I,h,P,j,b,R,q,w,V,F,U,z,G,K,W;const{promotion:d,advertisementPaused:de,togglePause:N,controlVideo:$,skipAutoClose:ce,promotionId:T,onClose:me,markAsViewed:L,externalAd:H}=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,Y=!!((n=(l=d.banner)==null?void 0:l.video)!=null&&n.url),E=d.autoPlayVideo===u.AutoPlayVideo.ENABLED;if(g.useEffect(()=>{N==null||N(Y||E)},[]),g.useEffect(()=>{T&&d.type&&L&&L()},[T,d.type,L]),g.useEffect(()=>()=>{$==null||$({muted:!1})},[$]),H)return o.jsx(Eo,{...e,externalAd:H});let S=(r=d.banner)==null?void 0:r.url;S&&S.indexOf("http")!==0&&(S=`https://${S}`);let O=!0;return Y&&(!de||!E?O=!0:O=!1),o.jsxs(te,{className:"PromoOverlay",children:[o.jsxs(se,{children:[o.jsxs(ne,{className:t.cx_default(!k&&le),children:[((a=d.sponsor)==null?void 0:a.logo)&&d.logoMode===u.PromotionLogoMode.LEFT&&o.jsx(X,{src:(c=d.sponsor)==null?void 0:c.logo,alt:"promo"}),o.jsxs(yo,{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(co,{children:(i=d.sponsor)==null?void 0:i.name}),o.jsxs(vo,{className:"SponsorText",children:[o.jsx(ae,{children:"AD"}),o.jsx(fo,{children:"SPONSORED"})]})]})]}),o.jsx(t.b,{className:"ClosePromoIcon",close:me,autoClose:(f=d.closeTimer)==null?void 0:f.auto,duration:ce?0:(y=d.closeTimer)==null?void 0:y.seconds,isPlaying:O})]}),o.jsxs(ie,{children:[k&&o.jsx(X,{className:uo,src:(m=d.sponsor)==null?void 0:m.logo,alt:"promo"}),o.jsx(Z,{children:(_=(x=d.banner)==null?void 0:x.video)!=null&&_.url?o.jsx(t.Y,{source:(I=(A=d.banner)==null?void 0:A.video)==null?void 0:I.url,poster:(P=(h=d.banner)==null?void 0:h.video)==null?void 0:P.thumbnailUrl,aspectRatio:M?"1/1":"16/9",onPause:()=>{E&&(N==null||N(!0))},onPlay:()=>{t.eventBus.emit("advertisement",{action:"videoPlay",payload:{id:T,type:d.type}}),N==null||N(!1)},controlVideo:$,autoPlay:E}):(j=d.banner)!=null&&j.imageUrl?o.jsx(mo,{style:M?{aspectRatio:"1/1"}:{},src:(b=d.banner)==null?void 0:b.imageUrl,alt:"promo"}):null}),!M&&o.jsxs(Z,{children:[((R=d.banner)==null?void 0:R.title)&&o.jsx(xo,{className:t.cx_default("AdvTitle",k&&Io),children:(q=d.banner)==null?void 0:q.title}),((w=d.banner)==null?void 0:w.body)&&o.jsx(po,{className:"AdvDescription",children:(V=d.banner)==null?void 0:V.body})]})]}),d.buttonType!==u.PromotionButtonType.NO_BUTTON&&o.jsx(Ao,{children:o.jsx(go,{href:S,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":T,"data-promo-type":d.type,target:"_blank",children:(W=(K=d.banner)==null?void 0:K.ctaButton)==null?void 0:W.label})})]})},Co=t.styled_default("div")({name:"SidebarContainer",class:"s1abskp8",propsAsIs:!1}),Lo=({children:e,direction:s,style:l,className:n,hiding:r})=>o.jsx(B,{direction:s,style:l,hiding:r,className:n,children:o.jsx(Co,{children:e})}),Mo=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11_LBAR||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21_LBAR,ko=e=>(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB11||(e==null?void 0:e.type)===u.PromotionType.INGAME_IAB21,Oo=({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:x})=>e.promotion?c&&e.notification?o.jsx(ao,{open:i,notification:e.notification,promotionId:e.question.id}):!a&&!p&&(l||ko(e.promotion))?o.jsx(ro,{className:"PromoOverlayContainer",children:o.jsx(ee,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,onClose:s,skipAutoClose:n,externalAd:f,controlVideo:y,advertisementPaused:m,togglePause:x})}):a&&(l||Mo(e.promotion))?o.jsx(Lo,{className:"PromoSidebarContainer",direction:a,hiding:!1,children:o.jsx(ee,{markAsViewed:v,promotionId:e.question.id,promotion:e.promotion,externalAd:f,onClose:s,controlVideo:y,skipAutoClose:n,advertisementPaused:m,togglePause:x})}):p?o.jsx(Ne,{promotionId:e.question.id,hiding:!1,promotion:e.promotion,direction:p}):null:null,Bo=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}})}},Ro=({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,x;const _=g.useRef(null),A=t.useStore(e.advertisement.$store);t.L(_,{enabled:!!A.data,event:"click",listener:Do});const I=!a&&!r;if(A.data===void 0||!v&&A.isViewed)return null;const h=((x=(m=(y=A==null?void 0:A.data)==null?void 0:y.notification)==null?void 0:m.promotion)==null?void 0:x.mode)===u.NotificationPromotionMode.LOWER_THIRD;return o.jsx(Bo,{ref:_,style:{height:I?"auto":"100%"},className:t.cx_default("SL-AdvertisementUIWrap",p&&"mobile-view",h&&"SL-AdvertisementUIWrap--lower-third"),children:o.jsx(Oo,{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})})},re=({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(Ro,{gamification:y,sidebar:s,banner:n,layoutMode:c,isMobileScreen:p,persistent:v,notification:i,skipTypeCheck:a,skipAutoClose:r,externalAd:l,controlVideo:e.controlVideoPlayer}):null},qo=({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(re,{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=qo;exports.StreamLayerSDKAdvertisementUI=re;
|
|
@@ -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,y=n+(u?" ":s("│"))+" ";return n+s(u?"└":"├")+s("─")+s(d?"┬":"─")+" "+e(l,y,a).slice(n.length+2)}).join("")};const E_=__,br=Symbol("avvio.TimeTree.untrackNode"),Aa=Symbol("avvio.TimeTree.trackNode"),Nr=Symbol("avvio.TimeTree.getParent"),Ir=Symbol("avvio.TimeTree.getNode"),Or=Symbol("avvio.TimeTree.addNode");let b_=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])}[br](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)}[Nr](e){if(e===null)return this.root;const t=this.tableLabel.get(e);return t.id?t:t[t.length-1]}[Ir](e){return this.tableId.get(e)}[Or](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[Nr](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[Or](e,t,n)}stop(e,t=Date.now()){const n=this[Ir](e);n&&(n.stop=t,n.diff=n.stop-n.start||0,this[br](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 E_(t)}};var N_=b_,Vs={exports:{}},rs={exports:{}},wa,vr;function I_(){if(vr)return wa;vr=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 y=typeof u;if(y==="string"&&u.length>0)return r(u);if(y==="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 y=parseFloat(d[1]),T=(d[2]||"ms").toLowerCase();switch(T){case"years":case"year":case"yrs":case"yr":case"y":return y*o;case"weeks":case"week":case"w":return y*s;case"days":case"day":case"d":return y*a;case"hours":case"hour":case"hrs":case"hr":case"h":return y*n;case"minutes":case"minute":case"mins":case"min":case"m":return y*t;case"seconds":case"second":case"secs":case"sec":case"s":return y*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;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,y,T){var f=d>=y*1.5;return Math.round(u/y)+" "+T+(f?"s":"")}return wa}function O_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=s,n.enabled=r,n.humanize=I_(),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 y=0;y<u.length;y++)d=(d<<5)-d+u.charCodeAt(y),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,y=null,T,f;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:()=>y!==null?y:(T!==n.namespaces&&(T=n.namespaces,f=n.enabled(u)),f),set:N=>{y=N}}),typeof n.init=="function"&&n.init(k),k}function a(u,d){const y=n(this.namespace+(typeof d>"u"?":":d)+u);return y.log=this.log,y}function s(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const y=(typeof u=="string"?u:"").split(/[\s,]+/),T=y.length;for(d=0;d<T;d++)y[d]&&(u=y[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,y;for(d=0,y=n.skips.length;d<y;d++)if(n.skips[d].test(u))return!1;for(d=0,y=n.names.length;d<y;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 v_=O_;(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,y=>{y!=="%%"&&(u++,y==="%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=v_(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(rs,rs.exports);var Uc=rs.exports;const A_=lc,w_=kc.EventEmitter,R_=ea.inherits,ue=Uc("avvio"),{AVV_ERR_READY_TIMEOUT:L_}=Dc,Ra=Symbol.for("plugin-meta");function M_(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 P_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function Vt(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=M_(t,n),this.isAfter=a,this.q=A_(e,C_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}R_(Vt,w_);Vt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){ue("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 ue("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,ue("exec",s);let o;const r=l=>{if(a){ue("loading complete",s);return}this._error=l,ue(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(ue("setting up timeout",s,this.timeout),o=setTimeout(function(){ue("timed out",s),o=null;const l=new L_(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"&&(ue("exec: resolving promise",s),c.then(()=>D.nextTick(r),l=>D.nextTick(r,l)))};Vt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(ue("rejecting promise",this.name,n),this._promise.reject(n)):(ue("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=P_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};Vt.prototype.enqueue=function(e,t){ue("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Vt.prototype.finish=function(e,t){ue("finish",this.name,e);const n=()=>{this.loaded||(ue("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(ue("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{ue("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else ue("delayed",this.name),this.q.drain=()=>{ue("drain",this.name),this.q.drain=D_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function C_(e,t){const n=this;D.nextTick(qs.bind(n),e,t)}function qs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,qs.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 D_(){}Vs.exports=Vt;Vs.exports.loadPlugin=qs;var U_=Vs.exports;const Ar=lc,F_=kc.EventEmitter,B_=ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:La,AVV_ERR_CALLBACK_NOT_FN:Wt,AVV_ERR_PLUGIN_NOT_VALID:G_,AVV_ERR_ROOT_PLG_BOOTED:V_,AVV_ERR_READY_TIMEOUT:q_}=Dc,x_=N_,is=U_,Ft=Uc("avvio"),xn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function H_(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:Fc.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 Wt(r,typeof m);return n.ready(m?Pa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new Wt(c,typeof m);return n.onClose(K_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new Wt(l,typeof m);return m?(n.close(Pa(m,this)),this):n.close()}}function ce(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 ce)){const a=new ce(e,t,n);return e&&H_(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 x_,this._readyQ=Ar(this,Bc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=wr},this._closeQ=Ar(this,$_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=wr},this._doStart=null,this._root=new is(this,Q_.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)})}),is.loadPlugin.call(this,this._root,a=>{Ft("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 Q_(e,t,n){this._doStart=n,t.autostart&&this.start()}B_(ce,F_);ce.prototype.start=function(){return this.started=!0,D.nextTick(this._doStart),this};ce.prototype.override=function(e,t,n){return e};function Y_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new G_(typeof e);return e}ce.prototype[xn]=!0;ce.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};ce.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(ce.prototype,"then",{get:Fc});ce.prototype._addPlugin=function(e,t,n){if(e=Y_(e),t=t||{},this.booted)throw new V_;const a=this._current[0],s=new is(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};ce.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Bc.call(this,e,s)}return this};ce.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};ce.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Wt("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};ce.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Wt("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)}})};ce.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ce.prototype.toJSON=function(){return this.pluginTree.toJSON()};function wr(){}function Fc(){if(this.booted){Ft("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Ft("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function Bc(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 j_.call(this,e,a,n,t)}function j_(e,t,n,a){const s=e.name;Ft("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Ft("timed out",s),o=null;const c=new q_(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 $_(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"?(Ft("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 K_(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)}}ws.exports=ce;ws.exports.express=function(e){return ce(e,{expose:{use:"load"}})};var W_=ws.exports;const z_=Nh(W_);(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 J_(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=z_(Object.create({}),{autostart:!1});return r.use(eh,{friendsTab:a.friendsTab}),r.use($k,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Jk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(Zk,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(dk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(gk),r.use(zk),r.use(ph),r.use(Fk),r.use(bh),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 X_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Hs.useState(null);return Hs.useEffect(()=>{let y=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(f=>(f!==null&&typeof f.disableApp=="function"&&f.disableApp(),null)),()=>{y=!0};const T=J_(e,n,a,{version:"1.9.3",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const f of t)T.use(f);return T.ready().then(f=>{y||(d(f.sdk),typeof window<"u")}).catch(f=>console.log(f)),()=>{y=!0,T.close(function(f){if(f)throw f})}},[e,n]),u};exports.AutoPlayVideo=Qn;exports.CloseTimerAuto=li;exports.CtaIconMode=si;exports.InvitationFrom=Pn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=ni;exports.NotificationPromotionMode=ti;exports.NotificationSponsorLogoMode=ai;exports.PickHistoryStatus=Nt;exports.PromotionButtonType=ri;exports.PromotionLogoMode=ii;exports.PromotionType=Te;exports.QuestionImages=ot;exports.QuestionStatus=re;exports.QuestionType=C;exports.SdkOverlayType=Q;exports.createContextKey=Qa;exports.global=Ya;exports.pino_1=Ur;exports.useStreamLayerApp=X_;
|
|
17
|
+
`).slice(0,2).map(n=>n.trim()).join(" -- ")}function P_(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}function Vt(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=M_(t,n),this.isAfter=a,this.q=A_(e,C_,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}R_(Vt,w_);Vt.prototype.exec=function(e,t){const n=this.func;let a=!1;const s=this.name;if(this.parent._error&&!this.isAfter){ue("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 ue("override errored",s),t(l)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,ue("exec",s);let o;const r=l=>{if(a){ue("loading complete",s);return}this._error=l,ue(l?"exec errored":"exec completed",s),a=!0,o&&clearTimeout(o),t(l)};this.timeout>0&&(ue("setting up timeout",s,this.timeout),o=setTimeout(function(){ue("timed out",s),o=null;const l=new L_(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"&&(ue("exec: resolving promise",s),c.then(()=>D.nextTick(r),l=>D.nextTick(r,l)))};Vt.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const e=()=>{this.server.after((n,a)=>{this._error=n,this.q.pause(),n?(ue("rejecting promise",this.name,n),this._promise.reject(n)):(ue("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=P_(),t=this._promise.promise,this.server?e():this.on("start",e)),t};Vt.prototype.enqueue=function(e,t){ue("enqueue",this.name,e.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(e,t)};Vt.prototype.finish=function(e,t){ue("finish",this.name,e);const n=()=>{this.loaded||(ue("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(ue("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const s=()=>{ue("wrap"),queueMicrotask(a)};this._promise.resolve(),this._promise.promise.then(s,s),this._promise=null}else n();else ue("delayed",this.name),this.q.drain=()=>{ue("drain",this.name),this.q.drain=D_,queueMicrotask(a)}};queueMicrotask(a),this.q.resume()};function C_(e,t){const n=this;D.nextTick(qs.bind(n),e,t)}function qs(e,t){if(typeof e.func.then=="function"){e.func.then(a=>{typeof a.default=="function"&&(a=a.default),e.func=a,qs.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 D_(){}Vs.exports=Vt;Vs.exports.loadPlugin=qs;var U_=Vs.exports;const Ar=lc,F_=kc.EventEmitter,B_=ea.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:La,AVV_ERR_CALLBACK_NOT_FN:Wt,AVV_ERR_PLUGIN_NOT_VALID:G_,AVV_ERR_ROOT_PLG_BOOTED:V_,AVV_ERR_READY_TIMEOUT:q_}=Dc,x_=N_,is=U_,Ft=Uc("avvio"),xn=Symbol("kAvvio"),Ma=Symbol("kThenifyDoNotWrap");function H_(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:Fc.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 Wt(r,typeof m);return n.ready(m?Pa(m,this):void 0)},e[c]=function(m){if(typeof m!="function")throw new Wt(c,typeof m);return n.onClose(K_(m,this)),this},e[l]=function(m){if(m&&typeof m!="function")throw new Wt(l,typeof m);return m?(n.close(Pa(m,this)),this):n.close()}}function ce(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 ce)){const a=new ce(e,t,n);return e&&H_(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 x_,this._readyQ=Ar(this,Bc,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=wr},this._closeQ=Ar(this,$_,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=wr},this._doStart=null,this._root=new is(this,Q_.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)})}),is.loadPlugin.call(this,this._root,a=>{Ft("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 Q_(e,t,n){this._doStart=n,t.autostart&&this.start()}B_(ce,F_);ce.prototype.start=function(){return this.started=!0,D.nextTick(this._doStart),this};ce.prototype.override=function(e,t,n){return e};function Y_(e){if(e&&typeof e=="object"&&typeof e.default=="function"&&(e=e.default),!(e&&(typeof e=="function"||typeof e.then=="function")))throw new G_(typeof e);return e}ce.prototype[xn]=!0;ce.prototype.use=function(e,t){return this._lastUsed=this._addPlugin(e,t,!1),this};ce.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(ce.prototype,"then",{get:Fc});ce.prototype._addPlugin=function(e,t,n){if(e=Y_(e),t=t||{},this.booted)throw new V_;const a=this._current[0],s=new is(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};ce.prototype.after=function(e){if(!e)return this._loadRegistered();this._addPlugin(t.bind(this),{},!0);function t(n,a,s){Bc.call(this,e,s)}return this};ce.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};ce.prototype.close=function(e){let t;if(e){if(typeof e!="function")throw new Wt("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};ce.prototype.ready=function(e){if(e){if(typeof e!="function")throw new Wt("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)}})};ce.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};ce.prototype.toJSON=function(){return this.pluginTree.toJSON()};function wr(){}function Fc(){if(this.booted){Ft("thenify returning null because we are already booted");return}if(this[Ma]){this[Ma]=!1;return}return Ft("thenify"),(e,t)=>this._loadRegistered().then(()=>(this[Ma]=!0,e(this._server)),t)}function Bc(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 j_.call(this,e,a,n,t)}function j_(e,t,n,a){const s=e.name;Ft("setting up ready timeout",s,this._timeout);let o=setTimeout(()=>{Ft("timed out",s),o=null;const c=new q_(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 $_(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"?(Ft("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 K_(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)}}ws.exports=ce;ws.exports.express=function(e){return ce(e,{expose:{use:"load"}})};var W_=ws.exports;const z_=Nh(W_);(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 J_(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=z_(Object.create({}),{autostart:!1});return r.use(eh,{friendsTab:a.friendsTab}),r.use($k,{onDeepLinkHandled:a==null?void 0:a.onDeepLinkHandled}),r.use(Jk,{videoPlayerController:a==null?void 0:a.videoPlayerController}),r.use(Zk,{onContentActivate:a==null?void 0:a.onContentActivate,withAd:a==null?void 0:a.withAd,withAdNotification:a==null?void 0:a.withAdNotification}),r.use(dk,{sdkKey:e,host:s,analyticsHost:o,version:a==null?void 0:a.version}),r.use(gk),r.use(zk),r.use(ph),r.use(Fk),r.use(bh),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 X_=({sdkKey:e,plugins:t,production:n,autoEnable:a,onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m})=>{const[u,d]=Hs.useState(null);return Hs.useEffect(()=>{let y=!1;if(!e)return console.error("streamlayer sdk key should be provided"),d(f=>(f!==null&&typeof f.disableApp=="function"&&f.disableApp(),null)),()=>{y=!0};const T=J_(e,n,a,{version:"1.9.4",onDeepLinkHandled:s,videoPlayerController:o,onContentActivate:r,withAdNotification:c,withAd:l,friendsTab:m});if(t)for(const f of t)T.use(f);return T.ready().then(f=>{y||(d(f.sdk),typeof window<"u")}).catch(f=>console.log(f)),()=>{y=!0,T.close(function(f){if(f)throw f})}},[e,n]),u};exports.AutoPlayVideo=Qn;exports.CloseTimerAuto=li;exports.CtaIconMode=si;exports.InvitationFrom=Pn;exports.NotificationEnabled=Ln;exports.NotificationPromotionImagePosition=ni;exports.NotificationPromotionMode=ti;exports.NotificationSponsorLogoMode=ai;exports.PickHistoryStatus=Nt;exports.PromotionButtonType=ri;exports.PromotionLogoMode=ii;exports.PromotionType=Te;exports.QuestionImages=ot;exports.QuestionStatus=re;exports.QuestionType=C;exports.SdkOverlayType=Q;exports.createContextKey=Qa;exports.global=Ya;exports.pino_1=Ur;exports.useStreamLayerApp=X_;
|
package/lib/dist/cjs/masters.js
CHANGED
|
@@ -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,L=o+(_?" ":c("│"))+" ";return o+c(_?"└":"├")+c("─")+c(N?"┬":"─")+" "+n(b,L,l).slice(o.length+2)}).join("")};const kte=bte,QS=Symbol("avvio.TimeTree.untrackNode"),Z5=Symbol("avvio.TimeTree.trackNode"),YS=Symbol("avvio.TimeTree.getParent"),KS=Symbol("avvio.TimeTree.getNode"),ZS=Symbol("avvio.TimeTree.addNode");let Ste=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])}[QS](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)}[YS](n){if(n===null)return this.root;const a=this.tableLabel.get(n);return a.id?a:a[a.length-1]}[KS](n){return this.tableId.get(n)}[ZS](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[YS](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[ZS](n,a,o)}stop(n,a=Date.now()){const o=this[KS](n);o&&(o.stop=a,o.diff=o.stop-o.start||0,this[QS](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 kte(a)}};var wte=Ste,Oy={exports:{}},F9={exports:{}},X5,XS;function Cte(){if(XS)return X5;XS=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 L=typeof _;if(L==="string"&&_.length>0)return f(_);if(L==="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 L=parseFloat(N[1]),O=(N[2]||"ms").toLowerCase();switch(O){case"years":case"year":case"yrs":case"yr":case"y":return L*p;case"weeks":case"week":case"w":return L*c;case"days":case"day":case"d":return L*l;case"hours":case"hour":case"hrs":case"hr":case"h":return L*o;case"minutes":case"minute":case"mins":case"min":case"m":return L*a;case"seconds":case"second":case"secs":case"sec":case"s":return L*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return L;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,L,O){var P=N>=L*1.5;return Math.round(_/L)+" "+O+(P?"s":"")}return X5}function Ete(n){o.debug=o,o.default=o,o.coerce=b,o.disable=p,o.enable=c,o.enabled=f,o.humanize=Cte(),o.destroy=C,Object.keys(n).forEach(_=>{o[_]=n[_]}),o.names=[],o.skips=[],o.formatters={};function a(_){let N=0;for(let L=0;L<_.length;L++)N=(N<<5)-N+_.charCodeAt(L),N|=0;return o.colors[Math.abs(N)%o.colors.length]}o.selectColor=a;function o(_){let N,L=null,O,P;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,le)=>{if(te==="%%")return"%";Q++;const ae=o.formatters[le];if(typeof ae=="function"){const we=j[Q];te=ae.call(V,we),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:()=>L!==null?L:(O!==o.namespaces&&(O=o.namespaces,P=o.enabled(_)),P),set:j=>{L=j}}),typeof o.init=="function"&&o.init(D),D}function l(_,N){const L=o(this.namespace+(typeof N>"u"?":":N)+_);return L.log=this.log,L}function c(_){o.save(_),o.namespaces=_,o.names=[],o.skips=[];let N;const L=(typeof _=="string"?_:"").split(/[\s,]+/),O=L.length;for(N=0;N<O;N++)L[N]&&(_=L[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,L;for(N=0,L=o.skips.length;N<L;N++)if(o.skips[N].test(_))return!1;for(N=0,L=o.names.length;N<L;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 _te=Ete;(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,L=>{L!=="%%"&&(_++,L==="%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=_te(a);const{formatters:y}=n.exports;y.j=function(b){try{return JSON.stringify(b)}catch(C){return"[UnexpectedJSONParseError]: "+C.message}}})(F9,F9.exports);var qE=F9.exports;const Ite=TE,Nte=NE.EventEmitter,Rte=P6.inherits,Fa=qE("avvio"),{AVV_ERR_READY_TIMEOUT:Lte}=GE,J5=Symbol.for("plugin-meta");function Ote(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 Ate(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function Im(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=Ote(a,o),this.isAfter=l,this.q=Ite(n,xte,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Rte(Im,Nte);Im.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Fa("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 Fa("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Fa("exec",c);let p;const f=b=>{if(l){Fa("loading complete",c);return}this._error=b,Fa(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Fa("setting up timeout",c,this.timeout),p=setTimeout(function(){Fa("timed out",c),p=null;const b=new Lte(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"&&(Fa("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};Im.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Fa("rejecting promise",this.name,o),this._promise.reject(o)):(Fa("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=Ate(),a=this._promise.promise,this.server?n():this.on("start",n)),a};Im.prototype.enqueue=function(n,a){Fa("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};Im.prototype.finish=function(n,a){Fa("finish",this.name,n);const o=()=>{this.loaded||(Fa("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(Fa("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Fa("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Fa("delayed",this.name),this.q.drain=()=>{Fa("drain",this.name),this.q.drain=Pte,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function xte(n,a){const o=this;St.nextTick(Ay.bind(o),n,a)}function Ay(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,Ay.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 Pte(){}Oy.exports=Im;Oy.exports.loadPlugin=Ay;var Mte=Oy.exports;const JS=TE,Dte=NE.EventEmitter,Ute=P6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:e9,AVV_ERR_CALLBACK_NOT_FN:o2,AVV_ERR_PLUGIN_NOT_VALID:Fte,AVV_ERR_ROOT_PLG_BOOTED:Vte,AVV_ERR_READY_TIMEOUT:jte}=GE,Bte=wte,V9=Mte,km=qE("avvio"),T6=Symbol("kAvvio"),t9=Symbol("kThenifyDoNotWrap");function $te(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:WE.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 o2(f,typeof C);return o.ready(C?n9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new o2(y,typeof C);return o.onClose(Wte(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new o2(b,typeof C);return C?(o.close(n9(C,this)),this):o.close()}}function wa(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 wa)){const l=new wa(n,a,o);return n&&$te(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 Bte,this._readyQ=JS(this,QE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=ew},this._closeQ=JS(this,qte,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=ew},this._doStart=null,this._root=new V9(this,zte.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)})}),V9.loadPlugin.call(this,this._root,l=>{km("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 zte(n,a,o){this._doStart=o,a.autostart&&this.start()}Ute(wa,Dte);wa.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};wa.prototype.override=function(n,a,o){return n};function Hte(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new Fte(typeof n);return n}wa.prototype[T6]=!0;wa.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};wa.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(wa.prototype,"then",{get:WE});wa.prototype._addPlugin=function(n,a,o){if(n=Hte(n),a=a||{},this.booted)throw new Vte;const l=this._current[0],c=new V9(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};wa.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){QE.call(this,n,c)}return this};wa.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};wa.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new o2("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};wa.prototype.ready=function(n){if(n){if(typeof n!="function")throw new o2("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)}})};wa.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};wa.prototype.toJSON=function(){return this.pluginTree.toJSON()};function ew(){}function WE(){if(this.booted){km("thenify returning null because we are already booted");return}if(this[t9]){this[t9]=!1;return}return km("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[t9]=!0,n(this._server)),a)}function QE(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 Gte.call(this,n,l,o,a)}function Gte(n,a,o,l){const c=n.name;km("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{km("timed out",c),p=null;const y=new jte(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"?(km("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 Wte(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)}}by.exports=wa;by.exports.express=function(n){return wa(n,{expose:{use:"load"}})};var Qte=by.exports;const Yte=wJ(Qte);(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 Kte(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=Yte(Object.create({}),{autostart:!1});return f.use(JX,{friendsTab:l.friendsTab}),f.use(qX,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(KX,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(XX,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),f.use(dX,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(gX),f.use(YX),f.use(mJ),f.use(DX),f.use(SJ),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 Zte=({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 L=!1;if(!n)return console.error("streamlayer sdk key should be provided"),N(P=>(P!==null&&typeof P.disableApp=="function"&&P.disableApp(),null)),()=>{L=!0};const O=Kte(n,o,l,{version:"1.9.3",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C});if(a)for(const P of a)O.use(P);return O.ready().then(P=>{L||(N(P.sdk),typeof window<"u")}).catch(P=>console.log(P)),()=>{L=!0,O.close(function(P){if(P)throw P})}},[n,o]),_},Xte=({event:n})=>{const a=xy(),o=tne();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 YE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(YE||{});const Jte={status:0,sdk:null},V6=W.createContext(Jte),ene=({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:L})=>{const O=Zte({sdkKey:n,plugins:o,production:p,autoEnable:f,onDeepLinkHandled:_,videoPlayerController:N,onContentActivate:L,withAdNotification:y,withAd:b,friendsTab:C}),P=W.useRef(""),D=W.useMemo(()=>O?{sdk:O,status:2,event:P,theme:a}:{status:1,sdk:null,event:P,theme:a},[O]);return W.useEffect(()=>{O&&O.options.setKey("friendsTab",C)},[O,C]),W.useEffect(()=>()=>{_&&(O==null||O.removeDeepLinkHandler(_)),N&&(O==null||O.removeVideoPlayerController(N))},[O]),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(Xte,{event:c}),l]})},xy=()=>{const{sdk:n}=W.useContext(V6);return n},tne=()=>{const{event:n}=W.useContext(V6);return n},nne=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(ene,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),ane=({children:n,overlays:a})=>{const{sdk:o,status:l}=W.useContext(V6);return l===YE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(MC,{style:{height:"100%"},children:w.jsx(Rq,{sdk:o,overlays:a,children:n})})}):n({})};class rne 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(ane,{...this.props})}}const one=({token:n,schema:a})=>{const o=xy();return W.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n),o&&(o.withAuth=!0)},[n,a,o]),null},sne=()=>{const n=xy();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(MC,{children:w.jsx(Vq,{sdk:n})})}):null};exports.C=EC;exports.C$1=GV;exports.M=my;exports.MastersStreamLayerProvider=nne;exports.MastersStreamLayerSDKReact=rne;exports.N=la;exports.O=ry;exports.S=RC;exports.S$1=WV;exports.StreamLayerLogin=one;exports.StreamLayerSDKPoints=sne;exports.T=dy;exports.b=CC;exports.cx_default=Su;exports.d=QV;exports.k=OC;exports.l=zV;exports.m=n2;exports.m$1=$V;exports.n=sy;exports.p=Bq;exports.styled_default=x;exports.useStore=Ut;exports.z=Sz;
|
|
211
|
+
`).slice(0,2).map(o=>o.trim()).join(" -- ")}function Ate(){const n={};return n.promise=new Promise((a,o)=>{n.resolve=a,n.reject=o}),n}function Im(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=Ote(a,o),this.isAfter=l,this.q=Ite(n,xte,1),this.q.pause(),this._error=null,this.loaded=!1,this._promise=null}Rte(Im,Nte);Im.prototype.exec=function(n,a){const o=this.func;let l=!1;const c=this.name;if(this.parent._error&&!this.isAfter){Fa("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 Fa("override errored",c),a(b)}this.opts=typeof this.opts=="function"?this.opts(this.server):this.opts,Fa("exec",c);let p;const f=b=>{if(l){Fa("loading complete",c);return}this._error=b,Fa(b?"exec errored":"exec completed",c),l=!0,p&&clearTimeout(p),a(b)};this.timeout>0&&(Fa("setting up timeout",c,this.timeout),p=setTimeout(function(){Fa("timed out",c),p=null;const b=new Lte(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"&&(Fa("exec: resolving promise",c),y.then(()=>St.nextTick(f),b=>St.nextTick(f,b)))};Im.prototype.loadedSoFar=function(){if(this.loaded)return Promise.resolve();const n=()=>{this.server.after((o,l)=>{this._error=o,this.q.pause(),o?(Fa("rejecting promise",this.name,o),this._promise.reject(o)):(Fa("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=Ate(),a=this._promise.promise,this.server?n():this.on("start",n)),a};Im.prototype.enqueue=function(n,a){Fa("enqueue",this.name,n.name),this.emit("enqueue",this.server?this.server.name:null,this.name,Date.now()),this.q.push(n,a)};Im.prototype.finish=function(n,a){Fa("finish",this.name,n);const o=()=>{this.loaded||(Fa("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(Fa("check",this.name,this.q.length(),this.q.running(),this._promise),this.q.length()===0&&this.q.running()===0)if(this._promise){const c=()=>{Fa("wrap"),queueMicrotask(l)};this._promise.resolve(),this._promise.promise.then(c,c),this._promise=null}else o();else Fa("delayed",this.name),this.q.drain=()=>{Fa("drain",this.name),this.q.drain=Pte,queueMicrotask(l)}};queueMicrotask(l),this.q.resume()};function xte(n,a){const o=this;St.nextTick(Ay.bind(o),n,a)}function Ay(n,a){if(typeof n.func.then=="function"){n.func.then(l=>{typeof l.default=="function"&&(l=l.default),n.func=l,Ay.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 Pte(){}Oy.exports=Im;Oy.exports.loadPlugin=Ay;var Mte=Oy.exports;const JS=TE,Dte=NE.EventEmitter,Ute=P6.inherits,{AVV_ERR_EXPOSE_ALREADY_DEFINED:e9,AVV_ERR_CALLBACK_NOT_FN:o2,AVV_ERR_PLUGIN_NOT_VALID:Fte,AVV_ERR_ROOT_PLG_BOOTED:Vte,AVV_ERR_READY_TIMEOUT:jte}=GE,Bte=wte,V9=Mte,km=qE("avvio"),T6=Symbol("kAvvio"),t9=Symbol("kThenifyDoNotWrap");function $te(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:WE.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 o2(f,typeof C);return o.ready(C?n9(C,this):void 0)},n[y]=function(C){if(typeof C!="function")throw new o2(y,typeof C);return o.onClose(Wte(C,this)),this},n[b]=function(C){if(C&&typeof C!="function")throw new o2(b,typeof C);return C?(o.close(n9(C,this)),this):o.close()}}function wa(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 wa)){const l=new wa(n,a,o);return n&&$te(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 Bte,this._readyQ=JS(this,QE,1),this._readyQ.pause(),this._readyQ.drain=()=>{this.emit("start"),this._readyQ.drain=ew},this._closeQ=JS(this,qte,1),this._closeQ.pause(),this._closeQ.drain=()=>{this.emit("close"),this._closeQ.drain=ew},this._doStart=null,this._root=new V9(this,zte.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)})}),V9.loadPlugin.call(this,this._root,l=>{km("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 zte(n,a,o){this._doStart=o,a.autostart&&this.start()}Ute(wa,Dte);wa.prototype.start=function(){return this.started=!0,St.nextTick(this._doStart),this};wa.prototype.override=function(n,a,o){return n};function Hte(n){if(n&&typeof n=="object"&&typeof n.default=="function"&&(n=n.default),!(n&&(typeof n=="function"||typeof n.then=="function")))throw new Fte(typeof n);return n}wa.prototype[T6]=!0;wa.prototype.use=function(n,a){return this._lastUsed=this._addPlugin(n,a,!1),this};wa.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(wa.prototype,"then",{get:WE});wa.prototype._addPlugin=function(n,a,o){if(n=Hte(n),a=a||{},this.booted)throw new Vte;const l=this._current[0],c=new V9(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};wa.prototype.after=function(n){if(!n)return this._loadRegistered();this._addPlugin(a.bind(this),{},!0);function a(o,l,c){QE.call(this,n,c)}return this};wa.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};wa.prototype.close=function(n){let a;if(n){if(typeof n!="function")throw new o2("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};wa.prototype.ready=function(n){if(n){if(typeof n!="function")throw new o2("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)}})};wa.prototype.prettyPrint=function(){return this.pluginTree.prittyPrint()};wa.prototype.toJSON=function(){return this.pluginTree.toJSON()};function ew(){}function WE(){if(this.booted){km("thenify returning null because we are already booted");return}if(this[t9]){this[t9]=!1;return}return km("thenify"),(n,a)=>this._loadRegistered().then(()=>(this[t9]=!0,n(this._server)),a)}function QE(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 Gte.call(this,n,l,o,a)}function Gte(n,a,o,l){const c=n.name;km("setting up ready timeout",c,this._timeout);let p=setTimeout(()=>{km("timed out",c),p=null;const y=new jte(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"?(km("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 Wte(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)}}by.exports=wa;by.exports.express=function(n){return wa(n,{expose:{use:"load"}})};var Qte=by.exports;const Yte=wJ(Qte);(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 Kte(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=Yte(Object.create({}),{autostart:!1});return f.use(JX,{friendsTab:l.friendsTab}),f.use(qX,{onDeepLinkHandled:l==null?void 0:l.onDeepLinkHandled}),f.use(KX,{videoPlayerController:l==null?void 0:l.videoPlayerController}),f.use(XX,{onContentActivate:l==null?void 0:l.onContentActivate,withAd:l==null?void 0:l.withAd,withAdNotification:l==null?void 0:l.withAdNotification}),f.use(dX,{sdkKey:n,host:c,analyticsHost:p,version:l==null?void 0:l.version}),f.use(gX),f.use(YX),f.use(mJ),f.use(DX),f.use(SJ),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 Zte=({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 L=!1;if(!n)return console.error("streamlayer sdk key should be provided"),N(P=>(P!==null&&typeof P.disableApp=="function"&&P.disableApp(),null)),()=>{L=!0};const O=Kte(n,o,l,{version:"1.9.4",onDeepLinkHandled:c,videoPlayerController:p,onContentActivate:f,withAdNotification:y,withAd:b,friendsTab:C});if(a)for(const P of a)O.use(P);return O.ready().then(P=>{L||(N(P.sdk),typeof window<"u")}).catch(P=>console.log(P)),()=>{L=!0,O.close(function(P){if(P)throw P})}},[n,o]),_},Xte=({event:n})=>{const a=xy(),o=tne();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 YE=(n=>(n[n.UNSET=0]="UNSET",n[n.CONNECTED=1]="CONNECTED",n[n.READY=2]="READY",n))(YE||{});const Jte={status:0,sdk:null},V6=W.createContext(Jte),ene=({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:L})=>{const O=Zte({sdkKey:n,plugins:o,production:p,autoEnable:f,onDeepLinkHandled:_,videoPlayerController:N,onContentActivate:L,withAdNotification:y,withAd:b,friendsTab:C}),P=W.useRef(""),D=W.useMemo(()=>O?{sdk:O,status:2,event:P,theme:a}:{status:1,sdk:null,event:P,theme:a},[O]);return W.useEffect(()=>{O&&O.options.setKey("friendsTab",C)},[O,C]),W.useEffect(()=>()=>{_&&(O==null||O.removeDeepLinkHandler(_)),N&&(O==null||O.removeVideoPlayerController(N))},[O]),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(Xte,{event:c}),l]})},xy=()=>{const{sdk:n}=W.useContext(V6);return n},tne=()=>{const{event:n}=W.useContext(V6);return n},nne=({sdkKey:n,plugins:a,children:o,onDeepLinkHandled:l,videoPlayerController:c,production:p=!0})=>w.jsx(ene,{sdkKey:n,plugins:a,production:p,autoEnable:!1,onDeepLinkHandled:l,videoPlayerController:c,children:o}),ane=({children:n,overlays:a})=>{const{sdk:o,status:l}=W.useContext(V6);return l===YE.UNSET?(console.error("Wrap app in `StreamLayerProvider`"),n({})):o?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(MC,{style:{height:"100%"},children:w.jsx(Rq,{sdk:o,overlays:a,children:n})})}):n({})};class rne 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(ane,{...this.props})}}const one=({token:n,schema:a})=>{const o=xy();return W.useEffect(()=>{n&&a&&o&&o.authorizationBypass(a,n),o&&(o.withAuth=!0)},[n,a,o]),null},sne=()=>{const n=xy();return n?w.jsx("div",{className:"StreamLayerSDK",children:w.jsx(MC,{children:w.jsx(Vq,{sdk:n})})}):null};exports.C=EC;exports.C$1=GV;exports.M=my;exports.MastersStreamLayerProvider=nne;exports.MastersStreamLayerSDKReact=rne;exports.N=la;exports.O=ry;exports.S=RC;exports.S$1=WV;exports.StreamLayerLogin=one;exports.StreamLayerSDKPoints=sne;exports.T=dy;exports.b=CC;exports.cx_default=Su;exports.d=QV;exports.k=OC;exports.l=zV;exports.m=n2;exports.m$1=$V;exports.n=sy;exports.p=Bq;exports.styled_default=x;exports.useStore=Ut;exports.z=Sz;
|
package/lib/dist/es/masters.js
CHANGED
|
@@ -42402,7 +42402,7 @@ const sne = ({
|
|
|
42402
42402
|
L = !0;
|
|
42403
42403
|
};
|
|
42404
42404
|
const O = ine(n, o, l, {
|
|
42405
|
-
version: "1.9.
|
|
42405
|
+
version: "1.9.4",
|
|
42406
42406
|
onDeepLinkHandled: c,
|
|
42407
42407
|
videoPlayerController: p,
|
|
42408
42408
|
onContentActivate: f,
|
package/lib/es/advertisement.js
CHANGED
|
@@ -35,13 +35,17 @@ const qo = /* @__PURE__ */ n("div")({
|
|
|
35
35
|
var l, r;
|
|
36
36
|
if (!((l = o.additionalBanner) != null && l.imageUrl))
|
|
37
37
|
return null;
|
|
38
|
-
let c = (r = o.
|
|
38
|
+
let c = (r = o.additionalBanner) == null ? void 0 : r.url;
|
|
39
39
|
return c && c.indexOf("http") !== 0 && (c = `https://${c}`), /* @__PURE__ */ e(z, { direction: t, hiding: i, children: /* @__PURE__ */ e(Ko, { className: "BannerContainer", children: /* @__PURE__ */ e(
|
|
40
40
|
Jo,
|
|
41
41
|
{
|
|
42
|
+
as: c ? "a" : "span",
|
|
42
43
|
className: "BannerLink",
|
|
43
44
|
href: c,
|
|
44
|
-
style: {
|
|
45
|
+
style: {
|
|
46
|
+
backgroundImage: `url(${o.additionalBanner.imageUrl})`,
|
|
47
|
+
cursor: c ? "pointer" : "default"
|
|
48
|
+
},
|
|
45
49
|
"data-promo-id": s,
|
|
46
50
|
"data-promo-type": o.type,
|
|
47
51
|
"data-analytics": "banner",
|
|
@@ -17892,7 +17892,7 @@ const nE = ({
|
|
|
17892
17892
|
y = !0;
|
|
17893
17893
|
};
|
|
17894
17894
|
const T = Z_(e, n, a, {
|
|
17895
|
-
version: "1.9.
|
|
17895
|
+
version: "1.9.4",
|
|
17896
17896
|
onDeepLinkHandled: s,
|
|
17897
17897
|
videoPlayerController: o,
|
|
17898
17898
|
onContentActivate: r,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/react",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "StreamLayer, Inc (https://streamlayer.io)",
|
|
6
6
|
"maintainers": [
|
|
@@ -83,17 +83,17 @@
|
|
|
83
83
|
}
|
|
84
84
|
],
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@streamlayer/feature-gamification": "^1.11.
|
|
87
|
-
"@streamlayer/sdk-web": "^1.6.
|
|
88
|
-
"@streamlayer/sdk-web-analytics": "^1.4.
|
|
89
|
-
"@streamlayer/sdk-web-api": "^1.6.
|
|
90
|
-
"@streamlayer/sdk-web-core": "^1.8.
|
|
91
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
92
|
-
"@streamlayer/sdk-web-interfaces": "^1.3.
|
|
93
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
94
|
-
"@streamlayer/sdk-web-notifications": "^1.2.
|
|
95
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
96
|
-
"@streamlayer/sdk-web-types": "^1.8.
|
|
86
|
+
"@streamlayer/feature-gamification": "^1.11.1",
|
|
87
|
+
"@streamlayer/sdk-web": "^1.6.4",
|
|
88
|
+
"@streamlayer/sdk-web-analytics": "^1.4.12",
|
|
89
|
+
"@streamlayer/sdk-web-api": "^1.6.12",
|
|
90
|
+
"@streamlayer/sdk-web-core": "^1.8.1",
|
|
91
|
+
"@streamlayer/sdk-web-features": "^1.0.33",
|
|
92
|
+
"@streamlayer/sdk-web-interfaces": "^1.3.1",
|
|
93
|
+
"@streamlayer/sdk-web-logger": "^1.0.33",
|
|
94
|
+
"@streamlayer/sdk-web-notifications": "^1.2.12",
|
|
95
|
+
"@streamlayer/sdk-web-storage": "^1.0.33",
|
|
96
|
+
"@streamlayer/sdk-web-types": "^1.8.6"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@bufbuild/protobuf": "^1.10.0",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"size-limit": "^11.1.6",
|
|
150
150
|
"url-loader": "^4.1.1",
|
|
151
151
|
"vite-plugin-dts": "^4.2.3",
|
|
152
|
-
"@streamlayer/react-ui": "^1.13.
|
|
152
|
+
"@streamlayer/react-ui": "^1.13.4"
|
|
153
153
|
},
|
|
154
154
|
"scripts": {
|
|
155
155
|
"size-limit": "size-limit"
|