import{q as h,g as u,l as b,V as x}from"./7nzMR1a0.js";import{f as E}from"./D_qxKlPu.js";import{au as w,cv as y,cP as D,cw as A,bi as l,a3 as f,bO as F,bI as I,bq as L,bk as S,q}from"#entry";const O=I({fullscreen:Boolean,scrollable:Boolean,...L(b({captureFocus:!0,origin:"center center",scrollStrategy:"block",transition:{component:x},zIndex:2400,retainFocus:!0}),["disableInitialFocus"])},"VDialog"),R=w()({name:"VDialog",props:O(),emits:{"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(e,d){let{emit:i,slots:c}=d;const r=y(e,"modelValue"),{scopeId:v}=h(),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 D(r,async n=>{n||(await S(),t.value.activatorEl?.focus({preventScroll:!0}))}),A(()=>{const n=u.filterProps(e),V=l({"aria-haspopup":"dialog"},e.activatorProps),P=l({tabindex:-1},e.contentProps);return f(u,l({ref:t,class:["v-dialog",{"v-dialog--fullscreen":e.fullscreen,"v-dialog--scrollable":e.scrollable},e.class],style:e.style},n,{modelValue:r.value,"onUpdate:modelValue":a=>r.value=a,"aria-modal":"true",activatorProps:V,contentProps:P,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:c.activator,default:function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return f(q,{root:"VDialog"},{default:()=>[c.default?.(...s)]})}})}),E({},t)}});export{R as V};
