<commit_before>(function () {
  "use strict";

  var app = angular.module('viewCustom', ['angularLoad']);


  //add "try this search elsewhere" options
  app.component('prmSearchResultListAfter', {
    controller: 'SearchElsewhereController',
    bindings: {
      'parentCtrl': '<'
    },
    template: '<div style="position:absolute;top:0;left:0;background-color:black;color:white;">' +
                '<p><a id="searchWorldCat" target="_blank" href="https://www.worldcat.org?q=">try your search in WorldCat</a></p>' +
                '<p><a id="searchGoogleScholar" target="_blank" href="https://scholar.google.ca/scholar?q=">try your search in Google Scholar</a></p>' +
              '</div>'
  })
  .controller('SearchElsewhereController', ['$scope', function($scope){
    var vm = this;
    
    vm.$onInit = function(){
      var terms = "", searchFields = vm.parentCtrl.searchService.searchFieldsService;
          
      if (searchFields.advancedSearch){
        searchFields.searchParams.query.forEach(function(t){
          terms += t.replace(/^[^,]+,[^,]+,/, "").replace(/,[^,]+$/, "") + " ";
        });
        terms = terms.replace(/^\s+|\s+$/, "");
      }
      else{
        terms = searchFields.mainSearch;
      }

      //worldcat
      angular.element(
        document.getElementById("searchWorldCat")
      ).attr("href", "https://www.worldcat.org/search?q=" + encodeURIComponent(terms));
      
      //google scholar
      angular.element(
        document.getElementById("searchGoogleScholar")
      ).attr("href", "https://scholar.google.ca/scholar?q=" + encodeURIComponent(terms));
    };
  }]);


  //add LiveHelp button/options
  app.component('prmExploreMainAfter', {
    controller: 'LiveHelpController',
    templateUrl: 'custom/ACAD/html/live-help.html'
  })
  .controller('LiveHelpController', ['$scope', 'angularLoad', function($scope, angularLoad){
    var ctrl       = this,
        chatWindow = null,<commit_msg>whitespace<commit_after>(function () {
  "use strict";

  var app = angular.module('viewCustom', ['angularLoad']);

  //add "try this search elsewhere" options
  app.component('prmSearchResultListAfter', {
    controller: 'SearchElsewhereController',
    bindings: {
      'parentCtrl': '<'
    },
    template: '<div style="position:absolute;top:0;left:0;background-color:black;color:white;">' +
                '<p><a id="searchWorldCat" target="_blank" href="https://www.worldcat.org?q=">try your search in WorldCat</a></p>' +
                '<p><a id="searchGoogleScholar" target="_blank" href="https://scholar.google.ca/scholar?q=">try your search in Google Scholar</a></p>' +
              '</div>'
  })
  .controller('SearchElsewhereController', ['$scope', function($scope){
    var vm = this;

    vm.$onInit = function(){
      var terms = "", searchFields = vm.parentCtrl.searchService.searchFieldsService;

      if (searchFields.advancedSearch){
        searchFields.searchParams.query.forEach(function(t){
          terms += t.replace(/^[^,]+,[^,]+,/, "").replace(/,[^,]+$/, "") + " ";
        });
        terms = terms.replace(/^\s+|\s+$/, "");
      }
      else{
        terms = searchFields.mainSearch;
      }

      //worldcat
      angular.element(
        document.getElementById("searchWorldCat")
      ).attr("href", "https://www.worldcat.org/search?q=" + encodeURIComponent(terms));

      //google scholar
      angular.element(
        document.getElementById("searchGoogleScholar")
      ).attr("href", "https://scholar.google.ca/scholar?q=" + encodeURIComponent(terms));
    };
  }]);

  //add LiveHelp button/options
  app.component('prmExploreMainAfter', {
    controller: 'LiveHelpController',
    templateUrl: 'custom/ACAD/html/live-help.html'
  })
  .controller('LiveHelpController', ['$scope', 'angularLoad', function($scope, angularLoad){
    var ctrl       = this,
        chatWindow = null,
{'fraction_non_alphanumeric': 0.18191187838186035, 'fraction_numerical': 0.001030662200463798, 'mean_word_length': 3.1518716577540107, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, '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': '1826684', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1154, 'n_words': 185}