import _extends from "@babel/runtime/helpers/extends";
var columnSize = {
  wide: '4',
  desktop: '4',
  tablet: '5'
};
var isOddIndex = function isOddIndex(index) {
  return !((index + 1) % 2);
};
var getEvenOffset = function getEvenOffset(index) {
  return isOddIndex(index) ? '1' : undefined;
};
var getOddOffset = function getOddOffset(index) {
  return isOddIndex(index) ? undefined : '1';
};
var getLeftConfig = function getLeftConfig(count, index) {
  switch (count) {
    case 2:
    case 4:
      return _extends(_extends({}, columnSize), {
        leftOffsetWide: getEvenOffset(index),
        leftOffsetDesktop: getEvenOffset(index),
        leftOffsetTablet: getEvenOffset(index)
      });
    default:
      return _extends(_extends({}, columnSize), {
        leftOffsetTablet: getEvenOffset(index)
      });
  }
};
var getCenterMediumConfig = function getCenterMediumConfig(count, index) {
  switch (count) {
    case 3:
      return _extends(_extends({}, columnSize), {
        leftOffsetTablet: getOddOffset(index)
      });
    case 4:
      return _extends(_extends({}, columnSize), {
        rightOffsetWide: getOddOffset(index),
        leftOffsetWide: getEvenOffset(index),
        rightOffsetDesktop: getEvenOffset(index),
        leftOffsetDesktop: getOddOffset(index),
        rightOffsetTablet: getEvenOffset(index),
        leftOffsetTablet: getOddOffset(index)
      });
    default:
      return _extends(_extends({}, columnSize), {
        rightOffsetWide: getOddOffset(index),
        leftOffsetWide: getEvenOffset(index)
      });
  }
};
var getCenterLargeConfig = function getCenterLargeConfig(count, index) {
  switch (count) {
    case 4:
      return _extends(_extends({}, columnSize), {
        leftOffsetWide: getOddOffset(index),
        rightOffsetWide: getEvenOffset(index),
        leftOffsetDesktop: getOddOffset(index),
        rightOffsetDesktop: getEvenOffset(index),
        leftOffsetTablet: getOddOffset(index),
        rightOffsetTablet: getEvenOffset(index)
      });
    case 3:
      return _extends(_extends({}, columnSize), {
        leftOffsetTablet: getOddOffset(index)
      });
    default:
      return _extends({}, columnSize);
  }
};
var getCenterConfig = function getCenterConfig(count, index, gutterSize) {
  switch (gutterSize) {
    case 'medium':
      {
        return getCenterMediumConfig(count, index);
      }
    default:
      {
        return getCenterLargeConfig(count, index);
      }
  }
};
export default getCenterConfig;
export { columnSize, isOddIndex, getEvenOffset, getOddOffset, getLeftConfig, getCenterMediumConfig, getCenterLargeConfig };