import{Ct as e,E as t,Mt as n,P as r,W as i,X as a,_ as o,dt as s,g as c,h as l,v as u,w as d}from"./vendor/json-editor-vue-ddj4xtqm.js";import{Bn as f,Yt as p,en as m,k as h}from"#entry";var g=[`border`],_={relative:``,"h-full":``,"w-full":``,"of-auto":``},v=t({__name:`NDrawer`,props:{modelValue:{type:Boolean},top:{},left:{},autoClose:{type:Boolean},transition:{default:`right`}},emits:[`close`],setup(t,{emit:v}){let y=t,b=v,x=e(),{height:S}=m(()=>y.top,void 0,{box:`border-box`}),C=typeof y.left==`string`&&y.left.startsWith(`#`)?document.querySelector(y.left)?.getBoundingClientRect().width:m(()=>y.left,void 0,{box:`border-box`}).width;p(x,()=>{y.modelValue&&y.autoClose&&b(`close`)},{ignore:[`a`,`button`,`summary`,`[role="dialog"]`]});let w={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(e,p)=>{let m=h;return i(),c(f,r(w[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:s(()=>[t.modelValue?(i(),u(`div`,r({key:0,ref_key:`el`,ref:x,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":``,"n-glass-effect":``,"text-sm":``,style:{top:t.transition===`bottom`?`auto`:`${n(S)}px`,left:t.transition===`right`&&!n(C)?`auto`:`${n(C)}px`}},e.$attrs),[d(m,{absolute:``,"right-2":``,"top-2":``,"z-20":``,"text-xl":``,icon:`carbon-close`,border:!1,onClick:p[0]||=t=>e.$emit(`close`)}),l(`div`,_,[a(e.$slots,`default`)])],16,g)):o(``,!0)]),_:3},16)}}}),y=Object.assign(v,{__name:`NDrawer`});export{y as t};