import{bk as n,a2 as b,_ as g}from"./cbulnwf4.js";import{q as h,k as y,R as v,a0 as l,a1 as k,O as B,Q as C,a3 as i,v as o,a2 as _,P as $,S as w,L as V}from"./vendor/json-editor-vue-huf8dypo.js";const x=["border"],N={relative:"","h-full":"","w-full":"","of-auto":""},E=h({__name:"NDrawer",props:{modelValue:{type:Boolean},top:{},left:{},autoClose:{type:Boolean},transition:{default:"right"}},emits:["close"],setup(m,{emit:c}){const e=m,f=c,a=y(),{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;b(a,()=>{e.modelValue&&e.autoClose&&f("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=g;return l(),v(V,i(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:k(()=>[t.modelValue?(l(),B("div",i({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),[_(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",N,[w(t.$slots,"default")])],16,x)):C("",!0)]),_:3},16)}}});export{E as _};
