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

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

const nameSpace = slice.name;
const formSelectors = createFormSelector(REDUX_FIELD_NAME, nameSpace);

export const idSelector = (state) => state[nameSpace].id;
// general tab
export const hubSelector = (state) => state[nameSpace].hub;
export const hubOptionsSelector = (state) => state[nameSpace].hubOptions;
export const xrayCampaignSelector = (state) => state[nameSpace].xrayCampaign;
export const xrayCampaignOptionsSelector = (state) => state[nameSpace].xrayCampaignOptions;
export const nameSelector = (state) => state[nameSpace].name;
export const statusSelector = (state) => state[nameSpace].status;
export const prioritySelector = (state) => state[nameSpace].priority;
export const xrayCreative1Selector = (state) => state[nameSpace].xrayCreative1;
export const xrayCreative2Selector = (state) => state[nameSpace].xrayCreative2;
export const xrayCreative3Selector = (state) => state[nameSpace].xrayCreative3;
export const xrayCreativeOptionsSelectors = (state) => state[nameSpace].xrayCreativeOptions;
// delivery tab
export const startTimeSelector = (state) => state[nameSpace].startTime;
export const endTimeSelector = (state) => state[nameSpace].endTime;
export const timezoneSelector = (state) => state[nameSpace].timezone;
export const timezoneOptionsSelector = (state) => state[nameSpace].timezoneOptions;
export const rateSelector = (state) => state[nameSpace].rate;
export const impressionsBudgetSelector = (state) => state[nameSpace].impressionsBudget;
export const spendBudgetSelector = (state) => state[nameSpace].spendBudget;
// targeting tab
export const watchSelectors = (state) => state[nameSpace].watch;
export const watchOptionsSelectors = (state) => state[nameSpace].watchOptions;
export const watchChannelSelectors = (state) => state[nameSpace].watchChannel;
export const watchChannelOptionsSelectors = (state) => state[nameSpace].watchChannelOptions;
export const playerSelectors = (state) => state[nameSpace].player;
export const playerOptionsSelectors = (state) => state[nameSpace].playerOptions;
export const domainsSelectors = (state) => state[nameSpace].domains;
export const domainOptionsSelectors = (state) => state[nameSpace].domainOptions;
export const devicesSelectors = (state) => state[nameSpace].devices;
export const geographySelectors = (state) => state[nameSpace].geography;
export const geographyOptionsSelectors = (state) => state[nameSpace].geographyOptions;
export const inviewSelectors = (state) => state[nameSpace].inview;
export const notInviewSelectors = (state) => state[nameSpace].notInview;
export const playerSizesSelectors = (state) => state[nameSpace].playerSizes;
export const videoSelector = (state) => state[nameSpace].video;
export const videoOptionsSelector = (state) => state[nameSpace].videoOptions;
export const videoFromTimestampSelector = (state) => state[nameSpace].videoFromTimestamp;
export const videoToTimestampSelector = (state) => state[nameSpace].videoToTimestamp;
export const iabCategoriesSelector = (state) => state[nameSpace].iabCategories;
export const peopleSelector = (state) => state[nameSpace].people;
export const peopleOptionsSelector = (state) => state[nameSpace].peopleOptions;
export const brandsSelector = (state) => state[nameSpace].brands;
export const brandsOptionsSelector = (state) => state[nameSpace].brandsOptions;
export const keywordsSelector = (state) => state[nameSpace].keywords;
export const keywordsOptionsSelector = (state) => state[nameSpace].keywordsOptions;
export const labelsSelector = (state) => state[nameSpace].labels;
export const labelsOptionsSelectors = (state) => state[nameSpace].labelsOptions;
export const brandSafetySelector = (state) => state[nameSpace].brandSafety;
export const brandSafetyOptionsSelector = (state) => state[nameSpace].brandSafetyOptions;

export const activeTabIdSelector = (state) => state[nameSpace].activeTabId;

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