text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = _default;
  
  var _react = _interopRequireDefault(require("react"));
  
  var _Annotation = _interopRequireDefault(require("../Annotation"));
  
  var _EditableAnnotation = _interopRequireDefault(require("../EditableAnnotation"));
  
  var _ConnectorLine = _interopRequireDefault(require("../Connector/ConnectorLine"));
  
  var _ConnectorElbow = _interopRequireDefault(require("../Connector/ConnectorElbow"));
  
  var _ConnectorCurve = _interopRequireDefault(require("../Connector/ConnectorCurve"));
  
  var _ConnectorEndDot = _interopRequireDefault(require("../Connector/ConnectorEndDot"));
  
  var _ConnectorEndArrow = _interopRequireDefault(require("../Connector/ConnectorEndArrow"));
  
  var _Subject = _interopRequireDefault(require("../Subject/Subject"));
  
  var _Note = _interopRequireDefault(require("../Note/Note"));
  
  var _JSXNote = _interopRequireDefault(require("../Note/JSXNote"));
  
  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); }
  
  var getAnnotationType = function getAnnotationType(editMode) {
    return editMode ? _EditableAnnotation.default : _Annotation.default;
  };
  
  function _default(props, Connector) {
    var NoteDefaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
    var Subject = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _Subject.default;
    var SubjectDefaultProps = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
    var NoteType = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : _Note.default;
    var _props$disable = props.disable,
        disable = _props$disable === void 0 ? [] : _props$disable,
        connector = props.connector,
        note = props.note,
        subject = props.subject,
        x = props.x,
        y = props.y,
        dx = props.dx,
        dy = props.dy,
        nx = props.nx,
        ny = props.ny,
        color = props.color,
        className = props.className,
        onDrag = props.onDrag,
        onDragStart = props.onDragStart,
        onDragEnd = props.onDragEnd,
        editMode = props.editMode,
        events = props.events;
    var CONNECTORS = {
      type: {
        curve: _ConnectorCurve.default,
        line: _ConnectorLine.default,
        elbow: _ConnectorElbow.default
      },
      end: {
        dot: _ConnectorEndDot.default,
        arrow: _ConnectorEndArrow.default
      }
    };
    var ConnectorType, ConnectorEndType;
  
    if (disable.indexOf("connector") === -1) {
      ConnectorType = connector && CONNECTORS.type[connector.type] || Connector;
      ConnectorEndType = connector && CONNECTORS.end[connector.end];
    }
  
    var AnnotationType = getAnnotationType(props.editMode);
    return _react.default.createElement(AnnotationType, _extends({
      x: x,
      y: y,
      dx: dx,
      dy: dy,
      nx: nx,
      ny: ny,
      color: color,
      className: className,
      onDrag: onDrag,
      onDragStart: onDragStart,
      onDragEnd: onDragEnd,
      editMode: editMode
    }, SubjectDefaultProps, subject, {
      events: events
    }), ConnectorType && _react.default.createElement(ConnectorType, connector, ConnectorEndType && _react.default.createElement(ConnectorEndType, null)), Subject && disable.indexOf("subject") === -1 && _react.default.createElement(Subject, null), note && disable.indexOf("note") === -1 && (_react.default.isValidElement(note) || typeof note === "function" ? _react.default.createElement(_JSXNote.default, {
      noteDefaultProps: NoteDefaultProps,
      note: note
    }) : _react.default.createElement(NoteType, _extends({}, NoteDefaultProps, note))));
  }