1(()=>{"use strict";const e=window.wp.htmlEntities;class t{constructor(e,t={},i=[]){this.initialState=e,this.possibleStates=t,this.stateArgs=i,this.state=null;for(const e of Object.values(this.possibleStates))e.stateMachine=this}step(){null===this.state&&(this.state=this.initialState,this.possibleStates[this.state].enter(...this.stateArgs)),this.possibleStates[this.state].execute(...this.stateArgs)}transition(e,...t){this.state=e,this.possibleStates[this.state].enter(...this.stateArgs,...t)}}class i{enter(){}execute(){}}const n=[".footer-share-bar .fsb-desktop",".mobile-anchor"],s=["#IL_INSEARCH"],r=["#wpadminbar","#header","#onetrust-consent-sdk",".onetrust-pc-dark-filter",".wallpaper-ad"].join(","),o=new Set(["SCRIPT","STYLE","LINK","NOSCRIPT","TEMPLATE","META"]),a=e=>e instanceof HTMLElement&&o.has(e.tagName),h=e=>{for(const t of e)if(!a(t))return!0;return!1},c=e=>Math.max(280,.75*e),d=()=>{const e=window.innerHeight,t=window.visualViewport;return{bottom:e,visibleHeight:t?t.height*(t.scale||1):e}};class l extends t{constructor(e,t={},i=[],s={}){if(super(e,t,i),!("playerWrap"in s&&s.playerWrap instanceof HTMLElement&&"player"in s&&s.player instanceof HTMLElement&&"sizeHelper"in s&&s.sizeHelper instanceof HTMLElement))throw new Error("The markup is not correct!");this.$playerwrap=s.playerWrap,this.$player=s.player,this.$helper=s.sizeHelper,this.initialPlayerHeight=this.getHeight(this.$player),this.initialPlayerWidth=this.getWidth(this.$player),this.playerRatio=this.initialPlayerHeight/this.initialPlayerWidth,this.anchorAdObserver=null,this.anchorAdMutationObserver=null,this.anchorVisibilityObserver=null,this.gptListeners=[],this.anchorTrackingTornDown=!1,this.anchorSettleTimer=null,this.anchorSettleUntil=0,this.anchorSettleEndsBy=0,this.anchorSettleCooldownUntil=0,this.anchorRefreshHoldStartedAt=0,this.anchorRefreshHoldTimer=null,this.anchorRefreshPending=!1,this.anchorUpdateFrame=null,this.$anchorContainer=null,this.lastAnchorClearance=0,this.observedAnchorIframes=new Set,this.orientationTarget=null,this.orientationEvent="",this.scheduleAnchorUpdate=this.scheduleAnchorUpdate.bind(this),this.settleAnchorClearance=this.settleAnchorClearance.bind(this);for(const e of n){const t=document.querySelector(e);if(t){this.$anchorContainer=t;break}}this.$anchorContainer&&this.setupAnchorTracking()}setupAnchorTracking(){this.anchorAdObserver=new ResizeObserver(this.scheduleAnchorUpdate),this.anchorAdObserver.observe(this.$anchorContainer),this.observeAnchorAdIframes(),this.anchorAdMutationObserver=new MutationObserver(e=>{e.some(e=>h(e.addedNodes)||h(e.removedNodes))&&this.settleAnchorClearance()}),this.anchorAdMutationObserver.observe(document.body,{childList:!0}),this.anchorAdMutationObserver.observe(this.$anchorContainer,{childList:!0,subtree:!0}),this.anchorVisibilityObserver=new IntersectionObserver(this.settleAnchorClearance,{threshold:[0,.01,.5,1]}),this.anchorVisibilityObserver.observe(this.$anchorContainer),window.addEventListener("resize",this.scheduleAnchorUpdate),window.visualViewport?.addEventListener("resize",this.scheduleAnchorUpdate);const e=screen.orientation;this.orientationTarget=e?.addEventListener?e:window,this.orientationEvent=window===this.orientationTarget?"orientationchange":"change",this.orientationTarget.addEventListener(this.orientationEvent,this.settleAnchorClearance),window.googletag=window.googletag||{cmd:[]},googletag.cmd.push(()=>{this.anchorTrackingTornDown||["slotRequested","slotRenderEnded","slotOnload"].forEach(e=>{const t=t=>{this.anchorTrackingTornDown||t.slot.getSlotElementId().includes("anchor")&&("slotRequested"===e?this.anchorRefreshPending=!0:("slotOnload"===e||t.isEmpty)&&(this.anchorRefreshPending=!1),this.observeAnchorAdIframes(),this.forceSettleAnchorClearance())};googletag.pubads().addEventListener(e,t),this.gptListeners.push({eventName:e,handler:t})})}),this.forceSettleAnchorClearance()}observeAnchorAdIframes(){this.anchorAdObserver&&this.$anchorContainer&&(this.observedAnchorIframes.forEach(e=>{e.isConnected||(this.anchorAdObserver.unobserve(e),this.observedAnchorIframes.delete(e))}
1),this.$anchorContainer.querySelectorAll("iframe").forEach(e=>{this.anchorAdObserver.observe(e),this.observedAnchorIframes.add(e)}))}scheduleAnchorUpdate(){this.anchorTrackingTornDown||null!==this.anchorUpdateFrame||(this.anchorUpdateFrame=window.requestAnimationFrame(()=>{this.anchorUpdateFrame=null,this.updateAnchorClearance()}))}settleAnchorClearance(){if(this.anchorTrackingTornDown)return;const e=Date.now();if(this.scheduleAnchorUpdate(),null===this.anchorSettleTimer){if(e<this.anchorSettleCooldownUntil)return;this.anchorSettleEndsBy=e+2e4,this.anchorSettleTimer=window.setInterval(()=>{this.scheduleAnchorUpdate(),Date.now()<this.anchorSettleUntil||(Date.now()>=this.anchorSettleEndsBy&&(this.anchorSettleCooldownUntil=Date.now()+1e4),this.clearAnchorSettleTimers())},400)}this.anchorSettleUntil=Math.min(e+4e3,this.anchorSettleEndsBy)}forceSettleAnchorClearance(){this.anchorSettleCooldownUntil=0,this.anchorSettleEndsBy=Math.max(this.anchorSettleEndsBy,Date.now()+4e3),this.settleAnchorClearance()}clearAnchorSettleTimers(){null!==this.anchorSettleTimer&&(window.clearInterval(this.anchorSettleTimer),this.anchorSettleTimer=null)}updateAnchorClearance(){if(!this.$anchorContainer)return;let e=this.getAnchorClearance();e<this.lastAnchorClearance&&this.isAnchorAdRefreshing()?(0===this.anchorRefreshHoldStartedAt&&(this.anchorRefreshHoldStartedAt=Date.now(),this.armAnchorRefreshHoldExpiry()),Date.now()-this.anchorRefreshHoldStartedAt<5e3&&(e=this.lastAnchorClearance)):(this.anchorRefreshHoldStartedAt=0,this.clearAnchorRefreshHoldTimer());const t=this.$playerwrap.classList.contains("sticky");this.lastAnchorClearance=t?e:0;const i=Math.max(150,e);this.$playerwrap.style.bottom=(t?Math.min(i,this.getMaxOnScreenBottom()):i)+"px"}getMaxOnScreenBottom(){return Math.max(0,d().bottom-this.$playerwrap.getBoundingClientRect().height)}armAnchorRefreshHoldExpiry(){this.clearAnchorRefreshHoldTimer(),this.anchorRefreshHoldTimer=window.setTimeout(()=>{this.anchorRefreshHoldTimer=null,this.scheduleAnchorUpdate()},5050)}clearAnchorRefreshHoldTimer(){null!==this.anchorRefreshHoldTimer&&(window.clearTimeout(this.anchorRefreshHoldTimer),this.anchorRefreshHoldTimer=null)}isAnchorAdRefreshing(){return this.anchorRefreshPending&&!!this.$anchorContainer&&!!this.$anchorContainer.querySelector(".gpt-ad")}getAnchorClearance(){const e=d(),t=this.getPlayerHorizontalBand();let i=0;return this.getAnchorAdElements().forEach(n=>{const s=this.getOccupiedTop(n,e,t);null!==s&&(i=Math.max(i,e.bottom-s))}),Math.min(i,Math.round(c(e.visibleHeight)))}getPlayerHorizontalBand(){if(!this.$playerwrap.classList.contains("sticky"))return null;const{left:e,right:t}=this.$playerwrap.getBoundingClientRect();return{left:e,right:t}}getAnchorAdElements(){const e=this.$anchorContainer?[this.$anchorContainer]:[];s.forEach(t=>{const i=document.querySelector(t);i&&e.push(i)});for(const t of document.body.children){if(!(t instanceof HTMLElement)||o.has(t.tagName))continue;if(t.contains(this.$anchorContainer)||t.contains(this.$playerwrap))continue;if(t.matches(r))continue;const{position:i}=getComputedStyle(t);"fixed"!==i&&"sticky"!==i||e.push(t)}return[...new Set(e)]}getOccupiedTop(e,t,i=null){const n=[e];let s=0,r=null;for(;n.length&&s<1e3;){const e=n.pop();s++;const o=getComputedStyle(e);if("none"===o.display||"hidden"===o.visibility||0===parseFloat(o.opacity))continue;const a=e.getBoundingClientRect();if(this.isOccupyingBottom(a,t,i)&&(r=null===r?a.top:Math.min(r,a.top)),"visible"===o.overflowY){const t=e.children;for(let e=0;e<t.length&&s+n.length<1e3;e++)n.push(t[e])}}return r}isOccupyingBottom(e,t,i){return!(e.width<100||e.height<20||e.top<=4||e.height>c(t.visibleHeight)||e.bottom<t.bottom-120||e.top>=t.bottom||i&&(e.right<=i.left||e.left>=i.right))}teardownAnchorTracking(){this.anchorTrackingTornDown=!0,this.clearAnchorSettleTimers(),this.clearAnchorRefreshHoldTimer(),this.gptListeners.length&&googletag.cmd.push(()=>{this.gptListeners.forEach(({eventName:e,handler:t})=>{googletag.pubads().removeEventListener(e,t)}),this.gptListeners=[]}),null!==this.anchorUpdateFrame&&(window.cancelAnimationFrame(this.anchorUpdateFrame),this.anchorUpdateFrame=null),this.anchorAdObserver&&(this.anchorAdObserver.disconnect(),this.anchorAdObserver=null),this.observedAnchorIframes.clear(),this.anchorAdMutationObserver&&(this.anchorAdMutationObserver.disconnect(),this.anchorAdMutationObserver=null),this.anchorVisibilityObserver&&(this.anchorVisibilityObserver.disconnect(),this.anchorVisibilityObserver=null),window.removeEventListener("resize",this.scheduleAnchorUpdate),window.visualVie
1wport?.removeEventListener("resize",this.scheduleAnchorUpdate),this.orientationTarget&&(this.orientationTarget.removeEventListener(this.orientationEvent,this.settleAnchorClearance),this.orientationTarget=null),this.anchorRefreshPending=!1,this.$anchorContainer=null}getOuterHeight(e,t=!1){let i=e.offsetHeight;if(t){const t=getComputedStyle(e);i+=parseFloat(t.marginTop)+parseFloat(t.marginBottom)}return i}getHeight(e){const t=getComputedStyle(e);return e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)}getWidth(e){const t=getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)}}let u=370;window.matchMedia("(max-width: 40em)").matches&&(u=220);class p extends i{enter(){const e=Math.min(this.stateMachine.getWidth(this.stateMachine.$player.parentElement),u);this.stateMachine.$helper.style.height=this.stateMachine.getOuterHeight(this.stateMachine.$playerwrap,!0)+"px",this.stateMachine.$player.style.width=e+"px",this.stateMachine.$player.style.height=e*this.stateMachine.playerRatio+"px",this.stateMachine.$player.style.maxWidth="100%",this.stateMachine.$playerwrap.classList.add("sticky"),this.stateMachine.$playerwrap.style.display="none",this.stateMachine.$playerwrap.offsetWidth,this.stateMachine.$playerwrap.style.display="",this.stateMachine.scheduleAnchorUpdate()}execute(){this.stateMachine.entry.isIntersecting&&this.stateMachine.transition("unstick")}}class A extends i{enter(){this.stateMachine.$player.style.width=this.stateMachine.initialPlayerWidth+"px",this.stateMachine.$player.style.height=this.stateMachine.initialPlayerHeight+"px",this.stateMachine.$player.style.maxWidth="100%",this.stateMachine.$playerwrap.classList.remove("sticky"),this.stateMachine.$playerwrap.style.display="none",this.stateMachine.$playerwrap.offsetWidth,this.stateMachine.$playerwrap.style.display="",this.stateMachine.$helper.style.height="0",this.stateMachine.entry.isIntersecting||this.stateMachine.transition("stick")}execute(){this.stateMachine.entry.isIntersecting||this.stateMachine.transition("stick")}}class g extends i{enter(){this.stateMachine.$player.style.width=this.stateMachine.initialPlayerWidth+"px",this.stateMachine.$player.style.height=this.stateMachine.initialPlayerHeight+"px",this.stateMachine.$player.style.maxWidth="100%",this.stateMachine.$playerwrap.classList.remove("sticky"),this.stateMachine.$helper.style.height="0",this.stateMachine.teardownAnchorTracking()}}class m extends i{enter(e){window.addEventListener("scroll",()=>{e?e.play()?.then(()=>{this.stateMachine.entry.isIntersecting?this.stateMachine.transition("unstick"):this.stateMachine.transition("stick")}):this.stateMachine.entry.isIntersecting?this.stateMachine.transition("unstick"):this.stateMachine.transition("stick")},{once:!0})}}const y=window.wp.components,v=window.wp.element,w=window.wp.i18n,f=window.wp.url,b=e=>{const t=`; ${document.cookie}`.split(`; ${e}=`);return 2===t.length?t.pop().split(";").shift():null},M=window.ReactJSXRuntime;function E(e,t){return new Promise((i,n)=>{if(!t)return void n("must pass video ID");const s=n=>{try{const r=JSON.parse(n.data);e===r.event&&t===r.id&&(window.removeEventListener("message",s),i(window.zypePlayers[t]))}catch(e){}};window.addEventListener("message",s)})}function S(e,t,i={},n=!1){const s=new URL(t),r=[];for(const e in i)r.push(e+"="+i[e]);return"undefined"!=typeof OnetrustActiveGroups&&OnetrustActiveGroups.includes("C0004")?(s.searchParams.set("rdp",0),s.searchParams.set("npa",0)):(s.searchParams.set("rdp",1),s.searchParams.set("npa",1)),s.searchParams.set("vid",e),s.searchParams.set("vpmute",n?1:0),s.searchParams.set("cust_params",r.join("&")),s.toString()}const T={},C=new WeakMap;function _(e){return C.has(e)||C.set(e,{eventListenersInitialized:!1,adsScheduledBySource:new Set}),C.get(e)}const R=new URLSearchParams(window.location.search),k=R.get("utm_medium")?.toLowerCase(),I=(e,t)=>{var i;if(!T[t])return void console.warn(`No video event data found for video ID ${t}`);const n=null!==(i=videoBridge?.eventCat)&&void 0!==i?i:"zype_shortcode";let s=0;const{quartilesReached:r,videoTitle:o,currentTimeFunction:a,duration:h,contentType:c,stickyStateMachine:d}=T[t];r&&(r.first&&(s=25),r.second&&(s=50),r.third&&(s=75),r.fourth&&(s=100));let l=videoBridge?.video_show;var u;l||(l=null!==(u=videoBridge?.video_content_category)&&void 0!==u?u:void 0);let p="stick"===d?.state?"floating":"inline";"video_hub"===n&&(p="hub");const A={video_stage:e,video_environment:n,video_id:t,video_title:null!=o?o:void 0,video_duration:h,video_current_time:"function"==typeof a?a():void 0,video_percent:s,video_provider:"zype",content_type:c||"editorial",video_category:l,page_type:"zype_shortcode"===n?"article":n,player_surface:p};T[t]?.errorMessage&&(A.error_message=String(T[t].errorMessage).slice(0,100)),window.iOneGA.sendEventDirectly("video_event",A),delete T[t].errorMessage,delete T[t].contentType};function O(t,i={},n){const s=new URL(t);let r;r="cpc"===k||"true"===s.searchParams.get("autoplay"),s.searchParams.set("autoplay","fal
1se"),i.isAudioOnly&&s.searchParams.set("audio","true"),E("zype:setupcomplete",i.videoId).then(t=>{videoBridge?.options?.disablesticky||function(e,t){let i;const n=new IntersectionObserver(e=>{e.forEach(e=>{i.entry=e,i.step()})},{rootMargin:"0px",threshold:.25}),s=t.matches("#zype-shortcode-wrapper")?t:t.querySelector("#zype-shortcode-wrapper"),r="cpc"===k?"stick":"wait";s&&(n.observe(s),i=new l(r,{wait:new m,unstick:new A,stick:new p,stop:new g},[],{playerWrap:t.querySelector("#zype-shortcode-player"),player:t.querySelector("#zype-shortcode-player .zype-shortcode"),sizeHelper:t.querySelector("#zype-shortcode-cls-helper")}),T[e]={},T[e].stickyStateMachine=i,t.querySelectorAll(".ione-video__close-button").forEach(e=>{e.addEventListener("click",()=>{i.transition("stop"),n.disconnect()})}))}(i.videoId,n),function(t,i={},n){var s,r;const o=_(t);if(o.eventListenersInitialized)return;o.eventListenersInitialized=!0;const{videoId:a,videoTitle:h}=i;T[a]={...null!==(s=T[a])&&void 0!==s?s:{},duration:null!==(r=t.getDuration())&&void 0!==r?r:null,currentTimeFunction:t.getCurrentTime.bind(t),videoTitle:h,playerReady:!0,firstFrameViewed:!1,quartilesReached:{first:!1,second:!1,third:!1,fourth:!1}},I("player_ready",a);const c=n.querySelector(".ione-video__video-title");c&&(c.textContent.length||(c.textContent=(0,e.decodeEntities)(h))),E("zype:firstframeviewed",a).then(()=>{T[a].firstFrameViewed=!0,I("video_start",a)}),t.on("timechanged",e=>{if(0<T[a].duration){const t=e.time/T[a].duration*100;25<=t&&!1===T[a].quartilesReached.first&&(T[a].quartilesReached.first=!0,I("video_progress",a)),50<=t&&!1===T[a].quartilesReached.second&&(T[a].quartilesReached.second=!0,I("video_progress",a)),75<=t&&!1===T[a].quartilesReached.third&&(T[a].quartilesReached.third=!0,I("video_progress",a))}}),t.on("playbackfinished",()=>{!1===T[a].quartilesReached.fourth&&(T[a].quartilesReached.fourth=!0,I("video_complete",a))}),["adstarted","admanifestloaded","adskipped","adfinished"].forEach(e=>{t.on(e,e=>{let t=e.type;switch(t){case"admanifestloaded":t="ad_loaded";break;case"adstarted":t="ad_started";break;case"adskipped":t="ad_skipped";break;case"adfinished":t="ad_complete"}T[a].contentType="advertisement",I(t,a)})}),["play","paused","seeked","viewmodechanged","muted","unmuted","error"].forEach(e=>{t.on(e,e=>{let t=e.type;switch(t){case"play":t="video_play";break;case"paused":t="video_pause";break;case"seeked":t="video_seek";break;case"viewmodechanged":t="fullscreen"===e.to?"video_fullscreen":"fullscreen"===e.from?"video_exit_fullscreen":"";break;case"muted":t="video_mute";break;case"unmuted":t="video_unmute";break;case"error":t="video_error",T[a].errorMessage=e.message;break;default:t=""}t&&I(t,a)})})}(t,i,n);const s=e=>{t.off("sourceloaded",s);const n=_(t),o=function(e,t={}){var i,n;return null!==(i=null!==(n=e?.source?.url)&&void 0!==n?n:e?.source?.title)&&void 0!==i?i:t.videoId}(e,i);!function(e,t={}){var i,n;const{videoId:s}=t;T[s]={...null!==(i=T[s])&&void 0!==i?i:{},duration:null!==(n=e.getDuration())&&void 0!==n?n:null,quartilesReached:{first:!1,second:!1,third:!1,fourth:!1}}}(t,i),-1!==videoBridge.options.ad_exclusions.indexOf(i.videoId)||n.adsScheduledBySource.has(o)?console.log("Zype Player Adapter: THIS VIDEO WONT GET ADS"):(function(e,t={},i=!1){const n={postID:videoBridge.postId,category:videoBridge.categories.join(","),tag:videoBridge.tags.join(",")};if(k&&(n.utm_medium=k),videoBridge.options.ad_tag&&e.ads.schedule({tag:{url:S(t.videoId,videoBridge.options.ad_tag,n,i),type:"vast"},id:"Preroll",position:"pre"}),videoBridge.options.ad_tag_midroll){var s;const r=null!==(s=t.adBreaks)&&void 0!==s?s:new Set;if(r.size>0){let s=0;for(const o of r)e.ads.schedule({tag:{url:S(t.videoId,videoBridge.options.ad_tag_midroll,n,i),type:"vast"},id:`midroll_${s}`,position:o}),s++}else{const s=parseInt(e.getDuration(),10),r=[];s>480&&s<900?r.push("50%"):s>=900&&s<1200?(r.push("33%"),r.push("66%")):s>=1200&&(r.push("25%"),r.push("50%"),r.push("75%")),r.forEach((s,r)=>{e.ads.schedule({tag:{url:S(t.videoId,videoBridge.options.ad_tag_midroll,n,i),type:"vast"},id:`midroll_${r}`,position:s})})}}}(t,i,r),n.adsScheduledBySource.add(o)),r&&async function({muted:e=!0}={}){const t=document.createElement("video");
1t.muted=e,t.playsInline=!0,t.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQRChYECGFOAZwEAAAAAAAK8EU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHWTbuMU6uEElTDZ1OsggGRTbuMU6uEHFO7a1OsggKm7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsCrXsYMPQkBNgIxMYXZmNjIuMy4xMDBXQYxMYXZmNjIuMy4xMDBEiYhAj0AAAAAAABZUrmtAta4BAAAAAAAAR9eBAXPFiMyZZj7rURiKnIEAIrWcg3VuZIiBAIaFVl9WUDmDgQEj44OEO5rKAOCYsIEBuoEBmoECVbCMVbGBAFW7gQFVuYECrgEAAAAAAABc14ECc8WINSO6HRbhC3CcgQAitZyDdW5kiIEAhoZBX09QVVNWqoNjLqBWu4QExLQAg4EC4ZGfgQG1iEC/QAAAAAAAYmSBEGOik09wdXNIZWFkAQE4AUAfAAAAAAASVMNnQNlzc59jwIBnyJlFo4dFTkNPREVSRIeMTGF2ZjYyLjMuMTAwc3PaY8CLY8WIzJlmPutRGIpnyKVFo4dFTkNPREVSRIeYTGF2YzYyLjExLjEwMCBsaWJ2cHgtdnA5Z8ihRaOIRFVSQVRJT05Eh5MwMDowMDowMS4wMDAwMDAwMDAAc3PXY8CLY8WINSO6HRbhC3BnyKJFo4dFTkNPREVSRIeVTGF2YzYyLjExLjEwMCBsaWJvcHVzZ8ihRaOIRFVSQVRJT05Eh5MwMDowMDowMC4wMDAwMDAwMDAAH0O2dbHngQCjrIEAAICiSYNC4AAAAAYAOCQcGEoAACAgABG///+mlH/////TSj/////ppQAAHFO7a5G7j7OBALeK94EB8YICcPCBAw==";try{return await t.play(),t.pause(),!0}catch(e){return!1}}({muted:!1}).then(e=>{e&&"video_hub"===videoBridge.eventCat||t.mute(),t.play()})};t.on("sourceloaded",s)});const o=document.createElement("script");o.src=s.toString(),o.async=!0,document.body.appendChild(o)}function B(e){const t=e.replace(".js",".json");return new Promise((e,i)=>{fetch(t,{headers:{Accept:"application/json"}}).then(e=>{if(!e.ok)throw e.status;return e.json()}).then(t=>{void 0===t.response||void 0===t.response.video||void 0===t.response.video.title?i(new Error("Invalid video data response")):e(t.response.video)}).catch(e=>{console.error("ERROR GETTING VIDEO DATA:",e),i(e)})})}function $(e,t){return new Promise((i,n)=>{fetch(`https://api.zype.com/videos/${e}/ad_timings?api_key=${t}`,{method:"GET",headers:{Accept:"application/json"}}).then(e=>{if(!e.ok)throw e.status;return e.json()}).then(e=>{const t=new Set,n=e.response;n.length>0&&n.forEach(e=>{e.ad_timings.forEach(e=>{0!==e.time&&t.add(e.hms_time)})}),i(t)}).catch(e=>{n("Error getting ad timings:",e)})})}document.querySelectorAll(".zype-shortcode").forEach(async function(e){var t,i;const n=null!==(t=null!==(i=e.closest(".ione-video"))&&void 0!==i?i:e.parentElement)&&void 0!==t?t:e,s={videoId:e.dataset.videoid,videoTitle:"",adBreaks:null,adobeRequired:e.dataset.adoberequired};let r=e.dataset.url;if("1"===s.adobeRequired){const t=await async function(e){let t=(0,v.createRoot)(e);t.render((0,M.jsx)("div",{className:"ione-adobe-check",children:(0,M.jsxs)("p",{children:[(0,M.jsx)(y.Spinner,{}),(0,w.__)("Checking if the video is availableâ¦","ione-modules")]})}));const i=b("ione_zype_session_id"),n=b("ione_adobe_device_code");if(i&&n)try{const e=await fetch("/wp-json/ione/v1/adobe-auth-media-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:i})}),n=await e.json();if(e?.ok&&"string"==typeof n?.media_token)return t.unmount(),n.media_token;console.log(n)}catch(e){console.error(e.message)}t.unmount();const s=(0,f.addQueryArgs)("/videos/watch-login/",{redirect:window.location.href});return videoBridge.postId&&0>=parseInt(videoBridge.postId)?(t=(0,v.createRoot)(e),t.render((0,M.jsx)("div",{className:"ione-adobe-check",children:(0,M.jsxs)("p",{children:[(0,w.__)("Please login to your Cable Provider to watch this video.","ione-modules"),(0,M.jsx)("a",{href:s,children:(0,w.__)("Login here","ione-modules")})]})}))):window.location.href=s,!1}(e);if(!t)return;const i=new URL(r);i.searchParams.set("adobe_media_token",t),r=i.toString()}if("yes"===e.dataset.isplaylist)O(r,s,n);else{const t=new URL(r).searchParams.get("api_key");Promise.all([B(r).catch(e=>(console.error("Error getting video data:",e),{title:""})),$(e.dataset.videoid,t).catch(e=>(console.error("Error getting ad timings:",e),null)),(o={id:e.dataset.videoid,readOnlyKey:!1},new Promise((e,t)=>{if("object"!=typeof o||null===o||!o.id||"object"!=typeof videoBridge||null===videoBridge)return void e(!1);const i=videoBridge.read_only_key||!1,n=o.readOnlyKey||i,s=o.id;if(!n)return void e(!1);
1const r=new URLSearchParams;r.append("api_key",n);const a=new AbortController,h=setTimeout(()=>a.abort(),5e3);fetch(`https://api.zype.com/videos/${s}/self_hosted?${r.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:a.signal}).then(e=>{if(clearTimeout(h),!e.ok)throw new Error(`Zype API ${e.status}`);return e.json()}).then(t=>{const i=Array.isArray(t?.response)&&t.response[0]&&Array.isArray(t.response[0].outputs)?t.response[0].outputs:[];let n=!0;for(let e=0;e<i.length;e++)if(Number(i[e]?.aspect_ratio)>0){n=!1;break}e(n)}).catch(e=>{clearTimeout(h),t(e)})})).catch(e=>(console.warn("videoIsAudioOnly failed, defaulting to false",e),!1))]).then(([e,t,i])=>{s.videoTitle=e.title,s.adBreaks=t,s.isAudioOnly=i,O(r,s,n)})}var o})})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.