import { create } from 'zustand';
const DEFAULT_HEIGHT = 300;
const MIN_HEIGHT = 150;
export const useTerminalStore = create((set) => ({
    isOpen: false,
    panelHeight: DEFAULT_HEIGHT,
    activeTabId: null,
    isMaximized: false,
    get isExpanded() {
        return this.isOpen;
    },
    get selectedTerminalId() {
        return this.activeTabId;
    },
    openPanel: () => set({ isOpen: true }),
    closePanel: () => set({ isOpen: false, isMaximized: false }),
    togglePanel: () => set((s) => ({
        isOpen: !s.isOpen,
        isMaximized: !s.isOpen ? s.isMaximized : false,
    })),
    setPanelHeight: (height) => set({ panelHeight: Math.max(MIN_HEIGHT, height) }),
    selectTab: (id) => set({ activeTabId: id, isOpen: true }),
    toggleMaximize: () => set((s) => ({ isMaximized: !s.isMaximized })),
    expandSidebar: () => set({ isOpen: true }),
    collapseSidebar: () => set({ isOpen: false, activeTabId: null, isMaximized: false }),
    toggleSidebar: () => set((s) => ({
        isOpen: !s.isOpen,
        isMaximized: !s.isOpen ? s.isMaximized : false,
    })),
    selectTerminal: (id) => set({ activeTabId: id, isOpen: true }),
}));
//# sourceMappingURL=terminalStore.js.map