!function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};e.m=t,e.c=i,e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=7)}([function(t,e){var i={isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return"[object Object]"===Object.prototype.toString.call(t)},isInt:function(t){return parseInt(t,10)===t},floor10:function(t){return t=+t,isNaN(t)?NaN:(t=t.toString().split("e"),t=Math.floor(+(t[0]+"e"+(t[1]?+t[1]+1:1))),t=t.toString().split("e"),+(t[0]+"e"+(t[1]?+t[1]-1:-1)))},truncate:function(t,e){return(""+t).substr(0,e)+"&tr="+t.length},getUid:function(){var t=window.crypto||window.msCrypto;return"object"==typeof t&&"function"==typeof t.getRandomValues?function(){return Date.now().toString(36)+"-"+t.getRandomValues(new Uint32Array(1))[0].toString(36)}:function(){return Date.now().toString(36)+"-"+Math.round(1e15*Math.random()).toString(36)}}(),merge:function(t,e){var i=arguments.length;if(i<2||null==t)return t;for(var s=1;s-1}:function(t,e){for(var i=0;i0||"webkitFlowInto"in n.style&&"webkitFlowFrom"in n.style)&&(t=new Object({name:"safari"}),s.featuresInduced.push(t)),this.window.chrome&&this.window.chrome.webstore&&(t=new Object({name:"chrome"}),s.featuresInduced.push(t)),"documentMode"in this.window.document&&(t=new Object({name:"ie",version:{}}),this.window.document.compatMode&&(t.version.major=6),this.window.XMLHttpRequest&&(t.version.major=7),this.window.document.querySelector&&(t.version.major=8),this.window.document.addEventListener&&(t.version.major=9),this.window.atob&&(t.version.major=10),this.window.ActiveXObject||(t.version.major=11),s.featuresInduced.push(t)),!this.window.document.documentMode&&this.window.StyleMedia&&(t=new Object({name:"edge"}),s.featuresInduced.push(t)),s.hasIdentifiableFeatures=s.featuresInduced.length>0,s.hasExclusiveFeatures=1===s.featuresInduced.length,s.hasExclusiveFeatures&&(t=s.featuresInduced[0],s.name=t.name,s.hasAmbiguousClaims=s.userAgentInduced.name!==s.name,!s.hasAmbiguousClaims&&t.version&&t.version.major===s.userAgentInduced.version.major&&(s.version=t.version)),s.is[s.name]=!0,s.plugins={},s.plugins.flash=this.getFlashPluginInfo(),s},s.prototype.getPerformanceTiming=function(){if(!("performance"in this.window&&"timing"in this.window.performance))return{};if("toJSON"in this.window.performance.timing)return this.window.performance.timing.toJSON();var t={};return["navigationStart","unloadEventStart","unloadEventEnd","redirectStart","redirectEnd","fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"].forEach(function(e){var i=this.window.performance.timing[e];void 0!==i&&(t[e]=i)}),t},s.prototype.getScreenRect=function(){return{left:0,top:0,right:(this.window.screen.left||this.window.screen.availLeft||0)+this.window.screen.availWidth,bottom:(this.window.screen.top||this.window.screen.availTop||0)+this.window.screen.availHeight,width:this.window.screen.availWidth,height:this.window.screen.availHeight}},s.prototype.getAppRect=function(){return{left:this.window.screenX,top:this.window.screenY,right:this.window.screenX+(this.window.outerWidth||this.window.innerWidth),bottom:this.window.screenY+(this.window.outerHeight||this.window.innerHeight),width:this.window.outerWidth,height:this.window.outerHeight}},s.prototype.getTopViewportRect=function(){if(this.hasTopAccess){var t=this.window.document.documentElement;return{left:0,top:0,right:t.clientWidth,bottom:t.clientHeight,width:t.clientWidth,height:t.clientHeight}}},s.prototype.getPageVisibilityState=function(){return this.window.document[this.VISIBILITYSTATE_PROPERTY]},s.prototype.onReadystatechange=function(){this.page.readyState=this.window.document.readyState},s.prototype.onPageload=function(){this.page.isLoaded=!0},s.prototype.onPageunload=function(){this.page.isLoaded=!1},s.prototype.onVisibilitychange=function(){n.merge(this.page,{visibilityState:this.getPageVisibilityState(),isHidden:this.window.document[this.HIDDEN_PROPERTY],isVisible:!this.window.document[this.HIDDEN_PROPERTY]})},s.prototype.getPageText=function(){if(!this.hasTopAccess)return"";var t=(this.window.document.title||"")+" "+this.window.location.href;if(this.window.document.body){for(var e=this.window.document.body.cloneNode(!0),i=e.querySelectorAll("script, style"),s=0,n=i.length;s]+?>/g," ")}for(var r=this.window.document.querySelectorAll("meta"),s=0,n=r.length;s= 2 && n < 13) return 5*60E3; if (n >= 13) return;"}},truncation:{"^hurl":2e3,"^iurl":1e3,"^url\\d+":300}},ad:{container:{search:{count:{max:2},scriptTextLength:{max:2500},interval:250}},creative:{iab:{units:{160:[600],180:[150],300:[250,600,1050],728:[90],970:[90,250]}},display:{selector:"img, iframe:not([class~=adlgdrgnexc]), object, embed"},video:{selector:"object, embed, video"},width:{min:80,max:"Infinity"},height:{min:30,max:"Infinity"}},search:{count:{max:60},interval:800},measure:{enabled:!0,iab:{desktop:{display:{standard:{pixels:{percentage:{min:50}},duration:{min:1e3}},large:{pixels:{threshold:242500,percentage:{min:30}},duration:{min:1e3}}},video:{standard:{pixels:{percentage:{min:50}},duration:{min:2e3}},large:{pixels:{threshold:242500,percentage:{min:30}},duration:{min:2e3}}}},mobile:{display:{standard:{pixels:{percentage:{min:50}},duration:{min:1e3}},large:{pixels:{threshold:242500,percentage:{min:50}},duration:{min:1e3}}},video:{standard:{pixels:{percentage:{min:50}},duration:{min:2e3}},large:{pixels:{threshold:242500,percentage:{min:50}},duration:{min:2e3}}}}},interval:100}},brandSafety:{mask:{enabled:!0},scan:{enabled:!0},webService:{path:"/fw/url_status.php",url:"https://ser.adledge.com/fw/url_status.php'"},apriori:["3814","3848","3877","3897","3916"],getPageTextTimeout:1e3},ivt:{timingsListLimit:50}}},function(t,e,i){function s(t){this.windows=[],this.encapsulationLevel=-1,this.isUnderXDomain=!1,this.urls=[],this.refs=[];var e=t.window,i=t.window;do{this.encapsulationLevel++,this.lastIframeWindow=i,this.isInPopup=this.isInPopup||null!=e.opener;var s={};try{s.object=e,s.url=e.location.toString(),s.protocol=e.location.protocol,this.highestWindow=e,this.highestUrl=s.url}catch(t){this.isUnderXDomain=!0}try{s.referrer=e.document.referrer.toString(),e!=top&&(this.highestUrl=s.referrer)}catch(t){}this.windows[this.encapsulationLevel]=s,i=e,e=e.parent}while(i!==t.window.top&&this.encapsulationLevel0&&this.windows[a-1].referrer?this.windows[a-1].referrer==this.highestUrl?this.urls[a]="adl_page":this.windows[a-1].referrer===this.window.url?this.urls[a]="adl_iframe":this.urls[a]=this.windows[a-1].referrer:s.url==this.highestUrl?this.urls[a]="adl_page":s.url==this.window.url&&(this.urls[a]="adl_iframe"),a===this.windows.length-1&&s.referrer&&(s.referrer===this.highestUrl?this.refs[a]="adl_page":s.referrer===this.window.url&&(this.refs[a]="adl_iframe"))}}var n=i(0),o=100;t.exports=s},function(t,e,i){function s(){this.executionStart=Date.now(),this.version="7e69932",this.window=window}var n=i(5);try{var o=i(8);s.prototype.getNode=function(){if(this.node)return this.node;if("currentScript"in this.window.document)return this.window.document.currentScript;for(var t=this.window.document.querySelectorAll('script[src*="//rs.adledge.com/aleagypkg"]'),e=0;e1&&this.session.data.set("occ",t)}},s.prototype.getAgentExecutionStartList=function(){var t=[],e=[],i=this.config.current.ivt.timingsListLimit;if(!this.agentExecutionStartListComplete){for(var s in r.sessions)if(r.sessions.hasOwnProperty(s)){var o=r.sessions[s];if(s===this.session.id)continue;(o.timing.agentExecutionStart<=this.session.timing.agentExecutionStart?t:e).push(o.timing.agentExecutionStart)}if(t.length||e.length){e=e.sort(n.compareNumbersAsc).slice(0,i),e.length>=i&&(this.agentExecutionStartListComplete=!0,r.unsubscribe({channel:".*",topic:"ivt:init",callback:this.getAgentExecutionStartList}));var a=t.sort(n.compareNumbersDesc).slice(0,i).concat(e);this.session.data.set("aesl",a)}}},t.exports=s},function(t,e,i){function s(t){this.controller=t,this.session=t.session,this.default=r,this.current=n.merge({},this.default)}var n=i(0),o=i(2).getInstance(),r=i(5);s.prototype.getParams=function(){var t={},e={};if(window[this.session.id])t=window[this.session.id];else{var i;if(this.session.agent.node.hasAttribute("alepar"))this.current.serializedParams=this.session.agent.node.getAttribute("alepar");else{var s=this.session.agent.node.getAttribute("src");if(!s)throw new Error("configParamsNoAgentNodeSrc");this.current.serializedParams=s.split("?")[1]}if(!this.current.serializedParams)throw new Error("configParamsNoSerialized");i=this.current.serializedParams.split("&");for(var n=0;n=this.current.ad.creative.width.min&&(t.ad.creative.width.clue=+s[0]),a&&a>=this.current.ad.creative.height.min&&(t.ad.creative.height.clue=+s[1])}else(this.params.wdt||this.params.hgt)&&(this.params.wdt&&this.params.wdt>=this.current.ad.creative.width.min&&(t.ad.creative.width.clue=+this.params.wdt),this.params.hgt&&this.params.hgt>=this.current.ad.creative.height.min&&(t.ad.creative.height.clue=+this.params.hgt));n.merge(this.current,t)},t.exports=s},function(t,e,i){function s(t){this.buffer={},this.session=t.session,this.config=this.session.config,this.sendCount={fail:0,success:0}}var n=i(0),o=i(3),r=i(2).getInstance(),a=i(1).getInstance();s.prototype.set=function(t,e){var i={};n.isObject(t)?i=t:i[t]=e;for(var s in i)if(i.hasOwnProperty(s))for(var o in this.config.current.data.truncation)if(this.config.current.data.truncation.hasOwnProperty(o)){var r=this.config.current.data.truncation[o],a=new RegExp(o);a.test(s)&&i[s].length>r&&(i[s]=n.truncate(i[s],r))}n.merge(this.buffer,i)},s.prototype.flush=function(t){if(this.config.current.data.flush.enabled){t||(t={}),t.event&&t.event.type&&(this.flushEvent=t.event.type);var e={fe:this.flushEvent,avc:Object.keys(r.window.adlgdrgn).length,ac:Object.keys(a.sessions).length},i=n.merge(r.getPerformanceTiming(),this.session.timing,{dataFlush:Date.now()});n.merge(e,this.buffer,{timing:i}),this.session.log.length&&n.merge(e,this.buffer,{log:this.session.log}),this.session.beacon=this.serialize(e);var s=n.merge({},this.config.current.data.flush.request,t.request,{data:this.session.beacon,context:this});new o(this.config.current.data.flush.url,s,this.onSent),a.publish({channel:this.session.id,topic:"data:flush",data:this})}},s.prototype.serialize=function(t){if(t)return this.session.ad&&this.session.ad.measures&&(t.msr=this.serializeMeasures(this.session.ad.measures)),t},s.prototype.serializeMeasures=function(t){for(var e=[],i=0,s=t.length;i150&&(a+="-"+n.floor10((r.timeStamp-this.session.timing.adMeasureFirst-100)/1e3).toFixed(1)):a+="-"+n.floor10((Date.now()-this.session.timing.adMeasureFirst)/1e3).toFixed(1),e.push(a)}return e.join("_")},s.prototype.onSent=function(t,e){t?(this.set({fc:{f:++this.sendCount.fail},ffr:e.toJSON()}),"sendBeacon"===t.type&&(this.config.current.data.flush.request.type="xhr",this.flush())):this.set({fc:{s:++this.sendCount.success}})},t.exports=s},function(module,exports,__webpack_require__){function BrandSafety(t){this.URL_STATUS_UNKNWON=0,this.URL_STATUS_PROPER=1,this.URL_STATUS_IMPROPER=2,this.URL_STATUS_NORMAL=3,this.URL_STATUS_ADSERVER=4,this.MASK_STATUS_ENABLED="true",this.MASK_STATUS_DISABLED="false",this.controller=t;var e=this.session=t.session,i=this.config=e.config;this.context=e.agent.context,metaController.clients[i.params.cltid]||(metaController.clients[i.params.cltid]={}),metaController.clients[i.params.cltid].brandSafety||(metaController.clients[i.params.cltid].brandSafety={url:{},mask:{},analyse:{count:0}}),this.clientConfig=metaController.clients[i.params.cltid].brandSafety,this.wsResponse={}}var Utils=__webpack_require__(0),Request=__webpack_require__(3),environment=__webpack_require__(2).getInstance(),metaController=__webpack_require__(1).getInstance();BrandSafety.prototype.isStatusDetermined=function(){return this.wsResponse.s==this.URL_STATUS_PROPER||this.wsResponse.s==this.URL_STATUS_IMPROPER||this.wsResponse.s==this.URL_STATUS_NORMAL&&this.wsResponse.m==this.MASK_STATUS_ENABLED},BrandSafety.prototype.getStatus=function(){var data={u:this.context.highestUrl,c:this.config.params.cltid};this.context.isHighestURLPage||(data.itu=0,data.iu=this.context.window.url),new Request(this.config.current.brandSafety.url,{method:"get",type:"xhr",async:!0,data:data,accept:"text/plain",context:this},function(err,request){try{if(err)throw err;if(request.response.split("&").map(function(t){return t.split("=")}).forEach(function(t){this.wsResponse[t[0]]=t[1]},this),!this.wsResponse.s||!this.wsResponse.m)throw new Error("missingParams");if(this.session.data.set("wss",this.wsResponse.s),this.clientConfig.url={status:eval(this.wsResponse.s),extracted:this.wsResponse.exu,extractedFrom:this.wsResponse.exus},this.clientConfig.url.extracted&&(this.context.highestUrl=this.clientConfig.url.extracted,this.session.data.set({hurl:this.clientConfig.url.extracted,iexu:"1",exus:this.clientConfig.url.extractedFrom})),this.isStatusDetermined())return this.clientConfig.mask.status=this.wsResponse.m,void metaController.publish({channel:this.controller.session.id,topic:"brandSafety:status",data:this});if(!this.config.current.brandSafety.scan.enabled||!environment.hasTopAccess)return void(this.context.isHighestURLPage||this.clientConfig.url.extracted||"2"!==this.config.params.fw||(this.clientConfig.mask.status=this.MASK_STATUS_ENABLED,metaController.publish({channel:this.controller.session.id,topic:"brandSafety:status",data:this})));environment.page.isLoaded?(environment.getPageText(),this.analyse()):metaController.barrier({channel:this.session.id,topics:["page:load"],context:this,timeout:this.config.current.brandSafety.getPageTextTimeout,callback:function(){this.clientConfig.analyse.count||(environment.getPageText(),this.analyse())}})}catch(t){this.controller.log(t,{type:"brandSafetyGetStatus",level:"error",response:request.response})}})},BrandSafety.prototype.getKeywordsList=function(){var t=[];switch(this.config.params.cltid){case"3848":case"3877":t.push(this.keywordsLists.affiperfFR);break;case"3897":t.push(this.keywordsLists.emirates);break;case"3942":t.push(this.keywordsLists.bnp);break;case"3814":Utils.inArray(["144092","bnp","4134870","hellobank"],this.config.params.advid)&&t.push(this.keywordsLists.bnp)}return t.push(this.keywordsLists.common),t},BrandSafety.prototype.analyse=function(){environment.page.text&&(this.clientConfig.analyse.status="running",this.clientConfig.analyse.count++,new Request(this.config.current.protocol+"//"+this.config.current.host.cdn+"/brandSafety.json",{method:"get",type:"xhr",async:!0,accept:"application/json",responseType:"json",context:this},function(t,e){try{if(t)throw t;this.keywordsLists=e.response;(this.clientConfig.keywordsList=this.getKeywordsList()).some(function(t){for(var e in t){var i=t[e];if(!(environment.page.text.indexOf(e)<0)){if(new RegExp(i||"\\b"+e+"\\b").test(environment.page.text))return this.session.data.set("kw",this.clientConfig.badKeyword=e),(Utils.inArray(this.config.current.brandSafety.apriori,this.config.params.cltid)||"2"===this.config.params.fw)&&metaController.publish({channel:this.controller.session.id,topic:"brandSafety:status",data:this}),!0}}},this),this.clientConfig.analyse.status="complete"}catch(t){this.controller.log(t,{type:"brandSafetyAnalyse",level:"error"})}}))},module.exports=BrandSafety},function(t,e,i){function s(t){this.controller=t;var e=this.session=t.session;this.agent=e.agent,this.config=e.config,this.tag=e.tag,this.type=n.inArray([p,g,f],e.config.params.vid)?"video":"display",this.container={},this.creative={},this.mask={},this.creativeNodesFilter=this.creativeNodesFilterFactory(),this.measures=[],this.iab={requirement:{rule:this.config.current.ad.measure.iab[r.device.type][this.type]},measure:{}},this.previous={pageIsVisible:r.page.isVisible},this.viewable={},this.viewability=this.viewabilityFactory(),this.viewability||this.controller.log({type:"adNoGetViewabilityMethod",level:"error"}),this.searchCount=0,this.search()}var n=i(0),o=i(4),r=i(2).getInstance(),a=i(1).getInstance(),h=i(6),c=i(14),d=i(15),l=i(16),u=i(17),p="1",g="3",f="4";s.prototype.viewabilityFactory=function(){return!this.agent.context.isUnderXDomain||document.body.fireEvent?d:"IntersectionObserver"in window?c:"mozInnerScreenX"in window?d:r.browser.is.ie||r.browser.is.edge&&r.browser.userAgentInduced.version.major<=13?l:r.browser.is.safari?u:void 0},s.prototype.creativeNodesFilterFactory=function(){return"video"===this.type?this.videoCreativeNodesFilter:this.displayCreativeNodesFilter},s.prototype.displayCreativeNodesFilter=function(t){if(t){var e=t.getBoundingClientRect&&t.getBoundingClientRect();if(e&&!(e.widththis.config.current.ad.creative.width.max||e.heightthis.config.current.ad.creative.height.max)){if(this.config.params.pty){if(!t.hasAttribute(this.config.params.pty))return;var i=t.getAttribute(this.config.params.pty);if(!i)return;if(!this.config.params.vle)return;if(i!==this.config.params.vle)return}if(!(this.config.current.ad.creative.width.clue&&Math.abs(e.width-this.config.current.ad.creative.width.clue)>10||this.config.params.mwdt&&e.width10||this.config.params.mhgt&&e.heightthis.config.current.ad.creative.width.max||e.heightthis.config.current.ad.creative.height.max)){if("1"==this.config.params.vid||"2"==this.config.params.vid){if(!this.config.params.pty)return;if(!t.hasAttribute(this.config.params.pty))return;if(!t.getAttribute(this.config.params.pty))return}if(!(this.config.params.mwdt&&e.width=this.config.current.ad.search.count.max)return void this.controller.log({type:"adSearchCtrselSelector",level:"fatal",message:"ctrsel selector '"+this.config.params.ctrsel+"' provided "+i.length+" results"});this.container.node=i[0]}else{if(this.searchContainer(),!this.container.node){if(this.agent.context.isInIframe&&this.agent.node&&this.agent.node.parentNode&&"head"===this.agent.node.parentNode.tagName.toLowerCase()){if(this.searchCount=this.config.current.ad.search.count.max)return void this.controller.log({type:"adSearchCtvselSelector",level:"fatal",message:"ctvsel selector '"+this.config.params.ctvsel+"' provided "+e.length+" results"})}else e=(this.container.node||this.agent.context.window.object.document).querySelectorAll(this.config.current.ad.creative[this.type].selector);var s=Array.prototype.slice.call(e).filter(this.creativeNodesFilter,this);if(!s.length&&this.agent.context.hasTopAccess&&this.agent.context.isInIframe&&!this.agent.context.isUnderXDomain){var c=o.getRect(this.agent.window.frameElement),d=r.window.document.createTreeWalker(r.window.document.body,NodeFilter.SHOW_ELEMENT,function(t){if(t===this.agent.window.frameElement||!n.matchesSelector(t,this.config.current.ad.creative[this.type].selector))return NodeFilter.FILTER_SKIP;var e=o.getRect(t);return o.equals(c,e,2)?NodeFilter.FILTER_ACCEPT:void 0}.bind(this),!1);d.nextNode()&&(s=[d.currentNode].filter(this.creativeNodesFilter,this))}s.length&&(this.creative.node=s[0],t=this.creative,t.config=this.config.current.ad.creative),t?(this.object=t,this.window=t.node.ownerDocument.defaultView,this.context=this.window===this.agent.window?this.agent.context:new h(this),this.session.ad=this,this.viewability&&this.viewability.init.apply(this),this.controller.setTiming({adSearchComplete:Date.now()}),a.publish({channel:this.controller.session.id,topic:"ad:search:complete",data:this})):this.searchCount0&&p.length0&&c.test(p)&&(!d||d.test(p))&&!n.inArray(t,u)){this.container.node=u.parentNode;break}}}else for(var l=0;l0&&p.length0&&!n.inArray(t,u)){this.container.node=u.parentNode;break}}},s.prototype.measure=function(){try{if(!this.session.config.current.ad.measure.enabled)return;if(r.browser.is.ie&&(!this.object.node||!this.object.node.parentNode))return;var t=Date.now();if(this.measureStart||(this.measureStart=t,this.controller.setTiming({adMeasureStart:this.measureStart}),a.publish({channel:this.controller.session.id,topic:"ad:measure:start",data:this})),this.viewability.get.apply(this),n.isInt(this.viewable.percentage)){var e=!1;r.page.isVisible!==this.previous.pageIsVisible&&(r.page.isVisible?("number"==typeof this.previous.viewablePercentage&&(this.viewable.percentage=this.previous.viewablePercentage),this.previous.viewablePercentage=0):(this.previous.viewablePercentage=this.viewable.percentage,this.viewable.percentage=0),this.previous.pageIsVisible=r.page.isVisible,e=!0),r.page.isVisible&&this.viewable.percentage!==this.previous.viewablePercentage&&(this.previous.viewablePercentage=this.viewable.percentage,e=!0),e&&(this.previous.timeStamp=t,this.measures.push({viewablePercentage:this.viewable.percentage,pageIsVisible:r.page.isVisible,timeStamp:t}),a.publish({channel:this.controller.session.id,topic:"ad:viewability:change",data:this})),this.measures.length&&(this.measureFirst||(this.measureFirst=t,this.controller.setTiming({adMeasureFirst:this.measureFirst}),a.publish({channel:this.controller.session.id,topic:"ad:measure:first",data:this}),this.getRect(),this.area=this.object.rect.getArea(),this.format=this.area>=this.iab.requirement.rule.large.pixels.threshold?"large":"standard",this.iab.requirement.percentage=this.iab.requirement.rule[this.format].pixels.percentage.min,this.iab.requirement.duration=this.iab.requirement.rule[this.format].duration.min),this.viewable.percentage>=this.iab.requirement.percentage&&r.page.isVisible?this.iab.measure.timeStamp||(this.iab.measure.timeStamp=t):delete this.iab.measure.timeStamp,!this.iab.measure.taken&&this.iab.measure.timeStamp&&t-this.iab.measure.timeStamp>=this.iab.requirement.duration&&(this.iab.measure.taken=!0,this.controller.setTiming({adViewabilityIab:t}),a.publish({channel:this.controller.session.id,topic:"ad:viewability:iab",data:this})))}this.measureTimeoutId=setTimeout(this.measure.bind(this),this.config.current.ad.measure.interval)}catch(t){this.controller.log(t,{type:"adMeasure",level:"error"})}},s.prototype.disableMeasure=function(){this.session.config.current.ad.measure.enabled=!1,clearTimeout(this.measureTimeoutId)},s.prototype.getRect=function(){return this.object.rect=o.getRect(this.object.node)},s.prototype.getSize=function(){var t=this.getRect();if(t.width&&t.height)return Math.round(t.width)+"x"+Math.round(t.height)},s.prototype.getPageOffset=function(){for(var t=this.getRect(),e=0;e=o.window.innerWidth&&o.window.outerHeight>=o.window.innerHeight?(this.topViewportOffset.X=o.window.outerWidth-o.window.innerWidth,this.topViewportOffset.Y=o.window.outerHeight-o.window.innerHeight):o.browser.name in a&&(this.topViewportOffset.X=a[o.browser.name].X,this.topViewportOffset.Y=a[o.browser.name].Y);var e,i=o.getScreenRect(),r=o.getAppRect(),h={left:r.left+this.topViewportOffset.X,top:r.top+this.topViewportOffset.Y,right:r.right,bottom:r.bottom,width:r.width,height:r.height},c=n.getIntersectionRect(i,h);if(this.context.isInIframe)if(this.context.isUnderXDomain)"mozInnerScreenX"in this.window?e={left:this.window.mozInnerScreenX,top:this.window.mozInnerScreenY,right:this.window.mozInnerScreenX+this.window.innerWidth,bottom:this.window.mozInnerScreenY+this.window.innerHeight,width:this.window.innerWidth,height:this.window.innerHeight}:this.window.document.body.fireEvent&&(!this.ieAttachedEvent&&this.window.document.body.attachEvent("onmousemove",function(t){this.ieEventLeft=t.screenX-t.clientX,this.ieEventTop=t.screenY-t.clientY,this.ieAttachedEvent=!0}.bind(this)),this.window.document.body.fireEvent("onmousemove"),e={left:this.ieEventLeft||0,top:this.ieEventTop||0,right:this.ieEventLeft+this.window.innerWidth||0,bottom:this.ieEventTop+this.window.innerHeight||0,width:this.window.innerWidth,height:this.window.innerHeight});else{var d=this.window.frameElement.getBoundingClientRect();e={left:this.window.screenX+this.topViewportOffset.X+d.left,top:this.window.screenY+this.topViewportOffset.Y+d.top,right:this.window.screenX+this.topViewportOffset.X+d.right,bottom:this.window.screenY+this.topViewportOffset.Y+d.bottom,width:d.width||d.right-d.left,height:d.height||d.bottom-d.top}}else e={left:this.window.screenX+this.topViewportOffset.X,top:this.window.screenY+this.topViewportOffset.Y,right:this.window.screenX+this.window.innerWidth+this.topViewportOffset.X,bottom:this.window.screenY+this.window.innerHeight+this.topViewportOffset.Y,width:this.window.innerWidth,height:this.window.innerHeight};var l=n.getIntersectionRect(c,e);l.left-=this.window.screenX,l.top-=this.window.screenY,l.right-=this.window.screenX,l.bottom-=this.window.screenY,l.right-=this.topViewportOffset.X,l.bottom-=this.topViewportOffset.Y,l.left-=this.topViewportOffset.X,l.top-=this.topViewportOffset.Y,this.context.isInIframe&&(l.right-=l.left,l.bottom-=l.top,l.left=-l.left,l.top=-l.top);var u={left:0,top:0,right:t.clientWidth,bottom:t.clientHeight,width:t.clientWidth,height:t.clientHeight},p=n.getIntersectionRect(l,u);if(!s.contains(t,this.object.node))return this.viewable.percentage=0;if(!this.object.node.offsetWidth||!this.object.node.offsetHeight)return this.viewable.percentage=0;this.getRect(),this.area=this.object.rect.width*this.object.rect.height;var g=n.getIntersectionRect(this.object.rect,p);if(0==(this.viewable.area=Math.max(g.width*g.height,0)))return this.viewable.percentage=0;var f={X:1,Y:1},m={leftTop:{x:g.left+f.X,y:g.top+f.Y},rightTop:{x:g.right-f.X,y:g.top+f.Y},rightBottom:{x:g.right-f.X,y:g.bottom-f.Y},leftBottom:{x:g.left+f.X,y:g.bottom-f.Y}},w=[],b=[];for(var v in m){var y=m[v],x=document.elementFromPoint(y.x,y.y);if(x&&x!=this.object.node&&!(s.getOpacity(x)<.3)&&!(w.indexOf(x)>-1)){var S=x.getBoundingClientRect(),A=n.getIntersectionRect(g,S),I=A.width*A.height;this.viewable.area-=I;for(var E=0,T=b.length;El?0:1,s.latestTimeStamp=s.timeStamp,s.timeStamp=e,s.activated=!0,u)return;for(var c=0,d=0,p=this.iframePixels.length;dl||document.hidden)&&(s.viewable=0),t+=s.viewable}return this.viewable.percentage=Math.round(100*t/h)}}]);