function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

import ToastManager from './toast.manager';

var Toast =
/*#__PURE__*/
function () {
  function Toast() {
    _classCallCheck(this, Toast);
  }

  _createClass(Toast, null, [{
    key: "error",
    value: function error(props) {
      return Toast.getManager().error(props);
    }
  }, {
    key: "success",
    value: function success(props) {
      return Toast.getManager().success(props);
    }
  }, {
    key: "warning",
    value: function warning(props) {
      return Toast.getManager().warning(props);
    }
  }, {
    key: "info",
    value: function info(props) {
      return Toast.getManager().info(props);
    }
  }, {
    key: "close",
    value: function close(key) {
      Toast.getManager().close(key);
    }
  }, {
    key: "closeAll",
    value: function closeAll() {
      Toast.getManager().closeAll();
    }
  }, {
    key: "getDuplicationKey",
    value: function getDuplicationKey(props) {
      return Toast.getManager().getDuplicationKey(props);
    }
  }, {
    key: "isDuplicated",
    value: function isDuplicated(props) {
      return !!Toast.getDuplicationKey(props);
    }
  }, {
    key: "destroy",
    value: function destroy() {
      Toast.getManager().destroy();
    }
  }, {
    key: "setTemplate",
    value: function setTemplate(template) {
      Toast.getManager().setTemplate(template);
    }
  }, {
    key: "getManager",
    value: function getManager() {
      if (!Toast.manager) {
        Toast.manager = new ToastManager();
      }

      return Toast.manager;
    }
  }]);

  return Toast;
}();

_defineProperty(Toast, "manager", null);

export default Toast;