import{k as b,ag as C,l as c,a as w,G as d,H as k,Q as u,I as m,ac as B,O as s,a1 as a,U as f,u as t,M as H,J as x,X as S,ad as T,W}from"./BO9AmBA3.js";import{u as E}from"./Blx3Uc3i.js";import{a0 as N}from"./BmsEUx_s.js";const O={class:"fixed z-100 inset-0 bg-black bg-opacity-50"},V=["data-testid"],D=b({__name:"LayoutSidebar",props:{controller:{},side:{default:"right"},customWidth:{},customHeight:{},bgColor:{}},setup(p){const o=p,{controller:v}=C(o),{isOpen:r,close:h}=v.value;E(r);const l=c(()=>{switch(o.side){case"left":return"-translate-x-full";case"right":return"translate-x-full";case"top":return"-translate-y-full";case"bottom":return"translate-y-full";default:return""}}),n=c(()=>{switch(o.side){case"left":return"-translate-x-0";case"right":return"translate-x-0";case"top":return"-translate-y-0";case"bottom":return"-translate-y-26/50";default:return""}}),y=n,g=l,i=w();return N(i,()=>h()),(e,z)=>(d(),k(W,{to:"body"},[u(f,{"enter-active-class":"transition ease-out duration-200 transform","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition ease-in duration-300 transform","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:m(()=>[B(s("div",O,[s("div",{class:a(["flex items-start justify-center",[e.customHeight?e.customHeight:"min-h-screen"]])},[u(f,{"enter-active-class":"transition ease-out duration-500 transform","enter-from-class":t(l),"enter-to-class":t(n),"leave-active-class":"transition ease-in duration-300 transform","leave-from-class":t(y),"leave-to-class":t(g)},{default:m(()=>[t(r)?(d(),H("div",{key:0,class:a(["pointer-events-none fixed flex max-w-full",{"left-0 top-14":e.side==="left","right-0 top-14":e.side==="right","top-1/2 -translate-y-1/2":e.side==="top"||e.side==="bottom","max-h-screen overflow-y-auto":e.customHeight}]),"data-testid":`sidebar-${e.side}`},[s("div",{ref_key:"sidebarContentElement",ref:i,class:a(["pointer-events-auto w-screen",[e.customWidth?e.customWidth:"max-w-md"]])},[s("div",{class:a(["flex flex-col shadow-xl",[e.bgColor?e.bgColor:"bg-white"]])},[x(e.$slots,"default")],2)],2)],10,V)):S("",!0)]),_:3},8,["enter-from-class","enter-to-class","leave-from-class","leave-to-class"])],2)],512),[[T,t(r)]])]),_:3})]))}});export{D as _};