"use strict";

require("core-js/modules/es.symbol.js");
require("core-js/modules/es.array.filter.js");
require("core-js/modules/es.array.for-each.js");
require("core-js/modules/es.array.push.js");
require("core-js/modules/es.object.define-properties.js");
require("core-js/modules/es.object.define-property.js");
require("core-js/modules/es.object.get-own-property-descriptor.js");
require("core-js/modules/es.object.get-own-property-descriptors.js");
require("core-js/modules/es.object.keys.js");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/esnext.iterator.constructor.js");
require("core-js/modules/esnext.iterator.filter.js");
require("core-js/modules/esnext.iterator.for-each.js");
require("core-js/modules/web.dom-collections.for-each.js");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FcrGuideToolTip = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
require("rc-tooltip/assets/bootstrap_white.css");
require("./index.css");
require("./arrow.css");
var _classnames = _interopRequireDefault(require("classnames"));
var _ = require(".");
var _icon = require("../icon");
var _type = require("../icon/type");
var _jsxRuntime = require("react/jsx-runtime");
var _excluded = ["closable", "content", "onClose"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var GuideToolTipClosableOverlayWrap = function GuideToolTipClosableOverlayWrap(props) {
  var content = props.content,
    closable = props.closable,
    onClose = props.onClose;
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
    className: (0, _classnames["default"])('fcr-guide-tooltip-overlay-content'),
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
      style: {
        padding: closable ? '0px 8px' : '0px 24px'
      },
      className: (0, _classnames["default"])('fcr-guide-tooltip-overlay-content-inner'),
      children: content
    }), closable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
      className: (0, _classnames["default"])('fcr-guide-tooltip-overlay-content-closable', 'fcr-divider'),
      onClick: onClose,
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FcrIcon, {
        type: _type.FcrIconType.FCR_CLOSE,
        size: 24
      })
    })]
  });
};
var FcrGuideToolTip = exports.FcrGuideToolTip = function FcrGuideToolTip(props) {
  var closable = props.closable,
    content = props.content,
    onClose = props.onClose,
    others = (0, _objectWithoutProperties2["default"])(props, _excluded);
  var defaultGuideOverlayInnerStyle = {
    padding: '0',
    background: "var(--fcr_ui_scene_inverse2)",
    border: "1px solid var(--fcr_ui_scene_inverse2)",
    fontStyle: 'normal',
    fontWeight: '400',
    fontSize: '14px',
    lineHeight: '40px',
    color: "var(--fcr_ui_scene_inverse)",
    borderRadius: "var(--fcr_cornerradius_xxs)"
  };
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.FcrToolTip, _objectSpread({
    arrowContent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FcrIcon, {
      colors: {
        iconPrimary: 'var(--fcr_ui_scene_inverse2)'
      },
      type: _type.FcrIconType.FCR_TOOLTIP_ARROW,
      size: 16
    }),
    content: /*#__PURE__*/(0, _jsxRuntime.jsx)(GuideToolTipClosableOverlayWrap, {
      content: content,
      onClose: onClose,
      closable: closable
    }),
    overlayInnerStyle: _objectSpread(_objectSpread({}, defaultGuideOverlayInnerStyle), props.overlayInnerStyle)
  }, others));
};