/* eslint-disable */
(function () {
  var ua = navigator.userAgent;

  function getVersion(regex) {
    var match = ua.match(regex);
    return match ? parseFloat(match[1]) : 0;
  }

  var isOldEdge = /Edge\/\d+/.test(ua);
  var isIE = /MSIE |Trident\//.test(ua);
  var edgeVersion = getVersion(/Edg\/(\d+)/);
  var operaVersion = getVersion(/OPR\/(\d+)/);
  var chromeVersion = getVersion(/Chrome\/(\d+)/);
  var safariVersion = getVersion(/Version\/(\d+)/);
  var firefoxVersion = getVersion(/Firefox\/(\d+)/);

  function checkIsVersionObsolete(version, minVersion) {
    return version > 0 && version < minVersion;
  }

  var isObsolete =
    isIE ||
    isOldEdge ||
    checkIsVersionObsolete(edgeVersion, 85) ||
    checkIsVersionObsolete(operaVersion, 71) ||
    checkIsVersionObsolete(chromeVersion, 85) ||
    checkIsVersionObsolete(firefoxVersion, 78) ||
    checkIsVersionObsolete(safariVersion, 15.7);

  if (isObsolete) {
    window.location.href = '/unsupported-browser.html';
  }
})();