import{C as e,Q as t,S as n,St as r,T as i,U as a,Y as o,cn as s,ct as c,dt as l,f as u,ft as d,in as f,j as p,k as m,kt as h,m as g,n as _,nn as v,ot as y,w as b,x,z as S}from"./vue.runtime.esm-bundler-DpGzKKN4.js";import{M as C,R as w,Zt as T,n as E,x as D,y as O,z as k}from"./style-DGCNsUJ6.js";import{b as A}from"./GxPagination-DOexUzbO.js";import{Ot as j,Vt as M,kt as N,o as P,rt as F,s as I}from"./vnode-DU8g6Rf7.js";import{r as L}from"./use-lockscreen-DhUbRdm_.js";import{i as R,n as z,r as B}from"./dialog-BLJqz3g4.js";var V=O({...R,direction:{type:String,default:`rtl`,values:[`ltr`,`rtl`,`ttb`,`btt`]},resizable:Boolean,size:{type:[String,Number],default:`30%`},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:`2`}}),H=B;function U(e,t){let{width:n,height:i}=w(),o=x(()=>[`ltr`,`rtl`].includes(e.direction)),s=x(()=>[`ltr`,`ttb`].includes(e.direction)?1:-1),l=x(()=>o.value?n.value:i.value),u=x(()=>k(d.value+s.value*f.value,4,l.value)),d=r(0),f=r(0),p=r(!1),m=r(!1),h=[],g=[],_=()=>{let e=t.value?.closest(`[aria-modal="true"]`);return e?o.value?e.offsetWidth:e.offsetHeight:100};c(()=>[e.size,e.resizable],()=>{m.value=!1,d.value=0,f.value=0,b()});let v=t=>{e.resizable&&(m.value||=(d.value=_(),!0),h=[t.pageX,t.pageY],p.value=!0,g.push(C(window,`mouseup`,b),C(window,`mousemove`,y)))},y=e=>{let{pageX:t,pageY:n}=e,r=t-h[0],i=n-h[1];f.value=o.value?r:i},b=()=>{h=[],d.value=u.value,f.value=0,p.value=!1,g.forEach(e=>e?.()),g=[]},S=C(t,`mousedown`,v);return a(()=>{S(),b()}),{size:x(()=>m.value?`${u.value}px`:E(e.size)),isResizing:p,isHorizontal:o}}var W=N(M(p({...p({name:`ElDrawer`,inheritAttrs:!1}),props:V,emits:H,setup(a,{expose:c}){let p=a,C=y();P({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`},x(()=>!!C.title));let w=r(),E=r(),O=r(),k=T(`drawer`),{t:M}=D(),{afterEnter:N,afterLeave:R,beforeLeave:B,visible:V,rendered:H,titleId:W,bodyId:G,zIndex:K,onModalClick:q,onOpenAutoFocus:J,onCloseAutoFocus:Y,onFocusoutPrevented:X,onCloseRequested:Z,handleClose:Q}=z(p,w),{isHorizontal:$,size:ee,isResizing:te}=U(p,O),ne=x(()=>p.modalPenetrable&&!p.modal);return c({handleClose:Q,afterEnter:N,afterLeave:R}),(r,a)=>(o(),e(h(A),{to:r.appendTo,disabled:r.appendTo===`body`?!r.appendToBody:!1},{default:l(()=>[m(_,{name:h(k).b(`fade`),onAfterEnter:h(N),onAfterLeave:h(R),onBeforeLeave:h(B),persisted:``},{default:l(()=>[d(m(h(L),{mask:r.modal,"overlay-class":[h(k).is(`drawer`),r.modalClass??``,`${h(k).namespace.value}-modal-drawer`,h(k).is(`penetrable`,h(ne))],"z-index":h(K),onClick:h(q)},{default:l(()=>[m(h(I),{loop:``,trapped:h(V),"focus-trap-el":w.value,"focus-start-el":E.value,onFocusAfterTrapped:h(J),onFocusAfterReleased:h(Y),onFocusoutPrevented:h(X),onReleaseRequested:h(Z)},{default:l(()=>[n(`div`,S({ref_key:`drawerRef`,ref:w,"aria-modal":`true`,"aria-label":r.title||void 0,"aria-labelledby":r.title?void 0:h(W),"aria-describedby":h(G)},r.$attrs,{class:[h(k).b(),r.direction,h(V)&&`open`,h(k).is(`dragging`,h(te))],style:{[h($)?`width`:`height`]:h(ee)},role:`dialog`,onClick:g(()=>{},[`stop`])}),[n(`span`,{ref_key:`focusStartRef`,ref:E,class:v(h(k).e(`sr-focus`)),tabindex:`-1`},null,2),r.withHeader?(o(),i(`header`,{key:0,class:v([h(k).e(`header`),r.headerClass])},[r.$slots.title?t(r.$slots,`title`,{key:1},()=>[b(` DEPRECATED SLOT `)]):t(r.$slots,`header`,{key:0,close:h(Q),titleId:h(W),titleClass:h(k).e(`title`)},()=>[n(`span`,{id:h(W),role:`heading`,"aria-level":r.headerAriaLevel,class:v(h(k).e(`title`))},s(r.title),11,[`id`,`aria-level`])]),r.showClose?(o(),i(`button`,{key:2,"aria-label":h(M)(`el.drawer.close`),class:v(h(k).e(`close-btn`)),type:`button`,onClick:h(Q)},[m(h(j),{class:v(h(k).e(`close`))},{default:l(()=>[m(h(F))]),_:1},8,[`class`])],10,[`aria-label`,`onClick`])):b(`v-if`,!0)],2)):b(`v-if`,!0),h(H)?(o(),i(`div`,{key:1,id:h(G),class:v([h(k).e(`body`),r.bodyClass])},[t(r.$slots,`default`)],10,[`id`])):b(`v-if`,!0),r.$slots.footer?(o(),i(`div`,{key:2,class:v([h(k).e(`footer`),r.footerClass])},[t(r.$slots,`footer`)],2)):b(`v-if`,!0),r.resizable?(o(),i(`div`,{key:3,ref_key:`draggerRef`,ref:O,style:f({zIndex:h(K)}),class:v(h(k).e(`dragger`))},null,6)):b(`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`]),[[u,h(V)]])]),_:3},8,[`name`,`onAfterEnter`,`onAfterLeave`,`onBeforeLeave`])]),_:3},8,[`to`,`disabled`]))}}),[[`__file`,`drawer.vue`]]));export{W as t};