import{d as k,ae as X,p as B,e as v,o as f,f as T,M as h,r,n as t,a as e,O as Y,Q as E,w as n,c as F,X as G,V as S,g as z,b as H,u as W,q as w,y as Z,D as x,m as ee,az as oe,E as se,T as ae,ah as le,h as te}from"./index-11843334.js";import{u as ne,a as re,b as ie}from"./el-message-box-9fd7f437.js";import{E as de,_ as N,ab as ce,u as P}from"./el-button-7b435908.js";import{b as ue,c as fe,d as pe,a as me,u as ge}from"./use-dialog-90edb7a0.js";import{F as ve,c as be}from"./el-scrollbar-654ee4cf.js";import{c as ye}from"./el-dropdown-item-9b77b9ae.js";const O=Symbol("dialogInjectionKey"),Ce=["aria-level"],he=["aria-label"],Ee=["id"],ke=k({name:"ElDialogContent"}),Re=k({...ke,props:ue,emits:fe,setup(R){const l=R,{t:i}=X(),{Close:$}=ce,{dialogRef:d,headerRef:p,bodyId:D,ns:s,style:m}=B(O),{focusTrapRef:b}=B(ve),y=v(()=>[s.b(),s.is("fullscreen",l.fullscreen),s.is("draggable",l.draggable),s.is("align-center",l.alignCenter),{[s.m("center")]:l.center},l.customClass]),A=ye(b,d),I=v(()=>l.draggable);return ne(d,p,I),(a,C)=>(f(),T("div",{ref:e(A),class:t(e(y)),style:z(e(m)),tabindex:"-1"},[h("header",{ref_key:"headerRef",ref:p,class:t(e(s).e("header"))},[r(a.$slots,"header",{},()=>[h("span",{role:"heading","aria-level":a.ariaLevel,class:t(e(s).e("title"))},Y(a.title),11,Ce)]),a.showClose?(f(),T("button",{key:0,"aria-label":e(i)("el.dialog.close"),class:t(e(s).e("headerbtn")),type:"button",onClick:C[0]||(C[0]=L=>a.$emit("close"))},[E(e(de),{class:t(e(s).e("close"))},{default:n(()=>[(f(),F(G(a.closeIcon||e($))))]),_:1},8,["class"])],10,he)):S("v-if",!0)],2),h("div",{id:e(D),class:t(e(s).e("body"))},[r(a.$slots,"default")],10,Ee),a.$slots.footer?(f(),T("footer",{key:0,class:t(e(s).e("footer"))},[r(a.$slots,"footer")],2)):S("v-if",!0)],6))}});var $e=N(Re,[["__file","dialog-content.vue"]]);const De=["aria-label","aria-labelledby","aria-describedby"],Ae=k({name:"ElDialog",inheritAttrs:!1}),Ie=k({...Ae,props:pe,emits:me,setup(R,{expose:l}){const i=R,$=H();P({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},v(()=>!!$.title)),P({scope:"el-dialog",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/dialog.html#attributes",type:"Attribute"},v(()=>!!i.customClass));const d=W("dialog"),p=w(),D=w(),s=w(),{visible:m,titleId:b,bodyId:y,style:A,overlayDialogStyle:I,rendered:a,zIndex:C,afterEnter:L,afterLeave:q,beforeLeave:K,handleClose:M,onModalClick:V,onOpenAutoFocus:j,onCloseAutoFocus:U,onCloseRequested:_,onFocusoutPrevented:J}=ge(i,p);Z(O,{dialogRef:p,headerRef:D,bodyId:y,ns:d,rendered:a,style:A});const c=ie(V),Q=v(()=>i.draggable&&!i.fullscreen);return l({visible:m,dialogContentRef:s}),(o,u)=>(f(),F(le,{to:o.appendTo,disabled:o.appendTo!=="body"?!1:!o.appendToBody},[E(ae,{name:"dialog-fade",onAfterEnter:e(L),onAfterLeave:e(q),onBeforeLeave:e(K),persisted:""},{default:n(()=>[x(E(e(re),{"custom-mask-event":"",mask:o.modal,"overlay-class":o.modalClass,"z-index":e(C)},{default:n(()=>[h("div",{role:"dialog","aria-modal":"true","aria-label":o.title||void 0,"aria-labelledby":o.title?void 0:e(b),"aria-describedby":e(y),class:t(`${e(d).namespace.value}-overlay-dialog`),style:z(e(I)),onClick:u[0]||(u[0]=(...g)=>e(c).onClick&&e(c).onClick(...g)),onMousedown:u[1]||(u[1]=(...g)=>e(c).onMousedown&&e(c).onMousedown(...g)),onMouseup:u[2]||(u[2]=(...g)=>e(c).onMouseup&&e(c).onMouseup(...g))},[E(e(be),{loop:"",trapped:e(m),"focus-start-el":"container",onFocusAfterTrapped:e(j),onFocusAfterReleased:e(U),onFocusoutPrevented:e(J),onReleaseRequested:e(_)},{default:n(()=>[e(a)?(f(),F($e,ee({key:0,ref_key:"dialogContentRef",ref:s},o.$attrs,{"custom-class":o.customClass,center:o.center,"align-center":o.alignCenter,"close-icon":o.closeIcon,draggable:e(Q),fullscreen:o.fullscreen,"show-close":o.showClose,title:o.title,"aria-level":o.headerAriaLevel,onClose:e(M)}),oe({header:n(()=>[o.$slots.title?r(o.$slots,"title",{key:1}):r(o.$slots,"header",{key:0,close:e(M),titleId:e(b),titleClass:e(d).e("title")})]),default:n(()=>[r(o.$slots,"default")]),_:2},[o.$slots.footer?{name:"footer",fn:n(()=>[r(o.$slots,"footer")])}:void 0]),1040,["custom-class","center","align-center","close-icon","draggable","fullscreen","show-close","title","aria-level","onClose"])):S("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,De)]),_:3},8,["mask","overlay-class","z-index"]),[[se,e(m)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["to","disabled"]))}});var Te=N(Ie,[["__file","dialog.vue"]]);const Pe=te(Te);export{Pe as E};
