import { create } from 'zustand';
import { useGitStore } from './gitStore';
import { useResearchStore } from './researchStore';
import { useSettingsStore } from './settingsStore';
import { useTunnelStore } from './tunnelStore';
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();
                useResearchStore.getState().collapseSidebar();
                useSettingsStore.getState().collapseSidebar();
                useTunnelStore.getState().collapseSidebar();
            }
            return { isExpanded: newExpanded };
        });
    },
    expandSidebar: () => {
        useGitStore.getState().collapseSidebar();
        useResearchStore.getState().collapseSidebar();
        useSettingsStore.getState().collapseSidebar();
        useTunnelStore.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