{"size": 1054, "ext": "js", "max_stars_repo_path": "ui/static/js/module/bootstrap.js", "max_stars_repo_name": "site-0002/themes", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "ui/static/js/module/bootstrap.js", "max_issues_repo_name": "site-0002/themes", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ui/static/js/module/bootstrap.js", "max_forks_repo_name": "site-0002/themes", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.4255319149, "max_line_length": 70, "alphanum_fraction": 0.6518026565}
export function nodeActiveTab() {
  if (!query('ul.node-tabs')) {
    return false;
  }

  const $elID = attr('ul.node-tabs', 'id');
  const $elTabs = queryAll('button[data-bs-toggle="tab"]');
  const $storageItem = $elID + '-active';

  Array.from($elTabs).forEach($i => {
    eventActiveTab($i, $storageItem)
  });

  const $activeTab = storeGet($storageItem);

  if ($activeTab) {
    const $tab = query('button[data-bs-target="' + $activeTab + '"]');
    const $bsTab = new bootstrap.Tab($tab);
    $bsTab.show()
  }
}

function eventActiveTab($i, $s) {
  $i.addEventListener('show.bs.tab', ($e) => {
    storeSet($s, $i.dataset.bsTarget);
  });
}

function storeSet($name, $value) {
  return localStorage.setItem($name, $value);
}

function storeGet($item) {
  return localStorage.getItem($item);
}

function query($element) {
  return document.querySelector($element);
}

function queryAll($element) {
  return document.querySelectorAll($element);
}

function attr($element, $attr) {
  return document.querySelector($element).getAttribute($attr);
}