var _excluded = ["children", "height", "sAngle", "eAngle", "forward"];
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; }
import React from "react";
export default function PositionAnnotationOnCircle(_ref) {
  var children = _ref.children,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? 0 : _ref$height,
    _ref$sAngle = _ref.sAngle,
    sAngle = _ref$sAngle === void 0 ? 0 : _ref$sAngle,
    _ref$eAngle = _ref.eAngle,
    eAngle = _ref$eAngle === void 0 ? 0 : _ref$eAngle,
    _ref$forward = _ref.forward,
    forward = _ref$forward === void 0 ? true : _ref$forward,
    rest = _objectWithoutPropertiesLoose(_ref, _excluded);
  var sAngleDegs = sAngle * 360 / Math.PI / 2;
  var eAngleDegs = eAngle * 360 / Math.PI / 2;
  var transform;
  var revTransform;
  if (forward) {
    transform = "translate(0," + -height + ") rotate(" + sAngleDegs + ",0," + height + ")";
  } else {
    transform = "scale(-1,1) translate(0," + -height + ") rotate(" + -eAngleDegs + ",0," + height + ") ";
    revTransform = " rotate(" + eAngleDegs + ",0," + height + ") scale(-1,1) rotate(" + sAngleDegs + ", 0," + height + ")";
  }
  var props = _extends({
    transform: transform
  }, rest);
  /* eslint-disable */
  if (!children) return {
    transform: transform,
    revTransform: revTransform
  };
  /* eslint-enable */

  return React.cloneElement(children, props);
}