import{x,r as d,a as $,o as A,M as g,j as f,k as p,F as C,t as P,v as I,l as m}from"./CdnR8bhP.js";const b=["id"],O=x({name:"WidgetAdSlot",__name:"index",props:{advertID:{},mobileAdvertID:{},isNewsPage:{},adLength:{},seed:{},renderSlotID:{},isSplash:{}},setup(y){const a=d(!0),u=d(void 0),e=y,o=d(void 0),c=$(),r=d(),h=d(),S=e.isSplash;function D(){const i=window.innerWidth;u.value<1280!=i<1280&&o.value&&w(),u.value=i}function w(){a.value=!1,window.adition=(window==null?void 0:window.adition)||void 0,adition!==void 0&&adition.srq.push(function(i){o.value?i.identityService.clearOptout():i.identityService.optout(),i.completeRendering()})}return A(async()=>{var i,v;if(u.value=window.innerWidth,h.value=e==null?void 0:e.renderSlotID,window.adition!==void 0){const t=window.innerWidth<1280&&e.mobileAdvertID||e.advertID;window.adition=(window==null?void 0:window.adition)||void 0,window.adition!==void 0&&adition.srq.push(function(n){n.registerAdfarm("adfarm1.adition.com").setProfile("section","home").setProfile("subsection","").setProfile("childfriendly",(c==null?void 0:c.isChildfriendly)===!0?"true":"false"),Array.from({length:e.adLength}).forEach((s,l)=>{n.configureRenderSlot(e.renderSlotID||`mpu-slot-${l+1}${e.seed}`).setContentunitId(t).setProfile("group",e.renderSlotID||`mpu-slot-${l+1}${e.seed}`)});for(let s=0;s{var t;o.value=(t=window==null?void 0:window.OnetrustActiveGroups)==null?void 0:t.split(",").includes("C0003")}),function(t){if(t instanceof Element){const n=window.getComputedStyle(t);return n.width!=="0"&&n.height!=="0"&&n.opacity!=="0"&&n.display!=="none"&&n.visibility!=="hidden"}return!1}(document.querySelector("#onetrust-banner-sdk"))||(o.value=(v=window==null?void 0:window.OnetrustActiveGroups)==null?void 0:v.split(",").includes("C0003")),window.addEventListener("resize",D),e.isSplash&&(w(),e.renderSlotID&&(r.value=e.renderSlotID))}),g(o,()=>{window!==void 0&&(w(),e.renderSlotID&&(r.value=e.renderSlotID))}),g(a,()=>{console.log(`-- loading :${a.value} --`)}),(i,v)=>(f(),p("div",{class:I([i.isNewsPage||m(S)?"m-0":"m-4",e.renderSlotID?"w-full":"w-full container mx-auto",{"flex flex-col items-center justify-center gap-4 md:flex-row md:gap-0":m(S)!=1}])},[(f(!0),p(C,null,P(e.adLength,(t,n)=>(f(),p("div",{key:n,id:m(h)||`mpu-slot-${t}${i.seed}`,class:I(["container w-full",e.renderSlotID?"max-w-[720px]":"container mx-auto flex items-center justify-center"])},null,10,b))),128))],2))}});export{O as _};