"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _styledComponents = require("./styled-components.js");

var _overrides = require("../helpers/overrides.js");

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

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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }

function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

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; }

function Block(_ref) {
  var children = _ref.children,
      as = _ref.as,
      overrides = _ref.overrides,
      color = _ref.color,
      font = _ref.font,
      alignContent = _ref.alignContent,
      alignItems = _ref.alignItems,
      alignSelf = _ref.alignSelf,
      flexDirection = _ref.flexDirection,
      display = _ref.display,
      flex = _ref.flex,
      grid = _ref.grid,
      gridArea = _ref.gridArea,
      gridAutoColumns = _ref.gridAutoColumns,
      gridAutoFlow = _ref.gridAutoFlow,
      gridAutoRows = _ref.gridAutoRows,
      gridColumn = _ref.gridColumn,
      gridColumnEnd = _ref.gridColumnEnd,
      gridColumnGap = _ref.gridColumnGap,
      gridColumnStart = _ref.gridColumnStart,
      gridGap = _ref.gridGap,
      gridRow = _ref.gridRow,
      gridRowStart = _ref.gridRowStart,
      gridRowEnd = _ref.gridRowEnd,
      gridTemplate = _ref.gridTemplate,
      gridTemplateAreas = _ref.gridTemplateAreas,
      gridTemplateColumns = _ref.gridTemplateColumns,
      gridTemplateRows = _ref.gridTemplateRows,
      justifyContent = _ref.justifyContent,
      justifyItems = _ref.justifyItems,
      justifySelf = _ref.justifySelf,
      position = _ref.position,
      width = _ref.width,
      minWidth = _ref.minWidth,
      maxWidth = _ref.maxWidth,
      height = _ref.height,
      minHeight = _ref.minHeight,
      maxHeight = _ref.maxHeight,
      overflow = _ref.overflow,
      margin = _ref.margin,
      marginTop = _ref.marginTop,
      marginRight = _ref.marginRight,
      marginBottom = _ref.marginBottom,
      marginLeft = _ref.marginLeft,
      padding = _ref.padding,
      paddingTop = _ref.paddingTop,
      paddingRight = _ref.paddingRight,
      paddingBottom = _ref.paddingBottom,
      paddingLeft = _ref.paddingLeft,
      placeContent = _ref.placeContent,
      placeItems = _ref.placeItems,
      placeSelf = _ref.placeSelf,
      flexWrap = _ref.flexWrap,
      left = _ref.left,
      top = _ref.top,
      right = _ref.right,
      bottom = _ref.bottom,
      other = _objectWithoutProperties(_ref, ["children", "as", "overrides", "color", "font", "alignContent", "alignItems", "alignSelf", "flexDirection", "display", "flex", "grid", "gridArea", "gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridColumn", "gridColumnEnd", "gridColumnGap", "gridColumnStart", "gridGap", "gridRow", "gridRowStart", "gridRowEnd", "gridTemplate", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows", "justifyContent", "justifyItems", "justifySelf", "position", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "overflow", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "placeContent", "placeItems", "placeSelf", "flexWrap", "left", "top", "right", "bottom"]);

  var _getOverrides = (0, _overrides.getOverrides)( // $FlowFixMe
  overrides.Block, _styledComponents.StyledBlock),
      _getOverrides2 = _slicedToArray(_getOverrides, 2),
      BaseBlock = _getOverrides2[0],
      baseBlockProps = _getOverrides2[1];

  return _react.default.createElement(BaseBlock, _extends({
    $as: as,
    $color: color,
    $font: font,
    $alignContent: alignContent,
    $alignItems: alignItems,
    $alignSelf: alignSelf,
    $flexDirection: flexDirection,
    $display: display,
    $flex: flex,
    $grid: grid,
    $gridArea: gridArea,
    $gridAutoColumns: gridAutoColumns,
    $gridAutoFlow: gridAutoFlow,
    $gridAutoRows: gridAutoRows,
    $gridColumn: gridColumn,
    $gridColumnEnd: gridColumnEnd,
    $gridColumnGap: gridColumnGap,
    $gridColumnStart: gridColumnStart,
    $gridGap: gridGap,
    $gridRow: gridRow,
    $gridRowStart: gridRowStart,
    $gridRowEnd: gridRowEnd,
    $gridTemplate: gridTemplate,
    $gridTemplateAreas: gridTemplateAreas,
    $gridTemplateColumns: gridTemplateColumns,
    $gridTemplateRows: gridTemplateRows,
    $justifyContent: justifyContent,
    $justifyItems: justifyItems,
    $justifySelf: justifySelf,
    $position: position,
    $width: width,
    $minWidth: minWidth,
    $maxWidth: maxWidth,
    $height: height,
    $minHeight: minHeight,
    $maxHeight: maxHeight,
    $overflow: overflow,
    $margin: margin,
    $marginTop: marginTop,
    $marginRight: marginRight,
    $marginBottom: marginBottom,
    $marginLeft: marginLeft,
    $padding: padding,
    $paddingTop: paddingTop,
    $paddingRight: paddingRight,
    $paddingBottom: paddingBottom,
    $paddingLeft: paddingLeft,
    $placeContent: placeContent,
    $placeItems: placeItems,
    $placeSelf: placeSelf,
    $flexWrap: flexWrap,
    $left: left,
    $top: top,
    $right: right,
    $bottom: bottom,
    "data-baseweb": "block"
  }, other, baseBlockProps), children);
}

Block.defaultProps = {
  overrides: {},
  as: 'div'
};
var _default = Block;
exports.default = _default;