"use strict";

exports.__esModule = true;
exports["default"] = exports.RowView = void 0;
var _core = require("@blueprintjs/core");
var _draggableClassnames = _interopRequireDefault(require("../constants/draggableClassnames"));
var _lodash = require("lodash");
var _prepareRowData = _interopRequireDefault(require("../utils/prepareRowData"));
var _react = _interopRequireDefault(require("react"));
var _reactDraggable = _interopRequireDefault(require("react-draggable"));
var _RowItem = _interopRequireDefault(require("../RowItem"));
var _reactList = _interopRequireDefault(require("@teselagen/react-list"));
var _withEditorInteractions = _interopRequireDefault(require("../withEditorInteractions"));
var _estimateRowHeight = _interopRequireWildcard(require("./estimateRowHeight"));
var _rowviewContants = require("../constants/rowviewContants");
var _getBpsPerRow = _interopRequireDefault(require("../withEditorInteractions/getBpsPerRow"));
require("./style.css");
var _editorUtils = require("../utils/editorUtils");
var _isMobile = _interopRequireDefault(require("is-mobile"));
var _classnames = _interopRequireDefault(require("classnames"));
var _clickAndDragUtils = require("../withEditorInteractions/clickAndDragUtils");
var _reselect = require("reselect");
var _reactRedux = require("react-redux");
var _excluded = ["sequenceData", "editorClicked", "caretPosition", "backgroundRightClicked", "width", "marginWidth", "height", "truncateLabelsThatDoNotFit", "RowItemProps"];
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 _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 _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 _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function noop() {}
var rowJumpButtonStyle = {
  height: _estimateRowHeight.rowHeights.rowJumpButtons.height
};
var bounds = {
  top: 0,
  left: 0,
  right: 0,
  bottom: 0
};
var _RowView = /*#__PURE__*/function (_React$Component) {
  _inheritsLoose(_RowView, _React$Component);
  function _RowView() {
    var _this;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
    _defineProperty(_assertThisInitialized(_this), "estimateRowHeight", function (index, cache) {
      var _this$props = _this.props,
        annotationVisibility = _this$props.annotationVisibility,
        annotationLabelVisibility = _this$props.annotationLabelVisibility,
        sequenceData = _this$props.sequenceData;
      return (0, _estimateRowHeight["default"])({
        index: index,
        cache: cache,
        chromatogramData: sequenceData.chromatogramData,
        showJumpButtons: _this.showJumpButtons,
        row: _this.rowData[index],
        rowCount: _this.rowData.length,
        annotationVisibility: annotationVisibility,
        annotationLabelVisibility: annotationLabelVisibility
      });
    });
    _defineProperty(_assertThisInitialized(_this), "getNearestCursorPositionToMouseEvent", function (rowData, event, callback) {
      var _this$props2 = _this.props,
        _this$props2$charWidt = _this$props2.charWidth,
        charWidth = _this$props2$charWidt === void 0 ? _rowviewContants.defaultCharWidth : _this$props2$charWidt,
        sequenceData = _this$props2.sequenceData;
      var sequenceLength = sequenceData.noSequence ? sequenceData.size : sequenceData.sequence.length;
      var rowNotFound = true;
      var visibleRowsContainer = _this.InfiniteScroller && _this.InfiniteScroller.items;
      //loop through all the rendered rows to see if the click event lands in one of them
      var nearestCaretPos = 0;
      var selectionStartGrabbed = event.target.classList.contains(_draggableClassnames["default"].selectionStart);
      var selectionEndGrabbed = event.target.classList.contains(_draggableClassnames["default"].selectionEnd);
      (0, _lodash.some)(visibleRowsContainer.childNodes, function (rowDomNode) {
        var boundingRowRect = rowDomNode.getBoundingClientRect();
        if ((0, _editorUtils.getClientY)(event) > boundingRowRect.top && (0, _editorUtils.getClientY)(event) < boundingRowRect.top + boundingRowRect.height) {
          //then the click is falls within this row
          rowNotFound = false;
          var row = rowData[Number(rowDomNode.getAttribute("data-row-number"))];
          if ((0, _editorUtils.getClientX)(event) - boundingRowRect.left < 0) {
            nearestCaretPos = row.start;
          } else {
            var clickXPositionRelativeToRowContainer = (0, _editorUtils.getClientX)(event) - boundingRowRect.left;
            var numberOfBPsInFromRowStart = Math.floor((clickXPositionRelativeToRowContainer + charWidth / 2) / charWidth);
            nearestCaretPos = numberOfBPsInFromRowStart + row.start;
            if (nearestCaretPos > row.end + 1) {
              nearestCaretPos = row.end + 1;
            }
          }
          return true; //break the loop early because we found the row the click event landed in
        }
      });

      if (rowNotFound) {
        var _visibleRowsContainer = visibleRowsContainer.getBoundingClientRect(),
          top = _visibleRowsContainer.top,
          bottom = _visibleRowsContainer.bottom;
        var numbers = [top, bottom];
        var target = (0, _editorUtils.getClientY)(event);
        var topOrBottom = numbers.map(function (value, index) {
          return [Math.abs(value - target), index];
        }).sort().map(function (value) {
          return numbers[value[1]];
        })[0];
        var rowDomNode;
        if (topOrBottom === top) {
          rowDomNode = visibleRowsContainer.childNodes[0];
        } else {
          rowDomNode = visibleRowsContainer.childNodes[visibleRowsContainer.childNodes.length - 1];
        }
        if (rowDomNode) {
          var row = rowData[Number(rowDomNode.getAttribute("data-row-number"))];
          //return the last bp index in the rendered rows
          nearestCaretPos = row.end;
        } else {
          nearestCaretPos = 0;
        }
      }
      if (_this.props.sequenceData.isProtein) {
        nearestCaretPos = Math.round(nearestCaretPos / 3) * 3;
      }
      if (sequenceLength === 0) nearestCaretPos = 0;
      var _this$props3 = _this.props,
        updateSelectionOrCaret = _this$props3.updateSelectionOrCaret,
        caretPosition = _this$props3.caretPosition,
        selectionLayer = _this$props3.selectionLayer,
        caretPositionUpdate = _this$props3.caretPositionUpdate,
        selectionLayerUpdate = _this$props3.selectionLayerUpdate;
      callback({
        updateSelectionOrCaret: updateSelectionOrCaret,
        caretPosition: caretPosition,
        selectionLayer: selectionLayer,
        caretPositionUpdate: caretPositionUpdate,
        selectionLayerUpdate: selectionLayerUpdate,
        sequenceLength: sequenceLength,
        doNotWrapOrigin: !(_this.props.sequenceData && _this.props.sequenceData.circular),
        selectionStartGrabbed: selectionStartGrabbed,
        selectionEndGrabbed: selectionEndGrabbed,
        event: event,
        className: event.target.className,
        shiftHeld: event.shiftKey,
        nearestCaretPos: nearestCaretPos
      });
    });
    _defineProperty(_assertThisInitialized(_this), "updateScrollPosition", function (oldProps, newProps) {
      _this.cache = {};
      if (_this.dragging === true) {
        return;
      }
      var _newProps$caretPositi = newProps.caretPosition,
        caretPosition = _newProps$caretPositi === void 0 ? -1 : _newProps$caretPositi,
        _newProps$selectionLa = newProps.selectionLayer,
        selectionLayer = _newProps$selectionLa === void 0 ? {} : _newProps$selectionLa,
        _newProps$matchedSear = newProps.matchedSearchLayer,
        matchedSearchLayer = _newProps$matchedSear === void 0 ? {} : _newProps$matchedSear;
      var _oldProps$caretPositi = oldProps.caretPosition,
        caretPositionOld = _oldProps$caretPositi === void 0 ? -1 : _oldProps$caretPositi,
        _oldProps$selectionLa = oldProps.selectionLayer,
        selectionLayerOld = _oldProps$selectionLa === void 0 ? {} : _oldProps$selectionLa,
        _oldProps$matchedSear = oldProps.matchedSearchLayer,
        matchedSearchLayerOld = _oldProps$matchedSear === void 0 ? {} : _oldProps$matchedSear;
      var bpsPerRow = (0, _getBpsPerRow["default"])(newProps);
      //UPDATE THE ROW VIEW'S POSITION BASED ON CARET OR SELECTION CHANGES
      // let previousBp;
      var scrollToBp = -1;
      if (matchedSearchLayer.start > -1 && (matchedSearchLayer.forceUpdate && matchedSearchLayer.forceUpdate !== matchedSearchLayerOld.forceUpdate || matchedSearchLayer.start !== matchedSearchLayerOld.start)) {
        // previousBp = matchedSearchLayerOld.start;
        scrollToBp = matchedSearchLayer.start;
      } else if (matchedSearchLayer.end > -1 && (matchedSearchLayer.forceUpdate && matchedSearchLayer.forceUpdate !== matchedSearchLayerOld.forceUpdate || matchedSearchLayer.end !== matchedSearchLayerOld.end)) {
        // previousBp = selectionLayerOld.end;
        scrollToBp = matchedSearchLayer.end;
      } else if (caretPosition > -1 && caretPosition !== caretPositionOld) {
        // previousBp = caretPositionOld;
        scrollToBp = caretPosition;
      } else if (selectionLayer.start > -1 && (selectionLayer.forceUpdate && selectionLayer.forceUpdate !== selectionLayerOld.forceUpdate && selectionLayer.forceUpdate !== "end" || selectionLayer.start !== selectionLayerOld.start && !selectionLayer.isFromRowView)) {
        // previousBp = selectionLayerOld.start;
        scrollToBp = selectionLayer.start;
      } else if (selectionLayer.end > -1 && (selectionLayer.forceUpdate && selectionLayer.forceUpdate !== selectionLayerOld.forceUpdate && selectionLayer.forceUpdate !== "start" || selectionLayer.end !== selectionLayerOld.end && !selectionLayer.isFromRowView)) {
        // previousBp = selectionLayerOld.end;
        scrollToBp = selectionLayer.end;
      }
      if (scrollToBp > -1 && _this.InfiniteScroller && _this.InfiniteScroller.scrollTo) {
        _this.calledUpdateScrollOnce = true;
        var rowToScrollTo = Math.floor(scrollToBp / bpsPerRow);
        var _this$InfiniteScrolle = _this.InfiniteScroller.getVisibleRange(),
          start = _this$InfiniteScrolle[0],
          end = _this$InfiniteScrolle[1];
        // const jumpToBottomOfRow = scrollToBp > previousBp;
        if (rowToScrollTo < start || rowToScrollTo > end) {
          //wrap this in a set timeout to give onDoubleClick enough time to fire before jumping the rowview around
          setTimeout(function () {
            _this.InfiniteScroller && _this.InfiniteScroller.scrollTo(rowToScrollTo);
          }, 0);
          clearInterval(_this.jumpIntervalId); //tnr this was triggering a nasty error in cypress related to sinon -
          //this will try to run the following logic at most 10 times with a 100ms pause between each
          _this.jumpIntervalId = setIntervalX(function () {
            if (!_this.InfiniteScroller) return; //this might be undefined if we've already unmounted
            var _this$InfiniteScrolle2 = _this.InfiniteScroller.items.querySelectorAll("[data-row-number=\"" + rowToScrollTo + "\"]"),
              el = _this$InfiniteScrolle2[0];
            if (!el) {
              //sometimes the el isn't on the page even after the jump because of drawing issues, so we'll try the scroll one more time
              _this.InfiniteScroller && _this.InfiniteScroller.scrollTo(rowToScrollTo);
              return;
            } else {
              el.scrollIntoView && el.scrollIntoView({
                behavior: "auto",
                block: "nearest",
                inline: "nearest"
              });
              try {
                //djr I think there is some double clearing going on here causing cypress to fail so now its in a try block
                clearInterval(_this.jumpIntervalId);
              } catch (_unused) {
                console.error();
              }
            }
            //tnr: we can't use the following because it messes up the scroll of the Reflex panels
            //causing the tabs to not be shown
            // el.scrollIntoView && el.scrollIntoView();
          }, 100, 10 //tnr: we could run this more than 5 times.. doesn't really matter
          );
        }
      }
    });
    _defineProperty(_assertThisInitialized(_this), "cache", {});
    _defineProperty(_assertThisInitialized(_this), "renderItem", function (index) {
      // if (this.cache[index]) return this.cache[index];
      var _this$props4 = _this.props,
        sequenceData = _this$props4.sequenceData,
        editorClicked = _this$props4.editorClicked,
        caretPosition = _this$props4.caretPosition,
        backgroundRightClicked = _this$props4.backgroundRightClicked,
        width = _this$props4.width,
        marginWidth = _this$props4.marginWidth,
        height = _this$props4.height,
        truncateLabelsThatDoNotFit = _this$props4.truncateLabelsThatDoNotFit,
        RowItemProps = _this$props4.RowItemProps,
        rest = _objectWithoutPropertiesLoose(_this$props4, _excluded);
      var rowTopComp;
      var rowBottomComp;
      var rowData = _this.rowData;
      var bpsPerRow = _this.bpsPerRow;
      _this.showJumpButtons = rowData.length > 15;
      if (_this.showJumpButtons) {
        if (index === 0) {
          rowTopComp = /*#__PURE__*/_react["default"].createElement("div", {
            style: rowJumpButtonStyle
          }, /*#__PURE__*/_react["default"].createElement(_core.Button, {
            style: {
              fontStyle: "italic"
            },
            intent: "primary",
            icon: "arrow-down",
            minimal: true,
            "data-test": "jumpToEndButton",
            onClick: function onClick(e) {
              e.stopPropagation();
              _this.InfiniteScroller && _this.InfiniteScroller.scrollTo(rowData.length);
            }
          }, "\u8DF3\u5230\u6700\u540E"));
        } else if (index === rowData.length - 1) {
          rowBottomComp = /*#__PURE__*/_react["default"].createElement("div", {
            style: rowJumpButtonStyle
          }, /*#__PURE__*/_react["default"].createElement(_core.Button, {
            style: {
              fontStyle: "italic"
            },
            intent: "primary",
            icon: "arrow-up",
            minimal: true,
            "data-test": "jumpToStartButton",
            onClick: function onClick(e) {
              e.stopPropagation();
              _this.InfiniteScroller && _this.InfiniteScroller.scrollTo(0);
            }
          }, "\u8DF3\u5230\u5F00\u59CB"));
        }
      }
      if (rowData[index]) {
        var _this$state;
        var rowItem = /*#__PURE__*/_react["default"].createElement("div", {
          "data-row-number": index,
          key: index
        }, /*#__PURE__*/_react["default"].createElement("div", {
          className: "veRowItemSpacer"
        }), /*#__PURE__*/_react["default"].createElement(_RowItem["default"], _extends({}, _extends({}, rest, {
          rowTopComp: rowTopComp,
          truncateLabelsThatDoNotFit: truncateLabelsThatDoNotFit,
          rowBottomComp: rowBottomComp,
          scalePct: (_this$state = _this.state) === null || _this$state === void 0 ? void 0 : _this$state.scalePct,
          setScalePct: function setScalePct(scalePct) {
            _this.setState({
              scalePct: scalePct
            });
          },
          isRowView: true,
          isProtein: sequenceData.isProtein,
          chromatogramData: sequenceData.chromatogramData,
          sequenceLength: sequenceData.sequence.length,
          bpsPerRow: bpsPerRow,
          caretPosition: caretPosition,
          emptyText: (0, _editorUtils.getEmptyText)({
            sequenceData: sequenceData,
            caretPosition: caretPosition
          }),
          fullSequence: sequenceData.sequence
        }, RowItemProps), {
          row: rowData[index]
        })), index === rowData.length - 1 ? /*#__PURE__*/_react["default"].createElement("div", {
          className: "veRowItemSpacer"
        }) : null);
        // this.cache[index] = rowItem;
        return rowItem;
      } else {
        return null;
      }
    });
    _defineProperty(_assertThisInitialized(_this), "onDrag", function (event) {
      if ((0, _isMobile["default"])({
        tablet: true
      })) {
        if (
        //only allow dragging on mobile if the user is grabbing the cursor
        !(0, _lodash.some)(_draggableClassnames["default"], function (cn) {
          if (event.target.classList.contains(cn)) {
            return true;
          }
        })) {
          return;
        }
      }
      _this.dragging = true;
      var rowData = _this.rowData;
      _this.getNearestCursorPositionToMouseEvent(rowData, event, _clickAndDragUtils.editorDragged);
    });
    _defineProperty(_assertThisInitialized(_this), "onStart", function (event) {
      _this.dragging = true;
      var rowData = _this.rowData;
      _this.getNearestCursorPositionToMouseEvent(rowData, event, _clickAndDragUtils.editorDragStarted);
    });
    _defineProperty(_assertThisInitialized(_this), "onStop", function () {
      _this.dragging = false;
      (0, _clickAndDragUtils.editorDragStopped)();
    });
    _defineProperty(_assertThisInitialized(_this), "getRef", function (ref) {
      return _this.node = ref;
    });
    _defineProperty(_assertThisInitialized(_this), "onContextMenu", function (event) {
      _this.getNearestCursorPositionToMouseEvent(_this.rowData, event, _this.props.backgroundRightClicked);
    });
    _defineProperty(_assertThisInitialized(_this), "onClick", function (event) {
      _this.getNearestCursorPositionToMouseEvent(_this.rowData, event, _this.props.editorClicked);
    });
    _defineProperty(_assertThisInitialized(_this), "getReactListRef", function (c) {
      _this.InfiniteScroller = c;
      !_this.calledUpdateScrollOnce && _this.updateScrollPosition({}, _this.props); //trigger the scroll here as well because now we actually have the infinite scroller component accessible
    });
    return _this;
  }
  var _proto = _RowView.prototype;
  _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(props) {
    //we haven't yet called this function yet, so to make sure it jumps to the selected bps we just set a variable on the class
    this.updateScrollPosition(this.calledUpdateScrollOnce ? this.props : {}, props);
  };
  _proto.render = function render() {
    var _this$props5 = this.props,
      width = _this$props5.width,
      marginWidth = _this$props5.marginWidth,
      height = _this$props5.height,
      className = _this$props5.className,
      bpsPerRow = _this$props5.bpsPerRow,
      rowData = _this$props5.rowData;
    if (width === "100%") {
      //we can't render an actual 100% width row view (we need a pixel measurement but we get passed width=100% by react-measure)
      return /*#__PURE__*/_react["default"].createElement("div", {
        style: {
          width: width,
          height: height || 300
        }
      });
    }
    if (marginWidth < _rowviewContants.defaultMarginWidth) {
      marginWidth = _rowviewContants.defaultMarginWidth;
    }
    var containerWidthMinusMargin = width - marginWidth;
    this.bpsPerRow = bpsPerRow;
    this.rowData = rowData;

    // const shouldClear = this.shouldClearCache();
    return /*#__PURE__*/_react["default"].createElement(_reactDraggable["default"], {
      bounds: bounds,
      onDrag: this.onDrag,
      onStart: this.onStart,
      onStop: this.onStop
    }, /*#__PURE__*/_react["default"].createElement("div", {
      ref: this.getRef,
      className: (0, _classnames["default"])("veRowView", className),
      style: _extends({
        overflowY: "auto",
        overflowX: "visible",
        height: height || 300,
        width: containerWidthMinusMargin + marginWidth,
        paddingLeft: marginWidth / 2,
        paddingRight: marginWidth / 2
      }, _isMobile["default"] && {
        touchAction: "inherit"
      }),
      onContextMenu: this.onContextMenu,
      onScroll: onScroll,
      onClick: this.onClick
    }, /*#__PURE__*/_react["default"].createElement(_reactList["default"], {
      clearCache: true,
      ref: this.getReactListRef,
      itemRenderer: this.renderItem,
      length: rowData.length,
      itemSizeEstimator: this.estimateRowHeight,
      type: "variable"
    })));
  };
  return _RowView;
}(_react["default"].Component);
_defineProperty(_RowView, "defaultProps", {
  sequenceData: {
    sequence: ""
  },
  selectionLayer: {},
  // bpToJumpTo:0,
  editorClicked: noop,
  backgroundRightClicked: noop,
  // onScroll: noop,
  width: _rowviewContants.defaultContainerWidth,
  marginWidth: _rowviewContants.defaultMarginWidth,
  height: 400,
  charWidth: _rowviewContants.defaultCharWidth,
  RowItemProps: {}
});
var RowView = (0, _reactRedux.connect)(function (state, ownProps) {
  var bpsPerRow = (0, _getBpsPerRow["default"])(ownProps);
  //the width we pass to the rowitem needs to be the exact width of the bps so we need to trim off any extra space:
  var rowData = getRowData(ownProps.sequenceData, bpsPerRow);
  return {
    bpsPerRow: bpsPerRow,
    rowData: rowData
  };
})(_RowView);
exports.RowView = RowView;
var _default = (0, _withEditorInteractions["default"])(RowView);
exports["default"] = _default;
function onScroll() {
  window.__veScrolling = true;
  setTimeout(endScroll);
}
var endScroll = (0, _lodash.debounce)(function () {
  window.__veScrolling = false;
}, 100);
function setIntervalX(callback, delay, repetitions) {
  var x = 0;
  var intervalID = window.setInterval(function () {
    callback();
    if (++x === repetitions) {
      try {
        //djr I think there is some double clearing going on here so I put it in a try block
        window.clearInterval(intervalID);
      } catch (_unused2) {
        console.error();
      }
    }
  }, delay);
  return intervalID;
}
var getRowData = (0, _reselect.defaultMemoize)(function (sequenceData, bpsPerRow) {
  return (0, _prepareRowData["default"])(_extends({}, sequenceData, {
    primers: sequenceData.filteredPrimers || sequenceData.primers,
    features: sequenceData.filteredFeatures || sequenceData.features,
    parts: sequenceData.filteredParts || sequenceData.parts
  }), bpsPerRow);
});