import { create } from "zustand";
import { devtools } from "zustand/middleware";
//#region src/stores/workflowStore.ts
const useWorkflowStore = create()(devtools((set) => ({
	title: "",
	setWorkflowToolbarTitle: (title) => set((state) => ({ title })),
	taskDataMap: {},
	updateTaskDataMap: (taskId, pageId, data) => set((state) => {
		const updatedTaskDataMap = { ...state.taskDataMap };
		if (updatedTaskDataMap[taskId]) if (updatedTaskDataMap[taskId][pageId]) updatedTaskDataMap[taskId][pageId] = data;
		else updatedTaskDataMap[taskId] = { [pageId]: data };
		else updatedTaskDataMap[taskId] = { [pageId]: data };
		return { taskDataMap: updatedTaskDataMap };
	}),
	setTaskDataMap: (taskId, data) => set((state) => {
		const updatedTaskDataMap = { ...state.taskDataMap };
		updatedTaskDataMap[taskId] = data;
		return { taskDataMap: updatedTaskDataMap };
	})
})));
//#endregion
export { useWorkflowStore };

//# sourceMappingURL=workflowStore.mjs.map