/**
 * A module which contains the definition of the application and the base of configuration
 *
 * @module app/index/services/index
 * @exports app/index
 *
 * @author Developer Developer
 */

import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/css/bootstrap-theme.css';
import 'font-awesome/css/font-awesome.css';
import angular from 'angular';
import angular_cookies from 'angular-cookies';
import angular_sanitize from 'angular-sanitize';
import angular_ui_router from 'angular-ui-router';
import angular_animate from 'angular-animate';
import angular_clipboard from 'angular-clipboard';
import angular_ui_bootstrap from 'angular-ui-bootstrap';
import angular_route from 'angular-route';
import angular_utils from 'angularUtils/src/angularUtils.js';
import angular_utils_pagination from 'angularUtils/src/directives/pagination/dirPagination.js';
require('./styles/index.scss');

// TODO(Ed)  clean this up, add the appropriate imports to phosphor-webui

import constants_index from './constants/index.js';
import environment_constants from './constants/environment-constants.js';

import services_index from './common/services/index.js';
import constants from './common/services/constants.js';
import dataService from './common/services/dataService.js';
import api_utils from './common/services/api-utils.js';
import userModel from './common/services/userModel.js';
import apiInterceptor from './common/services/apiInterceptor.js';

import filters_index from './common/filters/index.js';

import directives_index from './common/directives/index.js';
import errors from './common/directives/errors.js';
import app_header from './common/directives/app-header.js';
import app_navigation from './common/directives/app-navigation.js';
import confirm from './common/directives/confirm.js';
import log_event from './common/directives/log-event.js';
import log_filter from './common/directives/log-filter.js';
import log_search_control from './common/directives/log-search-control.js';
import toggle_flag from './common/directives/toggle-flag.js';
import firmware_list from './common/directives/firmware-list.js';
import file from './common/directives/file.js';
import loader from './common/directives/loader.js';
import paginate from './common/directives/paginate.js';

import login_index from './login/index.js';
import login_controller from './login/controllers/login-controller.js';

import overview_index from './overview/index.js';
import system_overview_controller from './overview/controllers/system-overview-controller.js';

import server_control_index from './server-control/index.js';
import bmc_reboot_controller from './server-control/controllers/bmc-reboot-controller.js';
import power_operations_controller from './server-control/controllers/power-operations-controller.js';
import remote_console_controller from './server-control/controllers/remote-console-controller.js';
import remote_console_window_controller from './server-control/controllers/remote-console-window-controller.js';

import server_health_index from './server-health/index.js';
import diagnostics_controller from './server-health/controllers/diagnostics-controller.js';
import inventory_controller from './server-health/controllers/inventory-controller.js';
import inventory_overview_controller from './server-health/controllers/inventory-overview-controller.js';
import log_controller from './server-health/controllers/log-controller.js';
import power_consumption_controller from './server-health/controllers/power-consumption-controller.js';
import sensors_controller from './server-health/controllers/sensors-controller.js';
import sensors_overview_controller from './server-health/controllers/sensors-overview-controller.js';
import unit_id_controller from './server-health/controllers/unit-id-controller.js';

import configuration_index from './configuration/index.js';
import date_time_controller from './configuration/controllers/date-time-controller.js';
import file_controller from './configuration/controllers/file-controller.js';
import network_controller from './configuration/controllers/network-controller.js';
import security_controller from './configuration/controllers/security-controller.js';
import firmware_controller from './configuration/controllers/firmware-controller.js';

import firmware_index from './firmware/index.js';
import bmc_controller from './firmware/controllers/bmc-controller.js';
import server_controller from './firmware/controllers/server-controller.js';

import multi_server_index from './multi-server/index.js';
import multi_server_controller from './multi-server/controllers/multi-server-controller.js';

import users_index from './users/index.js';
import user_accounts_controller from './users/controllers/user-accounts-controller.js';

import phosphor_templates from './templates.js';
import phosphor_vendors from './vendors.js';

window.angular && (function(angular) {
  'use strict';

  angular
    .module('app', [
      // Dependencies
      'ngRoute',
      'angular-clipboard',
      'angularUtils.directives.dirPagination',
      // Basic resources
      'app.constants',
      'app.templates',
      'app.vendors',
      'app.common.services',
      'app.common.directives',
      'app.common.filters',
      // Model resources
      'app.login',
      'app.overview',
      'app.serverControl',
      'app.serverHealth',
      'app.configuration',
      'app.users',
      'app.multiServer'
    ])
    // Route configuration
    .config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
      $locationProvider.hashPrefix('');
      $routeProvider
        .otherwise({
          'redirectTo': '/login'
        });
    }])
    .config(['$compileProvider', function($compileProvider) {
      $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|file|data|blob):/);
    }])
    .config(['$httpProvider', function($httpProvider) {
      $httpProvider.interceptors.push('apiInterceptor');
    }])
    .run(['$rootScope', '$location', 'dataService', 'userModel',
      function($rootScope, $location, dataService, userModel) {
        $rootScope.dataService = dataService;
        dataService.path = $location.path();
        $rootScope.$on('$routeChangeStart', function(event, next, current) {
          if (next.$$route == null || next.$$route == undefined) return;
          if (next.$$route.authenticated) {
            if (!userModel.isLoggedIn()) {
              $location.path('/login');
            }
          }

          if (next.$$route.originalPath == '/' ||
            next.$$route.originalPath == '/login') {
            if (userModel.isLoggedIn()) {
              if (current && current.$$route) {
                $location.path(current.$$route.originalPath);
              }
              else {
                $location.path('/overview/server');
              }
            }
          }
        });
        $rootScope.$on('$locationChangeSuccess', function(event) {
          var path = $location.path();
          dataService.path = path;
          if (['/', '/login', '/logout'].indexOf(path) == -1 &&
            path.indexOf('/login') == -1) {
            dataService.showNavigation = true;
          }
          else {
            dataService.showNavigation = false;
          }
        });

        $rootScope.$on('timedout-user', function() {
          sessionStorage.removeItem('LOGIN_ID');
          $location.path('/login');
        });
      }
    ]);

})(window.angular);
