@streamlayer/react 1.21.2 → 1.21.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 +1 -1
- package/lib/cjs/index2.js +4 -4
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +15 -15
- package/lib/cjs/useStreamLayerApp2.js +17 -16
- package/lib/classic/cjs/advertisement.js +1 -1
- package/lib/classic/cjs/bet-pack.js +4 -4
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +10 -10
- package/lib/classic/cjs/useStreamLayerApp2.js +17 -16
- package/lib/classic/es/advertisement.js +2 -2
- package/lib/classic/es/bet-pack.js +6 -7
- package/lib/classic/es/insight.js +1 -1
- package/lib/classic/es/notification.js +29 -29
- package/lib/classic/es/points.js +1 -1
- package/lib/classic/es/provider.js +27 -29
- package/lib/classic/es/useStreamLayerApp2.js +4651 -2705
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +34 -33
- package/lib/dist/es/gamification-feature2.js +1 -1
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +9557 -7614
- package/lib/es/advertisement.js +2 -2
- package/lib/es/index2.js +6 -7
- package/lib/es/insight.js +1 -1
- package/lib/es/notification.js +29 -29
- package/lib/es/points.js +1 -1
- package/lib/es/provider.js +27 -29
- package/lib/es/useStreamLayerApp2.js +4651 -2705
- package/package.json +17 -17
package/lib/cjs/advertisement.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),_e=require("react");require("nanostores");const W=require("./provider.js");require("lodash.throttle");require("react-dom");require("react-countup");const ue=require("./useStreamLayerApp2.js"),Dd=require("./vast-client.min-B0NUra1B.js"),Qf=require("./index-l-eyvmpL.js"),Gn=require("uuid"),Jf=W.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),Zf="a1rlj479",em="s35f1di",tm="sj4471g",im="b12050d8",nm="b1d5ybek",sm=i=>i==="left"||i==="right"?em:im,rm=i=>i==="left"||i==="right"?tm:nm,am=i=>i==="left"?"avdxyl3":i==="right"?"a1bisd08":i==="top"?"a1u9y2aj":"a1qqaks",bo=({children:i,style:e,className:t,enabled:n=!0,hiding:s,direction:r="left",onAnimationEnd:a})=>z.jsx(Jf,{style:e,className:W.cx_default(t,Zf,am(r),n&&!s&&sm(r),n&&s&&rm(r)),onAnimationEnd:a,children:i}),om=W.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),lm=W.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),um=()=>om,dm=W.styled_default(um())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Od=({promotion:i,promotionId:e,hiding:t,isEventFired:n,fireEvent:s,direction:r="bottom"})=>{const a=(i==null?void 0:i.adUnit)===ue.AdUnit.STANDART,l=a?i.banner:i.additionalBanner;if(_e.useEffect(()=>{l!=null&&l.imageUrl&&i.type&&e&&(n!=null&&n("banner-showed")||(W.eventBus.emit("advertisement",{action:"bannerShown",payload:{id:e,type:i.type}}),s==null||s("banner-showed")))},[l==null?void 0:l.imageUrl,s,n,i.type,e]),!(l!=null&&l.imageUrl))return null;let c=l==null?void 0:l.url;return c&&c.indexOf("http")!==0&&(c=`https://${c}`),z.jsx(bo,{direction:r,hiding:t,children:z.jsx(lm,{className:"BannerContainer","data-is-ad":a,children:z.jsx(dm,{as:c?"a":"span",className:"BannerLink",href:c,style:{backgroundImage:`url(${l.imageUrl})`,cursor:c?"pointer":"default"},"data-promo-id":e,"data-promo-type":i.type,"data-a":"banner",target:"_blank","data-is-ad":a})})})},hm=({cardId:i,promotion:e,direction:t="bottom"})=>z.jsx(Od,{promotion:e,promotionId:i,direction:t,hiding:!1}),cm=W.styled_default("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:!1}),pm=W.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),gm=W.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),fm=W.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),To=W.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),mm=()=>To,ym=W.styled_default(mm())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),iu=W.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),_m=W.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),bm=W.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Tm=W.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),vm=W.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),Md=W.styled_default("button")({name:"TVButton",class:"tkkfuqy",propsAsIs:!1}),Sm=()=>Md,Em=W.styled_default(Sm())({name:"DismissButton",class:"dh9vato",propsAsIs:!0}),wm=()=>Md,Rd=W.styled_default(wm())({name:"OpenButton",class:"oeah8gv",propsAsIs:!0}),km={[ue.NotificationPromotionImagePosition.BOTTOM]:To,[ue.NotificationPromotionImagePosition.MIDDLE]:ym},Cm=({src:i,imagePosition:e})=>{const t=km[e]||To;return z.jsx(t,{children:z.jsx("img",{src:i,alt:""})})},Im=W.O(Em),xm=W.O(Rd),Am=({notification:i,open:e,close:t,webos:n})=>{if(!i||!i.promotion||i.enabled!==ue.NotificationEnabled.NOTIFICATION_ENABLED)return null;const{title:s,body:r,image:a,promotion:l}=i,{sponsorLogo:c,sponsorLogoMode:f,imagePosition:m,ctaButton:b}=l;return z.jsxs(vm,{"data-webos":n,className:"SL_Lower_Third_Notification",onClick:n?void 0:e,children:[z.jsxs(cm,{children:[z.jsx(Cm,{src:a,imagePosition:m}),z.jsxs(pm,{children:[s&&z.jsx(gm,{children:s}),r&&z.jsx(fm,{children:r})]})]}),z.jsxs(bm,{children:[f!==ue.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&z.jsxs(z.Fragment,{children:[z.jsx(_m,{children:z.jsx("img",{src:c,alt:s})}),z.jsx(Tm,{})]}),n?z.jsxs(z.Fragment,{children:[z.jsx(Im,{webos:!0,onClick:t,children:"Dismiss"}),z.jsxs(xm,{webos:!0,autoFocus:!0,style:{color:b==null?void 0:b.textColor,backgroundColor:b==null?void 0:b.color},onClick:e,children:[(b==null?void 0:b.ctaIcon)&&(b==null?void 0:b.ctaIconMode)===ue.CtaIconMode.CTA_ICON_TRANSPARENT&&z.jsx(iu,{src:b==null?void 0:b.ctaIcon,alt:"cta-icon"}),(b==null?void 0:b.label)||"Open"]})]}):z.jsxs(Rd,{name:"promo-button",style:{color:b==null?void 0:b.textColor,backgroundColor:b==null?void 0:b.color},children:[(b==null?void 0:b.ctaIcon)&&(b==null?void 0:b.ctaIconMode)===ue.CtaIconMode.CTA_ICON_TRANSPARENT&&z.jsx(iu,{src:b==null?void 0:b.ctaIcon,alt:"cta-icon"}),(b==null?void 0:b.label)||"Open"]})]})]})},Pm=W.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Lm=W.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),Dm=W.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),Om=W.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Mm=W.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),Lr=W.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),Rm=()=>Lr,nu=W.styled_default(Rm())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),Um=()=>Lr,Ud=W.styled_default(Um())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),Nm=()=>Ud,Bm=W.styled_default(Nm())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Fm=()=>Lr,jm=W.styled_default(Fm())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),$m=()=>Lr,qm=W.styled_default($m())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),Vm=W.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),Hm=()=>W.B1,zm=W.styled_default(Hm())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),Wm=W.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),Nd=W.styled_default("button")({name:"TVButton",class:"thdqfl0",propsAsIs:!1}),Gm=()=>Nd,Xm=W.styled_default(Gm())({name:"DismissButton",class:"d11pe8bx",propsAsIs:!0}),Km=()=>Nd,Ym=W.styled_default(Km())({name:"OpenButton",class:"oy9k0kp",propsAsIs:!0}),Qm={[ue.NotificationPromotionImagePosition.UNSET]:nu,[ue.NotificationPromotionImagePosition.FIT]:nu,[ue.NotificationPromotionImagePosition.CENTERED]:Ud,[ue.NotificationPromotionImagePosition.BOTTOM]:Bm,[ue.NotificationPromotionImagePosition.SOLID]:jm,[ue.NotificationPromotionImagePosition.MIDDLE]:qm},Jm=({src:i,imagePosition:e})=>{const t=Qm[e];return z.jsx(t,{children:z.jsx("img",{src:i,alt:""})})},Zm=W.O(Xm),ey=W.O(Ym),ty=({notification:i,open:e,promotionId:t,hiding:n,direction:s="left",close:r,webos:a})=>{if(!i||!i.promotion||i.enabled!==ue.NotificationEnabled.NOTIFICATION_ENABLED)return null;if(i.promotion.mode===ue.NotificationPromotionMode.LOWER_THIRD)return z.jsx(Am,{notification:i,open:e,close:r,webos:a});const{title:l,body:c,image:f,promotion:m}=i,{sponsorLogo:b,sponsorLogoMode:C,imagePosition:w,ctaButton:A}=m,v=M=>{M.stopPropagation(),r==null||r()};return z.jsx(bo,{className:"SL_Rich_Notification",direction:s,hiding:n,children:z.jsxs(Lm,{onClick:a?()=>{}:e,children:[C!==ue.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&b&&z.jsx(Wm,{children:z.jsx("img",{src:b,alt:l})}),z.jsxs(Pm,{children:[z.jsx(Jm,{src:f,imagePosition:w}),z.jsxs(Dm,{children:[l&&z.jsx(Om,{children:l}),c&&z.jsx(Mm,{children:c})]}),a&&z.jsx(Zm,{webos:!0,onClick:v,children:"Dismiss"}),z.jsxs(ey,{webos:a,autoFocus:a,onClick:a?e:()=>{},name:"promo-button",style:{color:A==null?void 0:A.textColor,backgroundColor:A==null?void 0:A.color},children:[(A==null?void 0:A.ctaIcon)&&(A==null?void 0:A.ctaIconMode)===ue.CtaIconMode.CTA_ICON_TRANSPARENT&&z.jsx(Vm,{src:A==null?void 0:A.ctaIcon,alt:"cta-icon"}),(A==null?void 0:A.label)||"Open"]}),z.jsx(zm,{name:"chevronRight"})]})]})})},iy=W.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),Bd=W.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),Fd=W.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),jd=W.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),$d="h10toh7",su=W.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),ny=W.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),qd=W.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),sy=W.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),ry="s1nmch9k",ru=W.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),ay=W.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),oy=W.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),ly=W.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),Vd=W.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),uy=W.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),Hd=W.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),zd=W.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),dy=W.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),hy="h17rwbtk",cy=W.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),au=W.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),py=W.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),gy=({time:i,adCount:e,adPosition:t})=>{const n=Math.floor(i/60),s=i-n*60;return n===0&&s===0&&e===t?null:z.jsxs(cy,{children:[e>1&&z.jsxs(z.Fragment,{children:[z.jsxs(au,{children:[t," of ",e]}),z.jsx(py,{})]}),z.jsxs(au,{children:[n,":",s<10?`0${s}`:s]})]})},fy=W.styled_default("a")({name:"WhyThisAdLink",class:"w13o8uld",propsAsIs:!1}),my=({whyThisAd:i})=>{const[e,t]=_e.useState(!1);return!i.iconClickThroughURLTemplate||!i.staticResource?null:z.jsxs(fy,{style:{width:i.width,height:i.height,[i.xPosition]:3,[i.yPosition]:11},href:i.iconClickThroughURLTemplate,target:"_blank",rel:"noreferrer",children:[!e&&z.jsx("img",{alt:"ad choice",src:i.staticResource,onLoad:()=>t(!1),onError:()=>t(!0)}),e&&z.jsx("span",{children:"ad choice"})]})},yy=W.styled_default("div")({name:"VideoControls",class:"v1xzooj9",propsAsIs:!1}),Wd=W.styled_default("button")({name:"ControlBtn",class:"c1bo41vr",propsAsIs:!1}),_y=()=>Wd,by=W.styled_default(_y())({name:"MuteIcon",class:"m13efyu8",propsAsIs:!0}),Ty=()=>Wd,vy=W.styled_default(Ty())({name:"PauseIcon",class:"pladkgh",propsAsIs:!0}),Sy=W.styled_default("div")({name:"Container",class:"cjnga56",propsAsIs:!1}),Ey=W.styled_default("div")({name:"ControlsContainer",class:"c7qs1am",propsAsIs:!1}),ou="m12n261r",lu="m16vcml8",uu="m1078nk6",du=globalThis||void 0||self;class wy{constructor(e){this.id=e.getAttribute("id"),this.allowMultipleAds=e.getAttribute("allowMultipleAds"),this.followRedirects=e.getAttribute("followRedirects"),this.vastAdData=null,this.adTagURI=null,this.customData=null;for(const t in e.childNodes){const n=e.childNodes[t];switch(n.localName){case"AdTagURI":this.adTagURI={templateType:n.getAttribute("templateType"),uri:(n.textContent||n.text||"").trim()};break;case"VASTAdData":for(this.vastAdData=n.firstChild;this.vastAdData&&this.vastAdData.nodeType!==1;)this.vastAdData=this.vastAdData.nextSibling;break;case"CustomAdData":this.customData=n;break}}}}function Gd(i,e){const t=[];for(const n in i.childNodes){const s=i.childNodes[n];(s.nodeName===e||e===`vmap:${s.nodeName}`||s.nodeName===`vmap:${e}`)&&t.push(s)}return t}function ky(i){if(!i||!i.childNodes)return{};const e=i.childNodes,t=[];for(const s in e){const r=e[s];r.nodeName==="#cdata-section"&&t.push(r)}if(t&&t.length>0)try{return JSON.parse(t[0].data)}catch{}let n="";for(const s in e){const r=e[s];switch(r.nodeName){case"#text":n+=r.textContent.trim();break;case"#cdata-section":n+=r.data;break}}return n}function vo(i){const e={attributes:{},children:{},value:{}};e.value=ky(i);const t=i.attributes;if(t)for(const s in t){const r=t[s];r.nodeName&&r.nodeValue!==void 0&&r.nodeValue!==null&&(e.attributes[r.nodeName]=r.nodeValue)}const n=i.childNodes;if(n)for(const s in n){const r=n[s];r.nodeName&&r.nodeName.substring(0,1)!=="#"&&(e.children[r.nodeName]=vo(r))}return e}class Cy{constructor(e){this.timeOffset=e.getAttribute("timeOffset"),this.breakType=e.getAttribute("breakType"),this.breakId=e.getAttribute("breakId"),this.repeatAfter=e.getAttribute("repeatAfter"),this.adSource=null,this.trackingEvents=[],this.extensions=[];for(const t in e.childNodes){const n=e.childNodes[t];switch(n.localName){case"AdSource":this.adSource=new wy(n);break;case"TrackingEvents":for(const s in n.childNodes){const r=n.childNodes[s];r.localName==="Tracking"&&this.trackingEvents.push({event:r.getAttribute("event"),uri:(r.textContent||r.text||"").trim()})}break;case"Extensions":this.extensions=Gd(n,"Extension").map(s=>vo(s));break}}}track(e,t){for(const n in this.trackingEvents){const s=this.trackingEvents[n];if(s.event===e){let{uri:r}=s;s.event==="error"&&(r=r.replace("[ERRORCODE]",t)),this.tracker(r)}}}tracker(e){if(typeof window<"u"&&window!==null){const t=new Image;t.src=e}}}class Iy{constructor(e){if(!e||!e.documentElement||e.documentElement.localName!=="VMAP")throw new Error("Not a VMAP document");this.version=e.documentElement.getAttribute("version"),this.adBreaks=[],this.extensions=[];for(const t in e.documentElement.childNodes){const n=e.documentElement.childNodes[t];switch(n.localName){case"AdBreak":this.adBreaks.push(new Cy(n));break;case"Extensions":this.extensions=Gd(n,"Extension").map(s=>vo(s));break}}}}const xy=(i,e)=>{const t=goog.pal,n=new t.ConsentSettings;n.allowStorage=!1;const s=new t.NonceLoader(n);return async()=>{try{const r=new URL(e),a=new t.NonceRequest;let l=localStorage.getItem("sl-device-id")||Gn.v4(),c=sessionStorage.getItem("sl-ad-session-id");c||(c=Gn.v4(),sessionStorage.setItem("sl-ad-session-id",c)),Gn.validate(l)||(l=Gn.v5(`https://${l}`,Gn.v5.URL)),r.searchParams.get("url")||r.searchParams.set("url","https://streamlayer.io"),r.searchParams.get("description_url")||r.searchParams.set("description_url","https://streamlayer.io"),a.adWillAutoPlay=r.searchParams.get("vpa")==="auto",a.adWillPlayMuted=r.searchParams.get("vpmute")==="1",a.continuousPlayback=!0,a.descriptionUrl=r.searchParams.get("description_url"),a.iconsSupported=!0,a.sessionId=l,a.supportedApiFrameworks="2,7,9",a.videoHeight=i.clientHeight,a.videoWidth=i.clientWidth;const f=await s.loadNonceManager(a);return r.searchParams.get("is_lat")==="[placeholder]"&&r.searchParams.set("is_lat","1"),r.searchParams.get("rdid")==="[placeholder]"&&r.searchParams.set("rdid",l),r.searchParams.get("correlator")==="[placeholder]"&&r.searchParams.set("correlator",c),r.searchParams.set("wta","1"),r.searchParams.set("givn",f.getNonce()),{url:r,manager:f}}catch(r){console.log("AdsManager could not be started",r);return}}},Ay=new Dd.ce,Py=i=>i.creatives.find(e=>e.mediaFiles),Ly=i=>{var e;const t=i==null?void 0:i.mediaFiles;return t!=null&&t.length&&((e=t.find(n=>n.fileURL))==null?void 0:e.fileURL)||""},Xn=W.a({ads:[],autoplay:!0,muted:!1,nonceManager:void 0}),Dy=(i,e)=>{const[t,n]=_e.useState(),s=_e.useRef(Date.now()),r=_e.useRef(Date.now());return _e.useEffect(()=>{if(!e||!(i!=null&&i.current))return;const a=xy(i.current,e),l=Date.now();s.current=l,Xn.set({ads:[],autoplay:!0,muted:!1,nonceManager:void 0}),a().then(c=>{s.current===l&&c&&(n(c.url),Xn.set({ads:[],autoplay:!0,muted:!1,nonceManager:c.manager}))}).catch(c=>{console.error(c)})},[i,e]),_e.useEffect(()=>{const a=async(l,c)=>{let f=[];if(l.searchParams.get("output")==="vmap"){const w=await fetch(l.toString()),A=new DOMParser,v=await w.text(),M=A.parseFromString(v,"text/xml");f=new Iy(M).adBreaks.map(D=>D.adSource.adTagURI.uri)}else f=[l.toString()];const m=await Promise.all(f.map((w,A)=>Ay.get(w).then(v=>{if(r.current===c){const M=v.ads.find(N=>N.creatives.length>0);if(!M)return;const D=Py(M),R=Ly(D);return{creative:D,order:A,mediaFileUrl:R,ad:M,raw:v}}}))),b=l.searchParams.get("vpa")!=="click",C=l.searchParams.get("vpmute")==="1";Xn.set({...Xn.get(),ads:m.filter(w=>!!w),autoplay:b,muted:C})};if(t){const l=Date.now();r.current=l,a(t,l)}return()=>{r.current=0}},[t]),Xn},ar=globalThis||void 0||self;var or=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof du<"u"?du:typeof self<"u"?self:{};function ms(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Oy(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Zn;typeof window<"u"?Zn=window:typeof or<"u"?Zn=or:typeof self<"u"?Zn=self:Zn={};var Dr=Zn;const x=ms(Dr),My={},Ry=Object.freeze(Object.defineProperty({__proto__:null,default:My},Symbol.toStringTag,{value:"Module"})),Uy=Oy(Ry);var hu=typeof or<"u"?or:typeof window<"u"?window:{},Ny=Uy,es;typeof document<"u"?es=document:(es=hu["__GLOBAL_DOCUMENT_CACHE@4"],es||(es=hu["__GLOBAL_DOCUMENT_CACHE@4"]=Ny));var Xd=es;const G=ms(Xd);var So={exports:{}},Kd={exports:{}};(function(i){function e(){return i.exports=e=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var r in s)({}).hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},i.exports.__esModule=!0,i.exports.default=i.exports,e.apply(null,arguments)}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports})(Kd);var By=Kd.exports,Fy=$y,jy=Object.prototype.toString;function $y(i){if(!i)return!1;var e=jy.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}function qy(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=Vy(i))||e){t&&(i=t);var n=0;return function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),_e=require("react"),W=require("./provider.js");require("nanostores");require("lodash.throttle");require("react-dom");require("react-countup");const ue=require("./useStreamLayerApp2.js"),Dd=require("./vast-client.min-B0NUra1B.js"),Qf=require("./index-l-eyvmpL.js"),Gn=require("uuid"),Jf=W.styled_default("div")({name:"Container",class:"c5b6wdg",propsAsIs:!1}),Zf="a1rlj479",em="s35f1di",tm="sj4471g",im="b12050d8",nm="b1d5ybek",sm=i=>i==="left"||i==="right"?em:im,rm=i=>i==="left"||i==="right"?tm:nm,am=i=>i==="left"?"avdxyl3":i==="right"?"a1bisd08":i==="top"?"a1u9y2aj":"a1qqaks",bo=({children:i,style:e,className:t,enabled:n=!0,hiding:s,direction:r="left",onAnimationEnd:a})=>z.jsx(Jf,{style:e,className:W.cx_default(t,Zf,am(r),n&&!s&&sm(r),n&&s&&rm(r)),onAnimationEnd:a,children:i}),om=W.styled_default("a")({name:"Link",class:"l1sgte8c",propsAsIs:!1}),lm=W.styled_default("div")({name:"BannerContainer",class:"b7yfc72",propsAsIs:!1}),um=()=>om,dm=W.styled_default(um())({name:"BannerLink",class:"bejjq94",propsAsIs:!0}),Od=({promotion:i,promotionId:e,hiding:t,isEventFired:n,fireEvent:s,direction:r="bottom"})=>{const a=(i==null?void 0:i.adUnit)===ue.AdUnit.STANDART,l=a?i.banner:i.additionalBanner;if(_e.useEffect(()=>{l!=null&&l.imageUrl&&i.type&&e&&(n!=null&&n("banner-showed")||(W.eventBus.emit("advertisement",{action:"bannerShown",payload:{id:e,type:i.type}}),s==null||s("banner-showed")))},[l==null?void 0:l.imageUrl,s,n,i.type,e]),!(l!=null&&l.imageUrl))return null;let c=l==null?void 0:l.url;return c&&c.indexOf("http")!==0&&(c=`https://${c}`),z.jsx(bo,{direction:r,hiding:t,children:z.jsx(lm,{className:"BannerContainer","data-is-ad":a,children:z.jsx(dm,{as:c?"a":"span",className:"BannerLink",href:c,style:{backgroundImage:`url(${l.imageUrl})`,cursor:c?"pointer":"default"},"data-promo-id":e,"data-promo-type":i.type,"data-a":"banner",target:"_blank","data-is-ad":a})})})},hm=({cardId:i,promotion:e,direction:t="bottom"})=>z.jsx(Od,{promotion:e,promotionId:i,direction:t,hiding:!1}),cm=W.styled_default("div")({name:"NotificationContent",class:"n18wsqoo",propsAsIs:!1}),pm=W.styled_default("div")({name:"Body",class:"b1ia90c2",propsAsIs:!1}),gm=W.styled_default("div")({name:"Title",class:"tg2z08v",propsAsIs:!1}),fm=W.styled_default("div")({name:"Text",class:"t59zdk1",propsAsIs:!1}),To=W.styled_default("div")({name:"MediaImgBottom",class:"m1ab9fq",propsAsIs:!1}),mm=()=>To,ym=W.styled_default(mm())({name:"MediaImgMiddle",class:"m9fsr0y",propsAsIs:!0}),iu=W.styled_default("img")({name:"CtaIcon",class:"cvi9y5q",propsAsIs:!1}),_m=W.styled_default("div")({name:"Logo",class:"l5mq0z",propsAsIs:!1}),bm=W.styled_default("div")({name:"Footer",class:"f1mse0ft",propsAsIs:!1}),Tm=W.styled_default("div")({name:"Vector",class:"v1hcloah",propsAsIs:!1}),vm=W.styled_default("div")({name:"NotificationContainer",class:"n3n65jf",propsAsIs:!1}),Md=W.styled_default("button")({name:"TVButton",class:"tkkfuqy",propsAsIs:!1}),Sm=()=>Md,Em=W.styled_default(Sm())({name:"DismissButton",class:"dh9vato",propsAsIs:!0}),wm=()=>Md,Rd=W.styled_default(wm())({name:"OpenButton",class:"oeah8gv",propsAsIs:!0}),km={[ue.NotificationPromotionImagePosition.BOTTOM]:To,[ue.NotificationPromotionImagePosition.MIDDLE]:ym},Cm=({src:i,imagePosition:e})=>{const t=km[e]||To;return z.jsx(t,{children:z.jsx("img",{src:i,alt:""})})},Im=W.O(Em),xm=W.O(Rd),Am=({notification:i,open:e,close:t,webos:n})=>{if(!i||!i.promotion||i.enabled!==ue.NotificationEnabled.NOTIFICATION_ENABLED)return null;const{title:s,body:r,image:a,promotion:l}=i,{sponsorLogo:c,sponsorLogoMode:f,imagePosition:m,ctaButton:b}=l;return z.jsxs(vm,{"data-webos":n,className:"SL_Lower_Third_Notification",onClick:n?void 0:e,children:[z.jsxs(cm,{children:[z.jsx(Cm,{src:a,imagePosition:m}),z.jsxs(pm,{children:[s&&z.jsx(gm,{children:s}),r&&z.jsx(fm,{children:r})]})]}),z.jsxs(bm,{children:[f!==ue.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&z.jsxs(z.Fragment,{children:[z.jsx(_m,{children:z.jsx("img",{src:c,alt:s})}),z.jsx(Tm,{})]}),n?z.jsxs(z.Fragment,{children:[z.jsx(Im,{webos:!0,onClick:t,children:"Dismiss"}),z.jsxs(xm,{webos:!0,autoFocus:!0,style:{color:b==null?void 0:b.textColor,backgroundColor:b==null?void 0:b.color},onClick:e,children:[(b==null?void 0:b.ctaIcon)&&(b==null?void 0:b.ctaIconMode)===ue.CtaIconMode.CTA_ICON_TRANSPARENT&&z.jsx(iu,{src:b==null?void 0:b.ctaIcon,alt:"cta-icon"}),(b==null?void 0:b.label)||"Open"]})]}):z.jsxs(Rd,{name:"promo-button",style:{color:b==null?void 0:b.textColor,backgroundColor:b==null?void 0:b.color},children:[(b==null?void 0:b.ctaIcon)&&(b==null?void 0:b.ctaIconMode)===ue.CtaIconMode.CTA_ICON_TRANSPARENT&&z.jsx(iu,{src:b==null?void 0:b.ctaIcon,alt:"cta-icon"}),(b==null?void 0:b.label)||"Open"]})]})]})},Pm=W.styled_default("div")({name:"NotificationContent",class:"n1ku6hz",propsAsIs:!1}),Lm=W.styled_default("div")({name:"NotificationContainer",class:"nbxqmol",propsAsIs:!1}),Dm=W.styled_default("div")({name:"Body",class:"b1gu3eml",propsAsIs:!1}),Om=W.styled_default("div")({name:"Title",class:"t1u17zva",propsAsIs:!1}),Mm=W.styled_default("div")({name:"Text",class:"t10ko1g",propsAsIs:!1}),Lr=W.styled_default("div")({name:"Media",class:"mntc42e",propsAsIs:!1}),Rm=()=>Lr,nu=W.styled_default(Rm())({name:"MediaImgFit",class:"ml060eo",propsAsIs:!0}),Um=()=>Lr,Ud=W.styled_default(Um())({name:"MediaImgCentered",class:"m1vqlvig",propsAsIs:!0}),Nm=()=>Ud,Bm=W.styled_default(Nm())({name:"MediaImgBottom",class:"m1e7tvi5",propsAsIs:!0}),Fm=()=>Lr,jm=W.styled_default(Fm())({name:"MediaImgSolid",class:"mqvntt2",propsAsIs:!0}),$m=()=>Lr,qm=W.styled_default($m())({name:"MediaImgMiddle",class:"m12jtj3u",propsAsIs:!0}),Vm=W.styled_default("img")({name:"CtaIcon",class:"ckq1frv",propsAsIs:!1}),Hm=()=>W.B1,zm=W.styled_default(Hm())({name:"StyledChevronRight",class:"s9mjmz3",propsAsIs:!0}),Wm=W.styled_default("div")({name:"Logo",class:"l1cf50a7",propsAsIs:!1}),Nd=W.styled_default("button")({name:"TVButton",class:"thdqfl0",propsAsIs:!1}),Gm=()=>Nd,Xm=W.styled_default(Gm())({name:"DismissButton",class:"d11pe8bx",propsAsIs:!0}),Km=()=>Nd,Ym=W.styled_default(Km())({name:"OpenButton",class:"oy9k0kp",propsAsIs:!0}),Qm={[ue.NotificationPromotionImagePosition.UNSET]:nu,[ue.NotificationPromotionImagePosition.FIT]:nu,[ue.NotificationPromotionImagePosition.CENTERED]:Ud,[ue.NotificationPromotionImagePosition.BOTTOM]:Bm,[ue.NotificationPromotionImagePosition.SOLID]:jm,[ue.NotificationPromotionImagePosition.MIDDLE]:qm},Jm=({src:i,imagePosition:e})=>{const t=Qm[e];return z.jsx(t,{children:z.jsx("img",{src:i,alt:""})})},Zm=W.O(Xm),ey=W.O(Ym),ty=({notification:i,open:e,promotionId:t,hiding:n,direction:s="left",close:r,webos:a})=>{if(!i||!i.promotion||i.enabled!==ue.NotificationEnabled.NOTIFICATION_ENABLED)return null;if(i.promotion.mode===ue.NotificationPromotionMode.LOWER_THIRD)return z.jsx(Am,{notification:i,open:e,close:r,webos:a});const{title:l,body:c,image:f,promotion:m}=i,{sponsorLogo:b,sponsorLogoMode:C,imagePosition:w,ctaButton:A}=m,v=M=>{M.stopPropagation(),r==null||r()};return z.jsx(bo,{className:"SL_Rich_Notification",direction:s,hiding:n,children:z.jsxs(Lm,{onClick:a?()=>{}:e,children:[C!==ue.NotificationSponsorLogoMode.NOTIFICATION_SPONSOR_LOGO_NONE&&b&&z.jsx(Wm,{children:z.jsx("img",{src:b,alt:l})}),z.jsxs(Pm,{children:[z.jsx(Jm,{src:f,imagePosition:w}),z.jsxs(Dm,{children:[l&&z.jsx(Om,{children:l}),c&&z.jsx(Mm,{children:c})]}),a&&z.jsx(Zm,{webos:!0,onClick:v,children:"Dismiss"}),z.jsxs(ey,{webos:a,autoFocus:a,onClick:a?e:()=>{},name:"promo-button",style:{color:A==null?void 0:A.textColor,backgroundColor:A==null?void 0:A.color},children:[(A==null?void 0:A.ctaIcon)&&(A==null?void 0:A.ctaIconMode)===ue.CtaIconMode.CTA_ICON_TRANSPARENT&&z.jsx(Vm,{src:A==null?void 0:A.ctaIcon,alt:"cta-icon"}),(A==null?void 0:A.label)||"Open"]}),z.jsx(zm,{name:"chevronRight"})]})]})})},iy=W.styled_default("div")({name:"OverlayContainer",class:"okzhq2w",propsAsIs:!1}),Bd=W.styled_default("div")({name:"PromoOverlay",class:"pmgz5i",propsAsIs:!1}),Fd=W.styled_default("div")({name:"Header",class:"hyxi3jt",propsAsIs:!1}),jd=W.styled_default("div")({name:"HeaderContent",class:"h149e3gp",propsAsIs:!1}),$d="h10toh7",su=W.styled_default("img")({name:"SponsorLogo",class:"s1jyea6t",propsAsIs:!1}),ny=W.styled_default("div")({name:"SponsorName",class:"szpfa3h",propsAsIs:!1}),qd=W.styled_default("div")({name:"Media",class:"m1crmu01",propsAsIs:!1}),sy=W.styled_default("img")({name:"PromoImg",class:"p1l37r8s",propsAsIs:!1}),ry="s1nmch9k",ru=W.styled_default("div")({name:"Content",class:"c1er0ljd",propsAsIs:!1}),ay=W.styled_default("div")({name:"Description",class:"dydopmr",propsAsIs:!1}),oy=W.styled_default("div")({name:"Sponsor",class:"s1w6nt04",propsAsIs:!1}),ly=W.styled_default("div")({name:"SponsorText",class:"s1evcmtq",propsAsIs:!1}),Vd=W.styled_default("div")({name:"ADLogo",class:"awodx0x",propsAsIs:!1}),uy=W.styled_default("span")({name:"SponsoredText",class:"s1q3n6oi",propsAsIs:!1}),Hd=W.styled_default("div")({name:"ActionBtnWrap",class:"a8d4xfk",propsAsIs:!1}),zd=W.styled_default("a")({name:"ActionButton",class:"at6oobh",propsAsIs:!1}),dy=W.styled_default("div")({name:"Title",class:"t1gyg7tt",propsAsIs:!1}),hy="h17rwbtk",cy=W.styled_default("div")({name:"Container",class:"c10m2bce",propsAsIs:!1}),au=W.styled_default("div")({name:"Item",class:"ig23yq5",propsAsIs:!1}),py=W.styled_default("div")({name:"Dot",class:"d1f6aqua",propsAsIs:!1}),gy=({time:i,adCount:e,adPosition:t})=>{const n=Math.floor(i/60),s=i-n*60;return n===0&&s===0&&e===t?null:z.jsxs(cy,{children:[e>1&&z.jsxs(z.Fragment,{children:[z.jsxs(au,{children:[t," of ",e]}),z.jsx(py,{})]}),z.jsxs(au,{children:[n,":",s<10?`0${s}`:s]})]})},fy=W.styled_default("a")({name:"WhyThisAdLink",class:"w13o8uld",propsAsIs:!1}),my=({whyThisAd:i})=>{const[e,t]=_e.useState(!1);return!i.iconClickThroughURLTemplate||!i.staticResource?null:z.jsxs(fy,{style:{width:i.width,height:i.height,[i.xPosition]:3,[i.yPosition]:11},href:i.iconClickThroughURLTemplate,target:"_blank",rel:"noreferrer",children:[!e&&z.jsx("img",{alt:"ad choice",src:i.staticResource,onLoad:()=>t(!1),onError:()=>t(!0)}),e&&z.jsx("span",{children:"ad choice"})]})},yy=W.styled_default("div")({name:"VideoControls",class:"v1xzooj9",propsAsIs:!1}),Wd=W.styled_default("button")({name:"ControlBtn",class:"c1bo41vr",propsAsIs:!1}),_y=()=>Wd,by=W.styled_default(_y())({name:"MuteIcon",class:"m13efyu8",propsAsIs:!0}),Ty=()=>Wd,vy=W.styled_default(Ty())({name:"PauseIcon",class:"pladkgh",propsAsIs:!0}),Sy=W.styled_default("div")({name:"Container",class:"cjnga56",propsAsIs:!1}),Ey=W.styled_default("div")({name:"ControlsContainer",class:"c7qs1am",propsAsIs:!1}),ou="m12n261r",lu="m16vcml8",uu="m1078nk6",du=globalThis||void 0||self;class wy{constructor(e){this.id=e.getAttribute("id"),this.allowMultipleAds=e.getAttribute("allowMultipleAds"),this.followRedirects=e.getAttribute("followRedirects"),this.vastAdData=null,this.adTagURI=null,this.customData=null;for(const t in e.childNodes){const n=e.childNodes[t];switch(n.localName){case"AdTagURI":this.adTagURI={templateType:n.getAttribute("templateType"),uri:(n.textContent||n.text||"").trim()};break;case"VASTAdData":for(this.vastAdData=n.firstChild;this.vastAdData&&this.vastAdData.nodeType!==1;)this.vastAdData=this.vastAdData.nextSibling;break;case"CustomAdData":this.customData=n;break}}}}function Gd(i,e){const t=[];for(const n in i.childNodes){const s=i.childNodes[n];(s.nodeName===e||e===`vmap:${s.nodeName}`||s.nodeName===`vmap:${e}`)&&t.push(s)}return t}function ky(i){if(!i||!i.childNodes)return{};const e=i.childNodes,t=[];for(const s in e){const r=e[s];r.nodeName==="#cdata-section"&&t.push(r)}if(t&&t.length>0)try{return JSON.parse(t[0].data)}catch{}let n="";for(const s in e){const r=e[s];switch(r.nodeName){case"#text":n+=r.textContent.trim();break;case"#cdata-section":n+=r.data;break}}return n}function vo(i){const e={attributes:{},children:{},value:{}};e.value=ky(i);const t=i.attributes;if(t)for(const s in t){const r=t[s];r.nodeName&&r.nodeValue!==void 0&&r.nodeValue!==null&&(e.attributes[r.nodeName]=r.nodeValue)}const n=i.childNodes;if(n)for(const s in n){const r=n[s];r.nodeName&&r.nodeName.substring(0,1)!=="#"&&(e.children[r.nodeName]=vo(r))}return e}class Cy{constructor(e){this.timeOffset=e.getAttribute("timeOffset"),this.breakType=e.getAttribute("breakType"),this.breakId=e.getAttribute("breakId"),this.repeatAfter=e.getAttribute("repeatAfter"),this.adSource=null,this.trackingEvents=[],this.extensions=[];for(const t in e.childNodes){const n=e.childNodes[t];switch(n.localName){case"AdSource":this.adSource=new wy(n);break;case"TrackingEvents":for(const s in n.childNodes){const r=n.childNodes[s];r.localName==="Tracking"&&this.trackingEvents.push({event:r.getAttribute("event"),uri:(r.textContent||r.text||"").trim()})}break;case"Extensions":this.extensions=Gd(n,"Extension").map(s=>vo(s));break}}}track(e,t){for(const n in this.trackingEvents){const s=this.trackingEvents[n];if(s.event===e){let{uri:r}=s;s.event==="error"&&(r=r.replace("[ERRORCODE]",t)),this.tracker(r)}}}tracker(e){if(typeof window<"u"&&window!==null){const t=new Image;t.src=e}}}class Iy{constructor(e){if(!e||!e.documentElement||e.documentElement.localName!=="VMAP")throw new Error("Not a VMAP document");this.version=e.documentElement.getAttribute("version"),this.adBreaks=[],this.extensions=[];for(const t in e.documentElement.childNodes){const n=e.documentElement.childNodes[t];switch(n.localName){case"AdBreak":this.adBreaks.push(new Cy(n));break;case"Extensions":this.extensions=Gd(n,"Extension").map(s=>vo(s));break}}}}const xy=(i,e)=>{const t=goog.pal,n=new t.ConsentSettings;n.allowStorage=!1;const s=new t.NonceLoader(n);return async()=>{try{const r=new URL(e),a=new t.NonceRequest;let l=localStorage.getItem("sl-device-id")||Gn.v4(),c=sessionStorage.getItem("sl-ad-session-id");c||(c=Gn.v4(),sessionStorage.setItem("sl-ad-session-id",c)),Gn.validate(l)||(l=Gn.v5(`https://${l}`,Gn.v5.URL)),r.searchParams.get("url")||r.searchParams.set("url","https://streamlayer.io"),r.searchParams.get("description_url")||r.searchParams.set("description_url","https://streamlayer.io"),a.adWillAutoPlay=r.searchParams.get("vpa")==="auto",a.adWillPlayMuted=r.searchParams.get("vpmute")==="1",a.continuousPlayback=!0,a.descriptionUrl=r.searchParams.get("description_url"),a.iconsSupported=!0,a.sessionId=l,a.supportedApiFrameworks="2,7,9",a.videoHeight=i.clientHeight,a.videoWidth=i.clientWidth;const f=await s.loadNonceManager(a);return r.searchParams.get("is_lat")==="[placeholder]"&&r.searchParams.set("is_lat","1"),r.searchParams.get("rdid")==="[placeholder]"&&r.searchParams.set("rdid",l),r.searchParams.get("correlator")==="[placeholder]"&&r.searchParams.set("correlator",c),r.searchParams.set("wta","1"),r.searchParams.set("givn",f.getNonce()),{url:r,manager:f}}catch(r){console.log("AdsManager could not be started",r);return}}},Ay=new Dd.ce,Py=i=>i.creatives.find(e=>e.mediaFiles),Ly=i=>{var e;const t=i==null?void 0:i.mediaFiles;return t!=null&&t.length&&((e=t.find(n=>n.fileURL))==null?void 0:e.fileURL)||""},Xn=W.a({ads:[],autoplay:!0,muted:!1,nonceManager:void 0}),Dy=(i,e)=>{const[t,n]=_e.useState(),s=_e.useRef(Date.now()),r=_e.useRef(Date.now());return _e.useEffect(()=>{if(!e||!(i!=null&&i.current))return;const a=xy(i.current,e),l=Date.now();s.current=l,Xn.set({ads:[],autoplay:!0,muted:!1,nonceManager:void 0}),a().then(c=>{s.current===l&&c&&(n(c.url),Xn.set({ads:[],autoplay:!0,muted:!1,nonceManager:c.manager}))}).catch(c=>{console.error(c)})},[i,e]),_e.useEffect(()=>{const a=async(l,c)=>{let f=[];if(l.searchParams.get("output")==="vmap"){const w=await fetch(l.toString()),A=new DOMParser,v=await w.text(),M=A.parseFromString(v,"text/xml");f=new Iy(M).adBreaks.map(D=>D.adSource.adTagURI.uri)}else f=[l.toString()];const m=await Promise.all(f.map((w,A)=>Ay.get(w).then(v=>{if(r.current===c){const M=v.ads.find(N=>N.creatives.length>0);if(!M)return;const D=Py(M),R=Ly(D);return{creative:D,order:A,mediaFileUrl:R,ad:M,raw:v}}}))),b=l.searchParams.get("vpa")!=="click",C=l.searchParams.get("vpmute")==="1";Xn.set({...Xn.get(),ads:m.filter(w=>!!w),autoplay:b,muted:C})};if(t){const l=Date.now();r.current=l,a(t,l)}return()=>{r.current=0}},[t]),Xn},ar=globalThis||void 0||self;var or=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof du<"u"?du:typeof self<"u"?self:{};function ms(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Oy(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var Zn;typeof window<"u"?Zn=window:typeof or<"u"?Zn=or:typeof self<"u"?Zn=self:Zn={};var Dr=Zn;const x=ms(Dr),My={},Ry=Object.freeze(Object.defineProperty({__proto__:null,default:My},Symbol.toStringTag,{value:"Module"})),Uy=Oy(Ry);var hu=typeof or<"u"?or:typeof window<"u"?window:{},Ny=Uy,es;typeof document<"u"?es=document:(es=hu["__GLOBAL_DOCUMENT_CACHE@4"],es||(es=hu["__GLOBAL_DOCUMENT_CACHE@4"]=Ny));var Xd=es;const G=ms(Xd);var So={exports:{}},Kd={exports:{}};(function(i){function e(){return i.exports=e=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var r in s)({}).hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},i.exports.__esModule=!0,i.exports.default=i.exports,e.apply(null,arguments)}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports})(Kd);var By=Kd.exports,Fy=$y,jy=Object.prototype.toString;function $y(i){if(!i)return!1;var e=jy.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}function qy(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=Vy(i))||e){t&&(i=t);var n=0;return function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vy(i,e){if(i){if(typeof i=="string")return cu(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return cu(i,e)}}function cu(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=i[t];return n}var Hy=function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(t,n){this.typeToInterceptorsMap_.has(t)||this.typeToInterceptorsMap_.set(t,new Set);var s=this.typeToInterceptorsMap_.get(t);return s.has(n)?!1:(s.add(n),!0)},e.removeInterceptor=function(t,n){var s=this.typeToInterceptorsMap_.get(t);return s&&s.has(n)?(s.delete(n),!0):!1},e.clearInterceptorsByType=function(t){var n=this.typeToInterceptorsMap_.get(t);return n?(this.typeToInterceptorsMap_.delete(t),this.typeToInterceptorsMap_.set(t,new Set),!0):!1},e.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},e.getForType=function(t){return this.typeToInterceptorsMap_.get(t)||new Set},e.execute=function(t,n){for(var s=this.getForType(t),r=qy(s),a;!(a=r()).done;){var l=a.value;try{n=l(n)}catch{}}return n},i}(),zy=Hy,Wy=function(){function i(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(t){this.maxAttempts_=t},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(t){this.delayFactor_=t},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(t){this.fuzzFactor_=t},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(t){this.initialDelay_=t},e.createRetry=function(t){var n=t===void 0?{}:t,s=n.maxAttempts,r=n.delayFactor,a=n.fuzzFactor,l=n.initialDelay;return new Gy({maxAttempts:s||this.maxAttempts_,delayFactor:r||this.delayFactor_,fuzzFactor:a||this.fuzzFactor_,initialDelay:l||this.initialDelay_})},i}(),Gy=function(){function i(t){this.maxAttempts_=t.maxAttempts,this.delayFactor_=t.delayFactor,this.fuzzFactor_=t.fuzzFactor,this.currentDelay_=t.initialDelay,this.currentAttempt_=1}var e=i.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var t=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+t},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var t=this.getCurrentMinPossibleDelay(),n=this.getCurrentMaxPossibleDelay();return t+Math.random()*(n-t)},i}(),Xy=Wy,Ky=Dr,Yy=function(i,e){return e===void 0&&(e=!1),function(t,n,s){if(t){i(t);return}if(n.statusCode>=400&&n.statusCode<=599){var r=s;if(e)if(Ky.TextDecoder){var a=Qy(n.headers&&n.headers["content-type"]);try{r=new TextDecoder(a).decode(s)}catch{}}else r=String.fromCharCode.apply(null,new Uint8Array(s));i({cause:r});return}i(null,s)}};function Qy(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var n=t.split("="),s=n[0],r=n[1];return s.trim()==="charset"?r.trim():e},"utf-8")}var Jy=Yy,Yd=Dr,Zy=By,e_=Fy,Qd=zy,t_=Xy;Fe.httpHandler=Jy;Fe.requestInterceptorsStorage=new Qd;Fe.responseInterceptorsStorage=new Qd;Fe.retryManager=new t_;/**
|
|
3
3
|
* @license
|
|
4
4
|
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|