import{bk as n,aa as b,f as g}from"./h48l6b7a.js";import{l as h,c as y,N as v,a0 as k,a2 as l,J as B,R as i,U as C,a1 as $,V,W as w,u as o,X as N}from"./vendor/json-editor-vue-hrh84odz.js";const x=["border"],z={relative:"","h-full":"","w-full":"","of-auto":""},R=h({__name:"NDrawer",props:{modelValue:{type:Boolean},top:{},left:{},autoClose:{type:Boolean},transition:{default:"right"}},emits:["close"],setup(f,{emit:m}){const e=f,c=m,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&&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=g;return i(),v(B,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:k(()=>[t.modelValue?(i(),C("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),[$(p,{absolute:"","right-2":"","top-2":"","z-20":"","text-xl":"",icon:"carbon-close",border:!1,onClick:r[0]||(r[0]=_=>t.$emit("close"))}),V("div",z,[w(t.$slots,"default")])],16,x)):N("",!0)]),_:3},16)}}});export{R as _};
