import{g as w,r as W,K as m,a8 as h,a9 as F,a1 as S,m as v}from"./entry.Ddy3dMw-.js";function y(t){return{height:t.style.height,width:t.style.width,position:t.style.position,visibility:t.style.visibility,overflow:t.style.overflow,paddingTop:t.style.paddingTop,paddingBottom:t.style.paddingBottom,borderTopWidth:t.style.borderTopWidth,borderBottomWidth:t.style.borderBottomWidth,marginTop:t.style.marginTop,marginBottom:t.style.marginBottom}}function C(t,e,n){const i=v(t),{width:o}=getComputedStyle(e);e.style.width=o,e.style.position="absolute",e.style.visibility="hidden",e.style.height="";const{height:s}=getComputedStyle(e);return e.style.width=n.width,e.style.position=n.position,e.style.visibility=n.visibility,e.style.height=i,e.style.overflow="hidden",n.height&&n.height!=i?n.height:s}function c(t,e,n,i,o){const s=t.animate(i,o);t.style.height=e.height,s.onfinish=()=>{t.style.overflow=e.overflow,n()}}function f(t,e,n,i){const o=v(e);return[{height:o,opacity:t.opacityClosed,paddingTop:o,paddingBottom:o,borderTopWidth:o,borderBottomWidth:o,marginTop:o,marginBottom:o},{height:n,opacity:t.opacityOpen,paddingTop:i.paddingTop||0,paddingBottom:i.paddingBottom||0,borderTopWidth:i.borderTopWidth||0,borderBottomWidth:i.borderBottomWidth||0,marginTop:i.marginTop||0,marginBottom:i.marginBottom||0}]}const E=w({props:{modelValue:{type:Boolean,default:!1},duration:{type:Number,default:500},timingFunction:{type:String,default:"ease-in-out"},timingFunctionEnter:{type:String,default:null},timingFunctionLeave:{type:String,default:null},opacityOpen:{type:Number,default:1},opacityClosed:{type:Number,default:0},tag:{type:String,default:"div"}},emits:["update:modelValue","open-start","open-end","close-start","close-end"],setup(t,{slots:e,attrs:n,emit:i}){const o=W("0px"),s=m(()=>t.timingFunctionEnter||t.timingFunction),b=m(()=>t.timingFunctionLeave||t.timingFunction);function B(l,p){const d=l,r=y(d),a=C(o,d,r),g=f(t,o,a,r),u={duration:t.duration,easing:s.value};c(d,r,()=>{p(),i("open-end")},g,u)}function T(l,p){const d=l,r=y(d),{height:a}=getComputedStyle(d);d.style.height=a,d.style.overflow="hidden";const g=f(t,o,a,r).reverse(),u={duration:t.duration,easing:b.value};c(d,r,()=>{p(),i("close-end")},g,u)}return()=>h(S,{css:!1,onBeforeEnter:()=>i("open-start"),onEnter:B,onBeforeLeave:()=>i("close-start"),onLeave:T},{default:()=>t.modelValue?h(t.tag,F(n,{class:"slide-up-down__container"}),e):null})}});export{E as V};