import { curry } from 'ramda';

var handleMetaClick = curry(function (history, params, event) {
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  if (isMetaKeyPressed(event)) {
    return window.open(params.pathname || params, "_blank");
  }
  var _options$isHistoryRep = options.isHistoryReplace,
    isHistoryReplace = _options$isHistoryRep === void 0 ? false : _options$isHistoryRep;
  var historyMethod = isHistoryReplace ? history.replace : history.push;
  return historyMethod(params);
});
var isMetaKeyPressed = function isMetaKeyPressed(event) {
  return !!(event !== null && event !== void 0 && event.ctrlKey || event !== null && event !== void 0 && event.metaKey);
};

export { handleMetaClick, isMetaKeyPressed };
//# sourceMappingURL=metaClick.js.map
