Array.prototype.find||(Array.prototype.find=Array.prototype.find||function(n){var t,r;if(typeof n!="function")throw new TypeError("callback must be a function");var i=Object(this),u=i.length>>>0,f=arguments[1];for(t=0;t<u;t++)if(r=i[t],n.call(f,r,t,i))return r});String.prototype.includes||(String.prototype.includes=function(n,t){"use strict";return typeof t!="number"&&(t=0),t+n.length>this.length?!1:this.indexOf(n,t)!==-1});var analyticsEvents={init:function(){var n,t,i;for(window.dmpLayer={},dmpLayer.url=window.location.href,analyticsModel.pageType==="video"?(dmpLayer.name=analyticsModel.videoName,dmpLayer.live=analyticsModel.live,dmpLayer.showSeries=analyticsModel.showSeries,dmpLayer.showName=analyticsModel.showName,dataLayer.push({video:{id:analyticsModel.id}},{videoName:analyticsModel.videoName},{live:analyticsModel.live},{videoType:analyticsModel.videoType},{showSeries:analyticsModel.showSeries},{showName:analyticsModel.showName})):analyticsModel.pageType==="show"&&(dmpLayer.name=analyticsModel.showName,dataLayer.push({showName:analyticsModel.showName})),(analyticsModel.pageType==="video"||analyticsModel.pageType==="show")&&(dmpLayer.hostName=analyticsModel.hostName,dmpLayer.category=analyticsModel.contentTopic,dataLayer.push({hostName:analyticsModel.hostName},{contentTopic:analyticsModel.contentTopic})),analyticsModel.pageType==="channel"&&(dmpLayer.hostName=analyticsModel.hostName,dataLayer.push({hostName:analyticsModel.hostName})),dmpLayer.name===undefined&&(dmpLayer.name=analyticsModel.pageType),dmpLayer.id=analyticsModel.id,dmpLayer.type=analyticsModel.pageType,dmpLayer.loggedin=analyticsModel.loggedin,analyticsModel.loggedin&&(dmpLayer.userId=analyticsModel.userId,dataLayer.push({user:{id:analyticsModel.userId}})),dataLayer.push({pageType:analyticsModel.pageType},{loggedin:analyticsModel.loggedin},{webLocation:webLocation}),n=0;n<localStorage.length;n++)localStorage.key(n)!==null&&localStorage.key(n).startsWith("metric1_")&&(t=parseInt(localStorage.getItem(localStorage.key(n))),i=localStorage.key(n).replace("metric1_",""),localStorage.removeItem("metric1_"+i),localStorage.removeItem("metric1Time_"+i),n=n-2,t!==0&&(dmpLayer.metric1=t,gjdmp.tr("WatchedTime",{id:i,value:t,type:"video",url:window.location.href}),dataLayer.push({metric1:t})));gjdmp.tr("PageView",dmpLayer)},videoShare:function(){dataLayer.push({event:"gaEvent",gaEventData:{eCat:"Video",eAct:"Share",eLab:"-",eVal:1},eventCallback:function(){dataLayer.push({gaEventData:undefined})}})},videoComment:function(n){gjdmp.tr("comment",{id:analyticsModel.id,name:analyticsModel.videoName,value:n,type:"comment",category:"video",url:window.location.href});dataLayer.push({event:"gaEvent",gaEventData:{eCat:"Video",eAct:"Comment",eLab:"-",eVal:1},eventCallback:function(){dataLayer.push({gaEventData:undefined})}})},videoMoreComments:function(){gjdmp.tr("morecomments",{id:analyticsModel.id,name:analyticsModel.videoName,type:"comment",category:"video",url:window.location.href})},videoDeleteComment:function(n){gjdmp.tr("deletecomment",{id:analyticsModel.id,name:analyticsModel.videoName,value:"comment_"+n,type:"comment",category:"video",url:window.location.href})},videoMoreReplies:function(n){gjdmp.tr("morereplies",{id:analyticsModel.id,name:analyticsModel.videoName,value:"comment_"+n,type:"comment",category:"video",url:window.location.href})},videoReplyComment:function(n){gjdmp.tr("replycomment",{id:analyticsModel.id,name:analyticsModel.videoName,value:n,type:"comment",category:"video",url:window.location.href})},videoDeleteReply:function(n,t){gjdmp.tr("deletereply",{id:analyticsModel.id,name:analyticsModel.videoName,value:"reply_"+n+"_block_"+t,type:"video",category:"video",url:window.location.href})},videoReact:function(n,t){gjdmp.tr(n.toLowerCase(),{id:analyticsModel.id,name:analyticsModel.videoName,value:"entity_"+t,type:"entity",category:"video",url:window.location.href});dataLayer.push({event:"gaEvent",gaEventData:{eCat:"Video",eAct:"Rate",eLab:n,eVal:1},eventCallback:function(){dataLayer.push({gaEventData:undefined})}})},videoRemoveReact:function(n,t){gjdmp.tr(n.toLowerCase(),{id:analyticsModel.id,name:analyticsModel.videoName,value:"entity_"+t,type:"entity",category:"video",url:window.location.href})},videoRate:function(n,t,i){gjdmp.tr(n,{id:analyticsModel.id,name:analyticsModel.videoName,value:"entity_"+t+"_value_"+i,type:"video",category:"video",url:window.location.href})},subscribe:function(n){dataLayer.push({event:"gaEvent",gaEventData:{eCat:"User",eAct:"Subscription",eLab:n,eVal:1},eventCallback:function(){dataLayer.push({gaEventData:undefined})}})},registration:function(){dataLayer.push({event:"gaEvent",gaEventData:{eCat:"User",eAct:"Registration",eLab:"-",eVal:1},eventCallback:function(){dataLayer.push({gaEventData:undefined})}})},login:function(){dataLayer.push({event:"gaEvent",gaEventData:{eCat:"User",eAct:"Login",eLab:"-",eVal:1},eventCallback:function(){dataLayer.push({gaEventData:undefined})}})},watchLater:function(n,t,i){gjdmp.tr(t,{id:analyticsModel.id,name:analyticsModel.videoName,value:"entity_"+i,type:"entity",category:"video",url:window.location.href});dataLayer.push({event:"gaEvent",gaEventData:{eCat:"Video",eAct:n,eLab:"-",eVal:1},eventCallback:function(){dataLayer.push({gaEventData:undefined})}})},videoView:function(){gjdmp.tr("ViewContent",dmpLayer)},relatedClick:function(n,t,i){gjdmp.tr("relatedclick",{id:n,name:t,value:i,type:"entity",category:"video"})},playTime:{triggers:[],triggered:function(n){return this.triggers.length>0&&this.triggers.find(function(t){return t.time===n?t.triggered:!1})},push:function(n){this.triggered(n)||(analyticsEvents.playTime.triggers.push({time:n,triggered:!0}),gjdmp.tr(n,{id:analyticsModel.id,name:analyticsModel.videoName,type:analyticsModel.pageType,url:window.location.href}),dataLayer.push({event:"gaEvent",gaEventData:{eCat:"Video",eAct:"Playtime",eLab:n,eVal:1},eventCallback:function(){dataLayer.push({gaEventData:undefined})}}))}},getProduct:function(n){return window.productsModel===null?null:window.productsModel.find(function(t){return t.Id&&t.Id==n?t:null})},productImpression:{ids:[],push:function(n,t){var i,f=analyticsEvents.productImpression.getType(t),e=[],r="",u={},s,o;if(typeof n=="object"){for(s=0,o=0;o<n.length;o++){if(i=analyticsEvents.getProduct(n[o]),i===null||i!=="undefined"||typeof i.Id!="undefined"&&i.Id&&this.ids.includes(i.Id)){s++;continue}this.ids.push(i.Id);r=new URL(i.Link?i.Link:i.ButtonRedirectUrl);i.position=this.ids.length;u={name:i.Title,id:i.Id,brand:r.hostname,category:analyticsModel.contentTopic,list:f,dimension5:r.hostname,position:i.position};i.Price!==undefined&&(u.price=typeof i.Price=="string"?i.Price.replace(/\D+/g,""):i.Price);e.push(u);i.ListType=f}s!==n.length&&dataLayer.push({event:"gaEeImpressions",ecommerce:{impressions:e}})}else if(typeof n=="string"||typeof n=="number"){if(i=analyticsEvents.getProduct(n),i===null||i===undefined||this.ids.includes(n))return;this.ids.push(i.Id);r=new URL(i.Link?i.Link:i.ButtonRedirectUrl);i.position=this.ids.length;u={name:i.Title,id:i.Id,brand:r.hostname,category:analyticsModel.contentTopic,list:f,dimension5:r.hostname,position:i.position};i.Price!==undefined&&(u.price=i.Price.replace(/\D+/g,""));e.push(u);i.ListType=f;dataLayer.push({event:"gaEeImpressions",ecommerce:{impressions:e}})}},getType:function(n){switch(n){case 1:return"In video - fixed";case 2:return"Under video - button";case 3:return"Under video - about video link";default:return""}}},isProductClicked:!0,productClick:function(n){var t=analyticsEvents.getProduct(n),i,r,u;t!==null&&t!==undefined&&(vpPlayer.player.video.pause(),adHoverPause=!1,i=new URL(t.Link?t.Link:t.ButtonRedirectUrl),i.insertParameter("utm_source",analyticsModel.platformDomain),i.insertParameter("utm_medium","video"),i.insertParameter("utm_campaign",t.ListType),i.insertParameter("utm_content",analyticsModel.showName+" - "+analyticsModel.videoName),i.insertParameter("utm_term",t.Id),r={name:t.Title,id:t.Id,brand:i.hostname,category:analyticsModel.contentTopic,list:t.ListType,dimension5:i.hostname,position:analyticsEvents.productImpression.ids.length},t.Price!==undefined&&(r.price=t.Price.replace(/\D+/g,"")),dataLayer.push({event:"gaEeClick",ecommerce:{click:{actionField:{list:t.ListType},products:[r]}}}),u=window.open(i,"_blank"),u.focus())},promoView:{ids:[],push:function(n,t){var i,u,f,r;if(typeof n=="object"){for(u=0,f=[],r=0;r<n.length;r++){if(i=analyticsEvents.getProduct(n[r]),i===null||i===undefined||this.ids.includes(i.Id)){u++;continue}this.ids.push(i.Id);i.Dimension8=t;i.Position=this.ids.length;i.Name=analyticsEvents.promoView.getName(i,t);f.push({id:i.Id,name:i.Name,creative:i.Title,position:this.ids.length,dimension8:t})}u!==n.length&&dataLayer.push({event:"gaEePromoView",ecommerce:{promoView:{promotions:f}}})}else if(typeof n=="string"||typeof n=="number"){if(i=analyticsEvents.getProduct(n),i===null||i===undefined||this.ids.includes(i.Id))return;this.ids.push(i.Id);i.Dimension8=t;i.Position=this.ids.length;i.Name===undefined&&(i.Name=analyticsEvents.promoView.getName(i,t));dataLayer.push({event:"gaEePromoView",ecommerce:{promoView:{promotions:[{id:i.Id,name:i.Name,creative:i.Title,position:this.ids.length,dimension8:t}]}}})}},getName:function(n,t){switch(t){case"Ad - video":return n.Name+", SkipTime: 5";case"Show":return n.Name;case"Video":return n.Name;default:return n.Name}}},promoClick:{push:function(n,t){var i=analyticsEvents.getProduct(n),r=analyticsEvents.promoClick.getType(t);dataLayer.push({event:"gaEePromoClick",adClickType:r,ecommerce:{promoClick:{promotions:[{id:i.Id,name:i.Name,creative:i.Title,position:i.Position,dimension8:i.Dimension8}]}}})},getType:function(n){switch(n){case 1:return"ad";case 2:return"skip";default:return undefined}}},getCookie:function(n){var i=`; ${document.cookie}`,t=i.split(`; ${n}=`);if(t.length===2)return t.pop().split(";").shift()}};analyticsEvents.init()