import{a0 as q,a2 as A,af as H,G as v,r as k,a4 as O,ap as U,o as t,g as V,w as l,h as i,aC as M,f as e,i as G,a as E,U as j,A as J,n as o,c as d,ab as f,t as K,l as r,v as Q,ai as W}from"./index-25eb6331.js";import{l as X,I as Y,E as Z,c as _,_ as x}from"./index-3bef6acb.js";import{E as ee}from"./index-db57f3ab.js";import{a as ae,b as se}from"./button-c2afb424.js";import{b as oe,c as te,u as re}from"./overlay-25bb32bf.js";const le=q({...oe,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),ie=te,de=A({name:"ElDrawer",inheritAttrs:!1}),ne=A({...de,props:le,emits:ie,setup(g,{expose:R}){const n=g,S=H();X({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},v(()=>!!S.title));const u=k(),b=k(),s=O("drawer"),{t:F}=U(),{afterEnter:y,afterLeave:h,beforeLeave:L,visible:c,rendered:T,titleId:p,bodyId:w,zIndex:B,onModalClick:D,onOpenAutoFocus:z,onCloseAutoFocus:P,onFocusoutPrevented:$,onCloseRequested:I,handleClose:m}=re(n,u),N=v(()=>n.direction==="rtl"||n.direction==="ltr"),C=v(()=>Y(n.size));return R({handleClose:m,afterEnter:y,afterLeave:h}),(a,ue)=>(t(),V(e(se),{to:a.appendTo,disabled:a.appendTo!=="body"?!1:!a.appendToBody},{default:l(()=>[i(M,{name:e(s).b("fade"),onAfterEnter:e(y),onAfterLeave:e(h),onBeforeLeave:e(L),persisted:""},{default:l(()=>[G(i(e(ee),{mask:a.modal,"overlay-class":a.modalClass,"z-index":e(B),onClick:e(D)},{default:l(()=>[i(e(ae),{loop:"",trapped:e(c),"focus-trap-el":u.value,"focus-start-el":b.value,onFocusAfterTrapped:e(z),onFocusAfterReleased:e(P),onFocusoutPrevented:e($),onReleaseRequested:e(I)},{default:l(()=>[E("div",j({ref_key:"drawerRef",ref:u,"aria-modal":"true","aria-label":a.title||void 0,"aria-labelledby":a.title?void 0:e(p),"aria-describedby":e(w)},a.$attrs,{class:[e(s).b(),a.direction,e(c)&&"open"],style:e(N)?"width: "+e(C):"height: "+e(C),role:"dialog",onClick:J(()=>{},["stop"])}),[E("span",{ref_key:"focusStartRef",ref:b,class:o(e(s).e("sr-focus")),tabindex:"-1"},null,2),a.withHeader?(t(),d("header",{key:0,class:o([e(s).e("header"),a.headerClass])},[a.$slots.title?f(a.$slots,"title",{key:1},()=>[r(" DEPRECATED SLOT ")]):f(a.$slots,"header",{key:0,close:e(m),titleId:e(p),titleClass:e(s).e("title")},()=>[a.$slots.title?r("v-if",!0):(t(),d("span",{key:0,id:e(p),role:"heading","aria-level":a.headerAriaLevel,class:o(e(s).e("title"))},K(a.title),11,["id","aria-level"]))]),a.showClose?(t(),d("button",{key:2,"aria-label":e(F)("el.drawer.close"),class:o(e(s).e("close-btn")),type:"button",onClick:e(m)},[i(e(Z),{class:o(e(s).e("close"))},{default:l(()=>[i(e(_))]),_:1},8,["class"])],10,["aria-label","onClick"])):r("v-if",!0)],2)):r("v-if",!0),e(T)?(t(),d("div",{key:1,id:e(w),class:o([e(s).e("body"),a.bodyClass])},[f(a.$slots,"default")],10,["id"])):r("v-if",!0),a.$slots.footer?(t(),d("div",{key:2,class:o([e(s).e("footer"),a.footerClass])},[f(a.$slots,"footer")],2)):r("v-if",!0)],16,["aria-label","aria-labelledby","aria-describedby","onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[Q,e(c)]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var fe=x(ne,[["__file","drawer.vue"]]);const ye=W(fe);export{ye as E};
