import{c as t,J as e,S as o,K as n,L as i}from"./_auto-entry_vgv2-CiA_x9nb.js";export{I as calculateScaleFactor,N as getAspectRatio,M as scaleAdIpadAirPortrait}from"./_auto-entry_vgv2-CiA_x9nb.js";import"react/jsx-runtime";const a=a=>{var d,l,r,s,c,u;const{adScaleConfig:v,pageContext:{deviceType:f}}=t.get();if(!(null==v?void 0:v.enabled))return;if(e(a,o.ANY_FULLSCREEN))return;const p=null!==(d=v.adsToBeScaled[f])&&void 0!==d?d:[],g=n(a.targetId.split("-")[0]);if(!p.includes(g))return;const m=null!==(r=null===(l=v.offset)||void 0===l?void 0:l[g])&&void 0!==r?r:0,w=document.getElementById(a.targetId),I=null!==(s=null==w?void 0:w.offsetWidth)&&void 0!==s?s:window.screen.width,S=null!==(u=null===(c=null==w?void 0:w.parentElement)||void 0===c?void 0:c.offsetWidth)&&void 0!==u?u:window.screen.width;i(a,(I<S?I:S)-m)};export{i as scaleAd,a as scaleAds};
