"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var React = _interopRequireWildcard(require("react"));

var _reactTooltip = _interopRequireDefault(require("react-tooltip"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

//  strict
// $FlowFixMe
var Wrapper =
/*#__PURE__*/
_styledComponents.default.div.withConfig({
  componentId: "sc-8q376a-0"
})(["\n  width: fit-content;\n  display: inline-flex;\n"]);

var TooltipHost =
/*#__PURE__*/
function (_React$PureComponent) {
  (0, _inherits2.default)(TooltipHost, _React$PureComponent);

  function TooltipHost() {
    (0, _classCallCheck2.default)(this, TooltipHost);
    return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(TooltipHost).apply(this, arguments));
  }

  (0, _createClass2.default)(TooltipHost, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      _reactTooltip.default.rebuild();
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          tip = _this$props.tip,
          children = _this$props.children,
          id = _this$props.id;
      var dataTip = tip == null ? '' : tip;
      return React.createElement(Wrapper, (0, _extends2.default)({
        "data-for": id,
        "data-tip": dataTip
      }, this.props), children);
    }
  }]);
  return TooltipHost;
}(React.PureComponent);

TooltipHost.propTypes = process.env.NODE_ENV !== "production" ? {
  children: _propTypes.default.node.isRequired,
  id: _propTypes.default.string.isRequired,
  tip: _propTypes.default.string
} : {};
var _default = TooltipHost;
exports.default = _default;