var BROWSER_SIZE_THRESHOLD = 38;
export var AUTH_WINDOW_HEIGHT = 760;
export var AUTH_WINDOW_WIDTH = 620;
export var getWindowOpenFeatures = function getWindowOpenFeatures(popupHeight, popupWidth) {
  var vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
  var vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
  var vl = window.screenLeft || 0;
  var vt = window.screenTop || 0;

  // Center the popup window
  var left = (vw - popupWidth) / 2 + vl;
  var top = (vh - popupHeight) / 2 + vt;

  // Open a popup if there's enough space in the viewport
  // Otherwise, fall back to the default behavior (opening in a new tab)
  var windowFeatures = vw > popupWidth + BROWSER_SIZE_THRESHOLD && vh > popupHeight + BROWSER_SIZE_THRESHOLD ? "width=".concat(popupWidth, ",height=").concat(popupHeight, ",left=").concat(left, ",top=").concat(top) : undefined;
  return windowFeatures;
};