function AkaHTML5MediaAnalytics(cz){var bV="3.12.11";var bJ=document.currentScript;var l=null;var ak=null;var a3=true;var w=null;var bR=null;var c6=false;var ap=null;if(cz){if(cz.loaderName){w=cz.loaderName}if(cz.loaderVersion){bR=cz.loaderVersion}}if(bJ){l=bJ.src}else{bK("Should be Internet Explorer")}function J(){return((1+Math.random())*65536|0).toString(16).substring(1)}function de(){return J()+J()+"-"+J()+"-"+J()+"-"+J()+"-"+J()+J()+J()}var bC=bC||function(dm,dk){var dn={},dq=dn.lib={},dg=dq.Base=function(){function ds(){}return{extend:function(dt){ds.prototype=this;var du=new ds;dt&&du.mixIn(dt);du.$super=this;return du},create:function(){var dt=this.extend();dt.init.apply(dt,arguments);return dt},init:function(){},mixIn:function(dt){for(var du in dt){dt.hasOwnProperty(du)&&(this[du]=dt[du])}dt.hasOwnProperty("toString")&&(this.toString=dt.toString)},clone:function(){return this.$super.extend(this)}}}(),dh=dq.WordArray=dg.extend({init:function(ds,dt){ds=this.words=ds||[];this.sigBytes=dt!=dk?dt:4*ds.length},toString:function(ds){return(ds||dp).stringify(this)},concat:function(dt){var du=this.words,dw=dt.words,dv=this.sigBytes,dt=dt.sigBytes;this.clamp();if(dv%4){for(var ds=0;ds<dt;ds++){du[dv+ds>>>2]|=(dw[ds>>>2]>>>24-8*(ds%4)&255)<<24-8*((dv+ds)%4)}}else{if(65535<dw.length){for(ds=0;ds<dt;ds+=4){du[dv+ds>>>2]=dw[ds>>>2]}}else{du.push.apply(du,dw)}}this.sigBytes+=dt;return this},clamp:function(){var ds=this.words,dt=this.sigBytes;ds[dt>>>2]&=4294967295<<32-8*(dt%4);ds.length=dm.ceil(dt/4)},clone:function(){var ds=dg.clone.call(this);ds.words=this.words.slice(0);return ds},random:function(ds){for(var dt=[],du=0;du<ds;du+=4){dt.push(4294967296*dm.random()|0)}return dh.create(dt,ds)}}),e=dn.enc={},dp=e.Hex={stringify:function(dt){for(var du=dt.words,dt=dt.sigBytes,dw=[],ds=0;ds<dt;ds++){var dv=du[ds>>>2]>>>24-8*(ds%4)&255;dw.push((dv>>>4).toString(16));dw.push((dv&15).toString(16))}return dw.join("")},parse:function(dt){for(var du=dt.length,dv=[],ds=0;ds<du;ds+=2){dv[ds>>>3]|=parseInt(dt.substr(ds,2),16)<<24-4*(ds%8)}return dh.create(dv,du/2)}},dj=e.Latin1={stringify:function(dt){for(var du=dt.words,dt=dt.sigBytes,ds=[],dv=0;dv<dt;dv++){ds.push(String.fromCharCode(du[dv>>>2]>>>24-8*(dv%4)&255))}return ds.join("")},parse:function(dt){for(var ds=dt.length,dv=[],du=0;du<ds;du++){dv[du>>>2]|=(dt.charCodeAt(du)&255)<<24-8*(du%4)}return dh.create(dv,ds)}},di=e.Utf8={stringify:function(dt){try{return decodeURIComponent(escape(dj.stringify(dt)))}catch(ds){throw Error("Malformed UTF-8 data")}},parse:function(ds){return dj.parse(unescape(encodeURIComponent(ds)))}},dl=dq.BufferedBlockAlgorithm=dg.extend({reset:function(){this._data=dh.create();this._nDataBytes=0},_append:function(ds){"string"==typeof ds&&(ds=di.parse(ds));this._data.concat(ds);this._nDataBytes+=ds.sigBytes},_process:function(dt){var ds=this._data,dy=ds.words,dx=ds.sigBytes,du=this.blockSize,dv=dx/(4*du),dv=dt?dm.ceil(dv):dm.max((dv|0)-this._minBufferSize,0),dt=dv*du,dx=dm.min(4*dt,dx);if(dt){for(var dw=0;dw<dt;dw+=du){this._doProcessBlock(dy,dw)}dw=dy.splice(0,dt);ds.sigBytes-=dx}return dh.create(dw,dx)},clone:function(){var ds=dg.clone.call(this);ds._data=this._data.clone();return ds},_minBufferSize:0});dq.Hasher=dl.extend({init:function(){this.reset()},reset:function(){dl.reset.call(this);this._doReset()},update:function(ds){this._append(ds);this._process();return this},finalize:function(ds){ds&&this._append(ds);this._doFinalize();return this._hash},clone:function(){var ds=dl.clone.call(this);ds._hash=this._hash.clone();return ds},blockSize:16,_createHelper:function(ds){return function(dt,du){return ds.create(du).finalize(dt)}},_createHmacHelper:function(ds){return function(dt,du){return dr.HMAC.create(ds,du).finalize(dt)}}});var dr=dn.algo={};return dn}(Math);(function(){var di=bC,dh=di.lib,dj=dh.WordArray,dh=dh.Hasher,dg=[],e=di.algo.SHA1=dh.extend({_doReset:function(){this._hash=dj.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(dq,dk){for(var ds=this._hash.words,dm=ds[0],dl=ds[1],dn=ds[2],dp=ds[3],du=ds[4],dr=0;80>dr;dr++){if(16>dr){dg[dr]=dq[dk+dr]|0}else{var dt=dg[dr-3]^dg[dr-8]^dg[dr-14]^dg[dr-16];dg[dr]=dt<<1|dt>>>31}dt=(dm<<5|dm>>>27)+du+dg[dr];dt=20>dr?dt+((dl&dn|~dl&dp)+1518500249):40>dr?dt+((dl^dn^dp)+1859775393):60>dr?dt+((dl&dn|dl&dp|dn&dp)-1894007588):dt+((dl^dn^dp)-899497514);du=dp;dp=dn;dn=dl<<30|dl>>>2;dl=dm;dm=dt}ds[0]=ds[0]+dm|0;ds[1]=ds[1]+dl|0;ds[2]=ds[2]+dn|0;ds[3]=ds[3]+dp|0;ds[4]=ds[4]+du|0},_doFinalize:function(){var dk=this._data,dm=dk.words,dn=8*this._nDataBytes,dl=8*dk.sigBytes;dm[dl>>>5]|=128<<24-dl%32;dm[(dl+64>>>9<<4)+15]=dn;dk.sigBytes=4*dm.length;this._process()}});di.SHA1=dh._createHelper(e);di.HmacSHA1=dh._createHmacHelper(e)})();(function(){var dg=bC,e=dg.enc.Utf8;dg.algo.HMAC=dg.lib.Base.extend({init:function(dn,dq){dn=this._hasher=dn.create();"string"==typeof dq&&(dq=e.parse(dq));var dm=dn.blockSize,di=4*dm;dq.sigBytes>di&&(dq=dn.finalize(dq));for(var dh=this._oKey=dq.clone(),dp=this._iKey=dq.clone(),dk=dh.words,dj=dp.words,dl=0;dl<dm;dl++){dk[dl]^=1549556828,dj[dl]^=909522486}dh.sigBytes=dp.sigBytes=di;this.reset()},reset:function(){var dh=this._hasher;dh.reset();dh.update(this._iKey)},update:function(dh){this._hasher.update(dh);return this},finalize:function(di){var dh=this._hasher,di=dh.finalize(di);dh.reset();return dh.finalize(this._oKey.clone().concat(di))}})})();(function(){var dj=bC,di=dj.lib,dk=di.Base,dg=di.WordArray,di=dj.algo,e=di.HMAC,dh=di.PBKDF2=dk.extend({cfg:dk.extend({keySize:4,hasher:di.SHA1,iterations:1}),init:function(dl){this.cfg=this.cfg.extend(dl)},compute:function(du,dw){for(var dt=this.cfg,dq=e.create(dt.hasher,du),ds=dg.create(),dr=dg.create([1]),dy=ds.words,dv=dr.words,dx=dt.keySize,dt=dt.iterations;dy.length<dx;){var dp=dq.update(dw).finalize(dr);dq.reset();for(var dm=dp.words,dA=dm.length,dl=dp,dB=1;dB<dt;dB++){dl=dq.finalize(dl);dq.reset();for(var dz=dl.words,dn=0;dn<dA;dn++){dm[dn]^=dz[dn]}}ds.concat(dp);dv[0]++}ds.sigBytes=4*dx;return ds}});dj.PBKDF2=function(dl,dn,dm){return dh.create(dm).compute(dl,dn)}})();function cc(dn,dk){if(dn==null||dn==""){return}var di=/(\w+):\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/;try{var dh=di.exec(dn);dk.protocol=dh[1];dk.hostName=dh[2];dk.port=dh[3]?dh[3]:"80";dk.path=dh[4];var dm=dk.path.split("/");var dj=dm.length;dk.streamName=dm[dj-1];var dg=dk.streamName.toLowerCase();if(dg.indexOf(".m3u")!=-1||dg.indexOf("manifest")!=-1||dg.indexOf(".f4m")!=-1||dg.indexOf(".mpd")!=-1){if(dj>=3){dk.streamName=dm[dj-2]+"/"+dm[dj-1]}}dk.hash=dh[5]?dh[5]:"";dk.search=dh[6]?dh[6]:"";dk.host=dk.hostName+":"+dk.port}catch(dl){bK("Exception,  parseStreamUrl :"+dl)}}function b5(e,dg){var dh;if(e!=null){dh=e}else{dh=(new Date).getTime()}return dh}var Z=false;if(window){try{Z=window.XDomainRequest?true:false}catch(cb){Z=false}}var bf={};var Y={};var bu=null;var cm={eventCode:"",beaconId:"",sequenceId:"",logType:"",endOfStream:"",logVersion:"",formatVersion:"",visitId:"",errorCode:"",partNumber:"",totalParts:"",hostName:"",streamName:"",port:"",protocol:"",userAgent:"",playerType:"",os:"",format:"",connectTime:"",bufferingTime:"",startupTime:"",streamLength:"",bytesTotal:"",browser:"",browserSize:"",videoSize:"",streamUrl:"",deliveryType:"",pluginVersion:"",beaconVersion:"",serverIp:"",playerFormat:"",outlierStartupTime:"",isFirstTitle:"",rebufferSessionH:"",sequenceIdH:"",isSessionWithRebufferH:"",playerState:"",currentStreamTime:"",currentClockTime:"",playClockTime:"",playStreamTime:"",rebufferCount:"",rebufferTime:"",pauseCount:"",pauseDuration:"",pauseIntervalsAsString:"",seekCount:"",seekTime:"",seekIntervalsAsString:"",pauseSeekSession:"",resumeBufferCount:"",resumeBufferTime:"",isView:"",isSessionWithRebuffer:"",logInterval:"",rebufferSession:"",socialSharing:"",endReasonCode:"",totalPlayClockTime:"",totalPlayStreamTime:"",totalRebufferCount:"",totalRebufferTime:"",totalAdPlayClockTime:"",totalAdStartCount:"",totalAdAbandonCount:"",lastHTime:"",isVisitStart:"",isVisitEnd:"",visitAttempts:"",visitPlays:"",visitViews:"",visitErrors:"",visitInterval:"",visitPlayClockTime:"",visitPlayStreamTime:"",visitRebufferCount:"",visitRebufferTime:"",visitStartupErrors:"",visitAdPlayClockTime:"",visitAdStartCount:"",visitAdAbandonCount:"",visitUniqueTitles:"",adAbandonCount:"",adPauseTime:"",adStartupTime:"",adPlayClockTime:"",adCount:"",adSession:"",sessionId:"",attemptId:"",playerReferrer:"",ais_idpId:"",ais_idpName:"",ais_idpDisplayName:"",ais_idpUrl:"",ais_queryToken:"",ais_aisuid:"",qualityOfExperience:"",transitionStreamTimeSession:"",transitionUpSwitchCount:"",transitionDownSwitchCount:"",averagedBitRate:"",fullOs:"",longitude:"",latitude:"",connectivity:""};var cv={title:false,category:false,subCategory:false,show:false,contentLength:false,contentType:false,device:false,deliveryType:false,playerId:false,eventName:false};var aG={};var cl={};aG.isBrightcoveVideo=false;aG.objectBased=false;aG.videoPassed=false;var an=false;var Q=false;var aT=false;var aD={};var bQ={};var cD=false;var cU=[];var bk={timer:null,queue:[],browserClose:false,enabled:true,time:250};var bD={};var by=[];var aW={};var bP={};var o={};o.seekThreshold=2e3;o.visitTimeout=60*60*1e3;var aN={};var cu={};var al={};var b3={};var L=100;var cA={};var ae=false;var bO=false;var c={fastTCPFailed:false,fastTCPEnabled:false};var cy=[];var bv={};bv.dataSent={};var ca=1;var aL=-1;var r=null;var ck={};var z=[];var N={pageURLCsmaDebug:0,configURLCsmaDebug:0,configDebug:0,windowOpened:false,logStoredMsg:true,printException:false};function aq(){this.aisRetries=0;this.aisRequestLimit=3;this.aisRequestInterval=3e4;this.requestFailed=false}var b9=new aq;var D={setDataArr:["adId","adDuration","adTitle","adCategory","adPartnerId","adServer","adDaypart","adIndustryCategory","adEvent"],clearAdAnalytics:function(){this.isAdLoaded=false;this.isAdStarted=false;this.id="";this.type="0";this.startPos="0";this.playBucket="-1";this.endStatus="2";this.adLoadTime=null;this.adStartTime=null;this.adStartupTime="0";for(var e=0;e<this.setDataArr.length;e++){this[this.setDataArr[e]]=""}}};var ch={bitRateArr:[],currentBitRate:"-",currentStartPos:0,bitRateCount:{},bitRatePlayTime:{},bitRateBucketMap:{},clearBitRate:function(){this.bitRateArr=[];this.currentBitRate="-";this.bitRateCount={};this.bitRatePlayTime={}},updateBitRateArr:function(dh){if(this.bitRateArr.length>0){var e=this.bitRateArr.length;var dg=ch.bitRateArr[e-1];if(this.currentBitRate==dg.bitRate){dg.playTime+=dh}else{this.pushInBitRateArr(dh,this.currentBitRate,this.currentStartPos)}}else{this.pushInBitRateArr(dh,this.currentBitRate,this.currentStartPos)}},pushInBitRateArr:function(dh,e,dg){this.bitRateArr.push({bitRate:e,playTime:dh,startPos:dg})},populateBitRateBucketMap:function(e,dk){var dh,di=false;var dg=b3.bitRateBucketTimes;if(e!="-"&&e!==""){e=parseInt(e/1e3)}for(var dj in dg){di=false;dh=dg[dj];if(e=="-"||e===""||e<0){if(!dh.max&&!dh.min){di=true;break}}else{if(dh.max&&dh.min){if(e>=dh.min&&e<dh.max){di=true;break}}else{if(dh.max){if(e<dh.max){di=true;break}}else{if(dh.min){if(e>=dh.min){di=true;break}}}}}}if(di){this.bitRateBucketMap[dj]+=dk}},findMaxPersistentBitRate:function(){try{if(this.bitRatePlayTime){var dg=0,dh=-1;for(var di in this.bitRatePlayTime){if(this.bitRatePlayTime[di]>dh){dh=this.bitRatePlayTime[di];dg=di}}if(dg!==0){return dg}}}catch(dj){bK("Exception, find max persistent bit rate")}},getTransitionSession:function(dm){try{var di=null;var dh,dr,dj="";var dk=0,dn,dq=0,dg=0;var dl=true;if(this.bitRateArr.length>0){dh=this.bitRateArr[0];if(dh.bitRate=="-"){dl=false;if(this.bitRateArr[1]&&this.bitRateArr[1].bitRate!="-"){dl=true;this.bitRateArr[1].startPos=this.bitRateArr[0].startPos;this.bitRateArr[1].playTime+=this.bitRateArr[0].playTime;this.bitRateArr.shift()}}}for(dr in this.bitRateBucketMap){this.bitRateBucketMap[dr]=0}for(dk=0;dk<this.bitRateArr.length;dk++){dh=this.bitRateArr[dk];if(dh.bitRate in this.bitRateCount){if(dk!=0){this.bitRateCount[dh.bitRate]++}}else{this.bitRateCount[dh.bitRate]=1}if(dh.bitRate!=""&&dh.bitRate!="-"){if(dh.bitRate in this.bitRatePlayTime){this.bitRatePlayTime[dh.bitRate]+=dh.playTime}else{this.bitRatePlayTime[dh.bitRate]=dh.playTime}}dn=this.bitRateCount[dh.bitRate];if(di){di+=","+dh.bitRate+":"+dh.startPos+":"+dh.playTime+"::"+dn}else{di=dh.bitRate+":"+dh.startPos+":"+dh.playTime+"::"+dn}this.populateBitRateBucketMap(dh.bitRate,dh.playTime);try{if(dl){dq+=dh.bitRate*dh.playTime;dg+=dh.playTime}}catch(dp){}}dm.maxPersistentBitRate=this.findMaxPersistentBitRate();dm.transitionStreamTimeSession=di;for(dr in this.bitRateBucketMap){if(dj){dj+=","+dr+":"+this.bitRateBucketMap[dr]}else{dj=dr+":"+this.bitRateBucketMap[dr]}}dm.bitRateBucketTimes=dj;try{if(dl&&dg&&dg!=0){dm.averagedBitRate=dq+":"+dg}else{dm.averagedBitRate=null}}catch(dp){}}catch(dp){bK("Exception, get transition Session :"+dp)}}};amaURLUtility=function(){};amaURLUtility.isURL=function(e){var dg=new RegExp("((http|https)(://))?([a-zA-Z0-9]+[.]{1}){2}[a-zA-z0-9]+(/{1}[a-zA-Z0-9]+)*/?","i");if(!dg.test(e)){return false}return true};amaURLUtility.parseURLComponents=function(dj){var dh={};var dk=/(\w+):\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/;try{var di=dk.exec(dj);dh.protocol=di[1];dh.hostName=di[2];dh.port=di[3]?di[3]:"80";dh.path=di[4];var dn=this.path.split("/");var dl=dn.length;dh.name=dn[dl-1];var dg=dh.name.toLowerCase();if(dg.indexOf(".m3u")!=-1||dg.indexOf("manifest")!=-1||dg.indexOf(".f4m")!=-1||dg.indexOf(".mpd")!=-1){if(dl>=3){dh.name=dn[dl-2]+"/"+dn[dl-1]}}dh.hash=di[5]?di[5]:"";dh.search=di[6]?di[6]:"";dh.host=dh.hostName+":"+dh.port}catch(dm){console.log("Exception,  parseStreamUrl :"+dm)}return dh};streamError={InvalidURL:"URL is not valid",ParsingFailed:"Failed to parse stream URL",Invalid_Manifest:"Invalid manifest received",Invalid_Stream:"Stream is not valid",NoError:"success"};streamInfoBase=function(e,dg){this.url=e;this.name=null;this.length=0;this.format=null;this.deliveryType="O";this.isValid=false;this.streamType=null;this.callback=dg};streamInfoBase.prototype.getStreamURL=function(){return this.url};streamInfoBase.prototype.getStreamName=function(){return this.name};streamInfoBase.prototype.getStreamLength=function(){return this.length};streamInfoBase.prototype.getStreamFormat=function(){return this.format};streamInfoBase.prototype.getDeliveryType=function(){return this.deliveryType};streamInfoBase.prototype.getStreamType=function(){return this.streamType};streamInfoBase.prototype.getCallback=function(){return this.callback};streamInfoBase.prototype.parseURL=function(){var di=/(\w+):\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/;try{var dh=di.exec(this.url);this.protocol=dh[1];this.hostName=dh[2];this.port=dh[3]?dh[3]:"80";this.path=dh[4];var dl=this.path.split("/");var dj=dl.length;this.name=dl[dj-1];var dg=this.name.toLowerCase();if(dg.indexOf(".m3u")!=-1||dg.indexOf("manifest")!=-1||dg.indexOf(".f4m")!=-1||dg.indexOf(".mpd")!=-1){if(dj>=3){this.name=dl[dj-2]+"/"+dl[dj-1]}}this.hash=dh[5]?dh[5]:"";this.search=dh[6]?dh[6]:"";this.host=this.hostName+":"+this.port}catch(dk){console.log("Exception,  parseStreamUrl :"+dk)}};var f=function(di,dj,dh,dg){try{di.prototype=Object.create(dj.prototype,{url:{value:dh,enumerable:false},callback:{value:dg,enumerable:false}})}catch(dk){console.log("Exception thrown from InheritObject"+dk)}};hlsStreamInfo=function(dg){this.recursiveDownload=false;this.isParsed=false;this.parse=function(dt){try{if(!dt){return streamError.InvalidURL}if(dt.search("#EXTM3U")===-1){return streamError.ParsingFailed}this.streamType="hls";this.format="L";this.parseURL();var du=dt.split("\n");var dj="";var dw=/PROGRAM-ID=(\d+)/;var dr,dq;if(du){for(dq=0;dq<du.length;dq++){if(dr=dw.exec(du[dq])){if(dr[1]==dj){break}else{dj=dr[1]}}}if(dq!=du.length){this.format="L"}}var di=this.getStreamURL();var dv,dh,dm,dx;if(di){var dk=/(\w+):\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/;var dl=dk.exec(di);dv=dl[1];dh=dl[2];dm=dl[3]?dl[3]:"80";dx=dl[4]}dw=/^#EXT((INF)|(-X-STREAM-INF))[^\n]*\n([^\n]*)\n/m;console.log("Checking");if(dr=dw.exec(dt)){console.log("Checking done "+dr[4]);if(/.m3u8$/.exec(dr[4])&&dv&&dh){try{this.recursiveDownload=true;var dn=new XMLHttpRequest;var dp;if(!amaURLUtility.isURL(dr[4])){dp=dv+"://"+dh+dr[4]}else{dp=dr[4]}console.log("Requesting URL = "+dp);dn.open("GET",dp,true);dn.onreadystatechange=function(dy){return function(){console.log("current content type from stream url is = "+this.getResponseHeader("content-type"));if(this.readyState===4){if(this.status===200&&this.responseText){if(/^#EXT-X-ENDLIST/m.exec(this.responseText)){dy.deliveryType="O"}else{dy.deliveryType="L";dy.length="-1"}}dy.getCallback()(dy)}}}(this);if(dn.overrideMimeType){dn.overrideMimeType("text/plain")}dn.send(null)}catch(ds){console.log("parsePlaylist, Exception,  parsing play list, "+ds)}}else{if(/^#EXT-X-ENDLIST/m.exec(dt)){this.deliveryType="O"}}}}catch(ds){console.log("Exception,  parsePlaylist : "+ds)}this.isParsed=true;return streamError.NoError};var e=this.parse(dg);if(e===streamError.NoError){if(this.recursiveDownload===false){this.getCallback()(this)}this.streamType="hls";this.deliveryType="O";return this}else{}};dashStreamInfo=function(dh){this.isParsed=false;try{this.parse=function(dn){if(!dn){return streamError.InvalidURL}this.parseURL();this.format="Dash";this.streamType="dash";var dk=new DOMParser;var dv=dk.parseFromString(dn,"text/xml");if(!dv){return streamError.ParsingFailed}var ds=dv.getElementsByTagName("MPD");if(!ds||!ds[0]){return streamError.ParsingFailed}var dr=ds[0].getAttribute("type");if(dr==="dynamic"){this.deliveryType="L";this.length=0}else{this.deliveryType="O";var e=ds[0].getAttribute("mediaPresentationDuration").replace("PT","");var dp=e.search("H");var dt=0;this.length=0;if(dp!==-1){var dm=Number(e.substring(0,dp));if(!isNaN(dm)){this.length+=dm*60*60*1e3;dt=dp+1}}var dl=e.search("M");if(dl!==-1){var dj=Number(e.substring(dt,dl));if(!isNaN(dj)){this.length+=dj*60*1e3;dt=dl+1}}var dq=e.search("S");if(dq!==-1){var du=Number(e.substring(dt,dq));if(!isNaN(du)){this.length+=du*1e3}}console.log("Current stream length = "+this.length)}this.getCallback()(this);this.isParsed=true;return streamError.NoError}}catch(di){console.log("Exception thrown from dashStreamInfo "+di)}var dg=this.parse(dh);if(dg===streamError.NoError){return this}else{}};nonAdaptiveStream=function(dg){try{this.format="P";this.deliveryType="O";this.streamType="nonAdaptiveStream";this.length=0;this.parseURL();this.getCallback()(this);return this}catch(dh){console.log("Exception thrown from nonAdaptiveStream"+dh)}};var cR={};cR.FactoryWithURL=function(di,dg,dh){var dj;try{var dl=new XMLHttpRequest;dl.open("GET",dg,true);dl.onreadystatechange=function(){if(this.readyState===4&&this.status===200&&this.responseText){dj=cR.FactoryWithContent(di,dg,this.responseText,dh)}else{}};dl.send(null)}catch(dk){console.log("Exception thrown from streamFactory.FactoryWithURL"+dk)}};cR.FactoryWithContent=function(dk,dg,dj,dp){function dm(){f(hlsStreamInfo,streamInfoBase,dg,dp);return new hlsStreamInfo(dj)}function dn(){f(dashStreamInfo,streamInfoBase,dg,dp);return new dashStreamInfo(dj)}function dl(){f(nonAdaptiveStream,streamInfoBase,dg,dp);return new nonAdaptiveStream(dj)}var dh;try{if("hls"===dk){dh=dm()}else{if("dash"===dk){dh=dn()}else{dh=dl()}}}catch(di){console.log("Exception thrown from streamFactory.FactoryWithContent "+di)}return dh};StreamTypeDetector=function(di,dh,dk,dp){function dg(e,dr,dq){console.log("Mime type method didn't work. Lets apply parsers one after another - Brute force");var ds=cR.FactoryWithContent("hls",e,dr,dq);if(!ds.isParsed){console.log("not a HLS stream");ds=cR.FactoryWithContent("dash",e,dr,dq);if(!ds.isParsed){console.log("not Dash either... Assuming Progressive download");ds=cR.FactoryWithContent("nonAdaptive",e,dr,dq)}}}try{if(!di||di===""){return streamError.Invalid_Stream}if(dk){var dm=RegExp(".m3u8");var dn=RegExp(".mpd");if(dm.exec(di)){console.log("Found m3u8 as an extension");cR.FactoryWithURL("hls",di,dp);return}else{if(dn.exec(di)){console.log("Found mpd as an extension");cR.FactoryWithURL("dash",di,dp);return}else{console.log("Couldn't find either m3u8 or Dash will try mime type");var dj=new XMLHttpRequest;console.log("To get mime type trying HEAD request");dj.open("HEAD",dj,true);if(dj.overrideMimeType){dj.overrideMimeType("text/xml")}dj.onreadystatechange=function(){if(this.readyState===this.DONE){var dq=this.getResponseHeader("content-type");var e=null;if("application/x-mpegURL"===dq||"vnd.apple.mpegURL"===dq){console.log("Rceived mime type is m3u8");e=cR.FactoryWithContent("hls",di,this.responseText,dp)}else{if("application/dash+xml"===dq){console.log("Rceived mime type is dash");e=cR.FactoryWithContent("dash",di,this.responseText,dp)}else{dg(di,this.responseText,dp)}}}};dj.send(null)}}}else{dg(di,dh,dp)}return streamError.NoError}catch(dl){console.log("Exception thrown from StreamTypeDetector "+dl)}};fragmentState={Invalid:"Invalid",InPorgress:"InProgress",Completed:"Completed"};fragment=function(dg,e){this.id=dg;this.bitrate=e;this.timeStamp=(new Date).getTime();this.state=fragmentState.InPorgress;this.downloadTime=0;this.bytesDownloaded=0};streamFragments=function(){this.fragments={};this.fragmentId=0;this.downloadStarted=function(dg){var e=new fragment(this.fragmentId,dg);this.fragments[this.fragmentId.toString()]=e};this.cleanup=function(){for(var e in this.fragments){delete this.fragments[e]}};this.downloadCompleted=function(di,e){if(this.fragments[this.fragmentId.toString()]&&this.fragments[this.fragmentId.toString()].state!==fragmentState.Completed){var dh=this.fragments[this.fragmentId.toString()];var dg=(new Date).getTime();dh.downloadTime=dg-dh.timeStamp;dh.state=fragmentState.Completed;if(e){dh.bytesDownloaded=e;console.log("bytesDownloaded reported = "+e)}else{dh.bytesDownloaded=di*dh.downloadTime;console.log("bytesDownloaded not reported and calculated one is = "+dh.bytesDownloaded)}this.fragmentId++}}};hlsStream=function(){var dg=0;var e=new streamFragments;this.streamFragmentDownloadStarted=function(dh){e.downloadStarted(dh);if(dg!==dh){bX(dh)}};this.streamFragmentDownloadCompleted=function(dh){e.downloadCompleted(dh,0)};this.cleanupFragments=function(){e.cleanup()};this.getBandwidthFromFragments=function(){var dj=0;var dh=0;for(index in e.fragments){var di=e.fragments[index];if(di.state===fragmentState.Completed&&di.bytesDownloaded){dj+=di.bytesDownloaded;dh+=di.downloadTime}}if(dh===0){return 0}return dj/dh}};var bG="";var dc=function(){if(typeof akamaiBCVideoObject!="undefined"){try{var dh=document.getElementsByTagName("script");var dk=0;var dg="";if(dh.length){for(dk=0;dk<dh.length;dk++){if(dh[dk].src!=null&&(dh[dk].src.indexOf("79423.analytics.edgesuite.net")!=-1||dh[dk].src.indexOf("79423.analytics.edgekey.net")!=-1)){bG=dh[dk].src;dg=K("configPath",dh[dk].src);if(dg!=""){aD.url=dg}}}}}catch(dm){}}else{if(cz&&cz.configPath){aD.url=cz.configPath;aG.objectBased=true}else{aD.url=AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH}}try{if(window){var dp=null;if(bH()){dp=K("AkamaiAnalytics_configPath",window.parent.location);if(dp){aD.url=dp}}else{dp=K("AkamaiAnalytics_configPath",window.location);if(dp){aD.url=dp}}}}catch(dm){}if(aD.url){var dn=parseInt(K("enableGenericAPI",aD.url));if(dn==1){aG.objectBased=true}aD.beaconSent=parseInt(K("beaconSentNotify",aD.url));var dj=parseInt(K("setVideoObject",aD.url));if(dj==1){aG.videoPassed=true}var dl=parseInt(K("subscribeVideo",aD.url));if(dl==1){aG.videoPassed=true}var di=parseInt(K("exception",aD.url));if(di==1){N.printException=true}N.configURLCsmaDebug=parseInt(K("debug",aD.url))}}();function bH(){var dl=false;try{if(window!==window.parent){var dh={};var di={};var dg=document.URL;var dk=null;if(document&&document.referrer){dk=document.referrer}if(dg!=null){cc(dg,dh)}if(dk!=null){cc(dk,di)}if(dh.port===di.port&&dh.protocol===di.protocol&&dh.hostName===di.hostName){dl=true}}else{dl=true}}catch(dj){}return dl}try{if(window){if(bH()){N.pageURLCsmaDebug=parseInt(K("AkamaiAnalytics_debug",window.parent.location))}else{N.pageURLCsmaDebug=parseInt(K("AkamaiAnalytics_debug",window.location))}}}catch(cb){}try{if(typeof akamaiBCVideoObject!="undefined"&&typeof brightcovePerforceVersion!="undefined"){bh("std:pluginVersion","Brightcove-"+brightcovePerforceVersion)}}catch(cb){bK("Exception,  pluginVersion: "+cb)}function cT(){var dl=false;try{var dh=document.URL;var di=/(\w+):\/\/([^\/:]+):?([^\/]+)?(\/[^#?]*)#?([^?]+)?\??(.+)?/;var dg=di.exec(dh);var dk=dg[1];if(dk=="https"){dl=true}}catch(dj){}return dl}function aV(){if(N.windowOpened){return}if(N.pageURLCsmaDebug==1||N.configURLCsmaDebug==1||N.configDebug==1){if(typeof AkamaiAnalytics_debugWindow_available=="function"&&AkamaiAnalytics_debugWindow_available()=="1"){return}var e="JS-"+bV;if(w!=null&&bR!=null){e=e+":"+w+"-"+bR}if("pluginVersion"in Y){e=e+":"+Y.pluginVersion}AkamaiAnalytics_debugWindow_data={version:e};if(cT()){s("https://79423.analytics.edgekey.net/csma/debug/DebugWindow.js","AkamaiAnalytics_debug");cY(m,"https://79423.analytics.edgekey.net/plugins/release-details/latest/html5.xml",false,true)}else{s("http://79423.analytics.edgesuite.net/csma/debug/DebugWindow.js","AkamaiAnalytics_debug");cY(m,"http://79423.analytics.edgesuite.net/plugins/release-details/latest/html5.xml",false,true)}N.windowOpened=true;ac()}}aV();function ac(){try{var dg=aD.url.toLowerCase();var di="";if(dg.indexOf(".edgesuite.net/")==-1&&dg.indexOf(".edgekey.net/")==-1){di="Incorrect Beacon XML Path";di+="<ul style='list-style-type:circle;margin:0'>";di+="<li>We have identified that the Beacon XML in not loaded from an Akamai Domain.</li>";di+="<li>Kindly use the same Beacon XML path that is provided in SOLA Anlaytics UI while provisioning.</li></ul>";bK(di,"ERROR")}}catch(dh){}}function bS(){try{var dh=o.beaconUrl.toLowerCase();var di="";if(dh.indexOf(".edgesuite.net/")==-1&&dh.indexOf(".edgekey.net/")==-1){di="Beacons sent to incorrect domain : "+dh;di+="<ul style='list-style-type:circle;margin:0'>";di+="<li>We have identified that the beacons are not sent to an Akamai Domain.</li>";di+="<li>Kindly use the proper Beacon XML path that is provided in SOLA Anlaytics UI while provisioning.</li></ul>";bK(di,"ERROR")}}catch(dg){}}function a0(){try{var dg="";for(var di in cv){if(cv[di]){if(!(di in bf)){if(dg){dg+=", "+di}else{dg=di}}}}if(dg){dg="Following dimensons have not being set : "+dg;dg+="<ul style='list-style-type:circle;margin:0'>";dg+="<li>Please refer 'Set Custom Data' section in Integration guide for more details.</li></ul>";bK(dg,"INTEGRATION")}}catch(dh){}}function m(dw){try{var di=dw.readyState;var dA=dw.status;if(di==4&&dA==200){var dh=dw.responseXML;if(dh){var dr;if(dh.documentElement){dr=dh.documentElement}else{dr=dh}if(dr){var ds=document.getElementsByTagName("script");var dC=0;var dv=false;var dm="";var dy="";if(typeof akamaiBCVideoObject!="undefined"){if(bG){dv=true;dy=bG}}else{if(l){dv=U(l);dy=l}else{if(ds.length){for(dC=0;dC<ds.length;dC++){if(ds[dC].src!=null){var dB=ds[dC].src;dv=U(dB);if(dv){dy=dB;break}}}}}}var dk="";var dt=null;if(typeof akamaiBCVideoObject!="undefined"){dk=dr.getElementsByTagName("brightcove")[0]}else{dk=dr.getElementsByTagName("plugin")[0];if(w!=null){dt=dr.getElementsByTagName(w)[0]}}if(dk){var dH=dk.getAttribute("name");var dl=dk.getAttribute("version");var dp=dk.getAttribute("link");var dx=dk.getAttribute("size");var dn=dk.getAttribute("date");var dz="";var dD="";var dj="";var dg="";var du="";if(dt){dj=dt.getAttribute("name");dD=dt.getAttribute("version");dg=dt.getAttribute("date");du=dt.getAttribute("link")}var dG=aG.objectBased==true?"JavaScript":dH;bK("Integration Type : "+dG,"INTEGRATION");if(dv){bK("Plugin path is correct ["+dy+"]","INTEGRATION")}else{dz="Incorrect Plugin Path";dz+="<ul style='list-style-type:circle;margin:0'>";dz+="<li>Kindly refer the Integration Guide and use the correct plugin path for integration</li>";dz+="<li>The plugin path should be one of the below :</li>";if(typeof akamaiBCVideoObject!="undefined"){dz+="<ul><li>http://79423.analytics.edgesuite.net/html5/brightcoveAkamaihtml5-min.js</li>";dz+="<li>https://79423.analytics.edgekey.net/html5/brightcoveAkamaihtml5-min.js</li></ul>"}else{dz+="<ul><li>http://79423.analytics.edgekey.net/html5/akamaihtml5-min.js</li>";dz+="<li>http://79423.analytics.edgekey.net/js/csma.js</li></ul>"}dz+="</ul>";bK(dz,"ERROR")}var dF=cg(bV,dl);if(dF>=0){bK("Plugin is Latest (Version = "+bV+" )","INTEGRATION")}else{dz="Old Plugin Version";dz+="<ul style='list-style-type:circle;margin:0'>";dz+="<li>Current Plugin Version is "+bV+"</li>";dz+="<li>The latest plugin version in "+dl+" which was released on date "+dn+"</li>";dz+="<li>Kindly check if proper path mentioned in integration guide is used for integration</li>";dz+="<li>If proper path is used, try by clearing browser cache.</li>";bK(dz,"ERROR")}if(dD===bR){bK(dj+" is Latest (Version = "+w+"-"+bR+" )","INTEGRATION")}else{if(w!=null){var dq="Old "+dj+" (Version = "+bR+") is used. ";dq+="<p>The latest "+dj+" version is "+dD+" which was released on "+dg+". </p>";dq+="<p>Kindly download the latest "+dj+" JS from the below location and use it instead. </p>";dq+="<p>"+du+"</p>";bK(dq,"ERROR")}}}}}}}catch(dE){}}function U(e){if(e.indexOf("79423.analytics.edgesuite.net")!=-1||e.indexOf("79423.analytics.edgekey.net")!=-1){if(e.indexOf("/html5/akamaihtml5-min.js")!=-1||e.indexOf("/js/csma.js")!=-1||e.indexOf("/js/brightcove-csma.js")!=-1){return true}}return false}function cg(dg,dm){try{var dj=0;if(dg!=null&&dm!=null){var dk=dg.split(".");var dh=dm.split(".");while(dk.length>dh.length){dh.push(0)}while(dh.length>dk.length){dk.push(0)}for(var di=0;di<dk.length;di++){if(parseInt(dk[di])>parseInt(dh[di])){dj=1;break}if(parseInt(dk[di])<parseInt(dh[di])){dj=-1;break}}}}catch(dl){}return dj}function cx(di,dg,e){var dh;if(Z){dh=new XDomainRequest;dh.onload=function(){bK("XML Request : xmlClient.onload");di("4","200",dh.responseText)};dh.onerror=function(dj){bK("Error, ais request")};dh.open("GET",dg,e);dh.send(null)}else{dh=new XMLHttpRequest;dh.responseType="json";dh.open("GET",dg,e);if(dh.overrideMimeType){dh.overrideMimeType("application/json")}dh.onreadystatechange=function(){di(dh.readyState,dh.status,dh.responseText)};dh.send(null)}}function cY(di,e,dh,dg){if(aT){}else{aU(di,e,dh,dg)}}function aU(dl,dg,dk,di){if(dl){bK("XML Request: isXDomainRequest = "+Z+":::funcCallback =  :url: "+dg)}var dj;if(dg==null||dg=="undefined"||dg==""){return}try{if(Z){dj=new XDomainRequest;if(dl){dj.onprogress=function(){};dj.ontimeout=function(){};dj.onload=function(){bK("XML Request : xmlClient.onload");if(window.DOMParser){var dp=new DOMParser;var dn=dp.parseFromString(dj.responseText,"text/xml");var e={};e.status="200";e.readyState="4";e.responseXML=dn;e.responseText=dj.responseText;dl(e)}else{var dn=new ActiveXObject("Microsoft.XMLDOM");dn.async=false;dn.loadXML(dj.responseText);var e={};e.status="200";e.readyState="4";e.responseXML=dn;dl(e)}};dj.onerror=function(dn){bK("XML Request : Error, loading xml. url = :"+dg);if(dg.indexOf("serverIp")!=-1){ae=true}if(dg.indexOf("protocol-info")!=-1){c.fastTCPFailed=true}}}dj.open("GET",dg,!dk);try{if(di){setTimeout(function(){dj.send()},100)}else{dj.send(null)}}catch(dm){try{dj.send(null)}catch(dh){}}}else{dj=new XMLHttpRequest;dj.open("GET",dg,!dk);if(dl){if(dj.overrideMimeType){dj.overrideMimeType("text/xml")}dj.onreadystatechange=function(){bK("XML Request : xmlClient.onreadystatechange");dl(dj)}}dj.send(null)}}catch(dm){bK("Exception,  XML Request for url :"+dg+",Exception:"+dm)}}function av(du){var dC=du.readyState;var dz=du.status;bK("readConfig: readyState = "+dC+":::status = "+dz);try{if(dC==4&&dz==200){bc();var dx=du.responseXML;if(dx){var dt;if(dx.documentElement){dt=dx.documentElement}else{dt=dx}var dh=dt.getElementsByTagName("dataMetrics");for(var dG=0;dG<dh.length;++dG){var dK=dh[dG];var dq=dK.parentNode;var dg=dq.nodeName;by[dG]=dg;var dD=bD[dg]=[];var dy=dq.getAttribute("eventCode");if(dy){al[dg]=dy}var dM=dK.getElementsByTagName("data");for(var dJ=0;dJ<dM.length;++dJ){var dE=dM[dJ];dg=dE.getAttribute("name");var dB=dE.getAttribute("key");dy=dE.getAttribute("value");var dO=dE.getAttribute("sendOnce");var dN=dE.getAttribute("fallback");var dn=dE.getAttribute("size");var dF=dE.getAttribute("regExpJS");var dp=dE.getAttribute("expiry");var dl={};dl.name=dg;dl.key=dB;if(dg in cv){cv[dg]=true}else{if(dB.indexOf("_cd_")!=-1){cv[dg]=true}}if(dy){dl.value=dy}if(dO){dl.isSent=false;dl.sendOnce=dO}if(dN){dl.fallback=dN}if(dn){dl.size=dn}if(dF){dl.regExpJS=dF}if(dp){dl.expiryDuration=parseInt(parseInt(dp)/1440)}dD.push(dl)}}N.configDebug=parseInt(dt.getAttribute("debug"));if(N.configDebug!=1){N.configDebug=0}if(N.configDebug==1){aV()}if(dt.getElementsByTagName("isActive")[0]&&dt.getElementsByTagName("isActive")[0].childNodes[0]){ca=dt.getElementsByTagName("isActive")[0].childNodes[0].nodeValue}aW.beaconId=dt.getElementsByTagName("beaconId")[0].childNodes[0].nodeValue;aW.beaconVersion=dt.getElementsByTagName("beaconVersion")[0].childNodes[0].nodeValue;var dv=dt.getElementsByTagName("logTo")[0];o.logType=dv.getAttribute("logType");if(!o.logType){o.logType="relative"}o.logInterval=dv.getAttribute("logInterval")*1e3;if(!o.logInterval){o.loginterval=300*1e3}o.heartBeatInterval=dv.getAttribute("heartBeatInterval")*1e3;if(!o.heartBeatInterval){o.heartBeatInterval=60*1e3}o.secondaryLogTime=dv.getAttribute("secondaryLogTime")*1e3;if(!o.secondaryLogTime){o.secondaryLogTime=15*1e3}o.rebufferDurationOutlier=dv.getAttribute("rebufferDurationOutlier")*1e3;if(!o.rebufferDurationOutlier){o.rebufferDurationOutlier=600*1e3}o.isSessionWithRebufferLimit=dv.getAttribute("isSessionWithRebufferLimit");if(!o.isSessionWithRebufferLimit){o.isSessionWithRebufferLimit=500}o.fastTCPEnabled=dv.getAttribute("fastTCPEnabled");if(!o.fastTCPEnabled){o.fastTCPEnabled=0}if(o.fastTCPEnabled==1){c.fastTCPEnabled=true}o.aisRequestLimit=dv.getAttribute("aisRequestLimit");if(!o.aisRequestLimit){o.aisRequestLimit=3}if(b9){b9.aisRequestLimit=o.aisRequestLimit}o.aisRequestInterval=dv.getAttribute("aisRequestInterval")*1e3;if(!o.aisRequestInterval){o.aisRequestInterval=30*1e3}if(b9){b9.aisRequestInterval=o.aisRequestInterval}o.startupTimeOutlierLimit=dv.getAttribute("startupTimeOutlierLimit")*1e3;if(!o.startupTimeOutlierLimit){o.startupTimeOutlierLimit=600*1e3}o.visitTimeout=dv.getAttribute("visitTimeout")*60*1e3;if(!o.visitTimeout){o.visitTimeout=60*60*1e3}o.urlParamSeparator=dv.getAttribute("urlParamSeparator");if(!o.urlParamSeparator){o.urlParamSeparator="~"}o.encodedParamSeparator=dv.getAttribute("encodedParamSeparator");if(!o.encodedParamSeparator){o.encodedParamSeparator="*@*"}o.initBrowserCloseTime=dv.getAttribute("initBrowserCloseTime");if(!o.initBrowserCloseTime){o.initBrowserCloseTime=15*60*1e3}o.seekThreshold=dv.getAttribute("seekThreshold")*1e3;if(!o.seekThreshold){o.seekThreshold=2e3}var di=dv.getAttribute("delayTimer");if(di){bk.time=di}var dA=dv.getAttribute("disableDelay");if(dA==1){bk.enabled=false}var dk=dv.getElementsByTagName("host")[0].childNodes;if(dk.length>1){o.beaconUrl="";for(var dJ=0;dJ<dk.length;dJ++){o.beaconUrl+=dk[dJ].nodeValue}}else{o.beaconUrl=dv.getElementsByTagName("host")[0].childNodes[0].nodeValue}if(o.beaconUrl.indexOf("http://")==-1&&o.beaconUrl.indexOf("https://")==-1){o.beaconUrl="http://"+o.beaconUrl}o.beaconUrl+=dv.getElementsByTagName("path")[0].childNodes[0].nodeValue;o.maxLogLineLength=dv.getAttribute("maxLogLineLength");if(!o.maxLogLineLength){o.maxLogLineLength=2048}o.maxLogLineLength-=o.beaconUrl.length;o.logVersion="2.0";o.formatVersion="1.1";if(dv.getElementsByTagName("formatVersion")&&dv.getElementsByTagName("formatVersion")[0]&&dv.getElementsByTagName("formatVersion")[0].childNodes[0]){o.formatVersion=dv.getElementsByTagName("formatVersion")[0].childNodes[0].nodeValue}o.useKey=parseInt(dt.getElementsByTagName("statistics")[0].getAttribute("useKey"));var dP=dt.getElementsByTagName("feedback")[0];if(dP!=null&&dP!==""){bv.shouldSendFLine=true;bv.limit=dP.getAttribute("limit");if(!bv.limit){bv.limit=3}bv.socialShareLimit=dP.getAttribute("socialShareLimit");if(!bv.socialShareLimit){bv.socialShareLimit=1}}var dQ=dt.getElementsByTagName("security")[0];if(dQ!=null&&dQ!==""){var dH=dQ.getElementsByTagName("ViewerDiagnostics")[0];if(dH!=null&&dH!==""){aN.viewerDiagnostics={};var dj=dH.getElementsByTagName("salt")[0];if(dj!=null&&dj!==""){aN.viewerDiagnostics.salt={};var dr=dj.getAttribute("value");var ds=dj.getAttribute("version");if(dr!=null&&dr!==""){aN.viewerDiagnostics.salt.value=dr;aN.viewerDiagnosticsEnabled=true;if(ds!=null&&ds!==""){aN.viewerDiagnostics.salt.version=ds}aN.viewerDiagnostics.salt.bytes=dj.getAttribute("bytes")*2;if(!aN.viewerDiagnostics.salt.bytes){aN.viewerDiagnostics.salt.bytes=16*2}aN.viewerDiagnostics.salt.iterations=dj.getAttribute("iterations");if(!aN.viewerDiagnostics.salt.iterations){aN.viewerDiagnostics.salt.iterations=50}}else{aN.viewerDiagnosticsEnabled=false}}}}var dm=dt.getElementsByTagName("bucketInfo")[0];cu.bucketLength=dm.getElementsByTagName("bucketLength")[0].childNodes[0].nodeValue;cu.bucketCount=dm.getElementsByTagName("bucketCount")[0].childNodes[0].nodeValue;cD=true;for(var dI in bf){try{if(dI.substring(0,4)=="_cd_"){c1(dI)}}catch(dL){}}p();bt();bS();var dw=dt.getElementsByTagName("match");for(var dJ=0;dJ<dw.length;dJ++){match=dw[dJ];try{parentKey=match.parentNode.parentNode.getAttribute("name");if(!b3[parentKey]){b3[parentKey]={}}b3[parentKey][match.getAttribute("key")]={type:match.getAttribute("type"),name:match.getAttribute("name"),value:match.getAttribute("value")}}catch(dL){bK(dL)}}a9();O();aS()}}}catch(dL){bK("Exception,  readConfig :"+dL)}}function c1(e){var dh=bD.common;if(dh!=null){var dg={};dg.name=e;dg.key=e;dh.push(dg)}}function p(){try{var dg=bD.split;for(var dh=0;dh<dg.length;dh++){bP[dg[dh].name]=dg[dh].key}}catch(di){}}function a9(){var dj={};try{if(!b3.bitRateBucketTimes){b3.bitRateBucketTimes={};dj=b3.bitRateBucketTimes;dj.U={key:"U",type:"range"};dj.S={key:"S",max:1500,value:"max:1500",type:"range"};dj.Q={key:"Q",min:1500,max:2500,value:"min:1500;max:2500",type:"range"};dj.D={key:"D",min:2500,value:"min:2500",type:"range"}}else{var dl,di,dh;for(dh in b3.bitRateBucketTimes){dj=b3.bitRateBucketTimes[dh];if(dj){dj.key=dh;if(!dj.value){dj.category="first"}else{dl=dj.value;di=dl.split(";");for(var dg=0;dg<di.length;dg++){if(di[dg].indexOf("min:")!=-1){dj.min=parseInt(di[dg].split(":")[1])}else{if(di[dg].indexOf("max:")!=-1){dj.max=parseInt(di[dg].split(":")[1])}}}}}}}ch.bitRateBucketMap={};for(var dk in b3.bitRateBucketTimes){ch.bitRateBucketMap[dk]=0}}catch(dm){bK("Exception, find bit rate match rules :"+dm)}}function O(){bK("fillVideoWithConfig function");if(aG&&aG.akamai){var e=aG.akamai;e.populateMetricsFromConfiguration();if(e.isSLineSent){y(aG)}if(aN.viewerDiagnosticsEnabled){b4(e)}e.cdn=aM(e)}}function aS(){bK("sendStoredBeacons: number of beacons to be sent = "+cU.length);try{var dh=aG.akamai;while(cU.length>0){var dg=cU.shift();bK("readConfig: sending beacon event code = "+dg.code);dg.element.populateMetricsFromConfiguration();dg.element.xViewerId=ck.xViewerId;dg.element.xViewerIdVersion=ck.xViewerIdVersion;dg.element.cdn=aM(dg.element);b1(dg.element,dg.code,dg.synch)}}catch(di){bK("Exception,  sendStoredBeacons"+di)}}cY(av,aD.url,false,true);function aM(di){if(bf.cdn){return bf.cdn}else{try{for(key in b3.cdn){var dl=b3.cdn[key];if(dl&&dl.name&&dl.value){var dk=di[dl.name];var dg=dl.value.split(",");for(var dh=0;dh<dg.length;dh++){if(dk&&dk.indexOf(dg[dh].trim())!=-1){return key;break}}}}}catch(dj){bK("Exception Get CDN"+dj.message)}}}function aA(dh){var dg="";var e;if(dh.indexOf("://")!=-1){e=dh.indexOf("://");dh=dh.substring(e+3)}if(dh.indexOf("/")!=-1){e=dh.indexOf("/");if(dh.indexOf("?")!=-1){var di=dh.indexOf("?");e=e<di?e:di}dg=dh.substring(0,e)}else{if(dh.indexOf("?")!=-1){var e=dh.indexOf("?");dg=dh.substring(0,e)}else{dg=dh}}return dg}function ay(dk,dj,e,di){var dh=dk.currentState;var dg=dk.seekObject;if(di=="S"&&dg.seekStartStreamTime==-1){dg.seekStartEpochTime=dh.timeUpdateClockTime;dg.seekEndEpochTime=dj;dg.seekStartStreamTime=dh.timeUpdateStreamTime;dg.seekEndStreamTime=e}else{if(di=="S"&&dg.seekEndStreamTime==dh.timeUpdateStreamTime){dg.seekEndEpochTime=dj;dg.seekEndStreamTime=e}else{if(dg.seekStartStreamTime!=-1){dk.seekTime+=dg.seekEndEpochTime-dg.seekStartEpochTime;if(dk.seekIntervalsAsString!="-"){dk.seekIntervalsAsString+=","+dg.seekStartStreamTime+":"+dg.seekEndStreamTime}else{dk.seekIntervalsAsString=dg.seekStartStreamTime+":"+dg.seekEndStreamTime}if(dk.pauseSeekSession!="-"){dk.pauseSeekSession+=",S("+dg.seekStartStreamTime+":"+(dg.seekStartEpochTime-dk.startTimer)+"-"+dg.seekEndStreamTime+":"+(dg.seekEndEpochTime-dk.startTimer)+")"}else{dk.pauseSeekSession="S("+dg.seekStartStreamTime+":"+(dg.seekStartEpochTime-dk.startTimer)+"-"+dg.seekEndStreamTime+":"+(dg.seekEndEpochTime-dk.startTimer)+")"}++dk.seekCount;dk.seekObject={seekStartEpochTime:-1,seekEndEpochTime:-1,seekStartStreamTime:-1,seekEndStreamTime:-1}}}}}function V(dh,dg){bK("set RebufferSession : curTime = "+dg);try{var dj=Math.round(dg-dh.lastLogTime-dh.curRebufferTime);var dk=Math.round(dh.curRebufferTime);dh.currRebufferEndEpoch=Math.round(dg);dh.currRebufferStartEpoch=Math.round(dg-dk);if(dk>o.isSessionWithRebufferLimit){dh.isSessionWithRebuffer=1}if(dh.rebufferSession){dh.rebufferSession=dh.rebufferSession+";"+dj+":"+dk}else{dh.rebufferSession=dj+":"+dk}}catch(di){bK("Error, set RebufferSession"+di.message)}}function cE(dm,dg){var dj;var dl;if(dg=="B"){var dh="";if(dm.rebufferSession){var e=dm.rebufferSession.split(";");for(var di=0;di<e.length;di++){var dk=e[di].split(":");if(di==0){dh+="0:"+dk[1]}else{dh+=e[di]}if(di!=e.length-1){dh+=";"}}bK("newRebufferSession = "+dh);dm.rebufferSession=dh}dl=1;dj=0}else{dl=0;if(dm.lastRebufferEndEpoch>0){dj=dm.firstRebufferStartEpoch-dm.lastRebufferEndEpoch}else{dj=-1}}dm.rebufferSession=dl+":"+dj+";"+dm.rebufferSession;dm.lastRebufferEndEpoch=dm.currRebufferEndEpoch}function cr(dj,di){var dg=1;dj.rebufferSessionH=null;if(!dj.rebufferSessionArrayHLine||dj.rebufferSessionArrayHLine&&dj.rebufferSessionArrayHLine.length===0){return}while(dj.rebufferSessionArrayHLine[dg]&&di-dj.rebufferSessionArrayHLine[dg]>2*o.heartBeatInterval){dj.rebufferSessionArrayHLine.shift();dj.rebufferSessionArrayHLine.shift();if(dj.isSessionWithRebufferH==1){dj.sendIsSessionWithRebufferH=0;dj.isSessionWithRebufferH=null}}while(dj.rebufferSessionArrayHLine[dg]){var e=di-dj.rebufferSessionArrayHLine[dg-1];var dh=dj.rebufferSessionArrayHLine[dg]-dj.rebufferSessionArrayHLine[dg-1];if(dj.sendIsSessionWithRebufferH==1){if(dh>o.isSessionWithRebufferLimit){dj.isSessionWithRebufferH=1}}if(dj.rebufferSessionH){dj.rebufferSessionH=dj.rebufferSessionH+";"+e+":"+dh}else{dj.rebufferSessionH=e+":"+dh}dg=dg+2}dg=dg-1;if(dj.rebufferSessionArrayHLine[dg]){var e=di-dj.rebufferSessionArrayHLine[dg];if(dj.sendIsSessionWithRebufferH==1){if(e>o.isSessionWithRebufferLimit){dj.isSessionWithRebufferH=1}}if(dj.rebufferSessionH){dj.rebufferSessionH=dj.rebufferSessionH+";"+e+":"+e}else{dj.rebufferSessionH=e+":"+e}}}function cC(e){if(bf.deliveryType){return bf.deliveryType}else{return e.deliveryType}}function ce(dh){var e=dh.readyState;var dg=dh.status;if(parseInt(dg/100)===4||dg===0){bK("readServerIp: serverIpFailed request falied as status is ,in 400 series");ae=true}if(e==4&&dg==200){var dj=dh.responseXML;if(dj){var di;if(dj.documentElement){di=dj.documentElement}else{di=dj}if(bO){cA.serverip=di.getElementsByTagName("ip")[0].childNodes[0].nodeValue}else{cA.serverip=di.getElementsByTagName("serverip")[0].childNodes[0].nodeValue}bK("readServerIp : diagnostics.serverip =  "+cA.serverip)}}}function aj(e){var di=e.akamai;if(ae){bK("getting ServerIp : serverIp request failed");return}if(di.hostName){try{var dh=null;if(di.protocol){if(di.protocol.indexOf("rtmp")!=-1){dh="http://"+di.hostName+"/fcs/ident";bO=true}else{dh=di.protocol+"://"+di.hostName+"/serverip"}bK("getting ServerIp : serverIpPath = "+dh);cY(ce,dh,false,true)}}catch(dg){ae=true;bK("getting ServerIp: error, xmphttprequest")}}}function ai(dh){var dg="";var dj=dh.readyState;var di=dh.status;if(parseInt(di/100)===4||di===0){bK("read fast tcp: fast tcp Failed request falied as status is 400 series");c.fastTCPFailed=true}try{if(dj==4&&di==200){var dn=dh.responseXML;if(dn){bK("populating fast tcp");var dp;if(dn.documentElement){dp=dn.documentElement}else{dp=dn}if(dp&&dp.firstElementChild){var e=dp.firstElementChild;var dk="";var dm="";if(e){if(e.hasAttribute("key")){dm=e.getAttribute("key");dk=e.childNodes[0].nodeValue;dg=dm+":"+dk}while(e.nextElementSibling){e=e.nextElementSibling;if(e.hasAttribute("key")){dm=e.getAttribute("key");dk=e.childNodes[0].nodeValue;if(dg){dg+=","+dm+":"+dk}else{dg=dm+":"+dk}}}}}}}if(dg){c.ftcp=dg}}catch(dl){bK("Exception,  read fast tcp"+dl)}}function ct(e){var di=e.akamai;if(c.fastTCPFailed){bK("getting fast tcp: request failed");return}if(di.hostName){try{var dh=di.protocol+"://"+di.hostName+"/protocol-info";bK("getting fast tcp : fastTCPPath = "+dh);cY(ai,dh,false,true)}catch(dg){c.fastTCPFailed=true;bK("getting ServerIp: error, xmphttprequest")}}}function aR(dg,dj){try{var dh=dg.akamai;if(o&&o.logInterval&&!dj){dh.fastTCPServerIpTimer=bW(aR,o.logInterval,[dg])}if(!ae){aj(dg)}if(!c.fastTCPFailed&&c.fastTCPEnabled){ct(dg)}if(ae&&c.fastTCPFailed){bZ(dh.fastTCPServerIpTimer)}}catch(di){bK("Exception get fast tcp server ip")}}function bi(e){var dg=null;if(e.objectBased){if(e.errorReason){dg=e.errorReason}else{dg=cj[0]}}else{if(e.externalError){dg=e.externalError}else{if(e.error&&e.error.code){dg=cj[e.error.code]}else{dg=cj[0]}}}return dg}function ah(dg){var e="Play.End.Detected";if(dg.objectBased){if(dg.endReason){e=dg.endReason}}return e}function B(){ck.viewerId=bf.viewerId?bf.viewerId:null;ck.viewerDiagnosticsId=bf.viewerDiagnosticsId?bf.viewerDiagnosticsId:bf.viewerId?bf.viewerId:null}function d(dg){var e=de();return e}function aJ(dh){var dj=ck.viewerId;if(dj=="-"){return}if(!dj){try{if(window&&window.localStorage&&window.localStorage.getItem("akamai_clientId")){dj=window.localStorage.getItem("akamai_clientId")}else{try{dj=de();if(window&&window.localStorage){window.localStorage.setItem("akamai_clientId",dj)}}catch(dg){bK("window.localStorage Exception :"+dg)}}}catch(di){bK("Exception,  getting viewerId"+di);dj=de()}}return dj}function b4(dl,di){var dk=null;if(ck&&ck.viewerDiagnosticsId){dk=ck.viewerDiagnosticsId}var dg="";var dj=50;var e=16*2;if(!dk||dk=="-"){return}if(di&&dl.xViewerId){return}a1(dl);bK("get Viewer DiagnosticsID");dk=encodeURIComponent(dk);if(aN&&aN.viewerDiagnostics&&aN.viewerDiagnostics.salt&&aN.viewerDiagnostics.salt.value){dg=aN.viewerDiagnostics.salt.value}if(aN&&aN.viewerDiagnostics&&aN.viewerDiagnostics.salt&&aN.viewerDiagnostics.salt.iterations){dj=aN.viewerDiagnostics.salt.iterations}if(aN&&aN.viewerDiagnostics&&aN.viewerDiagnostics.salt&&aN.viewerDiagnostics.salt.bytes){e=aN.viewerDiagnostics.salt.bytes}var dh=bC.PBKDF2(dk,dg,{keySize:e/8,iterations:dj});dl.xViewerId=dh;ck.xViewerId=dh}function a1(dg){var e=null;if(aN&&aN.viewerDiagnostics&&aN.viewerDiagnostics.salt&&aN.viewerDiagnostics.salt.version){e=aN.viewerDiagnostics.salt.version}dg.xViewerIdVersion=e;ck.xViewerIdVersion=e}function cW(dh,di,dg){var e;if(di=="viewerId"||di=="clientId"||di=="viewerDiagnosticsId"){return}if(dg){if(bf[dg]){e=bf[dg]}else{if(dh[dg]){e=dh[dg]}}}dh[di]=e}this.getValueFromQueryString=function(){return K(key,searchURL)};function K(dh,dl,dj){if(dj==null){dj=""}try{if(dl==""||dl==null){return}dh=dh.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var di=new RegExp("[\\?&]"+dh+"=([^&#]*)");var dg=di.exec(dl);if(dg==null){return dj}else{return dg[1]}}catch(dk){bK("Exception,  getValueFromQueryString :"+dk);return dj}}function bT(e){var dg=e.akamai;bZ(dg.fastTCPServerIpTimer);if(a3){aR(e)}}function bW(di,dk,dh){try{var dg=null;dg=setTimeout(function(){di.apply(undefined,dh)},dk);return dg}catch(dj){bK("Exception, set window timeout:"+dj);try{dg=window.setTimeout(function(){di.apply(undefined,dh)},dk)}catch(dj){return null}return dg}}function bZ(dg){try{clearTimeout(dg)}catch(dh){bK("Exception clear window timeout:"+dh);try{window.clearTimeout(dg)}catch(dh){}}}function y(e){bK("startBeaconTImer");var dg=e.akamai;if(dg.areTimerStarted){return}bK("startBeaconTimer: starting beacon timer");dg.firstPLineTimer=bW(c9,o.secondaryLogTime,[e]);dg.hLineTimer=bW(c2,o.heartBeatInterval,[e]);dg.fastTCPServerIpTimer=bW(bT,o.logInterval-5e3,[e]);if(e.objectBased){L=500}dg.pollingTimer=bW(cL,L,[e]);dg.areTimerStarted=true}function bE(e){var dg=e.akamai;if(dg){if(dg.hLineTimer){bZ(dg.hLineTimer)}if(dg.pollingTimer){bZ(dg.pollingTimer)}if(dg.fastTCPServerIpTimer){bZ(dg.fastTCPServerIpTimer)}if(dg.firstPLineTimer){bZ(dg.firstPLineTimer)}if(b9&&b9.retryTimer){bZ(b9.retryTimer)}}}function c5(dg){var dj=dg.akamai;bv.akamai={};bv.dataSent={};dj.areTimerStarted=false;dj.isCLineSent=false;dj.isELineSent=false;dj.lastRebufferEndEpoch=0;dj.connectTime=0;bk.browserClose=false;dj.totalPlayClockTime=dj.totalStreamTime=dj.totalRebufferCount=dj.totalRebufferTime=0;dj.isVisitEnd=0;dj.sequenceId="0";dj.wasPutToSleep=false;dj.chasingSleep=null;dj.continuousRebufferDuration=0;aH(dg);dj.attemptId=dj.sessionId=d(dj);B();dj.clientId=dj.viewerId=aJ(dj);if(aN.viewerDiagnosticsEnabled){b4(dj)}dj.lastPLineSentTime=dj.hLineSentCount=dj.lastSLineSentTime=dj.lastHLineSentTime=0;dj.lastHTime=0;X("HTML_LastCLineTime");bL=[0,0,0,0,0,0,0,0,0,0,0,0];var dk=parseInt(E("HTML_VisitCountCookie"));if(!dk||dk==""){dj.isVisitStart=1;dk=0;bn("HTML_VisitCountCookie",dk)}var dl=parseInt(E("HTML_isPlayingCount"));if(!dl||dl==""){dl=0;bn("HTML_isPlayingCount",dl)}var e=E("HTML_VisitValueCookie");if(!e||e==""){bn("HTML_VisitValueCookie","0|0|0|0|0|0|0|0|0|0|0|0|0")}var di=E("HTML_BitRateBucketCsv");if(!di||di==""){bn("HTML_BitRateBucketCsv","0,0,0,0,0,0,0,0")}var dh=E(cn);if(!dh||dh==""){dj.browserSessionId=dj.visitId=de();bn(cn,dj.visitId)}else{dj.browserSessionId=dj.visitId=E(cn)}}function G(e,di){var dh=e.akamai;dh.isILineSent=true;++dh.iLineCount;dh.lastSLineSentTime=di;if(dh.iLineCount==1){var dj=parseInt(E("HTML_VisitCountCookie"));++dj;bn("HTML_VisitCountCookie",dj);g=di}var dg=parseInt(E("HTML_VisitIntervalStartTime"));if(!dg||dg==" "){dg=di;bn("HTML_VisitIntervalStartTime",dg)}bL[0]=1;dh.sendVLine=true}function at(dk,dj){try{var di=aG.akamai;if(di.clearVisitTimeoutId){bZ(di.clearVisitTimeoutId)}c5(aG);di.logInterval="0";if(!cD){var dh=cQ(di);var dg={element:dh,code:"init",synch:dk};cU.push(dg)}else{b1(di,"init",dk)}di.lastLogTime=dj;++di.sequenceId;G(aG,dj);di.currentState.state=cB.init;bK(": sendBeaconILineAd : Setting state to init");di.currentState.timeUpdateClockTime=dj;di.startTimer=dj}catch(dl){bK("Exception, send I line AD:"+dl)}}function c9(e){var dh=b5();var dg=e.akamai;dg.lastPLineSentTime=dh;u(e,"playing",false,dh)}function v(dn,dq,dj,di){try{bK("start of the session function");var dl=dn.akamai;if(!dl||!dl.firstTimePlay){return}if(dl.adLoadTime&&dl.adLoadTime>dl.iLineSentTime){dl.startupTime=dl.adLoadTime-dl.iLineSentTime;if(dl.adEndTime){dl.startupTime+=dj-dl.adEndTime}}else{dl.startupTime=dj-dl.iLineSentTime}if(dl.startupTime>o.startupTimeOutlierLimit){dl.outlierStartupTime=dl.startupTime;dl.startupTime=0}dl.bufferingTime=dl.startupTime;var dp={type:"startup",startTime:0,endTime:dl.startupTime};aH(dn);var dh=C(dn);cc(dh,dl);dl.streamUrl=dh;if(dh!=null&&dh.indexOf("?")!=-1){dh=dh.substring(0,dh.indexOf("?"))}if(dh!=null&&dh!=""){if(/.m3u8$/.exec(dh)){dl.format="L";dl.playerFormat=dl.playerType+":"+dl.format}else{dl.format="P";dl.playerFormat=dl.playerType+":"+dl.format;dl.deliveryType="O"}console.log("Creating hls stream");dl.stream=new hlsStream}var dk=StreamTypeDetector(dh,ap,c6,function(e){if(e){console.log("detected stream type = "+e.getStreamType());console.log("Received steam type = "+e.getStreamType()+"\n Stream URL = "+e.getStreamURL()+"\n Stream Name = "+e.getStreamName()+"\n Stream Length = "+e.getStreamLength()+"\n Stream Format = "+e.getStreamFormat()+"\n Stream Delivery Type = "+e.getDeliveryType());dl.streamUrl=e.getStreamURL();dl.format=e.getStreamFormat();dl.deliveryType=e.getDeliveryType();if(e.getStreamLength()){dl.streamLength=e.getStreamLength()}dl.streamName=e.getStreamName()}});if(dk!==streamError.NoError){console.log("failed to detect stream. May be we do not have sufficient information")}dl.streamLength=parseInt(H(dn));dl.played=[];var dg=parseInt(E("HTML_isPlayingCount"));dg=dg+1;bn("HTML_isPlayingCount",dg);B();if(aN.viewerDiagnosticsEnabled){b4(dl,true)}dl.lastSLineSentTime=dj;u(dn,"playStart",false,dj);dl.rebufferSessionArrayHLine=[];dl.isSLineSent=true;if(cD){y(dn)}bL[1]=1;dl.isFirstTitle=null;dl.isVisitStart=null;dl.firstTimePlay=false;dl.initPlayed(di)}catch(dm){bK("Exception, send S line:"+dm)}}function c0(dg,dj,di){try{bK("send beacon I line");var dh=dg.akamai;dh.cdn=aM(dh);if(a3){aR(dg,true)}if(!dh.iLineSentTime){dh.iLineSentTime=di}if(dg.videoWidth&&dg.videoHeight){dh.videoSize=dg.videoWidth+"x"+dg.videoHeight}if(!dh.isILineSent){c5(dg);u(dg,"init",dj,di);G(dg,di);if(dh.clearVisitTimeoutId){bZ(dh.clearVisitTimeoutId)}}}catch(dk){bK("Exception send I line:"+dk)}}function c2(e){var dh=e.akamai;dh.hLineTimer=bW(c2,o.heartBeatInterval,[e]);var dg=b5();u(e,"heartBeat",false,dg);dh.lastHLineSentTime=dg;dh.hLineSentCount++;if(dh.hLineSentCount%(o.logInterval/o.heartBeatInterval)==0){u(e,"playing",false,dg);dh.lastPLineSentTime=dg;if(dh.continuousRebufferDuration>=o.rebufferDurationOutlier){if(aG.objectBased){aG.errorReason="Error.Continous.Rebuffer";T(aG)}else{akamaiHandleError("Error.Continous.Rebuffer")}}}}function bI(dg,dk,dj,di){try{bK("sendBeaconCLine : endReasonCode = "+dk);var dh=dg.akamai;dh.endReasonCode=dk;u(dg,"complete",dj,di);var dn=parseInt(E("HTML_isPlayingCount"));dn=dn-1;bn("HTML_isPlayingCount",dn);dh.isVisitStart=null;dh.isCLineSent=true;dh.firstTimePlay=true;bE(dg);var dm=di;bn("HTML_LastCLineTime",dm)}catch(dl){bK("Exception, send beacon C Line:"+dl)}}function h(dg,dm,dj,di){try{var dh=dg.akamai;if(dm){dh.errorCode=dm}else{dh.errorCode="UNKNOWN"}bK("sendBeaconELine : errorCode = "+dh.errorCode);bL[3]=1;if(dh.sequenceId==1){bL[11]=1;B();if(aN.viewerDiagnosticsEnabled){b4(dh,true)}}dh.playerState="E";u(dg,"error",dj,di);if(dh.isSLineSent){var dn=parseInt(E("HTML_isPlayingCount"));dn=dn-1;bn("HTML_isPlayingCount",dn)}dh.isELineSent=true;dh.isVisitStart=null;dh.firstTimePlay=true;bE(dg);var dl=di;cp(dh);bn("HTML_LastCLineTime",dl)}catch(dk){bK("Exception, send beacon E line:"+dk)}}function ao(dg,dk){try{bK("sendBeaconVLine");var dj=dg.akamai;dj.isVisitEnd=1;q(dj);var dh=parseInt(E("HTML_VisitIntervalStartTime"));dj.visitMaxPersistentBitRateBucket=ci();dj.visitInterval=dk-dh;if(dh==""||dh==null||isNaN(dh)){dj.visitInterval=dk-g}dj.sessionId=null;dj.attemptId=null;dj.sequenceId=null;X("HTML_BitRateBucketCsv");X("HTML_VisitValueCookie");X("HTML_VisitIntervalStartTime");X("HTML_LastCLineTime");X("HTML_VisitCountCookie");X("HTML_isPlayingCount");X(cn);u(dg,"visit",true,dk);bv.akamai={};bv.dataSent={};bK("sendBeaconVLine: beacon sent");dj.sendVLine=false;dj.iLineCount=0;bZ(dg.akamai.clearVisitTimeoutId);var di=dj.isPlaylist;dg.akamai=new a6(aG);if(typeof akamaiBCVideoObject!="undefined"){dg.akamai.isPlaylist=di}}catch(dl){bK("Exception, send beacon V line:"+dl)}}function ad(){var e=E("HTML_VisitValueCookie");var dj=e.split("|");var dk;for(var dh=0;dh<bL.length;dh++){F[dh]+=bL[dh]}bK("setVisitValueCookie :: visit values saved"+F);for(var di=0;di<dj.length;di++){dj[di]=parseInt(dj[di])+bL[di]}var dg=dj.join("|");bn("HTML_VisitValueCookie",dg)}function be(){try{var dj=E("HTML_BitRateBucketCsv");var dk=aB.split(",");var dg=dj.split(",");var dh=0;for(var di in ch.bitRatePlayTime){di=parseInt(di);dh=parseInt((di-1)/5e5);if(dh>7){dh=7}dg[dh]=parseInt(dg[dh])+ch.bitRatePlayTime[di];dk[dh]=parseInt(dk[dh])+ch.bitRatePlayTime[di]}dj=dg.join(",");bn("HTML_BitRateBucketCsv",dj);aB=dk.join(",")}catch(dl){bK("Exception set bit rate bucketcsv"+dl)}}function co(e){bK("entered setVisitValueParameters");bL[4]=e.totalPlayClockTime;bL[5]=e.totalPlayStreamTime;bL[6]=e.totalRebufferCount;bL[7]=e.totalRebufferTime;bL[8]=e.totalAdPlayClockTime;bL[9]=e.totalAdStartCount;bL[10]=e.totalAdAbandonCount;if(e.totalPlayClockTime>5e3){bL[2]=1}be();ad()}function q(di){try{var dn=E("HTML_VisitValueCookie");var dg=dn.split("|");var dk=true;if(dg==""||dg==null){dk=false}var dp;var dm=[];if(dk){dm=dg}else{dm=F}var dl=["visitAttempts","visitPlays","visitViews","visitErrors","visitPlayClockTime","visitPlayStreamTime","visitRebufferCount","visitRebufferTime","visitAdPlayClockTime","visitAdStartCount","visitAdAbandonCount","visitStartupErrors"];for(var dh=0;dh<dl.length;dh++){di[dl[dh]]=dm[dh]}}catch(dj){bK("Exception get visit value  cookie : "+dj)}}function ci(){try{var dk=E("HTML_BitRateBucketCsv");var dh=dk.split(",");var dg=false;if(dh==null||dh==""){dh=aB.split(",")}dh[0]=parseInt(dh[0]);var dm="00",di=dh[0];for(var dj=0;dj<dh.length;dj++){dh[dj]=parseInt(dh[dj]);if(dh[dj]>0){dg=true}if(di<dh[dj]){di=dh[dj];dm="0"+dj}}if(dg){return dm}}catch(dl){bK("Exception, get visit max bit rate bucket"+dl)}}function bo(di){try{var dg=encodeURI(di);dg=dg.replace(/#/g,"%23");return dg}catch(dh){bK("Exception,  encoding beacon");return di}}function bg(){try{bK("send delayed beacon");if(bk.queue&&bk.queue.length>0){var dg=bk.queue.shift();bk.timer=bW(bg,bk.time,[]);bK("sending delayed beacon ::"+dg.url,"BEACON");cY(null,dg.url,dg.isSync)}else{bK("send delayed beacon : clear the timer");bZ(bk.timer);bk.timer=null}}catch(dh){}}function aC(dk,dj,di){if(ca==0){bK("put beacon On Wire, dont send beacon isACtive is zero");return}var e=o.beaconUrl+"?"+dk;try{if(bk.enabled){var dh={};if(bk.browserClose){if(bk.timer){bZ(bk.timer)}if(bk.queue&&bk.queue.length>0){while(bk.queue.length>0){dh=bk.queue.shift();bK("put beacon on wire, send beacon from queue::"+dh.url,"BEACON");cY(null,dh.url,dh.isSync)}}bK("put beacon on wire browser close::"+e,"BEACON");cY(null,e,dj)}else{bK("put beacon on wire pushing beacon in queue::"+e);dh.url=e;dh.isSync=dj;bk.queue.push(dh);if(bk.timer){bK("put beacon on wire: timer is running")}else{bK("put beacon on wire: call send delayed beacon");bg()}}}else{bK("put beacon on wire"+e,"BEACON");cY(null,e,dj)}}catch(dg){bK("failed to send beacon");bK(dg)}}function cP(dg,dh){try{dg=dg.substring(0,dh);return dg}catch(di){bK("Exception,  getTruncatedMetric"+di);return dg}}function da(dm,dk,dg,dl){try{var di;for(var dj=0;dj<dk.length;dj++){if(dk[dj].expiryDuration){c7(dm,dk[dj])}di=dk[dj].name;var dh=null;if(di in dm){dh=dm[di]}if(dk[dj].value){dh=dk[dj].value}if(dh||dh==0){if(dk[dj].sendOnce){if(dk[dj].isSent===false){if(dh!=0){dk[dj].isSent=true}j(dh,dk,di,dj,dl,dg)}}else{j(dh,dk,di,dj,dl,dg)}}}}catch(dn){bK("Exception, assemble logs:"+dn)}}function j(dm,dn,dh,dj,dg,dk){try{if(dn[dj].regExpJS){var dp=new RegExp(dn[dj].regExpJS);var di=dp.exec(dm);if(di){dm=di[di.length-1]}}}catch(dl){bK("Exception,  evaluating regExpJS attribute for metric : "+dh)}dm=String(dm).replace(/~/g,o.encodedParamSeparator);if(dn[dj].size){dm=cP(dm,dn[dj].size)}if(dn[dj].key in dg){}else{dg[dn[dj].key]=dn[dj].key;dk.push((o.useKey?dn[dj].key:dh)+"="+dm)}}function b1(dr,dm,dl){try{bK("getBeaconStrings : eventCode =  "+dm);var dj=bD.common;var dC=[];var dq=bD[dm];if(dq==null||dq=="undefined"){bK("getbeaconstrings, return as eventmetrics undefined");return}var dv=[];var dB={};if(!dr.eventCode){dr.eventCode=al[dm]}da(dr,dj,dC,dB);if(dm=="error"){dr.updateTerminateMetrics();co(dr,bL)}if(dm=="complete"){dr.updateTerminateMetrics();var dg=bD.playing;co(dr,bL);da(dr,dg,dv,dB)}da(dr,dq,dv,dB);var du=dC.join(o.urlParamSeparator);du=bo(du);var dz=0;try{for(var dx in bP){if(o.useKey){dz+=bP[dx].length+3+o.urlParamSeparator.length}else{dz+=dx.length+3+o.urlParamSeparator.length}}}catch(dA){dz=12}dz--;var dp=o.maxLogLineLength-dz-du.length-3-o.beaconUrl.length;if(dp<=0){dp=4780-dz-du.length-3-o.beaconUrl.length}var dw=[];var dt="";if(dp>0){if(dv.length>0){var dy;var dh="";var dk="";for(dy=0;dy<dv.length;dy++){dk=bo(dv[dy]);if(dk.length>=dp){dw.push(dk)}else{if(dh.length+dk.length<=dp){if(dh){dh+=o.urlParamSeparator+dk}else{dh=dk}}else{dw.push(dh);dh=""}}}if(dh!=""){dw.push(dh)}}var di=dw.length;if(di>1){for(var ds=1;ds<=di;++ds){dt=du+o.urlParamSeparator;dt+=(o.useKey?bP.partNumber:"partNumber")+"="+ds+o.urlParamSeparator;dt+=(o.useKey?bP.totalParts:"totalParts")+"="+di+o.urlParamSeparator;dt+=dw[ds-1];dt+=o.urlParamSeparator;if(bD[dm]){aC(dt,dl,dr)}}}else{dt=du+o.urlParamSeparator+dw[0]+o.urlParamSeparator;aC(dt,dl,dr)}}else{var dn=dv.join(o.urlParamSeparator);dn=bo(dn);dt=du+o.urlParamSeparator+dn+o.urlParamSeparator;if(bD[dm]){aC(dt,dl,dr)}}}catch(dA){bK("Exception, get beacon Strings:"+dA)}}function cp(e){bv.fLineCount=0;var dg=cQ(e);bv.akamai=dg;bv.akamai.customDataPopulated=false}function x(){try{var dk="socialShare:";var dg=dk.length;var dh=bv.socialSharingObj;for(var di in bf){if(di.indexOf(dk)!=-1){if(di in bv.dataSent){if(bv.dataSent[di].count<bv.socialShareLimit){++bv.dataSent[di].count;if(dh==null){dh[di.substring(dg)]=bf[di]}else{if(di.substring(dg)in dh){dh[di.substring(dg)]=parseInt(dh[di.substring(dg)])+parseInt(bf[di])}else{dh[di.substring(dg)]=bf[di]}}}}else{bv.dataSent[di]={};bv.dataSent[di].value=bf[di];bv.dataSent[di].count=1;dh[di.substring(dg)]=bf[di]}delete bf[di]}}bv.socialSharingObj=dh}catch(dj){bK("Exception,  getFeedbackObj"+dj);bv.socialSharing=null}}function db(dh){try{var dj=null;if(bv.socialSharingObj!=null){for(var dg in bv.socialSharingObj){if(dj==null){dj=dg+":"+bv.socialSharingObj[dg]+","}else{dj+=dg+":"+bv.socialSharingObj[dg]+","}}}if(dj!=null){dh.socialSharing=dj.substring(0,dj.length-1)}}catch(di){bK("Exception,  getFeedbackData"+di);dh.socialSharing=null}bv.socialSharingObj={}}function bN(di){try{for(var dh in bD){if(bD[dh]){for(var dg=0;dg<bD[dh].length;dg++){if(bD[dh][dg].fallback&&!bf[bD[dh][dg].name]){cW(di,bD[dh][dg].name,bD[dh][dg].fallback)}}}}}catch(dj){}}function a5(dh){try{var dg=Y.streamName?Y.streamName:dh.streamName}catch(di){}try{if(bf.title){dh.title=bf.title}else{dh.title=bf.eventName?bf.eventName:dg}if(bf.eventName){dh.eventName=bf.eventName}else{dh.eventName=bf.title?bf.title:dg}}catch(di){bK("Exception,  getting title and eventName, "+di)}}function ba(dl,dp,di,dg){bK("updating metrics for playing and end events");var dk=dl.akamai;var dm=0;var dn=dk.playerState;var dh=true;dk.currentStreamTime=parseInt(aE(dl));switch(dk.currentState.state){case cB.playing:dk.playerState="PL";if(dp-dk.seekTime>0){dk.updatePlayClockTime(dp-dk.seekTime,dk.currentState.lastEventClockTime,di)}if(dk.playClockTime<0){dk.playClockTime=0}dk.updatePlayed(dk.currentStreamTime);break;case cB.pause:dk.pauseDuration+=dp;dk.playerState="PS";break;case cB.rebuffering:if(!dk.wasPutToSleep){dk.rebufferTime+=dp;dk.curRebufferTime+=dp;V(dk,di);dk.playerState="B";dm=di-dk.curRebufferTime;break}case cB.resumeBuffering:dk.playerState="RB";dk.resumeBufferTime+=dp;break;case cB.ended:dk.updatePlayed(dk.currentStreamTime);break;case cB.seek:if(di-dk.currentState.timeUpdateClockTime>0){ay(dk,di,dk.currentStreamTime,"S")}dk.currentState.timeUpdateClockTime=di;dk.playerState="SK";break;default:dh=false;break}if(dk.playerState==="B"){dk.continuousRebufferDuration+=dk.curRebufferTime}else{dk.continuousRebufferDuration=0}ch.getTransitionSession(dk);ay(dk);if(dk.rebufferSession){cE(dk,dn);dk.firstRebufferStartEpoch=dm}if(dk.playClockTime>5e3){dk.isView=1}if(dh){dk.currentState.lastEventClockTime=di}dk.bytesLoaded=cf(dl);if(dk.played){var e=dk.played;dk.playStreamTime=0;for(var dj=0;dj<e.length;dj++){dk.playStreamTime+=parseInt(e[dj][1]-e[dj][0])}if(dk.logType=="R"){dk.playStreamTime-=dk.lastPlayStreamTime;dk.lastPlayStreamTime+=dk.playStreamTime}}if(dg&&dk.endReasonCode!="Browser.Close"&&!dk.streamTitleSwitchReason){dk.playerState="E"}}function c4(di){try{var dg="-";if(document&&document.referrer){var dh=document.referrer;dh=dh.split("/",3);if(dh&&dh[2]){dg=dh[2]}}if(window==window.top){di.pageUrl=bf.pageUrl?bf.pageUrl:document.URL;di.pageHost=bf.pageUrl&&aA(bf.pageUrl)?aA(bf.pageUrl):document.location.hostname;di.pageReferrer=bf.pageReferrer?bf.pageReferrer:document.referrer?document.referrer:"-";di.pageReferrerHost=bf.pageReferrer&&aA(bf.pageReferrer)?aA(bf.pageReferrer):document.referrer?dg:"-"}else{di.pageUrl=bf.pageUrl?bf.pageUrl:document.referrer?document.referrer:"-";di.pageHost=bf.pageUrl&&aA(bf.pageUrl)?aA(bf.pageUrl):document.referrer?dg:"-";di.pageReferrer=bf.pageReferrer?bf.pageReferrer:"NA";di.pageReferrerHost=bf.pageReferrer&&aA(bf.pageReferrer)?aA(bf.pageReferrer):"NA"}}catch(dj){}}function a4(dh){try{var dg;for(dg in Y){if(dg!="viewerId"&&dg!="clientId"&&dg!="viewerDiagnosticsId"&&dg!="pluginVersion"){dh[dg]=Y[dg]}}if("pluginVersion"in Y){dh.pluginVersion=bV+":"+Y.pluginVersion}}catch(di){}}function cG(dj,di){bK("populate custom data, eventCode = "+di);try{c4(dj);dj.deliveryType=cC(dj);dj.device=bf.device?bf.device:aY;if(di=="playing"||di=="complete"||di=="feedback"||di=="error"){db(dj);if((dj.socialSharing==null||dj.socialSharing=="")&&di=="feedback"&&!dj.customDataChanged){--bv.fLineCount;return}}var dh;for(dh in bf){if(dh!="viewerId"&&dh!="clientId"&&dh!="viewerDiagnosticsId"){if(!(dh in cm)){dj[dh]=bf[dh]}}}if(b9&&b9.akamai){for(var dg in b9.akamai){dj[dg]=b9.akamai[dg]}}a5(dj);dj.cdn=aM(dj)}catch(dk){bK("Exception,  populate Custom Data , "+dk)}}function u(dp,dl,dn,dj){try{bK("sendBeacon: eventCode = "+dl+", clocktime = "+dj);var dk=dp.akamai;var ds=dj-dk.currentState.lastEventClockTime;if(dl!="init"){dk.logInterval=dk.lastLogTime<=0?"0":(dj-dk.lastLogTime)/1e3}else{dk.logInterval="0"}if(!dk.customDataPopulated){cG(dk,dl)}dk.serverIp=cA.serverip?cA.serverip:"-";dk.fastTCP=c.ftcp?c.ftcp:"-";dk.eventCode=al[dl];if(dk.hLineSentCount>0){dk.lastHTime=(dj-dk.lastHLineSentTime)/1e3}else{dk.lastHTime=(dj-dk.lastSLineSentTime)/1e3}if(dl=="heartBeat"){var dr=dk.logInterval;dk.logInterval=(dj-dk.lastPLineSentTime)/1e3;cr(dk,dj)}if(dk.logInterval<0){dk.logInterval="0"}var di=false;if(dl=="complete"){dl="playing";di=true}dk.endOfStream=di?"1":"0";dk.currentClockTime=dj-dk.startTimer;dk.currentStreamTime=parseInt(aE(dp));if(dl=="playing"&&!dk.playEndMetricsUpdated){if(di){cr(dk,dj)}bK("send Beacon, updating play and end metrics");ba(dp,ds,dj,di);aH(dp)}if(!dk.customDataPopulated){bN(dk)}a4(dk);if(!cD){var dq=cQ(dk);var dg={element:dq,code:di?"complete":dl,synch:dn};cU.push(dg);if(dl=="playing"||dl=="playStart"){dk.clearRelativeMetrics()}if(dl!="heartBeat"){bK("send beacon :configurationPopulated false sequenceId = "+dk.sequenceId);++dk.sequenceId;dk.lastLogTime=dj}else{dk.logInterval=dr}return}if(dl=="playStart"){a0()}dk.populateMetricsFromConfiguration();dk.xViewerId=ck.xViewerId;dk.xViewerIdVersion=ck.xViewerIdVersion;if(typeof akaMediaAnalytics!="undefined"&&akaMediaAnalytics!=null){var dh=akaMediaAnalytics.getStream();if(dh){dk.bandwidth=dh.getBandwidthFromFragments();bK("reporting bandwidth = "+dk.bandwidth);dh.cleanupFragments()}}if(di){b1(dk,"complete",dn)}else{b1(dk,dl,dn)}dk.qualityOfExperience=null;di=false;if(dl=="playing"||dl=="playStart"){dk.clearRelativeMetrics()}if(dl!="heartBeat"){++dk.sequenceId;dk.lastLogTime=dj}else{dk.logInterval=dr}}catch(dm){bK("Exception, send beacon:"+dm)}}function cQ(dh,dj){var dj=dj||{};try{for(var dg in dh){if(typeof dh[dg]==="object"&&dh[dg]){dj[dg]=dh[dg].constructor===Array?[]:{};cQ(dh[dg],dj[dg])}else{dj[dg]=dh[dg]}}return dj}catch(di){}}this.logMessage=function(dg,e){bK(dg,e)};function bK(dk,dh){try{if(N.configURLCsmaDebug==1||N.pageURLCsmaDebug==1||N.configDebug==1){try{if(N.printException){if(dk.indexOf("Exception")!=-1){dh="ERROR"}}}catch(dj){}try{W(dk,dh)}catch(dg){}try{console.log(dk)}catch(dg){}}else{if(!cD){var di={message:dk,msgType:dh};z.push(di)}}}catch(dg){}}function W(dh,e){if(e==null||e==""){e="TRACE"}if(dh==null||dh==""){return}if(typeof AkamaiAnalytics_debugWindow_available=="function"&&AkamaiAnalytics_debugWindow_available()=="1"){AkamaiAnalytics_debugWindow_appendLog(dh,e)}else{var dg={message:dh,msgType:e};z.push(dg)}}function bt(){try{if(N.configURLCsmaDebug==1||N.pageURLCsmaDebug==1||N.configDebug==1){if(N.logStoredMsg){if(typeof AkamaiAnalytics_debugWindow_available=="function"&&AkamaiAnalytics_debugWindow_available()=="1"){if(N.logTimer){bZ(N.logTimer)}N.logStoredMsg=false;if(z.length){for(var dg=0;dg<z.length;dg++){bK(z[dg].message,z[dg].msgType)}z=[]}}else{N.logTimer=bW(bt,1e3,[])}}}}catch(dh){}}var bj,a,af;var cn="AkamaiAnalytics_BrowserSessionId";var bF=null;var aI=null;var b0=null;var cJ=null;var cS=null;var aY=null;var bm=null;if(navigator&&navigator.userAgent){bm=navigator.userAgent}function cw(){if(navigator&&navigator.userAgent){try{var e=navigator.userAgent;var dj=/\((\w+)/;var dh=dj.exec(e);aI=dh[1].toLowerCase();if(e.indexOf("Xbox")!=-1){aI="Xbox"}else{if(aI.indexOf("compatible")!=-1||aI.indexOf("windows")!=-1||aI.indexOf("mobile")!=-1){aI="Windows"}else{if(aI.indexOf("x11")!=-1){aI="Linux"}else{if(aI.indexOf("macintosh")!=-1||aI.indexOf("mac os")!=-1||aI.indexOf("macos")!=-1){aI="Mac OS"}else{if(aI.indexOf("ipad")!=-1){aI="iPad"}else{if(aI.indexOf("iphone")!=-1){aI="iPhone"}else{if(aI.indexOf("ipod")!=-1){aI="iOS"}else{if(e.indexOf("Android")!=-1){aI="Android"}else{if(e.indexOf("PlayStation 4")!=-1){aI="PlayStation 4"}else{if(e.indexOf("PLAYSTATION 3")!=-1){aI="PlayStation 3"}else{aI="Others"}}}}}}}}}}}catch(di){bK("Exception,  finding Osname");aI="Others"}b0=aI;try{dj=/(NT|Phone|OS X|Linux|CPU.*?OS) ([0-9\._]+)/;dh=dj.exec(e);if(dh&&dh.length>2){cS=dh[2]?dh[2]:"";if(cS){b0+=" "+cS}var dg=null;if(aI=="Windows"){dg=a7(cS);aI=aI+" "+dg}}}catch(di){bK("Exception,  OSVersion"+di)}}}function a7(dg){var dh=null;if(dg){if(dg=="6.3"||dg=="6.2"){dh="8"}else{if(dg=="6.1"){dh="7"}else{if(dg=="6.0"){dh="Vista"}else{if(dg=="5.2"||dg=="5.1"){dh="XP"}else{var e=dg.split(".");if(parseInt(e[0])>=8){dh=e[0]}else{dh="Other"}}}}}}return dh}function P(){if(navigator&&navigator.userAgent){var e=navigator.userAgent;var dk=/(MSIE|Chrome|Version|Firefox)[ \/]([0-9]+)/;try{var dh=dk.exec(e);bF=dh[1];if(dh[1]=="Version"){dk=/(Opera|Safari)/;var dm=dk.exec(e);bF=dm[1]}}catch(dj){bK("Exception,  browserName"+dj)}try{bK("browser version = "+dh[2]);var dg=e.indexOf("Edge");if(dg!=-1){uagentLength=e.length;var dl=e.substr(dg,uagentLength-dg);var di=dl.split("/");bF=di[0];cJ=di[1]}else{cJ=dh[2]}if(bF&&cJ){bF=bF+" "+cJ}}catch(dj){bK("Exception,  browserVersion"+dj)}}}function bM(){if(navigator&&navigator.userAgent){try{var dg=navigator.userAgent;dg=dg.toLowerCase();if(dg.indexOf("ipad")!=-1){aY="iPad"}else{if(dg.indexOf("ipod")!=-1){aY="iPod"}else{if(dg.indexOf("iphone")!=-1){aY="iPhone"}else{if(dg.indexOf("android")!=-1){aY="Android Device"}else{if(dg.indexOf("xbox")!=-1){aY="Xbox"}else{if(dg.indexOf("macintosh")!=-1||dg.indexOf("windows")!=-1||dg.indexOf("compatible")!=-1){aY="Desktop"}else{if(dg.indexOf("playstation 4")!=-1){aY="PlayStation 4"}else{if(dg.indexOf("playstation 3")!=-1){aY="PlayStation 3"}else{aY="Others"}}}}}}}}}catch(dh){bK("Exception,  getitng device name : "+dh);aY="Others"}}}cw();P();bM();var cB={ended:0,init:1,playing:2,pause:3,seek:4,rebuffering:5,resumeBuffering:6};function cM(dg){try{switch(dg){case cB.ended:return"ended";break;case cB.init:return"init";break;case cB.playing:return"playing";break;case cB.pause:return"pause";break;case cB.seek:return"seek";break;case cB.rebuffering:return"rebuffering";break;case cB.resumeBuffering:return"resumeBuffering";break;default:return"undefined";break}}catch(dh){}}var bL=[0,0,0,0,0,0,0,0,0,0,0,0];var F=[0,0,0,0,0,0,0,0,0,0,0,0];var g;var aB="0,0,0,0,0,0,0,0";function a6(e){if(e&&e.customMetrics){for(var dg in e.customMetrics){if(!(dg in cm)){this[dg]=e.customMetrics[dg]}}}this.userAgent=bm;this.playerType="HTML5";if(w!=null&&bR!=null){this.pluginVersion="JS-"+bV+":"+w+"-"+bR}else{if(aG.objectBased){this.pluginVersion="JS-"+bV}else{this.pluginVersion="HTML5-"+bV}}this.os=aI;this.fullOs=b0;this.osVersion=cS;this.browser=bF;this.browserVersion=cJ;this.browserSize=window.innerWidth+"x"+window.innerHeight;this.rebufferCount=0;this.bytesLoadedCallback=0;this.lastBytesLoaded=0;this.currRebufferEndEpoch=0;this.totalPlayClockTime=0;this.totalPlayStreamTime=0;this.totalRebufferCount=0;this.totalRebufferTime=0;this.totalPauseCount=0;this.totalPauseDuration=0;this.totalSeekCount=0;this.totalSeekTime=0;this.totalResumeBufferCount=0;this.totalResumeBufferTime=0;this.totalAdPlayClockTime=0;this.totalAdStartCount=0;this.totalAdAbandonCount=0;this.updateTerminateMetrics=function(){try{if(this.playClockTime){this.totalPlayClockTime+=parseInt(this.playClockTime)}if(this.playStreamTime){this.totalPlayStreamTime+=parseInt(this.playStreamTime)}if(this.rebufferCount){this.totalRebufferCount+=parseInt(this.rebufferCount)}if(this.rebufferTime){this.totalRebufferTime+=parseInt(this.rebufferTime)}if(this.pauseCount){this.totalPauseCount+=parseInt(this.pauseCount)}if(this.pauseDuration){this.totalPauseDuration+=parseInt(this.pauseDuration)}if(this.seekCount){this.totalSeekCount+=parseInt(this.seekCount)}if(this.seekTime){this.totalSeekTime+=parseInt(this.seekTime)}if(this.resumeBufferCount){this.totalResumeBufferCount+=parseInt(this.resumeBufferCount)}if(this.resumeBufferTime){this.totalResumeBufferTime+=parseInt(this.resumeBufferTime)}if(this.adPlayClockTime){this.totalAdPlayClockTime+=parseInt(this.adPlayClockTime)}if(this.adCount){this.totalAdStartCount+=parseInt(this.adCount)}if(this.adAbandonCount){this.totalAdAbandonCount+=parseInt(this.adAbandonCount)}var dh=b5();this.startupAbondonWaitTime=dh;this.playInterval=dh}catch(di){bK("Unable to update cumulative metrics")}};this.clearRelativeMetrics=function(){var dh=["rebufferCount","rebufferTime","playClockTime","playStreamTime","seekCount","seekTime","pauseCount","pauseDuration","resumeBufferCount","resumeBufferTime","averagedBitRate","transitionUpSwitchCount","transitionDownSwitchCount","rebufferSession","curRebufferTime","adCount","adPlayClockTime","adStartupTime","adAbandonCount","adPauseTime"];this.updateTerminateMetrics();for(var di=0;di<dh.length;++di){this[dh[di]]=0}this.pauseIntervalsAsString="-";this.seekIntervalsAsString="-";this.pauseSeekSession="-";this.transitionStreamTimeSession="-";this.socialSharing=null;this.adSession=null;bv.socialSharing=null;bv.socialSharingObj={};ch.bitRateArr=[];delete this.rebufferSession};this.populateMetricsFromConfiguration=function(){this.beaconId=aW.beaconId;this.beaconVersion=aW.beaconVersion;this.logType=o.logType=="relative"?"R":"C";this.logVersion=o.logVersion;this.startupTimeOutlierLimit=o.startupTimeOutlierLimit;this.formatVersion=o.formatVersion;this.bucketCount=cu.bucketCount;this.bucketLength=cu.bucketLength;for(var di in bD){if(bD[di]){for(var dh=0;dh<bD[di].length;dh++){if(bD[di][dh].value){this[bD[di][dh].name]=bD[di][dh].value}}}}};this.initPlayed=function(dh){this.played.push([dh,dh]);this.playingIndex=0};this.updatePlayClockTime=function(di,dh,dj){this.playClockTime+=di;ch.updateBitRateArr(di)};this.updatePlayed=function(dh,dk){var dj=this.played;if(!dj){return}for(var di=0;di<dj.length;di++){}for(var di=this.playingIndex;di<dj.length&&dh>dj[di][0];di++){}if(di!=this.playingIndex){dj[this.playingIndex][1]=Math.max(dh,dj[di-1][1]);dj.splice(this.playingIndex+1,di-this.playingIndex-1)}else{dj[this.playingIndex][1]=Math.max(dh,dj[this.playingIndex][1])}if(dk==null){return}for(di=0;di<dj.length;di++){if(dj[di][0]<=dk&&dj[di][1]>=dk){this.playingIndex=di;return}else{if(di+1<dj.length&&dj[di][1]<dk&&dj[di+1][0]>dk){di++;this.playingIndex=di;dj.splice(di,0,[dk,dk]);return}}}if(di==dj.length){dj.push([dk,dk]);this.playingIndex=di}};this.isVisitEnd=0;this.sequenceId="0";this.isSLineSent=false;this.sendVLine=false;this.played=[];this.iLineCount=0;this.isPlaylist=false;this.isFirstTitle=1;this.currentState={state:cB.ended,lastEventClockTime:0,pauseStartStreamTime:0,pauseStartClockTime:0,timeUpdateStreamTime:0,timeUpdateClockTime:0,pollingTimerStreamTime:0,seekStartStreamPos:0};this.seekObject={seekStartEpochTime:-1,seekEndEpochTime:-1,seekStartStreamTime:-1,seekEndStreamTime:-1};this.clearRelativeMetrics();bK("value of configurationPopulated"+cD);if(cD){this.populateMetricsFromConfiguration()}this.loadStartILine=false;this.canPlayUpdated=false;this.canPlayEventAutoPlay=true;this.format="P";this.playerFormat=this.playerType+":"+this.format;this.deliveryType="O";this.firstTimeProgress=true;this.firstTimePlay=true;this.isILineSent=false;this.seekFrom=0;this.lastPlayStreamTime=0;this.lastPlayLogTime=0;this.lastLogTime=0;this.curRebufferTime=0;this.sendIsSessionWithRebufferH=1}aG.akamai=new a6(aG);function cI(){try{var dh,dg;for(dh in bD){if(bD[dh]){for(dg=0;dg<bD[dh].length;dg++){if(bD[dh][dg].isSent&&bD[dh][dg].isSent===true){bD[dh][dg].isSent=false}}}}}catch(di){}}function bb(dk){bK("endOfTheSession");var dj=dk.akamai;var dl=dj.isPlaylist;var dh=dj.visitId;var e=dj.viewerId;var di=dj.streamName;var dn=dj.cdn;var dm=dj.sendVLine;var dg=dj.iLineCount;dk.akamai=null;cI();dj=dk.akamai=new a6(dk);dj.visitId=dj.browserSessionId=dh;dj.viewerId=dj.clientId=e;dj.cdn=dn;aL=-1;dj.streamName=di;dj.iLineCount=dg;dk.akamai.clearVisitTimeoutId=bW(cV,o.visitTimeout,[dk,1]);dj.sendVLine=dm;dj.isPlaylist=dl;if(dk.played){dk.played.length=0}ch.clearBitRate()}function bA(){try{if(this.readyState==4&&this.status==200&&this.responseText){var dl=this.akamai;var dg=this.responseText.split("\n");var dn="";var dk=/PROGRAM-ID=(\d+)/;var dh,di;if(dg){for(di=0;di<dg.length;di++){if(dh=dk.exec(dg[di])){if(dh[1]==dn){break}else{dn=dh[1]}}}if(di!=dg.length){dl.format="L";dl.playerFormat=dl.playerType+":"+dl.format}}dk=/^#EXT((INF)|(-X-STREAM-INF))[^\n]*\n([^\n]*)\n/m;bK("Checking");if(dh=dk.exec(this.responseText)){bK("Checking done "+dh[4]);if(/.m3u8$/.exec(dh[4])){try{var dj=new XMLHttpRequest;dj.open("GET",dh[4],true);dj.onreadystatechange=function(){console.log("current content type from stream url is = "+this.getResponseHeader("content-type"));if(this.readyState==4&&this.status==200){if(this.responseText){if(/^#EXT-X-ENDLIST/m.exec(this.responseText)){dl.deliveryType="O"}}}};if(dj.overrideMimeType){dj.overrideMimeType("text/plain")}dj.send(null)}catch(dm){bK("parsePlaylist, Exception,  parsing play list, "+dm)}}else{if(/^#EXT-X-ENDLIST/m.exec(this.responseText)){dl.deliveryType="O"}}}}}catch(dm){bK("Exception,  parsePlaylist : "+dm)}}var cj=["UNKNOWN","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"];function bY(e){if(cl&&cl.dataset&&cl.dataset.isad&&cl.dataset.isad=="true"){return true}else{return false}}function b7(dh,dg,dk,dj){if(dg=="playing"){cy=[]}var di={};di.eventType=dg;di.eventTime=dj;if(dk){di.streamUrl=dk}if(dg=="error"){di.errorCode=bi(dh)}if(cy&&cy.length>0){var e=cy[cy.length-1];if(e.eventType==di.eventType&&e.streamUrl==di.streamUrl){if(dg=="error"){e.errorCode=di.errorCode}e.eventTime=di.eventTime}else{cy.push(di)}}else{cy.push(di)}}function R(dg,dn,dm,di){try{var dl=false;if(cy.length>0){var dh=cy[cy.length-1];bK("check error events array, previous event is : "+dh.eventType);if(dh.eventType=="error"&&dm==dh.streamUrl){if(dn=="error"){var dk=bi(dg);if(dh.errorCode==dk){dl=true}else{dl=false}dh.eventTime=di;dh.errorCode=dk}else{if(dn=="play"&&dh.eventTime&&di-dh.eventTime<=2e3){dl=true}}}}}catch(dj){bK("Exception,  checkErrorEventsArray"+dj);dl=false}return dl}function bB(dh){if(bY(dh)){bK("handle Seeking Event : video tag is of type AD, return");return}try{var dj=b5();var dg=parseInt(aE(dh));var dl=dh.akamai;var di=dl.currentState;var dp=dj-di.lastEventClockTime;var dk=dj-dl.startTimer;var dm=di.state;if(di.state==cB.playing){dl.updatePlayClockTime(dp,di.lastEventClockTime,dj)}if(dl.isPlaylist&&di.state==cB.ended&&dl.browser=="Safari"){}di.lastEventClockTime=dj}catch(dn){bK("Exception,  handle Seeking Event : "+dn)}}function ab(dh,dj,dg){if(bY(dh)){bK("handle Seeked Event : video tag is of type AD, return");return}try{if(!dj){dj=b5()}if(!dg){dg=parseInt(aE(dh))}var dl=dh.akamai;var di=dl.currentState;var dp=dj-di.lastEventClockTime;var dk=dj-dl.startTimer;var dm=di.state;bK("entered function handle Seeked Event, currentstate = "+cM(di.state));if(dm==cB.pause||dm==cB.playing||dm==cB.rebuffering||di.state==cB.seek){if(dj-di.timeUpdateClockTime>0){ay(dl,dj,dg,"S")}switch(dm){case cB.playing:dl.updatePlayed(di.timeUpdateStreamTime,dg);di.lastEventClockTime=dj;dl.updatePlayClockTime(dp,di.lastEventClockTime,dj);di.state=cB.seek;di.seekStartStreamPos=dg;break;case cB.rebuffering:if(!dl.wasPutToSleep){bK("handle seeked event, previous state is rebuffering");dl.rebufferTime+=dp;dl.curRebufferTime+=dp;if(dl.rebufferSessionArrayHLine){dl.rebufferSessionArrayHLine.push(dj)}try{V(dl,dj);dl.curRebufferTime=0}catch(dn){bK("Error...Play"+dn.message)}di.lastEventClockTime=dj;di.state=cB.seek}else{bK("Rejecting this event, because rebuffer was caused by system sleep")}break}}}catch(dn){bK("Exception,  handle Seeked Event :"+dn)}}function ag(dh,dq){if(bY(dh)){bK("handlePauseEvent : video tag is of type AD, return");return}try{bK("entered function handle Pause Event");var dj=b5(dq);var dg=parseInt(aE(dh));var dn=dh.akamai;var di=dn.currentState;var dk=H(dh);if(dn.firstTimePlay||di.state==cB.pause){return}if(dk&&dk!=0&&dg&&dg!=0){if(Math.abs(dk-dg)<1e3){return}}var dr=dj-di.lastEventClockTime;var dl=dj-dn.startTimer;var dm=di.state;switch(dm){case cB.playing:dn.updatePlayClockTime(dr,di.lastEventClockTime,dj);++dn.pauseCount;ay(dn,dj,dg,"P");if(dn.pauseSeekSession!="-"){dn.pauseSeekSession+=",P("+dg+":"+dl+")"}else{dn.pauseSeekSession="P("+dg+":"+dl+")"}dn.updatePlayed(dg);break;case cB.rebuffering:if(!dn.chasingSleep){++dn.pauseCount;ay(dn,dj,dg,"P");if(dn.pauseSeekSession!="-"){dn.pauseSeekSession+=",P("+dg+":"+dl+")"}else{dn.pauseSeekSession="P("+dg+":"+dl+")"}dn.rebufferTime+=dr;dn.curRebufferTime+=dr;if(dn.rebufferSessionArrayHLine){bK("handlePauseEvent : pushing, rebufferSessionArrayHLine");dn.rebufferSessionArrayHLine.push(dj)}try{V(dn,dj);dn.curRebufferTime=0}catch(dp){bK("Error...Pause"+dp.message)}}break}di.state=cB.pause;di.pauseStartStreamTime=dg;di.pauseStartClockTime=dj;di.lastEventClockTime=dj}catch(dp){bK("Exception,  handlePauseEvent : "+dp)}}function bX(di,dh){try{if(aG&&aG.akamai){bK("handle bit rate switch");try{di=parseInt(di)}catch(dl){bK("Exception,bit rate to int :"+dl);return}if(isNaN(di)){bK("handle bitrate swtich, bite rate isNaN")}var dk=aG.akamai;var dj=dk.currentState;var dg=aE(aG);if(ch.currentBitRate!="-"){if(di>ch.currentBitRate){dk.transitionUpSwitchCount++}else{if(di<ch.currentBitRate){dk.transitionDownSwitchCount++}}}if(dj&&dj.state==cB.playing){k(aG,dh)}ch.currentBitRate=di;ch.currentStartPos=dg}}catch(dl){bK("Exception, handle bit rate switch:"+dl)}}function aw(di,dp){if(bY(di)){bK("handle Play Event : video tag is of type AD, return");return}try{var dl=b5(dp);var dt=C(di);if(di.akamai&&di.akamai.postRollTimer){bK("handle play event: send the C line without changing set data");bZ(di.akamai.postRollTimer);delete di.akamai.postRollTimer;ar(di,dl)}if(!di.objectBased&&!dt){bK("handle play event, video is null");return}if(R(di,"play",dt,dl)){bK("handle play Event: play is thrown after error, return, curTime = "+dl);return}b7(di,"play",dt,dl);var dr=di.akamai;var dh=parseInt(aE(di));var dj=dr.currentState;var du=dl-dj.lastEventClockTime;var dn=dl-dr.startTimer;var dq=dj.state;bK("entered function handle Play Event, current state = "+cM(dj.state));switch(dq){case cB.ended:cc(dt,dr);dr.streamUrl=dt;dr.startTimer=dl;dr.streamLength=parseInt(H(di));if(dt!=null&&dt.indexOf("?")!=-1){dt=dt.substring(0,dt.indexOf("?"))}if(dt!=null&&dt!=""&&/.m3u8$/.exec(dt)){dr.format="L";dr.playerFormat=dr.playerType+":"+dr.format;dr.deliveryType="L";try{var dk=new XMLHttpRequest;dk.akamai=dr;dk.open("GET",dt,true);dk.onreadystatechange=bA;if(dk.overrideMimeType){dk.overrideMimeType("text/plain")}dk.send(null)}catch(ds){bK("handleplayEvent, Exception,  parsing play list, "+ds)}}aL=-1;c0(di,false,dl);dr.currentState.state=cB.init;bK(dl+": handlePlayBackEvent : Setting state to init");dr.currentState.timeUpdateClockTime=dl;dr.currentState.timeUpdateStreamTime=0;dr.currentState.lastEventClockTime=dl;dr.isPlaylist=true;var dg=C(di);var dm=StreamTypeDetector(dg,ap,c6,function(e){if(e){console.log("detected stream type = "+e.getStreamType());console.log("Received steam type = "+e.getStreamType()+"\n Stream URL = "+e.getStreamURL()+"\n Stream Name = "+e.getStreamName()+"\n Stream Length = "+e.getStreamLength()+"\n Stream Format = "+e.getStreamFormat()+"\n Stream Delivery Type = "+e.getDeliveryType());dr.streamUrl=e.getStreamURL();dr.format=e.getStreamFormat();dr.deliveryType=e.getDeliveryType();if(e.getStreamLength()){dr.streamLength=e.getStreamLength()}dr.streamName=e.getStreamName()}});if(dm!==streamError.NoError){console.log("failed to detect stream. May be we do not have sufficient information")}break;case cB.pause:dr.pauseDuration+=du;if(dr.pauseIntervalsAsString!="-"){dr.pauseIntervalsAsString+=","+dj.pauseStartStreamTime+":"+(dl-dj.pauseStartClockTime)}else{dr.pauseIntervalsAsString=dj.pauseStartStreamTime+":"+(dl-dj.pauseStartClockTime)}if(dr.pauseSeekSession!="-"){dr.pauseSeekSession+=",R("+dj.pauseStartStreamTime+":"+dn+")"}else{dr.pauseSeekSession="R("+dj.pauseStartStreamTime+":"+dn+")"}dr.updatePlayed(dj.pauseStartStreamTime,dh);dr.currentState.lastEventClockTime=dl;++dr.resumeBufferCount;dj.state=cB.resumeBuffering;break;case cB.init:if(!dr.iLineSentTime){dr.iLineSentTime=dl}if(dr.loadStartILine&&!dr.canPlayEventAutoPlay&&!dr.canPlayUpdated){dr.iLineSentTime=dl;dr.canPlayUpdated=true}break}}catch(ds){bK("Exception,  handle Play Event:"+ds)}}function k(di,dg){if(bY(di)){bK("handle Playing Event : video tag is of type AD, return");return}try{var dk=b5(dg);var dq=C(aG);if(!di.objectBased&&!dq){bK("handle playing event, video is null");return}b7(di,"playing",dq,dk);var dh=parseInt(aE(di));var dn=di.akamai;var dj=dn.currentState;var dr=dk-dj.lastEventClockTime;var dl=dk-dn.startTimer;var dm=dj.state;bK("entered function handle Playing Event, current State = "+cM(dj.state));switch(dm){case cB.rebuffering:if(!dn.wasPutToSleep){dn.rebufferTime+=dr;dn.curRebufferTime+=dr;dn.continuousRebufferDuration=0;if(dn.rebufferSessionArrayHLine){dn.rebufferSessionArrayHLine.push(dk)}try{V(dn,dk);dn.curRebufferTime=0}catch(dp){bK("Error...Play"+dp.message)}}break;case cB.pause:case cB.resumeBuffering:dn.resumeBufferTime+=dr;if(dr==0&&dn.resumeBufferCount>0){--dn.resumeBufferCount}break;case cB.init:v(di,dr,dk,dh);ch.currentStartPos=dh;break;case cB.ended:bK("handle Playing Event : dispatch play and playing event");aw(di,dk);k(di,dk);break;case cB.playing:dn.updatePlayClockTime(dr,dj.lastEventClockTime,dk);break;case cB.seek:if(dk-dj.timeUpdateClockTime>0){ay(dn,dk,dh,"S");dn.updatePlayed(dj.seekStartStreamPos,dh)}break}dj.state=cB.playing;dj.lastEventClockTime=dk}catch(dp){bK("Exception,  handle Playing Event:"+dp)}}function I(di,dh){if(bY(di)){bK("handleWaitingEvent : video tag is of type AD, return");return}try{var dn=di.akamai;if(dn.currentState.state==cB.rebuffering){bK("already inside handleWaiting Event");return}var dk=b5(dh);var dg=parseInt(aE(di));var dj=dn.currentState;var dq=dk-dj.lastEventClockTime;var dl=dk-dn.startTimer;var dm=dj.state;bK("entered function handle Waiting Event, current state = "+cM(dj.state));switch(dm){case cB.playing:dn.updatePlayClockTime(dq,dj.lastEventClockTime,dk);++dn.rebufferCount;if(dn.rebufferCount==1&&dn.playerState!="B"){dn.firstRebufferStartEpoch=Math.round(dk)}if(dn.rebufferSessionArrayHLine){bK("handleWaitingEvent : pushing, rebufferSessionArrayHLine"+dk);dn.rebufferSessionArrayHLine.push(dk)}dn.updatePlayed(dg);dj.state=cB.rebuffering;break;case cB.pause:++dn.resumeBufferCount;dj.state=cB.resumeBuffering;break;case cB.init:break}dj.lastEventClockTime=dk;bK("handle waiting event, if seek starts, stream pos = "+dg);dj.seekStartStreamPos=dg}catch(dp){bK("Exception,  handleWaitingEvent:"+dp)}}function t(e){if(bY(e)){bK("handleAbortEvent : video tag is of type AD, return");return}T(e)}function T(dh){if(bY(dh)){bK("handle Error Event : video tag is of type AD, return");return}try{var dj=b5();var dr=C(dh);var dq=bi(dh);if(!dh.objectBased&&!dr){bK("handle error event, video is null");return}if(R(dh,"error",dr,dj)){bK("handle Error Event: consecutive error events thrown, return, curTime = "+dj);return}if(dh&&dh.akamai&&!dh.akamai.isILineSent){bK("handle Error Event: calling handle Play Event");aw(dh,dj)}b7(dh,"error",dr,dj);var dg=parseInt(aE(dh));var dm=dh.akamai;var di=dm.currentState;var ds=dj-di.lastEventClockTime;var dk=dj-dm.startTimer;var dl=di.state;bK("entered function handle Error Event, current state = "+cM(di.state));if(di.state==cB.playing){dm.updatePlayClockTime(ds,di.lastEventClockTime,dj)}if(dm.isELineSent||dm.isCLineSent){return}h(dh,dq,dj);di.state=cB.ended;var dp=parseInt(E("HTML_LastCLineTime"));bb(dh);di.lastEventClockTime=dj}catch(dn){bK("Exception,  handleErrorEvent:"+dn)}}function bU(dj,dh){if(bY(dj)){bK("handle Ended Event WithDelay : video tag is of type AD, return");return}try{var dm=dj.akamai;var di=dm.currentState;bK("entered function handle Ended Event WithDelay, current state"+cM(di.state));var dl=b5(dh);var dk=ah(dj);var dg=dl-di.lastEventClockTime;if(dm.pollingTimer){bZ(dm.pollingTimer)}if(b9&&b9.retryTimer){bZ(b9.retryTimer)}if(dm.hLineTimer){bZ(dm.hLineTimer)}if(dm.fastTCPServerIpTimer){bZ(dm.fastTCPServerIpTimer)}if(dm.firstPLineTimer){bZ(dm.firstPLineTimer)}if(b9&&b9.retryTimer){bZ(b9.retryTimer)}if(dm.postRollTimer){bK("handle Ended Event WithDelay: postRollTimer already started return");return}cG(dm,"complete");a4(dm);bN(dm);dm.postRollTimer=bW(ar,1e3,[dj]);cp(dm);dm.customDataPopulated=true;cr(dm,dl);ba(dj,dg,dl,true);dm.playEndMetricsUpdated=true}catch(dn){bK("Exception,  handle Ended Event WithDelay"+dn);ar(dj,dl)}}function ar(dh,dm){try{var dp=dh.akamai;if(dp.postRollTimer){bZ(dp.postRollTimer);delete dp.postRollTimer}if(dp.isELineSent||dp.isCLineSent){bK("handle Ended Event : already sent C line, return");return}var dk=b5(dm);var dg=parseInt(aE(dh));var di=dp.currentState;var ds=dk-di.lastEventClockTime;var dl=dk-dp.startTimer;var dn=di.state;bK("entered function handle Ended Event, current state"+cM(di.state));if(!dp.playEndMetricsUpdated){ba(dh,ds,dk,true);dp.playEndMetricsUpdated=true}di.state=cB.ended;var dj=ah(dh);if(dp.streamTitleSwitchReason!=null&&dp.streamTitleSwitchReason!=""){dj=dp.streamTitleSwitchReason}bI(dh,dj,false,dk);var dr=parseInt(E("HTML_LastCLineTime"));bb(dh);di.lastEventClockTime=dk}catch(dq){bK("Exception,  handle Ended Event :"+dq)}}this.getViewerId=function(){try{var dg=aG.akamai;if(dg&&dg.viewerId){return dg.viewerId}else{return null}}catch(dh){return null}};this.setData=function(e,dg){bh(e,dg)};this.handleStreamSwitch=function(){cF()};this.handleTitleSwitch=function(e){cN(e)};this.handleFeedbackEvent=function(){aF()};this.handleApplicationExit=function(){aZ()};this.enableServerIpLookUp=function(){a3=true};this.disableServerIpLookUp=function(){a3=false};this.enableLocation=function(e){bs(e)};this.enableManifestRequest=function(e){c6=e};this.setURLManifest=function(e){ap=e};function bd(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e&&e.type){aG.akamai.connectivity=e.type}}function bs(dg){if(dg){if(navigator.geolocation&&ak==null){ak=navigator.geolocation.watchPosition(br,b2);var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e&&e.type){aG.akamai.connectivity=e.type;e.addEventListener("typechange",bd)}}}else{if(navigator.geolocation&&ak!=null){navigator.geolocation.clearWatch(ak);ak=null;e.removeEventListener("typechange",bd)}}}function br(e){if(e&&e.coords){aG.akamai.latitude=e.coords.latitude;aG.akamai.longitude=e.coords.longitude}}function b2(dg){var e="";switch(dg.code){case dg.PERMISSION_DENIED:e="User denied the request for Geolocation.";break;case dg.POSITION_UNAVAILABLE:e="Location information is unavailable.";break;case dg.TIMEOUT:e="The request to get user location timed out.";break;case dg.UNKNOWN_ERROR:e="An unknown error occurred.";break}bK("Location Error : ",e)}function bh(dg,dh){try{if(aG&&aG.akamai&&aG.akamai.isSLineSent){bK("setData() API called after 'Start Of Play' for dimension -> "+dg+"|All custom dimensions should be set before the play is initiated.","WARN")}else{bK("Set Data("+dg+":"+dh+")")}if(dg=="customDataObject"){b8(dh)}else{if(dg=="customDataFunction"){bu=dh}else{try{if(dh!=null){dh=dh.trim()}}catch(di){}if(dg=="viewerId"||dg=="viewerDiagnosticsId"){if(dh==null||dh==""){dh="-"}}try{if(cD){if(dg.substring(0,4)=="_cd_"){c1(dg)}}}catch(di){}try{if(dg.indexOf("std:")!=-1){Y[dg.substring(4)]=dh}else{bf[dg]=dh}}catch(di){bf[dg]=dh}if(dg.indexOf("socialShare:")!=-1||dg.indexOf("feedback:")!=-1){aF()}}}}catch(di){bK("Exception, Set Data :"+di)}}function b8(dg){try{if(typeof dg=="object"){for(var dh in dg){bh(dh,dg[dh])}}}catch(di){bK("Exception set custom data object"+di)}}function cF(e){var dg=aG.akamai;dg.streamTitleSwitchReason="Stream.Switched";ar(aG,e)}function cN(di,dj){aG.akamai.streamTitleSwitchReason="Title.Switched";var dh=aG.akamai.isFirstTitle;ar(aG,dj);try{if(di!=null&&di!=""){for(var dg in di){bh(dg,di[dg])}}}catch(dk){bK("Exception, handle title switch:"+dk)}aG.akamai.isFirstTitle=dh;aw(aG,dj);k(aG,dj);try{aG.akamai.currentState.timeUpdateStreamTime=parseInt(aE(aG))}catch(dk){bK("Exception,  handleTitleSwitch"+dk)}}function aF(){try{var dm="feedback:";var dg=dm.length;var dl=false;var dj=b5();for(var di in bf){if(di.indexOf(dm)!=-1){var dh=di.substring(dg);bf[dh]=bf[di];delete bf[di];dl=true}}x();bK("handleFeedbackEvent");if(bv&&bv.shouldSendFLine&&bv.akamai&&(bv.akamai.isCLineSent||bv.akamai.postRollTimer)){if(dl){bv.akamai.customDataChanged=true}if(bv.fLineCount<bv.limit){u(bv,"feedback",false,dj)}++bv.fLineCount;bv.akamai.customDataChanged=false;bv.akamai.socialSharing=null}}catch(dk){bK("Exception, handle feed back event :"+dk)}}function aZ(){try{if(!aG.objectBased){bK("application exit, unsubscribe video events");cK(aG)}}catch(dg){}a8()}function am(dh){if(bY(dh)){return}try{if(an){bK("handle time update event, return as inside background state for idevice");return}var dj=b5(null,true);var dg=parseInt(aE(dh));var dm=dh.akamai;if(!dm){return}if(dm.postRollTimer){return}var di=dm.currentState;var dq=dj-di.lastEventClockTime;var dl=dj-dm.startTimer;var dn=di.state;var dk=dg-di.timeUpdateStreamTime;if(di.timeUpdateStreamTime!=0){if(Math.abs(dk)>=o.seekThreshold&&dm.isSLineSent){bK("stream diff in time update is "+dk);ab(dh,dj,dg)}else{if(dk>0&&dk<=750){if(dh.objectBased){if(di.state==cB.seek){k(dh)}}else{if(!dm.isSLineSent||di.state==cB.seek||di.state==cB.rebuffering){bK("handle time update event,  dispatching playing event,  current Video state is : "+cM(di.state));k(dh)}}}}}di.timeUpdateClockTime=dj;di.timeUpdateStreamTime=dg}catch(dp){bK("Exception,  handleTimeupddate :"+dp)}}this.handleSessionInit=function(dg,dh){try{if(dg){if(typeof cz!="object"){cz={}}if(dg.streamHeadPosition){cz.streamHeadPosition=dg.streamHeadPosition}if(dg.streamLength){cz.streamLength=dg.streamLength}if(dg.streamURL){cz.streamURL=dg.streamURL}if(dg.bytesLoaded){cz.bytesLoaded=dg.bytesLoaded}if(dg.customDataFunction){cz.customDataFunction=dg.customDataFunction}if(cz.customDataFunction){bu=cz.customDataFunction}if(dg.firstBitRate){cz.firstBitRate=dg.firstBitRate}if(cz.firstBitRate){bX(cz.firstBitRate,dh)}}aw(aG,dh)}catch(di){}};this.handleBitRateSwitch=function(dg,e){bX(dg,e)};this.handlePlaying=function(e){aw(aG,e);k(aG,e)};this.handlePlayEnd=function(dg,e){if(aG.objectBased){aG.endReason=dg}bU(aG,e)};this.handleMediaChangedEvent=function(){ar(aG)};this.handlePause=function(e){ag(aG,e)};this.handleResume=function(e){aw(aG,e);k(aG,e)};this.handleBufferStart=function(e){I(aG,e)};this.handleBufferEnd=function(e){aw(aG,e);k(aG,e)};this.handleError=function(dg){try{if(aG.objectBased){aG.errorReason=dg}else{aG.externalError=dg}T(aG)}catch(dh){}};this.handleTimeupdateEvent=function(){am(aG)};this.updateAdObject=function(e){bx(e)};this.handleAdLoaded=function(dh,dg){try{bw(dh,dg)}catch(di){}};this.handleAdStarted=function(dg,e){aX(dg,e)};this.handleAdCompleted=function(e){M(e)};this.handleAdFirstQuartile=function(){c3()};this.handleAdMidPoint=function(){b()};this.handleAdThirdQuartile=function(){cq()};this.handleAdStopped=function(e){n(e)};this.handleAdError=function(e){aP(e)};this.handleSetupAISEvent=function(e,dg,dh){bp(e,dg,dh)};this.getStream=function(){var e=aG.akamai;return e.stream};function bp(dg,di,dk){try{var dh=b9.aisRequestLimit;var dj=b9.aisRequestInterval;b9=new aq;b9.aisRequestInterval=dj;b9.aisRequestLimit=dh;if(!dg){bK("return from ais, platform is null");return}b9.platform=dg;b9.version=di?di:"1.0";if(dk){b9.aisCustomDataObj=dk}b9.requestUrl="http://idp.securetve.com/rest/";b9.initUrl=b9.requestUrl+b9.version+"/"+b9.platform+"/init/?format=jsonp&responsefield=akaMediaAnalytics.receiveAISInitRequest";b9.identityUrl=b9.requestUrl+b9.version+"/"+b9.platform+"/identity/?format=jsonp&responsefield=akaMediaAnalytics.receiveAISIdentityRequest";b9.initUrlId="AkamaiAISInitUrl";b9.identityUrlId="AkamaiAISIdentityUrl";s(b9.initUrl,b9.initUrlId)}catch(dl){b9.requestFailed=true}}this.receiveAISInitRequest=function(di){try{b9.initObj=di;ax(b9.initUrlId);if(b9.initObj==""||b9.initObj==null){b9.requestFailed=true;return}if(b9.requestFailed){return}if(b9.initObj.authenticated){b9.akamai={};b9.akamai.ais_queryToken=b9.initObj.querytoken;if(b9.initObj.idps){var dj=b9.initObj.idps;for(var dg in dj){b9.akamai.ais_idpId=dg;b9.akamai.ais_idpName=dj[dg].name;b9.akamai.ais_idpDisplayName=dj[dg].display_name;b9.akamai.ais_idpUrl=dj[dg].url}}s(b9.identityUrl,b9.identityUrlId)}else{if(!b9.requestFailed){bK("receiveAISInitRequest, retrying the request");++b9.aisRetries;if(b9.aisRetries<b9.aisRequestLimit){b9.retryTimer=bW(s,b9.aisRequestInterval,[b9.initUrl,b9.initUrlId])}}}}catch(dh){b9.requestFailed=true}};this.receiveAISIdentityRequest=function(dh){try{b9.identityObj=dh;ax(b9.identityUrlId);if(dh==null||dh==""){return}if(!b9.akamai){b9.akamai={}}if(dh.indentity&&dh.identity.aisuid){b9.akamai.ais_aisuid=dh.identity.aisuid}cO()}catch(dg){b9.requestFailed=true}};function cO(){var dh={};var dj;var di;try{if(b9&&b9.aisCustomDataObj){if(!b9.akamai){b9.akamai={}}for(var dg in b9.aisCustomDataObj){dj=b9.aisCustomDataObj[dg].split("/");if(dj[0]=="INIT"&&b9.initObj){dh=b9.initObj}else{if(dj[0]=="IDENTITY"&&b9.identityObj){dh=b9.identityObj}}if(dh){for(di=1;di<dj.length;di++){if(dj[di]&&dh[dj[di]]){dh=dh[dj[di]]}}if(typeof dh!="object"){b9.akamai[dg]=dh}}}}}catch(dk){bK("Exception,  populateAISCustomData"+dk)}}function s(dh,dj){try{var dg=document.createElement("script");dg.setAttribute("src",dh);dg.id=dj;document.getElementsByTagName("head")[0].appendChild(dg)}catch(di){bK("Exception,  loading JavaScript File "+dh)}}function ax(di){try{var dg=document.getElementById(di);dg.parentNode.removeChild(dg)}catch(dh){bK("Exception,  removing script with id "+di)}}function cL(dh){var di,e;di=dh.akamai;di.pollingTimer=bW(cL,L,[dh]);var dg=Date.now();if(di.chasingSleep>0&&dg>di.chasingSleep+5e3){aQ(dh);di.wasPutToSleep=true}di.chasingSleep=dg;if(dh){if(dh.isBrightcoveVideo){akamaiBCVideoModule.getVideoPosition(false,au)}else{au(0,dh)}}}function aQ(e){cI();ch.clearBitRate();akamai=e.akamai;if(!e.objectBased&&akamai.pollingTimer){bZ(akamai.pollingTimer)}if(b9&&b9.retryTimer){bZ(b9.retryTimer)}if(akamai.hLineTimer){bZ(akamai.hLineTimer)}if(akamai.fastTCPServerIpTimer){bZ(akamai.fastTCPServerIpTimer)}if(akamai.firstPLineTimer){bZ(akamai.firstPLineTimer)}if(b9&&b9.retryTimer){bZ(b9.retryTimer)}if(akamai.postRollTimer){bZ(akamai.postRollTimer);delete akamai.postRollTimer}akamai.currentState.state=cB.ended;akamai.isILineSent=false;akamai.isSLineSent=false;akamai.firstTimePlay=true;akamai.iLineSentTime=0;akamai.lastPlayStreamTime=0}function au(e,di){var dk,dg;var dj=b5(null,true);if(aG!=null&&aG.isBrightcoveVideo){aG.currentTime=parseInt(e);dg=parseInt(e*1e3);di=aG}else{dg=parseInt(aE(di))}if(dg=="undefined"||isNaN(dg)||dg==""){return}dk=di.akamai;var dh=dk.currentState;if(dh.state==cB.ended){return}if(di.objectBased&&dk.wasPutToSleep===true&&dg===dh.pollingTimerStreamTime){if(dk.pollingTimer){bZ(dk.pollingTimer)}aw(aG);k(aG)}else{if(di.objectBased){am(di)}else{if(dh.state==cB.pause||dh.state==cB.seek){return}if(dg!=0&&dg===dh.pollingTimerStreamTime&&dh.state!=cB.rebuffering){bK("check stream head position, call handle waiting event");I(di)}else{dh.pollingTimerStreamTime=dg}}}}function aE(dh){var dg=0;try{if(dh.objectBased){if(cz&&cz.streamHeadPosition){dg=cz.streamHeadPosition();dh.currentTime=dg}}else{if(cl.currentTime){dg=cl.currentTime;dh.currentTime=dg}}}catch(di){}if(dg==0&&aL!=-1){dg=aL}if(dg!=0){aL=dg}return dg*1e3}function H(dg){var di=0;try{if(dg){if(dg.objectBased){if(cz&&cz.streamLength){di=cz.streamLength();dg.duration=di}}else{di=cl.duration;dg.duration=di}}}catch(dh){}return di*1e3}function C(dh){var dg="";try{if(dh){if(dh.objectBased){if(cz&&cz.streamURL){dg=cz.streamURL();dh.currentSrc=dg}}else{if(bf.streamURL){dg=bf.streamURL}else{dg=cl.currentSrc;dh.currentSrc=dg}}}}catch(di){}return dg}function cH(){return aE(aG)/1e3}function dd(){return H(aG)/1e3}function bl(){return C(aG)}function cf(di){var dg=0,dh=0;try{if(di){if(di.objectBased){if(cz&&cz.bytesLoaded){dg=parseInt(cz.bytesLoaded());dh=dg-di.akamai.lastBytesLoaded}}}}catch(dj){}di.akamai.lastBytesLoaded=dg;if(dh>0){return dh}}function aH(dh){try{var dg={};if(bu!=null){dg=bu();b8(dg)}}catch(di){}}function bw(dh,dg){try{bK("handle Ad loaded");if(D.isAdLoaded){bK("handleAdLoaded API is called multiple times.|We have identified that 2 successive handleAdLoaded APIs are called.|Kindly ensure that sequence of Ad calls -- handleAdLoaded->handleAdStarted->handleAdComplete is maintained.","WARN")}var dk=aG.akamai;if(!dk.isILineSent){var di=(new Date).getTime();if(dg!=null&&di-dg>0){}}var dj=b5(dg);D.clearAdAnalytics();D.isAdLoaded=true;D.adLoadTime=dj;D.adCount=1;D.adAbandoned=true;if(dk.postRollTimer){bE(aG);bZ(dk.postRollTimer);dk.postRollAd=true;dk.customDataPopulated=false;D.type=2}else{if(dk.isILineSent){if(dk.isSLineSent){ag(aG,dj);D.type=1}else{if(!dk.isSLineSent){if(!dk.adLoadTime){dk.adLoadTime=dj}}}}}bx(dh);if(!dk.isILineSent){at(false,dj)}}catch(dl){bK("Exception,handle ad loaded:"+dl)}}function aX(dh,dg){try{bK("handle Ad Started");var di=b5(dg);D.isAdStarted=true;if(!D.isAdLoaded){bK("handleAdLoaded API is missing.|We have identified that handleAdStarted API is called without handleAdLoaded.|Kindly ensure that handleAdLoaded API is called for every Ad and relevant adObject is passed as an argument.","WARN");bw(dh,di)}D.playBucket="0";D.adStartTime=di;D.adStartupTime=di-D.adLoadTime;D.startPos=aE(aG);bx(dh)}catch(dj){bK("Exception,handle ad started:"+dj)}}function M(dg){try{bK("handleAdEnded");if(D.playBucket=="0"){bK("Ad Progress related APIs not called.|We have identified that handleAdFirstQuartile,handleAdMidPoint & handleAdThirdQuartile APIs have not been called.|It will be good if these APIs are called in order to capture more accurate Ad information","WARN")}D.playBucket="4";b6("0",dg)}catch(dh){bK("Exception,handle ad completed:"+dh)}}function c3(){if(!D.isAdStarted){bK("handleAdStarted API is missing.|We have identified that handleAdFirstQuartile API is called without handleAdStarted.|Kindly ensure that handleAdStarted API is called for every Ad that starts successfully.","ERROR")}D.playBucket="1"}function b(){D.playBucket="2"}function cq(){D.playBucket="3"}function n(e){b6("1",e)}function aP(e){b6("3",e)}function bx(dh){try{var di=D.setDataArr;bK("populate ad metric");for(var dg=0;dg<di.length;dg++){if(di[dg]in dh){D[di[dg]]=dh[di[dg]]}}}catch(dj){}}function b6(dj,dg){try{var dl=b5(dg);var dk=aG.akamai;D.endStatus=dj;if(dj!="0"){D.adAbandonCount=1}if(D.isAdLoaded&&D.isAdStarted){D.adPlayClockTime=dl-D.adStartTime}D.adSession=az();var dh=["adStartupTime","adCount","adPlayClockTime","adAbandonCount"];for(var di=0;di<dh.length;di++){dk[dh[di]]+=D[dh[di]]}if(dk.adSession){dk.adSession+=","+D.adSession}else{dk.adSession=D.adSession}D.isAdStarted=false;D.isAdLoaded=false;if(dj!="2"){D.adAbandoned=false;if(dk){if(dk.postRollAd){dk.postRollAd=null;ar(aG,dl)}else{if(dk.isSLineSent){aw(aG,dl);k(aG,dl)}else{if(!dk.isSLineSent){dk.adEndTime=dl}}}}}}catch(dm){bK("Exception,populate ad end:"+dm)}}function az(){var dg="";var dh=["adId","type","startPos","adStartupTime","adPlayClockTime","playBucket","endStatus","adDuration","adTitle","adCategory","adPartnerId","adServer","adDaypart","adIndustryCategory","adEvent"];try{for(var di=0;di<dh.length;di++){if(D[dh[di]]==0||D[dh[di]]!=null&&D[dh[di]]!=""){dg+=D[dh[di]]+":"}else{dg+=":"}}dg=dg.substring(0,dg.length-1)}catch(dj){}return dg}function a2(dg){try{if(bY(dg)){return}var dh=dg.akamai;if(dh.firstTimeProgress){}}catch(di){}}function aO(dg){try{if(bY(dg)){return}var dh=dg.akamai;if(cl.autoplay){aw(dg);dh.loadStartILine=true}}catch(di){}}function cs(dg){try{if(bY(dg)){return}var dh=dg.akamai;if(cl.autoplay){dh.canPlayEventAutoPlay=true}else{dh.canPlayEventAutoPlay=false}}catch(di){}}function cd(dg){try{if(bY(dg)){return}var dh=dg.akamai;if(dh.firstTimeProgress){dh.firstTimeProgress=false}if(dh.logType=="R"){}}catch(di){}}function df(dg){try{if(bY(dg)){return}var dh=dg.akamai;dh.streamLength=parseInt(H(dg))}catch(di){}}this.subscribeVideoObject=function(dg){try{if(dg){aa(dg)}}catch(dh){}};function aa(dh){bK("subscribeToEvents : video = "+dh);var dg=["abort","error","play","pause","playing","waiting","seeking","seeked","ended","timeupdate"];var dj=["progress","load","durationchange"];cl=dh;try{dh.addEventListener("play",bQ.play=function(){aw(aG)},false);dh.addEventListener("pause",bQ.pause=function(){ag(aG)},false);dh.addEventListener("error",bQ.error=function(){T(aG)},false);dh.addEventListener("ended",bQ.ended=function(){bU(aG)},false);dh.addEventListener("playing",bQ.playing=function(){k(aG)},false);dh.addEventListener("waiting",bQ.waiting=function(){I(aG)},false);dh.addEventListener("timeupdate",bQ.timeupdate=function(){am(aG)},false);dh.addEventListener("load",bQ.load=function(){a2(aG)},false);dh.addEventListener("progress",bQ.progress=function(){cd(aG)},false);dh.addEventListener("durationchange",bQ.durationchange=function(){df(aG)},false);dh.addEventListener("canplay",bQ.canplay=function(){cs(aG)},false);dh.addEventListener("loadstart",bQ.loadstart=function(){aO(aG)},false);bK("subscribed to events completed")}catch(di){bK("Exception,  subscribeToEvents,unable to add listeners to video tag :"+di)}}function cK(dg){try{dg.removeEventListener("play",bQ.play,false);dg.removeEventListener("pause",bQ.pause,false);dg.removeEventListener("error",bQ.error,false);dg.removeEventListener("ended",bQ.ended,false);dg.removeEventListener("playing",bQ.playing,false);dg.removeEventListener("waiting",bQ.waiting,false);dg.removeEventListener("timeupdate",bQ.timeupdate,false);dg.removeEventListener("load",bQ.load,false);dg.removeEventListener("progress",bQ.progress,false);dg.removeEventListener("durationchange",bQ.durationchange,false);dg.removeEventListener("canplay",bQ.canplay,false);dg.removeEventListener("loadstart",bQ.loadstart,false)}catch(dh){bK("Exception, unSubscribeFrom Events:"+dh)}}function bz(di){try{if(typeof akamaiBCVideoObject!="undefined"){cl=akamaiBCVideoObject;aG.isBrightcoveVideo=true;initBrightcove()}else{if(aG.objectBased||aG.videoPassed){}else{if(document){var dh=document.getElementsByTagName("video");bK("add MediaEvent Listeners : videos.length "+dh.length);if(dh&&dh.length==0){dh=document.getElementsByTagName("audio")}for(var dg=0;dg<dh.length;++dg){aa(dh[dg])}document.addEventListener("DOMNodeInserted",aK,false);document.addEventListener("DOMNodeRemoved",aK,false);document.addEventListener("DOMAttrModified",aK,false)}}}if(di){if(di.type=="DOMContentLoaded"){document.removeEventListener("load",bz,true)}else{if(di.type=="load"&&dh&&dh.length>0){document.removeEventListener("load",bz,true)}}}}catch(dj){bK("Exception,  add MediaEvent Listeners :"+dj)}}function aK(e){var dg=e.target;if(dg.nodeType==dg.COMMENT_NODE||dg.tagName==null||dg.tagName.toLowerCase()!="video"&&dg.tagName.toLowerCase()!="audio"){return}switch(e.type){case"DOMNodeRemoved":if(dg.dataset&&dg.dataset.isad&&dg.dataset.isad=="true"){}else{cV(aG,0)}break;case"DOMNodeInserted":aa(dg);break}}function cV(dh,dr){bK("handle Video Unload");var dk=b5();var dl=dh.akamai;var dj=parseInt(E("HTML_VisitCountCookie"));bk.browserClose=true;try{if(dl&&dl.currentState.state>=cB.init&&dr==0){if(dl.isELineSent||dl.isCLineSent){return}if(D&&D.adAbandoned){var di="Ad.Abandon";if(dl.postRollTimer){bZ(dl.postRollTimer);delete dl.postRollTimer}bI(dh,di,true,dk)}else{if(!dl.firstTimePlay){var di="Browser.Close";if(dl.postRollTimer){bZ(dl.postRollTimer);delete dl.postRollTimer}bI(dh,di,true,dk)}else{var dq="Browser.Refresh.NoStart";if(dk-dl.startTimer>o.initBrowserCloseTime){dq="Browser.Refresh.NoStart.Late"}h(dh,dq,true,dk)}}}}catch(dm){}try{var dp=parseInt(E("HTML_LastCLineTime"));var dn=dp+o.visitTimeout-dk;var dg=parseInt(E("HTML_isPlayingCount"));bK("handle Video Unload: playing cookie =  "+dg+", visit cookie :"+dj);if(dj>=1&&dr==1){if(dn>0){bZ(dl.clearVisitTimeoutId);dh.akamai.clearVisitTimeoutId=bW(cV,dn,[dh,1]);return}else{if(dn<=0&&dj>1&&dg>0){bZ(dl.clearVisitTimeoutId);dh.akamai.clearVisitTimeoutId=bW(cV,o.visitTimeout,[dh,1]);return}}}bK("handle Video Unload: decrementing HTML_VisitCountCookie");dj=dj-1;bn("HTML_VisitCountCookie",dj);var dj=parseInt(E("HTML_VisitCountCookie"));if(dj===0||isNaN(dj)){if(dl.sendVLine){ao(dh,dk)}}}catch(dm){}}function a8(){try{if(D.isAdLoaded){b6("2")}}catch(dg){}cV(aG,0)}function c8(dg){bK("handlePagehide");an=true;a8()}function cZ(dg){bK("handlePageshow:");try{if(aG&&aG.tagName){bK("handlePageShow: media tag is :"+aG.tagName);if(aG.akamai&&an){bK("handlePageshow: send play and playing on timeupdate");Q=true}}}catch(dg){bK("Exception,  handlePagehsow : "+dg)}an=false}function E(dh){var dg=dh+"=";var dj="";try{if(document.cookie.length>0){offset=document.cookie.indexOf(dg);if(offset!=-1){offset+=dg.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}dj=document.cookie.substring(offset,end)}}}catch(di){}return dj}function X(dg){try{var dk=location.pathname.split("/");var dj=" path=";document.cookie=dg+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT;";for(var dh=0;dh<dk.length;dh++){dj+=(dj.substr(-1)!="/"?"/":"")+dk[dh];document.cookie=dg+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT;"+dj+";"}}catch(di){}}function bn(dh,di,dl){try{var dg=dh+"="+di+";Path=/;";if(dl){if(parseInt(dl)>0){var dk=new Date;dk.setDate(dk.getDate()+parseInt(dl));if(dk!=null){dg+="expires="+dk.toUTCString()+";"}}}if(document){document.cookie=dg}}catch(dj){}}function c7(dm,dj){try{if(typeof dm!=="undefined"&&dm!==null&&typeof dj!=="undefined"&&dj!==null){var dg=dm[i(dj.name)];var di=bC.SHA1(dg).toString();var dl=A(di);var dh=0;var dk=b5();if(dl){dh=dk-parseFloat(dl);dh=dh/1e3/60;dh=dh>0?dh.toFixed(2):0}bq(di,dk,dj.expiryDuration);dm[dj.name]=dh.toString()}}catch(dn){bK("Exception,  calculateUniqueDimension :"+dn)}}function i(e){dimension="";if(e==="viewerInterval"){dimension="viewerId"}else{if(e==="viewerTitleInterval"){dimension="title"}}return dimension}function A(dh){try{var di=window.localStorage.getItem(dh);if(typeof di!=="undefined"&&di!==null){var dg=JSON.parse(di);var dj=dg.value;return dj}}catch(dk){}}function bc(){try{bK("deleteExpiredDataFromLocalStorage");var dh=b5();var dk=null;var dg=window.localStorage.length;for(var dj=dg-1;dj>=0;dj--){var di=window.localStorage.getItem(window.localStorage.key(dj));if(typeof di!=="undefined"&&di!==null&&di.indexOf("expiryDate")!==-1){var dl=JSON.parse(di);if(typeof dl!=="undefined"&&dl!==null&&typeof dl.expiryDate!=="undefined"&&dl.expiryDate!==null){dk=Date.parse(dl.expiryDate);if(dk<=dh){window.localStorage.removeItem(window.localStorage.key(dj))}}}}}catch(dm){}}function bq(di,dj,dl){try{var dh={value:dj};if(typeof dl!=="undefined"&&dl!==null){var dg=new Date;if(parseInt(dl)>0){dg.setDate(dg.getDate()+parseInt(dl))}else{dg.setDate(dg.getDate()+parseInt(90))}dh.expiryDate=dg.toDateString()}window.localStorage.setItem(di,JSON.stringify(dh))}catch(dk){}}function cX(){try{if(aI=="iPad"||aI=="iPhone"){return true}}catch(dg){return false}}function S(){try{if(aG.objectBased||aG.videoPassed){bz()}else{bK("adding MediaEventListeners: DOMContentLoaded");document.addEventListener("DOMContentLoaded",bz,false);bK("adding MediaEventListeners: Load");document.addEventListener("load",bz,true)}}catch(dg){bK("Exception,  Addding DOMContentLoaded and Load event listeners :"+dg)}if(window){if(cX()){window.addEventListener("pagehide",c8,false);window.addEventListener("pageshow",cZ,false)}else{if(typeof akamaiBCVideoObject!="undefined"&&window.addEventListener){window.addEventListener("beforeunload",a8,false)}else{if(window.addEventListener){try{if(bH()){window.parent.addEventListener("beforeunload",a8,false)}else{window.addEventListener("beforeunload",a8,false)}}catch(dg){bK("Exception, add window document listeners : "+dg);window.addEventListener("beforeunload",a8,false)}}else{if(window.attachEvent){try{if(bH()){window.parent.attachEvent("onbeforeunload",a8)}else{window.attachEvent("onbeforeunload",a8)}}catch(dg){window.attachEvent("onbeforeunload",a8)}}}}}}}S()}if(typeof akamaiBCVideoObject!="undefined"){akaMediaAnalytics=new AkaHTML5MediaAnalytics(null)}else{if(typeof AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH!="undefined"){if(AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH.indexOf("enableGenericAPI=1")==-1&&AKAMAI_MEDIA_ANALYTICS_CONFIG_FILE_PATH.indexOf("subscribeVideo")==-1){akaMediaAnalytics=new AkaHTML5MediaAnalytics(null)}}}function setAkamaiMediaAnalyticsData(b,c,a){try{if(akaMediaAnalytics){akaMediaAnalytics.setData(b,c)}}catch(d){}}function akamaiPlaybackCompleted(){try{if(akaMediaAnalytics){akaMediaAnalytics.handlePlayEnd()}}catch(a){console.log(a)}}function akamaiGetViewerId(){try{var b=null;if(akaMediaAnalytics){b=akaMediaAnalytics.getViewerId()}}catch(a){}return b}function akamaiSetStreamURL(a,c){try{if(a!=null&&a!=""){setAkamaiMediaAnalyticsData("streamURL",a)}if(akaMediaAnalytics){if(typeof c!=="undefined"){akaMediaAnalytics.enableManifestRequest(c)}else{console.log("shouldSDKFetchManifest is not set by the player")}}else{console.log("akaMediaAnalytics is null akamaiSetStreamURL api call will fail")}}catch(b){console.log("Exception thrown from akamaiSetStreamURL. Exception = "+b)}}function akamaiSetURLManifest(a){try{if(akaMediaAnalytics){akaMediaAnalytics.setURLManifest(a)}else{console.log("akaMediaAnalytics is null akamaiSetURLManifest api call will fail")}}catch(b){console.log("Exception thrown from akamaiSetURLManifest. Exception = "+b)}}function akamaiSetViewerId(a){if(a==null||a==""){a="-"}setAkamaiMediaAnalyticsData("viewerId",a);setAkamaiMediaAnalyticsData("clientId",a)}function akamaiSetViewerDiagnosticsId(a){if(a==null||a==""){a="-"}setAkamaiMediaAnalyticsData("viewerDiagnosticsId",a)}function akamaiUpdateAdObject(a){if(akaMediaAnalytics){akaMediaAnalytics.updateAdObject(a)}}function akamaiHandleAdStarted(a){if(akaMediaAnalytics){akaMediaAnalytics.handleAdStarted(a)}}function akamaiHandleAdCompleted(){if(akaMediaAnalytics){akaMediaAnalytics.handleAdCompleted()}}function akamaiHandleAdLoaded(a){if(akaMediaAnalytics){akaMediaAnalytics.handleAdLoaded(a)}}function akamaiHandleAdFirstQuartile(){if(akaMediaAnalytics){akaMediaAnalytics.handleAdFirstQuartile()}}function akamaiHandleAdMidPoint(){if(akaMediaAnalytics){akaMediaAnalytics.handleAdMidPoint()}}function akamaiHandleAdThirdQuartile(){if(akaMediaAnalytics){akaMediaAnalytics.handleAdThirdQuartile()}}function akamaiHandleAdError(){if(akaMediaAnalytics){akaMediaAnalytics.handleAdError()}}function akamaiHandleAdStopped(){if(akaMediaAnalytics){akaMediaAnalytics.handleAdStopped()}}function akamaiHandleStreamSwitch(){if(akaMediaAnalytics){akaMediaAnalytics.handleStreamSwitch()}}function akamaiHandleTitleSwitch(a){if(akaMediaAnalytics){akaMediaAnalytics.handleTitleSwitch(a)}}function akamaiSetupAIS(a,b,c){if(akaMediaAnalytics){akaMediaAnalytics.handleSetupAISEvent(a,b,c)}}function akamaiHandleBitRateSwitch(a){if(akaMediaAnalytics){akaMediaAnalytics.handleBitRateSwitch(a)}}function akamaiHandleApplicationExit(){if(akaMediaAnalytics){akaMediaAnalytics.handleApplicationExit()}}function akamaiSetVideoObject(a){if(akaMediaAnalytics){akaMediaAnalytics.subscribeVideoObject(a)}}function akamaiSubscribeVideoObject(a){if(akaMediaAnalytics){akaMediaAnalytics.subscribeVideoObject(a)}}function akamaiEnableLocation(a){if(akaMediaAnalytics){akaMediaAnalytics.enableLocation(a)}}function akamaiDisableServerIpLookup(){try{if(akaMediaAnalytics){akaMediaAnalytics.disableServerIpLookUp()}}catch(a){}}function akamaiEnableServerIpLookup(){try{if(akaMediaAnalytics){akaMediaAnalytics.enableServerIpLookUp()}}catch(a){}}function akamaiHandleError(a){try{if(akaMediaAnalytics){akaMediaAnalytics.handleError(a)}}catch(b){}}function fragmentDownloadStarted(a){akamaiFragmentDownloadStarted(a)}function fragmentDownloadCompleted(a){akamaiFragmentDownloadCompleted(a)}function akamaiFragmentDownloadStarted(a){var b=akaMediaAnalytics.getStream();if(!b||!a){return}b.streamFragmentDownloadStarted(a)}function akamaiFragmentDownloadCompleted(a){var b=akaMediaAnalytics.getStream();if(!b||!a){return}b.streamFragmentDownloadCompleted(a)}
//# sourceMappingURL=./support.min.js.map