"use strict";

exports.__esModule = true;
exports["default"] = CircularPrimer;
var _react = _interopRequireDefault(require("react"));
var _editorUtils = require("../utils/editorUtils");
var _drawDirectedPiePiece2 = _interopRequireDefault(require("./drawDirectedPiePiece"));
var _getInternalLabel = require("./getInternalLabel");
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 CircularPrimer(props) {
  var _props$color = props.color,
    color = _props$color === void 0 ? "orange" : _props$color,
    radius = props.radius,
    _props$arrowheadLengt = props.arrowheadLength,
    arrowheadLength = _props$arrowheadLengt === void 0 ? 0.5 : _props$arrowheadLengt,
    annotationHeight = props.annotationHeight,
    totalAngle = props.totalAngle,
    id = props.id,
    labelNeedsFlip = props.labelNeedsFlip,
    ellipsizedName = props.ellipsizedName;
  var _drawDirectedPiePiece = (0, _drawDirectedPiePiece2["default"])({
      radius: radius,
      annotationHeight: annotationHeight,
      totalAngle: totalAngle,
      arrowheadLength: arrowheadLength,
      tailThickness: 1,
      //feature specific
      returnTextPath: true,
      hasLabel: ellipsizedName,
      labelNeedsFlip: labelNeedsFlip
    }),
    path = _drawDirectedPiePiece[0],
    textPath = _drawDirectedPiePiece[1];
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, (0, _editorUtils.getStripedPattern)({
    color: color
  }), /*#__PURE__*/_react["default"].createElement("path", {
    className: "vePrimer veCircularViewPrimer",
    id: id,
    strokeWidth: ".5",
    stroke: "black",
    fill: "url(#diagonalHatch)",
    d: path.print()
  }), (0, _getInternalLabel.getInternalLabel)(_extends({}, props, {
    colorToUse: color,
    textPath: textPath
  })));
}
module.exports = exports.default;