text: pbjsChunk([31],{189:function(e,r,t){t(190),e.exports=t(191)},190:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.spec=void 0;var n=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a=(function(e){{if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r}})(t(0)),o=t(9),u=t(6);var c=r.spec={code:"kargo",isBidRequestValid:function(e){return!(!e||!e.params)&&!!e.params.placementId},buildRequests:function(e,r){var t=o.config.getConfig("currency"),u=n({},{timeout:r.timeout,currency:t,cpmGranularity:1,cpmRange:{floor:0,ceil:20},adSlotIds:a._map(e,(function(e){return e.params.placementId}))},c._getAllMetadata()),i=encodeURIComponent(JSON.stringify(u));return n({},r,{method:"GET",url:"https://krk.kargo.com/api/v1/bid",data:"json="+i,currency:t})},interpretResponse:function(e,r){var t=e.body,n={};a._each(r.bids,(function(e){return n[e.params.placementId]=e}));var o=[];for(var u in t){var c=t[u];o.push({requestId:n[u].bidId,cpm:Number(c.cpm),width:c.width,height:c.height,ad:c.adm,ttl:300,creativeId:u,netRevenue:!0,currency:r.currency})}return o},_readCookie:function(e){var r=e+"=",t=document.cookie.split(";");for(var n in t){for(var a=t[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(r))return a.substring(r.length,a.length)}return null},_getCrbIds:function(){try{var e=JSON.parse(decodeURIComponent(c._readCookie("krg_crb"))),r={};if(e&&e.v){var t=JSON.parse(atob(e.v));t&&t.syncIds&&(r=t.syncIds)}return r}catch(e){return{}}},_getUid:function(){try{var e=JSON.parse(decodeURIComponent(c._readCookie("krg_uid"))),r={};return e&&e.v&&(r=e.v),r}catch(e){return{}}},_getKruxUserId:function(){return c._getLocalStorageSafely("kxkar_user")},_getKruxSegments:function(){return c._getLocalStorageSafely("kxkar_segs")},_getKrux:function(){var e=c._getKruxSegments(),r=[];return e&&(r=e.split(",")),{userID:c._getKruxUserId(),segments:r}},_getLocalStorageSafely:function(e){try{return localStorage.getItem(e)}catch(e){return null}},_getUserIds:function(){var e=c._getUid(),r=c._getCrbIds();return{kargoID:e.userId,clientID:e.clientId,crbIDs:r,optOut:e.optOut}},_getAllMetadata:function(){return{userIDs:c._getUserIds(),krux:c._getKrux(),pageURL:window.location.href,rawCRB:c._readCookie("krg_crb")}}};(0,u.registerBidder)(c)},191:function(e,r){}},[189]);