@@ -75,6 +75,26 @@ function buildRequests(bidReqs, bidderRequest) {
75
75
deepSetValue ( brightcomBidReq , 'user.ext.consent' , bidderRequest . gdprConsent . consentString ) ;
76
76
}
77
77
78
+ if ( bidderRequest && bidderRequest . uspConsent ) {
79
+ deepSetValue ( brightcomBidReq , 'regs.ext.us_privacy' , bidderRequest . uspConsent ) ;
80
+ }
81
+
82
+ if ( config . getConfig ( 'coppa' ) === true ) {
83
+ deepSetValue ( brightcomBidReq , 'regs.coppa' , 1 ) ;
84
+ }
85
+
86
+ if ( bidReqs [ 0 ] && bidReqs [ 0 ] . schain ) {
87
+ deepSetValue ( brightcomBidReq , 'source.ext.schain' , bidReqs [ 0 ] . schain )
88
+ }
89
+
90
+ if ( bidReqs [ 0 ] && bidReqs [ 0 ] . userIdAsEids ) {
91
+ deepSetValue ( brightcomBidReq , 'user.ext.eids' , bidReqs [ 0 ] . userIdAsEids || [ ] )
92
+ }
93
+
94
+ if ( bidReqs [ 0 ] && bidReqs [ 0 ] . userId ) {
95
+ deepSetValue ( brightcomBidReq , 'user.ext.ids' , bidReqs [ 0 ] . userId || [ ] )
96
+ }
97
+
78
98
return {
79
99
method : 'POST' ,
80
100
url : URL ,
@@ -103,7 +123,7 @@ function interpretResponse(serverResponse) {
103
123
logWarn ( 'Brightcom server returned empty/non-json response: ' + JSON . stringify ( serverResponse . body ) ) ;
104
124
return [ ] ;
105
125
}
106
- const { body : { id, seatbid} } = serverResponse ;
126
+ const { body : { id, seatbid} } = serverResponse ;
107
127
try {
108
128
const brightcomBidResponses = [ ] ;
109
129
if ( id &&
@@ -164,9 +184,9 @@ function _isViewabilityMeasurable(element) {
164
184
return ! _isIframe ( ) && element !== null ;
165
185
}
166
186
167
- function _getViewability ( element , topWin , { w, h } = { } ) {
187
+ function _getViewability ( element , topWin , { w, h} = { } ) {
168
188
return getWindowTop ( ) . document . visibilityState === 'visible'
169
- ? _getPercentInView ( element , topWin , { w, h } )
189
+ ? _getPercentInView ( element , topWin , { w, h} )
170
190
: 0 ;
171
191
}
172
192
@@ -182,8 +202,8 @@ function _getMinSize(sizes) {
182
202
return sizes . reduce ( ( min , size ) => size . h * size . w < min . h * min . w ? size : min ) ;
183
203
}
184
204
185
- function _getBoundingBox ( element , { w, h } = { } ) {
186
- let { width, height, left, top, right, bottom } = element . getBoundingClientRect ( ) ;
205
+ function _getBoundingBox ( element , { w, h} = { } ) {
206
+ let { width, height, left, top, right, bottom} = element . getBoundingClientRect ( ) ;
187
207
188
208
if ( ( width === 0 || height === 0 ) && w && h ) {
189
209
width = w ;
@@ -192,7 +212,7 @@ function _getBoundingBox(element, { w, h } = {}) {
192
212
bottom = top + h ;
193
213
}
194
214
195
- return { width, height, left, top, right, bottom } ;
215
+ return { width, height, left, top, right, bottom} ;
196
216
}
197
217
198
218
function _getIntersectionOfRects ( rects ) {
@@ -225,16 +245,16 @@ function _getIntersectionOfRects(rects) {
225
245
return bbox ;
226
246
}
227
247
228
- function _getPercentInView ( element , topWin , { w, h } = { } ) {
229
- const elementBoundingBox = _getBoundingBox ( element , { w, h } ) ;
248
+ function _getPercentInView ( element , topWin , { w, h} = { } ) {
249
+ const elementBoundingBox = _getBoundingBox ( element , { w, h} ) ;
230
250
231
251
// Obtain the intersection of the element and the viewport
232
- const elementInViewBoundingBox = _getIntersectionOfRects ( [ {
252
+ const elementInViewBoundingBox = _getIntersectionOfRects ( [ {
233
253
left : 0 ,
234
254
top : 0 ,
235
255
right : topWin . innerWidth ,
236
256
bottom : topWin . innerHeight
237
- } , elementBoundingBox ] ) ;
257
+ } , elementBoundingBox ] ) ;
238
258
239
259
let elementInViewArea , elementTotalArea ;
240
260
0 commit comments