import _extends from "@babel/runtime/helpers/extends";
import { IconPositionEnum } from "./types";
// left-aligned column with left side icon
var getLeftSideConfig = function getLeftSideConfig(count, index) {
  var everySecondWithoutOffset = index % 2 ? '1' : undefined;
  var columnSize = {
    wide: '4',
    desktop: '5',
    tablet: '10'
  };
  switch (count) {
    case 2:
    case 4:
      return _extends(_extends({}, columnSize), {
        leftOffsetWide: everySecondWithoutOffset,
        leftOffsetDesktop: everySecondWithoutOffset
      });
    default:
      return _extends(_extends({}, columnSize), {
        leftOffsetDesktop: everySecondWithoutOffset
      });
  }
};
// left-aligned column with left-aligned icon on top
var getLeftTopConfig = function getLeftTopConfig(count, index) {
  var everySecondWithoutOffset = index % 2 ? '1' : undefined;
  var everyThirdWithoutOffset = index % 3 ? '1' : undefined;
  switch (count) {
    case 2:
      return {
        wide: '4',
        desktop: '4',
        tablet: '5',
        leftOffsetWide: everySecondWithoutOffset,
        leftOffsetDesktop: everySecondWithoutOffset,
        leftOffsetTablet: everySecondWithoutOffset
      };
    case 4:
      return {
        wide: '3',
        desktop: '4',
        tablet: '5',
        leftOffsetDesktop: everySecondWithoutOffset,
        leftOffsetTablet: everySecondWithoutOffset
      };
    default:
      return {
        wide: '3',
        desktop: '4',
        tablet: '5',
        leftOffsetWide: everyThirdWithoutOffset,
        leftOffsetTablet: everySecondWithoutOffset
      };
  }
};
// center-aligned column with center-aligned icon on top
var getCenterTopConfig = function getCenterTopConfig(count, index) {
  var isEvenIndex = !(index % 2);
  var everyEvenWithLeftOffset = isEvenIndex ? '1' : undefined;
  var everyOddWithRightOffset = isEvenIndex ? undefined : '1';
  switch (count) {
    case 4:
      return {
        wide: '3',
        desktop: '5',
        tablet: '5',
        leftOffsetDesktop: everyEvenWithLeftOffset,
        leftOffsetTablet: everyEvenWithLeftOffset,
        rightOffsetTablet: everyOddWithRightOffset,
        rightOffsetDesktop: everyOddWithRightOffset
      };
    default:
      return {
        wide: '4',
        desktop: '4',
        tablet: '4'
      };
  }
};
var getOneColumnConfig = function getOneColumnConfig(iconPosition) {
  return iconPosition !== IconPositionEnum.CENTER_TOP ? {
    wide: '10',
    desktop: '10',
    tablet: '10'
  } : {
    wide: '12',
    desktop: '12',
    tablet: '12'
  };
};
var getMultiColumnConfig = function getMultiColumnConfig(iconPosition, count, index) {
  switch (iconPosition) {
    case IconPositionEnum.LEFT_TOP:
      return getLeftTopConfig(count, index);
    case IconPositionEnum.CENTER_TOP:
      return getCenterTopConfig(count, index);
    default:
      return getLeftSideConfig(count, index);
  }
};
export default getMultiColumnConfig;
export { getLeftSideConfig, getLeftTopConfig, getCenterTopConfig, getOneColumnConfig };