prebid.js 8.1.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/.devcontainer/devcontainer.json +3 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/admanBidAdapter.js +1 -1
  8. package/dist/adqueryBidAdapter.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adtelligentBidAdapter.js +1 -1
  11. package/dist/adtrgtmeBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/adyoulikeBidAdapter.js +1 -1
  14. package/dist/ajaBidAdapter.js +1 -1
  15. package/dist/amxBidAdapter.js +1 -1
  16. package/dist/amxIdSystem.js +1 -1
  17. package/dist/appierAnalyticsAdapter.js +1 -1
  18. package/dist/appnexusBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/beopBidAdapter.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bridBidAdapter.js +1 -0
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/carodaBidAdapter.js +1 -1
  28. package/dist/categoryTranslation.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -1
  30. package/dist/cmp.js +1 -0
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectadBidAdapter.js +1 -1
  33. package/dist/consentManagement.js +1 -1
  34. package/dist/consentManagementGpp.js +1 -1
  35. package/dist/consentManagementUsp.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantAnalyticsAdapter.js +1 -1
  38. package/dist/conversantBidAdapter.js +1 -1
  39. package/dist/craftBidAdapter.js +1 -1
  40. package/dist/criteoBidAdapter.js +1 -1
  41. package/dist/cwireBidAdapter.js +1 -1
  42. package/dist/dependencies.json +15 -0
  43. package/dist/discoveryBidAdapter.js +1 -1
  44. package/dist/dspxBidAdapter.js +1 -1
  45. package/dist/eplanningBidAdapter.js +1 -1
  46. package/dist/euidIdSystem.js +1 -1
  47. package/dist/feedadBidAdapter.js +1 -1
  48. package/dist/finativeBidAdapter.js +1 -1
  49. package/dist/freewheel-sspBidAdapter.js +1 -1
  50. package/dist/gmosspBidAdapter.js +1 -1
  51. package/dist/goldbachBidAdapter.js +1 -1
  52. package/dist/gppControl_usnat.js +1 -0
  53. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  54. package/dist/greenbidsRtdProvider.js +1 -1
  55. package/dist/gridBidAdapter.js +1 -1
  56. package/dist/gumgumBidAdapter.js +1 -1
  57. package/dist/h12mediaBidAdapter.js +1 -1
  58. package/dist/holidBidAdapter.js +1 -1
  59. package/dist/hypelabBidAdapter.js +1 -1
  60. package/dist/id5IdSystem.js +1 -1
  61. package/dist/imdsBidAdapter.js +1 -1
  62. package/dist/improvedigitalBidAdapter.js +1 -1
  63. package/dist/insticatorBidAdapter.js +1 -1
  64. package/dist/intentIqIdSystem.js +1 -1
  65. package/dist/ixBidAdapter.js +1 -1
  66. package/dist/justpremiumBidAdapter.js +1 -1
  67. package/dist/kargoBidAdapter.js +1 -1
  68. package/dist/konduitAnalyticsAdapter.js +1 -1
  69. package/dist/kueezBidAdapter.js +1 -1
  70. package/dist/kueezRtbBidAdapter.js +1 -1
  71. package/dist/kulturemediaBidAdapter.js +1 -1
  72. package/dist/lassoBidAdapter.js +1 -1
  73. package/dist/lifestreetBidAdapter.js +1 -1
  74. package/dist/liveIntentIdSystem.js +1 -1
  75. package/dist/livewrappedAnalyticsAdapter.js +1 -1
  76. package/dist/logicadBidAdapter.js +1 -1
  77. package/dist/loglyliftBidAdapter.js +1 -1
  78. package/dist/magniteAnalyticsAdapter.js +1 -1
  79. package/dist/malltvAnalyticsAdapter.js +1 -1
  80. package/dist/marsmediaBidAdapter.js +1 -1
  81. package/dist/mediafuseBidAdapter.js +1 -1
  82. package/dist/mediagoBidAdapter.js +1 -1
  83. package/dist/mediasquareBidAdapter.js +1 -1
  84. package/dist/mgidBidAdapter.js +1 -1
  85. package/dist/minutemediaBidAdapter.js +1 -1
  86. package/dist/minutemediaplusBidAdapter.js +1 -1
  87. package/dist/mspa.js +1 -0
  88. package/dist/nexx360BidAdapter.js +1 -1
  89. package/dist/not-for-prod/prebid.js +144 -140
  90. package/dist/oguryBidAdapter.js +1 -1
  91. package/dist/onetagBidAdapter.js +1 -1
  92. package/dist/ooloAnalyticsAdapter.js +1 -1
  93. package/dist/optidigitalBidAdapter.js +1 -1
  94. package/dist/outbrainBidAdapter.js +1 -1
  95. package/dist/oxxionRtdProvider.js +1 -1
  96. package/dist/parrableIdSystem.js +1 -1
  97. package/dist/pixfutureBidAdapter.js +1 -1
  98. package/dist/prebid-core.js +1 -1
  99. package/dist/publinkIdSystem.js +1 -1
  100. package/dist/pubmaticBidAdapter.js +1 -1
  101. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  102. package/dist/pxyzBidAdapter.js +1 -1
  103. package/dist/quantcastBidAdapter.js +1 -1
  104. package/dist/readpeakBidAdapter.js +1 -1
  105. package/dist/relaidoBidAdapter.js +1 -1
  106. package/dist/retailspotBidAdapter.js +1 -1
  107. package/dist/rhythmoneBidAdapter.js +1 -1
  108. package/dist/riseBidAdapter.js +1 -1
  109. package/dist/rubiconBidAdapter.js +1 -1
  110. package/dist/seedingAllianceBidAdapter.js +1 -1
  111. package/dist/seedtagBidAdapter.js +1 -1
  112. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  113. package/dist/sharethroughBidAdapter.js +1 -1
  114. package/dist/shinezBidAdapter.js +1 -1
  115. package/dist/smaatoBidAdapter.js +1 -1
  116. package/dist/smartadserverBidAdapter.js +1 -1
  117. package/dist/smartxBidAdapter.js +1 -1
  118. package/dist/smartyadsBidAdapter.js +1 -1
  119. package/dist/smilewantedBidAdapter.js +1 -1
  120. package/dist/sonobiBidAdapter.js +1 -1
  121. package/dist/sovrnAnalyticsAdapter.js +1 -1
  122. package/dist/sovrnBidAdapter.js +1 -1
  123. package/dist/sspBCBidAdapter.js +1 -1
  124. package/dist/stvBidAdapter.js +1 -1
  125. package/dist/sublimeBidAdapter.js +1 -1
  126. package/dist/targetVideoBidAdapter.js +1 -1
  127. package/dist/teadsBidAdapter.js +1 -1
  128. package/dist/trafficgateBidAdapter.js +1 -1
  129. package/dist/trionBidAdapter.js +1 -1
  130. package/dist/tripleliftBidAdapter.js +1 -1
  131. package/dist/ttdBidAdapter.js +1 -1
  132. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  133. package/dist/uid2IdSystem.js +1 -1
  134. package/dist/underdogmediaBidAdapter.js +1 -1
  135. package/dist/undertoneBidAdapter.js +1 -1
  136. package/dist/userId.js +1 -1
  137. package/dist/vidazooBidAdapter.js +1 -1
  138. package/dist/videobyteBidAdapter.js +1 -1
  139. package/dist/visxBidAdapter.js +1 -1
  140. package/dist/vuukleBidAdapter.js +1 -1
  141. package/dist/widespaceBidAdapter.js +1 -1
  142. package/dist/winrBidAdapter.js +1 -1
  143. package/dist/yahoosspBidAdapter.js +1 -1
  144. package/dist/yieldmoBidAdapter.js +1 -1
  145. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  146. package/libraries/cmp/cmpClient.js +139 -0
  147. package/libraries/mspa/activityControls.js +91 -0
  148. package/modules/adagioBidAdapter.js +2 -1
  149. package/modules/admanBidAdapter.js +5 -0
  150. package/modules/adtelligentBidAdapter.js +8 -0
  151. package/modules/beopBidAdapter.js +6 -6
  152. package/modules/beopBidAdapter.md +35 -1
  153. package/modules/bridBidAdapter.js +223 -0
  154. package/modules/cadentApertureMXBidAdapter.md +2 -2
  155. package/modules/categoryTranslation.js +3 -2
  156. package/modules/consentManagement.js +12 -86
  157. package/modules/consentManagementGpp.js +47 -126
  158. package/modules/consentManagementUsp.js +19 -97
  159. package/modules/discoveryBidAdapter.js +1 -1
  160. package/modules/gppControl_usnat.js +11 -0
  161. package/modules/holidBidAdapter.js +49 -30
  162. package/modules/intentIqIdSystem.js +6 -5
  163. package/modules/ixBidAdapter.js +2 -1
  164. package/modules/liveIntentIdSystem.js +8 -3
  165. package/modules/livewrappedAnalyticsAdapter.js +33 -33
  166. package/modules/mediagoBidAdapter.js +1 -0
  167. package/modules/mediasquareBidAdapter.js +19 -23
  168. package/modules/oxxionRtdProvider.js +124 -11
  169. package/modules/oxxionRtdProvider.md +19 -4
  170. package/modules/smartyadsBidAdapter.js +6 -3
  171. package/modules/sovrnBidAdapter.js +5 -0
  172. package/modules/trafficgateBidAdapter.js +126 -72
  173. package/modules/tripleliftBidAdapter.js +21 -1
  174. package/modules/userId/eids.js +29 -0
  175. package/modules/userId/eids.md +19 -2
  176. package/modules/userId/index.js +78 -29
  177. package/modules/userId/userId.md +3 -0
  178. package/modules/vidazooBidAdapter.js +68 -16
  179. package/package.json +1 -1
  180. package/src/activities/params.js +4 -1
  181. package/test/spec/libraries/cmp/cmpClient_spec.js +233 -0
  182. package/test/spec/libraries/mspa/activityControls_spec.js +315 -0
  183. package/test/spec/modules/adagioBidAdapter_spec.js +2 -1
  184. package/test/spec/modules/admanBidAdapter_spec.js +8 -2
  185. package/test/spec/modules/adqueryBidAdapter_spec.js +5 -1
  186. package/test/spec/modules/adtelligentBidAdapter_spec.js +8 -0
  187. package/test/spec/modules/beopBidAdapter_spec.js +18 -2
  188. package/test/spec/modules/bridBidAdapter_spec.js +129 -0
  189. package/test/spec/modules/byDataAnalyticsAdapter_spec.js +9 -7
  190. package/test/spec/modules/cadentApertureMXBidAdapter_spec.js +1 -1
  191. package/test/spec/modules/chtnwBidAdapter_spec.js +4 -1
  192. package/test/spec/modules/consentManagementGpp_spec.js +84 -7
  193. package/test/spec/modules/consentManagement_spec.js +8 -18
  194. package/test/spec/modules/datablocksBidAdapter_spec.js +7 -3
  195. package/test/spec/modules/eids_spec.js +87 -0
  196. package/test/spec/modules/holidBidAdapter_spec.js +26 -6
  197. package/test/spec/modules/insticatorBidAdapter_spec.js +6 -2
  198. package/test/spec/modules/intentIqIdSystem_spec.js +36 -2
  199. package/test/spec/modules/ixBidAdapter_spec.js +52 -18
  200. package/test/spec/modules/lassoBidAdapter_spec.js +6 -4
  201. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +17 -2
  202. package/test/spec/modules/liveIntentIdSystem_spec.js +11 -6
  203. package/test/spec/modules/mediasquareBidAdapter_spec.js +3 -0
  204. package/test/spec/modules/onetagBidAdapter_spec.js +81 -75
  205. package/test/spec/modules/orbidderBidAdapter_spec.js +6 -3
  206. package/test/spec/modules/oxxionRtdProvider_spec.js +113 -1
  207. package/test/spec/modules/relaidoBidAdapter_spec.js +4 -3
  208. package/test/spec/modules/smartyadsBidAdapter_spec.js +1 -1
  209. package/test/spec/modules/sovrnBidAdapter_spec.js +34 -0
  210. package/test/spec/modules/trafficgateBidAdapter_spec.js +1349 -199
  211. package/test/spec/modules/tripleliftBidAdapter_spec.js +20 -1
  212. package/test/spec/modules/ucfunnelBidAdapter_spec.js +37 -16
  213. package/test/spec/modules/userId_spec.js +393 -6
  214. package/test/spec/modules/vidazooBidAdapter_spec.js +131 -0
