(function(){ (()=>{"use strict";var e,t,i;!function(e){e.HISTORY_MUTATION="_pbstck_kleanads_historyMutation",e.PAGE_CHANGE="_pbstck_kleanads_pageChange"}(e||(e={})),function(e){e.SPA_RELOAD="admSPAReload"}(t||(t={})),function(e){e.REPLACE_STATE="replaceState",e.PUSH_STATE="pushState"}(i||(i={}));const n=t=>{window.history[t]=new Proxy(window.history[t],{apply(i,n,o){const s=window.location.href,a=i.apply(n,o),r=new CustomEvent(e.HISTORY_MUTATION,{detail:{referrer:s,stateObj:o[0],title:o[1],url:o[2],type:t}});return dispatchEvent(r),a}})};var o;const s=/kleanads:debug/.test(window.location.href),a=!!(null===(o=window.localStorage)||void 0===o?void 0:o.getItem)&&null!==window.localStorage.getItem("kleanads"),r=!1;function d(){return r||s||a}function l(e,t){return`[${e}] [${performance.now().toFixed(2)}] ${t}`}function c(e,t,...i){d()&&console.log(l(e,t),...i)}function u(e,t,...i){d()&&console.error(l(e,t),...i)}class f{constructor(e,t){this.tagId=e,this.kleanadsVersion=t}handleMessage(e,t,i){const n={source:"kleanads",type:"log",level:e,message:t,tagId:this.tagId,kleanadsVersion:this.kleanadsVersion,href:window.location.href,...i};var o;o=n,navigator.sendBeacon("https://intake.pbstck.com/v1/trace",JSON.stringify(o)),b("[datadog] log sent to Datadog: ",n)}error(e){this.handleMessage("error",e)}warn(e){this.handleMessage("warn",e)}logWithPayload(e,t){this.handleMessage("info",e,t)}}const g="kleanads";let p,h="nd",v="nd",m="nd";function b(e,...t){c(g,e,...t)}function y(e,...t){!function(e,t,...i){d()&&console.debug(l(e,t),...i)}(g,e,...t)}function C(e,...t){!function(e,t,...i){d()&&console.warn(l(e,t),...i)}(g,e,...t),null==p||p.warn(e)}function w(e,...t){u(g,e,...t),null==p||p.error(e),navigator.sendBeacon(`https://intake.pbstck.com/v1/intake/error?tId=${h}&v=${v}&s=${m}&c=1`,JSON.stringify([{message:e}]))}function S(e,t){const i=document.createElement("meta");i.setAttribute("name",`pbstck:${e}`),i.content=t,document.getElementsByTagName("head")[0].appendChild(i)}function A(e){const t=document.querySelector(`meta[name="pbstck:${e}"]`);t&&t.remove()}function k(e,t){const i=document.createElement("meta");i.setAttribute("name",`ad:${e}`),i.content=t,document.getElementsByTagName("head")[0].appendChild(i)}function E(e){const t={};e.document.querySelectorAll('meta[name^="ad:"]').forEach((e=>{const i=function(e){var t;const i=(null===(t=e.attributes.getNamedItem("name"))||void 0===t?void 0:t.value)||"";return i.startsWith("ad:")?i.slice(3):i}(e);i&&(t[i]=function(e){var t;return((null===(t=e.attributes.getNamedItem("content"))||void 0===t?void 0:t.value)||"").split(",")}(e))}));const i=new URLSearchParams(e.location.search);for(const e of i.keys())e.startsWith("ad:")&&(c("kleanads-common",`Add key ${e} found in URL to metaTargetings`),t[e.slice(3)]=i.getAll(e));return t}function I(){const e=document.head.querySelector('meta[name="ad:no_cmp"]');return!!e&&"true"===e.content}const $="[DOM]";function U(e){return null!==document.getElementById(e)}function T(){return new Promise((e=>{"complete"===document.readyState||"interactive"===document.readyState?(b(`${$} document already loaded`),e()):window.addEventListener("DOMContentLoaded",(()=>{b(`${$} DOMContentLoaded event fired`),e()}))}))}function O(e){const t=document.getElementById(e);return t?t.getBoundingClientRect().top:(b(`${$} div ${e} not found during get distance from top`),0)}async function x(e,t){var i,n;if(e.pocOverrides&&e.pocOverrides.extraScripts){const{beforeStart:o}=t;b(o?"Loading extraScripts before config":"Loading extraScripts after consent");const s=(null!==(n=null===(i=e.pocOverrides)||void 0===i?void 0:i.extraScripts)&&void 0!==n?n:[]).filter((t=>t.tagId===e.tagId&&!!t.beforeStart===o)),a=s.filter((({synchronous:e})=>!e)).flatMap((e=>e.scripts)),r=s.filter((({synchronous:e})=>e)).flatMap((e=>e.scripts));b(`downloading async extra script ${a}`),a.forEach((e=>P(e))),b(`downloading sync extra script ${r}`);for(const e of r)try{await _(e)}catch(e){b("[extra-script] Error while loading sync extra script",e)}}}function P(e,t){const i=function(e,t){const i=document.createElement("script");return i.setAttribute("src",e),t&&Object.keys(t).forEach((function(e){i.setAttribute("data-pubstack-"+e,t[e])})),i}(e,t);i.setAttribute("async","true"),i.setAttribute("data-kleanads","true"),document.head.append(i)}async function _(e,t=3){return R((()=>import(e)),t).then((e=>e)).catch((i=>{throw w(`Failed to load module ${e} after ${t} retries`,i),new Error("Too many failed attempt to load external module.")}))}const j=e=>new Promise((t=>setTimeout(t,e)));function R(e,t){return new Promise(((i,n)=>e().then(i).catch((i=>t>1?j(100).then(R.bind(null,e,t-1)).then((e=>e)).catch(n):n(i)))))}function L(e,t){return e.sizet.size?-1:0}function N(e){const t=document.createElement("meta");t.setAttribute("name","pbstck_context:pbstck_ab_test"),t.content=e,document.getElementsByTagName("head")[0].appendChild(t)}function D(e){return e.filter(B)}function M(e){return e>=100||e>=Math.floor(100*Math.random())+1}function B(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function z(){const e=new RegExp("(?:(?:^|.*; *)firstid *= *([^;]*).*$)|^.*$","i"),t=document.cookie.match(e);return t&&t[1]?decodeURIComponent(t[1]):void 0}const F=(e,t)=>("master"===e.roadblock?0:1)-("master"===t.roadblock?0:1)||O(e.divId)-O(t.divId),W="adServerAdUnitName";function V(e){return e&&"string"==typeof e?e:void 0}function H(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function G(e){var t,i,n,o,s,a,r,d,l;if(!H(e))throw new Error("unable to parse JSON: adUnit is not valid");const c=J(e.divId,"divId"),u=J(e.adUnitName,"adUnitName"),f=function(e,t){if(!Array.isArray(e))throw new Error(`Unable to parse JSON: the sizes field ${e} is not a valid list of Size`);return e}(e.sizes),g=function(e,t){if(!Array.isArray(e))throw new Error(`Unable to parse JSON: the bidders field ${e} is not a valid list of PrebidBidder`);for(const t of e)if("string"!=typeof t.bidder)throw new Error(`Unable to parse JSON: the bidder field ${t.bidder} (inside bidders) is not a valid bidder name`);return e}(e.bidders),p=K(e.parallax,"parallax",!1),h=K(e.dynamic,"dynamic",!1),v=K(e.sticky,"sticky",!1),m=q(e.targeting,"targeting"),b=function(e,t){if(!e)return;if(!Array.isArray(e))throw new Error(`Unable to parse JSON: the ${t} field ${e} is not valid KeyValueTargeting list`);const i=[];for(const n of e){const e=q(n,t);e&&i.push(e)}return i}(e.extraTargetings,"extraTargetings");if(void 0!==e.pubstackNameOverride&&"string"!=typeof e.pubstackNameOverride)throw new Error("unable to parse JSON: the pubstackNameOverride field is not valid");if(void 0!==e.floors&&!H(e.floors))throw new Error("unable to parse JSON: the floors field is not valid");if(void 0!==(null===(t=e.floors)||void 0===t?void 0:t.currency)&&"string"!=typeof(null===(i=e.floors)||void 0===i?void 0:i.currency))throw new Error("unable to parse JSON: the floors field is missing the currency");if(void 0!==(null===(n=e.floors)||void 0===n?void 0:n.schema)&&!H(null===(o=e.floors)||void 0===o?void 0:o.schema))throw new Error("unable to parse JSON: the floors field is missing the schema");if(e.floors){if("string"!=typeof(null===(s=e.floors.schema)||void 0===s?void 0:s.delimiter))throw new Error("unable to parse JSON: the floors schema field is missing the delimiter");if(!Array.isArray(null===(a=e.floors.schema)||void 0===a?void 0:a.fields))throw new Error("unable to parse JSON: the floors field schema delimiter is not an array");for(const t of e.floors.schema.fields)if(void 0===t||"string"!=typeof t)throw new Error("unable to parse JSON: the bidder field inside bidders array is not valid")}if(void 0!==(null===(r=e.floors)||void 0===r?void 0:r.values)&&"object"!=typeof(null===(d=e.floors)||void 0===d?void 0:d.values))throw new Error("unable to parse JSON: the floors field is missing the values or they are not well formed");if(void 0!==e.extraAdServerSizes&&!Array.isArray(e.extraAdServerSizes))throw new Error(`unable to parse JSON: the extraAdServerSizes field for adunit ${c} is not valid: ${e.extraAdServerSizes}`);let y,C,w,S;if(void 0!==e.canOutstream&&"boolean"!=typeof e.canOutstream)throw new Error("unable to parse JSON: the canOutstream field is not valid");if(y=e.canOutstream,void 0!==e.isInstream&&"boolean"!=typeof e.isInstream)throw new Error("unable to parse JSON: the isInstream field is not valid");if(C=e.isInstream,e.biddersOutstream){if(!Array.isArray(e.biddersOutstream))throw new Error(`unable to parse JSON: the biddersOutstream field for adunit ${c} is not valid: ${e.biddersOutstream}`);for(const t of e.biddersOutstream)if("string"!=typeof t)throw new Error("unable to parse JSON: the value inside biddersOutstream array is not valid")}switch(e.outOfPageType){case"interstitial":case"default":w=e.outOfPageType;break;default:w=void 0}switch(e.roadblock){case"master":case"companion":S=e.roadblock;break;default:S=void 0}return{divId:c,adUnitName:u,sizes:f,pubstackNameOverride:e.pubstackNameOverride,adServerAdUnitName:e.adServerAdUnitName,slotName:e.slotName,bidders:g,parallax:p,dynamic:h,targeting:m,extraTargetings:b,sticky:v,stickyDivCreation:!!e.stickyDivCreation,floors:e.floors,extraAdServerSizes:e.extraAdServerSizes,headerBiddingEnabled:K(e.headerBiddingEnabled,"headerBiddingEnabled",!0),canOutstream:y,isInstream:C,biddersOutstream:null!==(l=e.biddersOutstream)&&void 0!==l?l:[],outOfPageType:w,roadblock:S,webComponentAdunit:!!e.webComponentAdunit,closingOnSelector:e.closingOnSelector}}function J(e,t){if("string"!=typeof e)throw new Error(`Unable to parse JSON: the ${t} field ${e} is not a valid string`);return e}function K(e,t,i){if(void 0!==e&&"boolean"!=typeof e)throw new Error(`Unable to parse JSON: the ${t} field ${e} is not a valid boolean`);return null!=e?e:i}function q(e,t){if(!e)return;if(!H(e))throw new Error(`Unable to parse JSON: the ${t} field ${e} is not a valid KeyValueTargeting`);const i=J(e.key,t),n=V(e.value),o=function(e){if(e&&Array.isArray(e))return e}(e.values);if(!n&&!o)throw new Error(`Unable to parse JSON: targeting.value(s) is not valid for field ${t}`);return{key:i,value:n,values:o}}function Y(e,t,i,n,o){return e.flatMap((e=>{var s,a,r;const d=function(e,t,i,n){const o=[];if("number"!=typeof t&&""===t||o.push(t),i&&0!==i.length){const e=function(e,t){return e.filter((e=>e!==W)).map((e=>t.get(e))).filter((e=>e)).join("/")}(i,n);e&&o.push(e)}else C("Ad unit path config is missing for this site");const s=`/${o.join("/")}`;return i&&i.includes(W)?`${s}/${e}`:`${s}`}(e.adServerAdUnitName||e.divId,i,n,t);if(e.dynamic)return function(e,t,i){return function(e){const t=[],i=e.divId.startsWith("css:")?e.divId.replace("css:",""):`[id^="${e.divId}"]`;return document.querySelectorAll(i).forEach((i=>{const n=i.id.replace(e.divId,"");/[a-zA-Z]/g.test(n)&&!e.divId.startsWith("css:")||t.push(i.id)})),t}(e).map((n=>{var o,s,a;return{...e,canOutstream:null!==(o=e.canOutstream)&&void 0!==o&&o,isInstream:null!==(s=e.isInstream)&&void 0!==s&&s,extraTargetings:[...e.extraTargetings||[],...Q(n),X(e.divId,n)],divId:n,slotName:e.slotName||t,dynamic:!1,adUnitPath:t,adServerAdUnitName:null!==(a=e.adServerAdUnitName)&&void 0!==a?a:e.divId,pubstackDeclarationTargetingKeys:null!=i?i:[]}}))}(e,d,o);{let t=e.divId;const i=e.divId.startsWith("css:")?e.divId.replace("css:",""):void 0;if(i){const e=function(e){try{return Array.from(document.querySelectorAll(e)).map((e=>e.id))}catch(t){return b(`${$} ${e} is not a valid CSS selector`),[]}}(i);e.length&&(t=e[0])}return U(t)||"interstitial"===e.outOfPageType||e.sticky&&e.stickyDivCreation?[{...e,divId:t,canOutstream:null!==(s=e.canOutstream)&&void 0!==s&&s,isInstream:null!==(a=e.isInstream)&&void 0!==a&&a,extraTargetings:[...e.extraTargetings||[],...Q(t)],adUnitPath:d,slotName:e.slotName||d,adServerAdUnitName:null!==(r=e.adServerAdUnitName)&&void 0!==r?r:t,pubstackDeclarationTargetingKeys:null!=o?o:[]}]:(b(`Div id missing for ${e.divId}, no further action on this ad unit`),[])}}))}function X(e,t){const i=new RegExp("\\D","g");return{key:"ad_index",value:t.replace(i,"")}}function Q(e){const t=document.getElementById(e);return(null==t?void 0:t.hasAttributes())?Array.from(t.attributes).filter((e=>e.name.startsWith("data-ad-"))).map((e=>({key:e.name.replace("data-ad-",""),value:e.value}))):[]}var Z,ee;function te(e){if(!e)return;if(!H(e))throw new Error("unable to parse JSON: lazyLoadingGoogle field is not valid");if(0===Object.keys(e).length||!e.googleFetchMarginPercent&&!e.googleRenderMarginPercent&&!e.googleMobileScaling)return{};const t={};return"number"==typeof e.googleFetchMarginPercent&&(t.googleFetchMarginPercent=e.googleFetchMarginPercent),"number"==typeof e.googleRenderMarginPercent&&(t.googleRenderMarginPercent=e.googleRenderMarginPercent),"number"==typeof e.googleMobileScaling&&(t.googleMobileScaling=e.googleMobileScaling),t}function ie(e){if(null==e)return;if(!H(e))throw new Error("unable to parse JSON: lazyLoadingKleanads field is not valid");let t;return"number"!=typeof e.viewportPercent?e.numberOfViewports&&"number"==typeof e.numberOfViewports?t=e.numberOfViewports:(C("unable to parse JSON: the lazyLoadingKleanads field is not valid, falling back to 0 viewport"),t=0):t=e.viewportPercent,{viewportPercent:t}}function ne(e){if(null!=e){if(!H(e))throw new Error("unable to parse JSON: lazyLoading field is not valid");if("string"!=typeof e.configName)throw new Error("unable to parse JSON: the lazyLoading's configName field is not valid");return{configName:e.configName,lazyLoadingGoogle:te(e.lazyLoadingGoogle),lazyLoadingKleanads:ie(e.lazyLoadingKleanads)}}}function oe(e){if(!Array.isArray(e))throw new Error("unable to parse JSON: the adUnits field is not valid");const t=[];for(const i of e)try{t.push(G(i))}catch(e){w("Invalid ad unit configuration",e)}return t}function se(e){if(!function(e){if(!e)throw new Error("unable to parse JSON: prebidConfig field is not valid");return Object.keys(e).includes("adCallTimeout")&&Object.keys(e).includes("pbjsConfig")}(e))throw new Error("unable to parse JSON: prebidConfig field is not valid");if("number"!=typeof e.adCallTimeout)throw new Error("unable to parse JSON: the prebidConfig's adCallTimeout field is not valid");return{adCallTimeout:e.adCallTimeout,pbjsConfig:ae(e.pbjsConfig)}}function ae(e){if(!H(e))throw new Error("unable to parse JSON: pbjsConfig field is not valid");void 0===e.allowLocalStorage&&(e.allowLocalStorage=!0);const t=re(e,"userSync"),i=re(e,"outbrain"),n=re(e,"realTimeData"),o=re(e,"analytics"),s=re(e,"currency"),a=re(e,"bidderConfigs"),r=re(e,"priceGranularity"),d=re(e,"floors"),l=re(e,"schain");return{...e,...t&&{userSync:t},...i&&{outbrain:i},...n&&{realTimeData:n},...o&&{analytics:o},...a&&{bidderConfigs:a},...s&&{currency:s},...r&&{priceGranularity:r},...d&&{floors:d},...l&&{schain:l}}}!function(e){e.firstId="firstId",e.utiqId="utiqId",e.sharedId="sharedId"}(Z||(Z={})),function(e){e.id5id="id5Id"}(ee||(ee={}));const re=(e,t)=>{if(!(t in e))return;const i=V(e[t]);if(i)try{return JSON.parse(i)}catch(e){w(`unable to parse JSON in pbjsConfigFromPartial: ${t} `,e)}};async function de(e,t,i,n){const o=function(e,t,i,n){const o=function(e,t,i,n,o){return`${e}/config/${t.scopeId.substring(0,8)}/${n.substring(0,8)}/${t.stackId}/${i}/${o}.json`}(e.configUrl,i,n,e.tagId,t);return o.replace(/([^:]\/)\/+/g,"$1")}(e,t,i,n);return new Promise((e=>{fetch(o).then((t=>{t.text().then((async t=>{const i=function(e){const t=JSON.parse(e);return{...t,lazyLoading:ne(t.lazyLoading),adUnits:oe(t.adUnits),prebidConfig:se(t.prebidConfig)}}(t);e(i)}))})).catch((async t=>{w(`unable to load the configuration ${t}`),e(void 0)}))}))}var le,ce;!function(e){e.BEGIN="begin",e.CMP_RESPONSE_AVAILABLE="cmp_response_available",e.MAIN_THREAD_END="main_thread_end",e.GOOGLETAG_READY="googletag_ready",e.APSTAG_READY="apstag_ready"}(le||(le={})),function(e){e.START_AUCTION="start_auction",e.END_PBJS_AUCTION="end_pbjs_auction",e.END_APS_AUCTION="end_aps_auction",e.START_AD_SERVER_CALL="start_ad_server_call",e.SLOT_RENDER_ENDED_TIME="slot_render_ended_time",e.SLOT_RESPONSE_RECEIVED_TIME="slot_response_received_time"}(ce||(ce={}));const ue=[],fe=[],ge="getEntriesByName"in performance&&"measure"in performance&&"mark"in performance;function pe(e){ue.includes(e)||(we(e),ue.push(e))}function he(e,t){const i=Ce(e,t);fe.includes(i)||(we(i),fe.push(i))}function ve(e){if(ue.includes(e))return function(e){if(ge)return performance.getEntriesByName(e)[0].startTime}(e)}function me(e,t){if(ue.includes(e)&&ue.includes(t))return Se(e,t)}function be(e,t,i){const n=Ce(e,i);if(ue.includes(t)&&fe.includes(n))return Se(t,n)}function ye(e,t,i){const n=Ce(e,t),o=Ce(e,i);if(fe.includes(n)&&fe.includes(o))return Se(n,o)}function Ce(e,t){return`${e}_${t}`}function we(e){ge&&(performance.mark(e.toString()),b(`[performance] [mark] ${e}: ${performance.getEntriesByName(e)[0].startTime.toFixed(2)}`))}function Se(e,t){if(ge){const i=`measure_${e}_${t}`,n=performance.getEntriesByName(i);if(0!==n.length&&"measure"===n[0].entryType)return n[0].duration;try{return performance.measure(i,e,t).duration}catch{return}}}const Ae=10;function ke(e,t){100*Math.random()0&&"mark"===t[0].entryType}(le.GOOGLETAG_READY);Te.set(e,t)}function xe(e,t){return{adUnit:e,consentType:Ie,eventOrigin:t,startAuctionFromConsent:be(e,le.CMP_RESPONSE_AVAILABLE,ce.START_AUCTION),pbjsAuctionDuration:ye(e,ce.START_AUCTION,ce.END_PBJS_AUCTION),apsAuctionDuration:ye(e,ce.START_AUCTION,ce.END_APS_AUCTION),startAdServerCallFromConsent:be(e,le.CMP_RESPONSE_AVAILABLE,ce.START_AD_SERVER_CALL),slotRenderEndedFromConsent:be(e,le.CMP_RESPONSE_AVAILABLE,ce.SLOT_RENDER_ENDED_TIME),adServerResponseDuration:ye(e,ce.START_AD_SERVER_CALL,ce.SLOT_RESPONSE_RECEIVED_TIME),totalAdCallDuration:ye(e,ce.START_AUCTION,ce.SLOT_RENDER_ENDED_TIME),isGoogletagReadyAtPbjsAuctionEnd:Te.get(e)}}function Pe(e){return new Promise(((t,i)=>{!function(e,t,i){var n;(n=e,new Promise(((e,t)=>_e(n,e,t)))).then((()=>{try{!function(e,t){(function(e){return e.__tcfapi})(e)("addEventListener",2,(e=>{if(e&&("useractioncomplete"===e.eventStatus||"tcloaded"===e.eventStatus)){b("[consent] Consent status ",e.eventStatus),pe(le.CMP_RESPONSE_AVAILABLE);const n=function(e){if(!e.purpose.consents||0===Object.keys(e.purpose.consents).length)return!1;for(const t in e.purpose.consents)if(!e.purpose.consents[t])return!1;return!0}(e);i=n?Ee.WAIT_USER_CONSENT:Ee.WAIT_USER_REFUSED,Ie=i,t(n)}var i}))}(e,t)}catch(e){b("[consent] Error while loading tcf api"),i(e)}})).catch((e=>{b("[consent] Error while loading tcf api",e),i(e)}))}(e,t,i)}))}function _e(e,t,i){const n=e.__tcfapi;n&&function(e){if("function"!=typeof e)throw new Error("__tcfapi is not a function");return!0}(n)?t():setTimeout((()=>_e(e,t,i)),100)}function je(e){return e.map((e=>({key:e.key.toLowerCase(),defaultValue:e.defaultValue?e.defaultValue.toLowerCase():void 0,otherValues:e.otherValues?e.otherValues.map((e=>e.toLowerCase())):[]})))}const Re={pbjsFinished:!1,apsFinished:!1},Le="[executor] [instream]";class Ne{constructor(e,t,i,n,o){this.rank=1,this.adServer=e,this.pbjs=t,this.aps=i,this.bidderAliases=n,this.kleanadsRunCount=o}executeAdCall(e){setTimeout((()=>{Ue(e.divId,"executorTimeout")}),2e4),this.adUnitAuctionStatus?C(`${Le} cannot make a new ad call, existing one on ${e.divId}.`):(b(`${Le} executeAdCall for adunit`,e),this.startAuction(e))}executeRefresh(e){this.adServer.cleanTargetings();const t={labels:["pubstackRefresh",`pubstackRefreshRank:${e.rank}`]};this.startAuction(e.adUnit,t)}startAuction(e,t){if(this.adUnitAuctionStatus=Re,he(e.divId,ce.START_AUCTION),b(`${Le} starting auctions for ${e.divId}`),this.pbjs){const i=this.pbjs.getPbjs();this.pbjs.startPbjsAuction([e],(()=>{this.kleanadsRunCount===bi?this.pbjsFinished(i,e):b(`${Le} kleanads run count has changed (from ${this.kleanadsRunCount} to ${bi}), avoid calling pbjsFinished`)}),this.bidderAliases,t)}this.aps&&this.aps.startApsAuction([e],((t,i)=>{this.kleanadsRunCount===bi?this.apsFinished(t,e,i):b(`${Le} kleanads run count has changed (from ${this.kleanadsRunCount} to ${bi}), avoid calling apsFinished`)})),this.pbjs||this.aps||this.adServer.executeWhenAdServerReady((()=>{this.kleanadsRunCount===bi?this.callAdServer(e):b(`${Le} kleanads run count has changed (from ${this.kleanadsRunCount} to ${bi}), avoid calling AdServer`)}))}isAlreadyMonetized(){return!!this.adUnitAuctionStatus}pbjsFinished(e,t){b(`${Le} pbjs end callback for ${t.divId}`,e.getAllPrebidWinningBids()),he(t.divId,ce.END_PBJS_AUCTION),Oe(t.divId),this.adServer.executeWhenAdServerReady((()=>{b(`${Le} pbjs end callback ad server ready ${t.divId}`),this.adServer.setPbjsTargetings(e,t),this.adUnitAuctionStatus&&(this.adUnitAuctionStatus.pbjsFinished=!0),this.canCallAdServer()&&this.callAdServer(t)}))}apsFinished(e,t,i){b(`${Le} aps end callback ${t.divId}`,i),he(t.divId,ce.END_APS_AUCTION),this.adServer.executeWhenAdServerReady((()=>{b(`${Le} aps end callback ad server ready ${t.divId}`),this.adServer.setApsTargetings(e,i),this.adUnitAuctionStatus&&(this.adUnitAuctionStatus.apsFinished=!0),this.canCallAdServer()&&this.callAdServer(t)}))}canCallAdServer(){const e=this.adUnitAuctionStatus;return this.aps&&!this.pbjs?e&&e.apsFinished:this.pbjs&&!this.aps?e&&e.pbjsFinished:this.pbjs&&this.aps?e&&e.apsFinished&&e.pbjsFinished:void 0}callAdServer(e){he(e.divId,ce.START_AD_SERVER_CALL),this.adServer.callAdServer(e,(()=>{b(`${Le} onCallFinished called, adding setTimeout to a new auction`),setTimeout((()=>{this.executeRefresh({adUnit:e,rank:this.rank}),this.rank++}),5e3)})),b(`${Le} ad server called ${e.divId}`)}}const De={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Me;const Be=new Uint8Array(16);function ze(){if(!Me&&(Me="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Me))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Me(Be)}const Fe=[];for(let e=0;e<256;++e)Fe.push((e+256).toString(16).slice(1));const We=function(e,t,i){if(De.randomUUID&&!t&&!e)return De.randomUUID();const n=(e=e||{}).random||(e.rng||ze)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return Fe[e[t+0]]+Fe[e[t+1]]+Fe[e[t+2]]+Fe[e[t+3]]+"-"+Fe[e[t+4]]+Fe[e[t+5]]+"-"+Fe[e[t+6]]+Fe[e[t+7]]+"-"+Fe[e[t+8]]+Fe[e[t+9]]+"-"+Fe[e[t+10]]+Fe[e[t+11]]+Fe[e[t+12]]+Fe[e[t+13]]+Fe[e[t+14]]+Fe[e[t+15]]}(n)},Ve=(e,t)=>"fluid"===e&&"fluid"===t||e[0]===t[0]&&e[1]===t[1],He=e=>!!e.sizes.find((e=>Ve(e,[1800,1e3])));function Ge(e){var t;const i=null!==(t=e.values)&&void 0!==t?t:[];return e.value?e.value:i}function Je(e){return e.pubstackNameOverride?e.pubstackNameOverride:e.adServerAdUnitName}function Ke(){window,window.sublime=window.sublime||{};const e=window.sublime.notifyId||We();return window.sublime.notifyId=e,e}const qe=(e,t)=>({...e,bids:t,mediaTypes:{video:{mimes:["video/mp4","video/webm","application/javascript"],context:"instream",playerSize:[640,480]}}}),Ye=(e,t,i)=>({...t,bids:i.filter((t=>e.biddersOutstream.includes(t.bidder))),mediaTypes:{video:{context:"outstream",playerSize:[640,480],mimes:["video/mp4","video/ogg","video/webm","application/javascript"],protocols:[1,2,3,4,5,6,7,8,11,12,13,14],api:[1,2,3,5,6,7],playbackmethod:[2,3,4],skip:1,linearity:2,startdelay:0,placement:3,plcmt:4,playVideoVisibleThreshold:25,nonViewableBehavior:"pause"}},renderer:{url:"https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js",options:{adText:"",aspectRatio:"16:9",skippable:{enabled:!0,skipButtonText:"SKIP"}}}}),Xe=e=>{var t;const i=[];return e.isInstream?["Instream"]:((e.sizes.length>0||(null!==(t=e.extraAdServerSizes)&&void 0!==t?t:[]).length>0)&&i.push("Banner"),e.canOutstream&&i.push("Outstream"),i)},Qe=["adyoulike"],Ze=(e,t,i)=>{const n=e.biddersSkin?i.filter((t=>{var i;return null===(i=e.biddersSkin)||void 0===i?void 0:i.includes(t.bidder)})):i,o={...t,bids:n.filter((e=>!Qe.includes(e.bidder))),mediaTypes:{banner:{sizes:[[1800,1e3]]}}},s=D(e.sizes).filter((e=>!Ve(e,[1800,1e3])));return s.length>0?[{...t,bids:i,mediaTypes:{banner:{sizes:s}}},o]:[o]},et=(e,t,i)=>({...t,bids:i,mediaTypes:{banner:{sizes:D(e.sizes)}}});function tt(e){var t,i;const n=[...null!==(t=e.extraTargetings)&&void 0!==t?t:[]];e.targeting&&n.push(e.targeting);const o=(null!==(i=e.pubstackDeclarationTargetingKeys)&&void 0!==i?i:[]).map((e=>{const t=n.find((t=>t.key===e));if(t)return t;{const t=E(window)[e];return t?{key:e,values:t}:void 0}})).filter((e=>!!e)).map((e=>`${e.key}=${function(e){const t=e.values?e.values.join(","):"";return e.value?e.value:t}(e)}`)).join("&"),s=e.adUnitPath.includes("?")?"&":"?";return o.length>0?`${e.adUnitPath}${s}${o}`:e.adUnitPath}function it(e){if("string"==typeof e)return!0;if(Array.isArray(e)){for(const t of e)if("string"!=typeof t)return!1;return!0}return!1}function nt(e,t,i){const n=t.getTargeting(i);n&&n.length>0&&(b(`removing ${i} targeting from slot ${e}`),t.clearTargeting(i))}const ot="bid_bidder",st="bid_size",at="bid_mediatype";class rt{constructor(){this.uprEnabled=!0}setUprState(e,t){switch("true"===function(e,t){const i=window.document.querySelector('meta[name="adm_feature:upr_disabled"]');return null!==i?i.getAttribute("content"):null}()&&(e="disabled"),e){case"disabled":this.uprEnabled=!1;break;case"tested":this.uprEnabled=M(null!=t?t:50),this.uprTested=!0;break;default:this.uprEnabled=!0}}static getInstance(){return rt.instance||(rt.instance=new rt),rt.instance}}const dt="[GAM]",lt="xp_name",ct="ad_adunitname",ut=[3,1];let ft=!1;const gt=[];function pt(e){return new Promise(((t,i)=>vt(e,t,i)))}const ht=50;function vt(e,t,i){if(e.googletag)try{e.googletag.apiReady?t():setTimeout((()=>vt(e,t,i)),ht)}catch(e){i(e)}else setTimeout((()=>vt(e,t,i)),ht)}const mt=e=>{const t=e.slot,i=t.getSlotElementId();he(i,ce.SLOT_RENDER_ENDED_TIME),Ue(i,"slotRenderEnded"),function(e,t){nt(e,t,"ad_floor-rule"),nt(e,t,"prkv")}(i,t),b(`slot render ended for ${i}`)},bt=e=>{const t=e.slot.getSlotElementId();b(`slot response received for ${t}`),he(t,ce.SLOT_RESPONSE_RECEIVED_TIME)};function yt(e,t){let i=!1;if(e.targeting){const n=Ge(e.targeting),o=e.targeting.key;t.setTargeting(o,n),b(`${dt} adding targeting (${e.targeting.key}, ${n}) to adunit ${e.divId}`),o===ct&&(i=!0)}if(e.extraTargetings)for(const n of e.extraTargetings){const o=Ge(n),s=n.key;t.setTargeting(s,o),b(`${dt} adding targeting (${n.key}, ${o}) to adunit ${e.divId}`),s===ct&&(i=!0)}i||t.setTargeting(ct,[e.adServerAdUnitName])}function Ct(e){ft?e():gt.push(e)}class wt{constructor(e,t){var i;this.pubstackWindow=e,this.prebidOrderIds=(null===(i=t.globalRefreshConfig)||void 0===i?void 0:i.prebidOrderIds)||[]}init(e,t,i,n){!function(e,t,i,n,o){pt(e).then((()=>{var s,a;b("googletag ready, starting initialization"),e.googletag.pubads().disableInitialLoad(),e.googletag.pubads().enableSingleRequest()||w("unable to enable single request"),function(e,t,i){const n=e.googletag.pubads();i.forEach(((e,t)=>{e&&n.setTargeting(t,e)}));const o=E(e);b("[targetings] here are the targetings",o),Object.keys(o).forEach((e=>{n.setTargeting(e,o[e])})),n.setTargeting("adm","1"),n.setTargeting("device",t),n.setTargeting(lt,"1");const s=rt.getInstance().grapeshotValues;if((null==s?void 0:s.length)&&n.setTargeting("gs_cat",s),rt.getInstance().uprTested){b(`${dt} setting xp_variant/pbstck_ab_test gam targeting value any previous value will be ignored`);const e=`floor_optimization:${rt.getInstance().uprEnabled}`;n.setTargeting("xp_variant",e),n.setTargeting("pbstck_ab_test",e)}}(e,t,i),o&&o.ppidValue&&e.googletag.pubads().setPublisherProvidedId(o.ppidValue),e.googletag.enableServices(),(null===(s=null==n?void 0:n.lazyLoadingGoogle)||void 0===s?void 0:s.googleFetchMarginPercent)&&(null===(a=null==n?void 0:n.lazyLoadingGoogle)||void 0===a?void 0:a.googleRenderMarginPercent)&&e.googletag.pubads().enableLazyLoad({fetchMarginPercent:n.lazyLoadingGoogle.googleFetchMarginPercent,renderMarginPercent:n.lazyLoadingGoogle.googleRenderMarginPercent,mobileScaling:n.lazyLoadingGoogle.googleMobileScaling}),rt.getInstance().disableGPTSetCentering||e.googletag.pubads().setCentering(!0),b("googletag initialized"),ft=!0,gt.forEach((e=>e())),pe(le.GOOGLETAG_READY),ke("[metric] googletag",{consentType:Ie,googletagReady:me(le.CMP_RESPONSE_AVAILABLE,le.GOOGLETAG_READY),adUnitWithAuctionEnded:Array.from(Te.keys())}),y("GAM","googletag slotRenderEnded listener added"),e.googletag.pubads().addEventListener("slotRenderEnded",mt),e.googletag.pubads().addEventListener("slotResponseReceived",bt)}))}(this.pubstackWindow,e,t,i,n)}declareAdUnits(e){return this.declareGoogleSlots(e)}cleanAdUnits(){b(`${dt} cleaning slots`,this.pubstackWindow.googletag.pubads().getSlots().map((e=>e.getSlotElementId())),this.pubstackWindow.googletag.pubads().getSlots());const e=[];this.pubstackWindow.googletag.pubads().getSlots().forEach((t=>{const i=this.pubstackWindow.googletag.destroySlots([t]);y(`${dt} slot ${t.getSlotElementId()} destroyed ? ${i}`),i||(e.push(t),b(`${dt} slot ${t.getSlotElementId()} not destroyed, retrying later`))})),e.length?w(`${dt} unable to destroy slot ${St(e)}`):y(`${dt} all slots destroyed`),this.pubstackWindow.googletag.pubads().removeEventListener("slotRenderEnded",mt),this.pubstackWindow.googletag.pubads().removeEventListener("slotResponseReceived",bt),gt.splice(0)}setPbjsTargetings(e,t){e?(b(`${dt} try to put pbjs targeting keys for ${t.map((e=>e.divId)).join(",")}`),t.forEach((t=>{const i=this.getSlot(t,"setPbjsTargetings");i&&function(e,t,i){i.getTargetingKeys().forEach((e=>{"bid_"!==e.substring(0,4)&&"hb_"!==e.substring(0,3)||i.clearTargeting(e)}));const n=t.getAdserverTargetingForAdUnitCode(e.divId);for(const t of Object.keys(n)){const o=n[t];it(o)?i.setTargeting(t,o):C(`[targeting] unable to set targeting ${t}=${o} on adUnit ${e.divId}`)}}(t,e,i)}))):w(`${dt} no pbjs given: unable to put header bidding targetings`)}setApsTargetings(e,t,i){e&&(b(`${dt} putting targeting keys for aps auction`,i),e.setDisplayBids())}setRefreshTargeting(e){const t=this.getSlot(e.adUnit,"setPbjsTargetings");var i,n;t&&(i=t,n=e.rank,i.setTargeting("ad_refresh","1"),i.setTargeting("pbstck_refresh","1"),i.setTargeting("ad_refresh-rank",function(e){return e<10?`${e}`:"10-more"}(n)))}callAdServer(e){b(`${dt} preparing call to GAM for ${e.map((e=>e.divId)).join(",")}`,e);const t=this.pubstackWindow.googletag.pubads().getSlots(),i=e.map((e=>t.find((t=>t.getSlotElementId()===e.divId)))).filter((e=>!!e));b(`${dt} calling GAM with ${i.length} slots`,St(i),St(t)),this.pubstackWindow.googletag.pubads().refresh(i)}executeWhenAdServerReady(e){ft?e():gt.push(e)}renderListener(e){Ct((()=>{this.renderListenerCallback=t=>{const i=t.slot,n=t.campaignId,o={divId:i.getSlotElementId(),lineItemId:t.lineItemId,orderId:n,size:At(t),isEmpty:t.isEmpty,advertiserId:t.advertiserId};if(n&&this.prebidOrderIds.includes(n)){const e=i.getTargeting(ot);e&&(o.hb_bidder=Array.isArray(e)?e[0]:e);const t=i.getTargeting(st);t&&t[0]&&(o.size=function(e){if("fluid"===e)return"fluid";const[t,i]=e.split("x");return[parseInt(t,10),parseInt(i,10)]}(t[0]));const n=i.getTargeting(at);n&&(o.hb_mediaType=Array.isArray(n)?n[0]:n)}e(o)},this.pubstackWindow.googletag.pubads().addEventListener("slotRenderEnded",this.renderListenerCallback)}))}removeRenderListener(){this.renderListenerCallback&&(y("GAM","removing render listener"),this.pubstackWindow.googletag.pubads().removeEventListener("slotRenderEnded",this.renderListenerCallback))}getSlot(e,t){const i=this.pubstackWindow.googletag.pubads().getSlots().filter((t=>t.getSlotElementId()===e.divId));if(0!==i.length)return i.length>1&&w(`${dt} multiple slot found for adunit ${e.divId} on operation ${t}`),i[0];w(`${dt} slot not found for adunit ${e.divId} on operation ${t}`)}declareGoogleSlots(e){return new Promise((t=>{Ct((()=>{const i=e.sort(F),n=[];i.forEach((e=>{var t,i,o;if("interstitial"===e.outOfPageType){b(`${dt} define slot interstitial for ${e.divId} (${e.adUnitPath})`);const t=window.googletag.defineOutOfPageSlot(e.adUnitPath,googletag.enums.OutOfPageFormat.INTERSTITIAL);t&&(b("slot interstitial created"),t.addService(googletag.pubads()),n.push(t),yt(e,t))}else if(document.getElementById(e.divId)){let n;if("default"===e.outOfPageType)b(`${dt} define slot out of page for ${e.divId} (${e.adUnitPath})`),n=null===(t=window.googletag.defineOutOfPageSlot(e.adUnitPath,e.divId))||void 0===t?void 0:t.addService(googletag.pubads());else{const t=[ut,...e.sizes,...null!==(i=e.extraAdServerSizes)&&void 0!==i?i:[]];b(`${dt} define slot for ${e.divId} (${e.adUnitPath})`),n=null===(o=window.googletag.defineSlot(e.adUnitPath,t,e.divId))||void 0===o?void 0:o.addService(googletag.pubads())}n?(b(`${dt} slot created, displaying ${e.divId}`),googletag.display(e.divId),yt(e,n)):w(`${dt} unable to create slot for ${e.divId}`)}else b(`${dt} unable to display ${e.divId}, the div does not exist`)})),n.forEach((e=>{b(`${dt} calling googletag.display for interstitial slot`,e),googletag.display(e)})),n.length>0&&googletag.pubads().refresh(n);const o=rt.getInstance().declareXPLNTargetings;o&&o(),t()}))}))}}function St(e){return e.map((e=>({id:e.getSlotElementId(),path:e.getAdUnitPath()})))}function At(e){return e.size}const kt="[instream] [Dailymotion]";class Et{constructor(e,t,i,n){this.callbackAdded=!1,this.admDailymotionReadySent=!1,this.pubstackWindow=e,this.pageContext=t,this.device=i,this.targetings=$t(this.device,this.pubstackWindow),this.instreamType=null!=n?n:"dailymotion-v1"}setApsTargetings(e,t){var i;if(!e||0===t.length)return;b(`${kt} putting targeting keys for aps auction of winning bidder`,t[0]);const n=null===(i=t[0].helpers)||void 0===i?void 0:i.qsParams();if(n)return void this.targetings.push(n.slice(1));const o=t[0].qsParams;o&&this.targetings.push(o.slice(1))}executeWhenAdServerReady(e){this.pubstackWindow.dailymotion?e():setTimeout(this.executeWhenAdServerReady.bind(this,e),100)}async callAdServer(e,t){var i,n,o;b(`${kt} call ad server`);const s=e.divId,a=await(null===(i=this.pubstackWindow.dailymotion)||void 0===i?void 0:i.getPlayer(s));if(a)switch(b(`${kt}`,s,a),this.customConfig=function(e,t,i){var n,o,s;const a=function(e){const t=[];return e.targeting&&t.push(It(e.targeting)),e.extraTargetings&&e.extraTargetings.forEach((e=>t.push(It(e)))),t}(e);b(`${kt} adUnitTargetings`,a);const r=a.concat(t).join("&"),d=Object.keys(null!==(o=null===(n=e.instreamParams)||void 0===n?void 0:n.vast)&&void 0!==o?o:{}).map((function(t){var i;return`${t}=${null===(i=e.instreamParams)||void 0===i?void 0:i.vast[t]}`})).join("&"),l=null===(s=e.instreamParams)||void 0===s?void 0:s.adDeactivationContext;let c=!1;if(l){const e=i.get(l.key);c=!!e&&l.values.includes(e)}const u={dynamiciu:e.adUnitPath,keyvalues:r,keyvalues2:d};return c?{...u,premium:"true"}:u}(e,this.targetings,this.pageContext),b(`${kt} generated customConfig`,this.customConfig),this.instreamType){case"dailymotion-v1":b(`${kt} setCustomConfig`,this.customConfig),a.setCustomConfig(this.customConfig),b(`${kt} ad server called ${s}`),document.dispatchEvent(new CustomEvent("admDailymotionReady",{detail:{divId:s}})),b(`${kt} admDailymotionReady event dispatched`);break;case"dailymotion-v2":this.callbackAdded||(b(`${kt} add callback to event ${null===(n=this.pubstackWindow.dailymotion)||void 0===n?void 0:n.events.AD_READYTOFETCH}`),a.on(null===(o=this.pubstackWindow.dailymotion)||void 0===o?void 0:o.events.AD_READYTOFETCH,(()=>{b(`${kt} event AD_READYTOFETCH received, setCustomConfig`,this.customConfig),this.customConfig&&a.setCustomConfig(this.customConfig),t&&(b(`${kt} event AD_READYTOFETCH, call "onCallFinished"`),t())})),this.callbackAdded=!0);break;case"dailymotion-prisma":if(b(`${kt} setCustomConfig`,this.customConfig),this.customConfig.customParams=`${encodeURIComponent(this.customConfig.keyvalues)}&${this.customConfig.keyvalues2}/${encodeURIComponent(this.customConfig.dynamiciu)}`,b(`${kt} customParams`,this.customConfig.customParams),a.setCustomConfig(this.customConfig),b(`${kt} ad server called ${s}`),this.admDailymotionReadySent||(b(`${kt} dispatching admDailymotionReady event`),document.dispatchEvent(new CustomEvent("admDailymotionReady",{detail:{divId:s}})),this.admDailymotionReadySent=!0),t){let e=!1;a.on("AD_PLAY",(()=>{e||(b(`${kt} event AD_PLAY, call "onCallFinished"`),t()),e=!0}),{once:!0})}}else w(`${kt} no player found for ${s}`)}setPbjsTargetings(e,t){if(e){b(`${kt} put pbjs targeting keys for ${t.divId}`);const i=e.getAdserverTargetingForAdUnitCode(t.divId);for(const e of Object.keys(i)){const n=i[e];it(n)?this.targetings.push(`${e}=${n}`):C(`${kt} [targeting] unable to set targeting ${e}=${n} on adUnit ${t.divId}`)}}else w(`${kt} no pbjs given: unable to put header bidding targetings`)}cleanTargetings(){this.targetings.splice(0),this.targetings.push(...$t(this.device,this.pubstackWindow))}}function It(e){const t=Ge(e);return`${e.key}=${"string"==typeof t?t:t.join(",")}`}function $t(e,t){const i=[],n=E(t);Object.keys(n).forEach((e=>{const t=n[e].join(",");i.push(`${e}=${t}`)})),i.push("adm=1"),i.push(`device=${e}`),i.push(`${lt}=1`);try{const e=JSON.parse(t.localStorage._pdfps).slice(0,250).join(",");""!==e?i.push(`permutive=${e}`):b(`[${kt}] no permutive targeting found`)}catch(e){b(`[${kt}] error reading permutive targeting`)}return i}class Ut{constructor(){this.name="AdServer",this.enableConsentless=!1,this.scriptLoaded=!1}get adServer(){return this._adServer}isLoaded(){return!!this._adServer}async load({config:e}){this._adServer=new wt(window,e),this._adServer.renderListener((t=>{t.isEmpty||function(e,t,i,n,o){const s=`${n}_${o}`;navigator.sendBeacon(`https://intake.pbstck.com/v1/intake/gam-impression?sId=${t}&tId=${e}&c=1&s=${s}&v=${i}`)}(e.tagId,e.stack.scopeId,e.kleanadsVersion,e.stack.stackId,e.stackVersion)})),this.enableConsentless=e.enableConsentless}async onAfterConsentRefused(){this.enableConsentless&&(this.isLoaded()?this.scriptLoaded||(P("https://pagead2.googlesyndication.com/tag/js/gpt.js"),this.scriptLoaded=!0):w("AdServerModule - onAfterConsentRefused (with consentless enabled) - AdServer is not loaded"))}async onAfterConsentAccepted(){this.isLoaded()?this.scriptLoaded||(P("https://securepubads.g.doubleclick.net/tag/js/gpt.js"),this.scriptLoaded=!0):w("AdServerModule - onAfterConsentAccepted - AdServer is not loaded")}async onAdUnitConfigLoad({config:e,adUnitConfig:t}){var i;null===(i=this._adServer)||void 0===i||i.init(e.device,e.pageContext,t.lazyLoading,t.gamConfig)}async onPrepareAdUnits({toPreparedAdUnits:e}){var t;const i=(null!=e?e:[]).filter((e=>!e.isInstream));return null===(t=this._adServer)||void 0===t?void 0:t.declareAdUnits(i)}async clean(){var e;null===(e=this._adServer)||void 0===e||e.cleanAdUnits()}}function Tt(e){return function(t,i){return class extends t{constructor(){super(...arguments),this.deferLoadingTo=e}}}}let Ot=4400;const xt="[executor] [APS]";let Pt=!1,_t=!1;function jt(e){const t=e.apstag;if(t.kleanadsBlocker){b(`${xt} getting apstag from blocker's methods`);const e=t;return{...t,fetchBids:e.fetchBidsKleanads,setDisplayBids:e.setDisplayBidsKleanads}}return t}class Rt{constructor(e,t){this.pubstackWindow=e,this.apsPubId=t}setEnableApsForTests(e){!function(e){w(`${xt} this function should be used only for testing purpose`),Pt=e}(e)}load(){!function(e){function t(t,i){var n,o;null===(o=null===(n=jt(e))||void 0===n?void 0:n._Q)||void 0===o||o.push([t,i])}Pt=!0,e.apstag||(b(`${xt} overriding apstag`),e.apstag={_Q:[]}),b(`${xt} overriding apstag functions`),e.apstag.init=(...e)=>t("i",e),b(`${xt} init set!`,e.apstag.init),e.apstag.fetchBids=(...e)=>t("f",e),e.apstag.setDisplayBids=()=>{},e.apstag.targetingKeys=()=>[],P("//c.amazon-adsystem.com/aax2/apstag.js")}(this.pubstackWindow)}startApsAuction(e,t){if(!Pt)return b(`${xt} skipping auction for adunits [${e.map((e=>e.divId)).join(",")}]`),void t(void 0,[]);if(!_t)return C(`${xt} cannot start auction: apstag is not initialized`),void t(void 0,[]);const i=jt(this.pubstackWindow);if(!i)return C(`${xt} cannot find apstag on the page`),void t(void 0,[]);const n=function(e){return e.filter((e=>e.headerBiddingEnabled)).reduce(((e,t)=>{const i=Xe(t);if(i.includes("Instream")){const t={slotID:"videoSlot",mediaType:"video",sizes:[[640,480]]};return[...e,t]}if(i.includes("Banner")&&i.includes("Outstream")){const i={slotID:t.divId,slotName:t.slotName,mediaType:"multi-format",multiFormatProperties:{display:{sizes:D(t.sizes)},video:{sizes:[[640,480]]}}};return[...e,i]}if(i.includes("Banner")){const i={slotID:t.divId,slotName:t.slotName,sizes:D(t.sizes)};return i.sizes.length?[...e,i]:e}if(i.includes("Outstream")){const i={slotID:t.divId,mediaType:"video",sizes:[[640,480]]};return[...e,i]}return[]}),[])}(e);if(b(`${xt} apsSlots created`,n),0===n.length)return void t(i,[]);b(`${xt} calling fetchBids`);let o=!1;setTimeout((()=>{o||(C(`${xt} fetchbids did not response before ${Ot}ms, calling callback`),o=!0,t(i,[]))}),Ot),i.fetchBids({slots:n},(e=>{o||(o=!0,t(i,e))})),b(`${xt} auction started`,n)}initAps(e){if(Pt){Ot=e+1400,b(`${xt} updating failsafe timeout to ${Ot}`);const t=jt(this.pubstackWindow);if(!t)return void C(`${xt} cannot find apstag on the page`);t.init({pubID:this.apsPubId,adServer:"googletag",bidTimeout:e,deals:!0,videoAdServer:"DFP"},(()=>{b(`${xt} apstag init done`),pe(le.APSTAG_READY),ke("[metric] apstag",{consentType:Ie,apstagReady:me(le.CMP_RESPONSE_AVAILABLE,le.APSTAG_READY)})})),_t=!0}else b(`${xt} apstag init skipped`)}}let Lt=(()=>{let e,t,i=[Tt("onAdUnitConfigLoad")],n=[];return t=class{constructor(){this.name="Aps"}get aps(){return this._aps}isLoaded(){return!!this._aps}async load({adUnitConfig:e}){var t;this._aps=function(e,t){if(e&&t.some((e=>e.headerBiddingEnabled&&(e.isInstream||e.canOutstream||e.sizes.some((e=>"fluid"!==e)))))){b("downloading amazon apstag");const t=new Rt(window,e);return t.load(),t}}(null===(t=e.tamConfig)||void 0===t?void 0:t.apsPubId,e.adUnits)}async onAdUnitConfigLoad({config:e,adUnitConfig:t}){var i,n,o;null===(i=this._aps)||void 0===i||i.initAps(null!==(o=null===(n=t.prebidConfig)||void 0===n?void 0:n.adCallTimeout)&&void 0!==o?o:e.adCallTimeout)}async clean(){}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"ApsModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;oe.isLoaded())).find((t=>t instanceof e))}async loadModules(e){for(const t of e){b(Nt,`Loading module ${t.name}`);try{await t.load(this.lifecycleState)}catch(e){w(Nt,`Error while loading module ${t.name}`,e)}}}async loadInitialModules(){const e=this.modules.filter((e=>!e.deferLoadingTo&&!e.isLoaded()));b(`[${Nt}] Loading initial modules. ${e.length} modules to load`),await this.loadModules(e)}async modulesDispatchEvent(e,...t){this.lifecycleState={...this.lifecycleState,...t[0]};const i=this.lifecycleState,n=this.modules.filter((t=>t.deferLoadingTo===e&&!t.isLoaded()));return b(`[${Nt}] event call: ${e}. ${n.length} deferred modules to load`),await this.loadModules(n),new Promise((t=>{var n;const o=this.modules.filter((t=>t.isLoaded()&&t[e]&&"function"==typeof t[e]));b(`[${Nt}] event call: ${e}. ${o.length} modules to call`);const s=[];for(const t of o){b(Nt,`Calling ${e} on module ${t.name}`);const o=null===(n=t[e])||void 0===n?void 0:n.call(t,i);o instanceof Promise&&s.push(o)}t(s)}))}async modulesCleanUp(){const e=this.modules.filter((e=>e.isLoaded()));b(`[${Nt}] Cleaning modules. ${e.length} modules cleanup started`);for(const t of e)b(Nt,`Cleaning module ${t.name}`),await t.clean(this.lifecycleState);this.modules=[]}}const Mt="[pbjs] [sublime]",Bt=1900,zt="[pbjs]";function Ft(e,t=[]){const i=null==t?void 0:t.map((e=>e.bidderSource));return Array.from(new Set(e.flatMap((e=>e.bidders)).map((e=>e.bidder)).concat(i)))}function Wt(e,t){const i=e.cpm,n=i>0?function(e,t){let i;if(t.forEach((t=>{const n=parseFloat(t.max);n>e&&(i=!i||nparseFloat(e.max))));const n=parseFloat(i.increment);return parseFloat((Math.floor(e/n)*n).toFixed(2))}(i,t):0,o=Math.max(...t.map((e=>parseFloat(e.max))));return Math.min(n,o).toFixed(2)}function Vt(e,t,i,n,o){const[s,a,r]=function(e){const t=[],i=[],n=[];return e.forEach((e=>{e.headerBiddingEnabled&&e.bidders.length>0?(t.push(e),i.push(e.divId)):n.push(e.divId)})),[t,i.join(","),n.join(",")]}(t);if(s.length>0){const t=null==o?void 0:o.timeout,d=null==o?void 0:o.labels,l=function(e){const t=e.getConfig("bidderTimeout");if(t){if("number"==typeof t)return t+Bt;if(parseInt(t))return parseInt(t)+Bt}return 4900}(e);let u=!1;setTimeout((()=>{u||(C(`${zt}prebid requestBids did not response before ${l}ms, calling callback`),u=!0,i())}),l);const f=()=>{u||(u=!0,i())},g=s.flatMap((e=>function(e,t){var i,n;const o=e.bidders.map((e=>function(e,t){var i;return"sublime"===e.bidder||e.bidder===(null===(i=null==t?void 0:t.find((e=>"sublime"===e.bidderSource)))||void 0===i?void 0:i.bidderLabel)?(c("common","[Sublime] generate notify id"),{...e,params:{...e.params,notifyId:Ke()}}):e}(e,t))),s={code:e.divId,pubstack:{adUnitName:Je(e),adUnitPath:tt(e)},floors:e.floors,ortb2Imp:e.ortb2Imp};if(null===(i=e.extraTargetings)||void 0===i?void 0:i.find((e=>"ad_index"===e.key))){const t=null===(n=e.extraTargetings.find((e=>"ad_index"===e.key)))||void 0===n?void 0:n.value;s.pubstack&&(s.pubstack.tags=[`ad_index:${t}`])}const a=Xe(e);if(a.includes("Instream"))return[qe(s,o)];const r=[];return a.includes("Banner")&&(He(e)?r.push(...Ze(e,s,o)):r.push(et(e,s,o))),a.includes("Outstream")&&r.push(Ye(e,s,o)),r}(e,n)));b(`${zt}[executor] [pbjs] calling requestBids for ${g.map((e=>e.code)).join(",")}`),e.requestBids({timeout:t,adUnits:g,bidsBackHandler:f,labels:d}),b(`${zt}[executor] [pbjs] prebid auction started for [${a}] | prebid auction skipped for [${r}]`,s)}else b(`${zt}[executor] [pbjs] no prebid auction to start for [${r}]`),i()}function Ht(e,t,i){const n=e.flatMap((e=>e.bidders)).map((e=>e.bidder)),o=[...new Set(n)],s=[t,...(null==i?void 0:i.filter((e=>e.bidderSource===t)).map((e=>e.bidderLabel)))||[]];return o.some((e=>null==s?void 0:s.includes(e)))}class Gt{constructor(e){this.pbjs=e.getPbjs()}initPbjs(e,t,i,n){!function(e,t,i,n,o){var s,a,r,d,l;b(`${zt}[initPbjs] Start prebid initialization`);const{currency:c,userSync:u,priceGranularity:f,bidderAdjustments:g,bidderAliases:p,bidderConfigs:h,floors:v,analytics:m,schain:y,outbrain:w,realTimeData:S,allowLocalStorage:A,fledgeForGpt:k,dsaConfig:E,s2sConfig:I}=i,$=Ft(t,p);if(e.setConfig(n),c&&(b(`${zt}[initPbjs] set currency config`,c),e.setConfig({currency:c,priceGranularity:"dense"}),f&&(b(`${zt}[initPbjs] set priceGranularity config`,f),e.setConfig({priceGranularity:f}))),u){b(`${zt}[initPbjs] set userSync config`,u);const t={filterSettings:{iframe:{bidders:["optidigital","richaudience","justpremium","impactify","smilewanted","onetag"],filter:"include"},image:{bidders:"*",filter:"include"}},...u};e.setConfig({userSync:t})}w&&(b(`${zt}[initPbjs] set Outbrain config:`,w),e.setConfig({outbrain:w})),S&&(b(`${zt}[initPbjs] set realTimeData config`,S),e.setConfig({realTimeData:S})),v&&(b(`${zt}[initPbjs] set floors config`,v),e.setConfig({floors:v}));const U=null==S?void 0:S.dataProviders.find((e=>"greenbidsRtdProvider"===e.name));if(m||U){const t=m||[];if(U){const e=null===(s=U.params)||void 0===s?void 0:s.pbuid;if(e&&!t.find((e=>"greenbids"===e.provider))){const i=function(e,t){return{provider:"greenbids",options:{pbuid:e,sampling:t}}}(e,null===(a=U.params)||void 0===a?void 0:a.sampling);t.push(i)}}b(`${zt}[initPbjs] enable analytics`,t),e.enableAnalytics(t)}if(y&&(b(`${zt}[initPbjs] set schain config`,y),e.setConfig({schain:y})),k&&e.setConfig({fledgeForGpt:{enabled:!0}}),h){b(`${zt}[initPbjs] set bidder config`,h);for(const t of h)e.setBidderConfig(t)}const T={};if(g){b(`${zt}[initPbjs] set bidder adjustments config`,g);for(const e of g)T[e.bidder]={bidCpmAdjustment:function(t){return t*e.adjustment}}}if(A)for(const e of $)T[e]={...T[e],storageAllowed:!0};if(T.standard={adserverTargeting:[{key:ot,val:function(e){return e.bidderCode}},{key:"bid_id",val:function(e){return e.adId}},{key:"bid_cpm",val:function(e){return e.pbCg}},{key:st,val:function(e){return e.size}},{key:at,val:function(e){return e.mediaType}},{key:"bid_videoId",val:function(e){return e.videoCacheKey}}]},o&&rt.getInstance().uprEnabled&&(T.standard={adserverTargeting:[...T.standard.adserverTargeting,{key:"prkv",val:e=>Wt(e,o)},{key:"ad_floor-rule",val:e=>Wt(e,o)}]}),Object.keys(T).length>0&&(e.bidderSettings=T),p){b(`${zt}[initPbjs] set alias bidder`,p);for(const t of p)e.aliasBidder(t.bidderSource,t.bidderLabel)}if(Ht(t,"sublime",p)){const e=function(e,t){var i,n;const o=null===(i=null==t?void 0:t.find((e=>"sublime"===e.bidderSource)))||void 0===i?void 0:i.bidderLabel,s=e.filter((e=>e.bidders.find((e=>"sublime"===e.bidder||e.bidder===o))));if(0===s.length)return;if(s.length>1)return void C(`${Mt} Sublime bidder has multiple adUnits ${s.map((e=>e.divId)).join("")}`,s);const a=null===(n=s[0].bidders.find((e=>"sublime"===e.bidder||e.bidder===o)))||void 0===n?void 0:n.params;if(a){const e=a.zoneId;if(e&&("string"==typeof e||"number"==typeof e))return`${e}`}else C(`${Mt} unable to extract Sublime zoneId from ${s[0].divId}`,s[0])}(t,p);if(e){const t=`https://sac.ayads.co/sublime/${e}/prebid`;b(`${zt}[initPbjs] loading sublime script ${t}`),P(t)}}if(null===(r=e.installedModules)||void 0===r?void 0:r.includes("utiqSystem")){const t=localStorage.getItem("utiqPass");if(t)try{const i=JSON.parse(t),n=null!==(null===(l=null===(d=null==i?void 0:i.connectId)||void 0===d?void 0:d.idGraph)||void 0===l?void 0:l[0].atid);b(`${zt}[initPbjs] set Utiq key values isUtiqPresent=`,n),e.mergeConfig({ortb2:{site:{keywords:"isUtiqPresent="+n}}})}catch(e){C(`${zt}[initPbjs] Utiq config is not valid JSON`,t)}}E&&(b(`${zt}[initPbjs] set DSA config`,E),e.mergeConfig({ortb2:{regs:{ext:{dsa:E}}}})),I&&(b(`${zt}[initPbjs] set prebid server config`,I),e.setConfig({s2sConfig:I})),Ht(t,"criteo",p)&&e.setConfig({criteo:{fastBidVersion:"latest"}}),b(`${zt}[initPbjs] Prebid is initialized`)}(this.pbjs,e,t,i,n)}extractUniqAdaptersName(e,t=[]){return Ft(e,t)}roundUpToNearestIncrement(e,t){return function(e,t){const i=e.sort(((e,t)=>e.maxt<=e.max));if(0===n.length)return b(`${zt}[Price granularity] round up - initial CpmValue : ${t} // rounded value : ${i[i.length-1].max} `),i[i.length-1].max.toFixed(2);const o=n[0].increment;let s=t%o==0?t:t+(o-t%o);const a=t.toString().split("."),r=a.length>1?a[1].split("").length:0;(s-o).toFixed(r)===t.toFixed(r)&&(s=t);const d=s.toFixed(2);return b(`${zt}[Price granularity] round up - initial CpmValue : ${t} // rounded value : ${d} `),d}(e,t)}startPbjsAuction(e,t,i,n){Vt(this.pbjs,e,t,i,n)}getPbjs(){return this.pbjs}setContextValuesAsTargeting(e,t,i){const n={};for(const[t,i]of e)n[t]=i;for(const e in t)1===t[e].length?n[e]=t[e][0]:n[e]=t[e];this.pbjs.setBidderConfig({bidders:i,config:{ortb2:{site:{ext:{data:n}}},appnexusAuctionKeywords:n}})}}let Jt=(()=>{let e,t,i=[Tt("onAdUnitConfigLoad")],n=[];return t=class{constructor(){this.name="Prebid"}get pbjs(){return this._pbjs}isLoaded(){return!!this._pbjs}async load({config:e,adUnitConfig:t}){this._pbjs=await async function(e,t){if(t.some((e=>e.headerBiddingEnabled&&e.bidders.length)))try{const t=await _(e);return new Gt(t)}catch(e){return void b("[config] Error while loading the kleanadsPbjs module",e)}}(e.newPrebidUrl,t.adUnits),this._pbjs&&this.aliasWindowPbjs(window,this._pbjs.getPbjs())}async onAdUnitConfigLoad({config:e,adUnitConfig:t}){var i,n,o,s,a;if(!this._pbjs)throw new Error("PrebidModule is not loaded");const r=null!==(n=null===(i=null==t?void 0:t.prebidConfig)||void 0===i?void 0:i.adCallTimeout)&&void 0!==n?n:e.adCallTimeout,d=null!==(s=null===(o=t.prebidConfig)||void 0===o?void 0:o.pbjsConfig)&&void 0!==s?s:e.pbjsConfig,l={bidderTimeout:r,useBidCache:!0,maxRequestsPerOrigin:6,consentManagement:e.noCmp?void 0:{gdpr:{cmpApi:"iab",timeout:8e3,defaultGdprScope:!0}},enableSendAllBids:!1,pageUrl:document.location.href,cache:{url:"https://prebid.adnxs.com/pbc/v1/cache",ignoreBidderCacheKey:!0},timeoutBuffer:400};if(this._pbjs.initPbjs(t.adUnits,d,l,e.priceRuleBuckets),null===(a=null==d?void 0:d.targetingBehaviors)||void 0===a?void 0:a.sendKVTargetings){const i=E(window),n=this._pbjs.extractUniqAdaptersName(t.adUnits,d.bidderAliases).filter((e=>{var t;return!(null===(t=d.targetingBehaviors)||void 0===t?void 0:t.biddersBlackList.includes(e))}));this._pbjs.setContextValuesAsTargeting(e.pageContext,i,n)}}async clean(){var e;this.setDefaultPbjsConfig();const t=null===(e=this._pbjs)||void 0===e?void 0:e.getPbjs();t&&(t.bidderSettings={})}aliasWindowPbjs(e,t){e.pbjs=t}setDefaultPbjsConfig(){var e;null===(e=this._pbjs)||void 0===e||e.getPbjs().setConfig({bidderTimeout:3e3,enableSendAllBids:!0,useBidCache:!1,deviceAccess:!0,timeoutBuffer:400,disableAjaxTimeout:!1,maxNestedIframes:10,priceGranularity:"medium",customPriceBucket:{},mediaTypePriceGranularity:{},bidderSequence:"random",auctionOptions:{},userSync:{syncEnabled:!0,filterSettings:{image:{bidders:"*",filter:"include"}},syncsPerBidder:5,syncDelay:3e3,auctionDelay:0}})}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"PrebidModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;o{if(function(e){return 0===e.top&&0===e.bottom&&0===e.left&&0===e.right&&0===e.width&&0===e.height}(t))return!1;const n=-i*e.innerHeight,o=(1+i)*e.innerHeight>t.top,s=t.bottom>n;return o&&s};function Yt(e,t,i){const n=e.filter((e=>e.sticky||t.isDivIdMatchingRule(e.divId))).filter((e=>!i.isAlreadyMonetized(e)));i.executeAdCall(n),setTimeout((()=>Yt(e,t,i)),200)}const Xt="[POC][DisableHeaderBidding] ";function Qt(e){var t,i,n;return null===(n=null===(i=null===(t=e.pocOverrides)||void 0===t?void 0:t.spaConfig)||void 0===i?void 0:i[e.tagId])||void 0===n?void 0:n.mode}function Zt(e,t){var i;if(t)return null!==(i=t[e])&&void 0!==i?i:t.type}function ei(e,t){return t.flatMap((t=>[t,...e.filter((e=>e.bidderSource===t)).map((e=>e.bidderLabel))]))}class ti{constructor(e,t){this.adUnitConfig={...e},this.pocOverrides=t}withInstreamAdUnits(){var e,t;return(null===(e=this.pocOverrides)||void 0===e?void 0:e.instreamAdUnits)&&(null===(t=this.pocOverrides)||void 0===t||t.instreamAdUnits.forEach((e=>{this.adUnitConfig.adUnits.push({...e,isInstream:!0,dynamic:!1,parallax:!1,sticky:!1,canOutstream:!1,biddersOutstream:[]})}))),this}withConvertToInstreamAdUnit(){const e=this.pocOverrides.convertToInstreamAdUnits;return e&&this.adUnitConfig.adUnits.forEach((t=>{const i=e[t.adUnitName];i&&(t.isInstream=!0,t.dynamic=!1,t.parallax=!1,t.sticky=!1,t.canOutstream=!1,t.biddersOutstream=[],t.floors=i.floors,t.instreamParams=i.instreamParams)})),this}withFirstId(e=[]){var t,i,n;if(null===(t=this.pocOverrides)||void 0===t?void 0:t.firstId){const t=z();if(t){const o=null!==(n=null===(i=this.adUnitConfig.prebidConfig.pbjsConfig.userSync)||void 0===i?void 0:i.userIds)&&void 0!==n?n:[];o.push({name:"pubProvidedId",bidders:ei(e,["appnexus","pubmatic","rubicon","ix","nexx360","criteo","smartadserver"]),params:{eids:[{source:"first-id.fr",uids:[{id:t,atype:1,ext:{stype:"ppuid"}}]}]}}),this.adUnitConfig.prebidConfig.pbjsConfig.userSync={...this.adUnitConfig.prebidConfig.pbjsConfig.userSync,userIds:o}}}return this}withDisableHeaderBidder(e){var t,i;return(null===(t=this.pocOverrides)||void 0===t?void 0:t.disableHeaderBidder)&&(this.adUnitConfig.adUnits=function(e,t,i){if(!e.key)return w(`${Xt} partial configuration: no context key. Using default configuration.`),i;if(!e.values||0===e.values.length)return w(`${Xt} partial configuration: no available values for the context key. Using default configuration.`),i;const n=t.get(e.key);return n?e.values.includes(n)?(b(`${Xt} Removing bidders for all adUnits (${e.key}=${n})`),i.map((e=>({...e,bidders:[]})))):(b(`${Xt} No need to remove bidder: ${n}`),i):(b(`${Xt} No valid ${e.key} meta found, using default config.`),i)}(null===(i=this.pocOverrides)||void 0===i?void 0:i.disableHeaderBidder,e,this.adUnitConfig.adUnits)),this}withConvertToInterstitialAdUnit(){const e=this.pocOverrides.convertToInterstitialAdUnits;return e&&this.adUnitConfig.adUnits.forEach((t=>{e.includes(t.adUnitName)&&(t.outOfPageType="interstitial",b(`Interstitial adUnit found: ${t.adUnitName}`))})),this}withSkinRenderingSettings(e,t){var i,n,o;const s=null===(i=this.pocOverrides)||void 0===i?void 0:i.skinRenderingSettings,a=null===(n=null==s?void 0:s.stackLevel)||void 0===n?void 0:n[t],r=null===(o=null==s?void 0:s.siteLevel)||void 0===o?void 0:o[e];return(null==r?void 0:r.disableSkinBids)||(null==a?void 0:a.disableSkinBids)?this.adUnitConfig.adUnits=this.adUnitConfig.adUnits.map((e=>({...e,sizes:e.sizes.filter((e=>!Ve(e,[1800,1e3])))}))):((null==r?void 0:r.biddersOverride)||(null==a?void 0:a.biddersOverride))&&(this.adUnitConfig.adUnits=this.adUnitConfig.adUnits.map((e=>{var t;return e.sizes.some((e=>Ve(e,[1800,1e3])))?{...e,biddersSkin:null!==(t=null==a?void 0:a.biddersOverride)&&void 0!==t?t:null==r?void 0:r.biddersOverride}:e}))),this}withReworldAbcdefTest(){var e,t;return(null===(t=null===(e=this.pocOverrides)||void 0===e?void 0:e.reworldAbcdefTest)||void 0===t?void 0:t.length)&&function(e,t){const i=function(e){if(100!==e.reduce(((e,t)=>e+t),0))return b("The sum of all probabilities should be equal to 100 and is not, we use the first version of the ab test"),1;const t=e.reduce(((e,t)=>(e.length?e.push(e[e.length-1]+t):e.push(t),e)),[]),i=Math.floor(100*Math.random())+1;return t.findIndex((e=>i<=e))+1}(t);switch(S("pbstck_reworld_test",`${i}`),k("pbstck_reworld_test",`${i}`),i){case 3:case 5:e.adUnits=e.adUnits.map((e=>({...e,bidders:[]})));break;case 4:delete e.tamConfig;break;case 6:delete e.tamConfig,e.adUnits=e.adUnits.map((e=>({...e,bidders:[]})))}}(this.adUnitConfig,this.pocOverrides.reworldAbcdefTest),this}withPrebidPpidSolution(e){var t,i,n,o;if(null===(i=null===(t=this.pocOverrides)||void 0===t?void 0:t.prebidPpidSolutions)||void 0===i?void 0:i.length){const t=null===(n=this.pocOverrides)||void 0===n?void 0:n.prebidPpidSolutions.find((t=>t.siteId===e)),i=null===(o=this.pocOverrides)||void 0===o?void 0:o.prebidPpidSolutions.find((e=>!e.siteId));(t||i)&&(this.adUnitConfig.prebidConfig.pbjsConfig.userSync={...this.adUnitConfig.prebidConfig.pbjsConfig.userSync,ppid:(null==t?void 0:t.prebidPpid)||(null==i?void 0:i.prebidPpid)})}return this}withRefreshOutOfFocus(e){var t,i;const n=null===(t=this.pocOverrides)||void 0===t?void 0:t.refreshOutOfFocus;if(n){const t=n[e];t&&(null===(i=this.adUnitConfig.refreshConfig)||void 0===i||i.adUnitConfig.forEach((e=>{e.refreshOutOfFocusConfig=t})))}return this}withPpidSolution(e,t=[]){var i,n,o,s,a,r,d;if(null===(i=this.pocOverrides)||void 0===i?void 0:i.ppidSolutions){const i=(null===(n=this.pocOverrides)||void 0===n?void 0:n.ppidSolutions.sites)?this.pocOverrides.ppidSolutions.sites[e]:void 0,l=null===(o=this.pocOverrides)||void 0===o?void 0:o.ppidSolutions.scope,c=null!=i?i:l;let u="";switch(null==c?void 0:c.ppidSolution){case Z.firstId:{u="first-id.fr";const e=z();if(e){const i=null!==(a=null===(s=this.adUnitConfig.prebidConfig.pbjsConfig.userSync)||void 0===s?void 0:s.userIds)&&void 0!==a?a:[];i.push({name:"pubProvidedId",bidders:ei(t,["appnexus","pubmatic","rubicon","ix","nexx360","criteo","smartadserver"]),params:{eids:[{source:u,uids:[{id:e,atype:1,ext:{stype:"ppuid"}}]}]}}),this.adUnitConfig.prebidConfig.pbjsConfig.userSync={...this.adUnitConfig.prebidConfig.pbjsConfig.userSync,userIds:i,ppid:u}}break}case Z.sharedId:u="pubcid.org",this.adUnitConfig.prebidConfig.pbjsConfig.userSync={...this.adUnitConfig.prebidConfig.pbjsConfig.userSync,ppid:u};break;case Z.utiqId:u="utiq.com",this.adUnitConfig.prebidConfig.pbjsConfig.userSync={...this.adUnitConfig.prebidConfig.pbjsConfig.userSync,ppid:u};break;case ee.id5id:{const e=localStorage.getItem("id5id");if(e){const t=(d=e,JSON.parse(decodeURIComponent(d)).gp);this.adUnitConfig.gamConfig&&t&&(this.adUnitConfig.gamConfig.ppidValue=t)}else b("id5id not found in local storage");break}default:if(null==c?void 0:c.ppidSolution){let e=localStorage.getItem(c.ppidSolution);e?this.adUnitConfig.gamConfig&&(this.adUnitConfig.gamConfig.ppidValue=e):(e=null!==(r=function(e){var t;const i=("; "+document.cookie).split("; "+e+"=");if(2===i.length)return null===(t=i.pop())||void 0===t?void 0:t.split(";").shift()}(c.ppidSolution))&&void 0!==r?r:null,e&&(this.adUnitConfig.gamConfig?this.adUnitConfig.gamConfig.ppidValue=e:b("Cannot find ppid value in local storage or cookie",null==c?void 0:c.ppidSolution)))}}}return this}withRefreshSpecificRules(){var e,t;const i=null===(e=this.pocOverrides)||void 0===e?void 0:e.refreshSpecificRules;return i&&(null===(t=this.adUnitConfig.refreshConfig)||void 0===t||t.adUnitConfig.forEach((e=>{var t;e.specificRules=[...null!==(t=e.specificRules)&&void 0!==t?t:[],...i]}))),this}withRefreshAlwaysInView(){var e,t;const i=null===(e=this.pocOverrides)||void 0===e?void 0:e.refreshAlwaysInViewAdUnitNames;if(this.adUnitConfig.refreshConfig&&i&&i.length>0){const e=[];this.adUnitConfig.refreshConfig.adUnitConfig.forEach((t=>{delete t.adUnits,i.forEach((i=>{var n;(null===(n=t.adUnitNames)||void 0===n?void 0:n.includes(i))&&(e.push({...t,alwaysInView:!0,adUnitNames:[i]}),t.adUnitNames.splice(t.adUnitNames.indexOf(i),1))}))})),this.adUnitConfig.refreshConfig.adUnitConfig=[...this.adUnitConfig.refreshConfig.adUnitConfig.filter((e=>(e.adUnitNames||[]).length>0)),...e]}else{const e=null===(t=this.pocOverrides)||void 0===t?void 0:t.refreshAlwaysInViewDivIds;if(this.adUnitConfig.refreshConfig&&e&&e.length>0){const t=[];this.adUnitConfig.refreshConfig.adUnitConfig.forEach((i=>{delete i.adUnitNames,e.forEach((e=>{var n;(null===(n=i.adUnits)||void 0===n?void 0:n.includes(e))&&(t.push({...i,alwaysInView:!0,adUnits:[e]}),i.adUnits.splice(i.adUnits.indexOf(e),1))}))})),this.adUnitConfig.refreshConfig.adUnitConfig=[...this.adUnitConfig.refreshConfig.adUnitConfig.filter((e=>(e.adUnits||[]).length>0)),...t]}}return this}withRefreshExceptions(){var e,t;const i=null===(e=this.pocOverrides)||void 0===e?void 0:e.refreshException;return i&&(null===(t=this.adUnitConfig.refreshConfig)||void 0===t||t.adUnitConfig.forEach((e=>{e.refreshException=i}))),this}withrefreshBehaviorOnEmpty(){var e,t;const i=null===(e=this.pocOverrides)||void 0===e?void 0:e.refreshBehaviorOnEmpty;return i&&(null===(t=this.adUnitConfig.refreshConfig)||void 0===t||t.adUnitConfig.forEach((e=>{e.refreshBehaviorOnEmpty=i}))),this}withStickyDivCreation(){var e;const t=null===(e=this.pocOverrides)||void 0===e?void 0:e.stickyDivCreation;return t&&this.adUnitConfig.adUnits.filter((e=>e.sticky)).forEach((e=>e.stickyDivCreation=t)),this}withStickyClosingOnSelector(){var e;const t=null===(e=this.pocOverrides)||void 0===e?void 0:e.stickyClosingOnSelector;return t&&this.adUnitConfig.adUnits.filter((e=>e.sticky)).forEach((e=>e.closingOnSelector=t)),this}withOutbrainConfig(e){var t;if(null===(t=this.pocOverrides)||void 0===t?void 0:t.outbrainConfig){const t=this.pocOverrides.outbrainConfig.find((t=>t.siteId===e)),i=this.pocOverrides.outbrainConfig.find((e=>!e.siteId)),n=t||i;n&&(this.adUnitConfig.prebidConfig.pbjsConfig.outbrain={bidderUrl:n.bidderUrl,usersyncUrl:n.usersyncUrl})}return this}withEnableXpln(){var e;return(null===(e=this.pocOverrides)||void 0===e?void 0:e.xplnEnabled)&&(this.adUnitConfig.xplnConfig={enabled:!0}),this}withFledgeForGpt(e=[]){var t,i;if(null===(t=this.pocOverrides)||void 0===t?void 0:t.fledgeForGpt){const t=ei(e,["criteo"]);this.adUnitConfig.adUnits.forEach((e=>{var i;e.bidders.find((e=>t.includes(e.bidder)))&&(e.ortb2Imp={...e.ortb2Imp,ext:{...null===(i=e.ortb2Imp)||void 0===i?void 0:i.ext,ae:1}})})),this.adUnitConfig.prebidConfig.pbjsConfig.bidderConfigs||(this.adUnitConfig.prebidConfig.pbjsConfig.bidderConfigs=[]);const n=this.adUnitConfig.prebidConfig.pbjsConfig.bidderConfigs.find((e=>Array.isArray(e.bidders)&&e.bidders.find((e=>t.includes(e)))));n&&n.config?n.config.fledgeEnabled=!0:null===(i=this.adUnitConfig.prebidConfig.pbjsConfig.bidderConfigs)||void 0===i||i.push({bidders:[...t],config:{fledgeEnabled:!0}}),this.adUnitConfig.prebidConfig.pbjsConfig={...this.adUnitConfig.prebidConfig.pbjsConfig,fledgeForGpt:!0}}return this}withSkinFloor(e){var t,i,n;const o=null===(t=this.pocOverrides)||void 0===t?void 0:t.skinFloor;if(o){const t=null!==(n=null===(i=o.specificFloor)||void 0===i?void 0:i[e])&&void 0!==n?n:o.defaultFloor;this.adUnitConfig.adUnits.forEach((e=>{var i;if(e.sizes.some((e=>Ve(e,[1800,1e3]))))if(e.floors){const n=null===(i=e.floors)||void 0===i?void 0:i.values.banner;n?e.floors={...e.floors,schema:{delimiter:"|",fields:["mediaType","size"]},values:{"banner|*":n,"banner|1800x1000":t}}:w("no banner value found in floors, skin floor cannot be applied.",e.floors)}else e.floors={currency:o.currency,schema:{delimiter:"|",fields:["mediaType","size"]},values:{"banner|1800x1000":t}}}))}return this}withWebComponentAdUnits(e){var t,i,n,o,s;const a=[...(null===(i=null===(t=this.pocOverrides)||void 0===t?void 0:t.webComponentAdUnits)||void 0===i?void 0:i.scopeLevel)||[],...(null===(s=null===(o=null===(n=this.pocOverrides)||void 0===n?void 0:n.webComponentAdUnits)||void 0===o?void 0:o.siteLevel)||void 0===s?void 0:s[e])||[]];return a.length>0&&this.adUnitConfig.adUnits.forEach((e=>{a.includes(e.adUnitName)&&(e.webComponentAdunit=!0)})),this}withDsaConfig(){var e,t;return(null===(e=this.pocOverrides)||void 0===e?void 0:e.dsaConfig)&&(this.adUnitConfig.prebidConfig.pbjsConfig={...this.adUnitConfig.prebidConfig.pbjsConfig,dsaConfig:null===(t=this.pocOverrides)||void 0===t?void 0:t.dsaConfig}),this}withPrebidServerConfig(e){var t;return(null===(t=this.pocOverrides)||void 0===t?void 0:t.prebidServer)&&this.pocOverrides.prebidServer.siteIds.includes(e)&&(M(this.pocOverrides.prebidServer.ratio)?(this.adUnitConfig.prebidConfig.pbjsConfig={...this.adUnitConfig.prebidConfig.pbjsConfig,s2sConfig:{...this.pocOverrides.prebidServer.s2sConfig}},N("rule2")):N("rule1")),this}withDisableGPTSetCentering(e){var t,i,n,o,s;return((null===(i=null===(t=this.pocOverrides)||void 0===t?void 0:t.disableGPTSetCentering)||void 0===i?void 0:i.scope)||(null===(s=null===(o=null===(n=this.pocOverrides)||void 0===n?void 0:n.disableGPTSetCentering)||void 0===o?void 0:o.sites)||void 0===s?void 0:s[e]))&&(rt.getInstance().disableGPTSetCentering=!0),this}build(){return this.adUnitConfig}}function ii(e,t,i,n){return new ti(e,t.pocOverrides||{}).withInstreamAdUnits().withConvertToInstreamAdUnit().withFirstId(t.pbjsConfig.bidderAliases).withDisableHeaderBidder(i).withSkinRenderingSettings(t.tagId,n.stackId).withReworldAbcdefTest().withPrebidPpidSolution(t.tagId).withRefreshSpecificRules().withRefreshAlwaysInView().withRefreshExceptions().withrefreshBehaviorOnEmpty().withRefreshOutOfFocus(t.tagId).withStickyDivCreation().withStickyClosingOnSelector().withEnableXpln().withOutbrainConfig(t.tagId).withFledgeForGpt(t.pbjsConfig.bidderAliases).withSkinFloor(t.tagId).withWebComponentAdUnits(t.tagId).withDsaConfig().withPrebidServerConfig(t.tagId).withPpidSolution(t.tagId,t.pbjsConfig.bidderAliases).withConvertToInterstitialAdUnit().withDisableGPTSetCentering(t.tagId).build()}const ni=e=>!!e.priority&&!!e.conditions,oi=e=>!e.priority&&!e.conditions,si=e=>"elements"in e,ai={AND:({elements:e},t)=>e.every((e=>di(e,t))),OR:({elements:e},t)=>e.some((e=>di(e,t)))},ri={IN:({key:e,values:t},i)=>t.some((t=>t===i.get(e))),NOT_IN:({key:e,values:t},i)=>!t.some((t=>t===i.get(e)))};function di(e,t){return si(e)?ai[e.op](e,t):ri[e.op](e,t)}const li={pbjsFinished:!1,apsFinished:!1},ci="[executor] [buffered]";var ui;!function(e){e[e.FirstCall=0]="FirstCall",e[e.Refresh=1]="Refresh"}(ui||(ui={}));class fi{constructor(e,t,i,n,o,s){this.buffer=[],this.auctionRunning=!1,this.adUnitAuctionStatus=new Map,this.adServer=e,this.pbjs=t,this.aps=i,this.logPrefix=`${ci}${s?` [${s}]`:""}`,this.bidderAliases=n,this.kleanadsRunCount=o}executeAdCall(e){if(0===e.length)return;setTimeout((()=>{e.forEach((e=>Ue(e.divId,"executorTimeout")))}),2e4);const t=e.filter((e=>!this.adUnitAuctionStatus.has(e.divId))).sort(((e,t)=>O(e.divId)-O(t.divId)));this.logAlreadyMonetizedAdUnits(e,t),b(`${this.logPrefix} buffering adunits`,e),t.forEach((e=>{this.bufferAdUnits({adUnits:[e],origin:ui.FirstCall})}))}executeAdCallRoadblock(e){if(0===e.length)return;setTimeout((()=>{e.forEach((e=>Ue(e.divId,"executorTimeout")))}),2e4);const t=e.filter((e=>!this.adUnitAuctionStatus.has(e.divId))).sort(F);this.logAlreadyMonetizedAdUnits(e,t),b(`${this.logPrefix} buffering adunits`,e),this.bufferAdUnits({adUnits:t,origin:ui.FirstCall})}bufferAdUnits(e){var t;switch(this.buffer.push(e),e.origin){case ui.FirstCall:null===(t=e.adUnits)||void 0===t||t.forEach((e=>{this.adUnitAuctionStatus.set(e.divId,li)}));break;case ui.Refresh:this.adUnitAuctionStatus.set(e.refreshableAdUnit.adUnit.divId,li);break;default:w(`${this.logPrefix} unknown buffer entry origin`)}this.startAuctionForBufferedAdUnits()}executeRefresh(e){this.bufferAdUnits({refreshableAdUnit:e,origin:ui.Refresh})}startAuctionForBufferedAdUnits(){if(this.auctionRunning)return void b(`${this.logPrefix} auction already running, not starting a new one`);b(`${this.logPrefix} looking at buffer with ${this.buffer.length} entries`);const e=this.buffer.shift();if(b(`${this.logPrefix} adunits taken from buffer`,e),e)switch(e.origin){case ui.FirstCall:this.startAuction(e.adUnits);break;case ui.Refresh:this.startAuction([e.refreshableAdUnit.adUnit],{labels:["pubstackRefresh",`pubstackRefreshRank:${e.refreshableAdUnit.rank}`]});break;default:w(`${this.logPrefix} unknown buffer entry origin`)}else b(`${this.logPrefix} no more adunit to monetize in buffer`)}startAuction(e,t){if(this.auctionRunning=!0,e.forEach((e=>{he(e.divId,ce.START_AUCTION)})),b(`${this.logPrefix} starting auctions for ${e.map((e=>e.divId))}`),this.pbjs){const i=this.pbjs.getPbjs();this.pbjs.startPbjsAuction(e,(()=>{this.kleanadsRunCount===bi?this.pbjsFinished(i,e):b(`${ci} kleanads run count has changed (from ${this.kleanadsRunCount} to ${bi}), avoid calling pbjsFinished`)}),this.bidderAliases,t)}this.aps&&this.aps.startApsAuction(e,((t,i)=>{this.kleanadsRunCount===bi?this.apsFinished(t,e,i):b(`${ci} kleanads run count has changed (from ${this.kleanadsRunCount} to ${bi}), avoid calling apsFinished`)})),this.pbjs||this.aps||this.adServer.executeWhenAdServerReady((()=>{this.kleanadsRunCount===bi?this.callAdServer(e):b(`${ci} kleanads run count has changed (from ${this.kleanadsRunCount} to ${bi}), avoid calling AdServer`)}))}isAlreadyMonetized(e){return this.adUnitAuctionStatus.has(e.divId)}logAlreadyMonetizedAdUnits(e,t){if(e.length!==t.length){const t=e.filter((e=>this.adUnitAuctionStatus.has(e.divId)));C(`${this.logPrefix} cannot make a new ad call, existing one on ${t.map((e=>e.divId)).join(",")}.`)}}pbjsFinished(e,t){b(`${this.logPrefix} pbjs end callback for ${t.map((e=>e.divId)).join(",")}`,e.getAllPrebidWinningBids()),t.forEach((e=>{he(e.divId,ce.END_PBJS_AUCTION),Oe(e.divId)})),this.adServer.executeWhenAdServerReady((()=>{b(`${this.logPrefix} pbjs end callback ad server ready ${t.map((e=>e.divId)).join(",")}`),this.adServer.setPbjsTargetings(e,t),t.forEach((e=>{const t=this.adUnitAuctionStatus.get(e.divId);t&&this.adUnitAuctionStatus.set(e.divId,{...t,pbjsFinished:!0})})),this.canCallAdServer(t)&&this.callAdServer(t)}))}apsFinished(e,t,i){b(`${this.logPrefix} aps end callback ${t.map((e=>e.divId)).join(",")}`,i),t.forEach((e=>he(e.divId,ce.END_APS_AUCTION))),this.adServer.executeWhenAdServerReady((()=>{b(`${this.logPrefix} aps end callback ad server ready ${t.map((e=>e.divId)).join(",")}`),this.adServer.setApsTargetings(e,t,i),t.forEach((e=>{const t=this.adUnitAuctionStatus.get(e.divId);t&&this.adUnitAuctionStatus.set(e.divId,{...t,apsFinished:!0})})),this.canCallAdServer(t)&&this.callAdServer(t)}))}canCallAdServer(e){const t=e.filter((e=>{const t=this.adUnitAuctionStatus.get(e.divId);return this.aps&&!this.pbjs?t&&t.apsFinished:this.pbjs&&!this.aps?t&&t.pbjsFinished:this.pbjs&&this.aps?t&&t.apsFinished&&t.pbjsFinished:void 0}));return t.length>0&&t.length!==e.length&&w(`${this.logPrefix} cannot call ad server for ${e.map((e=>e.divId)).join(",")}, some ad units are not ready`),t.length>0}callAdServer(e){if(this.auctionRunning=!1,this.startAuctionForBufferedAdUnits(),e.forEach((e=>{he(e.divId,ce.START_AD_SERVER_CALL)})),e.length>0){this.adServer.callAdServer(e);const t=e.map((e=>e.divId));b(`${this.logPrefix} ad server called ${t.join(",")}`)}}}class gi{constructor(e,t,i,n){this.adUnitConfig=e,this.device=t,this.kleanAdsConfig=i,this.pageContext=n,this.adUnits=[],this.callbacks=[]}alreadyUsedDivIds(){return this.adUnits.map((e=>e.divId))}setConfig(e,t,i,n){this.adUnitConfig=e,this.device=t,this.kleanAdsConfig=i,this.pageContext=n,this.adUnits=[],this.callbacks=[]}async executeWhenAdUnitsFound(e){const t=(i=this.adUnitConfig,this.device,n=this.kleanAdsConfig,o=this.pageContext,pi(i.adUnits,i,0,n,o)).filter((e=>!this.alreadyUsedDivIds().includes(e.divId)));var i,n,o;if(this.adUnits.push(...t),await e(this.adUnits),this.callbacks.push(e),!this.adUnitObserver){const e=async e=>{const t=function(e,t,i,n,o){return pi([e],t,0,n,o)}(e,this.adUnitConfig,this.device,this.kleanAdsConfig,this.pageContext).filter((e=>!this.alreadyUsedDivIds().includes(e.divId))).reduce(((e,t)=>(e.find((e=>e.divId===t.divId))?w(`We tried to prepare two times the same divId, skipping adUnit ${t.adServerAdUnitName} from the list`,t):(e.push(t),y("New adUnit dynamicaly loaded",t.divId)),e)),[]);t.length>0&&(this.adUnits.push(...t),this.callbacks.forEach((async e=>{await e(t)})))};this.startAdUnitObserver(e)}}cleanObserverAndAdUnits(){var e;null===(e=this.adUnitObserver)||void 0===e||e.disconnect(),this.adUnitObserver=void 0,this.adUnits=[]}startAdUnitObserver(e){const t=this.alreadyUsedDivIds(),i=this.adUnitConfig.adUnits.filter((e=>!t.includes(e.divId)||e.dynamic)),n=document.body,o=new MutationObserver(function(e,t){return(i,n)=>{i.filter((e=>"childList"===e.type&&e.addedNodes.length>0)).forEach((i=>{Array.from(i.addedNodes).filter((e=>e.nodeType===Node.ELEMENT_NODE)).forEach((i=>{e.forEach((e=>{const n=e.divId.startsWith("css:")?e.divId.replace("css:",""):e.dynamic?`[id^="${e.divId}"]`:`[id="${e.divId}"]`;(i.matches(n)||i.querySelectorAll(n).length>0)&&t(e)}))}))}))}}(i,e));o.observe(n,{childList:!0,subtree:!0}),this.adUnitObserver=o}}function pi(e,t,i,n,o){var s,a;const r=null!==(a=null===(s=null==t?void 0:t.gamConfig)||void 0===s?void 0:s.adUnitPathConfig)&&void 0!==a?a:[];return Y(e,o,function(e,t){var i,n,o,s,a;const r=null!==(n=null===(i=null==t?void 0:t.gamConfig)||void 0===i?void 0:i.networkId)&&void 0!==n?n:e.networkId,d=(null===(o=null==t?void 0:t.gamConfig)||void 0===o?void 0:o.mcmIds)&&(null===(s=null==t?void 0:t.gamConfig)||void 0===s?void 0:s.mcmIds.length)>0?null===(a=null==t?void 0:t.gamConfig)||void 0===a?void 0:a.mcmIds:e.mcmIds;return r?d?[r,...d].join(","):r:""}(n,t),r,n.pubstackDeclarationTargetingKeys)}let hi=(()=>{let e,t,i=[Tt("onAdUnitConfigLoad")],n=[];return t=class{constructor(){this.name="AdUnitsManager"}get adUnitsManager(){return this._adUnitsManager}isLoaded(){return!!this._adUnitsManager}async load({config:e,adUnitConfig:t}){this._adUnitsManager=new gi(t,e.device,e,e.pageContext)}async onAdUnitConfigLoad({config:e,adUnitConfig:t}){var i;null===(i=this._adUnitsManager)||void 0===i||i.setConfig(t,e.device,e,e.pageContext)}async clean(){var e;null===(e=this._adUnitsManager)||void 0===e||e.cleanObserverAndAdUnits()}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"AdUnitsManagerModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;o=t.size)return t.device;return"desktop"}(c.innerWidth,e.screenSizeBreakpoints);rt.getInstance().setUprState(null===(s=e.pocOverrides)||void 0===s?void 0:s.uprState,null===(a=e.pocOverrides)||void 0===a?void 0:a.uprRatio);const S=function(e,t){const i=je(t),n=new Map(i.map((({key:e,defaultValue:t})=>[e,t])));e.document.querySelectorAll('meta[name^="pbstck_context:"]').forEach((e=>{var t,o;const s=null===(t=e.attributes.getNamedItem("name"))||void 0===t?void 0:t.value.substring(15).toLowerCase(),a=null===(o=e.attributes.getNamedItem("content"))||void 0===o?void 0:o.value.toLowerCase();if(s&&a){const e=i.find((({key:e})=>e===s));e&&(function(e,t){var i;return t.defaultValue===e||(null!==(i=t.otherValues)&&void 0!==i?i:[]).includes(e)}(a,e)?(n.set(s,a),b(`[context] found context ${s} with content ${a}`)):C(`[context] Unknown ${s} value ${a}`))}}));const o=new URLSearchParams(e.location.search);for(const e of o.keys())e.startsWith("pbstck_context:")&&(b(`[context] Add key ${e} found in URL to context`),n.set(e.slice(15),o.get(e)||""));return n}(c,e.context);0===S.size?b("[context] No context set"):(b("[context] The following context will be used:"),S.forEach(((e,t)=>{b(`[context] ${t} => ${e}`)})));const A=function(e,t){const i=e.filter(ni).sort(((e,t)=>e.priority-t.priority)),n=e.filter(oi);0===n.length&&w("[stacks] Could not find default stack"),n.length>1&&w("[stacks] Multiple default stacks found");const o=n[0],s=i.find((e=>di(e.conditions,t))),a=null!=s?s:o;return a?b(`[stacks] served stack: ${a.stackId} ${a===o?"(default stack)":""}`,a):w("[stacks] No stack to serve"),a}(e.stacks,S);if(!A)return void w("No stack found, stopping monetization");const k=wi(A.versions).toString(),E={...e,device:y,stack:A,stackVersion:k,pageContext:S,enableConsentless:null!==(d=null===(r=e.pocOverrides)||void 0===r?void 0:r.enableConsentless)&&void 0!==d&&d,noCmp:I(),spaMode:Qt(e),pubstackWindow:c,instreamType:Zt(e.tagId,null===(l=e.pocOverrides)||void 0===l?void 0:l.instreamConfig)},$=new Dt(E,t);switch(await $.loadInitialModules(),E.spaMode){case"manual":b("[SPA] manual SPA enabled"),ki((()=>{b("[SPA] manual page change requested, restarting kleanads.js"),Si(e,$)}));break;case"auto":b("[SPA] auto SPA enabled"),n(i.REPLACE_STATE),n(i.PUSH_STATE),Ai((()=>{b("[SPA] page change detected, restarting kleanads.js"),Si(e,$)}))}return m=k,{configPromise:de(e,y,A,k).then((t=>t&&e.pocOverrides?ii(t,e,S,A):t)),kleanAdsConfig:E,moduleService:$}}async function Ci(e){var t,i,n,o,s,a,r,d,l;const{configPromise:c,kleanAdsConfig:{device:u,pageContext:f,...g},moduleService:p}=e;b("StartKleanAds");const h=g.noCmp||await Pe(window);Ie!==Ee.UNKNOWN&&ke("[metric] cmpResponseAvailable",{cmpResponseAvailable:ve(le.CMP_RESPONSE_AVAILABLE),fromBeginCmpResponseAvailable:me(le.BEGIN,le.CMP_RESPONSE_AVAILABLE),consentType:Ie}),await p.modulesDispatchEvent("onAfterConsent"),await x(g,{beforeStart:!1});const v=g.stacks.find((e=>e.stackId===function(e){var t,i;return null===(i=null===(t=e.pocOverrides)||void 0===t?void 0:t.consentlessStacks)||void 0===i?void 0:i[e.tagId]}(g)));if(b("Consentless stack is the following",v),h?await p.modulesDispatchEvent("onAfterConsentAccepted"):(await p.modulesDispatchEvent("onAfterConsentRefused"),b("Consent refused"),v&&(g.stack=v,g.stackVersion=wi(v.versions).toString(),b("Consent not given, using override consentless stack: ",v.stackId))),k("adm_stack",`${g.stack.stackId}_v${g.stackVersion}`),h||g.enableConsentless||v){await p.modulesDispatchEvent("onBeforeAdUnitConfigLoad");const e=h?c:function(e,t,i,n,o){return de(e,t,i,n).then((t=>t&&e.pocOverrides?ii(t,e,o,i):t))}(g,u,g.stack,g.stackVersion,f),v=await e;if(b("[config] kleanAdsConfig :",g),b("[config] adUnitConfig :",v),v){if(g.pocOverrides&&g.pocOverrides.grapeshotTargetings){b("[pocOverrides] Poc Grapeshot enabled");const e=await async function(e){return new Promise((t=>{const i=`${e}${encodeURIComponent(window.location.href)}`,n=document.createElement("script");n.async=!0,n.src=i,n.onload=()=>t(window.gs_channels),setTimeout((()=>t(void 0)),3e3),n.onerror=()=>t(void 0),document.head.append(n)}))}(g.pocOverrides.grapeshotTargetings);rt.getInstance().grapeshotValues=e}await p.modulesDispatchEvent("onAdUnitConfigLoad",{adUnitConfig:v}),(null===(t=g.pocOverrides)||void 0===t?void 0:t.waitForDOMLoaded)?await T():rt.getInstance().uprTested||(M(50)?(b("[AB Test (50%)] waitForDOMLoaded"),N("1"),await T()):(b("[AB Test (50%)] no waitForDOMLoaded"),N("2")));const e=null===(i=p.getLoadedModuleInstance(Jt))||void 0===i?void 0:i.pbjs;e&&await p.modulesDispatchEvent("onAfterPrebidReady",{prebid:e});const c=null===(n=p.getLoadedModuleInstance(Lt))||void 0===n?void 0:n.aps,h=null===(o=p.getLoadedModuleInstance(Ut))||void 0===o?void 0:o.adServer,A=null===(s=p.getLoadedModuleInstance(hi))||void 0===s?void 0:s.adUnitsManager;if(!h)return void w("no adServer found, stopping monetization");if(!A)return void w("no adUnitManager found, stopping monetization");m=window,y=g.context,S=null!==(r=null===(a=v.gamConfig)||void 0===a?void 0:a.adUnitPathConfig)&&void 0!==r?r:[],function(e,t,i){const n=[],o=je(t).filter((e=>void 0!==e.defaultValue)).map((e=>e.key.toLowerCase())),s=[];e.document.querySelectorAll('meta[name^="pbstck_context:"]').forEach((e=>{var t;const i=null===(t=e.attributes.getNamedItem("name"))||void 0===t?void 0:t.value.substring(15).toLowerCase();i&&s.push(i)}));for(const e of i)o.includes(e)&&!s.includes(e)&&n.push(e);return n}(m,y,S).forEach((e=>{C(`[context] Missing ${e} context key used in adunit path`)}));const k=new fi(h,e,c,null!==(d=g.pbjsConfig.bidderAliases)&&void 0!==d?d:[],bi),E=v.adUnits.some((e=>e.isInstream))?new Ne(new Et(window,f,u,g.instreamType),e,c,null!==(l=g.pbjsConfig.bidderAliases)&&void 0!==l?l:[],bi):void 0,I=async e=>{b("[config] adUnits to monetize:",e);const t=await p.modulesDispatchEvent("onPrepareAdUnits",{toPreparedAdUnits:e});Promise.all(t).then((()=>{b("[config] adUnits prepared"),p.modulesDispatchEvent("onAfterPrepareAdUnits",{preparedAdUnits:e})})),function(e,t,i,n){const o=e.filter((e=>e.roadblock)).filter((e=>!e.isInstream)).filter((e=>U(e.divId))),s=e.filter((e=>!e.roadblock)).filter((e=>!e.isInstream)).filter((e=>U(e.divId))),a=e.filter((e=>e.isInstream)).filter((e=>U(e.divId)));t.executeAdCallRoadblock(o),a.length>0&&(a.length>1&&C(`cannot monetize multiple instream adunits, using only the first one ${a[0].divId}`),null==i||i.executeAdCall(a[0]));const r=function(e){if(e&&e.lazyLoadingKleanads){const t=e.lazyLoadingKleanads.viewportPercent/100;return b(`[lazyloading] lazy loading enabled with ${t} viewports`),(e,i)=>qt(e,i,t)}}(n);if(r){const e=new Kt(window,r);o.length>0?setTimeout((()=>Yt(s,e,t)),1e3):Yt(s,e,t)}else o.length>0?setTimeout((()=>t.executeAdCall(s)),1e3):t.executeAdCall(s)}(e,k,E,v.lazyLoading)};await A.executeWhenAdUnitsFound(I);const $=v.refreshConfig,O=g.globalRefreshConfig;O&&$&&_(`${O.refreshModuleBaseUrl}/${g.kleanadsVersion}/kleanads-refresh.mjs`,3).then((async e=>{const t=g.networkId&&O.hasExclusions?await Ei(g.configUrl,g.networkId,g.stack.scopeId):mi;e.initRefresh(A,k,$.adUnitConfig,t,h,g.pbjsConfig.bidderAliases)})).catch((e=>{w("Failed to load refresh module after 3 retries",e)}))}else w("no input configuration, stopping monetization")}else b("consent not given, no monetization");var m,y,S;pe(le.MAIN_THREAD_END)}function wi(e){const t=e.sort(((e,t)=>e.ratio-t.ratio));return M(void 0!==t[0].ratio?t[0].ratio:100)?t[0].version:t[1].version}const Si=async(e,t)=>{bi+=1,b("Unloading Kleanads, run cleanup on all modules");const i=t.getModules();await t.modulesCleanUp(),b("Kleanads unloaded, restarting");const n=await yi(e,i,!0);n&&Ci(n)},Ai=t=>{const i=new MutationObserver((()=>{o()})),n=e=>{const t=e,n=new URL(t.detail.referrer),o=(s=t.detail.url)?`${s}`.startsWith("http")?new URL(s).pathname:`${s}`:"";var s;n.pathname!==o&&i.observe(document.head,{attributes:!0,childList:!0,subtree:!0})};window.addEventListener(e.HISTORY_MUTATION,n);const o=()=>{window.removeEventListener(e.HISTORY_MUTATION,n),i.disconnect(),window.dispatchEvent(new CustomEvent(e.PAGE_CHANGE)),t()}},ki=i=>{const n=()=>{o()};window.addEventListener(t.SPA_RELOAD,n);const o=()=>{window.removeEventListener(t.SPA_RELOAD,n),window.dispatchEvent(new CustomEvent(e.PAGE_CHANGE)),i()}},Ei=async(e,t,i)=>await fetch(`${e}/refresh-exclusions/${t}/${i}/currentExclusions.json`).then((async e=>e.json().then((e=>e)).catch((e=>{w(`unable to extract line items with no refresh: ${e}`)})))).catch((e=>w(`unable to get line items with no refresh: ${e}`)));let Ii=(()=>{let e,t,i=[Tt("onAfterConsent")],n=[];return t=class{constructor(){this.name="Collector",this._isLoaded=!1,this._scriptAdded=!1}isLoaded(){return this._isLoaded}async load(){this._isLoaded=!0}async onAfterConsent({config:e}){this._scriptAdded||(setTimeout((()=>{b("Downloading pubstack collector"),P(`https://boot.pbstck.com/v1/tag/${e.tagId}`)}),200),this._scriptAdded=!0)}async clean(){}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"CollectorModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;o{let e,t,i=[Tt("onAdUnitConfigLoad")],n=[];return t=class{constructor(){this.name="SkinRendering",this._isLoaded=!1,this.eligibleForSkinRendering=!1}isLoaded(){return this._isLoaded}async load({config:e,adUnitConfig:t}){var i,n,o,s,a,r,d,l,c,u;this.eligibleForSkinRendering=function(e,t){var i,n,o,s,a,r,d,l,c;return!!(null===(s=null===(o=null===(n=null===(i=e.pocOverrides)||void 0===i?void 0:i.skinRenderingSettings)||void 0===n?void 0:n.siteLevel)||void 0===o?void 0:o[e.tagId])||void 0===s?void 0:s.enabledSkinRenderAdaptation)&&!(null===(l=null===(d=null===(r=null===(a=e.pocOverrides)||void 0===a?void 0:a.skinRenderingSettings)||void 0===r?void 0:r.stackLevel)||void 0===d?void 0:d[e.stack.stackId])||void 0===l?void 0:l.disableSkinRenderAdaptation)&&(null===(c=t.adUnits)||void 0===c?void 0:c.some((e=>e.sizes.some((e=>Ve(e,[1800,1e3]))))))}(e,t);const{maxHeaderHeightPx:f,marginTopPx:g,siteContentWidthPx:p,additionalSkinRenderingCss:h}=null!==(u=null!==(a=null===(s=null===(o=null===(n=null===(i=e.pocOverrides)||void 0===i?void 0:i.skinRenderingSettings)||void 0===n?void 0:n.stackLevel)||void 0===o?void 0:o[e.stack.stackId])||void 0===s?void 0:s.style)&&void 0!==a?a:null===(c=null===(l=null===(d=null===(r=e.pocOverrides)||void 0===r?void 0:r.skinRenderingSettings)||void 0===d?void 0:d.siteLevel)||void 0===l?void 0:l[e.tagId])||void 0===c?void 0:c.style)&&void 0!==u?u:{};this.configuredMaxHeaderHeightPx=f,this.configuredMarginTopPx=g,this.configuredSiteContentWidthPx=p,this.configuredAdditionalSkinRenderingCss=h,this.eligibleForSkinRendering&&(this._isLoaded=!0)}async onAfterPrebidReady({prebid:e}){this.pbjs=e,this.eligibleForSkinRendering&&this.pbjs.getPbjs().onEvent("bidWon",this.applySkinRendering.bind(this))}async clean(){this.eligibleForSkinRendering&&this.pbjs&&this.pbjs.getPbjs().offEvent("bidWon",this.applySkinRendering.bind(this)),this._isLoaded=!1}shouldApplySkinRendering(e){var t;const i=["sublime","justpremium","gumgum"],n=null===(t=this.pbjs)||void 0===t?void 0:t.getPbjs();if(n){const t=i.some((t=>e.bidderCode===t||n.aliasRegistry[e.bidderCode]===t));return"1800x1000"===e.size&&!t}return u("kleanads-refresh","shouldApplySkinRendering: unable to get aliasRegistry: prebid is not defined"),!1}applySkinRendering(e){var t,i,n,o;const s="pbstck_skin_rendering",a=document.getElementById(e.adUnitCode);if(a)if(this.shouldApplySkinRendering(e)){const r=null!==(t=this.configuredMaxHeaderHeightPx)&&void 0!==t?t:250,d=null!==(i=this.configuredMarginTopPx)&&void 0!==i?i:0,l=null!==(n=this.configuredSiteContentWidthPx)&&void 0!==n?n:1e3,c=null!==(o=this.configuredAdditionalSkinRenderingCss)&&void 0!==o?o:"",u=1e3,f=(1800-l)/2,g=f+l,p=document.createElement("style");p.textContent=`\n #${e.adUnitCode}.${s} {\n /* leave security margin to help display top of creative */\n height: ${r}px;\n /* set it properly in page flow */\n display: block;\n margin-top: ${d}px;\n }\n\n #${e.adUnitCode}.${s} > div {\n /* horizontally center creative */\n transform: translateX(-50%);\n position: absolute;\n left: 50%;\n\n /* clipping out the unused part of the creative to leave content visible */\n clip-path: polygon(0 0, 0% 100%, ${f}px ${u}px, ${f}px ${r}px, ${g}px ${r}px, ${g}px 100%, 100% 100%, 100% 0%);\n }\n\n ${c}\n `,document.head.appendChild(p),a.classList.add(s)}else a.classList.contains(s)&&e.labels.includes("pubstackRefresh")&&a.classList.remove(s);else C(`onBidwon: skinRendering impossible - adUnitDiv not found for ${e.adUnitCode}`)}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"SkinRenderingModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;o{let e,t,i=[Tt("onAdUnitConfigLoad")],n=[];return t=class{constructor(){this.name="CssClass",this._isLoaded=!1}async load({config:e}){this.pubstackWindow=e.pubstackWindow,Ct((()=>{var e;null===(e=this.pubstackWindow)||void 0===e||e.googletag.pubads().addEventListener("slotRenderEnded",this.applyClassBySlotRenderEndedEvent)})),this._isLoaded=!0}async onAfterPrebidReady({prebid:e}){e.getPbjs().onEvent("bidWon",this.applyClassByBidWon)}async applyClassBySlotRenderEndedEvent(e){var t;const i=e.slot.getSlotElementId(),n=document.getElementById(i);n&&(e.isEmpty?(n.classList.replace(Ui,Ti),b(`[CSS Class] slot empty: ${i}`)):(n.classList.replace(Ui,Oi),n.classList.replace(Ti,Oi),(null===(t=e.size)||void 0===t?void 0:t.length)&&1800===e.size[0]&&1e3===e.size[1]?(n.classList.add(xi),n.setAttribute(Pi,"gam"),b(`[CSS Class] slot rendered is skin: ${i}`)):(n.classList.remove(xi),n.removeAttribute(Pi)),b(`[CSS Class] slot rendered: ${i}`)))}applyClassByBidWon(e){const t=document.getElementById(e.adUnitCode);"1800x1000"===e.size&&(null==t||t.classList.add(xi),null==t||t.setAttribute(Pi,"prebid"),_i.includes(e.bidderCode)||null==t||t.classList.add("adm-ad-skin-resizable"),b(`[CSS Class] bidWon is skin: ${e.adUnitCode}`))}async onPrepareAdUnits({toPreparedAdUnits:e}){e&&e.forEach((e=>{const t=document.getElementById(e.divId);t&&t.classList.add(Ui)}))}isLoaded(){return this._isLoaded}clean(){return this._isLoaded=!1,Promise.resolve(void 0)}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"CssClassModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;o
',"text/xml").getElementById("adunit-component-template");this.shadowRoot.innerHTML=e.innerHTML}}function Ni(e){if(e.webComponentAdunit){const t=e.divId,i=document.getElementById(t);if(i){const e=document.createElement("adm-adunit");i.getAttributeNames().forEach((t=>{e.setAttribute(t,i.getAttribute(t)||""),i.removeAttribute(t)})),i.id=`adm-adunit-${t}`,i.appendChild(e),document.head.insertAdjacentHTML("beforeend","")}}}const Di="[parallax]";class Mi extends HTMLElement{static get observedAttributes(){return["height"]}constructor(){super(),this.attachShadow({mode:"open"}),this.mutationObserver=new MutationObserver((()=>{this.mutationDebounceTimeout&&clearTimeout(this.mutationDebounceTimeout),this.mutationDebounceTimeout=setTimeout((()=>{this.mutationDebounceTimeout=void 0,this.updateShadowLayout()}),Mi.MUTATION_DEBOUNCE_TIMEOUT_VALUE_MS)}));const e=window.kleanadsPbjs;if(e)try{e.onEvent("auctionEnd",(e=>{var t;(null===(t=e.adUnitCodes)||void 0===t?void 0:t.includes(this.id))&&(this.latestBidWon=void 0)})),e.onEvent("bidWon",(e=>{e.adUnitCode===this.id&&(this.latestBidWon=e)}))}catch(e){C(`${Di} unable to listen to bidWon event`,e)}else C(`${Di} pbjs not loaded, unable to listen to bidWon event`)}get height(){var e,t;return parseInt(null!==(e=this.getAttribute("height"))&&void 0!==e?e:"0")||parseInt(null!==(t=this.style.height)&&void 0!==t?t:"0")||Mi.defaultParallaxHeight}connectedCallback(){this.isConnected&&(this.setAttribute(Mi.DATA_PBSTCK_COMPONENT_ATTR_NAME,Mi.DATA_PBSTCK_COMPONENT_ATTR_VALUE.NO_AD),this.setShadowDom("
"),this.updateShadowLayout(),this.mutationObserver.observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){this.mutationObserver.disconnect()}attributeChangedCallback(){this.updateShadowLayout()}getHighestChild(){const e=Array.from(this.children);if(0!==e.length)return Bi(e)}setPosition(){const e=this.getBoundingClientRect(),t=this.getHighestChild();if(e&&t&&this.parallaxStyleSheet){const i=(e.top-Mi.defaultMarges)/(window.innerHeight-2*Mi.defaultMarges-e.height)*100,n=`*[${Mi.DATA_PBSTCK_COMPONENT_ATTR_NAME}="${Mi.DATA_PBSTCK_COMPONENT_ATTR_VALUE.PARALLAX}"] #${CSS.escape(t.id)}`;this.parallaxStyleSheet.innerHTML=i<0?`${n} {transform: translate3d(0, 0, 0)}`:i>100?`${n} {transform: translate3d(0, ${e.height-t.offsetHeight}px, 0)}`:`${n} {transform: translate3d(0, ${(e.height-t.offsetHeight)*i/100}px, 0)}`}}setShadowDom(e){if(!this.shadowRoot)return;this.shadowRoot.innerHTML=e;const t=new CSSStyleSheet;t.insertRule(`:host { display:block; min-width: 300px; max-width: 100%; min-height: ${this.height}px; max-height: ${this.height}px; overflow: hidden; position: relative; margin: 0 auto; }`),t.insertRule(`.parallax { width: 100%; height: ${this.offsetHeight}px; margin: 0 auto; padding: 0; position: relative; overflow: hidden; }`),t.insertRule(`.banner { width : 100%; min-height :${this.offsetHeight}px; max-height :${this.offsetHeight}px; display : flex; margin : 0 auto; justify-content : center; align-items:center;}`),t.insertRule(".parallax .clip { min-height: 100%; clip-path: inset(0px); }"),this.shadowRoot.adoptedStyleSheets=[t]}setLayoutBanner(){var e;null===(e=this.parallaxStyleSheet)||void 0===e||e.remove(),this.parallaxStyleSheet=void 0;const t=document.createElement("div");t.className="banner";const i=document.createElement("div"),n=document.createElement("slot");i.append(n),t.append(i),this.setAttribute(Mi.DATA_PBSTCK_COMPONENT_ATTR_NAME,Mi.DATA_PBSTCK_COMPONENT_ATTR_VALUE.BANNER),this.setShadowDom(t.outerHTML),this.onScrollHandler&&(document.removeEventListener("scroll",this.onScrollHandler),this.onScrollHandler=void 0)}setLayoutParallax(){if(!this.shadowRoot)return;if(!this.parallaxStyleSheet){const e=document.createElement("style");e.setAttribute("type","text/css"),document.head.appendChild(e),this.parallaxStyleSheet=e}const e=document.createElement("div");e.className="parallax";const t=document.createElement("div");t.className="clip";const i=document.createElement("slot"),n=document.createElement("div");n.append(i),t.append(n),e.append(t),this.setAttribute(Mi.DATA_PBSTCK_COMPONENT_ATTR_NAME,Mi.DATA_PBSTCK_COMPONENT_ATTR_VALUE.PARALLAX),this.setShadowDom(`${e.outerHTML}`);const o=this.getHighestChild();o&&(o.style.position="absolute",o.style.left="0",o.style.right="0",o.style.margin="0 auto"),this.setPosition(),this.onScrollHandler||(this.onScrollHandler=this.setPosition.bind(this),document.addEventListener("scroll",this.onScrollHandler))}updateShadowLayout(){var e,t;if(0===(null===(e=this.parentElement)||void 0===e?void 0:e.offsetWidth)&&C(`${Di} parent element of better-parallax#${this.id} has a 0 width`),"1x1"===(null===(t=this.latestBidWon)||void 0===t?void 0:t.size))b(`${Di} winningBid is 1x1, disabling parallax`),this.setLayoutBanner();else{const e=this.getHighestChild();if(void 0===e)return;const t=getComputedStyle(e);parseInt(t.width),parseInt(t.height)<=this.height?this.setLayoutBanner():this.setLayoutParallax()}Array.from(this.querySelectorAll("iframe")).filter((e=>!e.hasAttribute("data-pbstck-loaded"))).forEach((e=>e.addEventListener("load",(()=>{e.setAttribute("data-pbstck-loaded","true"),this.updateShadowLayout.call(this)}))))}}Mi.defaultParallaxHeight=310,Mi.defaultMarges=40,Mi.MUTATION_DEBOUNCE_TIMEOUT_VALUE_MS=40,Mi.DATA_PBSTCK_COMPONENT_ATTR_NAME="data-pbstck-component",Mi.DATA_PBSTCK_COMPONENT_ATTR_VALUE={NO_AD:"no-ad",BANNER:"banner",PARALLAX:"parallax"};const Bi=e=>e.reduce(((e,t)=>{const i=getComputedStyle(e),n=getComputedStyle(t);return parseInt(n.height)>parseInt(i.height)?t:e}),e[0]);function zi(e){if(e.parallax){const t=e.divId,i=document.getElementById(t);if(b(`${Di} prepareParallax`,e),i){const t=document.createElement("better-parallax");for(let e=0;ee))),s=o/2+10,a=Math.max(310,s,n);t.style.height=`${a}px`,t.setAttribute("height",`${a}px`)}}}var Fi;class Wi extends HTMLElement{constructor(){super();const e=window.kleanadsPbjs;if(e)try{e.onEvent("bidWon",this.winningBid.bind(this))}catch(e){C("[pbstck-sticky] unable to listen to bidWon event",e)}else C("[pbstck-sticky] pbjs not loaded, unable to listen to bidWon event");this.attachShadow({mode:"open"}),this.mutationObserver=new MutationObserver((e=>{b("[pbstck-sticky] [mutationObs]",e),this.isAddingCreative(e)?(b("[pbstck-sticky] [mutationObs] add element on nested"),this.setDisplay()):(b("[pbstck-sticky] [mutationObs] no element in sticky"),this.unSetDisplay()),this.updateShadowLayout()})),this.addEventListener("close",(()=>{b('[pbstck-sticky] event "close" caught, closing sticky component'),this.unSetDisplay()}))}winningBid(e){e.adUnitCode===this.id&&(b("[pbstck-sticky] [winningBid]",e),b("[pbstck-sticky] [winningBid]",e.bidderCode,e.adUnitCode),"ogury"!==e.bidderCode&&"missena"!==e.bidderCode&&"seedtag"!==e.bidderCode||this.setSpecialBidder())}unSetDisplay(){Fi.shouldDisplay=!1,this.updateShadowLayout()}setDisplay(){Fi.shouldDisplay=!0,this.updateShadowLayout()}setSpecialBidder(){Fi.specialBidder=!0,this.updateShadowLayout()}isAddingCreative(e){var t,i,n;return(null===(t=e[0])||void 0===t?void 0:t.addedNodes[0])&&(null===(n=null===(i=e[0])||void 0===i?void 0:i.target.parentElement)||void 0===n?void 0:n.id)===this.id}connectedCallback(){this.isConnected&&(b("[pbstck-sticky] no-ad"),this.setAttribute("data-pbstck-component","no-ad"),this.setShadowDom("
"),this.updateShadowLayout(),this.mutationObserver.observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){this.mutationObserver.disconnect()}attributeChangedCallback(){this.updateShadowLayout()}getHighestChild(){const e=Array.from(this.children);if(0!==e.length)return Vi(e)}setShadowDom(e){this.shadowRoot&&(Fi.shouldDisplay&&!Fi.specialBidder?this.shadowRoot.innerHTML=`\n \n ${e}`:Fi.shouldDisplay&&Fi.specialBidder?(this.shadowRoot.innerHTML="\n
",Fi.specialBidder=!1):this.shadowRoot.innerHTML="\n ")}updateShadowLayout(){if(b(`[pbstck-sticky] updating element ${this.id}`),!this.shadowRoot)return;this.setAttribute("data-pbstck-component","sticky");const e=document.createElement("div");e.className="sticky-container";const t=document.createElement("slot");e.append(t),this.setShadowDom(`${e.outerHTML}`);const i=this.getHighestChild();if(i){i.style.display="block",i.style.margin="0 auto",i.style.bottom="0",i.style.maxHeight=`${Fi.maxCreativeHeight}px`;const e=document.createElement("div");e.className="sticky-button-container";const t=document.createElement("div");t.className="sticky-button";const n=document.createElement("div");n.className="sticky-button-text",n.addEventListener("click",(()=>{b("[pbstck-sticky] Close button pressed, hiding the sticky adunit"),this.unSetDisplay()}));const o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d","M 5.3,18.7 C 5.5,18.9 5.7,19 6,19 6.3,19 6.5,18.9 6.7,18.7 l 5.3,-5.3 5.3,5.3 c 0.2,0.2 0.5,0.3 0.7,0.3 0.2,0 0.5,-0.1 0.7,-0.3 0.4,-0.4 0.4,-1 0,-1.4 L 13.4,12 18.7,6.7 c 0.4,-0.4 0.4,-1 0,-1.4 -0.4,-0.4 -1,-0.4 -1.4,0 L 12,10.6 6.7,5.3 c -0.4,-0.4 -1,-0.4 -1.4,0 -0.4,0.4 -0.4,1 0,1.4 l 5.3,5.3 -5.3,5.3 c -0.4,0.4 -0.4,1 0,1.4 z");const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("class","cross"),s.setAttribute("height","22px"),s.setAttribute("width","22px"),s.setAttribute("fill","#333"),s.append(o),n.append(s),t.append(n),e.append(t),this.shadowRoot.prepend(e)}}}Fi=Wi,Wi.backgroundColor="rgb(250, 250, 250)",Wi.maxCreativeHeight=216,Wi.buttonHeight=32,Wi.maxHeight=Fi.maxCreativeHeight+Fi.buttonHeight,Wi.shouldDisplay=!1,Wi.specialBidder=!1;const Vi=e=>e.reduce(((e,t)=>t.offsetHeight>e.offsetHeight?t:e),e[0]);function Hi(e){if(e.sticky){const t=e.divId,i=document.getElementById(t);if(b("[pbstck-sticky]",e),"pbstck-sticky"===(null==i?void 0:i.localName))return void b(`[pbstck-sticky] div ${t} already prepared`);const n=document.createElement("pbstck-sticky");n.id=t;const o=`adm-sticky-${t}`;if(i)b(`[pbstck-sticky] div ${t} existing`),i.id=o,i.appendChild(n);else{b(`[pbstck-sticky] div ${t} not existing`);const e=document.createElement("div");e.id=o,e.appendChild(n),document.body.appendChild(e)}}}let Gi=(()=>{let e,t,i=[Tt("onAdUnitConfigLoad")],n=[];return t=class{constructor(){this.name="ContainersModule",this.loaded=!1,this.firstStickyDefined=!1}isLoaded(){return this.loaded}async load(){if("function"==typeof(null===customElements||void 0===customElements?void 0:customElements.define)&&"function"==typeof MutationObserver)try{customElements.define("adm-adunit",Li),customElements.define("better-parallax",Mi),customElements.define("pbstck-sticky",Wi)}catch(e){w(`[ContainersModule] unable to define custom elements, error "${e}"`)}else C('[ContainersModule] unable to define custom elements, error: "browser not compatible"');this.loaded=!0}async onAdUnitConfigLoad({adUnitConfig:e}){const t=e.adUnits.find((e=>e.sticky));if(null==t?void 0:t.closingOnSelector){const e=document.querySelectorAll(null==t?void 0:t.closingOnSelector);if(e.length>0){const t=new IntersectionObserver((e=>{e.forEach((e=>{var t;e.intersectionRatio>0&&(null===(t=document.querySelector("pbstck-sticky"))||void 0===t||t.dispatchEvent(new CustomEvent("close")))}))}),{});e.forEach((e=>t.observe(e)))}}}async onPrepareAdUnits({config:e,toPreparedAdUnits:t}){for(const i of null!=t?t:[])i.parallax&&zi(i),i.webComponentAdunit&&Ni(i),"mobile"===e.device&&i.sticky&&!this.firstStickyDefined&&(Hi(i),this.firstStickyDefined=!0)}async clean(){}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"ContainersModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;o{let e,t,i=[Tt("onAfterPrepareAdUnits")],n=[];return t=class{constructor(){this.name="XplnModule",this.loaded=!1}async load(){this.loaded=!0}async onAfterPrepareAdUnits({config:e,adUnitConfig:t}){b("XplnModule declare xpln targeting when ready"),(null==t?void 0:t.xplnConfig)&&qi(e.pubstackWindow)}async clean(){this.loaded=!1}isLoaded(){return this.loaded}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"XplnModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;o{if(!(t>15))return e.xpln_targeting&&e.xpln_targeting.toString().length>100?(e.xpln_targeting(),void b("XPLN targeting called")):void setTimeout((()=>Ki(e,t+1)),300);C("Could not declare XPLN targetings, xpln_targeting function is undefined")},qi=e=>{Ki(e,0)};let Yi=(()=>{let e,t,i=[Tt("onAdUnitConfigLoad")],n=[];return t=class{constructor(){this.name="PublicAccessModule",this._isLoaded=!1}isLoaded(){return this._isLoaded}async load({config:e,adUnitConfig:t}){e.pubstackWindow._pbstckKleanAds.getBootstrapConfig=()=>{const{pubstackWindow:t,...i}=e;return i},e.pubstackWindow._pbstckKleanAds.getStackConfig=()=>t,e.pubstackWindow._pbstckKleanAds.apiReady=!0,this._isLoaded=!0}async clean({config:e}){e.pubstackWindow._pbstckKleanAds.apiReady=!1,e.pubstackWindow._pbstckKleanAds.getBootstrapConfig=()=>{throw new Error("Not ready yet, wait for apiLoaded.")},e.pubstackWindow._pbstckKleanAds.getStackConfig=()=>{throw new Error("Not ready yet, wait for apiLoaded.")}}},function(e,t,i){"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}(t,"PublicAccessModule"),(()=>{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;(function(e,t,i,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,d=n.kind,l="getter"===d?"get":"setter"===d?"set":"value",c=!t&&e?n.static?e:e.prototype:null,u=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f=!1,g=i.length-1;g>=0;g--){var p={};for(var h in n)p[h]="access"===h?{}:n[h];for(var h in n.access)p.access[h]=n.access[h];p.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var v=(0,i[g])("accessor"===d?{get:u.get,set:u.set}:u[l],p);if("accessor"===d){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=a(v.get))&&(u.get=r),(r=a(v.set))&&(u.set=r),(r=a(v.init))&&o.unshift(r)}else(r=a(v))&&("field"===d?o.unshift(r):u[l]=r)}c&&Object.defineProperty(c,n.name,u),f=!0})(null,e={value:t},i,{kind:"class",name:t.name,metadata:o},null,n),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),function(e,t,i){for(var n=arguments.length>2,o=0;o{try{A(e)}catch(e){C(`Unable to remove meta tag ${A}`,e)}})),this._isLoaded=!1}},Jt,Lt,Gi,Ut,Ii,hi,$i,ji,Ji,Yi];class Qi{static getModules(){return Xi}}window._pbstckKleanAds={initKleanAds:async function(e){const t=await yi(e,Qi.getModules().map((e=>new e)));t&&Ci(t)},apiReady:!1,getBootstrapConfig:()=>{throw new Error("Not ready yet, wait for apiReady.")},getStackConfig:()=>{throw new Error("Not ready yet, wait for apiReady.")}}})();; window._pbstckKleanAds.initKleanAds({"adCallTimeout":3000,"configUrl":"https://cdn-adm.pbstck.com","context":[{"defaultValue":"marmiton","key":"site_name","otherValues":["aufeminin","lesnumeriques","netmums","doctissimo_fr"]},{"defaultValue":"organic","key":"source","otherValues":["doctissimo_fr_organic","doctissimo_fr_video","marmiton_organic"]},{"defaultValue":"homepage","key":"section","otherValues":["expert_club","forum","forum_family","forum_others","forum_parenting","forum_pregnancy","forum_sexo","forum_sexo18years","other","others","recipes","search","section_astro","section_beauty","section_fashion","section_fit","section_life","section_lifestyle","section_parenting","section_people","section_sexo","section_society","section_health"]},{"defaultValue":"all_placements","key":"ops_template","otherValues":["300_atf_only","banner_atf_and_300_atf","banner_atf_only","no_pub"]},{"defaultValue":"homepage","key":"section_reworld","otherValues":["doctissimo_fr_forum_drugs","doctissimo_fr_forum_family","doctissimo_fr_forum_health","doctissimo_fr_forum_pregnancy","doctissimo_fr_forum_psycho","doctissimo_fr_homepage","doctissimo_fr_others","doctissimo_fr_section_altmed","doctissimo_fr_section_animals","doctissimo_fr_section_baby","doctissimo_fr_section_beauty","doctissimo_fr_section_drugs","doctissimo_fr_section_family","doctissimo_fr_section_fashion","doctissimo_fr_section_fit","doctissimo_fr_section_health","doctissimo_fr_section_nutrition","doctissimo_fr_section_pregnancy","doctissimo_fr_section_psycho","doctissimo_fr_section_sexo","doctissimo_fr_tool_maternity","expert_club","forum","forum_drugs","forum_family","forum_health","forum_others","forum_parenting","forum_pregnancy","forum_psycho","forum_sexo","forum_sexo18years","marmiton_homepage","marmiton_others","marmiton_recipes","marmiton_search","other","others","recipes","search","section_activities","section_altmed","section_animals","section_astro","section_automobile","section_baby","section_beauty","section_chil","section_child","section_drugs","section_emissions","section_family","section_fashion","section_fit","section_food","section_gaming","section_health","section_informatique","section_life","section_lifestyle","section_local","section_loisirs","section_maison","section_nutrition","section_parenting","section_people","section_photo","section_pregnancy","section_pro","section_psycho","section_recipes","section_reviews","section_sante-sport","section_sexo","section_society","section_support","section_tag","section_telecharger","section_telephonie","section_telephonique","section_tv_son","section_velos-trottinettes","section_video","tool_maternity","tools_maternity","video","hubs_homepages"]},{"defaultValue":"","key":"pubstacktestroadblock","otherValues":["true"]},{"defaultValue":"","key":"subscribed","otherValues":["true","false"]},{"defaultValue":"","key":"test_seedtag","otherValues":["false","true"]},{"defaultValue":"","key":"marque","otherValues":["nhshealthystart24"]},{"defaultValue":"","key":"test_sublime","otherValues":["true","false"]}],"globalRefreshConfig":{"hasExcludedLineItems":true,"hasExclusions":true,"prebidOrderIds":[3226787703,3226789815,3235455261,3233770739],"refreshModuleBaseUrl":"https://cdn-kleanads-poc.pbstck.com/kleanads-refresh"},"kleanadsVersion":"2405061004","metricThrottling":false,"networkId":46980923,"newPrebidUrl":"https://cdn-adm.pbstck.com/kleanads-prebid/8.46.0-ad7626a9e41f1108f93b54cca34116bafcf0bf81.js","pbjsConfig":{"bidderAdjustments":[{"adjustment":0.800000011920929,"bidder":"gingerad"}],"bidderAliases":[{"bidderLabel":"alliancegravity","bidderSource":"appnexus"},{"bidderLabel":"triplelift_native","bidderSource":"triplelift"},{"bidderLabel":"triplelift_video","bidderSource":"triplelift"},{"bidderLabel":"Gravity-Video","bidderSource":"appnexus"},{"bidderLabel":"ix_video","bidderSource":"ix"},{"bidderLabel":"gingerad","bidderSource":"appnexus"},{"bidderLabel":"nexx360-fuel","bidderSource":"nexx360"},{"bidderLabel":"richaudience-video","bidderSource":"richaudience"},{"bidderLabel":"moneytag","bidderSource":"appnexus"},{"bidderLabel":"b-covery","bidderSource":"appnexus"}]},"pocOverrides":{"convertToInstreamAdUnits":{"doctissimo_fr_video":{"floors":{"currency":"EUR","schema":{"fields":["mediaType"]},"values":{"video":3}},"instreamParams":{"adDeactivationContext":{"key":"ops_template","values":["300_atf_only","banner_atf_and_300_atf","banner_atf_only","no_pub"]},"targetings":{"video_pos":"mtf"},"vast":{"pmad":3,"pmnd":0,"pmxd":61000,"sz":"640x480","vpos":"preroll"}}},"instream":{"floors":{"currency":"EUR","schema":{"fields":["mediaType"]},"values":{"video":3}},"instreamParams":{"adDeactivationContext":{"key":"ops_template","values":["300_atf_only","banner_atf_and_300_atf","banner_atf_only","no_pub"]},"targetings":{"video_pos":"mtf"},"vast":{"pmad":3,"pmnd":0,"pmxd":61000,"sz":"640x480","vpos":"preroll"}}}},"convertToInterstitialAdUnits":["interstitiel","aufeminin-interstitiel","doctissimo_fr-interstitiel"],"extraScripts":[{"scripts":["https://ssp.implcit.com/s/gam/156.js","https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/marmiton-bliink-240305.js"],"synchronous":false,"tagId":"400a2fd4-d9cd-4b18-aa2f-06f245688ebf"},{"beforeStart":true,"scripts":["https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/optidigital_20240423.js"],"synchronous":true,"tagId":"3486e37f-4e07-4afb-b808-7c50b14b6c4e"},{"scripts":["https://ssp.implcit.com/s/gam/156.js","https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/aufeminin-bliink-240305.js"],"synchronous":false,"tagId":"3486e37f-4e07-4afb-b808-7c50b14b6c4e"},{"scripts":["https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/xpln-231019.js"],"synchronous":true,"tagId":"3486e37f-4e07-4afb-b808-7c50b14b6c4e"},{"scripts":["https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/xpln-231019.js"],"synchronous":true,"tagId":"400a2fd4-d9cd-4b18-aa2f-06f245688ebf"},{"scripts":["https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/xpln-231019.js"],"synchronous":true,"tagId":"6bc4b196-d31c-4831-aee5-407e41f4b9db"},{"beforeStart":true,"scripts":["https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/optidigital_20240423.js"],"synchronous":true,"tagId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8"},{"scripts":["https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/xpln-231019.js"],"synchronous":true,"tagId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8"},{"scripts":["https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/xpln-231019.js"],"synchronous":true,"tagId":"89679788-2d05-472a-81c2-44935ac5876c"},{"scripts":["https://ssp.implcit.com/s/gam/156.js","https://cdn-kleanads-poc.pbstck.com/extra-scripts/reworld/netmums-cssDisplayNoneOverride-20240408_2.js"],"synchronous":false,"tagId":"6bc4b196-d31c-4831-aee5-407e41f4b9db"},{"scripts":["https://ssp.implcit.com/s/gam/156.js"],"synchronous":false,"tagId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8"},{"scripts":["https://ssp.implcit.com/s/gam/156.js"],"synchronous":false,"tagId":"89679788-2d05-472a-81c2-44935ac5876c"}],"firstId":true,"fledgeForGpt":true,"instreamConfig":{"400a2fd4-d9cd-4b18-aa2f-06f245688ebf":"dailymotion-v1","type":"dailymotion-v2"},"prebidPpidSolutions":[{"prebidPpid":"first-id.fr"}],"refreshBehaviorOnEmpty":"instantSecondChance","refreshSpecificRules":[{"bidder":"invibes","timer":30},{"bidder":"triplelift_video","timer":40}],"skinFloor":{"currency":"EUR","defaultFloor":3},"skinRenderingSettings":{"siteLevel":{"3486e37f-4e07-4afb-b808-7c50b14b6c4e":{"biddersOverride":["adagio","adyoulike","alliancegravity","appnexus","criteo","mediasquare","nexx360-fuel","ogury","ozone","pubmatic","richaudience","rubicon","smartadserver","smilewanted","teads","triplelift"],"enabledSkinRenderAdaptation":true},"400a2fd4-d9cd-4b18-aa2f-06f245688ebf":{"biddersOverride":["adagio","adyoulike","alliancegravity","appnexus","criteo","mediasquare","nexx360-fuel","ogury","ozone","pubmatic","richaudience","rubicon","smartadserver","smilewanted","teads","triplelift"],"enabledSkinRenderAdaptation":true},"45b44fb4-45a2-4c32-8d9b-789e4827d8d8":{"biddersOverride":["adagio","adyoulike","alliancegravity","appnexus","criteo","mediasquare","nexx360-fuel","ogury","ozone","pubmatic","richaudience","rubicon","smartadserver","smilewanted","teads","triplelift"],"enabledSkinRenderAdaptation":true},"6bc4b196-d31c-4831-aee5-407e41f4b9db":{"biddersOverride":["adagio","adyoulike","alliancegravity","appnexus","criteo","mediasquare","nexx360-fuel","ogury","ozone","pubmatic","richaudience","rubicon","smartadserver","smilewanted","teads","triplelift"],"enabledSkinRenderAdaptation":true},"89679788-2d05-472a-81c2-44935ac5876c":{"biddersOverride":["adagio","adyoulike","alliancegravity","appnexus","criteo","mediasquare","nexx360-fuel","ogury","ozone","pubmatic","richaudience","rubicon","smartadserver","smilewanted","teads","triplelift"],"enabledSkinRenderAdaptation":true}}},"uprRatio":99,"uprState":"tested","waitForDOMLoaded":true,"xplnEnabled":true},"priceRuleBuckets":[{"increment":"0.05","max":"3"},{"increment":"0.1","max":"4.4"},{"increment":"0.2","max":"6"},{"increment":"0.5","max":"10"},{"increment":"2","max":"18"}],"pubstackDeclarationTargetingKeys":["pos"],"screenSizeBreakpoints":[{"device":"mobile","size":0},{"device":"desktop","size":768}],"stacks":[{"conditions":{"elements":[{"key":"ops_template","op":"IN","values":["no_pub"]}],"op":"AND"},"priority":1,"scopeId":"f9b5256f-6086-402f-8067-9a97bd298e0d","siteId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8","stackId":"3e48f9df-2595-4015-aa87-4ece03d584a4","versions":[{"ratio":100,"version":2}]},{"conditions":null,"priority":null,"scopeId":"f9b5256f-6086-402f-8067-9a97bd298e0d","siteId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8","stackId":"44f46114-bbeb-448f-b143-9bbbb29302ce","versions":[{"ratio":100,"version":30}]},{"conditions":{"elements":[{"key":"ops_template","op":"IN","values":["300_atf_only"]}],"op":"AND"},"priority":4,"scopeId":"f9b5256f-6086-402f-8067-9a97bd298e0d","siteId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8","stackId":"606db296-1188-4f80-ad05-db66422c97e7","versions":[{"ratio":100,"version":9}]},{"conditions":{"elements":[{"key":"ops_template","op":"IN","values":["banner_atf_and_300_atf"]}],"op":"AND"},"priority":2,"scopeId":"f9b5256f-6086-402f-8067-9a97bd298e0d","siteId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8","stackId":"b6e3f58b-8f8a-4c2a-8557-62812ff39bfa","versions":[{"ratio":100,"version":12}]},{"conditions":{"elements":[{"key":"section_reworld","op":"IN","values":["homepage","doctissimo_fr_homepage"]}],"op":"AND"},"priority":5,"scopeId":"f9b5256f-6086-402f-8067-9a97bd298e0d","siteId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8","stackId":"f67729b3-444b-4965-85e3-ed08e233e314","versions":[{"ratio":100,"version":2}]},{"conditions":{"elements":[{"key":"ops_template","op":"IN","values":["banner_atf_only"]}],"op":"AND"},"priority":3,"scopeId":"f9b5256f-6086-402f-8067-9a97bd298e0d","siteId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8","stackId":"8fb023c8-8f0e-4af3-b280-8b8c929056c8","versions":[{"ratio":100,"version":10}]}],"tagId":"45b44fb4-45a2-4c32-8d9b-789e4827d8d8"}); })();