text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = void 0;
  
  var _react = _interopRequireDefault(require("react"));
  
  var _propTypes = _interopRequireDefault(require("prop-types"));
  
  var _styledComponents = _interopRequireDefault(require("styled-components"));
  
  var _Modal = _interopRequireDefault(require("../Modal"));
  
  var _alertImages = require("./alertImages");
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var Dialog = _styledComponents.default.div.withConfig({
    displayName: "Alert__Dialog",
    componentId: "obh2xy-0"
  })(["display:flex;flex-direction:row;"]);
  
  function imageDialog(_ref) {
    var type = _ref.type;
    var images = {
      error: _alertImages.dialogError,
      info: _alertImages.dialogInfo,
      warning: _alertImages.dialogWarning
    };
    return "background-image: url(".concat(images[type] || images.error, ");");
  }
  
  Dialog.Image = _styledComponents.default.div.withConfig({
    displayName: "Alert__Image",
    componentId: "obh2xy-1"
  })(["", " background-repeat:no-repeat;background-size:70%;height:45px;width:45px;background-position:center;margin-right:10px;"], imageDialog);
  Dialog.Message = _styledComponents.default.div.withConfig({
    displayName: "Alert__Message",
    componentId: "obh2xy-2"
  })(["display:flex;align-items:center;justify-content:center;"]);
  
  var Alert = function Alert(_ref2) {
    var type = _ref2.type,
        title = _ref2.title,
        message = _ref2.message,
        onCloseModal = _ref2.onCloseModal,
        closeAlert = _ref2.closeAlert;
    var defaultPosition = {
      x: Math.floor(window.innerWidth / 2) - 150,
      y: Math.floor(window.innerHeight / 2) - 80
    };
    return _react.default.createElement(_Modal.default, {
      title: title,
      closeModal: onCloseModal,
      buttonsAlignment: "center",
      buttons: [{
        value: 'OK',
        onClick: closeAlert
      }],
      defaultPosition: defaultPosition,
      width: "auto",
      height: 120
    }, _react.default.createElement(Dialog, null, _react.default.createElement(Dialog.Image, {
      type: type
    }), _react.default.createElement(Dialog.Message, null, message)));
  };
  
  Alert.displayName = 'Alert';
  Alert.propTypes = {
    title: _propTypes.default.string.isRequired,
    message: _propTypes.default.string.isRequired,
    type: _propTypes.default.oneOf(['info', 'error', 'warning']),
    closeAlert: _propTypes.default.func
  };
  Alert.defaultProps = {
    type: 'error',
    closeAlert: function closeAlert() {}
  };
  var _default = Alert;
  exports.default = _default;