"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.COLORS_MAP = void 0;

var React = _interopRequireWildcard(require("react"));

var _classnames2 = _interopRequireDefault(require("classnames"));

var _excluded = ["contentArray", "aside", "className", "toRight", "clickable", "noPadding", "small", "spacedBottom", "color"];

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var COLORS_MAP = {
  white: 'white',
  transparent: 'transparent',
  'blue-20': 'blue-20',
  'gray-20': 'gray-20'
};
exports.COLORS_MAP = COLORS_MAP;

var Media = function Media(props) {
  var _props$contentArray = props.contentArray,
      contentArray = _props$contentArray === void 0 ? [] : _props$contentArray,
      aside = props.aside,
      className = props.className,
      toRight = props.toRight,
      clickable = props.clickable,
      noPadding = props.noPadding,
      small = props.small,
      spacedBottom = props.spacedBottom,
      _props$color = props.color,
      color = _props$color === void 0 ? 'white' : _props$color,
      restProps = _objectWithoutProperties(props, _excluded);

  var mediaClassName = (0, _classnames2.default)('sg-media', _defineProperty({
    'sg-media--to-right': toRight,
    'sg-media--clickable': clickable,
    'sg-media--no-padding': noPadding
  }, "sg-media--".concat(String(color)), color), className);
  var contentClassName = (0, _classnames2.default)('sg-media__content', {
    'sg-media__content--small': small,
    'sg-media__content--spaced-bottom': spacedBottom
  });
  return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
    className: mediaClassName
  }), /*#__PURE__*/React.createElement("div", {
    className: "sg-media__aside"
  }, aside), /*#__PURE__*/React.createElement("div", {
    className: "sg-media__wrapper"
  }, contentArray.map(function (content, index) {
    return /*#__PURE__*/React.createElement("div", {
      key: index,
      className: contentClassName
    }, content);
  })));
};

var _default = Media;
exports.default = _default;