text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = void 0;
  
  var _propTypes = _interopRequireDefault(require("prop-types"));
  
  var _react = _interopRequireDefault(require("react"));
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  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; }
  
  class DefaultSnackbar extends _react.default.PureComponent {
    componentDidMount() {
      this.snackId = this.context.addToSnackQueue(this.getSnackOptions());
    }
  
    getSnackOptions() {
      var _this$props = this.props,
          action = _this$props.action,
          actionTitle = _this$props.actionTitle,
          kind = _this$props.kind,
          title = _this$props.title,
          subtitle = _this$props.subtitle,
          timeout = _this$props.timeout,
          children = _this$props.children,
          onClose = _this$props.onClose,
          onAction = _this$props.onAction,
          isPersisted = _this$props.isPersisted,
          isCloseable = _this$props.isCloseable,
          allowDuplicateSnackbarType = _this$props.allowDuplicateSnackbarType;
      return {
        kind,
        title,
        subtitle,
        children,
        onClose,
        action: {
          title: actionTitle || action && action.title,
          callback: onAction || action && action.callback
        },
        isPersisted,
        isCloseable,
        autoDismissTimeout: timeout,
        allowDuplicateSnackbarType
      };
    }
  
    componentWillUnmount() {
      this.context.handleDismissSnack(this.snackId);
    }
  
    componentDidUpdate() {
      this.context.updateSnack(this.snackId, this.getSnackOptions());
    }
  
    render() {
      return null;
    }
  
  }
  
  exports.default = DefaultSnackbar;
  
  _defineProperty(DefaultSnackbar, "propTypes", {
    kind: _propTypes.default.oneOf(['info', 'warning', 'error', 'success']),
    title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
    subtitle: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
    isPersisted: _propTypes.default.bool,
    isCloseable: _propTypes.default.bool,
    children: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
    onClose: _propTypes.default.func,
    action: _propTypes.default.shape({
      // Title is also a legacy prop
      title: _propTypes.default.string,
      callback: _propTypes.default.func
    }),
    // Legacy props
    onAction: _propTypes.default.func,
    actionTitle: _propTypes.default.string,
    timeout: _propTypes.default.number,
    allowDuplicateSnackbarType: _propTypes.default.bool
  });
  
  _defineProperty(DefaultSnackbar, "contextTypes", {
    addToSnackQueue: _propTypes.default.func,
    handleDismissSnack: _propTypes.default.func,
    updateSnack: _propTypes.default.func
  });