import{v}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{d as b,e as h,c as _,B as k,f as B,i as S,x as d,p as x}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{r as Y}from"./vendor-vue-reactivity-CheHbvBM.js";import{a as z}from"./vendor-vue-shared-DrzsEcag.js";const C={class:"ccb-popup__overlay"},P={class:"ccb-popup__wrapper"},E=b({__name:"Popup",props:{size:{}},setup(c,{expose:i}){const r=c,p=h(()=>r.size||"medium"),o=Y(!1);let t=0;const e={scrollY:0,overflow:"",position:"",top:"",width:""},u=()=>{typeof window>"u"||typeof document>"u"||(t===0&&(e.scrollY=window.scrollY,e.overflow=document.body.style.overflow,e.position=document.body.style.position,e.top=document.body.style.top,e.width=document.body.style.width,document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.top=`-${e.scrollY}px`,document.body.style.width="100%"),t++)},n=()=>{if(typeof window>"u"||typeof document>"u"||t<=0||(t--,t>0))return;const{scrollY:s,overflow:l,position:y,top:m,width:w}=e;document.body.style.overflow=l,document.body.style.position=y,document.body.style.top=m,document.body.style.width=w,window.scrollTo(0,s)},a=()=>{o.value||(u(),o.value=!0)},f=()=>{o.value&&(o.value=!1,n())};return _(()=>{o.value&&(o.value=!1,n())}),i({showPopup:a,hidePopup:f}),(s,l)=>k((S(),B("div",{class:z(["ccb-popup",{[p.value]:!0}])},[d("div",C,[d("div",P,[x(s.$slots,"default")])])],2)),[[v,o.value]])}});export{E as _};
//# sourceMappingURL=Popup.vue_vue_type_style_index_0_lang-uNTBWSeR.js.map
