import{dF as D,dG as S,cS as v,dL as V,d_ as w,d$ as x,e0 as E,e1 as P,e2 as $}from"./BC4hLSsA.js";import{a as l,g as b,n as B}from"./Bb-Ds3qC.js";const O=S({target:[Object,Array]},"v-dialog-transition"),y=new WeakMap,M=D()({name:"VDialogTransition",props:O(),setup(i,o){let{slots:e}=o;const r={onBeforeEnter(t){t.style.pointerEvents="none",t.style.visibility="hidden"},async onEnter(t,d){var g;await new Promise(a=>requestAnimationFrame(a)),await new Promise(a=>requestAnimationFrame(a)),t.style.visibility="";const n=F(i.target,t),{x:c,y:f,sx:h,sy:m,speed:s}=n;if(y.set(t,n),x())l(t,[{opacity:0},{}],{duration:125*s,easing:$}).finished.then(()=>d());else{const a=l(t,[{transform:`translate(${c}px, ${f}px) scale(${h}, ${m})`,opacity:0},{}],{duration:225*s,easing:$});(g=A(t))==null||g.forEach(p=>{l(p,[{opacity:0},{opacity:0,offset:.33},{}],{duration:225*2*s,easing:P})}),a.finished.then(()=>d())}},onAfterEnter(t){t.style.removeProperty("pointer-events")},onBeforeLeave(t){t.style.pointerEvents="none"},async onLeave(t,d){var g;await new Promise(a=>requestAnimationFrame(a));let n;!y.has(t)||Array.isArray(i.target)||i.target.offsetParent||i.target.getClientRects().length?n=F(i.target,t):n=y.get(t);const{x:c,y:f,sx:h,sy:m,speed:s}=n;x()?l(t,[{},{opacity:0}],{duration:85*s,easing:E}).finished.then(()=>d()):(l(t,[{},{transform:`translate(${c}px, ${f}px) scale(${h}, ${m})`,opacity:0}],{duration:125*s,easing:E}).finished.then(()=>d()),(g=A(t))==null||g.forEach(p=>{l(p,[{},{opacity:0,offset:.2},{opacity:0}],{duration:125*2*s,easing:P})}))},onAfterLeave(t){t.style.removeProperty("pointer-events")}};return()=>i.target?v(w,V({name:"dialog-transition"},r,{css:!1}),e):v(w,{name:"dialog-transition"},e)}});function A(i){var e;const o=(e=i.querySelector(":scope > .v-card, :scope > .v-sheet, :scope > .v-list"))==null?void 0:e.children;return o&&[...o]}function F(i,o){const e=b(i),r=B(o),[t,d]=getComputedStyle(o).transformOrigin.split(" ").map(C=>parseFloat(C)),[n,c]=getComputedStyle(o).getPropertyValue("--v-overlay-anchor-origin").split(" ");let f=e.left+e.width/2;n==="left"||c==="left"?f-=e.width/2:(n==="right"||c==="right")&&(f+=e.width/2);let h=e.top+e.height/2;n==="top"||c==="top"?h-=e.height/2:(n==="bottom"||c==="bottom")&&(h+=e.height/2);const m=e.width/r.width,s=e.height/r.height,g=Math.max(1,m,s),a=m/g||0,p=s/g||0,u=r.width*r.height/(window.innerWidth*window.innerHeight),T=u>.12?Math.min(1.5,(u-.12)*10+1):1;return{x:f-(t+r.left),y:h-(d+r.top),sx:a,sy:p,speed:T}}export{M as V};