-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublishertag.js.download
2 lines (2 loc) · 61.1 KB
/
publishertag.js.download
1
2
!function(){"use strict";function tryParseJson(a){try{return JSON.parse(a)}catch(a){return}}function SetLogLevel(a){Log.LOGLEVEL=a}function RequestBids(a,b,c){RequestBidsWithProfileId(a,standaloneProfileId,b,c)}function RequestBidsWithProfileId(a,b,c,d){var e=!1,f=new StandaloneInputParameters(a);if(checkInputParameters(f)){var g=function(a){var b=tryParseJson(a);if(void 0!==b&&void 0!==b.slots)for(var d=0,e=b.slots;d<e.length;d++){for(var g=e[d],h=void 0,i=0,j=f.placements;i<j.length;i++){var k=j[i];if(k.nativeCallback&&k.impId===g.impid){h=k.nativeCallback;break}}var l=GenerateBidResponseSlot(g.impid,g.cpm,g.width,g.height,g.zoneid,h,g.native,g.displayurl,g.creative);void 0!==l&&(window.criteo_pubtag.standaloneBidder.bids[l.id]=l)}void 0!==c&&c(GetBids())},h=function(){void 0!==c&&c([])},i=new DirectBiddingEventWithCaching(b,new DirectBiddingUrlBuilder(e),f.placements,g,h,h,d||3e3,f.networkId,f.integrationMode);window.criteo_pubtag.push(i)}}function SetLineItemRanges(a){var b=LineItemRange.createLineItemRangesFromString(a);window.criteo_pubtag.standaloneBidder.lineItemRanges=b}function SetDFPKeyValueTargeting(){var a=new DFPKeyValueTargeter,b=window.criteo_pubtag.standaloneBidder.lineItemRanges,c=GetImpressionIdToBestBid();for(var d in c){var e=c[d];a.setKeyValuePerSlot(d,ComputeDFPTargeting(e,b))}}function ComputeStandaloneDFPTargeting(a,b){var c=LineItemRange.createLineItemRangesFromString(b);return ComputeDFPTargeting(a,c)}function ComputeDFPTargeting(a,b){var c=LineItemRange.computeLineItemPricebandValue(a.cpm,b);return{crt_pb:[c],crt_bidid:[a.id]}}function RenderAd(a,b){var c,d="string"==typeof a?{bidId:a,document:b}:a,e=new RenderAdInputParameters(d);c=void 0!==e.containerId?new BidEventContainerTarget(e.document,e.containerId):new BidEventDocumentTarget(e.document),RenderAdOnTarget(e.bidId,c)}function RenderAdOnTarget(a,b){var c=window.criteo_pubtag.standaloneBidder.bids;if(c.hasOwnProperty(a)){var d=c[a],e=d.GenerateEvent(b);window.criteo_pubtag.push(e),delete c[a]}else Log.Error("Could not render bid with id: "+a)}function GetBids(){var a=window.criteo_pubtag.standaloneBidder.bids;if(null===a)return[];var b=window.criteo_pubtag.standaloneBidder.lineItemRanges,c=[];for(var d in a){var e=a[d];if(b.length>0){var f=LineItemRange.computeLineItemPricebandValue(e.cpm,b);e.cpm_bucket=f}c.push(e)}return c}function GetBidsForAdUnit(a,b){void 0===b&&(b=1);var c=GetBids(),d=[];for(var e in c){var f=c[e];f.impressionId===a&&d.push(f)}return d.sort(function(a,b){return b.cpm-a.cpm}).slice(0,Math.min(Math.max(b,0),d.length))}function checkInputParameters(a){if(void 0===a.placements)return Log.Error("Missing 'placements' parameter"),!1;if(0===a.placements.length)return Log.Error("'placements' parameter is empty"),!1;for(var b=0,c=a.placements;b<c.length;b++){var d=c[b];if(IsEmptyOrUndefined(d.impId))return Log.Error("Missing 'slotId' parameter in placements object"),!1;if(IsEmptyOrUndefined(d.zoneId)&&(IsEmptyOrUndefined(d.sizes)||IsEmptyOrUndefined(a.networkId)))return Log.Error("Missing zone information: specify either a zoneId or a networkId and a zone size"),!1;if(void 0!==d.nativeCallback&&"function"!=typeof d.nativeCallback)return Log.Error("'nativeCallback' parameter is not a function in placements object"),!1}return!0}function GetImpressionIdToBestBid(){var a={},b=window.criteo_pubtag.standaloneBidder.bids;for(var c in b){var d=b[c];if(a.hasOwnProperty(d.impressionId)){var e=a[d.impressionId];e.cpm<d.cpm&&(a[d.impressionId]=d)}else a[d.impressionId]=d}return a}function GenerateBidResponseSlot(a,b,c,d,e,f,g,h,i){return void 0!==f&&void 0!==g?new NativeBidResponseSlot(a,b,c,d,e,f,g):void 0===h||void 0!==i&&"<script"!==i.substr(0,7)?void 0!==i?new HtmlCreativeBidResponseSlot(a,b,c,d,e,i):void 0:new DisplayUrlBidResponseSlot(a,b,c,d,e,h)}function IsEmptyOrUndefined(a){return void 0===a||a+""==""}function GetIdfs(){return window.criteo_pubtag.context.getIdfs()}function SetIdfs(a){window.criteo_pubtag.context.setIdfs(a)}function DisplayAd(a){var b=new DisplayInputParameters(a);if(b.async=b.async!==!1,void 0===b.zoneid)return void Log.Error("missing parameter 'zoneid'");if(void 0!==b.layout&&b.async===!1)return void Log.Error("Criteo hosted ads only work in async mode");if(b.async===!0&&(void 0===b.containerid||""===b.containerid))return void Log.Error("Missing parameter 'containerid' for an async display");if(b.async===!1&&void 0!==b.passbackCode&&(Log.Error("Criteo.DisplayAd does not support synchronous local passback"),b.passbackCode=void 0),b.adFormat!==AdFormatType.Classic){var c=new AdvancedAdFormats(b.adFormat,b.containerid);if(c.IsUserOptout())return void Log.Debug("The user has opted-out for 1 day when closing the sticky footer.");b.containerid=c.CreateAdvancedAdFormatContainer()}var d;d=b.async?new DisplayEventAsync(new DisplayUrlBuilder,b):new DisplayEventSync(new DisplayUrlBuilder,b),window.criteo_pubtag.push(d)}function DisplayAcceptableAdIfAdblocked(a){var b=new DisplayInputParameters(a);if(void 0===b.zoneid)return void Log.Error("missing parameter 'zoneid'");if(void 0===b.containerid||""===b.containerid)return void Log.Error("missing parameter 'containerid' to display acceptable ads");if(!isVisible(document.getElementById(b.containerid)))return void Log.Error("can't display acceptable ad : the container \""+b.containerid+'" is not visible');window.criteo_pubtag.checkAdblocker();var c,d=new EyeoDealValidator;c=new DisplayEventAFR(new DisplayUrlBuilder,b,d.respectsEyeoDeal(b.containerid));var e;e=new Custom(function(){if(b.collapseContainerIfNotAdblocked){var a=document.getElementById(b.containerid);a.style.display="none"}void 0!==b.callIfNotAdblocked&&b.callIfNotAdblocked()});var f,g=function(){return window.criteo_pubtag.context.isAdBlocked===!0};f=new ConditionalEvent(g,c,e),window.criteo_pubtag.push(f)}function isVisible(a){if(a===document)return!0;if(!a)return!1;if(!a.parentNode)return!1;if(a.style){if("none"===a.style.display)return!1;if("hidden"===a.style.visibility)return!1}var b=window;if(b.getComputedStyle){var c=b.getComputedStyle(a,"");if("none"===c.display)return!1;if("hidden"===c.visibility)return!1}var d=a.currentStyle;if(d){if("none"===d.display)return!1;if("hidden"===d.visibility)return!1}return isVisible(a.parentNode)}function tryDecodeURIComponent(a,b){try{return decodeURIComponent(a)}catch(c){return void 0!==b?b:a}}function createEventProcessor(a){var b={push:function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];if("undefined"!=typeof a)for(var c=0,d=a;c<d.length;c++){var e=d[c];"function"==typeof e&&e()}}};return a&&Array.isArray(a)&&b.push.apply(b,a),b}function ExtractKeyValuesFromRtaResponse(a){if(void 0===a||""===a)return{};for(var b=a.split(";"),c={},d=0,e=b;d<e.length;d++){var f=e[d];if(""!==f){var g=f.split("=");if(2===g.length){var h=g[0],i=g[1];c[h]=c[h]||[],c[h].push(""+i)}}}return c}function CallRTA(a){var b=new RtaInputParameters(a);if(void 0===b.networkId)return void Log.Error("missing parameter 'networkid'");var c=b.crtgContentName?b.crtgContentName:DefaultCrtgContentName,d=b.crtgRtaCookieName?b.crtgRtaCookieName:DefaultCrtgRtaCookieName;window[c]=CookieHelper.GetCookie(d)||"";var e=new RtaEvent(new RtaUrlBuilder,b);window.criteo_pubtag.push(e)}function SetTargeting(a){var b=new RtaInputParameters(a);if(void 0===b.adserver)return void Log.Error("missing parameter 'adserver'");var c=[];if(void 0!==b.crtgContentName)c.push(b.crtgContentName);else if(window.criteo_pubtag.context.rtaVarNames.length>0)for(var d=0,e=window.criteo_pubtag.context.rtaVarNames;d<e.length;d++){var f=e[d];c.push(f)}else c.push(DefaultCrtgContentName);for(var g=0,h=c;g<h.length;g++){var i=h[g],j=window[i],k=ExtractKeyValuesFromRtaResponse(j),l=new RtaTargetingEvent(b.adserver,k);window.criteo_pubtag.push(l),RemoveCrtgContentNameFromPublisherTagContext(i)}}function ComputeDFPTargetingForAMP(a,b){var c=CookieHelper.GetCookie(a),d=ExtractKeyValuesFromRtaResponse(c);return RemoveCrtgContentNameFromPublisherTagContext(b),d}function RemoveCrtgContentNameFromPublisherTagContext(a){var b=window.criteo_pubtag.context.rtaVarNames.indexOf(a,0);b>-1&&window.criteo_pubtag.context.rtaVarNames.splice(b,1)}function SetupPassbackEventQueue(){window.Criteo.passbackEvents=createEventProcessor(window.Criteo.passbackEvents)}function RequestBidsPassback(a,b){RequestBidsWithProfileId(a,passbackProfileId,SetupPassbackEventQueue,b)}function RenderAdPassback(a,b,c){"function"!=typeof c&&(c=function(b){RenderAd({bidId:b.id,containerId:a})}),window.Criteo.passbackEvents=window.Criteo.passbackEvents||[],window.Criteo.passbackEvents.push(function(){var d=GetBidsForAdUnit(a)[0];d?c(d):b(a)})}var AbstractEvent=function(){function a(a){this.name=a}return a.prototype.eval=function(a){},a}(),LocalStorageHelper=function(){function a(a){this.EXPIRE_SUFFIX="_expires",this.CHECK_STORAGE_KEY="criteo_localstorage_check",this.localStorage=a||localStorage}return a.prototype.checkLocalStorage=function(){var a=this.CHECK_STORAGE_KEY;try{return this.localStorage.setItem(a,a),this.localStorage.removeItem(a),!0}catch(a){return!1}},a.prototype.removeItem=function(a){this.localStorage.removeItem(a),this.localStorage.removeItem(a+this.EXPIRE_SUFFIX)},a.prototype.getItem=function(a){var b=(new Date).getTime(),c=this.localStorage.getItem(a+this.EXPIRE_SUFFIX),d=c?parseInt(c,10):-1;return d!==-1&&d<b?(this.removeItem(a),null):this.localStorage.getItem(a)},a.prototype.setItem=function(a,b,c){if(void 0===c&&(c=null),this.localStorage.setItem(a,b),c){var d=(new Date).getTime(),e=d+c;this.localStorage.setItem(a+this.EXPIRE_SUFFIX,e.toString())}},a}(),Size=function(){function a(a,b){this.width=a,this.height=b}return a.prototype.toString=function(){return this.width+"x"+this.height},a}(),BidStorageKey=function(){function a(){}return a.BID_STORAGE_KEY_PREFIX="criteo_pt_cdb_bidcache",a}(),__extends$1=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),BidStorageKeyWithSize=function(a){function b(b){var c=a.call(this)||this;return c.size=b,c}return __extends$1(b,a),b.prototype.toString=function(){return BidStorageKey.BID_STORAGE_KEY_PREFIX+"_Size"+this.size},b}(BidStorageKey),__extends$2=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),BidStorageKeyWithZoneId=function(a){function b(b){var c=a.call(this)||this;return c.zoneId=b,c}return __extends$2(b,a),b.prototype.toString=function(){return BidStorageKey.BID_STORAGE_KEY_PREFIX+"_ZoneId"+this.zoneId},b}(BidStorageKey),BidStorageKeyFactory=function(){function a(a){this.useZoneIdIntegration=a}return a.prototype.createKeysFromSlotRequest=function(a){if(this.useZoneIdIntegration)return[new BidStorageKeyWithZoneId(a.zoneId)];for(var b=[],c=0,d=a.sizes;c<d.length;c++){var e=d[c];b.push(new BidStorageKeyWithSize(e))}return b},a.prototype.createKeyFromSlotResponse=function(a){return this.useZoneIdIntegration?new BidStorageKeyWithZoneId(a.zoneid):new BidStorageKeyWithSize(new Size(a.width,a.height))},a}(),DirectBiddingBidManager=function(){function a(a){this.localStorageHelper=new LocalStorageHelper,this.localStorageEnabled=this.localStorageHelper.checkLocalStorage(),this.bidStorageKeyFactory=new BidStorageKeyFactory(a)}return a.prototype.getRequestCachedBids=function(a){for(var b=[],c=0,d=a;c<d.length;c++)for(var e=d[c],f=0,g=this.bidStorageKeyFactory.createKeysFromSlotRequest(e);f<g.length;f++){var h=g[f],i=this.getBid(h);void 0!==i&&b.push(i)}return b},a.prototype.getBid=function(a){if(this.localStorageEnabled){var b=this.localStorageHelper.getItem(a.toString());return this.localStorageHelper.removeItem(a.toString()),b?tryParseJson(b):void 0}},a.prototype.storeResponseBids=function(a,b){if(void 0!==a.slots&&0!==a.slots.length)for(var c=0,d=a.slots;c<d.length;c++){var e=d[c],f=this.bidStorageKeyFactory.createKeyFromSlotResponse(e);this.storeBid(f,e,b)}},a.prototype.storeBid=function(a,b,c){this.localStorageEnabled&&this.localStorageHelper.setItem(a.toString(),JSON.stringify(b),1e3*c)},a}(),AsyncRequest=function(){function a(a,b,c,d){void 0===d&&(d=!0),this.url=a,this.data=b,this.contentType=c,this.withCredentials=d}return a.prototype.send=function(a,b,c,d){var e=void 0!==this.data?"POST":"GET",f=this.getXMLHttpRequest(e,a,b,c,d);if(void 0!==f)f.send(this.data);else{var g=this.getXDomainRequest(e,a,b,c,d);void 0!==g&&g.send(this.data)}},a.prototype.getXMLHttpRequest=function(b,c,d,e,f){var g=new XMLHttpRequest;if("withCredentials"in g)return g.open(b,this.url,!0),g.timeout=f?f:a.LOCAL_PASSBACK_TIMEOUT,this.contentType?g.setRequestHeader("Content-type",this.contentType):"POST"===b&&g.setRequestHeader("Content-type","application/x-www-form-urlencoded"),g.withCredentials=this.withCredentials,g.onload=function(){4===g.readyState&&200===g.status?c(g.responseText):d(g.readyState,g.status)},g.onerror=function(){d(void 0,void 0)},g.ontimeout=e,g},a.prototype.getXDomainRequest=function(b,c,d,e,f){if("undefined"!=typeof XDomainRequest){var g=new XDomainRequest;return g.timeout=f?f:a.LOCAL_PASSBACK_TIMEOUT,g.open(b,this.url),g.onload=function(){void 0!==g.responseText?c(g.responseText):d(void 0,void 0)},g.onerror&&(g.onerror=function(){d(void 0,void 0)}),g.ontimeout&&(g.ontimeout=e),g}},a.LOCAL_PASSBACK_TIMEOUT=3e4,a}(),TimeMeasurer=function(){function a(a){void 0===a&&(a=!0),a&&window.performance&&window.performance.now?this.now=window.performance.now.bind(window.performance):Date.now?this.now=Date.now:this.now=function(){return(new Date).getTime()}}return a.CreateRunning=function(){var b=new a;return b.start(),b},a.CreateWithStartTime=function(b){var c=new a(!1);return c.startTime=b,c},a.prototype.start=function(){this.startTime=this.now()},a.prototype.elapsed=function(){var a=this.now();return a-this.startTime},a}(),DirectBiddingMetric=function(){function a(a,b,c,d,e,f,g,h,i){this.impressionId=a,this.elapsed=b,this.isTimeout=c,this.adapterStartElapsed=d,this.cdbCallStartElapsed=e,this.cdbCallEndElapsed=f,this.adapterEndElapsed=g,this.adapterTimeout=h,this.adapterIsTimeout=i}return a}(),DirectBiddingMetricBuilder=function(){function a(){this.elapsed=0,this.isTimeout=!1,this.adapterStartElapsed=0,this.cdbCallStartElapsed=0,this.cdbCallEndElapsed=0,this.adapterEndElapsed=0}return a.prototype.withElapsed=function(a){return this.elapsed=a,this},a.prototype.withIsTimeout=function(a){return this.isTimeout=a,this},a.prototype.withAdapterStartElapsed=function(a){return this.adapterStartElapsed=a,this},a.prototype.withCdbCallStartElapsed=function(a){return this.cdbCallStartElapsed=a,this},a.prototype.withCdbCallEndElapsed=function(a){return this.cdbCallEndElapsed=a,this},a.prototype.withAdapterEndElapsed=function(a){return this.adapterEndElapsed=a,this},a.prototype.withAdapterTimeout=function(a){return this.adapterTimeout=a,this},a.prototype.build=function(a){var b;return void 0!==this.adapterTimeout&&(b=this.adapterEndElapsed>this.adapterTimeout),new DirectBiddingMetric(a,this.elapsed,this.isTimeout,this.adapterStartElapsed,this.cdbCallStartElapsed,this.cdbCallEndElapsed,this.adapterEndElapsed,this.adapterTimeout,b)},a}(),DirectBiddingMetricsManager=function(){function a(){this.localStorageHelper=new LocalStorageHelper,this.localStorageEnabled=this.localStorageHelper.checkLocalStorage()}return a.prototype.getMetrics=function(b){if(this.localStorageEnabled){var c=a.METRICS_STORAGE_KEY,d=this.localStorageHelper.getItem(c),e=d?tryParseJson(d):[];return b&&this.localStorageHelper.removeItem(c),e}return[]},a.prototype.storeMetric=function(b){if(this.localStorageEnabled){var c=a.METRICS_STORAGE_KEY,d=this.localStorageHelper.getItem(c),e=d?tryParseJson(d):[];e.push(b),this.localStorageHelper.setItem(c,JSON.stringify(e),36e5)}},a.METRICS_STORAGE_KEY="criteo_pt_cdb_metrics",a}(),__extends$3=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DirectBiddingEvent=function(a){function b(c,d,e,f,g,h,i,j,k,l){var m=a.call(this,b.NAME)||this;return m.profileId=c,m.urlBuilder=d,m.slots=e,m.metricsManager=new DirectBiddingMetricsManager,m.callbackSuccess=f,m.callbackError=g,m.callbackTimeout=h,m.timeout=i,m.networkId=j,m.integrationMode=k,m.adapterVersion=l,m}return __extends$3(b,a),b.useZoneIdIntegration=function(a,b){return void 0===b||0===a.filter(function(a){return void 0!==a.sizes&&a.sizes.length>0}).length},b.buildAuctionRequest=function(a,b,c,d){for(var e=[],f=0,g=a;f<g.length;f++){var h=g[f],i={impid:h.impId};if(void 0!==h.zoneId&&(i.zoneid=h.zoneId),void 0!==h.nativeCallback&&(i.native=!0),void 0!==h.transactionId&&(i.transactionid=h.transactionId),void 0!==h.publisherSubId&&(i.publishersubid=h.publisherSubId),void 0!==h.sizes){for(var j=[],k=0,l=h.sizes;k<l.length;k++){var m=l[k];j.push(m.width+"x"+m.height)}i.sizes=j}e.push(i)}var n={publisher:{url:c.highestAccessibleUrl},slots:e};return void 0!==d&&(n.publisher.networkid=d),b.length&&(n.previousBidFeedback=b),n},b.prototype.getMostPreciseTime=function(a,b){if(!window.performance||!window.performance.getEntries)return b;for(var c=window.performance.getEntries(),d=c.length-1;d>=0;--d){var e=c[d];if(e.name===a&&e.duration)return Math.round(e.duration)}return b},b.prototype.eval=function(a){var c=b.getCriteoAdapterBidRequest(),d=b.getRequestTimeMeasurer(c),e=new DirectBiddingMetricBuilder;if(e.withAdapterStartElapsed(d.elapsed()).withAdapterTimeout(b.getAdapterTimeout(c)),!this.isValidRequest()||"undefined"==typeof JSON)return void this.callbackError(void 0,void 0);var f=this.metricsManager.getMetrics(!0),g=JSON.stringify(b.buildAuctionRequest(this.slots,f,a.context,this.networkId)),h=this.urlBuilder.buildUrl(this.profileId,a.context,this.integrationMode,this.adapterVersion),i=new AsyncRequest(h,g,"application/x-www-form-urlencoded"),j=TimeMeasurer.CreateRunning();e.withCdbCallStartElapsed(d.elapsed());var k=this;i.send(function(a){e.withElapsed(k.getMostPreciseTime(h,j.elapsed())).withCdbCallEndElapsed(d.elapsed());var b=tryParseJson(a)||{},c=k.extractExtraData(b);void 0!==k.callbackSuccess&&k.callbackSuccess(JSON.stringify(b),c),e.withAdapterEndElapsed(d.elapsed());for(var f=0,g=c.genimpids;f<g.length;f++){var i=g[f];k.metricsManager.storeMetric(e.build(i))}},function(a,b){e.withElapsed(k.getMostPreciseTime(h,j.elapsed())).withCdbCallEndElapsed(d.elapsed()),void 0!==k.callbackError&&k.callbackError(a,b),e.withAdapterEndElapsed(d.elapsed()),k.metricsManager.storeMetric(e.build(""))},function(){e.withElapsed(k.getMostPreciseTime(h,j.elapsed())).withCdbCallEndElapsed(d.elapsed()).withIsTimeout(!0),void 0!==k.callbackTimeout&&k.callbackTimeout(),e.withAdapterEndElapsed(d.elapsed()),k.metricsManager.storeMetric(e.build(""))},this.timeout)},b.getCriteoAdapterBidRequest=function(){try{return window.pbjs._bidsRequested.find(function(a){return"criteo"===a.bidderCode})}catch(a){return}},b.getRequestTimeMeasurer=function(a){return void 0!==a&&void 0!==a.auctionStart?TimeMeasurer.CreateWithStartTime(a.auctionStart):TimeMeasurer.CreateRunning()},b.getAdapterTimeout=function(a){return void 0!==a?a.timeout:void 0},b.prototype.extractExtraData=function(a){var b=[""],c=0;return void 0!==a.exd&&(void 0!==a.exd.genimpids&&a.exd.genimpids.length>0&&(b=a.exd.genimpids),void 0!==a.exd.bidcachedurationseconds&&(c=a.exd.bidcachedurationseconds),delete a.exd),{genimpids:b,bidcachedurationseconds:c}},b.prototype.isValidRequest=function(){return this.slots.length>0},b.NAME="directbidding",b}(AbstractEvent),__extends=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DirectBiddingEventWithCaching=function(a){function b(c,d,e,f,g,h,i,j,k,l){var m=a.call(this,b.NAME)||this;return m.bidManager=new DirectBiddingBidManager(DirectBiddingEvent.useZoneIdIntegration(e,j)),m.directBiddingEvent=new DirectBiddingEvent(c,d,e,function(a,b){return m.onSuccess(a,b)},function(a,b){return m.onError(a,b)},function(){return m.onTimeout()},10*i,j,k,l),m.slots=e,m.callbackSuccess=f,m.callbackError=g,m.callbackTimeout=h,m.timeout=i,m.hasTimeouted=!1,m.hasResponded=!1,m}return __extends(b,a),b.prototype.eval=function(a){var b=this;setTimeout(function(){return b.onTimeout()},this.timeout),this.directBiddingEvent.eval(a)},b.prototype.onSuccess=function(a,b){if(this.hasResponded=!0,void 0!==b){var c=b.bidcachedurationseconds;if(this.hasTimeouted&&c>0)return void this.bidManager.storeResponseBids(JSON.parse(a),c)}this.hasTimeouted||this.callbackSuccess(a,b)},b.prototype.onError=function(a,b){this.hasResponded=!0,this.hasTimeouted||this.callbackError(a,b)},b.prototype.onHttpTimeout=function(){this.hasResponded=!0,this.hasTimeouted||this.callbackTimeout()},b.prototype.onTimeout=function(){if(!this.hasResponded){this.hasTimeouted=!0;var a=this.bidManager.getRequestCachedBids(this.slots);0===a.length?this.callbackTimeout():this.callbackSuccess(JSON.stringify({slots:a}),void 0)}},b.NAME="directbidding",b}(AbstractEvent),CacheBusterGenerator=function(){function a(){}return a.generateCacheBuster=function(){return Math.floor(99999999999*Math.random())},a}(),IntegrationMode;!function(a){a[a.Unspecified=0]="Unspecified",a[a.AMP=1]="AMP"}(IntegrationMode||(IntegrationMode={}));var PublisherTagVersion=36,DirectBiddingUrlBuilder=function(){function a(a){void 0===a&&(a=!1),this.auditMode=a}return a.prototype.buildUrl=function(b,c,d,e){void 0===d&&(d=IntegrationMode.Unspecified);var f="https:"===c.protocol?"https:":"http:",g=f+a.CRITEO_BIDDER_URL+this.getHandlerPath()+"?ptv="+PublisherTagVersion;return g+="&profileId="+String(b),g+=c.ctoIdOnPublisherDomain?"&idcpy="+c.ctoIdOnPublisherDomain:"",g+=c.idfs?"&idfs="+c.idfs:"",g+=c.isOptOut?"&optout=1":"",d!==IntegrationMode.Unspecified&&(g+="&im="+d),void 0!==e&&(g+="&av="+String(e)),g+="&cb="+String(CacheBusterGenerator.generateCacheBuster()),g+=c.getContextFlags()},a.prototype.getHandlerPath=function(){return this.auditMode?a.CRITEO_BIDDER_AUDIT_HANDLER:a.CRITEO_BIDDER_HANDLER},a.CRITEO_BIDDER_URL="//bidder.criteo.com/",a.CRITEO_BIDDER_HANDLER="cdb",a.CRITEO_BIDDER_AUDIT_HANDLER="prebid/audit",a}(),LogLevel;!function(a){a[a.Error=0]="Error",a[a.Warning=1]="Warning",a[a.Debug=2]="Debug"}(LogLevel||(LogLevel={}));var Log=function(){function a(){}return a.Debug=function(b){window.console&&a.LOGLEVEL>=LogLevel.Debug&&console.log("PubTag [DEBUG]:"+b)},a.Warning=function(b){window.console&&a.LOGLEVEL>=LogLevel.Warning&&console.log("PubTag [WARNING]:"+b)},a.Error=function(b){a.LOGLEVEL>=LogLevel.Error&&(window.console?console.log("PubTag [ERROR]:"+b):alert("PubTag [ERROR]:"+b))},a.LOGLEVEL=LogLevel.Error,a}(),DFPKeyValueTargeter=function(){function a(){void 0===window.googletag&&(window.googletag={}),this.googletag=window.googletag,this.googletag.cmd=this.googletag.cmd||[]}return a.prototype.setKeyValuesForAllSlots=function(a){var b=this;this.googletag.cmd.push(function(){for(var c in a)b.googletag.pubads().clearTargeting(c),b.googletag.pubads().setTargeting(c,a[c]+"")})},a.prototype.setKeyValuePerSlot=function(a,b){var c=this.googletag.pubads().getSlots().filter(function(b){return b.getSlotElementId()===a});0===c.length?Log.Warning("No googletag slot found for slotId: "+a):c.length>1?Log.Warning("More than one googletag slot found for slotId: "+a):this.googletag.cmd.push(function(){for(var a in b)c[0].clearTargeting(a),c[0].setTargeting(a,b[a]+"")})},a}(),BidEventTarget=function(){function a(){}return a}(),__extends$4=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),BidEventContainerTarget=function(_super){function BidEventContainerTarget(a,b){var c=_super.call(this)||this;return c.document=a,c.containerId=b,c.element=a.getElementById(b),void 0===c.element&&Log.Error("Target element '"+b+"' not found in the document"),c}return __extends$4(BidEventContainerTarget,_super),BidEventContainerTarget.prototype.ResizeFrame=function(a,b){},BidEventContainerTarget.prototype.Write=function(a){this.element.innerHTML=a},BidEventContainerTarget.prototype.LoadScript=function(url){url+=url.indexOf("?")===-1?"?":"&",url+="containerid="+encodeURIComponent(this.containerId);var request=new AsyncRequest(url);request.send(function(responseText){eval(responseText)},function(a,b){},function(){})},BidEventContainerTarget}(BidEventTarget),__extends$5=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),BidEventDocumentTarget=function(a){function b(b){var c=a.call(this)||this;return c.document=b,c}return __extends$5(b,a),b.prototype.ResizeFrame=function(a,b){if(this.document.defaultView&&this.document.defaultView.frameElement){var c=this.document.defaultView.frameElement;c.width=a,c.height=b}},b.prototype.Write=function(a){this.document.write(a)},b.prototype.LoadScript=function(a){this.Write("<script type='text/javascript' src='"+a+"'></script>")},b}(BidEventTarget),__extends$7=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),Custom=function(a){function b(c){var d=a.call(this,b.NAME)||this;return d.callback=c,d}return __extends$7(b,a),b.prototype.eval=function(a){this.callback&&this.callback.apply(this)},b.NAME="genericEvent",b}(AbstractEvent),BidResponseSlot=function(){function a(a,b,c,d,e){this.id=this.generateRandomId(),this.impressionId=a,this.cpm=b,this.width=c,this.height=d,this.zoneId=e}return a.prototype.generateRandomId=function(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,6)},a}(),__extends$6=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DisplayUrlBidResponseSlot=function(a){function b(b,c,d,e,f,g){var h=a.call(this,b,c,d,e,f)||this;return h.displayUrl=g,h}return __extends$6(b,a),b.prototype.GenerateEvent=function(a){var b=this;return a.ResizeFrame(this.width,this.height),new Custom(function(){return a.LoadScript(b.displayUrl)})},b.prototype.GenerateMessage=function(){return{displayUrl:this.displayUrl}},b}(BidResponseSlot),__extends$8=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),HtmlCreativeBidResponseSlot=function(a){function b(b,c,d,e,f,g){var h=a.call(this,b,c,d,e,f)||this;return h.creative=g,h}return __extends$8(b,a),b.prototype.GenerateEvent=function(a){var b=this;return a.ResizeFrame(this.width,this.height),new Custom(function(){return a.Write(b.creative)})},b.prototype.GenerateMessage=function(){return{creative:this.creative}},b}(BidResponseSlot),LineItemRange=function(){function a(a,b,c){this.lowerBound=a,this.upperBound=b,this.increment=c}return a.createLineItemRangesFromString=function(b){for(var c=[],d=b.split(";"),e=0,f=d;e<f.length;e++){var g=f[e],h=g.split(".."),i=a.roundToDecimal(h[0],2),j=h[1].split(":"),k=a.roundToDecimal(j[0],2),l=a.roundToDecimal(j[1],2);if(isNaN(i)||isNaN(k)||isNaN(l)||0===l){Log.Warning("Could not parse range parameter: "+g);break}if(i<0||k<0||l<0){Log.Warning("Positive values must be set for range bounds: "+g);break}var m=k-i,n=m/l,o=n===Math.floor(n);i>k?Log.Warning("Lower bound ("+i+") greater than upper bound ("+k+")"):o?c.push(new a(i,k,l)):Log.Warning("Range ("+m+") is not divisible by increment ("+l+")")}return c.sort(function(a,b){return a.upperBound>b.upperBound?1:b.upperBound>a.upperBound?-1:0}),c},a.getDefaultDenseLineItemRanges=function(){var b=new a(0,3,.01),c=new a(3,8,.05),d=new a(8,20,.5);return[b,c,d]},a.computeLineItemPricebandValue=function(b,c){0===c.length&&(c=a.getDefaultDenseLineItemRanges());for(var d=0,e=c;d<e.length;d++){var f=e[d];if(b<=f.upperBound&&b>f.lowerBound){var g=Math.floor(b/f.increment+1e-4)*f.increment;return a.formatPriceBand(g)}}return b<=c[0].lowerBound?a.formatPriceBand(c[0].lowerBound):a.formatPriceBand(c[c.length-1].upperBound)},a.formatPriceBand=function(a){return a.toFixed(2)},a.roundToDecimal=function(a,b){var c=parseFloat(a),d=Math.pow(10,b);return Math.round(c*d)/d},a}(),__extends$9=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),NativeBidResponseSlot=function(a){function b(b,c,d,e,f,g,h){var i=a.call(this,b,c,d,e,f)||this;return i.nativeCallback=g,i.nativePayload=h,i}return __extends$9(b,a),b.prototype.GenerateEvent=function(a){var b=this;return"function"!=typeof this.nativeCallback?(Log.Error("'nativeCallback' parameter is not a function in placements object"),new Custom(void 0)):"object"!=typeof this.nativePayload?(Log.Error("'nativePayload' parameter is not an object in placements object"),new Custom(void 0)):new Custom(function(){return b.nativeCallback(b.nativePayload)})},b.prototype.GenerateMessage=function(){return{nativePayload:this.nativePayload}},b}(BidResponseSlot),InputParameters=function(){function a(){var a=this;this.integrationMode=IntegrationMode.Unspecified,this.paramParser={},this.addParameter("integrationMode",function(b){a.integrationMode=a.parseIntegrationMode(b)})}return a.prototype.addParameter=function(a,b){this.paramParser[a.toLowerCase()]=b},a.prototype.tryFillParameters=function(a){for(var b in a)if(void 0!==a[b]){var c=b.toLowerCase();this.paramParser[c]?this.paramParser[c](a[b]):Log.Warning("Unknown parameter: "+b)}},a.prototype.parseIntegrationMode=function(a){switch(a.toLowerCase()){case"amp":return IntegrationMode.AMP;default:return IntegrationMode.Unspecified}},a}(),__extends$10=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),RenderAdInputParameters=function(a){function b(b){var c=a.call(this)||this;return c.document=window.document,c.containerId=void 0,c.addParameter("bidId",function(a){c.bidId=a}),c.addParameter("document",function(a){c.document=a}),c.addParameter("containerId",function(a){c.containerId=a}),a.prototype.tryFillParameters.call(c,b),c}return __extends$10(b,a),b}(InputParameters),DirectBiddingSlot=function(){function a(a,b,c,d,e,f){this.impId=a,
this.zoneId=b,this.nativeCallback=c,this.transactionId=d,this.sizes=e,this.publisherSubId=f}return a}(),__extends$12=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),PlacementInputParameters=function(a){function b(b){var c=a.call(this)||this;return c.slotId=void 0,c.zoneId=void 0,c.sizes=[],c.nativeCallback=void 0,c.publisherSubId=void 0,c.addParameter("slotid",function(a){c.slotId=a}),c.addParameter("zoneid",function(a){c.zoneId=a}),c.addParameter("sizes",function(a){for(var b=0,d=a;b<d.length;b++){var e=d[b],f=e.split("x");c.sizes.push(new Size(parseInt(f[0],10),parseInt(f[1],10)))}}),c.addParameter("nativecallback",function(a){c.nativeCallback=a}),c.addParameter("publisherSubId",function(a){c.publisherSubId=a}),a.prototype.tryFillParameters.call(c,b),c}return __extends$12(b,a),b}(InputParameters),__extends$11=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),StandaloneInputParameters=function(a){function b(b){var c=a.call(this)||this;return c.placements=void 0,c.networkId=void 0,c.addParameter("networkId",function(a){c.networkId=a}),c.addParameter("placements",function(a){c.placements=c.deserializePlacementInput(a)}),a.prototype.tryFillParameters.call(c,b),c}return __extends$11(b,a),b.prototype.deserializePlacementInput=function(a){for(var b=[],c=0,d=a;c<d.length;c++){var e=d[c],f=new PlacementInputParameters(e);b.push(new DirectBiddingSlot(f.slotId,f.zoneId,f.nativeCallback,void 0,f.sizes,f.publisherSubId))}return b},b}(InputParameters),standaloneProfileId=184,AMP=function(){function a(){}return a.Standalone=function(b,c,d){var e={integrationmode:"amp",placements:[{slotid:b.slot,zoneid:b.zone,sizes:[b.width+"x"+b.height]}]};RequestBids(e,function(e){if("DFP"===b.adserver){a.listenForCreativeRequests(e);for(var f=0,g=e;f<g.length;f++){var h=g[f],i=ComputeStandaloneDFPTargeting(h,b.lineItemRanges);d(i)}}c(null)},b.timeout)},a.listenForCreativeRequests=function(a){window.addEventListener("message",function(b){var c=b.data instanceof Object?b.data:tryParseJson(b.data);if(c&&c.bidId)for(var d=0,e=a;d<e.length;d++){var f=e[d];if(f.id===c.bidId){var g=f.GenerateMessage();g.message="Criteo creative",b.source.postMessage(JSON.stringify(g),"*")}}},!1)},a}(),__extends$13=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),ConditionalEvent=function(a){function b(c,d,e){var f=a.call(this,b.NAME)||this;return f.condition=c,f.eventIfTrue=d,f.eventIfFalse=e,f}return __extends$13(b,a),b.prototype.eval=function(a){this.condition.apply(this)?this.eventIfTrue.eval(a):this.eventIfFalse.eval(a)},b.NAME="conditionalEvent",b}(AbstractEvent),AdFormatType;!function(a){a[a.Classic=0]="Classic",a[a.StickyFooter=1]="StickyFooter",a[a.ScrollingBanner=2]="ScrollingBanner"}(AdFormatType||(AdFormatType={}));var CookieHelper=function(){function a(){}return a.SetCookie=function(b,c,d,e,f){void 0===f&&(f=!1);var g=e||document,h=new Date;h.setTime(h.getTime()+60*d*60*1e3);var i="expires="+h.toUTCString();if(!f)return void a.setCookieString(b,c,i,void 0,g);for(var j=g.location.hostname.split("."),k=0;k<j.length;++k){var l=j.slice(j.length-k-1,j.length).join(".");a.setCookieString(b,c,i,l,g);var m=a.GetCookie(b,e);if(m&&m===c)break}},a.DeleteCookie=function(b,c,d){void 0===d&&(d=!1),a.SetCookie(b,"",0,c,d)},a.GetCookie=function(a,b){for(var c=b||document,d=c.cookie.split(";"),e=0,f=d;e<f.length;e++){var g=f[e],h=g.substr(0,g.indexOf("=")).replace(/^\s+|\s+$/g,""),i=g.substr(g.indexOf("=")+1);if(h===a)return decodeURIComponent(i)}},a.setCookieString=function(a,b,c,d,e){var f=a+"="+encodeURIComponent(b)+";"+c+";";d&&""!==d&&(f+="domain=."+d+";"),e.cookie=f+"path=/"},a}(),AdvancedAdFormats=function(){function a(a,b){this.adFormat=a,this.containerId=b}return a.prototype.CreateAdvancedAdFormatContainer=function(){return this.adFormat===AdFormatType.StickyFooter?this.CreateStickyFooterContainer(this.containerId):this.adFormat===AdFormatType.ScrollingBanner?this.CreateScrollingBannerContainer(this.containerId):void 0},a.prototype.IsUserOptout=function(){return this.adFormat===AdFormatType.StickyFooter&&"true"===CookieHelper.GetCookie("cto_sticky_closed")},a.prototype.CreateStickyFooterContainer=function(a){var b=document.createElement("div");b.style.position="fixed",b.style.zIndex="2147483646",b.style.bottom="0",b.style.left="0",b.style.padding="0",b.style.borderColor="rgb(196, 196, 196)",b.style.width="100%",b.style.backgroundColor="rgba(245, 245, 245, 0.54902)",b.style.borderStyle="solid",b.style.borderWidth="1px";var c=document.createElement("a");b.appendChild(c),c.style.backgroundColor="rgb(221, 221, 221)",c.style.backgroundImage="url('//static.criteo.net/images/criteo/publishertag/close.png')",c.style.backgroundRepeat="no-repeat",c.style.backgroundPosition="center",c.style.display="block",c.style.position="absolute",c.style.left="0",c.style.top="-24px",c.style.width="23px",c.style.height="24px",c.style.borderBottomColor="#6d6c71",c.style.cursor="pointer",c.onclick=function(){b.style.display="none",CookieHelper.SetCookie("cto_sticky_closed","true",24)};var d=document.createElement("div");if(b.appendChild(d),d.id="cto_sticky",d.style.margin="0 auto",d.style.display="table",void 0===a||""===a)document.body.appendChild(b);else{var e=document.getElementById(a);e.appendChild(b)}return d.id},a.prototype.CreateScrollingBannerContainer=function(a){void 0===a||""===a?(this.scrollingDiv=document.createElement("div"),this.scrollingDiv.id="cto_scrolling",document.body.appendChild(this.scrollingDiv)):this.scrollingDiv=document.getElementById(a),this.scrollingContainerOffsetTop=this.scrollingDiv.offsetTop;var b=this;return window.addEventListener?window.addEventListener("scroll",function(){b.SetScrollingContainerPosition()},!1):window.attachEvent("onscroll",function(){b.SetScrollingContainerPosition()}),this.SetScrollingContainerPosition(),this.scrollingDiv.id},a.prototype.SetScrollingContainerPosition=function(){var a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;a>=this.scrollingContainerOffsetTop-10?(this.scrollingDiv.style.position="fixed",this.scrollingDiv.style.top="10px"):(this.scrollingDiv.style.position="static",this.scrollingDiv.style.top="auto")},a}(),__extends$15=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DisplayEvent=function(a){function b(b,c,d){var e=a.call(this,b)||this;return e.displayParameters=d,e.urlBuilder=c,e}return __extends$15(b,a),b.prototype.eval=function(a){this.displayParameters.atfRatio=a.viewabilityComputer.GetAtfRatio(a.context,this.displayParameters.containerid)},b.prototype.buildCasUrl=function(a,b,c,d){return this.urlBuilder.buildUrl(this.displayParameters,a,b,c,d)},b}(AbstractEvent),HandlerType;!function(a){a[a.AFR=0]="AFR",a[a.AJS=1]="AJS"}(HandlerType||(HandlerType={}));var __extends$14=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DisplayEventAFR=function(a){function b(c,d,e){var f=a.call(this,b.NAME,c,d)||this;return f.respectsEyeoDeal=e,f}return __extends$14(b,a),b.prototype.eval=function(b){a.prototype.eval.call(this,b);var c=this.displayParameters.containerid,d=this.displayParameters.callbackSuccess,e=this.displayParameters.callbackError,f=this.buildCasUrl(b.context,HandlerType.AFR);if(b.context.isAdBlocked){if(!this.respectsEyeoDeal)return;this.loadIframe(f,c,d,e)}else this.loadIframe(f,c,d,e)},b.prototype.loadIframe=function(a,b,c,d){var e=document.createElement("iframe");e.src=a,e.id=b+"_cto_iframe",e.frameBorder="0",e.hspace=0,e.vspace=0,e.marginWidth="0px",e.marginHeight="0px",e.width="100%",e.height="100%",e.scrolling="no",e.onload=c,e.onerror=d;var f=document.getElementById(b);f.appendChild(e)},b.NAME="displayAfr",b}(DisplayEvent),DomManipulationTools=function(){function a(){}return a.getHighestAccessibleWindow=function(a){var b=a,c=!1;try{for(;b.parent.document!==b.document;){if(!b.parent.document){c=!0;break}b=b.parent}}catch(a){c=!0}return{topFrame:b,err:c}},a.inIframe=function(){try{return window.self!==window.top}catch(a){return!0}},a}(),__extends$16=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DisplayEventAsync=function(_super){function DisplayEventAsync(a,b){return _super.call(this,DisplayEventAsync.NAME,a,b)||this}return __extends$16(DisplayEventAsync,_super),DisplayEventAsync.prototype.eval=function(a){var b=this;_super.prototype.eval.call(this,a);var c=this.displayParameters.containerid,d=this.displayParameters.width,e=this.displayParameters.height,f=this.displayParameters.layout,g=this.displayParameters.callbackSuccess,h=this.displayParameters.callbackError,i=this.displayParameters.passbackCode;if(""===c||void 0===c)Log.Error("No containerid provided");else if(void 0!==f){var j=DisplayEventAsync.CHAPI_NAME+"="+encodeURIComponent(JSON.stringify(f)),k=function(){var f=b.getContainerSize(c,d,e),k=b.buildCasUrl(a.context,void 0,f.width,f.height);b.loadScriptAsync(k,j,g,h,i)};void 0!==d&&void 0!==e?k():window.addEventListener?window.addEventListener("load",k,!1):window.attachEvent("onload",k)}else{var l=this.buildCasUrl(a.context);this.loadScriptAsync(l,void 0,g,h,i)}},DisplayEventAsync.prototype.loadScriptAsync=function(url,data,callBackSuccess,callbackFail,passbackCode){var request=new AsyncRequest(url,data);request.send(function(responseText){var pb=passbackCode?passbackCode:function(){};eval(responseText),void 0!==callBackSuccess&&callBackSuccess(responseText)},function(a,b){void 0!==passbackCode&&passbackCode(),void 0!==callbackFail&&callbackFail(a,b)},passbackCode)},DisplayEventAsync.prototype.getContainerSize=function(a,b,c){var d=document.getElementById(a),e=DomManipulationTools.inIframe(),f=b?b:e?document.body.offsetWidth:d.offsetWidth,g=c?c:e?document.body.offsetHeight:d.offsetHeight;return(0===f||0===g||f<80||g<40)&&(g=void 0,f=void 0),{width:f,height:g}},DisplayEventAsync.NAME="displayEventAsync",DisplayEventAsync.CHAPI_NAME="publisherCreativeConfiguration",DisplayEventAsync}(DisplayEvent),__extends$17=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DisplayEventSync=function(a){function b(c,d){return a.call(this,b.NAME,c,d)||this}return __extends$17(b,a),b.prototype.eval=function(b){a.prototype.eval.call(this,b);var c=this.buildCasUrl(b.context);this.loadScriptSync(c)},b.prototype.loadScriptSync=function(a){document.write("<script type='text/javascript' src='"+a+"'></script>")},b.NAME="displaySync",b}(DisplayEvent),__extends$18=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DisplayInputParameters=function(a){function b(b){var c=a.call(this)||this;return c.zoneid=void 0,c.async=void 0,c.containerid=void 0,c.width=void 0,c.height=void 0,c.callbackSuccess=void 0,c.callbackError=void 0,c.callIfNotAdblocked=void 0,c.passbackCode=void 0,c.publisherUrl=void 0,c.overridenWpdt0=void 0,c.overridenCt0=void 0,c.layout=void 0,c.atfRatio=void 0,c.adFormat=AdFormatType.Classic,c.overrideZoneFloor=!0,c.collapseContainerIfNotAdblocked=!0,c.extraData={},c.addParameter("zoneId",function(a){c.zoneid=a}),c.addParameter("async",function(a){c.async=a===!0}),c.addParameter("containerId",function(a){c.containerid=a}),c.addParameter("width",function(a){c.width=a}),c.addParameter("height",function(a){c.height=a}),c.addParameter("callbackSuccess",function(a){c.callbackSuccess=a}),c.addParameter("callbackError",function(a){c.callbackError=a}),c.addParameter("callIfNotAdblocked",function(a){c.callIfNotAdblocked=a}),c.addParameter("passbackCode",function(a){c.passbackCode=a}),c.addParameter("layout",function(a){c.layout=a}),c.addParameter("publisherCreativeConfiguration",function(a){c.layout=a}),c.addParameter("extraData",function(a){c.extraData=a}),c.addParameter("publisherUrl",function(a){c.publisherUrl=a}),c.addParameter("wpdt0",function(a){c.overridenWpdt0=a}),c.addParameter("ct0",function(a){c.overridenCt0=a}),c.addParameter("overrideZoneFloor",function(a){c.overrideZoneFloor=a}),c.addParameter("collapseContainerIfNotAdblocked",function(a){c.collapseContainerIfNotAdblocked=a}),c.addParameter("adFormat",function(a){c.adFormat=c.parseAdFormat(a)}),a.prototype.tryFillParameters.call(c,b),c}return __extends$18(b,a),b.prototype.parseAdFormat=function(a){switch(a.toLowerCase()){case"stickyfooter":return AdFormatType.StickyFooter;case"scrollingbanner":return AdFormatType.ScrollingBanner;default:return AdFormatType.Classic}},b}(InputParameters),DisplayUrlBuilder=function(){function a(){}return a.prototype.buildUrl=function(b,c,d,e,f){var g;g=d===HandlerType.AFR?a.CAS_URL_AFR:a.CAS_URL_AJS;var h="https:"===c.protocol?"https:":"http:",i=h+g+"?ptv="+PublisherTagVersion;if(c.isAdBlocked===!0){var j=this.getAbpParameter(b,c);i+="&abp="+String(j)}d!==HandlerType.AFR&&(i+=void 0!==b.containerid&&""!==b.containerid?"&containerid="+encodeURIComponent(b.containerid):""),i+="&zoneid="+String(b.zoneid),i+=e?"&width="+e:"",i+=f?"&height="+f:"",i+=c.ctoIdOnPublisherDomain?"&idcpy="+c.ctoIdOnPublisherDomain:"",i+=c.idfs?"&idfs="+c.idfs:"",i+=c.isOptOut?"&optout=1":"",i+="&cb="+String(CacheBusterGenerator.generateCacheBuster()),i+="&nodis="+(c.dising?"0":"1"),i+=c.charset?"&charset="+c.charset:"",i+=b.overridenCt0?"&ct0="+encodeURIComponent(b.overridenCt0):c.ct0?"&ct0="+encodeURIComponent(c.ct0):"",i+=b.overridenWpdt0?"&wpdt0="+encodeURIComponent(b.overridenWpdt0):c.wpdt0?"&wpdt0="+encodeURIComponent(c.wpdt0):"",i+=b.publisherUrl?"&publisherurl="+encodeURIComponent(b.publisherUrl):"",i+=c.getContextFlags();for(var k in b.extraData)void 0!==b.extraData[k]&&(i+="&"+k+"="+encodeURIComponent(b.extraData[k]));i+=b.passbackCode?"&dlp=1":"",b.integrationMode!==IntegrationMode.Unspecified&&(i+="&im="+b.integrationMode),i+="&dc="+c.displayContext;var l=Math.round(100*b.atfRatio)/100;return i+=void 0!==b.atfRatio?"&atfr="+l:"",i+=c.highestAccessibleUrl?"&loc="+encodeURIComponent(c.highestAccessibleUrl).substring(0,1600):""},a.prototype.getAbpParameter=function(a,b){var c=b.isAdBlocked?1:0,d=a.overrideZoneFloor?0:2;return c|d},a.CAS_URL_AJS="//cas.criteo.com/delivery/ajs.php",a.CAS_URL_AFR="//cas.criteo.com/delivery/afr.php",a}(),DisplayContext;!function(a){a[a.InFriendlyIframe=1]="InFriendlyIframe",a[a.InUnfriendlyIframe=2]="InUnfriendlyIframe",a[a.DirectIntegration=3]="DirectIntegration"}(DisplayContext||(DisplayContext={}));var ViewabilityComputer=function(){function a(){}return a.prototype.GetAtfRatio=function(b,c){var d=document.getElementById(c);if(b.displayContext===DisplayContext.DirectIntegration){if(null!==d)return a.getRatioAboveFold(d);document.write("<div id='compute_visibility_helper' width='0px' height='0px'></div>");var e=document.getElementById("compute_visibility_helper"),f=a.getRatioAboveFold(e);return e.parentElement.removeChild(e),f}if(b.displayContext===DisplayContext.InFriendlyIframe)return a.getRatioAboveFold(frameElement)},a.getRatioAboveFold=function(a){var b=DomManipulationTools.getHighestAccessibleWindow(window).topFrame,c=b.document,d=b.innerHeight||c.documentElement.clientHeight||c.body.clientHeight,e=a.getBoundingClientRect(),f=c.documentElement.scrollTop||c.body.scrollTop;return d>=e.bottom+f?1:d<=e.top+f?0:(d-e.top-f)/a.offsetHeight},a}(),EyeoDealValidator=function(){function a(){}return a.prototype.respectsEyeoDeal=function(b){var c=document.getElementById(b),d=this.respectsSizeConstraints(c);if(!d)return Log.Debug("The element "+b+"does not respect Eyeo acceptable ads size constraints"),!1;var e=this.getNewRatiosFeatures(c),f=e.respectsAdRatioConstraint;return f?(a.atfRatio=e.newAtfRatio,a.btfRatio=e.newBtfRatio):Log.Debug("The element "+b+"does not respect Eyeo acceptable ads ratio constraints"),f},a.prototype.respectsSizeConstraints=function(a){var b=this.getAdLocationAttribute(a);switch(b){case"above-content":return a.offsetHeight<=200;case"in-content":return!1;case"below-content":return a.offsetHeight<=400;case"side-content":return a.offsetWidth<=350;default:return void 0!==b&&Log.Error("Unknown data-ad-loc attribute : "+b),!0}},a.prototype.getAdLocationAttribute=function(a){return a.getAttribute("data-ad-loc")?a.getAttribute("data-ad-loc"):void 0},a.prototype.getNewRatiosFeatures=function(b){var c=!1,d=ViewabilityComputer.getRatioAboveFold(b),e=b.offsetHeight*b.offsetWidth,f=screen.width*screen.height,g=a.atfRatio+d*e/f,h=a.btfRatio+(1-d)*e/f;return c=g<=.15&&h<=.25,{respectsAdRatioConstraint:c,newAtfRatio:g,newBtfRatio:h}},a.atfRatio=0,a.btfRatio=0,a}(),Polyfills=function(){function a(){}return a.LoadPolyfills=function(){a.DefineIsArray(),a.DefineIndexOf(),a.DefineFilter()},a.DefineIsArray=function(){Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)})},a.DefineIndexOf=function(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){if(void 0===b&&(b=0),void 0===this)throw new TypeError("'this' is null or not defined");var c=this.length;if(0===c)return-1;if(b>=c)return-1;for(var d=Math.max(b>=0?b:c-Math.abs(b),0);d<c;){if(d in this&&this[d]===a)return d;d++}return-1})},a.DefineFilter=function(){Array.prototype.filter||(Array.prototype.filter=function(a){if(void 0===this||void 0===this)throw new TypeError;var b=this.length;if("function"!=typeof a)throw new TypeError;for(var c=[],d=arguments.length>=2?arguments[1]:void 0,e=0;e<b;e++)if(e in this){var f=this[e];a.call(d,f,e,this)&&c.push(f)}return c})},a}(),AdBlocker=function(){function a(){this.allowedPixelLoaded=!1,this.blockedPixelFailed=!1}return a.prototype.isAdBlocked=function(b,c){var d=this,e="https:"===b?"https:":"http:",f=e+a.allowedPixelUrl,g=e+a.blockedPixelUrl;this.createPixel(f,function(){d.allowedPixelLoaded=!0,d.blockedPixelFailed===!0&&c(!0)},function(){}),this.createPixel(g,function(){c(!1)},function(){d.blockedPixelFailed=!0,d.allowedPixelLoaded===!0&&c(!0)})},a.prototype.createPixel=function(a,b,c){var d=document.createElement("img");d.src=a,d.height=1,d.width=1,d.style.display="none",d.onload=b,d.onerror=c},a.allowedPixelUrl="//static.criteo.net/images/pixel.gif?ch=1",a.blockedPixelUrl="//static.criteo.net/images/pixel.gif?ch=2",a}(),CookieSynchronizer=function(){function a(a){this.topWin=a,this.topDoc=a.document,this.localStorageHelper=new LocalStorageHelper(this.topWin.localStorage),this.localStorageEnabled=this.localStorageHelper.checkLocalStorage()}return a.isSafariBrowser=function(){return null!==navigator.userAgent.match(a.SAFARI_CHECK_REGEX)},a.prototype.synchronizeCriteoUid=function(b){var c=this;if((b||a.isSafariBrowser())&&this.topWin.addEventListener)if("complete"===this.topDoc.readyState)this.appendGumIframeIfDoesNotExist();else{var d=function(){c.topDoc.removeEventListener("DOMContentLoaded",d),c.topWin.removeEventListener("load",d),c.appendGumIframeIfDoesNotExist()};this.topWin.addEventListener("load",d,!1),this.topDoc.addEventListener("DOMContentLoaded",d,!1)}},a.prototype.appendGumIframeIfDoesNotExist=function(){var b=this,c=this.createGumIframe(),d=function(a){var c=a.data;c.isCriteoMessage&&(c.optout?(b.setClientSideOptOut(),b.deleteClientSideUid(),b.deleteClientSideIdfs()):(c.uid||c.idfs)&&(c.uid&&b.setClientSideUid(c.uid),c.idfs&&b.setClientSideIdfs(c.idfs)))};this.topDoc.getElementById(a.SYNCFRAME_ID)||(this.topWin.addEventListener("message",d,!1),this.topDoc.body.appendChild(c))},a.prototype.getClientSideUid=function(){return this.getFromAllStorages(a.GUID_COOKIE_NAME)},a.prototype.setClientSideUid=function(b){this.writeOnAllStorages(a.GUID_COOKIE_NAME,b,a.GUID_RETENTION_TIME_HOUR)},a.prototype.deleteClientSideUid=function(){this.deleteFromAllStorage(a.GUID_COOKIE_NAME)},a.prototype.getClientSideOptOut=function(){var b=this.getFromAllStorages(a.OPTOUT_COOKIE_NAME);return Boolean(b)},a.prototype.setClientSideOptOut=function(){this.writeOnAllStorages(a.OPTOUT_COOKIE_NAME,"1",a.OPTOUT_RETENTION_TIME_HOUR)},a.prototype.deleteClientSideIdfs=function(){this.deleteFromAllStorage(a.IDFS_COOKIE_NAME)},a.prototype.getClientSideIdfs=function(){return this.getFromAllStorages(a.IDFS_COOKIE_NAME)},a.prototype.setClientSideIdfs=function(b){this.writeOnAllStorages(a.IDFS_COOKIE_NAME,b,a.GUID_RETENTION_TIME_HOUR)},a.prototype.createGumIframe=function(){var b=this.topDoc.createElement("iframe"),c=this.buildSyncframeSrc();return b.src=c,b.id=a.SYNCFRAME_ID,b.style.display="none",b},a.prototype.writeOnAllStorages=function(a,b,c){this.localStorageEnabled&&this.localStorageHelper.setItem(a,b),CookieHelper.SetCookie(a,b,c,this.topDoc,!0)},a.prototype.getFromAllStorages=function(a){var b,c=CookieHelper.GetCookie(a,this.topWin.document);return this.localStorageEnabled&&(b=this.localStorageHelper.getItem(a)),c||b},a.prototype.deleteFromAllStorage=function(a){CookieHelper.DeleteCookie(a,this.topDoc,!0),this.localStorageEnabled&&this.localStorageHelper.removeItem(a)},a.prototype.buildSyncframeSrc=function(){var a="https://gum.criteo.com/syncframe",b=this.getClientSideUid(),c=this.getClientSideIdfs(),d=this.getClientSideOptOut(),e="publishertag",f=PublisherTagVersion;return a+="#"+JSON.stringify({optout:d,uid:b,idfs:c,origin:e,version:f})},a.GUID_COOKIE_NAME="cto_idcpy",a.GUID_RETENTION_TIME_HOUR=9360,a.IDFS_COOKIE_NAME="cto_idfs",a.OPTOUT_COOKIE_NAME="cto_optout",a.OPTOUT_RETENTION_TIME_HOUR=43200,a.SYNCFRAME_ID="criteo-syncframe",a.SAFARI_CHECK_REGEX=/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[^ ]+ \(KHTML, like Gecko\) Version\/([^ ]+)( Mobile\/[^ ]+)? Safari\/[^ ]+$/i,a}(),Context=function(){function a(a,b){this.charset=a.charset?a.charset:a.characterSet?a.characterSet:"";var c=DomManipulationTools.getHighestAccessibleWindow(b);this.synchronizeCriteoUid(c),this.displayContext=this.getDisplayContext(c),this.highestAccessibleUrl=this.getHighestAccessibleUrl(c);var d=this.getQueryStringParams(this.highestAccessibleUrl);this.debugMode="1"===d.pbt_debug||!1,this.noLog="1"===d.pbt_nolog||!1,this.debugMode&&SetLogLevel(LogLevel.Debug),this.location=b.location,this.protocol=b.location.protocol,this.dising=!1,this.ct0=void 0,this.wpdt0=void 0,this.isAdBlocked=void 0,this.rtaVarNames=[]}return a.prototype.getContextFlags=function(){var a="";return a+=this.debugMode?"&debug=1":"",a+=this.noLog?"&nolog=1":""},a.prototype.getHighestAccessibleUrl=function(a){var b=a.topFrame,c=a.err,d="";if(c)try{if(d=b.top.location.href,!d){var e=b.location.ancestorOrigins;d=e[e.length-1]}}catch(a){d=b.document.referrer}else d=b.location.href;return d},a.prototype.getDisplayContext=function(a){return DomManipulationTools.inIframe()?a.err?DisplayContext.InUnfriendlyIframe:DisplayContext.InFriendlyIframe:DisplayContext.DirectIntegration},a.prototype.getQueryStringParams=function(a){var b={},c=a.split("?");if(c.length>1)for(var d=c[1].split("&"),e=0,f=d;e<f.length;e++){var g=f[e],h=g.split("=");b[tryDecodeURIComponent(h[0])]=tryDecodeURIComponent(h[1])}return b},a.prototype.synchronizeCriteoUid=function(a){var b=a.topFrame,c=new CookieSynchronizer(b);this.ctoIdOnPublisherDomain=c.getClientSideUid(),this.isOptOut=c.getClientSideOptOut(),this.idfs=c.getClientSideIdfs(),c.synchronizeCriteoUid()},a.prototype.getIdfs=function(){return this.idfs},a.prototype.setIdfs=function(a){this.idfs=a},a}(),StandaloneDirectBidder=function(){function a(){this.bids={},this.lineItemRanges=[]}return a}(),PublisherTag=function(){function a(){this.standaloneBidder=new StandaloneDirectBidder,this.canProcessConditionalEvents=void 0,this.events=[],this.context=new Context(document,window),this.viewabilityComputer=new ViewabilityComputer,this.adblocker=new AdBlocker,Log.Debug("Publisher Tag loaded")}return a.prototype.push=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];for(var c=0,d=a;c<d.length;c++){var e=d[c];this.events.push(e)}this.evalEvents()},a.prototype.checkAdblocker=function(){if(void 0===this.canProcessConditionalEvents){var a=this;this.canProcessConditionalEvents=!1,this.adblocker.isAdBlocked(this.context.protocol,function(b){a.context.isAdBlocked=b,a.canProcessConditionalEvents=!0,a.evalEvents()})}},a.prototype.evalEvents=function(){for(var a=0;a<this.events.length;)if("conditionalEvent"===this.events[a].name&&this.canProcessConditionalEvents===!1)a++;else{var b=this.events.splice(a,1);b[0].eval(this)}},a.VERSION=PublisherTagVersion,a}(),__extends$20=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),DefaultCrtgContentName="crtg_content",DefaultCrtgRtaCookieName="crtg_rta",RtaInputParameters=function(a){function b(b){var c=a.call(this)||this;return c.networkId=void 0,c.crtgContentName=void 0,c.crtgRtaCookieName=void 0,c.adserver=void 0,c.addParameter("networkId",function(a){c.networkId=a}),c.addParameter("varName",function(a){c.crtgContentName=a}),c.addParameter("cookieName",function(a){c.crtgRtaCookieName=a}),c.addParameter("adserver",function(a){c.adserver=a}),a.prototype.tryFillParameters.call(c,b),c}return __extends$20(b,a),b}(InputParameters),__extends$19=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),RtaEvent=function(_super){function RtaEvent(a,b){var c=_super.call(this,RtaEvent.NAME)||this;return c.urlBuilder=a,c.parameters=b,c}return __extends$19(RtaEvent,_super),RtaEvent.prototype.eval=function(a){_super.prototype.eval.call(this,a);var b=this.urlBuilder.buildUrl(this.parameters,a.context),c=new AsyncRequest(b),d=function(a,c){return Log.Error("An error occured while calling "+b)},e=this.parameters.crtgContentName?this.parameters.crtgContentName:DefaultCrtgContentName,f=a.context.rtaVarNames.indexOf(e,0);f===-1&&a.context.rtaVarNames.push(e),c.send(this.executeScript,d)},RtaEvent.prototype.executeScript=function(responseText){eval(responseText)},RtaEvent.NAME="rtaEvent",RtaEvent}(AbstractEvent),__extends$21=function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),RtaTargetingEvent=function(a){function b(c,d){var e=a.call(this,b.NAME)||this;return e.adserver=c,e.targetingValues=d,e}return __extends$21(b,a),b.prototype.eval=function(a){if(void 0===this.adserver)return void Log.Error("undefined adserver");switch(this.adserver.toLowerCase()){case"dfp":this.setTargetingDFP(this.targetingValues);break;default:Log.Error("unknown adserver '"+this.adserver+"'")}},b.prototype.setTargetingDFP=function(a){var b=new DFPKeyValueTargeter;b.setKeyValuesForAllSlots(a)},b.NAME="rtaTargetingEvent",b}(AbstractEvent),RtaUrlBuilder=function(){function a(){}return a.prototype.buildUrl=function(b,c){var d="https:"===c.protocol?"https:":"http:",e=d+a.RTA_URL+"?ptv="+PublisherTagVersion;return c.isAdBlocked===!0&&(e+="&abp=1"),e+="&netid="+String(b.networkId),e+=c.ctoIdOnPublisherDomain?"&idcpy="+c.ctoIdOnPublisherDomain:"",e+=c.idfs?"&idfs="+c.idfs:"",e+=c.isOptOut?"&optout=1":"",e+=b.crtgRtaCookieName?"&cookieName="+encodeURIComponent(b.crtgRtaCookieName):"",e+=b.crtgContentName?"&varName="+encodeURIComponent(b.crtgContentName):"",e+="&rnd="+String(CacheBusterGenerator.generateCacheBuster()),e+=c.getContextFlags(),b.integrationMode!==IntegrationMode.Unspecified&&(e+="&im="+b.integrationMode),e},a.RTA_URL="//rtax.criteo.com/delivery/rta/rta.js",a}(),passbackProfileId=206;window.criteo_pubtag||(Polyfills.LoadPolyfills(),window.criteo_pubtag=new PublisherTag),window.Criteo={CallRTA:CallRTA,ComputeDFPTargetingForAMP:ComputeDFPTargetingForAMP,SetTargeting:SetTargeting,DisplayAd:DisplayAd,DisplayAcceptableAdIfAdblocked:DisplayAcceptableAdIfAdblocked,ComputeStandaloneDFPTargeting:ComputeStandaloneDFPTargeting,GetBids:GetBids,GetBidsForAdUnit:GetBidsForAdUnit,RenderAd:RenderAd,RequestBids:RequestBids,SetDFPKeyValueTargeting:SetDFPKeyValueTargeting,SetLineItemRanges:SetLineItemRanges,Passback:{RequestBids:RequestBidsPassback,RenderAd:RenderAdPassback},PubTag:{Adapters:{AMP:AMP},Context:{SetIdfs:SetIdfs,GetIdfs:GetIdfs},DirectBidding:{DirectBiddingEvent:DirectBiddingEvent,DirectBiddingEventWithCaching:DirectBiddingEventWithCaching,DirectBiddingSlot:DirectBiddingSlot,DirectBiddingUrlBuilder:DirectBiddingUrlBuilder,Size:Size},RTA:{DefaultCrtgContentName:DefaultCrtgContentName,DefaultCrtgRtaCookieName:DefaultCrtgRtaCookieName}},events:window.Criteo?window.Criteo.events:[]},window.Criteo.events=createEventProcessor(window.Criteo.events)}();