export const FILTERS = [
  {
    label: 'Today',
    value: {
      stringFrom: 'now/d',
      change: {
        stringFrom: 'now-1d/d',
        stringTo: 'now-1d',
      },
      dimension: 'HOUR',
      changeDimension: 'MINUTE',
    },
  },
  {
    label: 'Today (vs 7d ago)',
    value: {
      stringFrom: 'now/d',
      stringTo: 'now/h',
      change: {
        stringFrom: 'now-7d/d',
        stringTo: 'now-7d/h',
      },
      dimension: 'HOUR',
      changeDimension: 'HOUR',
    },
  },
  {
    label: 'Yesterday',
    value: {
      stringFrom: 'now-1d/d',
      stringTo: 'now/d',
      change: {
        stringFrom: 'now-2d/d',
        stringTo: 'now-1d/d',
      },
      dimension: 'HOUR',
      changeDimension: 'HOUR',
    },
  },
  {
    label: 'Last 15 min',
    value: {
      stringFrom: 'now-22m/m',
      stringTo: 'now-7m/m',
      change: {
        stringFrom: 'now-37m/m',
        stringTo: 'now-22m/m',
      },
      dimension: 'MINUTE',
      changeDimension: 'MINUTE',
    },
  },
  {
    label: 'Current hour',
    value: {
      stringFrom: 'now/h',
      stringTo: 'now-7m/m',
      change: {
        stringFrom: 'now-1h/h',
        stringTo: 'now-1h-7m/m',
      },
      dimension: 'MINUTE',
      changeDimension: 'MINUTE',
    },
  },
  {
    label: 'Last 60 mins',
    value: {
      stringFrom: 'now-1h-7m/m',
      stringTo: 'now-7m/m',
      change: {
        stringFrom: 'now-2h-7m/m',
        stringTo: 'now-1h-7m/m',
      },
      dimension: 'MINUTE',
      changeDimension: 'MINUTE',
    },
  },
  {
    label: 'Current week',
    value: {
      stringFrom: 'now/w',
      change: {
        stringFrom: 'now-1w/w',
        stringTo: 'now-1w/h',
      },
      dimension: 'HOUR',
      changeDimension: 'HOUR',
    },
  },
  {
    label: 'Last 7 days',
    value: {
      stringFrom: 'now-6d/d',
      change: {
        stringFrom: 'now-13d/d',
        stringTo: 'now-7d/h',
      },
      dimension: 'HOUR',
      changeDimension: 'HOUR',
    },
  },
  {
    label: 'Month to date',
    value: {
      stringFrom: 'now/M',
      change: {
        stringFrom: 'now-1M/M',
        stringTo: 'now-1M/h',
      },
      dimension: 'HOUR',
      changeDimension: 'HOUR',
    },
  },
  {
    label: 'Last 30 Days',
    value: {
      stringFrom: 'now-30d/d',
      change: {
        stringFrom: 'now-60d/d',
        stringTo: 'now-30d/h',
      },
      dimension: 'HOUR',
      changeDimension: 'HOUR',
    },
  },
  {
    label: 'Previous Month',
    value: {
      stringFrom: 'now-1M/M',
      stringTo: 'now/M',
      dimension: 'HOUR',
    },
  },
];

export const FILTERS_SELF_SERVE = FILTERS.filter((_, index) => index !== 1);

export const TIME_INTERVAL_OPTIONS = [
  {
    label: '1 Min',
    value: {
      stringFrom: 'now-127m',
      stringTo: 'now-7m/m',
      interval: '1m',
      dimension: 'MINUTE',
    },
  },
  {
    label: '5 Min',
    value: {
      stringFrom: 'now-247m',
      stringTo: 'now-7m/m',
      interval: '5m',
      dimension: 'MINUTE',
    },
  },
  {
    label: 'Hour',
    value: {
      stringFrom: 'now-24h',
      interval: '1h',
      dimension: 'HOUR',
    },
  },
  {
    label: 'Day',
    value: {
      stringFrom: 'now-7d/d',
      interval: '1d',
      dimension: 'HOUR',
    },
  },
];

export const LIST_OF_META_SORTING = [
  'ID',
  'NAME',
  'SITES',
  'SUPPLIES',
  'ADVERTISERS',
  'DEMANDS',
  'TIER_PRIORITY',
  'PRICING',
  'CREATED',
  'AD_SERVING_FEES',
];

export const REFRESH_INTERVAL_TIME = 60000;

