import{d as P,j as u,k as x,l as E}from"./DCT0cttX.js";import{f as b}from"./D_qxKlPu.js";import{g as y,k as D,af as w,a as A,l as n,b as d,a4 as F,p as I,o as L,ae as S,d as k}from"#entry";const B=I({fullscreen:Boolean,scrollable:Boolean,...L(x({captureFocus:!0,origin:"center center",scrollStrategy:"block",transition:{component:E},zIndex:2400,retainFocus:!0}),["disableInitialFocus"])},"VDialog"),T=y()({name:"VDialog",props:B(),emits:{"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(e,f){let{emit:i,slots:s}=f;const r=D(e,"modelValue"),{scopeId:v}=P(),t=F();function m(){i("afterEnter"),(e.scrim||e.retainFocus)&&t.value?.contentEl&&!t.value.contentEl.contains(document.activeElement)&&t.value.contentEl.focus({preventScroll:!0})}function g(){i("afterLeave")}return w(r,async l=>{l||(await S(),t.value.activatorEl?.focus({preventScroll:!0}))}),A(()=>{const l=u.filterProps(e),V=n({"aria-haspopup":"dialog"},e.activatorProps),h=n({tabindex:-1},e.contentProps);return d(u,n({ref:t,class:["v-dialog",{"v-dialog--fullscreen":e.fullscreen,"v-dialog--scrollable":e.scrollable},e.class],style:e.style},l,{modelValue:r.value,"onUpdate:modelValue":a=>r.value=a,"aria-modal":"true",activatorProps:V,contentProps:h,height:e.fullscreen?void 0:e.height,width:e.fullscreen?void 0:e.width,maxHeight:e.fullscreen?void 0:e.maxHeight,maxWidth:e.fullscreen?void 0:e.maxWidth,role:"dialog",onAfterEnter:m,onAfterLeave:g},v),{activator:s.activator,default:function(){for(var a=arguments.length,c=new Array(a),o=0;o<a;o++)c[o]=arguments[o];return d(k,{root:"VDialog"},{default:()=>[s.default?.(...c)]})}})}),b({},t)}});export{T as V};
