"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

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

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));

var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));

var autoAdjustOverflow = {
  adjustX: 1,
  adjustY: 1
};
var targetOffset = [0, 0];
var placements = {
  bottomLeft: {
    points: ['tl', 'tl'],
    overflow: autoAdjustOverflow,
    offset: [0, -3],
    targetOffset: targetOffset
  },
  bottomRight: {
    points: ['tr', 'tr'],
    overflow: autoAdjustOverflow,
    offset: [0, -3],
    targetOffset: targetOffset
  },
  topRight: {
    points: ['br', 'br'],
    overflow: autoAdjustOverflow,
    offset: [0, 3],
    targetOffset: targetOffset
  },
  topLeft: {
    points: ['bl', 'bl'],
    overflow: autoAdjustOverflow,
    offset: [0, 3],
    targetOffset: targetOffset
  }
};

var getPlacements = function getPlacements(placement) {
  var copyPlacements = (0, _cloneDeep["default"])(placements);

  if ((0, _typeof2["default"])(placement) === 'object') {
    for (var offset in placement) {
      if (copyPlacements[offset]) {
        copyPlacements[offset].targetOffset = placement[offset];
      }
    }
  }

  return copyPlacements;
};

exports.getPlacements = getPlacements;
var _default = placements;
exports["default"] = _default;
//# sourceMappingURL=placements.js.map