@@ -1 +1 @@
1
- (self.pbjsChunk=self.pbjsChunk||[]).push([[15337],{55511:function(e,r,t){var n=t(71002),i=t(78640),a=t(64358),o=t(20265),d=t(96475),c=t(24679),u=t(14699),s=t(35706),p=t(34614),f="USD",m=300,l=!0,v="https://ads.yieldmo.com/pbcas",g="https://prebid-outstream.yieldmo.com/bundle.js",y=["mimes","startdelay","placement","startdelay","skipafter","protocols","api","playbackmethod","maxduration","minduration","pos","skip","skippable"],h=["name","domain","cat","keywords"],b=(0,a.getWindowTop)(),I=["description","title","pr","page_url"],x={code:"yieldmo",supportedMediaTypes:[c.Mk,c.pX],gvlid:173,isBidRequestValid:function(e){return!!(e&&e.adUnitCode&&e.bidId&&(w(e)||Z(e))&&function(e){if(!Z(e))return!0;var r=function(e,r,t){var n='"'.concat(e,'" is required');throw t&&(n+=" when "+t),new Error(n)},t=function(e,r,t){throw t=t?", expected: "+t:"",r=JSON.stringify(r),new Error('"'.concat(e,'"=').concat(r," is invalid").concat(t))},n=function(e){return void 0!==e},i=function(r,t,n,i){if(0===r.indexOf("video")){var a="params."+r,d="mediaTypes."+r,c=(0,o.Z)(e,a),u=(0,o.Z)(e,d),s=t(c),p=t(u);return s?c:p||(s?p||n(d,u,i):n(a,c,i),c||u)}var f=(0,o.Z)(e,r);return t(f)||n(r,f,i),f};try{i("video.context",(function(e){return!(0,a.isEmpty)(e)}),r),i("params.placementId",(function(e){return!(0,a.isEmpty)(e)}),r),i("video.playerSize",(function(e){return(0,a.isArrayOfNums)(e,2)||(0,a.isArray)(e)&&e.every((function(e){return(0,a.isArrayOfNums)(e,2)}))}),t,"array of 2 integers, ex: [640,480] or [[640,480]]"),i("video.mimes",(function(e){return n(e)}),r),i("video.mimes",(function(e){return(0,a.isArray)(e)&&e.every((function(e){return(0,a.isStr)(e)}))}),t,'array of strings, ex: ["video/mp4"]');var d=i("video.placement",(function(e){return n(e)}),r);return i("video.placement",(function(e){return e>=1&&e<=5}),t),1===d&&(i("video.startdelay",(function(e){return n(e)}),(function(e,t){return r(e,t,"placement == 1")})),i("video.startdelay",(function(e){return(0,a.isNumber)(e)}),t,"number, ex: 5")),i("video.protocols",(function(e){return n(e)}),r),i("video.protocols",(function(e){return(0,a.isArrayOfNums)(e)&&e.every((function(e){return e>=1&&e<=6}))}),t,"array of numbers, ex: [2,3]"),i("video.api",(function(e){return n(e)}),r),i("video.api",(function(e){return(0,a.isArrayOfNums)(e)&&e.every((function(e){return e>=1&&e<=6}))}),t,"array of numbers, ex: [2,3]"),i("video.playbackmethod",(function(e){return!n(e)||(0,a.isArrayOfNums)(e)}),t,"array of integers, ex: [2,6]"),i("video.maxduration",(function(e){return n(e)}),r),i("video.maxduration",(function(e){return(0,a.isInteger)(e)}),t),i("video.minduration",(function(e){return!n(e)||(0,a.isNumber)(e)}),t),i("video.skippable",(function(e){return!n(e)||(0,a.isBoolean)(e)}),t),i("video.skipafter",(function(e){return!n(e)||(0,a.isNumber)(e)}),t),i("video.pos",(function(e){return!n(e)||(0,a.isNumber)(e)}),t),i("params.badv",(function(e){return!n(e)||(0,a.isArray)(e)}),t,'array of strings, ex: ["ford.com","pepsi.com"]'),i("params.bcat",(function(e){return!n(e)||(0,a.isArray)(e)}),t,'array of strings, ex: ["IAB1-5","IAB1-6"]'),!0}catch(e){return(0,a.logError)(e.message),!1}}(e))},buildRequests:function(e,r){var t=function(e){var r,t;return!(null===(r=e.refererInfo)||void 0===r||null===(t=r.referer)||void 0===t||!t.includes("pb_force_a"))}(r),n=_("/exchange/prebid",t),i=_("/exchange/prebidvideo",t),u=e.filter((function(e){return w(e)})),s=e.filter((function(e){return Z(e)})),f=[],m=function(e){if((0,o.Z)(e,"userIdAsEids"))return e.userIdAsEids||[]}(e[0])||[];if(u.length>0){var l={pbav:"8.1.0",p:[],page_url:r.refererInfo.page,bust:(new Date).getTime().toString(),dnt:"1"===window.doNotTrack||"1"===window.navigator.doNotTrack||!1,description:k(),userConsent:JSON.stringify({gdprApplies:(0,o.Z)(r,"gdprConsent.gdprApplies")||"",cmp:(0,o.Z)(r,"gdprConsent.consentString")||"",gpp:(0,o.Z)(r,"gppConsent.gppString")||"",gpp_sid:(0,o.Z)(r,"gppConsent.applicableSections")||[]}),us_privacy:(0,o.Z)(r,"uspConsent")||""};(function(){try{if((0,a.getWindowTop)().location.href)return!0}catch(e){return!1}})()&&(l.pr=b.document&&b.document.referrer||"",l.scrd=b.devicePixelRatio||0,l.title=b.document.title||"",l.w=b.innerWidth,l.h=b.innerHeight);var v=window.navigator.maxTouchPoints;v&&(l.mtp=v),u.forEach((function(e){l.p.push(function(e){var r=(0,o.Z)(e,"ortb2Imp.ext.data.pbadslot"),t={placement_id:e.adUnitCode,callback_id:e.bidId,sizes:e.mediaTypes.banner.sizes};if(e.params){e.params.placementId&&(t.ym_placement_id=e.params.placementId);var n=S(e,c.Mk);n&&(t.bidFloor=n)}r&&(t.gpid=r);var i=(0,o.Z)(e,"ortb2Imp.ext.tid");i&&(t.tid=i);e.auctionId&&(t.auctionId=e.auctionId);return JSON.stringify(t)}(e));var r=N(e,"pubcid");r?l.pubcid=r:e.crumbs&&e.crumbs.pubcid&&(l.pubcid=e.crumbs.pubcid);var t=N(e,"tdid");t&&(l.tdid=t);var n=N(e,"criteoId");n&&(l.cri_prebid=n),e.schain&&(l.schain=JSON.stringify(e.schain)),(0,o.Z)(e,"params.lr_env")&&(l.ats_envelope=e.params.lr_env)})),l.p="["+l.p.toString()+"]",m.length&&(l.eids=JSON.stringify(m));var g="".concat(n,"?").concat((0,a.parseQueryStringParameters)(l)).length-8e3;if(g>0)for(var h=0;h<I.length&&!((g=T(g,l,I[h]))<=0);h++);f.push({method:"GET",url:n,data:l})}if(s.length>0){var x=function(e,r){var t=e[0].schain,n={id:e[0].bidderRequestId,tmax:r.timeout||400,at:1,imp:e.map((function(e){return function(e){var r=(0,o.Z)(e,"ortb2Imp.ext.data.pbadslot"),t=function(e){var r=(0,o.Z)(e,"mediaTypes.video.playerSize");if((0,a.isArrayOfNums)(r,2))return r;if((0,a.isArray)(r)&&(0,a.isArrayOfNums)(r[0],2))return r[0];return null}(e),n={id:e.bidId,tagid:e.adUnitCode,bidfloor:S(e,c.pX),ext:{placement_id:e.params.placementId,tid:(0,o.Z)(e,"ortb2Imp.ext.tid")},video:{w:t[0],h:t[1],linearity:1}},i=(0,o.Z)(e,"mediaTypes.video");Object.keys(i).filter((function(e){return(0,p.q9)(y,e)})).forEach((function(e){return n.video[e]=i[e]}));var d=(0,o.Z)(e,"params.video");Object.keys(d).filter((function(e){return(0,p.q9)(y,e)})).forEach((function(e){return n.video[e]=d[e]})),n.video.skippable&&(n.video.skip=1,delete n.video.skippable);1!==n.video.placement&&(n.video.startdelay=0,n.video.playbackmethod=[2]);r&&(n.ext.gpid=r);return n}(e)})),site:A(e[0],r),device:(0,o.Z)(r,"ortb2.device"),badv:e[0].params.badv||[],bcat:(0,o.Z)(r,"bcat")||e[0].params.bcat||[],ext:{prebid:"8.1.0"},ats_envelope:e[0].params.lr_env};t&&(n.schain=t);e[0].auctionId&&(n.auctionId=e[0].auctionId);return function(e,r){var t=r.gdprConsent,n=(0,o.Z)(r,"gppConsent.gppString"),i=(0,o.Z)(r,"gppConsent.applicableSections");n?(0,d.N)(e,"regs.ext.gpp",n):((0,d.N)(e,"regs.ext.gdpr",t&&t.gdprApplies?1:0),(0,d.N)(e,"user.ext.consent",t&&t.consentString?t.consentString:""));i&&i.length>0&&(0,d.N)(e,"regs.ext.gpp_sid",i);var a=(0,o.Z)(r,"uspConsent");!n&&a&&(0,d.N)(e,"regs.ext.us_privacy",a)}(n,r),n}(s,r);m.length&&(x.user={eids:m}),f.push({method:"POST",url:i,data:x})}return f},interpretResponse:function(e,r){var t=[],n=e.body;(n.length>0&&n.forEach((function(e){e.cpm>0&&t.push(function(e){return{dealId:e.publisherDealId,requestId:e.callback_id,cpm:e.cpm,width:e.width,height:e.height,creativeId:e.creative_id,currency:f,netRevenue:l,ttl:300,ad:e.ad,meta:{advertiserDomains:e.adomain||[],mediaType:c.Mk}}}(e))})),n.seatbid)&&n.seatbid.reduce((function(e,r){return e.concat(r.bid)}),[]).forEach((function(e){return t.push(function(e,r){var t=(0,p.sE)((0,o.Z)(r,"data.imp")||[],(function(r){return r.id===e.impid})),n={dealId:e.dealid,requestId:t.id,cpm:e.price,width:t.video.w,height:t.video.h,creativeId:e.crid||e.adid,currency:f,netRevenue:l,mediaType:c.pX,ttl:m,vastXml:e.adm,meta:{advertiserDomains:e.adomain||[],mediaType:c.pX}};if(t.video.placement&&1!==t.video.placement){var i=s.Th.install({url:g,config:{width:n.width,height:n.height,vastTimeout:15e3,maxAllowedVastTagRedirects:5,allowVpaid:!0,autoPlay:!0,preload:!0,mute:!0},id:t.tagid,loaded:!1});i.setRender((function(e){e.renderer.push((function(){var r=e.renderer,t=r.id,n=r.config;window.YMoutstreamPlayer(e,t,n)}))})),n.renderer=i}return n}(e,r))}));return t},getUserSyncs:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=[],a="&gdpr=".concat(t.gdprApplies?1:0),o="&gdpr_consent=".concat(encodeURIComponent(t.consentString||"")),d="us_privacy=".concat(encodeURIComponent(n)),c="".concat(v,"?").concat(d).concat(a).concat(o);return e.iframeEnabled?i.push({type:"iframe",url:c+"&type=iframe"}):e.pixelEnabled&&i.push({type:"image",url:c+"&type=image"}),i}};function w(e){return!!(0,o.Z)(e,"mediaTypes.banner")}function Z(e){return!!(0,o.Z)(e,"mediaTypes.video")}function k(){return document.querySelector('meta[name="description"]')&&document.querySelector('meta[name="description"]').getAttribute("content")||""}function N(e,r){return"object"===(0,n.Z)((0,o.Z)(e,"userId"))?e.userId[r]:void 0}function S(e,r){var t={};return"function"==typeof e.getFloor&&(t=e.getFloor({currency:f,mediaType:r,size:"*"})),t.floor||e.params.bidfloor||e.params.bidFloor||0}function A(e,r){var t,n={},i=(0,a.parseUrl)((0,o.Z)(r,"refererInfo.page"));(0,a.isEmpty)(i)||(n.page="".concat(i.protocol,"://").concat(i.hostname).concat(i.pathname)),null!==(t=r.refererInfo)&&void 0!==t&&t.ref&&(n.ref=r.refererInfo.ref);var d=document.getElementsByTagName("meta").keywords;d&&d.content&&(n.keywords=d.content);var c=(0,o.Z)(e,"params.site");return c&&Object.keys(c).filter((function(e){return(0,p.q9)(h,e)})).forEach((function(e){return n[e]=c[e]})),n}function T(e,r,t){if(r[t].length>e)return r[t]=r[t].substring(0,r[t].length-e),0;var n=e-r[t].length;return r[t]="",n}function _(e,r){return"".concat(r?"https://ads-stg.yieldmo.com":"https://ads.yieldmo.com").concat(e)}(0,u.dX)(x),(0,i.z)("yieldmoBidAdapter")}},function(e){var r;r=55511,e(e.s=r)}]);
1
+ (self.pbjsChunk=self.pbjsChunk||[]).push([[15337],{55511:function(e,r,t){var n=t(71002),i=t(78640),a=t(64358),o=t(20265),d=t(96475),c=t(24679),u=t(14699),s=t(35706),p=t(34614),f="USD",m=300,l=!0,v="https://ads.yieldmo.com/pbcas",g="https://prebid-outstream.yieldmo.com/bundle.js",y=["mimes","startdelay","placement","startdelay","skipafter","protocols","api","playbackmethod","maxduration","minduration","pos","skip","skippable"],h=["name","domain","cat","keywords"],b=(0,a.getWindowTop)(),I=["description","title","pr","page_url"],x={code:"yieldmo",supportedMediaTypes:[c.Mk,c.pX],gvlid:173,isBidRequestValid:function(e){return!!(e&&e.adUnitCode&&e.bidId&&(w(e)||Z(e))&&function(e){if(!Z(e))return!0;var r=function(e,r,t){var n='"'.concat(e,'" is required');throw t&&(n+=" when "+t),new Error(n)},t=function(e,r,t){throw t=t?", expected: "+t:"",r=JSON.stringify(r),new Error('"'.concat(e,'"=').concat(r," is invalid").concat(t))},n=function(e){return void 0!==e},i=function(r,t,n,i){if(0===r.indexOf("video")){var a="params."+r,d="mediaTypes."+r,c=(0,o.Z)(e,a),u=(0,o.Z)(e,d),s=t(c),p=t(u);return s?c:p||(s?p||n(d,u,i):n(a,c,i),c||u)}var f=(0,o.Z)(e,r);return t(f)||n(r,f,i),f};try{i("video.context",(function(e){return!(0,a.isEmpty)(e)}),r),i("params.placementId",(function(e){return!(0,a.isEmpty)(e)}),r),i("video.playerSize",(function(e){return(0,a.isArrayOfNums)(e,2)||(0,a.isArray)(e)&&e.every((function(e){return(0,a.isArrayOfNums)(e,2)}))}),t,"array of 2 integers, ex: [640,480] or [[640,480]]"),i("video.mimes",(function(e){return n(e)}),r),i("video.mimes",(function(e){return(0,a.isArray)(e)&&e.every((function(e){return(0,a.isStr)(e)}))}),t,'array of strings, ex: ["video/mp4"]');var d=i("video.placement",(function(e){return n(e)}),r);return i("video.placement",(function(e){return e>=1&&e<=5}),t),1===d&&(i("video.startdelay",(function(e){return n(e)}),(function(e,t){return r(e,t,"placement == 1")})),i("video.startdelay",(function(e){return(0,a.isNumber)(e)}),t,"number, ex: 5")),i("video.protocols",(function(e){return n(e)}),r),i("video.protocols",(function(e){return(0,a.isArrayOfNums)(e)&&e.every((function(e){return e>=1&&e<=6}))}),t,"array of numbers, ex: [2,3]"),i("video.api",(function(e){return n(e)}),r),i("video.api",(function(e){return(0,a.isArrayOfNums)(e)&&e.every((function(e){return e>=1&&e<=6}))}),t,"array of numbers, ex: [2,3]"),i("video.playbackmethod",(function(e){return!n(e)||(0,a.isArrayOfNums)(e)}),t,"array of integers, ex: [2,6]"),i("video.maxduration",(function(e){return n(e)}),r),i("video.maxduration",(function(e){return(0,a.isInteger)(e)}),t),i("video.minduration",(function(e){return!n(e)||(0,a.isNumber)(e)}),t),i("video.skippable",(function(e){return!n(e)||(0,a.isBoolean)(e)}),t),i("video.skipafter",(function(e){return!n(e)||(0,a.isNumber)(e)}),t),i("video.pos",(function(e){return!n(e)||(0,a.isNumber)(e)}),t),i("params.badv",(function(e){return!n(e)||(0,a.isArray)(e)}),t,'array of strings, ex: ["ford.com","pepsi.com"]'),i("params.bcat",(function(e){return!n(e)||(0,a.isArray)(e)}),t,'array of strings, ex: ["IAB1-5","IAB1-6"]'),!0}catch(e){return(0,a.logError)(e.message),!1}}(e))},buildRequests:function(e,r){var t=function(e){var r,t;return!(null===(r=e.refererInfo)||void 0===r||null===(t=r.referer)||void 0===t||!t.includes("pb_force_a"))}(r),n=_("/exchange/prebid",t),i=_("/exchange/prebidvideo",t),u=e.filter((function(e){return w(e)})),s=e.filter((function(e){return Z(e)})),f=[],m=function(e){if((0,o.Z)(e,"userIdAsEids"))return e.userIdAsEids||[]}(e[0])||[];if(u.length>0){var l={pbav:"8.3.0",p:[],page_url:r.refererInfo.page,bust:(new Date).getTime().toString(),dnt:"1"===window.doNotTrack||"1"===window.navigator.doNotTrack||!1,description:k(),userConsent:JSON.stringify({gdprApplies:(0,o.Z)(r,"gdprConsent.gdprApplies")||"",cmp:(0,o.Z)(r,"gdprConsent.consentString")||"",gpp:(0,o.Z)(r,"gppConsent.gppString")||"",gpp_sid:(0,o.Z)(r,"gppConsent.applicableSections")||[]}),us_privacy:(0,o.Z)(r,"uspConsent")||""};(function(){try{if((0,a.getWindowTop)().location.href)return!0}catch(e){return!1}})()&&(l.pr=b.document&&b.document.referrer||"",l.scrd=b.devicePixelRatio||0,l.title=b.document.title||"",l.w=b.innerWidth,l.h=b.innerHeight);var v=window.navigator.maxTouchPoints;v&&(l.mtp=v),u.forEach((function(e){l.p.push(function(e){var r=(0,o.Z)(e,"ortb2Imp.ext.data.pbadslot"),t={placement_id:e.adUnitCode,callback_id:e.bidId,sizes:e.mediaTypes.banner.sizes};if(e.params){e.params.placementId&&(t.ym_placement_id=e.params.placementId);var n=S(e,c.Mk);n&&(t.bidFloor=n)}r&&(t.gpid=r);var i=(0,o.Z)(e,"ortb2Imp.ext.tid");i&&(t.tid=i);e.auctionId&&(t.auctionId=e.auctionId);return JSON.stringify(t)}(e));var r=N(e,"pubcid");r?l.pubcid=r:e.crumbs&&e.crumbs.pubcid&&(l.pubcid=e.crumbs.pubcid);var t=N(e,"tdid");t&&(l.tdid=t);var n=N(e,"criteoId");n&&(l.cri_prebid=n),e.schain&&(l.schain=JSON.stringify(e.schain)),(0,o.Z)(e,"params.lr_env")&&(l.ats_envelope=e.params.lr_env)})),l.p="["+l.p.toString()+"]",m.length&&(l.eids=JSON.stringify(m));var g="".concat(n,"?").concat((0,a.parseQueryStringParameters)(l)).length-8e3;if(g>0)for(var h=0;h<I.length&&!((g=T(g,l,I[h]))<=0);h++);f.push({method:"GET",url:n,data:l})}if(s.length>0){var x=function(e,r){var t=e[0].schain,n={id:e[0].bidderRequestId,tmax:r.timeout||400,at:1,imp:e.map((function(e){return function(e){var r=(0,o.Z)(e,"ortb2Imp.ext.data.pbadslot"),t=function(e){var r=(0,o.Z)(e,"mediaTypes.video.playerSize");if((0,a.isArrayOfNums)(r,2))return r;if((0,a.isArray)(r)&&(0,a.isArrayOfNums)(r[0],2))return r[0];return null}(e),n={id:e.bidId,tagid:e.adUnitCode,bidfloor:S(e,c.pX),ext:{placement_id:e.params.placementId,tid:(0,o.Z)(e,"ortb2Imp.ext.tid")},video:{w:t[0],h:t[1],linearity:1}},i=(0,o.Z)(e,"mediaTypes.video");Object.keys(i).filter((function(e){return(0,p.q9)(y,e)})).forEach((function(e){return n.video[e]=i[e]}));var d=(0,o.Z)(e,"params.video");Object.keys(d).filter((function(e){return(0,p.q9)(y,e)})).forEach((function(e){return n.video[e]=d[e]})),n.video.skippable&&(n.video.skip=1,delete n.video.skippable);1!==n.video.placement&&(n.video.startdelay=0,n.video.playbackmethod=[2]);r&&(n.ext.gpid=r);return n}(e)})),site:A(e[0],r),device:(0,o.Z)(r,"ortb2.device"),badv:e[0].params.badv||[],bcat:(0,o.Z)(r,"bcat")||e[0].params.bcat||[],ext:{prebid:"8.3.0"},ats_envelope:e[0].params.lr_env};t&&(n.schain=t);e[0].auctionId&&(n.auctionId=e[0].auctionId);return function(e,r){var t=r.gdprConsent,n=(0,o.Z)(r,"gppConsent.gppString"),i=(0,o.Z)(r,"gppConsent.applicableSections");n?(0,d.N)(e,"regs.ext.gpp",n):((0,d.N)(e,"regs.ext.gdpr",t&&t.gdprApplies?1:0),(0,d.N)(e,"user.ext.consent",t&&t.consentString?t.consentString:""));i&&i.length>0&&(0,d.N)(e,"regs.ext.gpp_sid",i);var a=(0,o.Z)(r,"uspConsent");!n&&a&&(0,d.N)(e,"regs.ext.us_privacy",a)}(n,r),n}(s,r);m.length&&(x.user={eids:m}),f.push({method:"POST",url:i,data:x})}return f},interpretResponse:function(e,r){var t=[],n=e.body;(n.length>0&&n.forEach((function(e){e.cpm>0&&t.push(function(e){return{dealId:e.publisherDealId,requestId:e.callback_id,cpm:e.cpm,width:e.width,height:e.height,creativeId:e.creative_id,currency:f,netRevenue:l,ttl:300,ad:e.ad,meta:{advertiserDomains:e.adomain||[],mediaType:c.Mk}}}(e))})),n.seatbid)&&n.seatbid.reduce((function(e,r){return e.concat(r.bid)}),[]).forEach((function(e){return t.push(function(e,r){var t=(0,p.sE)((0,o.Z)(r,"data.imp")||[],(function(r){return r.id===e.impid})),n={dealId:e.dealid,requestId:t.id,cpm:e.price,width:t.video.w,height:t.video.h,creativeId:e.crid||e.adid,currency:f,netRevenue:l,mediaType:c.pX,ttl:m,vastXml:e.adm,meta:{advertiserDomains:e.adomain||[],mediaType:c.pX}};if(t.video.placement&&1!==t.video.placement){var i=s.Th.install({url:g,config:{width:n.width,height:n.height,vastTimeout:15e3,maxAllowedVastTagRedirects:5,allowVpaid:!0,autoPlay:!0,preload:!0,mute:!0},id:t.tagid,loaded:!1});i.setRender((function(e){e.renderer.push((function(){var r=e.renderer,t=r.id,n=r.config;window.YMoutstreamPlayer(e,t,n)}))})),n.renderer=i}return n}(e,r))}));return t},getUserSyncs:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=[],a="&gdpr=".concat(t.gdprApplies?1:0),o="&gdpr_consent=".concat(encodeURIComponent(t.consentString||"")),d="us_privacy=".concat(encodeURIComponent(n)),c="".concat(v,"?").concat(d).concat(a).concat(o);return e.iframeEnabled?i.push({type:"iframe",url:c+"&type=iframe"}):e.pixelEnabled&&i.push({type:"image",url:c+"&type=image"}),i}};function w(e){return!!(0,o.Z)(e,"mediaTypes.banner")}function Z(e){return!!(0,o.Z)(e,"mediaTypes.video")}function k(){return document.querySelector('meta[name="description"]')&&document.querySelector('meta[name="description"]').getAttribute("content")||""}function N(e,r){return"object"===(0,n.Z)((0,o.Z)(e,"userId"))?e.userId[r]:void 0}function S(e,r){var t={};return"function"==typeof e.getFloor&&(t=e.getFloor({currency:f,mediaType:r,size:"*"})),t.floor||e.params.bidfloor||e.params.bidFloor||0}function A(e,r){var t,n={},i=(0,a.parseUrl)((0,o.Z)(r,"refererInfo.page"));(0,a.isEmpty)(i)||(n.page="".concat(i.protocol,"://").concat(i.hostname).concat(i.pathname)),null!==(t=r.refererInfo)&&void 0!==t&&t.ref&&(n.ref=r.refererInfo.ref);var d=document.getElementsByTagName("meta").keywords;d&&d.content&&(n.keywords=d.content);var c=(0,o.Z)(e,"params.site");return c&&Object.keys(c).filter((function(e){return(0,p.q9)(h,e)})).forEach((function(e){return n[e]=c[e]})),n}function T(e,r,t){if(r[t].length>e)return r[t]=r[t].substring(0,r[t].length-e),0;var n=e-r[t].length;return r[t]="",n}function _(e,r){return"".concat(r?"https://ads-stg.yieldmo.com":"https://ads.yieldmo.com").concat(e)}(0,u.dX)(x),(0,i.z)("yieldmoBidAdapter")}},function(e){var r;r=55511,e(e.s=r)}]);
@@ -1 +1 @@
1
- (self.pbjsChunk=self.pbjsChunk||[]).push([[54572],{83519:function(e,t,n){var a=n(78640),i=n(64358),o=n(48928),r=n(64563),d=n(5644),s=n(86104),c=n(18621),u=n(78653),v={},g={},f={},l={};l[d.FP.BID_ADJUSTMENT]=!0,l[d.FP.BIDDER_DONE]=!0,l[d.FP.AUCTION_END]=!0;var p="",b="https://pool.tsukiji.iponweb.net/hba",I="";function S(e,t){e.adUnitCode&&t[e.adUnitCode]&&(e.adUnitName=t[e.adUnitCode]),(0,i.isArray)(e.adUnits)&&e.adUnits.forEach((function(e){e.code&&t[e.code]&&(e.name=t[e.code])})),(0,i.isArray)(e.adUnitCodes)&&(e.adUnitNames=e.adUnitCodes.map((function(e){return t[e]}))),["bids","bidderRequests","bidsReceived","noBids"].forEach((function(n){!function(e,t){(0,i.isArray)(e)&&e.forEach((function(e){S(e,t)}))}(e[n],t)}))}var h=Object.assign((0,r.ZP)({analyticsType:"endpoint"}),{getUrl:function(){return b},track:function(e){var t=e.eventType,n=e.args,a=void 0===n?{}:n;if(t===d.FP.BID_REQUESTED){var o="".concat(a.bidderCode,"_").concat(a.auctionId);v[o]=(0,i.deepClone)(a),v[o].bids=[],a.bids.forEach((function(e){g["".concat(e.bidId,"_").concat(e.auctionId)]=e}))}if(t===d.FP.BID_TIMEOUT&&(0,i.isArray)(a)){var r=h.eventsStorage,s={};a.forEach((function(e){var n="".concat(e.bidId,"_").concat(e.auctionId),a="".concat(e.bidder,"_").concat(e.auctionId);r[e.auctionId]||(r[e.auctionId]={events:[]}),(v[a]||s[e.bidder])&&g[n]&&(s[e.bidder]||(s[e.bidder]=v[a],r[e.auctionId].events.push({eventType:t,params:s[e.bidder]}),delete v[a]),s[e.bidder].bids.push(g[n]),delete g[n])}))}else if(p=a.auctionId||p){var b=h.eventsStorage;b[p]||(b[p]={events:[]});var y=a.refererInfo&&a.refererInfo.page;y&&f[p]!==y&&(f[p]=y);var E=Object.assign({},a);if(delete E.ad,E.bidsReceived&&(E.bidsReceived=E.bidsReceived.map((function(e){var t=Object.assign({},e);return delete t.ad,t}))),l[t]||b[p].events.push({eventType:t,params:E}),t===d.FP.AUCTION_END||t===d.FP.BID_WON){if(E.adServerTargeting=c.q0.getAllTargeting(u.K.getAdUnitCodes(),u.K.getBidsReceived()),h.eventsStorage[p]&&h.eventsStorage[p].events.length){h.eventsStorage[p].page={url:f[p]},h.eventsStorage[p].pubId=I,h.eventsStorage[p].wrapper_version="8.1.0";var A=function(){if(window.googletag&&window.googletag.pubads){var e=googletag.pubads();if(e&&e.getSlots){var t=e.getSlots();if(t&&t.length){var n={};return t.forEach((function(e){var t=e.getSlotElementId(),a=(e.getAdUnitPath()||"").split("/").pop();n[t]=a})),n}}}}();A&&h.eventsStorage[p].events.forEach((function(e){S(e.params,A)}))}h.sendStat(h.eventsStorage[p],p)}}},sendStat:function(e,t){e&&e.events&&e.events.length&&(delete h.eventsStorage[t],(0,o.h)(b,{success:function(){},error:function(){}},JSON.stringify(e),{method:"POST"}))}});h.eventsStorage={},h.originEnableAnalytics=h.enableAnalytics,h.enableAnalytics=function(e){var t=e&&e.options;t&&("string"==typeof t.url&&(b=t.url),t.pubId&&(I=t.pubId.toString())),h.originEnableAnalytics(e)},s.ZP.registerAnalyticsAdapter({adapter:h,code:"yieldone"});(0,a.z)("yieldoneAnalyticsAdapter")}},function(e){e.O(0,[14861],(function(){return t=83519,e(e.s=t);var t}));e.O()}]);
1
+ (self.pbjsChunk=self.pbjsChunk||[]).push([[54572],{83519:function(e,t,n){var a=n(78640),i=n(64358),o=n(48928),r=n(64563),d=n(5644),s=n(86104),c=n(18621),u=n(78653),v={},g={},f={},l={};l[d.FP.BID_ADJUSTMENT]=!0,l[d.FP.BIDDER_DONE]=!0,l[d.FP.AUCTION_END]=!0;var p="",b="https://pool.tsukiji.iponweb.net/hba",I="";function S(e,t){e.adUnitCode&&t[e.adUnitCode]&&(e.adUnitName=t[e.adUnitCode]),(0,i.isArray)(e.adUnits)&&e.adUnits.forEach((function(e){e.code&&t[e.code]&&(e.name=t[e.code])})),(0,i.isArray)(e.adUnitCodes)&&(e.adUnitNames=e.adUnitCodes.map((function(e){return t[e]}))),["bids","bidderRequests","bidsReceived","noBids"].forEach((function(n){!function(e,t){(0,i.isArray)(e)&&e.forEach((function(e){S(e,t)}))}(e[n],t)}))}var h=Object.assign((0,r.ZP)({analyticsType:"endpoint"}),{getUrl:function(){return b},track:function(e){var t=e.eventType,n=e.args,a=void 0===n?{}:n;if(t===d.FP.BID_REQUESTED){var o="".concat(a.bidderCode,"_").concat(a.auctionId);v[o]=(0,i.deepClone)(a),v[o].bids=[],a.bids.forEach((function(e){g["".concat(e.bidId,"_").concat(e.auctionId)]=e}))}if(t===d.FP.BID_TIMEOUT&&(0,i.isArray)(a)){var r=h.eventsStorage,s={};a.forEach((function(e){var n="".concat(e.bidId,"_").concat(e.auctionId),a="".concat(e.bidder,"_").concat(e.auctionId);r[e.auctionId]||(r[e.auctionId]={events:[]}),(v[a]||s[e.bidder])&&g[n]&&(s[e.bidder]||(s[e.bidder]=v[a],r[e.auctionId].events.push({eventType:t,params:s[e.bidder]}),delete v[a]),s[e.bidder].bids.push(g[n]),delete g[n])}))}else if(p=a.auctionId||p){var b=h.eventsStorage;b[p]||(b[p]={events:[]});var y=a.refererInfo&&a.refererInfo.page;y&&f[p]!==y&&(f[p]=y);var E=Object.assign({},a);if(delete E.ad,E.bidsReceived&&(E.bidsReceived=E.bidsReceived.map((function(e){var t=Object.assign({},e);return delete t.ad,t}))),l[t]||b[p].events.push({eventType:t,params:E}),t===d.FP.AUCTION_END||t===d.FP.BID_WON){if(E.adServerTargeting=c.q0.getAllTargeting(u.K.getAdUnitCodes(),u.K.getBidsReceived()),h.eventsStorage[p]&&h.eventsStorage[p].events.length){h.eventsStorage[p].page={url:f[p]},h.eventsStorage[p].pubId=I,h.eventsStorage[p].wrapper_version="8.3.0";var A=function(){if(window.googletag&&window.googletag.pubads){var e=googletag.pubads();if(e&&e.getSlots){var t=e.getSlots();if(t&&t.length){var n={};return t.forEach((function(e){var t=e.getSlotElementId(),a=(e.getAdUnitPath()||"").split("/").pop();n[t]=a})),n}}}}();A&&h.eventsStorage[p].events.forEach((function(e){S(e.params,A)}))}h.sendStat(h.eventsStorage[p],p)}}},sendStat:function(e,t){e&&e.events&&e.events.length&&(delete h.eventsStorage[t],(0,o.h)(b,{success:function(){},error:function(){}},JSON.stringify(e),{method:"POST"}))}});h.eventsStorage={},h.originEnableAnalytics=h.enableAnalytics,h.enableAnalytics=function(e){var t=e&&e.options;t&&("string"==typeof t.url&&(b=t.url),t.pubId&&(I=t.pubId.toString())),h.originEnableAnalytics(e)},s.ZP.registerAnalyticsAdapter({adapter:h,code:"yieldone"});(0,a.z)("yieldoneAnalyticsAdapter")}},function(e){e.O(0,[14861],(function(){return t=83519,e(e.s=t);var t}));e.O()}]);
@@ -0,0 +1,139 @@
1
+ import {GreedyPromise} from '../../src/utils/promise.js';
2
+
3
+ /**
4
+ * @typedef {function} CMPClient
5
+ *
6
+ * @param {{}} params CMP parameters. Currently this is a subset of {command, callback, parameter, version}.
7
+ * @returns {Promise<*>} a promise that:
8
+ * - if a `callback` param was provided, resolves (with no result) just before the first time it's run;
9
+ * - if `callback` was *not* provided, resolves to the return value of the CMP command
10
+ * @property {boolean} isDirect true if the CMP is directly accessible (no postMessage required)
11
+ */
12
+
13
+ /**
14
+ * Returns a function that can interface with a CMP regardless of where it's located.
15
+ *
16
+ * @param apiName name of the CMP api, e.g. "__gpp"
17
+ * @param apiVersion? CMP API version
18
+ * @param apiArgs? names of the arguments taken by the api function, in order.
19
+ * @param callbackArgs? names of the cross-frame response payload properties that should be passed as callback arguments, in order
20
+ * @param win
21
+ * @returns {CMPClient} CMP invocation function (or null if no CMP was found).
22
+ */
23
+ export function cmpClient(
24
+ {
25
+ apiName,
26
+ apiVersion,
27
+ apiArgs = ['command', 'callback', 'parameter', 'version'],
28
+ callbackArgs = ['returnValue', 'success'],
29
+ },
30
+ win = window
31
+ ) {
32
+ const cmpCallbacks = {};
33
+ const callName = `${apiName}Call`;
34
+ const cmpDataPkgName = `${apiName}Return`;
35
+
36
+ function handleMessage(event) {
37
+ const json = (typeof event.data === 'string' && event.data.includes(cmpDataPkgName)) ? JSON.parse(event.data) : event.data;
38
+ if (json?.[cmpDataPkgName]?.callId) {
39
+ const payload = json[cmpDataPkgName];
40
+
41
+ if (cmpCallbacks.hasOwnProperty(payload.callId)) {
42
+ cmpCallbacks[payload.callId](...callbackArgs.map(name => payload[name]));
43
+ }
44
+ }
45
+ }
46
+
47
+ function findCMP() {
48
+ let f = win;
49
+ let cmpFrame;
50
+ let isDirect = false;
51
+ while (f != null) {
52
+ try {
53
+ if (typeof f[apiName] === 'function') {
54
+ cmpFrame = f;
55
+ isDirect = true;
56
+ break;
57
+ }
58
+ } catch (e) {
59
+ }
60
+
61
+ // need separate try/catch blocks due to the exception errors thrown when trying to check for a frame that doesn't exist in 3rd party env
62
+ try {
63
+ if (f.frames[`${apiName}Locator`]) {
64
+ cmpFrame = f;
65
+ break;
66
+ }
67
+ } catch (e) {
68
+ }
69
+
70
+ if (f === win.top) break;
71
+ f = f.parent;
72
+ }
73
+
74
+ return [
75
+ cmpFrame,
76
+ isDirect
77
+ ];
78
+ }
79
+
80
+ const [cmpFrame, isDirect] = findCMP();
81
+
82
+ if (!cmpFrame) {
83
+ return;
84
+ }
85
+
86
+ function resolveParams(params) {
87
+ params = Object.assign({version: apiVersion}, params);
88
+ return apiArgs.map(arg => [arg, params[arg]])
89
+ }
90
+
91
+ function wrapCallback(callback, resolve, reject, preamble) {
92
+ return function (result, success) {
93
+ preamble && preamble();
94
+ const resolver = success == null || success ? resolve : reject;
95
+ if (typeof callback === 'function') {
96
+ resolver();
97
+ return callback.apply(this, arguments);
98
+ } else {
99
+ resolver(result);
100
+ }
101
+ }
102
+ }
103
+
104
+ let client;
105
+
106
+ if (isDirect) {
107
+ client = function invokeCMPDirect(params = {}) {
108
+ return new GreedyPromise((resolve, reject) => {
109
+ const ret = cmpFrame[apiName](...resolveParams({
110
+ ...params,
111
+ callback: params.callback && wrapCallback(params.callback, resolve, reject)
112
+ }).map(([_, val]) => val));
113
+ if (params.callback == null) {
114
+ resolve(ret);
115
+ }
116
+ });
117
+ };
118
+ } else {
119
+ win.addEventListener('message', handleMessage, false);
120
+
121
+ client = function invokeCMPFrame(params) {
122
+ return new GreedyPromise((resolve, reject) => {
123
+ // call CMP via postMessage
124
+ const callId = Math.random().toString();
125
+ const msg = {
126
+ [callName]: {
127
+ ...Object.fromEntries(resolveParams(params).filter(([param]) => param !== 'callback')),
128
+ callId: callId
129
+ }
130
+ };
131
+
132
+ cmpCallbacks[callId] = wrapCallback(params?.callback, resolve, reject, params?.callback == null && (() => { delete cmpCallbacks[callId] }));
133
+ cmpFrame.postMessage(msg, '*');
134
+ });
135
+ };
136
+ }
137
+ client.isDirect = isDirect;
138
+ return client;
139
+ }
@@ -0,0 +1,91 @@
1
+ import {registerActivityControl} from '../../src/activities/rules.js';
2
+ import {
3
+ ACTIVITY_ENRICH_EIDS,
4
+ ACTIVITY_ENRICH_UFPD,
5
+ ACTIVITY_SYNC_USER,
6
+ ACTIVITY_TRANSMIT_PRECISE_GEO
7
+ } from '../../src/activities/activities.js';
8
+ import {gppDataHandler} from '../../src/adapterManager.js';
9
+
10
+ // default interpretation for MSPA consent(s):
11
+ // https://docs.google.com/document/d/1yPEVx3bBdSkIw-QNkQR5qi1ztmn9zoXk-LaGQB6iw7Q
12
+
13
+ export function isBasicConsentDenied(cd) {
14
+ // service provider mode is always consent denied
15
+ return ['MspaServiceProviderMode', 'Gpc'].some(prop => cd[prop] === 1) ||
16
+ // you cannot consent to what you were not notified of
17
+ cd.PersonalDataConsents === 2 ||
18
+ // minors 13+ who have not given consent
19
+ cd.KnownChildSensitiveDataConsents[0] === 1 ||
20
+ // minors under 13 cannot consent
21
+ cd.KnownChildSensitiveDataConsents[1] !== 0 ||
22
+ // sensitive category consent impossible without notice
23
+ (cd.SensitiveDataProcessing.some(element => element === 2) && (cd.SensitiveDataLimitUseNotice !== 1 || cd.SensitiveDataProcessingOptOutNotice !== 1));
24
+ }
25
+
26
+ export function isSensitiveNoticeMissing(cd) {
27
+ return ['SensitiveDataProcessingOptOutNotice', 'SensitiveDataLimitUseNotice'].some(prop => cd[prop] === 2)
28
+ }
29
+
30
+ export function isConsentDenied(cd) {
31
+ return isBasicConsentDenied(cd) ||
32
+ // user opts out
33
+ (['SaleOptOut', 'SharingOptOut', 'TargetedAdvertisingOptOut'].some(prop => cd[prop] === 1)) ||
34
+ // notice not given
35
+ (['SaleOptOutNotice', 'SharingNotice', 'SharingOptOutNotice', 'TargetedAdvertisingOptOutNotice'].some(prop => cd[prop] === 2)) ||
36
+ // sale opted in but notice does not apply
37
+ ((cd.SaleOptOut === 2 && cd.SaleOptOutNotice === 0)) ||
38
+ // targeted opted in but notice does not apply
39
+ ((cd.TargetedAdvertisingOptOut === 2 && cd.TargetedAdvertisingOptOutNotice === 0)) ||
40
+ // sharing opted in but notices do not apply
41
+ ((cd.SharingOptOut === 2 && (cd.SharingNotice === 0 || cd.SharingOptOutNotice === 0)));
42
+ }
43
+
44
+ export function isTransmitUfpdConsentDenied(cd) {
45
+ // SensitiveDataProcessing[1-5,11]=1 OR SensitiveDataProcessing[6,7,9,10,12]<>0 OR
46
+ const mustBeZero = [6, 7, 9, 10, 12];
47
+ const mustBeZeroSubtractedVector = mustBeZero.map((number) => number - 1);
48
+ const SensitiveDataProcessingMustBeZero = cd.SensitiveDataProcessing.filter(index => mustBeZeroSubtractedVector.includes(index));
49
+ const cannotBeOne = [1, 2, 3, 4, 5, 11];
50
+ const cannotBeOneSubtractedVector = cannotBeOne.map((number) => number - 1);
51
+ const SensitiveDataProcessingCannotBeOne = cd.SensitiveDataProcessing.filter(index => cannotBeOneSubtractedVector.includes(index));
52
+ return isConsentDenied(cd) ||
53
+ isSensitiveNoticeMissing(cd) ||
54
+ SensitiveDataProcessingCannotBeOne.some(val => val === 1) ||
55
+ SensitiveDataProcessingMustBeZero.some(val => val !== 0);
56
+ }
57
+
58
+ export function isTransmitGeoConsentDenied(cd) {
59
+ return isBasicConsentDenied(cd) ||
60
+ isSensitiveNoticeMissing(cd) ||
61
+ cd.SensitiveDataProcessing[7] === 1
62
+ }
63
+
64
+ const CONSENT_RULES = {
65
+ [ACTIVITY_SYNC_USER]: isConsentDenied,
66
+ [ACTIVITY_ENRICH_EIDS]: isConsentDenied,
67
+ [ACTIVITY_ENRICH_UFPD]: isTransmitUfpdConsentDenied,
68
+ [ACTIVITY_TRANSMIT_PRECISE_GEO]: isTransmitGeoConsentDenied
69
+ }
70
+
71
+ export function mspaRule(sids, getConsent, denies, applicableSids = () => gppDataHandler.getConsentData()?.applicableSections) {
72
+ return function() {
73
+ if (applicableSids().some(sid => sids.includes(sid))) {
74
+ const consent = getConsent();
75
+ if (consent == null) {
76
+ return {allow: false, reason: 'consent data not available'};
77
+ }
78
+ if (denies(consent)) {
79
+ return {allow: false}
80
+ }
81
+ }
82
+ }
83
+ }
84
+
85
+ export function setupRules(api, sids, normalizeConsent = (c) => c, rules = CONSENT_RULES, registerRule = registerActivityControl, getConsentData = () => gppDataHandler.getConsentData()) {
86
+ const unreg = [];
87
+ Object.entries(rules).forEach(([activity, denies]) => {
88
+ unreg.push(registerRule(activity, `MSPA (${api})`, mspaRule(sids, () => normalizeConsent(getConsentData()?.sectionData?.[api]), denies, () => getConsentData()?.applicableSections || [])))
89
+ })
90
+ return () => unreg.forEach(ur => ur())
91
+ }
@@ -1152,7 +1152,8 @@ export const spec = {
1152
1152
  },
