(()=>{if(window.embiInterstitialLoaded)return void console.warn("EMBI Interstitial script ya estΓ‘ cargado. Abortando ejecuciΓ³n duplicada.");window.embiInterstitialLoaded=!0;const e=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=768,t=4e3,i=1500,n=3e4,o="100% 0px",r=!1,d={fetchMarginPercent:200,renderMarginPercent:100,mobileScaling:1},s={enabled:!0,loadDelay:100},a=(...e)=>r&&console.log(...e),l=(...e)=>console.warn(...e),c=(...e)=>console.error(...e),p=window.pbjs||(window.pbjs={que:[]}),m=window.googletag=window.googletag||{};m.cmd=m.cmd||[];const u=[{slot:"/22562061343/0020-01_everardoherrera-com_intop__",tagId:"embi_footer_intop_3e470283",type:"FOOTER_INTOP",ubication:"",position:"TOP",manualInsertion:!1,mobileSizes:[[320,50],[320,100],[300,50]],desktopSizes:[[728,90],[970,90]],offset:null,tbLoaderURL:"",loadImmediately:!1,adunitMobile:{code:"embi_footer_intop_3e470283",mediaTypes:{banner:{sizes:[[320,50],[320,100],[300,50]]}},bids:[{bidder:"teads",params:{pageId:127001,placementId:138654}},{bidder:"adagio",params:{site:"everardoherrera-com",placement:"0020-01_everardoherrera-com_intop__",organizationId:"1047",adUnitElementId:"embi_footer_intop_3e470283"}},{bidder:"onetag",params:{pubId:"736328ea479779c"}},{bidder:"yandex",params:{placementId:"R-A-3584696-1"}},{bidder:"rubicon",params:{siteId:619237,zoneId:4013335,accountId:24030}},{bidder:"seedtag",params:{adUnitId:"24996781'",placement:"inArticle",publisherId:"5766-6216-01"}},{bidder:"monetixads",params:{host:"embimedia.rtb.monetixads.com",networkId:2692443626}},{bidder:"smilewanted",params:{zoneId:"embi-media.com_hb_display"}}],ortb2Imp:{ext:{gpid:"/22562061343/0020-01_everardoherrera-com_intop__",data:{pbadslot:"/22562061343/0020-01_everardoherrera-com_intop__",divId:"embi_footer_intop_3e470283"},instl:0,rwdd:0}}},adunitDesktop:{code:"embi_footer_intop_3e470283",mediaTypes:{banner:{sizes:[[728,90],[970,90]]}},bids:[{bidder:"teads",params:{pageId:127001,placementId:138654}},{bidder:"adagio",params:{site:"everardoherrera-com",placement:"0020-01_everardoherrera-com_intop__",organizationId:"1047",adUnitElementId:"embi_footer_intop_3e470283"}},{bidder:"onetag",params:{pubId:"736328ea479779c"}},{bidder:"yandex",params:{placementId:"R-A-3584696-1"}},{bidder:"rubicon",params:{siteId:619237,zoneId:4013337,accountId:24030}},{bidder:"seedtag",params:{adUnitId:"24996781'",placement:"inArticle",publisherId:"5766-6216-01"}},{bidder:"monetixads",params:{host:"embimedia.rtb.monetixads.com",networkId:2692443626}},{bidder:"smilewanted",params:{zoneId:"embi-media.com_hb_display"}}],ortb2Imp:{ext:{gpid:"/22562061343/0020-01_everardoherrera-com_intop__",data:{pbadslot:"/22562061343/0020-01_everardoherrera-com_intop__",divId:"embi_footer_intop_3e470283"},instl:0,rwdd:0}}}}];function h(e,t){if(!g(`script[src='${e}']`)){const i=document.createElement("script");i.async=t,i.type="text/javascript",i.src=e,document.head.appendChild(i)}}function f(e){try{const t=e.split(",");for(const e of t){const t=g(e);if(t)return t}return null}catch(t){return c("Error getting first location available with selectors:",e,t),null}}function g(e){try{return document.querySelector(e)}catch(t){return c("Error getting element with selector:",e,t),null}}function b(t,i=null){let n=0,o=0;if(t&&t.length>0&&t.forEach(e=>{if(Array.isArray(e)&&2===e.length){const[t,i]=e;t>n&&(n=t),i>o&&(o=i)}}),i){const t=e?i.adunitMobile:i.adunitDesktop;if(t&&t.mediaTypes&&t.mediaTypes.video&&t.mediaTypes.video.playerSize){t.mediaTypes.video.playerSize.forEach(e=>{if(Array.isArray(e)&&2===e.length){const[t,i]=e;t>n&&(n=t),i>o&&(o=i)}})}}return{maxWidth:n>0?`${n}px`:"none",maxHeight:o>0?`${o}px`:"none"}}let y;h("https://securepubads.g.doubleclick.net/tag/js/gpt.js"),h("https://embi-media.com/prebids/production/prebid.js");let v=null;function I(){if(!v||!v.parentNode)return;const e=v.parentNode;e.lastElementChild!==v&&e.appendChild(v)}const w={requestedAds:new Set,priorityAds:new Set,requestBids(e,n=!1,o=!1){try{const r=n?"Refresh":o?"Priority":"Lazy",d=o?i:t;a(`🎯 ${r} bid request for ${e} (timeout: ${d}ms)`),n||x.lastRefreshTime.set(e,Date.now()),p.que.push(()=>{p.requestBids({adUnitCodes:[e],timeout:d,bidsBackHandler:()=>{try{a(`βœ… ${r} bids received for ${e}`),p.setTargetingForGPTAsync([e]),w.refreshGAM(e)}catch(t){c(`❌ Error in bidsBackHandler for ${e}:`,t),w.fallbackGAM(e)}}})})}catch(t){c(`Error in requestBids for ${e}:`,t)}},refreshGAM(e){m.cmd.push(()=>{try{const t=m.pubads().getSlots().find(t=>t.getSlotElementId()===e);t?(a(`Refreshing GAM slot: ${e}`),m.pubads().refresh([t])):(l(`Slot not found for ${e}, using general refresh`),m.pubads().refresh())}catch(t){c(`Error refreshing GAM for ${e}:`,t)}})},fallbackGAM(e){m.cmd.push(()=>{try{l(`Fallback GAM call for ${e}`),m.pubads().refresh()}catch(t){c(`Critical fallback error for ${e}:`,t)}})},markRequested(e){this.requestedAds.add(e)},wasRequested(e){return this.requestedAds.has(e)},loadPriorityAds(){if(!s.enabled)return void a("Priority loading disabled in config");const e=u.filter(e=>e.loadImmediately);0!==e.length?(a(`πŸš€ Loading ${e.length} priority ad(s) immediately`),e.forEach(e=>{try{const t=e.tagId;if(a(`Loading priority ad: ${t}`),this.markRequested(t),this.priorityAds.add(t),this.requestBids(t,!1,!0),e.tagId2){const t=e.tagId2;a(`Loading priority ad (double box 2): ${t}`),this.markRequested(t),this.priorityAds.add(t),this.requestBids(t,!1,!0)}}catch(t){c(`Error loading priority ad ${e.tagId}:`,t)}})):a("No priority ads to load")},isPriority(e){return this.priorityAds.has(e)}},x={visibleAds:new Set,hiddenAdsInViewport:new Set,sentinelObserver:null,refreshInterval:null,sentinels:new Map,lastRefreshTime:new Map,createSentinel(e,t){try{const i=document.createElement("div");return i.id=`sentinel_${e}`,i.className="ad-sentinel",i.style.cssText="\n position: absolute;\n width: 1px;\n height: 1px;\n opacity: 0;\n pointer-events: none;\n z-index: -1;\n ",t.parentNode.insertBefore(i,t.nextSibling),this.sentinels.set(e,i),a(`Created sentinel for: ${e}`),i}catch(t){return c(`Error creating sentinel for ${e}:`,t),null}},shouldRefreshAd(e){const t=u.find(t=>t.tagId===e),i=t&&("HIGH_IMPACT"===t.type||"FOOTER_INTOP"===t.type||"DISPLAY_VIDEO_STICKY"===t.type);if(!(this.visibleAds.has(e)||this.hiddenAdsInViewport.has(e)||i))return a(` ❌ ${e} not in viewport (visible or hidden)`),!1;if(i)a(` πŸ“ ${e} is ${t.type} overlay`);else{const t=this.hiddenAdsInViewport.has(e);a(` πŸ“ ${e} is ${t?"hidden":"visible"} in viewport`)}const o=this.lastRefreshTime.get(e);if(!o)return a(` βœ… ${e} ready for first refresh (never refreshed before)`),!0;const r=Date.now()-o,d=r>=n;return a(` ${d?"βœ…":"⏳"} ${e} time since refresh: ${Math.round(r/1e3)}s / ${n/1e3}s`),d},triggerAdRefresh(e,t="entered viewport"){try{u.find(t=>t.tagId===e);if(this.shouldRefreshAd(e))a(`🎯 Triggering refresh for ${e} (${t})`),w.requestBids(e,!0),this.lastRefreshTime.set(e,Date.now());else{const t=this.lastRefreshTime.get(e),i=Math.round((Date.now()-t)/1e3);a(`⏭️ Skipping refresh for ${e} (refreshed ${i}s ago)`)}}catch(t){c(`Error triggering refresh for ${e}:`,t)}},initialize(){try{this.sentinelObserver=new IntersectionObserver(e=>{e.forEach(e=>{const t=e.target.id.replace("sentinel_","");if(e.isIntersecting){const e=document.getElementById(t);if(!e)return;const i=e.getBoundingClientRect(),n=0===i.width&&0===i.height;if(!w.wasRequested(t))a(`πŸ‘οΈ Ad entering viewport (first load): ${t}`),w.markRequested(t),w.requestBids(t,!1,!1),n?this.hiddenAdsInViewport.add(t):this.visibleAds.add(t);else if(n){const e=this.hiddenAdsInViewport.has(t);this.hiddenAdsInViewport.add(t),this.visibleAds.delete(t),a(`πŸ“ Hidden ad in viewport: ${t}`),!e&&this.shouldRefreshAd(t)&&this.triggerAdRefresh(t,"hidden ad re-entered viewport")}else{const e=this.visibleAds.has(t);this.visibleAds.add(t),this.hiddenAdsInViewport.delete(t),a(`πŸ“ Visible ad in viewport: ${t}`),!e&&this.shouldRefreshAd(t)&&this.triggerAdRefresh(t,"visible ad re-entered viewport")}}else this.hiddenAdsInViewport.delete(t),this.visibleAds.delete(t),a(`πŸ“ Ad left viewport: ${t}`)}),a(`Visible ads: ${this.visibleAds.size}, Hidden in viewport: ${this.hiddenAdsInViewport.size}`)},{rootMargin:o,threshold:0});let e=0;(function(){const e=[];return u.forEach(t=>{t.tagId&&e.push(t.tagId),t.tagId2&&e.push(t.tagId2)}),e})().forEach(t=>{const i=document.getElementById(t);if(i){const n=this.createSentinel(t,i);n&&(this.sentinelObserver.observe(n),e++,a(`πŸ‘οΈ Observing sentinel for: ${t}`))}else l(`⚠️ Ad slot not found in DOM: ${t}`)}),this.startRefreshTimer(),a(`βœ… Unified sentinel system initialized: ${e} ad units (priority ads will skip lazy load, but track for refresh)`)}catch(e){c("Error initializing refresh manager:",e)}},startRefreshTimer(){this.refreshInterval=setInterval(()=>{this.refreshVisibleAds()},n)},refreshVisibleAds(){try{const e=new Set;if(this.visibleAds.forEach(t=>e.add(t)),this.hiddenAdsInViewport.forEach(t=>e.add(t)),u.forEach(t=>{"FOOTER_INTOP"===t.type&&e.add(t.tagId)}),0===e.size)return void a("⏭️ No ads in refresh range");a(`πŸ”„ Periodic refresh: ${e.size} ad(s) (${this.visibleAds.size} visible + ${this.hiddenAdsInViewport.size} hidden + overlays)`),e.forEach(e=>{try{const t=document.getElementById(e);if(t&&this.shouldRefreshAd(e))a(`Refreshing ad: ${e}`),w.requestBids(e,!0),this.lastRefreshTime.set(e,Date.now());else if(t){const t=this.lastRefreshTime.get(e),i=Math.round((Date.now()-t)/1e3);a(`⏭️ Skipping ${e} (refreshed ${i}s ago)`)}}catch(t){c(`Error refreshing ${e}:`,t)}})}catch(e){c("Error in refreshVisibleAds:",e)}},destroy(){this.sentinelObserver&&this.sentinelObserver.disconnect(),this.refreshInterval&&clearInterval(this.refreshInterval),this.sentinels.forEach(e=>{try{e&&e.parentNode&&e.parentNode.removeChild(e)}catch(e){c("Error removing sentinel:",e)}}),this.sentinels.clear(),this.lastRefreshTime.clear(),this.visibleAds.clear(),this.hiddenAdsInViewport.clear(),a("RefreshManager cleanup complete")}};function E(t){try{const o=t.tagId,r=t.type,d=t.slot;if("HIGH_IMPACT"===r&&(INTERSTITIAL_AD_UNIT_CODE=o,INTERSTITIAL_AD_UNIT_PATH=d),t.manualInsertion&&"TABOOLA_INTEGRATION"!==t.type){if(document.getElementById(o)&&m.cmd.push(function(){m.display(o)}),t.tagId2){const s=t.tagId2;document.getElementById(s)&&m.cmd.push(function(){m.display(s)})}}else{const a=t.position,p=t.ubication,u=t.offset;function i(e,t){const i=document.createElement("script");i.textContent=`\n googletag.cmd.push(function() {\n googletag.display('${t}');\n });\n `,e.appendChild(i)}try{if("TABOOLA_INTEGRATION"===r)createTaboolaContainer(t);else if("HIGH_IMPACT"===r)INTERSTITIAL_CONTAINER=createInterstitialContainer(o),i(INTERSTITIAL_CONTAINER,o);else if("DISPLAY_VIDEO_STICKY"===r)cornerContainer=createCornerContainer(o,a,u),i(cornerContainer,o);else if("FOOTER_INTOP"===r)y=function(e,t="TOP"){const i=(v&&v.isConnected||(v=document.getElementById("embi-overlay-root"),v||(v=document.createElement("div"),v.id="embi-overlay-root",Object.assign(v.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483647"}),document.body.appendChild(v))),v),n=document.createElement("div");n.id="embi-footer-intop-ad-container",function(e,t){e.style.position="fixed",e.style.left="50%",e.style.transform="translateX(-50%)",e.style.bottom="FOOTER"===t?"0px":"auto",e.style.top="TOP"===t?"0px":"auto",e.style.zIndex="2147483647",e.style.background="transparent",e.style.display="none",e.style.transition="bottom 0.3s ease-in-out",e.style.pointerEvents="auto",e.style.textAlign="center"}(n,t);const o=document.createElement("div");return o.id=e,n.appendChild(o),n.appendChild(function(e,t){const i=document.createElement("button");i.innerHTML="Γ—",i.title="Close ad";const n="rgba(0, 0, 0, 0.6)",o="rgba(0, 0, 0, 0.8)",r="FOOTER"===t?"translate(50%, -50%)":"translate(50%, 50%)";return Object.assign(i.style,{position:"absolute",right:"0px",top:"FOOTER"===t?"0px":"auto",bottom:"TOP"===t?"0px":"auto",width:"16px",height:"16px",background:n,opacity:"1",padding:"0px",border:"none",borderRadius:"50%",color:"#fff",fontSize:"18px",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"2147483648",transform:r,transition:"background 0.2s ease, transform 0.2s ease",boxShadow:"0 2px 8px rgba(0,0,0,0.3)"}),i.addEventListener("mouseenter",()=>{i.style.background=o,i.style.transform=`${r} scale(1.1)`,i.style.boxShadow="0 4px 12px rgba(0,0,0,0.4)"}),i.addEventListener("mouseleave",()=>{i.style.background=n,i.style.transform=r,i.style.boxShadow="0 2px 8px rgba(0,0,0,0.3)"}),i.addEventListener("click",()=>{e.style.display="none"}),i}(n,t)),i.appendChild(n),I(),n}(o,a),i(y,o);else if("DOUBLE_BOX"===r){const h=f(`${p}`);if(!h)return c(`Elemento con clase '${p}' no encontrado en el DOM para el anuncio ${o}. No se pudo insertar el DIV.`),!1;const g=t.tagId2,w=e?t.mobileSizes:t.desktopSizes,{maxWidth:x,maxHeight:E}=b(w,t),_=document.createElement("div");_.id=`container_${o}`,(n=_).style.display="flex",n.style.flexDirection=e?"column":"row",n.style.gap="24px",n.style.marginBottom="24px",n.style.background="transparent",n.style.justifyContent="center",n.style.alignItems="center";const T=document.createElement("div");T.id=`wrapper_${o}`,T.className="ad-slot-wrapper",T.style.maxWidth=x,T.style.maxHeight=E,T.style.overflow="hidden",T.style.display="flex",T.style.justifyContent="center",T.style.alignItems="center";const A=document.createElement("div");A.id=o,A.className="ad-slot",A.style.minHeight="1px",i(A,o),T.appendChild(A),_.appendChild(T);const C=document.createElement("div");C.id=`wrapper_${g}`,C.className="ad-slot-wrapper",C.style.maxWidth=x,C.style.maxHeight=E,C.style.overflow="hidden",C.style.display="flex",C.style.justifyContent="center",C.style.alignItems="center";const $=document.createElement("div");switch($.id=g,$.className="ad-slot",$.style.minHeight="1px",i($,g),C.appendChild($),_.appendChild(C),a){case"INSERT_BEFORE":h.insertAdjacentElement("beforebegin",_);break;case"INSERT_AFTER":h.insertAdjacentElement("afterend",_);break;default:h.appendChild(_)}}else if("DISPLAY_VIDEO"===r){const S=f(`${p}`);if(!S)return void c(`Elemento con clase '${p}' no encontrado en el DOM para el anuncio ${o}.`);const O=e?t.mobileSizes:t.desktopSizes,{maxWidth:R,maxHeight:k}=b(O,t),B=document.createElement("div");B.id=`wrapper_${o}`,B.className="ad-slot-wrapper",B.style.maxWidth=R,B.style.maxHeight=k,B.style.overflow="hidden",B.style.margin="0 auto 24px",B.style.display="flex",B.style.justifyContent="center",B.style.alignItems="center";const D=document.createElement("div");switch(D.id=o,D.className="ad-slot",D.style.minHeight="1px",i(D,o),B.appendChild(D),a){case"INSERT_BEFORE":S.insertAdjacentElement("beforebegin",B);break;case"INSERT_AFTER":S.insertAdjacentElement("afterend",B);break;default:S.appendChild(B)}}else if(t.isSticky)cornerContainer=createCornerContainer(o,a),i(cornerContainer,o);else{const M=f(`${p}`);if(!M)return void c(`Elemento con clase '${p}' no encontrado en el DOM para el anuncio ${o}.`);const z=e?t.mobileSizes:t.desktopSizes,{maxWidth:L,maxHeight:N}=b(z,t),P=document.createElement("div");P.id=`wrapper_${o}`,P.className="ad-slot-wrapper",P.style.maxWidth=L,P.style.maxHeight=N,P.style.overflow="hidden",P.style.margin="0 auto 24px",P.style.display="flex",P.style.justifyContent="center",P.style.alignItems="center";const H=document.createElement("div");switch(H.id=o,H.className="ad-slot",H.style.minHeight="1px",i(H,o),P.appendChild(H),a){case"INSERT_BEFORE":M.insertAdjacentElement("beforebegin",P);break;case"INSERT_AFTER":M.insertAdjacentElement("afterend",P);break;default:M.appendChild(P)}}}catch(q){return c(`Error procesando el anuncio ${o}:`,q),!1}}return!0}catch(j){return l("Error inserting ad unit div for product",t.tagId,j),!1}var n}function _(){try{if(u.length>0){const n=[...u.map(t=>e?t.adunitMobile:t.adunitDesktop).filter(Boolean),...u.filter(e=>"DOUBLE_BOX"===e.type).map(t=>e?t.adunitMobile2:t.adunitDesktop2).filter(Boolean)];m.cmd.push(function(){u.filter(e=>"TABOOLA_INTEGRATION"!==e.type).forEach(t=>{try{const i=e?t.mobileSizes:t.desktopSizes;t.adSlot=m.defineSlot(t.slot,i,t.tagId).setForceSafeFrame(!1).addService(m.pubads()),"DOUBLE_BOX"===t.type&&(t.adSlotB=m.defineSlot(t.slot2,i,t.tagId2).setForceSafeFrame(!1).addService(m.pubads())),a(`GPT slot defined: ${t.tagId}`)}catch(e){c("Error creating GPT slot for product",t.tagId,e)}}),m.pubads().disableInitialLoad(),m.pubads().enableLazyLoad(d),m.pubads().collapseEmptyDivs(!0),m.pubads().setCentering(!0),m.pubads().addEventListener("slotRenderEnded",function(e){const t=e.slot.getSlotElementId();u.forEach(i=>{try{t===i.tagId&&"FOOTER_INTOP"===i.type&&(n=y,o=e.isEmpty,n&&(n.style.display=o?"none":"block",o||I()))}catch(e){c("Error rendering slot for product",i.tagId,e)}var n,o})}),m.enableServices(),a("GPT configuration complete")}),p.que.push(function(){p.setConfig({useBidCache:!0,ttlBuffer:6,timeoutBuffer:1e3,bidderTimeout:t,debug:r,priceGranularity:{buckets:[{precision:2,min:0,max:5,increment:.01},{precision:2,min:5,max:10,increment:.1},{precision:2,min:10,max:20,increment:.5}]},enableSendAllBids:!1,targetingControls:{alwaysIncludeDeals:!0},enableTIDs:!0,allowActivities:!0,deviceAccess:!0,cache:{url:"https://prebid.adnxs.com/pbc/v1/cache",ignoreBidderCacheKey:!0},realTimeData:{dataProviders:[{name:"adagio",params:{site:"everardoherrera-com",organizationId:"1047"}}]},userSync:{filterSettings:{iframe:{bidders:["adagio"],filter:"include"}}}}),p.setBidderConfig({bidders:["yandex"],config:{ortb2:{imp:{ext:{prebid:{floormin:.01}}}}}}),p.setBidderConfig({bidders:["teads"],config:{ortb2:{imp:{ext:{prebid:{floormin:.01}}}},schain:{validation:"strict",config:{ver:"1.0",complete:1,nodes:[{asi:"embi-media.com",sid:"16164",hp:1}]}}}}),p.setBidderConfig({bidders:["rubicon"],config:{ortb2:{imp:{ext:{prebid:{floormin:.01}}}},schain:{validation:"strict",config:{ver:"1.0",complete:1,nodes:[{asi:"embi-media.com",sid:"24030",hp:1}]}}}}),p.setBidderConfig({bidders:["onetag"],config:{ortb2:{imp:{ext:{prebid:{floormin:.01}}}},schain:{validation:"strict",config:{ver:"1.0",complete:1,nodes:[{asi:"embi-media.com",sid:"736328ea479779c",hp:1}]}}}}),p.setBidderConfig({bidders:["seedtag"],config:{ortb2:{imp:{ext:{prebid:{floormin:.01}}}},schain:{validation:"strict",config:{ver:"1.0",complete:1,nodes:[{asi:"embi-media.com",sid:"5e95b6c23e75750600682736",hp:1}]}}}}),p.setBidderConfig({bidders:["smilewanted"],config:{ortb2:{imp:{ext:{prebid:{floormin:.01}}}},schain:{validation:"strict",config:{ver:"1.0",complete:1,nodes:[{asi:"embi-media.com",sid:"3236",hp:1}]}}}}),p.setBidderConfig({bidders:["adagio"],config:{ortb2:{imp:{ext:{prebid:{floormin:.01}}}},schain:{validation:"strict",config:{ver:"1.0",complete:1,nodes:[{asi:"embi-media.com",sid:"1047",hp:1}]}}}}),p.setBidderConfig({bidders:["monetixads"],config:{ortb2:{imp:{ext:{prebid:{floormin:.01}}}},schain:{validation:"strict",config:{ver:"1.0",complete:1,nodes:[{asi:"embi-media.com",sid:"2692443626",hp:1}]}}}}),p.bidderSettings={standard:{storageAllowed:!0,adserverTargeting:[{key:"hb_bidder",val:function(e){return e.bidderCode}},{key:"hb_adid",val:function(e){return e.adId}},{key:"hb_pb",val:function(e){return e.pbCg}},{key:"hb_size",val:function(e){return e.size}},{key:"hb_source",val:function(e){return e.source}},{key:"hb_format",val:function(e){return e.mediaType}}]}},p.addAdUnits(n),a("Prebid configuration complete")}),u.forEach(e=>{E(e)}),setTimeout(()=>{const e=u.filter(e=>"HIGH_IMPACT"===e.type||"FOOTER_INTOP"===e.type||"DISPLAY_VIDEO_STICKY"===e.type);e.length>0&&(a("🎯 Loading overlay ads immediately..."),e.forEach(e=>{try{a(` - Requesting bids for ${e.type} ad: ${e.tagId}`),w.markRequested(e.tagId),w.requestBids(e.tagId,!1,!0)}catch(t){c(`Error loading ${e.type} ad ${e.tagId}:`,t)}}))},s.loadDelay),setTimeout(()=>{a("πŸš€ Initiating priority ad loading..."),w.loadPriorityAds()},s.loadDelay),setTimeout(()=>{a("πŸ”„ Initializing unified sentinel system (lazy load + refresh)..."),x.initialize()},s.loadDelay+100);try{const o="G-LDHL2HW58G",l=document.createElement("script");function i(){window.dataLayer.push(arguments)}l.async=!0,l.src=`https://www.googletagmanager.com/gtag/js?id=${o}`,document.head.appendChild(l),window.dataLayer=window.dataLayer||[],window.gtag=i,i("js",new Date),i("config",o,{anonymize_ip:!0,send_page_view:!0});({auctionCache:new Map,init:function(){window.pbjs=window.pbjs||{que:[]},window.googletag=window.googletag||{cmd:[]},p.que.push(()=>{p.onEvent("bidWon",e=>{this.auctionCache.set(e.adUnitCode,{bidder:e.bidder,cpm:parseFloat(e.cpm),adId:e.adId}),setTimeout(()=>this.auctionCache.delete(e.adUnitCode),25e3)})}),m.cmd.push(()=>{m.pubads().addEventListener("slotRenderEnded",e=>{this.reconcile(e)})})},reconcile:function(e){const t=e.slot.getSlotElementId();if(!u.some(e=>e.tagId===t||e.tagId2===t))return void a(`⚠️ Skipping gtag event for non-configured ad unit: ${t}`);let n=this.auctionCache.get(t);const o=e.slot.getTargeting("hb_adid")?.[0];if(!n&&o&&window.pbjs){a(`⚠️ Cache miss for ${t}, retrieving bid from Prebid by adId: ${o}`);try{const e=p.getBidResponses();for(const i in e){const r=(e[i].bids||[]).find(e=>e.adId===o);if(r){a(`βœ… Found matching bid in Prebid for ${t}`),n={bidder:r.bidder,cpm:parseFloat(r.cpm),adId:r.adId},this.auctionCache.set(t,n);break}}n||a(`❌ Could not find matching bid in Prebid responses for ${t}`)}catch(e){c(`Error retrieving bid from Prebid for ${t}:`,e)}}let r="gam_direct",d=0,s="google";e.isEmpty?r="unfilled":e.isBackfill?r="google_adx":n&&n.adId===o&&(r="prebid",d=n.cpm,s=n.bidder),i("event","ad_impression",{ad_source:r,revenue_cpm:d,bidder_name:s,ad_unit:e.slot.getAdUnitPath(),site_domain:window.location.hostname,content_path:window.location.pathname,gam_response_id:e.responseIdentifier}),this.auctionCache.delete(t)}}).init()}catch(h){c("Error gtag: ",h)}}}catch(f){c("Error in mainInitialization:",f)}finally{a("βœ… EMBI ad system initialized successfully")}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",_):_()})(),function(){"use strict";if(window.vidvertoCornerScriptLoaded)return void console.warn("Vidverto Corner script already loaded. Aborting duplicate execution.");window.vidvertoCornerScriptLoaded=!0;const e={adSlotId:"18595",vidvertoId:"vidverto_ 18595",width:"90vw",maxWidth:"340px",aspectRatio:"16 / 9",position:"BOTTOM_RIGHT",offsetX:0,offsetY:0,mobileOffsetX:0,mobileOffsetY:0,mobileBreakpoint:768,useAbsolutePosition:!1,zIndex:"9997",borderRadius:"12px",backgroundColor:"#000",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",closeButtonColor:"rgba(0, 0, 0, 0.6)",closeButtonHoverColor:"rgba(0, 0, 0, 0.8)",animationDuration:"0.3s",showCloseButton:!0,autoShow:!0,retryAttempts:20,retryDelay:200,dimensionMonitorDuration:1e4,dimensionCheckInterval:100,debug:!1};function t(t,...i){if(e.debug)switch(t){case"log":default:console.log(...i);break;case"warn":console.warn(...i);break;case"error":console.error(...i);break;case"info":console.info(...i)}}const i={TOP_LEFT:{top:"20px",left:"20px",bottom:"auto",right:"auto"},TOP_RIGHT:{top:"20px",right:"20px",bottom:"auto",left:"auto"},BOTTOM_LEFT:{bottom:"20px",left:"20px",top:"auto",right:"auto"},BOTTOM_RIGHT:{bottom:"20px",right:"20px",top:"auto",left:"auto"}};let n,o,r,d,s,a=!1,l=null,c=null,p=null,m=0,u=new Set,h=!1,f=!1,g=null;function b(){if(!g||!g.parentNode)return;const e=g.parentNode;e.lastElementChild!==g&&(e.appendChild(g),t("log","πŸ” Overlay moved to top"))}function y(e){const n={...i[e.position]},o=function(e){return window.innerWidth{!function(){if(!n)return;const t=y(e);Object.assign(n.style,t)}()},150)}function I(e){const i=g&&g.isConnected?g:(g=document.getElementById("embi-overlay-root"),g?(t("log","βœ… Reusing existing embi-overlay-root"),g):(g=document.createElement("div"),g.id="embi-overlay-root",Object.assign(g.style,{position:"fixed",inset:"0",pointerEvents:"none",zIndex:"2147483647"}),document.body.appendChild(g),t("log","βœ… Created embi-overlay-root (main script not loaded)"),g));n=document.createElement("div"),n.id="floating-video-wrapper";const r=y(e),d={position:"fixed",zIndex:e.zIndex||"9997",display:"none",opacity:"0",transform:"translateY(20px)",transition:`opacity ${e.animationDuration} ease, transform ${e.animationDuration} ease`,pointerEvents:"auto",...r};Object.assign(n.style,d),o=document.createElement("div"),o.id="floating-video-container";const s={width:e.width,maxWidth:e.maxWidth,aspectRatio:e.aspectRatio,background:e.backgroundColor,borderRadius:e.borderRadius,overflow:"hidden",boxShadow:e.boxShadow,display:"flex",alignItems:"center",justifyContent:"center"};return Object.assign(o.style,s),n.appendChild(o),i.appendChild(n),b(),t("log","βœ… Floating video structure created with config:",e),{wrapper:n,container:o}}function w(e){if(!e.showCloseButton)return;const i=document.createElement("button");i.innerHTML="Γ—",i.title="Close video";const l={position:"absolute",top:"-20px",right:"0px",width:"16px",height:"16px",background:e.closeButtonColor,opacity:"0.2",padding:"0px",border:"none",borderRadius:"50%",color:"#fff",fontSize:"18px",fontWeight:"bold",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"2147483646",transition:"background 0.2s ease, transform 0.2s ease",boxShadow:"0 2px 8px rgba(0,0,0,0.3)",pointerEvents:"auto"};Object.assign(i.style,l),i.addEventListener("mouseenter",()=>{i.style.background=e.closeButtonHoverColor,i.style.transform="scale(1.1)",i.style.boxShadow="0 4px 12px rgba(0,0,0,0.4)"}),i.addEventListener("mouseleave",()=>{i.style.background=e.closeButtonColor,i.style.transform="scale(1)",i.style.boxShadow="0 2px 8px rgba(0,0,0,0.3)"}),i.addEventListener("click",()=>{n&&n.parentNode&&(r&&(r.disconnect(),r=null),d&&(d.disconnect(),d=null),E(),window.removeEventListener("resize",v),clearTimeout(s),n.parentNode.removeChild(n),n=null,o=null,a=!1,p=null,f=!1,h=!1,u.clear(),m=0,t("log","βœ… Floating video container completely removed"))}),n.appendChild(i)}function x(){if(!o)return!1;const i=o.querySelectorAll("div.aries_videoWrapper > div.aries_videoPlayer > div > div");let n=!1;return i.length>0&&i.forEach((i,o)=>{const r=i.id||i.outerHTML.slice(0,50),d=u.has(r),s=""!==i.style.width||""!==i.style.height;if(!d||s){t("log",`πŸ”§ Mutation: Video ${o+1}: ${d?"Dimensions reapplied":"Found new element"}, removing dimensions...`),i.style.setProperty("width","","important"),i.style.setProperty("height","","important"),i.style.setProperty("max-width","100%","important"),i.style.setProperty("max-height","100%","important");i.querySelectorAll("iframe").forEach(t=>{t.style.setProperty("max-width",e.maxWidth,"important"),t.style.setProperty("max-height",e.maxHeight,"important"),t.style.setProperty("width","100%","important"),t.style.setProperty("height","100%","important"),t.removeAttribute("width"),t.removeAttribute("height")}),u.add(r),p=i,t("log",`βœ… Mutation: Video ${o+1}: Removed/prevented width and height from:`,i),n=!0}}),n}function E(){l&&(clearInterval(l),l=null),c&&(clearTimeout(c),c=null),d&&(d.disconnect(),d=null,t("log","πŸ”Œ Mutation observer disconnected")),h=!1,t("log","⏹️ Dimension monitoring stopped")}function _(){if(f)return void t("log","⚠️ Styles already applied, skipping...");f=!0,t("log","🎨 Applying all styles after video load...");const i=o.querySelector(`div[id^="${e.vidvertoId}"]`);i&&Object.assign(i.style,{width:"100%",height:"100%",position:"absolute",top:"0",left:"0"}),$(),A(),C(),function(){if(d)return;t("log","πŸ” Setting up dimension observer for all video elements..."),d=new MutationObserver(e=>{e.some(e=>"attributes"===e.type&&"style"===e.attributeName&&e.target.matches("div.aries_videoWrapper > div.aries_videoPlayer > div > div"))?(t("log","⚠️ Style attribute changed on video element(s), reapplying to all..."),x()):x()}),d.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","id"]}),t("log","βœ… Dimension observer started for all video elements")}(),function(){if(h)return void t("log","⚠️ Dimension monitoring already active, skipping...");h=!0,t("log","πŸ” Starting continuous dimension monitoring...");let i=0;const n=e.dimensionMonitorDuration/e.dimensionCheckInterval;l=setInterval(()=>{if(i++,!o||!o.parentNode)return t("warn","Container removed, stopping dimension monitoring"),void E();i>=n&&E()},e.dimensionCheckInterval),c=setTimeout(()=>{E()},e.dimensionMonitorDuration),t("log",`βœ… Monitoring active for ${e.dimensionMonitorDuration/1e3} seconds`)}(),t("log","βœ… All styles applied and monitoring started")}function T(i=0){if(t("log",`Checking video loaded (attempt ${i+1}/${e.retryAttempts+1})`),function(){t("log","Checking if video/ad is loaded..."),t("log","Container:",o),t("log","CONFIG.ID:",e.vidvertoId);const i=o.querySelector(`div[id^="${e.vidvertoId}"]`),n=document.querySelector(`div[id*="_${e.adSlotId}_"]`);if(t("log","Dynamic div found:",i),!i)return!1;if(t("log","Video div found:",n),!n)return!1;const r=n.children.length>0;t("log","Has content:",r);const d=n.querySelector("video")||n.querySelector("iframe")||n.querySelector("canvas")||n.querySelector('[class*="video"]')||n.querySelector('[class*="player"]');t("log","Has video element:",d);const s=i.id!==e.vidvertoId,a=i.innerHTML.trim().length>0;return r&&(d||s&&a)}())return t("log","βœ… Video/ad detected as loaded, applying styles and showing container"),_(),n&&e.autoShow&&(n.style.display="block",n.offsetHeight,n.style.opacity="1",n.style.transform="translateY(0)",b()),!0;if(iT(i+1),n)}else t("warn","Video/ad not detected as loaded after maximum retries");return!1}function A(e=0,i=10){if(!o)return void t("warn","Container not available for aries div styling");const n=o.querySelectorAll('div[id^="aries_div_"]');if(0!==n.length)t("log",`🎯 Found ${n.length} aries div(s) inside floating wrapper to style`),n.forEach((e,i)=>{Object.assign(e.style,{width:"100%",height:"100%"}),t("log",`βœ… Styled aries div ${i+1}`)});else if(eA(e+1,i),t)}else t("warn","No aries divs found inside floating wrapper after maximum retries")}function C(i=0,n=10){if(!o)return void t("warn","Container not available for aries video player styling");const r=o.querySelectorAll('.aries_videoPlayer:not([class*=" "])');if(0!==r.length)t("log",`🎯 Found ${r.length} aries video player(s) inside floating wrapper to style`),r.forEach((i,n)=>{i.style.maxWidth=e.maxWidth,i.style.maxHeight=e.maxHeight,t("log",`βœ… Styled aries video player ${n+1}`)});else if(iC(i+1,n),e)}else t("warn","No aries video players found inside floating wrapper after maximum retries")}function $(i=0,n=15){if(!o)return void t("warn","Container not available for child styling");const r=o.querySelector(`div[id*="_${e.adSlotId}_"]`);if(r)return async function(){const i=[r];let n=r;for(let e=0;e<3;e++){const o=await d(n,e);if(!o){t("log",`Stopping at level ${e+1} - no more children found`);break}i.push(o),n=o}return t("log",`Total children found: ${i.length}`),i.forEach((t,i)=>{if(t){const n=3===i?{width:"100%",height:"100%",maxWidth:e.maxWidth,maxHeight:e.maxHeight}:{width:"100%",height:"100%"};Object.assign(t.style,n)}}),i.length}().then(e=>{if(0===e&&i$(i+1,n),e)}else e>0?t("log",`βœ… Successfully styled ${e} children`):t("warn","No children found after maximum retries")});if(i$(i+1,n),e)}else t("warn","First child not found inside floating wrapper after maximum retries");function d(e,t=0,i=3){return new Promise(t=>{!function i(n=0,o=5){const r=e.querySelector(":scope > div");if(r)return t(r);if(!(ni(n+1,o),50+25*n)}()})}}function S(){t("log","πŸš€ Initializing Configurable Floating Video..."),"loading"!==document.readyState?(t("log","πŸ“‹ Using configuration:",e),I(e),w(e),window.addEventListener("resize",v),r=new MutationObserver(i=>{t("log","MutationObserver triggered, mutations:",i.length);const n=o.querySelector(`div[id^="${e.vidvertoId}"]`);if(!n)return void t("log","Skipping - no dynamic div found");if(a)return void t("log","Skipping - already processed dynamic div");const d=n.children.length>0||""!==n.innerHTML.trim(),s=n.id!==e.vidvertoId;d||s?(a=!0,setTimeout(()=>{T()},500),setTimeout(()=>{r.disconnect(),t("log","MutationObserver disconnected after successful styling")},1e3)):t("log","Skipping - div has no content and is same as placeholder")}),r.observe(o,{childList:!0,subtree:!0}),function(e){const i=e.vidvertoId+Date.now(),n=document.createElement("div");n.id=e.vidvertoId,o.appendChild(n);const r=document.createElement("script");r.textContent=`\n !function(v,t,o){\n var a=t.createElement("script");\n a.src="https://ad.vidverto.io/vidverto/js/aries/v1/invocation.js";\n a.setAttribute("fetchpriority","high");\n var r=v.top;\n r.document.head.appendChild(a);\n r.aries=r.aries||{},r.aries.v1=r.aries.v1||{commands:[]};\n var c=r.aries.v1;\n c.commands.push(function(){\n var d=document.getElementById("${e.vidvertoId}");\n if (d) {\n d.setAttribute("id", "${i}");\n var t = v.frameElement || d;\n const w = d.offsetWidth || 340;\n const h = d.offsetHeight || (w * 9 / 16);\n c.mount("${e.adSlotId}", t, { width: w, height: h });\n }\n });\n }(window, document);\n `,document.body.appendChild(r),t("log","βœ… Vidverto script injected")}(e),setTimeout(()=>{T()},1e3),t("log","βœ… Configurable Floating Video initialized successfully")):document.addEventListener("DOMContentLoaded",S)}setTimeout(()=>{n||(t("log","πŸ”„ Auto-initializing with configuration"),S())},100)}();