import{d as b,r as h,bY as n,aV as g,h as y,j as v,au as l,aU as k,o as i,m as B,i as C,k as $,aa as V,f as o,p as w,_ as N}from"./CCqMIw4K.js";const _=["border"],x={relative:"","h-full":"","w-full":"","of-auto":""},E=b({__name:"NDrawer",props:{modelValue:{type:Boolean},top:{},left:{},autoClose:{type:Boolean},transition:{default:"right"}},emits:["close"],setup(m,{emit:f}){const e=m,c=f,a=h(),{height:u}=n(()=>e.top,void 0,{box:"border-box"}),s=typeof e.left=="string"&&e.left.startsWith("#")?document.querySelector(e.left)?.getBoundingClientRect().width:n(()=>e.left,void 0,{box:"border-box"}).width;g(a,()=>{e.modelValue&&e.autoClose&&c("close")},{ignore:["a","button","summary",'[role="dialog"]']});const d={right:{"enter-from-class":"transform translate-x-1/1","leave-to-class":"transform translate-x-1/1"},top:{"enter-from-class":"transform translate-y--1/1","leave-to-class":"transform translate-y--1/1"},bottom:{"enter-from-class":"transform translate-y-1/1","leave-to-class":"transform translate-y-1/1"}};return(t,r)=>{const p=N;return i(),y(k,l(d[t.transition],{"enter-active-class":"duration-200 ease-in","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-out","leave-from-class":"opacity-100"}),{default:v(()=>[t.modelValue?(i(),B("div",l({key:0,ref_key:"el",ref:a,border:`${t.transition==="right"?"l":t.transition==="bottom"?"t":"b"} base`,flex:"~ col gap-1",class:{"right-0":t.transition==="right"||t.transition==="bottom"},absolute:"","bottom-0":"","z-10":"","z-20":"","of-auto":"","text-sm":"","n-glass-effect":"",style:{top:t.transition==="bottom"?"auto":`${o(u)}px`,left:t.transition==="right"&&!o(s)?"auto":`${o(s)}px`}},t.$attrs),[C(p,{absolute:"","right-2":"","top-2":"","z-20":"","text-xl":"",icon:"carbon-close",border:!1,onClick:r[0]||(r[0]=z=>t.$emit("close"))}),$("div",x,[V(t.$slots,"default")])],16,_)):w("",!0)]),_:3},16)}}});export{E as _};
