import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{er as t}from"./control-ui-foundation-CeFMP1Ly.js";import{fl as n,ml as r}from"./control-ui-core-pH6nakZ-.js";import{E as i,G as a,J as o,K as s,O as c,W as l,Z as u,at as d,h as f,m as p}from"./lit-runtime-BEtFSUCp.js";import{Ft as m,Ht as h,Lt as g,Rt as _,g as v,qt as y,w as b}from"./control-ui-core-Br5DB0Zj.js";import{Da as x,Oa as S}from"./control-ui-boot-Cdpgu1Gm.js";import{B as C,V as w}from"./control-ui-boot-B1lcIXow.js";import{d as T,u as E}from"./control-ui-boot-J-x6DHHT.js";import{Z as D,ot as O,q as k}from"./control-ui-boot-D1DWJlBr.js";import{a as A,n as j,r as M,t as N}from"./dock-destination-controls-qvkD_2gG.js";function P(e,t){let n=e.find(e=>e.slot===t);if(!n)throw Error(`Missing sidebar panel definition for ${t}`);return n}function F(e,t=!1){return o`
${e.icon}${e.label}
${e.shortcut?o`${e.shortcut}`:a}
`}function I(e){return e.columns[0]?.panels??[]}var L;function R(){return(R=e((()=>{l(),u(),p(),i(),N(),_(),x(),M(),b(),m(),h(),r(),E(),D(),C(),L=class extends n{constructor(...e){super(...e),this.layout={columns:[]},this.panelDefinitions=T(),this.panelTemplates={},this.panelActions={},this.availableSlots=[],this.callbacks=null,this.narrow=!1,this.availableWidth=0}deliverPanelEvent(e,t){let n=this.parentElement?.querySelector(`[data-panel-slot="${e}"]`)?.firstElementChild;return!(n instanceof HTMLElement)||typeof n.handleToggleRequest!=`function`?!1:(n.handleToggleRequest(t),!0)}panelTypes(){return this.availableSlots.map(e=>P(this.panelDefinitions,e))}renderTypeMenu(){let e=new Set(I(this.layout).map(e=>e.slot));return o`
{let n=t.detail.item.value;n&&(this.callbacks?.openSlot(n),n===`browser`&&e.has(n)&&this.deliverPanelEvent(n,new CustomEvent(v,{detail:{open:!0,newTab:!0}})))}}
>
${this.panelTypes().filter(t=>t.slot===`browser`||!e.has(t.slot)).map(e=>o`
${F(e,!0)}
`)}
`}renderHeader(e){let t=e.panels.map(e=>{let t=P(this.panelDefinitions,e.slot);return{id:e.id,domId:`side-panel-tab-${e.id}`,label:t.label,labelTooltip:t.label,icon:t.icon,closeLabel:y(`chat.sidebarColumns.close`,{panel:t.label})}}),n=e.panels.find(t=>t.id===e.activePanelId)??t[0],r=e.panels.find(e=>e.id===n?.id),i=(r?this.panelActions[r.slot]:null)??null;return o`