<commit_before>import React from 'react';
import Module from 'Parser/Core/Module';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';
import Icon from 'common/Icon';

import FocusTracker from '../FocusChart/FocusTracker';

class TimeFocusCapped extends Module {
  static dependencies = {
    focusTracker: FocusTracker,
  };

  get getTotalWaste(){
    let waste = this.focusTracker.secondsCapped * this.focusTracker.focusGen;
    if (this.focusTracker.generatorCasts) {
      waste += Object.values(this.focusTracker.activeFocusWasted).reduce((sum, waste) => sum + waste, 0);
    }
    return Math.round(waste);
  }

  statistic() {
    const totalFocusWaste = this.getTotalWaste;
    const percentCapped = Math.round(this.focusTracker.secondsCapped/(this.owner.fightDuration/1000) * 10000)/100;
    return (
      <StatisticBox
        icon = {<Icon icon='ability_hunter_focusfire' alt = 'Focus Wasted' />}
        label = 'Time Focus Capped'
        tooltip= {`You wasted <b> ${totalFocusWaste}  </b> focus. <br /> 
        That's <b>  ${formatPercentage(totalFocusWaste/(this.owner.fightDuration/1000 * this.focusTracker.focusGen) * 10000)/100}% </b> of your total focus generated. 
        <br /> For more details, see the Focus Chart tab.`}
        value =  {`${percentCapped} %`}
      //Time not Focus-Capped: {Math.round((this.owner.fightDuration / 1000 - this.focusTracker.secondsCapped) * 100) / 100}s / {Math.floor(this.owner.fightDuration / 1000)}
      footer={(
        <div className="statistic-bar">
        <div
          className="stat-health-bg"<commit_msg>Bug fix<commit_after>import React from 'react';
import Module from 'Parser/Core/Module';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';
import Icon from 'common/Icon';
import { formatPercentage } from 'common/format';

import FocusTracker from '../FocusChart/FocusTracker';

class TimeFocusCapped extends Module {
  static dependencies = {
    focusTracker: FocusTracker,
  };

  get getTotalWaste(){
    let waste = this.focusTracker.secondsCapped * this.focusTracker.focusGen;
    if (this.focusTracker.generatorCasts) {
      waste += Object.values(this.focusTracker.activeFocusWasted).reduce((sum, waste) => sum + waste, 0);
    }
    return Math.round(waste);
  }

  statistic() {
    const totalFocusWaste = this.getTotalWaste;
    const percentCapped = formatPercentage(this.focusTracker.secondsCapped/(this.owner.fightDuration/1000));
    return (
      <StatisticBox
        icon = {<Icon icon='ability_hunter_focusfire' alt = 'Focus Wasted' />}
        label = 'Time Focus Capped'
        tooltip= {`You wasted <b> ${totalFocusWaste}  </b> focus. <br /> 
        That's <b>  ${formatPercentage(totalFocusWaste/(this.owner.fightDuration/1000 * this.focusTracker.focusGen))}% </b> of your total focus generated. 
        <br /> For more details, see the Focus Chart tab.`}
        value =  {`${percentCapped} %`}
      //Time not Focus-Capped: {Math.round((this.owner.fightDuration / 1000 - this.focusTracker.secondsCapped) * 100) / 100}s / {Math.floor(this.owner.fightDuration / 1000)}
      footer={(
        <div className="statistic-bar">
        <div
          className="stat-health-bg"
{'fraction_non_alphanumeric': 0.13161169881767268, 'fraction_numerical': 0.019290603609209707, 'mean_word_length': 3.515449438202247, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2014783', 'n_tokens_mistral': 1045, 'n_tokens_neox': 965, 'n_words': 222}