try { __ez.fads.adLoadHB=(__ez.fads.adLoadHB&&__ez.fads.adLoadHB.loaded===true)?__ez.fads.adLoadHB:{loaded:true,timeoutSet:false,auctionStatus:{},version:1,maxFloor:2,log:__ez.fads.log,lastAuctionTimes:{},bangerName:'IL11ILILIIlLLLILILLLLIILLLIIL11111LLILiiLIliLlILlLiiLLIiILL',minTimeBetweenAuctions:20000,hbIds:[],init:function(vp_ht,doc_ht,version){__ez_fad_pb();this.version=version;this.initFeatureMap();},reset:function(){this.auctionStatus={};},cleanupAdData:function(divId){this.hbIds=this.hbIds.filter(function(id){return id!==divId;});delete this.auctionStatus[divId];},LoadAd:function(ids,count,floors,timeout){this.log('HB Loading ad: ',ids,count,floors);if(!Array.isArray(ids)){ids=[ids];} if(isNaN(count))count=0;if(count<1){floors=this.convertBr1ToHBFloors(floors);} this.log('HB Loading ad: ',ids,count,floors);this.setTimeout(2000);var slots=[];var alreadyRunning=[];for(var i=0;i0){this.requestBids(ids,slots,floors,timeout);}else if(alreadyRunning.length==ids.length){return;}else if(count<50){var to=(count*10>100)?count*10:100;setTimeout(function(){__ez.fads.adLoadHB.LoadAd(ids,count+1,floors,timeout)},to);}else{for(var i=0;ithis.maxFloor)?this.maxFloor:Math.round(f*100)/100;} return hbFloors;},setUpGlobalEvents:function(){if(this.preBidEventsSetup){return;} this.preBidEventsSetup=true;this.setUpEventListeners();if(__ez.fads.logEnabled){epbjs.mergeConfig({debug:true});}},adFilled:function(id){this.auctionStatus[id]=null;this.bidCache.releaseBid(id);},FilterByAuctionEligible:function(ids){var auctionEligible=[];var auctionNotEligble=[];var auctionRunning=[];for(var i=0;ithis.minTimeBetweenAuctions;if(!isLongEnough){} return isLongEnough;},requestBids:function(ids,adUnits,floors,timeout){if(typeof timeout==='undefined'){timeout=2000;} if(timeout<800){timeout=800;} for(var i=0;i{var isBidderBlockedFromBidding=noBidsByAdUnitsCache[adUnits[i].code].includes(bid.bidder);if(!isBidderBlockedFromBidding){filteredBids.push(bid);}});adUnits[i].bids=filteredBids;} return adUnits;},setMinimumBidFloors:function(adUnits,floors){var minFloor=0;for(var k in floors){if(floors[k]0){var foundUnit=epbjs.adUnits.find(unit=>unit&&unit.code===id);if(typeof foundUnit!=='undefined'&&foundUnit!=null){return foundUnit;}} return this.GetEZAdunitById(id);},GetEZAdunitById:function(id){if(typeof epbjs!=='undefined'&&typeof epbjs.ezAdUnits!=='undefined'&&epbjs.ezAdUnits.length>0){var foundUnit=epbjs.ezAdUnits.find(unit=>unit&&unit.code===id);if(typeof foundUnit!=='undefined'){return foundUnit;}else{return false;}} return null;},addPixelData:function(slot,key,name,transform){var value=slot.getTargeting(key)[0];if(typeof value!=='undefined'&&value!==''){if(name==null)name=key;__ez.pel.Add(slot,[new __ezDotData(name,transform?transform(value):value)]);} return value;},HandleBidWonModifiers:function(bid){if(typeof bid==='undefined'||bid===null||!bid.bidder||bid.bidder.toLowerCase()!=='aidem'){return;} let slotID=bid.adUnitName;__ez.fads.SetGAMTargeting(slotID,'reft','n');},checkPrebidIds:function(){if(typeof epbjs==='undefined'){return;} let appliedUIDs=epbjs.getUserIds();if(!appliedUIDs.uid2||!appliedUIDs.uid2.id||__ez.fads.adLoadHB.sentIDPixel===true){return;} __ez.fads.adLoadHB.sentIDPixel=true;let pvID=window["_ezaq"]["page_view_id"];let pvData=[(new __ezDotData('email_applied',1))];if(typeof __ez.bit!=="undefined"){__ez.bit.AddAndFire(pvID,pvData);return;} window.ez_bit_cmd=window.ez_bit_cmd||[];window.ez_bit_cmd.push(function(){__ez.bit.AddAndFire(pvID,pvData);});},} var __ez_fad_ezpbinitd=false;function __ez_fad_pb(){if(__ez_fad_ezpbinitd==false&&typeof __ez_fad_ezpbinit=='function') {__ez_fad_ezpbinit();__ez_fad_ezpbinitd=true;}else if(__ez_fad_ezpbinitd==false) {setTimeout(function(){__ez_fad_pb()},100);}}Object.assign(__ez.fads.adLoadHB,{processedAuctions:[],preBidEventsSetup:false,winningAdIds:[],featureMap:featureMap={position:{}},hasAdWon:function(adId){return this.winningAdIds.indexOf(adId)>-1;},recordAdWin:function(adId){this.winningAdIds.push(adId);},auctionCompleteHandler:function(bids,timedOut,auctionId,ids,e){if(this.processedAuctions.indexOf(auctionId)>-1){return;} this.processedAuctions.push(auctionId);if(ids.length==0){return;} this.log('auctionCompleteHandler: bid response for bids:',bids,'timededout:',timedOut,'auctionId:',auctionId,'ids:',ids);for(var i=0;i0){this.bidCache.cacheNoBids(e.noBids);} if(e.bidsReceived.length>0){this.bidCache.removeCacheNoBidsForReceivedBids(e.bidsReceived);} __ez.fads.logAdStats(ids,'adloadhb');__ez.fads.AdLoadComplete('adLoadHB',ids);},RecordBidReceived:function(bid){if(typeof window.PrebidImpressionController==='undefined'){return;} var slotTargeting=this.GetSlotTargetingForAdCode(bid.adUnitCode);window.PrebidImpressionController.newPrebidImpression(slotTargeting,bid);},GetSlotTargetingForAdCode:function(adCode){if(!adCode.startsWith('div-gpt-ad')){return{};} var slotTargetingMatches=ezslots_raw.filter(s=>s.tap&&s.tap.startsWith(adCode.slice(11,-2)));if(slotTargetingMatches.length===0){return{};} return slotTargetingMatches[0];},SetBidForId:function(id){var topBid=this.bidCache.getTopBid(id);this.log("top bid from cache for ",id,topBid) if(topBid!=null&&typeof topBid.adId!=='undefined'){this.setBidParams(id,topBid);}else{}},AdRenderSuccessHandler:function(bid){if(typeof __ez==='undefined'||typeof __ez.pel==='undefined'||typeof __ezDotData==='undefined'||typeof __ez.pel.Add!=='function'||typeof __ez.bit==='undefined'||typeof __ez.bit.Add!=='function'){setTimeout(function(){__ez.fads.adLoadHB.AdRenderSuccessHandler(bid)},1000);return;} var slot=__ez.fads.adLoadGAM.GetSlotById(bid.adUnitCode);if(typeof slot==='undefined'||typeof bid.adId==='undefined'){return;} var last_bid_val=parseInt(slot.getTargeting("br1")[0]);if(typeof window.ezbfcr!=='undefined'){last_bid_val=last_bid_val*window.ezbfcr;} var ssid=0;var revenue=bid.cpm/1000;var lcBidder="missing";if(typeof bid.bidder!=='undefined'){lcBidder=bid.bidder.toLowerCase();} if(typeof epbjs.SS[lcBidder]!=='undefined'){ssid=epbjs.SS[lcBidder];__ez.pel.Add(slot,[new __ezDotData('stat_source_id',ssid)],revenue,0,revenue,last_bid_val,ssid);} __ez.pel.Add(slot,[new __ezDotData('loaded',1)],revenue,0,revenue,last_bid_val,ssid);__ez.bit.AddAndFire(window["_ezaq"]["page_view_id"],[new __ezDotData('est_revenue_usd',revenue)]);this.addPixelData(slot,'eb_br','filled_bid_hash',function(v){return v.substring(0,32);});this.addPixelData(slot,'hb_rt','prebid_source');this.addPixelData(slot,'ic','refresh_count',null,function(v){return parseInt(v);});__ez.pel.Fire();if(window.__ezIIQ&&__ezIIQ.isIIQEnabled&&__ezIIQ.isIIQEnabled()){__ezIIQ.sendIIQData(__ezIIQ.iiqBidSourcePrebid,slot.getSlotElementId(),bid.cpm,bid);} this.log("AdRenderSuccessHandler FINISHED: bid:",bid,"slot:",slot);},RenderFailedHandler:function(event){this.log("RenderFailedHandler: bid:",event);if(typeof event.bid!='undefined'){var bid=event.bid;}else{var bid=this.bidCache.getBidByAdId(event.adId);} if(typeof bid!='undefined'&&bid!=null){this.bidCache.removeBid(bid);__ez.fads.RefreshAd(bid.adUnitCode,true);}},UpdatePrebidVars:function(bid){var adUnitCode=bid.adUnitCode;var bidder=bid.bidder;epbjs.ezas[adUnitCode]=bid.size;if(bidder==="ehb"){epbjs.ezdss[adUnitCode]=bid.ss;}else{var lowerCaseBidder=bidder.toLowerCase();var matchedBidder=epbjs.SS[lowerCaseBidder]!==undefined?lowerCaseBidder:(epbjs.SS[bidder]!==undefined?bidder:null);if(matchedBidder!==null){epbjs.ezdss[adUnitCode]=epbjs.SS[matchedBidder];if(epbjs.useAdj&&epbjs.bidders.indexOf(bidder)>-1){epbjs.ezobid[adUnitCode]=bid.cpm/epbjs.gadj;}}else{console.error("epbjs: NO MATCHED BIDDER",bidder,epbjs.SS);}} if(epbjs.ezBidCache!==undefined){epbjs.ezBidCache.clearBidForUnit(adUnitCode,bid.bidderCode);} this.log("HB WON! bid:",adUnitCode,bid.transactionId,bid);this.bidCache.removeBid(bid);},setUpEventListeners:function(){epbjs.onEvent('bidWon',function(bid){if(__ez.fads.adLoadHB.hasAdWon(bid.adId)){return;} __ez.fads.adLoadHB.recordAdWin(bid.adId);__ez.fads.adLoadHB.log("!!!!!!!!!!!! bidWon event",bid);__ez.fads.adLoadHB.UpdatePrebidVars(bid);__ez.fads.adLoadHB.HandleBidWonModifiers(bid);});epbjs.onEvent('adRenderSucceeded',function(e){__ez.fads.adLoadHB.log("!!!!!!!!!!!! adRenderSucceeded event",e);__ez.fads.adLoadHB.AdRenderSuccessHandler(e.bid);});epbjs.onEvent('beforeRequestBids',function(event){event.forEach(adunitRequest=>{let adID=adunitRequest.code;let bidderSSIDs=adunitRequest.bids.map(b=>epbjs.SS[b.bidder]).filter(ssid=>typeof ssid!=='undefined');__ez.fads.log("beforeRequestBids set rbs targeting:",adID,bidderSSIDs);if(__ez.fads.adLoadGAM.loaded===false){__ez.fads.SetGAMTargeting(adID,'rbs',bidderSSIDs);return;} __ez.fads.adLoadGAM.SetTargeting(adID,'rbs',bidderSSIDs);})}) epbjs.onEvent('auctionEnd',function(e,timedOut,acutionId){__ez.fads.adLoadHB.log("auctionEnd event",e);__ez.fads.adLoadHB.auctionCompleteHandler(e.bidsReceived,false,e.auctionId,e.adUnitCodes,e);});epbjs.onEvent('adRenderFailed',function(e){__ez.fads.adLoadHB.RenderFailedHandler(e);});},initFeatureMap:function(){this.featureMap.position={'rubicon':'position',};},});__ez.fads.adLoadHB.bidCache=__ez.fads.adLoadHB.bidCache||{cachedBids:{},noBidsByAdUnits:{},recentlyReleased:{},ttlBuffer:3000,log:__ez.fads.adLoadHB.log,parent:__ez.fads.adLoadHB,log:function(){if(__ez.fads.logEnabled){let args=Array.from(arguments);args.unshift('bidCache::');__ez.fads.adLoadHB.log.apply(__ez.fads.adLoadHB,args);}},cacheBid:function(adUnit,bid){if(!adUnit||!bid){return null;} if(typeof epbjs.bidderSettings=="object"&&bid.bidder in epbjs.bidderSettings&&typeof epbjs.bidderSettings[bid.bidder].bidCpmAdjustment=="function"){var adjBid=Math.floor(epbjs.bidderSettings[bid.bidder].bidCpmAdjustment(bid.cpm)*100)/100;if(typeof adjBid!="undefined"&&!isNaN(adjBid)){bid.cpm=adjBid;bid.pbCg=adjBid;if(typeof bid.adserverTargeting!="undefined"){bid.adserverTargeting["epp"]=adjBid;}}} bid.ogAdUnitCode=adUnit.code;var key=this.getCacheKey(adUnit);if(bid.bidderCode==='teads'||bid.bidderCode==='aidem'){key=bid.adUnitCode;} if(bid.bidderCode==='aidem'){key=bid.adUnitCode;bid.ttl=10;} if(typeof this.cachedBids[key]==='undefined'){this.cachedBids[key]=[];} this.cachedBids[key].push(bid);},cacheNoBids:function(noBids){var exclusionList=[11309,11314,11313,11321,11315,10061,11290,11335,10087,11294,11316,10097,11328];noBids.forEach(({adUnitCode,bidder,bidderWinsCount,bidderRequestsCount})=>{if(epbjs.SS.hasOwnProperty(bidder)&&exclusionList.includes(epbjs.SS[bidder])){return;} if(typeof this.noBidsByAdUnits[adUnitCode]==='undefined'){this.noBidsByAdUnits[adUnitCode]=[bidder];}else if(!this.noBidsByAdUnits[adUnitCode].includes(bidder)){this.noBidsByAdUnits[adUnitCode].push(bidder);}});this.log("cached NoBidsByAdUnits:",this.noBidsByAdUnits);},removeCacheNoBidsForReceivedBids:function(receivedBids){receivedBids.forEach(({adUnitCode,bidder})=>{if(typeof this.noBidsByAdUnits[adUnitCode]==='undefined'){return;} if(this.noBidsByAdUnits[adUnitCode].includes(bidder)){this.noBidsByAdUnits[adUnitCode]=this.noBidsByAdUnits[adUnitCode].filter(item=>item!==bidder);}});},getBidByAdId:function(adId){for(var key in this.cachedBids){var bids=this.cachedBids[key];for(var i=0;itopBid.cpm){topBid=bids[i];}} if(topBid!==null){topBid.reserved=true;topBid.reservedId=adUnit.code;topBid.adUnitCode=adUnit.code;} return topBid;},getBidsForAdUnit:function(adUnit){if(!adUnit){return null;} var key=this.getCacheKey(adUnit);this.removeExpiredBids();var bids=this.cachedBids[key];if(typeof bids==='undefined'){this.log('no bids found for',key);return null;} bids=this.filterBidsAvailableFromCache(adUnit,bids,key);bids=bids.filter(bid=>!(this.isBidExpired(bid)&&bid.reserved&&bid.reservedId!==adUnit.code));__ez.fads.adLoadHB.bidCache.log(`returning ${bids.length} bids`);return bids},filterBidsAvailableFromCache:function(adUnit,bids,bidCacheKey){if(bidCacheKey!==adUnit.code&&Array.isArray(this.cachedBids[adUnit.code])){bids=[...bids,...this.cachedBids[adUnit.code]];} let forcedSoloBidder=new URLSearchParams(window.location.search).get('ez_force_hb_solo');if(forcedSoloBidder){bids=bids.filter(bid=>bid.bidderCode===forcedSoloBidder);} return bids;},setRenderDiv:function(adid){for(var key in this.cachedBids){var bids=this.cachedBids[key];for(var i=0;i(bid.responseTimestamp+(bid.ttl*1000)-this.ttlBuffer);},removeExpiredBids:function(){for(var key in this.cachedBids){var bids=this.cachedBids[key];for(var i=0;i