1153
1153
  prebidVersion: '$prebid.version$',
1154
1154
  featuresVersion: FEATURES_VERSION,
1155
- usIfr: usIfr
1155
+ usIfr: usIfr,
1156
+ adgjs: storage.localStorageIsEnabled()
1156
1157
  },
1157
1158
  options: {
1158
1159
  contentType: 'text/plain'
@@ -109,6 +109,11 @@ export const spec = {
109
109
  bidFloor: getBidFloor(bid)
110
110
  }
111
111
 
112
+ if (bid.transactionId) {
113
+ placement.ext = placement.ext || {};
114
+ placement.ext.tid = bid.transactionId;
115
+ }
116
+
112
117
  if (bid.schain) {
113
118
  placement.schain = bid.schain;
114
119
  }
@@ -200,6 +200,14 @@ function bidToTag(bidRequests, adapterRequest) {
200
200
  tag.DMPId = window.adtDmp.getUID();
201
201
  }
202
202
 
203
+ if (adapterRequest.gppConsent) {
204
+ tag.GPP = adapterRequest.gppConsent.gppString;
205
+ tag.GPPSid = adapterRequest.gppConsent.applicableSections?.toString();
206
+ } else if (adapterRequest.ortb2?.regs?.gpp) {
207
+ tag.GPP = adapterRequest.ortb2.regs.gpp;
208
+ tag.GPPSid = adapterRequest.ortb2.regs.gpp_sid;
209
+ }
210
+
203
211
  // end publisher env
204
212
  const bids = [];
205
213
 
@@ -48,8 +48,10 @@ export const spec = {
48
48
  */
49
49
  buildRequests: function(validBidRequests, bidderRequest) {
50
50
  const slots = validBidRequests.map(beOpRequestSlotsMaker);
51
- const firstPartyData = bidderRequest.ortb2;
52
- const psegs = (firstPartyData && firstPartyData.user && firstPartyData.user.ext && firstPartyData.user.ext.data) ? firstPartyData.user.ext.data.permutive : undefined;
51
+ const firstPartyData = bidderRequest.ortb2 || {};
52
+ const psegs = firstPartyData.user?.ext?.permutive || firstPartyData.user?.ext?.data?.permutive || [];
53
+ const userBpSegs = firstPartyData.user?.ext?.bpsegs || firstPartyData.user?.ext?.data?.bpsegs || [];
54
+ const siteBpSegs = firstPartyData.site?.ext?.bpsegs || firstPartyData.site?.ext?.data?.bpsegs || [];
53
55
  const pageUrl = getPageUrl(bidderRequest.refererInfo, window);
54
56
  const gdpr = bidderRequest.gdprConsent;
55
57
  const firstSlot = slots[0];
@@ -61,6 +63,8 @@ export const spec = {
61
63
  nid: firstSlot.nid,
62
64
  nptnid: firstSlot.nptnid,
63
65
  pid: firstSlot.pid,
66
+ psegs: psegs,
67
+ bpsegs: (userBpSegs.concat(siteBpSegs)).map(item => item.toString()),
64
68
  url: pageUrl,
65
69
  lang: (window.navigator.language || window.navigator.languages[0]),
66
70
  kwds: keywords,
@@ -71,10 +75,6 @@ export const spec = {
71
75
  tc_string: (gdpr && gdpr.gdprApplies) ? gdpr.consentString : null,
72
76
  };
73
77
 
74
- if (psegs) {
75
- Object.assign(payloadObject, {psegs: psegs});
76
- }
77
-
78
78
  const payloadString = JSON.stringify(payloadObject);
79
79
  return {
80
80
  method: 'POST',
@@ -9,13 +9,14 @@
9
9
  Module that connects to BeOp's demand sources
10
10
 
11
11
  # Test Parameters
12
+
12
13
  ```
13
14
  var adUnits = [
14
15
  {
15
16
  code: 'in-article',
16
17
  mediaTypes: {
17
18
  banner: {
18
- sizes: [[1,1]],
19
+ sizes: [[1,1]],
19
20
  }
20
21
  },
21
22
  bids: [
@@ -31,3 +32,36 @@ Module that connects to BeOp's demand sources
31
32
  ];
32
33
  ```
33
34
 
35
+ # Custom Bidder data
36
+
37
+ If you want to pass your first party data to BeOp, you can set your bidder `config.ortb2` object with
38
+
39
+ ```json
40
+ {
41
+ "site": {
42
+ "ext": {
43
+ "bpsegs": ["Your", 1, "ST", "party", "data"],
44
+ "data": {
45
+ "bpsegs": ["Your", 1, "ST", "party", "data"]
46
+ }
47
+ }
48
+ },
49
+ "user": {
50
+ "ext": {
51
+ "bpsegs": ["Your", 1, "ST", "party", "data"],
52
+ "data": {
53
+ "bpsegs": ["Your", 1, "ST", "party", "data"]
54
+ }
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ You can choose the location between:
61
+
62
+ - `site.ext`
63
+ - `site.ext.data`
64
+ - `user.ext`
65
+ - `user.ext.data`
66
+
67
+ and our BidAdapter will be able to find them
@@ -0,0 +1,223 @@
1
+ import {createTrackPixelHtml, _each, deepAccess, getDefinedParams, parseGPTSingleSizeArrayToRtbSize} from '../src/utils.js';
2
+ import {VIDEO} from '../src/mediaTypes.js';
3
+ import {registerBidder} from '../src/adapters/bidderFactory.js';
4
+ import {getRefererInfo} from '../src/refererDetection.js';
5
+
6
+ const SOURCE = 'pbjs';
7
+ const BIDDER_CODE = 'brid';
8
+ const ENDPOINT_URL = 'https://pbs.prebrid.tv/openrtb2/auction';
9
+ const GVLID = 934;
10
+ const TIME_TO_LIVE = 300;
11
+ const VIDEO_PARAMS = [
12
+ 'api', 'linearity', 'maxduration', 'mimes', 'minduration', 'placement',
13
+ 'playbackmethod', 'protocols', 'startdelay'
14
+ ];
15
+
16
+ export const spec = {
17
+
18
+ code: BIDDER_CODE,
19
+ gvlid: GVLID,
20
+ supportedMediaTypes: [VIDEO],
21
+
22
+ /**
23
+ * Determines whether or not the given bid request is valid.
24
+ *
25
+ * @param {object} bid The bid to validate.
26
+ * @return boolean True if this is a valid bid, and false otherwise.
27
+ */
28
+ isBidRequestValid: function(bid) {
29
+ return !!(bid && bid.params && bid.params.placementId);
30
+ },
31
+
32
+ /**
33
+ * Make a server request from the list of BidRequests.
34
+ *
35
+ * @param {BidRequest[]} bidRequests A non-empty list of bid requests which should be sent to the Server.
36
+ * @param {BidderRequest} bidderRequest bidder request object.
37
+ * @return ServerRequest Info describing the request to the server.
38
+ */
39
+ buildRequests: function(bidRequests, bidderRequest) {
40
+ const requests = [];
41
+
42
+ _each(bidRequests, function(bid) {
43
+ const placementId = bid.params.placementId;
44
+ const bidId = bid.bidId;
45
+ let sizes = bid.sizes;
46
+ if (sizes && !Array.isArray(sizes[0])) sizes = [sizes];
47
+
48
+ const site = getSiteObj();
49
+
50
+ const postBody = {
51
+ sdk: {
52
+ source: SOURCE,
53
+ version: '$prebid.version$'
54
+ },
55
+ id: bidderRequest.bidderRequestId,
56
+ site,
57
+ imp: []
58
+ };
59
+
60
+ const imp = {
61
+ ext: {
62
+ prebid: {
63
+ storedrequest: {'id': placementId}
64
+ }
65
+ }
66
+ };
67
+
68
+ const video = deepAccess(bid, 'mediaTypes.video');
69
+ if (video) {
70
+ imp.video = getDefinedParams(video, VIDEO_PARAMS);
71
+ if (video.playerSize) {
72
+ imp.video = Object.assign(
73
+ imp.video, parseGPTSingleSizeArrayToRtbSize(video.playerSize[0]) || {}
74
+ );
75
+ } else if (video.w && video.h) {
76
+ imp.video.w = video.w;
77
+ imp.video.h = video.h;
78
+ };
79
+ };
80
+
81
+ postBody.imp.push(imp);
82
+
83
+ const gdprConsent = bidderRequest && bidderRequest.gdprConsent;
84
+ const uspConsent = bidderRequest && bidderRequest.uspConsent;
85
+
86
+ if (gdprConsent || uspConsent) {
87
+ postBody.regs = { ext: {} };
88
+
89
+ if (uspConsent) {
90
+ postBody.regs.ext.us_privacy = uspConsent;
91
+ };
92
+
93
+ if (gdprConsent) {
94
+ if (typeof gdprConsent.gdprApplies !== 'undefined') {
95
+ postBody.regs.ext.gdpr = gdprConsent.gdprApplies ? 1 : 0;
96
+ };
97
+
98
+ if (typeof gdprConsent.consentString !== 'undefined') {
99
+ postBody.user = {
100
+ ext: { consent: gdprConsent.consentString }
101
+ };
102
+ };
103
+ };
104
+ };
105
+
106
+ if (bidRequests[0].schain) {
107
+ postBody.schain = bidRequests[0].schain;
108
+ }
109
+
110
+ const params = bid.params;
111
+
112
+ requests.push({
113
+ method: 'POST',
114
+ url: ENDPOINT_URL,
115
+ data: JSON.stringify(postBody),
116
+ options: {
117
+ withCredentials: true
118
+ },
119
+ bidId,
120
+ params
121
+ });
122
+ });
123
+
124
+ return requests;
125
+ },
126
+
127
+ /**
128
+ * Unpack the response from the server into a list of bids.
129
+ *
130
+ * @param {*} serverResponse A successful response from the server.
131
+ * @return {Bid[]} An array of bids which were nested inside the server.
132
+ */
133
+ interpretResponse: function(serverResponse, bidRequest) {
134
+ const response = serverResponse.body;
135
+ const bidResponses = [];
136
+
137
+ _each(response.seatbid, (resp) => {
138
+ _each(resp.bid, (bid) => {
139
+ const requestId = bidRequest.bidId;
140
+ const params = bidRequest.params;
141
+
142
+ const {ad, adUrl, vastUrl, vastXml} = getAd(bid);
143
+
144
+ const bidResponse = {
145
+ requestId,
146
+ params,
147
+ cpm: bid.price,
148
+ width: bid.w,
149
+ height: bid.h,
150
+ creativeId: bid.adid,
151
+ currency: response.cur,
152
+ netRevenue: false,
153
+ ttl: TIME_TO_LIVE,
154
+ meta: {
155
+ advertiserDomains: bid.adomain || []
156
+ }
157
+ };
158
+
159
+ if (vastUrl || vastXml) {
160
+ bidResponse.mediaType = VIDEO;
161
+ if (vastUrl) bidResponse.vastUrl = vastUrl;
162
+ if (vastXml) bidResponse.vastXml = vastXml;
163
+ } else {
164
+ bidResponse.ad = ad;
165
+ bidResponse.adUrl = adUrl;
166
+ };
167
+
168
+ bidResponses.push(bidResponse);
169
+ });
170
+ });
171
+
172
+ return bidResponses;
173
+ },
174
+
175
+ }
176
+
177
+ /**
178
+ * Helper function to get ad
179
+ *
180
+ * @param {object} bid The bid.
181
+ * @return {object} ad object.
182
+ */
183
+ function getAd(bid) {
184
+ let ad, adUrl, vastXml, vastUrl;
185
+
186
+ switch (deepAccess(bid, 'ext.prebid.type')) {
187
+ case VIDEO:
188
+ if (bid.adm.substr(0, 4) === 'http') {
189
+ vastUrl = bid.adm;
190
+ } else {
191
+ vastXml = bid.adm;
192
+ };
193
+ break;
194
+ default:
195
+ if (bid.adm && bid.nurl) {
196
+ ad = bid.adm;
197
+ ad += createTrackPixelHtml(decodeURIComponent(bid.nurl));
198
+ } else if (bid.adm) {
199
+ ad = bid.adm;
200
+ } else if (bid.nurl) {
201
+ adUrl = bid.nurl;
202
+ };
203
+ }
204
+
205
+ return {ad, adUrl, vastXml, vastUrl};
206
+ }
207
+
208
+ /**
209
+ * Helper function to get site object
210
+ *
211
+ * @return {object} siteObj.
212
+ */
213
+ function getSiteObj() {
214
+ const refInfo = (getRefererInfo && getRefererInfo()) || {};
215
+
216
+ return {
217
+ page: refInfo.page,
218
+ ref: refInfo.ref,
219
+ domain: refInfo.domain
220
+ };
221
+ }
222
+
223
+ registerBidder(spec);
@@ -3,14 +3,14 @@
3
3
  ```
4
4
  Module Name: Cadent Aperture MX Adapter
5
5
  Module Type: Bidder Adapter
6
- Maintainer: git@emxdigital.com
6
+ Maintainer: contactaperturemx@cadent.tv
7
7
  ```
8
8
 
9
9
  # Description
10
10
 
11
11
  The Cadent Aperture MX adapter provides publishers with access to the Cadent Aperture MX SSP. The adapter is GDPR compliant. Please note that the adapter supports Banner and Video (Instream & Outstream) media types.
12
12
 
13
- Note: The Cadent Aperture MX adapter requires approval and implementation guidelines from the Cadent team, including existing publishers that work with Cadent. Please reach out to your account manager or prebid@emxdigital.com for more information.
13
+ Note: The Cadent Aperture MX adapter requires approval and implementation guidelines from the Cadent team, including existing publishers that work with Cadent. Please reach out to your account manager or contactaperturemx@cadent.tv for more information.
14
14
 
15
15
  The bidder code should be ```cadent_aperture_mx```
16
16
  The params used by the bidder are :