export const $ = (id) => document.getElementById(id);

export const state = {
  apiBase: $('apiBase'),
  adminToken: $('adminToken'),
  projectName: $('projectName'),
  projectOptions: $('projectOptions'),
  days: $('days'),
  refreshButton: $('refreshButton'),
  errorBox: $('errorBox'),
  statusDot: $('statusDot'),
  statusText: $('statusText'),
  tabButtons: Array.from(document.querySelectorAll('[data-tab-button]')),
  tabPanels: Array.from(document.querySelectorAll('[data-tab-panel]')),
  totalOpen: $('totalOpen'),
  totalView: $('totalView'),
  totalClients: $('totalClients'),
  todayActiveClients: $('todayActiveClients'),
  wau: $('wau'),
  mau: $('mau'),
  newClients: $('newClients'),
  returningClients: $('returningClients'),
  githubStars: $('githubStars'),
  githubForks: $('githubForks'),
  githubOpenIssues: $('githubOpenIssues'),
  githubRepoUrl: $('githubRepoUrl'),
  dailyTable: $('dailyTable'),
  pagesTable: $('pagesTable'),
  versionsTable: $('versionsTable'),
  retentionTable: $('retentionTable'),
  configUsage: $('configUsage'),
  modelUsage: $('modelUsage'),
  latestTable: $('latestTable'),
  prevLatestPage: $('prevLatestPage'),
  nextLatestPage: $('nextLatestPage'),
  latestPageInfo: $('latestPageInfo'),
  loadNoticeButton: $('loadNoticeButton'),
  publishNoticeButton: $('publishNoticeButton'),
  disableNoticeButton: $('disableNoticeButton'),
  noticeMeta: $('noticeMeta'),
  noticeStatus: $('noticeStatus'),
  noticeTitle: $('noticeTitle'),
  noticeEnabled: $('noticeEnabled'),
  noticeContent: $('noticeContent'),
};

export const appState = {
  activeTab: 'overview',
  latestPage: 1,
  latestTotal: 0,
  latestPageSize: 10,
};
