 = 0;
      let heartRateChart;
      let heartRateData = [];
      let heartbeatInterval;
      let timestampInterval;
      let hourlyHeartRateChart;
      let lastUpdated = null;
      let lastDataTimestamp = null;
      let countdownInterval;
      let refreshButton;
      let isRefreshing = false;

      const defaultOptions = {
        responsive: true,
        maintainAspectRatio: false,
        animation: {
          duration: 750,
        },
        plugins: {
          legend: {
            labels