text: pbjsChunk([63],{312:function(e,r,a){e.exports=a(313)},313:function(e,r,a){"use strict";var t=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},i=a(4),d=a(0),s=a(5),n=a(2),c=a(3),l=a(8).default;function p(){var e=new l("twenga");function r(e,r){var a="//rtb.t.c4tw.net/Bid?";if(a=d.tryAppendQueryString(a,"s","h"),a=d.tryAppendQueryString(a,"callback","pbjs.handleTwCB"),a=d.tryAppendQueryString(a,"callback_uid",r),a=d.tryAppendQueryString(a,"referrer",d.getTopWindowUrl()),e.params)for(var t in e.params){var i=e.params[t];switch(t){case"placementId":t="id";break;case"siteId":t="sid";break;case"publisherId":t="pid";break;case"currency":t="cur";break;case"bidFloor":t="min";break;case"country":t="gz"}a=d.tryAppendQueryString(a,t,i)}var s=d.parseSizesInput(e.sizes);return s.length>0&&(a=d.tryAppendQueryString(a,"size",s.join(","))),a+="ta=1",d.logMessage("bid request built: "+a),e.startTime=(new Date).getTime(),a}return e.callBids=function(e){for(var a=0;a<e.bids.length;a++){var t=e.bids[a],i=t.bidId;s.loadScript(r(t,i))}},pbjs.handleTwCB=function(e){var r;if(e&&e.callback_uid){var a,t=e.callback_uid,s="",l=d.getBidRequest(t);l&&(r=l.bidder,s=l.placementCode,l.status=i.STATUS.GOOD),d.logMessage("JSONP callback function called for ad ID: "+t);var p=[];if(e.result&&e.result.cpm&&0!==e.result.cpm&&e.result.ad){var o=e.result;a=parseInt(o.cpm,10),a/=1e4;var u=o.ad.replace("%%WP%%",o.cpm);(p=c.createBid(1,l)).creative_id=o.creative_id,p.bidderCode=r,p.cpm=a,!u||0!==u.lastIndexOf("http",0)&&0!==u.lastIndexOf("//",0)?p.ad=u:p.adUrl=u,p.width=o.width,p.height=o.height,n.addBidResponse(s,p)}else d.logMessage("No prebid response from Twenga for placement code "+s),(p=c.createBid(2,l)).bidderCode=r,n.addBidResponse(s,p)}else d.logMessage("No prebid response for placement %%PLACEMENT%%")},t(this,{callBids:e.callBids,setBidderCode:e.setBidderCode,buildBidCall:r})}a(1).registerBidAdapter(new p,"twenga"),e.exports=p}},[312]);