"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ForbiddenAction = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireDefault(require("react"));
var _reactIntl = require("react-intl");
var _messages = require("../../../messages");
var ForbiddenAction = exports.ForbiddenAction = function ForbiddenAction(handler) {
  var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'connect-other-account';
  var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _messages.messages.try_another_account;
  var values = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  return {
    id: id,
    text: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, message, {
      values: values
    })),
    promise: function promise() {
      return new Promise(function (resolve) {
        return resolve(handler());
      });
    },
    buttonAppearance: 'default'
  };
};