export const useFavoriteStore = defineStore("favoriteStore", {
  persist: {
    storage: piniaPluginPersistedstate.localStorage()
  },  state: () => ({
    listTakenFromTree: undefined,
    activeEventTreeList: undefined,
    favoriteActiveTab: undefined,
    favoriteSchema: undefined,

    // researchTerms: undefined,
    researchSchema: undefined,
    researchActiveSchema: undefined,
    dataForTreeMap: undefined,

    domainActive: undefined,
    activeTab: undefined,
    searchActiveTab: undefined,
    navigateListActiveTab: undefined,
    navigateListSchema: undefined,
    activeNavigateListSchema: undefined,
    navigateChartActiveTab: undefined,
    navigateChartSchema: undefined,
    activeNavigateChartSchema: undefined,
    selectionFilterItems: [],
  }),
  getters: {
    listTakenFromTreeGetter(state) {
      return state.listTakenFromTree;
    },
    activeEventTreeListGetter(state) {
      return state.activeEventTreeList;
    },
    favoriteActiveTabGetter(state) {
      return state.favoriteActiveTab;
    },
    favoriteSchemaGetter(state) {
      return state.favoriteSchema;
    },
  },
  actions: {
    SET_LIST_TAKEN_FROM_TREE(listTakenFromTree) {
      this.listTakenFromTree = listTakenFromTree;
    },
    SET_ACTIVE_EVENT_TREE_LIST(activeEventTreeList) {
      this.activeEventTreeList = activeEventTreeList;
    },
    favoriteActiveTabSetter(favoriteActiveTab) {
      this.favoriteActiveTab = favoriteActiveTab;
    },
    favoriteSchemaSetter(favoriteSchema) {
      this.favoriteSchema = favoriteSchema;
    },
  },
});
