import{D as e,b as t}from"./runtime-core.esm-bundler-Babufkcf.js";import{t as n}from"./runtime-dom.esm-bundler-Ce9t-RuK.js";import{t as r}from"./create-CGAkPJkS.js";var i=r({name:`QSlideTransition`,props:{appear:Boolean,duration:{type:Number,default:300}},emits:[`show`,`hide`],setup(r,{slots:i,emit:a}){let o=!1,s,c,l=null,u=null,d,f;function p(){s?.(),s=null,o=!1,l!==null&&(clearTimeout(l),l=null),u!==null&&(clearTimeout(u),u=null),c?.removeEventListener(`transitionend`,d),d=null}function m(e,t,n){t!==void 0&&(e.style.height=`${t}px`),e.style.transition=`height ${r.duration}ms cubic-bezier(.25, .8, .50, 1)`,o=!0,s=n}function h(e,t){e.style.overflowY=null,e.style.height=null,e.style.transition=null,p(),t!==f&&a(t)}function g(e,t){let n=0;c=e,o?(p(),n=e.offsetHeight===e.scrollHeight?0:void 0):(f=`hide`,e.style.overflowY=`hidden`),m(e,n,t),l=setTimeout(()=>{l=null,e.style.height=`${e.scrollHeight}px`,d=t=>{u=null,(Object(t)!==t||t.target===e)&&h(e,`show`)},e.addEventListener(`transitionend`,d),u=setTimeout(d,r.duration*1.1)},100)}function _(e,t){let n;c=e,o?p():(f=`show`,e.style.overflowY=`hidden`,n=e.scrollHeight),m(e,n,t),l=setTimeout(()=>{l=null,e.style.height=0,d=t=>{u=null,(Object(t)!==t||t.target===e)&&h(e,`hide`)},e.addEventListener(`transitionend`,d),u=setTimeout(d,r.duration*1.1)},100)}return e(()=>{o&&p()}),()=>t(n,{css:!1,appear:r.appear,onEnter:g,onLeave:_},i.default)}});export{i as t};