import React from 'react';
import classNames from 'classnames';
import './index.less';
export var SourceEdge = function SourceEdge(props) {
  var targetPosition = props.targetPosition,
      sourcePosition = props.sourcePosition,
      disabled = props.disabled,
      singleChild = props.singleChild,
      selected = props.selected;
  var edgeTurnDistance = 20;
  var START_PT = sourcePosition;
  var P2 = {
    x: targetPosition.x - edgeTurnDistance,
    y: sourcePosition.y
  };
  var P3 = {
    x: targetPosition.x - edgeTurnDistance,
    y: targetPosition.y
  };
  var END_PT = targetPosition;
  var points = singleChild ? [[START_PT.x, START_PT.y], [END_PT.x, END_PT.y], [END_PT.x, END_PT.y]] : [[START_PT.x, START_PT.y], [P2.x, P2.y], [P3.x, P3.y], [END_PT.x, END_PT.y]];
  return React.createElement(React.Fragment, null, React.createElement("polyline", {
    points: points.join(', '),
    className: classNames('SourceEdge', {
      'SourceEdge-disabled': disabled,
      'SourceEdge-selected': selected
    })
  }));
};