import{g as j,u as t,d as w,e as y,s as B,v as C,c as b,o as d,r as l,a as c,b as u,t as L,p as g,F as z,n as I,y as k,A as N}from"./index-D86EVCbM.js";import{aE as O,m as D,j as F,l as E,E as X,$ as M}from"./ReferenceContentLoader-jQeEHBuo.js";import"./navigation-BK47qCFk.js";import{b as Q}from"./ScalarHotkey.vue-D1cXZ33d.js";const R={theme:{screens:{xs:"400px",sm:"600px",md:"800px",lg:"1000px",xl:"1200px",zoomed:{raw:"(max-width: 720px) and (max-height: 480px)"}}}};function V(){const i=R.theme.screens,r=Object.fromEntries(Object.entries(i).map(([s,e])=>[s,O(typeof e=="string"?`(min-width: ${e})`:e.raw)])),a=j(()=>Object.fromEntries(Object.entries(r).map(([s,e])=>[s,t(e)])));return{screens:i,mediaQueries:r,breakpoints:a}}const W={key:0,class:"xl:min-h-client-header flex min-h-12 items-center justify-between px-3 py-1.5 text-sm md:px-[18px] md:py-2.5"},q={class:"m-0 whitespace-nowrap text-sm font-medium"},A={class:"bg-b-1 has-[.empty-sidebar-item]:border-t-1/2 relative sticky bottom-0 z-10 w-[inherit] pt-0 md:px-2.5 md:pb-2.5"},P=w({__name:"Sidebar",props:{title:{}},setup(i){const{isSidebarOpen:r}=D(),{sidebarWidth:a,setSidebarWidth:s}=F(),{layout:e}=E(),m=y(!1),h=y(null),{breakpoints:p}=V(),$=o=>{o.preventDefault();const v=o.clientX,S=Number.parseInt(getComputedStyle(h.value).width||a.value,10),f=_=>{m.value=!0,document.body.classList.add("dragging");let n=S+_.clientX-v;n>420&&(n=420+(n-420)*.2),n<240&&(n=240),s(`${n}px`)},x=()=>{m.value=!1,document.body.classList.remove("dragging"),document.documentElement.removeEventListener("mousemove",f,!1),document.documentElement.removeEventListener("mouseup",x,!1),Number.parseInt(a.value,10)>420?s("360px"):Number.parseInt(a.value,10)<240&&s("240px")};document.documentElement.addEventListener("mousemove",f,!1),document.documentElement.addEventListener("mouseup",x,!1)};return(o,v)=>B((d(),b("aside",{ref_key:"sidebarRef",ref:h,class:g(["sidebar bg-b-1 md:border-r-1/2 relative flex min-w-full flex-1 flex-col overflow-hidden leading-3 md:min-w-fit md:flex-none md:border-b-0",{dragging:m.value}]),style:I({width:t(p).lg?t(a):"100%"})},[l(o.$slots,"header",{},void 0,!0),t(e)!=="modal"&&o.title?(d(),b("div",W,[u("h2",q,L(o.title),1),t(p).lg?c("",!0):l(o.$slots,"button",{key:0},void 0,!0)])):c("",!0),u("div",{class:g(["custom-scroll sidebar-height w-[inherit] pb-0 md:pb-[37px]",{"sidebar-mask":t(e)!=="modal"}])},[l(o.$slots,"content",{},void 0,!0)],2),t(p).lg?(d(),b(z,{key:1},[u("div",A,[l(o.$slots,"button",{},void 0,!0)]),u("div",{class:"resizer",onMousedown:$},null,32)],64)):c("",!0)],6)),[[C,t(r)]])}}),T=X(P,[["__scopeId","data-v-d9639e58"]]),U=w({__name:"SidebarButton",props:{click:{type:Function},hotkey:{}},setup(i){const r=i,{layout:a}=E(),s=()=>{r.click()};return(e,m)=>(d(),k(t(M),{class:"bg-b-1 text-c-1 hover:bg-b-2 border-1/2 group relative h-auto w-auto px-2 py-1 md:w-full md:p-1.5",icon:"Plus",variant:"outlined",onClick:s},{default:N(()=>[l(e.$slots,"title"),e.hotkey&&t(a)==="desktop"?(d(),k(Q,{key:0,class:"text-c-2 add-item-hotkey absolute right-2 hidden group-hover:opacity-80 md:block",hotkey:e.hotkey},null,8,["hotkey"])):c("",!0)]),_:3}))}});export{U as g,T as m};
