(()=>{"use strict";var e={};let t,n,o,i,r,a,c,s,l;function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&d(e,t)}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=h(e);if(t){var i=h(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return p(this,n)}}function p(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){for(var n=0;n{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e),function(e){let t=!1;function o(){const e=(new Error).stack;if(!e)return null;const t=e.split("\n")[3].split(" ");let n=t[t.length-1];return"("!==n[0]&&(n="("+n+")"),n}e.setAllowLogging=function(e){t=!!n.findHighestWindow().location.search.includes("bex_logging=true")||e},e.logInfo=function(...e){if(!t)return;const n=o(),i=Date.now()-performance.timing.navigationStart;console.log("%c%s%c%s%s","background: #00008B; color: White; font-weight: bold;","[CeX Header Bidding]","",i,n?" ".concat(n):"","",...e)},e.logWarning=function(...e){if(!t)return;const n=o(),i=Date.now()-performance.timing.navigationStart;console.log("%c%s%c%s%s","background: #FF8C00; color: White; font-weight: bold;","[CeX Header Bidding]","",i,n?" ".concat(n):"","",...e)},e.logError=function(e,...n){if(!t)return;const i=o(),r=Date.now()-performance.timing.navigationStart;n.length>0&&console.log("%c%s%c%s%s","background: #8B0000; color: White; font-weight: bold;","[CeX Header Bidding]","",r,i?" ".concat(i):"","",...n),console.error(e),console.trace()},e.logProblem=function(...e){if(!t)return;const n=o(),i=Date.now()-performance.timing.navigationStart;console.log("%c%s%c%s%s","background: #8B0000; color: White; font-weight: bold;","[CeX Header Bidding]","",i,n?" ".concat(n):"","",...e),console.trace()}}(t||(t={})),function(e){function n(){const e=window.top;let t=window;for(;t!==e;)try{t.parent.document,t=t.parent}catch(e){break}return t}function o(){return n().document}e.getRandomInt=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e)+e)},e.replaceAll=function(e,t,n){return e.split(t).join(n)},e.fixDomain=function(e){return(e=(e=e.toLowerCase()).replace(/^http(s?):\/\//i,"")).startsWith("www.")&&(e=e.slice(4)),e.endsWith("/")&&(e=e.slice(0,-1)),e},e.guid=function(e=4){return e>11&&(e=11),Math.random().toString(36).substr(2,e)},e.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},e.findHighestWindow=n,e.findHighestDocument=o,e.hbFrameId="__bexHBFrame";const i=e.hbdevFrameId="__bexHBDevFrame";function r(e,t){const n=o();n.body||(n.body=n.createElement("body"));let i=n.querySelector("#".concat(t));return i||(i=n.createElement("iframe"),i.id=t,i.style.display="none",i.onload=function(){const t=i.contentDocument,n=t?.createElement("script");n&&(n.src="https://".concat(e,"/hbscript"),n.async=!0,n.defer=!0,t?.head.appendChild(n))},n.body.appendChild(i),i)}e.createHbFrame=r,e.initalizeHb=function(e,n){"www.slovenskenovice.si"===window.location.host&&window.afterIpromPrebid?(t.logInfo("Setting iframe creation through iprom initalizer..."),window.afterIpromPrebid.push((function(){return r(e,n)}))):r(e,n)},e.isDevelMode=function(e=!1,t){return!(!e&&void 0===t)&&(e?window.frameElement?.id===i:void 0===t||t.includes("hbdev.contentexchange.me"))},e.sendEventImage=function(e){const t=o(),n=t.createElement("img");n.src=e,n.onload=function(){t.body.removeChild(n)},n.style.display="none",t.body.appendChild(n)},e.crawlToPost=function(e){let t=e;for(;t&&!t.classList.contains("$bexAd_post");){if("BODY"===t.tagName)return null;if(!t.parentElement)return null;t=t.parentElement}return t},e.getCookie=function(e,t){const n="; ".concat(t).split("; ".concat(e,"="));if(2===n.length)return n.pop()?.split(";").shift()}}(n||(n={})),function(e){function t(){const e=n.findHighestWindow();let t=e.bextag;return t||(e.bextag=t={targeting:{},headerbidding:{queue:[]},_internals:{headerbidding:{bexDisplayHB:{},bexNativeHB:{}},loaders:{},bds:{}},sendQueue:[],onBexAdFailed:[],onBexAdSuccess:[]}),"sendQueue"in e.bextag||(e.bextag.sendQueue=[]),"targeting"in e.bextag||(e.bextag.targeting={}),"headerbidding"in e.bextag||(e.bextag.headerbidding={}),"queue"in e.bextag.headerbidding||(e.bextag.headerbidding.queue=[]),"_internals"in e.bextag||(e.bextag._internals={}),"headerbidding"in e.bextag._internals||(e.bextag._internals.headerbidding={}),"bexDisplayHB"in e.bextag._internals.headerbidding||(e.bextag._internals.headerbidding.bexDisplayHB={}),"bexNativeHB"in e.bextag._internals.headerbidding||(e.bextag._internals.headerbidding.bexNativeHB={}),"loaders"in e.bextag._internals||(e.bextag._internals.loaders={}),"bds"in e.bextag._internals||(e.bextag._internals.bds={}),"onBexAdFailed"in e.bextag||(e.bextag.onBexAdFailed=[]),"onBexAdSuccess"in e.bextag||(e.bextag.onBexAdSuccess=[]),t}e.getBexTag=t,e.getBexDevTag=function(){const e=t();let n=e._devTag;n||(e._devTag=n={targeting:{},headerbidding:{queue:[]},_internals:{headerbidding:{bexDisplayHB:{},bexNativeHB:{}},loaders:{},bds:{}},sendQueue:[],onBexAdFailed:[],onBexAdSuccess:[]});const o=n;return"sendQueue"in o||(o.sendQueue=[]),"targeting"in o||(o.targeting={}),"headerbidding"in o||(o.headerbidding={}),"queue"in o.headerbidding||(o.headerbidding.queue=[]),"_internals"in o||(o._internals={}),"headerbidding"in o._internals||(o._internals.headerbidding={}),"bexDisplayHB"in o._internals.headerbidding||(o._internals.headerbidding.bexDisplayHB={}),"bexNativeHB"in o._internals.headerbidding||(o._internals.headerbidding.bexNativeHB={}),"loaders"in o._internals||(o._internals.loaders={}),"bds"in o._internals||(o._internals.bds={}),"onBexAdFailed"in o||(o.onBexAdFailed=[]),"onBexAdSuccess"in o||(o.onBexAdSuccess=[]),n}}(o||(o={})),(i||(i={})).getAdformTag=function(){const e=window;return e.adformtag=e.adformtag||[]},(r||(r={})).getPrebid=function(){const e=window;let t=e.pbjs;return t||(e.pbjs=t={que:[]}),t},a||(a={}),function(e){let o=m((function e(){v(this,e)}));e.MemoryStorage=o;let i=function(e){u(o,e);var n=f(o);function o(e,t){var i;return v(this,o),b(g(i=n.call(this)),"_name",void 0),b(g(i),"_storage",void 0),b(g(i),"_data",void 0),b(g(i),"_isLoaded",void 0),i._name=e,i._storage=t,i._data={},i._isLoaded=!1,i}return m(o,[{key:"getValue",value:function(e){return this.load(),this._data[e]}},{key:"setValue",value:function(e,t){this._data[e]=t,this.save()}},{key:"deleteKey",value:function(e){this.hasKey(e)&&(delete this._data[e],this.save())}},{key:"hasKey",value:function(e){return this.load(),void 0!==this._data[e]}},{key:"save",value:function(){try{this._storage.setItem(this._name,JSON.stringify(this._data))}catch(e){t.logError(e,"Failed to save browser storage!",this._name)}}},{key:"load",value:function(){if(!this._isLoaded){this._isLoaded=!0;try{const e=this._storage.getItem(this._name);if(!e)return;this._data=JSON.parse(e)}catch(e){t.logError(e,"Failed to load browser storage!",this._name),this._data={}}}}},{key:"clear",value:function(){this._data={},this.save()}}]),o}(o);e.BrowserStorage=i;let r=function(e){u(o,e);var t=f(o);function o(e){return v(this,o),t.call(this,e,n.findHighestWindow().sessionStorage)}return m(o)}(i);e.Session=r}(c||(c={})),function(e){const o={};e.registerFallback=function(e){return e?o[e.id]?t.logWarning("Fallback already registered!",e.name):void(o[e.id]=e):t.logWarning("No fallback provided during registration!")},e.invokeFallback=async function(e,i){if(!e||!i)return!1;const r=n.uuidv4();let a=e.execList;for(;null!=a;)try{const n=o[a.type];if(!n){t.logWarning("Fallback is not registered!",a.type),a=a?.next;continue}if(!n.isAvailable){t.logWarning("Fallback is not available!",n.name),a=a?.next;continue}if("object"==typeof a.config&&(a.config.adFormat=e.execList.config.adFormat||a.config.adFormat),await n.invoke(a.config,i,r))return t.logInfo("Fallback was successfully invoked and rendered an ad!",n.name),!0;a=a?.next}catch(e){t.logError(e,"An error occured while trying to execute a fallback!"),a=a?.next}return t.logWarning("Ad was not able to be processed by the fallback system!"),!1}}(s||(s={})),function(e){const o={},i=n.findHighestDocument();function r(e,t,n,o){const i=t.children;for(let r=0;r');var d="push"==l?"position:absolute;right:5px;bottom:5px;":"float:right;margin:0 0 8px 8px;";s.querySelector("$bexAd_title_html").outerHTML+=' ")+titles[0].outerHTML,s?.classList.add("bexvideo")}else r.setAttribute("src",b),r.setAttribute("alt",i.title),r.style["background-image"]="url("+(i[c[1]]||"")+")",a.useImageContain?r.style["background-size"]="contain":r.style["background-size"]="cover",r.style["background-repeat"]="no-repeat",r.style["background-position"]="center"}else if("$type"===c[2]&&3===c.length)switch(c[1]){case"image":l.push("bexImage");break;case"title":l.push("bexTitle");break;case"post":l.push("bexPost");break;default:t.logWarning("Invalid template element type",c[1],o)}else if("$replace"===c[2]&&5===c.length){let e=o.getAttribute(c[3]);if(!e)continue;e=n.replaceAll(e,c[4],i[c[1]]),o.setAttribute(c[3],e)}else"$style"===c[2]&&4===c.length?s[c[1]]=c[3]:("clickUrl"===c[1]&&(i.clickTrackers&&o.addEventListener("click",(function(){t.logInfo("Advertisement has been clicked!",o);for(let e of i.clickTrackers)n.sendEventImage(e)})),i.clickFuncs&&o.addEventListener("click",(function(){t.logInfo("Executing click functions for",o);for(let e of i.clickFuncs)try{e()}catch(n){t.logError(n,"Failed to execute click function",e)}}))),o.setAttribute(c[2],i[c[1]]||""))}for(let e in s)o.style[e]=s[e];for(let e of l)o.classList.add(e);return r(e,o,i,a),o}e.registerRenderer=function(e){return e?o[e.id]?t.logWarning("Renderer already registered!",e.name):void(o[e.id]=e):t.logWarning("No renderer provided during registration!")},e.renderSticker=function(e,t){if(e.querySelector(".cex-adform-sticker")){const n=e.querySelector(".cex-adform-sticker");n.style.display="inline-block",n.innerHTML=!n?.classList.contains("cex-sticker-replace")&&n.innerHTML||t||"Ad"}else{const n=i.createElement("div");n.style="\n line-height: 1.5;\n position: absolute;\n padding:0px 5px;\n top:3px;\n left:3px;\n border-radius: 3px;\n box-shadow: 1px 1px 1px 0 rgba(50, 50, 50, 0.2);\n background-color: rgba(255, 255, 255, 0.7);\n color: #2f2f2f;\n font-size: 12px;\n border: 1px solid #b3b3b3;\n z-index:10;\n display:block",n.className="cex-adform-sticker",n.innerHTML=n.innerHTML||t||"Ad",e.appendChild(n)}},e.renderTemplate=r,e.renderElement=a,e.createHTMLTemplate=function(e){const t=i.createElement("template"),o=n.guid();return e=e.replace(/##rnd##/g,o),t.innerHTML=e,t},e.invokeRenderer=async function(e,n,i,r,a){if(!e||!i)return!1;const c=o[e];if(!c)return t.logWarning("Renderer is not registered!",e),!1;if(!c.isAvailable)return t.logWarning("Renderer is not available!",c.name),!1;try{if(await c.render(n,i,r,a))return t.logInfo("Successfuly rendered advertisment!",c.name,n),!0}catch(e){t.logError(e,"An error occured while trying to render ad!",c.name,n)}return t.logWarning("Failed to render ad using the renderer system!"),!1}}(l||(l={}));let w,x,_,k,I=[],P=null;function O(){if(P)for(let e of I)"resolve"===P.func?e[0](P.passedData):e[1](P.passedData)}function T(e,t){for(var n=0;nq.innerWidth||t.push(n);return t}},{key:"getCorrectSize",value:function(e){if(!e.size)return[[300,250]];let t=[];return e.size.desktop&&q.innerWidth>480&&(t=t.concat(this.verifyFromSizes(e.size.desktop))),e.size.mobile&&q.innerWidth<=480&&(t=t.concat(this.verifyFromSizes(e.size.mobile))),e.size.universal&&t.length<1&&(t=t.concat(this.verifyFromSizes(e.size.universal))),t}},{key:"getIdFromBidParam",value:function(e){switch(e.bidder){case"criteo":case"adkernel":case"smilewanted":return e.params.zoneId;case"mgid":case"contentexchange":case"appnexus":case"adpone":return e.params.placementId;case"adtelligent":return e.params.aid;case"smartadserver":return e.params.formatId;case"adformOpenRTB":return e.params.mid;case"admixer":return e.params.zone;case"adagio":return e.params.organizationId;case"pubmatic":return e.params.adSlot;case"sovrn":return e.params.tagid;default:return null}}},{key:"buildAdUnit",value:function(e,t){const n=e.bids.filter((function(e){return"video"==e.mediaType})),o=e.bids.filter((function(e){return"video"!=e.mediaType}));if("NATIVE"===e.type)return[{code:t,mediaTypes:{native:{image:{required:!0,sizes:[300,150],aspect_ratios:[{min_width:250,ratio_width:2,ratio_height:1}]},title:{required:!0,len:150},sponsoredBy:{required:!1}}},bids:o},{code:t,mediaTypes:{video:{context:"outstream",playerSize:[[640,480]],mimes:["video/mp4","video/webm","video/ogg"],protocols:[1,2,3,4,5,6,7,8],playbackmethod:[2,6],skip:0,maxduration:60,api:[1,2],placement:2,renderer:{url:"https://hb.contentexchange.me/bundle.js?v2",backupOnly:!1}}},bids:n}];if(e.size){const i=this.getCorrectSize(e);return i.length<1?null:[{code:t,mediaTypes:{banner:{sizes:i}},bids:o},{code:t,mediaTypes:{video:{context:"outstream",playerSize:i,mimes:["video/mp4","video/webm","video/ogg"],protocols:[1,2,3,4,5,6,7,8],playbackmethod:[2,6],skip:0,maxduration:60,api:[1,2],placement:2,renderer:{url:"https://hb.contentexchange.me/bundle.js?v2",backupOnly:!1}}},bids:n}]}return null}},{key:"invoke",value:async function(e,n,o){const i=n.classList.contains("cex-adform-container")?n.parentElement?.id:n.id,r=this.buildAdUnit(e,i||"");if(!r)return!1;r[0],t.logInfo("Got header bidding configuration",e);for(let t of e.bids){const n=this.getIdFromBidParam(t);if(!n)continue;const o=t.mediaType;x.mapAdUnitBidder(e.id,t.bidder+"_"+o,n)}n.setAttribute("domain",e.domain);const a=await k.sendAdUnit(r,e.size?.original,e);if(_.sendAuctionData(o,a.auctionId),a.winner&&x.setWinningBid(a.winner),x.sendAuctionData(a.auctionId),!a||!a.winner)return!1;let c="generic";return"banner"===a.winner.mediaType?c="display":"video"===a.winner.mediaType&&(c="video"),await l.invokeRenderer(c,n,a.winner,o,e)}}])&&C(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),c}(R));const G=n.findHighestWindow();let M=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&B(e,t)}(s,e);var o,i,r,a,c=(r=s,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=z(r);if(a){var n=z(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return W(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),N(L(e=c.call(this)),"_googleObserver",void 0),N(L(e),"_blacklist",void 0),N(L(e),"_whitelist",void 0),e._blacklist=[],e._whitelist=[],e._googleObserver=new MutationObserver(e.onTrackedCallback.bind(L(e))),n.findHighestWindow().addEventListener("message",e.onMessageReceived.bind(L(e))),e}return o=s,i=[{key:"id",get:function(){return"google"}},{key:"name",get:function(){return"Google"}},{key:"convertGoogleToKVP",value:function(e){let t={};for(let n=0;n=250&&(!t||t[0]>=250)}},{key:"getHighestSize",value:function(e){if(!e.size)return null;for(let t of e.size)if(!(t[0]>G.innerWidth))return t;return null}},{key:"invoke",value:function(e,o,i){var r=this;return new Promise((async function(a,c){if(_.sendFallbackRequestData(i),!e.Google.Slot)return t.logWarning("Slot was not specified in Google ad!",e),_.sendFallbackData(i,!1),a(!1);const s=G.document,l=o.querySelector(".cex-adform-container");let u=o;const d=e.size||[o.scrollWidth,o.scrollHeight];l&&(u=l),e.Google.Key&&!r.isValidAdSpace(u)&&(t.logWarning("Selected ad space is less than 250px in width! Cannot place Google here!",o),_.sendFallbackData(i,!1),x.sendGoogleData(i,e.Google.Slot,d,!1)),Object.assign(u.style,{display:"flex",justifyContent:"center",alignItems:"flex-start"}),u.classList.add("bex-google-fallback"),u.style.zIndex="-10";const f=s.createElement("ins"),p=o.children;if(!l)for(let e of p)e!==f&&e!==u&&(e.style.display="none");e.Google.Key?(f.style.display="block",f.setAttribute("data-ad-format","fluid"),f.setAttribute("data-ad-layout-key",e.Google.Key),f.style.width="100%",f.style.height="100%"):(f.style.display="inline-block",d?(f.style.width=d[0]+"px",f.style.height=d[1]+"px"):(f.style.width="100%",f.style.height="100%")),f.classList.add("adsbygoogle"),f.setAttribute("data-ad-client","ca-pub-6068861086909170"),f.setAttribute("data-ad-slot",e.Google.Slot);const g="google-"+n.guid(),h=e.Google.Key?{id:e.Placement_ID,domain:e.Domain,placement:e.Placement_ID,source:"google",placement_size:{width:0,height:0},availableSizes:[{width:0,height:0}],size:null,type:"NATIVE",mediaType:"native",hasResponse:!1,hasWon:!1,cpm:0}:{id:e.Placement_ID,domain:e.Domain,placement:e.Placement_ID,source:"google",placement_size:{width:e.size[0],height:e.size[1]},availableSizes:e.available_sizes?.map((function(e){return{width:e[0],height:e[1]}})),size:null,type:"DISPLAY",mediaType:"banner",hasResponse:!1,hasWon:!1,cpm:0},b={},y="https://hb.contentexchange.me/stats";if(b.requests=[h],f.onGoogleComplete=function(n){if(!n){b.responses=[];const n=new XMLHttpRequest;return n.open("POST","".concat(y,"/auctionData")),n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.send(JSON.stringify(b)),t.logInfo("Sending fail data for Google",b),t.logWarning("Detected fail-state for Google ad!",u),_.sendFallbackData(i,!1),x.sendGoogleData(i,e.Google.Slot,d,!1),u!==o?u.parentElement?.removeChild(u):f.parentElement?.removeChild(f),a(!1)}const r=e.Google.Key?{id:e.Placement_ID,domain:e.Domain,placement:e.Placement_ID,source:"google",placement_size:{width:0,height:0},availableSizes:[{width:0,height:0}],size:{width:0,height:0},type:"NATIVE",mediaType:"native",hasResponse:!0,hasWon:!0,cpm:0}:{id:e.Placement_ID,domain:e.Domain,placement:e.Placement_ID,source:"google",placement_size:e.size,availableSizes:e.available_sizes,size:e.size,type:"DISPLAY",mediaType:"banner",hasResponse:!0,hasWon:!0,cpm:0};b.responses=[r];const c=new XMLHttpRequest;c.open("POST","".concat(y,"/auctionData")),c.setRequestHeader("Content-Type","application/json;charset=UTF-8"),c.send(JSON.stringify(b)),t.logInfo("Sending "+(e.Google.Key?"native":"display")+" data for Google",b),x.registerBidResponse(g,r),x.sendImpression(g),x.trackAdViewability(g,o),_.sendFallbackData(i,!0),x.sendGoogleData(i,e.Google.Slot,d,!0);const s=o.children;if(l)for(let e of s)e!==f&&e!==u&&(e.style.visibility="hidden");return u.style.zIndex="1",a(!0)},r.trackGoogleElement(f),u.insertAdjacentElement("afterbegin",f),!s.head.querySelector("#bex-google-script")){const e=s.createElement("script");e.id="bex-google-script",e.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",e.async=!0,s.head.appendChild(e)}try{(G.adsbygoogle=G.adsbygoogle||[]).push({})}catch(e){return c(e)}}))}}],i&&H(o.prototype,i),Object.defineProperty(o,"prototype",{writable:!1}),s}(R);function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V(e,t){for(var n=0;n\n \n \n '.concat(n.ad,"\n \n \n ")),a.contentDocument?(i.renderAd(a.contentDocument,n.adId),x.sendImpression(n.adId),x.trackAdViewability(n.adId,a),!0):(t.logWarning("Failed to find contentDocument for display ad!"),!1)}}])&&he(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),s}(E));const Pe=n.findHighestWindow(),Oe=Pe.document;new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&_e(e,t)}(a,e);var t,n,o,i,r=(o=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ie(o);if(i){var n=Ie(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ke(this,e)});function a(){return we(this,a),r.apply(this,arguments)}return t=a,(n=[{key:"id",get:function(){return"video"}},{key:"name",get:function(){return"Video Renderer"}},{key:"render",value:async function(e,t,n,o){try{var i=Pe.location.origin.replace(/https?:\/\//,""),r=t.adUnitCode.split(/-/g)[2],a={width:e.clientWidth,height:e.clientHeight,vastTimeout:5e3,maxAllowedVastTagRedirects:3,allowVpaid:!0,autoPlay:!0,preload:!0,mute:!0,loopAd:!0,adText:!1,adCTAText:!1,logoLink:"https://www.contentexchange.me/?utm_campaign=hbvideo&utm_source="+i+"&utm_medium=placement_"+r,onclick:function(){x.sendClick(t.adId)}};if("push"==o?.adFormat?(e.innerHTML='
',e.style.height="166px",e.style.setProperty("--bex_floater_close_color","#fff"),e.querySelector(".bex-close")?.addEventListener("click",(function(){e.classList.remove("bex-animate"),e.classList.remove("bex-show")}))):e.innerHTML="",t.vastXml&&(t.vastXml=t.vastXml.replace(/http:\/\//g,"https://")),t.ad=t.vastUrl||t.vastXml||null,"function"==typeof Pe.outstreamPlayer)Pe.outstreamPlayer(t,e.id,a),x.sendImpression(t.adId),x.trackAdViewability(t.adId,e);else{var c=Oe.createElement("script");c.src="https://hb.contentexchange.me/bundle.js?v9",c.onload=function(){Pe.outstreamPlayer(t,e.id,a),x.sendImpression(t.adId),x.trackAdViewability(t.adId,e)};var s=Oe.createElement("style");s.innerHTML="\n ._bex_observe .fluid_ad_playing {\n top: -5px !important;\n left: auto !important;\n right: -5px;\n line-height:2;\n padding:0px 8px;\n }\n ",Oe.body.appendChild(s),Oe.body.appendChild(c)}}catch(e){console.error(e),console.error("Error in video ad rendering!")}return!0}}])&&xe(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(E));const Te=o.getBexTag(),Ee=n.isDevelMode(!0)?o.getBexDevTag():Te,Se=Te.onBexAdSuccess,Re=Te.onBexAdFailed,Fe=Ee.headerbidding,Ce=Ee._internals.headerbidding,je=Ce.bexDisplayHB,Ae=Ce.bexNativeHB;function De(e){const n=document.createElement("img");n.src=e,n.onload=function(){n.parentElement?.removeChild(n),t.logInfo("Sent image request to",e)},document.body.appendChild(n),t.logInfo("Sending image request to",e,n)}t.setAllowLogging(n.isDevelMode()),je.executeAd=async function(e,n){if(!n||!e)return!1;if(w.IsCMPAvailable()){t.logInfo("Waiting for CMP to respond...");try{await w.WaitForConsent()}catch(e){t.logError(e,"Failed to wait for consent!")}t.logInfo("Consent responded! Continuing...")}if(await s.invokeFallback(e,n)){t.logInfo("Advertisement successfully loaded",e);for(let e of Se)try{e(n)}catch(e){t.logError(e,"Failed to execute success event!",e)}return!0}t.logInfo("Advertisement has failed to load",e);for(let e of Re)try{e(n)}catch(e){t.logError(e,"Failed to execute failed event!",e)}return!1},Ae.executeAd=async function(e,o,i){if(!o||!e)return!1;if(w.IsCMPAvailable()){t.logInfo("Waiting for CMP to respond...");try{await w.WaitForConsent()}catch(e){t.logError(e,"Failed to wait for consent!")}t.logInfo("Consent responded! Continuing...")}const r=n.crawlToPost(o);if(!r)return t.logProblem("Could not find post element for adUnit",e),!1;if(await s.invokeFallback(e,r)){t.logInfo("Advertisement successfully loaded",e);for(let e of Se)try{e(r)}catch(e){t.logError(e,"Failed to execute success event!",e)}return!0}t.logInfo("Advertisement has failed to load",e);for(let e of Re)try{e(r)}catch(e){t.logError(e,"Failed to execute failed event!",e)}return!1};let qe="https://sync2.adnetwork.agency/image?pbjs=1";w.getTCString().then((function(e){qe+="&gdpr=1&gdpr_consent="+e,De(qe)})).catch((function(e){t.logError(e,"Failed to find tcString!"),De(qe)})),k.init().then((function(){if(t.logInfo("Header bidding engine successfully initialized!"),t.logInfo("Cleaning existing queue..."),Array.isArray(Fe.queue)){for(let e of Fe.queue)try{e()}catch(n){t.logError(n,"Failed to execute function!",e)}Fe.queue={push:function(e){try{e()}catch(n){t.logError("Failed to execute function!",e)}}}}t.logInfo("Queue cleared!"),t.logInfo("Setting sendQueue processor"),setInterval((function(){if(0==Ee.sendQueue.length)return;const e=n.findHighestWindow(),o=n.findHighestDocument(),i={domain:e!=top?n.fixDomain(o.referrer):n.fixDomain(e.location.host),requests:Ee.sendQueue};Ee.sendQueue=[];const r=new XMLHttpRequest;r.open("POST","".concat("https://hb.contentexchange.me/stats","/request")),r.setRequestHeader("Content-Type","application/json;charset=UTF-8"),r.send(JSON.stringify(i)),t.logInfo("Sending batched request data",i)}),50)})).catch((function(e){return t.logError(e,"Failed to initialize header bidding engine!")}));var He=self;for(var Be in e)He[Be]=e[Be];e.__esModule&&Object.defineProperty(He,"__esModule",{value:!0})})();