text: pbjsChunk([17],{296:function(e,r,t){t(297),e.exports=t(298)},297:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.spec=r.ENDPOINT=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=t(0),a=t(6),o=r.ENDPOINT="//app.readpeak.com/header/prebid",l={TITLE_LEN:70,DESCR_LEN:120,SPONSORED_BY_LEN:50,IMG_MIN:150,ICON_MIN:50,CTA_LEN:50},u=r.spec={code:"readpeak",supportedMediaTypes:["native"],isBidRequestValid:function(e){return!!(e&&e.params&&e.params.publisherId&&e.nativeParams)},buildRequests:function(e){var r={id:e[0].bidderRequestId,imp:e.map((function(e){return{id:(r=e).bidId,native:(function(e){if(e.nativeParams){var r=[];return c(r,(t=1,n=e.nativeParams.title,i=l.TITLE_LEN,n?{id:t,required:n.required?1:0,title:{len:n.len||i}}:null)),c(r,(a=2,o=e.nativeParams.image,u=3,d=l.IMG_MIN,s=l.IMG_MIN,o?{id:a,required:o.required?1:0,img:{type:u,wmin:o.wmin||d,hmin:o.hmin||s}}:null)),c(r,p(3,e.nativeParams.sponsoredBy,1,l.SPONSORED_BY_LEN)),c(r,p(4,e.nativeParams.body,2,l.DESCR_LEN)),c(r,p(5,e.nativeParams.cta,12,l.CTA_LEN)),{request:JSON.stringify({assets:r}),ver:"1.1"}}var t,n,i,a,o,u,d,s;return null})(r),bidfloor:r.params.bidfloor||0,bidfloorcur:r.params.bidfloorcur||"USD"};var r})).filter((function(e){return null!=e.native})),site:(function(e){var r=e&&0<e.length?e[0].params.publisherId:"0";if(!e[0].params.app)return{publisher:{id:r.toString()},id:r.toString(),ref:(function(){try{return window.top.document.referrer}catch(e){return document.referrer}})(),page:(0,i.getTopWindowLocation)().href,domain:(0,i.getTopWindowLocation)().hostname};return null})(e),app:(function(e){var r=e&&0<e.length?e[0].params.publisherId:"0",t=e[0].params.app;if(t)return{publisher:{id:r.toString()},bundle:t.bundle,storeurl:t.storeUrl,domain:t.domain};return null})(e),device:{ua:navigator.userAgent,language:navigator.language||navigator.browserLanguage||navigator.userLanguage||navigator.systemLanguage},isPrebid:!0};return{method:"POST",url:o,data:JSON.stringify(r)}},interpretResponse:function(e,r){return (function(e,t){var n={},i={};if(!t.body)return[];t=t.body,d(e.data).imp.forEach((function(e){n[e.id]=e})),t&&t.seatbid.forEach((function(e){return e.bid.forEach((function(e){i[e.impid]=e}))}));var a=[];return Object.keys(n).forEach((function(e){if(i[e]){var r={requestId:e,cpm:i[e].price,creativeId:i[e].crid,ttl:300,netRevenue:!0,mediaType:"native",currency:t.cur,native:(function(e,r){if(e&&e.native){var t=d(r.adm),n={};if(t&&t.assets)return t.assets.forEach((function(e){n.title=e.title?e.title.text:n.title,n.body=e.data&&4===e.id?e.data.value:n.body,n.sponsoredBy=e.data&&3===e.id?e.data.value:n.sponsoredBy,n.image=e.img&&2===e.id?e.img.url:n.image,n.cta=e.data&&5===e.id?e.data.value:n.cta})),t.link&&(n.clickUrl=encodeURIComponent(t.link.url)),n.impressionTrackers=t.imptrackers,n}return null})(n[e],i[e])};a.push(r)}})),a})(r,e)}};function c(e,r){r&&e.push(r)}function p(e,r,t,n){return r?{id:e,required:r.required?1:0,data:{type:t,len:r.len||n}}:null}function d(e){try{if(e)return"object"===(void 0===e?"undefined":n(e))?e:JSON.parse(e)}catch(e){(0,i.logError)("readpeakBidAdapter.safeParse","ERROR",e)}return null}(0,a.registerBidder)(u)},298:function(e,r){}},[296]);