export function useExamShellStats() {
  if (
    navigator.userAgent.indexOf("WOW64") != -1 ||
    navigator.userAgent.indexOf("Win64") != -1
  ) {
    _hmt.push(["_trackEvent", "登录页面", "64Bit OS"]);
  } else {
    _hmt.push(["_trackEvent", "登录页面", "非64Bit OS"]);
  }

  const shellVersion = window.navigator.userAgent
    .split(" ")
    .find((v) => v.startsWith("electron-exam-shell/"));
  const chromeVersion = window.navigator.userAgent
    .split(" ")
    .find((v) => v.startsWith("Chrome/"));
  if (shellVersion) {
    _hmt.push([
      "_trackEvent",
      "登录页面",
      "学生端版本",
      shellVersion + "/" + chromeVersion,
    ]);
  } else {
    _hmt.push(["_trackEvent", "登录页面", "浏览器登录"]);
    if (chromeVersion) {
      _hmt.push([
        "_trackEvent",
        "登录页面",
        "学生端版本/chrome",
        chromeVersion,
      ]);
    } else {
      _hmt.push([
        "_trackEvent",
        "登录页面",
        "学生端版本/其他浏览器",
        window.navigator.userAgent,
      ]);
    }
  }
}
