import { FORM_REDUX_FIELD_NAME } from '../../constants';

import { slice } from '../slices';
import createFormSelector from '@/modules/@common/Form/redux/selectors';

const nameSpace = slice.name;

export const watchTitleSelector = (state) => state[nameSpace].watchTitle;
export const watchEnvironmentSelector = (state) => state[nameSpace].watchEnvironment;
export const watchFolderNameSelector = (state) => state[nameSpace].watchFolderName;
export const watchHubSelector = (state) => state[nameSpace].watchHub;
export const idSelector = (state) => state[nameSpace].id;
export const activeTabIdSelector = (state) => state[nameSpace].activeTabId;
export const appearanceSelector = (state) => state[nameSpace].appearance;
export const titleSelector = (state) => state[nameSpace].title;
export const descriptionSelector = (state) => state[nameSpace].description;
export const sizeSelector = (state) => state[nameSpace].size;
export const designSelector = (state) => state[nameSpace].design;
export const bgSelector = (state) => state[nameSpace].bg;
export const logoSelector = (state) => state[nameSpace].logo;
export const bgLogoSelector = (state) => state[nameSpace].bgLogo;
export const titleColorSelector = (state) => state[nameSpace].titleColor;
export const descColorSelector = (state) => state[nameSpace].descColor;
export const vidTitleColorSelector = (state) => state[nameSpace].vidTitleColor;
export const vidInfoColorSelector = (state) => state[nameSpace].vidInfoColor;
export const cTitleColorSelector = (state) => state[nameSpace].cTitleColor;
export const cVidTitleColorSelector = (state) => state[nameSpace].cVidTitleColor;
export const cVidInfoColorSelector = (state) => state[nameSpace].cVidInfoColor;
export const cTitleSizeSelector = (state) => state[nameSpace].cTitleSize;
export const cVidTitleSizeSelector = (state) => state[nameSpace].cVidTitleSize;
export const cVidInfoSizeSelector = (state) => state[nameSpace].cVidInfoSize;
export const isLoadingSelector = (state) => state[nameSpace].isLoading;
export const formChangedSelector = (state) => state[nameSpace].formChanged;
export const mrssForExportSelector = (state) => state[nameSpace].MRSSForExport;
export const mrssAliasDomainSelector = (state) => state[nameSpace].MRSSAliasDomain;
export const mrssLinkUrlSelector = (state) => state[nameSpace].MRSSLinkUrl;

export const includeSponsoredContentSelector = (state) => state[nameSpace].includeSponsoredContent;
export const frequencySelector = (state) => state[nameSpace].frequency;
export const supplyTagSelector = (state) => state[nameSpace].supplyTag;
export const supplyTagOptionsSelector = (state) => state[nameSpace].supplyTagOptions;

const formSelectors = createFormSelector(FORM_REDUX_FIELD_NAME, nameSpace);

export const fullAccessToStoreFieldsForValidation = (state) => state[nameSpace];
export const scrollFieldSelector = (state) => formSelectors.getScrollField(state);
export const schemeSelector = (state) => formSelectors.schemeSelector(state);
