"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("vue");function p(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 B(t,o,i){const e=d.unref(t),{width:n}=getComputedStyle(o);o.style.width=n,o.style.position="absolute",o.style.visibility="hidden",o.style.height="";const{height:r}=getComputedStyle(o);return o.style.width=i.width,o.style.position=i.position,o.style.visibility=i.visibility,o.style.height=e,o.style.overflow="hidden",i.height&&i.height!=e?i.height:r}function y(t,o,i,e,n){const r=t.animate(e,n);t.style.height=o.height,r.onfinish=()=>{t.style.overflow=o.overflow,i()}}function f(t,o,i,e){const n=d.unref(o);return[{height:n,opacity:t.opacityClosed,paddingTop:n,paddingBottom:n,borderTopWidth:n,borderBottomWidth:n,marginTop:n,marginBottom:n},{height:i,opacity:t.opacityOpen,paddingTop:e.paddingTop||0,paddingBottom:e.paddingBottom||0,borderTopWidth:e.borderTopWidth||0,borderBottomWidth:e.borderBottomWidth||0,marginTop:e.marginTop||0,marginBottom:e.marginBottom||0}]}const w=d.defineComponent({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"},eager:{type:Boolean,default:!1}},emits:["update:modelValue","open-start","open-end","close-start","close-end"],setup(t,{slots:o,attrs:i,emit:e}){const n=d.ref("0px"),r=d.computed(()=>t.timingFunctionEnter||t.timingFunction),m=d.computed(()=>t.timingFunctionLeave||t.timingFunction);function b(g,l){const a=g,s=p(a),u=B(n,a,s),c=f(t,n,u,s),h={duration:t.duration,easing:r.value};y(a,s,()=>{l(),e("open-end")},c,h)}function v(g,l){const a=g,s=p(a),{height:u}=getComputedStyle(a);a.style.height=u,a.style.overflow="hidden";const c=f(t,n,u,s).reverse(),h={duration:t.duration,easing:m.value};y(a,s,()=>{l(),e("close-end")},c,h)}return()=>d.h(d.Transition,{css:!1,persisted:t.eager,onBeforeEnter:()=>e("open-start"),onEnter:b,onBeforeLeave:()=>e("close-start"),onLeave:v},{default:()=>t.modelValue||t.eager?d.withDirectives(d.h(t.tag,d.mergeProps(i,{class:"slide-up-down__container"}),o),[t.eager?[d.vShow,t.modelValue===!0]:[null]]):null})}});exports.Vue3SlideUpDown=w;