<commit_before>(function() {
  'use strict';
  var module = angular.module('app', [
    'mainViewController',
    'registerPages',
    'registerLogin',
    'registerForm',
    'restaurantAdminView',
    'commonFilters',
    'ngResource',
    'ngRoute',
    'i18nCustomizations',
  ]);

  module.config(['$routeProvider',
    function($routeProvider) {
      $routeProvider.
      when('/', {
        templateUrl: 'src/mainView/mainView.html',
        controller: 'MainViewCtrl',
        controllerAs: 'vm',
      }).
      when('/admin', {
        templateUrl: 'src/restaurantAdminView/restaurantAdminView.html',
        controller: 'RestaurantAdminViewCtrl',
        controllerAs: 'vm',
        resolve: {
          restaurant: ['$resource', '$location',
            function ($resource, $location) {
              return $resource('/api/v1/restaurant').get().$promise.catch(function(resp) {
                if (resp.status === 403) {
                  $location.path('/login');
                }
              });
            }
          ],
        },
      }).
      when('/login', {
        templateUrl: 'src/login.template.html',
      }).
      when('/faq', {
        templateUrl: 'src/faq.template.html',
      }).
      when('/register/login/:token', {
        templateUrl: 'src/register/login.template.html',
        controller: 'RegisterLoginCtrl',
        controllerAs: 'vm',
        resolve: {
          redirectURL: ['$http', '$route', '$q',
            function($http, $route, $q) {
              return $http.get('/api/v1/register/facebook', {
                params: {
                  token: $route.current.params.token,
                },
              }).then(function success(resp) {
                return {
                  url: resp.data,
                };
              }, function error(resp) {
                if (resp.status === 403 || resp.status === 401) {
                  return {
                    error: resp.data,
                  };
                }
                return $q.reject(resp);
              });
            }
          ],
        }
      }).
      when('/register/pages', {
        templateUrl: 'src/register/pages.template.html',
        controller: 'RegisterPagesCtrl',
        controllerAs: 'vm',
        resolve: {
          pages: ['$resource',
            function($resource) {
              return $resource('/api/v1/register/facebook/pages').query().$promise.catch(function(resp) {
                if (resp.status === 403) {
                  $location.path('/register/login');
                }
              });
            }
          ],
        },
      }).
      when('/register/form/:pageID?', {
        templateUrl: 'src/register/form.template.html',
        controller: 'RegisterFormCtrl',
        controllerAs: 'vm',
        resolve: {
          page: ['$resource', '$route', '$q',
            function($resource, $route, $q) {
              if (!$route.current.params.pageID) {
                return $q.resolve();
              }
              return $resource('/api/v1/register/facebook/pages/:id').get({
                id: $route.current.params.pageID,
              }).$promise.catch(function(resp) {
                if (resp.status === 403) {
                  $location.path('/register/login');
                }
              });
            }
          ],
        }
      }).
      otherwise({
        redirectTo: '/',
      });
    }
  ]);
})();<commit_msg>Update angular root for API endpoint changes<commit_after>(function() {
  'use strict';
  var module = angular.module('app', [
    'mainViewController',
    'registerPages',
    'registerLogin',
    'registerForm',
    'restaurantAdminView',
    'commonFilters',
    'ngResource',
    'ngRoute',
    'i18nCustomizations',
  ]);

  module.config(['$routeProvider',
    function($routeProvider) {
      $routeProvider.
      when('/', {
        templateUrl: 'src/mainView/mainView.html',
        controller: 'MainViewCtrl',
        controllerAs: 'vm',
      }).
      when('/admin/:restaurantID', {
        templateUrl: 'src/restaurantAdminView/restaurantAdminView.html',
        controller: 'RestaurantAdminViewCtrl',
        controllerAs: 'vm',
        resolve: {
          restaurant: ['$resource', '$location', '$route',
            function ($resource, $location, $route) {
              return $resource('/api/v1/restaurants/:id').get({
                id: $route.current.params.restaurantID,
              }).$promise.catch(function(resp) {
                if (resp.status === 403) {
                  $location.path('/login');
                }
              });
            }
          ],
        },
      }).
      when('/admin', {
        templateUrl: 'src/restaurantAdminView/restaurantSelection.html',
        controller: 'RestaurantSelectionCtrl',
        controllerAs: 'vm',
        resolve: {
          restaurants: ['$resource', '$location',
            function ($resource, $location) {
              return $resource('/api/v1/user/restaurants').query().$promise.catch(function(resp) {
                if (resp.status === 403) {
                  $location.path('/login');
                }
              });
            }
          ],
        },
      }).
      when('/login', {
        templateUrl: 'src/login.template.html',
      }).
      when('/faq', {
        templateUrl: 'src/faq.template.html',
      }).
      when('/register/login/:token', {
        templateUrl: 'src/register/login.template.html',
        controller: 'RegisterLoginCtrl',
        controllerAs: 'vm',
        resolve: {
          redirectURL: ['$http', '$route', '$q',
            function($http, $route, $q) {
              return $http.get('/api/v1/register/facebook', {
                params: {
                  token: $route.current.params.token,
                },
              }).then(function success(resp) {
                return {
                  url: resp.data,
                };
              }, function error(resp) {
                if (resp.status === 403 || resp.status === 401) {
                  return {
                    error: resp.data,
                  };
                }
                return $q.reject(resp);
              });
            }
          ],
        }
      }).
      when('/register/pages', {
        templateUrl: 'src/register/pages.template.html',
        controller: 'RegisterPagesCtrl',
        controllerAs: 'vm',
        resolve: {
          pages: ['$resource', '$location',
            function($resource, $location) {
              return $resource('/api/v1/register/facebook/pages').query().$promise.catch(function(resp) {
                if (resp.status === 403) {
                  $location.path('/login');
                }
              });
            }
          ],
        },
      }).
      when('/register/form/:pageID?', {
        templateUrl: 'src/register/form.template.html',
        controller: 'RegisterFormCtrl',
        controllerAs: 'vm',
        resolve: {
          page: ['$resource', '$location', '$route', '$q',
            function($resource, $location, $route, $q) {
              if (!$route.current.params.pageID) {
                return $q.resolve();
              }
              return $resource('/api/v1/register/facebook/pages/:id').get({
                id: $route.current.params.pageID,
              }).$promise.catch(function(resp) {
                if (resp.status === 403) {
                  $location.path('/login');
                }
              });
            }
          ],
        }
      }).
      otherwise({
        redirectTo: '/',
      });
    }
  ]);
})();
{'fraction_non_alphanumeric': 0.15836509396766987, 'fraction_numerical': 0.006045472466815613, 'mean_word_length': 1.4438021836865766, 'pattern_counts': {'":': 0, '<': 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': '891300', 'n_tokens_mistral': 2091, 'n_tokens_neox': 2009, 'n_words': 305}