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