import { create } from 'zustand';
import { useGitStore } from './gitStore';
import { useTerminalStore } from './terminalStore';
import { useResearchStore } from './researchStore';
import { useSettingsStore } from './settingsStore';
export const useSessionFilesStore = create((set) => ({
    isExpanded: false,
    selectedFile: null,
    allOperations: [],
    selectedOperationIndex: 0,
    isDiffOpen: false,
    toggleSidebar: () => {
        set((state) => {
            const newExpanded = !state.isExpanded;
            if (newExpanded) {
                useGitStore.getState().collapseSidebar();
                useTerminalStore.getState().collapseSidebar();
                useResearchStore.getState().collapseSidebar();
                useSettingsStore.getState().collapseSidebar();
            }
            return { isExpanded: newExpanded };
        });
    },
    expandSidebar: () => {
        useGitStore.getState().collapseSidebar();
        useTerminalStore.getState().collapseSidebar();
        useResearchStore.getState().collapseSidebar();
        useSettingsStore.getState().collapseSidebar();
        set({ isExpanded: true });
    },
    collapseSidebar: () => set({
        isExpanded: false,
        isDiffOpen: false,
        selectedFile: null,
        allOperations: [],
        selectedOperationIndex: 0,
    }),
    openDiff: (file, operations) => set({
        selectedFile: file,
        allOperations: operations,
        selectedOperationIndex: operations.length - 1,
        isDiffOpen: true,
        isExpanded: true,
    }),
    selectOperation: (index) => set({ selectedOperationIndex: index }),
    closeDiff: () => set({
        isDiffOpen: false,
        selectedFile: null,
        allOperations: [],
        selectedOperationIndex: 0,
    }),
}));
//# sourceMappingURL=sessionFilesStore.js.map