export const TABS = [
  {
    label: 'Dashboard',
    link: '/marketplace-dashboard',
    showFormatFilter: true,
  },
  {
    label: 'Supply',
    link: '/supply',
    showFormatFilter: true,
  },
  {
    label: 'Demand',
    link: '/demand',
    showFormatFilter: true,
  },
  {
    label: 'Targeting',
    link: '/key-lists/keys',
    showFormatFilter: false,
  },
];

export const TABS_SELF_SERVE = [
  {
    label: 'Supply',
    link: '/supply',
    showFormatFilter: true,
  },
  {
    label: 'Demand',
    link: '/demand',
    showFormatFilter: true,
  },
  {
    label: 'Targeting',
    link: '/key-lists/lists',
    showFormatFilter: false,
  },
];

export const STATUS_FILTERS = [
  { label: 'All', value: 'ALL' },
  {
    label: 'Active',
    value: 'ACTIVE',
  },
  {
    label: 'Disabled',
    value: 'DISABLED',
  },
];

export const FORMAT_FILTERS = [
  {
    label: 'All',
    id: null,
    format: null,
    accountType: null,
  },
  {
    label: 'Video',
    id: 'VIDEO',
    format: 'VIDEO',
    accountType: 'PUBLISHER',
  },
  {
    label: 'Display',
    id: 'DISPLAY',
    format: 'DISPLAY',
    accountType: 'PUBLISHER',
  },
  {
    label: 'Sponsored',
    id: 'SPONSORED',
    format: 'SPONSORED',
    accountType: 'PUBLISHER',
  },
];

export const FORMAT_FILTERS_SELF_SERVE = [
  {
    label: 'All',
    id: null,
    format: null,
    accountType: null,
  },
  {
    label: 'Video',
    id: 'VIDEO',
    format: 'VIDEO',
    accountType: 'PUBLISHER',
  },
  {
    label: 'Display',
    id: 'DISPLAY',
    format: 'DISPLAY',
    accountType: 'PUBLISHER',
  },
  {
    label: 'Sponsored',
    id: 'SPONSORED',
    format: 'SPONSORED',
    accountType: 'PUBLISHER',
  },
];

export const LOG_ACTIONS_CONFIG = {
  PRICING_LINE_ITEM_ADD: 'has created a pricing line item',
  TIER_CHANGE: 'has changed tier',
  PRIORITY_CHANGE: 'has changed priority',
  AD_SERVER_URL_CHANGE: 'has changed Ad server URL',
  TIMEOUT_CHANGE: 'has changed Timeout (ms)',
  NEW_RATE_CREATION: 'has created a new rate',
  NEW_ADDITIONAL_FEES_CREATION: 'has created a new additional fees',
  ANY_TARGETING_CHANGE: 'has changed targeting',
  ANY_FREQUENCY_CAP_CHANGE: 'has changed Frequency Cap',
  ANY_BUDGETING_CHANGE: 'has changed budget',
  ANY_SPECIFIC_PARAMETER_CHANGE: 'has changed (Placement ID, Site ID, etc.)',
  AI_DEFAULT_FLOOR_MANAGEMENT: 'has changed AI Default Floor Management',
  DATA_LOOK_BACK_PERIOD_CHANGE: 'has changed Data Look-Back Period',
  UPDATE_FREQUENCY_CHANGE: 'has changed Update Frequency',
  MAXIMUM_NUMBER_OF_HB_TIERS_CHANGE: 'has changed Maximum Number of HB Tiers',
  MAX_SAME_TIER_KPI_GAP_CHANGE: 'has changed Max Same Tier KPI Gap (%)',
  DEFAULT_HB_FLOR_VIEWABLE_CHANGE: 'has changed Default HB Floor - Viewable',
  DEFAULT_HB_FLOR_NON_VIEWABLE_CHANGE: 'has changed Default HB Floor - Non-Viewable',
  AUTOMATIC_OPTIMIZATION_STATUS_CHANGE: 'has changed the status of Automatic Optimization',
  TARGET_KPI_CHANGE: 'has changed the Target KPI of Automatic Optimization',
  DEFAULT_HB_FLOR_FIRST_REQUEST_CHANGE: 'has changed First Request HB Floor',
  AUTOMATIC_FLOOR_PRICE_STATUS_CHANGE: 'has changed the status of Automatic Floor Adjustment',
};

export const CUSTOM_PARENT_STICKY_CLASS_NAME = 'sticky-parent-scroll-container';

export const PRIMARY_LEFT_Y_AXIS_ID = '2';
export const SECOND_LEFT_Y_AXIS_ID = '3';

export const PRIMARY_RIGHT_Y_AXIS_ID = '0';
export const SECOND_RIGHT_Y_AXIS_ID = '1';
