<commit_before>(function poll() {
  if (typeof ynabToolKit !== 'undefined' && ynabToolKit.pageReady === true) {
    ynabToolKit.activityTransactionLink = (function () {
      let applicationController = ynabToolKit.shared.containerLookup('controller:application');
      let userBudgetsController = ynabToolKit.shared.containerLookup('controller:users/budgets');

      function populateBudgetList() {
        let budgets = userBudgetsController.get('budgets');
        let currentBudgetId = applicationController.get('activeBudgetVersion').get('entityId');
        let $openBudgetListItem = $('.modal-select-budget').find('.modal-select-budget-open').parent();

        budgets.forEach((budget) => {
          if (budget.get('budgetVersionId') === currentBudgetId) return;

          let budgetListItem = $(`<li>
                                    <button>
                                      <i class="flaticon stroke mail-1"></i>
                                      ${budget.get('budgetVersionName')}
                                    </button>
                                  </li>`)
                                  .click(onBudgetClicked.bind(null, budget));

          $openBudgetListItem.after(budgetListItem);
        });
      }

      function onBudgetClicked(budget) {
        userBudgetsController.send('openBudget', budget.get('budgetVersionId'), budget.get('budgetVersionName'));
      }

      return {
        observe: function observe(changedNodes) {
          if (changedNodes.has('ynab-u modal-popup modal-select-budget ember-view modal-overlay active')) {
            populateBudgetList();
          }
        }
      };
    }());
  } else {
    setTimeout(poll, 250);
  }
}());
<commit_msg>this should avoid injection<commit_after>(function poll() {
  if (typeof ynabToolKit !== 'undefined' && ynabToolKit.pageReady === true) {
    ynabToolKit.activityTransactionLink = (function () {
      let applicationController = ynabToolKit.shared.containerLookup('controller:application');
      let userBudgetsController = ynabToolKit.shared.containerLookup('controller:users/budgets');

      function populateBudgetList() {
        let budgets = userBudgetsController.get('budgets');
        let currentBudgetId = applicationController.get('activeBudgetVersion').get('entityId');
        let $openBudgetListItem = $('.modal-select-budget').find('.modal-select-budget-open').parent();

        budgets.forEach((budget) => {
          if (budget.get('budgetVersionId') === currentBudgetId) return;

          let budgetListItem = $('<li>').append(
                                    $('<button>', { text: budget.get('budgetVersionName') }).prepend(
                                      $('<i>', {
                                        class: 'flaticon stroke mail-1'
                                      })
                                    )
                                  )
                                  .click(onBudgetClicked.bind(null, budget));

          $openBudgetListItem.after(budgetListItem);
        });
      }

      function onBudgetClicked(budget) {
        userBudgetsController.send('openBudget', budget.get('budgetVersionId'), budget.get('budgetVersionName'));
      }

      return {
        observe: function observe(changedNodes) {
          if (changedNodes.has('ynab-u modal-popup modal-select-budget ember-view modal-overlay active')) {
            populateBudgetList();
          }
        }
      };
    }());
  } else {
    setTimeout(poll, 250);
  }
}());

{'fraction_non_alphanumeric': 0.13028668748225944, 'fraction_numerical': 0.0022707919386886176, 'mean_word_length': 2.056374674761492, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5708932', 'n_tokens_mistral': 962, 'n_tokens_neox': 917, 'n_words': 136}