<commit_before>module ngApp.components.header.controllers {

  import ICartService = ngApp.cart.services.ICartService;
  import ICoreService = ngApp.core.services.ICoreService;
  import IUserService = ngApp.components.user.services.IUserService;

  export interface IHeaderController {
    isCollapsed: boolean;
    toggleCollapsed(): void;
    collapse(event: any): void;
    currentLang: string;
    languages: any;
    addedLanguages: boolean;
    setLanguage(): void;
    getNumCartItems(): number;
    logout(): void;
    loginQuery: string;
  }

  class HeaderController implements IHeaderController {
    isCollapsed: boolean = true;
    currentLang: string = "en";
    loginQuery: string = "";
    addedLanguages: boolean = false;
    languages: any = {
      "en": "English",
      "fr": "French",
      "es": "Spanish"
    };

    /* @ngInject */
    constructor(private gettextCatalog, private CartService: ICartService,
                private $state: ng.ui.IStateService,
                private UserService: IUserService, private $modal: any,
                private $window: ng.IWindowService) {
      this.addedLanguages = !!_.keys(gettextCatalog.strings).length;

      if ($window.location.port) {
        this.loginQuery = "?next=:" + $window.location.port;
      }
    }

    logout(): void {
      this.UserService.logout();
      this.$window.location.reload();
    }

    collapse(event: any): void {
      if (event.which === 1 || event.which === 13) {
        this.isCollapsed = true;
      }
    }

    toggleCollapsed(): void {
      this.isCollapsed = !this.isCollapsed;
    }

    setLanguage() {
      this.gettextCatalog.setCurrentLanguage(this.currentLang);
    }

    getNumCartItems(): number {<commit_msg>chore(login): Add redirect path for prod env<commit_after>module ngApp.components.header.controllers {

  import ICartService = ngApp.cart.services.ICartService;
  import ICoreService = ngApp.core.services.ICoreService;
  import IUserService = ngApp.components.user.services.IUserService;

  export interface IHeaderController {
    isCollapsed: boolean;
    toggleCollapsed(): void;
    collapse(event: any): void;
    currentLang: string;
    languages: any;
    addedLanguages: boolean;
    setLanguage(): void;
    getNumCartItems(): number;
    logout(): void;
    loginQuery: string;
  }

  class HeaderController implements IHeaderController {
    isCollapsed: boolean = true;
    currentLang: string = "en";
    loginQuery: string = "";
    addedLanguages: boolean = false;
    languages: any = {
      "en": "English",
      "fr": "French",
      "es": "Spanish"
    };

    /* @ngInject */
    constructor(private gettextCatalog, private CartService: ICartService,
                private $state: ng.ui.IStateService,
                private UserService: IUserService, private $modal: any,
                private $window: ng.IWindowService) {
      this.addedLanguages = !!_.keys(gettextCatalog.strings).length;

      if ($window.location.port) {
        this.loginQuery = "?next=:" + $window.location.port;
      } else {
        this.loginQuery = "?next=/";
      }
    }

    logout(): void {
      this.UserService.logout();
      this.$window.location.reload();
    }

    collapse(event: any): void {
      if (event.which === 1 || event.which === 13) {
        this.isCollapsed = true;
      }
    }

    toggleCollapsed(): void {
      this.isCollapsed = !this.isCollapsed;
    }

    setLanguage() {
      this.gettextCatalog.setCurrentLanguage(this.currentLang);
    }

    getNumCartItems(): number {
{'fraction_non_alphanumeric': 0.123210777434746, 'fraction_numerical': 0.0016839741790625876, 'mean_word_length': 2.8036286019210244, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, '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': '4549000', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1045, 'n_words': 219}