import{J as b,ah as v,O as w,cc as E}from"./index-CS0Lg7FU.js";const H=b({name:"QSlideTransition",props:{appear:Boolean,duration:{type:Number,default:300}},emits:["show","hide"],setup(r,{slots:g,emit:p}){let a=!1,d,f,i=null,o=null,n,h;function u(){d?.(),d=null,a=!1,i!==null&&(clearTimeout(i),i=null),o!==null&&(clearTimeout(o),o=null),f?.removeEventListener("transitionend",n),n=null}function c(t,e,l){e!==void 0&&(t.style.height=`${e}px`),t.style.transition=`height ${r.duration}ms cubic-bezier(.25, .8, .50, 1)`,a=!0,d=l}function m(t,e){t.style.overflowY=null,t.style.height=null,t.style.transition=null,u(),e!==h&&p(e)}function y(t,e){let l=0;f=t,a===!0?(u(),l=t.offsetHeight===t.scrollHeight?0:void 0):(h="hide",t.style.overflowY="hidden"),c(t,l,e),i=setTimeout(()=>{i=null,t.style.height=`${t.scrollHeight}px`,n=s=>{o=null,(Object(s)!==s||s.target===t)&&m(t,"show")},t.addEventListener("transitionend",n),o=setTimeout(n,r.duration*1.1)},100)}function T(t,e){let l;f=t,a===!0?u():(h="show",t.style.overflowY="hidden",l=t.scrollHeight),c(t,l,e),i=setTimeout(()=>{i=null,t.style.height=0,n=s=>{o=null,(Object(s)!==s||s.target===t)&&m(t,"hide")},t.addEventListener("transitionend",n),o=setTimeout(n,r.duration*1.1)},100)}return v(()=>{a===!0&&u()}),()=>w(E,{css:!1,appear:r.appear,onEnter:y,onLeave:T},g.default)}});export{H as Q};
