100*q.random());return a[b]},c={rt:"rattie",cb:"cachebust",th:"tabHiddenDtCall",es:"everySecond",sa:"swapids",
sc:"usesca",ha:"usehaps"},d={gm:"use100v",fif:"useFIF"},f=function(){var b,f;b=e(c).mapToObj(function(b,c){var d={};d[b]=e.fromBoolToNum(a[c]);return d});f=e(d).mapToObj(function(a,b){var c={};c[a]=e.fromBoolToNum(g(b));return c});f.gm=e.fromBoolToNum(u.usesIASFullyInViewCustomMetric());return e(b).mixin(f)},g=function(a){a=r[a];return!0===a||"true"===a||e.isFunction(a)};e(c).each(function(a,c){b(c)});return{on:b,bootstrapOn:g,bootstrapperHas:function(a){a=e.isStr(a)?[a]:a;return e(a).map(function(a,
b){if(e.isDef(r[b]))return 1}).length===a.length},getEnabledScriptUrl:function(a){var c=b("use"+a);a=r.sp_cdnScripts&&r.sp_cdnScripts[a];return c&&a},output:function(){return e(f()).toParams()}}},La=function(a){var b=h.BROWSERS,c=k.request("intersectionWatcher");return{calcInitialViewState:function(d,f,e){var p={IN_VIEW:65,OUT_OF_VIEW:25,PARTIAL_VIEW:30},m={IN_VIEW:75,OUT_OF_VIEW:25,PARTIAL_VIEW:50},l=h.NA,s=!u.xDomainIframe||c.isStarted()||a.browserIs(b.GECKO)||a.browserIs(b.IE);e=e?p:m;if(s||f)l=
d===h.PIV_NA?h.NA:d>=e.IN_VIEW?h.IN_VIEW:d<=e.OUT_OF_VIEW?h.OUT_OF_VIEW:d>=e.PARTIAL_VIEW?h.PARTIAL_VIEW_PLUS:h.PARTIAL_VIEW_MINUS;return l},calcPercentInView:function(a,b,g,p){var m=0,l=a;c.isStarted()?m=c.getPiv():a.hasValidDims()&&!a.isHidden()&&(e([b,g,p]).each(function(a,b){if(b.hasValidDims()){var c=l.getRounded(),d=b.getRounded(),f=Math.max(c.scrX,d.scrX),e=Math.max(c.scrY,d.scrY),p=Math.min(c.scrX+c.width,d.scrX+d.width),c=Math.min(c.scrY+c.height,d.scrY+d.height),p=p-f,c=c-e;l=G({scrX:f,
scrY:e,width:0a.length;)c?(b=new Uint32Array(1),w.crypto.getRandomValues(b),a+=b[0].toString(16)):a+=(16*q.random()|0).toString(16);a=a.slice(0,32)}catch(d){k.trigger("error",
h.ERROR_CODES.UID_GENERATION)}return a}());var d=function(){return r.anId};return{getAsid:function(){return r.asid},getAnId:d,getCacheBustId:function(){var a=new Date,b=Date.parse("Jan 1 "+a.getFullYear()),a=a.getTime()-b;return e.toBase(a,62)},getFwId:function(){return d()||r.advEntityId+"-"+r.pubEntityId},impressionIsIdentifiable:function(a){a&&(b=!0);return b},unq:a,getAvidIds:function(){return c},setAvidAdSessionContext:function(a){c=a}}},Ka=function(a){var b,c,d=k.request("features"),f=function(){var f,
g,m,B,D=q.getMaxNumber();f=q.getMaxNumber();g=q.getWindow();q.getDoc();u.friendly?(f=p(),m=f.left,B=f.top,D=f.width,f=f.height,g=v.windowPosition(),m=g.scrX+m,B=g.scrY+B):d.on("rattie")&&a.browserIs(h.BROWSERS.IE)?(c=c||k.request("ieXDomainViewability"),b=c.determineFramePosition(),m=b.scrX,B=b.scrY):e.isDef(g.mozInnerScreenX)&&(m=q.round(g.mozInnerScreenX),B=q.round(g.mozInnerScreenY));return{scrX:m,scrY:B,iFrameClippingWidth:D,iFrameClippingHeight:f}},g=function(){var a,b,c=v.getIeDimObj(),d=q.getWindow();
e.isDef(d.innerWidth)?(a=d.innerWidth,b=d.innerHeight):c&&e.isDef(c.clientWidth)?(a=c.clientWidth,b=c.clientHeight,0===a&&0")),f;if(f=e.isDef(d)){var g=b.getWindow();f=!1;e.isDef(g.navigator)&&e.isDef(g.navigator.userAgent)&&(g=g.navigator.userAgent.match(/Firefox\/([\.0-9]+)/),null!==g&&2==g.length&&(g=g[1].split("."),3==parseInt(g[0],10)&&6>=parseInt(g[1],10)&&(3==g.length?13>=parseInt(g[2],10)&&(f=!0):f=!0)))}f&&(a.g=d)}return a},l=
{};try{l.a=encodeURIComponent(top.location.href)}catch(h){}try{l.b=encodeURIComponent(parent.location.href)}catch(t){}if(u.embedded){try{l.c=encodeURIComponent(parent.document.referrer)}catch(k){}try{l.e=encodeURIComponent(w.document.referrer)}catch(q){}}try{"jsi"!==r.mode&&(l.d=encodeURIComponent(w.location.href))}catch(A){}try{l.f=encodeURIComponent(r.jsref)}catch(H){}try{g=m(),l.g=encodeURIComponent(g.g||""),l.q=encodeURIComponent(g.q||""),a.isStarted()&&!g.g&&1b.val.length?1:a.val.length=a?90:122)>=(a=a.charCodeAt(0)+13)?a:a-26)})},stringToFn:function(a){var b,c=w,d=a.split(".");for(a=0;ab&&c("ha1",a);b++};(function(){var b,e;u.embedded&&q.execAtEndOfThread(function(){try{e=r.contextNode.parentNode;var p=b=fc().getDFPValue(e),m={};m.df=p.type;p.size&&(m.sz=p.size.width+"."+p.size.height);p.tag&&(m.dom=p.tag);c("dfp",m);b.size&&a&&(a.events.on("newState",d),a.start())}catch(l){k.trigger("error",h.ERROR_CODES.HIDDEN)}})})()},{tier:h.TIERS.PRE_IMPRESSION_FRAUD,applies:function(a,b,c){return a.on("usehaps")}});
var Ba=function(a){var b,c,d,f=new ia,g=new W,p=new hc(f),m=new ic,l=new jc,h=new kc(f,a),t=function(){e.isUndef(d)&&(d=new lc(f));return d},q=function(){f.provide({frameCollection:function(){return p},adProxy:function(){return l},adTalkMessage:function(a){return new mc(a,f)},adTalkMessageCollection:function(){return m},idMapModule:t,interFrameQuerySelector:function(a){return new nc(a)}})};return{isApplicable:function(a){return e.isDef(w.JSON)&&e.isDef(w.postMessage)&&!a.isAvid()},start:function(){q();
g.traverse(p.addFrame);h.startListening();h.sendToKnownFrames();k.once("stopAdTalk",function(){h.stopListening()})},sendAdTalkCall:h.sendAdTalkCall,getFrameMap:function(){e.isUndef(b)&&(b=new oa(f));return b},getFrameMapIncludingPeerCase:function(){e.isUndef(c)&&(c=new oa(f,!0));return c},getIdMap:t}},mc=function(a,b){var c,d=b.request("adProxy").myIdCard,e=b.request("frameCollection").getMe().getStringifiedPosition();c=k.request("features").on("swapids")?r.oid:r.asid;var g=a||{},p=r.asid,d=d.tagId,
m=u.embedded,l=u.friendly,s=r.birthdate;c=c.split("-")[2];var t;u.friendly?t="["+h.AD_IDENTIFIER+"-"+r.asid+"]":(t=q.getWindow(),t=t.location&&t.location.href,t='iframe[src*="'+(t&&t.replace(/^https?\:\/\//i,""))+'"]');return{messageContent:g,srcAsid:p,srcTagId:d,srcIsEmbedded:m,srcIsFriendly:l,srcBirthdate:s,iasCommonId:c,nodeSelector:t,positionStr:e,version:"0.1"}},ic=function(){var a={};return{add:function(b,c){var d=b&&b.srcAsid;d&&!a[d]&&(a[d]=b,d!==r.asid&&e.isFunction(c)&&c(b))},map:function(b){return e(a).map(b)},
has:function(b){return a[b]}}},oc=function(a,b,c,d){var f,g=a==w;f={position:b.slice(0),id:b.join("-"),isMe:g,isLeaf:!a.frames.length,adProxies:g?c:[],selfDescription:void 0,unifiedId:r.birthdate,srcIsEmbedded:d?d.srcIsEmbedded:void 0,inbox:d?[d]:[],getDomObj:function(){return a},getStringifiedPosition:function(){return e(f.position).map(function(a,b){return e.toBase(Number(b)+1,36)}).join("")},isValidForMapping:function(){return f.isLeaf||f.isMe||e.isDef(f.selfDescription)}};var p=function(a){var b=
f.adProxies;a=a.adProxies;var c=[];b.length&&a.length?e(a).each(function(a,d){m(b,d)&&c.push(d)}):c=a;f.adProxies=b.concat(c)},m=function(a,b){return!e(a).find(function(a,c){return c.adSafeId&&c.adSafeId===b.adSafeId})},l=function(a){e(f.inbox).find(function(b,c){return c.srcAsid&&c.srcAsid===a.srcAsid})||f.inbox.push(a)};f.addInformationFromSrc=function(a,b){p(b);l(a);f.srcIsEmbedded=a.srcIsEmbedded;f.selfDescription=b};return f},hc=function(a){var b=[],c={},d={noMe:!0};return{addFrame:function(e,
g,p){var m=a.request("adProxy").getAll();e=new oc(e,g,m,p);b.push(e);c[e.id]=e;e.isMe&&(d=e);return e},getFrame:function(a){return c[a]},list:b,dictionary:c,getMe:function(){return d}}},oa=function(a,b){var c=function(a,c){var e=c.adProxies,m="";if(c.isValidForMapping()){if(b)m+=d(e,c.getStringifiedPosition());else{var l;l=""+c.getStringifiedPosition();l+=c.isMe?"*":"";l+=e.length?"."+e[0].tagId:"";m+=l}return m}},d=function(a,b){var c="";return c=a.length?c+e(a).stringify(function(a,c){return b+
(r.asid===c.adSafeId?"*":"")+"."+c.tagId},"|"):c+b};return{output:function(){var b=a.request("frameCollection"),d=e(b.list).stringify(c,"|");return e.toBase(b.getMe().unifiedId,62)+"+"+d}}},lc=function(a){var b=a.request("frameCollection").getMe().getStringifiedPosition(),c=r.contextNode.parentNode,d=a.request("interFrameQuerySelector",c),e=function(a){var b=a.length;return 120b.unifiedId&&(a.unifiedId=b.unifiedId)},m=function(a){return q.now()-a.sentTime},l=function(){var c=h.DT_CODES.ADTALK;a.request("frameCollection");b||(b=!0);k.trigger("sendDt",c)},s=function(a){return e.isUndef(a)||e.isUndef(a.selfDescription)},
t=function(c,d,e){var f=!1,g,t,q,r;try{g=a.request("frameCollection"),t=d.messageContent.self,p(g.getMe(),t),d.transferDuration=m(d),q=g.getFrame(t.id),a.request("adTalkMessageCollection").add(d,function(){f=!0}),s(q)||f?(q=q||g.addFrame(c.source,t.id.split("-"),d),q.addInformationFromSrc(d,t),e()):q.addInformationFromSrc(d,t),(r=b&&f&&a.request("idMapModule").isCandidateForMyIdMap(d))&&l()}catch(u){k.trigger("error",h.ERROR_CODES.ADTALK_DUBIOUS)}};return{sendAdTalkCall:l,sendToKnownFrames:function(){(new la).send(g)},
startListening:function(){c=new ka;c.listen(f,t,g)},stopListening:function(){c&&c.stop()},validateMessage:f,processMessage:t,createMessage:g}},pc=function(){var a=k.request("ids"),b=a.getAsid();return{tagId:a.getFwId(),adSafeId:b}},jc=function(){var a,b=[],c=function(a){a=new pc(a);b.push(a);return a};a=c();return{createNew:c,getAll:function(){return b},myIdCard:a}},Ja=function(a){var b,c,d=!1,e=q.getDoc().documentElement,g=function(a){var e=!0;d&&(d=!1,a.stopPropagation(),a.preventDefault(),b=a.screenX-
a.clientX,c=a.screenY-a.clientY,e=!1);return e};a.browserIs(h.BROWSERS.IE)&&x.addEvent(e,"click",g,!0);return{determineFramePosition:function(){a.browserIs(h.BROWSERS.IE)&&(d=!0,e.click());return{scrX:b,scrY:c}}}},Ia=function(){var a=h.NA,b=!1,c=function(a){if(!e.isUndef(a)){var b=q.getDoc().createElement("div");e(b.style).mixin({position:"absolute",width:"100%",opacity:"0",height:"100%",zIndex:-999,top:"0px",left:"0px"});b[h.IAS_DETECTOR]=!0;a.appendChild(b);return b}};return{getPiv:function(){return a},
isApplicable:function(a,b,c){var e=k.request("mobileApp");return(a.browserIs(h.BROWSERS.CHROME)||a.isAndroidWebViewBrowser())&&!e.isMobileAppEnvironment()&&a.hasIntersectionObserver()&&c.xDomainIframe&&b.on("chromeNativeIO")},start:function(){var d=q.getIntersectionObserver(function(b){b=b.pop();a=Math.min(b.intersectionRect.width*b.intersectionRect.height/(b.boundingClientRect.width*b.boundingClientRect.height)*100,100)},{threshold:[0,0.01,0.25,0.3,0.5,0.75,0.8,0.99,1]});q.execAtEndOfThread(function(){a===
h.NA&&(a=0)});d.observe(c(q.getDoc().body));q.execAtEndOfThread(function(){u.isBustedIframe()||k.trigger("delayedViewabilityReady")});b=!0},isStarted:function(){return b}}},ca=function(){var a=!1;(function(){x.whenReady(function(){k.trigger("startViewabilityLoop");a=!0})})();return{loopStarted:function(){return a}}};L("loopDelay",[],ca,{applies:function(a,b,c){return a.bootstrapOn("allowViewability")},tier:h.TIERS.VIEWABILITY});var qc=function(){return{start:function(a){k.on("measurable",function(){a()})},
isApplicable:function(a,b){return!b.browserIs(h.BROWSERS.WEBKIT)}}},rc=function(){return{start:function(a){a()},isApplicable:function(a){return a.isImmediatelyMeasurable()}}},db=function(a,b,c){var d=!1,f=function(){b.impressionIsIdentifiable()&&!d&&(d=!0,k.trigger("notify",r._onMeasurable))};return{start:function(){var b;b=[sc(),tc(),rc(),qc()];(b=e(b).findFirst(function(b,d){return d.isApplicable(c,a)}))&&b.start(f)},isApplicable:function(a){return a.bootstrapOn("useViewabilityNotification")&&e.isDef(r._onMeasurable)}}},
tc=function(){return{start:function(a){bc(k,["adImpression","measurable"]).onAll(function(){a()})},isApplicable:function(a,b){return!b.browserIs(h.BROWSERS.WEBKIT)&&u.isVideo()}}},sc=function(){return{start:function(a){k.on("adImpression",function(){a()})},isApplicable:function(a){return a.isImmediatelyMeasurable()&&u.isVideo()}}},Ab=function(a,b,c){var d=["rjss","jss","jload"],f=function(){var b=!1,c=a.getAvidAdSessionContext();e.isDef(c)&&(b=c.isDeferred);return!b};return{accepts:function(){var a=
e.isDef(e(d).find(function(a,b){return b===c}));return b.accepts()&&b.isMediaType(h.MEDIA_TYPE.DISPLAY)&&a},isImmediate:f,isMediaType:b.isMediaType,start:function(){f()||a.addEventListener("ready",function(){k.trigger("adImpression")})}}},zb=function(a){return{accepts:function(){return a.isAvidAvailable()},getAvidAdSessionContext:function(){return a.getAvidAdSessionContext()},isMediaType:function(b){var c,d=a.getAvidAdSessionContext();a.isAvidAvailable()&&e.isDef(d)&&(c=d.mediaType||h.MEDIA_TYPE.DISPLAY);
return b===c},supportsAdContainerGeometry:function(){var b=!1,c=a.getAvidAdSessionContext();e.isDef(c)&&(b=c.avidJsVersion,(c=e.isUndef(b))||(c=e.getNum(b.split(".")[0]),b=e.getNum(b.split(".")[1]),c=2===c?7<=b:3<=c),b=c);return b}}},yb=function(a,b){var c,d=function(a){var d,e,m;try{d=a.eventData.percentageInView,e=c&&75<=d,m={windowDimensions:{x:0,y:0,width:0,height:0},adDimensions:{x:0,y:0,width:0,height:0},containerDimensions:{x:0,y:0,width:0,height:0},shouldDelegateToDomBasedViewability:e,isMeasurable:0===
d||75<=d,isObstructed:!1,isHidden:!1,numberOfAdverts:1,percentageInView:d,detectionMethod:"av"},b.trigger("screenLocationChanged",m)}catch(l){}};return{start:function(){try{var b=a.getAvidAdSessionContext().avidAdSessionType;c="display"===b||"video"===b;a.addEventListener("viewability",d)}catch(e){}},addScreenLocationChangedListener:function(a){b.on("screenLocationChanged",a)}}},Cb=function(a,b,c){var d=["rjss","jss","jload"];return{accepts:function(){var a=e.isDef(e(d).find(function(a,b){return b===
c}));return b.accepts()&&b.isMediaType(h.MEDIA_TYPE.VIDEO)&&a},isImmediate:function(){return!1},isMediaType:b.isMediaType,start:function(){try{a.addEventListener("video",function(a){"AdImpression"===a.eventSubType&&k.trigger("adImpression")})}catch(b){}}}},Bb=function(a,b){var c=function(a){try{b.trigger("videoPlaybackEvent",{eventType:a.eventSubType,eventData:a.eventData})}catch(c){}};return{start:function(){a.addEventListener("video",c)},addVideoPlaybackEventListener:function(a){b.on("videoPlaybackEvent",
a)}}},aa=function(a,b){var c=!1,d=function(a){var d=a.percentageInView;c=!0;a.viewState=50<=d?h.IN_VIEW:h.OUT_OF_VIEW;a.outOfViewReason=50<=d?"":h.OUT_OF_VIEW_REASONS.GEOM;b.trigger("measurementChanged",a)};return{start:function(){k.trigger("addOutputItem",{output:h.MEDIA_TYPE.DISPLAY_CODE},h.MEDIA_TYPE_CODE,{type:h.IMPRESSION_EVENT});a.addScreenLocationChangedListener(d);a.start()},getStrategyName:function(){return h.MEASUREMENT_STRATEGY.DISPLAY},addMeasurementChangedListener:function(a){b.on("measurementChanged",
a)},isMeasurable:function(){return c}}},Qb=function(a,b,c){var d=e.isDef(a)?a.environment:void 0,f=e.isDef(a)?a.measurementStrategy:void 0,g=function(){return e.isDef(f)};e.isDef(b)&&b.start();return{hasMeasurementStrategy:g,getScreenLocationInfo:function(a){return b.create(a)},isImmediate:function(){return g()?d.isImmediate():!0},isMeasurable:function(){return g()?f.isMeasurable():!1},isMediaType:function(a){return g()?d.isMediaType(a):!1},start:function(){g()&&d.start()},requiresDelayedViewabilityEvent:function(){g()&&
b.requiresDelayedViewabilityEvent()}}},ga=function(a){return{resolve:function(){var b=e(a).findFirst(function(a,b){return b.environment.accepts()});if(e.isDef(b))return b}}},Pb=function(a,b){var c=!1,d,f={winDimensions:G({scrX:0,scrY:0,width:0,height:0}),adDimensions:G({scrX:0,scrY:0,width:0,height:0}),containerDimensions:G({scrX:0,scrY:0,width:0,height:0}),method:h.NA,viewState:h.NA,percentInView:h.NA,reason:"",obstructed:h.NA,isHidden:h.NA,tabHidden:h.NA,posViewState:h.NA,adCompCount:1},g=function(a){return a?
new G({scrX:a.x,scrY:a.y,width:a.width,height:a.height}):G({scrX:0,scrY:0,width:0,height:0})},p=function(a){d={winDimensions:g(a.windowDimensions),adDimensions:g(a.adDimensions),containerDimensions:g(a.containerDimensions),method:a.detectionMethod||h.NA,viewState:a.viewState||h.NA,percentInView:e.isDef(a.percentageInView)?a.percentageInView:h.NA,reason:a.outOfViewReason||"",obstructed:e.stringifyTriState(a.isObstructed),isHidden:h.NA,tabHidden:h.NA,posViewState:a.viewState||h.NA,adCompCount:1,shouldDelegateToDomBasedViewability:a.shouldDelegateToDomBasedViewability};
a.isMeasurable&&c&&(c=!1,k.trigger("delayedViewabilityReady"))};return{create:function(a){var c=f;if(e.isDef(d))if(b)c=d;else if(d.shouldDelegateToDomBasedViewability)c=a,c.method=d.method;else if(0===d.percentInView||75<=d.percentInView)c=d;return c},start:function(){var b;e.isDef(a)&&e.isDef(a.measurementStrategy)&&(b=a.measurementStrategy,b.addMeasurementChangedListener(p),b.start())},requiresDelayedViewabilityEvent:function(){c=!0}}},ea=function(a,b,c){var d=!1,f=!1,g=!1,p,m,l,s,t=function(){if(!e.isUndef(m)){var a=
[],b,k;d?(f?(k=!1,b=100):(k=s,b=l),50>b&&a.push(h.OUT_OF_VIEW_REASONS.GEOM)):(k=!1,b=0,a.push(h.OUT_OF_VIEW_REASONS.VIDEO));g=!0;m.shouldDelegateToDomBasedViewability=k;m.percentageInView=b;m.viewState=50>b?h.OUT_OF_VIEW:h.IN_VIEW;m.outOfViewReason=a.join(".");p=m;c.trigger("measurementChanged",p)}},q=function(a){m=a;l=a.percentageInView;s=a.shouldDelegateToDomBasedViewability;t()},r=function(a){a=a.eventType;"AdEnteredFullscreen"===a?f=!0:"AdExitedFullscreen"===a?f=!1:-1!=="AdStarted|AdVideoStart|AdPlaying".indexOf(a)?
d=!0:-1!=="AdSkipped|AdUserClose|AdPaused|AdVideoComplete|AdStopped".indexOf(a)&&(d=!1);t()};return{start:function(){k.trigger("addOutputItem",{output:h.MEDIA_TYPE.VIDEO_CODE},h.MEDIA_TYPE_CODE,{type:h.IMPRESSION_EVENT});a.addScreenLocationChangedListener(q);a.start();b.addVideoPlaybackEventListener(r);b.start()},getStrategyName:function(){return h.MEASUREMENT_STRATEGY.VIDEO},addMeasurementChangedListener:function(a){c.on("measurementChanged",a)},isMeasurable:function(){return g}}},Eb=function(a,
b){return{accepts:function(){return b.isInMobiMraidVideo()},isImmediate:function(){return!1},start:function(){try{var b;a.inmobi.IASDocumentVideoBuffer.addVideoEventListener(function(a){"AdVideoStart"!==a.type||b||(b=!0,k.trigger("adImpression"))})}catch(d){}}}},Db=function(a,b){var c=function(a){try{b.trigger("inMobiMraidVideoPlaybackEvent",{eventType:a.type})}catch(c){}};return{start:function(){try{a.inmobi.IASDocumentVideoBuffer.addVideoEventListener(c)}catch(b){}},addVideoPlaybackEventListener:function(a){b.on("inMobiMraidVideoPlaybackEvent",
a)}}},Fb=function(a,b){var c=function(a){a={viewport:a.eventData.viewport||{width:0,height:0},originalAdContainer:a.eventData.originalAdContainer||{x:0,y:0,width:0,height:0},computedAdContainer:a.eventData.computedAdContainer||{x:0,y:0,width:0,height:0},percentageInView:a.eventData.percentageInView,detectionMethod:h.DETECTION_METHODS.AVID,outOfViewReason:d(a.eventData.reasons)};b.trigger("containerGeometryMeasurementChanged",a)},d=function(a){var b={inactive:h.OUT_OF_VIEW_REASONS.FOCUS,viewport:h.OUT_OF_VIEW_REASONS.GEOM,
clipped:h.OUT_OF_VIEW_REASONS.GEOM,obstructed:h.OUT_OF_VIEW_REASONS.OBSTRUCTION,backgrounded:h.OUT_OF_VIEW_REASONS.FOCUS,notFound:h.OUT_OF_VIEW_REASONS.HIDDEN},c=[];if(!a)return"";e(a).each(function(a,d){var e=b[d];e&&0>c.indexOf(c)&&c.push(e)});return c.join(".")};return{start:function(){a.addEventListener("viewability",c)},addAdContainerGeometryMeasurementChangedListener:function(a){b.on("containerGeometryMeasurementChanged",a)},translateAvidOutOfViewReasons:d}},Kb=function(a){var b=function(a,
b){var c=Math.max(a.x,b.x),d=Math.max(a.y,b.y),e=Math.min(a.x+a.width,b.x+b.width),f=Math.min(a.y+a.height,b.y+b.height),e=e-c,f=f-d;return{x:c,y:d,width:0=d&&k<=h)return!0});c=!r&&u>=c.piv;g&&(c=c&&b.isVideoPlaying);return c},metricId:a.id,minUnit:a.minunit?1E3*a.minunit:1E3}},ub=function(a,b,c){var d=b.isVideo()?"video":"display",f=b.isMobileApp()?"app":"web",g=b.isDeviceTypeGroupMobile()?"mobile":"desktop",h=e(a.customViewability).isArray()&&0a.percentInView;!e&&g?(p.updateFrequency(1E3),e=!0):e&&!g&&(p.updateFrequency(c.isVideo()?200:100),e=!1)},t=function(){var a=new S(h.DT_CODES.VIDEO_EVENTS);k.trigger("sendDt",a.callType,a.enumerator,function(){var a={id:r.videoId,msg:"unloadComplete",
messageType:"misc"};q.getWindow().postMessage(JSON.stringify(a),"*")})};k.once("startViewabilityLoop",function(){if(k.request("ids").impressionIsIdentifiable()){p=dc(a.checkScreenLoc,c.isVideo()?200:100);p.start(!0);if(b.on("viewabilityOptimization")&&!l)k.on("newScreenEvent",s);x.addEvent(w,"beforeunload",function(){k.trigger("adSessionComplete")},!1)}});k.once("adSessionComplete",function(){c.isVideo()&&!c.isAvid()&&t();k.trigger("unload");p&&p.stop();a.cleanupPixelGrids();k.trigger("endAdSession");
k.trigger("stopAdTalk")})},{tier:h.TIERS.VIEWABILITY});var vc=function(a,b,c,d,f){var g,p,m,l=q.getWindow(),s=q.getDoc(),t=h.AD_IDENTIFIER+"-"+r.asid,B;d=d||b.parentNode||b.parent;var D=function(){if(!g)if(m=m||uc(d,f),g=m.calcDims(b,d),c===h.DETECTION_METHODS.VIDEO&&u.embedded){var a=g,e=(new G(b)).getRounded();try{a.set("width",e.width),a.set("height",e.height)}catch(l){k.trigger("error",h.ERROR_CODES.VIDEO_IN_IFRAME_DIMS_CALC)}}else c===h.DETECTION_METHODS.AD_PLACEHOLDER&&g.treatAsPlaceholder();
return g},A=function(){var b,d,g,l;d=r.mobOrTab;e.isUndef(p)&&(b=!d&&(u.friendly||e.isDef(w.mozInnerScreenX))&&f.on("offscreen"),g=D(),d=new G(v.calcWinDims()),b=new G(b?v.calcMonDims():{}),l=c===h.DETECTION_METHODS.VIDEO&&u.embedded?k.request("iframe").getClippedDims():new G({}),p=a.calcPercentInView(g,d,b,l));return p},H=function(){return a.calcInitialViewState(A())},z=function(){return b===w?!1:D().isHidden()};(function(){var a=s.body,a=b===l&&a?s.body:b;B=u.friendlyIframe?l.frameElement:a;x.addEvent(a,
"click",function(){k.trigger("adComponentClicked")});x.addEvent(a,"mouseover",function(){k.trigger("adComponentMousedOver")})})();return{mark:function(){v.setAttributeOf(B,t,"")},cleanup:function(){v.removeAttributeOf(B,t)},isNode:function(a){return b===a},isHidden:z,isObstructed:function(){return!1},getDims:D,getPercentInView:A,getLocationState:H,getOnPageViewability:function(){return z()?h.OUT_OF_VIEW:H()},getDetectionMethod:function(){return c},getContainerDims:function(){return G(d)},refresh:function(){p=
g=void 0;var a,c=b.parentNode;if(c){for(;b!==w&&c&&c!==y&&!a;)a=c===d,c=c.parentNode;a||(d=b.parentNode)}}}},wc=function(a,b){var c=[],d=function(){return c[0]&&c[0].getDetectionMethod()===h.DETECTION_METHODS.AD_PLACEHOLDER},f=function(e,f,g){var l=d()||0===c.length;e=vc(a,e,f,g,b);d()&&(g=c.shift(),g.cleanup());c.push(e);l&&e.mark();l&&f!==h.DETECTION_METHODS.AD_PLACEHOLDER&&k.trigger("primaryadfound",e)},g=function(){var a,b=!1,d=0,f=0;e(c).each(function(c,e){var g;g=e.getDims();g.hasValidDims()&&
(a=e.getPercentInView(),b=a!==h.NA,g=g.area(),d+=g,f+=a/100*g)});return{totalArea:d,totalInView:f,hasMeasurement:b}},p=function(){var a=g();return a.hasMeasurement?q.round(a.totalInView/a.totalArea*100):h.PIV_NA},m=function(){var c=g().totalArea>=h.MRC_LARGE_AD_SIZE&&b.on("largeAd")&&!u.isVideo();return a.calcInitialViewState(p(),!1,c)},l=function(a){var b=-1;e(c).each(function(c,d){d.isNode(a)&&(b=c)});return b},s=function(a){return function(){return c[0]&&c[0][a]()}};k.on("adComponentAdded",function(a){e(a).each(function(a,
b){-1===l(b)&&f(b,h.DETECTION_METHODS.MUTATION)})});k.on("adComponentRemoved",function(a){e(a).each(function(a,b){var d=l(b);-1v:!0;t=q.now();0===b.adDimensions.area()&&(s=0);r||(s=0);var M=s;l.push({tm:u.getTagTime(),piv:M});3=F)e.isUndef(m)&&(m=k.request("video")),s=m.getViewStateOverride(),
F=!0,s&&(F=s===h.IN_VIEW),s=F;x=s}s=x}else s=!y&&s>=F;b.viewState=s?h.IN_VIEW:h.OUT_OF_VIEW;b.percentInView=z();F=[];x=e(b.reason);y=h.OUT_OF_VIEW_REASONS;s||F.push(y.GEOM);x.contains(y.HIDDEN)&&F.push(y.HIDDEN);x.contains(y.OBSTRUCTION)&&F.push(y.OBSTRUCTION);b.reason=F;w||(w=!0,q.execAtEndOfThread(C))}else b.viewState=h.NA,b.percentInView=-1;return b},start:function(){k.on("endAdSession",y);c&&setTimeout(F,2E3)},getStrategyName:function(){return"mobileWebXdomainSafari"},isMeasurable:function(){return A},
isImmediate:function(){return!0},hasMeasurementStrategy:function(){return!0}}},ha=function(a,b,c,d){return{accepts:function(){var e=c.xDomainIframe,g=a.bootstrapOn("mobOrTab"),p=a.on("ios"),m=b.browserIs(h.BROWSERS.WEBKIT),l,k;l=!1;b.getUserAgent()&&(k=b.getUserAgent().match(/OS\s\d+/))&&0