import _typeof from "@babel/runtime/helpers/esm/typeof";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["ellipsis", "rel"];
import { createVNode as _createVNode, resolveDirective as _resolveDirective } from "vue";
import warning from '../_util/warning';
import Base, { baseProps } from './Base';
import PropTypes from '../_util/vue-types';
import omit from '../_util/omit';

var Link = function Link(props, _ref) {
  var slots = _ref.slots,
      attrs = _ref.attrs;

  var _props$attrs = _objectSpread(_objectSpread({}, props), attrs),
      ellipsis = _props$attrs.ellipsis,
      rel = _props$attrs.rel,
      restProps = _objectWithoutProperties(_props$attrs, _excluded);

  warning(_typeof(ellipsis) !== 'object', 'Typography.Link', '`ellipsis` only supports boolean value.');

  var mergedProps = _objectSpread(_objectSpread({}, restProps), {}, {
    rel: rel === undefined && restProps.target === '_blank' ? 'noopener noreferrer' : rel,
    ellipsis: !!ellipsis,
    component: 'a'
  }); // https://github.com/ant-design/ant-design/issues/26622
  // @ts-ignore


  delete mergedProps.navigate;
  return _createVNode(Base, mergedProps, slots);
};

Link.displayName = 'ATypographyLink';
Link.inheritAttrs = false;
Link.props = omit(_objectSpread(_objectSpread({}, baseProps()), {}, {
  ellipsis: PropTypes.looseBool
}), ['component']);
export default Link;