"use strict";

exports.__esModule = true;
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _useAAColorType2 = _interopRequireDefault(require("../../utils/useAAColorType"));
var _StackedAnnotations = _interopRequireDefault(require("../StackedAnnotations"));
var _Translation = _interopRequireDefault(require("./Translation"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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 getExtraInnerCompProps(annotationRange, _ref) {
  var showAminoAcidNumbers = _ref.showAminoAcidNumbers,
    getGaps = _ref.getGaps,
    isProtein = _ref.isProtein,
    colorType = _ref.colorType,
    annotationHeight = _ref.annotationHeight,
    spaceBetweenAnnotations = _ref.spaceBetweenAnnotations,
    sequenceLength = _ref.sequenceLength,
    aminoAcidNumbersHeight = _ref.aminoAcidNumbersHeight;
  var anotationHeightNoSpace = annotationHeight - spaceBetweenAnnotations;
  return {
    showAminoAcidNumbers: showAminoAcidNumbers,
    getGaps: getGaps,
    height: anotationHeightNoSpace,
    aminoAcidNumbersHeight: aminoAcidNumbersHeight,
    annotationRange: annotationRange,
    isProtein: isProtein,
    colorType: colorType,
    sequenceLength: sequenceLength
  };
}
function Translations(props) {
  var _useAAColorType = (0, _useAAColorType2["default"])(),
    colorType = _useAAColorType[0];
  return /*#__PURE__*/_react["default"].createElement(_StackedAnnotations["default"], _extends({}, props, {
    annotationRanges: props.annotationRanges.filter(function (t) {
      return !t.isJoinedLocation;
    }),
    annotationHeight: props.annotationHeight + (props.showAminoAcidNumbers ? props.aminoAcidNumbersHeight : 0),
    disregardLocations: true,
    getExtraInnerCompProps: getExtraInnerCompProps,
    InnerComp: _Translation["default"],
    colorType: colorType
  }));
}
var _default = Translations;
exports["default"] = _default;
module.exports = exports.default;