Commit d1dd6539d52ccc28957ff8c8b74539fd616ccf60
Committed by
Ábner Oliveira
1 parent
a92499c6
Exists in
master
and in
32 other branches
Fix the dist build
added task 'npm run build' and tslint (to check ts files) changed task gulp build to avoid to copy "ts" and "map" files to the dist folder changed 'npm run build' task to call webpack removed eslint checks because it was replaced by tslint commit of updated dist folder
Showing
13 changed files
with
36 additions
and
152 deletions
Show diff stats
dist/index.html
1 | -<!doctype html><html ng-app="angular"><head><base href="/"><meta charset="utf-8"><title>angular</title><meta name="description" content=""><meta name="viewport" content="width=device-width"><link rel="stylesheet" href="/designs/themes/angular-theme/dist/styles/vendor-ebefc2c7fc.css"><link rel="stylesheet" href="/designs/themes/angular-theme/dist/styles/app-1cbf5925d3.css"></head><body><!--[if lt IE 10]> | |
1 | +<!doctype html><html ng-app="noosferoApp"><head><base href="/"><meta charset="utf-8"><title>angular</title><meta name="description" content=""><meta name="viewport" content="width=device-width"><link rel="stylesheet" href="/designs/themes/angular-theme/dist/styles/vendor-ebefc2c7fc.css"><link rel="stylesheet" href="/designs/themes/angular-theme/dist/styles/app-bfd148a542.css"></head><body><!--[if lt IE 10]> | |
2 | 2 | <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
3 | - <![endif]--><div ui-view=""></div><script src="/designs/themes/angular-theme/dist/scripts/vendor-bcf412b41d.js"></script><script src="/designs/themes/angular-theme/dist/scripts/app-da900f6af6.js"></script></body></html> | |
4 | 3 | \ No newline at end of file |
4 | + <![endif]--><div ui-view=""></div><script src="/designs/themes/angular-theme/dist/scripts/vendor-9a3c78f00a.js"></script><script src="/designs/themes/angular-theme/dist/scripts/app-8b422df734.js"></script></body></html> | |
5 | 5 | \ No newline at end of file | ... | ... |
dist/maps/scripts/app-da900f6af6.js.map
... | ... | @@ -1 +0,0 @@ |
1 | -{"version":3,"sources":["scripts/app-da900f6af6.js"],"names":["angular","module","RecentDocumentsController","noosfero","$state","vm","this","profile","owner","documents","openDocument","article","go","page","path","identifier","limit","block","settings","profiles","one","id","get","content_type","per_page","then","response","data","articles","$inject","component","restrict","templateUrl","bindings","controller","ProfileImageBlockController","MembersBlockController","members","people","MainBlockController","LinkListBlockController","links","BlogController","posts","perPage","currentPage","loadPage","customGET","totalPosts","headers","noosferoArticle","$injector","$compile","ArticleController","directive","scope","controllerAs","bindToController","link","element","specificDirective","type","has","directiveName","replace","toLowerCase","replaceWith","ActivityController","getActivityTemplate","activity","verb","ProfileImageController","defaultIcon","BoxesController","boxesOrder","box","position","boxes","noosferoBlock","blockName","activities","factory","Restangular","$q","currentProfile","defer","promise","setCurrentProfile","resolve","service","profileId","filter","text","options","option","acmeNavbar","NavbarController","moment","$modal","AuthService","Session","$scope","AUTH_EVENTS","currentUser","getCurrentUser","modalInstance","openLogin","open","logout","current","reload","$on","loginSuccess","close","logoutSuccess","activate","$http","$rootScope","$log","login","credentials","url","encodedData","username","password","post","loginSuccessCallback","loginFailedCallback","loginFromCookie","debug","create","$broadcast","loginFailed","destroy","undefined","jsonp","isAuthenticated","userId","isAuthorized","authorizedRoles","isArray","indexOf","userRole","$localStorage","user","AuthController","$stateParams","ProfileInfoController","ProfileController","ProfileHomeController","fields","transitionTo","location","MainController","ContentViewerController","ContentViewerActionsController","CmsController","$httpParamSerializer","SweetAlert","save","customPOST","Content-Type","swal","title","timer","runBlock","addFullRequestInterceptor","operation","route","private_token","run","routeConfig","$stateProvider","$urlRouterProvider","state","views","mainBlockContent","abstract","content","actions@main","otherwise","config","constant","$logProvider","$locationProvider","RestangularProvider","$httpProvider","$provide","debugEnabled","html5Mode","enabled","setBaseUrl","setFullResponse","defaults","decorator","$delegate","$document","uiViewElement","scrollToElementAnimated","$templateCache","put"],"mappings":"CAAA,WACE,YAEAA,SACGC,OAAO,WAAY,YAAa,YAAa,YAAa,UACvC,aAAc,aAAc,SAAU,cACtC,YAAa,eAAgB,SAC7B,gBAAiB,iBAAkB,mBACnC,mBAAoB,WAAY,6BAIxD,W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AqC,2JACxDD,EAAeC,IAAI,iCAAiC,inBACpDD,EAAeC,IAAI,oCAAoC,wjDACvDD,EAAeC,IAAI,qDAAqD,6LACxED,EAAeC,IAAI,yCAAyC,+ZAC5DD,EAAeC,IAAI,2CAA2C,yIAC9DD,EAAeC,IAAI,2DAA2D,qPAC9ED,EAAeC,IAAI,4DAA4D,yGAC/ED,EAAeC,IAAI,2EAA2E,4fAC9FD,EAAeC,IAAI,kEAAkE,ihCACrFD,EAAeC,IAAI,kEAAkE,mzBACrFD,EAAeC,IAAI,wDAAwD,6kBAC3ED,EAAeC,IAAI,kDAAkD,83BACrED,EAAeC,IAAI,0DAA0D,sPAC7ED,EAAeC,IAAI,4DAA4D,wDAC/ED,EAAeC,IAAI,kEAAkE,sNACrFD,EAAeC,IAAI,kEAAkE,8UACrFD,EAAeC,IAAI,wEAAwE","file":"scripts/app-da900f6af6.js","sourcesContent":["(function() {\n 'use strict';\n\n angular\n .module('angular', ['ngAnimate', 'ngCookies', 'ngStorage', 'ngTouch',\n 'ngSanitize', 'ngMessages', 'ngAria', 'restangular',\n 'ui.router', 'ui.bootstrap', 'toastr',\n 'angularMoment', 'angular.filter', 'akoenig.deckgrid',\n 'angular-timeline', 'duScroll', 'oitozero.ngSweetAlert']);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoRecentDocumentsBlock', {\n restrict: 'E',\n templateUrl: 'app/components/noosfero-blocks/recent-documents/recent-documents.html',\n bindings: {\n block: '<',\n owner: '<'\n },\n controller: RecentDocumentsController\n });\n\n /** @ngInject */\n function RecentDocumentsController(noosfero, $state) {\n var vm = this;\n vm.profile = vm.owner;\n vm.documents = [];\n\n vm.openDocument = function(article) {\n $state.go(\"main.profile.page\", {page: article.path, profile: article.profile.identifier}); \n }\n\n var limit = vm.block.settings.limit || 5;\n //FIXME get all text articles\n noosfero.profiles.one(vm.profile.id).one('articles').get({content_type: 'TinyMceArticle', per_page: limit}).then(function(response) {\n vm.documents = response.data.articles;\n });\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoProfileImageBlock', {\n restrict: 'E',\n templateUrl: 'app/components/noosfero-blocks/profile-image/profile-image.html',\n bindings: {\n block: '<',\n owner: '<'\n },\n controller: ProfileImageBlockController\n });\n\n /** @ngInject */\n function ProfileImageBlockController() {\n var vm = this;\n vm.profile = vm.owner;\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoMembersBlock', {\n restrict: 'E',\n templateUrl: 'app/components/noosfero-blocks/members-block/members-block.html',\n bindings: {\n block: '<',\n owner: '<'\n },\n controller: MembersBlockController\n });\n\n /** @ngInject */\n function MembersBlockController(noosfero) {\n var vm = this;\n vm.members = [];\n\n noosfero.members(noosfero.profiles.one(vm.owner.id)).one().get({per_page: 6}).then(function(response) {\n vm.members = response.data.people;\n });\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoMainBlock', {\n restrict: 'E',\n templateUrl: 'app/components/noosfero-blocks/main-block/main-block.html',\n bindings: {\n block: '<',\n owner: '<'\n },\n controller: MainBlockController\n });\n\n /** @ngInject */\n function MainBlockController() {\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoLinkListBlock', {\n restrict: 'E',\n templateUrl: 'app/components/noosfero-blocks/link-list/link-list.html',\n bindings: {\n block: '<',\n owner: '<'\n },\n controller: LinkListBlockController\n });\n\n /** @ngInject */\n function LinkListBlockController() {\n this.links = this.block.settings.links;\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoBlog', {\n restrict: 'E',\n templateUrl: 'app/components/noosfero-articles/blog/blog.html',\n bindings: {\n article: '<',\n profile: '<'\n },\n controller: BlogController\n });\n\n /** @ngInject */\n function BlogController(noosfero) {\n var vm = this;\n vm.posts = [];\n vm.perPage = 3;\n vm.currentPage = 1;\n\n vm.loadPage = function() {\n noosfero.articles.one(vm.article.id).customGET('children', {\n content_type: 'TinyMceArticle',\n per_page: vm.perPage,\n page: vm.currentPage\n }).then(function(response) {\n vm.totalPosts = response.headers('total');\n vm.posts = response.data.articles;\n });\n }\n vm.loadPage();\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .directive('noosferoArticle', noosferoArticle);\n\n /** @ngInject */\n function noosferoArticle($injector, $compile) {\n var directive = {\n restrict: 'E',\n templateUrl: 'app/components/noosfero-articles/article/article.html',\n scope: {\n article: '<',\n profile: '<'\n },\n controller: ArticleController,\n controllerAs: 'vm',\n bindToController: true,\n link: function(scope, element) {\n var specificDirective = 'noosfero'+scope.vm.article.type;\n if($injector.has(specificDirective+'Directive')) {\n var directiveName = specificDirective.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n element.replaceWith($compile('<'+directiveName+' article=\"vm.article\" profile=\"vm.profile\"></'+directiveName+'>')(scope)); \n }\n }\n };\n\n return directive;\n\n /** @ngInject */\n function ArticleController() {\n }\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoActivity', {\n restrict: 'E',\n bindings: {\n activity: '<'\n },\n templateUrl: 'app/components/noosfero-activities/activity/activity.html',\n replace: true,\n controller: ActivityController\n });\n\n /** @ngInject */\n function ActivityController() {\n var vm = this;\n vm.getActivityTemplate = function(activity) {\n return 'app/components/noosfero-activities/activity/' + activity.verb + '.html';\n }\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoProfileImage', {\n restrict: 'E',\n templateUrl: 'app/components/noosfero/profile-image/profile-image.html',\n bindings: {\n profile: '<'\n },\n controller: ProfileImageController\n });\n\n /** @ngInject */\n function ProfileImageController() {\n var vm = this;\n vm.defaultIcon = 'fa-users';\n if(vm.profile && vm.profile.type==='Person') vm.defaultIcon = 'fa-user';\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoBoxes', {\n restrict: 'E',\n bindings: {\n boxes: '<',\n owner: '<'\n },\n templateUrl: 'app/components/noosfero-boxes/boxes.html',\n controller: BoxesController\n });\n\n /** @ngInject */\n function BoxesController() {\n var vm = this;\n\n vm.boxesOrder = function(box) {\n if(box.position==2) return 0;\n return box.position;\n }\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .directive('noosferoBlock', noosferoBlock);\n\n /** @ngInject */\n function noosferoBlock($compile) {\n var directive = {\n restrict: 'E',\n scope: {\n block: '<',\n owner: '<'\n },\n link: function(scope, element) {\n var blockName = scope.block.type.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n element.replaceWith($compile('<noosfero-'+blockName+' block=\"block\" owner=\"owner\"></noosfero-'+blockName+'>')(scope));\n }\n };\n return directive;\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .component('noosferoActivities', {\n restrict: 'E',\n bindings: {\n activities: '<'\n },\n templateUrl: 'app/components/noosfero-activities/activities.html'\n });\n\n})();\n\n(function() {\n 'use strict';\n \n angular.module('angular').factory('noosfero', function(Restangular, $q) {\n var currentProfile = $q.defer();\n\n return {\n currentProfile: currentProfile.promise,\n setCurrentProfile: function(profile) { currentProfile.resolve(profile) },\n profiles: Restangular.service('profiles'),\n articles: Restangular.service('articles'),\n profile: function(profileId) {\n return Restangular.one('profiles', profileId);\n },\n members: function(profile) {\n return Restangular.service('members', profile);\n },\n boxes: function(profileId) {\n return Restangular.service('boxes', Restangular.one('profiles', profileId))\n }\n }\n });\n})();\n\n(function() {\n 'use strict';\n angular\n .module(\"angular\")\n .filter(\"noosferoTemplateFilter\", function() {\n return function(text, options) {\n for(var option in options) {\n text = text.replace('{'+option+'}', options[option]);\n }\n return text;\n }\n })\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .directive('acmeNavbar', acmeNavbar);\n\n /** @ngInject */\n function acmeNavbar() {\n var directive = {\n restrict: 'E',\n templateUrl: 'app/components/navbar/navbar.html',\n scope: {},\n controller: NavbarController,\n controllerAs: 'vm',\n bindToController: true\n };\n\n return directive;\n\n /** @ngInject */\n function NavbarController(moment, $modal, AuthService, Session, $scope, $state, AUTH_EVENTS) {\n var vm = this;\n\n vm.currentUser = Session.getCurrentUser();\n vm.modalInstance = null;\n\n vm.openLogin = function() {\n vm.modalInstance = $modal.open({\n templateUrl: 'app/components/auth/login.html',\n controller: 'AuthController',\n controllerAs: 'vm',\n bindToController: true\n });\n };\n vm.logout = function() {\n AuthService.logout();\n $state.go($state.current, {}, {reload: true}); //TODO move to auth\n };\n $scope.$on(AUTH_EVENTS.loginSuccess, function() {\n if(vm.modalInstance) {\n vm.modalInstance.close();\n vm.modalInstance = null;\n }\n $state.go($state.current, {}, {reload: true}); //TODO move to auth\n });\n $scope.$on(AUTH_EVENTS.logoutSuccess, function() {\n vm.currentUser = Session.getCurrentUser();\n });\n\n vm.activate = function() {\n if(!vm.currentUser) vm.openLogin();\n }\n vm.activate();\n }\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .factory('Session', Session)\n .factory('AuthService', AuthService);\n\n /** @ngInject */\n function AuthService($q, $http, $rootScope, Session, $log, AUTH_EVENTS) {\n\n function login (credentials) {\n var url = '/api/v1/login';\n var encodedData = 'login=' + credentials.username + '&password=' + credentials.password;\n return $http.post(url, encodedData).then(loginSuccessCallback, loginFailedCallback);\n }\n\n function loginFromCookie() {\n var url = '/api/v1/login_from_cookie';\n return $http.post(url).then(loginSuccessCallback, loginFailedCallback);\n }\n \n function loginSuccessCallback(response) {\n $log.debug('AuthService.login [SUCCESS] response', response);\n var currentUser = Session.create(response.data);\n $rootScope.currentUser = currentUser;\n $rootScope.$broadcast(AUTH_EVENTS.loginSuccess, currentUser);\n return currentUser;\n }\n \n function loginFailedCallback(response) {\n $log.debug('AuthService.login [FAIL] response', response);\n $rootScope.$broadcast(AUTH_EVENTS.loginFailed);\n // return $q.reject(response);\n return null;\n }\n\n function logout () {\n Session.destroy();\n $rootScope.currentUser = undefined;\n $rootScope.$broadcast(AUTH_EVENTS.logoutSuccess);\n $http.jsonp('/account/logout'); //FIXME logout from noosfero to sync login state\n }\n\n function isAuthenticated () {\n return !!Session.userId;\n }\n\n function isAuthorized (authorizedRoles) {\n if (!angular.isArray(authorizedRoles)) {\n authorizedRoles = [authorizedRoles];\n }\n return (service.isAuthenticated() && authorizedRoles.indexOf(Session.userRole) !== -1);\n }\n\n var service = {\n login: login,\n loginFromCookie: loginFromCookie,\n logout: logout,\n isAuthenticated: isAuthenticated,\n isAuthorized: isAuthorized\n };\n return service;\n }\n\n /** @ngInject */\n function Session($localStorage, $log) {\n var service = {};\n\n service.create = function(data) {\n $localStorage.currentUser = data.user;\n $log.debug('User session created.', $localStorage.currentUser);\n return $localStorage.currentUser;\n };\n\n service.destroy = function() {\n delete $localStorage.currentUser;\n $log.debug('User session destroyed.');\n };\n\n service.getCurrentUser = function () {\n return $localStorage.currentUser;\n };\n\n return service;\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .controller('AuthController', AuthController);\n\n\n /** @ngInject */\n function AuthController(noosfero, $log, $stateParams, AuthService) {\n var vm = this;\n vm.credentials = {};\n vm.login = function() {\n AuthService.login(vm.credentials);\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .controller('ProfileInfoController', ProfileInfoController);\n\n\n /** @ngInject */\n function ProfileInfoController(noosfero) {\n var vm = this;\n vm.profile = null;\n vm.activities = [];\n activate();\n\n function activate() {\n noosfero.currentProfile.then(function(profile) {\n vm.profile = profile;\n return noosfero.profiles.one(vm.profile.id).one('activities').get();\n }).then(function(response) {\n vm.activities = response.data.activities;\n });\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .controller('ProfileController', ProfileController);\n\n\n /** @ngInject */\n function ProfileController(noosfero, $log, $stateParams) {\n var vm = this;\n vm.boxes = [];\n activate();\n\n function activate() {\n noosfero.profiles.one().get({identifier: $stateParams.profile}).then(function(response) {\n vm.profile = response.data[0];\n noosfero.setCurrentProfile(vm.profile);\n return noosfero.boxes(vm.profile.id).one().get();\n }).then(function(response) {\n vm.boxes = response.data.boxes;\n });\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .controller('ProfileHomeController', ProfileHomeController);\n\n\n /** @ngInject */\n function ProfileHomeController(noosfero, $log, $stateParams, $scope, $state) {\n var vm = this;\n activate();\n\n function activate() {\n noosfero.currentProfile.then(function(profile) {\n vm.profile = profile;\n return noosfero.profile(vm.profile.id).customGET('home_page', {fields: 'path'});\n }).then(function(response) {\n if(response.data.article) {\n $state.transitionTo('main.profile.page', {page: response.data.article.path, profile: vm.profile.identifier}, {location: false});\n } else {\n $state.transitionTo('main.profile.info', {profile: vm.profile.identifier}, {location: false});\n }\n });\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .controller('MainController', MainController);\n\n\n /** @ngInject */\n function MainController() {\n \n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .controller('ContentViewerController', ContentViewerController);\n\n\n /** @ngInject */\n function ContentViewerController(noosfero, $log, $stateParams) {\n var vm = this;\n vm.article = null;\n vm.profile = null;\n activate();\n\n function activate() {\n noosfero.currentProfile.then(function(profile) {\n vm.profile = profile;\n return noosfero.profiles.one(vm.profile.id).one('articles').get({path: $stateParams.page});\n }).then(function(response) {\n vm.article = response.data.article;\n });\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .controller('ContentViewerActionsController', ContentViewerActionsController);\n\n\n /** @ngInject */\n function ContentViewerActionsController(noosfero) {\n var vm = this;\n vm.article = null;\n vm.profile = null;\n activate();\n\n function activate() {\n noosfero.currentProfile.then(function(profile) {\n vm.profile = profile;\n });\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .controller('CmsController', CmsController);\n\n\n /** @ngInject */\n function CmsController(noosfero, $stateParams, $httpParamSerializer, $state, SweetAlert) {\n var vm = this;\n vm.article = {};\n vm.profile = null;\n\n vm.save = function() {\n noosfero.currentProfile.then(function(profile) {\n return noosfero.profiles.one(profile.id).customPOST(\n {article: vm.article},\n 'articles',\n {},\n {'Content-Type':'application/json'}\n )\n }).then(function(response) {\n $state.transitionTo('main.profile.page', {page: response.data.article.path, profile: response.data.article.profile.identifier});\n SweetAlert.swal({\n title: \"Good job!\",\n text: \"Article saved!\",\n type: \"success\",\n timer: 1000\n });\n });\n }\n \n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .run(runBlock);\n\n /** @ngInject */\n function runBlock($log, Restangular, Session) {\n Restangular.addFullRequestInterceptor(function(element, operation, route, url, headers) {\n if(Session.getCurrentUser()) {\n headers['Private-Token'] = Session.getCurrentUser().private_token;\n }\n return { headers: headers };\n });\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .config(routeConfig);\n\n function routeConfig($stateProvider, $urlRouterProvider) {\n $stateProvider\n .state('main', {\n url: '/',\n templateUrl: 'app/main/main.html',\n controller: 'MainController',\n controllerAs: 'vm',\n resolve: {\n currentUser: function(AuthService) {\n return AuthService.loginFromCookie();\n }\n }\n })\n .state('main.profile.cms', {\n url: '^/myprofile/:profile/cms',\n views: {\n 'mainBlockContent': {\n templateUrl: 'app/cms/cms.html',\n controller: 'CmsController',\n controllerAs: 'vm'\n }\n }\n })\n .state('main.profile.settings', {\n url: '^/myprofile/:profile'\n })\n .state('main.profile', {\n url: '^/:profile',\n abstract: true,\n views: {\n 'content': {\n templateUrl: 'app/profile/profile.html',\n controller: 'ProfileController',\n controllerAs: 'vm'\n }\n }\n })\n .state('main.profile.home', {\n url: '',\n views: {\n 'mainBlockContent': {\n controller: 'ProfileHomeController',\n controllerAs: 'vm'\n }\n }\n })\n .state('main.profile.info', {\n url: '^/profile/:profile',\n views: {\n 'mainBlockContent': {\n templateUrl: 'app/profile-info/profile-info.html',\n controller: 'ProfileInfoController',\n controllerAs: 'vm'\n }\n }\n })\n .state('main.profile.page', {\n url: '/{page:any}',\n views: {\n 'mainBlockContent': {\n templateUrl: 'app/content-viewer/page.html',\n controller: 'ContentViewerController',\n controllerAs: 'vm'\n },\n 'actions@main': {\n templateUrl: 'app/content-viewer/navbar-actions.html',\n controller: 'ContentViewerActionsController',\n controllerAs: 'vm'\n }\n }\n });\n\n $urlRouterProvider.otherwise('/');\n }\n\n})();\n\n/* global moment:false */\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .constant('moment', moment)\n .constant('AUTH_EVENTS', {\n loginSuccess: 'auth-login-success',\n loginFailed: 'auth-login-failed',\n logoutSuccess: 'auth-logout-success'\n });\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('angular')\n .config(config);\n\n /** @ngInject */\n function config($logProvider, $locationProvider, RestangularProvider, $httpProvider, $provide) {\n $logProvider.debugEnabled(true);\n $locationProvider.html5Mode({enabled: true});\n RestangularProvider.setBaseUrl('/api/v1');\n RestangularProvider.setFullResponse(true);\n $httpProvider.defaults.headers.post = {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'};\n\n $provide.decorator('$uiViewScroll', function ($delegate, $document) {\n return function (uiViewElement) {\n $document.scrollToElementAnimated(uiViewElement);\n };\n });\n }\n\n})();\n\nangular.module(\"angular\").run([\"$templateCache\", function($templateCache) {$templateCache.put(\"app/cms/cms.html\",\"<form><div class=\\\"form-group\\\"><label for=\\\"titleInput\\\">Title</label> <input type=\\\"text\\\" class=\\\"form-control\\\" id=\\\"titleInput\\\" placeholder=\\\"title\\\" ng-model=\\\"vm.article.name\\\"></div><div class=\\\"form-group\\\"><label for=\\\"bodyInput\\\">Text</label> <textarea class=\\\"form-control\\\" id=\\\"bodyInput\\\" rows=\\\"10\\\" ng-model=\\\"vm.article.body\\\"></textarea></div><button type=\\\"submit\\\" class=\\\"btn btn-default\\\" ng-click=\\\"vm.save()\\\">Save</button></form>\");\n$templateCache.put(\"app/content-viewer/navbar-actions.html\",\"<ul class=\\\"nav navbar-nav\\\"><li ng-show=\\\"vm.profile\\\"><a href=\\\"#\\\" role=\\\"button\\\" ui-sref=\\\"main.profile.cms({profile: vm.profile.identifier})\\\"><i class=\\\"fa fa-file fa-fw fa-lg\\\"></i> New Post</a></li></ul>\");\n$templateCache.put(\"app/content-viewer/page.html\",\"<noosfero-article ng-if=\\\"vm.article\\\" article=\\\"vm.article\\\" profile=\\\"vm.profile\\\"></noosfero-article>\");\n$templateCache.put(\"app/main/main.html\",\"<acme-navbar></acme-navbar><div ui-view=\\\"content\\\"></div>\");\n$templateCache.put(\"app/profile/profile.html\",\"<div class=\\\"profile-container\\\"><div class=\\\"row\\\"><noosfero-boxes boxes=\\\"vm.boxes\\\" owner=\\\"vm.profile\\\"></noosfero-boxes></div></div>\");\n$templateCache.put(\"app/profile-info/profile-info.html\",\"<h3>{{vm.profile.name}}</h3><div class=\\\"profile-wall\\\"><h4>Profile Wall</h4><noosfero-activities activities=\\\"vm.activities\\\"></noosfero-activities></div>\");\n$templateCache.put(\"app/components/auth/login.html\",\"<div class=\\\"modal-header\\\"><h3 class=\\\"modal-title\\\">Login</h3></div><div class=\\\"modal-body\\\"><form><div class=\\\"form-group\\\"><label for=\\\"exampleInputEmail1\\\">Login / Email address</label> <input type=\\\"text\\\" class=\\\"form-control\\\" id=\\\"exampleInputEmail1\\\" placeholder=\\\"Login / Email\\\" ng-model=\\\"vm.credentials.username\\\"></div><div class=\\\"form-group\\\"><label for=\\\"exampleInputPassword1\\\">Password</label> <input type=\\\"password\\\" class=\\\"form-control\\\" id=\\\"exampleInputPassword1\\\" placeholder=\\\"Password\\\" ng-model=\\\"vm.credentials.password\\\"></div><button type=\\\"submit\\\" class=\\\"btn btn-default\\\" ng-click=\\\"vm.login()\\\">Login</button></form></div>\");\n$templateCache.put(\"app/components/navbar/navbar.html\",\"<nav class=\\\"navbar navbar-static-top navbar-inverse\\\"><div class=\\\"container-fluid\\\"><div class=\\\"navbar-header\\\"><button type=\\\"button\\\" class=\\\"navbar-toggle collapsed\\\" ng-click=\\\"isCollapsed = !isCollapsed\\\"><span class=\\\"sr-only\\\">Toggle navigation</span> <span class=\\\"icon-bar\\\"></span> <span class=\\\"icon-bar\\\"></span> <span class=\\\"icon-bar\\\"></span></button> <a class=\\\"navbar-brand\\\" ui-sref=\\\"main\\\"><span class=\\\"noosfero-logo\\\"><img src=\\\"/designs/themes/angular-theme/dist/assets/images/logo-noosfero.png\\\"></span> Noosfero</a></div><div class=\\\"collapse navbar-collapse\\\" id=\\\"navbar-collapse\\\" collapse=\\\"isCollapsed\\\"><ul class=\\\"nav navbar-nav\\\"></ul><ul class=\\\"nav navbar-nav navbar-right\\\"><li ng-show=\\\"!vm.currentUser\\\"><a ng-href=\\\"#\\\" ng-click=\\\"vm.openLogin()\\\">Login</a></li><li class=\\\"dropdown profile-menu\\\" ng-show=\\\"vm.currentUser\\\" dropdown=\\\"\\\"><a href=\\\"#\\\" class=\\\"dropdown-toggle\\\" aria-expanded=\\\"false\\\" dropdown-toggle=\\\"\\\"><noosfero-profile-image profile=\\\"vm.currentUser.person\\\" class=\\\"profile-image\\\"></noosfero-profile-image><span ng-bind=\\\"vm.currentUser.person.name\\\"></span> <b class=\\\"caret\\\"></b></a><ul class=\\\"dropdown-menu\\\" dropdown-menu=\\\"\\\"><li><a ui-sref=\\\"main.profile.info({profile: vm.currentUser.person.identifier})\\\"><i class=\\\"fa fa-fw fa-user\\\"></i> Profile</a></li><li><a target=\\\"_self\\\" ui-sref=\\\"main.profile.settings({profile: vm.currentUser.person.identifier})\\\"><i class=\\\"fa fa-fw fa-gear\\\"></i> Settings</a></li><li class=\\\"divider\\\"></li><li><a href=\\\"#\\\" ng-click=\\\"vm.logout()\\\"><i class=\\\"fa fa-fw fa-power-off\\\"></i> Log Out</a></li></ul></li></ul><div ui-view=\\\"actions\\\"></div></div></div></nav>\");\n$templateCache.put(\"app/components/noosfero-activities/activities.html\",\"<timeline><timeline-event ng-repeat=\\\"activity in $ctrl.activities | orderBy: \\'created_at\\':true\\\"><noosfero-activity activity=\\\"activity\\\"></noosfero-activity></timeline-event></timeline>\");\n$templateCache.put(\"app/components/noosfero-boxes/box.html\",\"<div ng-class=\\\"{\\'col-md-2-5\\': box.position!=1, \\'col-md-7\\': box.position==1}\\\"><div ng-repeat=\\\"block in box.blocks | orderBy: \\'position\\'\\\" class=\\\"panel panel-default block {{block.type | lowercase}}\\\"><div class=\\\"panel-heading\\\" ng-show=\\\"block.title\\\"><h3 class=\\\"panel-title\\\">{{block.title}}</h3></div><div class=\\\"panel-body\\\"><noosfero-block block=\\\"block\\\" owner=\\\"$ctrl.owner\\\"></noosfero-block></div></div></div>\");\n$templateCache.put(\"app/components/noosfero-boxes/boxes.html\",\"<ng-include ng-repeat=\\\"box in $ctrl.boxes | orderBy: $ctrl.boxesOrder\\\" src=\\\"\\'app/components/noosfero-boxes/box.html\\'\\\"></ng-include>\");\n$templateCache.put(\"app/components/noosfero/profile-image/profile-image.html\",\"<span title=\\\"{{$ctrl.profile.name}}\\\"><img ng-if=\\\"$ctrl.profile.image\\\" ng-src=\\\"{{$ctrl.profile.image.url}}\\\" class=\\\"img-responsive profile-image\\\"> <i ng-if=\\\"!$ctrl.profile.image\\\" class=\\\"fa {{$ctrl.defaultIcon}} fa-5x profile-image\\\"></i></span>\");\n$templateCache.put(\"app/components/noosfero-activities/activity/activity.html\",\"<div class=\\\"activity\\\"><ng-include src=\\\"$ctrl.getActivityTemplate($ctrl.activity)\\\"></ng-include></div>\");\n$templateCache.put(\"app/components/noosfero-activities/activity/add_member_in_community.html\",\"<timeline-badge class=\\\"info\\\"><i class=\\\"fa fa-user-plus\\\"></i></timeline-badge><timeline-panel><timeline-heading><h4 class=\\\"timeline-title\\\"><a ui-sref=\\\"main.profile.info({profile: $ctrl.activity.user.identifier})\\\"><strong ng-bind=\\\"$ctrl.activity.user.name\\\"></strong></a> <span>has joined the community</span></h4><p><small class=\\\"text-muted\\\"><i class=\\\"fa fa-clock-o\\\"></i> <span am-time-ago=\\\"$ctrl.activity.created_at\\\"></span></small></p></timeline-heading><div class=\\\"timeline-body\\\"></div></timeline-panel>\");\n$templateCache.put(\"app/components/noosfero-activities/activity/create_article.html\",\"<timeline-badge class=\\\"success\\\"><i class=\\\"fa fa-file-text\\\"></i></timeline-badge><timeline-panel><timeline-heading><h4 class=\\\"timeline-title\\\"><a ui-sref=\\\"main.profile.info({profile: $ctrl.activity.user.identifier})\\\"><strong ng-bind=\\\"$ctrl.activity.user.name\\\"></strong></a> <span>has published on</span> <a ui-sref=\\\"main.profile.info({profile: $ctrl.activity.target.article.profile.identifier})\\\"><strong ng-bind=\\\"$ctrl.activity.target.article.profile.name\\\"></strong></a></h4><p><small class=\\\"text-muted\\\"><i class=\\\"fa fa-clock-o\\\"></i> <span am-time-ago=\\\"$ctrl.activity.created_at\\\"></span></small></p></timeline-heading><div class=\\\"timeline-body\\\"><div class=\\\"article\\\"><div class=\\\"title\\\"><a ui-sref=\\\"main.profile.page({profile: $ctrl.activity.target.article.profile.identifier, page: $ctrl.activity.target.article.path})\\\" ng-bind=\\\"$ctrl.activity.target.article.title\\\"></a></div><div class=\\\"lead small\\\"><div ng-bind-html=\\\"$ctrl.activity.target.article.body | stripTags | truncate: 100 : \\'...\\': true\\\"></div></div></div></div></timeline-panel>\");\n$templateCache.put(\"app/components/noosfero-activities/activity/new_friendship.html\",\"<timeline-badge class=\\\"info\\\"><i class=\\\"fa fa-user-plus\\\"></i></timeline-badge><timeline-panel><timeline-heading><h4 class=\\\"timeline-title\\\"><a ui-sref=\\\"main.profile.info({profile: $ctrl.activity.user.identifier})\\\"><strong ng-bind=\\\"$ctrl.activity.user.name\\\"></strong></a> <span>has made <span ng-bind=\\\"$ctrl.activity.params.friend_name.length\\\"></span> new friend(s):</span> <span class=\\\"comma-separated\\\"><a class=\\\"separated-item\\\" ui-sref=\\\"main.profile.info({profile: $ctrl.activity.params.friend_url[$index].profile})\\\" ng-repeat=\\\"friend in $ctrl.activity.params.friend_name\\\"><strong ng-bind=\\\"friend\\\"></strong></a></span></h4><p><small class=\\\"text-muted\\\"><i class=\\\"fa fa-clock-o\\\"></i> <span am-time-ago=\\\"$ctrl.activity.created_at\\\"></span></small></p></timeline-heading><div class=\\\"timeline-body\\\"></div></timeline-panel>\");\n$templateCache.put(\"app/components/noosfero-articles/article/article.html\",\"<div class=\\\"article\\\"><div class=\\\"page-header\\\"><h3 ng-bind=\\\"vm.article.title\\\"></h3></div><div class=\\\"sub-header clearfix\\\"><div class=\\\"page-info pull-right small text-muted\\\"><span class=\\\"time\\\"><i class=\\\"fa fa-clock-o\\\"></i> <span am-time-ago=\\\"vm.article.created_at\\\"></span></span> <span class=\\\"author\\\" ng-if=\\\"vm.article.author\\\"><i class=\\\"fa fa-user\\\"></i> <a ui-sref=\\\"main.profile({profile: vm.article.author.identifier})\\\"><span class=\\\"author-name\\\" ng-bind=\\\"vm.article.author.name\\\"></span></a></span></div></div><div class=\\\"page-body\\\"><div ng-bind-html=\\\"vm.article.body\\\"></div></div></div>\");\n$templateCache.put(\"app/components/noosfero-articles/blog/blog.html\",\"<div class=\\\"blog\\\"><div class=\\\"blog-cover\\\" ng-show=\\\"$ctrl.article.image\\\"><img ng-src=\\\"{{$ctrl.article.image.url}}\\\" class=\\\"img-responsive\\\"><h3 ng-bind=\\\"$ctrl.article.title\\\"></h3></div><div class=\\\"page-header\\\" ng-show=\\\"!$ctrl.article.image\\\"><h3 ng-bind=\\\"$ctrl.article.title\\\"></h3></div><div><div ng-repeat=\\\"child in $ctrl.posts | orderBy: \\'created_at\\':true\\\"><div class=\\\"page-header\\\"><a class=\\\"title\\\" ui-sref=\\\"main.profile.page({profile: $ctrl.profile.identifier, page: child.path})\\\"><h4 ng-bind=\\\"child.title\\\"></h4></a><div class=\\\"post-lead\\\" ng-bind-html=\\\"child.body | truncate: 500: \\'...\\': true\\\"></div></div></div></div><pagination ng-model=\\\"$ctrl.currentPage\\\" total-items=\\\"$ctrl.totalPosts\\\" class=\\\"pagination-sm center-block\\\" boundary-links=\\\"true\\\" items-per-page=\\\"$ctrl.perPage\\\" ng-change=\\\"$ctrl.loadPage()\\\" first-text=\\\"«\\\" last-text=\\\"»\\\" previous-text=\\\"‹\\\" next-text=\\\"›\\\"></pagination></div>\");\n$templateCache.put(\"app/components/noosfero-blocks/link-list/link-list.html\",\"<div class=\\\"link-list-block\\\"><div ng-repeat=\\\"link in $ctrl.links\\\"><a ng-href=\\\"{{link.address | noosferoTemplateFilter:{profile: $ctrl.owner.identifier} }}\\\"><i class=\\\"fa fa-fw icon-{{link.icon}}\\\"></i> <span>{{link.name}}</span></a></div></div>\");\n$templateCache.put(\"app/components/noosfero-blocks/main-block/main-block.html\",\"<div ui-view=\\\"mainBlockContent\\\" autoscroll=\\\"\\\"></div>\");\n$templateCache.put(\"app/components/noosfero-blocks/members-block/members-block.html\",\"<div class=\\\"members-block\\\"><a ng-repeat=\\\"member in $ctrl.members\\\" ui-sref=\\\"main.profile({profile: member.identifier})\\\" class=\\\"member\\\"><noosfero-profile-image profile=\\\"member\\\"></noosfero-profile-image></a></div>\");\n$templateCache.put(\"app/components/noosfero-blocks/profile-image/profile-image.html\",\"<div class=\\\"center-block text-center profile-image-block\\\"><a ui-sref=\\\"main.profile.info({profile: $ctrl.owner.identifier})\\\"><noosfero-profile-image profile=\\\"$ctrl.owner\\\"></noosfero-profile-image></a> <a class=\\\"settings-link\\\" target=\\\"_self\\\" ui-sref=\\\"main.profile.settings({profile: $ctrl.owner.identifier})\\\">Control panel</a></div>\");\n$templateCache.put(\"app/components/noosfero-blocks/recent-documents/recent-documents.html\",\"<div deckgrid=\\\"\\\" source=\\\"$ctrl.documents\\\" class=\\\"deckgrid\\\"><div class=\\\"a-card panel media\\\" ng-click=\\\"mother.$ctrl.openDocument(card);\\\"><div class=\\\"author media-left\\\" ng-show=\\\"card.author.image\\\"><img ng-src=\\\"{{card.author.image.url}}\\\" class=\\\"img-circle\\\"></div><div class=\\\"header media-body\\\"><h5 class=\\\"title media-heading\\\" ng-bind=\\\"card.title\\\"></h5><div class=\\\"subheader\\\"><span class=\\\"time\\\"><i class=\\\"fa fa-clock-o\\\"></i> <span am-time-ago=\\\"card.created_at\\\"></span></span></div></div><img ng-show=\\\"card.image\\\" ng-src=\\\"{{card.image.url}}\\\" class=\\\"img-responsive article-image\\\"><div class=\\\"post-lead\\\" ng-bind-html=\\\"card.body | stripTags | truncate: 100: \\'...\\': true\\\"></div></div></div>\");}]);"],"sourceRoot":"/source/"} | |
2 | 0 | \ No newline at end of file |
dist/maps/scripts/vendor-bcf412b41d.js.map
... | ... | @@ -1 +0,0 @@ |
1 | -{"version":3,"sources":["scripts/vendor-bcf412b41d.js"],"names":["window","document","undefined","minErr","module","ErrorConstructor","Error","paramPrefix","i","SKIP_INDEXES","templateArgs","arguments","code","message","template","replace","match","index","slice","shiftedIndex","length","toDebugString","encodeURIComponent","isArrayLike","obj","isWindow","isArray","isString","jqLite","Object","isNumber","Array","item","forEach","iterator","context","key","isFunction","hasOwnProperty","call","isPrimitive","isBlankObject","forEachSorted","keys","sort","reverseParams","iteratorFn","value","nextUid","uid","setHashKey","h","$$hashKey","baseExtend","dst","objs","deep","ii","isObject","j","jj","src","isDate","Date","valueOf","isRegExp","RegExp","nodeName","cloneNode","isElement","clone","extend","merge","toInt","str","parseInt","inherit","parent","extra","create","noop","identity","$","valueFn","hasCustomToString","toString","isUndefined","isDefined","getPrototypeOf","isScope","$evalAsync","$watch","isFile","isFormData","isBlob","isBoolean","isPromiseLike","then","isTypedArray","TYPED_ARRAY_REGEXP","test","isArrayBuffer","node","prop","attr","find","makeMap","items","split","nodeName_","element","lowercase","arrayRemove","array","indexOf","splice","copy","source","destination","copyRecurse","push","copyElement","stackSource","stackDest","ngMinErr","needsRecurse","copyType","constructor","buffer","copied","ArrayBuffer","byteLength","Uint8Array","set","re","lastIndex","shallowCopy","charAt","equals","o1","o2","keySet","t1","t2","getTime","createMap","concat","array1","array2","sliceArgs","args","startIndex","bind","self","fn","curryArgs","apply","toJsonReplacer","val","toJson","pretty","JSON","stringify","fromJson","json","parse","timezoneToOffset","timezone","fallback","ALL_COLONS","requestedTimezoneOffset","isNaN","addDateMinutes","date","minutes","setMinutes","getMinutes","convertTimezoneToLocal","reverse","dateTimezoneOffset","getTimezoneOffset","timezoneOffset","startingTag","empty","e","elemHtml","append","html","nodeType","NODE_TYPE_TEXT","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","substring","toKeyValue","parts","arrayValue","encodeUriQuery","join","encodeUriSegment","pctEncodeSpaces","getNgAttribute","ngAttr","ngAttrPrefixes","getAttribute","angularInit","bootstrap","appElement","config","prefix","name","hasAttribute","candidate","querySelector","strictDi","modules","defaultConfig","doBootstrap","injector","tag","unshift","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","scope","compile","$apply","data","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","angular","resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","location","reload","getTestability","rootElement","get","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","bindJQuery","originalCleanData","bindJQueryFired","jqName","jq","jQuery","on","JQLitePrototype","isolateScope","controller","inheritedData","cleanData","elems","events","elem","_data","$destroy","triggerHandler","JQLite","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","getBlockNodes","nodes","blockNodes","endNode","nextSibling","setupModuleLoader","ensure","factory","$injectorMinErr","$$minErr","requires","configFn","invokeLater","provider","method","insertMethod","queue","invokeQueue","moduleInstance","invokeLaterAndSetModuleName","recipeName","factoryFunction","$$moduleName","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","service","constant","decorator","animation","filter","directive","component","run","block","this","serializeObject","seen","publishExternalAPI","version","uppercase","callbacks","counter","$$csp","csp","angularModule","$$sanitizeUri","$$SanitizeUriProvider","$CompileProvider","a","htmlAnchorDirective","input","inputDirective","textarea","form","formDirective","script","scriptDirective","select","selectDirective","style","styleDirective","option","optionDirective","ngBind","ngBindDirective","ngBindHtml","ngBindHtmlDirective","ngBindTemplate","ngBindTemplateDirective","ngClass","ngClassDirective","ngClassEven","ngClassEvenDirective","ngClassOdd","ngClassOddDirective","ngCloak","ngCloakDirective","ngController","ngControllerDirective","ngForm","ngFormDirective","ngHide","ngHideDirective","ngIf","ngIfDirective","ngInclude","ngIncludeDirective","ngInit","ngInitDirective","ngNonBindable","ngNonBindableDirective","ngPluralize","ngPluralizeDirective","ngRepeat","ngRepeatDirective","ngShow","ngShowDirective","ngStyle","ngStyleDirective","ngSwitch","ngSwitchDirective","ngSwitchWhen","ngSwitchWhenDirective","ngSwitchDefault","ngSwitchDefaultDirective","ngOptions","ngOptionsDirective","ngTransclude","ngTranscludeDirective","ngModel","ngModelDirective","ngList","ngListDirective","ngChange","ngChangeDirective","pattern","patternDirective","ngPattern","required","requiredDirective","ngRequired","minlength","minlengthDirective","ngMinlength","maxlength","maxlengthDirective","ngMaxlength","ngValue","ngValueDirective","ngModelOptions","ngModelOptionsDirective","ngIncludeFillContentDirective","ngAttributeAliasDirectives","ngEventDirectives","$anchorScroll","$AnchorScrollProvider","$animate","$AnimateProvider","$animateCss","$CoreAnimateCssProvider","$$animateJs","$$CoreAnimateJsProvider","$$animateQueue","$$CoreAnimateQueueProvider","$$AnimateRunner","$$AnimateRunnerFactoryProvider","$$animateAsyncRun","$$AnimateAsyncRunFactoryProvider","$browser","$BrowserProvider","$cacheFactory","$CacheFactoryProvider","$controller","$ControllerProvider","$document","$DocumentProvider","$exceptionHandler","$ExceptionHandlerProvider","$filter","$FilterProvider","$$forceReflow","$$ForceReflowProvider","$interpolate","$InterpolateProvider","$interval","$IntervalProvider","$http","$HttpProvider","$httpParamSerializer","$HttpParamSerializerProvider","$httpParamSerializerJQLike","$HttpParamSerializerJQLikeProvider","$httpBackend","$HttpBackendProvider","$xhrFactory","$xhrFactoryProvider","$location","$LocationProvider","$log","$LogProvider","$parse","$ParseProvider","$rootScope","$RootScopeProvider","$q","$QProvider","$$q","$$QProvider","$sce","$SceProvider","$sceDelegate","$SceDelegateProvider","$sniffer","$SnifferProvider","$templateCache","$TemplateCacheProvider","$templateRequest","$TemplateRequestProvider","$$testability","$$TestabilityProvider","$timeout","$TimeoutProvider","$window","$WindowProvider","$$rAF","$$RAFProvider","$$jqLite","$$jqLiteProvider","$$HashMap","$$HashMapProvider","$$cookieReader","$$CookieReaderProvider","jqNextId","jqId","camelCase","SPECIAL_CHARS_REGEXP","_","offset","toUpperCase","MOZ_HACK_REGEXP","jqLiteIsTextNode","HTML_REGEXP","jqLiteAcceptsData","NODE_TYPE_ELEMENT","NODE_TYPE_DOCUMENT","jqLiteHasData","jqCache","ng339","jqLiteCleanData","jqLiteRemoveData","jqLiteBuildFragment","tmp","wrap","fragment","createDocumentFragment","createTextNode","appendChild","createElement","TAG_NAME_REGEXP","exec","wrapMap","_default","innerHTML","XHTML_TAG_REGEXP","lastChild","childNodes","firstChild","textContent","jqLiteParseHTML","parsed","SINGLE_TAG_REGEXP","jqLiteWrapNode","wrapper","parentNode","replaceChild","argIsString","trim","jqLiteMinErr","jqLiteAddNodes","jqLiteClone","jqLiteDealoc","onlyDescendants","querySelectorAll","descendants","l","jqLiteOff","type","unsupported","expandoStore","jqLiteExpandoStore","handle","removeHandler","listenerFns","removeEventListenerFn","MOUSE_EVENT_MAP","expandoId","createIfNecessary","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","selector","jqLiteRemoveClass","cssClasses","setAttribute","cssClass","jqLiteAddClass","existingClasses","root","elements","jqLiteController","jqLiteInheritedData","documentElement","names","NODE_TYPE_DOCUMENT_FRAGMENT","host","jqLiteEmpty","removeChild","jqLiteRemove","keepData","jqLiteDocumentLoaded","action","win","readyState","setTimeout","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","getAliasedAttrName","ALIASED_ATTR","createEventHandler","eventHandler","event","isDefaultPrevented","defaultPrevented","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","stopImmediatePropagation","stopPropagation","isImmediatePropagationStopped","handlerWrapper","specialHandlerWrapper","defaultHandlerWrapper","handler","specialMouseHandlerWrapper","target","related","relatedTarget","jqLiteContains","$get","hasClass","classes","addClass","removeClass","hashKey","nextUidFn","objType","HashMap","isolatedUid","put","extractArgs","fnText","STRIP_COMMENTS","ARROW_ARG","FN_ARGS","anonFn","annotate","$inject","argDecl","last","FN_ARG_SPLIT","FN_ARG","all","underscore","modulesToLoad","supportObject","delegate","provider_","providerInjector","instantiate","providerCache","providerSuffix","enforceReturnValue","result","instanceInjector","factoryFn","enforce","$injector","instanceCache","serviceName","decorFn","origProvider","orig$get","origInstance","$delegate","loadModules","moduleFn","runInvokeQueue","invokeArgs","loadedModules","stack","createInternalInjector","cache","getService","caller","INSTANTIATING","err","shift","injectionArgs","locals","$$annotate","isClass","func","msie","Function","prototype","Type","ctor","has","protoInstanceInjector","autoScrollingEnabled","disableAutoScrolling","getFirstAnchor","list","some","getYOffset","scroll","yOffset","getComputedStyle","position","getBoundingClientRect","bottom","scrollTo","scrollIntoView","elemTop","top","scrollBy","hash","elm","getElementById","getElementsByName","newVal","oldVal","mergeClasses","b","extractElementNode","ELEMENT_NODE","splitClasses","klass","prepareAnimateOptions","options","Browser","completeOutstandingRequest","outstandingRequestCount","outstandingRequestCallbacks","pop","error","getHash","url","substr","cacheStateAndFireUrlChange","pendingLocation","cacheState","fireUrlChange","getCurrentState","history","state","cachedState","lastCachedState","lastBrowserUrl","lastHistoryState","urlChangeListeners","listener","clearTimeout","pendingDeferIds","isMock","$$completeOutstandingRequest","$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","callback","href","baseElement","sameState","sameBase","stripHash","urlChangeInit","onUrlChange","$$applicationDestroyed","off","$$checkUrlChange","baseHref","defer","delay","timeoutId","cancel","deferId","cacheFactory","cacheId","refresh","entry","freshEnd","staleEnd","n","link","p","nextEntry","prevEntry","caches","size","stats","id","capacity","Number","MAX_VALUE","lruHash","lruEntry","remove","removeAll","destroy","info","$$sanitizeUriProvider","parseIsolateBindings","directiveName","isController","LOCAL_REGEXP","bindings","definition","scopeName","$compileMinErr","mode","collection","optional","attrName","parseDirectiveBindings","bindToController","controllerAs","identifierForController","assertValidDirectiveName","hasDirectives","Suffix","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","REQUIRE_PREFIX_REGEXP","EVENT_HANDLER_ATTR_REGEXP","registerDirective","directiveFactory","directives","priority","require","restrict","$$bindings","$$isolateBindings","makeInjectable","tElement","tAttrs","$element","$attrs","templateUrl","transclude","aHrefSanitizationWhitelist","regexp","imgSrcSanitizationWhitelist","enabled","setSpecialAttr","specialAttrHolder","attributes","attribute","removeNamedItem","setNamedItem","safeAddClass","className","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","NOT_EMPTY","domNode","nodeValue","compositeLinkFn","compileNodes","$$addScopeClass","namespace","cloneConnectFn","needsNewScope","$parent","$new","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","detectNamespaceForChildElements","$linkNode","wrapTemplate","controllerName","instance","$$addScopeInfo","parentElement","nodeList","$rootElement","nodeLinkFn","childLinkFn","childScope","idx","childBoundTranscludeFn","stableNodeList","nodeLinkFnFound","nodeListLength","linkFns","transcludeOnThisElement","createBoundTranscludeFn","templateOnThisElement","attrs","linkFnFound","Attributes","collectDirectives","applyDirectivesToNode","$$element","terminal","previousBoundTranscludeFn","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","boundSlots","$$slots","slotName","attrsMap","$attr","addDirective","directiveNormalize","nName","ngAttrName","isNgAttr","nAttrs","attrStartName","attrEndName","NG_ATTR_BINDING","PREFIX_REGEXP","multiElementMatch","MULTI_ELEMENT_DIR_RE","directiveIsMultiElement","addAttrInterpolateDirective","animVal","addTextInterpolateDirective","NODE_TYPE_COMMENT","byPriority","groupScan","attrStart","attrEnd","depth","groupElementsLinkFnWrapper","linkFn","compilationGenerator","eager","compiled","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","pre","post","newIsolateScopeDirective","$$isolateScope","cloneAndAnnotateFn","getControllers","elementControllers","inheritType","dataName","property","setupControllers","controllerDirectives","controllerKey","$scope","$transclude","controllerInstance","hasElementTranscludeDirective","linkNode","controllersBoundTransclude","cloneAttachFn","scopeToChild","slotTranscludeFn","controllerScope","removeScopeBindingWatches","removeControllerBindingWatches","newScopeDirective","isSlotFilled","templateDirective","$$originalDirective","initializeDirectiveBindings","$on","controllerDirective","identifier","controllerResult","$onInit","invokeLinkFn","$template","directiveValue","terminalPriority","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","$compileNode","replaceDirective","childTranscludeFn","didScanForMultipleTransclusion","mightHaveMultipleTransclusionError","$$start","$$end","assertNoDuplicate","$$tlb","candidateDirective","scanningIndex","createComment","replaceWith","slots","contents","slotMap","filledSlots","elementSelector","filled","$$newScope","denormalizeTemplate","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectiveScope","mergeTemplateAttributes","compileTemplateUrl","Math","max","newScope","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","$set","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","linkQueue","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","content","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","$$destroyed","oldClasses","ignoreChildLinkFn","diff","what","previousDirective","wrapModuleNameIfDefined","moduleName","text","interpolateFn","templateNode","templateNodeParent","hasCompileParent","$$addBindingClass","$$addBindingInfo","expressions","getTrustedContext","attrNormalizedName","HTML","RESOURCE_URL","allOrNothing","trustedContext","$$observers","newValue","$$inter","$$scope","oldValue","$updateClass","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","hasData","annotation","removeWatchCollection","lastValue","parentGet","parentSet","compare","removeWatch","$observe","literal","assign","parentValueWatch","parentValue","$stateful","$watchCollection","newParentValue","SIMPLE_ATTR_NAME","attributesToCopy","$normalize","$addClass","classVal","$removeClass","newClasses","toAdd","tokenDifference","toRemove","writeAttr","booleanKey","aliasedKey","observer","trimmedSrcset","srcPattern","rawUris","nbrUrisWith2parts","floor","innerIdx","lastTuple","removeAttr","listeners","startSymbol","endSymbol","binding","isolated","noTemplate","str1","str2","values","tokens1","tokens2","outer","token","jqNodes","ident","CNTRL_REG","globals","register","allowGlobals","addIdentifier","expression","later","$controllerMinErr","controllerPrototype","exception","cause","serializeValue","v","toISOString","params","k","serialize","toSerialize","topLevel","defaultHttpResponseTransform","headers","tempData","JSON_PROTECTION_PREFIX","contentType","APPLICATION_JSON","isJsonLike","jsonStart","JSON_START","JSON_ENDS","parseHeaders","fillInParsed","line","headerVal","headerKey","headersGetter","headersObj","transformData","status","fns","isSuccess","defaults","transformResponse","transformRequest","d","common","Accept","CONTENT_TYPE_APPLICATION_JSON","patch","xsrfCookieName","xsrfHeaderName","paramSerializer","useApplyAsync","useLegacyPromise","useLegacyPromiseExtensions","interceptorFactories","interceptors","requestConfig","response","resp","reject","executeHeaderFns","headerContent","processedHeaders","headerFn","header","mergeHeaders","defHeaderName","lowercaseDefHeaderName","reqHeaderName","defHeaders","reqHeaders","defaultHeadersIteration","serverRequest","reqData","withCredentials","sendReq","chain","promise","when","reversedInterceptors","interceptor","request","requestError","responseError","thenFn","rejectFn","success","$httpMinErrLegacyFn","createShortMethods","createShortMethodsWithData","done","headersString","statusText","resolveHttpPromise","resolvePromise","$applyAsync","$$phase","deferred","resolve","resolvePromiseWithResult","removePendingReq","pendingRequests","cachedResp","buildUrl","defaultCache","xsrfValue","urlIsSameOrigin","timeout","responseType","serializedParams","interceptorFactory","XMLHttpRequest","createHttpBackend","createXhr","$browserDefer","rawDocument","jsonpReq","callbackId","async","body","called","addEventListenerFn","timeoutRequest","jsonpDone","xhr","abort","completeRequest","open","setRequestHeader","onload","responseText","urlResolve","protocol","getAllResponseHeaders","onerror","onabort","send","escape","ch","unescapeText","escapedStartRegexp","escapedEndRegexp","constantWatchDelegate","objectEquality","constantInterp","unwatch","mustHaveExpression","parseStringifyInterceptor","getValue","$interpolateMinErr","interr","unescapedText","exp","$$watchDelegate","endIndex","parseFns","textLength","expressionPositions","startSymbolLength","endSymbolLength","throwNoconcat","compute","getTrusted","$watchGroup","oldValues","currValue","interval","count","invokeApply","hasParams","iteration","setInterval","clearInterval","skipApply","$$intervalId","notify","intervals","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","relativeUrl","prefixed","$$path","pathname","$$search","search","$$hash","beginsWith","begin","whole","trimEmptyHash","stripFile","lastIndexOf","serverBase","LocationHtml5Url","appBase","appBaseNoFile","basePrefix","$$html5","$$parse","pathUrl","$locationMinErr","$$compose","$$url","$$absUrl","$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","removeWindowsDriveName","base","firstPathSegmentMatch","windowsFilePathExp","withoutHashUrl","withoutBaseUrl","LocationHashbangInHtml5Url","locationGetter","locationGetterSetter","preprocess","html5Mode","requireBase","rewriteLinks","setBrowserUrlWithFallback","oldUrl","oldState","$$state","afterLocationChange","$broadcast","absUrl","LocationMode","initialUrl","IGNORE_URI_REGEXP","ctrlKey","metaKey","shiftKey","which","button","absHref","preventDefault","initializing","newUrl","newState","$digest","currentReplace","$$replace","urlOrStateChanged","debug","debugEnabled","flag","formatError","sourceURL","consoleLog","console","logFn","log","hasApply","arg1","arg2","warn","ensureSafeMemberName","fullExpression","$parseMinErr","getStringValue","ensureSafeObject","children","ensureSafeFunction","CALL","APPLY","BIND","ensureSafeAssignContext","ifDefined","plusFn","r","isStateless","filterName","findConstantAndWatchExpressions","ast","allConstants","argsToWatch","AST","Program","expr","Literal","toWatch","UnaryExpression","argument","BinaryExpression","left","right","LogicalExpression","ConditionalExpression","alternate","consequent","Identifier","MemberExpression","object","computed","CallExpression","callee","AssignmentExpression","ArrayExpression","ObjectExpression","properties","ThisExpression","LocalsExpression","getInputs","lastExpression","isAssignable","assignableAST","NGValueParameter","operator","isLiteral","isConstant","ASTCompiler","astBuilder","ASTInterpreter","isPossiblyDangerousMemberName","getValueOf","objectValueOf","cacheDefault","cacheExpensive","interceptorFn","expensiveChecks","parsedExpression","oneTime","cacheKey","runningChecksEnabled","parseOptions","$parseOptionsExpensive","$parseOptions","lexer","Lexer","parser","Parser","oneTimeLiteralWatchDelegate","oneTimeWatchDelegate","inputs","inputsWatchDelegate","expensiveChecksInterceptor","addInterceptor","expensiveCheckFn","expensiveCheckOldValue","expressionInputDirtyCheck","oldValueOfValue","prettyPrintExpression","lastResult","inputExpressions","oldInputValueOf","newInputValue","oldInputValueOfValues","oldInputValues","changed","old","$$postDigest","isAllDefined","allDefined","watchDelegate","useInputs","regularWatch","noUnsafeEval","$$runningExpensiveChecks","qFactory","nextTick","exceptionHandler","Promise","simpleBind","processQueue","pending","processScheduled","scheduleProcessQueue","Deferred","promises","results","$qMinErr","TypeError","onFulfilled","onRejected","progressBack","catch","finally","handleCallback","$$reject","$$resolve","that","rejectPromise","progress","makePromise","resolved","isResolved","callbackOutput","errback","$Q","resolver","resolveFn","requestAnimationFrame","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","timer","supported","createChildScopeClass","ChildScope","$$watchers","$$nextSibling","$$childHead","$$childTail","$$listeners","$$listenerCount","$$watchersCount","$id","$$ChildScope","TTL","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","destroyChildScope","$event","currentScope","cleanUpScope","$$prevSibling","$root","Scope","beginPhase","phase","clearPhase","incrementWatchersCount","current","decrementListenerCount","initWatchVal","flushApplyAsync","applyAsyncQueue","scheduleApplyAsync","isolate","child","watchExp","watcher","eq","watchExpressions","watchGroupAction","changeReactionScheduled","firstRun","newValues","deregisterFns","shouldCall","unwatchFn","$watchCollectionInterceptor","_value","newLength","bothNaN","newItem","oldItem","internalArray","oldLength","changeDetected","internalObject","$watchCollectionAction","initRun","veryOldValue","trackVeryOldValue","changeDetector","watch","watchers","dirty","next","logIdx","asyncTask","ttl","watchLog","asyncQueue","$eval","traverseScopesLoop","msg","postDigestQueue","eventName","$applyAsyncExpression","namedListeners","indexOfListener","$emit","targetScope","listenerArgs","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","uri","isImage","normalizedVal","regex","adjustMatcher","matcher","$sceMinErr","escapeForRegexp","adjustMatchers","matchers","adjustedMatchers","SCE_CONTEXTS","resourceUrlWhitelist","resourceUrlBlacklist","matchUrl","isResourceUrlAllowedByPolicy","allowed","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","trustAs","Constructor","byType","maybeTrusted","trustedValueHolderBase","htmlSanitizer","CSS","URL","JS","sce","isEnabled","parseAs","enumValue","lName","vendorPrefix","eventSupport","android","navigator","userAgent","boxee","vendorRegex","bodyStyle","transitions","animations","webkitTransition","webkitAnimation","pushState","hasEvent","divElm","httpOptions","handleRequestFn","tpl","ignoreRequestError","handleError","totalPendingRequests","getTrustedResourceUrl","transformer","testability","findBindings","opt_exactMatch","getElementsByClassName","matches","dataBinding","bindingName","findModels","prefixes","attributeEquals","getLocation","setLocation","whenStable","deferreds","$$timeoutId","urlParsingNode","requestUrl","originUrl","$$CookieReader","safeDecodeURIComponent","lastCookies","lastCookieString","cookieArray","cookie","currentCookieString","filters","suffix","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comparator","predicateFn","matchAgainstAnyProp","expressionType","getTypeForFilter","createPredicateFn","shouldMatchPrimitives","actual","expected","deepCompare","dontMatchWholeObject","actualType","expectedType","expectedVal","matchAnyProperty","actualVal","$locale","formats","NUMBER_FORMATS","amount","currencySymbol","fractionSize","CURRENCY_SYM","PATTERNS","maxFrac","formatNumber","GROUP_SEP","DECIMAL_SEP","number","numStr","digits","numberOfIntegerDigits","zeros","exponent","ZERO_CHAR","MAX_DIGITS","roundNumber","parsedNumber","minFrac","fractionLen","min","roundAt","digit","carry","reduceRight","groupSep","decimalSep","isInfinity","isFinite","isZero","abs","formattedText","integerLen","decimals","reduce","groups","lgSize","gSize","negPre","negSuf","posPre","posSuf","padNumber","num","neg","dateGetter","dateStrGetter","shortForm","timeZoneGetter","zone","paddedZone","getFirstThursdayOfYear","year","dayOfWeekOnFirst","getDay","getThursdayThisWeek","datetime","getFullYear","getMonth","getDate","weekGetter","firstThurs","thisThurs","round","ampmGetter","getHours","AMPMS","eraGetter","ERAS","longEraGetter","ERANAMES","jsonStringToDate","string","R_ISO8601_STR","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","m","s","ms","parseFloat","format","DATETIME_FORMATS","NUMBER_STRING","DATE_FORMATS_SPLIT","DATE_FORMATS","spacing","limit","Infinity","processPredicates","sortPredicate","reverseOrder","map","predicate","descending","objectValue","getPredicateValue","v1","v2","getComparisonObject","predicateValues","predicates","doComparison","compareValues","ngDirective","nullFormRenameControl","control","$name","FormController","controls","$error","$$success","$pending","$dirty","$pristine","$valid","$invalid","$submitted","$$parentForm","nullFormCtrl","$rollbackViewValue","$commitViewValue","$addControl","$$renameControl","newName","oldName","$removeControl","$setValidity","addSetValidityMethod","ctrl","unset","$setDirty","PRISTINE_CLASS","DIRTY_CLASS","$setPristine","setClass","SUBMITTED_CLASS","$setUntouched","$setSubmitted","stringBasedInputType","$formatters","$isEmpty","textInputType","baseInputType","composing","ev","ngTrim","$viewValue","$$hasNativeValidators","$setViewValue","deferListener","origValue","keyCode","$render","weekParser","isoWeek","existingDate","WEEK_REGEXP","week","hours","seconds","milliseconds","addDays","getSeconds","getMilliseconds","NaN","createDateParser","mapping","iso","ISO_DATE_REGEXP","yyyy","MM","dd","HH","mm","ss","sss","part","createDateInputType","parseDate","isValidDate","parseObservedDateValue","badInputChecker","previousDate","$options","$$parserName","$parsers","parsedDate","ngModelMinErr","ngMin","minVal","$validators","$validate","ngMax","maxVal","nativeValidation","validity","VALIDITY_STATE_PROPERTY","badInput","typeMismatch","numberInputType","NUMBER_REGEXP","urlInputType","modelValue","viewValue","URL_REGEXP","emailInputType","email","EMAIL_REGEXP","radioInputType","checked","parseConstantExpr","parseFn","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","classDirective","arrayDifference","arrayClasses","addClasses","digestClassCounts","removeClasses","classCounts","classesToUpdate","updateClasses","ngClassWatchAction","$index","old$index","mod","setValidity","validationErrorKey","createAndSet","unsetAndCleanup","cachedToggleClass","PENDING_CLASS","toggleValidationCss","isObjectEmpty","combinedState","switchValue","classCache","isValid","VALID_CLASS","INVALID_CLASS","chromeHack","optionElement","selected","REGEX_STRING_REGEXP","manualLowercase","String","fromCharCode","charCodeAt","manualUppercase","documentMode","rules","ngCspElement","ngCspAttribute","noInlineStyle","name_","el","NODE_TYPE_ATTRIBUTE","full","major","minor","dot","codeName","expando","addEventListener","removeEventListener","mouseleave","mouseenter","thead","col","tr","td","optgroup","tbody","tfoot","colgroup","caption","th","Node","contains","compareDocumentPosition","ready","trigger","fired","removeData","removeAttribute","css","lowercasedName","getNamedItem","specified","ret","getText","$dv","multiple","nodeCount","types","addHandler","noEventListener","one","onFn","replaceNode","insertBefore","contentDocument","prepend","wrapNode","detach","after","newElement","toggleClass","condition","classCondition","nextElementSibling","getElementsByTagName","extraParameters","dummyEvent","eventFnsCopy","handlerArgs","arg3","unbind","$animateMinErr","NG_ANIMATE_CLASSNAME","postDigestElements","updateData","handleCSSClassChanges","existing","addRemoveClassesPostDigest","add","classesAdded","classesRemoved","pin","domOperation","from","to","runner","complete","$$registeredAnimations","classNameFilter","$$classNameFilter","reservedRegex","domInsert","afterElement","afterNode","previousElementSibling","end","enter","move","leave","addclass","animate","tempClasses","waitForTick","waitQueue","passed","AnimateRunner","setHost","rafTick","timeoutTick","_doneCallbacks","_tick","doc","hidden","_state","INITIAL_STATE","DONE_PENDING_STATE","DONE_COMPLETE_STATE","runners","onProgress","getPromise","resolveHandler","rejectHandler","pause","resume","_resolve","initialOptions","applyAnimationContents","closed","$$prepared","cleanupStyles","start","offsetWidth","Content-Type","[","{","$httpMinErr","PATH_MATCH","http","https","ftp","locationPrototype","paramValue","Location","OPERATORS","ESCAPE","f","t","'","\"","lex","tokens","readString","peek","readNumber","isIdent","readIdent","is","isWhitespace","ch2","ch3","op1","op2","op3","throwError","chars","isExpOperator","colStr","peekCh","quote","rawString","hex","rep","ExpressionStatement","Property","program","expressionStatement","expect","filterChain","assignment","ternary","logicalOR","consume","logicalAND","equality","relational","additive","multiplicative","unary","primary","arrayDeclaration","constants","parseArguments","baseExpression","peekToken","kind","e1","e2","e3","e4","peekAhead","true","false","null","$locals","nextId","vars","own","assignable","stage","computing","recurse","return_","generateFunction","fnKey","intoId","watchId","fnString","USE","STRICT","filterPrefix","watchFns","varsPrefix","section","nameId","recursionFn","skipWatchIdCheck","if_","lazyAssign","computedMember","lazyRecurse","plus","not","getHasOwnProperty","nonComputedMember","addEnsureSafeObject","notNull","addEnsureSafeAssignContext","addEnsureSafeMemberName","addEnsureSafeFunction","member","defaultValue","stringEscapeRegex","stringEscapeFn","c","skip","init","rhs","lhs","unary+","unary-","unary!","binary+","binary-","binary*","binary/","binary%","binary===","binary!==","binary==","binary!=","binary<","binary>","binary<=","binary>=","binary&&","binary||","ternary?:","astCompiler","yy","y","MMMM","MMM","M","H","hh","EEEE","EEE","Z","ww","w","G","GG","GGG","GGGG","xlinkHref","propName","defaultLinkFn","normalized","htmlAttr","formDirectiveFactory","isNgForm","getSetter","formElement","nameAttr","ctrls","handleFormSubmission","parentFormCtrl","setter","DATE_REGEXP","DATETIMELOCAL_REGEXP","MONTH_REGEXP","TIME_REGEXP","inputType","datetime-local","time","month","radio","checkbox","submit","reset","file","CONSTANT_VALUE_REGEXP","tplAttr","$compile","templateElement","ngBindHtmlGetter","ngBindHtmlWatch","getTrustedHtml","$viewChangeListeners","forceAsyncEvents","blur","focus","previousElements","srcExp","onloadExp","autoScrollExp","autoscroll","previousElement","currentElement","changeCounter","cleanupLastIncludeContent","afterAnimation","thisChangeId","trimValues","UNTOUCHED_CLASS","TOUCHED_CLASS","EMPTY_CLASS","NOT_EMPTY_CLASS","NgModelController","$modelValue","$$rawModelValue","$asyncValidators","$untouched","$touched","parserValid","parsedNgModel","parsedNgModelAssign","ngModelGet","ngModelSet","pendingDebounce","$$setOptions","getterSetter","invokeModelGetter","invokeModelSetter","$$$p","$$updateEmptyClasses","currentValidationRunId","$setTouched","$$lastCommittedViewValue","prevValid","prevModelValue","allowInvalid","$$runValidators","allValid","$$writeModelToScope","doneCallback","processParseErrors","errorKey","processSyncValidators","syncValidatorsValid","validator","processAsyncValidators","validatorPromises","validationDone","localValidationRunId","$$parseAndValidate","writeToModelIfNeeded","updateOnDefault","$$debounceViewValueCommit","debounce","debounceDelay","formatters","modelCtrl","formCtrl","updateOn","DEFAULT_REGEXP","ngOptionsMinErr","NG_OPTIONS_REGEXP","parseOptionsExpression","optionsExp","selectElement","Option","selectValue","label","group","disabled","getOptionValuesKeys","optionValues","optionValuesKeys","keyName","itemKey","valueName","selectAs","trackBy","selectAsFn","viewValueFn","trackByFn","getTrackByValueFn","getTrackByValue","getLocals","displayFn","groupByFn","disableWhenFn","valuesFn","getWatchables","watchedArray","optionValuesLength","disableWhen","getOptions","optionItems","selectValueMap","optionItem","getOptionFromViewValue","getViewValueFromOption","ngOptionsPostLink","updateOptionElement","addOrReuseElement","removeExcessElements","skipEmptyAndUnknownOptions","emptyOption_","emptyOption","unknownOption_","unknownOption","updateOptions","previousValue","selectCtrl","readValue","groupMap","providedEmptyOption","groupElement","optGroupTemplate","currentOptionElement","optionTemplate","ngModelCtrl","nextValue","isNotPrimitive","renderEmptyOption","removeEmptyOption","renderUnknownOption","removeUnknownOption","writeValue","selectedValues","selections","selectedOption","registerOption","BRACE","IS_WHEN","updateElementText","newText","lastCount","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","attributeName","tmpMatch","whenKey","countIsNaN","pluralCat","whenExpFn","NG_REMOVED","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","getBlockStart","getBlockEnd","ngRepeatEndComment","aliasAs","trackByExp","trackByExpGetter","trackByIdExpFn","trackByIdArrayFn","trackByIdObjFn","hashFnLocals","lastBlockMap","nextNode","collectionLength","trackById","trackByIdFn","collectionKeys","nextBlockOrder","previousNode","nextBlockMap","blockKey","NG_HIDE_CLASS","NG_HIDE_IN_PROGRESS_CLASS","newStyles","oldStyles","cases","ngSwitchController","watchExpr","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","selectedTransclude","caseElement","selectedScope","anchor","ngTranscludeMinErr","ngTranscludeCloneAttachFn","ngTranscludeSlot","noopNgModelController","SelectController","optionsMap","unknownVal","hasOption","addOption","removeOption","optionScope","optionAttrs","interpolateValueFn","interpolateTextFn","selectPreLink","lastView","lastViewRef","selectPostLink","selectCtrlName","patternExp","intVal","getDecimals","getVF","opt_precision","pow","PLURAL_CATEGORY","ZERO","ONE","TWO","FEW","MANY","OTHER","DAY","FIRSTDAYOFWEEK","MONTH","SHORTDAY","SHORTMONTH","STANDALONEMONTH","WEEKENDRANGE","fullDate","longDate","medium","mediumDate","mediumTime","short","shortDate","shortTime","minInt","localeID","vf","head","packageStyles","styles","pendClasses","fix","isPrefix","removeFromArray","arr","stripCommentsFromElement","$$addClass","$$removeClass","applyAnimationClassesFactory","prepareAnimationOptions","$$domOperationFired","applyAnimationStyles","applyAnimationFromStyles","applyAnimationToStyles","mergeAnimationDetails","oldAnimation","newAnimation","newOptions","resolveElementClasses","preparationClasses","concatWithSpace","realDomOperation","splitClassesToLookup","ADD_CLASS","REMOVE_CLASS","flags","allow","getDomNode","applyGeneratedPreparationClasses","EVENT_CLASS_PREFIX","ADD_CLASS_SUFFIX","REMOVE_CLASS_SUFFIX","clearGeneratedClasses","activeClasses","blockTransitions","duration","applyInlineStyle","TRANSITION_DELAY_PROP","blockKeyframeAnimations","applyBlock","ANIMATION_PROP","ANIMATION_PLAYSTATE_KEY","styleTuple","getCssKeyframeDurationStyle","ANIMATION_DURATION_PROP","getCssDelayStyle","isKeyframeAnimation","ANIMATION_DELAY_PROP","computeCssStyles","detectedStyles","formalStyleName","actualStyleName","parseMaxTime","maxValue","truthyTimingValue","getCssTransitionDurationStyle","applyOnlyDuration","TRANSITION_PROP","DURATION_KEY","createLocalCacheLookup","flush","total","registerRestorableStyles","backup","getPropertyValue","TRANSITIONEND_EVENT","ANIMATIONEND_EVENT","ACTIVE_CLASS_SUFFIX","PREPARE_CLASS_SUFFIX","NG_ANIMATE_CHILDREN_DATA","CSS_PREFIX","ontransitionend","onwebkittransitionend","onanimationend","onwebkitanimationend","PROPERTY_KEY","DELAY_KEY","TIMING_KEY","ANIMATION_ITERATION_COUNT_KEY","SAFE_FAST_FORWARD_DURATION_VALUE","TRANSITION_DURATION_PROP","$$rAFSchedulerFactory","scheduler","tasks","cancelFn","waitUntilQuiet","$$AnimateChildrenDirective","setData","ngAnimateChildren","ANIMATE_TIMER_KEY","ONE_SECOND","ELAPSED_TIME_MAX_DECIMAL_PLACES","CLOSING_TIME_BUFFER","DETECT_CSS_PROPERTIES","transitionDuration","transitionDelay","transitionProperty","animationDuration","animationDelay","animationIterationCount","DETECT_STAGGER_CSS_PROPERTIES","$AnimateCssProvider","$animateProvider","gcsLookup","gcsStaggerLookup","$$rAFScheduler","gcsHashFn","extraClasses","KEY","parentID","parentCounter","computeCachedCssStyles","timings","computeCachedCssStaggerStyles","stagger","staggerClassName","rafWaitQueue","pageWidth","computeTimings","aD","tD","maxDelay","maxDuration","applyAnimationClasses","endFn","close","rejected","animationClosed","animationCompleted","animationPaused","$$skipPreparationClasses","temporaryStyles","restoreStyles","setProperty","removeProperty","onDone","onAnimationProgress","animationTimerData","applyBlocking","blockTransition","blockKeyframeAnimation","closeAndReturnNoopAnimator","$$willAnimate","originalEvent","timeStamp","$manualTimeStamp","now","elapsedTime","toFixed","startTime","maxDelayTime","triggerAnimationStart","recalculateTimingStyles","fullClassName","relativeDelay","hasTransitions","hasAnimations","applyAnimationDelay","delayStyle","maxDurationTime","easing","easeProp","easeVal","timerTime","endTime","animationsData","setupFallbackTimer","currentTimerData","expectedEndTime","onAnimationExpired","playPause","playAnimation","maxStagger","itemIndex","runnerHost","isStructural","structural","structuralClassName","addRemoveClassName","applyClassesEarly","hasToStyles","containsKeyframeAnimation","keyframeStyle","staggerVal","transitionStyle","durationStyle","staggerIndex","isFirst","skipBlocking","hasTransitionAll","applyTransitionDuration","applyAnimationDuration","applyTransitionDelay","$$AnimateCssDriverProvider","$$animationProvider","isDocumentFragment","drivers","NG_ANIMATE_SHIM_CLASS_NAME","NG_ANIMATE_ANCHOR_CLASS_NAME","NG_OUT_ANCHOR_CLASS_NAME","NG_IN_ANCHOR_CLASS_NAME","filterCssClasses","getUniqueValues","prepareAnchoredAnimation","outAnchor","inAnchor","calculateAnchorStyles","coords","bodyNode","scrollTop","scrollLeft","prepareOutAnimation","animator","getClassVal","prepareInAnimation","endingClasses","startingClasses","rootBodyElement","animatorIn","animatorOut","startingAnimator","currentAnimation","prepareFromToAnchorAnimation","anchors","fromAnimation","prepareRegularAnimation","toAnimation","anchorAnimations","outElement","inElement","animationRunners","animationDetails","rootNode","$$AnimateJsProvider","lookupAnimations","flagMap","animationFactory","applyOptions","executeAnimationFn","classesToAdd","classesToRemove","groupEventedAnimations","fnName","operations","ani","endProgressCb","onAnimationComplete","cancelled","packageAnimations","animateFn","before","afterFn","beforeFn","onComplete","endAnimations","closeActiveAnimations","$$AnimateJsDriverProvider","prepareAnimation","endFnFactory","NG_ANIMATE_ATTR_NAME","NG_ANIMATE_PIN_DATA","$$AnimateQueueProvider","makeTruthyCssClassMap","classString","ONE_SPACE","hasMatchingClasses","newClassString","currentClassString","currentClassMap","isAllowed","ruleType","previousAnimation","hasAnimationClasses","and","PRE_DIGEST_STATE","RUNNING_STATE","nA","nR","cA","cR","$$animation","postDigestTaskFactory","postDigestCalled","normalizeAnimationDetails","findCallbacks","targetNode","targetParentNode","entries","callbackRegistry","queueAnimation","notifyProgress","runInNextPostDigestOrNow","isAnimatableClassName","skipAnimations","animationsEnabled","disabledElementsLookup","existingAnimation","activeAnimationsLookup","hasExistingAnimation","areAnimationsAllowed","closeChildAnimations","skipAnimationFlag","cancelAnimationFlag","joinAnimationFlag","isValidAnimation","clearElementAnimationState","markElementAnimationState","animationCancelled","realRunner","isMatchingElement","nodeOrElmA","nodeOrElmB","animateChildren","bodyElement","bodyElementDetected","rootElementDetected","parentAnimationDetected","elementDisabled","parentHost","details","parentElementDisabled","allowAnimation","deregisterWatch","isEmpty","container","filterFromRegistry","matchContainer","matchCallback","containerNode","isMatch","bool","argCount","hasElement","recordExists","$$AnimationProvider","setRunner","RUNNER_STORAGE_KEY","removeRunner","getRunner","NG_ANIMATE_REF_ATTR","sortAnimations","processNode","processed","elementNode","lookup","parentEntry","tree","flatten","remainingLevelEntries","nextLevelEntries","row","childEntry","animationQueue","getAnchorNodes","SELECTOR","groupAnimations","preparedAnimations","refLookup","enterOrMove","anchorNodes","direction","animationID","usedIndicesLookup","anchorGroups","indexKey","lookupKey","beforeStart","cssClassesIntersection","out","in","aa","invokeFirstDriver","driverName","driver","prepareClassName","updateAnimationRunners","newRunner","update","handleDestroyedElement","groupedAnimations","toBeSortedAnimations","animationEntry","startAnimationFn","closeFn","targetElement","operation","animationRunner","ngAnimateSwapDirective","previousScope","ngAnimateSwap","$$CookieWriter","buildCookieString","expires","cookiePath","domain","toUTCString","secure","cookieLength","calcOptions","$$cookieWriter","getObject","getAll","putObject","$cookies","$TouchProvider","ngClickOverrideEnabled","ngClickDirectiveAdded","ngTouchClickDirectiveFactory","makeSwipeDirective","ngTouch","$swipe","MAX_VERTICAL_DISTANCE","MAX_VERTICAL_RATIO","MIN_HORIZONTAL_DISTANCE","validSwipe","startCoords","deltaY","deltaX","x","valid","swipeHandler","pointerTypes","getCoordinates","touches","changedTouches","clientX","clientY","getEvents","eventType","res","pointerType","POINTER_EVENTS","MOVE_BUFFER_RADIUS","mouse","touch","eventHandlers","totalX","totalY","lastPos","active","hit","x1","y1","x2","y2","CLICKBUSTER_THRESHOLD","checkAllowableRegions","touchCoordinates","onClick","lastPreventedTime","PREVENT_DURATION","lastLabelClickCoordinates","onTouchStart","preventGhostClick","TAP_DURATION","MOVE_TOLERANCE","ACTIVE_CLASS_NAME","resetState","tapping","tapElement","touchStartX","touchStartY","clickHandler","ngClick","srcElement","dist","sqrt","onclick","touchend","$SanitizeProvider","svgEnabled","validElements","svgElements","buf","htmlParser","htmlSanitizeWriter","enableSvg","sanitizeText","writer","toMap","lowercaseKeys","inertBodyElement","mXSSAttempts","$sanitizeMinErr","stripCustomNsAttrs","attrToMap","encodeEntities","SURROGATE_PAIR_REGEXP","hi","low","NON_ALPHANUMERIC_REGEXP","uriValidator","ignoreCurrentElement","blockedElements","lkey","validAttrs","uriAttrs","voidElements","attrNode","removeAttributeNode","optionalEndTagBlockElements","optionalEndTagInlineElements","optionalEndTagElements","blockElements","inlineElements","htmlAttrs","svgAttrs","implementation","createHTMLDocument","docElement","getDocumentElement","bodyElements","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","linkyMinErr","addText","addLink","raw","ngMessageDirectiveFactory","ngMessagesCtrl","records","commentNode","staticExp","ngMessage","dynamicExp","ngMessageExp","assignRecords","reRender","messageCtrl","attach","$$attachId","getAttachId","deregister","isAttrTruthy","truthy","ACTIVE_CLASS","INACTIVE_CLASS","findPreviousMessage","comment","prevNode","parentLookup","prevKey","$$ngMessageNode","messages","previousSibling","insertMessageNode","messageNode","removeMessageNode","latestKey","nextAttachId","renderLater","cachedCollection","render","ngMessagesMultiple","unmatchedMessages","matchedKeys","messageItem","messageFound","totalMessages","messageUsed","ngMessages","nextKey","ngMessagesInclude","$AriaProvider","ariaAttr","nodeBlackList","negate","ariaCamelName","isNodeOneOf","boolVal","ariaHidden","ariaChecked","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeypress","bindRoleForClick","newConfig","$$watchExpr","ngAriaModule","nodeTypeArray","$aria","shouldAttachAttr","normalizedAttr","allowBlacklistEls","shouldAttachRole","role","getShape","shape","ngAriaWatchModelValue","getRadioReaction","getCheckboxReaction","needsTabIndex","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","ngKeypress","baseCompareAscending","other","valIsNull","valIsUndef","valIsReflexive","othIsNull","othIsUndef","othIsReflexive","baseFindIndex","fromRight","baseIndexOf","fromIndex","indexOfNaN","baseIsFunction","baseToString","charsLeftIndex","charsRightIndex","compareAscending","criteria","compareMultiple","orders","objCriteria","othCriteria","ordersLength","order","deburrLetter","deburredLetters","escapeHtmlChar","chr","htmlEscapes","escapeRegExpChar","leadingChar","whitespaceChar","regexpEscapes","stringEscapes","escapeStringChar","isObjectLike","isSpace","charCode","replaceHolders","placeholder","resIndex","PLACEHOLDER","sortedUniq","iteratee","trimmedLeftIndex","trimmedRightIndex","unescapeHtmlChar","htmlUnescapes","runInContext","lodash","LazyWrapper","LodashWrapper","wrapperClone","baseLodash","chainAll","actions","__wrapped__","__actions__","__chain__","__dir__","__filtered__","__iteratees__","__takeCount__","POSITIVE_INFINITY","__views__","lazyClone","arrayCopy","lazyReverse","lazyValue","dir","isArr","isRight","arrLength","view","getView","iteratees","iterLength","takeCount","nativeMin","LARGE_ARRAY_SIZE","baseWrapperValue","iterIndex","LAZY_MAP_FLAG","LAZY_FILTER_FLAG","MapCache","__data__","mapDelete","mapGet","mapHas","mapSet","SetCache","nativeCreate","Set","cacheIndexOf","cachePush","arrayConcat","othIndex","othLength","arrayEach","arrayEachRight","arrayEvery","arrayExtremum","exValue","arrayFilter","arrayMap","arrayPush","arrayReduce","accumulator","initFromArray","arrayReduceRight","arraySome","arraySum","assignDefaults","sourceValue","assignOwnDefaults","assignWith","customizer","props","baseAssign","baseCopy","baseAt","isNil","propsLength","isIndex","baseCallback","thisArg","bindCallback","baseMatches","baseMatchesProperty","baseClone","isDeep","stackA","stackB","initCloneArray","objToString","isFunc","funcTag","objectTag","argsTag","cloneableTags","initCloneByTag","initCloneObject","baseForOwn","subValue","baseDelay","wait","FUNC_ERROR_TEXT","baseDifference","getIndexOf","isCommon","createCache","valuesLength","valuesIndex","baseEvery","baseEach","baseExtremum","baseFill","baseFilter","baseFind","eachFunc","retKey","baseFlatten","isStrict","isArguments","baseForIn","baseFor","keysIn","baseForOwnRight","baseForRight","baseFunctions","baseGet","pathKey","toObject","baseIsEqual","isLoose","baseIsEqualDeep","equalFunc","objIsArr","othIsArr","objTag","arrayTag","othTag","objIsObj","othIsObj","isSameTag","equalByTag","objIsWrapped","othIsWrapped","equalArrays","equalObjects","baseIsMatch","matchData","noCustomizer","objValue","srcValue","baseMap","getMatchData","isKey","isStrictComparable","toPath","baseSlice","baseMerge","isSrcArr","baseMergeDeep","mergeFunc","isPlainObject","toPlainObject","baseProperty","basePropertyDeep","basePullAt","indexes","previous","baseRandom","nativeFloor","nativeRandom","baseReduce","initFromCollection","baseSome","baseSortBy","comparer","baseSortByOrder","getCallback","baseSum","baseUniq","isLarge","seenIndex","baseValues","baseWhile","isDrop","binaryIndex","retHighest","high","HALF_MAX_ARRAY_LENGTH","mid","binaryIndexBy","valIsNaN","isDef","isReflexive","setLow","MAX_ARRAY_INDEX","bufferClone","composeArgs","partials","holders","holdersLength","argsIndex","argsLength","nativeMax","leftIndex","leftLength","composeArgsRight","holdersIndex","rightIndex","rightLength","createAggregator","initializer","createAssigner","assigner","restParam","sources","guard","isIterateeCall","createBaseEach","getLength","isLength","iterable","createBaseFor","keysFunc","createBindWrapper","Ctor","createCtorWrapper","createCompounder","words","deburr","thisBinding","baseCreate","createCurry","curryFunc","arity","createWrapper","createDefaults","createExtremum","toIterable","createFind","createFindIndex","createFindKey","objectFunc","createFlow","funcs","thru","getFuncName","funcName","getData","isLaziable","ARY_FLAG","CURRY_FLAG","PARTIAL_FLAG","REARG_FLAG","plant","createForEach","arrayFunc","createForIn","createForOwn","createObjectMapper","isMapKeys","mapped","createPadDir","createPadding","createPartial","partialFunc","createReduce","createHybridWrapper","bitmask","partialsRight","holdersRight","argPos","ary","isCurry","isCurryRight","argsHolders","newArgPos","newArity","newsHolders","newHoldersRight","newPartials","newPartialsRight","PARTIAL_RIGHT_FLAG","isCurryBound","BIND_FLAG","BIND_KEY_FLAG","newData","isBind","isBindKey","reorder","isAry","CURRY_BOUND_FLAG","CURRY_RIGHT_FLAG","strLength","nativeIsFinite","padLength","repeat","nativeCeil","createPartialWrapper","createRound","methodName","precision","createSortedIndex","mergeData","baseSetData","arrValue","othValue","boolTag","dateTag","errorTag","numberTag","regexpTag","stringTag","objProps","objLength","othProps","skipCtor","objCtor","othCtor","realNames","otherFunc","pairs","getNative","isNative","transforms","arrayBufferTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","byteOffset","reFlags","invokePath","reIsUint","MAX_SAFE_INTEGER","reIsPlainProp","reIsDeepProp","srcBitmask","newBitmask","isCombo","mergeDefaults","pickByArray","pickByCallback","oldArray","shimKeys","allowIndexes","rePropName","reEscapeChar","chunk","compact","drop","dropRight","dropRightWhile","dropWhile","fill","first","flattenDeep","initial","pull","rest","take","takeRight","takeRightWhile","takeWhile","uniq","isSorted","unzip","unzipWith","xor","zipObject","tap","wrapperChain","wrapperCommit","wrapperPlant","wrapperReverse","wrapped","wrapperToString","wrapperValue","every","findWhere","includes","pluck","sample","toArray","rand","shuffle","sortBy","sortByOrder","where","temp","maxTimeoutId","lastCalled","trailingCall","isCalled","delayed","remaining","stamp","maxDelayed","trailing","debounced","leading","maxWait","leadingCall","memoize","memoized","Cache","once","otherArgs","spread","throttle","cloneDeep","gt","gte","propertyIsEnumerable","isEqual","isError","reIsNative","fnToString","reIsHostCtor","isNull","typedArrayTags","lt","lte","functions","invert","multiValue","isProto","skipIndexes","nested","transform","valuesIn","inRange","random","floating","noMin","noMax","capitalize","reLatin1","reComboMark","endsWith","reHasUnescapedHtml","reUnescapedHtml","escapeRegExp","reHasRegExpChars","reRegExpChars","pad","radix","nativeParseInt","reHasHexPrefix","startsWith","otherOptions","settings","templateSettings","isEscaping","isEvaluating","imports","importsKeys","importsValues","interpolate","reNoMatch","reDelimiters","reInterpolate","reEsTemplate","evaluate","templateCounter","escapeValue","interpolateValue","esTemplateValue","evaluateValue","reUnescapedString","variable","reEmptyStringLeading","reEmptyStringMiddle","reEmptyStringTrailing","attempt","trimLeft","trimRight","trunc","DEFAULT_TRUNC_LENGTH","omission","DEFAULT_TRUNC_OMISSION","newEnd","global","unescape","reHasEscapedHtml","reEscapedHtml","reWords","matchesProperty","mixin","isObj","methodNames","noConflict","oldDash","propertyOf","range","step","times","MAX_ARRAY_LENGTH","uniqueId","idCounter","augend","addend","sum","pick","contextProps","arrayProto","objectProto","stringProto","WeakMap","ceil","nativeIsArray","nativeKeys","nativeNow","NEGATIVE_INFINITY","metaMap","support","reEscape","reEvaluate","baseEachRight","HOT_SPAN","HOT_COUNT","difference","findIndex","findLastIndex","intersection","arrays","pullAt","sortedIndex","sortedLastIndex","union","without","zip","zipWith","wrapperConcat","at","countBy","findLast","forEachRight","groupBy","indexBy","isProp","partition","sortByAll","bindAll","bindKey","curry","curryRight","flow","flowRight","modArgs","partial","partialRight","rearg","defaultsDeep","findKey","findLastKey","forIn","forInRight","forOwn","forOwnRight","mapKeys","mapValues","omit","word","kebabCase","padLeft","padRight","snakeCase","startCase","methodOf","backflow","collect","compose","each","eachRight","methods","tail","unique","any","detect","foldl","foldr","include","inject","VERSION","filtered","isFilter","takeName","dropName","operationName","createCallback","checkIteratee","retUnwrapped","lodashFunc","isHybrid","isLazy","useLazy","onlyLazy","chainName","commit","toJSON","mapTag","setTag","weakMapTag","upper","lower","À","Á","Â","Ã","Ä","Å","à","á","â","ã","ä","å","Ç","ç","Ð","ð","È","É","Ê","Ë","è","é","ê","ë","Ì","Í","Î","Ï","ì","í","î","ï","Ñ","ñ","Ò","Ó","Ô","Õ","Ö","Ø","ò","ó","ô","õ","ö","ø","Ù","Ú","Û","Ü","ù","ú","û","ü","Ý","ý","ÿ","Æ","æ","Þ","þ","ß","&","<",">","`","&","<",">",""","'","`","objectTypes","function","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","u","\\","\n","\r"," "," ","freeExports","exports","freeModule","freeGlobal","freeSelf","freeWindow","moduleExports","define","amd","restangular","Configurer","RestangularResource","configurer","resource","defaultRequestParams","isSafe","configuration","safeMethods","absolutePattern","isAbsoluteUrl","setSelfLinkAbsoluteUrl","baseUrl","setBaseUrl","newBaseUrl","extraFields","setExtraFields","newExtraFields","defaultHttpFields","setDefaultHttpFields","withHttpValues","httpLocalConfig","encodeIds","setEncodeIds","encode","setDefaultRequestParams","param1","param2","requestParams","defaultHeaders","setDefaultHeaders","methodOverriders","setMethodOverriders","overriders","isOverridenMethod","jsonp","setJsonp","urlCreator","setUrlCreator","urlCreatorFactory","restangularFields","route","parentResource","restangularCollection","cannonicalId","etag","selfLink","getList","trace","getRestangularUrl","getRequestedUrl","putElement","addRestangularMethod","getParentList","ids","httpConfig","reqParams","several","oneUrl","allUrl","customPUT","customPOST","customDELETE","customGET","customGETLIST","customOperation","doPUT","doPOST","doDELETE","doGET","doGETLIST","fromServer","withConfig","withHttpConfig","singleOne","plain","save","restangularized","setRestangularFields","resFields","isRestangularized","setFieldToElem","field","idValue","getFieldFromElem","setIdToElem","getIdFromElem","isValidId","elemId","setUrlToElem","getUrlFromElem","useCannonicalId","setUseCannonicalId","getCannonicalIdFromElem","actualId","responseInterceptors","defaultResponseInterceptor","responseExtractor","theData","addResponseInterceptor","extractor","errorInterceptors","addErrorInterceptor","setResponseInterceptor","setResponseExtractor","setErrorInterceptor","requestInterceptors","defaultInterceptor","fullRequestInterceptor","defaultRequest","addRequestInterceptor","setRequestInterceptor","addFullRequestInterceptor","setFullRequestInterceptor","onBeforeElemRestangularized","setOnBeforeElemRestangularized","setRestangularizePromiseInterceptor","restangularizePromiseInterceptor","onElemRestangularized","setOnElemRestangularized","shouldSaveParent","setParentless","setRequestSuffix","newSuffix","transformers","addElementTransformer","secondArg","thirdArg","isCollection","typeTransformers","coll","extendCollection","extendModel","transformElem","Restangular","force","transformLocalElements","changedElem","setTransformOnlyServerElements","fullResponse","setFullResponse","BaseCreator","setConfig","parentsArray","parents","localHttpConfig","callHeaders","callParams","Path","normalizeUrl","__this","acum","elemUrl","elemSelfLink","fetchUrl","fetchRequestedUrl","sortedKeys","globalConfiguration","createServiceForConfiguration","restangularizeBase","urlHandler","addRestangularMethodFunction","copyRestangularizedElement","stripRestangular","parentId","parentUrl","restangularFieldsForParent","restangularizeElem","restangularizeCollection","restangularizePromise","valueToFill","promiseCall","promiseGet","$object","callArgs","filledValue","addCustomOperation","customFunction","oper","alias","callFunction","callOperation","fetchFunction","fromElement","toElement","copiedElement","localElem","getFunction","putFunction","postFunction","deleteFunction","headFunction","traceFunction","optionsFunction","patchFunction","putElementFunction","getById","restangularizeCollectionAndElements","elemToPut","filledArray","serverElem","newArray","parseResponse","resData","whatFetched","okCallback","fullParams","processedData","cb","elemFunction","resParams","callObj","filledObject","errorCallback","isOverrideOperation","X-HTTP-Method-Override","defaultParams","defaultElem","bindedFunction","createdFunction","withConfigurationFunction","toService","knownCollectionMethods","serv","restangularizeElement","ancestors","second","objectKeys","inheritParams","currentParams","newParams","$current","$to","parentParams","inherited","inheritList","equalForKeys","filterByKeys","$Resolve","VISIT_IN_PROGRESS","VISIT_DONE","NOTHING","NO_DEPENDENCIES","NO_LOCALS","NO_PARENT","$$promises","$$values","study","invocables","visit","visited","cycle","plan","param","isResolve","invocableKeys","merged","$$inheritedValues","resolution","fail","$$failure","invocable","onfailure","invocation","proceed","waitParams","dep","$TemplateFactory","fromConfig","fromString","fromUrl","templateProvider","fromProvider","UrlMatcher","parentMatcher","addParameter","paramNames","$$UMFP","Param","quoteRegExp","squash","surroundPattern","matchDetails","isSearch","segment","cfg","caseInsensitive","searchPlaceholder","$$new","ParamSet","isOptional","sourceSearch","sourcePath","strict","$$paramNames","$UrlMatcherFactory","valToString","valFromString","getDefaultConfig","isStrictMode","isCaseInsensitive","isInjectable","flushTypeQueue","typeQueue","$types","def","defaultSquashPolicy","enqueue","defaultTypes","decode","int","capture","$$getDefaultValue","strictMode","isMatcher","o","definitionFn","unwrapShorthand","isShorthand","$$fn","getType","urlType","getArrayMode","arrayDefaults","arrayParamNomenclature","getSquashPolicy","getReplace","arrayMode","configuredKeys","defaultPolicy","$value","hasReplaceVal","$replace","replacement","$asArray","dynamic","$$parent","$$keys","ignore","paramset","paramValues","$$equals","paramValues1","paramValues2","equal","$$validates","rawVal","encoded","$UrlRouterProvider","$locationProvider","$urlMatcherFactory","regExpPrefix","handleIfMatch","$match","appendBasePath","isHtml5","absolute","evt","check","rule","handled","lastPushedUrl","otherwise","listen","interceptDeferred","sync","read","urlMatcher","$$avoidResync","validates","slash","redirect","handlerIsString","strategies","sticky","deferIntercept","$StateProvider","$urlRouterProvider","isRelative","stateName","findState","stateOrName","isStr","rel","pathLength","states","queueState","parentName","flushQueuedChildren","queued","registerState","stateBuilder","$delegates","abstractKey","$stateParams","$state","navigable","transitionTo","isGlob","doesStateMatchGlob","glob","globSegments","$view","$resolve","$urlRouter","handleRedirect","TransitionAborted","retry","$retry","TransitionFailed","retryTransition","transition","TransitionSuperseded","toParams","resolveState","paramsAreFiltered","resolveViews","viewsPromises","views","injectables","load","controllerProvider","injectLocals","$$controller","$$controllerAs","TransitionPrevented","go","relative","fromParams","fromPath","toState","redirectResult","keep","toLocals","reloadState","ownParams","shouldSkipReload","entering","exiting","onExit","onEnter","lossy","nav","nonSearchParamsEqual","fromAndToState","notSearchParam","nonQueryParamKeys","nonQueryParams","nonQueryParamSet","reloadOnSearch","compositeName","","abstract","$ViewProvider","$templateFactory","$ViewScrollProvider","useAnchorScroll","$ViewDirective","$uiViewScroll","getRenderer","animEnabled","ngMajorVer","ngMinorVer","$animator","statics","noanimation","cleanupLastView","cleanOld","_previousEl","_currentScope","previousEl","_willBeDestroyed","currentEl","renderer","updateView","firstTime","getUiViewName","previousLocals","latestLocals","$ViewDirectiveFill","uiView","parseStateRef","ref","preparsed","paramExpr","stateContext","stateData","getTypeInfo","isSvg","isForm","isAnchor","clickable","clickHook","ignorePreventDefaultCount","defaultOpts","$StateRefDirective","uiSrefActive","uiSref","uiSrefOpts","$$addStateInfo","$StateRefDynamicDirective","runStateRefLink","uiState","uiStateParams","uiStateOpts","$StateRefActiveDirective","addState","stateParams","activeClass","stateHash","createStateHash","anyMatch","exactMatch","activeEqClass","uiSrefActiveEq","$IsStateFilter","$IncludedByStateFilter","includesFilter","searchParams","decodePathArray","reverseString","unquoteDashes","allReversed","paramName","parameters","nTotal","nPath","paramVal","encodeDashes","isPathParam","isDefaultValue","nextSegment","isFinalPathParam","$subPattern","sub","ArrayType","bindTo","callbackName","arrayWrap","arrayUnwrap","falsey","arrayHandler","allTruthyMode","arrayEqualsHandler","val1","val2","$arrayMode","expand","height","scrollHeight","expandDone","collapse","collapseDone","shouldCollapse","closeOthers","accordionConfig","openGroup","isOpen","addGroup","groupScope","removeGroup","heading","isDisabled","setHeading","accordionCtrl","openClass","panelClass","toggleOpen","accordionGroupCtrl","accordionTransclude","closeable","alertCtrl","dismissOnTimeout","$bindHtmlUnsafeSuppressDeprecated","bindHtmlUnsafe","toggleEvent","buttonConfig","buttonsCtrl","display","btnRadio","isActive","uncheckable","getTrueValue","getCheckboxValue","btnCheckboxTrue","getFalseValue","btnCheckboxFalse","attributeValue","activeElement","goNext","slide","destroyed","currentSlide","noTransition","$currentTransition","slides","SLIDE_DIRECTION","NEW_ANIMATE","currentIndex","restartTimer","getSlideByIndex","resetTimer","currentInterval","timerFn","isPlaying","NO_TRANSITION","nextSlide","nextIndex","indexOfSlide","getCurrentIndex","newIndex","noWrap","prev","play","noPause","addSlide","removeSlide","carouselCtrl","beforeAddClass","stopped","directionClass","removeClassFn","beforeRemoveClass","createParser","formatCodeToRegex","SPECIAL_CHARACTERS_REGEXP","parsers","baseDate","fields","dt","mapper","getStyle","cssprop","currentStyle","isStaticPositioned","parentOffsetEl","docDomEl","offsetParent","elBCR","offsetParentBCR","offsetParentEl","clientTop","clientLeft","boundingClientRect","width","pageYOffset","pageXOffset","positionElements","hostEl","targetEl","positionStr","appendToBody","hostElPos","targetElWidth","targetElHeight","targetElPos","positionStrParts","pos0","pos1","shiftWidth","center","shiftHeight","formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","datepickerMode","minMode","maxMode","showWeeks","startingDay","yearRange","minDate","maxDate","shortcutPropagation","datepickerConfig","$datepickerSuppressError","modes","refreshView","initDate","activeDate","dateObject","activeDateId","ngModelCtrl_","_refreshView","createDateObject","model","customClass","dateDisabled","fixTimeZone","years","months","toggleMode",13,32,33,34,35,36,37,38,39,40,"focusElement","keydown","altKey","handleKeyDown","datepickerCtrl","getDaysInMonth","DAYS_IN_MONTH","getDates","startDate","dates","setDate","getISO8601WeekNumber","checkDate","setMonth","firstDayOfMonth","numDisplayedFromPreviousMonth","firstDate","days","secondary","labels","abbr","title","rows","weekNumbers","thursdayIndex","numWeeks","curWeek","date1","date2","getStartingYear","datepickerPopup","datepickerPopupTemplateUrl","datepickerTemplateUrl","html5Types","currentText","clearText","closeText","closeOnDateSelection","showButtonBar","onOpenFocus","$position","dateParser","datepickerPopupConfig","cameltoDash","$1","dateFormat","datepickerAppendToBody","watchData","isHtml5DateInput","newDateFormat","popupEl","ng-model","ng-change","template-url","datepickerEl","datepickerOptions","oldvalue","dateSelection","documentClickBind","inputKeydownBind","today","$popup","openScope","dropdownScope","closeDropdown","keybindFilter","getAutoClose","toggleElement","getToggleElement","dropdownElement","getDropdownElement","focusToggleElement","isKeynavEnabled","focusDropdownEntry","dropdownConfig","dropdownService","templateScope","getIsOpen","setIsOpen","toggleInvoker","onToggle","keynavEnabled","dropdownAppendToBody","keyboardNav","dropdownMenu","toggle","autoClose","getElement","wasOpen","rightalign","innerWidth","openContainer","dropdownMenuTemplateUrl","tplContent","newEl","offDestroy","dropdownCtrl","tplUrl","toggleDropdown","aria-haspopup","aria-expanded","createNew","removeTop","hasKey","$modalStack","modalInClass","NOW_CLOSING_EVENT","setIsAsync","backdropClass","windowClass","modal","getTop","backdrop","currentTarget","dismiss","$isRendered","modalRenderDeferObj","animationPromise","inputsWithAutofocus","modalRendered","modalAnimation","modalAnimationClass","$$multiMap","$$stackedMap","backdropIndex","topBackdropIndex","opened","openedWindows","removeModalWindow","modalInstance","elementToReceiveFocus","modalWindow","removeAfterAnimate","modalDomEl","modalScope","modalBodyClass","openedClass","OPENED_MODAL_CLASS","openedClasses","checkRemoveBackdrop","backdropDomEl","backdropScopeRef","backdropScope","domEl","afterAnimating","asyncDeferred","asyncPromise","broadcastClosing","resultOrReason","closing","focusableElementList","focusIndex","tababbleSelector","newBackdropIndex","keyboard","loadFocusElementList","focusChanged","isFocusInFirstItem","focusLastFocusableElement","isFocusInLastItem","focusFirstFocusableElement","modalOpener","renderDeferred","currBackdropIndex","angularBackgroundDomEl","angularDomEl","windowTemplateUrl","window-class","clearFocusListCache","$$uibDestructionScheduled","dismissAll","topModal","length0","modalDomE1","$modalProvider","getTemplatePromise","getResolvePromises","resolves","promisesArr","$modal","promiseChain","getPromiseChain","modalOptions","modalResultDeferred","modalOpenedDeferred","modalRenderDeferred","rendered","samePromise","templateAndResolvePromise","tplAndVars","$close","$dismiss","ctrlInstance","ctrlLocals","resolveIter","$modalInstance","setNumPages","numPages","itemsPerPage","totalPages","calculateTotalPages","page","selectPage","totalItems","clickAllowed","ngDisabled","noPrevious","noNext","boundaryLinks","directionLinks","firstText","previousText","nextText","lastText","rotate","paginationConfig","makePage","getPages","currentPage","pages","startPage","endPage","isMaxSized","maxSize","previousPageSet","nextPageSet","paginationCtrl","originalRender","align","pagerConfig","defaultOptions","placement","popupDelay","useContentExp","triggerMap","click","none","globalOptions","setTriggers","triggers","defaultTriggerShow","getTriggers","show","hide","startSym","endSym","tElem","tooltipLinker","tooltipCtrl","toggleTooltipBind","ttScope","hideTooltipBind","showTooltipBind","hasEnableExp","prepareTooltip","popupTimeout","transitionTimeout","contentExp","createTooltip","isOpenExp","origScope","tooltip","positionTooltip","positionTimeout","removeTooltip","tooltipLinkedScope","repositionScheduled","prepPopupClass","prepPlacement","prepPopupDelay","popupClass","prepTriggers","unregisterTriggers","ttBox","ttCss","appendToBodyVal","tooltipTemplateTranscludeScope","parseAsResourceUrl","tooltipTemplateTransclude","tooltipAnimationClass","$tooltip","originScope","tooltipHtmlUnsafeSuppressDeprecated","progressConfig","bars","addBar","bar","recalculatePercentage","percent","totalPercentage","removeBar","$progressSuppressWarning","progressCtrl","stateOn","stateOff","titles","ratingConfig","tmpTitles","ratingStates","buildTemplateObjects","getTitle","rate","readonly","onHover","onLeave","onKeydown","ratingCtrl","tabs","selectedTab","tab","onDeselect","selectCalled","onSelect","addTab","removeTab","newActiveIndex","vertical","justified","tabsetCtrl","disable","$transcludeFn","tabCtrl","isTabHeading","tagName","tabContentTransclude","headingElement","hourStep","minuteStep","showMeridian","meridians","readonlyInput","mousewheel","arrowkeys","showSpinners","timepickerConfig","getHoursFromTemplate","meridian","getMinutesFromTemplate","keyboardChange","makeValid","updateTemplate","invalidHours","invalidMinutes","addMinutes","newDate","addMinutesToSelected","hoursInputEl","minutesInputEl","setupMousewheelEvents","setupArrowkeyEvents","setupInputEvents","noIncrementHours","incrementedSelected","noDecrementHours","decrementedSelected","noIncrementMinutes","noDecrementMinutes","noToggleMeridian","isScrollingUp","delta","wheelDelta","detail","incrementHours","decrementHours","incrementMinutes","decrementMinutes","updateHours","updateMinutes","invalidate","toggleMeridian","timepickerCtrl","$transitionSuppressDeprecated","findEndEventName","endEventNames","transElement","$transition","endEventName","transitionEndHandler","transitionEndEventNames","WebkitTransition","MozTransition","OTransition","animationEndEventNames","transitionEndEventName","animationEndEventName","TYPEAHEAD_REGEXP","itemName","viewMapper","modelMapper","typeaheadParser","HOT_KEYS","eventDebounceTime","originalScope","fireRecalculating","moveInProgress","timeoutEventPromise","recalculatePosition","minLength","typeaheadMinLength","hasFocus","waitTime","typeaheadWaitMs","isEditable","typeaheadEditable","isLoadingSetter","typeaheadLoading","onSelectCallback","typeaheadOnSelect","isSelectOnBlur","typeaheadSelectOnBlur","isNoResultsSetter","typeaheadNoResults","inputFormatter","typeaheadInputFormatter","typeaheadAppendToBody","focusFirst","typeaheadFocusFirst","selectOnExact","typeaheadSelectOnExact","parsedModel","$setModelValue","parserResult","typeahead","popupId","aria-autocomplete","aria-owns","popUpEl","move-in-progress","query","typeaheadTemplateUrl","typeaheadPopupTemplateUrl","resetMatches","activeIdx","getMatchId","inputIsExactMatch","inputValue","getMatchesAsync","onCurrentRequest","timeoutPromise","scheduleSearchWithTimeout","cancelPreviousTimeout","candidateViewValue","emptyViewValue","$model","$item","$label","typeaheadFocusOnSelect","dismissClickHandler","popupTemplateUrl","matchIdx","selectActive","selectMatch","clonedElement","escapeRegexp","queryToEscape","containsHtml","matchItem","isSanitizePresent","trustAsHtml","R","S","L","T","g","loop","speed","typeSpeed","deleteSpeed","pauseDelay","postfix","clear","triggerPause","triggerResume","isRunning","malarkey","toastr","toastrConfig","toasts","toast","toastId","optionsOverride","_getOptions","iconClasses","_buildNotification","warning","wasClicked","findToast","lastToast","deleting","isOpened","onHidden","openToasts","maxOpened","containerDefer","_notify","iconClass","_createOrGetContainer","containerId","positionClass","pointer-events","ifMaxOpenedAndAutoDismiss","autoDismiss","createScope","generateEvent","allowHtml","toastType","extraData","extendedTimeOut","messageClass","onShown","onTap","progressBar","tapToDismiss","timeOut","titleClass","toastClass","closeButton","closeHtml","createToast","cleanOptionsOverride","badOptions","newToast","createToastEl","maxOpenedNotReached","shouldExit","isDuplicateOfLast","preventDuplicates","previousToastMessage","isDuplicateOpen","preventOpenDuplicates","oldToasts","newestOnTop","sibling","templates","progressbar","linkFunction","toastCtrl","updateProgress","percentage","hideTime","currentTimeOut","intervalId","stop","ToastController","startProgressBar","stopProgressBar","toastLinkFunction","createTimeout","hideAndStopProgressBar","wantsCloseButton","tapToast","moment","utils_hooks__hooks","hookCallback","setHookCallback","hasOwnProp","create_utc__createUTC","locale","createLocalOrUTC","utc","defaultParsingFlags","unusedTokens","unusedInput","overflow","charsLeftOver","nullInput","invalidMonth","invalidFormat","userInvalidated","getParsingFlags","_pf","valid__isValid","_isValid","_d","invalidWeekday","_strict","bigHour","valid__createInvalid","copyConfig","_isAMomentObject","_i","_f","_l","_tzm","_isUTC","_offset","_locale","momentProperties","Moment","updateInProgress","updateOffset","isMoment","absFloor","argumentForCoercion","coercedNumber","compareArrays","dontConvert","lengthDiff","diffs","Locale","normalizeLocale","chooseLocale","loadLocale","oldLocale","locales","globalLocale","_abbr","locale_locales__getSetGlobalLocale","locale_locales__getLocale","defineLocale","addUnitAlias","unit","shorthand","lowerCase","aliases","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedProp","normalizedInput","makeGetSet","keepTime","get_set__set","get_set__get","mom","getSet","zeroFill","targetLength","forceSign","absNumber","zerosToFill","sign","addFormatToken","padded","ordinal","formatTokenFunctions","localeData","removeFormattingTokens","makeFormatFunction","formattingTokens","output","formatMoment","expandFormat","formatFunctions","invalidDate","replaceLongDateFormatTokens","longDateFormat","localFormattingTokens","sth","addRegexToken","strictRegex","regexes","getParseRegexForToken","unescapeFormat","matched","p1","p2","p3","p4","addParseToken","addWeekParseToken","_w","addTimeToArrayFromToken","_a","daysInMonth","UTC","getUTCDate","localeMonths","_months","localeMonthsShort","_monthsShort","localeMonthsParse","monthName","_monthsParse","_longMonthsParse","_shortMonthsParse","monthsShort","dayOfMonth","monthsParse","getSetMonth","checkOverflow","DATE","YEAR","HOUR","MINUTE","SECOND","MILLISECOND","_overflowDayOfYear","suppressDeprecationWarnings","deprecate","deprecateSimple","deprecations","configFromISO","from_string__isoRegex","isoDates","isoTimes","matchOffset","configFromStringAndFormat","configFromString","aspNetJsonRegex","createFromInputFallback","createDate","createUTCDate","daysInYear","isLeapYear","getIsLeapYear","weekOfYear","firstDayOfWeek","firstDayOfWeekOfYear","adjustedMoment","daysToDayOfWeek","day","local__createLocal","dayOfYear","localeWeek","_week","dow","doy","localeFirstDayOfWeek","localeFirstDayOfYear","getSetWeek","getSetISOWeek","dayOfYearFromWeeks","weekday","week1Jan","janX","getUTCDay","getSetDayOfYear","startOf","currentDateArray","_useUTC","getUTCFullYear","getUTCMonth","configFromArray","currentDate","yearToUse","dayOfYearFromWeekInfo","_dayOfYear","_nextDay","setUTCMinutes","getUTCMinutes","weekYear","W","gg","ISO_8601","parsedInput","skipped","stringLength","totalParsedInputLength","meridiemFixWrap","_meridiem","hour","meridiem","isPm","meridiemHour","isPM","configFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","score","configFromObject","minute","millisecond","createFromConfig","prepareConfig","preparse","configFromInput","isUTC","pickBy","moments","Duration","quarters","quarter","weeks","_milliseconds","_days","_bubble","isDuration","utcOffset","offsetFromString","chunkOffset","cloneWithOffset","setTime","local","getDateOffset","getSetOffset","keepLocalTime","localAdjust","_changeInProgress","add_subtract__addSubtract","create__createDuration","getSetZone","setOffsetToUTC","setOffsetToLocal","subtract","setOffsetToParsedOffset","hasAlignedHourOffset","isDaylightSavingTime","isDaylightSavingTimeShifted","_isDSTShifted","isLocal","isUtcOffset","isUtc","diffRes","aspNetRegex","create__isoRegex","parseIso","momentsDifference","inp","positiveMomentsDifference","isAfter","isBefore","createAdder","period","dur","isAdding","moment_calendar__calendar","sod","calendar","inputMs","endOf","isBetween","isSame","asFloat","zoneDelta","monthDiff","anchor2","adjust","wholeMonthDiff","moment_format__toISOString","toDate","inputString","defaultFormat","postformat","withoutSuffix","humanize","fromNow","toNow","newLocaleData","isoWeekday","to_type__valueOf","unix","moment_valid__isValid","parsingFlags","invalidAt","addWeekYearFormatToken","weeksInYear","getSetWeekYear","getSetISOWeekYear","getISOWeeksInYear","getWeeksInYear","weekInfo","getSetQuarter","parseWeekday","weekdaysParse","localeWeekdays","_weekdays","localeWeekdaysShort","_weekdaysShort","localeWeekdaysMin","_weekdaysMin","localeWeekdaysParse","weekdayName","_weekdaysParse","weekdays","weekdaysShort","weekdaysMin","getSetDayOfWeek","getSetLocaleDayOfWeek","getSetISODayOfWeek","matchMeridiem","_meridiemParse","localeIsPM","localeMeridiem","isLower","parseMs","getZoneAbbr","getZoneName","moment__createUnix","moment__createInZone","parseZone","locale_calendar__calendar","_calendar","_longDateFormat","formatUpper","_invalidDate","_ordinal","preParsePostFormat","relative__relativeTime","isFuture","_relativeTime","pastFuture","locale_set__set","_ordinalParseLenient","_ordinalParse","lists__get","lists__listMonths","lists__listMonthsShort","lists__listWeekdays","lists__listWeekdaysShort","lists__listWeekdaysMin","duration_abs__abs","mathAbs","duration_add_subtract__addSubtract","duration_add_subtract__add","duration_add_subtract__subtract","absCeil","bubble","monthsFromDays","monthsToDays","daysToMonths","as","duration_as__valueOf","makeAs","duration_get__get","makeGetter","substituteTimeAgo","relativeTime","duration_humanize__relativeTime","posNegDuration","thresholds","duration_humanize__getSetRelativeTimeThreshold","threshold","withSuffix","iso_string__toISOString","iso_string__abs","Y","asSeconds","match1","match2","match3","match4","match6","match1to2","match1to3","match1to4","match1to6","matchUnsigned","matchSigned","matchTimestamp","matchWord","defaultLocaleMonths","defaultLocaleMonthsShort","parseTwoDigitYear","getSetYear","defaultLocaleWeek","prototypeMin","prototypeMax","add_subtract__add","add_subtract__subtract","lang","isoWeekYear","getSetDayOfMonth","defaultLocaleWeekdays","defaultLocaleWeekdaysShort","defaultLocaleWeekdaysMin","_isPm","defaultLocaleMeridiemParse","getSetHour","getSetMinute","getSetSecond","getSetMillisecond","momentPrototype__proto","isoWeeks","isoWeeksInYear","isDST","isDSTShifted","zoneAbbr","zoneName","momentPrototype","defaultCalendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","defaultLongDateFormat","LTS","LT","LL","LLL","LLLL","defaultInvalidDate","defaultOrdinal","defaultOrdinalParse","defaultRelativeTime","future","past","prototype__proto","firstDayOfYear","ordinalParse","langData","asMilliseconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","duration_prototype__proto","toIsoString","invalid","relativeTimeThreshold","_moment","_storageProvider","storageType","storageKeyPrefix","setKeyPrefix","serializer","deserializer","setSerializer","setDeserializer","getItem","setItem","isStorageSupported","localStorage","removeItem","_last$storage","_debounce","prefixLength","webStorage","$storage","$default","$sync","$reset","temp$storage","angularMoment","statefulFilters","serverTime","titleFormat","fullDateThreshold","fullDateFormat","amMoment","amTimeAgoConfig","angularMomentConfig","getNow","currentFrom","localNow","nowMillis","localDate","cancelTimer","activeTimeout","updateTime","momentInstance","daysAgo","showFullDate","howOld","secondsUntilUpdate","updateDateTimeAttr","isTimeElement","updateMoment","currentValue","momentValue","preprocessDate","currentFormat","modelName","amTimeAgo","amFrom","amWithoutSuffix","preprocessors","changeLocale","customization","changeTimezone","applyTimezone","aMoment","tz","amCalendarFilter","amDifferenceFilter","otherValue","usePrecision","preprocessValue","preprocessOtherValue","amDateFormatFilter","inputFormat","amDurationFormatFilter","amTimeAgoFilter","dateFrom","amSubtractFilter","amAddFilter","q","z","isGreaterThan","isGreaterThanOrEqualTo",">=","isLessThan","isLessThanOrEqualTo","<=","isEqualTo","==","isNotEqualTo","!=","isIdenticalTo","===","isNotIdenticalTo","!==","isMemoized","searchField","$key","PI","letters","encodeURI","DeckgridDescriptor","Deckgrid","Descriptor","$$deckgrid","$$link","$$templateKeyIndex","$$destroy","nullController","templateKey","cardtemplate","cardtemplatestring","outerHTML","extractedInnerHTML","cardTemplate","mother","mql","$$elem","columns","layout","$$getLayout","$$createColumns","$$onModelChange","$$getMediaQueries","onDestroy","removeListener","$$onMediaQueryChange","addListener","matchMedia","extractRules","stylesheet","sheet","cssRules","hasDeckgridStyles","regexe","media","selectorText","stylesheets","mediaQueries","mediaText","card","column","classList","newModel","oldModel","checkClass","side","leftSide","leftClass","rightClass","updateRowClasses","oddClass","evenClass","duScrollDefaultEasing","duScroll","cancelAnimation","requestAnimation","duScrollEasing","duScrollDuration","duScrollOffset","duScrollCancelOnEvents","proto","isDocument","HTMLDocument","DOCUMENT_NODE","HTMLElement","unwrap","duScrollTo","aliasFn","duScrollToElement","duScrollToAnimated","scrollAnimation","startLeft","duScrollLeft","startTop","duScrollTop","deltaLeft","deltaTop","cancelScrollAnimation","animationStep","timestamp","scrollX","scrollY","duScrollToElementAnimated","duScrollTopAnimated","duScrollLeftAnimated","unprefixed","vendors","polyfill","lastTime","currTime","timeToCall","scrollContainerAPI","duScrollGreedy","duScrollSpyWait","duScrollBottomSpy","duScrollActiveClass","createScrollHandler","bottomReached","containerEl","containerOffset","clientHeight","documentScrollHeight","innerHeight","currentlyActive","toBeActive","spies","spy","compareProperty","getTargetPosition","getTargetElement","contexts","createContext","destroyContext","defaultContextId","getContextForScope","getContextForSpy","contextId","isElementInDocument","addSpy","getContainer","removeSpy","containers","setContainer","getContainerId","removeContainer","duSmoothScroll","spyAPI","iElement","iAttrs","Spy","targetElementOrId","targetId","flushTargetCache","ngHref","duScrollspy","deregisterOnStateChange","__esModule","default","defineProperty","resetInput","logStr","confirmButtonText","showCancelButton","doneFunction","fixVerticalPosition","openModal","getModal","handleButton","getOverlay","onkeydown","onfocus","enableButtons","setDefaults","fadeOut","previousActiveElement","showInputError","resetInputError","disableButtons","sweetAlert","swal","./modules/default-params","./modules/handle-click","./modules/handle-dom","./modules/handle-key","./modules/handle-swal-dom","./modules/set-params","./modules/utils","allowOutsideClick","showConfirmButton","closeOnConfirm","closeOnCancel","confirmButtonColor","cancelButtonText","imageUrl","imageSize","allowEscapeKey","inputPlaceholder","showLoaderOnConfirm","backgroundColor","colorLuminance","boxShadow","isDescendant","handleConfirm","handleCancel","./handle-dom","./handle-swal-dom","./utils","opacity","padding","MouseEvent","bubbles","cancelable","dispatchEvent","createEvent","initEvent","createEventObject","fireEvent","cancelBubble","escapeHtml","_show","_hide","getTopMargin","fadeIn","fireClick","stopEventPropagation","setFocusStyle","hexToRgb","marginTop","sweetAlertInitialize","getInput","./default-params","./injected-html","isIE8","backgroundImage","borderLeftColor","confirmLoadingButtonColor","borderRightColor","attachEvent","isConfirm","R_ISO8061_STR","createHttpBackendMock","createResponse","prettyPrint","wrapResponse","handleResponse","$$respHeaders","handleTimeout","responses","MockXhr","expectation","expectations","wasExpected","matchHeaders","definitions","responsesPush","passThrough","parseRoute","star","MockHttpExpectation","respond","whenRoute","pathObj","expectRoute","digest","verifyNoOutstandingExpectation","verifyNoOutstandingRequest","resetExpectations","pathParams","keyObj","parseQuery","key_value","queryStr","$$lastInstance","$$method","$$async","$$reqHeaders","$$data","getResponseHeader","headerName","lines","mock","$Browser","$$lastUrl","pollFns","$$lastState","deferredFns","deferredNextId","fnIndex","$$baseHref","poll","pollFn","errors","logs","assertEmpty","logLevel","logItem","repeatFns","nextRepeatId","tick","nextTime","millis","task","TzDate","tsStr","origDate","localOffset","offsetDiff","toLocaleDateString","getUTCHours","getUTCSeconds","getUTCMilliseconds","unimplementedMethods","reflowFn","totalReflows","queueFn","animateJsConstructor","$closeAndFlush","animateCssConstructor",{"end":{"file":0,"comments_before":[],"nlb":false,"endpos":2450989,"endcol":19,"endline":68146,"pos":2450982,"col":12,"line":68146,"value":"reflows","type":"name","_comments_dumped":true},"start":{"file":0,"comments_before":[],"nlb":false,"endpos":2450989,"endcol":19,"endline":68146,"pos":2450982,"col":12,"line":68146,"value":"reflows","type":"name","_comments_dumped":true},"name":"reflows"},"reflows","closeAndFlush","hideErrors","doNextRun","somethingFlushed","dump","serializeScope","$TimeoutDecorator","formatPendingTasksAsString","verifyNoPendingTasks","$RAFDecorator","rafFn","$RootElementProvider","$ControllerDecorator","$ComponentControllerProvider","componentName","candidateDirectives","directiveInfo","$componentController","$RootScopeDecorator","e2e","$httpBackendDecorator","countChildScopes","pendingChildHeads","countWatchers","$rootScopePrototype","$countChildScopes","$countWatchers","jasmine","mocha","currentSpec","annotatedFunctions","isSpecRunning","beforeEach","setup","afterEach","teardown","$modules","$providerInjector","fragments","workFn","moduleFns","ErrorAddingDeclarationLoc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gB,iBAGd1tL,EAAS6Z,SAAS8zK,EAAS/6L,GAE7B,KAEEoN,EAASO,OAAOotL,EAAS/6L,IAAMkO,EAAQ1J,KAAM6O,MAE7C,MAAOrI,GACP,GAAIA,EAAEme,OAASwxK,EACb,KAAM,IAAID,GAAoC1vL,EAAG2vL,EAEnD,MAAM3vL,GACN,QACA2vL,EAAgB,OAzCtB,GAAII,GAAWx5L,MAAM2oB,UAAUxpB,MAAMqB,KAAK5B,UAAW,GACjDw6L,EAAgB,GAAI76L,OAAM,uBAC9B,OAAOk6L,KAAkBQ,EAAOz4L,KAAK+3L,GAAeU,GA8CtDtsL,EAAQunL,KAAKtpE,OAAOn/G,SAAW,SAASzK,GAItC,QAASi4L,KACP,GAAIj4L,IAAUu3L,EAAYgB,gBAAiB,CACzC,GAAIhB,EAAYxxK,UACd,KAAM,IAAIxoB,OAAM,8DAEhBg6L,GAAYgB,gBAAkBv4L,GAPpC,MADAA,GAAQpC,UAAUS,SAAW2B,GAAQ,EAC9By3L,IAAkBQ,IAAWA,KAerCh7L,OAAQA,OAAO0O","file":"scripts/vendor-bcf412b41d.js","sourcesContent":["/**\n * @license AngularJS v1.5.0\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, document, undefined) {'use strict';\n\n/**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * Angular. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one. The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace') . Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n * error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\nfunction minErr(module, ErrorConstructor) {\n ErrorConstructor = ErrorConstructor || Error;\n return function() {\n var SKIP_INDEXES = 2;\n\n var templateArgs = arguments,\n code = templateArgs[0],\n message = '[' + (module ? module + ':' : '') + code + '] ',\n template = templateArgs[1],\n paramPrefix, i;\n\n message += template.replace(/\\{\\d+\\}/g, function(match) {\n var index = +match.slice(1, -1),\n shiftedIndex = index + SKIP_INDEXES;\n\n if (shiftedIndex < templateArgs.length) {\n return toDebugString(templateArgs[shiftedIndex]);\n }\n\n return match;\n });\n\n message += '\\nhttp://errors.angularjs.org/1.5.0/' +\n (module ? module + '/' : '') + code;\n\n for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {\n message += paramPrefix + 'p' + (i - SKIP_INDEXES) + '=' +\n encodeURIComponent(toDebugString(templateArgs[i]));\n }\n\n return new ErrorConstructor(message);\n };\n}\n\n/* We need to tell jshint what variables are being exported */\n/* global angular: true,\n msie: true,\n jqLite: true,\n jQuery: true,\n slice: true,\n splice: true,\n push: true,\n toString: true,\n ngMinErr: true,\n angularModule: true,\n uid: true,\n REGEX_STRING_REGEXP: true,\n VALIDITY_STATE_PROPERTY: true,\n\n lowercase: true,\n uppercase: true,\n manualLowercase: true,\n manualUppercase: true,\n nodeName_: true,\n isArrayLike: true,\n forEach: true,\n forEachSorted: true,\n reverseParams: true,\n nextUid: true,\n setHashKey: true,\n extend: true,\n toInt: true,\n inherit: true,\n merge: true,\n noop: true,\n identity: true,\n valueFn: true,\n isUndefined: true,\n isDefined: true,\n isObject: true,\n isBlankObject: true,\n isString: true,\n isNumber: true,\n isDate: true,\n isArray: true,\n isFunction: true,\n isRegExp: true,\n isWindow: true,\n isScope: true,\n isFile: true,\n isFormData: true,\n isBlob: true,\n isBoolean: true,\n isPromiseLike: true,\n trim: true,\n escapeForRegexp: true,\n isElement: true,\n makeMap: true,\n includes: true,\n arrayRemove: true,\n copy: true,\n shallowCopy: true,\n equals: true,\n csp: true,\n jq: true,\n concat: true,\n sliceArgs: true,\n bind: true,\n toJsonReplacer: true,\n toJson: true,\n fromJson: true,\n convertTimezoneToLocal: true,\n timezoneToOffset: true,\n startingTag: true,\n tryDecodeURIComponent: true,\n parseKeyValue: true,\n toKeyValue: true,\n encodeUriSegment: true,\n encodeUriQuery: true,\n angularInit: true,\n bootstrap: true,\n getTestability: true,\n snake_case: true,\n bindJQuery: true,\n assertArg: true,\n assertArgFn: true,\n assertNotHasOwnProperty: true,\n getter: true,\n getBlockNodes: true,\n hasOwnProperty: true,\n createMap: true,\n\n NODE_TYPE_ELEMENT: true,\n NODE_TYPE_ATTRIBUTE: true,\n NODE_TYPE_TEXT: true,\n NODE_TYPE_COMMENT: true,\n NODE_TYPE_DOCUMENT: true,\n NODE_TYPE_DOCUMENT_FRAGMENT: true,\n*/\n\n////////////////////////////////////\n\n/**\n * @ngdoc module\n * @name ng\n * @module ng\n * @description\n *\n * # ng (core module)\n * The ng module is loaded by default when an AngularJS application is started. The module itself\n * contains the essential components for an AngularJS application to function. The table below\n * lists a high level breakdown of each of the services/factories, filters, directives and testing\n * components available within this core module.\n *\n * <div doc-module-components=\"ng\"></div>\n */\n\nvar REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\n// The name of a form control's ValidityState property.\n// This is used so that it's possible for internal tests to create mock ValidityStates.\nvar VALIDITY_STATE_PROPERTY = 'validity';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};\nvar uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};\n\n\nvar manualLowercase = function(s) {\n /* jshint bitwise: false */\n return isString(s)\n ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})\n : s;\n};\nvar manualUppercase = function(s) {\n /* jshint bitwise: false */\n return isString(s)\n ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})\n : s;\n};\n\n\n// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish\n// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods\n// with correct but slower alternatives. See https://github.com/angular/angular.js/issues/11387\nif ('i' !== 'I'.toLowerCase()) {\n lowercase = manualLowercase;\n uppercase = manualUppercase;\n}\n\n\nvar\n msie, // holds major version number for IE, or NaN if UA is not IE.\n jqLite, // delay binding since jQuery could be loaded after us.\n jQuery, // delay binding\n slice = [].slice,\n splice = [].splice,\n push = [].push,\n toString = Object.prototype.toString,\n getPrototypeOf = Object.getPrototypeOf,\n ngMinErr = minErr('ng'),\n\n /** @name angular */\n angular = window.angular || (window.angular = {}),\n angularModule,\n uid = 0;\n\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nmsie = document.documentMode;\n\n\n/**\n * @private\n * @param {*} obj\n * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n * String ...)\n */\nfunction isArrayLike(obj) {\n\n // `null`, `undefined` and `window` are not array-like\n if (obj == null || isWindow(obj)) return false;\n\n // arrays, strings and jQuery/jqLite objects are array like\n // * jqLite is either the jQuery or jqLite constructor function\n // * we have to check the existence of jqLite first as this method is called\n // via the forEach method when constructing the jqLite object in the first place\n if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true;\n\n // Support: iOS 8.2 (not reproducible in simulator)\n // \"length\" in obj used to prevent JIT error (gh-11508)\n var length = \"length\" in Object(obj) && obj.length;\n\n // NodeList objects (with `item` method) and\n // other objects with suitable length characteristics are array-like\n return isNumber(length) &&\n (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item == 'function');\n\n}\n\n/**\n * @ngdoc function\n * @name angular.forEach\n * @module ng\n * @kind function\n *\n * @description\n * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n * is the value of an object property or an array element, `key` is the object property key or\n * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n *\n * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n * using the `hasOwnProperty` method.\n *\n * Unlike ES262's\n * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n * return the value provided.\n *\n ```js\n var values = {name: 'misko', gender: 'male'};\n var log = [];\n angular.forEach(values, function(value, key) {\n this.push(key + ': ' + value);\n }, log);\n expect(log).toEqual(['name: misko', 'gender: male']);\n ```\n *\n * @param {Object|Array} obj Object to iterate over.\n * @param {Function} iterator Iterator function.\n * @param {Object=} context Object to become context (`this`) for the iterator function.\n * @returns {Object|Array} Reference to `obj`.\n */\n\nfunction forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n // Need to check if hasOwnProperty exists,\n // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj) || isArrayLike(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else if (isBlankObject(obj)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n } else if (typeof obj.hasOwnProperty === 'function') {\n // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else {\n // Slow path for objects which do not have a method `hasOwnProperty`\n for (key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n}\n\nfunction forEachSorted(obj, iterator, context) {\n var keys = Object.keys(obj).sort();\n for (var i = 0; i < keys.length; i++) {\n iterator.call(context, obj[keys[i]], keys[i]);\n }\n return keys;\n}\n\n\n/**\n * when using forEach the params are value, key, but it is often useful to have key, value.\n * @param {function(string, *)} iteratorFn\n * @returns {function(*, string)}\n */\nfunction reverseParams(iteratorFn) {\n return function(value, key) {iteratorFn(key, value);};\n}\n\n/**\n * A consistent way of creating unique IDs in angular.\n *\n * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n * we hit number precision issues in JavaScript.\n *\n * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n *\n * @returns {number} an unique alpha-numeric string\n */\nfunction nextUid() {\n return ++uid;\n}\n\n\n/**\n * Set or clear the hashkey for an object.\n * @param obj object\n * @param h the hashkey (!truthy to delete the hashkey)\n */\nfunction setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n } else {\n delete obj.$$hashKey;\n }\n}\n\n\nfunction baseExtend(dst, objs, deep) {\n var h = dst.$$hashKey;\n\n for (var i = 0, ii = objs.length; i < ii; ++i) {\n var obj = objs[i];\n if (!isObject(obj) && !isFunction(obj)) continue;\n var keys = Object.keys(obj);\n for (var j = 0, jj = keys.length; j < jj; j++) {\n var key = keys[j];\n var src = obj[key];\n\n if (deep && isObject(src)) {\n if (isDate(src)) {\n dst[key] = new Date(src.valueOf());\n } else if (isRegExp(src)) {\n dst[key] = new RegExp(src);\n } else if (src.nodeName) {\n dst[key] = src.cloneNode(true);\n } else if (isElement(src)) {\n dst[key] = src.clone();\n } else {\n if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};\n baseExtend(dst[key], [src], true);\n }\n } else {\n dst[key] = src;\n }\n }\n }\n\n setHashKey(dst, h);\n return dst;\n}\n\n/**\n * @ngdoc function\n * @name angular.extend\n * @module ng\n * @kind function\n *\n * @description\n * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n *\n * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use\n * {@link angular.merge} for this.\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\nfunction extend(dst) {\n return baseExtend(dst, slice.call(arguments, 1), false);\n}\n\n\n/**\n* @ngdoc function\n* @name angular.merge\n* @module ng\n* @kind function\n*\n* @description\n* Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n* by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.\n*\n* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source\n* objects, performing a deep copy.\n*\n* @param {Object} dst Destination object.\n* @param {...Object} src Source object(s).\n* @returns {Object} Reference to `dst`.\n*/\nfunction merge(dst) {\n return baseExtend(dst, slice.call(arguments, 1), true);\n}\n\n\n\nfunction toInt(str) {\n return parseInt(str, 10);\n}\n\n\nfunction inherit(parent, extra) {\n return extend(Object.create(parent), extra);\n}\n\n/**\n * @ngdoc function\n * @name angular.noop\n * @module ng\n * @kind function\n *\n * @description\n * A function that performs no operations. This function can be useful when writing code in the\n * functional style.\n ```js\n function foo(callback) {\n var result = calculateResult();\n (callback || angular.noop)(result);\n }\n ```\n */\nfunction noop() {}\nnoop.$inject = [];\n\n\n/**\n * @ngdoc function\n * @name angular.identity\n * @module ng\n * @kind function\n *\n * @description\n * A function that returns its first argument. This function is useful when writing code in the\n * functional style.\n *\n ```js\n function transformer(transformationFn, value) {\n return (transformationFn || angular.identity)(value);\n };\n ```\n * @param {*} value to be returned.\n * @returns {*} the value passed in.\n */\nfunction identity($) {return $;}\nidentity.$inject = [];\n\n\nfunction valueFn(value) {return function() {return value;};}\n\nfunction hasCustomToString(obj) {\n return isFunction(obj.toString) && obj.toString !== toString;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isUndefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is undefined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is undefined.\n */\nfunction isUndefined(value) {return typeof value === 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is defined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is defined.\n */\nfunction isDefined(value) {return typeof value !== 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isObject\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n * considered to be objects. Note that JavaScript arrays are objects.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\nfunction isObject(value) {\n // http://jsperf.com/isobject4\n return value !== null && typeof value === 'object';\n}\n\n\n/**\n * Determine if a value is an object with a null prototype\n *\n * @returns {boolean} True if `value` is an `Object` with a null prototype\n */\nfunction isBlankObject(value) {\n return value !== null && typeof value === 'object' && !getPrototypeOf(value);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isString\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `String`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `String`.\n */\nfunction isString(value) {return typeof value === 'string';}\n\n\n/**\n * @ngdoc function\n * @name angular.isNumber\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Number`.\n *\n * This includes the \"special\" numbers `NaN`, `+Infinity` and `-Infinity`.\n *\n * If you wish to exclude these then you can use the native\n * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)\n * method.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Number`.\n */\nfunction isNumber(value) {return typeof value === 'number';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDate\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a value is a date.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Date`.\n */\nfunction isDate(value) {\n return toString.call(value) === '[object Date]';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isArray\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Array`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Array`.\n */\nvar isArray = Array.isArray;\n\n/**\n * @ngdoc function\n * @name angular.isFunction\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Function`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Function`.\n */\nfunction isFunction(value) {return typeof value === 'function';}\n\n\n/**\n * Determines if a value is a regular expression object.\n *\n * @private\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `RegExp`.\n */\nfunction isRegExp(value) {\n return toString.call(value) === '[object RegExp]';\n}\n\n\n/**\n * Checks if `obj` is a window object.\n *\n * @private\n * @param {*} obj Object to check\n * @returns {boolean} True if `obj` is a window obj.\n */\nfunction isWindow(obj) {\n return obj && obj.window === obj;\n}\n\n\nfunction isScope(obj) {\n return obj && obj.$evalAsync && obj.$watch;\n}\n\n\nfunction isFile(obj) {\n return toString.call(obj) === '[object File]';\n}\n\n\nfunction isFormData(obj) {\n return toString.call(obj) === '[object FormData]';\n}\n\n\nfunction isBlob(obj) {\n return toString.call(obj) === '[object Blob]';\n}\n\n\nfunction isBoolean(value) {\n return typeof value === 'boolean';\n}\n\n\nfunction isPromiseLike(obj) {\n return obj && isFunction(obj.then);\n}\n\n\nvar TYPED_ARRAY_REGEXP = /^\\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\\]$/;\nfunction isTypedArray(value) {\n return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));\n}\n\nfunction isArrayBuffer(obj) {\n return toString.call(obj) === '[object ArrayBuffer]';\n}\n\n\nvar trim = function(value) {\n return isString(value) ? value.trim() : value;\n};\n\n// Copied from:\n// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n// Prereq: s is a string.\nvar escapeForRegexp = function(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n replace(/\\x08/g, '\\\\x08');\n};\n\n\n/**\n * @ngdoc function\n * @name angular.isElement\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a DOM element (or wrapped jQuery element).\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).\n */\nfunction isElement(node) {\n return !!(node &&\n (node.nodeName // we are a direct element\n || (node.prop && node.attr && node.find))); // we have an on and find method part of jQuery API\n}\n\n/**\n * @param str 'key1,key2,...'\n * @returns {object} in the form of {key1:true, key2:true, ...}\n */\nfunction makeMap(str) {\n var obj = {}, items = str.split(','), i;\n for (i = 0; i < items.length; i++) {\n obj[items[i]] = true;\n }\n return obj;\n}\n\n\nfunction nodeName_(element) {\n return lowercase(element.nodeName || (element[0] && element[0].nodeName));\n}\n\nfunction includes(array, obj) {\n return Array.prototype.indexOf.call(array, obj) != -1;\n}\n\nfunction arrayRemove(array, value) {\n var index = array.indexOf(value);\n if (index >= 0) {\n array.splice(index, 1);\n }\n return index;\n}\n\n/**\n * @ngdoc function\n * @name angular.copy\n * @module ng\n * @kind function\n *\n * @description\n * Creates a deep copy of `source`, which should be an object or an array.\n *\n * * If no destination is supplied, a copy of the object or array is created.\n * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n * are deleted and then all elements/properties from the source are copied to it.\n * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n * * If `source` is identical to 'destination' an exception will be thrown.\n *\n * @param {*} source The source that will be used to make a copy.\n * Can be any type, including primitives, `null`, and `undefined`.\n * @param {(Object|Array)=} destination Destination into which the source is copied. If\n * provided, must be of the same type as `source`.\n * @returns {*} The copy or updated `destination`, if `destination` was specified.\n *\n * @example\n <example module=\"copyExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form novalidate class=\"simple-form\">\n Name: <input type=\"text\" ng-model=\"user.name\" /><br />\n E-mail: <input type=\"email\" ng-model=\"user.email\" /><br />\n Gender: <input type=\"radio\" ng-model=\"user.gender\" value=\"male\" />male\n <input type=\"radio\" ng-model=\"user.gender\" value=\"female\" />female<br />\n <button ng-click=\"reset()\">RESET</button>\n <button ng-click=\"update(user)\">SAVE</button>\n </form>\n <pre>form = {{user | json}}</pre>\n <pre>master = {{master | json}}</pre>\n </div>\n\n <script>\n angular.module('copyExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.master= {};\n\n $scope.update = function(user) {\n // Example with 1 argument\n $scope.master= angular.copy(user);\n };\n\n $scope.reset = function() {\n // Example with 2 arguments\n angular.copy($scope.master, $scope.user);\n };\n\n $scope.reset();\n }]);\n </script>\n </file>\n </example>\n */\nfunction copy(source, destination) {\n var stackSource = [];\n var stackDest = [];\n\n if (destination) {\n if (isTypedArray(destination) || isArrayBuffer(destination)) {\n throw ngMinErr('cpta', \"Can't copy! TypedArray destination cannot be mutated.\");\n }\n if (source === destination) {\n throw ngMinErr('cpi', \"Can't copy! Source and destination are identical.\");\n }\n\n // Empty the destination object\n if (isArray(destination)) {\n destination.length = 0;\n } else {\n forEach(destination, function(value, key) {\n if (key !== '$$hashKey') {\n delete destination[key];\n }\n });\n }\n\n stackSource.push(source);\n stackDest.push(destination);\n return copyRecurse(source, destination);\n }\n\n return copyElement(source);\n\n function copyRecurse(source, destination) {\n var h = destination.$$hashKey;\n var result, key;\n if (isArray(source)) {\n for (var i = 0, ii = source.length; i < ii; i++) {\n destination.push(copyElement(source[i]));\n }\n } else if (isBlankObject(source)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in source) {\n destination[key] = copyElement(source[key]);\n }\n } else if (source && typeof source.hasOwnProperty === 'function') {\n // Slow path, which must rely on hasOwnProperty\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = copyElement(source[key]);\n }\n }\n } else {\n // Slowest path --- hasOwnProperty can't be called as a method\n for (key in source) {\n if (hasOwnProperty.call(source, key)) {\n destination[key] = copyElement(source[key]);\n }\n }\n }\n setHashKey(destination, h);\n return destination;\n }\n\n function copyElement(source) {\n // Simple values\n if (!isObject(source)) {\n return source;\n }\n\n // Already copied values\n var index = stackSource.indexOf(source);\n if (index !== -1) {\n return stackDest[index];\n }\n\n if (isWindow(source) || isScope(source)) {\n throw ngMinErr('cpws',\n \"Can't copy! Making copies of Window or Scope instances is not supported.\");\n }\n\n var needsRecurse = false;\n var destination = copyType(source);\n\n if (destination === undefined) {\n destination = isArray(source) ? [] : Object.create(getPrototypeOf(source));\n needsRecurse = true;\n }\n\n stackSource.push(source);\n stackDest.push(destination);\n\n return needsRecurse\n ? copyRecurse(source, destination)\n : destination;\n }\n\n function copyType(source) {\n switch (toString.call(source)) {\n case '[object Int8Array]':\n case '[object Int16Array]':\n case '[object Int32Array]':\n case '[object Float32Array]':\n case '[object Float64Array]':\n case '[object Uint8Array]':\n case '[object Uint8ClampedArray]':\n case '[object Uint16Array]':\n case '[object Uint32Array]':\n return new source.constructor(copyElement(source.buffer));\n\n case '[object ArrayBuffer]':\n //Support: IE10\n if (!source.slice) {\n var copied = new ArrayBuffer(source.byteLength);\n new Uint8Array(copied).set(new Uint8Array(source));\n return copied;\n }\n return source.slice(0);\n\n case '[object Boolean]':\n case '[object Number]':\n case '[object String]':\n case '[object Date]':\n return new source.constructor(source.valueOf());\n\n case '[object RegExp]':\n var re = new RegExp(source.source, source.toString().match(/[^\\/]*$/)[0]);\n re.lastIndex = source.lastIndex;\n return re;\n }\n\n if (isFunction(source.cloneNode)) {\n return source.cloneNode(true);\n }\n }\n}\n\n/**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\nfunction shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for (var i = 0, ii = src.length; i < ii; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.equals\n * @module ng\n * @kind function\n *\n * @description\n * Determines if two objects or two values are equivalent. Supports value types, regular\n * expressions, arrays and objects.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `angular.equals`.\n * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n * * Both values represent the same regular expression (In JavaScript,\n * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n * representation matches).\n *\n * During a property comparison, properties of `function` type and properties with names\n * that begin with `$` are ignored.\n *\n * Scope and DOMWindow objects are being compared only by identify (`===`).\n *\n * @param {*} o1 Object or value to compare.\n * @param {*} o2 Object or value to compare.\n * @returns {boolean} True if arguments are equal.\n */\nfunction equals(o1, o2) {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n if (t1 == t2 && t1 == 'object') {\n if (isArray(o1)) {\n if (!isArray(o2)) return false;\n if ((length = o1.length) == o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else if (isDate(o1)) {\n if (!isDate(o2)) return false;\n return equals(o1.getTime(), o2.getTime());\n } else if (isRegExp(o1)) {\n if (!isRegExp(o2)) return false;\n return o1.toString() == o2.toString();\n } else {\n if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||\n isArray(o2) || isDate(o2) || isRegExp(o2)) return false;\n keySet = createMap();\n for (key in o1) {\n if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n if (!equals(o1[key], o2[key])) return false;\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) &&\n key.charAt(0) !== '$' &&\n isDefined(o2[key]) &&\n !isFunction(o2[key])) return false;\n }\n return true;\n }\n }\n return false;\n}\n\nvar csp = function() {\n if (!isDefined(csp.rules)) {\n\n\n var ngCspElement = (document.querySelector('[ng-csp]') ||\n document.querySelector('[data-ng-csp]'));\n\n if (ngCspElement) {\n var ngCspAttribute = ngCspElement.getAttribute('ng-csp') ||\n ngCspElement.getAttribute('data-ng-csp');\n csp.rules = {\n noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1),\n noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1)\n };\n } else {\n csp.rules = {\n noUnsafeEval: noUnsafeEval(),\n noInlineStyle: false\n };\n }\n }\n\n return csp.rules;\n\n function noUnsafeEval() {\n try {\n /* jshint -W031, -W054 */\n new Function('');\n /* jshint +W031, +W054 */\n return false;\n } catch (e) {\n return true;\n }\n }\n};\n\n/**\n * @ngdoc directive\n * @module ng\n * @name ngJq\n *\n * @element ANY\n * @param {string=} ngJq the name of the library available under `window`\n * to be used for angular.element\n * @description\n * Use this directive to force the angular.element library. This should be\n * used to force either jqLite by leaving ng-jq blank or setting the name of\n * the jquery variable under window (eg. jQuery).\n *\n * Since angular looks for this directive when it is loaded (doesn't wait for the\n * DOMContentLoaded event), it must be placed on an element that comes before the script\n * which loads angular. Also, only the first instance of `ng-jq` will be used and all\n * others ignored.\n *\n * @example\n * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.\n ```html\n <!doctype html>\n <html ng-app ng-jq>\n ...\n ...\n </html>\n ```\n * @example\n * This example shows how to use a jQuery based library of a different name.\n * The library name must be available at the top most 'window'.\n ```html\n <!doctype html>\n <html ng-app ng-jq=\"jQueryLib\">\n ...\n ...\n </html>\n ```\n */\nvar jq = function() {\n if (isDefined(jq.name_)) return jq.name_;\n var el;\n var i, ii = ngAttrPrefixes.length, prefix, name;\n for (i = 0; i < ii; ++i) {\n prefix = ngAttrPrefixes[i];\n if (el = document.querySelector('[' + prefix.replace(':', '\\\\:') + 'jq]')) {\n name = el.getAttribute(prefix + 'jq');\n break;\n }\n }\n\n return (jq.name_ = name);\n};\n\nfunction concat(array1, array2, index) {\n return array1.concat(slice.call(array2, index));\n}\n\nfunction sliceArgs(args, startIndex) {\n return slice.call(args, startIndex || 0);\n}\n\n\n/* jshint -W101 */\n/**\n * @ngdoc function\n * @name angular.bind\n * @module ng\n * @kind function\n *\n * @description\n * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n *\n * @param {Object} self Context which `fn` should be evaluated in.\n * @param {function()} fn Function to be bound.\n * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n */\n/* jshint +W101 */\nfunction bind(self, fn) {\n var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n if (isFunction(fn) && !(fn instanceof RegExp)) {\n return curryArgs.length\n ? function() {\n return arguments.length\n ? fn.apply(self, concat(curryArgs, arguments, 0))\n : fn.apply(self, curryArgs);\n }\n : function() {\n return arguments.length\n ? fn.apply(self, arguments)\n : fn.call(self);\n };\n } else {\n // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)\n return fn;\n }\n}\n\n\nfunction toJsonReplacer(key, value) {\n var val = value;\n\n if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n val = undefined;\n } else if (isWindow(value)) {\n val = '$WINDOW';\n } else if (value && document === value) {\n val = '$DOCUMENT';\n } else if (isScope(value)) {\n val = '$SCOPE';\n }\n\n return val;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.toJson\n * @module ng\n * @kind function\n *\n * @description\n * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n * stripped since angular uses this notation internally.\n *\n * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.\n * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.\n * If set to an integer, the JSON output will contain that many spaces per indentation.\n * @returns {string|undefined} JSON-ified string representing `obj`.\n */\nfunction toJson(obj, pretty) {\n if (isUndefined(obj)) return undefined;\n if (!isNumber(pretty)) {\n pretty = pretty ? 2 : null;\n }\n return JSON.stringify(obj, toJsonReplacer, pretty);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.fromJson\n * @module ng\n * @kind function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|string|number} Deserialized JSON string.\n */\nfunction fromJson(json) {\n return isString(json)\n ? JSON.parse(json)\n : json;\n}\n\n\nvar ALL_COLONS = /:/g;\nfunction timezoneToOffset(timezone, fallback) {\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(ALL_COLONS, '');\n var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n}\n\n\nfunction addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n}\n\n\nfunction convertTimezoneToLocal(date, timezone, reverse) {\n reverse = reverse ? -1 : 1;\n var dateTimezoneOffset = date.getTimezoneOffset();\n var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));\n}\n\n\n/**\n * @returns {string} Returns the string representation of the element.\n */\nfunction startingTag(element) {\n element = jqLite(element).clone();\n try {\n // turns out IE does not let you set .html() on elements which\n // are not allowed to have children. So we just ignore it.\n element.empty();\n } catch (e) {}\n var elemHtml = jqLite('<div>').append(element).html();\n try {\n return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :\n elemHtml.\n match(/^(<[^>]+>)/)[1].\n replace(/^<([\\w\\-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});\n } catch (e) {\n return lowercase(elemHtml);\n }\n\n}\n\n\n/////////////////////////////////////////////////\n\n/**\n * Tries to decode the URI component without throwing an exception.\n *\n * @private\n * @param str value potential URI component to check.\n * @returns {boolean} True if `value` can be decoded\n * with the decodeURIComponent function.\n */\nfunction tryDecodeURIComponent(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n // Ignore any invalid uri component\n }\n}\n\n\n/**\n * Parses an escaped url query string into key-value pairs.\n * @returns {Object.<string,boolean|Array>}\n */\nfunction parseKeyValue(/**string*/keyValue) {\n var obj = {};\n forEach((keyValue || \"\").split('&'), function(keyValue) {\n var splitPoint, key, val;\n if (keyValue) {\n key = keyValue = keyValue.replace(/\\+/g,'%20');\n splitPoint = keyValue.indexOf('=');\n if (splitPoint !== -1) {\n key = keyValue.substring(0, splitPoint);\n val = keyValue.substring(splitPoint + 1);\n }\n key = tryDecodeURIComponent(key);\n if (isDefined(key)) {\n val = isDefined(val) ? tryDecodeURIComponent(val) : true;\n if (!hasOwnProperty.call(obj, key)) {\n obj[key] = val;\n } else if (isArray(obj[key])) {\n obj[key].push(val);\n } else {\n obj[key] = [obj[key],val];\n }\n }\n }\n });\n return obj;\n}\n\nfunction toKeyValue(obj) {\n var parts = [];\n forEach(obj, function(value, key) {\n if (isArray(value)) {\n forEach(value, function(arrayValue) {\n parts.push(encodeUriQuery(key, true) +\n (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));\n });\n } else {\n parts.push(encodeUriQuery(key, true) +\n (value === true ? '' : '=' + encodeUriQuery(value, true)));\n }\n });\n return parts.length ? parts.join('&') : '';\n}\n\n\n/**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n * segments:\n * segment = *pchar\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n}\n\n\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}\n\nvar ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];\n\nfunction getNgAttribute(element, ngAttr) {\n var attr, i, ii = ngAttrPrefixes.length;\n for (i = 0; i < ii; ++i) {\n attr = ngAttrPrefixes[i] + ngAttr;\n if (isString(attr = element.getAttribute(attr))) {\n return attr;\n }\n }\n return null;\n}\n\n/**\n * @ngdoc directive\n * @name ngApp\n * @module ng\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n * {@link angular.module module} name to load.\n * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n * created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n * do not use explicit function annotation (and are thus unsuitable for minification), as described\n * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n * tracking down the root of these bugs.\n *\n * @description\n *\n * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n * designates the **root element** of the application and is typically placed near the root element\n * of the page - e.g. on the `<body>` or `<html>` tags.\n *\n * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n * found in the document will be used to define the root element to auto-bootstrap as an\n * application. To run multiple applications in an HTML document you must manually bootstrap them using\n * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.\n *\n * You can specify an **AngularJS module** to be used as the root module for the application. This\n * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n * should contain the application code needed or have dependencies on other modules that will\n * contain the code. See {@link angular.module} for more information.\n *\n * In the example below if the `ngApp` directive were not placed on the `html` element then the\n * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n * would not be resolved to `3`.\n *\n * `ngApp` is the easiest, and most common way to bootstrap an application.\n *\n <example module=\"ngAppDemo\">\n <file name=\"index.html\">\n <div ng-controller=\"ngAppDemoController\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n });\n </file>\n </example>\n *\n * Using `ngStrictDi`, you would see something like this:\n *\n <example ng-app-included=\"true\">\n <file name=\"index.html\">\n <div ng-app=\"ngAppStrictDemo\" ng-strict-di>\n <div ng-controller=\"GoodController1\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n\n <p>This renders because the controller does not fail to\n instantiate, by using explicit annotation style (see\n script.js for details)\n </p>\n </div>\n\n <div ng-controller=\"GoodController2\">\n Name: <input ng-model=\"name\"><br />\n Hello, {{name}}!\n\n <p>This renders because the controller does not fail to\n instantiate, by using explicit annotation style\n (see script.js for details)\n </p>\n </div>\n\n <div ng-controller=\"BadController\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n\n <p>The controller could not be instantiated, due to relying\n on automatic function annotations (which are disabled in\n strict mode). As such, the content of this section is not\n interpolated, and there should be an error in your web console.\n </p>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngAppStrictDemo', [])\n // BadController will fail to instantiate, due to relying on automatic function annotation,\n // rather than an explicit annotation\n .controller('BadController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n })\n // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,\n // due to using explicit annotations using the array style and $inject property, respectively.\n .controller('GoodController1', ['$scope', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n }])\n .controller('GoodController2', GoodController2);\n function GoodController2($scope) {\n $scope.name = \"World\";\n }\n GoodController2.$inject = ['$scope'];\n </file>\n <file name=\"style.css\">\n div[ng-controller] {\n margin-bottom: 1em;\n -webkit-border-radius: 4px;\n border-radius: 4px;\n border: 1px solid;\n padding: .5em;\n }\n div[ng-controller^=Good] {\n border-color: #d6e9c6;\n background-color: #dff0d8;\n color: #3c763d;\n }\n div[ng-controller^=Bad] {\n border-color: #ebccd1;\n background-color: #f2dede;\n color: #a94442;\n margin-bottom: 0;\n }\n </file>\n </example>\n */\nfunction angularInit(element, bootstrap) {\n var appElement,\n module,\n config = {};\n\n // The element `element` has priority over any other element\n forEach(ngAttrPrefixes, function(prefix) {\n var name = prefix + 'app';\n\n if (!appElement && element.hasAttribute && element.hasAttribute(name)) {\n appElement = element;\n module = element.getAttribute(name);\n }\n });\n forEach(ngAttrPrefixes, function(prefix) {\n var name = prefix + 'app';\n var candidate;\n\n if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\\\:') + ']'))) {\n appElement = candidate;\n module = candidate.getAttribute(name);\n }\n });\n if (appElement) {\n config.strictDi = getNgAttribute(appElement, \"strict-di\") !== null;\n bootstrap(appElement, module ? [module] : [], config);\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.bootstrap\n * @module ng\n * @description\n * Use this function to manually start up angular application.\n *\n * See: {@link guide/bootstrap Bootstrap}\n *\n * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually.\n * They must use {@link ng.directive:ngApp ngApp}.\n *\n * Angular will detect if it has been loaded into the browser more than once and only allow the\n * first loaded script to be bootstrapped and will report a warning to the browser console for\n * each of the subsequent scripts. This prevents strange results in applications, where otherwise\n * multiple instances of Angular try to work on the DOM.\n *\n * ```html\n * <!doctype html>\n * <html>\n * <body>\n * <div ng-controller=\"WelcomeController\">\n * {{greeting}}\n * </div>\n *\n * <script src=\"angular.js\"></script>\n * <script>\n * var app = angular.module('demo', [])\n * .controller('WelcomeController', function($scope) {\n * $scope.greeting = 'Welcome!';\n * });\n * angular.bootstrap(document, ['demo']);\n * </script>\n * </body>\n * </html>\n * ```\n *\n * @param {DOMElement} element DOM element which is the root of angular application.\n * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.\n * Each item in the array should be the name of a predefined module or a (DI annotated)\n * function that will be invoked by the injector as a `config` block.\n * See: {@link angular.module modules}\n * @param {Object=} config an object for defining configuration options for the application. The\n * following keys are supported:\n *\n * * `strictDi` - disable automatic function annotation for the application. This is meant to\n * assist in finding bugs which break minified code. Defaults to `false`.\n *\n * @returns {auto.$injector} Returns the newly created injector for this app.\n */\nfunction bootstrap(element, modules, config) {\n if (!isObject(config)) config = {};\n var defaultConfig = {\n strictDi: false\n };\n config = extend(defaultConfig, config);\n var doBootstrap = function() {\n element = jqLite(element);\n\n if (element.injector()) {\n var tag = (element[0] === document) ? 'document' : startingTag(element);\n //Encode angle brackets to prevent input from being sanitized to empty string #8683\n throw ngMinErr(\n 'btstrpd',\n \"App Already Bootstrapped with this Element '{0}'\",\n tag.replace(/</,'<').replace(/>/,'>'));\n }\n\n modules = modules || [];\n modules.unshift(['$provide', function($provide) {\n $provide.value('$rootElement', element);\n }]);\n\n if (config.debugInfoEnabled) {\n // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.\n modules.push(['$compileProvider', function($compileProvider) {\n $compileProvider.debugInfoEnabled(true);\n }]);\n }\n\n modules.unshift('ng');\n var injector = createInjector(modules, config.strictDi);\n injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',\n function bootstrapApply(scope, element, compile, injector) {\n scope.$apply(function() {\n element.data('$injector', injector);\n compile(element)(scope);\n });\n }]\n );\n return injector;\n };\n\n var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;\n var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\n\n if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {\n config.debugInfoEnabled = true;\n window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');\n }\n\n if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {\n return doBootstrap();\n }\n\n window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');\n angular.resumeBootstrap = function(extraModules) {\n forEach(extraModules, function(module) {\n modules.push(module);\n });\n return doBootstrap();\n };\n\n if (isFunction(angular.resumeDeferredBootstrap)) {\n angular.resumeDeferredBootstrap();\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.reloadWithDebugInfo\n * @module ng\n * @description\n * Use this function to reload the current application with debug information turned on.\n * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.\n *\n * See {@link ng.$compileProvider#debugInfoEnabled} for more.\n */\nfunction reloadWithDebugInfo() {\n window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;\n window.location.reload();\n}\n\n/**\n * @name angular.getTestability\n * @module ng\n * @description\n * Get the testability service for the instance of Angular on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of angular application.\n */\nfunction getTestability(rootElement) {\n var injector = angular.element(rootElement).injector();\n if (!injector) {\n throw ngMinErr('test',\n 'no injector found for element argument to getTestability');\n }\n return injector.get('$$testability');\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n}\n\nvar bindJQueryFired = false;\nfunction bindJQuery() {\n var originalCleanData;\n\n if (bindJQueryFired) {\n return;\n }\n\n // bind to jQuery if present;\n var jqName = jq();\n jQuery = isUndefined(jqName) ? window.jQuery : // use jQuery (if present)\n !jqName ? undefined : // use jqLite\n window[jqName]; // use jQuery specified by `ngJq`\n\n // Use jQuery if it exists with proper functionality, otherwise default to us.\n // Angular 1.2+ requires jQuery 1.7+ for on()/off() support.\n // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older\n // versions. It will not work for sure with jQuery <1.7, though.\n if (jQuery && jQuery.fn.on) {\n jqLite = jQuery;\n extend(jQuery.fn, {\n scope: JQLitePrototype.scope,\n isolateScope: JQLitePrototype.isolateScope,\n controller: JQLitePrototype.controller,\n injector: JQLitePrototype.injector,\n inheritedData: JQLitePrototype.inheritedData\n });\n\n // All nodes removed from the DOM via various jQuery APIs like .remove()\n // are passed through jQuery.cleanData. Monkey-patch this method to fire\n // the $destroy event on all removed nodes.\n originalCleanData = jQuery.cleanData;\n jQuery.cleanData = function(elems) {\n var events;\n for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n events = jQuery._data(elem, \"events\");\n if (events && events.$destroy) {\n jQuery(elem).triggerHandler('$destroy');\n }\n }\n originalCleanData(elems);\n };\n } else {\n jqLite = JQLite;\n }\n\n angular.element = jqLite;\n\n // Prevent double-proxying.\n bindJQueryFired = true;\n}\n\n/**\n * throw error if the argument is falsy.\n */\nfunction assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', \"Argument '{0}' is {1}\", (name || '?'), (reason || \"required\"));\n }\n return arg;\n}\n\nfunction assertArgFn(arg, name, acceptArrayAnnotation) {\n if (acceptArrayAnnotation && isArray(arg)) {\n arg = arg[arg.length - 1];\n }\n\n assertArg(isFunction(arg), name, 'not a function, got ' +\n (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));\n return arg;\n}\n\n/**\n * throw error if the name given is hasOwnProperty\n * @param {String} name the name to test\n * @param {String} context the context in which the name is used, such as module or directive\n */\nfunction assertNotHasOwnProperty(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', \"hasOwnProperty is not a valid {0} name\", context);\n }\n}\n\n/**\n * Return the value accessible from the object by path. Any undefined traversals are ignored\n * @param {Object} obj starting object\n * @param {String} path path to traverse\n * @param {boolean} [bindFnToScope=true]\n * @returns {Object} value as accessible by path\n */\n//TODO(misko): this function needs to be removed\nfunction getter(obj, path, bindFnToScope) {\n if (!path) return obj;\n var keys = path.split('.');\n var key;\n var lastInstance = obj;\n var len = keys.length;\n\n for (var i = 0; i < len; i++) {\n key = keys[i];\n if (obj) {\n obj = (lastInstance = obj)[key];\n }\n }\n if (!bindFnToScope && isFunction(obj)) {\n return bind(lastInstance, obj);\n }\n return obj;\n}\n\n/**\n * Return the DOM siblings between the first and last node in the given array.\n * @param {Array} array like object\n * @returns {Array} the inputted object or a jqLite collection containing the nodes\n */\nfunction getBlockNodes(nodes) {\n // TODO(perf): update `nodes` instead of creating a new object?\n var node = nodes[0];\n var endNode = nodes[nodes.length - 1];\n var blockNodes;\n\n for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {\n if (blockNodes || nodes[i] !== node) {\n if (!blockNodes) {\n blockNodes = jqLite(slice.call(nodes, 0, i));\n }\n blockNodes.push(node);\n }\n }\n\n return blockNodes || nodes;\n}\n\n\n/**\n * Creates a new object without a prototype. This object is useful for lookup without having to\n * guard against prototypically inherited properties via hasOwnProperty.\n *\n * Related micro-benchmarks:\n * - http://jsperf.com/object-create2\n * - http://jsperf.com/proto-map-lookup/2\n * - http://jsperf.com/for-in-vs-object-keys2\n *\n * @returns {Object}\n */\nfunction createMap() {\n return Object.create(null);\n}\n\nvar NODE_TYPE_ELEMENT = 1;\nvar NODE_TYPE_ATTRIBUTE = 2;\nvar NODE_TYPE_TEXT = 3;\nvar NODE_TYPE_COMMENT = 8;\nvar NODE_TYPE_DOCUMENT = 9;\nvar NODE_TYPE_DOCUMENT_FRAGMENT = 11;\n\n/**\n * @ngdoc type\n * @name angular.Module\n * @module ng\n * @description\n *\n * Interface for configuring angular {@link angular.module modules}.\n */\n\nfunction setupModuleLoader(window) {\n\n var $injectorMinErr = minErr('$injector');\n var ngMinErr = minErr('ng');\n\n function ensure(obj, name, factory) {\n return obj[name] || (obj[name] = factory());\n }\n\n var angular = ensure(window, 'angular', Object);\n\n // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap\n angular.$$minErr = angular.$$minErr || minErr;\n\n return ensure(angular, 'module', function() {\n /** @type {Object.<string, angular.Module>} */\n var modules = {};\n\n /**\n * @ngdoc function\n * @name angular.module\n * @module ng\n * @description\n *\n * The `angular.module` is a global place for creating, registering and retrieving Angular\n * modules.\n * All modules (angular core or 3rd party) that should be available to an application must be\n * registered using this mechanism.\n *\n * Passing one argument retrieves an existing {@link angular.Module},\n * whereas passing more than one argument creates a new {@link angular.Module}\n *\n *\n * # Module\n *\n * A module is a collection of services, directives, controllers, filters, and configuration information.\n * `angular.module` is used to configure the {@link auto.$injector $injector}.\n *\n * ```js\n * // Create a new module\n * var myModule = angular.module('myModule', []);\n *\n * // register a new service\n * myModule.value('appName', 'MyCoolApp');\n *\n * // configure existing services inside initialization blocks.\n * myModule.config(['$locationProvider', function($locationProvider) {\n * // Configure existing providers\n * $locationProvider.hashPrefix('!');\n * }]);\n * ```\n *\n * Then you can create an injector and load your modules like this:\n *\n * ```js\n * var injector = angular.injector(['ng', 'myModule'])\n * ```\n *\n * However it's more likely that you'll just use\n * {@link ng.directive:ngApp ngApp} or\n * {@link angular.bootstrap} to simplify this process for you.\n *\n * @param {!string} name The name of the module to create or retrieve.\n * @param {!Array.<string>=} requires If specified then new module is being created. If\n * unspecified then the module is being retrieved for further configuration.\n * @param {Function=} configFn Optional configuration function for the module. Same as\n * {@link angular.Module#config Module#config()}.\n * @returns {angular.Module} new module with the {@link angular.Module} api.\n */\n return function module(name, requires, configFn) {\n var assertNotHasOwnProperty = function(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n };\n\n assertNotHasOwnProperty(name, 'module');\n if (requires && modules.hasOwnProperty(name)) {\n modules[name] = null;\n }\n return ensure(modules, name, function() {\n if (!requires) {\n throw $injectorMinErr('nomod', \"Module '{0}' is not available! You either misspelled \" +\n \"the module name or forgot to load it. If registering a module ensure that you \" +\n \"specify the dependencies as the second argument.\", name);\n }\n\n /** @type {!Array.<Array.<*>>} */\n var invokeQueue = [];\n\n /** @type {!Array.<Function>} */\n var configBlocks = [];\n\n /** @type {!Array.<Function>} */\n var runBlocks = [];\n\n var config = invokeLater('$injector', 'invoke', 'push', configBlocks);\n\n /** @type {angular.Module} */\n var moduleInstance = {\n // Private state\n _invokeQueue: invokeQueue,\n _configBlocks: configBlocks,\n _runBlocks: runBlocks,\n\n /**\n * @ngdoc property\n * @name angular.Module#requires\n * @module ng\n *\n * @description\n * Holds the list of modules which the injector will load before the current module is\n * loaded.\n */\n requires: requires,\n\n /**\n * @ngdoc property\n * @name angular.Module#name\n * @module ng\n *\n * @description\n * Name of the module.\n */\n name: name,\n\n\n /**\n * @ngdoc method\n * @name angular.Module#provider\n * @module ng\n * @param {string} name service name\n * @param {Function} providerType Construction function for creating new instance of the\n * service.\n * @description\n * See {@link auto.$provide#provider $provide.provider()}.\n */\n provider: invokeLaterAndSetModuleName('$provide', 'provider'),\n\n /**\n * @ngdoc method\n * @name angular.Module#factory\n * @module ng\n * @param {string} name service name\n * @param {Function} providerFunction Function for creating new instance of the service.\n * @description\n * See {@link auto.$provide#factory $provide.factory()}.\n */\n factory: invokeLaterAndSetModuleName('$provide', 'factory'),\n\n /**\n * @ngdoc method\n * @name angular.Module#service\n * @module ng\n * @param {string} name service name\n * @param {Function} constructor A constructor function that will be instantiated.\n * @description\n * See {@link auto.$provide#service $provide.service()}.\n */\n service: invokeLaterAndSetModuleName('$provide', 'service'),\n\n /**\n * @ngdoc method\n * @name angular.Module#value\n * @module ng\n * @param {string} name service name\n * @param {*} object Service instance object.\n * @description\n * See {@link auto.$provide#value $provide.value()}.\n */\n value: invokeLater('$provide', 'value'),\n\n /**\n * @ngdoc method\n * @name angular.Module#constant\n * @module ng\n * @param {string} name constant name\n * @param {*} object Constant value.\n * @description\n * Because the constants are fixed, they get applied before other provide methods.\n * See {@link auto.$provide#constant $provide.constant()}.\n */\n constant: invokeLater('$provide', 'constant', 'unshift'),\n\n /**\n * @ngdoc method\n * @name angular.Module#decorator\n * @module ng\n * @param {string} The name of the service to decorate.\n * @param {Function} This function will be invoked when the service needs to be\n * instantiated and should return the decorated service instance.\n * @description\n * See {@link auto.$provide#decorator $provide.decorator()}.\n */\n decorator: invokeLaterAndSetModuleName('$provide', 'decorator'),\n\n /**\n * @ngdoc method\n * @name angular.Module#animation\n * @module ng\n * @param {string} name animation name\n * @param {Function} animationFactory Factory function for creating new instance of an\n * animation.\n * @description\n *\n * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.\n *\n *\n * Defines an animation hook that can be later used with\n * {@link $animate $animate} service and directives that use this service.\n *\n * ```js\n * module.animation('.animation-name', function($inject1, $inject2) {\n * return {\n * eventName : function(element, done) {\n * //code to run the animation\n * //once complete, then run done()\n * return function cancellationFunction(element) {\n * //code to cancel the animation\n * }\n * }\n * }\n * })\n * ```\n *\n * See {@link ng.$animateProvider#register $animateProvider.register()} and\n * {@link ngAnimate ngAnimate module} for more information.\n */\n animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#filter\n * @module ng\n * @param {string} name Filter name - this must be a valid angular expression identifier\n * @param {Function} filterFactory Factory function for creating new instance of filter.\n * @description\n * See {@link ng.$filterProvider#register $filterProvider.register()}.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n * </div>\n */\n filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#controller\n * @module ng\n * @param {string|Object} name Controller name, or an object map of controllers where the\n * keys are the names and the values are the constructors.\n * @param {Function} constructor Controller constructor function.\n * @description\n * See {@link ng.$controllerProvider#register $controllerProvider.register()}.\n */\n controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#directive\n * @module ng\n * @param {string|Object} name Directive name, or an object map of directives where the\n * keys are the names and the values are the factories.\n * @param {Function} directiveFactory Factory function for creating new instance of\n * directives.\n * @description\n * See {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),\n\n /**\n * @ngdoc method\n * @name angular.Module#component\n * @module ng\n * @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp)\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object})\n *\n * @description\n * See {@link ng.$compileProvider#component $compileProvider.component()}.\n */\n component: invokeLaterAndSetModuleName('$compileProvider', 'component'),\n\n /**\n * @ngdoc method\n * @name angular.Module#config\n * @module ng\n * @param {Function} configFn Execute this function on module load. Useful for service\n * configuration.\n * @description\n * Use this method to register work which needs to be performed on module loading.\n * For more about how to configure services, see\n * {@link providers#provider-recipe Provider Recipe}.\n */\n config: config,\n\n /**\n * @ngdoc method\n * @name angular.Module#run\n * @module ng\n * @param {Function} initializationFn Execute this function after injector creation.\n * Useful for application initialization.\n * @description\n * Use this method to register work which should be performed when the injector is done\n * loading all modules.\n */\n run: function(block) {\n runBlocks.push(block);\n return this;\n }\n };\n\n if (configFn) {\n config(configFn);\n }\n\n return moduleInstance;\n\n /**\n * @param {string} provider\n * @param {string} method\n * @param {String=} insertMethod\n * @returns {angular.Module}\n */\n function invokeLater(provider, method, insertMethod, queue) {\n if (!queue) queue = invokeQueue;\n return function() {\n queue[insertMethod || 'push']([provider, method, arguments]);\n return moduleInstance;\n };\n }\n\n /**\n * @param {string} provider\n * @param {string} method\n * @returns {angular.Module}\n */\n function invokeLaterAndSetModuleName(provider, method) {\n return function(recipeName, factoryFunction) {\n if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;\n invokeQueue.push([provider, method, arguments]);\n return moduleInstance;\n };\n }\n });\n };\n });\n\n}\n\n/* global: toDebugString: true */\n\nfunction serializeObject(obj) {\n var seen = [];\n\n return JSON.stringify(obj, function(key, val) {\n val = toJsonReplacer(key, val);\n if (isObject(val)) {\n\n if (seen.indexOf(val) >= 0) return '...';\n\n seen.push(val);\n }\n return val;\n });\n}\n\nfunction toDebugString(obj) {\n if (typeof obj === 'function') {\n return obj.toString().replace(/ \\{[\\s\\S]*$/, '');\n } else if (isUndefined(obj)) {\n return 'undefined';\n } else if (typeof obj !== 'string') {\n return serializeObject(obj);\n }\n return obj;\n}\n\n/* global angularModule: true,\n version: true,\n\n $CompileProvider,\n\n htmlAnchorDirective,\n inputDirective,\n inputDirective,\n formDirective,\n scriptDirective,\n selectDirective,\n styleDirective,\n optionDirective,\n ngBindDirective,\n ngBindHtmlDirective,\n ngBindTemplateDirective,\n ngClassDirective,\n ngClassEvenDirective,\n ngClassOddDirective,\n ngCloakDirective,\n ngControllerDirective,\n ngFormDirective,\n ngHideDirective,\n ngIfDirective,\n ngIncludeDirective,\n ngIncludeFillContentDirective,\n ngInitDirective,\n ngNonBindableDirective,\n ngPluralizeDirective,\n ngRepeatDirective,\n ngShowDirective,\n ngStyleDirective,\n ngSwitchDirective,\n ngSwitchWhenDirective,\n ngSwitchDefaultDirective,\n ngOptionsDirective,\n ngTranscludeDirective,\n ngModelDirective,\n ngListDirective,\n ngChangeDirective,\n patternDirective,\n patternDirective,\n requiredDirective,\n requiredDirective,\n minlengthDirective,\n minlengthDirective,\n maxlengthDirective,\n maxlengthDirective,\n ngValueDirective,\n ngModelOptionsDirective,\n ngAttributeAliasDirectives,\n ngEventDirectives,\n\n $AnchorScrollProvider,\n $AnimateProvider,\n $CoreAnimateCssProvider,\n $$CoreAnimateJsProvider,\n $$CoreAnimateQueueProvider,\n $$AnimateRunnerFactoryProvider,\n $$AnimateAsyncRunFactoryProvider,\n $BrowserProvider,\n $CacheFactoryProvider,\n $ControllerProvider,\n $DateProvider,\n $DocumentProvider,\n $ExceptionHandlerProvider,\n $FilterProvider,\n $$ForceReflowProvider,\n $InterpolateProvider,\n $IntervalProvider,\n $$HashMapProvider,\n $HttpProvider,\n $HttpParamSerializerProvider,\n $HttpParamSerializerJQLikeProvider,\n $HttpBackendProvider,\n $xhrFactoryProvider,\n $LocationProvider,\n $LogProvider,\n $ParseProvider,\n $RootScopeProvider,\n $QProvider,\n $$QProvider,\n $$SanitizeUriProvider,\n $SceProvider,\n $SceDelegateProvider,\n $SnifferProvider,\n $TemplateCacheProvider,\n $TemplateRequestProvider,\n $$TestabilityProvider,\n $TimeoutProvider,\n $$RAFProvider,\n $WindowProvider,\n $$jqLiteProvider,\n $$CookieReaderProvider\n*/\n\n\n/**\n * @ngdoc object\n * @name angular.version\n * @module ng\n * @description\n * An object that contains information about the current AngularJS version.\n *\n * This object has the following properties:\n *\n * - `full` – `{string}` – Full version string, such as \"0.9.18\".\n * - `major` – `{number}` – Major version number, such as \"0\".\n * - `minor` – `{number}` – Minor version number, such as \"9\".\n * - `dot` – `{number}` – Dot version number, such as \"18\".\n * - `codeName` – `{string}` – Code name of the release, such as \"jiggling-armfat\".\n */\nvar version = {\n full: '1.5.0', // all of these placeholder strings will be replaced by grunt's\n major: 1, // package task\n minor: 5,\n dot: 0,\n codeName: 'ennoblement-facilitation'\n};\n\n\nfunction publishExternalAPI(angular) {\n extend(angular, {\n 'bootstrap': bootstrap,\n 'copy': copy,\n 'extend': extend,\n 'merge': merge,\n 'equals': equals,\n 'element': jqLite,\n 'forEach': forEach,\n 'injector': createInjector,\n 'noop': noop,\n 'bind': bind,\n 'toJson': toJson,\n 'fromJson': fromJson,\n 'identity': identity,\n 'isUndefined': isUndefined,\n 'isDefined': isDefined,\n 'isString': isString,\n 'isFunction': isFunction,\n 'isObject': isObject,\n 'isNumber': isNumber,\n 'isElement': isElement,\n 'isArray': isArray,\n 'version': version,\n 'isDate': isDate,\n 'lowercase': lowercase,\n 'uppercase': uppercase,\n 'callbacks': {counter: 0},\n 'getTestability': getTestability,\n '$$minErr': minErr,\n '$$csp': csp,\n 'reloadWithDebugInfo': reloadWithDebugInfo\n });\n\n angularModule = setupModuleLoader(window);\n\n angularModule('ng', ['ngLocale'], ['$provide',\n function ngModule($provide) {\n // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.\n $provide.provider({\n $$sanitizeUri: $$SanitizeUriProvider\n });\n $provide.provider('$compile', $CompileProvider).\n directive({\n a: htmlAnchorDirective,\n input: inputDirective,\n textarea: inputDirective,\n form: formDirective,\n script: scriptDirective,\n select: selectDirective,\n style: styleDirective,\n option: optionDirective,\n ngBind: ngBindDirective,\n ngBindHtml: ngBindHtmlDirective,\n ngBindTemplate: ngBindTemplateDirective,\n ngClass: ngClassDirective,\n ngClassEven: ngClassEvenDirective,\n ngClassOdd: ngClassOddDirective,\n ngCloak: ngCloakDirective,\n ngController: ngControllerDirective,\n ngForm: ngFormDirective,\n ngHide: ngHideDirective,\n ngIf: ngIfDirective,\n ngInclude: ngIncludeDirective,\n ngInit: ngInitDirective,\n ngNonBindable: ngNonBindableDirective,\n ngPluralize: ngPluralizeDirective,\n ngRepeat: ngRepeatDirective,\n ngShow: ngShowDirective,\n ngStyle: ngStyleDirective,\n ngSwitch: ngSwitchDirective,\n ngSwitchWhen: ngSwitchWhenDirective,\n ngSwitchDefault: ngSwitchDefaultDirective,\n ngOptions: ngOptionsDirective,\n ngTransclude: ngTranscludeDirective,\n ngModel: ngModelDirective,\n ngList: ngListDirective,\n ngChange: ngChangeDirective,\n pattern: patternDirective,\n ngPattern: patternDirective,\n required: requiredDirective,\n ngRequired: requiredDirective,\n minlength: minlengthDirective,\n ngMinlength: minlengthDirective,\n maxlength: maxlengthDirective,\n ngMaxlength: maxlengthDirective,\n ngValue: ngValueDirective,\n ngModelOptions: ngModelOptionsDirective\n }).\n directive({\n ngInclude: ngIncludeFillContentDirective\n }).\n directive(ngAttributeAliasDirectives).\n directive(ngEventDirectives);\n $provide.provider({\n $anchorScroll: $AnchorScrollProvider,\n $animate: $AnimateProvider,\n $animateCss: $CoreAnimateCssProvider,\n $$animateJs: $$CoreAnimateJsProvider,\n $$animateQueue: $$CoreAnimateQueueProvider,\n $$AnimateRunner: $$AnimateRunnerFactoryProvider,\n $$animateAsyncRun: $$AnimateAsyncRunFactoryProvider,\n $browser: $BrowserProvider,\n $cacheFactory: $CacheFactoryProvider,\n $controller: $ControllerProvider,\n $document: $DocumentProvider,\n $exceptionHandler: $ExceptionHandlerProvider,\n $filter: $FilterProvider,\n $$forceReflow: $$ForceReflowProvider,\n $interpolate: $InterpolateProvider,\n $interval: $IntervalProvider,\n $http: $HttpProvider,\n $httpParamSerializer: $HttpParamSerializerProvider,\n $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,\n $httpBackend: $HttpBackendProvider,\n $xhrFactory: $xhrFactoryProvider,\n $location: $LocationProvider,\n $log: $LogProvider,\n $parse: $ParseProvider,\n $rootScope: $RootScopeProvider,\n $q: $QProvider,\n $$q: $$QProvider,\n $sce: $SceProvider,\n $sceDelegate: $SceDelegateProvider,\n $sniffer: $SnifferProvider,\n $templateCache: $TemplateCacheProvider,\n $templateRequest: $TemplateRequestProvider,\n $$testability: $$TestabilityProvider,\n $timeout: $TimeoutProvider,\n $window: $WindowProvider,\n $$rAF: $$RAFProvider,\n $$jqLite: $$jqLiteProvider,\n $$HashMap: $$HashMapProvider,\n $$cookieReader: $$CookieReaderProvider\n });\n }\n ]);\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* global JQLitePrototype: true,\n addEventListenerFn: true,\n removeEventListenerFn: true,\n BOOLEAN_ATTR: true,\n ALIASED_ATTR: true,\n*/\n\n//////////////////////////////////\n//JQLite\n//////////////////////////////////\n\n/**\n * @ngdoc function\n * @name angular.element\n * @module ng\n * @kind function\n *\n * @description\n * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.\n *\n * If jQuery is available, `angular.element` is an alias for the\n * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`\n * delegates to Angular's built-in subset of jQuery, called \"jQuery lite\" or **jqLite**.\n *\n * jqLite is a tiny, API-compatible subset of jQuery that allows\n * Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most\n * commonly needed functionality with the goal of having a very small footprint.\n *\n * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. You can also use the\n * {@link ngJq `ngJq`} directive to specify that jqlite should be used over jQuery, or to use a\n * specific version of jQuery if multiple versions exist on the page.\n *\n * <div class=\"alert alert-info\">**Note:** All element references in Angular are always wrapped with jQuery or\n * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.</div>\n *\n * <div class=\"alert alert-warning\">**Note:** Keep in mind that this function will not find elements\n * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)`\n * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.</div>\n *\n * ## Angular's jqLite\n * jqLite provides only the following jQuery methods:\n *\n * - [`addClass()`](http://api.jquery.com/addClass/)\n * - [`after()`](http://api.jquery.com/after/)\n * - [`append()`](http://api.jquery.com/append/)\n * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters\n * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData\n * - [`children()`](http://api.jquery.com/children/) - Does not support selectors\n * - [`clone()`](http://api.jquery.com/clone/)\n * - [`contents()`](http://api.jquery.com/contents/)\n * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`.\n * As a setter, does not convert numbers to strings or append 'px', and also does not have automatic property prefixing.\n * - [`data()`](http://api.jquery.com/data/)\n * - [`detach()`](http://api.jquery.com/detach/)\n * - [`empty()`](http://api.jquery.com/empty/)\n * - [`eq()`](http://api.jquery.com/eq/)\n * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name\n * - [`hasClass()`](http://api.jquery.com/hasClass/)\n * - [`html()`](http://api.jquery.com/html/)\n * - [`next()`](http://api.jquery.com/next/) - Does not support selectors\n * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData\n * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter\n * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors\n * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors\n * - [`prepend()`](http://api.jquery.com/prepend/)\n * - [`prop()`](http://api.jquery.com/prop/)\n * - [`ready()`](http://api.jquery.com/ready/)\n * - [`remove()`](http://api.jquery.com/remove/)\n * - [`removeAttr()`](http://api.jquery.com/removeAttr/)\n * - [`removeClass()`](http://api.jquery.com/removeClass/)\n * - [`removeData()`](http://api.jquery.com/removeData/)\n * - [`replaceWith()`](http://api.jquery.com/replaceWith/)\n * - [`text()`](http://api.jquery.com/text/)\n * - [`toggleClass()`](http://api.jquery.com/toggleClass/)\n * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers.\n * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces or event object as parameter\n * - [`val()`](http://api.jquery.com/val/)\n * - [`wrap()`](http://api.jquery.com/wrap/)\n *\n * ## jQuery/jqLite Extras\n * Angular also provides the following additional methods and events to both jQuery and jqLite:\n *\n * ### Events\n * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event\n * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM\n * element before it is removed.\n *\n * ### Methods\n * - `controller(name)` - retrieves the controller of the current element or its parent. By default\n * retrieves controller associated with the `ngController` directive. If `name` is provided as\n * camelCase directive name, then the controller for this directive will be retrieved (e.g.\n * `'ngModel'`).\n * - `injector()` - retrieves the injector of the current element or its parent.\n * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current\n * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to\n * be enabled.\n * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the\n * current element. This getter should be used only on elements that contain a directive which starts a new isolate\n * scope. Calling `scope()` on this element always returns the original non-isolate scope.\n * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.\n * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top\n * parent element is reached.\n *\n * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.\n * @returns {Object} jQuery object.\n */\n\nJQLite.expando = 'ng339';\n\nvar jqCache = JQLite.cache = {},\n jqId = 1,\n addEventListenerFn = function(element, type, fn) {\n element.addEventListener(type, fn, false);\n },\n removeEventListenerFn = function(element, type, fn) {\n element.removeEventListener(type, fn, false);\n };\n\n/*\n * !!! This is an undocumented \"private\" function !!!\n */\nJQLite._data = function(node) {\n //jQuery always returns an object on cache miss\n return this.cache[node[this.expando]] || {};\n};\n\nfunction jqNextId() { return ++jqId; }\n\n\nvar SPECIAL_CHARS_REGEXP = /([\\:\\-\\_]+(.))/g;\nvar MOZ_HACK_REGEXP = /^moz([A-Z])/;\nvar MOUSE_EVENT_MAP= { mouseleave: \"mouseout\", mouseenter: \"mouseover\"};\nvar jqLiteMinErr = minErr('jqLite');\n\n/**\n * Converts snake_case to camelCase.\n * Also there is special case for Moz prefix starting with upper case letter.\n * @param name Name to normalize\n */\nfunction camelCase(name) {\n return name.\n replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n }).\n replace(MOZ_HACK_REGEXP, 'Moz$1');\n}\n\nvar SINGLE_TAG_REGEXP = /^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/;\nvar HTML_REGEXP = /<|&#?\\w+;/;\nvar TAG_NAME_REGEXP = /<([\\w:-]+)/;\nvar XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:-]+)[^>]*)\\/>/gi;\n\nvar wrapMap = {\n 'option': [1, '<select multiple=\"multiple\">', '</select>'],\n\n 'thead': [1, '<table>', '</table>'],\n 'col': [2, '<table><colgroup>', '</colgroup></table>'],\n 'tr': [2, '<table><tbody>', '</tbody></table>'],\n 'td': [3, '<table><tbody><tr>', '</tr></tbody></table>'],\n '_default': [0, \"\", \"\"]\n};\n\nwrapMap.optgroup = wrapMap.option;\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction jqLiteIsTextNode(html) {\n return !HTML_REGEXP.test(html);\n}\n\nfunction jqLiteAcceptsData(node) {\n // The window object can accept data but has no nodeType\n // Otherwise we are only interested in elements (1) and documents (9)\n var nodeType = node.nodeType;\n return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;\n}\n\nfunction jqLiteHasData(node) {\n for (var key in jqCache[node.ng339]) {\n return true;\n }\n return false;\n}\n\nfunction jqLiteCleanData(nodes) {\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n jqLiteRemoveData(nodes[i]);\n }\n}\n\nfunction jqLiteBuildFragment(html, context) {\n var tmp, tag, wrap,\n fragment = context.createDocumentFragment(),\n nodes = [], i;\n\n if (jqLiteIsTextNode(html)) {\n // Convert non-html into a text node\n nodes.push(context.createTextNode(html));\n } else {\n // Convert html into DOM nodes\n tmp = tmp || fragment.appendChild(context.createElement(\"div\"));\n tag = (TAG_NAME_REGEXP.exec(html) || [\"\", \"\"])[1].toLowerCase();\n wrap = wrapMap[tag] || wrapMap._default;\n tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, \"<$1></$2>\") + wrap[2];\n\n // Descend through wrappers to the right content\n i = wrap[0];\n while (i--) {\n tmp = tmp.lastChild;\n }\n\n nodes = concat(nodes, tmp.childNodes);\n\n tmp = fragment.firstChild;\n tmp.textContent = \"\";\n }\n\n // Remove wrapper from fragment\n fragment.textContent = \"\";\n fragment.innerHTML = \"\"; // Clear inner HTML\n forEach(nodes, function(node) {\n fragment.appendChild(node);\n });\n\n return fragment;\n}\n\nfunction jqLiteParseHTML(html, context) {\n context = context || document;\n var parsed;\n\n if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {\n return [context.createElement(parsed[1])];\n }\n\n if ((parsed = jqLiteBuildFragment(html, context))) {\n return parsed.childNodes;\n }\n\n return [];\n}\n\nfunction jqLiteWrapNode(node, wrapper) {\n var parent = node.parentNode;\n\n if (parent) {\n parent.replaceChild(wrapper, node);\n }\n\n wrapper.appendChild(node);\n}\n\n\n// IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\nvar jqLiteContains = Node.prototype.contains || function(arg) {\n // jshint bitwise: false\n return !!(this.compareDocumentPosition(arg) & 16);\n // jshint bitwise: true\n};\n\n/////////////////////////////////////////////\nfunction JQLite(element) {\n if (element instanceof JQLite) {\n return element;\n }\n\n var argIsString;\n\n if (isString(element)) {\n element = trim(element);\n argIsString = true;\n }\n if (!(this instanceof JQLite)) {\n if (argIsString && element.charAt(0) != '<') {\n throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');\n }\n return new JQLite(element);\n }\n\n if (argIsString) {\n jqLiteAddNodes(this, jqLiteParseHTML(element));\n } else {\n jqLiteAddNodes(this, element);\n }\n}\n\nfunction jqLiteClone(element) {\n return element.cloneNode(true);\n}\n\nfunction jqLiteDealoc(element, onlyDescendants) {\n if (!onlyDescendants) jqLiteRemoveData(element);\n\n if (element.querySelectorAll) {\n var descendants = element.querySelectorAll('*');\n for (var i = 0, l = descendants.length; i < l; i++) {\n jqLiteRemoveData(descendants[i]);\n }\n }\n}\n\nfunction jqLiteOff(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');\n\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var handle = expandoStore && expandoStore.handle;\n\n if (!handle) return; //no listeners registered\n\n if (!type) {\n for (type in events) {\n if (type !== '$destroy') {\n removeEventListenerFn(element, type, handle);\n }\n delete events[type];\n }\n } else {\n\n var removeHandler = function(type) {\n var listenerFns = events[type];\n if (isDefined(fn)) {\n arrayRemove(listenerFns || [], fn);\n }\n if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {\n removeEventListenerFn(element, type, handle);\n delete events[type];\n }\n };\n\n forEach(type.split(' '), function(type) {\n removeHandler(type);\n if (MOUSE_EVENT_MAP[type]) {\n removeHandler(MOUSE_EVENT_MAP[type]);\n }\n });\n }\n}\n\nfunction jqLiteRemoveData(element, name) {\n var expandoId = element.ng339;\n var expandoStore = expandoId && jqCache[expandoId];\n\n if (expandoStore) {\n if (name) {\n delete expandoStore.data[name];\n return;\n }\n\n if (expandoStore.handle) {\n if (expandoStore.events.$destroy) {\n expandoStore.handle({}, '$destroy');\n }\n jqLiteOff(element);\n }\n delete jqCache[expandoId];\n element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it\n }\n}\n\n\nfunction jqLiteExpandoStore(element, createIfNecessary) {\n var expandoId = element.ng339,\n expandoStore = expandoId && jqCache[expandoId];\n\n if (createIfNecessary && !expandoStore) {\n element.ng339 = expandoId = jqNextId();\n expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};\n }\n\n return expandoStore;\n}\n\n\nfunction jqLiteData(element, key, value) {\n if (jqLiteAcceptsData(element)) {\n\n var isSimpleSetter = isDefined(value);\n var isSimpleGetter = !isSimpleSetter && key && !isObject(key);\n var massGetter = !key;\n var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);\n var data = expandoStore && expandoStore.data;\n\n if (isSimpleSetter) { // data('key', value)\n data[key] = value;\n } else {\n if (massGetter) { // data()\n return data;\n } else {\n if (isSimpleGetter) { // data('key')\n // don't force creation of expandoStore if it doesn't exist yet\n return data && data[key];\n } else { // mass-setter: data({key1: val1, key2: val2})\n extend(data, key);\n }\n }\n }\n }\n}\n\nfunction jqLiteHasClass(element, selector) {\n if (!element.getAttribute) return false;\n return ((\" \" + (element.getAttribute('class') || '') + \" \").replace(/[\\n\\t]/g, \" \").\n indexOf(\" \" + selector + \" \") > -1);\n}\n\nfunction jqLiteRemoveClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n forEach(cssClasses.split(' '), function(cssClass) {\n element.setAttribute('class', trim(\n (\" \" + (element.getAttribute('class') || '') + \" \")\n .replace(/[\\n\\t]/g, \" \")\n .replace(\" \" + trim(cssClass) + \" \", \" \"))\n );\n });\n }\n}\n\nfunction jqLiteAddClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')\n .replace(/[\\n\\t]/g, \" \");\n\n forEach(cssClasses.split(' '), function(cssClass) {\n cssClass = trim(cssClass);\n if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {\n existingClasses += cssClass + ' ';\n }\n });\n\n element.setAttribute('class', trim(existingClasses));\n }\n}\n\n\nfunction jqLiteAddNodes(root, elements) {\n // THIS CODE IS VERY HOT. Don't make changes without benchmarking.\n\n if (elements) {\n\n // if a Node (the most common case)\n if (elements.nodeType) {\n root[root.length++] = elements;\n } else {\n var length = elements.length;\n\n // if an Array or NodeList and not a Window\n if (typeof length === 'number' && elements.window !== elements) {\n if (length) {\n for (var i = 0; i < length; i++) {\n root[root.length++] = elements[i];\n }\n }\n } else {\n root[root.length++] = elements;\n }\n }\n }\n}\n\n\nfunction jqLiteController(element, name) {\n return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');\n}\n\nfunction jqLiteInheritedData(element, name, value) {\n // if element is the document object work with the html element instead\n // this makes $(document).scope() possible\n if (element.nodeType == NODE_TYPE_DOCUMENT) {\n element = element.documentElement;\n }\n var names = isArray(name) ? name : [name];\n\n while (element) {\n for (var i = 0, ii = names.length; i < ii; i++) {\n if (isDefined(value = jqLite.data(element, names[i]))) return value;\n }\n\n // If dealing with a document fragment node with a host element, and no parent, use the host\n // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM\n // to lookup parent controllers.\n element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);\n }\n}\n\nfunction jqLiteEmpty(element) {\n jqLiteDealoc(element, true);\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}\n\nfunction jqLiteRemove(element, keepData) {\n if (!keepData) jqLiteDealoc(element);\n var parent = element.parentNode;\n if (parent) parent.removeChild(element);\n}\n\n\nfunction jqLiteDocumentLoaded(action, win) {\n win = win || window;\n if (win.document.readyState === 'complete') {\n // Force the action to be run async for consistent behavior\n // from the action's point of view\n // i.e. it will definitely not be in a $apply\n win.setTimeout(action);\n } else {\n // No need to unbind this handler as load is only ever called once\n jqLite(win).on('load', action);\n }\n}\n\n//////////////////////////////////////////\n// Functions which are declared directly.\n//////////////////////////////////////////\nvar JQLitePrototype = JQLite.prototype = {\n ready: function(fn) {\n var fired = false;\n\n function trigger() {\n if (fired) return;\n fired = true;\n fn();\n }\n\n // check if document is already loaded\n if (document.readyState === 'complete') {\n setTimeout(trigger);\n } else {\n this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9\n // we can not use jqLite since we are not done loading and jQuery could be loaded later.\n // jshint -W064\n JQLite(window).on('load', trigger); // fallback to window.onload for others\n // jshint +W064\n }\n },\n toString: function() {\n var value = [];\n forEach(this, function(e) { value.push('' + e);});\n return '[' + value.join(', ') + ']';\n },\n\n eq: function(index) {\n return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);\n },\n\n length: 0,\n push: push,\n sort: [].sort,\n splice: [].splice\n};\n\n//////////////////////////////////////////\n// Functions iterating getter/setters.\n// these functions return self on setter and\n// value on get.\n//////////////////////////////////////////\nvar BOOLEAN_ATTR = {};\nforEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {\n BOOLEAN_ATTR[lowercase(value)] = value;\n});\nvar BOOLEAN_ELEMENTS = {};\nforEach('input,select,option,textarea,button,form,details'.split(','), function(value) {\n BOOLEAN_ELEMENTS[value] = true;\n});\nvar ALIASED_ATTR = {\n 'ngMinlength': 'minlength',\n 'ngMaxlength': 'maxlength',\n 'ngMin': 'min',\n 'ngMax': 'max',\n 'ngPattern': 'pattern'\n};\n\nfunction getBooleanAttrName(element, name) {\n // check dom last since we will most likely fail on name\n var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];\n\n // booleanAttr is here twice to minimize DOM access\n return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;\n}\n\nfunction getAliasedAttrName(name) {\n return ALIASED_ATTR[name];\n}\n\nforEach({\n data: jqLiteData,\n removeData: jqLiteRemoveData,\n hasData: jqLiteHasData,\n cleanData: jqLiteCleanData\n}, function(fn, name) {\n JQLite[name] = fn;\n});\n\nforEach({\n data: jqLiteData,\n inheritedData: jqLiteInheritedData,\n\n scope: function(element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);\n },\n\n isolateScope: function(element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');\n },\n\n controller: jqLiteController,\n\n injector: function(element) {\n return jqLiteInheritedData(element, '$injector');\n },\n\n removeAttr: function(element, name) {\n element.removeAttribute(name);\n },\n\n hasClass: jqLiteHasClass,\n\n css: function(element, name, value) {\n name = camelCase(name);\n\n if (isDefined(value)) {\n element.style[name] = value;\n } else {\n return element.style[name];\n }\n },\n\n attr: function(element, name, value) {\n var nodeType = element.nodeType;\n if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT) {\n return;\n }\n var lowercasedName = lowercase(name);\n if (BOOLEAN_ATTR[lowercasedName]) {\n if (isDefined(value)) {\n if (!!value) {\n element[name] = true;\n element.setAttribute(name, lowercasedName);\n } else {\n element[name] = false;\n element.removeAttribute(lowercasedName);\n }\n } else {\n return (element[name] ||\n (element.attributes.getNamedItem(name) || noop).specified)\n ? lowercasedName\n : undefined;\n }\n } else if (isDefined(value)) {\n element.setAttribute(name, value);\n } else if (element.getAttribute) {\n // the extra argument \"2\" is to get the right thing for a.href in IE, see jQuery code\n // some elements (e.g. Document) don't have get attribute, so return undefined\n var ret = element.getAttribute(name, 2);\n // normalize non-existing attributes to undefined (as jQuery)\n return ret === null ? undefined : ret;\n }\n },\n\n prop: function(element, name, value) {\n if (isDefined(value)) {\n element[name] = value;\n } else {\n return element[name];\n }\n },\n\n text: (function() {\n getText.$dv = '';\n return getText;\n\n function getText(element, value) {\n if (isUndefined(value)) {\n var nodeType = element.nodeType;\n return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';\n }\n element.textContent = value;\n }\n })(),\n\n val: function(element, value) {\n if (isUndefined(value)) {\n if (element.multiple && nodeName_(element) === 'select') {\n var result = [];\n forEach(element.options, function(option) {\n if (option.selected) {\n result.push(option.value || option.text);\n }\n });\n return result.length === 0 ? null : result;\n }\n return element.value;\n }\n element.value = value;\n },\n\n html: function(element, value) {\n if (isUndefined(value)) {\n return element.innerHTML;\n }\n jqLiteDealoc(element, true);\n element.innerHTML = value;\n },\n\n empty: jqLiteEmpty\n}, function(fn, name) {\n /**\n * Properties: writes return selection, reads return first value\n */\n JQLite.prototype[name] = function(arg1, arg2) {\n var i, key;\n var nodeCount = this.length;\n\n // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it\n // in a way that survives minification.\n // jqLiteEmpty takes no arguments but is a setter.\n if (fn !== jqLiteEmpty &&\n (isUndefined((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {\n if (isObject(arg1)) {\n\n // we are a write, but the object properties are the key/values\n for (i = 0; i < nodeCount; i++) {\n if (fn === jqLiteData) {\n // data() takes the whole object in jQuery\n fn(this[i], arg1);\n } else {\n for (key in arg1) {\n fn(this[i], key, arg1[key]);\n }\n }\n }\n // return self for chaining\n return this;\n } else {\n // we are a read, so read the first child.\n // TODO: do we still need this?\n var value = fn.$dv;\n // Only if we have $dv do we iterate over all, otherwise it is just the first element.\n var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount;\n for (var j = 0; j < jj; j++) {\n var nodeValue = fn(this[j], arg1, arg2);\n value = value ? value + nodeValue : nodeValue;\n }\n return value;\n }\n } else {\n // we are a write, so apply to all children\n for (i = 0; i < nodeCount; i++) {\n fn(this[i], arg1, arg2);\n }\n // return self for chaining\n return this;\n }\n };\n});\n\nfunction createEventHandler(element, events) {\n var eventHandler = function(event, type) {\n // jQuery specific api\n event.isDefaultPrevented = function() {\n return event.defaultPrevented;\n };\n\n var eventFns = events[type || event.type];\n var eventFnsLength = eventFns ? eventFns.length : 0;\n\n if (!eventFnsLength) return;\n\n if (isUndefined(event.immediatePropagationStopped)) {\n var originalStopImmediatePropagation = event.stopImmediatePropagation;\n event.stopImmediatePropagation = function() {\n event.immediatePropagationStopped = true;\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n\n if (originalStopImmediatePropagation) {\n originalStopImmediatePropagation.call(event);\n }\n };\n }\n\n event.isImmediatePropagationStopped = function() {\n return event.immediatePropagationStopped === true;\n };\n\n // Some events have special handlers that wrap the real handler\n var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper;\n\n // Copy event handlers in case event handlers array is modified during execution.\n if ((eventFnsLength > 1)) {\n eventFns = shallowCopy(eventFns);\n }\n\n for (var i = 0; i < eventFnsLength; i++) {\n if (!event.isImmediatePropagationStopped()) {\n handlerWrapper(element, event, eventFns[i]);\n }\n }\n };\n\n // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all\n // events on `element`\n eventHandler.elem = element;\n return eventHandler;\n}\n\nfunction defaultHandlerWrapper(element, event, handler) {\n handler.call(element, event);\n}\n\nfunction specialMouseHandlerWrapper(target, event, handler) {\n // Refer to jQuery's implementation of mouseenter & mouseleave\n // Read about mouseenter and mouseleave:\n // http://www.quirksmode.org/js/events_mouse.html#link8\n var related = event.relatedTarget;\n // For mousenter/leave call the handler if related is outside the target.\n // NB: No relatedTarget if the mouse left/entered the browser window\n if (!related || (related !== target && !jqLiteContains.call(target, related))) {\n handler.call(target, event);\n }\n}\n\n//////////////////////////////////////////\n// Functions iterating traversal.\n// These functions chain results into a single\n// selector.\n//////////////////////////////////////////\nforEach({\n removeData: jqLiteRemoveData,\n\n on: function jqLiteOn(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');\n\n // Do not add event handlers to non-elements because they will not be cleaned up.\n if (!jqLiteAcceptsData(element)) {\n return;\n }\n\n var expandoStore = jqLiteExpandoStore(element, true);\n var events = expandoStore.events;\n var handle = expandoStore.handle;\n\n if (!handle) {\n handle = expandoStore.handle = createEventHandler(element, events);\n }\n\n // http://jsperf.com/string-indexof-vs-split\n var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];\n var i = types.length;\n\n var addHandler = function(type, specialHandlerWrapper, noEventListener) {\n var eventFns = events[type];\n\n if (!eventFns) {\n eventFns = events[type] = [];\n eventFns.specialHandlerWrapper = specialHandlerWrapper;\n if (type !== '$destroy' && !noEventListener) {\n addEventListenerFn(element, type, handle);\n }\n }\n\n eventFns.push(fn);\n };\n\n while (i--) {\n type = types[i];\n if (MOUSE_EVENT_MAP[type]) {\n addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper);\n addHandler(type, undefined, true);\n } else {\n addHandler(type);\n }\n }\n },\n\n off: jqLiteOff,\n\n one: function(element, type, fn) {\n element = jqLite(element);\n\n //add the listener twice so that when it is called\n //you can remove the original function and still be\n //able to call element.off(ev, fn) normally\n element.on(type, function onFn() {\n element.off(type, fn);\n element.off(type, onFn);\n });\n element.on(type, fn);\n },\n\n replaceWith: function(element, replaceNode) {\n var index, parent = element.parentNode;\n jqLiteDealoc(element);\n forEach(new JQLite(replaceNode), function(node) {\n if (index) {\n parent.insertBefore(node, index.nextSibling);\n } else {\n parent.replaceChild(node, element);\n }\n index = node;\n });\n },\n\n children: function(element) {\n var children = [];\n forEach(element.childNodes, function(element) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n children.push(element);\n }\n });\n return children;\n },\n\n contents: function(element) {\n return element.contentDocument || element.childNodes || [];\n },\n\n append: function(element, node) {\n var nodeType = element.nodeType;\n if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;\n\n node = new JQLite(node);\n\n for (var i = 0, ii = node.length; i < ii; i++) {\n var child = node[i];\n element.appendChild(child);\n }\n },\n\n prepend: function(element, node) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n var index = element.firstChild;\n forEach(new JQLite(node), function(child) {\n element.insertBefore(child, index);\n });\n }\n },\n\n wrap: function(element, wrapNode) {\n jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]);\n },\n\n remove: jqLiteRemove,\n\n detach: function(element) {\n jqLiteRemove(element, true);\n },\n\n after: function(element, newElement) {\n var index = element, parent = element.parentNode;\n newElement = new JQLite(newElement);\n\n for (var i = 0, ii = newElement.length; i < ii; i++) {\n var node = newElement[i];\n parent.insertBefore(node, index.nextSibling);\n index = node;\n }\n },\n\n addClass: jqLiteAddClass,\n removeClass: jqLiteRemoveClass,\n\n toggleClass: function(element, selector, condition) {\n if (selector) {\n forEach(selector.split(' '), function(className) {\n var classCondition = condition;\n if (isUndefined(classCondition)) {\n classCondition = !jqLiteHasClass(element, className);\n }\n (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);\n });\n }\n },\n\n parent: function(element) {\n var parent = element.parentNode;\n return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;\n },\n\n next: function(element) {\n return element.nextElementSibling;\n },\n\n find: function(element, selector) {\n if (element.getElementsByTagName) {\n return element.getElementsByTagName(selector);\n } else {\n return [];\n }\n },\n\n clone: jqLiteClone,\n\n triggerHandler: function(element, event, extraParameters) {\n\n var dummyEvent, eventFnsCopy, handlerArgs;\n var eventName = event.type || event;\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var eventFns = events && events[eventName];\n\n if (eventFns) {\n // Create a dummy event to pass to the handlers\n dummyEvent = {\n preventDefault: function() { this.defaultPrevented = true; },\n isDefaultPrevented: function() { return this.defaultPrevented === true; },\n stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },\n isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },\n stopPropagation: noop,\n type: eventName,\n target: element\n };\n\n // If a custom event was provided then extend our dummy event with it\n if (event.type) {\n dummyEvent = extend(dummyEvent, event);\n }\n\n // Copy event handlers in case event handlers array is modified during execution.\n eventFnsCopy = shallowCopy(eventFns);\n handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];\n\n forEach(eventFnsCopy, function(fn) {\n if (!dummyEvent.isImmediatePropagationStopped()) {\n fn.apply(element, handlerArgs);\n }\n });\n }\n }\n}, function(fn, name) {\n /**\n * chaining functions\n */\n JQLite.prototype[name] = function(arg1, arg2, arg3) {\n var value;\n\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (isUndefined(value)) {\n value = fn(this[i], arg1, arg2, arg3);\n if (isDefined(value)) {\n // any function which returns a value needs to be wrapped\n value = jqLite(value);\n }\n } else {\n jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));\n }\n }\n return isDefined(value) ? value : this;\n };\n\n // bind legacy bind/unbind to on/off\n JQLite.prototype.bind = JQLite.prototype.on;\n JQLite.prototype.unbind = JQLite.prototype.off;\n});\n\n\n// Provider for private $$jqLite service\nfunction $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}\n\n/**\n * Computes a hash of an 'obj'.\n * Hash of a:\n * string is string\n * number is number as string\n * object is either result of calling $$hashKey function on the object or uniquely generated id,\n * that is also assigned to the $$hashKey property of the object.\n *\n * @param obj\n * @returns {string} hash string such that the same input will have the same hash string.\n * The resulting string key is in 'type:hashKey' format.\n */\nfunction hashKey(obj, nextUidFn) {\n var key = obj && obj.$$hashKey;\n\n if (key) {\n if (typeof key === 'function') {\n key = obj.$$hashKey();\n }\n return key;\n }\n\n var objType = typeof obj;\n if (objType == 'function' || (objType == 'object' && obj !== null)) {\n key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();\n } else {\n key = objType + ':' + obj;\n }\n\n return key;\n}\n\n/**\n * HashMap which can use objects as keys\n */\nfunction HashMap(array, isolatedUid) {\n if (isolatedUid) {\n var uid = 0;\n this.nextUid = function() {\n return ++uid;\n };\n }\n forEach(array, this.put, this);\n}\nHashMap.prototype = {\n /**\n * Store key value pair\n * @param key key to store can be any type\n * @param value value to store can be any type\n */\n put: function(key, value) {\n this[hashKey(key, this.nextUid)] = value;\n },\n\n /**\n * @param key\n * @returns {Object} the value for the key\n */\n get: function(key) {\n return this[hashKey(key, this.nextUid)];\n },\n\n /**\n * Remove the key/value pair\n * @param key\n */\n remove: function(key) {\n var value = this[key = hashKey(key, this.nextUid)];\n delete this[key];\n return value;\n }\n};\n\nvar $$HashMapProvider = [function() {\n this.$get = [function() {\n return HashMap;\n }];\n}];\n\n/**\n * @ngdoc function\n * @module ng\n * @name angular.injector\n * @kind function\n *\n * @description\n * Creates an injector object that can be used for retrieving services as well as for\n * dependency injection (see {@link guide/di dependency injection}).\n *\n * @param {Array.<string|Function>} modules A list of module functions or their aliases. See\n * {@link angular.module}. The `ng` module must be explicitly added.\n * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which\n * disallows argument name annotation inference.\n * @returns {injector} Injector object. See {@link auto.$injector $injector}.\n *\n * @example\n * Typical usage\n * ```js\n * // create an injector\n * var $injector = angular.injector(['ng']);\n *\n * // use the injector to kick off your application\n * // use the type inference to auto inject arguments, or use implicit injection\n * $injector.invoke(function($rootScope, $compile, $document) {\n * $compile($document)($rootScope);\n * $rootScope.$digest();\n * });\n * ```\n *\n * Sometimes you want to get access to the injector of a currently running Angular app\n * from outside Angular. Perhaps, you want to inject and compile some markup after the\n * application has been bootstrapped. You can do this using the extra `injector()` added\n * to JQuery/jqLite elements. See {@link angular.element}.\n *\n * *This is fairly rare but could be the case if a third party library is injecting the\n * markup.*\n *\n * In the following example a new block of HTML containing a `ng-controller`\n * directive is added to the end of the document body by JQuery. We then compile and link\n * it into the current AngularJS scope.\n *\n * ```js\n * var $div = $('<div ng-controller=\"MyCtrl\">{{content.label}}</div>');\n * $(document.body).append($div);\n *\n * angular.element(document).injector().invoke(function($compile) {\n * var scope = angular.element($div).scope();\n * $compile($div)(scope);\n * });\n * ```\n */\n\n\n/**\n * @ngdoc module\n * @name auto\n * @description\n *\n * Implicit module which gets automatically added to each {@link auto.$injector $injector}.\n */\n\nvar ARROW_ARG = /^([^\\(]+?)=>/;\nvar FN_ARGS = /^[^\\(]*\\(\\s*([^\\)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /^\\s*(_?)(\\S+?)\\1\\s*$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\nvar $injectorMinErr = minErr('$injector');\n\nfunction extractArgs(fn) {\n var fnText = fn.toString().replace(STRIP_COMMENTS, ''),\n args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);\n return args;\n}\n\nfunction anonFn(fn) {\n // For anonymous functions, showing at the very least the function signature can help in\n // debugging.\n var args = extractArgs(fn);\n if (args) {\n return 'function(' + (args[1] || '').replace(/[\\s\\r\\n]+/, ' ') + ')';\n }\n return 'fn';\n}\n\nfunction annotate(fn, strictDi, name) {\n var $inject,\n argDecl,\n last;\n\n if (typeof fn === 'function') {\n if (!($inject = fn.$inject)) {\n $inject = [];\n if (fn.length) {\n if (strictDi) {\n if (!isString(name) || !name) {\n name = fn.name || anonFn(fn);\n }\n throw $injectorMinErr('strictdi',\n '{0} is not using explicit annotation and cannot be invoked in strict mode', name);\n }\n argDecl = extractArgs(fn);\n forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {\n arg.replace(FN_ARG, function(all, underscore, name) {\n $inject.push(name);\n });\n });\n }\n fn.$inject = $inject;\n }\n } else if (isArray(fn)) {\n last = fn.length - 1;\n assertArgFn(fn[last], 'fn');\n $inject = fn.slice(0, last);\n } else {\n assertArgFn(fn, 'fn', true);\n }\n return $inject;\n}\n\n///////////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $injector\n *\n * @description\n *\n * `$injector` is used to retrieve object instances as defined by\n * {@link auto.$provide provider}, instantiate types, invoke methods,\n * and load modules.\n *\n * The following always holds true:\n *\n * ```js\n * var $injector = angular.injector();\n * expect($injector.get('$injector')).toBe($injector);\n * expect($injector.invoke(function($injector) {\n * return $injector;\n * })).toBe($injector);\n * ```\n *\n * # Injection Function Annotation\n *\n * JavaScript does not have annotations, and annotations are needed for dependency injection. The\n * following are all valid ways of annotating function with injection arguments and are equivalent.\n *\n * ```js\n * // inferred (only works if code not minified/obfuscated)\n * $injector.invoke(function(serviceA){});\n *\n * // annotated\n * function explicit(serviceA) {};\n * explicit.$inject = ['serviceA'];\n * $injector.invoke(explicit);\n *\n * // inline\n * $injector.invoke(['serviceA', function(serviceA){}]);\n * ```\n *\n * ## Inference\n *\n * In JavaScript calling `toString()` on a function returns the function definition. The definition\n * can then be parsed and the function arguments can be extracted. This method of discovering\n * annotations is disallowed when the injector is in strict mode.\n * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the\n * argument names.\n *\n * ## `$inject` Annotation\n * By adding an `$inject` property onto a function the injection parameters can be specified.\n *\n * ## Inline\n * As an array of injection names, where the last item in the array is the function to call.\n */\n\n/**\n * @ngdoc method\n * @name $injector#get\n *\n * @description\n * Return an instance of the service.\n *\n * @param {string} name The name of the instance to retrieve.\n * @param {string=} caller An optional string to provide the origin of the function call for error messages.\n * @return {*} The instance.\n */\n\n/**\n * @ngdoc method\n * @name $injector#invoke\n *\n * @description\n * Invoke the method and supply the method arguments from the `$injector`.\n *\n * @param {Function|Array.<string|Function>} fn The injectable function to invoke. Function parameters are\n * injected according to the {@link guide/di $inject Annotation} rules.\n * @param {Object=} self The `this` for the invoked method.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {*} the value returned by the invoked `fn` function.\n */\n\n/**\n * @ngdoc method\n * @name $injector#has\n *\n * @description\n * Allows the user to query if the particular service exists.\n *\n * @param {string} name Name of the service to query.\n * @returns {boolean} `true` if injector has given service.\n */\n\n/**\n * @ngdoc method\n * @name $injector#instantiate\n * @description\n * Create a new instance of JS type. The method takes a constructor function, invokes the new\n * operator, and supplies all of the arguments to the constructor function as specified by the\n * constructor annotation.\n *\n * @param {Function} Type Annotated constructor function.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {Object} new instance of `Type`.\n */\n\n/**\n * @ngdoc method\n * @name $injector#annotate\n *\n * @description\n * Returns an array of service names which the function is requesting for injection. This API is\n * used by the injector to determine which services need to be injected into the function when the\n * function is invoked. There are three ways in which the function can be annotated with the needed\n * dependencies.\n *\n * # Argument names\n *\n * The simplest form is to extract the dependencies from the arguments of the function. This is done\n * by converting the function into a string using `toString()` method and extracting the argument\n * names.\n * ```js\n * // Given\n * function MyController($scope, $route) {\n * // ...\n * }\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * You can disallow this method by using strict injection mode.\n *\n * This method does not work with code minification / obfuscation. For this reason the following\n * annotation strategies are supported.\n *\n * # The `$inject` property\n *\n * If a function has an `$inject` property and its value is an array of strings, then the strings\n * represent names of services to be injected into the function.\n * ```js\n * // Given\n * var MyController = function(obfuscatedScope, obfuscatedRoute) {\n * // ...\n * }\n * // Define function dependencies\n * MyController['$inject'] = ['$scope', '$route'];\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * # The array notation\n *\n * It is often desirable to inline Injected functions and that's when setting the `$inject` property\n * is very inconvenient. In these situations using the array notation to specify the dependencies in\n * a way that survives minification is a better choice:\n *\n * ```js\n * // We wish to write this (not minification / obfuscation safe)\n * injector.invoke(function($compile, $rootScope) {\n * // ...\n * });\n *\n * // We are forced to write break inlining\n * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {\n * // ...\n * };\n * tmpFn.$inject = ['$compile', '$rootScope'];\n * injector.invoke(tmpFn);\n *\n * // To better support inline function the inline annotation is supported\n * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {\n * // ...\n * }]);\n *\n * // Therefore\n * expect(injector.annotate(\n * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])\n * ).toEqual(['$compile', '$rootScope']);\n * ```\n *\n * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to\n * be retrieved as described above.\n *\n * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.\n *\n * @returns {Array.<string>} The names of the services which the function requires.\n */\n\n\n\n\n/**\n * @ngdoc service\n * @name $provide\n *\n * @description\n *\n * The {@link auto.$provide $provide} service has a number of methods for registering components\n * with the {@link auto.$injector $injector}. Many of these functions are also exposed on\n * {@link angular.Module}.\n *\n * An Angular **service** is a singleton object created by a **service factory**. These **service\n * factories** are functions which, in turn, are created by a **service provider**.\n * The **service providers** are constructor functions. When instantiated they must contain a\n * property called `$get`, which holds the **service factory** function.\n *\n * When you request a service, the {@link auto.$injector $injector} is responsible for finding the\n * correct **service provider**, instantiating it and then calling its `$get` **service factory**\n * function to get the instance of the **service**.\n *\n * Often services have no configuration options and there is no need to add methods to the service\n * provider. The provider will be no more than a constructor function with a `$get` property. For\n * these cases the {@link auto.$provide $provide} service has additional helper methods to register\n * services without specifying a provider.\n *\n * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the\n * {@link auto.$injector $injector}\n * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by\n * providers and services.\n * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by\n * services, not providers.\n * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`,\n * that will be wrapped in a **service provider** object, whose `$get` property will contain the\n * given factory function.\n * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class`\n * that will be wrapped in a **service provider** object, whose `$get` property will instantiate\n * a new object using the given constructor function.\n *\n * See the individual methods for more information and examples.\n */\n\n/**\n * @ngdoc method\n * @name $provide#provider\n * @description\n *\n * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions\n * are constructor functions, whose instances are responsible for \"providing\" a factory for a\n * service.\n *\n * Service provider names start with the name of the service they provide followed by `Provider`.\n * For example, the {@link ng.$log $log} service has a provider called\n * {@link ng.$logProvider $logProvider}.\n *\n * Service provider objects can have additional methods which allow configuration of the provider\n * and its service. Importantly, you can configure what kind of service is created by the `$get`\n * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a\n * method {@link ng.$logProvider#debugEnabled debugEnabled}\n * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the\n * console or not.\n *\n * @param {string} name The name of the instance. NOTE: the provider will be available under `name +\n 'Provider'` key.\n * @param {(Object|function())} provider If the provider is:\n *\n * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using\n * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.\n * - `Constructor`: a new instance of the provider will be created using\n * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.\n *\n * @returns {Object} registered provider instance\n\n * @example\n *\n * The following example shows how to create a simple event tracking service and register it using\n * {@link auto.$provide#provider $provide.provider()}.\n *\n * ```js\n * // Define the eventTracker provider\n * function EventTrackerProvider() {\n * var trackingUrl = '/track';\n *\n * // A provider method for configuring where the tracked events should been saved\n * this.setTrackingUrl = function(url) {\n * trackingUrl = url;\n * };\n *\n * // The service factory function\n * this.$get = ['$http', function($http) {\n * var trackedEvents = {};\n * return {\n * // Call this to track an event\n * event: function(event) {\n * var count = trackedEvents[event] || 0;\n * count += 1;\n * trackedEvents[event] = count;\n * return count;\n * },\n * // Call this to save the tracked events to the trackingUrl\n * save: function() {\n * $http.post(trackingUrl, trackedEvents);\n * }\n * };\n * }];\n * }\n *\n * describe('eventTracker', function() {\n * var postSpy;\n *\n * beforeEach(module(function($provide) {\n * // Register the eventTracker provider\n * $provide.provider('eventTracker', EventTrackerProvider);\n * }));\n *\n * beforeEach(module(function(eventTrackerProvider) {\n * // Configure eventTracker provider\n * eventTrackerProvider.setTrackingUrl('/custom-track');\n * }));\n *\n * it('tracks events', inject(function(eventTracker) {\n * expect(eventTracker.event('login')).toEqual(1);\n * expect(eventTracker.event('login')).toEqual(2);\n * }));\n *\n * it('saves to the tracking url', inject(function(eventTracker, $http) {\n * postSpy = spyOn($http, 'post');\n * eventTracker.event('login');\n * eventTracker.save();\n * expect(postSpy).toHaveBeenCalled();\n * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');\n * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');\n * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });\n * }));\n * });\n * ```\n */\n\n/**\n * @ngdoc method\n * @name $provide#factory\n * @description\n *\n * Register a **service factory**, which will be called to return the service instance.\n * This is short for registering a service where its provider consists of only a `$get` property,\n * which is the given service factory function.\n * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to\n * configure your service in a provider.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.<string|Function>} $getFn The injectable $getFn for the instance creation.\n * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service\n * ```js\n * $provide.factory('ping', ['$http', function($http) {\n * return function ping() {\n * return $http.send('/ping');\n * };\n * }]);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping();\n * }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#service\n * @description\n *\n * Register a **service constructor**, which will be invoked with `new` to create the service\n * instance.\n * This is short for registering a service where its provider's `$get` property is a factory\n * function that returns an instance instantiated by the injector from the service constructor\n * function.\n *\n * Internally it looks a bit like this:\n *\n * ```\n * {\n * $get: function() {\n * return $injector.instantiate(constructor);\n * }\n * }\n * ```\n *\n *\n * You should use {@link auto.$provide#service $provide.service(class)} if you define your service\n * as a type/class.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.<string|Function>} constructor An injectable class (constructor function)\n * that will be instantiated.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service using\n * {@link auto.$provide#service $provide.service(class)}.\n * ```js\n * var Ping = function($http) {\n * this.$http = $http;\n * };\n *\n * Ping.$inject = ['$http'];\n *\n * Ping.prototype.send = function() {\n * return this.$http.get('/ping');\n * };\n * $provide.service('ping', Ping);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping.send();\n * }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#value\n * @description\n *\n * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a\n * number, an array, an object or a function. This is short for registering a service where its\n * provider's `$get` property is a factory function that takes no arguments and returns the **value\n * service**.\n *\n * Value services are similar to constant services, except that they cannot be injected into a\n * module configuration function (see {@link angular.Module#config}) but they can be overridden by\n * an Angular\n * {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the instance.\n * @param {*} value The value.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here are some examples of creating value services.\n * ```js\n * $provide.value('ADMIN_USER', 'admin');\n *\n * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });\n *\n * $provide.value('halfOf', function(value) {\n * return value / 2;\n * });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#constant\n * @description\n *\n * Register a **constant service**, such as a string, a number, an array, an object or a function,\n * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be\n * injected into a module configuration function (see {@link angular.Module#config}) and it cannot\n * be overridden by an Angular {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the constant.\n * @param {*} value The constant value.\n * @returns {Object} registered instance\n *\n * @example\n * Here a some examples of creating constants:\n * ```js\n * $provide.constant('SHARD_HEIGHT', 306);\n *\n * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);\n *\n * $provide.constant('double', function(value) {\n * return value * 2;\n * });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#decorator\n * @description\n *\n * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator\n * intercepts the creation of a service, allowing it to override or modify the behavior of the\n * service. The object returned by the decorator may be the original service, or a new service\n * object which replaces or wraps and delegates to the original service.\n *\n * @param {string} name The name of the service to decorate.\n * @param {Function|Array.<string|Function>} decorator This function will be invoked when the service needs to be\n * instantiated and should return the decorated service instance. The function is called using\n * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.\n * Local injection arguments:\n *\n * * `$delegate` - The original service instance, which can be monkey patched, configured,\n * decorated or delegated to.\n *\n * @example\n * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting\n * calls to {@link ng.$log#error $log.warn()}.\n * ```js\n * $provide.decorator('$log', ['$delegate', function($delegate) {\n * $delegate.warn = $delegate.error;\n * return $delegate;\n * }]);\n * ```\n */\n\n\nfunction createInjector(modulesToLoad, strictDi) {\n strictDi = (strictDi === true);\n var INSTANTIATING = {},\n providerSuffix = 'Provider',\n path = [],\n loadedModules = new HashMap([], true),\n providerCache = {\n $provide: {\n provider: supportObject(provider),\n factory: supportObject(factory),\n service: supportObject(service),\n value: supportObject(value),\n constant: supportObject(constant),\n decorator: decorator\n }\n },\n providerInjector = (providerCache.$injector =\n createInternalInjector(providerCache, function(serviceName, caller) {\n if (angular.isString(caller)) {\n path.push(caller);\n }\n throw $injectorMinErr('unpr', \"Unknown provider: {0}\", path.join(' <- '));\n })),\n instanceCache = {},\n protoInstanceInjector =\n createInternalInjector(instanceCache, function(serviceName, caller) {\n var provider = providerInjector.get(serviceName + providerSuffix, caller);\n return instanceInjector.invoke(\n provider.$get, provider, undefined, serviceName);\n }),\n instanceInjector = protoInstanceInjector;\n\n providerCache['$injector' + providerSuffix] = { $get: valueFn(protoInstanceInjector) };\n var runBlocks = loadModules(modulesToLoad);\n instanceInjector = protoInstanceInjector.get('$injector');\n instanceInjector.strictDi = strictDi;\n forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); });\n\n return instanceInjector;\n\n ////////////////////////////////////\n // $provider\n ////////////////////////////////////\n\n function supportObject(delegate) {\n return function(key, value) {\n if (isObject(key)) {\n forEach(key, reverseParams(delegate));\n } else {\n return delegate(key, value);\n }\n };\n }\n\n function provider(name, provider_) {\n assertNotHasOwnProperty(name, 'service');\n if (isFunction(provider_) || isArray(provider_)) {\n provider_ = providerInjector.instantiate(provider_);\n }\n if (!provider_.$get) {\n throw $injectorMinErr('pget', \"Provider '{0}' must define $get factory method.\", name);\n }\n return providerCache[name + providerSuffix] = provider_;\n }\n\n function enforceReturnValue(name, factory) {\n return function enforcedReturnValue() {\n var result = instanceInjector.invoke(factory, this);\n if (isUndefined(result)) {\n throw $injectorMinErr('undef', \"Provider '{0}' must return a value from $get factory method.\", name);\n }\n return result;\n };\n }\n\n function factory(name, factoryFn, enforce) {\n return provider(name, {\n $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn\n });\n }\n\n function service(name, constructor) {\n return factory(name, ['$injector', function($injector) {\n return $injector.instantiate(constructor);\n }]);\n }\n\n function value(name, val) { return factory(name, valueFn(val), false); }\n\n function constant(name, value) {\n assertNotHasOwnProperty(name, 'constant');\n providerCache[name] = value;\n instanceCache[name] = value;\n }\n\n function decorator(serviceName, decorFn) {\n var origProvider = providerInjector.get(serviceName + providerSuffix),\n orig$get = origProvider.$get;\n\n origProvider.$get = function() {\n var origInstance = instanceInjector.invoke(orig$get, origProvider);\n return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});\n };\n }\n\n ////////////////////////////////////\n // Module Loading\n ////////////////////////////////////\n function loadModules(modulesToLoad) {\n assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');\n var runBlocks = [], moduleFn;\n forEach(modulesToLoad, function(module) {\n if (loadedModules.get(module)) return;\n loadedModules.put(module, true);\n\n function runInvokeQueue(queue) {\n var i, ii;\n for (i = 0, ii = queue.length; i < ii; i++) {\n var invokeArgs = queue[i],\n provider = providerInjector.get(invokeArgs[0]);\n\n provider[invokeArgs[1]].apply(provider, invokeArgs[2]);\n }\n }\n\n try {\n if (isString(module)) {\n moduleFn = angularModule(module);\n runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);\n runInvokeQueue(moduleFn._invokeQueue);\n runInvokeQueue(moduleFn._configBlocks);\n } else if (isFunction(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else if (isArray(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else {\n assertArgFn(module, 'module');\n }\n } catch (e) {\n if (isArray(module)) {\n module = module[module.length - 1];\n }\n if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {\n // Safari & FF's stack traces don't contain error.message content\n // unlike those of Chrome and IE\n // So if stack doesn't contain message, we create a new string that contains both.\n // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.\n /* jshint -W022 */\n e = e.message + '\\n' + e.stack;\n }\n throw $injectorMinErr('modulerr', \"Failed to instantiate module {0} due to:\\n{1}\",\n module, e.stack || e.message || e);\n }\n });\n return runBlocks;\n }\n\n ////////////////////////////////////\n // internal Injector\n ////////////////////////////////////\n\n function createInternalInjector(cache, factory) {\n\n function getService(serviceName, caller) {\n if (cache.hasOwnProperty(serviceName)) {\n if (cache[serviceName] === INSTANTIATING) {\n throw $injectorMinErr('cdep', 'Circular dependency found: {0}',\n serviceName + ' <- ' + path.join(' <- '));\n }\n return cache[serviceName];\n } else {\n try {\n path.unshift(serviceName);\n cache[serviceName] = INSTANTIATING;\n return cache[serviceName] = factory(serviceName, caller);\n } catch (err) {\n if (cache[serviceName] === INSTANTIATING) {\n delete cache[serviceName];\n }\n throw err;\n } finally {\n path.shift();\n }\n }\n }\n\n\n function injectionArgs(fn, locals, serviceName) {\n var args = [],\n $inject = createInjector.$$annotate(fn, strictDi, serviceName);\n\n for (var i = 0, length = $inject.length; i < length; i++) {\n var key = $inject[i];\n if (typeof key !== 'string') {\n throw $injectorMinErr('itkn',\n 'Incorrect injection token! Expected service name as string, got {0}', key);\n }\n args.push(locals && locals.hasOwnProperty(key) ? locals[key] :\n getService(key, serviceName));\n }\n return args;\n }\n\n function isClass(func) {\n // IE 9-11 do not support classes and IE9 leaks with the code below.\n if (msie <= 11) {\n return false;\n }\n // Workaround for MS Edge.\n // Check https://connect.microsoft.com/IE/Feedback/Details/2211653\n return typeof func === 'function'\n && /^(?:class\\s|constructor\\()/.test(Function.prototype.toString.call(func));\n }\n\n function invoke(fn, self, locals, serviceName) {\n if (typeof locals === 'string') {\n serviceName = locals;\n locals = null;\n }\n\n var args = injectionArgs(fn, locals, serviceName);\n if (isArray(fn)) {\n fn = fn[fn.length - 1];\n }\n\n if (!isClass(fn)) {\n // http://jsperf.com/angularjs-invoke-apply-vs-switch\n // #5388\n return fn.apply(self, args);\n } else {\n args.unshift(null);\n return new (Function.prototype.bind.apply(fn, args))();\n }\n }\n\n\n function instantiate(Type, locals, serviceName) {\n // Check if Type is annotated and use just the given function at n-1 as parameter\n // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);\n var ctor = (isArray(Type) ? Type[Type.length - 1] : Type);\n var args = injectionArgs(Type, locals, serviceName);\n // Empty object at position 0 is ignored for invocation with `new`, but required.\n args.unshift(null);\n return new (Function.prototype.bind.apply(ctor, args))();\n }\n\n\n return {\n invoke: invoke,\n instantiate: instantiate,\n get: getService,\n annotate: createInjector.$$annotate,\n has: function(name) {\n return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);\n }\n };\n }\n}\n\ncreateInjector.$$annotate = annotate;\n\n/**\n * @ngdoc provider\n * @name $anchorScrollProvider\n *\n * @description\n * Use `$anchorScrollProvider` to disable automatic scrolling whenever\n * {@link ng.$location#hash $location.hash()} changes.\n */\nfunction $AnchorScrollProvider() {\n\n var autoScrollingEnabled = true;\n\n /**\n * @ngdoc method\n * @name $anchorScrollProvider#disableAutoScrolling\n *\n * @description\n * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to\n * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.<br />\n * Use this method to disable automatic scrolling.\n *\n * If automatic scrolling is disabled, one must explicitly call\n * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the\n * current hash.\n */\n this.disableAutoScrolling = function() {\n autoScrollingEnabled = false;\n };\n\n /**\n * @ngdoc service\n * @name $anchorScroll\n * @kind function\n * @requires $window\n * @requires $location\n * @requires $rootScope\n *\n * @description\n * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the\n * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified\n * in the\n * [HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/browsers.html#the-indicated-part-of-the-document).\n *\n * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to\n * match any anchor whenever it changes. This can be disabled by calling\n * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.\n *\n * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a\n * vertical scroll-offset (either fixed or dynamic).\n *\n * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of\n * {@link ng.$location#hash $location.hash()} will be used.\n *\n * @property {(number|function|jqLite)} yOffset\n * If set, specifies a vertical scroll-offset. This is often useful when there are fixed\n * positioned elements at the top of the page, such as navbars, headers etc.\n *\n * `yOffset` can be specified in various ways:\n * - **number**: A fixed number of pixels to be used as offset.<br /><br />\n * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return\n * a number representing the offset (in pixels).<br /><br />\n * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from\n * the top of the page to the element's bottom will be used as offset.<br />\n * **Note**: The element will be taken into account only as long as its `position` is set to\n * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust\n * their height and/or positioning according to the viewport's size.\n *\n * <br />\n * <div class=\"alert alert-warning\">\n * In order for `yOffset` to work properly, scrolling should take place on the document's root and\n * not some child element.\n * </div>\n *\n * @example\n <example module=\"anchorScrollExample\">\n <file name=\"index.html\">\n <div id=\"scrollArea\" ng-controller=\"ScrollController\">\n <a ng-click=\"gotoBottom()\">Go to bottom</a>\n <a id=\"bottom\"></a> You're at the bottom!\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('anchorScrollExample', [])\n .controller('ScrollController', ['$scope', '$location', '$anchorScroll',\n function ($scope, $location, $anchorScroll) {\n $scope.gotoBottom = function() {\n // set the location.hash to the id of\n // the element you wish to scroll to.\n $location.hash('bottom');\n\n // call $anchorScroll()\n $anchorScroll();\n };\n }]);\n </file>\n <file name=\"style.css\">\n #scrollArea {\n height: 280px;\n overflow: auto;\n }\n\n #bottom {\n display: block;\n margin-top: 2000px;\n }\n </file>\n </example>\n *\n * <hr />\n * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).\n * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.\n *\n * @example\n <example module=\"anchorScrollOffsetExample\">\n <file name=\"index.html\">\n <div class=\"fixed-header\" ng-controller=\"headerCtrl\">\n <a href=\"\" ng-click=\"gotoAnchor(x)\" ng-repeat=\"x in [1,2,3,4,5]\">\n Go to anchor {{x}}\n </a>\n </div>\n <div id=\"anchor{{x}}\" class=\"anchor\" ng-repeat=\"x in [1,2,3,4,5]\">\n Anchor {{x}} of 5\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('anchorScrollOffsetExample', [])\n .run(['$anchorScroll', function($anchorScroll) {\n $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels\n }])\n .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',\n function ($anchorScroll, $location, $scope) {\n $scope.gotoAnchor = function(x) {\n var newHash = 'anchor' + x;\n if ($location.hash() !== newHash) {\n // set the $location.hash to `newHash` and\n // $anchorScroll will automatically scroll to it\n $location.hash('anchor' + x);\n } else {\n // call $anchorScroll() explicitly,\n // since $location.hash hasn't changed\n $anchorScroll();\n }\n };\n }\n ]);\n </file>\n <file name=\"style.css\">\n body {\n padding-top: 50px;\n }\n\n .anchor {\n border: 2px dashed DarkOrchid;\n padding: 10px 10px 200px 10px;\n }\n\n .fixed-header {\n background-color: rgba(0, 0, 0, 0.2);\n height: 50px;\n position: fixed;\n top: 0; left: 0; right: 0;\n }\n\n .fixed-header > a {\n display: inline-block;\n margin: 5px 15px;\n }\n </file>\n </example>\n */\n this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {\n var document = $window.document;\n\n // Helper function to get first anchor from a NodeList\n // (using `Array#some()` instead of `angular#forEach()` since it's more performant\n // and working in all supported browsers.)\n function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }\n\n function getYOffset() {\n\n var offset = scroll.yOffset;\n\n if (isFunction(offset)) {\n offset = offset();\n } else if (isElement(offset)) {\n var elem = offset[0];\n var style = $window.getComputedStyle(elem);\n if (style.position !== 'fixed') {\n offset = 0;\n } else {\n offset = elem.getBoundingClientRect().bottom;\n }\n } else if (!isNumber(offset)) {\n offset = 0;\n }\n\n return offset;\n }\n\n function scrollTo(elem) {\n if (elem) {\n elem.scrollIntoView();\n\n var offset = getYOffset();\n\n if (offset) {\n // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.\n // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the\n // top of the viewport.\n //\n // IF the number of pixels from the top of `elem` to the end of the page's content is less\n // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some\n // way down the page.\n //\n // This is often the case for elements near the bottom of the page.\n //\n // In such cases we do not need to scroll the whole `offset` up, just the difference between\n // the top of the element and the offset, which is enough to align the top of `elem` at the\n // desired position.\n var elemTop = elem.getBoundingClientRect().top;\n $window.scrollBy(0, elemTop - offset);\n }\n } else {\n $window.scrollTo(0, 0);\n }\n }\n\n function scroll(hash) {\n hash = isString(hash) ? hash : $location.hash();\n var elm;\n\n // empty hash, scroll to the top of the page\n if (!hash) scrollTo(null);\n\n // element with given id\n else if ((elm = document.getElementById(hash))) scrollTo(elm);\n\n // first anchor with given name :-D\n else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);\n\n // no element and hash == 'top', scroll to the top of the page\n else if (hash === 'top') scrollTo(null);\n }\n\n // does not scroll when user clicks on anchor link that is currently on\n // (no url change, no $location.hash() change), browser native does scroll\n if (autoScrollingEnabled) {\n $rootScope.$watch(function autoScrollWatch() {return $location.hash();},\n function autoScrollWatchAction(newVal, oldVal) {\n // skip the initial scroll if $location.hash is empty\n if (newVal === oldVal && newVal === '') return;\n\n jqLiteDocumentLoaded(function() {\n $rootScope.$evalAsync(scroll);\n });\n });\n }\n\n return scroll;\n }];\n}\n\nvar $animateMinErr = minErr('$animate');\nvar ELEMENT_NODE = 1;\nvar NG_ANIMATE_CLASSNAME = 'ng-animate';\n\nfunction mergeClasses(a,b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n}\n\nfunction extractElementNode(element) {\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType === ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction splitClasses(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n // Use createMap() to prevent class assumptions involving property names in\n // Object.prototype\n var obj = createMap();\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n}\n\n// if any other type of options value besides an Object value is\n// passed into the $animate.method() animation then this helper code\n// will be run which will ignore it. While this patch is not the\n// greatest solution to this, a lot of existing plugins depend on\n// $animate to either call the callback (< 1.2) or return a promise\n// that can be changed. This helper function ensures that the options\n// are wiped clean incase a callback function is provided.\nfunction prepareAnimateOptions(options) {\n return isObject(options)\n ? options\n : {};\n}\n\nvar $$CoreAnimateJsProvider = function() {\n this.$get = function() {};\n};\n\n// this is prefixed with Core since it conflicts with\n// the animateQueueProvider defined in ngAnimate/animateQueue.js\nvar $$CoreAnimateQueueProvider = function() {\n var postDigestQueue = new HashMap();\n var postDigestElements = [];\n\n this.$get = ['$$AnimateRunner', '$rootScope',\n function($$AnimateRunner, $rootScope) {\n return {\n enabled: noop,\n on: noop,\n off: noop,\n pin: noop,\n\n push: function(element, event, options, domOperation) {\n domOperation && domOperation();\n\n options = options || {};\n options.from && element.css(options.from);\n options.to && element.css(options.to);\n\n if (options.addClass || options.removeClass) {\n addRemoveClassesPostDigest(element, options.addClass, options.removeClass);\n }\n\n var runner = new $$AnimateRunner(); // jshint ignore:line\n\n // since there are no animations to run the runner needs to be\n // notified that the animation call is complete.\n runner.complete();\n return runner;\n }\n };\n\n\n function updateData(data, classes, value) {\n var changed = false;\n if (classes) {\n classes = isString(classes) ? classes.split(' ') :\n isArray(classes) ? classes : [];\n forEach(classes, function(className) {\n if (className) {\n changed = true;\n data[className] = value;\n }\n });\n }\n return changed;\n }\n\n function handleCSSClassChanges() {\n forEach(postDigestElements, function(element) {\n var data = postDigestQueue.get(element);\n if (data) {\n var existing = splitClasses(element.attr('class'));\n var toAdd = '';\n var toRemove = '';\n forEach(data, function(status, className) {\n var hasClass = !!existing[className];\n if (status !== hasClass) {\n if (status) {\n toAdd += (toAdd.length ? ' ' : '') + className;\n } else {\n toRemove += (toRemove.length ? ' ' : '') + className;\n }\n }\n });\n\n forEach(element, function(elm) {\n toAdd && jqLiteAddClass(elm, toAdd);\n toRemove && jqLiteRemoveClass(elm, toRemove);\n });\n postDigestQueue.remove(element);\n }\n });\n postDigestElements.length = 0;\n }\n\n\n function addRemoveClassesPostDigest(element, add, remove) {\n var data = postDigestQueue.get(element) || {};\n\n var classesAdded = updateData(data, add, true);\n var classesRemoved = updateData(data, remove, false);\n\n if (classesAdded || classesRemoved) {\n\n postDigestQueue.put(element, data);\n postDigestElements.push(element);\n\n if (postDigestElements.length === 1) {\n $rootScope.$$postDigest(handleCSSClassChanges);\n }\n }\n }\n }];\n};\n\n/**\n * @ngdoc provider\n * @name $animateProvider\n *\n * @description\n * Default implementation of $animate that doesn't perform any animations, instead just\n * synchronously performs DOM updates and resolves the returned runner promise.\n *\n * In order to enable animations the `ngAnimate` module has to be loaded.\n *\n * To see the functional implementation check out `src/ngAnimate/animate.js`.\n */\nvar $AnimateProvider = ['$provide', function($provide) {\n var provider = this;\n\n this.$$registeredAnimations = Object.create(null);\n\n /**\n * @ngdoc method\n * @name $animateProvider#register\n *\n * @description\n * Registers a new injectable animation factory function. The factory function produces the\n * animation object which contains callback functions for each event that is expected to be\n * animated.\n *\n * * `eventFn`: `function(element, ... , doneFunction, options)`\n * The element to animate, the `doneFunction` and the options fed into the animation. Depending\n * on the type of animation additional arguments will be injected into the animation function. The\n * list below explains the function signatures for the different animation methods:\n *\n * - setClass: function(element, addedClasses, removedClasses, doneFunction, options)\n * - addClass: function(element, addedClasses, doneFunction, options)\n * - removeClass: function(element, removedClasses, doneFunction, options)\n * - enter, leave, move: function(element, doneFunction, options)\n * - animate: function(element, fromStyles, toStyles, doneFunction, options)\n *\n * Make sure to trigger the `doneFunction` once the animation is fully complete.\n *\n * ```js\n * return {\n * //enter, leave, move signature\n * eventFn : function(element, done, options) {\n * //code to run the animation\n * //once complete, then run done()\n * return function endFunction(wasCancelled) {\n * //code to cancel the animation\n * }\n * }\n * }\n * ```\n *\n * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).\n * @param {Function} factory The factory function that will be executed to return the animation\n * object.\n */\n this.register = function(name, factory) {\n if (name && name.charAt(0) !== '.') {\n throw $animateMinErr('notcsel', \"Expecting class selector starting with '.' got '{0}'.\", name);\n }\n\n var key = name + '-animation';\n provider.$$registeredAnimations[name.substr(1)] = key;\n $provide.factory(key, factory);\n };\n\n /**\n * @ngdoc method\n * @name $animateProvider#classNameFilter\n *\n * @description\n * Sets and/or returns the CSS class regular expression that is checked when performing\n * an animation. Upon bootstrap the classNameFilter value is not set at all and will\n * therefore enable $animate to attempt to perform an animation on any element that is triggered.\n * When setting the `classNameFilter` value, animations will only be performed on elements\n * that successfully match the filter expression. This in turn can boost performance\n * for low-powered devices as well as applications containing a lot of structural operations.\n * @param {RegExp=} expression The className expression which will be checked against all animations\n * @return {RegExp} The current CSS className expression value. If null then there is no expression value\n */\n this.classNameFilter = function(expression) {\n if (arguments.length === 1) {\n this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;\n if (this.$$classNameFilter) {\n var reservedRegex = new RegExp(\"(\\\\s+|\\\\/)\" + NG_ANIMATE_CLASSNAME + \"(\\\\s+|\\\\/)\");\n if (reservedRegex.test(this.$$classNameFilter.toString())) {\n throw $animateMinErr('nongcls','$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the \"{0}\" CSS class.', NG_ANIMATE_CLASSNAME);\n\n }\n }\n }\n return this.$$classNameFilter;\n };\n\n this.$get = ['$$animateQueue', function($$animateQueue) {\n function domInsert(element, parentElement, afterElement) {\n // if for some reason the previous element was removed\n // from the dom sometime before this code runs then let's\n // just stick to using the parent element as the anchor\n if (afterElement) {\n var afterNode = extractElementNode(afterElement);\n if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) {\n afterElement = null;\n }\n }\n afterElement ? afterElement.after(element) : parentElement.prepend(element);\n }\n\n /**\n * @ngdoc service\n * @name $animate\n * @description The $animate service exposes a series of DOM utility methods that provide support\n * for animation hooks. The default behavior is the application of DOM operations, however,\n * when an animation is detected (and animations are enabled), $animate will do the heavy lifting\n * to ensure that animation runs with the triggered DOM operation.\n *\n * By default $animate doesn't trigger any animations. This is because the `ngAnimate` module isn't\n * included and only when it is active then the animation hooks that `$animate` triggers will be\n * functional. Once active then all structural `ng-` directives will trigger animations as they perform\n * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`,\n * `ngShow`, `ngHide` and `ngMessages` also provide support for animations.\n *\n * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives.\n *\n * To learn more about enabling animation support, click here to visit the\n * {@link ngAnimate ngAnimate module page}.\n */\n return {\n // we don't call it directly since non-existant arguments may\n // be interpreted as null within the sub enabled function\n\n /**\n *\n * @ngdoc method\n * @name $animate#on\n * @kind function\n * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)\n * has fired on the given element or among any of its children. Once the listener is fired, the provided callback\n * is fired with the following params:\n *\n * ```js\n * $animate.on('enter', container,\n * function callback(element, phase) {\n * // cool we detected an enter animation within the container\n * }\n * );\n * ```\n *\n * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)\n * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself\n * as well as among its children\n * @param {Function} callback the callback function that will be fired when the listener is triggered\n *\n * The arguments present in the callback function are:\n * * `element` - The captured DOM element that the animation was fired on.\n * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).\n */\n on: $$animateQueue.on,\n\n /**\n *\n * @ngdoc method\n * @name $animate#off\n * @kind function\n * @description Deregisters an event listener based on the event which has been associated with the provided element. This method\n * can be used in three different ways depending on the arguments:\n *\n * ```js\n * // remove all the animation event listeners listening for `enter`\n * $animate.off('enter');\n *\n * // remove all the animation event listeners listening for `enter` on the given element and its children\n * $animate.off('enter', container);\n *\n * // remove the event listener function provided by `callback` that is set\n * // to listen for `enter` on the given `container` as well as its children\n * $animate.off('enter', container, callback);\n * ```\n *\n * @param {string} event the animation event (e.g. enter, leave, move, addClass, removeClass, etc...)\n * @param {DOMElement=} container the container element the event listener was placed on\n * @param {Function=} callback the callback function that was registered as the listener\n */\n off: $$animateQueue.off,\n\n /**\n * @ngdoc method\n * @name $animate#pin\n * @kind function\n * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists\n * outside of the DOM structure of the Angular application. By doing so, any animation triggered via `$animate` can be issued on the\n * element despite being outside the realm of the application or within another application. Say for example if the application\n * was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated\n * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind\n * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.\n *\n * Note that this feature is only active when the `ngAnimate` module is used.\n *\n * @param {DOMElement} element the external element that will be pinned\n * @param {DOMElement} parentElement the host parent element that will be associated with the external element\n */\n pin: $$animateQueue.pin,\n\n /**\n *\n * @ngdoc method\n * @name $animate#enabled\n * @kind function\n * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This\n * function can be called in four ways:\n *\n * ```js\n * // returns true or false\n * $animate.enabled();\n *\n * // changes the enabled state for all animations\n * $animate.enabled(false);\n * $animate.enabled(true);\n *\n * // returns true or false if animations are enabled for an element\n * $animate.enabled(element);\n *\n * // changes the enabled state for an element and its children\n * $animate.enabled(element, true);\n * $animate.enabled(element, false);\n * ```\n *\n * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state\n * @param {boolean=} enabled whether or not the animations will be enabled for the element\n *\n * @return {boolean} whether or not animations are enabled\n */\n enabled: $$animateQueue.enabled,\n\n /**\n * @ngdoc method\n * @name $animate#cancel\n * @kind function\n * @description Cancels the provided animation.\n *\n * @param {Promise} animationPromise The animation promise that is returned when an animation is started.\n */\n cancel: function(runner) {\n runner.end && runner.end();\n },\n\n /**\n *\n * @ngdoc method\n * @name $animate#enter\n * @kind function\n * @description Inserts the element into the DOM either after the `after` element (if provided) or\n * as the first child within the `parent` element and then triggers an animation.\n * A promise is returned that will be resolved during the next digest once the animation\n * has completed.\n *\n * @param {DOMElement} element the element which will be inserted into the DOM\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element\n *\n * @return {Promise} the animation callback promise\n */\n enter: function(element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options));\n },\n\n /**\n *\n * @ngdoc method\n * @name $animate#move\n * @kind function\n * @description Inserts (moves) the element into its new position in the DOM either after\n * the `after` element (if provided) or as the first child within the `parent` element\n * and then triggers an animation. A promise is returned that will be resolved\n * during the next digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be moved into the new DOM position\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element\n *\n * @return {Promise} the animation callback promise\n */\n move: function(element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'move', prepareAnimateOptions(options));\n },\n\n /**\n * @ngdoc method\n * @name $animate#leave\n * @kind function\n * @description Triggers an animation and then removes the element from the DOM.\n * When the function is called a promise is returned that will be resolved during the next\n * digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be removed from the DOM\n * @param {object=} options an optional collection of options/styles that will be applied to the element\n *\n * @return {Promise} the animation callback promise\n */\n leave: function(element, options) {\n return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() {\n element.remove();\n });\n },\n\n /**\n * @ngdoc method\n * @name $animate#addClass\n * @kind function\n *\n * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon\n * execution, the addClass operation will only be handled after the next digest and it will not trigger an\n * animation if element already contains the CSS class or if the class is removed at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element\n *\n * @return {Promise} the animation callback promise\n */\n addClass: function(element, className, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addclass, className);\n return $$animateQueue.push(element, 'addClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#removeClass\n * @kind function\n *\n * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon\n * execution, the removeClass operation will only be handled after the next digest and it will not trigger an\n * animation if element does not contain the CSS class or if the class is added at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element\n *\n * @return {Promise} the animation callback promise\n */\n removeClass: function(element, className, options) {\n options = prepareAnimateOptions(options);\n options.removeClass = mergeClasses(options.removeClass, className);\n return $$animateQueue.push(element, 'removeClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#setClass\n * @kind function\n *\n * @description Performs both the addition and removal of a CSS classes on an element and (during the process)\n * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and\n * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has\n * passed. Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element\n *\n * @return {Promise} the animation callback promise\n */\n setClass: function(element, add, remove, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addClass, add);\n options.removeClass = mergeClasses(options.removeClass, remove);\n return $$animateQueue.push(element, 'setClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#animate\n * @kind function\n *\n * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.\n * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take\n * on the provided styles. For example, if a transition animation is set for the given classNamem, then the provided `from` and\n * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding\n * style in `to`, the style in `from` is applied immediately, and no animation is run.\n * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`\n * method (or as part of the `options` parameter):\n *\n * ```js\n * ngModule.animation('.my-inline-animation', function() {\n * return {\n * animate : function(element, from, to, done, options) {\n * //animation\n * done();\n * }\n * }\n * });\n * ```\n *\n * @param {DOMElement} element the element which the CSS styles will be applied to\n * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.\n * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.\n * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If\n * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.\n * (Note that if no animation is detected then this value will not be applied to the element.)\n * @param {object=} options an optional collection of options/styles that will be applied to the element\n *\n * @return {Promise} the animation callback promise\n */\n animate: function(element, from, to, className, options) {\n options = prepareAnimateOptions(options);\n options.from = options.from ? extend(options.from, from) : from;\n options.to = options.to ? extend(options.to, to) : to;\n\n className = className || 'ng-inline-animate';\n options.tempClasses = mergeClasses(options.tempClasses, className);\n return $$animateQueue.push(element, 'animate', options);\n }\n };\n }];\n}];\n\nvar $$AnimateAsyncRunFactoryProvider = function() {\n this.$get = ['$$rAF', function($$rAF) {\n var waitQueue = [];\n\n function waitForTick(fn) {\n waitQueue.push(fn);\n if (waitQueue.length > 1) return;\n $$rAF(function() {\n for (var i = 0; i < waitQueue.length; i++) {\n waitQueue[i]();\n }\n waitQueue = [];\n });\n }\n\n return function() {\n var passed = false;\n waitForTick(function() {\n passed = true;\n });\n return function(callback) {\n passed ? callback() : waitForTick(callback);\n };\n };\n }];\n};\n\nvar $$AnimateRunnerFactoryProvider = function() {\n this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$document', '$timeout',\n function($q, $sniffer, $$animateAsyncRun, $document, $timeout) {\n\n var INITIAL_STATE = 0;\n var DONE_PENDING_STATE = 1;\n var DONE_COMPLETE_STATE = 2;\n\n AnimateRunner.chain = function(chain, callback) {\n var index = 0;\n\n next();\n function next() {\n if (index === chain.length) {\n callback(true);\n return;\n }\n\n chain[index](function(response) {\n if (response === false) {\n callback(false);\n return;\n }\n index++;\n next();\n });\n }\n };\n\n AnimateRunner.all = function(runners, callback) {\n var count = 0;\n var status = true;\n forEach(runners, function(runner) {\n runner.done(onProgress);\n });\n\n function onProgress(response) {\n status = status && response;\n if (++count === runners.length) {\n callback(status);\n }\n }\n };\n\n function AnimateRunner(host) {\n this.setHost(host);\n\n var rafTick = $$animateAsyncRun();\n var timeoutTick = function(fn) {\n $timeout(fn, 0, false);\n };\n\n this._doneCallbacks = [];\n this._tick = function(fn) {\n var doc = $document[0];\n\n // the document may not be ready or attached\n // to the module for some internal tests\n if (doc && doc.hidden) {\n timeoutTick(fn);\n } else {\n rafTick(fn);\n }\n };\n this._state = 0;\n }\n\n AnimateRunner.prototype = {\n setHost: function(host) {\n this.host = host || {};\n },\n\n done: function(fn) {\n if (this._state === DONE_COMPLETE_STATE) {\n fn();\n } else {\n this._doneCallbacks.push(fn);\n }\n },\n\n progress: noop,\n\n getPromise: function() {\n if (!this.promise) {\n var self = this;\n this.promise = $q(function(resolve, reject) {\n self.done(function(status) {\n status === false ? reject() : resolve();\n });\n });\n }\n return this.promise;\n },\n\n then: function(resolveHandler, rejectHandler) {\n return this.getPromise().then(resolveHandler, rejectHandler);\n },\n\n 'catch': function(handler) {\n return this.getPromise()['catch'](handler);\n },\n\n 'finally': function(handler) {\n return this.getPromise()['finally'](handler);\n },\n\n pause: function() {\n if (this.host.pause) {\n this.host.pause();\n }\n },\n\n resume: function() {\n if (this.host.resume) {\n this.host.resume();\n }\n },\n\n end: function() {\n if (this.host.end) {\n this.host.end();\n }\n this._resolve(true);\n },\n\n cancel: function() {\n if (this.host.cancel) {\n this.host.cancel();\n }\n this._resolve(false);\n },\n\n complete: function(response) {\n var self = this;\n if (self._state === INITIAL_STATE) {\n self._state = DONE_PENDING_STATE;\n self._tick(function() {\n self._resolve(response);\n });\n }\n },\n\n _resolve: function(response) {\n if (this._state !== DONE_COMPLETE_STATE) {\n forEach(this._doneCallbacks, function(fn) {\n fn(response);\n });\n this._doneCallbacks.length = 0;\n this._state = DONE_COMPLETE_STATE;\n }\n }\n };\n\n return AnimateRunner;\n }];\n};\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n *\n * @description\n * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,\n * then the `$animateCss` service will actually perform animations.\n *\n * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.\n */\nvar $CoreAnimateCssProvider = function() {\n this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) {\n\n return function(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = copy(options);\n }\n\n // there is no point in applying the styles since\n // there is no animation that goes on at all in\n // this version of $animateCss.\n if (options.cleanupStyles) {\n options.from = options.to = null;\n }\n\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n\n /* jshint newcap: false */\n var closed, runner = new $$AnimateRunner();\n return {\n start: run,\n end: run\n };\n\n function run() {\n $$rAF(function() {\n applyAnimationContents();\n if (!closed) {\n runner.complete();\n }\n closed = true;\n });\n return runner;\n }\n\n function applyAnimationContents() {\n if (options.addClass) {\n element.addClass(options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n element.removeClass(options.removeClass);\n options.removeClass = null;\n }\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n }\n };\n }];\n};\n\n/* global stripHash: true */\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $browser\n * @requires $log\n * @description\n * This object has two goals:\n *\n * - hide all the global state in the browser caused by the window object\n * - abstract away all the browser specific features and inconsistencies\n *\n * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`\n * service, which can be used for convenient testing of the application without the interaction with\n * the real browser apis.\n */\n/**\n * @param {object} window The global window object.\n * @param {object} document jQuery wrapped document.\n * @param {object} $log window.console or an object with the same interface.\n * @param {object} $sniffer $sniffer service\n */\nfunction Browser(window, document, $log, $sniffer) {\n var self = this,\n rawDocument = document[0],\n location = window.location,\n history = window.history,\n setTimeout = window.setTimeout,\n clearTimeout = window.clearTimeout,\n pendingDeferIds = {};\n\n self.isMock = false;\n\n var outstandingRequestCount = 0;\n var outstandingRequestCallbacks = [];\n\n // TODO(vojta): remove this temporary api\n self.$$completeOutstandingRequest = completeOutstandingRequest;\n self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };\n\n /**\n * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`\n * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.\n */\n function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while (outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }\n\n function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n }\n\n /**\n * @private\n * Note: this method is used only by scenario runner\n * TODO(vojta): prefix this method with $$ ?\n * @param {function()} callback Function that will be called when no outstanding request\n */\n self.notifyWhenNoOutstandingRequests = function(callback) {\n if (outstandingRequestCount === 0) {\n callback();\n } else {\n outstandingRequestCallbacks.push(callback);\n }\n };\n\n //////////////////////////////////////////////////////////////\n // URL API\n //////////////////////////////////////////////////////////////\n\n var cachedState, lastHistoryState,\n lastBrowserUrl = location.href,\n baseElement = document.find('base'),\n pendingLocation = null;\n\n cacheState();\n lastHistoryState = cachedState;\n\n /**\n * @name $browser#url\n *\n * @description\n * GETTER:\n * Without any argument, this method just returns current value of location.href.\n *\n * SETTER:\n * With at least one argument, this method sets url to new value.\n * If html5 history api supported, pushState/replaceState is used, otherwise\n * location.href/location.replace is used.\n * Returns its own instance to allow chaining\n *\n * NOTE: this api is intended for use only by the $location service. Please use the\n * {@link ng.$location $location service} to change url.\n *\n * @param {string} url New url (when used as setter)\n * @param {boolean=} replace Should new url replace current history record?\n * @param {object=} state object to use with pushState/replaceState\n */\n self.url = function(url, replace, state) {\n // In modern browsers `history.state` is `null` by default; treating it separately\n // from `undefined` would cause `$browser.url('/foo')` to change `history.state`\n // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.\n if (isUndefined(state)) {\n state = null;\n }\n\n // Android Browser BFCache causes location, history reference to become stale.\n if (location !== window.location) location = window.location;\n if (history !== window.history) history = window.history;\n\n // setter\n if (url) {\n var sameState = lastHistoryState === state;\n\n // Don't change anything if previous and current URLs and states match. This also prevents\n // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.\n // See https://github.com/angular/angular.js/commit/ffb2701\n if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {\n return self;\n }\n var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);\n lastBrowserUrl = url;\n lastHistoryState = state;\n // Don't use history API if only the hash changed\n // due to a bug in IE10/IE11 which leads\n // to not firing a `hashchange` nor `popstate` event\n // in some cases (see #9143).\n if ($sniffer.history && (!sameBase || !sameState)) {\n history[replace ? 'replaceState' : 'pushState'](state, '', url);\n cacheState();\n // Do the assignment again so that those two variables are referentially identical.\n lastHistoryState = cachedState;\n } else {\n if (!sameBase || pendingLocation) {\n pendingLocation = url;\n }\n if (replace) {\n location.replace(url);\n } else if (!sameBase) {\n location.href = url;\n } else {\n location.hash = getHash(url);\n }\n if (location.href !== url) {\n pendingLocation = url;\n }\n }\n return self;\n // getter\n } else {\n // - pendingLocation is needed as browsers don't allow to read out\n // the new location.href if a reload happened or if there is a bug like in iOS 9 (see\n // https://openradar.appspot.com/22186109).\n // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172\n return pendingLocation || location.href.replace(/%27/g,\"'\");\n }\n };\n\n /**\n * @name $browser#state\n *\n * @description\n * This method is a getter.\n *\n * Return history.state or null if history.state is undefined.\n *\n * @returns {object} state\n */\n self.state = function() {\n return cachedState;\n };\n\n var urlChangeListeners = [],\n urlChangeInit = false;\n\n function cacheStateAndFireUrlChange() {\n pendingLocation = null;\n cacheState();\n fireUrlChange();\n }\n\n function getCurrentState() {\n try {\n return history.state;\n } catch (e) {\n // MSIE can reportedly throw when there is no state (UNCONFIRMED).\n }\n }\n\n // This variable should be used *only* inside the cacheState function.\n var lastCachedState = null;\n function cacheState() {\n // This should be the only place in $browser where `history.state` is read.\n cachedState = getCurrentState();\n cachedState = isUndefined(cachedState) ? null : cachedState;\n\n // Prevent callbacks fo fire twice if both hashchange & popstate were fired.\n if (equals(cachedState, lastCachedState)) {\n cachedState = lastCachedState;\n }\n lastCachedState = cachedState;\n }\n\n function fireUrlChange() {\n if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {\n return;\n }\n\n lastBrowserUrl = self.url();\n lastHistoryState = cachedState;\n forEach(urlChangeListeners, function(listener) {\n listener(self.url(), cachedState);\n });\n }\n\n /**\n * @name $browser#onUrlChange\n *\n * @description\n * Register callback function that will be called, when url changes.\n *\n * It's only called when the url is changed from outside of angular:\n * - user types different url into address bar\n * - user clicks on history (forward/back) button\n * - user clicks on a link\n *\n * It's not called when url is changed by $browser.url() method\n *\n * The listener gets called with new url as parameter.\n *\n * NOTE: this api is intended for use only by the $location service. Please use the\n * {@link ng.$location $location service} to monitor url changes in angular apps.\n *\n * @param {function(string)} listener Listener function to be called when url changes.\n * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.\n */\n self.onUrlChange = function(callback) {\n // TODO(vojta): refactor to use node's syntax for events\n if (!urlChangeInit) {\n // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)\n // don't fire popstate when user change the address bar and don't fire hashchange when url\n // changed by push/replaceState\n\n // html5 history api - popstate event\n if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);\n // hashchange event\n jqLite(window).on('hashchange', cacheStateAndFireUrlChange);\n\n urlChangeInit = true;\n }\n\n urlChangeListeners.push(callback);\n return callback;\n };\n\n /**\n * @private\n * Remove popstate and hashchange handler from window.\n *\n * NOTE: this api is intended for use only by $rootScope.\n */\n self.$$applicationDestroyed = function() {\n jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange);\n };\n\n /**\n * Checks whether the url has changed outside of Angular.\n * Needs to be exported to be able to check for changes that have been done in sync,\n * as hashchange/popstate events fire in async.\n */\n self.$$checkUrlChange = fireUrlChange;\n\n //////////////////////////////////////////////////////////////\n // Misc API\n //////////////////////////////////////////////////////////////\n\n /**\n * @name $browser#baseHref\n *\n * @description\n * Returns current <base href>\n * (always relative - without domain)\n *\n * @returns {string} The current base href\n */\n self.baseHref = function() {\n var href = baseElement.attr('href');\n return href ? href.replace(/^(https?\\:)?\\/\\/[^\\/]*/, '') : '';\n };\n\n /**\n * @name $browser#defer\n * @param {function()} fn A function, who's execution should be deferred.\n * @param {number=} [delay=0] of milliseconds to defer the function execution.\n * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.\n *\n * @description\n * Executes a fn asynchronously via `setTimeout(fn, delay)`.\n *\n * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using\n * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed\n * via `$browser.defer.flush()`.\n *\n */\n self.defer = function(fn, delay) {\n var timeoutId;\n outstandingRequestCount++;\n timeoutId = setTimeout(function() {\n delete pendingDeferIds[timeoutId];\n completeOutstandingRequest(fn);\n }, delay || 0);\n pendingDeferIds[timeoutId] = true;\n return timeoutId;\n };\n\n\n /**\n * @name $browser#defer.cancel\n *\n * @description\n * Cancels a deferred task identified with `deferId`.\n *\n * @param {*} deferId Token returned by the `$browser.defer` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n self.defer.cancel = function(deferId) {\n if (pendingDeferIds[deferId]) {\n delete pendingDeferIds[deferId];\n clearTimeout(deferId);\n completeOutstandingRequest(noop);\n return true;\n }\n return false;\n };\n\n}\n\nfunction $BrowserProvider() {\n this.$get = ['$window', '$log', '$sniffer', '$document',\n function($window, $log, $sniffer, $document) {\n return new Browser($window, $document, $log, $sniffer);\n }];\n}\n\n/**\n * @ngdoc service\n * @name $cacheFactory\n *\n * @description\n * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to\n * them.\n *\n * ```js\n *\n * var cache = $cacheFactory('cacheId');\n * expect($cacheFactory.get('cacheId')).toBe(cache);\n * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();\n *\n * cache.put(\"key\", \"value\");\n * cache.put(\"another key\", \"another value\");\n *\n * // We've specified no options on creation\n * expect(cache.info()).toEqual({id: 'cacheId', size: 2});\n *\n * ```\n *\n *\n * @param {string} cacheId Name or id of the newly created cache.\n * @param {object=} options Options object that specifies the cache behavior. Properties:\n *\n * - `{number=}` `capacity` — turns the cache into LRU cache.\n *\n * @returns {object} Newly created cache object with the following set of methods:\n *\n * - `{object}` `info()` — Returns id, size, and options of cache.\n * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns\n * it.\n * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.\n * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.\n * - `{void}` `removeAll()` — Removes all cached values.\n * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.\n *\n * @example\n <example module=\"cacheExampleApp\">\n <file name=\"index.html\">\n <div ng-controller=\"CacheController\">\n <input ng-model=\"newCacheKey\" placeholder=\"Key\">\n <input ng-model=\"newCacheValue\" placeholder=\"Value\">\n <button ng-click=\"put(newCacheKey, newCacheValue)\">Cache</button>\n\n <p ng-if=\"keys.length\">Cached Values</p>\n <div ng-repeat=\"key in keys\">\n <span ng-bind=\"key\"></span>\n <span>: </span>\n <b ng-bind=\"cache.get(key)\"></b>\n </div>\n\n <p>Cache Info</p>\n <div ng-repeat=\"(key, value) in cache.info()\">\n <span ng-bind=\"key\"></span>\n <span>: </span>\n <b ng-bind=\"value\"></b>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('cacheExampleApp', []).\n controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {\n $scope.keys = [];\n $scope.cache = $cacheFactory('cacheId');\n $scope.put = function(key, value) {\n if (angular.isUndefined($scope.cache.get(key))) {\n $scope.keys.push(key);\n }\n $scope.cache.put(key, angular.isUndefined(value) ? null : value);\n };\n }]);\n </file>\n <file name=\"style.css\">\n p {\n margin: 10px 0 3px;\n }\n </file>\n </example>\n */\nfunction $CacheFactoryProvider() {\n\n this.$get = function() {\n var caches = {};\n\n function cacheFactory(cacheId, options) {\n if (cacheId in caches) {\n throw minErr('$cacheFactory')('iid', \"CacheId '{0}' is already taken!\", cacheId);\n }\n\n var size = 0,\n stats = extend({}, options, {id: cacheId}),\n data = createMap(),\n capacity = (options && options.capacity) || Number.MAX_VALUE,\n lruHash = createMap(),\n freshEnd = null,\n staleEnd = null;\n\n /**\n * @ngdoc type\n * @name $cacheFactory.Cache\n *\n * @description\n * A cache object used to store and retrieve data, primarily used by\n * {@link $http $http} and the {@link ng.directive:script script} directive to cache\n * templates and other data.\n *\n * ```js\n * angular.module('superCache')\n * .factory('superCache', ['$cacheFactory', function($cacheFactory) {\n * return $cacheFactory('super-cache');\n * }]);\n * ```\n *\n * Example test:\n *\n * ```js\n * it('should behave like a cache', inject(function(superCache) {\n * superCache.put('key', 'value');\n * superCache.put('another key', 'another value');\n *\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 2\n * });\n *\n * superCache.remove('another key');\n * expect(superCache.get('another key')).toBeUndefined();\n *\n * superCache.removeAll();\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 0\n * });\n * }));\n * ```\n */\n return caches[cacheId] = {\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#put\n * @kind function\n *\n * @description\n * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be\n * retrieved later, and incrementing the size of the cache if the key was not already\n * present in the cache. If behaving like an LRU cache, it will also remove stale\n * entries from the set.\n *\n * It will not insert undefined values into the cache.\n *\n * @param {string} key the key under which the cached data is stored.\n * @param {*} value the value to store alongside the key. If it is undefined, the key\n * will not be stored.\n * @returns {*} the value stored.\n */\n put: function(key, value) {\n if (isUndefined(value)) return;\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key] || (lruHash[key] = {key: key});\n\n refresh(lruEntry);\n }\n\n if (!(key in data)) size++;\n data[key] = value;\n\n if (size > capacity) {\n this.remove(staleEnd.key);\n }\n\n return value;\n },\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#get\n * @kind function\n *\n * @description\n * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the data to be retrieved\n * @returns {*} the value stored.\n */\n get: function(key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n refresh(lruEntry);\n }\n\n return data[key];\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#remove\n * @kind function\n *\n * @description\n * Removes an entry from the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the entry to be removed\n */\n remove: function(key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n if (lruEntry == freshEnd) freshEnd = lruEntry.p;\n if (lruEntry == staleEnd) staleEnd = lruEntry.n;\n link(lruEntry.n,lruEntry.p);\n\n delete lruHash[key];\n }\n\n if (!(key in data)) return;\n\n delete data[key];\n size--;\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#removeAll\n * @kind function\n *\n * @description\n * Clears the cache object of any entries.\n */\n removeAll: function() {\n data = createMap();\n size = 0;\n lruHash = createMap();\n freshEnd = staleEnd = null;\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#destroy\n * @kind function\n *\n * @description\n * Destroys the {@link $cacheFactory.Cache Cache} object entirely,\n * removing it from the {@link $cacheFactory $cacheFactory} set.\n */\n destroy: function() {\n data = null;\n stats = null;\n lruHash = null;\n delete caches[cacheId];\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#info\n * @kind function\n *\n * @description\n * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.\n *\n * @returns {object} an object with the following properties:\n * <ul>\n * <li>**id**: the id of the cache instance</li>\n * <li>**size**: the number of entries kept in the cache instance</li>\n * <li>**...**: any additional properties from the options object when creating the\n * cache.</li>\n * </ul>\n */\n info: function() {\n return extend({}, stats, {size: size});\n }\n };\n\n\n /**\n * makes the `entry` the freshEnd of the LRU linked list\n */\n function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }\n\n\n /**\n * bidirectionally links two entries of the LRU linked list\n */\n function link(nextEntry, prevEntry) {\n if (nextEntry != prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory#info\n *\n * @description\n * Get information about all the caches that have been created\n *\n * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`\n */\n cacheFactory.info = function() {\n var info = {};\n forEach(caches, function(cache, cacheId) {\n info[cacheId] = cache.info();\n });\n return info;\n };\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory#get\n *\n * @description\n * Get access to a cache object by the `cacheId` used when it was created.\n *\n * @param {string} cacheId Name or id of a cache to access.\n * @returns {object} Cache object identified by the cacheId or undefined if no such cache.\n */\n cacheFactory.get = function(cacheId) {\n return caches[cacheId];\n };\n\n\n return cacheFactory;\n };\n}\n\n/**\n * @ngdoc service\n * @name $templateCache\n *\n * @description\n * The first time a template is used, it is loaded in the template cache for quick retrieval. You\n * can load templates directly into the cache in a `script` tag, or by consuming the\n * `$templateCache` service directly.\n *\n * Adding via the `script` tag:\n *\n * ```html\n * <script type=\"text/ng-template\" id=\"templateId.html\">\n * <p>This is the content of the template</p>\n * </script>\n * ```\n *\n * **Note:** the `script` tag containing the template does not need to be included in the `head` of\n * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,\n * element with ng-app attribute), otherwise the template will be ignored.\n *\n * Adding via the `$templateCache` service:\n *\n * ```js\n * var myApp = angular.module('myApp', []);\n * myApp.run(function($templateCache) {\n * $templateCache.put('templateId.html', 'This is the content of the template');\n * });\n * ```\n *\n * To retrieve the template later, simply use it in your HTML:\n * ```html\n * <div ng-include=\" 'templateId.html' \"></div>\n * ```\n *\n * or get it via Javascript:\n * ```js\n * $templateCache.get('templateId.html')\n * ```\n *\n * See {@link ng.$cacheFactory $cacheFactory}.\n *\n */\nfunction $TemplateCacheProvider() {\n this.$get = ['$cacheFactory', function($cacheFactory) {\n return $cacheFactory('templates');\n }];\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!\n *\n * DOM-related variables:\n *\n * - \"node\" - DOM Node\n * - \"element\" - DOM Element or Node\n * - \"$node\" or \"$element\" - jqLite-wrapped node or element\n *\n *\n * Compiler related stuff:\n *\n * - \"linkFn\" - linking fn of a single directive\n * - \"nodeLinkFn\" - function that aggregates all linking fns for a particular node\n * - \"childLinkFn\" - function that aggregates all linking fns for child nodes of a particular node\n * - \"compositeLinkFn\" - function that aggregates all linking fns for a compilation root (nodeList)\n */\n\n\n/**\n * @ngdoc service\n * @name $compile\n * @kind function\n *\n * @description\n * Compiles an HTML string or DOM into a template and produces a template function, which\n * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.\n *\n * The compilation is a process of walking the DOM tree and matching DOM elements to\n * {@link ng.$compileProvider#directive directives}.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** This document is an in-depth reference of all directive options.\n * For a gentle introduction to directives with examples of common use cases,\n * see the {@link guide/directive directive guide}.\n * </div>\n *\n * ## Comprehensive Directive API\n *\n * There are many different options for a directive.\n *\n * The difference resides in the return value of the factory function.\n * You can either return a \"Directive Definition Object\" (see below) that defines the directive properties,\n * or just the `postLink` function (all other properties will have the default values).\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:** It's recommended to use the \"directive definition object\" form.\n * </div>\n *\n * Here's an example directive declared with a Directive Definition Object:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * priority: 0,\n * template: '<div></div>', // or // function(tElement, tAttrs) { ... },\n * // or\n * // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },\n * transclude: false,\n * restrict: 'A',\n * templateNamespace: 'html',\n * scope: false,\n * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },\n * controllerAs: 'stringIdentifier',\n * bindToController: false,\n * require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],\n * compile: function compile(tElement, tAttrs, transclude) {\n * return {\n * pre: function preLink(scope, iElement, iAttrs, controller) { ... },\n * post: function postLink(scope, iElement, iAttrs, controller) { ... }\n * }\n * // or\n * // return function postLink( ... ) { ... }\n * },\n * // or\n * // link: {\n * // pre: function preLink(scope, iElement, iAttrs, controller) { ... },\n * // post: function postLink(scope, iElement, iAttrs, controller) { ... }\n * // }\n * // or\n * // link: function postLink( ... ) { ... }\n * };\n * return directiveDefinitionObject;\n * });\n * ```\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Any unspecified options will use the default value. You can see the default values below.\n * </div>\n *\n * Therefore the above can be simplified as:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * link: function postLink(scope, iElement, iAttrs) { ... }\n * };\n * return directiveDefinitionObject;\n * // or\n * // return function postLink(scope, iElement, iAttrs) { ... }\n * });\n * ```\n *\n *\n *\n * ### Directive Definition Object\n *\n * The directive definition object provides instructions to the {@link ng.$compile\n * compiler}. The attributes are:\n *\n * #### `multiElement`\n * When this property is set to true, the HTML compiler will collect DOM nodes between\n * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them\n * together as the directive elements. It is recommended that this feature be used on directives\n * which are not strictly behavioral (such as {@link ngClick}), and which\n * do not manipulate or replace child nodes (such as {@link ngInclude}).\n *\n * #### `priority`\n * When there are multiple directives defined on a single DOM element, sometimes it\n * is necessary to specify the order in which the directives are applied. The `priority` is used\n * to sort the directives before their `compile` functions get called. Priority is defined as a\n * number. Directives with greater numerical `priority` are compiled first. Pre-link functions\n * are also run in priority order, but post-link functions are run in reverse order. The order\n * of directives with the same priority is undefined. The default priority is `0`.\n *\n * #### `terminal`\n * If set to true then the current `priority` will be the last set of directives\n * which will execute (any directives at the current priority will still execute\n * as the order of execution on same `priority` is undefined). Note that expressions\n * and other directives used in the directive's template will also be excluded from execution.\n *\n * #### `scope`\n * The scope property can be `true`, an object or a falsy value:\n *\n * * **falsy:** No scope will be created for the directive. The directive will use its parent's scope.\n *\n * * **`true`:** A new child scope that prototypically inherits from its parent will be created for\n * the directive's element. If multiple directives on the same element request a new scope,\n * only one new scope is created. The new scope rule does not apply for the root of the template\n * since the root of the template always gets a new scope.\n *\n * * **`{...}` (an object hash):** A new \"isolate\" scope is created for the directive's element. The\n * 'isolate' scope differs from normal scope in that it does not prototypically inherit from its parent\n * scope. This is useful when creating reusable components, which should not accidentally read or modify\n * data in the parent scope.\n *\n * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the\n * directive's element. These local properties are useful for aliasing values for templates. The keys in\n * the object hash map to the name of the property on the isolate scope; the values define how the property\n * is bound to the parent scope, via matching attributes on the directive's element:\n *\n * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is\n * always a string since DOM attributes are strings. If no `attr` name is specified then the\n * attribute name is assumed to be the same as the local name. Given `<my-component\n * my-attr=\"hello {{name}}\">` and the isolate scope definition `scope: { localName:'@myAttr' }`,\n * the directive's scope property `localName` will reflect the interpolated value of `hello\n * {{name}}`. As the `name` attribute changes so will the `localName` property on the directive's\n * scope. The `name` is read from the parent scope (not the directive's scope).\n *\n * * `=` or `=attr` - set up a bidirectional binding between a local scope property and an expression\n * passed via the attribute `attr`. The expression is evaluated in the context of the parent scope.\n * If no `attr` name is specified then the attribute name is assumed to be the same as the local\n * name. Given `<my-component my-attr=\"parentModel\">` and the isolate scope definition `scope: {\n * localModel: '=myAttr' }`, the property `localModel` on the directive's scope will reflect the\n * value of `parentModel` on the parent scope. Changes to `parentModel` will be reflected in\n * `localModel` and vice versa. Optional attributes should be marked as such with a question mark:\n * `=?` or `=?attr`. If the binding expression is non-assignable, or if the attribute isn't\n * optional and doesn't exist, an exception ({@link error/$compile/nonassign `$compile:nonassign`})\n * will be thrown upon discovering changes to the local value, since it will be impossible to sync\n * them back to the parent scope. By default, the {@link ng.$rootScope.Scope#$watch `$watch`}\n * method is used for tracking changes, and the equality check is based on object identity.\n * However, if an object literal or an array literal is passed as the binding expression, the\n * equality check is done by value (using the {@link angular.equals} function). It's also possible\n * to watch the evaluated value shallowly with {@link ng.$rootScope.Scope#$watchCollection\n * `$watchCollection`}: use `=*` or `=*attr` (`=*?` or `=*?attr` if the attribute is optional).\n *\n * * `<` or `<attr` - set up a one-way (one-directional) binding between a local scope property and an\n * expression passed via the attribute `attr`. The expression is evaluated in the context of the\n * parent scope. If no `attr` name is specified then the attribute name is assumed to be the same as the\n * local name. You can also make the binding optional by adding `?`: `<?` or `<?attr`.\n *\n * For example, given `<my-component my-attr=\"parentModel\">` and directive definition of\n * `scope: { localModel:'<myAttr' }`, then the isolated scope property `localModel` will reflect the\n * value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected\n * in `localModel`, but changes in `localModel` will not reflect in `parentModel`. There are however\n * two caveats:\n * 1. one-way binding does not copy the value from the parent to the isolate scope, it simply\n * sets the same value. That means if your bound value is an object, changes to its properties\n * in the isolated scope will be reflected in the parent scope (because both reference the same object).\n * 2. one-way binding watches changes to the **identity** of the parent value. That means the\n * {@link ng.$rootScope.Scope#$watch `$watch`} on the parent value only fires if the reference\n * to the value has changed. In most cases, this should not be of concern, but can be important\n * to know if you one-way bind to an object, and then replace that object in the isolated scope.\n * If you now change a property of the object in your parent scope, the change will not be\n * propagated to the isolated scope, because the identity of the object on the parent scope\n * has not changed. Instead you must assign a new object.\n *\n * One-way binding is useful if you do not plan to propagate changes to your isolated scope bindings\n * back to the parent. However, it does not make this completely impossible.\n *\n * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. If\n * no `attr` name is specified then the attribute name is assumed to be the same as the local name.\n * Given `<my-component my-attr=\"count = count + value\">` and the isolate scope definition `scope: {\n * localFn:'&myAttr' }`, the isolate scope property `localFn` will point to a function wrapper for\n * the `count = count + value` expression. Often it's desirable to pass data from the isolated scope\n * via an expression to the parent scope. This can be done by passing a map of local variable names\n * and values into the expression wrapper fn. For example, if the expression is `increment(amount)`\n * then we can specify the amount value by calling the `localFn` as `localFn({amount: 22})`.\n *\n * In general it's possible to apply more than one directive to one element, but there might be limitations\n * depending on the type of scope required by the directives. The following points will help explain these limitations.\n * For simplicity only two directives are taken into account, but it is also applicable for several directives:\n *\n * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope\n * * **child scope** + **no scope** => Both directives will share one single child scope\n * * **child scope** + **child scope** => Both directives will share one single child scope\n * * **isolated scope** + **no scope** => The isolated directive will use it's own created isolated scope. The other directive will use\n * its parent's scope\n * * **isolated scope** + **child scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives cannot\n * be applied to the same element.\n * * **isolated scope** + **isolated scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives\n * cannot be applied to the same element.\n *\n *\n * #### `bindToController`\n * This property is used to bind scope properties directly to the controller. It can be either\n * `true` or an object hash with the same format as the `scope` property. Additionally, a controller\n * alias must be set, either by using `controllerAs: 'myAlias'` or by specifying the alias in the controller\n * definition: `controller: 'myCtrl as myAlias'`.\n *\n * When an isolate scope is used for a directive (see above), `bindToController: true` will\n * allow a component to have its properties bound to the controller, rather than to scope.\n *\n * After the controller is instantiated, the initial values of the isolate scope bindings will be bound to the controller\n * properties. You can access these bindings once they have been initialized by providing a controller method called\n * `$onInit`, which is called after all the controllers on an element have been constructed and had their bindings\n * initialized.\n *\n * <div class=\"alert alert-warning\">\n * **Deprecation warning:** although bindings for non-ES6 class controllers are currently\n * bound to `this` before the controller constructor is called, this use is now deprecated. Please place initialization\n * code that relies upon bindings inside a `$onInit` method on the controller, instead.\n * </div>\n *\n * It is also possible to set `bindToController` to an object hash with the same format as the `scope` property.\n * This will set up the scope bindings to the controller directly. Note that `scope` can still be used\n * to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate\n * scope (useful for component directives).\n *\n * If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`.\n *\n *\n * #### `controller`\n * Controller constructor function. The controller is instantiated before the\n * pre-linking phase and can be accessed by other directives (see\n * `require` attribute). This allows the directives to communicate with each other and augment\n * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:\n *\n * * `$scope` - Current scope associated with the element\n * * `$element` - Current element\n * * `$attrs` - Current attributes object for the element\n * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:\n * `function([scope], cloneLinkingFn, futureParentElement, slotName)`:\n * * `scope`: (optional) override the scope.\n * * `cloneLinkingFn`: (optional) argument to create clones of the original transcluded content.\n * * `futureParentElement` (optional):\n * * defines the parent to which the `cloneLinkingFn` will add the cloned elements.\n * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.\n * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)\n * and when the `cloneLinkinFn` is passed,\n * as those elements need to created and cloned in a special way when they are defined outside their\n * usual containers (e.g. like `<svg>`).\n * * See also the `directive.templateNamespace` property.\n * * `slotName`: (optional) the name of the slot to transclude. If falsy (e.g. `null`, `undefined` or `''`)\n * then the default translusion is provided.\n * The `$transclude` function also has a method on it, `$transclude.isSlotFilled(slotName)`, which returns\n * `true` if the specified slot contains content (i.e. one or more DOM nodes).\n *\n * The controller can provide the following methods that act as life-cycle hooks:\n * * `$onInit` - Called on each controller after all the controllers on an element have been constructed and\n * had their bindings initialized (and before the pre & post linking functions for the directives on\n * this element). This is a good place to put initialization code for your controller.\n *\n * #### `require`\n * Require another directive and inject its controller as the fourth argument to the linking function. The\n * `require` property can be a string, an array or an object:\n * * a **string** containing the name of the directive to pass to the linking function\n * * an **array** containing the names of directives to pass to the linking function. The argument passed to the\n * linking function will be an array of controllers in the same order as the names in the `require` property\n * * an **object** whose property values are the names of the directives to pass to the linking function. The argument\n * passed to the linking function will also be an object with matching keys, whose values will hold the corresponding\n * controllers.\n *\n * If the `require` property is an object and `bindToController` is truthy, then the required controllers are\n * bound to the controller using the keys of the `require` property. This binding occurs after all the controllers\n * have been constructed but before `$onInit` is called.\n * See the {@link $compileProvider#component} helper for an example of how this can be used.\n *\n * If no such required directive(s) can be found, or if the directive does not have a controller, then an error is\n * raised (unless no link function is specified and the required controllers are not being bound to the directive\n * controller, in which case error checking is skipped). The name can be prefixed with:\n *\n * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.\n * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.\n * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.\n * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.\n * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass\n * `null` to the `link` fn if not found.\n * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass\n * `null` to the `link` fn if not found.\n *\n *\n * #### `controllerAs`\n * Identifier name for a reference to the controller in the directive's scope.\n * This allows the controller to be referenced from the directive template. This is especially\n * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible\n * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the\n * `controllerAs` reference might overwrite a property that already exists on the parent scope.\n *\n *\n * #### `restrict`\n * String of subset of `EACM` which restricts the directive to a specific directive\n * declaration style. If omitted, the defaults (elements and attributes) are used.\n *\n * * `E` - Element name (default): `<my-directive></my-directive>`\n * * `A` - Attribute (default): `<div my-directive=\"exp\"></div>`\n * * `C` - Class: `<div class=\"my-directive: exp;\"></div>`\n * * `M` - Comment: `<!-- directive: my-directive exp -->`\n *\n *\n * #### `templateNamespace`\n * String representing the document type used by the markup in the template.\n * AngularJS needs this information as those elements need to be created and cloned\n * in a special way when they are defined outside their usual containers like `<svg>` and `<math>`.\n *\n * * `html` - All root nodes in the template are HTML. Root nodes may also be\n * top-level elements such as `<svg>` or `<math>`.\n * * `svg` - The root nodes in the template are SVG elements (excluding `<math>`).\n * * `math` - The root nodes in the template are MathML elements (excluding `<svg>`).\n *\n * If no `templateNamespace` is specified, then the namespace is considered to be `html`.\n *\n * #### `template`\n * HTML markup that may:\n * * Replace the contents of the directive's element (default).\n * * Replace the directive's element itself (if `replace` is true - DEPRECATED).\n * * Wrap the contents of the directive's element (if `transclude` is true).\n *\n * Value may be:\n *\n * * A string. For example `<div red-on-hover>{{delete_str}}</div>`.\n * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`\n * function api below) and returns a string value.\n *\n *\n * #### `templateUrl`\n * This is similar to `template` but the template is loaded from the specified URL, asynchronously.\n *\n * Because template loading is asynchronous the compiler will suspend compilation of directives on that element\n * for later when the template has been resolved. In the meantime it will continue to compile and link\n * sibling and parent elements as though this element had not contained any directives.\n *\n * The compiler does not suspend the entire compilation to wait for templates to be loaded because this\n * would result in the whole app \"stalling\" until all templates are loaded asynchronously - even in the\n * case when only one deeply nested directive has `templateUrl`.\n *\n * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}\n *\n * You can specify `templateUrl` as a string representing the URL or as a function which takes two\n * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns\n * a string value representing the url. In either case, the template URL is passed through {@link\n * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.\n *\n *\n * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0)\n * specify what the template should replace. Defaults to `false`.\n *\n * * `true` - the template will replace the directive's element.\n * * `false` - the template will replace the contents of the directive's element.\n *\n * The replacement process migrates all of the attributes / classes from the old element to the new\n * one. See the {@link guide/directive#template-expanding-directive\n * Directives Guide} for an example.\n *\n * There are very few scenarios where element replacement is required for the application function,\n * the main one being reusable custom components that are used within SVG contexts\n * (because SVG doesn't work with custom elements in the DOM tree).\n *\n * #### `transclude`\n * Extract the contents of the element where the directive appears and make it available to the directive.\n * The contents are compiled and provided to the directive as a **transclusion function**. See the\n * {@link $compile#transclusion Transclusion} section below.\n *\n *\n * #### `compile`\n *\n * ```js\n * function compile(tElement, tAttrs, transclude) { ... }\n * ```\n *\n * The compile function deals with transforming the template DOM. Since most directives do not do\n * template transformation, it is not used often. The compile function takes the following arguments:\n *\n * * `tElement` - template element - The element where the directive has been declared. It is\n * safe to do template transformation on the element and child elements only.\n *\n * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared\n * between all directive compile functions.\n *\n * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`\n *\n * <div class=\"alert alert-warning\">\n * **Note:** The template instance and the link instance may be different objects if the template has\n * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that\n * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration\n * should be done in a linking function rather than in a compile function.\n * </div>\n\n * <div class=\"alert alert-warning\">\n * **Note:** The compile function cannot handle directives that recursively use themselves in their\n * own templates or compile functions. Compiling these directives results in an infinite loop and\n * stack overflow errors.\n *\n * This can be avoided by manually using $compile in the postLink function to imperatively compile\n * a directive's template instead of relying on automatic template compilation via `template` or\n * `templateUrl` declaration or manual compilation inside the compile function.\n * </div>\n *\n * <div class=\"alert alert-danger\">\n * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it\n * e.g. does not know about the right outer scope. Please use the transclude function that is passed\n * to the link function instead.\n * </div>\n\n * A compile function can have a return value which can be either a function or an object.\n *\n * * returning a (post-link) function - is equivalent to registering the linking function via the\n * `link` property of the config object when the compile function is empty.\n *\n * * returning an object with function(s) registered via `pre` and `post` properties - allows you to\n * control when a linking function should be called during the linking phase. See info about\n * pre-linking and post-linking functions below.\n *\n *\n * #### `link`\n * This property is used only if the `compile` property is not defined.\n *\n * ```js\n * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }\n * ```\n *\n * The link function is responsible for registering DOM listeners as well as updating the DOM. It is\n * executed after the template has been cloned. This is where most of the directive logic will be\n * put.\n *\n * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the\n * directive for registering {@link ng.$rootScope.Scope#$watch watches}.\n *\n * * `iElement` - instance element - The element where the directive is to be used. It is safe to\n * manipulate the children of the element only in `postLink` function since the children have\n * already been linked.\n *\n * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared\n * between all directive linking functions.\n *\n * * `controller` - the directive's required controller instance(s) - Instances are shared\n * among all directives, which allows the directives to use the controllers as a communication\n * channel. The exact value depends on the directive's `require` property:\n * * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one\n * * `string`: the controller instance\n * * `array`: array of controller instances\n *\n * If a required controller cannot be found, and it is optional, the instance is `null`,\n * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown.\n *\n * Note that you can also require the directive's own controller - it will be made available like\n * any other controller.\n *\n * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.\n * This is the same as the `$transclude`\n * parameter of directive controllers, see there for details.\n * `function([scope], cloneLinkingFn, futureParentElement)`.\n *\n * #### Pre-linking function\n *\n * Executed before the child elements are linked. Not safe to do DOM transformation since the\n * compiler linking function will fail to locate the correct elements for linking.\n *\n * #### Post-linking function\n *\n * Executed after the child elements are linked.\n *\n * Note that child elements that contain `templateUrl` directives will not have been compiled\n * and linked since they are waiting for their template to load asynchronously and their own\n * compilation and linking has been suspended until that occurs.\n *\n * It is safe to do DOM transformation in the post-linking function on elements that are not waiting\n * for their async templates to be resolved.\n *\n *\n * ### Transclusion\n *\n * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and\n * copying them to another part of the DOM, while maintaining their connection to the original AngularJS\n * scope from where they were taken.\n *\n * Transclusion is used (often with {@link ngTransclude}) to insert the\n * original contents of a directive's element into a specified place in the template of the directive.\n * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded\n * content has access to the properties on the scope from which it was taken, even if the directive\n * has isolated scope.\n * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.\n *\n * This makes it possible for the widget to have private state for its template, while the transcluded\n * content has access to its originating scope.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** When testing an element transclude directive you must not place the directive at the root of the\n * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives\n * Testing Transclusion Directives}.\n * </div>\n *\n * There are three kinds of transclusion depending upon whether you want to transclude just the contents of the\n * directive's element, the entire element or multiple parts of the element contents:\n *\n * * `true` - transclude the content (i.e. the child nodes) of the directive's element.\n * * `'element'` - transclude the whole of the directive's element including any directives on this\n * element that defined at a lower priority than this directive. When used, the `template`\n * property is ignored.\n * * **`{...}` (an object hash):** - map elements of the content onto transclusion \"slots\" in the template.\n *\n * **Mult-slot transclusion** is declared by providing an object for the `transclude` property.\n *\n * This object is a map where the keys are the name of the slot to fill and the value is an element selector\n * used to match the HTML to the slot. The element selector should be in normalized form (e.g. `myElement`)\n * and will match the standard element variants (e.g. `my-element`, `my:element`, `data-my-element`, etc).\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n *\n * If the element selector is prefixed with a `?` then that slot is optional.\n *\n * For example, the transclude object `{ slotA: '?myCustomElement' }` maps `<my-custom-element>` elements to\n * the `slotA` slot, which can be accessed via the `$transclude` function or via the {@link ngTransclude} directive.\n *\n * Slots that are not marked as optional (`?`) will trigger a compile time error if there are no matching elements\n * in the transclude content. If you wish to know if an optional slot was filled with content, then you can call\n * `$transclude.isSlotFilled(slotName)` on the transclude function passed to the directive's link function and\n * injectable into the directive's controller.\n *\n *\n * #### Transclusion Functions\n *\n * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion\n * function** to the directive's `link` function and `controller`. This transclusion function is a special\n * **linking function** that will return the compiled contents linked to a new transclusion scope.\n *\n * <div class=\"alert alert-info\">\n * If you are just using {@link ngTransclude} then you don't need to worry about this function, since\n * ngTransclude will deal with it for us.\n * </div>\n *\n * If you want to manually control the insertion and removal of the transcluded content in your directive\n * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery\n * object that contains the compiled DOM, which is linked to the correct transclusion scope.\n *\n * When you call a transclusion function you can pass in a **clone attach function**. This function accepts\n * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded\n * content and the `scope` is the newly created transclusion scope, to which the clone is bound.\n *\n * <div class=\"alert alert-info\">\n * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a transclude function\n * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.\n * </div>\n *\n * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone\n * attach function**:\n *\n * ```js\n * var transcludedContent, transclusionScope;\n *\n * $transclude(function(clone, scope) {\n * element.append(clone);\n * transcludedContent = clone;\n * transclusionScope = scope;\n * });\n * ```\n *\n * Later, if you want to remove the transcluded content from your DOM then you should also destroy the\n * associated transclusion scope:\n *\n * ```js\n * transcludedContent.remove();\n * transclusionScope.$destroy();\n * ```\n *\n * <div class=\"alert alert-info\">\n * **Best Practice**: if you intend to add and remove transcluded content manually in your directive\n * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it),\n * then you are also responsible for calling `$destroy` on the transclusion scope.\n * </div>\n *\n * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}\n * automatically destroy their transcluded clones as necessary so you do not need to worry about this if\n * you are simply using {@link ngTransclude} to inject the transclusion into your directive.\n *\n *\n * #### Transclusion Scopes\n *\n * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion\n * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed\n * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it\n * was taken.\n *\n * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look\n * like this:\n *\n * ```html\n * <div ng-app>\n * <div isolate>\n * <div transclusion>\n * </div>\n * </div>\n * </div>\n * ```\n *\n * The `$parent` scope hierarchy will look like this:\n *\n ```\n - $rootScope\n - isolate\n - transclusion\n ```\n *\n * but the scopes will inherit prototypically from different scopes to their `$parent`.\n *\n ```\n - $rootScope\n - transclusion\n - isolate\n ```\n *\n *\n * ### Attributes\n *\n * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the\n * `link()` or `compile()` functions. It has a variety of uses.\n *\n * * *Accessing normalized attribute names:* Directives like 'ngBind' can be expressed in many ways:\n * 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. The attributes object allows for normalized access\n * to the attributes.\n *\n * * *Directive inter-communication:* All directives share the same instance of the attributes\n * object which allows the directives to use the attributes object as inter directive\n * communication.\n *\n * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object\n * allowing other directives to read the interpolated value.\n *\n * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes\n * that contain interpolation (e.g. `src=\"{{bar}}\"`). Not only is this very efficient but it's also\n * the only way to easily get the actual value because during the linking phase the interpolation\n * hasn't been evaluated yet and so the value is at this time set to `undefined`.\n *\n * ```js\n * function linkingFn(scope, elm, attrs, ctrl) {\n * // get the attribute value\n * console.log(attrs.ngModel);\n *\n * // change the attribute\n * attrs.$set('ngModel', 'new value');\n *\n * // observe changes to interpolated attribute\n * attrs.$observe('ngModel', function(value) {\n * console.log('ngModel has changed value to ' + value);\n * });\n * }\n * ```\n *\n * ## Example\n *\n * <div class=\"alert alert-warning\">\n * **Note**: Typically directives are registered with `module.directive`. The example below is\n * to illustrate how `$compile` works.\n * </div>\n *\n <example module=\"compileExample\">\n <file name=\"index.html\">\n <script>\n angular.module('compileExample', [], function($compileProvider) {\n // configure new 'compile' directive by passing a directive\n // factory function. The factory function injects the '$compile'\n $compileProvider.directive('compile', function($compile) {\n // directive factory creates a link function\n return function(scope, element, attrs) {\n scope.$watch(\n function(scope) {\n // watch the 'compile' expression for changes\n return scope.$eval(attrs.compile);\n },\n function(value) {\n // when the 'compile' expression changes\n // assign it into the current DOM\n element.html(value);\n\n // compile the new DOM and link it to the current\n // scope.\n // NOTE: we only compile .childNodes so that\n // we don't get into infinite loop compiling ourselves\n $compile(element.contents())(scope);\n }\n );\n };\n });\n })\n .controller('GreeterController', ['$scope', function($scope) {\n $scope.name = 'Angular';\n $scope.html = 'Hello {{name}}';\n }]);\n </script>\n <div ng-controller=\"GreeterController\">\n <input ng-model=\"name\"> <br/>\n <textarea ng-model=\"html\"></textarea> <br/>\n <div compile=\"html\"></div>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should auto compile', function() {\n var textarea = $('textarea');\n var output = $('div[compile]');\n // The initial state reads 'Hello Angular'.\n expect(output.getText()).toBe('Hello Angular');\n textarea.clear();\n textarea.sendKeys('{{name}}!');\n expect(output.getText()).toBe('Angular!');\n });\n </file>\n </example>\n\n *\n *\n * @param {string|DOMElement} element Element or HTML string to compile into a template function.\n * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.\n *\n * <div class=\"alert alert-danger\">\n * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it\n * e.g. will not use the right outer scope. Please pass the transclude function as a\n * `parentBoundTranscludeFn` to the link function instead.\n * </div>\n *\n * @param {number} maxPriority only apply directives lower than given priority (Only effects the\n * root element(s), not their children)\n * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template\n * (a DOM element/tree) to a scope. Where:\n *\n * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.\n * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the\n * `template` and call the `cloneAttachFn` function allowing the caller to attach the\n * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is\n * called as: <br/> `cloneAttachFn(clonedElement, scope)` where:\n *\n * * `clonedElement` - is a clone of the original `element` passed into the compiler.\n * * `scope` - is the current scope with which the linking function is working with.\n *\n * * `options` - An optional object hash with linking options. If `options` is provided, then the following\n * keys may be used to control linking behavior:\n *\n * * `parentBoundTranscludeFn` - the transclude function made available to\n * directives; if given, it will be passed through to the link functions of\n * directives found in `element` during compilation.\n * * `transcludeControllers` - an object hash with keys that map controller names\n * to a hash with the key `instance`, which maps to the controller instance;\n * if given, it will make the controllers available to directives on the compileNode:\n * ```\n * {\n * parent: {\n * instance: parentControllerInstance\n * }\n * }\n * ```\n * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add\n * the cloned elements; only needed for transcludes that are allowed to contain non html\n * elements (e.g. SVG elements). See also the directive.controller property.\n *\n * Calling the linking function returns the element of the template. It is either the original\n * element passed in, or the clone of the element if the `cloneAttachFn` is provided.\n *\n * After linking the view is not updated until after a call to $digest which typically is done by\n * Angular automatically.\n *\n * If you need access to the bound view, there are two ways to do it:\n *\n * - If you are not asking the linking function to clone the template, create the DOM element(s)\n * before you send them to the compiler and keep this reference around.\n * ```js\n * var element = $compile('<p>{{total}}</p>')(scope);\n * ```\n *\n * - if on the other hand, you need the element to be cloned, the view reference from the original\n * example would not point to the clone, but rather to the original template that was cloned. In\n * this case, you can access the clone via the cloneAttachFn:\n * ```js\n * var templateElement = angular.element('<p>{{total}}</p>'),\n * scope = ....;\n *\n * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {\n * //attach the clone to DOM document at the right place\n * });\n *\n * //now we have reference to the cloned DOM via `clonedElement`\n * ```\n *\n *\n * For information on how the compiler works, see the\n * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.\n */\n\nvar $compileMinErr = minErr('$compile');\n\n/**\n * @ngdoc provider\n * @name $compileProvider\n *\n * @description\n */\n$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];\nfunction $CompileProvider($provide, $$sanitizeUriProvider) {\n var hasDirectives = {},\n Suffix = 'Directive',\n COMMENT_DIRECTIVE_REGEXP = /^\\s*directive\\:\\s*([\\w\\-]+)\\s+(.*)$/,\n CLASS_DIRECTIVE_REGEXP = /(([\\w\\-]+)(?:\\:([^;]+))?;?)/,\n ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),\n REQUIRE_PREFIX_REGEXP = /^(?:(\\^\\^?)?(\\?)?(\\^\\^?)?)?/;\n\n // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes\n // The assumption is that future DOM event attribute names will begin with\n // 'on' and be composed of only English letters.\n var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;\n\n function parseIsolateBindings(scope, directiveName, isController) {\n var LOCAL_REGEXP = /^\\s*([@&<]|=(\\*?))(\\??)\\s*(\\w*)\\s*$/;\n\n var bindings = {};\n\n forEach(scope, function(definition, scopeName) {\n var match = definition.match(LOCAL_REGEXP);\n\n if (!match) {\n throw $compileMinErr('iscp',\n \"Invalid {3} for directive '{0}'.\" +\n \" Definition: {... {1}: '{2}' ...}\",\n directiveName, scopeName, definition,\n (isController ? \"controller bindings definition\" :\n \"isolate scope definition\"));\n }\n\n bindings[scopeName] = {\n mode: match[1][0],\n collection: match[2] === '*',\n optional: match[3] === '?',\n attrName: match[4] || scopeName\n };\n });\n\n return bindings;\n }\n\n function parseDirectiveBindings(directive, directiveName) {\n var bindings = {\n isolateScope: null,\n bindToController: null\n };\n if (isObject(directive.scope)) {\n if (directive.bindToController === true) {\n bindings.bindToController = parseIsolateBindings(directive.scope,\n directiveName, true);\n bindings.isolateScope = {};\n } else {\n bindings.isolateScope = parseIsolateBindings(directive.scope,\n directiveName, false);\n }\n }\n if (isObject(directive.bindToController)) {\n bindings.bindToController =\n parseIsolateBindings(directive.bindToController, directiveName, true);\n }\n if (isObject(bindings.bindToController)) {\n var controller = directive.controller;\n var controllerAs = directive.controllerAs;\n if (!controller) {\n // There is no controller, there may or may not be a controllerAs property\n throw $compileMinErr('noctrl',\n \"Cannot bind to controller without directive '{0}'s controller.\",\n directiveName);\n } else if (!identifierForController(controller, controllerAs)) {\n // There is a controller, but no identifier or controllerAs property\n throw $compileMinErr('noident',\n \"Cannot bind to controller without identifier for directive '{0}'.\",\n directiveName);\n }\n }\n return bindings;\n }\n\n function assertValidDirectiveName(name) {\n var letter = name.charAt(0);\n if (!letter || letter !== lowercase(letter)) {\n throw $compileMinErr('baddir', \"Directive name '{0}' is invalid. The first character must be a lowercase letter\", name);\n }\n if (name !== name.trim()) {\n throw $compileMinErr('baddir',\n \"Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces\",\n name);\n }\n }\n\n /**\n * @ngdoc method\n * @name $compileProvider#directive\n * @kind function\n *\n * @description\n * Register a new directive with the compiler.\n *\n * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which\n * will match as <code>ng-bind</code>), or an object map of directives where the keys are the\n * names and the values are the factories.\n * @param {Function|Array} directiveFactory An injectable directive factory function. See the\n * {@link guide/directive directive guide} and the {@link $compile compile API} for more info.\n * @returns {ng.$compileProvider} Self for chaining.\n */\n this.directive = function registerDirective(name, directiveFactory) {\n assertNotHasOwnProperty(name, 'directive');\n if (isString(name)) {\n assertValidDirectiveName(name);\n assertArg(directiveFactory, 'directiveFactory');\n if (!hasDirectives.hasOwnProperty(name)) {\n hasDirectives[name] = [];\n $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',\n function($injector, $exceptionHandler) {\n var directives = [];\n forEach(hasDirectives[name], function(directiveFactory, index) {\n try {\n var directive = $injector.invoke(directiveFactory);\n if (isFunction(directive)) {\n directive = { compile: valueFn(directive) };\n } else if (!directive.compile && directive.link) {\n directive.compile = valueFn(directive.link);\n }\n directive.priority = directive.priority || 0;\n directive.index = index;\n directive.name = directive.name || name;\n directive.require = directive.require || (directive.controller && directive.name);\n directive.restrict = directive.restrict || 'EA';\n var bindings = directive.$$bindings =\n parseDirectiveBindings(directive, directive.name);\n if (isObject(bindings.isolateScope)) {\n directive.$$isolateBindings = bindings.isolateScope;\n }\n directive.$$moduleName = directiveFactory.$$moduleName;\n directives.push(directive);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n return directives;\n }]);\n }\n hasDirectives[name].push(directiveFactory);\n } else {\n forEach(name, reverseParams(registerDirective));\n }\n return this;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#component\n * @module ng\n * @param {string} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`)\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object}),\n * with the following properties (all optional):\n *\n * - `controller` – `{(string|function()=}` – controller constructor function that should be\n * associated with newly created scope or the name of a {@link ng.$compile#-controller-\n * registered controller} if passed as a string. An empty `noop` function by default.\n * - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.\n * If present, the controller will be published to scope under the `controllerAs` name.\n * If not present, this will default to be `$ctrl`.\n * - `template` – `{string=|function()=}` – html template as a string or a function that\n * returns an html template as a string which should be used as the contents of this component.\n * Empty string by default.\n *\n * If `template` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html\n * template that should be used as the contents of this component.\n *\n * If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties.\n * Component properties are always bound to the component controller and not to the scope.\n * See {@link ng.$compile#-bindtocontroller- `bindToController`}.\n * - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled.\n * Disabled by default.\n * - `$...` – `{function()=}` – additional annotations to provide to the directive factory function.\n *\n * @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls.\n * @description\n * Register a **component definition** with the compiler. This is a shorthand for registering a special\n * type of directive, which represents a self-contained UI component in your application. Such components\n * are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`).\n *\n * Component definitions are very simple and do not require as much configuration as defining general\n * directives. Component definitions usually consist only of a template and a controller backing it.\n *\n * In order to make the definition easier, components enforce best practices like use of `controllerAs`,\n * `bindToController`. They always have **isolate scope** and are restricted to elements.\n *\n * Here are a few examples of how you would usually define components:\n *\n * ```js\n * var myMod = angular.module(...);\n * myMod.component('myComp', {\n * template: '<div>My name is {{$ctrl.name}}</div>',\n * controller: function() {\n * this.name = 'shahar';\n * }\n * });\n *\n * myMod.component('myComp', {\n * template: '<div>My name is {{$ctrl.name}}</div>',\n * bindings: {name: '@'}\n * });\n *\n * myMod.component('myComp', {\n * templateUrl: 'views/my-comp.html',\n * controller: 'MyCtrl as ctrl',\n * bindings: {name: '@'}\n * });\n *\n * ```\n * For more examples, and an in-depth guide, see the {@link guide/component component guide}.\n *\n * <br />\n * See also {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n this.component = function registerComponent(name, options) {\n var controller = options.controller || function() {};\n\n function factory($injector) {\n function makeInjectable(fn) {\n if (isFunction(fn) || isArray(fn)) {\n return function(tElement, tAttrs) {\n return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs});\n };\n } else {\n return fn;\n }\n }\n\n var template = (!options.template && !options.templateUrl ? '' : options.template);\n return {\n controller: controller,\n controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl',\n template: makeInjectable(template),\n templateUrl: makeInjectable(options.templateUrl),\n transclude: options.transclude,\n scope: {},\n bindToController: options.bindings || {},\n restrict: 'E',\n require: options.require\n };\n }\n\n // Copy any annotation properties (starting with $) over to the factory function\n // These could be used by libraries such as the new component router\n forEach(options, function(val, key) {\n if (key.charAt(0) === '$') {\n factory[key] = val;\n }\n });\n\n factory.$inject = ['$injector'];\n\n return this.directive(name, factory);\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#aHrefSanitizationWhitelist\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at preventing XSS attacks via html links.\n *\n * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.aHrefSanitizationWhitelist();\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#imgSrcSanitizationWhitelist\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();\n }\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#debugInfoEnabled\n *\n * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the\n * current debugInfoEnabled state\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable/disable various debug runtime information in the compiler such as adding\n * binding information and a reference to the current scope on to DOM elements.\n * If enabled, the compiler will add the following to DOM elements that have been bound to the scope\n * * `ng-binding` CSS class\n * * `$binding` data property containing an array of the binding expressions\n *\n * You may want to disable this in production for a significant performance boost. See\n * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.\n *\n * The default value is true.\n */\n var debugInfoEnabled = true;\n this.debugInfoEnabled = function(enabled) {\n if (isDefined(enabled)) {\n debugInfoEnabled = enabled;\n return this;\n }\n return debugInfoEnabled;\n };\n\n this.$get = [\n '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',\n '$controller', '$rootScope', '$sce', '$animate', '$$sanitizeUri',\n function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse,\n $controller, $rootScope, $sce, $animate, $$sanitizeUri) {\n\n var SIMPLE_ATTR_NAME = /^\\w/;\n var specialAttrHolder = document.createElement('div');\n var Attributes = function(element, attributesToCopy) {\n if (attributesToCopy) {\n var keys = Object.keys(attributesToCopy);\n var i, l, key;\n\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n this[key] = attributesToCopy[key];\n }\n } else {\n this.$attr = {};\n }\n\n this.$$element = element;\n };\n\n Attributes.prototype = {\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$normalize\n * @kind function\n *\n * @description\n * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or\n * `data-`) to its normalized, camelCase form.\n *\n * Also there is special case for Moz prefix starting with upper case letter.\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n *\n * @param {string} name Name to normalize\n */\n $normalize: directiveNormalize,\n\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$addClass\n * @kind function\n *\n * @description\n * Adds the CSS class value specified by the classVal parameter to the element. If animations\n * are enabled then an animation will be triggered for the class addition.\n *\n * @param {string} classVal The className value that will be added to the element\n */\n $addClass: function(classVal) {\n if (classVal && classVal.length > 0) {\n $animate.addClass(this.$$element, classVal);\n }\n },\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$removeClass\n * @kind function\n *\n * @description\n * Removes the CSS class value specified by the classVal parameter from the element. If\n * animations are enabled then an animation will be triggered for the class removal.\n *\n * @param {string} classVal The className value that will be removed from the element\n */\n $removeClass: function(classVal) {\n if (classVal && classVal.length > 0) {\n $animate.removeClass(this.$$element, classVal);\n }\n },\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$updateClass\n * @kind function\n *\n * @description\n * Adds and removes the appropriate CSS class values to the element based on the difference\n * between the new and old CSS class values (specified as newClasses and oldClasses).\n *\n * @param {string} newClasses The current CSS className value\n * @param {string} oldClasses The former CSS className value\n */\n $updateClass: function(newClasses, oldClasses) {\n var toAdd = tokenDifference(newClasses, oldClasses);\n if (toAdd && toAdd.length) {\n $animate.addClass(this.$$element, toAdd);\n }\n\n var toRemove = tokenDifference(oldClasses, newClasses);\n if (toRemove && toRemove.length) {\n $animate.removeClass(this.$$element, toRemove);\n }\n },\n\n /**\n * Set a normalized attribute on the element in a way such that all directives\n * can share the attribute. This function properly handles boolean attributes.\n * @param {string} key Normalized key. (ie ngAttribute)\n * @param {string|boolean} value The value to set. If `null` attribute will be deleted.\n * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.\n * Defaults to true.\n * @param {string=} attrName Optional none normalized name. Defaults to key.\n */\n $set: function(key, value, writeAttr, attrName) {\n // TODO: decide whether or not to throw an error if \"class\"\n //is set through this function since it may cause $updateClass to\n //become unstable.\n\n var node = this.$$element[0],\n booleanKey = getBooleanAttrName(node, key),\n aliasedKey = getAliasedAttrName(key),\n observer = key,\n nodeName;\n\n if (booleanKey) {\n this.$$element.prop(key, value);\n attrName = booleanKey;\n } else if (aliasedKey) {\n this[aliasedKey] = value;\n observer = aliasedKey;\n }\n\n this[key] = value;\n\n // translate normalized key to actual key\n if (attrName) {\n this.$attr[key] = attrName;\n } else {\n attrName = this.$attr[key];\n if (!attrName) {\n this.$attr[key] = attrName = snake_case(key, '-');\n }\n }\n\n nodeName = nodeName_(this.$$element);\n\n if ((nodeName === 'a' && (key === 'href' || key === 'xlinkHref')) ||\n (nodeName === 'img' && key === 'src')) {\n // sanitize a[href] and img[src] values\n this[key] = value = $$sanitizeUri(value, key === 'src');\n } else if (nodeName === 'img' && key === 'srcset') {\n // sanitize img[srcset] values\n var result = \"\";\n\n // first check if there are spaces because it's not the same pattern\n var trimmedSrcset = trim(value);\n // ( 999x ,| 999w ,| ,|, )\n var srcPattern = /(\\s+\\d+x\\s*,|\\s+\\d+w\\s*,|\\s+,|,\\s+)/;\n var pattern = /\\s/.test(trimmedSrcset) ? srcPattern : /(,)/;\n\n // split srcset into tuple of uri and descriptor except for the last item\n var rawUris = trimmedSrcset.split(pattern);\n\n // for each tuples\n var nbrUrisWith2parts = Math.floor(rawUris.length / 2);\n for (var i = 0; i < nbrUrisWith2parts; i++) {\n var innerIdx = i * 2;\n // sanitize the uri\n result += $$sanitizeUri(trim(rawUris[innerIdx]), true);\n // add the descriptor\n result += (\" \" + trim(rawUris[innerIdx + 1]));\n }\n\n // split the last item into uri and descriptor\n var lastTuple = trim(rawUris[i * 2]).split(/\\s/);\n\n // sanitize the last uri\n result += $$sanitizeUri(trim(lastTuple[0]), true);\n\n // and add the last descriptor if any\n if (lastTuple.length === 2) {\n result += (\" \" + trim(lastTuple[1]));\n }\n this[key] = value = result;\n }\n\n if (writeAttr !== false) {\n if (value === null || isUndefined(value)) {\n this.$$element.removeAttr(attrName);\n } else {\n if (SIMPLE_ATTR_NAME.test(attrName)) {\n this.$$element.attr(attrName, value);\n } else {\n setSpecialAttr(this.$$element[0], attrName, value);\n }\n }\n }\n\n // fire observers\n var $$observers = this.$$observers;\n $$observers && forEach($$observers[observer], function(fn) {\n try {\n fn(value);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n },\n\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$observe\n * @kind function\n *\n * @description\n * Observes an interpolated attribute.\n *\n * The observer function will be invoked once during the next `$digest` following\n * compilation. The observer is then invoked whenever the interpolated value\n * changes.\n *\n * @param {string} key Normalized key. (ie ngAttribute) .\n * @param {function(interpolatedValue)} fn Function that will be called whenever\n the interpolated value of the attribute changes.\n * See the {@link guide/interpolation#how-text-and-attribute-bindings-work Interpolation\n * guide} for more info.\n * @returns {function()} Returns a deregistration function for this observer.\n */\n $observe: function(key, fn) {\n var attrs = this,\n $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),\n listeners = ($$observers[key] || ($$observers[key] = []));\n\n listeners.push(fn);\n $rootScope.$evalAsync(function() {\n if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) {\n // no one registered attribute interpolation function, so lets call it manually\n fn(attrs[key]);\n }\n });\n\n return function() {\n arrayRemove(listeners, fn);\n };\n }\n };\n\n function setSpecialAttr(element, attrName, value) {\n // Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute`\n // so we have to jump through some hoops to get such an attribute\n // https://github.com/angular/angular.js/pull/13318\n specialAttrHolder.innerHTML = \"<span \" + attrName + \">\";\n var attributes = specialAttrHolder.firstChild.attributes;\n var attribute = attributes[0];\n // We have to remove the attribute from its container element before we can add it to the destination element\n attributes.removeNamedItem(attribute.name);\n attribute.value = value;\n element.attributes.setNamedItem(attribute);\n }\n\n function safeAddClass($element, className) {\n try {\n $element.addClass(className);\n } catch (e) {\n // ignore, since it means that we are trying to set class on\n // SVG element, where class name is read-only.\n }\n }\n\n\n var startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n denormalizeTemplate = (startSymbol == '{{' && endSymbol == '}}')\n ? identity\n : function denormalizeTemplate(template) {\n return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n },\n NG_ATTR_BINDING = /^ngAttr[A-Z]/;\n var MULTI_ELEMENT_DIR_RE = /^(.+)Start$/;\n\n compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {\n var bindings = $element.data('$binding') || [];\n\n if (isArray(binding)) {\n bindings = bindings.concat(binding);\n } else {\n bindings.push(binding);\n }\n\n $element.data('$binding', bindings);\n } : noop;\n\n compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {\n safeAddClass($element, 'ng-binding');\n } : noop;\n\n compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {\n var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';\n $element.data(dataName, scope);\n } : noop;\n\n compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {\n safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');\n } : noop;\n\n return compile;\n\n //================================\n\n function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,\n previousCompileContext) {\n if (!($compileNodes instanceof jqLite)) {\n // jquery always rewraps, whereas we need to preserve the original selector so that we can\n // modify it.\n $compileNodes = jqLite($compileNodes);\n }\n\n var NOT_EMPTY = /\\S+/;\n\n // We can not compile top level text elements since text nodes can be merged and we will\n // not be able to attach scope data to them, so we will wrap them in <span>\n for (var i = 0, len = $compileNodes.length; i < len; i++) {\n var domNode = $compileNodes[i];\n\n if (domNode.nodeType === NODE_TYPE_TEXT && domNode.nodeValue.match(NOT_EMPTY) /* non-empty */) {\n jqLiteWrapNode(domNode, $compileNodes[i] = document.createElement('span'));\n }\n }\n\n var compositeLinkFn =\n compileNodes($compileNodes, transcludeFn, $compileNodes,\n maxPriority, ignoreDirective, previousCompileContext);\n compile.$$addScopeClass($compileNodes);\n var namespace = null;\n return function publicLinkFn(scope, cloneConnectFn, options) {\n assertArg(scope, 'scope');\n\n if (previousCompileContext && previousCompileContext.needsNewScope) {\n // A parent directive did a replace and a directive on this element asked\n // for transclusion, which caused us to lose a layer of element on which\n // we could hold the new transclusion scope, so we will create it manually\n // here.\n scope = scope.$parent.$new();\n }\n\n options = options || {};\n var parentBoundTranscludeFn = options.parentBoundTranscludeFn,\n transcludeControllers = options.transcludeControllers,\n futureParentElement = options.futureParentElement;\n\n // When `parentBoundTranscludeFn` is passed, it is a\n // `controllersBoundTransclude` function (it was previously passed\n // as `transclude` to directive.link) so we must unwrap it to get\n // its `boundTranscludeFn`\n if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {\n parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;\n }\n\n if (!namespace) {\n namespace = detectNamespaceForChildElements(futureParentElement);\n }\n var $linkNode;\n if (namespace !== 'html') {\n // When using a directive with replace:true and templateUrl the $compileNodes\n // (or a child element inside of them)\n // might change, so we need to recreate the namespace adapted compileNodes\n // for call to the link function.\n // Note: This will already clone the nodes...\n $linkNode = jqLite(\n wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html())\n );\n } else if (cloneConnectFn) {\n // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart\n // and sometimes changes the structure of the DOM.\n $linkNode = JQLitePrototype.clone.call($compileNodes);\n } else {\n $linkNode = $compileNodes;\n }\n\n if (transcludeControllers) {\n for (var controllerName in transcludeControllers) {\n $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);\n }\n }\n\n compile.$$addScopeInfo($linkNode, scope);\n\n if (cloneConnectFn) cloneConnectFn($linkNode, scope);\n if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);\n return $linkNode;\n };\n }\n\n function detectNamespaceForChildElements(parentElement) {\n // TODO: Make this detect MathML as well...\n var node = parentElement && parentElement[0];\n if (!node) {\n return 'html';\n } else {\n return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html';\n }\n }\n\n /**\n * Compile function matches each node in nodeList against the directives. Once all directives\n * for a particular node are collected their compile functions are executed. The compile\n * functions return values - the linking functions - are combined into a composite linking\n * function, which is the a linking function for the node.\n *\n * @param {NodeList} nodeList an array of nodes or NodeList to compile\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new child of the transcluded parent scope.\n * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then\n * the rootElement must be set the jqLite collection of the compile root. This is\n * needed so that the jqLite collection items can be replaced with widgets.\n * @param {number=} maxPriority Max directive priority.\n * @returns {Function} A composite linking function of all of the matched directives or null.\n */\n function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,\n previousCompileContext) {\n var linkFns = [],\n attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;\n\n for (var i = 0; i < nodeList.length; i++) {\n attrs = new Attributes();\n\n // we must always refer to nodeList[i] since the nodes can be replaced underneath us.\n directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,\n ignoreDirective);\n\n nodeLinkFn = (directives.length)\n ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,\n null, [], [], previousCompileContext)\n : null;\n\n if (nodeLinkFn && nodeLinkFn.scope) {\n compile.$$addScopeClass(attrs.$$element);\n }\n\n childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||\n !(childNodes = nodeList[i].childNodes) ||\n !childNodes.length)\n ? null\n : compileNodes(childNodes,\n nodeLinkFn ? (\n (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)\n && nodeLinkFn.transclude) : transcludeFn);\n\n if (nodeLinkFn || childLinkFn) {\n linkFns.push(i, nodeLinkFn, childLinkFn);\n linkFnFound = true;\n nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;\n }\n\n //use the previous context only for the first element in the virtual group\n previousCompileContext = null;\n }\n\n // return a linking function if we have found anything, null otherwise\n return linkFnFound ? compositeLinkFn : null;\n\n function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {\n var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;\n var stableNodeList;\n\n\n if (nodeLinkFnFound) {\n // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our\n // offsets don't get screwed up\n var nodeListLength = nodeList.length;\n stableNodeList = new Array(nodeListLength);\n\n // create a sparse array by only copying the elements which have a linkFn\n for (i = 0; i < linkFns.length; i+=3) {\n idx = linkFns[i];\n stableNodeList[idx] = nodeList[idx];\n }\n } else {\n stableNodeList = nodeList;\n }\n\n for (i = 0, ii = linkFns.length; i < ii;) {\n node = stableNodeList[linkFns[i++]];\n nodeLinkFn = linkFns[i++];\n childLinkFn = linkFns[i++];\n\n if (nodeLinkFn) {\n if (nodeLinkFn.scope) {\n childScope = scope.$new();\n compile.$$addScopeInfo(jqLite(node), childScope);\n } else {\n childScope = scope;\n }\n\n if (nodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(\n scope, nodeLinkFn.transclude, parentBoundTranscludeFn);\n\n } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {\n childBoundTranscludeFn = parentBoundTranscludeFn;\n\n } else if (!parentBoundTranscludeFn && transcludeFn) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);\n\n } else {\n childBoundTranscludeFn = null;\n }\n\n nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);\n\n } else if (childLinkFn) {\n childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);\n }\n }\n }\n }\n\n function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {\n\n var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {\n\n if (!transcludedScope) {\n transcludedScope = scope.$new(false, containingScope);\n transcludedScope.$$transcluded = true;\n }\n\n return transcludeFn(transcludedScope, cloneFn, {\n parentBoundTranscludeFn: previousBoundTranscludeFn,\n transcludeControllers: controllers,\n futureParentElement: futureParentElement\n });\n };\n\n // We need to attach the transclusion slots onto the `boundTranscludeFn`\n // so that they are available inside the `controllersBoundTransclude` function\n var boundSlots = boundTranscludeFn.$$slots = createMap();\n for (var slotName in transcludeFn.$$slots) {\n if (transcludeFn.$$slots[slotName]) {\n boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn);\n } else {\n boundSlots[slotName] = null;\n }\n }\n\n return boundTranscludeFn;\n }\n\n /**\n * Looks for directives on the given node and adds them to the directive collection which is\n * sorted.\n *\n * @param node Node to search.\n * @param directives An array to which the directives are added to. This array is sorted before\n * the function returns.\n * @param attrs The shared attrs object which is used to populate the normalized attributes.\n * @param {number=} maxPriority Max directive priority.\n */\n function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n var nodeType = node.nodeType,\n attrsMap = attrs.$attr,\n match,\n className;\n\n switch (nodeType) {\n case NODE_TYPE_ELEMENT: /* Element */\n // use the node name: <directive>\n addDirective(directives,\n directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective);\n\n // iterate over the attributes\n for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,\n j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {\n var attrStartName = false;\n var attrEndName = false;\n\n attr = nAttrs[j];\n name = attr.name;\n value = trim(attr.value);\n\n // support ngAttr attribute binding\n ngAttrName = directiveNormalize(name);\n if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) {\n name = name.replace(PREFIX_REGEXP, '')\n .substr(8).replace(/_(.)/g, function(match, letter) {\n return letter.toUpperCase();\n });\n }\n\n var multiElementMatch = ngAttrName.match(MULTI_ELEMENT_DIR_RE);\n if (multiElementMatch && directiveIsMultiElement(multiElementMatch[1])) {\n attrStartName = name;\n attrEndName = name.substr(0, name.length - 5) + 'end';\n name = name.substr(0, name.length - 6);\n }\n\n nName = directiveNormalize(name.toLowerCase());\n attrsMap[nName] = name;\n if (isNgAttr || !attrs.hasOwnProperty(nName)) {\n attrs[nName] = value;\n if (getBooleanAttrName(node, nName)) {\n attrs[nName] = true; // presence means true\n }\n }\n addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);\n addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,\n attrEndName);\n }\n\n // use class as directive\n className = node.className;\n if (isObject(className)) {\n // Maybe SVGAnimatedString\n className = className.animVal;\n }\n if (isString(className) && className !== '') {\n while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {\n nName = directiveNormalize(match[2]);\n if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[3]);\n }\n className = className.substr(match.index + match[0].length);\n }\n }\n break;\n case NODE_TYPE_TEXT: /* Text Node */\n if (msie === 11) {\n // Workaround for #11781\n while (node.parentNode && node.nextSibling && node.nextSibling.nodeType === NODE_TYPE_TEXT) {\n node.nodeValue = node.nodeValue + node.nextSibling.nodeValue;\n node.parentNode.removeChild(node.nextSibling);\n }\n }\n addTextInterpolateDirective(directives, node.nodeValue);\n break;\n case NODE_TYPE_COMMENT: /* Comment */\n try {\n match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);\n if (match) {\n nName = directiveNormalize(match[1]);\n if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[2]);\n }\n }\n } catch (e) {\n // turns out that under some circumstances IE9 throws errors when one attempts to read\n // comment's node value.\n // Just ignore it and continue. (Can't seem to reproduce in test case.)\n }\n break;\n }\n\n directives.sort(byPriority);\n return directives;\n }\n\n /**\n * Given a node with an directive-start it collects all of the siblings until it finds\n * directive-end.\n * @param node\n * @param attrStart\n * @param attrEnd\n * @returns {*}\n */\n function groupScan(node, attrStart, attrEnd) {\n var nodes = [];\n var depth = 0;\n if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {\n do {\n if (!node) {\n throw $compileMinErr('uterdir',\n \"Unterminated attribute, found '{0}' but no matching '{1}' found.\",\n attrStart, attrEnd);\n }\n if (node.nodeType == NODE_TYPE_ELEMENT) {\n if (node.hasAttribute(attrStart)) depth++;\n if (node.hasAttribute(attrEnd)) depth--;\n }\n nodes.push(node);\n node = node.nextSibling;\n } while (depth > 0);\n } else {\n nodes.push(node);\n }\n\n return jqLite(nodes);\n }\n\n /**\n * Wrapper for linking function which converts normal linking function into a grouped\n * linking function.\n * @param linkFn\n * @param attrStart\n * @param attrEnd\n * @returns {Function}\n */\n function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {\n return function(scope, element, attrs, controllers, transcludeFn) {\n element = groupScan(element[0], attrStart, attrEnd);\n return linkFn(scope, element, attrs, controllers, transcludeFn);\n };\n }\n\n /**\n * A function generator that is used to support both eager and lazy compilation\n * linking function.\n * @param eager\n * @param $compileNodes\n * @param transcludeFn\n * @param maxPriority\n * @param ignoreDirective\n * @param previousCompileContext\n * @returns {Function}\n */\n function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {\n if (eager) {\n return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n }\n\n var compiled;\n\n return function() {\n if (!compiled) {\n compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n\n // Null out all of these references in order to make them eligible for garbage collection\n // since this is a potentially long lived closure\n $compileNodes = transcludeFn = previousCompileContext = null;\n }\n\n return compiled.apply(this, arguments);\n };\n }\n\n /**\n * Once the directives have been collected, their compile functions are executed. This method\n * is responsible for inlining directive templates as well as terminating the application\n * of the directives if the terminal directive has been reached.\n *\n * @param {Array} directives Array of collected directives to execute their compile function.\n * this needs to be pre-sorted by priority order.\n * @param {Node} compileNode The raw DOM node to apply the compile functions to\n * @param {Object} templateAttrs The shared attribute function\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new\n * child of the transcluded parent scope.\n * @param {JQLite} jqCollection If we are working on the root of the compile tree then this\n * argument has the root jqLite array so that we can replace nodes\n * on it.\n * @param {Object=} originalReplaceDirective An optional directive that will be ignored when\n * compiling the transclusion.\n * @param {Array.<Function>} preLinkFns\n * @param {Array.<Function>} postLinkFns\n * @param {Object} previousCompileContext Context used for previous compilation of the current\n * node\n * @returns {Function} linkFn\n */\n function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,\n jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,\n previousCompileContext) {\n previousCompileContext = previousCompileContext || {};\n\n var terminalPriority = -Number.MAX_VALUE,\n newScopeDirective = previousCompileContext.newScopeDirective,\n controllerDirectives = previousCompileContext.controllerDirectives,\n newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,\n templateDirective = previousCompileContext.templateDirective,\n nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,\n hasTranscludeDirective = false,\n hasTemplate = false,\n hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,\n $compileNode = templateAttrs.$$element = jqLite(compileNode),\n directive,\n directiveName,\n $template,\n replaceDirective = originalReplaceDirective,\n childTranscludeFn = transcludeFn,\n linkFn,\n didScanForMultipleTransclusion = false,\n mightHaveMultipleTransclusionError = false,\n directiveValue;\n\n // executes all directives on the current element\n for (var i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n var attrStart = directive.$$start;\n var attrEnd = directive.$$end;\n\n // collect multiblock sections\n if (attrStart) {\n $compileNode = groupScan(compileNode, attrStart, attrEnd);\n }\n $template = undefined;\n\n if (terminalPriority > directive.priority) {\n break; // prevent further processing of directives\n }\n\n if (directiveValue = directive.scope) {\n\n // skip the check for directives with async templates, we'll check the derived sync\n // directive when the template arrives\n if (!directive.templateUrl) {\n if (isObject(directiveValue)) {\n // This directive is trying to add an isolated scope.\n // Check that there is no scope of any kind already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,\n directive, $compileNode);\n newIsolateScopeDirective = directive;\n } else {\n // This directive is trying to add a child scope.\n // Check that there is no isolated scope already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,\n $compileNode);\n }\n }\n\n newScopeDirective = newScopeDirective || directive;\n }\n\n directiveName = directive.name;\n\n // If we encounter a condition that can result in transclusion on the directive,\n // then scan ahead in the remaining directives for others that may cause a multiple\n // transclusion error to be thrown during the compilation process. If a matching directive\n // is found, then we know that when we encounter a transcluded directive, we need to eagerly\n // compile the `transclude` function rather than doing it lazily in order to throw\n // exceptions at the correct time\n if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template))\n || (directive.transclude && !directive.$$tlb))) {\n var candidateDirective;\n\n for (var scanningIndex = i + 1; candidateDirective = directives[scanningIndex++];) {\n if ((candidateDirective.transclude && !candidateDirective.$$tlb)\n || (candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template))) {\n mightHaveMultipleTransclusionError = true;\n break;\n }\n }\n\n didScanForMultipleTransclusion = true;\n }\n\n if (!directive.templateUrl && directive.controller) {\n directiveValue = directive.controller;\n controllerDirectives = controllerDirectives || createMap();\n assertNoDuplicate(\"'\" + directiveName + \"' controller\",\n controllerDirectives[directiveName], directive, $compileNode);\n controllerDirectives[directiveName] = directive;\n }\n\n if (directiveValue = directive.transclude) {\n hasTranscludeDirective = true;\n\n // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.\n // This option should only be used by directives that know how to safely handle element transclusion,\n // where the transcluded nodes are added or replaced after linking.\n if (!directive.$$tlb) {\n assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);\n nonTlbTranscludeDirective = directive;\n }\n\n if (directiveValue == 'element') {\n hasElementTranscludeDirective = true;\n terminalPriority = directive.priority;\n $template = $compileNode;\n $compileNode = templateAttrs.$$element =\n jqLite(document.createComment(' ' + directiveName + ': ' +\n templateAttrs[directiveName] + ' '));\n compileNode = $compileNode[0];\n replaceWith(jqCollection, sliceArgs($template), compileNode);\n\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority,\n replaceDirective && replaceDirective.name, {\n // Don't pass in:\n // - controllerDirectives - otherwise we'll create duplicates controllers\n // - newIsolateScopeDirective or templateDirective - combining templates with\n // element transclusion doesn't make sense.\n //\n // We need only nonTlbTranscludeDirective so that we prevent putting transclusion\n // on the same element more than once.\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n } else {\n\n var slots = createMap();\n\n $template = jqLite(jqLiteClone(compileNode)).contents();\n\n if (isObject(directiveValue)) {\n\n // We have transclusion slots,\n // collect them up, compile them and store their transclusion functions\n $template = [];\n\n var slotMap = createMap();\n var filledSlots = createMap();\n\n // Parse the element selectors\n forEach(directiveValue, function(elementSelector, slotName) {\n // If an element selector starts with a ? then it is optional\n var optional = (elementSelector.charAt(0) === '?');\n elementSelector = optional ? elementSelector.substring(1) : elementSelector;\n\n slotMap[elementSelector] = slotName;\n\n // We explicitly assign `null` since this implies that a slot was defined but not filled.\n // Later when calling boundTransclusion functions with a slot name we only error if the\n // slot is `undefined`\n slots[slotName] = null;\n\n // filledSlots contains `true` for all slots that are either optional or have been\n // filled. This is used to check that we have not missed any required slots\n filledSlots[slotName] = optional;\n });\n\n // Add the matching elements into their slot\n forEach($compileNode.contents(), function(node) {\n var slotName = slotMap[directiveNormalize(nodeName_(node))];\n if (slotName) {\n filledSlots[slotName] = true;\n slots[slotName] = slots[slotName] || [];\n slots[slotName].push(node);\n } else {\n $template.push(node);\n }\n });\n\n // Check for required slots that were not filled\n forEach(filledSlots, function(filled, slotName) {\n if (!filled) {\n throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName);\n }\n });\n\n for (var slotName in slots) {\n if (slots[slotName]) {\n // Only define a transclusion function if the slot was filled\n slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slots[slotName], transcludeFn);\n }\n }\n }\n\n $compileNode.empty(); // clear contents\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined,\n undefined, { needsNewScope: directive.$$isolateScope || directive.$$newScope});\n childTranscludeFn.$$slots = slots;\n }\n }\n\n if (directive.template) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n\n directiveValue = (isFunction(directive.template))\n ? directive.template($compileNode, templateAttrs)\n : directive.template;\n\n directiveValue = denormalizeTemplate(directiveValue);\n\n if (directive.replace) {\n replaceDirective = directive;\n if (jqLiteIsTextNode(directiveValue)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));\n }\n compileNode = $template[0];\n\n if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt',\n \"Template for directive '{0}' must have exactly one root element. {1}\",\n directiveName, '');\n }\n\n replaceWith(jqCollection, $compileNode, compileNode);\n\n var newTemplateAttrs = {$attr: {}};\n\n // combine directives from the original node and from the template:\n // - take the array of directives for this element\n // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)\n // - collect directives from the template and sort them by priority\n // - combine directives as: processed + template + unprocessed\n var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);\n var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));\n\n if (newIsolateScopeDirective || newScopeDirective) {\n // The original directive caused the current element to be replaced but this element\n // also needs to have a new scope, so we need to tell the template directives\n // that they would need to get their scope from further up, if they require transclusion\n markDirectiveScope(templateDirectives, newIsolateScopeDirective, newScopeDirective);\n }\n directives = directives.concat(templateDirectives).concat(unprocessedDirectives);\n mergeTemplateAttributes(templateAttrs, newTemplateAttrs);\n\n ii = directives.length;\n } else {\n $compileNode.html(directiveValue);\n }\n }\n\n if (directive.templateUrl) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n\n if (directive.replace) {\n replaceDirective = directive;\n }\n\n nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,\n templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {\n controllerDirectives: controllerDirectives,\n newScopeDirective: (newScopeDirective !== directive) && newScopeDirective,\n newIsolateScopeDirective: newIsolateScopeDirective,\n templateDirective: templateDirective,\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n ii = directives.length;\n } else if (directive.compile) {\n try {\n linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);\n if (isFunction(linkFn)) {\n addLinkFns(null, linkFn, attrStart, attrEnd);\n } else if (linkFn) {\n addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd);\n }\n } catch (e) {\n $exceptionHandler(e, startingTag($compileNode));\n }\n }\n\n if (directive.terminal) {\n nodeLinkFn.terminal = true;\n terminalPriority = Math.max(terminalPriority, directive.priority);\n }\n\n }\n\n nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;\n nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;\n nodeLinkFn.templateOnThisElement = hasTemplate;\n nodeLinkFn.transclude = childTranscludeFn;\n\n previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;\n\n // might be normal or delayed nodeLinkFn depending on if templateUrl is present\n return nodeLinkFn;\n\n ////////////////////\n\n function addLinkFns(pre, post, attrStart, attrEnd) {\n if (pre) {\n if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);\n pre.require = directive.require;\n pre.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n pre = cloneAndAnnotateFn(pre, {isolateScope: true});\n }\n preLinkFns.push(pre);\n }\n if (post) {\n if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);\n post.require = directive.require;\n post.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n post = cloneAndAnnotateFn(post, {isolateScope: true});\n }\n postLinkFns.push(post);\n }\n }\n\n\n function getControllers(directiveName, require, $element, elementControllers) {\n var value;\n\n if (isString(require)) {\n var match = require.match(REQUIRE_PREFIX_REGEXP);\n var name = require.substring(match[0].length);\n var inheritType = match[1] || match[3];\n var optional = match[2] === '?';\n\n //If only parents then start at the parent element\n if (inheritType === '^^') {\n $element = $element.parent();\n //Otherwise attempt getting the controller from elementControllers in case\n //the element is transcluded (and has no data) and to avoid .data if possible\n } else {\n value = elementControllers && elementControllers[name];\n value = value && value.instance;\n }\n\n if (!value) {\n var dataName = '$' + name + 'Controller';\n value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName);\n }\n\n if (!value && !optional) {\n throw $compileMinErr('ctreq',\n \"Controller '{0}', required by directive '{1}', can't be found!\",\n name, directiveName);\n }\n } else if (isArray(require)) {\n value = [];\n for (var i = 0, ii = require.length; i < ii; i++) {\n value[i] = getControllers(directiveName, require[i], $element, elementControllers);\n }\n } else if (isObject(require)) {\n value = {};\n forEach(require, function(controller, property) {\n value[property] = getControllers(directiveName, controller, $element, elementControllers);\n });\n }\n\n return value || null;\n }\n\n function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope) {\n var elementControllers = createMap();\n for (var controllerKey in controllerDirectives) {\n var directive = controllerDirectives[controllerKey];\n var locals = {\n $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,\n $element: $element,\n $attrs: attrs,\n $transclude: transcludeFn\n };\n\n var controller = directive.controller;\n if (controller == '@') {\n controller = attrs[directive.name];\n }\n\n var controllerInstance = $controller(controller, locals, true, directive.controllerAs);\n\n // For directives with element transclusion the element is a comment,\n // but jQuery .data doesn't support attaching data to comment nodes as it's hard to\n // clean up (http://bugs.jquery.com/ticket/8335).\n // Instead, we save the controllers for the element in a local hash and attach to .data\n // later, once we have the actual element.\n elementControllers[directive.name] = controllerInstance;\n if (!hasElementTranscludeDirective) {\n $element.data('$' + directive.name + 'Controller', controllerInstance.instance);\n }\n }\n return elementControllers;\n }\n\n function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {\n var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,\n attrs, removeScopeBindingWatches, removeControllerBindingWatches;\n\n if (compileNode === linkNode) {\n attrs = templateAttrs;\n $element = templateAttrs.$$element;\n } else {\n $element = jqLite(linkNode);\n attrs = new Attributes($element, templateAttrs);\n }\n\n controllerScope = scope;\n if (newIsolateScopeDirective) {\n isolateScope = scope.$new(true);\n } else if (newScopeDirective) {\n controllerScope = scope.$parent;\n }\n\n if (boundTranscludeFn) {\n // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`\n // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`\n transcludeFn = controllersBoundTransclude;\n transcludeFn.$$boundTransclude = boundTranscludeFn;\n // expose the slots on the `$transclude` function\n transcludeFn.isSlotFilled = function(slotName) {\n return !!boundTranscludeFn.$$slots[slotName];\n };\n }\n\n if (controllerDirectives) {\n elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope);\n }\n\n if (newIsolateScopeDirective) {\n // Initialize isolate scope bindings for new isolate scope directive.\n compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||\n templateDirective === newIsolateScopeDirective.$$originalDirective)));\n compile.$$addScopeClass($element, true);\n isolateScope.$$isolateBindings =\n newIsolateScopeDirective.$$isolateBindings;\n removeScopeBindingWatches = initializeDirectiveBindings(scope, attrs, isolateScope,\n isolateScope.$$isolateBindings,\n newIsolateScopeDirective);\n if (removeScopeBindingWatches) {\n isolateScope.$on('$destroy', removeScopeBindingWatches);\n }\n }\n\n // Initialize bindToController bindings\n for (var name in elementControllers) {\n var controllerDirective = controllerDirectives[name];\n var controller = elementControllers[name];\n var bindings = controllerDirective.$$bindings.bindToController;\n\n if (controller.identifier && bindings) {\n removeControllerBindingWatches =\n initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n }\n\n var controllerResult = controller();\n if (controllerResult !== controller.instance) {\n // If the controller constructor has a return value, overwrite the instance\n // from setupControllers\n controller.instance = controllerResult;\n $element.data('$' + controllerDirective.name + 'Controller', controllerResult);\n removeControllerBindingWatches && removeControllerBindingWatches();\n removeControllerBindingWatches =\n initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n }\n }\n\n // Bind the required controllers to the controller, if `require` is an object and `bindToController` is truthy\n forEach(controllerDirectives, function(controllerDirective, name) {\n var require = controllerDirective.require;\n if (controllerDirective.bindToController && !isArray(require) && isObject(require)) {\n extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers));\n }\n });\n\n // Trigger the `$onInit` method on all controllers that have one\n forEach(elementControllers, function(controller) {\n if (isFunction(controller.instance.$onInit)) {\n controller.instance.$onInit();\n }\n });\n\n // PRELINKING\n for (i = 0, ii = preLinkFns.length; i < ii; i++) {\n linkFn = preLinkFns[i];\n invokeLinkFn(linkFn,\n linkFn.isolateScope ? isolateScope : scope,\n $element,\n attrs,\n linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n transcludeFn\n );\n }\n\n // RECURSION\n // We only pass the isolate scope, if the isolate directive has a template,\n // otherwise the child elements do not belong to the isolate directive.\n var scopeToChild = scope;\n if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {\n scopeToChild = isolateScope;\n }\n childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);\n\n // POSTLINKING\n for (i = postLinkFns.length - 1; i >= 0; i--) {\n linkFn = postLinkFns[i];\n invokeLinkFn(linkFn,\n linkFn.isolateScope ? isolateScope : scope,\n $element,\n attrs,\n linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n transcludeFn\n );\n }\n\n // This is the function that is injected as `$transclude`.\n // Note: all arguments are optional!\n function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {\n var transcludeControllers;\n // No scope passed in:\n if (!isScope(scope)) {\n slotName = futureParentElement;\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n if (slotName) {\n // slotTranscludeFn can be one of three things:\n // * a transclude function - a filled slot\n // * `null` - an optional slot that was not filled\n // * `undefined` - a slot that was not declared (i.e. invalid)\n var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];\n if (slotTranscludeFn) {\n return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n } else if (isUndefined(slotTranscludeFn)) {\n throw $compileMinErr('noslot',\n 'No parent directive that requires a transclusion with slot name \"{0}\". ' +\n 'Element: {1}',\n slotName, startingTag($element));\n }\n } else {\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }\n }\n }\n }\n\n // Depending upon the context in which a directive finds itself it might need to have a new isolated\n // or child scope created. For instance:\n // * if the directive has been pulled into a template because another directive with a higher priority\n // asked for element transclusion\n // * if the directive itself asks for transclusion but it is at the root of a template and the original\n // element was replaced. See https://github.com/angular/angular.js/issues/12936\n function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }\n\n /**\n * looks up the directive and decorates it with exception handling and proper parameters. We\n * call this the boundDirective.\n *\n * @param {string} name name of the directive to look up.\n * @param {string} location The directive must be found in specific format.\n * String containing any of theses characters:\n *\n * * `E`: element name\n * * `A': attribute\n * * `C`: class\n * * `M`: comment\n * @returns {boolean} true if directive was added.\n */\n function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,\n endAttrName) {\n if (name === ignoreDirective) return null;\n var match = null;\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix),\n i = 0, ii = directives.length; i < ii; i++) {\n try {\n directive = directives[i];\n if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&\n directive.restrict.indexOf(location) != -1) {\n if (startAttrName) {\n directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});\n }\n tDirectives.push(directive);\n match = directive;\n }\n } catch (e) { $exceptionHandler(e); }\n }\n }\n return match;\n }\n\n\n /**\n * looks up the directive and returns true if it is a multi-element directive,\n * and therefore requires DOM nodes between -start and -end markers to be grouped\n * together.\n *\n * @param {string} name name of the directive to look up.\n * @returns true if directive was registered as multi-element.\n */\n function directiveIsMultiElement(name) {\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix),\n i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n if (directive.multiElement) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * When the element is replaced with HTML template then the new attributes\n * on the template need to be merged with the existing attributes in the DOM.\n * The desired effect is to have both of the attributes present.\n *\n * @param {object} dst destination attributes (original DOM)\n * @param {object} src source attributes (from the directive template)\n */\n function mergeTemplateAttributes(dst, src) {\n var srcAttr = src.$attr,\n dstAttr = dst.$attr,\n $element = dst.$$element;\n\n // reapply the old attributes to the new element\n forEach(dst, function(value, key) {\n if (key.charAt(0) != '$') {\n if (src[key] && src[key] !== value) {\n value += (key === 'style' ? ';' : ' ') + src[key];\n }\n dst.$set(key, value, true, srcAttr[key]);\n }\n });\n\n // copy the new attributes on the old attrs object\n forEach(src, function(value, key) {\n if (key == 'class') {\n safeAddClass($element, value);\n dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;\n } else if (key == 'style') {\n $element.attr('style', $element.attr('style') + ';' + value);\n dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value;\n // `dst` will never contain hasOwnProperty as DOM parser won't let it.\n // You will get an \"InvalidCharacterError: DOM Exception 5\" error if you\n // have an attribute like \"has-own-property\" or \"data-has-own-property\", etc.\n } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {\n dst[key] = value;\n dstAttr[key] = srcAttr[key];\n }\n });\n }\n\n\n function compileTemplateUrl(directives, $compileNode, tAttrs,\n $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {\n var linkQueue = [],\n afterTemplateNodeLinkFn,\n afterTemplateChildLinkFn,\n beforeTemplateCompileNode = $compileNode[0],\n origAsyncDirective = directives.shift(),\n derivedSyncDirective = inherit(origAsyncDirective, {\n templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective\n }),\n templateUrl = (isFunction(origAsyncDirective.templateUrl))\n ? origAsyncDirective.templateUrl($compileNode, tAttrs)\n : origAsyncDirective.templateUrl,\n templateNamespace = origAsyncDirective.templateNamespace;\n\n $compileNode.empty();\n\n $templateRequest(templateUrl)\n .then(function(content) {\n var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;\n\n content = denormalizeTemplate(content);\n\n if (origAsyncDirective.replace) {\n if (jqLiteIsTextNode(content)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(templateNamespace, trim(content)));\n }\n compileNode = $template[0];\n\n if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt',\n \"Template for directive '{0}' must have exactly one root element. {1}\",\n origAsyncDirective.name, templateUrl);\n }\n\n tempTemplateAttrs = {$attr: {}};\n replaceWith($rootElement, $compileNode, compileNode);\n var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);\n\n if (isObject(origAsyncDirective.scope)) {\n // the original directive that caused the template to be loaded async required\n // an isolate scope\n markDirectiveScope(templateDirectives, true);\n }\n directives = templateDirectives.concat(directives);\n mergeTemplateAttributes(tAttrs, tempTemplateAttrs);\n } else {\n compileNode = beforeTemplateCompileNode;\n $compileNode.html(content);\n }\n\n directives.unshift(derivedSyncDirective);\n\n afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,\n childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,\n previousCompileContext);\n forEach($rootElement, function(node, i) {\n if (node == compileNode) {\n $rootElement[i] = $compileNode[0];\n }\n });\n afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);\n\n while (linkQueue.length) {\n var scope = linkQueue.shift(),\n beforeTemplateLinkNode = linkQueue.shift(),\n linkRootElement = linkQueue.shift(),\n boundTranscludeFn = linkQueue.shift(),\n linkNode = $compileNode[0];\n\n if (scope.$$destroyed) continue;\n\n if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {\n var oldClasses = beforeTemplateLinkNode.className;\n\n if (!(previousCompileContext.hasElementTranscludeDirective &&\n origAsyncDirective.replace)) {\n // it was cloned therefore we have to clone as well.\n linkNode = jqLiteClone(compileNode);\n }\n replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);\n\n // Copy in CSS classes from original node\n safeAddClass(jqLite(linkNode), oldClasses);\n }\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n } else {\n childBoundTranscludeFn = boundTranscludeFn;\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,\n childBoundTranscludeFn);\n }\n linkQueue = null;\n });\n\n return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {\n var childBoundTranscludeFn = boundTranscludeFn;\n if (scope.$$destroyed) return;\n if (linkQueue) {\n linkQueue.push(scope,\n node,\n rootElement,\n childBoundTranscludeFn);\n } else {\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);\n }\n };\n }\n\n\n /**\n * Sorting function for bound directives.\n */\n function byPriority(a, b) {\n var diff = b.priority - a.priority;\n if (diff !== 0) return diff;\n if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;\n return a.index - b.index;\n }\n\n function assertNoDuplicate(what, previousDirective, directive, element) {\n\n function wrapModuleNameIfDefined(moduleName) {\n return moduleName ?\n (' (module: ' + moduleName + ')') :\n '';\n }\n\n if (previousDirective) {\n throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}',\n previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName),\n directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element));\n }\n }\n\n\n function addTextInterpolateDirective(directives, text) {\n var interpolateFn = $interpolate(text, true);\n if (interpolateFn) {\n directives.push({\n priority: 0,\n compile: function textInterpolateCompileFn(templateNode) {\n var templateNodeParent = templateNode.parent(),\n hasCompileParent = !!templateNodeParent.length;\n\n // When transcluding a template that has bindings in the root\n // we don't have a parent and thus need to add the class during linking fn.\n if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);\n\n return function textInterpolateLinkFn(scope, node) {\n var parent = node.parent();\n if (!hasCompileParent) compile.$$addBindingClass(parent);\n compile.$$addBindingInfo(parent, interpolateFn.expressions);\n scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {\n node[0].nodeValue = value;\n });\n };\n }\n });\n }\n }\n\n\n function wrapTemplate(type, template) {\n type = lowercase(type || 'html');\n switch (type) {\n case 'svg':\n case 'math':\n var wrapper = document.createElement('div');\n wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>';\n return wrapper.childNodes[0].childNodes;\n default:\n return template;\n }\n }\n\n\n function getTrustedContext(node, attrNormalizedName) {\n if (attrNormalizedName == \"srcdoc\") {\n return $sce.HTML;\n }\n var tag = nodeName_(node);\n // maction[xlink:href] can source SVG. It's not limited to <maction>.\n if (attrNormalizedName == \"xlinkHref\" ||\n (tag == \"form\" && attrNormalizedName == \"action\") ||\n (tag != \"img\" && (attrNormalizedName == \"src\" ||\n attrNormalizedName == \"ngSrc\"))) {\n return $sce.RESOURCE_URL;\n }\n }\n\n\n function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) {\n var trustedContext = getTrustedContext(node, name);\n allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing;\n\n var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing);\n\n // no interpolation found -> ignore\n if (!interpolateFn) return;\n\n\n if (name === \"multiple\" && nodeName_(node) === \"select\") {\n throw $compileMinErr(\"selmulti\",\n \"Binding to the 'multiple' attribute is not supported. Element: {0}\",\n startingTag(node));\n }\n\n directives.push({\n priority: 100,\n compile: function() {\n return {\n pre: function attrInterpolatePreLinkFn(scope, element, attr) {\n var $$observers = (attr.$$observers || (attr.$$observers = createMap()));\n\n if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {\n throw $compileMinErr('nodomevents',\n \"Interpolations for HTML DOM event attributes are disallowed. Please use the \" +\n \"ng- versions (such as ng-click instead of onclick) instead.\");\n }\n\n // If the attribute has changed since last $interpolate()ed\n var newValue = attr[name];\n if (newValue !== value) {\n // we need to interpolate again since the attribute value has been updated\n // (e.g. by another directive's compile function)\n // ensure unset/empty values make interpolateFn falsy\n interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);\n value = newValue;\n }\n\n // if attribute was updated so that there is no interpolation going on we don't want to\n // register any observers\n if (!interpolateFn) return;\n\n // initialize attr object so that it's ready in case we need the value for isolate\n // scope initialization, otherwise the value would not be available from isolate\n // directive's linking fn during linking phase\n attr[name] = interpolateFn(scope);\n\n ($$observers[name] || ($$observers[name] = [])).$$inter = true;\n (attr.$$observers && attr.$$observers[name].$$scope || scope).\n $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {\n //special case for class attribute addition + removal\n //so that class changes can tap into the animation\n //hooks provided by the $animate service. Be sure to\n //skip animations when the first digest occurs (when\n //both the new and the old values are the same) since\n //the CSS classes are the non-interpolated values\n if (name === 'class' && newValue != oldValue) {\n attr.$updateClass(newValue, oldValue);\n } else {\n attr.$set(name, newValue);\n }\n });\n }\n };\n }\n });\n }\n\n\n /**\n * This is a special jqLite.replaceWith, which can replace items which\n * have no parents, provided that the containing jqLite collection is provided.\n *\n * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes\n * in the root of the tree.\n * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep\n * the shell, but replace its DOM node reference.\n * @param {Node} newNode The new DOM node.\n */\n function replaceWith($rootElement, elementsToRemove, newNode) {\n var firstElementToRemove = elementsToRemove[0],\n removeCount = elementsToRemove.length,\n parent = firstElementToRemove.parentNode,\n i, ii;\n\n if ($rootElement) {\n for (i = 0, ii = $rootElement.length; i < ii; i++) {\n if ($rootElement[i] == firstElementToRemove) {\n $rootElement[i++] = newNode;\n for (var j = i, j2 = j + removeCount - 1,\n jj = $rootElement.length;\n j < jj; j++, j2++) {\n if (j2 < jj) {\n $rootElement[j] = $rootElement[j2];\n } else {\n delete $rootElement[j];\n }\n }\n $rootElement.length -= removeCount - 1;\n\n // If the replaced element is also the jQuery .context then replace it\n // .context is a deprecated jQuery api, so we should set it only when jQuery set it\n // http://api.jquery.com/context/\n if ($rootElement.context === firstElementToRemove) {\n $rootElement.context = newNode;\n }\n break;\n }\n }\n }\n\n if (parent) {\n parent.replaceChild(newNode, firstElementToRemove);\n }\n\n // Append all the `elementsToRemove` to a fragment. This will...\n // - remove them from the DOM\n // - allow them to still be traversed with .nextSibling\n // - allow a single fragment.qSA to fetch all elements being removed\n var fragment = document.createDocumentFragment();\n for (i = 0; i < removeCount; i++) {\n fragment.appendChild(elementsToRemove[i]);\n }\n\n if (jqLite.hasData(firstElementToRemove)) {\n // Copy over user data (that includes Angular's $scope etc.). Don't copy private\n // data here because there's no public interface in jQuery to do that and copying over\n // event listeners (which is the main use of private data) wouldn't work anyway.\n jqLite.data(newNode, jqLite.data(firstElementToRemove));\n\n // Remove $destroy event listeners from `firstElementToRemove`\n jqLite(firstElementToRemove).off('$destroy');\n }\n\n // Cleanup any data/listeners on the elements and children.\n // This includes invoking the $destroy event on any elements with listeners.\n jqLite.cleanData(fragment.querySelectorAll('*'));\n\n // Update the jqLite collection to only contain the `newNode`\n for (i = 1; i < removeCount; i++) {\n delete elementsToRemove[i];\n }\n elementsToRemove[0] = newNode;\n elementsToRemove.length = 1;\n }\n\n\n function cloneAndAnnotateFn(fn, annotation) {\n return extend(function() { return fn.apply(null, arguments); }, fn, annotation);\n }\n\n\n function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {\n try {\n linkFn(scope, $element, attrs, controllers, transcludeFn);\n } catch (e) {\n $exceptionHandler(e, startingTag($element));\n }\n }\n\n\n // Set up $watches for isolate scope and controller bindings. This process\n // only occurs for isolate scopes and new scopes with controllerAs.\n function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {\n var removeWatchCollection = [];\n forEach(bindings, function(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, or &\n lastValue,\n parentGet, parentSet, compare, removeWatch;\n\n switch (mode) {\n\n case '@':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n destination[scopeName] = attrs[attrName] = void 0;\n }\n attrs.$observe(attrName, function(value) {\n if (isString(value)) {\n destination[scopeName] = value;\n }\n });\n attrs.$$observers[attrName].$$scope = scope;\n lastValue = attrs[attrName];\n if (isString(lastValue)) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(lastValue)(scope);\n } else if (isBoolean(lastValue)) {\n // If the attributes is one of the BOOLEAN_ATTR then Angular will have converted\n // the value to boolean rather than a string, so we special case this situation\n destination[scopeName] = lastValue;\n }\n break;\n\n case '=':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n attrs[attrName] = void 0;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!\",\n attrs[attrName], attrName, directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n if (definition.collection) {\n removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n removeWatchCollection.push(removeWatch);\n break;\n\n case '<':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n attrs[attrName] = void 0;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n\n destination[scopeName] = parentGet(scope);\n\n removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newParentValue) {\n destination[scopeName] = newParentValue;\n }, parentGet.literal);\n\n removeWatchCollection.push(removeWatch);\n break;\n\n case '&':\n // Don't assign Object.prototype method to scope\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n\n return removeWatchCollection.length && function removeWatches() {\n for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) {\n removeWatchCollection[i]();\n }\n };\n }\n }];\n}\n\nvar PREFIX_REGEXP = /^((?:x|data)[\\:\\-_])/i;\n/**\n * Converts all accepted directives format into proper directive name.\n * @param name Name to normalize\n */\nfunction directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}\n\n/**\n * @ngdoc type\n * @name $compile.directive.Attributes\n *\n * @description\n * A shared object between directive compile / linking functions which contains normalized DOM\n * element attributes. The values reflect current binding state `{{ }}`. The normalization is\n * needed since all of these are treated as equivalent in Angular:\n *\n * ```\n * <span ng:bind=\"a\" ng-bind=\"a\" data-ng-bind=\"a\" x-ng-bind=\"a\">\n * ```\n */\n\n/**\n * @ngdoc property\n * @name $compile.directive.Attributes#$attr\n *\n * @description\n * A map of DOM element attribute names to the normalized name. This is\n * needed to do reverse lookup from normalized name back to actual name.\n */\n\n\n/**\n * @ngdoc method\n * @name $compile.directive.Attributes#$set\n * @kind function\n *\n * @description\n * Set DOM element attribute value.\n *\n *\n * @param {string} name Normalized element attribute name of the property to modify. The name is\n * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}\n * property to the original name.\n * @param {string} value Value to set the attribute to. The value can be an interpolated string.\n */\n\n\n\n/**\n * Closure compiler type information\n */\n\nfunction nodesetLinkingFn(\n /* angular.Scope */ scope,\n /* NodeList */ nodeList,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction directiveLinkingFn(\n /* nodesetLinkingFn */ nodesetLinkingFn,\n /* angular.Scope */ scope,\n /* Node */ node,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction tokenDifference(str1, str2) {\n var values = '',\n tokens1 = str1.split(/\\s+/),\n tokens2 = str2.split(/\\s+/);\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token == tokens2[j]) continue outer;\n }\n values += (values.length > 0 ? ' ' : '') + token;\n }\n return values;\n}\n\nfunction removeComments(jqNodes) {\n jqNodes = jqLite(jqNodes);\n var i = jqNodes.length;\n\n if (i <= 1) {\n return jqNodes;\n }\n\n while (i--) {\n var node = jqNodes[i];\n if (node.nodeType === NODE_TYPE_COMMENT) {\n splice.call(jqNodes, i, 1);\n }\n }\n return jqNodes;\n}\n\nvar $controllerMinErr = minErr('$controller');\n\n\nvar CNTRL_REG = /^(\\S+)(\\s+as\\s+([\\w$]+))?$/;\nfunction identifierForController(controller, ident) {\n if (ident && isString(ident)) return ident;\n if (isString(controller)) {\n var match = CNTRL_REG.exec(controller);\n if (match) return match[3];\n }\n}\n\n\n/**\n * @ngdoc provider\n * @name $controllerProvider\n * @description\n * The {@link ng.$controller $controller service} is used by Angular to create new\n * controllers.\n *\n * This provider allows controller registration via the\n * {@link ng.$controllerProvider#register register} method.\n */\nfunction $ControllerProvider() {\n var controllers = {},\n globals = false;\n\n /**\n * @ngdoc method\n * @name $controllerProvider#register\n * @param {string|Object} name Controller name, or an object map of controllers where the keys are\n * the names and the values are the constructors.\n * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI\n * annotations in the array notation).\n */\n this.register = function(name, constructor) {\n assertNotHasOwnProperty(name, 'controller');\n if (isObject(name)) {\n extend(controllers, name);\n } else {\n controllers[name] = constructor;\n }\n };\n\n /**\n * @ngdoc method\n * @name $controllerProvider#allowGlobals\n * @description If called, allows `$controller` to find controller constructors on `window`\n */\n this.allowGlobals = function() {\n globals = true;\n };\n\n\n this.$get = ['$injector', '$window', function($injector, $window) {\n\n /**\n * @ngdoc service\n * @name $controller\n * @requires $injector\n *\n * @param {Function|string} constructor If called with a function then it's considered to be the\n * controller constructor function. Otherwise it's considered to be a string which is used\n * to retrieve the controller constructor using the following steps:\n *\n * * check if a controller with given name is registered via `$controllerProvider`\n * * check if evaluating the string on the current scope returns a constructor\n * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global\n * `window` object (not recommended)\n *\n * The string can use the `controller as property` syntax, where the controller instance is published\n * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n * to work correctly.\n *\n * @param {Object} locals Injection locals for Controller.\n * @return {Object} Instance of given controller.\n *\n * @description\n * `$controller` service is responsible for instantiating controllers.\n *\n * It's just a simple call to {@link auto.$injector $injector}, but extracted into\n * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).\n */\n return function(expression, locals, later, ident) {\n // PRIVATE API:\n // param `later` --- indicates that the controller's constructor is invoked at a later time.\n // If true, $controller will allocate the object with the correct\n // prototype chain, but will not invoke the controller until a returned\n // callback is invoked.\n // param `ident` --- An optional label which overrides the label parsed from the controller\n // expression, if any.\n var instance, match, constructor, identifier;\n later = later === true;\n if (ident && isString(ident)) {\n identifier = ident;\n }\n\n if (isString(expression)) {\n match = expression.match(CNTRL_REG);\n if (!match) {\n throw $controllerMinErr('ctrlfmt',\n \"Badly formed controller string '{0}'. \" +\n \"Must match `__name__ as __id__` or `__name__`.\", expression);\n }\n constructor = match[1],\n identifier = identifier || match[3];\n expression = controllers.hasOwnProperty(constructor)\n ? controllers[constructor]\n : getter(locals.$scope, constructor, true) ||\n (globals ? getter($window, constructor, true) : undefined);\n\n assertArgFn(expression, constructor, true);\n }\n\n if (later) {\n // Instantiate controller later:\n // This machinery is used to create an instance of the object before calling the\n // controller's constructor itself.\n //\n // This allows properties to be added to the controller before the constructor is\n // invoked. Primarily, this is used for isolate scope bindings in $compile.\n //\n // This feature is not intended for use by applications, and is thus not documented\n // publicly.\n // Object creation: http://jsperf.com/create-constructor/2\n var controllerPrototype = (isArray(expression) ?\n expression[expression.length - 1] : expression).prototype;\n instance = Object.create(controllerPrototype || null);\n\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n\n var instantiate;\n return instantiate = extend(function() {\n var result = $injector.invoke(expression, instance, locals, constructor);\n if (result !== instance && (isObject(result) || isFunction(result))) {\n instance = result;\n if (identifier) {\n // If result changed, re-assign controllerAs value to scope.\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n }\n return instance;\n }, {\n instance: instance,\n identifier: identifier\n });\n }\n\n instance = $injector.instantiate(expression, locals, constructor);\n\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n\n return instance;\n };\n\n function addIdentifier(locals, identifier, instance, name) {\n if (!(locals && isObject(locals.$scope))) {\n throw minErr('$controller')('noscp',\n \"Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.\",\n name, identifier);\n }\n\n locals.$scope[identifier] = instance;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $document\n * @requires $window\n *\n * @description\n * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.\n *\n * @example\n <example module=\"documentExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <p>$document title: <b ng-bind=\"title\"></b></p>\n <p>window.document title: <b ng-bind=\"windowTitle\"></b></p>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('documentExample', [])\n .controller('ExampleController', ['$scope', '$document', function($scope, $document) {\n $scope.title = $document[0].title;\n $scope.windowTitle = angular.element(window.document)[0].title;\n }]);\n </file>\n </example>\n */\nfunction $DocumentProvider() {\n this.$get = ['$window', function(window) {\n return jqLite(window.document);\n }];\n}\n\n/**\n * @ngdoc service\n * @name $exceptionHandler\n * @requires ng.$log\n *\n * @description\n * Any uncaught exception in angular expressions is delegated to this service.\n * The default implementation simply delegates to `$log.error` which logs it into\n * the browser console.\n *\n * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by\n * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.\n *\n * ## Example:\n *\n * ```js\n * angular.module('exceptionOverride', []).factory('$exceptionHandler', function() {\n * return function(exception, cause) {\n * exception.message += ' (caused by \"' + cause + '\")';\n * throw exception;\n * };\n * });\n * ```\n *\n * This example will override the normal action of `$exceptionHandler`, to make angular\n * exceptions fail hard when they happen, instead of just logging to the console.\n *\n * <hr />\n * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`\n * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}\n * (unless executed during a digest).\n *\n * If you wish, you can manually delegate exceptions, e.g.\n * `try { ... } catch(e) { $exceptionHandler(e); }`\n *\n * @param {Error} exception Exception associated with the error.\n * @param {string=} cause optional information about the context in which\n * the error was thrown.\n *\n */\nfunction $ExceptionHandlerProvider() {\n this.$get = ['$log', function($log) {\n return function(exception, cause) {\n $log.error.apply($log, arguments);\n };\n }];\n}\n\nvar $$ForceReflowProvider = function() {\n this.$get = ['$document', function($document) {\n return function(domNode) {\n //the line below will force the browser to perform a repaint so\n //that all the animated elements within the animation frame will\n //be properly updated and drawn on screen. This is required to\n //ensure that the preparation animation is properly flushed so that\n //the active state picks up from there. DO NOT REMOVE THIS LINE.\n //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH\n //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND\n //WILL TAKE YEARS AWAY FROM YOUR LIFE.\n if (domNode) {\n if (!domNode.nodeType && domNode instanceof jqLite) {\n domNode = domNode[0];\n }\n } else {\n domNode = $document[0].body;\n }\n return domNode.offsetWidth + 1;\n };\n }];\n};\n\nvar APPLICATION_JSON = 'application/json';\nvar CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};\nvar JSON_START = /^\\[|^\\{(?!\\{)/;\nvar JSON_ENDS = {\n '[': /]$/,\n '{': /}$/\n};\nvar JSON_PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\nvar $httpMinErr = minErr('$http');\nvar $httpMinErrLegacyFn = function(method) {\n return function() {\n throw $httpMinErr('legacy', 'The method `{0}` on the promise returned from `$http` has been disabled.', method);\n };\n};\n\nfunction serializeValue(v) {\n if (isObject(v)) {\n return isDate(v) ? v.toISOString() : toJson(v);\n }\n return v;\n}\n\n\nfunction $HttpParamSerializerProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializer\n * @description\n *\n * Default {@link $http `$http`} params serializer that converts objects to strings\n * according to the following rules:\n *\n * * `{'foo': 'bar'}` results in `foo=bar`\n * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)\n * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)\n * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D\"` (stringified and encoded representation of an object)\n *\n * Note that serializer will sort the request parameters alphabetically.\n * */\n\n this.$get = function() {\n return function ngParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n forEachSorted(params, function(value, key) {\n if (value === null || isUndefined(value)) return;\n if (isArray(value)) {\n forEach(value, function(v, k) {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v)));\n });\n } else {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));\n }\n });\n\n return parts.join('&');\n };\n };\n}\n\nfunction $HttpParamSerializerJQLikeProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializerJQLike\n * @description\n *\n * Alternative {@link $http `$http`} params serializer that follows\n * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.\n * The serializer will also sort the params alphabetically.\n *\n * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:\n *\n * ```js\n * $http({\n * url: myUrl,\n * method: 'GET',\n * params: myParams,\n * paramSerializer: '$httpParamSerializerJQLike'\n * });\n * ```\n *\n * It is also possible to set it as the default `paramSerializer` in the\n * {@link $httpProvider#defaults `$httpProvider`}.\n *\n * Additionally, you can inject the serializer and use it explicitly, for example to serialize\n * form data for submission:\n *\n * ```js\n * .controller(function($http, $httpParamSerializerJQLike) {\n * //...\n *\n * $http({\n * url: myUrl,\n * method: 'POST',\n * data: $httpParamSerializerJQLike(myData),\n * headers: {\n * 'Content-Type': 'application/x-www-form-urlencoded'\n * }\n * });\n *\n * });\n * ```\n *\n * */\n this.$get = function() {\n return function jQueryLikeParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n serialize(params, '', true);\n return parts.join('&');\n\n function serialize(toSerialize, prefix, topLevel) {\n if (toSerialize === null || isUndefined(toSerialize)) return;\n if (isArray(toSerialize)) {\n forEach(toSerialize, function(value, index) {\n serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']');\n });\n } else if (isObject(toSerialize) && !isDate(toSerialize)) {\n forEachSorted(toSerialize, function(value, key) {\n serialize(value, prefix +\n (topLevel ? '' : '[') +\n key +\n (topLevel ? '' : ']'));\n });\n } else {\n parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize)));\n }\n }\n };\n };\n}\n\nfunction defaultHttpResponseTransform(data, headers) {\n if (isString(data)) {\n // Strip json vulnerability protection prefix and trim whitespace\n var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();\n\n if (tempData) {\n var contentType = headers('Content-Type');\n if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {\n data = fromJson(tempData);\n }\n }\n }\n\n return data;\n}\n\nfunction isJsonLike(str) {\n var jsonStart = str.match(JSON_START);\n return jsonStart && JSON_ENDS[jsonStart[0]].test(str);\n}\n\n/**\n * Parse headers into key value object\n *\n * @param {string} headers Raw headers as a string\n * @returns {Object} Parsed headers as key value object\n */\nfunction parseHeaders(headers) {\n var parsed = createMap(), i;\n\n function fillInParsed(key, val) {\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n\n if (isString(headers)) {\n forEach(headers.split('\\n'), function(line) {\n i = line.indexOf(':');\n fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));\n });\n } else if (isObject(headers)) {\n forEach(headers, function(headerVal, headerKey) {\n fillInParsed(lowercase(headerKey), trim(headerVal));\n });\n }\n\n return parsed;\n}\n\n\n/**\n * Returns a function that provides access to parsed headers.\n *\n * Headers are lazy parsed when first requested.\n * @see parseHeaders\n *\n * @param {(string|Object)} headers Headers to provide access to.\n * @returns {function(string=)} Returns a getter function which if called with:\n *\n * - if called with single an argument returns a single header value or null\n * - if called with no arguments returns an object containing all headers.\n */\nfunction headersGetter(headers) {\n var headersObj;\n\n return function(name) {\n if (!headersObj) headersObj = parseHeaders(headers);\n\n if (name) {\n var value = headersObj[lowercase(name)];\n if (value === void 0) {\n value = null;\n }\n return value;\n }\n\n return headersObj;\n };\n}\n\n\n/**\n * Chain all given functions\n *\n * This function is used for both request and response transforming\n *\n * @param {*} data Data to transform.\n * @param {function(string=)} headers HTTP headers getter fn.\n * @param {number} status HTTP status code of the response.\n * @param {(Function|Array.<Function>)} fns Function or an array of functions.\n * @returns {*} Transformed data.\n */\nfunction transformData(data, headers, status, fns) {\n if (isFunction(fns)) {\n return fns(data, headers, status);\n }\n\n forEach(fns, function(fn) {\n data = fn(data, headers, status);\n });\n\n return data;\n}\n\n\nfunction isSuccess(status) {\n return 200 <= status && status < 300;\n}\n\n\n/**\n * @ngdoc provider\n * @name $httpProvider\n * @description\n * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.\n * */\nfunction $HttpProvider() {\n /**\n * @ngdoc property\n * @name $httpProvider#defaults\n * @description\n *\n * Object containing default values for all {@link ng.$http $http} requests.\n *\n * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`}\n * that will provide the cache for all requests who set their `cache` property to `true`.\n * If you set the `defaults.cache = false` then only requests that specify their own custom\n * cache object will be cached. See {@link $http#caching $http Caching} for more information.\n *\n * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.\n * Defaults value is `'XSRF-TOKEN'`.\n *\n * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the\n * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.\n *\n * - **`defaults.headers`** - {Object} - Default headers for all $http requests.\n * Refer to {@link ng.$http#setting-http-headers $http} for documentation on\n * setting default headers.\n * - **`defaults.headers.common`**\n * - **`defaults.headers.post`**\n * - **`defaults.headers.put`**\n * - **`defaults.headers.patch`**\n *\n *\n * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function\n * used to the prepare string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.\n * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.\n *\n **/\n var defaults = this.defaults = {\n // transform incoming response data\n transformResponse: [defaultHttpResponseTransform],\n\n // transform outgoing request data\n transformRequest: [function(d) {\n return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;\n }],\n\n // default headers\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON)\n },\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n paramSerializer: '$httpParamSerializer'\n };\n\n var useApplyAsync = false;\n /**\n * @ngdoc method\n * @name $httpProvider#useApplyAsync\n * @description\n *\n * Configure $http service to combine processing of multiple http responses received at around\n * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in\n * significant performance improvement for bigger applications that make many HTTP requests\n * concurrently (common during application bootstrap).\n *\n * Defaults to false. If no value is specified, returns the current configured value.\n *\n * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred\n * \"apply\" on the next tick, giving time for subsequent requests in a roughly ~10ms window\n * to load and share the same digest cycle.\n *\n * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n * otherwise, returns the current configured value.\n **/\n this.useApplyAsync = function(value) {\n if (isDefined(value)) {\n useApplyAsync = !!value;\n return this;\n }\n return useApplyAsync;\n };\n\n var useLegacyPromise = true;\n /**\n * @ngdoc method\n * @name $httpProvider#useLegacyPromiseExtensions\n * @description\n *\n * Configure `$http` service to return promises without the shorthand methods `success` and `error`.\n * This should be used to make sure that applications work without these methods.\n *\n * Defaults to true. If no value is specified, returns the current configured value.\n *\n * @param {boolean=} value If true, `$http` will return a promise with the deprecated legacy `success` and `error` methods.\n *\n * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n * otherwise, returns the current configured value.\n **/\n this.useLegacyPromiseExtensions = function(value) {\n if (isDefined(value)) {\n useLegacyPromise = !!value;\n return this;\n }\n return useLegacyPromise;\n };\n\n /**\n * @ngdoc property\n * @name $httpProvider#interceptors\n * @description\n *\n * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}\n * pre-processing of request or postprocessing of responses.\n *\n * These service factories are ordered by request, i.e. they are applied in the same order as the\n * array, on request, but reverse order, on response.\n *\n * {@link ng.$http#interceptors Interceptors detailed info}\n **/\n var interceptorFactories = this.interceptors = [];\n\n this.$get = ['$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector',\n function($httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector) {\n\n var defaultCache = $cacheFactory('$http');\n\n /**\n * Make sure that default param serializer is exposed as a function\n */\n defaults.paramSerializer = isString(defaults.paramSerializer) ?\n $injector.get(defaults.paramSerializer) : defaults.paramSerializer;\n\n /**\n * Interceptors stored in reverse order. Inner interceptors before outer interceptors.\n * The reversal is needed so that we can build up the interception chain around the\n * server request.\n */\n var reversedInterceptors = [];\n\n forEach(interceptorFactories, function(interceptorFactory) {\n reversedInterceptors.unshift(isString(interceptorFactory)\n ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));\n });\n\n /**\n * @ngdoc service\n * @kind function\n * @name $http\n * @requires ng.$httpBackend\n * @requires $cacheFactory\n * @requires $rootScope\n * @requires $q\n * @requires $injector\n *\n * @description\n * The `$http` service is a core Angular service that facilitates communication with the remote\n * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)\n * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).\n *\n * For unit testing applications that use `$http` service, see\n * {@link ngMock.$httpBackend $httpBackend mock}.\n *\n * For a higher level of abstraction, please check out the {@link ngResource.$resource\n * $resource} service.\n *\n * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by\n * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage\n * it is important to familiarize yourself with these APIs and the guarantees they provide.\n *\n *\n * ## General usage\n * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} —\n * that is used to generate an HTTP request and returns a {@link ng.$q promise}.\n *\n * ```js\n * // Simple GET request example:\n * $http({\n * method: 'GET',\n * url: '/someUrl'\n * }).then(function successCallback(response) {\n * // this callback will be called asynchronously\n * // when the response is available\n * }, function errorCallback(response) {\n * // called asynchronously if an error occurs\n * // or server returns response with an error status.\n * });\n * ```\n *\n * The response object has these properties:\n *\n * - **data** – `{string|Object}` – The response body transformed with the transform\n * functions.\n * - **status** – `{number}` – HTTP status code of the response.\n * - **headers** – `{function([headerName])}` – Header getter function.\n * - **config** – `{Object}` – The configuration object that was used to generate the request.\n * - **statusText** – `{string}` – HTTP status text of the response.\n *\n * A response status code between 200 and 299 is considered a success status and\n * will result in the success callback being called. Note that if the response is a redirect,\n * XMLHttpRequest will transparently follow it, meaning that the error callback will not be\n * called for such responses.\n *\n *\n * ## Shortcut methods\n *\n * Shortcut methods are also available. All shortcut methods require passing in the URL, and\n * request data must be passed in for POST/PUT requests. An optional config can be passed as the\n * last argument.\n *\n * ```js\n * $http.get('/someUrl', config).then(successCallback, errorCallback);\n * $http.post('/someUrl', data, config).then(successCallback, errorCallback);\n * ```\n *\n * Complete list of shortcut methods:\n *\n * - {@link ng.$http#get $http.get}\n * - {@link ng.$http#head $http.head}\n * - {@link ng.$http#post $http.post}\n * - {@link ng.$http#put $http.put}\n * - {@link ng.$http#delete $http.delete}\n * - {@link ng.$http#jsonp $http.jsonp}\n * - {@link ng.$http#patch $http.patch}\n *\n *\n * ## Writing Unit Tests that use $http\n * When unit testing (using {@link ngMock ngMock}), it is necessary to call\n * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending\n * request using trained responses.\n *\n * ```\n * $httpBackend.expectGET(...);\n * $http.get(...);\n * $httpBackend.flush();\n * ```\n *\n * ## Deprecation Notice\n * <div class=\"alert alert-danger\">\n * The `$http` legacy promise methods `success` and `error` have been deprecated.\n * Use the standard `then` method instead.\n * If {@link $httpProvider#useLegacyPromiseExtensions `$httpProvider.useLegacyPromiseExtensions`} is set to\n * `false` then these methods will throw {@link $http:legacy `$http/legacy`} error.\n * </div>\n *\n * ## Setting HTTP Headers\n *\n * The $http service will automatically add certain HTTP headers to all requests. These defaults\n * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration\n * object, which currently contains this default configuration:\n *\n * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):\n * - `Accept: application/json, text/plain, * / *`\n * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)\n * - `Content-Type: application/json`\n * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)\n * - `Content-Type: application/json`\n *\n * To add or overwrite these defaults, simply add or remove a property from these configuration\n * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object\n * with the lowercased HTTP method name as the key, e.g.\n * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`.\n *\n * The defaults can also be set at runtime via the `$http.defaults` object in the same\n * fashion. For example:\n *\n * ```\n * module.run(function($http) {\n * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w';\n * });\n * ```\n *\n * In addition, you can supply a `headers` property in the config object passed when\n * calling `$http(config)`, which overrides the defaults without changing them globally.\n *\n * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,\n * Use the `headers` property, setting the desired header to `undefined`. For example:\n *\n * ```js\n * var req = {\n * method: 'POST',\n * url: 'http://example.com',\n * headers: {\n * 'Content-Type': undefined\n * },\n * data: { test: 'test' }\n * }\n *\n * $http(req).then(function(){...}, function(){...});\n * ```\n *\n * ## Transforming Requests and Responses\n *\n * Both requests and responses can be transformed using transformation functions: `transformRequest`\n * and `transformResponse`. These properties can be a single function that returns\n * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,\n * which allows you to `push` or `unshift` a new transformation function into the transformation chain.\n *\n * ### Default Transformations\n *\n * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and\n * `defaults.transformResponse` properties. If a request does not provide its own transformations\n * then these will be applied.\n *\n * You can augment or replace the default transformations by modifying these properties by adding to or\n * replacing the array.\n *\n * Angular provides the following default transformations:\n *\n * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`):\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`):\n *\n * - If XSRF prefix is detected, strip it (see Security Considerations section below).\n * - If JSON response is detected, deserialize it using a JSON parser.\n *\n *\n * ### Overriding the Default Transformations Per Request\n *\n * If you wish override the request/response transformations only for a single request then provide\n * `transformRequest` and/or `transformResponse` properties on the configuration object passed\n * into `$http`.\n *\n * Note that if you provide these properties on the config object the default transformations will be\n * overwritten. If you wish to augment the default transformations then you must include them in your\n * local transformation array.\n *\n * The following code demonstrates adding a new response transformation to be run after the default response\n * transformations have been run.\n *\n * ```js\n * function appendTransform(defaults, transform) {\n *\n * // We can't guarantee that the default transformation is an array\n * defaults = angular.isArray(defaults) ? defaults : [defaults];\n *\n * // Append the new transformation to the defaults\n * return defaults.concat(transform);\n * }\n *\n * $http({\n * url: '...',\n * method: 'GET',\n * transformResponse: appendTransform($http.defaults.transformResponse, function(value) {\n * return doTransform(value);\n * })\n * });\n * ```\n *\n *\n * ## Caching\n *\n * To enable caching, set the request configuration `cache` property to `true` (to use default\n * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}).\n * When the cache is enabled, `$http` stores the response from the server in the specified\n * cache. The next time the same request is made, the response is served from the cache without\n * sending a request to the server.\n *\n * Note that even if the response is served from cache, delivery of the data is asynchronous in\n * the same way that real requests are.\n *\n * If there are multiple GET requests for the same URL that should be cached using the same\n * cache, but the cache is not populated yet, only one request to the server will be made and\n * the remaining requests will be fulfilled using the response from the first request.\n *\n * You can change the default cache to a new object (built with\n * {@link ng.$cacheFactory `$cacheFactory`}) by updating the\n * {@link ng.$http#defaults `$http.defaults.cache`} property. All requests who set\n * their `cache` property to `true` will now use this cache object.\n *\n * If you set the default cache to `false` then only requests that specify their own custom\n * cache object will be cached.\n *\n * ## Interceptors\n *\n * Before you start creating interceptors, be sure to understand the\n * {@link ng.$q $q and deferred/promise APIs}.\n *\n * For purposes of global error handling, authentication, or any kind of synchronous or\n * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be\n * able to intercept requests before they are handed to the server and\n * responses before they are handed over to the application code that\n * initiated these requests. The interceptors leverage the {@link ng.$q\n * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.\n *\n * The interceptors are service factories that are registered with the `$httpProvider` by\n * adding them to the `$httpProvider.interceptors` array. The factory is called and\n * injected with dependencies (if specified) and returns the interceptor.\n *\n * There are two kinds of interceptors (and two kinds of rejection interceptors):\n *\n * * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to\n * modify the `config` object or create a new one. The function needs to return the `config`\n * object directly, or a promise containing the `config` or a new `config` object.\n * * `requestError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n * * `response`: interceptors get called with http `response` object. The function is free to\n * modify the `response` object or create a new one. The function needs to return the `response`\n * object directly, or as a promise containing the `response` or a new `response` object.\n * * `responseError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n *\n *\n * ```js\n * // register the interceptor as a service\n * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {\n * return {\n * // optional method\n * 'request': function(config) {\n * // do something on success\n * return config;\n * },\n *\n * // optional method\n * 'requestError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * },\n *\n *\n *\n * // optional method\n * 'response': function(response) {\n * // do something on success\n * return response;\n * },\n *\n * // optional method\n * 'responseError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * }\n * };\n * });\n *\n * $httpProvider.interceptors.push('myHttpInterceptor');\n *\n *\n * // alternatively, register the interceptor via an anonymous factory\n * $httpProvider.interceptors.push(function($q, dependency1, dependency2) {\n * return {\n * 'request': function(config) {\n * // same as above\n * },\n *\n * 'response': function(response) {\n * // same as above\n * }\n * };\n * });\n * ```\n *\n * ## Security Considerations\n *\n * When designing web applications, consider security threats from:\n *\n * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)\n *\n * Both server and the client must cooperate in order to eliminate these threats. Angular comes\n * pre-configured with strategies that address these issues, but for this to work backend server\n * cooperation is required.\n *\n * ### JSON Vulnerability Protection\n *\n * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * allows third party website to turn your JSON resource URL into\n * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To\n * counter this your server can prefix all JSON requests with following string `\")]}',\\n\"`.\n * Angular will automatically strip the prefix before processing it as JSON.\n *\n * For example if your server needs to return:\n * ```js\n * ['one','two']\n * ```\n *\n * which is vulnerable to attack, your server can return:\n * ```js\n * )]}',\n * ['one','two']\n * ```\n *\n * Angular will strip the prefix, before processing the JSON.\n *\n *\n * ### Cross Site Request Forgery (XSRF) Protection\n *\n * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by\n * which the attacker can trick an authenticated user into unknowingly executing actions on your\n * website. Angular provides a mechanism to counter XSRF. When performing XHR requests, the\n * $http service reads a token from a cookie (by default, `XSRF-TOKEN`) and sets it as an HTTP\n * header (`X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read the\n * cookie, your server can be assured that the XHR came from JavaScript running on your domain.\n * The header will not be set for cross-domain requests.\n *\n * To take advantage of this, your server needs to set a token in a JavaScript readable session\n * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the\n * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure\n * that only JavaScript running on your domain could have sent the request. The token must be\n * unique for each user and must be verifiable by the server (to prevent the JavaScript from\n * making up its own tokens). We recommend that the token is a digest of your site's\n * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography))\n * for added security.\n *\n * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName\n * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,\n * or the per-request config object.\n *\n * In order to prevent collisions in environments where multiple Angular apps share the\n * same domain or subdomain, we recommend that each application uses unique cookie name.\n *\n * @param {object} config Object describing the request to be made and how it should be\n * processed. The object has following properties:\n *\n * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)\n * - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.\n * - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be serialized\n * with the `paramSerializer` and appended as GET parameters.\n * - **data** – `{string|Object}` – Data to be sent as the request message data.\n * - **headers** – `{Object}` – Map of strings or functions which return strings representing\n * HTTP headers to send to the server. If the return value of a function is null, the\n * header will not be sent. Functions accept a config object as an argument.\n * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.\n * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.\n * - **transformRequest** –\n * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –\n * transform function or an array of such functions. The transform function takes the http\n * request body and headers and returns its transformed (typically serialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **transformResponse** –\n * `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` –\n * transform function or an array of such functions. The transform function takes the http\n * response body, headers and status and returns its transformed (typically deserialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default TransformationjqLiks}\n * - **paramSerializer** - `{string|function(Object<string,string>):string}` - A function used to\n * prepare the string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as function registered with the\n * {@link $injector $injector}, which means you can create your own serializer\n * by registering it as a {@link auto.$provide#service service}.\n * The default serializer is the {@link $httpParamSerializer $httpParamSerializer};\n * alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike}\n * - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the\n * GET request, otherwise if a cache instance built with\n * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for\n * caching.\n * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}\n * that should abort the request when resolved.\n * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the\n * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)\n * for more information.\n * - **responseType** - `{string}` - see\n * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype).\n *\n * @returns {HttpPromise} Returns a {@link ng.$q `Promise}` that will be resolved to a response object\n * when the request succeeds or fails.\n *\n *\n * @property {Array.<Object>} pendingRequests Array of config objects for currently pending\n * requests. This is primarily meant to be used for debugging purposes.\n *\n *\n * @example\n<example module=\"httpExample\">\n<file name=\"index.html\">\n <div ng-controller=\"FetchController\">\n <select ng-model=\"method\" aria-label=\"Request method\">\n <option>GET</option>\n <option>JSONP</option>\n </select>\n <input type=\"text\" ng-model=\"url\" size=\"80\" aria-label=\"URL\" />\n <button id=\"fetchbtn\" ng-click=\"fetch()\">fetch</button><br>\n <button id=\"samplegetbtn\" ng-click=\"updateModel('GET', 'http-hello.html')\">Sample GET</button>\n <button id=\"samplejsonpbtn\"\n ng-click=\"updateModel('JSONP',\n 'https://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')\">\n Sample JSONP\n </button>\n <button id=\"invalidjsonpbtn\"\n ng-click=\"updateModel('JSONP', 'https://angularjs.org/doesntexist&callback=JSON_CALLBACK')\">\n Invalid JSONP\n </button>\n <pre>http status code: {{status}}</pre>\n <pre>http response data: {{data}}</pre>\n </div>\n</file>\n<file name=\"script.js\">\n angular.module('httpExample', [])\n .controller('FetchController', ['$scope', '$http', '$templateCache',\n function($scope, $http, $templateCache) {\n $scope.method = 'GET';\n $scope.url = 'http-hello.html';\n\n $scope.fetch = function() {\n $scope.code = null;\n $scope.response = null;\n\n $http({method: $scope.method, url: $scope.url, cache: $templateCache}).\n then(function(response) {\n $scope.status = response.status;\n $scope.data = response.data;\n }, function(response) {\n $scope.data = response.data || \"Request failed\";\n $scope.status = response.status;\n });\n };\n\n $scope.updateModel = function(method, url) {\n $scope.method = method;\n $scope.url = url;\n };\n }]);\n</file>\n<file name=\"http-hello.html\">\n Hello, $http!\n</file>\n<file name=\"protractor.js\" type=\"protractor\">\n var status = element(by.binding('status'));\n var data = element(by.binding('data'));\n var fetchBtn = element(by.id('fetchbtn'));\n var sampleGetBtn = element(by.id('samplegetbtn'));\n var sampleJsonpBtn = element(by.id('samplejsonpbtn'));\n var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));\n\n it('should make an xhr GET request', function() {\n sampleGetBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('200');\n expect(data.getText()).toMatch(/Hello, \\$http!/);\n });\n\n// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185\n// it('should make a JSONP request to angularjs.org', function() {\n// sampleJsonpBtn.click();\n// fetchBtn.click();\n// expect(status.getText()).toMatch('200');\n// expect(data.getText()).toMatch(/Super Hero!/);\n// });\n\n it('should make JSONP request to invalid URL and invoke the error handler',\n function() {\n invalidJsonpBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('0');\n expect(data.getText()).toMatch('Request failed');\n });\n</file>\n</example>\n */\n function $http(requestConfig) {\n\n if (!isObject(requestConfig)) {\n throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig);\n }\n\n if (!isString(requestConfig.url)) {\n throw minErr('$http')('badreq', 'Http request configuration url must be a string. Received: {0}', requestConfig.url);\n }\n\n var config = extend({\n method: 'get',\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse,\n paramSerializer: defaults.paramSerializer\n }, requestConfig);\n\n config.headers = mergeHeaders(requestConfig);\n config.method = uppercase(config.method);\n config.paramSerializer = isString(config.paramSerializer) ?\n $injector.get(config.paramSerializer) : config.paramSerializer;\n\n var serverRequest = function(config) {\n var headers = config.headers;\n var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);\n\n // strip content-type if data is undefined\n if (isUndefined(reqData)) {\n forEach(headers, function(value, header) {\n if (lowercase(header) === 'content-type') {\n delete headers[header];\n }\n });\n }\n\n if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {\n config.withCredentials = defaults.withCredentials;\n }\n\n // send request\n return sendReq(config, reqData).then(transformResponse, transformResponse);\n };\n\n var chain = [serverRequest, undefined];\n var promise = $q.when(config);\n\n // apply interceptors\n forEach(reversedInterceptors, function(interceptor) {\n if (interceptor.request || interceptor.requestError) {\n chain.unshift(interceptor.request, interceptor.requestError);\n }\n if (interceptor.response || interceptor.responseError) {\n chain.push(interceptor.response, interceptor.responseError);\n }\n });\n\n while (chain.length) {\n var thenFn = chain.shift();\n var rejectFn = chain.shift();\n\n promise = promise.then(thenFn, rejectFn);\n }\n\n if (useLegacyPromise) {\n promise.success = function(fn) {\n assertArgFn(fn, 'fn');\n\n promise.then(function(response) {\n fn(response.data, response.status, response.headers, config);\n });\n return promise;\n };\n\n promise.error = function(fn) {\n assertArgFn(fn, 'fn');\n\n promise.then(null, function(response) {\n fn(response.data, response.status, response.headers, config);\n });\n return promise;\n };\n } else {\n promise.success = $httpMinErrLegacyFn('success');\n promise.error = $httpMinErrLegacyFn('error');\n }\n\n return promise;\n\n function transformResponse(response) {\n // make a copy since the response must be cacheable\n var resp = extend({}, response);\n resp.data = transformData(response.data, response.headers, response.status,\n config.transformResponse);\n return (isSuccess(response.status))\n ? resp\n : $q.reject(resp);\n }\n\n function executeHeaderFns(headers, config) {\n var headerContent, processedHeaders = {};\n\n forEach(headers, function(headerFn, header) {\n if (isFunction(headerFn)) {\n headerContent = headerFn(config);\n if (headerContent != null) {\n processedHeaders[header] = headerContent;\n }\n } else {\n processedHeaders[header] = headerFn;\n }\n });\n\n return processedHeaders;\n }\n\n function mergeHeaders(config) {\n var defHeaders = defaults.headers,\n reqHeaders = extend({}, config.headers),\n defHeaderName, lowercaseDefHeaderName, reqHeaderName;\n\n defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);\n\n // using for-in instead of forEach to avoid unnecessary iteration after header has been found\n defaultHeadersIteration:\n for (defHeaderName in defHeaders) {\n lowercaseDefHeaderName = lowercase(defHeaderName);\n\n for (reqHeaderName in reqHeaders) {\n if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {\n continue defaultHeadersIteration;\n }\n }\n\n reqHeaders[defHeaderName] = defHeaders[defHeaderName];\n }\n\n // execute if header value is a function for merged headers\n return executeHeaderFns(reqHeaders, shallowCopy(config));\n }\n }\n\n $http.pendingRequests = [];\n\n /**\n * @ngdoc method\n * @name $http#get\n *\n * @description\n * Shortcut method to perform `GET` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#delete\n *\n * @description\n * Shortcut method to perform `DELETE` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#head\n *\n * @description\n * Shortcut method to perform `HEAD` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#jsonp\n *\n * @description\n * Shortcut method to perform `JSONP` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request.\n * The name of the callback should be the string `JSON_CALLBACK`.\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n createShortMethods('get', 'delete', 'head', 'jsonp');\n\n /**\n * @ngdoc method\n * @name $http#post\n *\n * @description\n * Shortcut method to perform `POST` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#put\n *\n * @description\n * Shortcut method to perform `PUT` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#patch\n *\n * @description\n * Shortcut method to perform `PATCH` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n createShortMethodsWithData('post', 'put', 'patch');\n\n /**\n * @ngdoc property\n * @name $http#defaults\n *\n * @description\n * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of\n * default headers, withCredentials as well as request and response transformations.\n *\n * See \"Setting HTTP Headers\" and \"Transforming Requests and Responses\" sections above.\n */\n $http.defaults = defaults;\n\n\n return $http;\n\n\n function createShortMethods(names) {\n forEach(arguments, function(name) {\n $http[name] = function(url, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url\n }));\n };\n });\n }\n\n\n function createShortMethodsWithData(name) {\n forEach(arguments, function(name) {\n $http[name] = function(url, data, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url,\n data: data\n }));\n };\n });\n }\n\n\n /**\n * Makes the request.\n *\n * !!! ACCESSES CLOSURE VARS:\n * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests\n */\n function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType);\n }\n\n return promise;\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }\n\n\n function buildUrl(url, serializedParams) {\n if (serializedParams.length > 0) {\n url += ((url.indexOf('?') == -1) ? '?' : '&') + serializedParams;\n }\n return url;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $xhrFactory\n *\n * @description\n * Factory function used to create XMLHttpRequest objects.\n *\n * Replace or decorate this service to create your own custom XMLHttpRequest objects.\n *\n * ```\n * angular.module('myApp', [])\n * .factory('$xhrFactory', function() {\n * return function createXhr(method, url) {\n * return new window.XMLHttpRequest({mozSystem: true});\n * };\n * });\n * ```\n *\n * @param {string} method HTTP method of the request (GET, POST, PUT, ..)\n * @param {string} url URL of the request.\n */\nfunction $xhrFactoryProvider() {\n this.$get = function() {\n return function createXhr() {\n return new window.XMLHttpRequest();\n };\n };\n}\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @requires $window\n * @requires $document\n * @requires $xhrFactory\n *\n * @description\n * HTTP backend used by the {@link ng.$http service} that delegates to\n * XMLHttpRequest object or JSONP and deals with browser incompatibilities.\n *\n * You should never need to use this service directly, instead use the higher-level abstractions:\n * {@link ng.$http $http} or {@link ngResource.$resource $resource}.\n *\n * During testing this implementation is swapped with {@link ngMock.$httpBackend mock\n * $httpBackend} which can be trained with responses.\n */\nfunction $HttpBackendProvider() {\n this.$get = ['$browser', '$window', '$document', '$xhrFactory', function($browser, $window, $document, $xhrFactory) {\n return createHttpBackend($browser, $xhrFactory, $browser.defer, $window.angular.callbacks, $document[0]);\n }];\n}\n\nfunction createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {\n // TODO(vojta): fix the signature\n return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {\n $browser.$$incOutstandingRequestCount();\n url = url || $browser.url();\n\n if (lowercase(method) == 'jsonp') {\n var callbackId = '_' + (callbacks.counter++).toString(36);\n callbacks[callbackId] = function(data) {\n callbacks[callbackId].data = data;\n callbacks[callbackId].called = true;\n };\n\n var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),\n callbackId, function(status, text) {\n completeRequest(callback, status, callbacks[callbackId].data, \"\", text);\n callbacks[callbackId] = noop;\n });\n } else {\n\n var xhr = createXhr(method, url);\n\n xhr.open(method, url, true);\n forEach(headers, function(value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n\n xhr.onload = function requestLoaded() {\n var statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n var response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n var status = xhr.status === 1223 ? 204 : xhr.status;\n\n // fix status code when it is 0 (0 status is undocumented).\n // Occurs when accessing file resources or on Android 4.1 stock browser\n // while retrieving files from application cache.\n if (status === 0) {\n status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;\n }\n\n completeRequest(callback,\n status,\n response,\n xhr.getAllResponseHeaders(),\n statusText);\n };\n\n var requestError = function() {\n // The response is always empty\n // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n completeRequest(callback, -1, null, null, '');\n };\n\n xhr.onerror = requestError;\n xhr.onabort = requestError;\n\n if (withCredentials) {\n xhr.withCredentials = true;\n }\n\n if (responseType) {\n try {\n xhr.responseType = responseType;\n } catch (e) {\n // WebKit added support for the json responseType value on 09/03/2013\n // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are\n // known to throw when setting the value \"json\" as the response type. Other older\n // browsers implementing the responseType\n //\n // The json response type can be ignored if not supported, because JSON payloads are\n // parsed on the client-side regardless.\n if (responseType !== 'json') {\n throw e;\n }\n }\n }\n\n xhr.send(isUndefined(post) ? null : post);\n }\n\n if (timeout > 0) {\n var timeoutId = $browserDefer(timeoutRequest, timeout);\n } else if (isPromiseLike(timeout)) {\n timeout.then(timeoutRequest);\n }\n\n\n function timeoutRequest() {\n jsonpDone && jsonpDone();\n xhr && xhr.abort();\n }\n\n function completeRequest(callback, status, response, headersString, statusText) {\n // cancel timeout and subsequent timeout promise resolution\n if (isDefined(timeoutId)) {\n $browserDefer.cancel(timeoutId);\n }\n jsonpDone = xhr = null;\n\n callback(status, response, headersString, statusText);\n $browser.$$completeOutstandingRequest(noop);\n }\n };\n\n function jsonpReq(url, callbackId, done) {\n // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.:\n // - fetches local scripts via XHR and evals them\n // - adds and immediately removes script elements from the document\n var script = rawDocument.createElement('script'), callback = null;\n script.type = \"text/javascript\";\n script.src = url;\n script.async = true;\n\n callback = function(event) {\n removeEventListenerFn(script, \"load\", callback);\n removeEventListenerFn(script, \"error\", callback);\n rawDocument.body.removeChild(script);\n script = null;\n var status = -1;\n var text = \"unknown\";\n\n if (event) {\n if (event.type === \"load\" && !callbacks[callbackId].called) {\n event = { type: \"error\" };\n }\n text = event.type;\n status = event.type === \"error\" ? 404 : 200;\n }\n\n if (done) {\n done(status, text);\n }\n };\n\n addEventListenerFn(script, \"load\", callback);\n addEventListenerFn(script, \"error\", callback);\n rawDocument.body.appendChild(script);\n return callback;\n }\n}\n\nvar $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');\n$interpolateMinErr.throwNoconcat = function(text) {\n throw $interpolateMinErr('noconcat',\n \"Error while interpolating: {0}\\nStrict Contextual Escaping disallows \" +\n \"interpolations that concatenate multiple expressions when a trusted value is \" +\n \"required. See http://docs.angularjs.org/api/ng.$sce\", text);\n};\n\n$interpolateMinErr.interr = function(text, err) {\n return $interpolateMinErr('interr', \"Can't interpolate: {0}\\n{1}\", text, err.toString());\n};\n\n/**\n * @ngdoc provider\n * @name $interpolateProvider\n *\n * @description\n *\n * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.\n *\n * <div class=\"alert alert-danger\">\n * This feature is sometimes used to mix different markup languages, e.g. to wrap an Angular\n * template within a Python Jinja template (or any other template language). Mixing templating\n * languages is **very dangerous**. The embedding template language will not safely escape Angular\n * expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS)\n * security bugs!\n * </div>\n *\n * @example\n<example name=\"custom-interpolation-markup\" module=\"customInterpolationApp\">\n<file name=\"index.html\">\n<script>\n var customInterpolationApp = angular.module('customInterpolationApp', []);\n\n customInterpolationApp.config(function($interpolateProvider) {\n $interpolateProvider.startSymbol('//');\n $interpolateProvider.endSymbol('//');\n });\n\n\n customInterpolationApp.controller('DemoController', function() {\n this.label = \"This binding is brought you by // interpolation symbols.\";\n });\n</script>\n<div ng-controller=\"DemoController as demo\">\n //demo.label//\n</div>\n</file>\n<file name=\"protractor.js\" type=\"protractor\">\n it('should interpolate binding with custom symbols', function() {\n expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');\n });\n</file>\n</example>\n */\nfunction $InterpolateProvider() {\n var startSymbol = '{{';\n var endSymbol = '}}';\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#startSymbol\n * @description\n * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.\n *\n * @param {string=} value new value to set the starting symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.startSymbol = function(value) {\n if (value) {\n startSymbol = value;\n return this;\n } else {\n return startSymbol;\n }\n };\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * @param {string=} value new value to set the ending symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.endSymbol = function(value) {\n if (value) {\n endSymbol = value;\n return this;\n } else {\n return endSymbol;\n }\n };\n\n\n this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {\n var startSymbolLength = startSymbol.length,\n endSymbolLength = endSymbol.length,\n escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),\n escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');\n\n function escape(ch) {\n return '\\\\\\\\\\\\' + ch;\n }\n\n function unescapeText(text) {\n return text.replace(escapedStartRegexp, startSymbol).\n replace(escapedEndRegexp, endSymbol);\n }\n\n function stringify(value) {\n if (value == null) { // null || undefined\n return '';\n }\n switch (typeof value) {\n case 'string':\n break;\n case 'number':\n value = '' + value;\n break;\n default:\n value = toJson(value);\n }\n\n return value;\n }\n\n //TODO: this is the same as the constantWatchDelegate in parse.js\n function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }\n\n /**\n * @ngdoc service\n * @name $interpolate\n * @kind function\n *\n * @requires $parse\n * @requires $sce\n *\n * @description\n *\n * Compiles a string with markup into an interpolation function. This service is used by the\n * HTML {@link ng.$compile $compile} service for data binding. See\n * {@link ng.$interpolateProvider $interpolateProvider} for configuring the\n * interpolation markup.\n *\n *\n * ```js\n * var $interpolate = ...; // injected\n * var exp = $interpolate('Hello {{name | uppercase}}!');\n * expect(exp({name:'Angular'})).toEqual('Hello ANGULAR!');\n * ```\n *\n * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is\n * `true`, the interpolation function will return `undefined` unless all embedded expressions\n * evaluate to a value other than `undefined`.\n *\n * ```js\n * var $interpolate = ...; // injected\n * var context = {greeting: 'Hello', name: undefined };\n *\n * // default \"forgiving\" mode\n * var exp = $interpolate('{{greeting}} {{name}}!');\n * expect(exp(context)).toEqual('Hello !');\n *\n * // \"allOrNothing\" mode\n * exp = $interpolate('{{greeting}} {{name}}!', false, null, true);\n * expect(exp(context)).toBeUndefined();\n * context.name = 'Angular';\n * expect(exp(context)).toEqual('Hello Angular!');\n * ```\n *\n * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.\n *\n * ####Escaped Interpolation\n * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers\n * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).\n * It will be rendered as a regular start/end marker, and will not be interpreted as an expression\n * or binding.\n *\n * This enables web-servers to prevent script injection attacks and defacing attacks, to some\n * degree, while also enabling code examples to work without relying on the\n * {@link ng.directive:ngNonBindable ngNonBindable} directive.\n *\n * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,\n * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all\n * interpolation start/end markers with their escaped counterparts.**\n *\n * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered\n * output when the $interpolate service processes the text. So, for HTML elements interpolated\n * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter\n * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,\n * this is typically useful only when user-data is used in rendering a template from the server, or\n * when otherwise untrusted data is used by a directive.\n *\n * <example>\n * <file name=\"index.html\">\n * <div ng-init=\"username='A user'\">\n * <p ng-init=\"apptitle='Escaping demo'\">{{apptitle}}: \\{\\{ username = \"defaced value\"; \\}\\}\n * </p>\n * <p><strong>{{username}}</strong> attempts to inject code which will deface the\n * application, but fails to accomplish their task, because the server has correctly\n * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)\n * characters.</p>\n * <p>Instead, the result of the attempted script injection is visible, and can be removed\n * from the database by an administrator.</p>\n * </div>\n * </file>\n * </example>\n *\n * @param {string} text The text with markup to interpolate.\n * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have\n * embedded expression in order to return an interpolation function. Strings with no\n * embedded expression will return null for the interpolation function.\n * @param {string=} trustedContext when provided, the returned function passes the interpolated\n * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,\n * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that\n * provides Strict Contextual Escaping for details.\n * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined\n * unless all embedded expressions evaluate to a value other than `undefined`.\n * @returns {function(context)} an interpolation function which is used to compute the\n * interpolated string. The function has these parameters:\n *\n * - `context`: evaluation context for all expressions embedded in the interpolated text\n */\n function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {\n // Provide a quick exit and simplified result function for text with no interpolation\n if (!text.length || text.indexOf(startSymbol) === -1) {\n var constantInterp;\n if (!mustHaveExpression) {\n var unescapedText = unescapeText(text);\n constantInterp = valueFn(unescapedText);\n constantInterp.exp = text;\n constantInterp.expressions = [];\n constantInterp.$$watchDelegate = constantWatchDelegate;\n }\n return constantInterp;\n }\n\n allOrNothing = !!allOrNothing;\n var startIndex,\n endIndex,\n index = 0,\n expressions = [],\n parseFns = [],\n textLength = text.length,\n exp,\n concat = [],\n expressionPositions = [];\n\n while (index < textLength) {\n if (((startIndex = text.indexOf(startSymbol, index)) != -1) &&\n ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) {\n if (index !== startIndex) {\n concat.push(unescapeText(text.substring(index, startIndex)));\n }\n exp = text.substring(startIndex + startSymbolLength, endIndex);\n expressions.push(exp);\n parseFns.push($parse(exp, parseStringifyInterceptor));\n index = endIndex + endSymbolLength;\n expressionPositions.push(concat.length);\n concat.push('');\n } else {\n // we did not find an interpolation, so we have to add the remainder to the separators array\n if (index !== textLength) {\n concat.push(unescapeText(text.substring(index)));\n }\n break;\n }\n }\n\n // Concatenating expressions makes it hard to reason about whether some combination of\n // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a\n // single expression be used for iframe[src], object[src], etc., we ensure that the value\n // that's used is assigned or constructed by some JS code somewhere that is more testable or\n // make it obvious that you bound the value to some user controlled value. This helps reduce\n // the load when auditing for XSS issues.\n if (trustedContext && concat.length > 1) {\n $interpolateMinErr.throwNoconcat(text);\n }\n\n if (!mustHaveExpression || expressions.length) {\n var compute = function(values) {\n for (var i = 0, ii = expressions.length; i < ii; i++) {\n if (allOrNothing && isUndefined(values[i])) return;\n concat[expressionPositions[i]] = values[i];\n }\n return concat.join('');\n };\n\n var getValue = function(value) {\n return trustedContext ?\n $sce.getTrusted(trustedContext, value) :\n $sce.valueOf(value);\n };\n\n return extend(function interpolationFn(context) {\n var i = 0;\n var ii = expressions.length;\n var values = new Array(ii);\n\n try {\n for (; i < ii; i++) {\n values[i] = parseFns[i](context);\n }\n\n return compute(values);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n\n }, {\n // all of these properties are undocumented for now\n exp: text, //just for compatibility with regular watchers created via $watch\n expressions: expressions,\n $$watchDelegate: function(scope, listener) {\n var lastValue;\n return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) {\n var currValue = compute(values);\n if (isFunction(listener)) {\n listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);\n }\n lastValue = currValue;\n });\n }\n });\n }\n\n function parseStringifyInterceptor(value) {\n try {\n value = getValue(value);\n return allOrNothing && !isDefined(value) ? value : stringify(value);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $interpolate#startSymbol\n * @description\n * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.\n *\n * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change\n * the symbol.\n *\n * @returns {string} start symbol.\n */\n $interpolate.startSymbol = function() {\n return startSymbol;\n };\n\n\n /**\n * @ngdoc method\n * @name $interpolate#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change\n * the symbol.\n *\n * @returns {string} end symbol.\n */\n $interpolate.endSymbol = function() {\n return endSymbol;\n };\n\n return $interpolate;\n }];\n}\n\nfunction $IntervalProvider() {\n this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser',\n function($rootScope, $window, $q, $$q, $browser) {\n var intervals = {};\n\n\n /**\n * @ngdoc service\n * @name $interval\n *\n * @description\n * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay`\n * milliseconds.\n *\n * The return value of registering an interval function is a promise. This promise will be\n * notified upon each tick of the interval, and will be resolved after `count` iterations, or\n * run indefinitely if `count` is not defined. The value of the notification will be the\n * number of iterations that have run.\n * To cancel an interval, call `$interval.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n * time.\n *\n * <div class=\"alert alert-warning\">\n * **Note**: Intervals created by this service must be explicitly destroyed when you are finished\n * with them. In particular they are not automatically destroyed when a controller's scope or a\n * directive's element are destroyed.\n * You should take this into consideration and make sure to always cancel the interval at the\n * appropriate moment. See the example below for more details on how and when to do this.\n * </div>\n *\n * @param {function()} fn A function that should be called repeatedly.\n * @param {number} delay Number of milliseconds between each function call.\n * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n * indefinitely.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {promise} A promise which will be notified on each iteration.\n *\n * @example\n * <example module=\"intervalExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('intervalExample', [])\n * .controller('ExampleController', ['$scope', '$interval',\n * function($scope, $interval) {\n * $scope.format = 'M/d/yy h:mm:ss a';\n * $scope.blood_1 = 100;\n * $scope.blood_2 = 120;\n *\n * var stop;\n * $scope.fight = function() {\n * // Don't start a new fight if we are already fighting\n * if ( angular.isDefined(stop) ) return;\n *\n * stop = $interval(function() {\n * if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {\n * $scope.blood_1 = $scope.blood_1 - 3;\n * $scope.blood_2 = $scope.blood_2 - 4;\n * } else {\n * $scope.stopFight();\n * }\n * }, 100);\n * };\n *\n * $scope.stopFight = function() {\n * if (angular.isDefined(stop)) {\n * $interval.cancel(stop);\n * stop = undefined;\n * }\n * };\n *\n * $scope.resetFight = function() {\n * $scope.blood_1 = 100;\n * $scope.blood_2 = 120;\n * };\n *\n * $scope.$on('$destroy', function() {\n * // Make sure that the interval is destroyed too\n * $scope.stopFight();\n * });\n * }])\n * // Register the 'myCurrentTime' directive factory method.\n * // We inject $interval and dateFilter service since the factory method is DI.\n * .directive('myCurrentTime', ['$interval', 'dateFilter',\n * function($interval, dateFilter) {\n * // return the directive link function. (compile function not needed)\n * return function(scope, element, attrs) {\n * var format, // date format\n * stopTime; // so that we can cancel the time updates\n *\n * // used to update the UI\n * function updateTime() {\n * element.text(dateFilter(new Date(), format));\n * }\n *\n * // watch the expression, and update the UI on change.\n * scope.$watch(attrs.myCurrentTime, function(value) {\n * format = value;\n * updateTime();\n * });\n *\n * stopTime = $interval(updateTime, 1000);\n *\n * // listen on DOM destroy (removal) event, and cancel the next UI update\n * // to prevent updating time after the DOM element was removed.\n * element.on('$destroy', function() {\n * $interval.cancel(stopTime);\n * });\n * }\n * }]);\n * </script>\n *\n * <div>\n * <div ng-controller=\"ExampleController\">\n * <label>Date format: <input ng-model=\"format\"></label> <hr/>\n * Current time is: <span my-current-time=\"format\"></span>\n * <hr/>\n * Blood 1 : <font color='red'>{{blood_1}}</font>\n * Blood 2 : <font color='red'>{{blood_2}}</font>\n * <button type=\"button\" data-ng-click=\"fight()\">Fight</button>\n * <button type=\"button\" data-ng-click=\"stopFight()\">StopFight</button>\n * <button type=\"button\" data-ng-click=\"resetFight()\">resetFight</button>\n * </div>\n * </div>\n *\n * </file>\n * </example>\n */\n function interval(fn, delay, count, invokeApply) {\n var hasParams = arguments.length > 4,\n args = hasParams ? sliceArgs(arguments, 4) : [],\n setInterval = $window.setInterval,\n clearInterval = $window.clearInterval,\n iteration = 0,\n skipApply = (isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise;\n\n count = isDefined(count) ? count : 0;\n\n promise.$$intervalId = setInterval(function tick() {\n if (skipApply) {\n $browser.defer(callback);\n } else {\n $rootScope.$evalAsync(callback);\n }\n deferred.notify(iteration++);\n\n if (count > 0 && iteration >= count) {\n deferred.resolve(iteration);\n clearInterval(promise.$$intervalId);\n delete intervals[promise.$$intervalId];\n }\n\n if (!skipApply) $rootScope.$apply();\n\n }, delay);\n\n intervals[promise.$$intervalId] = deferred;\n\n return promise;\n\n function callback() {\n if (!hasParams) {\n fn(iteration);\n } else {\n fn.apply(null, args);\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $interval#cancel\n *\n * @description\n * Cancels a task associated with the `promise`.\n *\n * @param {Promise=} promise returned by the `$interval` function.\n * @returns {boolean} Returns `true` if the task was successfully canceled.\n */\n interval.cancel = function(promise) {\n if (promise && promise.$$intervalId in intervals) {\n intervals[promise.$$intervalId].reject('canceled');\n $window.clearInterval(promise.$$intervalId);\n delete intervals[promise.$$intervalId];\n return true;\n }\n return false;\n };\n\n return interval;\n }];\n}\n\n/**\n * @ngdoc service\n * @name $locale\n *\n * @description\n * $locale service provides localization rules for various Angular components. As of right now the\n * only public api is:\n *\n * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)\n */\n\nvar PATH_MATCH = /^([^\\?#]*)(\\?([^#]*))?(#(.*))?$/,\n DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};\nvar $locationMinErr = minErr('$location');\n\n\n/**\n * Encode path using encodeUriSegment, ignoring forward slashes\n *\n * @param {string} path Path to encode\n * @returns {string}\n */\nfunction encodePath(path) {\n var segments = path.split('/'),\n i = segments.length;\n\n while (i--) {\n segments[i] = encodeUriSegment(segments[i]);\n }\n\n return segments.join('/');\n}\n\nfunction parseAbsoluteUrl(absoluteUrl, locationObj) {\n var parsedUrl = urlResolve(absoluteUrl);\n\n locationObj.$$protocol = parsedUrl.protocol;\n locationObj.$$host = parsedUrl.hostname;\n locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;\n}\n\n\nfunction parseAppUrl(relativeUrl, locationObj) {\n var prefixed = (relativeUrl.charAt(0) !== '/');\n if (prefixed) {\n relativeUrl = '/' + relativeUrl;\n }\n var match = urlResolve(relativeUrl);\n locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?\n match.pathname.substring(1) : match.pathname);\n locationObj.$$search = parseKeyValue(match.search);\n locationObj.$$hash = decodeURIComponent(match.hash);\n\n // make sure path starts with '/';\n if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {\n locationObj.$$path = '/' + locationObj.$$path;\n }\n}\n\n\n/**\n *\n * @param {string} begin\n * @param {string} whole\n * @returns {string} returns text from whole after begin or undefined if it does not begin with\n * expected string.\n */\nfunction beginsWith(begin, whole) {\n if (whole.indexOf(begin) === 0) {\n return whole.substr(begin.length);\n }\n}\n\n\nfunction stripHash(url) {\n var index = url.indexOf('#');\n return index == -1 ? url : url.substr(0, index);\n}\n\nfunction trimEmptyHash(url) {\n return url.replace(/(#.+)|#$/, '$1');\n}\n\n\nfunction stripFile(url) {\n return url.substr(0, stripHash(url).lastIndexOf('/') + 1);\n}\n\n/* return the server only (scheme://host:port) */\nfunction serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}\n\n\n/**\n * LocationHtml5Url represents an url\n * This object is exposed as $location service when HTML5 mode is enabled and supported\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} basePrefix url path prefix\n */\nfunction LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {\n this.$$html5 = true;\n basePrefix = basePrefix || '';\n parseAbsoluteUrl(appBase, this);\n\n\n /**\n * Parse given html5 (regular) url string into properties\n * @param {string} url HTML5 url\n * @private\n */\n this.$$parse = function(url) {\n var pathUrl = beginsWith(appBaseNoFile, url);\n if (!isString(pathUrl)) {\n throw $locationMinErr('ipthprfx', 'Invalid url \"{0}\", missing path prefix \"{1}\".', url,\n appBaseNoFile);\n }\n\n parseAppUrl(pathUrl, this);\n\n if (!this.$$path) {\n this.$$path = '/';\n }\n\n this.$$compose();\n };\n\n /**\n * Compose url and update `absUrl` property\n * @private\n */\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'\n };\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n var appUrl, prevAppUrl;\n var rewrittenUrl;\n\n if (isDefined(appUrl = beginsWith(appBase, url))) {\n prevAppUrl = appUrl;\n if (isDefined(appUrl = beginsWith(basePrefix, appUrl))) {\n rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl);\n } else {\n rewrittenUrl = appBase + prevAppUrl;\n }\n } else if (isDefined(appUrl = beginsWith(appBaseNoFile, url))) {\n rewrittenUrl = appBaseNoFile + appUrl;\n } else if (appBaseNoFile == url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n}\n\n\n/**\n * LocationHashbangUrl represents url\n * This object is exposed as $location service when developer doesn't opt into html5 mode.\n * It also serves as the base class for html5 mode fallback on legacy browsers.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {\n\n parseAbsoluteUrl(appBase, this);\n\n\n /**\n * Parse given hashbang url into properties\n * @param {string} url Hashbang url\n * @private\n */\n this.$$parse = function(url) {\n var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);\n var withoutHashUrl;\n\n if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {\n\n // The rest of the url starts with a hash so we have\n // got either a hashbang path or a plain hash fragment\n withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl);\n if (isUndefined(withoutHashUrl)) {\n // There was no hashbang prefix so we just have a hash fragment\n withoutHashUrl = withoutBaseUrl;\n }\n\n } else {\n // There was no hashbang path nor hash fragment:\n // If we are in HTML5 mode we use what is left as the path;\n // Otherwise we ignore what is left\n if (this.$$html5) {\n withoutHashUrl = withoutBaseUrl;\n } else {\n withoutHashUrl = '';\n if (isUndefined(withoutBaseUrl)) {\n appBase = url;\n this.replace();\n }\n }\n }\n\n parseAppUrl(withoutHashUrl, this);\n\n this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);\n\n this.$$compose();\n\n /*\n * In Windows, on an anchor node on documents loaded from\n * the filesystem, the browser will return a pathname\n * prefixed with the drive name ('/C:/path') when a\n * pathname without a drive is set:\n * * a.setAttribute('href', '/foo')\n * * a.pathname === '/C:/foo' //true\n *\n * Inside of Angular, we're always using pathnames that\n * do not include drive names for routing.\n */\n function removeWindowsDriveName(path, url, base) {\n /*\n Matches paths for file protocol on windows,\n such as /C:/foo/bar, and captures only /foo/bar.\n */\n var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n\n var firstPathSegmentMatch;\n\n //Get the relative path from the input URL.\n if (url.indexOf(base) === 0) {\n url = url.replace(base, '');\n }\n\n // The input URL intentionally contains a first path segment that ends with a colon.\n if (windowsFilePathExp.exec(url)) {\n return path;\n }\n\n firstPathSegmentMatch = windowsFilePathExp.exec(path);\n return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n }\n };\n\n /**\n * Compose hashbang url and update `absUrl` property\n * @private\n */\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');\n };\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (stripHash(appBase) == stripHash(url)) {\n this.$$parse(url);\n return true;\n }\n return false;\n };\n}\n\n\n/**\n * LocationHashbangUrl represents url\n * This object is exposed as $location service when html5 history api is enabled but the browser\n * does not support it.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {\n this.$$html5 = true;\n LocationHashbangUrl.apply(this, arguments);\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n\n var rewrittenUrl;\n var appUrl;\n\n if (appBase == stripHash(url)) {\n rewrittenUrl = url;\n } else if ((appUrl = beginsWith(appBaseNoFile, url))) {\n rewrittenUrl = appBase + hashPrefix + appUrl;\n } else if (appBaseNoFile === url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'\n this.$$absUrl = appBase + hashPrefix + this.$$url;\n };\n\n}\n\n\nvar locationPrototype = {\n\n /**\n * Are we in html5 mode?\n * @private\n */\n $$html5: false,\n\n /**\n * Has any change been replacing?\n * @private\n */\n $$replace: false,\n\n /**\n * @ngdoc method\n * @name $location#absUrl\n *\n * @description\n * This method is getter only.\n *\n * Return full url representation with all segments encoded according to rules specified in\n * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var absUrl = $location.absUrl();\n * // => \"http://example.com/#/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @return {string} full url\n */\n absUrl: locationGetter('$$absUrl'),\n\n /**\n * @ngdoc method\n * @name $location#url\n *\n * @description\n * This method is getter / setter.\n *\n * Return url (e.g. `/path?a=b#hash`) when called without any parameter.\n *\n * Change path, search and hash, when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var url = $location.url();\n * // => \"/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)\n * @return {string} url\n */\n url: function(url) {\n if (isUndefined(url)) {\n return this.$$url;\n }\n\n var match = PATH_MATCH.exec(url);\n if (match[1] || url === '') this.path(decodeURIComponent(match[1]));\n if (match[2] || match[1] || url === '') this.search(match[3] || '');\n this.hash(match[5] || '');\n\n return this;\n },\n\n /**\n * @ngdoc method\n * @name $location#protocol\n *\n * @description\n * This method is getter only.\n *\n * Return protocol of current url.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var protocol = $location.protocol();\n * // => \"http\"\n * ```\n *\n * @return {string} protocol of current url\n */\n protocol: locationGetter('$$protocol'),\n\n /**\n * @ngdoc method\n * @name $location#host\n *\n * @description\n * This method is getter only.\n *\n * Return host of current url.\n *\n * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var host = $location.host();\n * // => \"example.com\"\n *\n * // given url http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo\n * host = $location.host();\n * // => \"example.com\"\n * host = location.host;\n * // => \"example.com:8080\"\n * ```\n *\n * @return {string} host of current url.\n */\n host: locationGetter('$$host'),\n\n /**\n * @ngdoc method\n * @name $location#port\n *\n * @description\n * This method is getter only.\n *\n * Return port of current url.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var port = $location.port();\n * // => 80\n * ```\n *\n * @return {Number} port\n */\n port: locationGetter('$$port'),\n\n /**\n * @ngdoc method\n * @name $location#path\n *\n * @description\n * This method is getter / setter.\n *\n * Return path of current url when called without any parameter.\n *\n * Change path when called with parameter and return `$location`.\n *\n * Note: Path should always begin with forward slash (/), this method will add the forward slash\n * if it is missing.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var path = $location.path();\n * // => \"/some/path\"\n * ```\n *\n * @param {(string|number)=} path New path\n * @return {string} path\n */\n path: locationGetterSetter('$$path', function(path) {\n path = path !== null ? path.toString() : '';\n return path.charAt(0) == '/' ? path : '/' + path;\n }),\n\n /**\n * @ngdoc method\n * @name $location#search\n *\n * @description\n * This method is getter / setter.\n *\n * Return search part (as object) of current url when called without any parameter.\n *\n * Change search part when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var searchObject = $location.search();\n * // => {foo: 'bar', baz: 'xoxo'}\n *\n * // set foo to 'yipee'\n * $location.search('foo', 'yipee');\n * // $location.search() => {foo: 'yipee', baz: 'xoxo'}\n * ```\n *\n * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or\n * hash object.\n *\n * When called with a single argument the method acts as a setter, setting the `search` component\n * of `$location` to the specified value.\n *\n * If the argument is a hash object containing an array of values, these values will be encoded\n * as duplicate search parameters in the url.\n *\n * @param {(string|Number|Array<string>|boolean)=} paramValue If `search` is a string or number, then `paramValue`\n * will override only a single search property.\n *\n * If `paramValue` is an array, it will override the property of the `search` component of\n * `$location` specified via the first argument.\n *\n * If `paramValue` is `null`, the property specified via the first argument will be deleted.\n *\n * If `paramValue` is `true`, the property specified via the first argument will be added with no\n * value nor trailing equal sign.\n *\n * @return {Object} If called with no arguments returns the parsed `search` object. If called with\n * one or more arguments returns `$location` object itself.\n */\n search: function(search, paramValue) {\n switch (arguments.length) {\n case 0:\n return this.$$search;\n case 1:\n if (isString(search) || isNumber(search)) {\n search = search.toString();\n this.$$search = parseKeyValue(search);\n } else if (isObject(search)) {\n search = copy(search, {});\n // remove object undefined or null properties\n forEach(search, function(value, key) {\n if (value == null) delete search[key];\n });\n\n this.$$search = search;\n } else {\n throw $locationMinErr('isrcharg',\n 'The first argument of the `$location#search()` call must be a string or an object.');\n }\n break;\n default:\n if (isUndefined(paramValue) || paramValue === null) {\n delete this.$$search[search];\n } else {\n this.$$search[search] = paramValue;\n }\n }\n\n this.$$compose();\n return this;\n },\n\n /**\n * @ngdoc method\n * @name $location#hash\n *\n * @description\n * This method is getter / setter.\n *\n * Returns the hash fragment when called without any parameters.\n *\n * Changes the hash fragment when called with a parameter and returns `$location`.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue\n * var hash = $location.hash();\n * // => \"hashValue\"\n * ```\n *\n * @param {(string|number)=} hash New hash fragment\n * @return {string} hash\n */\n hash: locationGetterSetter('$$hash', function(hash) {\n return hash !== null ? hash.toString() : '';\n }),\n\n /**\n * @ngdoc method\n * @name $location#replace\n *\n * @description\n * If called, all changes to $location during the current `$digest` will replace the current history\n * record, instead of adding a new one.\n */\n replace: function() {\n this.$$replace = true;\n return this;\n }\n};\n\nforEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {\n Location.prototype = Object.create(locationPrototype);\n\n /**\n * @ngdoc method\n * @name $location#state\n *\n * @description\n * This method is getter / setter.\n *\n * Return the history state object when called without any parameter.\n *\n * Change the history state object when called with one parameter and return `$location`.\n * The state object is later passed to `pushState` or `replaceState`.\n *\n * NOTE: This method is supported only in HTML5 mode and only in browsers supporting\n * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support\n * older browsers (like IE9 or Android < 4.0), don't use this method.\n *\n * @param {object=} state State object for pushState or replaceState\n * @return {object} state\n */\n Location.prototype.state = function(state) {\n if (!arguments.length) {\n return this.$$state;\n }\n\n if (Location !== LocationHtml5Url || !this.$$html5) {\n throw $locationMinErr('nostate', 'History API state support is available only ' +\n 'in HTML5 mode and only in browsers supporting HTML5 History API');\n }\n // The user might modify `stateObject` after invoking `$location.state(stateObject)`\n // but we're changing the $$state reference to $browser.state() during the $digest\n // so the modification window is narrow.\n this.$$state = isUndefined(state) ? null : state;\n\n return this;\n };\n});\n\n\nfunction locationGetter(property) {\n return function() {\n return this[property];\n };\n}\n\n\nfunction locationGetterSetter(property, preprocess) {\n return function(value) {\n if (isUndefined(value)) {\n return this[property];\n }\n\n this[property] = preprocess(value);\n this.$$compose();\n\n return this;\n };\n}\n\n\n/**\n * @ngdoc service\n * @name $location\n *\n * @requires $rootElement\n *\n * @description\n * The $location service parses the URL in the browser address bar (based on the\n * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL\n * available to your application. Changes to the URL in the address bar are reflected into\n * $location service and changes to $location are reflected into the browser address bar.\n *\n * **The $location service:**\n *\n * - Exposes the current URL in the browser address bar, so you can\n * - Watch and observe the URL.\n * - Change the URL.\n * - Synchronizes the URL with the browser when the user\n * - Changes the address bar.\n * - Clicks the back or forward button (or clicks a History link).\n * - Clicks on a link.\n * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).\n *\n * For more information see {@link guide/$location Developer Guide: Using $location}\n */\n\n/**\n * @ngdoc provider\n * @name $locationProvider\n * @description\n * Use the `$locationProvider` to configure how the application deep linking paths are stored.\n */\nfunction $LocationProvider() {\n var hashPrefix = '',\n html5Mode = {\n enabled: false,\n requireBase: true,\n rewriteLinks: true\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#hashPrefix\n * @description\n * @param {string=} prefix Prefix for hash part (containing path and search)\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.hashPrefix = function(prefix) {\n if (isDefined(prefix)) {\n hashPrefix = prefix;\n return this;\n } else {\n return hashPrefix;\n }\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#html5Mode\n * @description\n * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.\n * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported\n * properties:\n * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to\n * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not\n * support `pushState`.\n * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies\n * whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are\n * true, and a base tag is not present, an error will be thrown when `$location` is injected.\n * See the {@link guide/$location $location guide for more information}\n * - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled,\n * enables/disables url rewriting for relative links.\n *\n * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter\n */\n this.html5Mode = function(mode) {\n if (isBoolean(mode)) {\n html5Mode.enabled = mode;\n return this;\n } else if (isObject(mode)) {\n\n if (isBoolean(mode.enabled)) {\n html5Mode.enabled = mode.enabled;\n }\n\n if (isBoolean(mode.requireBase)) {\n html5Mode.requireBase = mode.requireBase;\n }\n\n if (isBoolean(mode.rewriteLinks)) {\n html5Mode.rewriteLinks = mode.rewriteLinks;\n }\n\n return this;\n } else {\n return html5Mode;\n }\n };\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeStart\n * @eventType broadcast on root scope\n * @description\n * Broadcasted before a URL will change.\n *\n * This change can be prevented by calling\n * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more\n * details about event object. Upon successful change\n * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeSuccess\n * @eventType broadcast on root scope\n * @description\n * Broadcasted after a URL was changed.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',\n function($rootScope, $browser, $sniffer, $rootElement, $window) {\n var $location,\n LocationMode,\n baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''\n initialUrl = $browser.url(),\n appBase;\n\n if (html5Mode.enabled) {\n if (!baseHref && html5Mode.requireBase) {\n throw $locationMinErr('nobase',\n \"$location in HTML5 mode requires a <base> tag to be present!\");\n }\n appBase = serverBase(initialUrl) + (baseHref || '/');\n LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;\n } else {\n appBase = stripHash(initialUrl);\n LocationMode = LocationHashbangUrl;\n }\n var appBaseNoFile = stripFile(appBase);\n\n $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix);\n $location.$$parseLinkUrl(initialUrl, initialUrl);\n\n $location.$$state = $browser.state();\n\n var IGNORE_URI_REGEXP = /^\\s*(javascript|mailto):/i;\n\n function setBrowserUrlWithFallback(url, replace, state) {\n var oldUrl = $location.url();\n var oldState = $location.$$state;\n try {\n $browser.url(url, replace, state);\n\n // Make sure $location.state() returns referentially identical (not just deeply equal)\n // state object; this makes possible quick checking if the state changed in the digest\n // loop. Checking deep equality would be too expensive.\n $location.$$state = $browser.state();\n } catch (e) {\n // Restore old values if pushState fails\n $location.url(oldUrl);\n $location.$$state = oldState;\n\n throw e;\n }\n }\n\n $rootElement.on('click', function(event) {\n // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)\n // currently we open nice url link and redirect then\n\n if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return;\n\n var elm = jqLite(event.target);\n\n // traverse the DOM up to find first A tag\n while (nodeName_(elm[0]) !== 'a') {\n // ignore rewriting if no A tag (reached root element, or no parent - removed from document)\n if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;\n }\n\n var absHref = elm.prop('href');\n // get the actual href attribute - see\n // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx\n var relHref = elm.attr('href') || elm.attr('xlink:href');\n\n if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {\n // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during\n // an animation.\n absHref = urlResolve(absHref.animVal).href;\n }\n\n // Ignore when url is started with javascript: or mailto:\n if (IGNORE_URI_REGEXP.test(absHref)) return;\n\n if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {\n if ($location.$$parseLinkUrl(absHref, relHref)) {\n // We do a preventDefault for all urls that are part of the angular application,\n // in html5mode and also without, so that we are able to abort navigation without\n // getting double entries in the location history.\n event.preventDefault();\n // update location manually\n if ($location.absUrl() != $browser.url()) {\n $rootScope.$apply();\n // hack to work around FF6 bug 684208 when scenario runner clicks on links\n $window.angular['ff-684208-preventDefault'] = true;\n }\n }\n }\n });\n\n\n // rewrite hashbang url <> html5 url\n if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) {\n $browser.url($location.absUrl(), true);\n }\n\n var initializing = true;\n\n // update $location when $browser url changes\n $browser.onUrlChange(function(newUrl, newState) {\n\n if (isUndefined(beginsWith(appBaseNoFile, newUrl))) {\n // If we are navigating outside of the app then force a reload\n $window.location.href = newUrl;\n return;\n }\n\n $rootScope.$evalAsync(function() {\n var oldUrl = $location.absUrl();\n var oldState = $location.$$state;\n var defaultPrevented;\n newUrl = trimEmptyHash(newUrl);\n $location.$$parse(newUrl);\n $location.$$state = newState;\n\n defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n newState, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n setBrowserUrlWithFallback(oldUrl, false, oldState);\n } else {\n initializing = false;\n afterLocationChange(oldUrl, oldState);\n }\n });\n if (!$rootScope.$$phase) $rootScope.$digest();\n });\n\n // update browser\n $rootScope.$watch(function $locationWatch() {\n var oldUrl = trimEmptyHash($browser.url());\n var newUrl = trimEmptyHash($location.absUrl());\n var oldState = $browser.state();\n var currentReplace = $location.$$replace;\n var urlOrStateChanged = oldUrl !== newUrl ||\n ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);\n\n if (initializing || urlOrStateChanged) {\n initializing = false;\n\n $rootScope.$evalAsync(function() {\n var newUrl = $location.absUrl();\n var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n $location.$$state, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n } else {\n if (urlOrStateChanged) {\n setBrowserUrlWithFallback(newUrl, currentReplace,\n oldState === $location.$$state ? null : $location.$$state);\n }\n afterLocationChange(oldUrl, oldState);\n }\n });\n }\n\n $location.$$replace = false;\n\n // we don't need to return anything because $evalAsync will make the digest loop dirty when\n // there is a change\n });\n\n return $location;\n\n function afterLocationChange(oldUrl, oldState) {\n $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,\n $location.$$state, oldState);\n }\n}];\n}\n\n/**\n * @ngdoc service\n * @name $log\n * @requires $window\n *\n * @description\n * Simple service for logging. Default implementation safely writes the message\n * into the browser's console (if present).\n *\n * The main purpose of this service is to simplify debugging and troubleshooting.\n *\n * The default is to log `debug` messages. You can use\n * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.\n *\n * @example\n <example module=\"logExample\">\n <file name=\"script.js\">\n angular.module('logExample', [])\n .controller('LogController', ['$scope', '$log', function($scope, $log) {\n $scope.$log = $log;\n $scope.message = 'Hello World!';\n }]);\n </file>\n <file name=\"index.html\">\n <div ng-controller=\"LogController\">\n <p>Reload this page with open console, enter text and hit the log button...</p>\n <label>Message:\n <input type=\"text\" ng-model=\"message\" /></label>\n <button ng-click=\"$log.log(message)\">log</button>\n <button ng-click=\"$log.warn(message)\">warn</button>\n <button ng-click=\"$log.info(message)\">info</button>\n <button ng-click=\"$log.error(message)\">error</button>\n <button ng-click=\"$log.debug(message)\">debug</button>\n </div>\n </file>\n </example>\n */\n\n/**\n * @ngdoc provider\n * @name $logProvider\n * @description\n * Use the `$logProvider` to configure how the application logs messages\n */\nfunction $LogProvider() {\n var debug = true,\n self = this;\n\n /**\n * @ngdoc method\n * @name $logProvider#debugEnabled\n * @description\n * @param {boolean=} flag enable or disable debug level messages\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.debugEnabled = function(flag) {\n if (isDefined(flag)) {\n debug = flag;\n return this;\n } else {\n return debug;\n }\n };\n\n this.$get = ['$window', function($window) {\n return {\n /**\n * @ngdoc method\n * @name $log#log\n *\n * @description\n * Write a log message\n */\n log: consoleLog('log'),\n\n /**\n * @ngdoc method\n * @name $log#info\n *\n * @description\n * Write an information message\n */\n info: consoleLog('info'),\n\n /**\n * @ngdoc method\n * @name $log#warn\n *\n * @description\n * Write a warning message\n */\n warn: consoleLog('warn'),\n\n /**\n * @ngdoc method\n * @name $log#error\n *\n * @description\n * Write an error message\n */\n error: consoleLog('error'),\n\n /**\n * @ngdoc method\n * @name $log#debug\n *\n * @description\n * Write a debug message\n */\n debug: (function() {\n var fn = consoleLog('debug');\n\n return function() {\n if (debug) {\n fn.apply(self, arguments);\n }\n };\n }())\n };\n\n function formatError(arg) {\n if (arg instanceof Error) {\n if (arg.stack) {\n arg = (arg.message && arg.stack.indexOf(arg.message) === -1)\n ? 'Error: ' + arg.message + '\\n' + arg.stack\n : arg.stack;\n } else if (arg.sourceURL) {\n arg = arg.message + '\\n' + arg.sourceURL + ':' + arg.line;\n }\n }\n return arg;\n }\n\n function consoleLog(type) {\n var console = $window.console || {},\n logFn = console[type] || console.log || noop,\n hasApply = false;\n\n // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.\n // The reason behind this is that console.log has type \"object\" in IE8...\n try {\n hasApply = !!logFn.apply;\n } catch (e) {}\n\n if (hasApply) {\n return function() {\n var args = [];\n forEach(arguments, function(arg) {\n args.push(formatError(arg));\n });\n return logFn.apply(console, args);\n };\n }\n\n // we are IE which either doesn't have window.console => this is noop and we do nothing,\n // or we are IE where console.log doesn't have apply so we log at least first 2 args\n return function(arg1, arg2) {\n logFn(arg1, arg2 == null ? '' : arg2);\n };\n }\n }];\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $parseMinErr = minErr('$parse');\n\n// Sandboxing Angular Expressions\n// ------------------------------\n// Angular expressions are generally considered safe because these expressions only have direct\n// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by\n// obtaining a reference to native JS functions such as the Function constructor.\n//\n// As an example, consider the following Angular expression:\n//\n// {}.toString.constructor('alert(\"evil JS code\")')\n//\n// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits\n// against the expression language, but not to prevent exploits that were enabled by exposing\n// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good\n// practice and therefore we are not even trying to protect against interaction with an object\n// explicitly exposed in this way.\n//\n// In general, it is not possible to access a Window object from an angular expression unless a\n// window or some DOM object that has a reference to window is published onto a Scope.\n// Similarly we prevent invocations of function known to be dangerous, as well as assignments to\n// native objects.\n//\n// See https://docs.angularjs.org/guide/security\n\n\nfunction ensureSafeMemberName(name, fullExpression) {\n if (name === \"__defineGetter__\" || name === \"__defineSetter__\"\n || name === \"__lookupGetter__\" || name === \"__lookupSetter__\"\n || name === \"__proto__\") {\n throw $parseMinErr('isecfld',\n 'Attempting to access a disallowed field in Angular expressions! '\n + 'Expression: {0}', fullExpression);\n }\n return name;\n}\n\nfunction getStringValue(name) {\n // Property names must be strings. This means that non-string objects cannot be used\n // as keys in an object. Any non-string object, including a number, is typecasted\n // into a string via the toString method.\n // -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names\n //\n // So, to ensure that we are checking the same `name` that JavaScript would use, we cast it\n // to a string. It's not always possible. If `name` is an object and its `toString` method is\n // 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown:\n //\n // TypeError: Cannot convert object to primitive value\n //\n // For performance reasons, we don't catch this error here and allow it to propagate up the call\n // stack. Note that you'll get the same error in JavaScript if you try to access a property using\n // such a 'broken' object as a key.\n return name + '';\n}\n\nfunction ensureSafeObject(obj, fullExpression) {\n // nifty check if obj is Function that is fast and works across iframes and other contexts\n if (obj) {\n if (obj.constructor === obj) {\n throw $parseMinErr('isecfn',\n 'Referencing Function in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n } else if (// isWindow(obj)\n obj.window === obj) {\n throw $parseMinErr('isecwindow',\n 'Referencing the Window in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n } else if (// isElement(obj)\n obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {\n throw $parseMinErr('isecdom',\n 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n } else if (// block Object so that we can't get hold of dangerous Object.* methods\n obj === Object) {\n throw $parseMinErr('isecobj',\n 'Referencing Object in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n }\n }\n return obj;\n}\n\nvar CALL = Function.prototype.call;\nvar APPLY = Function.prototype.apply;\nvar BIND = Function.prototype.bind;\n\nfunction ensureSafeFunction(obj, fullExpression) {\n if (obj) {\n if (obj.constructor === obj) {\n throw $parseMinErr('isecfn',\n 'Referencing Function in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n } else if (obj === CALL || obj === APPLY || obj === BIND) {\n throw $parseMinErr('isecff',\n 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n }\n }\n}\n\nfunction ensureSafeAssignContext(obj, fullExpression) {\n if (obj) {\n if (obj === (0).constructor || obj === (false).constructor || obj === ''.constructor ||\n obj === {}.constructor || obj === [].constructor || obj === Function.constructor) {\n throw $parseMinErr('isecaf',\n 'Assigning to a constructor is disallowed! Expression: {0}', fullExpression);\n }\n }\n}\n\nvar OPERATORS = createMap();\nforEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; });\nvar ESCAPE = {\"n\":\"\\n\", \"f\":\"\\f\", \"r\":\"\\r\", \"t\":\"\\t\", \"v\":\"\\v\", \"'\":\"'\", '\"':'\"'};\n\n\n/////////////////////////////////////////\n\n\n/**\n * @constructor\n */\nvar Lexer = function(options) {\n this.options = options;\n};\n\nLexer.prototype = {\n constructor: Lexer,\n\n lex: function(text) {\n this.text = text;\n this.index = 0;\n this.tokens = [];\n\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n if (ch === '\"' || ch === \"'\") {\n this.readString(ch);\n } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {\n this.readNumber();\n } else if (this.isIdent(ch)) {\n this.readIdent();\n } else if (this.is(ch, '(){}[].,;:?')) {\n this.tokens.push({index: this.index, text: ch});\n this.index++;\n } else if (this.isWhitespace(ch)) {\n this.index++;\n } else {\n var ch2 = ch + this.peek();\n var ch3 = ch2 + this.peek(2);\n var op1 = OPERATORS[ch];\n var op2 = OPERATORS[ch2];\n var op3 = OPERATORS[ch3];\n if (op1 || op2 || op3) {\n var token = op3 ? ch3 : (op2 ? ch2 : ch);\n this.tokens.push({index: this.index, text: token, operator: true});\n this.index += token.length;\n } else {\n this.throwError('Unexpected next character ', this.index, this.index + 1);\n }\n }\n }\n return this.tokens;\n },\n\n is: function(ch, chars) {\n return chars.indexOf(ch) !== -1;\n },\n\n peek: function(i) {\n var num = i || 1;\n return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;\n },\n\n isNumber: function(ch) {\n return ('0' <= ch && ch <= '9') && typeof ch === \"string\";\n },\n\n isWhitespace: function(ch) {\n // IE treats non-breaking space as \\u00A0\n return (ch === ' ' || ch === '\\r' || ch === '\\t' ||\n ch === '\\n' || ch === '\\v' || ch === '\\u00A0');\n },\n\n isIdent: function(ch) {\n return ('a' <= ch && ch <= 'z' ||\n 'A' <= ch && ch <= 'Z' ||\n '_' === ch || ch === '$');\n },\n\n isExpOperator: function(ch) {\n return (ch === '-' || ch === '+' || this.isNumber(ch));\n },\n\n throwError: function(error, start, end) {\n end = end || this.index;\n var colStr = (isDefined(start)\n ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']'\n : ' ' + end);\n throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',\n error, colStr, this.text);\n },\n\n readNumber: function() {\n var number = '';\n var start = this.index;\n while (this.index < this.text.length) {\n var ch = lowercase(this.text.charAt(this.index));\n if (ch == '.' || this.isNumber(ch)) {\n number += ch;\n } else {\n var peekCh = this.peek();\n if (ch == 'e' && this.isExpOperator(peekCh)) {\n number += ch;\n } else if (this.isExpOperator(ch) &&\n peekCh && this.isNumber(peekCh) &&\n number.charAt(number.length - 1) == 'e') {\n number += ch;\n } else if (this.isExpOperator(ch) &&\n (!peekCh || !this.isNumber(peekCh)) &&\n number.charAt(number.length - 1) == 'e') {\n this.throwError('Invalid exponent');\n } else {\n break;\n }\n }\n this.index++;\n }\n this.tokens.push({\n index: start,\n text: number,\n constant: true,\n value: Number(number)\n });\n },\n\n readIdent: function() {\n var start = this.index;\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n if (!(this.isIdent(ch) || this.isNumber(ch))) {\n break;\n }\n this.index++;\n }\n this.tokens.push({\n index: start,\n text: this.text.slice(start, this.index),\n identifier: true\n });\n },\n\n readString: function(quote) {\n var start = this.index;\n this.index++;\n var string = '';\n var rawString = quote;\n var escape = false;\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n rawString += ch;\n if (escape) {\n if (ch === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5);\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('Invalid unicode escape [\\\\u' + hex + ']');\n }\n this.index += 4;\n string += String.fromCharCode(parseInt(hex, 16));\n } else {\n var rep = ESCAPE[ch];\n string = string + (rep || ch);\n }\n escape = false;\n } else if (ch === '\\\\') {\n escape = true;\n } else if (ch === quote) {\n this.index++;\n this.tokens.push({\n index: start,\n text: rawString,\n constant: true,\n value: string\n });\n return;\n } else {\n string += ch;\n }\n this.index++;\n }\n this.throwError('Unterminated quote', start);\n }\n};\n\nvar AST = function(lexer, options) {\n this.lexer = lexer;\n this.options = options;\n};\n\nAST.Program = 'Program';\nAST.ExpressionStatement = 'ExpressionStatement';\nAST.AssignmentExpression = 'AssignmentExpression';\nAST.ConditionalExpression = 'ConditionalExpression';\nAST.LogicalExpression = 'LogicalExpression';\nAST.BinaryExpression = 'BinaryExpression';\nAST.UnaryExpression = 'UnaryExpression';\nAST.CallExpression = 'CallExpression';\nAST.MemberExpression = 'MemberExpression';\nAST.Identifier = 'Identifier';\nAST.Literal = 'Literal';\nAST.ArrayExpression = 'ArrayExpression';\nAST.Property = 'Property';\nAST.ObjectExpression = 'ObjectExpression';\nAST.ThisExpression = 'ThisExpression';\nAST.LocalsExpression = 'LocalsExpression';\n\n// Internal use only\nAST.NGValueParameter = 'NGValueParameter';\n\nAST.prototype = {\n ast: function(text) {\n this.text = text;\n this.tokens = this.lexer.lex(text);\n\n var value = this.program();\n\n if (this.tokens.length !== 0) {\n this.throwError('is an unexpected token', this.tokens[0]);\n }\n\n return value;\n },\n\n program: function() {\n var body = [];\n while (true) {\n if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))\n body.push(this.expressionStatement());\n if (!this.expect(';')) {\n return { type: AST.Program, body: body};\n }\n }\n },\n\n expressionStatement: function() {\n return { type: AST.ExpressionStatement, expression: this.filterChain() };\n },\n\n filterChain: function() {\n var left = this.expression();\n var token;\n while ((token = this.expect('|'))) {\n left = this.filter(left);\n }\n return left;\n },\n\n expression: function() {\n return this.assignment();\n },\n\n assignment: function() {\n var result = this.ternary();\n if (this.expect('=')) {\n result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='};\n }\n return result;\n },\n\n ternary: function() {\n var test = this.logicalOR();\n var alternate;\n var consequent;\n if (this.expect('?')) {\n alternate = this.expression();\n if (this.consume(':')) {\n consequent = this.expression();\n return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent};\n }\n }\n return test;\n },\n\n logicalOR: function() {\n var left = this.logicalAND();\n while (this.expect('||')) {\n left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() };\n }\n return left;\n },\n\n logicalAND: function() {\n var left = this.equality();\n while (this.expect('&&')) {\n left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()};\n }\n return left;\n },\n\n equality: function() {\n var left = this.relational();\n var token;\n while ((token = this.expect('==','!=','===','!=='))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() };\n }\n return left;\n },\n\n relational: function() {\n var left = this.additive();\n var token;\n while ((token = this.expect('<', '>', '<=', '>='))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() };\n }\n return left;\n },\n\n additive: function() {\n var left = this.multiplicative();\n var token;\n while ((token = this.expect('+','-'))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() };\n }\n return left;\n },\n\n multiplicative: function() {\n var left = this.unary();\n var token;\n while ((token = this.expect('*','/','%'))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() };\n }\n return left;\n },\n\n unary: function() {\n var token;\n if ((token = this.expect('+', '-', '!'))) {\n return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() };\n } else {\n return this.primary();\n }\n },\n\n primary: function() {\n var primary;\n if (this.expect('(')) {\n primary = this.filterChain();\n this.consume(')');\n } else if (this.expect('[')) {\n primary = this.arrayDeclaration();\n } else if (this.expect('{')) {\n primary = this.object();\n } else if (this.constants.hasOwnProperty(this.peek().text)) {\n primary = copy(this.constants[this.consume().text]);\n } else if (this.peek().identifier) {\n primary = this.identifier();\n } else if (this.peek().constant) {\n primary = this.constant();\n } else {\n this.throwError('not a primary expression', this.peek());\n }\n\n var next;\n while ((next = this.expect('(', '[', '.'))) {\n if (next.text === '(') {\n primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() };\n this.consume(')');\n } else if (next.text === '[') {\n primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true };\n this.consume(']');\n } else if (next.text === '.') {\n primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false };\n } else {\n this.throwError('IMPOSSIBLE');\n }\n }\n return primary;\n },\n\n filter: function(baseExpression) {\n var args = [baseExpression];\n var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true};\n\n while (this.expect(':')) {\n args.push(this.expression());\n }\n\n return result;\n },\n\n parseArguments: function() {\n var args = [];\n if (this.peekToken().text !== ')') {\n do {\n args.push(this.expression());\n } while (this.expect(','));\n }\n return args;\n },\n\n identifier: function() {\n var token = this.consume();\n if (!token.identifier) {\n this.throwError('is not a valid identifier', token);\n }\n return { type: AST.Identifier, name: token.text };\n },\n\n constant: function() {\n // TODO check that it is a constant\n return { type: AST.Literal, value: this.consume().value };\n },\n\n arrayDeclaration: function() {\n var elements = [];\n if (this.peekToken().text !== ']') {\n do {\n if (this.peek(']')) {\n // Support trailing commas per ES5.1.\n break;\n }\n elements.push(this.expression());\n } while (this.expect(','));\n }\n this.consume(']');\n\n return { type: AST.ArrayExpression, elements: elements };\n },\n\n object: function() {\n var properties = [], property;\n if (this.peekToken().text !== '}') {\n do {\n if (this.peek('}')) {\n // Support trailing commas per ES5.1.\n break;\n }\n property = {type: AST.Property, kind: 'init'};\n if (this.peek().constant) {\n property.key = this.constant();\n } else if (this.peek().identifier) {\n property.key = this.identifier();\n } else {\n this.throwError(\"invalid key\", this.peek());\n }\n this.consume(':');\n property.value = this.expression();\n properties.push(property);\n } while (this.expect(','));\n }\n this.consume('}');\n\n return {type: AST.ObjectExpression, properties: properties };\n },\n\n throwError: function(msg, token) {\n throw $parseMinErr('syntax',\n 'Syntax Error: Token \\'{0}\\' {1} at column {2} of the expression [{3}] starting at [{4}].',\n token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));\n },\n\n consume: function(e1) {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n\n var token = this.expect(e1);\n if (!token) {\n this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());\n }\n return token;\n },\n\n peekToken: function() {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n return this.tokens[0];\n },\n\n peek: function(e1, e2, e3, e4) {\n return this.peekAhead(0, e1, e2, e3, e4);\n },\n\n peekAhead: function(i, e1, e2, e3, e4) {\n if (this.tokens.length > i) {\n var token = this.tokens[i];\n var t = token.text;\n if (t === e1 || t === e2 || t === e3 || t === e4 ||\n (!e1 && !e2 && !e3 && !e4)) {\n return token;\n }\n }\n return false;\n },\n\n expect: function(e1, e2, e3, e4) {\n var token = this.peek(e1, e2, e3, e4);\n if (token) {\n this.tokens.shift();\n return token;\n }\n return false;\n },\n\n\n /* `undefined` is not a constant, it is an identifier,\n * but using it as an identifier is not supported\n */\n constants: {\n 'true': { type: AST.Literal, value: true },\n 'false': { type: AST.Literal, value: false },\n 'null': { type: AST.Literal, value: null },\n 'undefined': {type: AST.Literal, value: undefined },\n 'this': {type: AST.ThisExpression },\n '$locals': {type: AST.LocalsExpression }\n }\n};\n\nfunction ifDefined(v, d) {\n return typeof v !== 'undefined' ? v : d;\n}\n\nfunction plusFn(l, r) {\n if (typeof l === 'undefined') return r;\n if (typeof r === 'undefined') return l;\n return l + r;\n}\n\nfunction isStateless($filter, filterName) {\n var fn = $filter(filterName);\n return !fn.$stateful;\n}\n\nfunction findConstantAndWatchExpressions(ast, $filter) {\n var allConstants;\n var argsToWatch;\n switch (ast.type) {\n case AST.Program:\n allConstants = true;\n forEach(ast.body, function(expr) {\n findConstantAndWatchExpressions(expr.expression, $filter);\n allConstants = allConstants && expr.expression.constant;\n });\n ast.constant = allConstants;\n break;\n case AST.Literal:\n ast.constant = true;\n ast.toWatch = [];\n break;\n case AST.UnaryExpression:\n findConstantAndWatchExpressions(ast.argument, $filter);\n ast.constant = ast.argument.constant;\n ast.toWatch = ast.argument.toWatch;\n break;\n case AST.BinaryExpression:\n findConstantAndWatchExpressions(ast.left, $filter);\n findConstantAndWatchExpressions(ast.right, $filter);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);\n break;\n case AST.LogicalExpression:\n findConstantAndWatchExpressions(ast.left, $filter);\n findConstantAndWatchExpressions(ast.right, $filter);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.ConditionalExpression:\n findConstantAndWatchExpressions(ast.test, $filter);\n findConstantAndWatchExpressions(ast.alternate, $filter);\n findConstantAndWatchExpressions(ast.consequent, $filter);\n ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.Identifier:\n ast.constant = false;\n ast.toWatch = [ast];\n break;\n case AST.MemberExpression:\n findConstantAndWatchExpressions(ast.object, $filter);\n if (ast.computed) {\n findConstantAndWatchExpressions(ast.property, $filter);\n }\n ast.constant = ast.object.constant && (!ast.computed || ast.property.constant);\n ast.toWatch = [ast];\n break;\n case AST.CallExpression:\n allConstants = ast.filter ? isStateless($filter, ast.callee.name) : false;\n argsToWatch = [];\n forEach(ast.arguments, function(expr) {\n findConstantAndWatchExpressions(expr, $filter);\n allConstants = allConstants && expr.constant;\n if (!expr.constant) {\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = ast.filter && isStateless($filter, ast.callee.name) ? argsToWatch : [ast];\n break;\n case AST.AssignmentExpression:\n findConstantAndWatchExpressions(ast.left, $filter);\n findConstantAndWatchExpressions(ast.right, $filter);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = [ast];\n break;\n case AST.ArrayExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.elements, function(expr) {\n findConstantAndWatchExpressions(expr, $filter);\n allConstants = allConstants && expr.constant;\n if (!expr.constant) {\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ObjectExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.properties, function(property) {\n findConstantAndWatchExpressions(property.value, $filter);\n allConstants = allConstants && property.value.constant;\n if (!property.value.constant) {\n argsToWatch.push.apply(argsToWatch, property.value.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ThisExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n case AST.LocalsExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n }\n}\n\nfunction getInputs(body) {\n if (body.length != 1) return;\n var lastExpression = body[0].expression;\n var candidate = lastExpression.toWatch;\n if (candidate.length !== 1) return candidate;\n return candidate[0] !== lastExpression ? candidate : undefined;\n}\n\nfunction isAssignable(ast) {\n return ast.type === AST.Identifier || ast.type === AST.MemberExpression;\n}\n\nfunction assignableAST(ast) {\n if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {\n return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='};\n }\n}\n\nfunction isLiteral(ast) {\n return ast.body.length === 0 ||\n ast.body.length === 1 && (\n ast.body[0].expression.type === AST.Literal ||\n ast.body[0].expression.type === AST.ArrayExpression ||\n ast.body[0].expression.type === AST.ObjectExpression);\n}\n\nfunction isConstant(ast) {\n return ast.constant;\n}\n\nfunction ASTCompiler(astBuilder, $filter) {\n this.astBuilder = astBuilder;\n this.$filter = $filter;\n}\n\nASTCompiler.prototype = {\n compile: function(expression, expensiveChecks) {\n var self = this;\n var ast = this.astBuilder.ast(expression);\n this.state = {\n nextId: 0,\n filters: {},\n expensiveChecks: expensiveChecks,\n fn: {vars: [], body: [], own: {}},\n assign: {vars: [], body: [], own: {}},\n inputs: []\n };\n findConstantAndWatchExpressions(ast, self.$filter);\n var extra = '';\n var assignable;\n this.stage = 'assign';\n if ((assignable = assignableAST(ast))) {\n this.state.computing = 'assign';\n var result = this.nextId();\n this.recurse(assignable, result);\n this.return_(result);\n extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l');\n }\n var toWatch = getInputs(ast.body);\n self.stage = 'inputs';\n forEach(toWatch, function(watch, key) {\n var fnKey = 'fn' + key;\n self.state[fnKey] = {vars: [], body: [], own: {}};\n self.state.computing = fnKey;\n var intoId = self.nextId();\n self.recurse(watch, intoId);\n self.return_(intoId);\n self.state.inputs.push(fnKey);\n watch.watchId = key;\n });\n this.state.computing = 'fn';\n this.stage = 'main';\n this.recurse(ast);\n var fnString =\n // The build and minification steps remove the string \"use strict\" from the code, but this is done using a regex.\n // This is a workaround for this until we do a better job at only removing the prefix only when we should.\n '\"' + this.USE + ' ' + this.STRICT + '\";\\n' +\n this.filterPrefix() +\n 'var fn=' + this.generateFunction('fn', 's,l,a,i') +\n extra +\n this.watchFns() +\n 'return fn;';\n\n /* jshint -W054 */\n var fn = (new Function('$filter',\n 'ensureSafeMemberName',\n 'ensureSafeObject',\n 'ensureSafeFunction',\n 'getStringValue',\n 'ensureSafeAssignContext',\n 'ifDefined',\n 'plus',\n 'text',\n fnString))(\n this.$filter,\n ensureSafeMemberName,\n ensureSafeObject,\n ensureSafeFunction,\n getStringValue,\n ensureSafeAssignContext,\n ifDefined,\n plusFn,\n expression);\n /* jshint +W054 */\n this.state = this.stage = undefined;\n fn.literal = isLiteral(ast);\n fn.constant = isConstant(ast);\n return fn;\n },\n\n USE: 'use',\n\n STRICT: 'strict',\n\n watchFns: function() {\n var result = [];\n var fns = this.state.inputs;\n var self = this;\n forEach(fns, function(name) {\n result.push('var ' + name + '=' + self.generateFunction(name, 's'));\n });\n if (fns.length) {\n result.push('fn.inputs=[' + fns.join(',') + '];');\n }\n return result.join('');\n },\n\n generateFunction: function(name, params) {\n return 'function(' + params + '){' +\n this.varsPrefix(name) +\n this.body(name) +\n '};';\n },\n\n filterPrefix: function() {\n var parts = [];\n var self = this;\n forEach(this.state.filters, function(id, filter) {\n parts.push(id + '=$filter(' + self.escape(filter) + ')');\n });\n if (parts.length) return 'var ' + parts.join(',') + ';';\n return '';\n },\n\n varsPrefix: function(section) {\n return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : '';\n },\n\n body: function(section) {\n return this.state[section].body.join('');\n },\n\n recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var left, right, self = this, args, expression;\n recursionFn = recursionFn || noop;\n if (!skipWatchIdCheck && isDefined(ast.watchId)) {\n intoId = intoId || this.nextId();\n this.if_('i',\n this.lazyAssign(intoId, this.computedMember('i', ast.watchId)),\n this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true)\n );\n return;\n }\n switch (ast.type) {\n case AST.Program:\n forEach(ast.body, function(expression, pos) {\n self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; });\n if (pos !== ast.body.length - 1) {\n self.current().body.push(right, ';');\n } else {\n self.return_(right);\n }\n });\n break;\n case AST.Literal:\n expression = this.escape(ast.value);\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.UnaryExpression:\n this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; });\n expression = ast.operator + '(' + this.ifDefined(right, 0) + ')';\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.BinaryExpression:\n this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; });\n this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; });\n if (ast.operator === '+') {\n expression = this.plus(left, right);\n } else if (ast.operator === '-') {\n expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);\n } else {\n expression = '(' + left + ')' + ast.operator + '(' + right + ')';\n }\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.LogicalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.left, intoId);\n self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId));\n recursionFn(intoId);\n break;\n case AST.ConditionalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.test, intoId);\n self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId));\n recursionFn(intoId);\n break;\n case AST.Identifier:\n intoId = intoId || this.nextId();\n if (nameId) {\n nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s');\n nameId.computed = false;\n nameId.name = ast.name;\n }\n ensureSafeMemberName(ast.name);\n self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)),\n function() {\n self.if_(self.stage === 'inputs' || 's', function() {\n if (create && create !== 1) {\n self.if_(\n self.not(self.nonComputedMember('s', ast.name)),\n self.lazyAssign(self.nonComputedMember('s', ast.name), '{}'));\n }\n self.assign(intoId, self.nonComputedMember('s', ast.name));\n });\n }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name))\n );\n if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.name)) {\n self.addEnsureSafeObject(intoId);\n }\n recursionFn(intoId);\n break;\n case AST.MemberExpression:\n left = nameId && (nameId.context = this.nextId()) || this.nextId();\n intoId = intoId || this.nextId();\n self.recurse(ast.object, left, undefined, function() {\n self.if_(self.notNull(left), function() {\n if (create && create !== 1) {\n self.addEnsureSafeAssignContext(left);\n }\n if (ast.computed) {\n right = self.nextId();\n self.recurse(ast.property, right);\n self.getStringValue(right);\n self.addEnsureSafeMemberName(right);\n if (create && create !== 1) {\n self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}'));\n }\n expression = self.ensureSafeObject(self.computedMember(left, right));\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = true;\n nameId.name = right;\n }\n } else {\n ensureSafeMemberName(ast.property.name);\n if (create && create !== 1) {\n self.if_(self.not(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}'));\n }\n expression = self.nonComputedMember(left, ast.property.name);\n if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.property.name)) {\n expression = self.ensureSafeObject(expression);\n }\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = false;\n nameId.name = ast.property.name;\n }\n }\n }, function() {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n }, !!create);\n break;\n case AST.CallExpression:\n intoId = intoId || this.nextId();\n if (ast.filter) {\n right = self.filter(ast.callee.name);\n args = [];\n forEach(ast.arguments, function(expr) {\n var argument = self.nextId();\n self.recurse(expr, argument);\n args.push(argument);\n });\n expression = right + '(' + args.join(',') + ')';\n self.assign(intoId, expression);\n recursionFn(intoId);\n } else {\n right = self.nextId();\n left = {};\n args = [];\n self.recurse(ast.callee, right, left, function() {\n self.if_(self.notNull(right), function() {\n self.addEnsureSafeFunction(right);\n forEach(ast.arguments, function(expr) {\n self.recurse(expr, self.nextId(), undefined, function(argument) {\n args.push(self.ensureSafeObject(argument));\n });\n });\n if (left.name) {\n if (!self.state.expensiveChecks) {\n self.addEnsureSafeObject(left.context);\n }\n expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')';\n } else {\n expression = right + '(' + args.join(',') + ')';\n }\n expression = self.ensureSafeObject(expression);\n self.assign(intoId, expression);\n }, function() {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n });\n }\n break;\n case AST.AssignmentExpression:\n right = this.nextId();\n left = {};\n if (!isAssignable(ast.left)) {\n throw $parseMinErr('lval', 'Trying to assign a value to a non l-value');\n }\n this.recurse(ast.left, undefined, left, function() {\n self.if_(self.notNull(left.context), function() {\n self.recurse(ast.right, right);\n self.addEnsureSafeObject(self.member(left.context, left.name, left.computed));\n self.addEnsureSafeAssignContext(left.context);\n expression = self.member(left.context, left.name, left.computed) + ast.operator + right;\n self.assign(intoId, expression);\n recursionFn(intoId || expression);\n });\n }, 1);\n break;\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function(expr) {\n self.recurse(expr, self.nextId(), undefined, function(argument) {\n args.push(argument);\n });\n });\n expression = '[' + args.join(',') + ']';\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.ObjectExpression:\n args = [];\n forEach(ast.properties, function(property) {\n self.recurse(property.value, self.nextId(), undefined, function(expr) {\n args.push(self.escape(\n property.key.type === AST.Identifier ? property.key.name :\n ('' + property.key.value)) +\n ':' + expr);\n });\n });\n expression = '{' + args.join(',') + '}';\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.ThisExpression:\n this.assign(intoId, 's');\n recursionFn('s');\n break;\n case AST.LocalsExpression:\n this.assign(intoId, 'l');\n recursionFn('l');\n break;\n case AST.NGValueParameter:\n this.assign(intoId, 'v');\n recursionFn('v');\n break;\n }\n },\n\n getHasOwnProperty: function(element, property) {\n var key = element + '.' + property;\n var own = this.current().own;\n if (!own.hasOwnProperty(key)) {\n own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');\n }\n return own[key];\n },\n\n assign: function(id, value) {\n if (!id) return;\n this.current().body.push(id, '=', value, ';');\n return id;\n },\n\n filter: function(filterName) {\n if (!this.state.filters.hasOwnProperty(filterName)) {\n this.state.filters[filterName] = this.nextId(true);\n }\n return this.state.filters[filterName];\n },\n\n ifDefined: function(id, defaultValue) {\n return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')';\n },\n\n plus: function(left, right) {\n return 'plus(' + left + ',' + right + ')';\n },\n\n return_: function(id) {\n this.current().body.push('return ', id, ';');\n },\n\n if_: function(test, alternate, consequent) {\n if (test === true) {\n alternate();\n } else {\n var body = this.current().body;\n body.push('if(', test, '){');\n alternate();\n body.push('}');\n if (consequent) {\n body.push('else{');\n consequent();\n body.push('}');\n }\n }\n },\n\n not: function(expression) {\n return '!(' + expression + ')';\n },\n\n notNull: function(expression) {\n return expression + '!=null';\n },\n\n nonComputedMember: function(left, right) {\n return left + '.' + right;\n },\n\n computedMember: function(left, right) {\n return left + '[' + right + ']';\n },\n\n member: function(left, right, computed) {\n if (computed) return this.computedMember(left, right);\n return this.nonComputedMember(left, right);\n },\n\n addEnsureSafeObject: function(item) {\n this.current().body.push(this.ensureSafeObject(item), ';');\n },\n\n addEnsureSafeMemberName: function(item) {\n this.current().body.push(this.ensureSafeMemberName(item), ';');\n },\n\n addEnsureSafeFunction: function(item) {\n this.current().body.push(this.ensureSafeFunction(item), ';');\n },\n\n addEnsureSafeAssignContext: function(item) {\n this.current().body.push(this.ensureSafeAssignContext(item), ';');\n },\n\n ensureSafeObject: function(item) {\n return 'ensureSafeObject(' + item + ',text)';\n },\n\n ensureSafeMemberName: function(item) {\n return 'ensureSafeMemberName(' + item + ',text)';\n },\n\n ensureSafeFunction: function(item) {\n return 'ensureSafeFunction(' + item + ',text)';\n },\n\n getStringValue: function(item) {\n this.assign(item, 'getStringValue(' + item + ')');\n },\n\n ensureSafeAssignContext: function(item) {\n return 'ensureSafeAssignContext(' + item + ',text)';\n },\n\n lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var self = this;\n return function() {\n self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);\n };\n },\n\n lazyAssign: function(id, value) {\n var self = this;\n return function() {\n self.assign(id, value);\n };\n },\n\n stringEscapeRegex: /[^ a-zA-Z0-9]/g,\n\n stringEscapeFn: function(c) {\n return '\\\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);\n },\n\n escape: function(value) {\n if (isString(value)) return \"'\" + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + \"'\";\n if (isNumber(value)) return value.toString();\n if (value === true) return 'true';\n if (value === false) return 'false';\n if (value === null) return 'null';\n if (typeof value === 'undefined') return 'undefined';\n\n throw $parseMinErr('esc', 'IMPOSSIBLE');\n },\n\n nextId: function(skip, init) {\n var id = 'v' + (this.state.nextId++);\n if (!skip) {\n this.current().vars.push(id + (init ? '=' + init : ''));\n }\n return id;\n },\n\n current: function() {\n return this.state[this.state.computing];\n }\n};\n\n\nfunction ASTInterpreter(astBuilder, $filter) {\n this.astBuilder = astBuilder;\n this.$filter = $filter;\n}\n\nASTInterpreter.prototype = {\n compile: function(expression, expensiveChecks) {\n var self = this;\n var ast = this.astBuilder.ast(expression);\n this.expression = expression;\n this.expensiveChecks = expensiveChecks;\n findConstantAndWatchExpressions(ast, self.$filter);\n var assignable;\n var assign;\n if ((assignable = assignableAST(ast))) {\n assign = this.recurse(assignable);\n }\n var toWatch = getInputs(ast.body);\n var inputs;\n if (toWatch) {\n inputs = [];\n forEach(toWatch, function(watch, key) {\n var input = self.recurse(watch);\n watch.input = input;\n inputs.push(input);\n watch.watchId = key;\n });\n }\n var expressions = [];\n forEach(ast.body, function(expression) {\n expressions.push(self.recurse(expression.expression));\n });\n var fn = ast.body.length === 0 ? function() {} :\n ast.body.length === 1 ? expressions[0] :\n function(scope, locals) {\n var lastValue;\n forEach(expressions, function(exp) {\n lastValue = exp(scope, locals);\n });\n return lastValue;\n };\n if (assign) {\n fn.assign = function(scope, value, locals) {\n return assign(scope, locals, value);\n };\n }\n if (inputs) {\n fn.inputs = inputs;\n }\n fn.literal = isLiteral(ast);\n fn.constant = isConstant(ast);\n return fn;\n },\n\n recurse: function(ast, context, create) {\n var left, right, self = this, args, expression;\n if (ast.input) {\n return this.inputs(ast.input, ast.watchId);\n }\n switch (ast.type) {\n case AST.Literal:\n return this.value(ast.value, context);\n case AST.UnaryExpression:\n right = this.recurse(ast.argument);\n return this['unary' + ast.operator](right, context);\n case AST.BinaryExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.LogicalExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.ConditionalExpression:\n return this['ternary?:'](\n this.recurse(ast.test),\n this.recurse(ast.alternate),\n this.recurse(ast.consequent),\n context\n );\n case AST.Identifier:\n ensureSafeMemberName(ast.name, self.expression);\n return self.identifier(ast.name,\n self.expensiveChecks || isPossiblyDangerousMemberName(ast.name),\n context, create, self.expression);\n case AST.MemberExpression:\n left = this.recurse(ast.object, false, !!create);\n if (!ast.computed) {\n ensureSafeMemberName(ast.property.name, self.expression);\n right = ast.property.name;\n }\n if (ast.computed) right = this.recurse(ast.property);\n return ast.computed ?\n this.computedMember(left, right, context, create, self.expression) :\n this.nonComputedMember(left, right, self.expensiveChecks, context, create, self.expression);\n case AST.CallExpression:\n args = [];\n forEach(ast.arguments, function(expr) {\n args.push(self.recurse(expr));\n });\n if (ast.filter) right = this.$filter(ast.callee.name);\n if (!ast.filter) right = this.recurse(ast.callee, true);\n return ast.filter ?\n function(scope, locals, assign, inputs) {\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(args[i](scope, locals, assign, inputs));\n }\n var value = right.apply(undefined, values, inputs);\n return context ? {context: undefined, name: undefined, value: value} : value;\n } :\n function(scope, locals, assign, inputs) {\n var rhs = right(scope, locals, assign, inputs);\n var value;\n if (rhs.value != null) {\n ensureSafeObject(rhs.context, self.expression);\n ensureSafeFunction(rhs.value, self.expression);\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(ensureSafeObject(args[i](scope, locals, assign, inputs), self.expression));\n }\n value = ensureSafeObject(rhs.value.apply(rhs.context, values), self.expression);\n }\n return context ? {value: value} : value;\n };\n case AST.AssignmentExpression:\n left = this.recurse(ast.left, true, 1);\n right = this.recurse(ast.right);\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n ensureSafeObject(lhs.value, self.expression);\n ensureSafeAssignContext(lhs.context);\n lhs.context[lhs.name] = rhs;\n return context ? {value: rhs} : rhs;\n };\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function(expr) {\n args.push(self.recurse(expr));\n });\n return function(scope, locals, assign, inputs) {\n var value = [];\n for (var i = 0; i < args.length; ++i) {\n value.push(args[i](scope, locals, assign, inputs));\n }\n return context ? {value: value} : value;\n };\n case AST.ObjectExpression:\n args = [];\n forEach(ast.properties, function(property) {\n args.push({key: property.key.type === AST.Identifier ?\n property.key.name :\n ('' + property.key.value),\n value: self.recurse(property.value)\n });\n });\n return function(scope, locals, assign, inputs) {\n var value = {};\n for (var i = 0; i < args.length; ++i) {\n value[args[i].key] = args[i].value(scope, locals, assign, inputs);\n }\n return context ? {value: value} : value;\n };\n case AST.ThisExpression:\n return function(scope) {\n return context ? {value: scope} : scope;\n };\n case AST.LocalsExpression:\n return function(scope, locals) {\n return context ? {value: locals} : locals;\n };\n case AST.NGValueParameter:\n return function(scope, locals, assign, inputs) {\n return context ? {value: assign} : assign;\n };\n }\n },\n\n 'unary+': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = +arg;\n } else {\n arg = 0;\n }\n return context ? {value: arg} : arg;\n };\n },\n 'unary-': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = -arg;\n } else {\n arg = 0;\n }\n return context ? {value: arg} : arg;\n };\n },\n 'unary!': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = !argument(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary+': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = plusFn(lhs, rhs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary-': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);\n return context ? {value: arg} : arg;\n };\n },\n 'binary*': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary/': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary%': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary===': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary!==': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary==': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary!=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary<': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary>': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary<=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary>=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary&&': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary||': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'ternary?:': function(test, alternate, consequent, context) {\n return function(scope, locals, assign, inputs) {\n var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n value: function(value, context) {\n return function() { return context ? {context: undefined, name: undefined, value: value} : value; };\n },\n identifier: function(name, expensiveChecks, context, create, expression) {\n return function(scope, locals, assign, inputs) {\n var base = locals && (name in locals) ? locals : scope;\n if (create && create !== 1 && base && !(base[name])) {\n base[name] = {};\n }\n var value = base ? base[name] : undefined;\n if (expensiveChecks) {\n ensureSafeObject(value, expression);\n }\n if (context) {\n return {context: base, name: name, value: value};\n } else {\n return value;\n }\n };\n },\n computedMember: function(left, right, context, create, expression) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs;\n var value;\n if (lhs != null) {\n rhs = right(scope, locals, assign, inputs);\n rhs = getStringValue(rhs);\n ensureSafeMemberName(rhs, expression);\n if (create && create !== 1) {\n ensureSafeAssignContext(lhs);\n if (lhs && !(lhs[rhs])) {\n lhs[rhs] = {};\n }\n }\n value = lhs[rhs];\n ensureSafeObject(value, expression);\n }\n if (context) {\n return {context: lhs, name: rhs, value: value};\n } else {\n return value;\n }\n };\n },\n nonComputedMember: function(left, right, expensiveChecks, context, create, expression) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n if (create && create !== 1) {\n ensureSafeAssignContext(lhs);\n if (lhs && !(lhs[right])) {\n lhs[right] = {};\n }\n }\n var value = lhs != null ? lhs[right] : undefined;\n if (expensiveChecks || isPossiblyDangerousMemberName(right)) {\n ensureSafeObject(value, expression);\n }\n if (context) {\n return {context: lhs, name: right, value: value};\n } else {\n return value;\n }\n };\n },\n inputs: function(input, watchId) {\n return function(scope, value, locals, inputs) {\n if (inputs) return inputs[watchId];\n return input(scope, value, locals);\n };\n }\n};\n\n/**\n * @constructor\n */\nvar Parser = function(lexer, $filter, options) {\n this.lexer = lexer;\n this.$filter = $filter;\n this.options = options;\n this.ast = new AST(this.lexer);\n this.astCompiler = options.csp ? new ASTInterpreter(this.ast, $filter) :\n new ASTCompiler(this.ast, $filter);\n};\n\nParser.prototype = {\n constructor: Parser,\n\n parse: function(text) {\n return this.astCompiler.compile(text, this.options.expensiveChecks);\n }\n};\n\nfunction isPossiblyDangerousMemberName(name) {\n return name == 'constructor';\n}\n\nvar objectValueOf = Object.prototype.valueOf;\n\nfunction getValueOf(value) {\n return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);\n}\n\n///////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $parse\n * @kind function\n *\n * @description\n *\n * Converts Angular {@link guide/expression expression} into a function.\n *\n * ```js\n * var getter = $parse('user.name');\n * var setter = getter.assign;\n * var context = {user:{name:'angular'}};\n * var locals = {user:{name:'local'}};\n *\n * expect(getter(context)).toEqual('angular');\n * setter(context, 'newValue');\n * expect(context.user.name).toEqual('newValue');\n * expect(getter(context, locals)).toEqual('local');\n * ```\n *\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n *\n * The returned function also has the following properties:\n * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript\n * literal.\n * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript\n * constant literals.\n * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be\n * set to a function to change its value on the given context.\n *\n */\n\n\n/**\n * @ngdoc provider\n * @name $parseProvider\n *\n * @description\n * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}\n * service.\n */\nfunction $ParseProvider() {\n var cacheDefault = createMap();\n var cacheExpensive = createMap();\n\n this.$get = ['$filter', function($filter) {\n var noUnsafeEval = csp().noUnsafeEval;\n var $parseOptions = {\n csp: noUnsafeEval,\n expensiveChecks: false\n },\n $parseOptionsExpensive = {\n csp: noUnsafeEval,\n expensiveChecks: true\n };\n var runningChecksEnabled = false;\n\n $parse.$$runningExpensiveChecks = function() {\n return runningChecksEnabled;\n };\n\n return $parse;\n\n function $parse(exp, interceptorFn, expensiveChecks) {\n var parsedExpression, oneTime, cacheKey;\n\n expensiveChecks = expensiveChecks || runningChecksEnabled;\n\n switch (typeof exp) {\n case 'string':\n exp = exp.trim();\n cacheKey = exp;\n\n var cache = (expensiveChecks ? cacheExpensive : cacheDefault);\n parsedExpression = cache[cacheKey];\n\n if (!parsedExpression) {\n if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {\n oneTime = true;\n exp = exp.substring(2);\n }\n var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions;\n var lexer = new Lexer(parseOptions);\n var parser = new Parser(lexer, $filter, parseOptions);\n parsedExpression = parser.parse(exp);\n if (parsedExpression.constant) {\n parsedExpression.$$watchDelegate = constantWatchDelegate;\n } else if (oneTime) {\n parsedExpression.$$watchDelegate = parsedExpression.literal ?\n oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;\n } else if (parsedExpression.inputs) {\n parsedExpression.$$watchDelegate = inputsWatchDelegate;\n }\n if (expensiveChecks) {\n parsedExpression = expensiveChecksInterceptor(parsedExpression);\n }\n cache[cacheKey] = parsedExpression;\n }\n return addInterceptor(parsedExpression, interceptorFn);\n\n case 'function':\n return addInterceptor(exp, interceptorFn);\n\n default:\n return addInterceptor(noop, interceptorFn);\n }\n }\n\n function expensiveChecksInterceptor(fn) {\n if (!fn) return fn;\n expensiveCheckFn.$$watchDelegate = fn.$$watchDelegate;\n expensiveCheckFn.assign = expensiveChecksInterceptor(fn.assign);\n expensiveCheckFn.constant = fn.constant;\n expensiveCheckFn.literal = fn.literal;\n for (var i = 0; fn.inputs && i < fn.inputs.length; ++i) {\n fn.inputs[i] = expensiveChecksInterceptor(fn.inputs[i]);\n }\n expensiveCheckFn.inputs = fn.inputs;\n\n return expensiveCheckFn;\n\n function expensiveCheckFn(scope, locals, assign, inputs) {\n var expensiveCheckOldValue = runningChecksEnabled;\n runningChecksEnabled = true;\n try {\n return fn(scope, locals, assign, inputs);\n } finally {\n runningChecksEnabled = expensiveCheckOldValue;\n }\n }\n }\n\n function expressionInputDirtyCheck(newValue, oldValueOfValue) {\n\n if (newValue == null || oldValueOfValue == null) { // null/undefined\n return newValue === oldValueOfValue;\n }\n\n if (typeof newValue === 'object') {\n\n // attempt to convert the value to a primitive type\n // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can\n // be cheaply dirty-checked\n newValue = getValueOf(newValue);\n\n if (typeof newValue === 'object') {\n // objects/arrays are not supported - deep-watching them would be too expensive\n return false;\n }\n\n // fall-through to the primitive equality check\n }\n\n //Primitive or NaN\n return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);\n }\n\n function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {\n var inputExpressions = parsedExpression.inputs;\n var lastResult;\n\n if (inputExpressions.length === 1) {\n var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails\n inputExpressions = inputExpressions[0];\n return scope.$watch(function expressionInputWatch(scope) {\n var newInputValue = inputExpressions(scope);\n if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) {\n lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);\n oldInputValueOf = newInputValue && getValueOf(newInputValue);\n }\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n\n var oldInputValueOfValues = [];\n var oldInputValues = [];\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails\n oldInputValues[i] = null;\n }\n\n return scope.$watch(function expressionInputsWatch(scope) {\n var changed = false;\n\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n var newInputValue = inputExpressions[i](scope);\n if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {\n oldInputValues[i] = newInputValue;\n oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);\n }\n }\n\n if (changed) {\n lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);\n }\n\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n\n function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch, lastValue;\n return unwatch = scope.$watch(function oneTimeWatch(scope) {\n return parsedExpression(scope);\n }, function oneTimeListener(value, old, scope) {\n lastValue = value;\n if (isFunction(listener)) {\n listener.apply(this, arguments);\n }\n if (isDefined(value)) {\n scope.$$postDigest(function() {\n if (isDefined(lastValue)) {\n unwatch();\n }\n });\n }\n }, objectEquality);\n }\n\n function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch, lastValue;\n return unwatch = scope.$watch(function oneTimeWatch(scope) {\n return parsedExpression(scope);\n }, function oneTimeListener(value, old, scope) {\n lastValue = value;\n if (isFunction(listener)) {\n listener.call(this, value, old, scope);\n }\n if (isAllDefined(value)) {\n scope.$$postDigest(function() {\n if (isAllDefined(lastValue)) unwatch();\n });\n }\n }, objectEquality);\n\n function isAllDefined(value) {\n var allDefined = true;\n forEach(value, function(val) {\n if (!isDefined(val)) allDefined = false;\n });\n return allDefined;\n }\n }\n\n function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch;\n return unwatch = scope.$watch(function constantWatch(scope) {\n unwatch();\n return parsedExpression(scope);\n }, listener, objectEquality);\n }\n\n function addInterceptor(parsedExpression, interceptorFn) {\n if (!interceptorFn) return parsedExpression;\n var watchDelegate = parsedExpression.$$watchDelegate;\n var useInputs = false;\n\n var regularWatch =\n watchDelegate !== oneTimeLiteralWatchDelegate &&\n watchDelegate !== oneTimeWatchDelegate;\n\n var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) {\n var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs);\n return interceptorFn(value, scope, locals);\n } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) {\n var value = parsedExpression(scope, locals, assign, inputs);\n var result = interceptorFn(value, scope, locals);\n // we only return the interceptor's result if the\n // initial value is defined (for bind-once)\n return isDefined(value) ? result : value;\n };\n\n // Propagate $$watchDelegates other then inputsWatchDelegate\n if (parsedExpression.$$watchDelegate &&\n parsedExpression.$$watchDelegate !== inputsWatchDelegate) {\n fn.$$watchDelegate = parsedExpression.$$watchDelegate;\n } else if (!interceptorFn.$stateful) {\n // If there is an interceptor, but no watchDelegate then treat the interceptor like\n // we treat filters - it is assumed to be a pure function unless flagged with $stateful\n fn.$$watchDelegate = inputsWatchDelegate;\n useInputs = !parsedExpression.inputs;\n fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression];\n }\n\n return fn;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $q\n * @requires $rootScope\n *\n * @description\n * A service that helps you run functions asynchronously, and use their return values (or exceptions)\n * when they are done processing.\n *\n * This is an implementation of promises/deferred objects inspired by\n * [Kris Kowal's Q](https://github.com/kriskowal/q).\n *\n * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred\n * implementations, and the other which resembles ES6 promises to some degree.\n *\n * # $q constructor\n *\n * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`\n * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony,\n * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n *\n * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are\n * available yet.\n *\n * It can be used like so:\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * // perform some asynchronous operation, resolve or reject the promise when appropriate.\n * return $q(function(resolve, reject) {\n * setTimeout(function() {\n * if (okToGreet(name)) {\n * resolve('Hello, ' + name + '!');\n * } else {\n * reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n * });\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * });\n * ```\n *\n * Note: progress/notify callbacks are not currently supported via the ES6-style interface.\n *\n * Note: unlike ES6 behavior, an exception thrown in the constructor function will NOT implicitly reject the promise.\n *\n * However, the more traditional CommonJS-style usage is still available, and documented below.\n *\n * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an\n * interface for interacting with an object that represents the result of an action that is\n * performed asynchronously, and may or may not be finished at any given point in time.\n *\n * From the perspective of dealing with error handling, deferred and promise APIs are to\n * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * var deferred = $q.defer();\n *\n * setTimeout(function() {\n * deferred.notify('About to greet ' + name + '.');\n *\n * if (okToGreet(name)) {\n * deferred.resolve('Hello, ' + name + '!');\n * } else {\n * deferred.reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n *\n * return deferred.promise;\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * }, function(update) {\n * alert('Got notification: ' + update);\n * });\n * ```\n *\n * At first it might not be obvious why this extra complexity is worth the trouble. The payoff\n * comes in the way of guarantees that promise and deferred APIs make, see\n * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.\n *\n * Additionally the promise api allows for composition that is very hard to do with the\n * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.\n * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the\n * section on serial or parallel joining of promises.\n *\n * # The Deferred API\n *\n * A new instance of deferred is constructed by calling `$q.defer()`.\n *\n * The purpose of the deferred object is to expose the associated Promise instance as well as APIs\n * that can be used for signaling the successful or unsuccessful completion, as well as the status\n * of the task.\n *\n * **Methods**\n *\n * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection\n * constructed via `$q.reject`, the promise will be rejected instead.\n * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to\n * resolving it with a rejection constructed via `$q.reject`.\n * - `notify(value)` - provides updates on the status of the promise's execution. This may be called\n * multiple times before the promise is either resolved or rejected.\n *\n * **Properties**\n *\n * - promise – `{Promise}` – promise object associated with this deferred.\n *\n *\n * # The Promise API\n *\n * A new promise instance is created when a deferred instance is created and can be retrieved by\n * calling `deferred.promise`.\n *\n * The purpose of the promise object is to allow for interested parties to get access to the result\n * of the deferred task when it completes.\n *\n * **Methods**\n *\n * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or\n * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously\n * as soon as the result is available. The callbacks are called with a single argument: the result\n * or rejection reason. Additionally, the notify callback may be called zero or more times to\n * provide a progress indication, before the promise is resolved or rejected.\n *\n * This method *returns a new promise* which is resolved or rejected via the return value of the\n * `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved\n * with the value which is resolved in that promise using\n * [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)).\n * It also notifies via the return value of the `notifyCallback` method. The promise cannot be\n * resolved or rejected from the notifyCallback method.\n *\n * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`\n *\n * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,\n * but to do so without modifying the final value. This is useful to release resources or do some\n * clean-up that needs to be done whether the promise was rejected or resolved. See the [full\n * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for\n * more information.\n *\n * # Chaining promises\n *\n * Because calling the `then` method of a promise returns a new derived promise, it is easily\n * possible to create a chain of promises:\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * return result + 1;\n * });\n *\n * // promiseB will be resolved immediately after promiseA is resolved and its value\n * // will be the result of promiseA incremented by 1\n * ```\n *\n * It is possible to create chains of any length and since a promise can be resolved with another\n * promise (which will defer its resolution further), it is possible to pause/defer resolution of\n * the promises at any point in the chain. This makes it possible to implement powerful APIs like\n * $http's response interceptors.\n *\n *\n * # Differences between Kris Kowal's Q and $q\n *\n * There are two main differences:\n *\n * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation\n * mechanism in angular, which means faster propagation of resolution or rejection into your\n * models and avoiding unnecessary browser repaints, which would result in flickering UI.\n * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains\n * all the important functionality needed for common async tasks.\n *\n * # Testing\n *\n * ```js\n * it('should simulate promise', inject(function($q, $rootScope) {\n * var deferred = $q.defer();\n * var promise = deferred.promise;\n * var resolvedValue;\n *\n * promise.then(function(value) { resolvedValue = value; });\n * expect(resolvedValue).toBeUndefined();\n *\n * // Simulate resolving of promise\n * deferred.resolve(123);\n * // Note that the 'then' function does not get called synchronously.\n * // This is because we want the promise API to always be async, whether or not\n * // it got called synchronously or asynchronously.\n * expect(resolvedValue).toBeUndefined();\n *\n * // Propagate promise resolution to 'then' functions using $apply().\n * $rootScope.$apply();\n * expect(resolvedValue).toEqual(123);\n * }));\n * ```\n *\n * @param {function(function, function)} resolver Function which is responsible for resolving or\n * rejecting the newly created promise. The first parameter is a function which resolves the\n * promise, the second parameter is a function which rejects the promise.\n *\n * @returns {Promise} The newly created promise.\n */\nfunction $QProvider() {\n\n this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {\n return qFactory(function(callback) {\n $rootScope.$evalAsync(callback);\n }, $exceptionHandler);\n }];\n}\n\nfunction $$QProvider() {\n this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {\n return qFactory(function(callback) {\n $browser.defer(callback);\n }, $exceptionHandler);\n }];\n}\n\n/**\n * Constructs a promise manager.\n *\n * @param {function(function)} nextTick Function for executing functions in the next turn.\n * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for\n * debugging purposes.\n * @returns {object} Promise manager.\n */\nfunction qFactory(nextTick, exceptionHandler) {\n var $qMinErr = minErr('$q', TypeError);\n\n /**\n * @ngdoc method\n * @name ng.$q#defer\n * @kind function\n *\n * @description\n * Creates a `Deferred` object which represents a task which will finish in the future.\n *\n * @returns {Deferred} Returns a new instance of deferred.\n */\n var defer = function() {\n var d = new Deferred();\n //Necessary to support unbound execution :/\n d.resolve = simpleBind(d, d.resolve);\n d.reject = simpleBind(d, d.reject);\n d.notify = simpleBind(d, d.notify);\n return d;\n };\n\n function Promise() {\n this.$$state = { status: 0 };\n }\n\n extend(Promise.prototype, {\n then: function(onFulfilled, onRejected, progressBack) {\n if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) {\n return this;\n }\n var result = new Deferred();\n\n this.$$state.pending = this.$$state.pending || [];\n this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);\n if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);\n\n return result.promise;\n },\n\n \"catch\": function(callback) {\n return this.then(null, callback);\n },\n\n \"finally\": function(callback, progressBack) {\n return this.then(function(value) {\n return handleCallback(value, true, callback);\n }, function(error) {\n return handleCallback(error, false, callback);\n }, progressBack);\n }\n });\n\n //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native\n function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }\n\n function processQueue(state) {\n var fn, deferred, pending;\n\n pending = state.pending;\n state.processScheduled = false;\n state.pending = undefined;\n for (var i = 0, ii = pending.length; i < ii; ++i) {\n deferred = pending[i][0];\n fn = pending[i][state.status];\n try {\n if (isFunction(fn)) {\n deferred.resolve(fn(state.value));\n } else if (state.status === 1) {\n deferred.resolve(state.value);\n } else {\n deferred.reject(state.value);\n }\n } catch (e) {\n deferred.reject(e);\n exceptionHandler(e);\n }\n }\n }\n\n function scheduleProcessQueue(state) {\n if (state.processScheduled || !state.pending) return;\n state.processScheduled = true;\n nextTick(function() { processQueue(state); });\n }\n\n function Deferred() {\n this.promise = new Promise();\n }\n\n extend(Deferred.prototype, {\n resolve: function(val) {\n if (this.promise.$$state.status) return;\n if (val === this.promise) {\n this.$$reject($qMinErr(\n 'qcycle',\n \"Expected promise to be resolved with value other than itself '{0}'\",\n val));\n } else {\n this.$$resolve(val);\n }\n\n },\n\n $$resolve: function(val) {\n var then;\n var that = this;\n var done = false;\n try {\n if ((isObject(val) || isFunction(val))) then = val && val.then;\n if (isFunction(then)) {\n this.promise.$$state.status = -1;\n then.call(val, resolvePromise, rejectPromise, simpleBind(this, this.notify));\n } else {\n this.promise.$$state.value = val;\n this.promise.$$state.status = 1;\n scheduleProcessQueue(this.promise.$$state);\n }\n } catch (e) {\n rejectPromise(e);\n exceptionHandler(e);\n }\n\n function resolvePromise(val) {\n if (done) return;\n done = true;\n that.$$resolve(val);\n }\n function rejectPromise(val) {\n if (done) return;\n done = true;\n that.$$reject(val);\n }\n },\n\n reject: function(reason) {\n if (this.promise.$$state.status) return;\n this.$$reject(reason);\n },\n\n $$reject: function(reason) {\n this.promise.$$state.value = reason;\n this.promise.$$state.status = 2;\n scheduleProcessQueue(this.promise.$$state);\n },\n\n notify: function(progress) {\n var callbacks = this.promise.$$state.pending;\n\n if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) {\n nextTick(function() {\n var callback, result;\n for (var i = 0, ii = callbacks.length; i < ii; i++) {\n result = callbacks[i][0];\n callback = callbacks[i][3];\n try {\n result.notify(isFunction(callback) ? callback(progress) : progress);\n } catch (e) {\n exceptionHandler(e);\n }\n }\n });\n }\n }\n });\n\n /**\n * @ngdoc method\n * @name $q#reject\n * @kind function\n *\n * @description\n * Creates a promise that is resolved as rejected with the specified `reason`. This api should be\n * used to forward rejection in a chain of promises. If you are dealing with the last promise in\n * a promise chain, you don't need to worry about it.\n *\n * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of\n * `reject` as the `throw` keyword in JavaScript. This also means that if you \"catch\" an error via\n * a promise error callback and you want to forward the error to the promise derived from the\n * current promise, you have to \"rethrow\" the error by returning a rejection constructed via\n * `reject`.\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * // success: do something and resolve promiseB\n * // with the old or a new result\n * return result;\n * }, function(reason) {\n * // error: handle the error if possible and\n * // resolve promiseB with newPromiseOrValue,\n * // otherwise forward the rejection to promiseB\n * if (canHandle(reason)) {\n * // handle the error and recover\n * return newPromiseOrValue;\n * }\n * return $q.reject(reason);\n * });\n * ```\n *\n * @param {*} reason Constant, message, exception or an object representing the rejection reason.\n * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.\n */\n var reject = function(reason) {\n var result = new Deferred();\n result.reject(reason);\n return result.promise;\n };\n\n var makePromise = function makePromise(value, resolved) {\n var result = new Deferred();\n if (resolved) {\n result.resolve(value);\n } else {\n result.reject(value);\n }\n return result.promise;\n };\n\n var handleCallback = function handleCallback(value, isResolved, callback) {\n var callbackOutput = null;\n try {\n if (isFunction(callback)) callbackOutput = callback();\n } catch (e) {\n return makePromise(e, false);\n }\n if (isPromiseLike(callbackOutput)) {\n return callbackOutput.then(function() {\n return makePromise(value, isResolved);\n }, function(error) {\n return makePromise(error, false);\n });\n } else {\n return makePromise(value, isResolved);\n }\n };\n\n /**\n * @ngdoc method\n * @name $q#when\n * @kind function\n *\n * @description\n * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\n * This is useful when you are dealing with an object that might or might not be a promise, or if\n * the promise comes from a source that can't be trusted.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n\n\n var when = function(value, callback, errback, progressBack) {\n var result = new Deferred();\n result.resolve(value);\n return result.promise.then(callback, errback, progressBack);\n };\n\n /**\n * @ngdoc method\n * @name $q#resolve\n * @kind function\n *\n * @description\n * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n var resolve = when;\n\n /**\n * @ngdoc method\n * @name $q#all\n * @kind function\n *\n * @description\n * Combines multiple promises into a single promise that is resolved when all of the input\n * promises are resolved.\n *\n * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.\n * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,\n * each value corresponding to the promise at the same index/key in the `promises` array/hash.\n * If any of the promises is resolved with a rejection, this resulting promise will be rejected\n * with the same rejection value.\n */\n\n function all(promises) {\n var deferred = new Deferred(),\n counter = 0,\n results = isArray(promises) ? [] : {};\n\n forEach(promises, function(promise, key) {\n counter++;\n when(promise).then(function(value) {\n if (results.hasOwnProperty(key)) return;\n results[key] = value;\n if (!(--counter)) deferred.resolve(results);\n }, function(reason) {\n if (results.hasOwnProperty(key)) return;\n deferred.reject(reason);\n });\n });\n\n if (counter === 0) {\n deferred.resolve(results);\n }\n\n return deferred.promise;\n }\n\n var $Q = function Q(resolver) {\n if (!isFunction(resolver)) {\n throw $qMinErr('norslvr', \"Expected resolverFn, got '{0}'\", resolver);\n }\n\n var deferred = new Deferred();\n\n function resolveFn(value) {\n deferred.resolve(value);\n }\n\n function rejectFn(reason) {\n deferred.reject(reason);\n }\n\n resolver(resolveFn, rejectFn);\n\n return deferred.promise;\n };\n\n // Let's make the instanceof operator work for promises, so that\n // `new $q(fn) instanceof $q` would evaluate to true.\n $Q.prototype = Promise.prototype;\n\n $Q.defer = defer;\n $Q.reject = reject;\n $Q.when = when;\n $Q.resolve = resolve;\n $Q.all = all;\n\n return $Q;\n}\n\nfunction $$RAFProvider() { //rAF\n this.$get = ['$window', '$timeout', function($window, $timeout) {\n var requestAnimationFrame = $window.requestAnimationFrame ||\n $window.webkitRequestAnimationFrame;\n\n var cancelAnimationFrame = $window.cancelAnimationFrame ||\n $window.webkitCancelAnimationFrame ||\n $window.webkitCancelRequestAnimationFrame;\n\n var rafSupported = !!requestAnimationFrame;\n var raf = rafSupported\n ? function(fn) {\n var id = requestAnimationFrame(fn);\n return function() {\n cancelAnimationFrame(id);\n };\n }\n : function(fn) {\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n return function() {\n $timeout.cancel(timer);\n };\n };\n\n raf.supported = rafSupported;\n\n return raf;\n }];\n}\n\n/**\n * DESIGN NOTES\n *\n * The design decisions behind the scope are heavily favored for speed and memory consumption.\n *\n * The typical use of scope is to watch the expressions, which most of the time return the same\n * value as last time so we optimize the operation.\n *\n * Closures construction is expensive in terms of speed as well as memory:\n * - No closures, instead use prototypical inheritance for API\n * - Internal state needs to be stored on scope directly, which means that private state is\n * exposed as $$____ properties\n *\n * Loop operations are optimized by using while(count--) { ... }\n * - This means that in order to keep the same order of execution as addition we have to add\n * items to the array at the beginning (unshift) instead of at the end (push)\n *\n * Child scopes are created and removed often\n * - Using an array would be slow since inserts in the middle are expensive; so we use linked lists\n *\n * There are fewer watches than observers. This is why you don't want the observer to be implemented\n * in the same way as watch. Watch requires return of the initialization function which is expensive\n * to construct.\n */\n\n\n/**\n * @ngdoc provider\n * @name $rootScopeProvider\n * @description\n *\n * Provider for the $rootScope service.\n */\n\n/**\n * @ngdoc method\n * @name $rootScopeProvider#digestTtl\n * @description\n *\n * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that the dependencies between `$watch`s will result in\n * several digest iterations. However if an application needs more than the default 10 digest\n * iterations for its model to stabilize then you should investigate what is causing the model to\n * continuously change during the digest.\n *\n * Increasing the TTL could have performance implications, so you should not change it without\n * proper justification.\n *\n * @param {number} limit The number of digest iterations.\n */\n\n\n/**\n * @ngdoc service\n * @name $rootScope\n * @description\n *\n * Every application has a single root {@link ng.$rootScope.Scope scope}.\n * All other scopes are descendant scopes of the root scope. Scopes provide separation\n * between the model and the view, via a mechanism for watching the model for changes.\n * They also provide event emission/broadcast and subscription facility. See the\n * {@link guide/scope developer guide on scopes}.\n */\nfunction $RootScopeProvider() {\n var TTL = 10;\n var $rootScopeMinErr = minErr('$rootScope');\n var lastDirtyWatch = null;\n var applyAsyncId = null;\n\n this.digestTtl = function(value) {\n if (arguments.length) {\n TTL = value;\n }\n return TTL;\n };\n\n function createChildScopeClass(parent) {\n function ChildScope() {\n this.$$watchers = this.$$nextSibling =\n this.$$childHead = this.$$childTail = null;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$id = nextUid();\n this.$$ChildScope = null;\n }\n ChildScope.prototype = parent;\n return ChildScope;\n }\n\n this.$get = ['$exceptionHandler', '$parse', '$browser',\n function($exceptionHandler, $parse, $browser) {\n\n function destroyChildScope($event) {\n $event.currentScope.$$destroyed = true;\n }\n\n function cleanUpScope($scope) {\n\n if (msie === 9) {\n // There is a memory leak in IE9 if all child scopes are not disconnected\n // completely when a scope is destroyed. So this code will recurse up through\n // all this scopes children\n //\n // See issue https://github.com/angular/angular.js/issues/10706\n $scope.$$childHead && cleanUpScope($scope.$$childHead);\n $scope.$$nextSibling && cleanUpScope($scope.$$nextSibling);\n }\n\n // The code below works around IE9 and V8's memory leaks\n //\n // See:\n // - https://code.google.com/p/v8/issues/detail?id=2073#c26\n // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909\n // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451\n\n $scope.$parent = $scope.$$nextSibling = $scope.$$prevSibling = $scope.$$childHead =\n $scope.$$childTail = $scope.$root = $scope.$$watchers = null;\n }\n\n /**\n * @ngdoc type\n * @name $rootScope.Scope\n *\n * @description\n * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the\n * {@link auto.$injector $injector}. Child scopes are created using the\n * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when\n * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for\n * an in-depth introduction and usage examples.\n *\n *\n * # Inheritance\n * A scope can inherit from a parent scope, as in this example:\n * ```js\n var parent = $rootScope;\n var child = parent.$new();\n\n parent.salutation = \"Hello\";\n expect(child.salutation).toEqual('Hello');\n\n child.salutation = \"Welcome\";\n expect(child.salutation).toEqual('Welcome');\n expect(parent.salutation).toEqual('Hello');\n * ```\n *\n * When interacting with `Scope` in tests, additional helper methods are available on the\n * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional\n * details.\n *\n *\n * @param {Object.<string, function()>=} providers Map of service factory which need to be\n * provided for the current scope. Defaults to {@link ng}.\n * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should\n * append/override services provided by `providers`. This is handy\n * when unit-testing and having the need to override a default\n * service.\n * @returns {Object} Newly created scope.\n *\n */\n function Scope() {\n this.$id = nextUid();\n this.$$phase = this.$parent = this.$$watchers =\n this.$$nextSibling = this.$$prevSibling =\n this.$$childHead = this.$$childTail = null;\n this.$root = this;\n this.$$destroyed = false;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$$isolateBindings = null;\n }\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$id\n *\n * @description\n * Unique scope ID (monotonically increasing) useful for debugging.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$parent\n *\n * @description\n * Reference to the parent scope.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$root\n *\n * @description\n * Reference to the root scope.\n */\n\n Scope.prototype = {\n constructor: Scope,\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$new\n * @kind function\n *\n * @description\n * Creates a new child {@link ng.$rootScope.Scope scope}.\n *\n * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.\n * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.\n *\n * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is\n * desired for the scope and its child scopes to be permanently detached from the parent and\n * thus stop participating in model change detection and listener notification by invoking.\n *\n * @param {boolean} isolate If true, then the scope does not prototypically inherit from the\n * parent scope. The scope is isolated, as it can not see parent scope properties.\n * When creating widgets, it is useful for the widget to not accidentally read parent\n * state.\n *\n * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`\n * of the newly created scope. Defaults to `this` scope if not provided.\n * This is used when creating a transclude scope to correctly place it\n * in the scope hierarchy while maintaining the correct prototypical\n * inheritance.\n *\n * @returns {Object} The newly created child scope.\n *\n */\n $new: function(isolate, parent) {\n var child;\n\n parent = parent || this;\n\n if (isolate) {\n child = new Scope();\n child.$root = this.$root;\n } else {\n // Only create a child scope class if somebody asks for one,\n // but cache it to allow the VM to optimize lookups.\n if (!this.$$ChildScope) {\n this.$$ChildScope = createChildScopeClass(this);\n }\n child = new this.$$ChildScope();\n }\n child.$parent = parent;\n child.$$prevSibling = parent.$$childTail;\n if (parent.$$childHead) {\n parent.$$childTail.$$nextSibling = child;\n parent.$$childTail = child;\n } else {\n parent.$$childHead = parent.$$childTail = child;\n }\n\n // When the new scope is not isolated or we inherit from `this`, and\n // the parent scope is destroyed, the property `$$destroyed` is inherited\n // prototypically. In all other cases, this property needs to be set\n // when the parent scope is destroyed.\n // The listener needs to be added after the parent is set\n if (isolate || parent != this) child.$on('$destroy', destroyChildScope);\n\n return child;\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watch\n * @kind function\n *\n * @description\n * Registers a `listener` callback to be executed whenever the `watchExpression` changes.\n *\n * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest\n * $digest()} and should return the value that will be watched. (`watchExpression` should not change\n * its value when executed multiple times with the same input because it may be executed multiple\n * times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be\n * [idempotent](http://en.wikipedia.org/wiki/Idempotence).\n * - The `listener` is called only when the value from the current `watchExpression` and the\n * previous call to `watchExpression` are not equal (with the exception of the initial run,\n * see below). Inequality is determined according to reference inequality,\n * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)\n * via the `!==` Javascript operator, unless `objectEquality == true`\n * (see next point)\n * - When `objectEquality == true`, inequality of the `watchExpression` is determined\n * according to the {@link angular.equals} function. To save the value of the object for\n * later comparison, the {@link angular.copy} function is used. This therefore means that\n * watching complex objects will have adverse memory and performance implications.\n * - The watch `listener` may change the model, which may trigger other `listener`s to fire.\n * This is achieved by rerunning the watchers until no changes are detected. The rerun\n * iteration limit is 10 to prevent an infinite loop deadlock.\n *\n *\n * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,\n * you can register a `watchExpression` function with no `listener`. (Be prepared for\n * multiple calls to your `watchExpression` because it will execute multiple times in a\n * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.)\n *\n * After a watcher is registered with the scope, the `listener` fn is called asynchronously\n * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the\n * watcher. In rare cases, this is undesirable because the listener is called when the result\n * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you\n * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the\n * listener was called due to initialization.\n *\n *\n *\n * # Example\n * ```js\n // let's assume that scope was dependency injected as the $rootScope\n var scope = $rootScope;\n scope.name = 'misko';\n scope.counter = 0;\n\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n\n\n\n // Using a function as a watchExpression\n var food;\n scope.foodCounter = 0;\n expect(scope.foodCounter).toEqual(0);\n scope.$watch(\n // This function returns the value being watched. It is called for each turn of the $digest loop\n function() { return food; },\n // This is the change listener, called when the value returned from the above function changes\n function(newValue, oldValue) {\n if ( newValue !== oldValue ) {\n // Only increment the counter if the value changed\n scope.foodCounter = scope.foodCounter + 1;\n }\n }\n );\n // No digest has been run so the counter will be zero\n expect(scope.foodCounter).toEqual(0);\n\n // Run the digest but since food has not changed count will still be zero\n scope.$digest();\n expect(scope.foodCounter).toEqual(0);\n\n // Update food and run digest. Now the counter will increment\n food = 'cheeseburger';\n scope.$digest();\n expect(scope.foodCounter).toEqual(1);\n\n * ```\n *\n *\n *\n * @param {(function()|string)} watchExpression Expression that is evaluated on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers\n * a call to the `listener`.\n *\n * - `string`: Evaluated as {@link guide/expression expression}\n * - `function(scope)`: called with current `scope` as a parameter.\n * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value\n * of `watchExpression` changes.\n *\n * - `newVal` contains the current value of the `watchExpression`\n * - `oldVal` contains the previous value of the `watchExpression`\n * - `scope` refers to the current scope\n * @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of\n * comparing for reference equality.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) {\n var get = $parse(watchExp);\n\n if (get.$$watchDelegate) {\n return get.$$watchDelegate(this, listener, objectEquality, get, watchExp);\n }\n var scope = this,\n array = scope.$$watchers,\n watcher = {\n fn: listener,\n last: initWatchVal,\n get: get,\n exp: prettyPrintExpression || watchExp,\n eq: !!objectEquality\n };\n\n lastDirtyWatch = null;\n\n if (!isFunction(listener)) {\n watcher.fn = noop;\n }\n\n if (!array) {\n array = scope.$$watchers = [];\n }\n // we use unshift since we use a while loop in $digest for speed.\n // the while loop reads in reverse order.\n array.unshift(watcher);\n incrementWatchersCount(this, 1);\n\n return function deregisterWatch() {\n if (arrayRemove(array, watcher) >= 0) {\n incrementWatchersCount(scope, -1);\n }\n lastDirtyWatch = null;\n };\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchGroup\n * @kind function\n *\n * @description\n * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.\n * If any one expression in the collection changes the `listener` is executed.\n *\n * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every\n * call to $digest() to see if any items changes.\n * - The `listener` is called whenever any expression in the `watchExpressions` array changes.\n *\n * @param {Array.<string|Function(scope)>} watchExpressions Array of expressions that will be individually\n * watched using {@link ng.$rootScope.Scope#$watch $watch()}\n *\n * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any\n * expression in `watchExpressions` changes\n * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * The `scope` refers to the current scope.\n * @returns {function()} Returns a de-registration function for all listeners.\n */\n $watchGroup: function(watchExpressions, listener) {\n var oldValues = new Array(watchExpressions.length);\n var newValues = new Array(watchExpressions.length);\n var deregisterFns = [];\n var self = this;\n var changeReactionScheduled = false;\n var firstRun = true;\n\n if (!watchExpressions.length) {\n // No expressions means we call the listener ASAP\n var shouldCall = true;\n self.$evalAsync(function() {\n if (shouldCall) listener(newValues, newValues, self);\n });\n return function deregisterWatchGroup() {\n shouldCall = false;\n };\n }\n\n if (watchExpressions.length === 1) {\n // Special case size of one\n return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {\n newValues[0] = value;\n oldValues[0] = oldValue;\n listener(newValues, (value === oldValue) ? newValues : oldValues, scope);\n });\n }\n\n forEach(watchExpressions, function(expr, i) {\n var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) {\n newValues[i] = value;\n oldValues[i] = oldValue;\n if (!changeReactionScheduled) {\n changeReactionScheduled = true;\n self.$evalAsync(watchGroupAction);\n }\n });\n deregisterFns.push(unwatchFn);\n });\n\n function watchGroupAction() {\n changeReactionScheduled = false;\n\n if (firstRun) {\n firstRun = false;\n listener(newValues, newValues, self);\n } else {\n listener(newValues, oldValues, self);\n }\n }\n\n return function deregisterWatchGroup() {\n while (deregisterFns.length) {\n deregisterFns.shift()();\n }\n };\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchCollection\n * @kind function\n *\n * @description\n * Shallow watches the properties of an object and fires whenever any of the properties change\n * (for arrays, this implies watching the array items; for object maps, this implies watching\n * the properties). If a change is detected, the `listener` callback is fired.\n *\n * - The `obj` collection is observed via standard $watch operation and is examined on every\n * call to $digest() to see if any items have been added, removed, or moved.\n * - The `listener` is called whenever anything within the `obj` has changed. Examples include\n * adding, removing, and moving items belonging to an object or array.\n *\n *\n * # Example\n * ```js\n $scope.names = ['igor', 'matias', 'misko', 'james'];\n $scope.dataCount = 4;\n\n $scope.$watchCollection('names', function(newNames, oldNames) {\n $scope.dataCount = newNames.length;\n });\n\n expect($scope.dataCount).toEqual(4);\n $scope.$digest();\n\n //still at 4 ... no changes\n expect($scope.dataCount).toEqual(4);\n\n $scope.names.pop();\n $scope.$digest();\n\n //now there's been a change\n expect($scope.dataCount).toEqual(3);\n * ```\n *\n *\n * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The\n * expression value should evaluate to an object or an array which is observed on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the\n * collection will trigger a call to the `listener`.\n *\n * @param {function(newCollection, oldCollection, scope)} listener a callback function called\n * when a change is detected.\n * - The `newCollection` object is the newly modified data obtained from the `obj` expression\n * - The `oldCollection` object is a copy of the former collection data.\n * Due to performance considerations, the`oldCollection` value is computed only if the\n * `listener` function declares two or more arguments.\n * - The `scope` argument refers to the current scope.\n *\n * @returns {function()} Returns a de-registration function for this listener. When the\n * de-registration function is executed, the internal watch operation is terminated.\n */\n $watchCollection: function(obj, listener) {\n $watchCollectionInterceptor.$stateful = true;\n\n var self = this;\n // the current value, updated on each dirty-check run\n var newValue;\n // a shallow copy of the newValue from the last dirty-check run,\n // updated to match newValue during dirty-check run\n var oldValue;\n // a shallow copy of the newValue from when the last change happened\n var veryOldValue;\n // only track veryOldValue if the listener is asking for it\n var trackVeryOldValue = (listener.length > 1);\n var changeDetected = 0;\n var changeDetector = $parse(obj, $watchCollectionInterceptor);\n var internalArray = [];\n var internalObject = {};\n var initRun = true;\n var oldLength = 0;\n\n function $watchCollectionInterceptor(_value) {\n newValue = _value;\n var newLength, key, bothNaN, newItem, oldItem;\n\n // If the new value is undefined, then return undefined as the watch may be a one-time watch\n if (isUndefined(newValue)) return;\n\n if (!isObject(newValue)) { // if primitive\n if (oldValue !== newValue) {\n oldValue = newValue;\n changeDetected++;\n }\n } else if (isArrayLike(newValue)) {\n if (oldValue !== internalArray) {\n // we are transitioning from something which was not an array into array.\n oldValue = internalArray;\n oldLength = oldValue.length = 0;\n changeDetected++;\n }\n\n newLength = newValue.length;\n\n if (oldLength !== newLength) {\n // if lengths do not match we need to trigger change notification\n changeDetected++;\n oldValue.length = oldLength = newLength;\n }\n // copy the items to oldValue and look for changes.\n for (var i = 0; i < newLength; i++) {\n oldItem = oldValue[i];\n newItem = newValue[i];\n\n bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n if (!bothNaN && (oldItem !== newItem)) {\n changeDetected++;\n oldValue[i] = newItem;\n }\n }\n } else {\n if (oldValue !== internalObject) {\n // we are transitioning from something which was not an object into object.\n oldValue = internalObject = {};\n oldLength = 0;\n changeDetected++;\n }\n // copy the items to oldValue and look for changes.\n newLength = 0;\n for (key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n newLength++;\n newItem = newValue[key];\n oldItem = oldValue[key];\n\n if (key in oldValue) {\n bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n if (!bothNaN && (oldItem !== newItem)) {\n changeDetected++;\n oldValue[key] = newItem;\n }\n } else {\n oldLength++;\n oldValue[key] = newItem;\n changeDetected++;\n }\n }\n }\n if (oldLength > newLength) {\n // we used to have more keys, need to find them and destroy them.\n changeDetected++;\n for (key in oldValue) {\n if (!hasOwnProperty.call(newValue, key)) {\n oldLength--;\n delete oldValue[key];\n }\n }\n }\n }\n return changeDetected;\n }\n\n function $watchCollectionAction() {\n if (initRun) {\n initRun = false;\n listener(newValue, newValue, self);\n } else {\n listener(newValue, veryOldValue, self);\n }\n\n // make a copy for the next time a collection is changed\n if (trackVeryOldValue) {\n if (!isObject(newValue)) {\n //primitive\n veryOldValue = newValue;\n } else if (isArrayLike(newValue)) {\n veryOldValue = new Array(newValue.length);\n for (var i = 0; i < newValue.length; i++) {\n veryOldValue[i] = newValue[i];\n }\n } else { // if object\n veryOldValue = {};\n for (var key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n veryOldValue[key] = newValue[key];\n }\n }\n }\n }\n }\n\n return this.$watch(changeDetector, $watchCollectionAction);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$digest\n * @kind function\n *\n * @description\n * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and\n * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change\n * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}\n * until no more listeners are firing. This means that it is possible to get into an infinite\n * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of\n * iterations exceeds 10.\n *\n * Usually, you don't call `$digest()` directly in\n * {@link ng.directive:ngController controllers} or in\n * {@link ng.$compileProvider#directive directives}.\n * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within\n * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.\n *\n * If you want to be notified whenever `$digest()` is called,\n * you can register a `watchExpression` function with\n * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.\n *\n * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.\n *\n * # Example\n * ```js\n var scope = ...;\n scope.name = 'misko';\n scope.counter = 0;\n\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n * ```\n *\n */\n $digest: function() {\n var watch, value, last, fn, get,\n watchers,\n length,\n dirty, ttl = TTL,\n next, current, target = this,\n watchLog = [],\n logIdx, logMsg, asyncTask;\n\n beginPhase('$digest');\n // Check for changes to browser url that happened in sync before the call to $digest\n $browser.$$checkUrlChange();\n\n if (this === $rootScope && applyAsyncId !== null) {\n // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then\n // cancel the scheduled $apply and flush the queue of expressions to be evaluated.\n $browser.defer.cancel(applyAsyncId);\n flushApplyAsync();\n }\n\n lastDirtyWatch = null;\n\n do { // \"while dirty\" loop\n dirty = false;\n current = target;\n\n while (asyncQueue.length) {\n try {\n asyncTask = asyncQueue.shift();\n asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);\n } catch (e) {\n $exceptionHandler(e);\n }\n lastDirtyWatch = null;\n }\n\n traverseScopesLoop:\n do { // \"traverse the scopes\" loop\n if ((watchers = current.$$watchers)) {\n // process our watches\n length = watchers.length;\n while (length--) {\n try {\n watch = watchers[length];\n // Most common watches are on primitives, in which case we can short\n // circuit it with === operator, only when === fails do we use .equals\n if (watch) {\n get = watch.get;\n if ((value = get(current)) !== (last = watch.last) &&\n !(watch.eq\n ? equals(value, last)\n : (typeof value === 'number' && typeof last === 'number'\n && isNaN(value) && isNaN(last)))) {\n dirty = true;\n lastDirtyWatch = watch;\n watch.last = watch.eq ? copy(value, null) : value;\n fn = watch.fn;\n fn(value, ((last === initWatchVal) ? value : last), current);\n if (ttl < 5) {\n logIdx = 4 - ttl;\n if (!watchLog[logIdx]) watchLog[logIdx] = [];\n watchLog[logIdx].push({\n msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,\n newVal: value,\n oldVal: last\n });\n }\n } else if (watch === lastDirtyWatch) {\n // If the most recently dirty watcher is now clean, short circuit since the remaining watchers\n // have already been tested.\n dirty = false;\n break traverseScopesLoop;\n }\n }\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $broadcast\n if (!(next = ((current.$$watchersCount && current.$$childHead) ||\n (current !== target && current.$$nextSibling)))) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n } while ((current = next));\n\n // `break traverseScopesLoop;` takes us to here\n\n if ((dirty || asyncQueue.length) && !(ttl--)) {\n clearPhase();\n throw $rootScopeMinErr('infdig',\n '{0} $digest() iterations reached. Aborting!\\n' +\n 'Watchers fired in the last 5 iterations: {1}',\n TTL, watchLog);\n }\n\n } while (dirty || asyncQueue.length);\n\n clearPhase();\n\n while (postDigestQueue.length) {\n try {\n postDigestQueue.shift()();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n },\n\n\n /**\n * @ngdoc event\n * @name $rootScope.Scope#$destroy\n * @eventType broadcast on scope being destroyed\n *\n * @description\n * Broadcasted when a scope and its children are being destroyed.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$destroy\n * @kind function\n *\n * @description\n * Removes the current scope (and all of its children) from the parent scope. Removal implies\n * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer\n * propagate to the current scope and its children. Removal also implies that the current\n * scope is eligible for garbage collection.\n *\n * The `$destroy()` is usually used by directives such as\n * {@link ng.directive:ngRepeat ngRepeat} for managing the\n * unrolling of the loop.\n *\n * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.\n * Application code can register a `$destroy` event handler that will give it a chance to\n * perform any necessary cleanup.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n $destroy: function() {\n // We can't destroy a scope that has been already destroyed.\n if (this.$$destroyed) return;\n var parent = this.$parent;\n\n this.$broadcast('$destroy');\n this.$$destroyed = true;\n\n if (this === $rootScope) {\n //Remove handlers attached to window when $rootScope is removed\n $browser.$$applicationDestroyed();\n }\n\n incrementWatchersCount(this, -this.$$watchersCount);\n for (var eventName in this.$$listenerCount) {\n decrementListenerCount(this, this.$$listenerCount[eventName], eventName);\n }\n\n // sever all the references to parent scopes (after this cleanup, the current scope should\n // not be retained by any of our references and should be eligible for garbage collection)\n if (parent && parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;\n if (parent && parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;\n if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;\n if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;\n\n // Disable listeners, watchers and apply/digest methods\n this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;\n this.$on = this.$watch = this.$watchGroup = function() { return noop; };\n this.$$listeners = {};\n\n // Disconnect the next sibling to prevent `cleanUpScope` destroying those too\n this.$$nextSibling = null;\n cleanUpScope(this);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$eval\n * @kind function\n *\n * @description\n * Executes the `expression` on the current scope and returns the result. Any exceptions in\n * the expression are propagated (uncaught). This is useful when evaluating Angular\n * expressions.\n *\n * # Example\n * ```js\n var scope = ng.$rootScope.Scope();\n scope.a = 1;\n scope.b = 2;\n\n expect(scope.$eval('a+b')).toEqual(3);\n expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);\n * ```\n *\n * @param {(string|function())=} expression An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n * @returns {*} The result of evaluating the expression.\n */\n $eval: function(expr, locals) {\n return $parse(expr)(this, locals);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$evalAsync\n * @kind function\n *\n * @description\n * Executes the expression on the current scope at a later point in time.\n *\n * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only\n * that:\n *\n * - it will execute after the function that scheduled the evaluation (preferably before DOM\n * rendering).\n * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after\n * `expression` execution.\n *\n * Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle\n * will be scheduled. However, it is encouraged to always call code that changes the model\n * from within an `$apply` call. That includes code evaluated via `$evalAsync`.\n *\n * @param {(string|function())=} expression An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n */\n $evalAsync: function(expr, locals) {\n // if we are outside of an $digest loop and this is the first time we are scheduling async\n // task also schedule async auto-flush\n if (!$rootScope.$$phase && !asyncQueue.length) {\n $browser.defer(function() {\n if (asyncQueue.length) {\n $rootScope.$digest();\n }\n });\n }\n\n asyncQueue.push({scope: this, expression: $parse(expr), locals: locals});\n },\n\n $$postDigest: function(fn) {\n postDigestQueue.push(fn);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$apply\n * @kind function\n *\n * @description\n * `$apply()` is used to execute an expression in angular from outside of the angular\n * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).\n * Because we are calling into the angular framework we need to perform proper scope life\n * cycle of {@link ng.$exceptionHandler exception handling},\n * {@link ng.$rootScope.Scope#$digest executing watches}.\n *\n * ## Life cycle\n *\n * # Pseudo-Code of `$apply()`\n * ```js\n function $apply(expr) {\n try {\n return $eval(expr);\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n $root.$digest();\n }\n }\n * ```\n *\n *\n * Scope's `$apply()` method transitions through the following stages:\n *\n * 1. The {@link guide/expression expression} is executed using the\n * {@link ng.$rootScope.Scope#$eval $eval()} method.\n * 2. Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the\n * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.\n *\n *\n * @param {(string|function())=} exp An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n *\n * @returns {*} The result of evaluating the expression.\n */\n $apply: function(expr) {\n try {\n beginPhase('$apply');\n try {\n return this.$eval(expr);\n } finally {\n clearPhase();\n }\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n try {\n $rootScope.$digest();\n } catch (e) {\n $exceptionHandler(e);\n throw e;\n }\n }\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$applyAsync\n * @kind function\n *\n * @description\n * Schedule the invocation of $apply to occur at a later time. The actual time difference\n * varies across browsers, but is typically around ~10 milliseconds.\n *\n * This can be used to queue up multiple expressions which need to be evaluated in the same\n * digest.\n *\n * @param {(string|function())=} exp An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n */\n $applyAsync: function(expr) {\n var scope = this;\n expr && applyAsyncQueue.push($applyAsyncExpression);\n expr = $parse(expr);\n scheduleApplyAsync();\n\n function $applyAsyncExpression() {\n scope.$eval(expr);\n }\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$on\n * @kind function\n *\n * @description\n * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for\n * discussion of event life cycle.\n *\n * The event listener function format is: `function(event, args...)`. The `event` object\n * passed into the listener has the following attributes:\n *\n * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or\n * `$broadcast`-ed.\n * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the\n * event propagates through the scope hierarchy, this property is set to null.\n * - `name` - `{string}`: name of the event.\n * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel\n * further event propagation (available only for events that were `$emit`-ed).\n * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag\n * to true.\n * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.\n *\n * @param {string} name Event name to listen on.\n * @param {function(event, ...args)} listener Function to call when the event is emitted.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $on: function(name, listener) {\n var namedListeners = this.$$listeners[name];\n if (!namedListeners) {\n this.$$listeners[name] = namedListeners = [];\n }\n namedListeners.push(listener);\n\n var current = this;\n do {\n if (!current.$$listenerCount[name]) {\n current.$$listenerCount[name] = 0;\n }\n current.$$listenerCount[name]++;\n } while ((current = current.$parent));\n\n var self = this;\n return function() {\n var indexOfListener = namedListeners.indexOf(listener);\n if (indexOfListener !== -1) {\n namedListeners[indexOfListener] = null;\n decrementListenerCount(self, 1, name);\n }\n };\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$emit\n * @kind function\n *\n * @description\n * Dispatches an event `name` upwards through the scope hierarchy notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$emit` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event traverses upwards toward the root scope and calls all\n * registered listeners along the way. The event will stop propagating if one of the listeners\n * cancels it.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to emit.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).\n */\n $emit: function(name, args) {\n var empty = [],\n namedListeners,\n scope = this,\n stopPropagation = false,\n event = {\n name: name,\n targetScope: scope,\n stopPropagation: function() {stopPropagation = true;},\n preventDefault: function() {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n },\n listenerArgs = concat([event], arguments, 1),\n i, length;\n\n do {\n namedListeners = scope.$$listeners[name] || empty;\n event.currentScope = scope;\n for (i = 0, length = namedListeners.length; i < length; i++) {\n\n // if listeners were deregistered, defragment the array\n if (!namedListeners[i]) {\n namedListeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n try {\n //allow all listeners attached to the current scope to run\n namedListeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n //if any listener on the current scope stops propagation, prevent bubbling\n if (stopPropagation) {\n event.currentScope = null;\n return event;\n }\n //traverse upwards\n scope = scope.$parent;\n } while (scope);\n\n event.currentScope = null;\n\n return event;\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$broadcast\n * @kind function\n *\n * @description\n * Dispatches an event `name` downwards to all child scopes (and their children) notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$broadcast` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event propagates to all direct and indirect scopes of the current\n * scope and calls all registered listeners along the way. The event cannot be canceled.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to broadcast.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}\n */\n $broadcast: function(name, args) {\n var target = this,\n current = target,\n next = target,\n event = {\n name: name,\n targetScope: target,\n preventDefault: function() {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n };\n\n if (!target.$$listenerCount[name]) return event;\n\n var listenerArgs = concat([event], arguments, 1),\n listeners, i, length;\n\n //down while you can, then up and next sibling or up and next sibling until back at root\n while ((current = next)) {\n event.currentScope = current;\n listeners = current.$$listeners[name] || [];\n for (i = 0, length = listeners.length; i < length; i++) {\n // if listeners were deregistered, defragment the array\n if (!listeners[i]) {\n listeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n\n try {\n listeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $digest\n // (though it differs due to having the extra check for $$listenerCount)\n if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||\n (current !== target && current.$$nextSibling)))) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n }\n\n event.currentScope = null;\n return event;\n }\n };\n\n var $rootScope = new Scope();\n\n //The internal queues. Expose them on the $rootScope for debugging/testing purposes.\n var asyncQueue = $rootScope.$$asyncQueue = [];\n var postDigestQueue = $rootScope.$$postDigestQueue = [];\n var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];\n\n return $rootScope;\n\n\n function beginPhase(phase) {\n if ($rootScope.$$phase) {\n throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);\n }\n\n $rootScope.$$phase = phase;\n }\n\n function clearPhase() {\n $rootScope.$$phase = null;\n }\n\n function incrementWatchersCount(current, count) {\n do {\n current.$$watchersCount += count;\n } while ((current = current.$parent));\n }\n\n function decrementListenerCount(current, count, name) {\n do {\n current.$$listenerCount[name] -= count;\n\n if (current.$$listenerCount[name] === 0) {\n delete current.$$listenerCount[name];\n }\n } while ((current = current.$parent));\n }\n\n /**\n * function used as an initial value for watchers.\n * because it's unique we can easily tell it apart from other values\n */\n function initWatchVal() {}\n\n function flushApplyAsync() {\n while (applyAsyncQueue.length) {\n try {\n applyAsyncQueue.shift()();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n applyAsyncId = null;\n }\n\n function scheduleApplyAsync() {\n if (applyAsyncId === null) {\n applyAsyncId = $browser.defer(function() {\n $rootScope.$apply(flushApplyAsync);\n });\n }\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $rootElement\n *\n * @description\n * The root element of Angular application. This is either the element where {@link\n * ng.directive:ngApp ngApp} was declared or the element passed into\n * {@link angular.bootstrap}. The element represents the root element of application. It is also the\n * location where the application's {@link auto.$injector $injector} service gets\n * published, and can be retrieved using `$rootElement.injector()`.\n */\n\n\n// the implementation is in angular.bootstrap\n\n/**\n * @description\n * Private service to sanitize uris for links and images. Used by $compile and $sanitize.\n */\nfunction $$SanitizeUriProvider() {\n var aHrefSanitizationWhitelist = /^\\s*(https?|ftp|mailto|tel|file):/,\n imgSrcSanitizationWhitelist = /^\\s*((https?|ftp|file|blob):|data:image\\/)/;\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n aHrefSanitizationWhitelist = regexp;\n return this;\n }\n return aHrefSanitizationWhitelist;\n };\n\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n imgSrcSanitizationWhitelist = regexp;\n return this;\n }\n return imgSrcSanitizationWhitelist;\n };\n\n this.$get = function() {\n return function sanitizeUri(uri, isImage) {\n var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;\n var normalizedVal;\n normalizedVal = urlResolve(uri).href;\n if (normalizedVal !== '' && !normalizedVal.match(regex)) {\n return 'unsafe:' + normalizedVal;\n }\n return uri;\n };\n };\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $sceMinErr = minErr('$sce');\n\nvar SCE_CONTEXTS = {\n HTML: 'html',\n CSS: 'css',\n URL: 'url',\n // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a\n // url. (e.g. ng-include, script src, templateUrl)\n RESOURCE_URL: 'resourceUrl',\n JS: 'js'\n};\n\n// Helper functions follow.\n\nfunction adjustMatcher(matcher) {\n if (matcher === 'self') {\n return matcher;\n } else if (isString(matcher)) {\n // Strings match exactly except for 2 wildcards - '*' and '**'.\n // '*' matches any character except those from the set ':/.?&'.\n // '**' matches any character (like .* in a RegExp).\n // More than 2 *'s raises an error as it's ill defined.\n if (matcher.indexOf('***') > -1) {\n throw $sceMinErr('iwcard',\n 'Illegal sequence *** in string matcher. String: {0}', matcher);\n }\n matcher = escapeForRegexp(matcher).\n replace('\\\\*\\\\*', '.*').\n replace('\\\\*', '[^:/.?&;]*');\n return new RegExp('^' + matcher + '$');\n } else if (isRegExp(matcher)) {\n // The only other type of matcher allowed is a Regexp.\n // Match entire URL / disallow partial matches.\n // Flags are reset (i.e. no global, ignoreCase or multiline)\n return new RegExp('^' + matcher.source + '$');\n } else {\n throw $sceMinErr('imatcher',\n 'Matchers may only be \"self\", string patterns or RegExp objects');\n }\n}\n\n\nfunction adjustMatchers(matchers) {\n var adjustedMatchers = [];\n if (isDefined(matchers)) {\n forEach(matchers, function(matcher) {\n adjustedMatchers.push(adjustMatcher(matcher));\n });\n }\n return adjustedMatchers;\n}\n\n\n/**\n * @ngdoc service\n * @name $sceDelegate\n * @kind function\n *\n * @description\n *\n * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict\n * Contextual Escaping (SCE)} services to AngularJS.\n *\n * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of\n * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is\n * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to\n * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things\n * work because `$sce` delegates to `$sceDelegate` for these operations.\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.\n *\n * The default instance of `$sceDelegate` should work out of the box with little pain. While you\n * can override it completely to change the behavior of `$sce`, the common case would\n * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting\n * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as\n * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist\n * $sceDelegateProvider.resourceUrlWhitelist} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n */\n\n/**\n * @ngdoc provider\n * @name $sceDelegateProvider\n * @description\n *\n * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate\n * $sceDelegate} service. This allows one to get/set the whitelists and blacklists used to ensure\n * that the URLs used for sourcing Angular templates are safe. Refer {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and\n * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n *\n * For the general details about this service in Angular, read the main page for {@link ng.$sce\n * Strict Contextual Escaping (SCE)}.\n *\n * **Example**: Consider the following case. <a name=\"example\"></a>\n *\n * - your app is hosted at url `http://myapp.example.com/`\n * - but some of your templates are hosted on other domains you control such as\n * `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc.\n * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.\n *\n * Here is what a secure configuration for this scenario might look like:\n *\n * ```\n * angular.module('myApp', []).config(function($sceDelegateProvider) {\n * $sceDelegateProvider.resourceUrlWhitelist([\n * // Allow same origin resource loads.\n * 'self',\n * // Allow loading from our assets domain. Notice the difference between * and **.\n * 'http://srv*.assets.example.com/**'\n * ]);\n *\n * // The blacklist overrides the whitelist so the open redirect here is blocked.\n * $sceDelegateProvider.resourceUrlBlacklist([\n * 'http://myapp.example.com/clickThru**'\n * ]);\n * });\n * ```\n */\n\nfunction $SceDelegateProvider() {\n this.SCE_CONTEXTS = SCE_CONTEXTS;\n\n // Resource URLs can also be trusted by policy.\n var resourceUrlWhitelist = ['self'],\n resourceUrlBlacklist = [];\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlWhitelist\n * @kind function\n *\n * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value\n * provided. This must be an array or null. A snapshot of this array is used so further\n * changes to the array are ignored.\n *\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** an empty whitelist array will block all URLs!\n * </div>\n *\n * @return {Array} the currently set whitelist array.\n *\n * The **default value** when no whitelist has been explicitly set is `['self']` allowing only\n * same origin resource requests.\n *\n * @description\n * Sets/Gets the whitelist of trusted resource URLs.\n */\n this.resourceUrlWhitelist = function(value) {\n if (arguments.length) {\n resourceUrlWhitelist = adjustMatchers(value);\n }\n return resourceUrlWhitelist;\n };\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlBlacklist\n * @kind function\n *\n * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value\n * provided. This must be an array or null. A snapshot of this array is used so further\n * changes to the array are ignored.\n *\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.\n *\n * The typical usage for the blacklist is to **block\n * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as\n * these would otherwise be trusted but actually return content from the redirected domain.\n *\n * Finally, **the blacklist overrides the whitelist** and has the final say.\n *\n * @return {Array} the currently set blacklist array.\n *\n * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there\n * is no blacklist.)\n *\n * @description\n * Sets/Gets the blacklist of trusted resource URLs.\n */\n\n this.resourceUrlBlacklist = function(value) {\n if (arguments.length) {\n resourceUrlBlacklist = adjustMatchers(value);\n }\n return resourceUrlBlacklist;\n };\n\n this.$get = ['$injector', function($injector) {\n\n var htmlSanitizer = function htmlSanitizer(html) {\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n };\n\n if ($injector.has('$sanitize')) {\n htmlSanitizer = $injector.get('$sanitize');\n }\n\n\n function matchUrl(matcher, parsedUrl) {\n if (matcher === 'self') {\n return urlIsSameOrigin(parsedUrl);\n } else {\n // definitely a regex. See adjustMatchers()\n return !!matcher.exec(parsedUrl.href);\n }\n }\n\n function isResourceUrlAllowedByPolicy(url) {\n var parsedUrl = urlResolve(url.toString());\n var i, n, allowed = false;\n // Ensure that at least one item from the whitelist allows this url.\n for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {\n if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {\n allowed = true;\n break;\n }\n }\n if (allowed) {\n // Ensure that no item from the blacklist blocked this url.\n for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {\n if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {\n allowed = false;\n break;\n }\n }\n }\n return allowed;\n }\n\n function generateHolderType(Base) {\n var holderType = function TrustedValueHolderType(trustedValue) {\n this.$$unwrapTrustedValue = function() {\n return trustedValue;\n };\n };\n if (Base) {\n holderType.prototype = new Base();\n }\n holderType.prototype.valueOf = function sceValueOf() {\n return this.$$unwrapTrustedValue();\n };\n holderType.prototype.toString = function sceToString() {\n return this.$$unwrapTrustedValue().toString();\n };\n return holderType;\n }\n\n var trustedValueHolderBase = generateHolderType(),\n byType = {};\n\n byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);\n\n /**\n * @ngdoc method\n * @name $sceDelegate#trustAs\n *\n * @description\n * Returns an object that is trusted by angular for use in specified strict\n * contextual escaping contexts (such as ng-bind-html, ng-include, any src\n * attribute interpolation, any dom event binding attribute interpolation\n * such as for onclick, etc.) that uses the provided value.\n * See {@link ng.$sce $sce} for enabling strict contextual escaping.\n *\n * @param {string} type The kind of context in which this value is safe for use. e.g. url,\n * resourceUrl, html, js and css.\n * @param {*} value The value that that should be considered trusted/safe.\n * @returns {*} A value that can be used to stand in for the provided `value` in places\n * where Angular expects a $sce.trustAs() return value.\n */\n function trustAs(type, trustedValue) {\n var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n if (!Constructor) {\n throw $sceMinErr('icontext',\n 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',\n type, trustedValue);\n }\n if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {\n return trustedValue;\n }\n // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting\n // mutable objects, we ensure here that the value passed in is actually a string.\n if (typeof trustedValue !== 'string') {\n throw $sceMinErr('itype',\n 'Attempted to trust a non-string value in a content requiring a string: Context: {0}',\n type);\n }\n return new Constructor(trustedValue);\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#valueOf\n *\n * @description\n * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.\n *\n * If the passed parameter is not a value that had been returned by {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is.\n *\n * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}\n * call or anything else.\n * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns\n * `value` unchanged.\n */\n function valueOf(maybeTrusted) {\n if (maybeTrusted instanceof trustedValueHolderBase) {\n return maybeTrusted.$$unwrapTrustedValue();\n } else {\n return maybeTrusted;\n }\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#getTrusted\n *\n * @description\n * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and\n * returns the originally supplied value if the queried context type is a supertype of the\n * created type. If this condition isn't satisfied, throws an exception.\n *\n * <div class=\"alert alert-danger\">\n * Disabling auto-escaping is extremely dangerous, it usually creates a Cross Site Scripting\n * (XSS) vulnerability in your application.\n * </div>\n *\n * @param {string} type The kind of context in which this value is to be used.\n * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} call.\n * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} if valid in this context. Otherwise, throws an exception.\n */\n function getTrusted(type, maybeTrusted) {\n if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {\n return maybeTrusted;\n }\n var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n if (constructor && maybeTrusted instanceof constructor) {\n return maybeTrusted.$$unwrapTrustedValue();\n }\n // If we get here, then we may only take one of two actions.\n // 1. sanitize the value for the requested type, or\n // 2. throw an exception.\n if (type === SCE_CONTEXTS.RESOURCE_URL) {\n if (isResourceUrlAllowedByPolicy(maybeTrusted)) {\n return maybeTrusted;\n } else {\n throw $sceMinErr('insecurl',\n 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}',\n maybeTrusted.toString());\n }\n } else if (type === SCE_CONTEXTS.HTML) {\n return htmlSanitizer(maybeTrusted);\n }\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n }\n\n return { trustAs: trustAs,\n getTrusted: getTrusted,\n valueOf: valueOf };\n }];\n}\n\n\n/**\n * @ngdoc provider\n * @name $sceProvider\n * @description\n *\n * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.\n * - enable/disable Strict Contextual Escaping (SCE) in a module\n * - override the default implementation with a custom delegate\n *\n * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.\n */\n\n/* jshint maxlen: false*/\n\n/**\n * @ngdoc service\n * @name $sce\n * @kind function\n *\n * @description\n *\n * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.\n *\n * # Strict Contextual Escaping\n *\n * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain\n * contexts to result in a value that is marked as safe to use for that context. One example of\n * such a context is binding arbitrary html controlled by the user via `ng-bind-html`. We refer\n * to these contexts as privileged or SCE contexts.\n *\n * As of version 1.2, Angular ships with SCE enabled by default.\n *\n * Note: When enabled (the default), IE<11 in quirks mode is not supported. In this mode, IE<11 allow\n * one to execute arbitrary javascript by the use of the expression() syntax. Refer\n * <http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx> to learn more about them.\n * You can ensure your document is in standards mode and not quirks mode by adding `<!doctype html>`\n * to the top of your HTML document.\n *\n * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for\n * security vulnerabilities such as XSS, clickjacking, etc. a lot easier.\n *\n * Here's an example of a binding in a privileged context:\n *\n * ```\n * <input ng-model=\"userHtml\" aria-label=\"User input\">\n * <div ng-bind-html=\"userHtml\"></div>\n * ```\n *\n * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE\n * disabled, this application allows the user to render arbitrary HTML into the DIV.\n * In a more realistic example, one may be rendering user comments, blog articles, etc. via\n * bindings. (HTML is just one example of a context where rendering user controlled input creates\n * security vulnerabilities.)\n *\n * For the case of HTML, you might use a library, either on the client side, or on the server side,\n * to sanitize unsafe HTML before binding to the value and rendering it in the document.\n *\n * How would you ensure that every place that used these types of bindings was bound to a value that\n * was sanitized by your library (or returned as safe for rendering by your server?) How can you\n * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some\n * properties/fields and forgot to update the binding to the sanitized value?\n *\n * To be secure by default, you want to ensure that any such bindings are disallowed unless you can\n * determine that something explicitly says it's safe to use a value for binding in that\n * context. You can then audit your code (a simple grep would do) to ensure that this is only done\n * for those values that you can easily tell are safe - because they were received from your server,\n * sanitized by your library, etc. You can organize your codebase to help with this - perhaps\n * allowing only the files in a specific directory to do this. Ensuring that the internal API\n * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.\n *\n * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}\n * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to\n * obtain values that will be accepted by SCE / privileged contexts.\n *\n *\n * ## How does it work?\n *\n * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted\n * $sce.getTrusted(context, value)} rather than to the value directly. Directives use {@link\n * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the\n * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.\n *\n * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link\n * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly\n * simplified):\n *\n * ```\n * var ngBindHtmlDirective = ['$sce', function($sce) {\n * return function(scope, element, attr) {\n * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {\n * element.html(value || '');\n * });\n * };\n * }];\n * ```\n *\n * ## Impact on loading templates\n *\n * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as\n * `templateUrl`'s specified by {@link guide/directive directives}.\n *\n * By default, Angular only loads templates from the same domain and protocol as the application\n * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or\n * protocols, you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist\n * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.\n *\n * *Please note*:\n * The browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy apply in addition to this and may further restrict whether the template is successfully\n * loaded. This means that without the right CORS policy, loading templates from a different domain\n * won't work on all browsers. Also, loading templates from `file://` URL does not work on some\n * browsers.\n *\n * ## This feels like too much overhead\n *\n * It's important to remember that SCE only applies to interpolation expressions.\n *\n * If your expressions are constant literals, they're automatically trusted and you don't need to\n * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g.\n * `<div ng-bind-html=\"'<b>implicitly trusted</b>'\"></div>`) just works.\n *\n * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them\n * through {@link ng.$sce#getTrusted $sce.getTrusted}. SCE doesn't play a role here.\n *\n * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load\n * templates in `ng-include` from your application's domain without having to even know about SCE.\n * It blocks loading templates from other domains or loading templates over http from an https\n * served document. You can change these by setting your own custom {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.\n *\n * This significantly reduces the overhead. It is far easier to pay the small overhead and have an\n * application that's secure and can be audited to verify that with much more ease than bolting\n * security onto an application later.\n *\n * <a name=\"contexts\"></a>\n * ## What trusted context types are supported?\n *\n * | Context | Notes |\n * |---------------------|----------------|\n * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |\n * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |\n * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`<a href=` and `<img src=` sanitize their urls and don't constitute an SCE context. |\n * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.) <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |\n * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. |\n *\n * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name=\"resourceUrlPatternItem\"></a>\n *\n * Each element in these arrays must be one of the following:\n *\n * - **'self'**\n * - The special **string**, `'self'`, can be used to match against all URLs of the **same\n * domain** as the application document using the **same protocol**.\n * - **String** (except the special value `'self'`)\n * - The string is matched against the full *normalized / absolute URL* of the resource\n * being tested (substring matches are not good enough.)\n * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters\n * match themselves.\n * - `*`: matches zero or more occurrences of any character other than one of the following 6\n * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use\n * in a whitelist.\n * - `**`: matches zero or more occurrences of *any* character. As such, it's not\n * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g.\n * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might\n * not have been the intention.) Its usage at the very end of the path is ok. (e.g.\n * http://foo.example.com/templates/**).\n * - **RegExp** (*see caveat below*)\n * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax\n * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to\n * accidentally introduce a bug when one updates a complex expression (imho, all regexes should\n * have good test coverage). For instance, the use of `.` in the regex is correct only in a\n * small number of cases. A `.` character in the regex used when matching the scheme or a\n * subdomain could be matched against a `:` or literal `.` that was likely not intended. It\n * is highly recommended to use the string patterns and only fall back to regular expressions\n * as a last resort.\n * - The regular expression must be an instance of RegExp (i.e. not a string.) It is\n * matched against the **entire** *normalized / absolute URL* of the resource being tested\n * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags\n * present on the RegExp (such as multiline, global, ignoreCase) are ignored.\n * - If you are generating your JavaScript from some other templating engine (not\n * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),\n * remember to escape your regular expression (and be aware that you might need more than\n * one level of escaping depending on your templating engine and the way you interpolated\n * the value.) Do make use of your platform's escaping mechanism as it might be good\n * enough before coding your own. E.g. Ruby has\n * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)\n * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).\n * Javascript lacks a similar built in function for escaping. Take a look at Google\n * Closure library's [goog.string.regExpEscape(s)](\n * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.\n *\n * ## Show me an example using SCE.\n *\n * <example module=\"mySceApp\" deps=\"angular-sanitize.js\">\n * <file name=\"index.html\">\n * <div ng-controller=\"AppController as myCtrl\">\n * <i ng-bind-html=\"myCtrl.explicitlyTrustedHtml\" id=\"explicitlyTrustedHtml\"></i><br><br>\n * <b>User comments</b><br>\n * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when\n * $sanitize is available. If $sanitize isn't available, this results in an error instead of an\n * exploit.\n * <div class=\"well\">\n * <div ng-repeat=\"userComment in myCtrl.userComments\">\n * <b>{{userComment.name}}</b>:\n * <span ng-bind-html=\"userComment.htmlComment\" class=\"htmlComment\"></span>\n * <br>\n * </div>\n * </div>\n * </div>\n * </file>\n *\n * <file name=\"script.js\">\n * angular.module('mySceApp', ['ngSanitize'])\n * .controller('AppController', ['$http', '$templateCache', '$sce',\n * function($http, $templateCache, $sce) {\n * var self = this;\n * $http.get(\"test_data.json\", {cache: $templateCache}).success(function(userComments) {\n * self.userComments = userComments;\n * });\n * self.explicitlyTrustedHtml = $sce.trustAsHtml(\n * '<span onmouseover=\"this.textContent="Explicitly trusted HTML bypasses ' +\n * 'sanitization."\">Hover over this text.</span>');\n * }]);\n * </file>\n *\n * <file name=\"test_data.json\">\n * [\n * { \"name\": \"Alice\",\n * \"htmlComment\":\n * \"<span onmouseover='this.textContent=\\\"PWN3D!\\\"'>Is <i>anyone</i> reading this?</span>\"\n * },\n * { \"name\": \"Bob\",\n * \"htmlComment\": \"<i>Yes!</i> Am I the only other one?\"\n * }\n * ]\n * </file>\n *\n * <file name=\"protractor.js\" type=\"protractor\">\n * describe('SCE doc demo', function() {\n * it('should sanitize untrusted values', function() {\n * expect(element.all(by.css('.htmlComment')).first().getInnerHtml())\n * .toBe('<span>Is <i>anyone</i> reading this?</span>');\n * });\n *\n * it('should NOT sanitize explicitly trusted values', function() {\n * expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe(\n * '<span onmouseover=\"this.textContent="Explicitly trusted HTML bypasses ' +\n * 'sanitization."\">Hover over this text.</span>');\n * });\n * });\n * </file>\n * </example>\n *\n *\n *\n * ## Can I disable SCE completely?\n *\n * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits\n * for little coding overhead. It will be much harder to take an SCE disabled application and\n * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE\n * for cases where you have a lot of existing code that was written before SCE was introduced and\n * you're migrating them a module at a time.\n *\n * That said, here's how you can completely disable SCE:\n *\n * ```\n * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {\n * // Completely disable SCE. For demonstration purposes only!\n * // Do not use in new projects.\n * $sceProvider.enabled(false);\n * });\n * ```\n *\n */\n/* jshint maxlen: 100 */\n\nfunction $SceProvider() {\n var enabled = true;\n\n /**\n * @ngdoc method\n * @name $sceProvider#enabled\n * @kind function\n *\n * @param {boolean=} value If provided, then enables/disables SCE.\n * @return {boolean} true if SCE is enabled, false otherwise.\n *\n * @description\n * Enables/disables SCE and returns the current value.\n */\n this.enabled = function(value) {\n if (arguments.length) {\n enabled = !!value;\n }\n return enabled;\n };\n\n\n /* Design notes on the default implementation for SCE.\n *\n * The API contract for the SCE delegate\n * -------------------------------------\n * The SCE delegate object must provide the following 3 methods:\n *\n * - trustAs(contextEnum, value)\n * This method is used to tell the SCE service that the provided value is OK to use in the\n * contexts specified by contextEnum. It must return an object that will be accepted by\n * getTrusted() for a compatible contextEnum and return this value.\n *\n * - valueOf(value)\n * For values that were not produced by trustAs(), return them as is. For values that were\n * produced by trustAs(), return the corresponding input value to trustAs. Basically, if\n * trustAs is wrapping the given values into some type, this operation unwraps it when given\n * such a value.\n *\n * - getTrusted(contextEnum, value)\n * This function should return the a value that is safe to use in the context specified by\n * contextEnum or throw and exception otherwise.\n *\n * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be\n * opaque or wrapped in some holder object. That happens to be an implementation detail. For\n * instance, an implementation could maintain a registry of all trusted objects by context. In\n * such a case, trustAs() would return the same object that was passed in. getTrusted() would\n * return the same object passed in if it was found in the registry under a compatible context or\n * throw an exception otherwise. An implementation might only wrap values some of the time based\n * on some criteria. getTrusted() might return a value and not throw an exception for special\n * constants or objects even if not wrapped. All such implementations fulfill this contract.\n *\n *\n * A note on the inheritance model for SCE contexts\n * ------------------------------------------------\n * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This\n * is purely an implementation details.\n *\n * The contract is simply this:\n *\n * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)\n * will also succeed.\n *\n * Inheritance happens to capture this in a natural way. In some future, we\n * may not use inheritance anymore. That is OK because no code outside of\n * sce.js and sceSpecs.js would need to be aware of this detail.\n */\n\n this.$get = ['$parse', '$sceDelegate', function(\n $parse, $sceDelegate) {\n // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow\n // the \"expression(javascript expression)\" syntax which is insecure.\n if (enabled && msie < 8) {\n throw $sceMinErr('iequirks',\n 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +\n 'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +\n 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');\n }\n\n var sce = shallowCopy(SCE_CONTEXTS);\n\n /**\n * @ngdoc method\n * @name $sce#isEnabled\n * @kind function\n *\n * @return {Boolean} true if SCE is enabled, false otherwise. If you want to set the value, you\n * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.\n *\n * @description\n * Returns a boolean indicating if SCE is enabled.\n */\n sce.isEnabled = function() {\n return enabled;\n };\n sce.trustAs = $sceDelegate.trustAs;\n sce.getTrusted = $sceDelegate.getTrusted;\n sce.valueOf = $sceDelegate.valueOf;\n\n if (!enabled) {\n sce.trustAs = sce.getTrusted = function(type, value) { return value; };\n sce.valueOf = identity;\n }\n\n /**\n * @ngdoc method\n * @name $sce#parseAs\n *\n * @description\n * Converts Angular {@link guide/expression expression} into a function. This is like {@link\n * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it\n * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,\n * *result*)}\n *\n * @param {string} type The kind of SCE context in which this result will be used.\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n sce.parseAs = function sceParseAs(type, expr) {\n var parsed = $parse(expr);\n if (parsed.literal && parsed.constant) {\n return parsed;\n } else {\n return $parse(expr, function(value) {\n return sce.getTrusted(type, value);\n });\n }\n };\n\n /**\n * @ngdoc method\n * @name $sce#trustAs\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such,\n * returns an object that is trusted by angular for use in specified strict contextual\n * escaping contexts (such as ng-bind-html, ng-include, any src attribute\n * interpolation, any dom event binding attribute interpolation such as for onclick, etc.)\n * that uses the provided value. See * {@link ng.$sce $sce} for enabling strict contextual\n * escaping.\n *\n * @param {string} type The kind of context in which this value is safe for use. e.g. url,\n * resourceUrl, html, js and css.\n * @param {*} value The value that that should be considered trusted/safe.\n * @returns {*} A value that can be used to stand in for the provided `value` in places\n * where Angular expects a $sce.trustAs() return value.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsHtml\n *\n * @description\n * Shorthand method. `$sce.trustAsHtml(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}\n *\n * @param {*} value The value to trustAs.\n * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml\n * $sce.getTrustedHtml(value)} to obtain the original value. (privileged directives\n * only accept expressions that are either literal constants or are the\n * return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}\n *\n * @param {*} value The value to trustAs.\n * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl\n * $sce.getTrustedUrl(value)} to obtain the original value. (privileged directives\n * only accept expressions that are either literal constants or are the\n * return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsResourceUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to trustAs.\n * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl(value)} to obtain the original value. (privileged directives\n * only accept expressions that are either literal constants or are the return\n * value of {@link ng.$sce#trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsJs\n *\n * @description\n * Shorthand method. `$sce.trustAsJs(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}\n *\n * @param {*} value The value to trustAs.\n * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs\n * $sce.getTrustedJs(value)} to obtain the original value. (privileged directives\n * only accept expressions that are either literal constants or are the\n * return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrusted\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such,\n * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the\n * originally supplied value if the queried context type is a supertype of the created type.\n * If this condition isn't satisfied, throws an exception.\n *\n * @param {string} type The kind of context in which this value is to be used.\n * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`}\n * call.\n * @returns {*} The value the was originally provided to\n * {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context.\n * Otherwise, throws an exception.\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedHtml\n *\n * @description\n * Shorthand method. `$sce.getTrustedHtml(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedCss\n *\n * @description\n * Shorthand method. `$sce.getTrustedCss(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedResourceUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedResourceUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to pass to `$sceDelegate.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedJs\n *\n * @description\n * Shorthand method. `$sce.getTrustedJs(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsHtml\n *\n * @description\n * Shorthand method. `$sce.parseAsHtml(expression string)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsCss\n *\n * @description\n * Shorthand method. `$sce.parseAsCss(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsResourceUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsJs\n *\n * @description\n * Shorthand method. `$sce.parseAsJs(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n // Shorthand delegations.\n var parse = sce.parseAs,\n getTrusted = sce.getTrusted,\n trustAs = sce.trustAs;\n\n forEach(SCE_CONTEXTS, function(enumValue, name) {\n var lName = lowercase(name);\n sce[camelCase(\"parse_as_\" + lName)] = function(expr) {\n return parse(enumValue, expr);\n };\n sce[camelCase(\"get_trusted_\" + lName)] = function(value) {\n return getTrusted(enumValue, value);\n };\n sce[camelCase(\"trust_as_\" + lName)] = function(value) {\n return trustAs(enumValue, value);\n };\n });\n\n return sce;\n }];\n}\n\n/**\n * !!! This is an undocumented \"private\" service !!!\n *\n * @name $sniffer\n * @requires $window\n * @requires $document\n *\n * @property {boolean} history Does the browser support html5 history api ?\n * @property {boolean} transitions Does the browser support CSS transition events ?\n * @property {boolean} animations Does the browser support CSS animation events ?\n *\n * @description\n * This is very simple implementation of testing browser's features.\n */\nfunction $SnifferProvider() {\n this.$get = ['$window', '$document', function($window, $document) {\n var eventSupport = {},\n android =\n toInt((/android (\\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),\n boxee = /Boxee/i.test(($window.navigator || {}).userAgent),\n document = $document[0] || {},\n vendorPrefix,\n vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/,\n bodyStyle = document.body && document.body.style,\n transitions = false,\n animations = false,\n match;\n\n if (bodyStyle) {\n for (var prop in bodyStyle) {\n if (match = vendorRegex.exec(prop)) {\n vendorPrefix = match[0];\n vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1);\n break;\n }\n }\n\n if (!vendorPrefix) {\n vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';\n }\n\n transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));\n animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));\n\n if (android && (!transitions || !animations)) {\n transitions = isString(bodyStyle.webkitTransition);\n animations = isString(bodyStyle.webkitAnimation);\n }\n }\n\n\n return {\n // Android has history.pushState, but it does not update location correctly\n // so let's not use the history API at all.\n // http://code.google.com/p/android/issues/detail?id=17471\n // https://github.com/angular/angular.js/issues/904\n\n // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has\n // so let's not use the history API also\n // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined\n // jshint -W018\n history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee),\n // jshint +W018\n hasEvent: function(event) {\n // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have\n // it. In particular the event is not fired when backspace or delete key are pressed or\n // when cut operation is performed.\n // IE10+ implements 'input' event but it erroneously fires under various situations,\n // e.g. when placeholder changes, or a form is focused.\n if (event === 'input' && msie <= 11) return false;\n\n if (isUndefined(eventSupport[event])) {\n var divElm = document.createElement('div');\n eventSupport[event] = 'on' + event in divElm;\n }\n\n return eventSupport[event];\n },\n csp: csp(),\n vendorPrefix: vendorPrefix,\n transitions: transitions,\n animations: animations,\n android: android\n };\n }];\n}\n\nvar $compileMinErr = minErr('$compile');\n\n/**\n * @ngdoc provider\n * @name $templateRequestProvider\n * @description\n * Used to configure the options passed to the {@link $http} service when making a template request.\n *\n * For example, it can be used for specifying the \"Accept\" header that is sent to the server, when\n * requesting a template.\n */\nfunction $TemplateRequestProvider() {\n\n var httpOptions;\n\n /**\n * @ngdoc method\n * @name $templateRequestProvider#httpOptions\n * @description\n * The options to be passed to the {@link $http} service when making the request.\n * You can use this to override options such as the \"Accept\" header for template requests.\n *\n * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the\n * options if not overridden here.\n *\n * @param {string=} value new value for the {@link $http} options.\n * @returns {string|self} Returns the {@link $http} options when used as getter and self if used as setter.\n */\n this.httpOptions = function(val) {\n if (val) {\n httpOptions = val;\n return this;\n }\n return httpOptions;\n };\n\n /**\n * @ngdoc service\n * @name $templateRequest\n *\n * @description\n * The `$templateRequest` service runs security checks then downloads the provided template using\n * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request\n * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the\n * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the\n * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted\n * when `tpl` is of type string and `$templateCache` has the matching entry.\n *\n * If you want to pass custom options to the `$http` service, such as setting the Accept header you\n * can configure this via {@link $templateRequestProvider#httpOptions}.\n *\n * @param {string|TrustedResourceUrl} tpl The HTTP request template URL\n * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty\n *\n * @return {Promise} a promise for the HTTP response data of the given URL.\n *\n * @property {number} totalPendingRequests total amount of pending template requests being downloaded.\n */\n this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce) {\n\n function handleRequestFn(tpl, ignoreRequestError) {\n handleRequestFn.totalPendingRequests++;\n\n // We consider the template cache holds only trusted templates, so\n // there's no need to go through whitelisting again for keys that already\n // are included in there. This also makes Angular accept any script\n // directive, no matter its name. However, we still need to unwrap trusted\n // types.\n if (!isString(tpl) || !$templateCache.get(tpl)) {\n tpl = $sce.getTrustedResourceUrl(tpl);\n }\n\n var transformResponse = $http.defaults && $http.defaults.transformResponse;\n\n if (isArray(transformResponse)) {\n transformResponse = transformResponse.filter(function(transformer) {\n return transformer !== defaultHttpResponseTransform;\n });\n } else if (transformResponse === defaultHttpResponseTransform) {\n transformResponse = null;\n }\n\n return $http.get(tpl, extend({\n cache: $templateCache,\n transformResponse: transformResponse\n }, httpOptions))\n ['finally'](function() {\n handleRequestFn.totalPendingRequests--;\n })\n .then(function(response) {\n $templateCache.put(tpl, response.data);\n return response.data;\n }, handleError);\n\n function handleError(resp) {\n if (!ignoreRequestError) {\n throw $compileMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})',\n tpl, resp.status, resp.statusText);\n }\n return $q.reject(resp);\n }\n }\n\n handleRequestFn.totalPendingRequests = 0;\n\n return handleRequestFn;\n }];\n}\n\nfunction $$TestabilityProvider() {\n this.$get = ['$rootScope', '$browser', '$location',\n function($rootScope, $browser, $location) {\n\n /**\n * @name $testability\n *\n * @description\n * The private $$testability service provides a collection of methods for use when debugging\n * or by automated test and debugging tools.\n */\n var testability = {};\n\n /**\n * @name $$testability#findBindings\n *\n * @description\n * Returns an array of elements that are bound (via ng-bind or {{}})\n * to expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The binding expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression. Filters and whitespace are ignored.\n */\n testability.findBindings = function(element, expression, opt_exactMatch) {\n var bindings = element.getElementsByClassName('ng-binding');\n var matches = [];\n forEach(bindings, function(binding) {\n var dataBinding = angular.element(binding).data('$binding');\n if (dataBinding) {\n forEach(dataBinding, function(bindingName) {\n if (opt_exactMatch) {\n var matcher = new RegExp('(^|\\\\s)' + escapeForRegexp(expression) + '(\\\\s|\\\\||$)');\n if (matcher.test(bindingName)) {\n matches.push(binding);\n }\n } else {\n if (bindingName.indexOf(expression) != -1) {\n matches.push(binding);\n }\n }\n });\n }\n });\n return matches;\n };\n\n /**\n * @name $$testability#findModels\n *\n * @description\n * Returns an array of elements that are two-way found via ng-model to\n * expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The model expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression.\n */\n testability.findModels = function(element, expression, opt_exactMatch) {\n var prefixes = ['ng-', 'data-ng-', 'ng\\\\:'];\n for (var p = 0; p < prefixes.length; ++p) {\n var attributeEquals = opt_exactMatch ? '=' : '*=';\n var selector = '[' + prefixes[p] + 'model' + attributeEquals + '\"' + expression + '\"]';\n var elements = element.querySelectorAll(selector);\n if (elements.length) {\n return elements;\n }\n }\n };\n\n /**\n * @name $$testability#getLocation\n *\n * @description\n * Shortcut for getting the location in a browser agnostic way. Returns\n * the path, search, and hash. (e.g. /path?a=b#hash)\n */\n testability.getLocation = function() {\n return $location.url();\n };\n\n /**\n * @name $$testability#setLocation\n *\n * @description\n * Shortcut for navigating to a location without doing a full page reload.\n *\n * @param {string} url The location url (path, search and hash,\n * e.g. /path?a=b#hash) to go to.\n */\n testability.setLocation = function(url) {\n if (url !== $location.url()) {\n $location.url(url);\n $rootScope.$digest();\n }\n };\n\n /**\n * @name $$testability#whenStable\n *\n * @description\n * Calls the callback when $timeout and $http requests are completed.\n *\n * @param {function} callback\n */\n testability.whenStable = function(callback) {\n $browser.notifyWhenNoOutstandingRequests(callback);\n };\n\n return testability;\n }];\n}\n\nfunction $TimeoutProvider() {\n this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',\n function($rootScope, $browser, $q, $$q, $exceptionHandler) {\n\n var deferreds = {};\n\n\n /**\n * @ngdoc service\n * @name $timeout\n *\n * @description\n * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch\n * block and delegates any exceptions to\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * The return value of calling `$timeout` is a promise, which will be resolved when\n * the delay has passed and the timeout function, if provided, is executed.\n *\n * To cancel a timeout request, call `$timeout.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to\n * synchronously flush the queue of deferred functions.\n *\n * If you only want a promise that will be resolved after some specified delay\n * then you can call `$timeout` without the `fn` function.\n *\n * @param {function()=} fn A function, whose execution should be delayed.\n * @param {number=} [delay=0] Delay in milliseconds.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {Promise} Promise that will be resolved when the timeout is reached. The promise\n * will be resolved with the return value of the `fn` function.\n *\n */\n function timeout(fn, delay, invokeApply) {\n if (!isFunction(fn)) {\n invokeApply = delay;\n delay = fn;\n fn = noop;\n }\n\n var args = sliceArgs(arguments, 3),\n skipApply = (isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise,\n timeoutId;\n\n timeoutId = $browser.defer(function() {\n try {\n deferred.resolve(fn.apply(null, args));\n } catch (e) {\n deferred.reject(e);\n $exceptionHandler(e);\n }\n finally {\n delete deferreds[promise.$$timeoutId];\n }\n\n if (!skipApply) $rootScope.$apply();\n }, delay);\n\n promise.$$timeoutId = timeoutId;\n deferreds[timeoutId] = deferred;\n\n return promise;\n }\n\n\n /**\n * @ngdoc method\n * @name $timeout#cancel\n *\n * @description\n * Cancels a task associated with the `promise`. As a result of this, the promise will be\n * resolved with a rejection.\n *\n * @param {Promise=} promise Promise returned by the `$timeout` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n timeout.cancel = function(promise) {\n if (promise && promise.$$timeoutId in deferreds) {\n deferreds[promise.$$timeoutId].reject('canceled');\n delete deferreds[promise.$$timeoutId];\n return $browser.defer.cancel(promise.$$timeoutId);\n }\n return false;\n };\n\n return timeout;\n }];\n}\n\n// NOTE: The usage of window and document instead of $window and $document here is\n// deliberate. This service depends on the specific behavior of anchor nodes created by the\n// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and\n// cause us to break tests. In addition, when the browser resolves a URL for XHR, it\n// doesn't know about mocked locations and resolves URLs to the real document - which is\n// exactly the behavior needed here. There is little value is mocking these out for this\n// service.\nvar urlParsingNode = document.createElement(\"a\");\nvar originUrl = urlResolve(window.location.href);\n\n\n/**\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|----------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol including the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol\n * | hostname | The hostname\n * | port | The port, without \":\"\n * | pathname | The pathname, beginning with \"/\"\n *\n */\nfunction urlResolve(url) {\n var href = url;\n\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute(\"href\", href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/')\n ? urlParsingNode.pathname\n : '/' + urlParsingNode.pathname\n };\n}\n\n/**\n * Parse a request URL and determine whether this is a same-origin request as the application document.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the request is for the same origin as the application document.\n */\nfunction urlIsSameOrigin(requestUrl) {\n var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;\n return (parsed.protocol === originUrl.protocol &&\n parsed.host === originUrl.host);\n}\n\n/**\n * @ngdoc service\n * @name $window\n *\n * @description\n * A reference to the browser's `window` object. While `window`\n * is globally available in JavaScript, it causes testability problems, because\n * it is a global variable. In angular we always refer to it through the\n * `$window` service, so it may be overridden, removed or mocked for testing.\n *\n * Expressions, like the one defined for the `ngClick` directive in the example\n * below, are evaluated with respect to the current scope. Therefore, there is\n * no risk of inadvertently coding in a dependency on a global value in such an\n * expression.\n *\n * @example\n <example module=\"windowExample\">\n <file name=\"index.html\">\n <script>\n angular.module('windowExample', [])\n .controller('ExampleController', ['$scope', '$window', function($scope, $window) {\n $scope.greeting = 'Hello, World!';\n $scope.doGreeting = function(greeting) {\n $window.alert(greeting);\n };\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <input type=\"text\" ng-model=\"greeting\" aria-label=\"greeting\" />\n <button ng-click=\"doGreeting(greeting)\">ALERT</button>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should display the greeting in the input box', function() {\n element(by.model('greeting')).sendKeys('Hello, E2E Tests');\n // If we click the button it will block the test runner\n // element(':button').click();\n });\n </file>\n </example>\n */\nfunction $WindowProvider() {\n this.$get = valueFn(window);\n}\n\n/**\n * @name $$cookieReader\n * @requires $document\n *\n * @description\n * This is a private service for reading cookies used by $http and ngCookies\n *\n * @return {Object} a key/value map of the current cookies\n */\nfunction $$CookieReader($document) {\n var rawDocument = $document[0] || {};\n var lastCookies = {};\n var lastCookieString = '';\n\n function safeDecodeURIComponent(str) {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n }\n\n return function() {\n var cookieArray, cookie, i, index, name;\n var currentCookieString = rawDocument.cookie || '';\n\n if (currentCookieString !== lastCookieString) {\n lastCookieString = currentCookieString;\n cookieArray = lastCookieString.split('; ');\n lastCookies = {};\n\n for (i = 0; i < cookieArray.length; i++) {\n cookie = cookieArray[i];\n index = cookie.indexOf('=');\n if (index > 0) { //ignore nameless cookies\n name = safeDecodeURIComponent(cookie.substring(0, index));\n // the first value that is seen for a cookie is the most\n // specific one. values for the same cookie name that\n // follow are for less specific paths.\n if (isUndefined(lastCookies[name])) {\n lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));\n }\n }\n }\n }\n return lastCookies;\n };\n}\n\n$$CookieReader.$inject = ['$document'];\n\nfunction $$CookieReaderProvider() {\n this.$get = $$CookieReader;\n}\n\n/* global currencyFilter: true,\n dateFilter: true,\n filterFilter: true,\n jsonFilter: true,\n limitToFilter: true,\n lowercaseFilter: true,\n numberFilter: true,\n orderByFilter: true,\n uppercaseFilter: true,\n */\n\n/**\n * @ngdoc provider\n * @name $filterProvider\n * @description\n *\n * Filters are just functions which transform input to an output. However filters need to be\n * Dependency Injected. To achieve this a filter definition consists of a factory function which is\n * annotated with dependencies and is responsible for creating a filter function.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n * </div>\n *\n * ```js\n * // Filter registration\n * function MyModule($provide, $filterProvider) {\n * // create a service to demonstrate injection (not always needed)\n * $provide.value('greet', function(name){\n * return 'Hello ' + name + '!';\n * });\n *\n * // register a filter factory which uses the\n * // greet service to demonstrate DI.\n * $filterProvider.register('greet', function(greet){\n * // return the filter function which uses the greet service\n * // to generate salutation\n * return function(text) {\n * // filters need to be forgiving so check input validity\n * return text && greet(text) || text;\n * };\n * });\n * }\n * ```\n *\n * The filter function is registered with the `$injector` under the filter name suffix with\n * `Filter`.\n *\n * ```js\n * it('should be the same instance', inject(\n * function($filterProvider) {\n * $filterProvider.register('reverse', function(){\n * return ...;\n * });\n * },\n * function($filter, reverseFilter) {\n * expect($filter('reverse')).toBe(reverseFilter);\n * });\n * ```\n *\n *\n * For more information about how angular filters work, and how to create your own filters, see\n * {@link guide/filter Filters} in the Angular Developer Guide.\n */\n\n/**\n * @ngdoc service\n * @name $filter\n * @kind function\n * @description\n * Filters are used for formatting data displayed to the user.\n *\n * The general syntax in templates is as follows:\n *\n * {{ expression [| filter_name[:parameter_value] ... ] }}\n *\n * @param {String} name Name of the filter function to retrieve\n * @return {Function} the filter function\n * @example\n <example name=\"$filter\" module=\"filterExample\">\n <file name=\"index.html\">\n <div ng-controller=\"MainCtrl\">\n <h3>{{ originalText }}</h3>\n <h3>{{ filteredText }}</h3>\n </div>\n </file>\n\n <file name=\"script.js\">\n angular.module('filterExample', [])\n .controller('MainCtrl', function($scope, $filter) {\n $scope.originalText = 'hello';\n $scope.filteredText = $filter('uppercase')($scope.originalText);\n });\n </file>\n </example>\n */\n$FilterProvider.$inject = ['$provide'];\nfunction $FilterProvider($provide) {\n var suffix = 'Filter';\n\n /**\n * @ngdoc method\n * @name $filterProvider#register\n * @param {string|Object} name Name of the filter function, or an object map of filters where\n * the keys are the filter names and the values are the filter factories.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n * </div>\n * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered.\n * @returns {Object} Registered filter instance, or if a map of filters was provided then a map\n * of the registered filter instances.\n */\n function register(name, factory) {\n if (isObject(name)) {\n var filters = {};\n forEach(name, function(filter, key) {\n filters[key] = register(key, filter);\n });\n return filters;\n } else {\n return $provide.factory(name + suffix, factory);\n }\n }\n this.register = register;\n\n this.$get = ['$injector', function($injector) {\n return function(name) {\n return $injector.get(name + suffix);\n };\n }];\n\n ////////////////////////////////////////\n\n /* global\n currencyFilter: false,\n dateFilter: false,\n filterFilter: false,\n jsonFilter: false,\n limitToFilter: false,\n lowercaseFilter: false,\n numberFilter: false,\n orderByFilter: false,\n uppercaseFilter: false,\n */\n\n register('currency', currencyFilter);\n register('date', dateFilter);\n register('filter', filterFilter);\n register('json', jsonFilter);\n register('limitTo', limitToFilter);\n register('lowercase', lowercaseFilter);\n register('number', numberFilter);\n register('orderBy', orderByFilter);\n register('uppercase', uppercaseFilter);\n}\n\n/**\n * @ngdoc filter\n * @name filter\n * @kind function\n *\n * @description\n * Selects a subset of items from `array` and returns it as a new array.\n *\n * @param {Array} array The source array.\n * @param {string|Object|function()} expression The predicate to be used for selecting items from\n * `array`.\n *\n * Can be one of:\n *\n * - `string`: The string is used for matching against the contents of the `array`. All strings or\n * objects with string properties in `array` that match this string will be returned. This also\n * applies to nested object properties.\n * The predicate can be negated by prefixing the string with `!`.\n *\n * - `Object`: A pattern object can be used to filter specific properties on objects contained\n * by `array`. For example `{name:\"M\", phone:\"1\"}` predicate will return an array of items\n * which have property `name` containing \"M\" and property `phone` containing \"1\". A special\n * property name `$` can be used (as in `{$:\"text\"}`) to accept a match against any\n * property of the object or its nested object properties. That's equivalent to the simple\n * substring match with a `string` as described above. The predicate can be negated by prefixing\n * the string with `!`.\n * For example `{name: \"!M\"}` predicate will return an array of items which have property `name`\n * not containing \"M\".\n *\n * Note that a named property will match properties on the same level only, while the special\n * `$` property will match properties on the same level or deeper. E.g. an array item like\n * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but\n * **will** be matched by `{$: 'John'}`.\n *\n * - `function(value, index, array)`: A predicate function can be used to write arbitrary filters.\n * The function is called for each element of the array, with the element, its index, and\n * the entire array itself as arguments.\n *\n * The final result is an array of those elements that the predicate returned true for.\n *\n * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in\n * determining if the expected value (from the filter expression) and actual value (from\n * the object in the array) should be considered a match.\n *\n * Can be one of:\n *\n * - `function(actual, expected)`:\n * The function will be given the object value and the predicate value to compare and\n * should return true if both values should be considered equal.\n *\n * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.\n * This is essentially strict comparison of expected and actual.\n *\n * - `false|undefined`: A short hand for a function which will look for a substring match in case\n * insensitive way.\n *\n * Primitive values are converted to strings. Objects are not compared against primitives,\n * unless they have a custom `toString` method (e.g. `Date` objects).\n *\n * @example\n <example>\n <file name=\"index.html\">\n <div ng-init=\"friends = [{name:'John', phone:'555-1276'},\n {name:'Mary', phone:'800-BIG-MARY'},\n {name:'Mike', phone:'555-4321'},\n {name:'Adam', phone:'555-5678'},\n {name:'Julie', phone:'555-8765'},\n {name:'Juliette', phone:'555-5678'}]\"></div>\n\n <label>Search: <input ng-model=\"searchText\"></label>\n <table id=\"searchTextResults\">\n <tr><th>Name</th><th>Phone</th></tr>\n <tr ng-repeat=\"friend in friends | filter:searchText\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n </tr>\n </table>\n <hr>\n <label>Any: <input ng-model=\"search.$\"></label> <br>\n <label>Name only <input ng-model=\"search.name\"></label><br>\n <label>Phone only <input ng-model=\"search.phone\"></label><br>\n <label>Equality <input type=\"checkbox\" ng-model=\"strict\"></label><br>\n <table id=\"searchObjResults\">\n <tr><th>Name</th><th>Phone</th></tr>\n <tr ng-repeat=\"friendObj in friends | filter:search:strict\">\n <td>{{friendObj.name}}</td>\n <td>{{friendObj.phone}}</td>\n </tr>\n </table>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var expectFriendNames = function(expectedNames, key) {\n element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {\n arr.forEach(function(wd, i) {\n expect(wd.getText()).toMatch(expectedNames[i]);\n });\n });\n };\n\n it('should search across all fields when filtering with a string', function() {\n var searchText = element(by.model('searchText'));\n searchText.clear();\n searchText.sendKeys('m');\n expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');\n\n searchText.clear();\n searchText.sendKeys('76');\n expectFriendNames(['John', 'Julie'], 'friend');\n });\n\n it('should search in specific fields when filtering with a predicate object', function() {\n var searchAny = element(by.model('search.$'));\n searchAny.clear();\n searchAny.sendKeys('i');\n expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');\n });\n it('should use a equal comparison when comparator is true', function() {\n var searchName = element(by.model('search.name'));\n var strict = element(by.model('strict'));\n searchName.clear();\n searchName.sendKeys('Julie');\n strict.click();\n expectFriendNames(['Julie'], 'friendObj');\n });\n </file>\n </example>\n */\nfunction filterFilter() {\n return function(array, expression, comparator) {\n if (!isArrayLike(array)) {\n if (array == null) {\n return array;\n } else {\n throw minErr('filter')('notarray', 'Expected array but received: {0}', array);\n }\n }\n\n var expressionType = getTypeForFilter(expression);\n var predicateFn;\n var matchAgainstAnyProp;\n\n switch (expressionType) {\n case 'function':\n predicateFn = expression;\n break;\n case 'boolean':\n case 'null':\n case 'number':\n case 'string':\n matchAgainstAnyProp = true;\n //jshint -W086\n case 'object':\n //jshint +W086\n predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp);\n break;\n default:\n return array;\n }\n\n return Array.prototype.filter.call(array, predicateFn);\n };\n}\n\n// Helper functions for `filterFilter`\nfunction createPredicateFn(expression, comparator, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && ('$' in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression.$, comparator, false);\n }\n return deepCompare(item, expression, comparator, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}\n\nfunction deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) {\n var actualType = getTypeForFilter(actual);\n var expectedType = getTypeForFilter(expected);\n\n if ((expectedType === 'string') && (expected.charAt(0) === '!')) {\n return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp);\n } else if (isArray(actual)) {\n // In case `actual` is an array, consider it a match\n // if ANY of it's items matches `expected`\n return actual.some(function(item) {\n return deepCompare(item, expected, comparator, matchAgainstAnyProp);\n });\n }\n\n switch (actualType) {\n case 'object':\n var key;\n if (matchAgainstAnyProp) {\n for (key in actual) {\n if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) {\n return true;\n }\n }\n return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false);\n } else if (expectedType === 'object') {\n for (key in expected) {\n var expectedVal = expected[key];\n if (isFunction(expectedVal) || isUndefined(expectedVal)) {\n continue;\n }\n\n var matchAnyProperty = key === '$';\n var actualVal = matchAnyProperty ? actual : actual[key];\n if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) {\n return false;\n }\n }\n return true;\n } else {\n return comparator(actual, expected);\n }\n break;\n case 'function':\n return false;\n default:\n return comparator(actual, expected);\n }\n}\n\n// Used for easily differentiating between `null` and actual `object`\nfunction getTypeForFilter(val) {\n return (val === null) ? 'null' : typeof val;\n}\n\nvar MAX_DIGITS = 22;\nvar DECIMAL_SEP = '.';\nvar ZERO_CHAR = '0';\n\n/**\n * @ngdoc filter\n * @name currency\n * @kind function\n *\n * @description\n * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default\n * symbol for current locale is used.\n *\n * @param {number} amount Input to filter.\n * @param {string=} symbol Currency symbol or identifier to be displayed.\n * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale\n * @returns {string} Formatted number.\n *\n *\n * @example\n <example module=\"currencyExample\">\n <file name=\"index.html\">\n <script>\n angular.module('currencyExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.amount = 1234.56;\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <input type=\"number\" ng-model=\"amount\" aria-label=\"amount\"> <br>\n default currency symbol ($): <span id=\"currency-default\">{{amount | currency}}</span><br>\n custom currency identifier (USD$): <span id=\"currency-custom\">{{amount | currency:\"USD$\"}}</span>\n no fractions (0): <span id=\"currency-no-fractions\">{{amount | currency:\"USD$\":0}}</span>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should init with 1234.56', function() {\n expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');\n expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');\n });\n it('should update', function() {\n if (browser.params.browser == 'safari') {\n // Safari does not understand the minus key. See\n // https://github.com/angular/protractor/issues/481\n return;\n }\n element(by.model('amount')).clear();\n element(by.model('amount')).sendKeys('-1234');\n expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00');\n expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234');\n });\n </file>\n </example>\n */\ncurrencyFilter.$inject = ['$locale'];\nfunction currencyFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(amount, currencySymbol, fractionSize) {\n if (isUndefined(currencySymbol)) {\n currencySymbol = formats.CURRENCY_SYM;\n }\n\n if (isUndefined(fractionSize)) {\n fractionSize = formats.PATTERNS[1].maxFrac;\n }\n\n // if null or undefined pass it through\n return (amount == null)\n ? amount\n : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).\n replace(/\\u00A4/g, currencySymbol);\n };\n}\n\n/**\n * @ngdoc filter\n * @name number\n * @kind function\n *\n * @description\n * Formats a number as text.\n *\n * If the input is null or undefined, it will just be returned.\n * If the input is infinite (Infinity/-Infinity) the Infinity symbol '∞' is returned.\n * If the input is not a number an empty string is returned.\n *\n *\n * @param {number|string} number Number to format.\n * @param {(number|string)=} fractionSize Number of decimal places to round the number to.\n * If this is not provided then the fraction size is computed from the current locale's number\n * formatting pattern. In the case of the default locale, it will be 3.\n * @returns {string} Number rounded to fractionSize and places a “,” after each third digit.\n *\n * @example\n <example module=\"numberFilterExample\">\n <file name=\"index.html\">\n <script>\n angular.module('numberFilterExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.val = 1234.56789;\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>Enter number: <input ng-model='val'></label><br>\n Default formatting: <span id='number-default'>{{val | number}}</span><br>\n No fractions: <span>{{val | number:0}}</span><br>\n Negative number: <span>{{-val | number:4}}</span>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should format numbers', function() {\n expect(element(by.id('number-default')).getText()).toBe('1,234.568');\n expect(element(by.binding('val | number:0')).getText()).toBe('1,235');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');\n });\n\n it('should update', function() {\n element(by.model('val')).clear();\n element(by.model('val')).sendKeys('3374.333');\n expect(element(by.id('number-default')).getText()).toBe('3,374.333');\n expect(element(by.binding('val | number:0')).getText()).toBe('3,374');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');\n });\n </file>\n </example>\n */\nnumberFilter.$inject = ['$locale'];\nfunction numberFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(number, fractionSize) {\n\n // if null or undefined pass it through\n return (number == null)\n ? number\n : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,\n fractionSize);\n };\n}\n\n/**\n * Parse a number (as a string) into three components that can be used\n * for formatting the number.\n *\n * (Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/)\n *\n * @param {string} numStr The number to parse\n * @return {object} An object describing this number, containing the following keys:\n * - d : an array of digits containing leading zeros as necessary\n * - i : the number of the digits in `d` that are to the left of the decimal point\n * - e : the exponent for numbers that would need more than `MAX_DIGITS` digits in `d`\n *\n */\nfunction parse(numStr) {\n var exponent = 0, digits, numberOfIntegerDigits;\n var i, j, zeros;\n\n // Decimal point?\n if ((numberOfIntegerDigits = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (numberOfIntegerDigits < 0) numberOfIntegerDigits = i;\n numberOfIntegerDigits += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (numberOfIntegerDigits < 0) {\n // There was no decimal point or exponent so it is an integer.\n numberOfIntegerDigits = numStr.length;\n }\n\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) == ZERO_CHAR; i++);\n\n if (i == (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n numberOfIntegerDigits = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) == ZERO_CHAR) zeros--;\n\n // Trailing zeros are insignificant so ignore them\n numberOfIntegerDigits -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = +numStr.charAt(i);\n }\n }\n\n // If the number overflows the maximum allowed digits then use an exponent.\n if (numberOfIntegerDigits > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = numberOfIntegerDigits - 1;\n numberOfIntegerDigits = 1;\n }\n\n return { d: digits, e: exponent, i: numberOfIntegerDigits };\n}\n\n/**\n * Round the parsed number to the specified number of decimal places\n * This function changed the parsedNumber in-place\n */\nfunction roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n var digits = parsedNumber.d;\n var fractionLen = digits.length - parsedNumber.i;\n\n // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n // The index of the digit to where rounding is to occur\n var roundAt = fractionSize + parsedNumber.i;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n digits.splice(roundAt);\n } else {\n // We rounded to zero so reset the parsedNumber\n parsedNumber.i = 1;\n digits.length = roundAt = fractionSize + 1;\n for (var i=0; i < roundAt; i++) digits[i] = 0;\n }\n\n if (digit >= 5) digits[roundAt - 1]++;\n\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < fractionSize; fractionLen++) digits.push(0);\n\n\n // Do any carrying, e.g. a digit was rounded up to 10\n var carry = digits.reduceRight(function(carry, d, i, digits) {\n d = d + carry;\n digits[i] = d % 10;\n return Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.i++;\n }\n}\n\n/**\n * Format a number into a string\n * @param {number} number The number to format\n * @param {{\n * minFrac, // the minimum number of digits required in the fraction part of the number\n * maxFrac, // the maximum number of digits required in the fraction part of the number\n * gSize, // number of digits in each group of separated digits\n * lgSize, // number of digits in the last group of digits before the decimal separator\n * negPre, // the string to go in front of a negative number (e.g. `-` or `(`))\n * posPre, // the string to go in front of a positive number\n * negSuf, // the string to go after a negative number (e.g. `)`)\n * posSuf // the string to go after a positive number\n * }} pattern\n * @param {string} groupSep The string to separate groups of number (e.g. `,`)\n * @param {string} decimalSep The string to act as the decimal separator (e.g. `.`)\n * @param {[type]} fractionSize The size of the fractional part of the number\n * @return {string} The number formatted as a string\n */\nfunction formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {\n\n if (!(isString(number) || isNumber(number)) || isNaN(number)) return '';\n\n var isInfinity = !isFinite(number);\n var isZero = false;\n var numStr = Math.abs(number) + '',\n formattedText = '',\n parsedNumber;\n\n if (isInfinity) {\n formattedText = '\\u221e';\n } else {\n parsedNumber = parse(numStr);\n\n roundNumber(parsedNumber, fractionSize, pattern.minFrac, pattern.maxFrac);\n\n var digits = parsedNumber.d;\n var integerLen = parsedNumber.i;\n var exponent = parsedNumber.e;\n var decimals = [];\n isZero = digits.reduce(function(isZero, d) { return isZero && !d; }, true);\n\n // pad zeros for small numbers\n while (integerLen < 0) {\n digits.unshift(0);\n integerLen++;\n }\n\n // extract decimals digits\n if (integerLen > 0) {\n decimals = digits.splice(integerLen);\n } else {\n decimals = digits;\n digits = [0];\n }\n\n // format the integer digits with grouping separators\n var groups = [];\n if (digits.length > pattern.lgSize) {\n groups.unshift(digits.splice(-pattern.lgSize).join(''));\n }\n while (digits.length > pattern.gSize) {\n groups.unshift(digits.splice(-pattern.gSize).join(''));\n }\n if (digits.length) {\n groups.unshift(digits.join(''));\n }\n formattedText = groups.join(groupSep);\n\n // append the decimal digits\n if (decimals.length) {\n formattedText += decimalSep + decimals.join('');\n }\n\n if (exponent) {\n formattedText += 'e+' + exponent;\n }\n }\n if (number < 0 && !isZero) {\n return pattern.negPre + formattedText + pattern.negSuf;\n } else {\n return pattern.posPre + formattedText + pattern.posSuf;\n }\n}\n\nfunction padNumber(num, digits, trim) {\n var neg = '';\n if (num < 0) {\n neg = '-';\n num = -num;\n }\n num = '' + num;\n while (num.length < digits) num = ZERO_CHAR + num;\n if (trim) {\n num = num.substr(num.length - digits);\n }\n return neg + num;\n}\n\n\nfunction dateGetter(name, size, offset, trim) {\n offset = offset || 0;\n return function(date) {\n var value = date['get' + name]();\n if (offset > 0 || value > -offset) {\n value += offset;\n }\n if (value === 0 && offset == -12) value = 12;\n return padNumber(value, size, trim);\n };\n}\n\nfunction dateStrGetter(name, shortForm) {\n return function(date, formats) {\n var value = date['get' + name]();\n var get = uppercase(shortForm ? ('SHORT' + name) : name);\n\n return formats[get][value];\n };\n}\n\nfunction timeZoneGetter(date, formats, offset) {\n var zone = -1 * offset;\n var paddedZone = (zone >= 0) ? \"+\" : \"\";\n\n paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +\n padNumber(Math.abs(zone % 60), 2);\n\n return paddedZone;\n}\n\nfunction getFirstThursdayOfYear(year) {\n // 0 = index of January\n var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();\n // 4 = index of Thursday (+1 to account for 1st = 5)\n // 11 = index of *next* Thursday (+1 account for 1st = 12)\n return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);\n}\n\nfunction getThursdayThisWeek(datetime) {\n return new Date(datetime.getFullYear(), datetime.getMonth(),\n // 4 = index of Thursday\n datetime.getDate() + (4 - datetime.getDay()));\n}\n\nfunction weekGetter(size) {\n return function(date) {\n var firstThurs = getFirstThursdayOfYear(date.getFullYear()),\n thisThurs = getThursdayThisWeek(date);\n\n var diff = +thisThurs - +firstThurs,\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n\n return padNumber(result, size);\n };\n}\n\nfunction ampmGetter(date, formats) {\n return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];\n}\n\nfunction eraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1];\n}\n\nfunction longEraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1];\n}\n\nvar DATE_FORMATS = {\n yyyy: dateGetter('FullYear', 4),\n yy: dateGetter('FullYear', 2, 0, true),\n y: dateGetter('FullYear', 1),\n MMMM: dateStrGetter('Month'),\n MMM: dateStrGetter('Month', true),\n MM: dateGetter('Month', 2, 1),\n M: dateGetter('Month', 1, 1),\n dd: dateGetter('Date', 2),\n d: dateGetter('Date', 1),\n HH: dateGetter('Hours', 2),\n H: dateGetter('Hours', 1),\n hh: dateGetter('Hours', 2, -12),\n h: dateGetter('Hours', 1, -12),\n mm: dateGetter('Minutes', 2),\n m: dateGetter('Minutes', 1),\n ss: dateGetter('Seconds', 2),\n s: dateGetter('Seconds', 1),\n // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions\n sss: dateGetter('Milliseconds', 3),\n EEEE: dateStrGetter('Day'),\n EEE: dateStrGetter('Day', true),\n a: ampmGetter,\n Z: timeZoneGetter,\n ww: weekGetter(2),\n w: weekGetter(1),\n G: eraGetter,\n GG: eraGetter,\n GGG: eraGetter,\n GGGG: longEraGetter\n};\n\nvar DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,\n NUMBER_STRING = /^\\-?\\d+$/;\n\n/**\n * @ngdoc filter\n * @name date\n * @kind function\n *\n * @description\n * Formats `date` to a string based on the requested `format`.\n *\n * `format` string can be composed of the following elements:\n *\n * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)\n * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)\n * * `'MMMM'`: Month in year (January-December)\n * * `'MMM'`: Month in year (Jan-Dec)\n * * `'MM'`: Month in year, padded (01-12)\n * * `'M'`: Month in year (1-12)\n * * `'dd'`: Day in month, padded (01-31)\n * * `'d'`: Day in month (1-31)\n * * `'EEEE'`: Day in Week,(Sunday-Saturday)\n * * `'EEE'`: Day in Week, (Sun-Sat)\n * * `'HH'`: Hour in day, padded (00-23)\n * * `'H'`: Hour in day (0-23)\n * * `'hh'`: Hour in AM/PM, padded (01-12)\n * * `'h'`: Hour in AM/PM, (1-12)\n * * `'mm'`: Minute in hour, padded (00-59)\n * * `'m'`: Minute in hour (0-59)\n * * `'ss'`: Second in minute, padded (00-59)\n * * `'s'`: Second in minute (0-59)\n * * `'sss'`: Millisecond in second, padded (000-999)\n * * `'a'`: AM/PM marker\n * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)\n * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year\n * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year\n * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')\n * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')\n *\n * `format` string can also be one of the following predefined\n * {@link guide/i18n localizable formats}:\n *\n * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale\n * (e.g. Sep 3, 2010 12:05:08 PM)\n * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM)\n * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale\n * (e.g. Friday, September 3, 2010)\n * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010)\n * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)\n * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)\n * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)\n * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)\n *\n * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.\n * `\"h 'in the morning'\"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence\n * (e.g. `\"h 'o''clock'\"`).\n *\n * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or\n * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its\n * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is\n * specified in the string input, the time is considered to be in the local timezone.\n * @param {string=} format Formatting rules (see Description). If not specified,\n * `mediumDate` is used.\n * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n * @returns {string} Formatted string or the input if input is not recognized as date/millis.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:\n <span>{{1288323623006 | date:'medium'}}</span><br>\n <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:\n <span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br>\n <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:\n <span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br>\n <span ng-non-bindable>{{1288323623006 | date:\"MM/dd/yyyy 'at' h:mma\"}}</span>:\n <span>{{'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"}}</span><br>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should format date', function() {\n expect(element(by.binding(\"1288323623006 | date:'medium'\")).getText()).\n toMatch(/Oct 2\\d, 2010 \\d{1,2}:\\d{2}:\\d{2} (AM|PM)/);\n expect(element(by.binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).getText()).\n toMatch(/2010\\-10\\-2\\d \\d{2}:\\d{2}:\\d{2} (\\-|\\+)?\\d{4}/);\n expect(element(by.binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).getText()).\n toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(AM|PM)/);\n expect(element(by.binding(\"'1288323623006' | date:\\\"MM/dd/yyyy 'at' h:mma\\\"\")).getText()).\n toMatch(/10\\/2\\d\\/2010 at \\d{1,2}:\\d{2}(AM|PM)/);\n });\n </file>\n </example>\n */\ndateFilter.$inject = ['$locale'];\nfunction dateFilter($locale) {\n\n\n var R_ISO8601_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n // 1 2 3 4 5 6 7 8 9 10 11\n function jsonStringToDate(string) {\n var match;\n if (match = string.match(R_ISO8601_STR)) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0,\n dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,\n timeSetter = match[8] ? date.setUTCHours : date.setHours;\n\n if (match[9]) {\n tzHour = toInt(match[9] + match[10]);\n tzMin = toInt(match[9] + match[11]);\n }\n dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));\n var h = toInt(match[4] || 0) - tzHour;\n var m = toInt(match[5] || 0) - tzMin;\n var s = toInt(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }\n return string;\n }\n\n\n return function(date, format, timezone) {\n var text = '',\n parts = [],\n fn, match;\n\n format = format || 'mediumDate';\n format = $locale.DATETIME_FORMATS[format] || format;\n if (isString(date)) {\n date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date);\n }\n\n if (isNumber(date)) {\n date = new Date(date);\n }\n\n if (!isDate(date) || !isFinite(date.getTime())) {\n return date;\n }\n\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = concat(parts, match, 1);\n format = parts.pop();\n } else {\n parts.push(format);\n format = null;\n }\n }\n\n var dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone, true);\n }\n forEach(parts, function(value) {\n fn = DATE_FORMATS[value];\n text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)\n : value === \"''\" ? \"'\" : value.replace(/(^'|'$)/g, '').replace(/''/g, \"'\");\n });\n\n return text;\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name json\n * @kind function\n *\n * @description\n * Allows you to convert a JavaScript object into JSON string.\n *\n * This filter is mostly useful for debugging. When using the double curly {{value}} notation\n * the binding is automatically converted to JSON.\n *\n * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.\n * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.\n * @returns {string} JSON string.\n *\n *\n * @example\n <example>\n <file name=\"index.html\">\n <pre id=\"default-spacing\">{{ {'name':'value'} | json }}</pre>\n <pre id=\"custom-spacing\">{{ {'name':'value'} | json:4 }}</pre>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should jsonify filtered objects', function() {\n expect(element(by.id('default-spacing')).getText()).toMatch(/\\{\\n \"name\": ?\"value\"\\n}/);\n expect(element(by.id('custom-spacing')).getText()).toMatch(/\\{\\n \"name\": ?\"value\"\\n}/);\n });\n </file>\n </example>\n *\n */\nfunction jsonFilter() {\n return function(object, spacing) {\n if (isUndefined(spacing)) {\n spacing = 2;\n }\n return toJson(object, spacing);\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name lowercase\n * @kind function\n * @description\n * Converts string to lowercase.\n * @see angular.lowercase\n */\nvar lowercaseFilter = valueFn(lowercase);\n\n\n/**\n * @ngdoc filter\n * @name uppercase\n * @kind function\n * @description\n * Converts string to uppercase.\n * @see angular.uppercase\n */\nvar uppercaseFilter = valueFn(uppercase);\n\n/**\n * @ngdoc filter\n * @name limitTo\n * @kind function\n *\n * @description\n * Creates a new array or string containing only a specified number of elements. The elements\n * are taken from either the beginning or the end of the source array, string or number, as specified by\n * the value and sign (positive or negative) of `limit`. If a number is used as input, it is\n * converted to a string.\n *\n * @param {Array|string|number} input Source array, string or number to be limited.\n * @param {string|number} limit The length of the returned array or string. If the `limit` number\n * is positive, `limit` number of items from the beginning of the source array/string are copied.\n * If the number is negative, `limit` number of items from the end of the source array/string\n * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined,\n * the input will be returned unchanged.\n * @param {(string|number)=} begin Index at which to begin limitation. As a negative index, `begin`\n * indicates an offset from the end of `input`. Defaults to `0`.\n * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array\n * had less than `limit` elements.\n *\n * @example\n <example module=\"limitToExample\">\n <file name=\"index.html\">\n <script>\n angular.module('limitToExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.numbers = [1,2,3,4,5,6,7,8,9];\n $scope.letters = \"abcdefghi\";\n $scope.longNumber = 2345432342;\n $scope.numLimit = 3;\n $scope.letterLimit = 3;\n $scope.longNumberLimit = 3;\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>\n Limit {{numbers}} to:\n <input type=\"number\" step=\"1\" ng-model=\"numLimit\">\n </label>\n <p>Output numbers: {{ numbers | limitTo:numLimit }}</p>\n <label>\n Limit {{letters}} to:\n <input type=\"number\" step=\"1\" ng-model=\"letterLimit\">\n </label>\n <p>Output letters: {{ letters | limitTo:letterLimit }}</p>\n <label>\n Limit {{longNumber}} to:\n <input type=\"number\" step=\"1\" ng-model=\"longNumberLimit\">\n </label>\n <p>Output long number: {{ longNumber | limitTo:longNumberLimit }}</p>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var numLimitInput = element(by.model('numLimit'));\n var letterLimitInput = element(by.model('letterLimit'));\n var longNumberLimitInput = element(by.model('longNumberLimit'));\n var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));\n var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));\n var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));\n\n it('should limit the number array to first three items', function() {\n expect(numLimitInput.getAttribute('value')).toBe('3');\n expect(letterLimitInput.getAttribute('value')).toBe('3');\n expect(longNumberLimitInput.getAttribute('value')).toBe('3');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');\n expect(limitedLetters.getText()).toEqual('Output letters: abc');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 234');\n });\n\n // There is a bug in safari and protractor that doesn't like the minus key\n // it('should update the output when -3 is entered', function() {\n // numLimitInput.clear();\n // numLimitInput.sendKeys('-3');\n // letterLimitInput.clear();\n // letterLimitInput.sendKeys('-3');\n // longNumberLimitInput.clear();\n // longNumberLimitInput.sendKeys('-3');\n // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');\n // expect(limitedLetters.getText()).toEqual('Output letters: ghi');\n // expect(limitedLongNumber.getText()).toEqual('Output long number: 342');\n // });\n\n it('should not exceed the maximum size of input array', function() {\n numLimitInput.clear();\n numLimitInput.sendKeys('100');\n letterLimitInput.clear();\n letterLimitInput.sendKeys('100');\n longNumberLimitInput.clear();\n longNumberLimitInput.sendKeys('100');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');\n expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');\n });\n </file>\n </example>\n*/\nfunction limitToFilter() {\n return function(input, limit, begin) {\n if (Math.abs(Number(limit)) === Infinity) {\n limit = Number(limit);\n } else {\n limit = toInt(limit);\n }\n if (isNaN(limit)) return input;\n\n if (isNumber(input)) input = input.toString();\n if (!isArray(input) && !isString(input)) return input;\n\n begin = (!begin || isNaN(begin)) ? 0 : toInt(begin);\n begin = (begin < 0) ? Math.max(0, input.length + begin) : begin;\n\n if (limit >= 0) {\n return input.slice(begin, begin + limit);\n } else {\n if (begin === 0) {\n return input.slice(limit, input.length);\n } else {\n return input.slice(Math.max(0, begin + limit), begin);\n }\n }\n };\n}\n\n/**\n * @ngdoc filter\n * @name orderBy\n * @kind function\n *\n * @description\n * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically\n * for strings and numerically for numbers. Note: if you notice numbers are not being sorted\n * as expected, make sure they are actually being saved as numbers and not strings.\n * Array-like values (e.g. NodeLists, jQuery objects, TypedArrays, Strings, etc) are also supported.\n *\n * @param {Array} array The array (or array-like object) to sort.\n * @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be\n * used by the comparator to determine the order of elements.\n *\n * Can be one of:\n *\n * - `function`: Getter function. The result of this function will be sorted using the\n * `<`, `===`, `>` operator.\n * - `string`: An Angular expression. The result of this expression is used to compare elements\n * (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by\n * 3 first characters of a property called `name`). The result of a constant expression\n * is interpreted as a property name to be used in comparisons (for example `\"special name\"`\n * to sort object by the value of their `special name` property). An expression can be\n * optionally prefixed with `+` or `-` to control ascending or descending sort order\n * (for example, `+name` or `-name`). If no property is provided, (e.g. `'+'`) then the array\n * element itself is used to compare where sorting.\n * - `Array`: An array of function or string predicates. The first predicate in the array\n * is used for sorting, but when two items are equivalent, the next predicate is used.\n *\n * If the predicate is missing or empty then it defaults to `'+'`.\n *\n * @param {boolean=} reverse Reverse the order of the array.\n * @returns {Array} Sorted copy of the source array.\n *\n *\n * @example\n * The example below demonstrates a simple ngRepeat, where the data is sorted\n * by age in descending order (predicate is set to `'-age'`).\n * `reverse` is not set, which means it defaults to `false`.\n <example module=\"orderByExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <table class=\"friend\">\n <tr>\n <th>Name</th>\n <th>Phone Number</th>\n <th>Age</th>\n </tr>\n <tr ng-repeat=\"friend in friends | orderBy:'-age'\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n <td>{{friend.age}}</td>\n </tr>\n </table>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('orderByExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends =\n [{name:'John', phone:'555-1212', age:10},\n {name:'Mary', phone:'555-9876', age:19},\n {name:'Mike', phone:'555-4321', age:21},\n {name:'Adam', phone:'555-5678', age:35},\n {name:'Julie', phone:'555-8765', age:29}];\n }]);\n </file>\n </example>\n *\n * The predicate and reverse parameters can be controlled dynamically through scope properties,\n * as shown in the next example.\n * @example\n <example module=\"orderByExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>\n <hr/>\n <button ng-click=\"predicate=''\">Set to unsorted</button>\n <table class=\"friend\">\n <tr>\n <th>\n <button ng-click=\"order('name')\">Name</button>\n <span class=\"sortorder\" ng-show=\"predicate === 'name'\" ng-class=\"{reverse:reverse}\"></span>\n </th>\n <th>\n <button ng-click=\"order('phone')\">Phone Number</button>\n <span class=\"sortorder\" ng-show=\"predicate === 'phone'\" ng-class=\"{reverse:reverse}\"></span>\n </th>\n <th>\n <button ng-click=\"order('age')\">Age</button>\n <span class=\"sortorder\" ng-show=\"predicate === 'age'\" ng-class=\"{reverse:reverse}\"></span>\n </th>\n </tr>\n <tr ng-repeat=\"friend in friends | orderBy:predicate:reverse\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n <td>{{friend.age}}</td>\n </tr>\n </table>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('orderByExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends =\n [{name:'John', phone:'555-1212', age:10},\n {name:'Mary', phone:'555-9876', age:19},\n {name:'Mike', phone:'555-4321', age:21},\n {name:'Adam', phone:'555-5678', age:35},\n {name:'Julie', phone:'555-8765', age:29}];\n $scope.predicate = 'age';\n $scope.reverse = true;\n $scope.order = function(predicate) {\n $scope.reverse = ($scope.predicate === predicate) ? !$scope.reverse : false;\n $scope.predicate = predicate;\n };\n }]);\n </file>\n <file name=\"style.css\">\n .sortorder:after {\n content: '\\25b2';\n }\n .sortorder.reverse:after {\n content: '\\25bc';\n }\n </file>\n </example>\n *\n * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the\n * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the\n * desired parameters.\n *\n * Example:\n *\n * @example\n <example module=\"orderByExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>\n <table class=\"friend\">\n <tr>\n <th>\n <button ng-click=\"order('name')\">Name</button>\n <span class=\"sortorder\" ng-show=\"predicate === 'name'\" ng-class=\"{reverse:reverse}\"></span>\n </th>\n <th>\n <button ng-click=\"order('phone')\">Phone Number</button>\n <span class=\"sortorder\" ng-show=\"predicate === 'phone'\" ng-class=\"{reverse:reverse}\"></span>\n </th>\n <th>\n <button ng-click=\"order('age')\">Age</button>\n <span class=\"sortorder\" ng-show=\"predicate === 'age'\" ng-class=\"{reverse:reverse}\"></span>\n </th>\n </tr>\n <tr ng-repeat=\"friend in friends\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n <td>{{friend.age}}</td>\n </tr>\n </table>\n </div>\n </file>\n\n <file name=\"script.js\">\n angular.module('orderByExample', [])\n .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) {\n var orderBy = $filter('orderBy');\n $scope.friends = [\n { name: 'John', phone: '555-1212', age: 10 },\n { name: 'Mary', phone: '555-9876', age: 19 },\n { name: 'Mike', phone: '555-4321', age: 21 },\n { name: 'Adam', phone: '555-5678', age: 35 },\n { name: 'Julie', phone: '555-8765', age: 29 }\n ];\n $scope.order = function(predicate) {\n $scope.predicate = predicate;\n $scope.reverse = ($scope.predicate === predicate) ? !$scope.reverse : false;\n $scope.friends = orderBy($scope.friends, predicate, $scope.reverse);\n };\n $scope.order('age', true);\n }]);\n </file>\n\n <file name=\"style.css\">\n .sortorder:after {\n content: '\\25b2';\n }\n .sortorder.reverse:after {\n content: '\\25bc';\n }\n </file>\n</example>\n */\norderByFilter.$inject = ['$parse'];\nfunction orderByFilter($parse) {\n return function(array, sortPredicate, reverseOrder) {\n\n if (array == null) return array;\n if (!isArrayLike(array)) {\n throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array);\n }\n\n if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; }\n if (sortPredicate.length === 0) { sortPredicate = ['+']; }\n\n var predicates = processPredicates(sortPredicate, reverseOrder);\n // Add a predicate at the end that evaluates to the element index. This makes the\n // sort stable as it works as a tie-breaker when all the input predicates cannot\n // distinguish between two elements.\n predicates.push({ get: function() { return {}; }, descending: reverseOrder ? -1 : 1});\n\n // The next three lines are a version of a Swartzian Transform idiom from Perl\n // (sometimes called the Decorate-Sort-Undecorate idiom)\n // See https://en.wikipedia.org/wiki/Schwartzian_transform\n var compareValues = Array.prototype.map.call(array, getComparisonObject);\n compareValues.sort(doComparison);\n array = compareValues.map(function(item) { return item.value; });\n\n return array;\n\n function getComparisonObject(value, index) {\n return {\n value: value,\n predicateValues: predicates.map(function(predicate) {\n return getPredicateValue(predicate.get(value), index);\n })\n };\n }\n\n function doComparison(v1, v2) {\n var result = 0;\n for (var index=0, length = predicates.length; index < length; ++index) {\n result = compare(v1.predicateValues[index], v2.predicateValues[index]) * predicates[index].descending;\n if (result) break;\n }\n return result;\n }\n };\n\n function processPredicates(sortPredicate, reverseOrder) {\n reverseOrder = reverseOrder ? -1 : 1;\n return sortPredicate.map(function(predicate) {\n var descending = 1, get = identity;\n\n if (isFunction(predicate)) {\n get = predicate;\n } else if (isString(predicate)) {\n if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {\n descending = predicate.charAt(0) == '-' ? -1 : 1;\n predicate = predicate.substring(1);\n }\n if (predicate !== '') {\n get = $parse(predicate);\n if (get.constant) {\n var key = get();\n get = function(value) { return value[key]; };\n }\n }\n }\n return { get: get, descending: descending * reverseOrder };\n });\n }\n\n function isPrimitive(value) {\n switch (typeof value) {\n case 'number': /* falls through */\n case 'boolean': /* falls through */\n case 'string':\n return true;\n default:\n return false;\n }\n }\n\n function objectValue(value, index) {\n // If `valueOf` is a valid function use that\n if (typeof value.valueOf === 'function') {\n value = value.valueOf();\n if (isPrimitive(value)) return value;\n }\n // If `toString` is a valid function and not the one from `Object.prototype` use that\n if (hasCustomToString(value)) {\n value = value.toString();\n if (isPrimitive(value)) return value;\n }\n // We have a basic object so we use the position of the object in the collection\n return index;\n }\n\n function getPredicateValue(value, index) {\n var type = typeof value;\n if (value === null) {\n type = 'string';\n value = 'null';\n } else if (type === 'string') {\n value = value.toLowerCase();\n } else if (type === 'object') {\n value = objectValue(value, index);\n }\n return { value: value, type: type };\n }\n\n function compare(v1, v2) {\n var result = 0;\n if (v1.type === v2.type) {\n if (v1.value !== v2.value) {\n result = v1.value < v2.value ? -1 : 1;\n }\n } else {\n result = v1.type < v2.type ? -1 : 1;\n }\n return result;\n }\n}\n\nfunction ngDirective(directive) {\n if (isFunction(directive)) {\n directive = {\n link: directive\n };\n }\n directive.restrict = directive.restrict || 'AC';\n return valueFn(directive);\n}\n\n/**\n * @ngdoc directive\n * @name a\n * @restrict E\n *\n * @description\n * Modifies the default behavior of the html A tag so that the default action is prevented when\n * the href attribute is empty.\n *\n * This change permits the easy creation of action links with the `ngClick` directive\n * without changing the location or causing page reloads, e.g.:\n * `<a href=\"\" ng-click=\"list.addItem()\">Add Item</a>`\n */\nvar htmlAnchorDirective = valueFn({\n restrict: 'E',\n compile: function(element, attr) {\n if (!attr.href && !attr.xlinkHref) {\n return function(scope, element) {\n // If the linked element is not an anchor tag anymore, do nothing\n if (element[0].nodeName.toLowerCase() !== 'a') return;\n\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n 'xlink:href' : 'href';\n element.on('click', function(event) {\n // if we have no href url, then don't navigate anywhere.\n if (!element.attr(href)) {\n event.preventDefault();\n }\n });\n };\n }\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngHref\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in an href attribute will\n * make the link go to the wrong URL if the user clicks it before\n * Angular has a chance to replace the `{{hash}}` markup with its\n * value. Until Angular replaces the markup the link will be broken\n * and will most likely return a 404 error. The `ngHref` directive\n * solves this problem.\n *\n * The wrong way to write it:\n * ```html\n * <a href=\"http://www.gravatar.com/avatar/{{hash}}\">link1</a>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <a ng-href=\"http://www.gravatar.com/avatar/{{hash}}\">link1</a>\n * ```\n *\n * @element A\n * @param {template} ngHref any string which can contain `{{}}` markup.\n *\n * @example\n * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes\n * in links and their different behaviors:\n <example>\n <file name=\"index.html\">\n <input ng-model=\"value\" /><br />\n <a id=\"link-1\" href ng-click=\"value = 1\">link 1</a> (link, don't reload)<br />\n <a id=\"link-2\" href=\"\" ng-click=\"value = 2\">link 2</a> (link, don't reload)<br />\n <a id=\"link-3\" ng-href=\"/{{'123'}}\">link 3</a> (link, reload!)<br />\n <a id=\"link-4\" href=\"\" name=\"xx\" ng-click=\"value = 4\">anchor</a> (link, don't reload)<br />\n <a id=\"link-5\" name=\"xxx\" ng-click=\"value = 5\">anchor</a> (no link)<br />\n <a id=\"link-6\" ng-href=\"{{value}}\">link</a> (link, change location)\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should execute ng-click but not reload when href without value', function() {\n element(by.id('link-1')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('1');\n expect(element(by.id('link-1')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when href empty string', function() {\n element(by.id('link-2')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('2');\n expect(element(by.id('link-2')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click and change url when ng-href specified', function() {\n expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\\/123$/);\n\n element(by.id('link-3')).click();\n\n // At this point, we navigate away from an Angular page, so we need\n // to use browser.driver to get the base webdriver.\n\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/123$/);\n });\n }, 5000, 'page should navigate to /123');\n });\n\n it('should execute ng-click but not reload when href empty string and name specified', function() {\n element(by.id('link-4')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('4');\n expect(element(by.id('link-4')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when no href but name specified', function() {\n element(by.id('link-5')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('5');\n expect(element(by.id('link-5')).getAttribute('href')).toBe(null);\n });\n\n it('should only change url when only ng-href', function() {\n element(by.model('value')).clear();\n element(by.model('value')).sendKeys('6');\n expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\\/6$/);\n\n element(by.id('link-6')).click();\n\n // At this point, we navigate away from an Angular page, so we need\n // to use browser.driver to get the base webdriver.\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/6$/);\n });\n }, 5000, 'page should navigate to /6');\n });\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngSrc\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `src` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrc` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * <img src=\"http://www.gravatar.com/avatar/{{hash}}\" alt=\"Description\"/>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <img ng-src=\"http://www.gravatar.com/avatar/{{hash}}\" alt=\"Description\" />\n * ```\n *\n * @element IMG\n * @param {template} ngSrc any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngSrcset\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrcset` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * <img srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\" alt=\"Description\"/>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <img ng-srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\" alt=\"Description\" />\n * ```\n *\n * @element IMG\n * @param {template} ngSrcset any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngDisabled\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * This directive sets the `disabled` attribute on the element if the\n * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `disabled`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <label>Click me to toggle: <input type=\"checkbox\" ng-model=\"checked\"></label><br/>\n <button ng-model=\"button\" ng-disabled=\"checked\">Button</button>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should toggle button', function() {\n expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element INPUT\n * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,\n * then the `disabled` attribute will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngChecked\n * @restrict A\n * @priority 100\n *\n * @description\n * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.\n *\n * Note that this directive should not be used together with {@link ngModel `ngModel`},\n * as this can lead to unexpected behavior.\n *\n * A special directive is necessary because we cannot use interpolation inside the `checked`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <label>Check me to check both: <input type=\"checkbox\" ng-model=\"master\"></label><br/>\n <input id=\"checkSlave\" type=\"checkbox\" ng-checked=\"master\" aria-label=\"Slave input\">\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check both checkBoxes', function() {\n expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();\n element(by.model('master')).click();\n expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element INPUT\n * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,\n * then the `checked` attribute will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngReadonly\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `readOnly` attribute on the element, if the expression inside `ngReadonly` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `readOnly`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <label>Check me to make text readonly: <input type=\"checkbox\" ng-model=\"checked\"></label><br/>\n <input type=\"text\" ng-readonly=\"checked\" value=\"I'm Angular\" aria-label=\"Readonly field\" />\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should toggle readonly attr', function() {\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element INPUT\n * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,\n * then special attribute \"readonly\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSelected\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `selected` attribute on the element, if the expression inside `ngSelected` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `selected`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <label>Check me to select: <input type=\"checkbox\" ng-model=\"selected\"></label><br/>\n <select aria-label=\"ngSelected demo\">\n <option>Hello!</option>\n <option id=\"greet\" ng-selected=\"selected\">Greetings!</option>\n </select>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should select Greetings!', function() {\n expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();\n element(by.model('selected')).click();\n expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element OPTION\n * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,\n * then special attribute \"selected\" will be set on the element\n */\n\n/**\n * @ngdoc directive\n * @name ngOpen\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `open` attribute on the element, if the expression inside `ngOpen` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `open`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <label>Check me check multiple: <input type=\"checkbox\" ng-model=\"open\"></label><br/>\n <details id=\"details\" ng-open=\"open\">\n <summary>Show/Hide me</summary>\n </details>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should toggle open', function() {\n expect(element(by.id('details')).getAttribute('open')).toBeFalsy();\n element(by.model('open')).click();\n expect(element(by.id('details')).getAttribute('open')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element DETAILS\n * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,\n * then special attribute \"open\" will be set on the element\n */\n\nvar ngAttributeAliasDirectives = {};\n\n// boolean attrs are evaluated\nforEach(BOOLEAN_ATTR, function(propName, attrName) {\n // binding to multiple is not supported\n if (propName == \"multiple\") return;\n\n function defaultLinkFn(scope, element, attr) {\n scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {\n attr.$set(attrName, !!value);\n });\n }\n\n var normalized = directiveNormalize('ng-' + attrName);\n var linkFn = defaultLinkFn;\n\n if (propName === 'checked') {\n linkFn = function(scope, element, attr) {\n // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input\n if (attr.ngModel !== attr[normalized]) {\n defaultLinkFn(scope, element, attr);\n }\n };\n }\n\n ngAttributeAliasDirectives[normalized] = function() {\n return {\n restrict: 'A',\n priority: 100,\n link: linkFn\n };\n };\n});\n\n// aliased input attrs are evaluated\nforEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {\n ngAttributeAliasDirectives[ngAttr] = function() {\n return {\n priority: 100,\n link: function(scope, element, attr) {\n //special case ngPattern when a literal regular expression value\n //is used as the expression (this way we don't have to watch anything).\n if (ngAttr === \"ngPattern\" && attr.ngPattern.charAt(0) == \"/\") {\n var match = attr.ngPattern.match(REGEX_STRING_REGEXP);\n if (match) {\n attr.$set(\"ngPattern\", new RegExp(match[1], match[2]));\n return;\n }\n }\n\n scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {\n attr.$set(ngAttr, value);\n });\n }\n };\n };\n});\n\n// ng-src, ng-srcset, ng-href are interpolated\nforEach(['src', 'srcset', 'href'], function(attrName) {\n var normalized = directiveNormalize('ng-' + attrName);\n ngAttributeAliasDirectives[normalized] = function() {\n return {\n priority: 99, // it needs to run after the attributes are interpolated\n link: function(scope, element, attr) {\n var propName = attrName,\n name = attrName;\n\n if (attrName === 'href' &&\n toString.call(element.prop('href')) === '[object SVGAnimatedString]') {\n name = 'xlinkHref';\n attr.$attr[name] = 'xlink:href';\n propName = null;\n }\n\n attr.$observe(normalized, function(value) {\n if (!value) {\n if (attrName === 'href') {\n attr.$set(name, null);\n }\n return;\n }\n\n attr.$set(name, value);\n\n // on IE, if \"ng:src\" directive declaration is used and \"src\" attribute doesn't exist\n // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need\n // to set the property as well to achieve the desired effect.\n // we use attr[attrName] value since $set can sanitize the url.\n if (msie && propName) element.prop(propName, attr[name]);\n });\n }\n };\n };\n});\n\n/* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true\n */\nvar nullFormCtrl = {\n $addControl: noop,\n $$renameControl: nullFormRenameControl,\n $removeControl: noop,\n $setValidity: noop,\n $setDirty: noop,\n $setPristine: noop,\n $setSubmitted: noop\n},\nSUBMITTED_CLASS = 'ng-submitted';\n\nfunction nullFormRenameControl(control, name) {\n control.$name = name;\n}\n\n/**\n * @ngdoc type\n * @name form.FormController\n *\n * @property {boolean} $pristine True if user has not interacted with the form yet.\n * @property {boolean} $dirty True if user has already interacted with the form.\n * @property {boolean} $valid True if all of the containing forms and controls are valid.\n * @property {boolean} $invalid True if at least one containing control or form is invalid.\n * @property {boolean} $pending True if at least one containing control or form is pending.\n * @property {boolean} $submitted True if user has submitted the form even if its invalid.\n *\n * @property {Object} $error Is an object hash, containing references to controls or\n * forms with failing validators, where:\n *\n * - keys are validation tokens (error names),\n * - values are arrays of controls or forms that have a failing validator for given error name.\n *\n * Built-in validation tokens:\n *\n * - `email`\n * - `max`\n * - `maxlength`\n * - `min`\n * - `minlength`\n * - `number`\n * - `pattern`\n * - `required`\n * - `url`\n * - `date`\n * - `datetimelocal`\n * - `time`\n * - `week`\n * - `month`\n *\n * @description\n * `FormController` keeps track of all its controls and nested forms as well as the state of them,\n * such as being valid/invalid or dirty/pristine.\n *\n * Each {@link ng.directive:form form} directive creates an instance\n * of `FormController`.\n *\n */\n//asks for $scope to fool the BC controller module\nFormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];\nfunction FormController(element, attrs, $scope, $animate, $interpolate) {\n var form = this,\n controls = [];\n\n // init state\n form.$error = {};\n form.$$success = {};\n form.$pending = undefined;\n form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope);\n form.$dirty = false;\n form.$pristine = true;\n form.$valid = true;\n form.$invalid = false;\n form.$submitted = false;\n form.$$parentForm = nullFormCtrl;\n\n /**\n * @ngdoc method\n * @name form.FormController#$rollbackViewValue\n *\n * @description\n * Rollback all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is typically needed by the reset button of\n * a form that uses `ng-model-options` to pend updates.\n */\n form.$rollbackViewValue = function() {\n forEach(controls, function(control) {\n control.$rollbackViewValue();\n });\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$commitViewValue\n *\n * @description\n * Commit all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n form.$commitViewValue = function() {\n forEach(controls, function(control) {\n control.$commitViewValue();\n });\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$addControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Register a control with the form. Input elements using ngModelController do this automatically\n * when they are linked.\n *\n * Note that the current state of the control will not be reflected on the new parent form. This\n * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine`\n * state.\n *\n * However, if the method is used programmatically, for example by adding dynamically created controls,\n * or controls that have been previously removed without destroying their corresponding DOM element,\n * it's the developers responsibility to make sure the current state propagates to the parent form.\n *\n * For example, if an input control is added that is already `$dirty` and has `$error` properties,\n * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form.\n */\n form.$addControl = function(control) {\n // Breaking change - before, inputs whose name was \"hasOwnProperty\" were quietly ignored\n // and not added to the scope. Now we throw an error.\n assertNotHasOwnProperty(control.$name, 'input');\n controls.push(control);\n\n if (control.$name) {\n form[control.$name] = control;\n }\n\n control.$$parentForm = form;\n };\n\n // Private API: rename a form control\n form.$$renameControl = function(control, newName) {\n var oldName = control.$name;\n\n if (form[oldName] === control) {\n delete form[oldName];\n }\n form[newName] = control;\n control.$name = newName;\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$removeControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Deregister a control from the form.\n *\n * Input elements using ngModelController do this automatically when they are destroyed.\n *\n * Note that only the removed control's validation state (`$errors`etc.) will be removed from the\n * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be\n * different from case to case. For example, removing the only `$dirty` control from a form may or\n * may not mean that the form is still `$dirty`.\n */\n form.$removeControl = function(control) {\n if (control.$name && form[control.$name] === control) {\n delete form[control.$name];\n }\n forEach(form.$pending, function(value, name) {\n form.$setValidity(name, null, control);\n });\n forEach(form.$error, function(value, name) {\n form.$setValidity(name, null, control);\n });\n forEach(form.$$success, function(value, name) {\n form.$setValidity(name, null, control);\n });\n\n arrayRemove(controls, control);\n control.$$parentForm = nullFormCtrl;\n };\n\n\n /**\n * @ngdoc method\n * @name form.FormController#$setValidity\n *\n * @description\n * Sets the validity of a form control.\n *\n * This method will also propagate to parent forms.\n */\n addSetValidityMethod({\n ctrl: this,\n $element: element,\n set: function(object, property, controller) {\n var list = object[property];\n if (!list) {\n object[property] = [controller];\n } else {\n var index = list.indexOf(controller);\n if (index === -1) {\n list.push(controller);\n }\n }\n },\n unset: function(object, property, controller) {\n var list = object[property];\n if (!list) {\n return;\n }\n arrayRemove(list, controller);\n if (list.length === 0) {\n delete object[property];\n }\n },\n $animate: $animate\n });\n\n /**\n * @ngdoc method\n * @name form.FormController#$setDirty\n *\n * @description\n * Sets the form to a dirty state.\n *\n * This method can be called to add the 'ng-dirty' class and set the form to a dirty\n * state (ng-dirty class). This method will also propagate to parent forms.\n */\n form.$setDirty = function() {\n $animate.removeClass(element, PRISTINE_CLASS);\n $animate.addClass(element, DIRTY_CLASS);\n form.$dirty = true;\n form.$pristine = false;\n form.$$parentForm.$setDirty();\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$setPristine\n *\n * @description\n * Sets the form to its pristine state.\n *\n * This method can be called to remove the 'ng-dirty' class and set the form to its pristine\n * state (ng-pristine class). This method will also propagate to all the controls contained\n * in this form.\n *\n * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after\n * saving or resetting it.\n */\n form.$setPristine = function() {\n $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);\n form.$dirty = false;\n form.$pristine = true;\n form.$submitted = false;\n forEach(controls, function(control) {\n control.$setPristine();\n });\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$setUntouched\n *\n * @description\n * Sets the form to its untouched state.\n *\n * This method can be called to remove the 'ng-touched' class and set the form controls to their\n * untouched state (ng-untouched class).\n *\n * Setting a form controls back to their untouched state is often useful when setting the form\n * back to its pristine state.\n */\n form.$setUntouched = function() {\n forEach(controls, function(control) {\n control.$setUntouched();\n });\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$setSubmitted\n *\n * @description\n * Sets the form to its submitted state.\n */\n form.$setSubmitted = function() {\n $animate.addClass(element, SUBMITTED_CLASS);\n form.$submitted = true;\n form.$$parentForm.$setSubmitted();\n };\n}\n\n/**\n * @ngdoc directive\n * @name ngForm\n * @restrict EAC\n *\n * @description\n * Nestable alias of {@link ng.directive:form `form`} directive. HTML\n * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a\n * sub-group of controls needs to be determined.\n *\n * Note: the purpose of `ngForm` is to group controls,\n * but not to be a replacement for the `<form>` tag with all of its capabilities\n * (e.g. posting to the server, ...).\n *\n * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n *\n */\n\n /**\n * @ngdoc directive\n * @name form\n * @restrict E\n *\n * @description\n * Directive that instantiates\n * {@link form.FormController FormController}.\n *\n * If the `name` attribute is specified, the form controller is published onto the current scope under\n * this name.\n *\n * # Alias: {@link ng.directive:ngForm `ngForm`}\n *\n * In Angular, forms can be nested. This means that the outer form is valid when all of the child\n * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so\n * Angular provides the {@link ng.directive:ngForm `ngForm`} directive, which behaves identically to\n * `form` but can be nested. Nested forms can be useful, for example, if the validity of a sub-group\n * of controls needs to be determined.\n *\n * # CSS classes\n * - `ng-valid` is set if the form is valid.\n * - `ng-invalid` is set if the form is invalid.\n * - `ng-pending` is set if the form is pending.\n * - `ng-pristine` is set if the form is pristine.\n * - `ng-dirty` is set if the form is dirty.\n * - `ng-submitted` is set if the form was submitted.\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n *\n * # Submitting a form and preventing the default action\n *\n * Since the role of forms in client-side Angular applications is different than in classical\n * roundtrip apps, it is desirable for the browser not to translate the form submission into a full\n * page reload that sends the data to the server. Instead some javascript logic should be triggered\n * to handle the form submission in an application-specific way.\n *\n * For this reason, Angular prevents the default action (form submission to the server) unless the\n * `<form>` element has an `action` attribute specified.\n *\n * You can use one of the following two ways to specify what javascript method should be called when\n * a form is submitted:\n *\n * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element\n * - {@link ng.directive:ngClick ngClick} directive on the first\n * button or input field of type submit (input[type=submit])\n *\n * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}\n * or {@link ng.directive:ngClick ngClick} directives.\n * This is because of the following form submission rules in the HTML specification:\n *\n * - If a form has only one input field then hitting enter in this field triggers form submit\n * (`ngSubmit`)\n * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter\n * doesn't trigger submit\n * - if a form has one or more input fields and one or more buttons or input[type=submit] then\n * hitting enter in any of the input fields will trigger the click handler on the *first* button or\n * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)\n *\n * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is\n * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * ## Animation Hooks\n *\n * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.\n * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any\n * other validations that are performed within the form. Animations in ngForm are similar to how\n * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well\n * as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style a form element\n * that has been rendered as invalid after it has been validated:\n *\n * <pre>\n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-form {\n * transition:0.5s linear all;\n * background: white;\n * }\n * .my-form.ng-invalid {\n * background: red;\n * color:white;\n * }\n * </pre>\n *\n * @example\n <example deps=\"angular-animate.js\" animations=\"true\" fixBase=\"true\" module=\"formExample\">\n <file name=\"index.html\">\n <script>\n angular.module('formExample', [])\n .controller('FormController', ['$scope', function($scope) {\n $scope.userType = 'guest';\n }]);\n </script>\n <style>\n .my-form {\n transition:all linear 0.5s;\n background: transparent;\n }\n .my-form.ng-invalid {\n background: red;\n }\n </style>\n <form name=\"myForm\" ng-controller=\"FormController\" class=\"my-form\">\n userType: <input name=\"input\" ng-model=\"userType\" required>\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">Required!</span><br>\n <code>userType = {{userType}}</code><br>\n <code>myForm.input.$valid = {{myForm.input.$valid}}</code><br>\n <code>myForm.input.$error = {{myForm.input.$error}}</code><br>\n <code>myForm.$valid = {{myForm.$valid}}</code><br>\n <code>myForm.$error.required = {{!!myForm.$error.required}}</code><br>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should initialize to model', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n expect(userType.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n var userInput = element(by.model('userType'));\n\n userInput.clear();\n userInput.sendKeys('');\n\n expect(userType.getText()).toEqual('userType =');\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n *\n * @param {string=} name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n */\nvar formDirectiveFactory = function(isNgForm) {\n return ['$timeout', '$parse', function($timeout, $parse) {\n var formDirective = {\n name: 'form',\n restrict: isNgForm ? 'EAC' : 'E',\n require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form\n controller: FormController,\n compile: function ngFormCompile(formElement, attr) {\n // Setup initial state of the control\n formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);\n\n var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false);\n\n return {\n pre: function ngFormPreLink(scope, formElement, attr, ctrls) {\n var controller = ctrls[0];\n\n // if `action` attr is not present on the form, prevent the default action (submission)\n if (!('action' in attr)) {\n // we can't use jq events because if a form is destroyed during submission the default\n // action is not prevented. see #1238\n //\n // IE 9 is not affected because it doesn't fire a submit event and try to do a full\n // page reload if the form was destroyed by submission of the form via a click handler\n // on a button in the form. Looks like an IE9 specific bug.\n var handleFormSubmission = function(event) {\n scope.$apply(function() {\n controller.$commitViewValue();\n controller.$setSubmitted();\n });\n\n event.preventDefault();\n };\n\n addEventListenerFn(formElement[0], 'submit', handleFormSubmission);\n\n // unregister the preventDefault listener so that we don't not leak memory but in a\n // way that will achieve the prevention of the default action.\n formElement.on('$destroy', function() {\n $timeout(function() {\n removeEventListenerFn(formElement[0], 'submit', handleFormSubmission);\n }, 0, false);\n });\n }\n\n var parentFormCtrl = ctrls[1] || controller.$$parentForm;\n parentFormCtrl.$addControl(controller);\n\n var setter = nameAttr ? getSetter(controller.$name) : noop;\n\n if (nameAttr) {\n setter(scope, controller);\n attr.$observe(nameAttr, function(newValue) {\n if (controller.$name === newValue) return;\n setter(scope, undefined);\n controller.$$parentForm.$$renameControl(controller, newValue);\n setter = getSetter(controller.$name);\n setter(scope, controller);\n });\n }\n formElement.on('$destroy', function() {\n controller.$$parentForm.$removeControl(controller);\n setter(scope, undefined);\n extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards\n });\n }\n };\n }\n };\n\n return formDirective;\n\n function getSetter(expression) {\n if (expression === '') {\n //create an assignable expression, so forms with an empty name can be renamed later\n return $parse('this[\"\"]').assign;\n }\n return $parse(expression).assign || noop;\n }\n }];\n};\n\nvar formDirective = formDirectiveFactory();\nvar ngFormDirective = formDirectiveFactory(true);\n\n/* global VALID_CLASS: false,\n INVALID_CLASS: false,\n PRISTINE_CLASS: false,\n DIRTY_CLASS: false,\n UNTOUCHED_CLASS: false,\n TOUCHED_CLASS: false,\n ngModelMinErr: false,\n*/\n\n// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231\nvar ISO_DATE_REGEXP = /\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)/;\n// See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987)\n// Note: We are being more lenient, because browsers are too.\n// 1. Scheme\n// 2. Slashes\n// 3. Username\n// 4. Password\n// 5. Hostname\n// 6. Port\n// 7. Path\n// 8. Query\n// 9. Fragment\n// 1111111111111111 222 333333 44444 555555555555555555555555 666 77777777 8888888 999\nvar URL_REGEXP = /^[a-z][a-z\\d.+-]*:\\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\\s:/?#]+|\\[[a-f\\d:]+\\])(?::\\d+)?(?:\\/[^?#]*)?(?:\\?[^#]*)?(?:#.*)?$/i;\nvar EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;\nvar NUMBER_REGEXP = /^\\s*(\\-|\\+)?(\\d+|(\\d*(\\.\\d*)))([eE][+-]?\\d+)?\\s*$/;\nvar DATE_REGEXP = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nvar DATETIMELOCAL_REGEXP = /^(\\d{4})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\nvar WEEK_REGEXP = /^(\\d{4})-W(\\d\\d)$/;\nvar MONTH_REGEXP = /^(\\d{4})-(\\d\\d)$/;\nvar TIME_REGEXP = /^(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\n\nvar inputType = {\n\n /**\n * @ngdoc input\n * @name input[text]\n *\n * @description\n * Standard HTML text input with angular data binding, inherited by most of the `input` elements.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Adds `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n * This parameter is ignored for input[type=password] controls, which will never trim the\n * input.\n *\n * @example\n <example name=\"text-input-directive\" module=\"textInputExample\">\n <file name=\"index.html\">\n <script>\n angular.module('textInputExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.example = {\n text: 'guest',\n word: /^\\s*\\w*\\s*$/\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>Single word:\n <input type=\"text\" name=\"input\" ng-model=\"example.text\"\n ng-pattern=\"example.word\" required ng-trim=\"false\">\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.pattern\">\n Single word only!</span>\n </div>\n <tt>text = {{example.text}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var text = element(by.binding('example.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if multi word', function() {\n input.clear();\n input.sendKeys('hello world');\n\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n */\n 'text': textInputType,\n\n /**\n * @ngdoc input\n * @name input[date]\n *\n * @description\n * Input with date validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601\n * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many\n * modern browsers do not yet support this input type, it is important to provide cues to users on the\n * expected input format via a placeholder or label.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `min=\"{{minDate | date:'yyyy-MM-dd'}}\"`). Note that `min` will also add native HTML5\n * constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `max=\"{{maxDate | date:'yyyy-MM-dd'}}\"`). Note that `max` will also add native HTML5\n * constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"date-input-directive\" module=\"dateInputExample\">\n <file name=\"index.html\">\n <script>\n angular.module('dateInputExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(2013, 9, 22)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label for=\"exampleInput\">Pick a date in 2013:</label>\n <input type=\"date\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"yyyy-MM-dd\" min=\"2013-01-01\" max=\"2013-12-31\" required />\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.date\">\n Not a valid date!</span>\n </div>\n <tt>value = {{example.value | date: \"yyyy-MM-dd\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"yyyy-MM-dd\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (see https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10-22');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'date': createDateInputType('date', DATE_REGEXP,\n createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),\n 'yyyy-MM-dd'),\n\n /**\n * @ngdoc input\n * @name input[datetime-local]\n *\n * @description\n * Input with datetime validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `min=\"{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `min` will also add native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `max=\"{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `max` will also add native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"datetimelocal-input-directive\" module=\"dateExample\">\n <file name=\"index.html\">\n <script>\n angular.module('dateExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(2010, 11, 28, 14, 57)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label for=\"exampleInput\">Pick a date between in 2013:</label>\n <input type=\"datetime-local\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"yyyy-MM-ddTHH:mm:ss\" min=\"2001-01-01T00:00:00\" max=\"2013-12-31T00:00:00\" required />\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.datetimelocal\">\n Not a valid date!</span>\n </div>\n <tt>value = {{example.value | date: \"yyyy-MM-ddTHH:mm:ss\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"yyyy-MM-ddTHH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2010-12-28T14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01-01T23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,\n createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),\n 'yyyy-MM-ddTHH:mm:ss.sss'),\n\n /**\n * @ngdoc input\n * @name input[time]\n *\n * @description\n * Input with time validation and transformation. In browsers that do not yet support\n * the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a\n * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minTime | date:'HH:mm:ss'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxTime | date:'HH:mm:ss'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the\n * `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the\n * `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"time-input-directive\" module=\"timeExample\">\n <file name=\"index.html\">\n <script>\n angular.module('timeExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(1970, 0, 1, 14, 57, 0)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label for=\"exampleInput\">Pick a between 8am and 5pm:</label>\n <input type=\"time\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"HH:mm:ss\" min=\"08:00:00\" max=\"17:00:00\" required />\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.time\">\n Not a valid date!</span>\n </div>\n <tt>value = {{example.value | date: \"HH:mm:ss\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"HH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'time': createDateInputType('time', TIME_REGEXP,\n createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),\n 'HH:mm:ss.sss'),\n\n /**\n * @ngdoc input\n * @name input[week]\n *\n * @description\n * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support\n * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * week format (yyyy-W##), for example: `2013-W02`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minWeek | date:'yyyy-Www'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxWeek | date:'yyyy-Www'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"week-input-directive\" module=\"weekExample\">\n <file name=\"index.html\">\n <script>\n angular.module('weekExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(2013, 0, 3)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label>Pick a date between in 2013:\n <input id=\"exampleInput\" type=\"week\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"YYYY-W##\" min=\"2012-W32\"\n max=\"2013-W52\" required />\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.week\">\n Not a valid date!</span>\n </div>\n <tt>value = {{example.value | date: \"yyyy-Www\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"yyyy-Www\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-W01');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-W01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),\n\n /**\n * @ngdoc input\n * @name input[month]\n *\n * @description\n * Input with month validation and transformation. In browsers that do not yet support\n * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * month format (yyyy-MM), for example: `2009-01`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n * If the model is not set to the first of the month, the next view to model update will set it\n * to the first of the month.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minMonth | date:'yyyy-MM'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxMonth | date:'yyyy-MM'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"month-input-directive\" module=\"monthExample\">\n <file name=\"index.html\">\n <script>\n angular.module('monthExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(2013, 9, 1)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label for=\"exampleInput\">Pick a month in 2013:</label>\n <input id=\"exampleInput\" type=\"month\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"yyyy-MM\" min=\"2013-01\" max=\"2013-12\" required />\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.month\">\n Not a valid month!</span>\n </div>\n <tt>value = {{example.value | date: \"yyyy-MM\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"yyyy-MM\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'month': createDateInputType('month', MONTH_REGEXP,\n createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),\n 'yyyy-MM'),\n\n /**\n * @ngdoc input\n * @name input[number]\n *\n * @description\n * Text input with number validation and transformation. Sets the `number` validation\n * error if not a valid number.\n *\n * <div class=\"alert alert-warning\">\n * The model must always be of type `number` otherwise Angular will throw an error.\n * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt}\n * error docs for more information and an example of how to convert your model if necessary.\n * </div>\n *\n * ## Issues with HTML5 constraint validation\n *\n * In browsers that follow the\n * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),\n * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.\n * If a non-number is entered in the input, the browser will report the value as an empty string,\n * which means the view / model values in `ngModel` and subsequently the scope value\n * will also be an empty string.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"number-input-directive\" module=\"numberExample\">\n <file name=\"index.html\">\n <script>\n angular.module('numberExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.example = {\n value: 12\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>Number:\n <input type=\"number\" name=\"input\" ng-model=\"example.value\"\n min=\"0\" max=\"99\" required>\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.number\">\n Not valid number!</span>\n </div>\n <tt>value = {{example.value}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('12');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if over max', function() {\n input.clear();\n input.sendKeys('123');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n */\n 'number': numberInputType,\n\n\n /**\n * @ngdoc input\n * @name input[url]\n *\n * @description\n * Text input with URL validation. Sets the `url` validation error key if the content is not a\n * valid URL.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex\n * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify\n * the built-in validators (see the {@link guide/forms Forms guide})\n * </div>\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"url-input-directive\" module=\"urlExample\">\n <file name=\"index.html\">\n <script>\n angular.module('urlExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.url = {\n text: 'http://google.com'\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>URL:\n <input type=\"url\" name=\"input\" ng-model=\"url.text\" required>\n <label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.url\">\n Not valid url!</span>\n </div>\n <tt>text = {{url.text}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n <tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var text = element(by.binding('url.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('url.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('http://google.com');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if not url', function() {\n input.clear();\n input.sendKeys('box');\n\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n */\n 'url': urlInputType,\n\n\n /**\n * @ngdoc input\n * @name input[email]\n *\n * @description\n * Text input with email validation. Sets the `email` validation error key if not a valid email\n * address.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex\n * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can\n * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide})\n * </div>\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"email-input-directive\" module=\"emailExample\">\n <file name=\"index.html\">\n <script>\n angular.module('emailExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.email = {\n text: 'me@example.com'\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>Email:\n <input type=\"email\" name=\"input\" ng-model=\"email.text\" required>\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.email\">\n Not valid email!</span>\n </div>\n <tt>text = {{email.text}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n <tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var text = element(by.binding('email.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('email.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('me@example.com');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if not email', function() {\n input.clear();\n input.sendKeys('xxx');\n\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n */\n 'email': emailInputType,\n\n\n /**\n * @ngdoc input\n * @name input[radio]\n *\n * @description\n * HTML radio button.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string} value The value to which the `ngModel` expression should be set when selected.\n * Note that `value` only supports `string` values, i.e. the scope model needs to be a string,\n * too. Use `ngValue` if you need complex models (`number`, `object`, ...).\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {string} ngValue Angular expression to which `ngModel` will be be set when the radio\n * is selected. Should be used instead of the `value` attribute if you need\n * a non-string `ngModel` (`boolean`, `array`, ...).\n *\n * @example\n <example name=\"radio-input-directive\" module=\"radioExample\">\n <file name=\"index.html\">\n <script>\n angular.module('radioExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.color = {\n name: 'blue'\n };\n $scope.specialValue = {\n \"id\": \"12345\",\n \"value\": \"green\"\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>\n <input type=\"radio\" ng-model=\"color.name\" value=\"red\">\n Red\n </label><br/>\n <label>\n <input type=\"radio\" ng-model=\"color.name\" ng-value=\"specialValue\">\n Green\n </label><br/>\n <label>\n <input type=\"radio\" ng-model=\"color.name\" value=\"blue\">\n Blue\n </label><br/>\n <tt>color = {{color.name | json}}</tt><br/>\n </form>\n Note that `ng-value=\"specialValue\"` sets radio item's value to be the value of `$scope.specialValue`.\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should change state', function() {\n var color = element(by.binding('color.name'));\n\n expect(color.getText()).toContain('blue');\n\n element.all(by.model('color.name')).get(0).click();\n\n expect(color.getText()).toContain('red');\n });\n </file>\n </example>\n */\n 'radio': radioInputType,\n\n\n /**\n * @ngdoc input\n * @name input[checkbox]\n *\n * @description\n * HTML checkbox.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ngTrueValue The value to which the expression should be set when selected.\n * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"checkbox-input-directive\" module=\"checkboxExample\">\n <file name=\"index.html\">\n <script>\n angular.module('checkboxExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.checkboxModel = {\n value1 : true,\n value2 : 'YES'\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>Value1:\n <input type=\"checkbox\" ng-model=\"checkboxModel.value1\">\n </label><br/>\n <label>Value2:\n <input type=\"checkbox\" ng-model=\"checkboxModel.value2\"\n ng-true-value=\"'YES'\" ng-false-value=\"'NO'\">\n </label><br/>\n <tt>value1 = {{checkboxModel.value1}}</tt><br/>\n <tt>value2 = {{checkboxModel.value2}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should change state', function() {\n var value1 = element(by.binding('checkboxModel.value1'));\n var value2 = element(by.binding('checkboxModel.value2'));\n\n expect(value1.getText()).toContain('true');\n expect(value2.getText()).toContain('YES');\n\n element(by.model('checkboxModel.value1')).click();\n element(by.model('checkboxModel.value2')).click();\n\n expect(value1.getText()).toContain('false');\n expect(value2.getText()).toContain('NO');\n });\n </file>\n </example>\n */\n 'checkbox': checkboxInputType,\n\n 'hidden': noop,\n 'button': noop,\n 'submit': noop,\n 'reset': noop,\n 'file': noop\n};\n\nfunction stringBasedInputType(ctrl) {\n ctrl.$formatters.push(function(value) {\n return ctrl.$isEmpty(value) ? value : value.toString();\n });\n}\n\nfunction textInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n}\n\nfunction baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n var type = lowercase(element[0].type);\n\n // In composition mode, users are still inputing intermediate text buffer,\n // hold the listener until composition is done.\n // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent\n if (!$sniffer.android) {\n var composing = false;\n\n element.on('compositionstart', function(data) {\n composing = true;\n });\n\n element.on('compositionend', function() {\n composing = false;\n listener();\n });\n }\n\n var listener = function(ev) {\n if (timeout) {\n $browser.defer.cancel(timeout);\n timeout = null;\n }\n if (composing) return;\n var value = element.val(),\n event = ev && ev.type;\n\n // By default we will trim the value\n // If the attribute ng-trim exists we will avoid trimming\n // If input type is 'password', the value is never trimmed\n if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {\n value = trim(value);\n }\n\n // If a control is suffering from bad input (due to native validators), browsers discard its\n // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the\n // control's value is the same empty value twice in a row.\n if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {\n ctrl.$setViewValue(value, event);\n }\n };\n\n // if the browser does support \"input\" event, we are fine - except on IE9 which doesn't fire the\n // input event on backspace, delete or cut\n if ($sniffer.hasEvent('input')) {\n element.on('input', listener);\n } else {\n var timeout;\n\n var deferListener = function(ev, input, origValue) {\n if (!timeout) {\n timeout = $browser.defer(function() {\n timeout = null;\n if (!input || input.value !== origValue) {\n listener(ev);\n }\n });\n }\n };\n\n element.on('keydown', function(event) {\n var key = event.keyCode;\n\n // ignore\n // command modifiers arrows\n if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;\n\n deferListener(event, this, this.value);\n });\n\n // if user modifies input value using context menu in IE, we need \"paste\" and \"cut\" events to catch it\n if ($sniffer.hasEvent('paste')) {\n element.on('paste cut', deferListener);\n }\n }\n\n // if user paste into input using mouse on older browser\n // or form autocomplete on newer browser, we need \"change\" event to catch it\n element.on('change', listener);\n\n ctrl.$render = function() {\n // Workaround for Firefox validation #12102.\n var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;\n if (element.val() !== value) {\n element.val(value);\n }\n };\n}\n\nfunction weekParser(isoWeek, existingDate) {\n if (isDate(isoWeek)) {\n return isoWeek;\n }\n\n if (isString(isoWeek)) {\n WEEK_REGEXP.lastIndex = 0;\n var parts = WEEK_REGEXP.exec(isoWeek);\n if (parts) {\n var year = +parts[1],\n week = +parts[2],\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n firstThurs = getFirstThursdayOfYear(year),\n addDays = (week - 1) * 7;\n\n if (existingDate) {\n hours = existingDate.getHours();\n minutes = existingDate.getMinutes();\n seconds = existingDate.getSeconds();\n milliseconds = existingDate.getMilliseconds();\n }\n\n return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);\n }\n }\n\n return NaN;\n}\n\nfunction createDateParser(regexp, mapping) {\n return function(iso, date) {\n var parts, map;\n\n if (isDate(iso)) {\n return iso;\n }\n\n if (isString(iso)) {\n // When a date is JSON'ified to wraps itself inside of an extra\n // set of double quotes. This makes the date parsing code unable\n // to match the date string and parse it as a date.\n if (iso.charAt(0) == '\"' && iso.charAt(iso.length - 1) == '\"') {\n iso = iso.substring(1, iso.length - 1);\n }\n if (ISO_DATE_REGEXP.test(iso)) {\n return new Date(iso);\n }\n regexp.lastIndex = 0;\n parts = regexp.exec(iso);\n\n if (parts) {\n parts.shift();\n if (date) {\n map = {\n yyyy: date.getFullYear(),\n MM: date.getMonth() + 1,\n dd: date.getDate(),\n HH: date.getHours(),\n mm: date.getMinutes(),\n ss: date.getSeconds(),\n sss: date.getMilliseconds() / 1000\n };\n } else {\n map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };\n }\n\n forEach(parts, function(part, index) {\n if (index < mapping.length) {\n map[mapping[index]] = +part;\n }\n });\n return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);\n }\n }\n\n return NaN;\n };\n}\n\nfunction createDateInputType(type, regexp, parseDate, format) {\n return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {\n badInputChecker(scope, element, attr, ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n var timezone = ctrl && ctrl.$options && ctrl.$options.timezone;\n var previousDate;\n\n ctrl.$$parserName = type;\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n if (regexp.test(value)) {\n // Note: We cannot read ctrl.$modelValue, as there might be a different\n // parser/formatter in the processing chain so that the model\n // contains some different data format!\n var parsedDate = parseDate(value, previousDate);\n if (timezone) {\n parsedDate = convertTimezoneToLocal(parsedDate, timezone);\n }\n return parsedDate;\n }\n return undefined;\n });\n\n ctrl.$formatters.push(function(value) {\n if (value && !isDate(value)) {\n throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);\n }\n if (isValidDate(value)) {\n previousDate = value;\n if (previousDate && timezone) {\n previousDate = convertTimezoneToLocal(previousDate, timezone, true);\n }\n return $filter('date')(value, format, timezone);\n } else {\n previousDate = null;\n return '';\n }\n });\n\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal;\n ctrl.$validators.min = function(value) {\n return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;\n };\n attr.$observe('min', function(val) {\n minVal = parseObservedDateValue(val);\n ctrl.$validate();\n });\n }\n\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal;\n ctrl.$validators.max = function(value) {\n return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;\n };\n attr.$observe('max', function(val) {\n maxVal = parseObservedDateValue(val);\n ctrl.$validate();\n });\n }\n\n function isValidDate(value) {\n // Invalid Date: getTime() returns NaN\n return value && !(value.getTime && value.getTime() !== value.getTime());\n }\n\n function parseObservedDateValue(val) {\n return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val;\n }\n };\n}\n\nfunction badInputChecker(scope, element, attr, ctrl) {\n var node = element[0];\n var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);\n if (nativeValidation) {\n ctrl.$parsers.push(function(value) {\n var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};\n return validity.badInput || validity.typeMismatch ? undefined : value;\n });\n }\n}\n\nfunction numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n badInputChecker(scope, element, attr, ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n ctrl.$$parserName = 'number';\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n if (NUMBER_REGEXP.test(value)) return parseFloat(value);\n return undefined;\n });\n\n ctrl.$formatters.push(function(value) {\n if (!ctrl.$isEmpty(value)) {\n if (!isNumber(value)) {\n throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);\n }\n value = value.toString();\n }\n return value;\n });\n\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal;\n ctrl.$validators.min = function(value) {\n return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;\n };\n\n attr.$observe('min', function(val) {\n if (isDefined(val) && !isNumber(val)) {\n val = parseFloat(val, 10);\n }\n minVal = isNumber(val) && !isNaN(val) ? val : undefined;\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n });\n }\n\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal;\n ctrl.$validators.max = function(value) {\n return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;\n };\n\n attr.$observe('max', function(val) {\n if (isDefined(val) && !isNumber(val)) {\n val = parseFloat(val, 10);\n }\n maxVal = isNumber(val) && !isNaN(val) ? val : undefined;\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n });\n }\n}\n\nfunction urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n\n ctrl.$$parserName = 'url';\n ctrl.$validators.url = function(modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || URL_REGEXP.test(value);\n };\n}\n\nfunction emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n\n ctrl.$$parserName = 'email';\n ctrl.$validators.email = function(modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);\n };\n}\n\nfunction radioInputType(scope, element, attr, ctrl) {\n // make the name unique, if not defined\n if (isUndefined(attr.name)) {\n element.attr('name', nextUid());\n }\n\n var listener = function(ev) {\n if (element[0].checked) {\n ctrl.$setViewValue(attr.value, ev && ev.type);\n }\n };\n\n element.on('click', listener);\n\n ctrl.$render = function() {\n var value = attr.value;\n element[0].checked = (value == ctrl.$viewValue);\n };\n\n attr.$observe('value', ctrl.$render);\n}\n\nfunction parseConstantExpr($parse, context, name, expression, fallback) {\n var parseFn;\n if (isDefined(expression)) {\n parseFn = $parse(expression);\n if (!parseFn.constant) {\n throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' +\n '`{1}`.', name, expression);\n }\n return parseFn(context);\n }\n return fallback;\n}\n\nfunction checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);\n var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);\n\n var listener = function(ev) {\n ctrl.$setViewValue(element[0].checked, ev && ev.type);\n };\n\n element.on('click', listener);\n\n ctrl.$render = function() {\n element[0].checked = ctrl.$viewValue;\n };\n\n // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`\n // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert\n // it to a boolean.\n ctrl.$isEmpty = function(value) {\n return value === false;\n };\n\n ctrl.$formatters.push(function(value) {\n return equals(value, trueValue);\n });\n\n ctrl.$parsers.push(function(value) {\n return value ? trueValue : falseValue;\n });\n}\n\n\n/**\n * @ngdoc directive\n * @name textarea\n * @restrict E\n *\n * @description\n * HTML textarea element control with angular data-binding. The data-binding and validation\n * properties of this element are exactly the same as those of the\n * {@link ng.directive:input input element}.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n * length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n */\n\n\n/**\n * @ngdoc directive\n * @name input\n * @restrict E\n *\n * @description\n * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding,\n * input state control, and validation.\n * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Not every feature offered is available for all input types.\n * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`.\n * </div>\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {boolean=} ngRequired Sets `required` attribute if set to true\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n * length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * value does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n * This parameter is ignored for input[type=password] controls, which will never trim the\n * input.\n *\n * @example\n <example name=\"input-directive\" module=\"inputExample\">\n <file name=\"index.html\">\n <script>\n angular.module('inputExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.user = {name: 'guest', last: 'visitor'};\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <form name=\"myForm\">\n <label>\n User name:\n <input type=\"text\" name=\"userName\" ng-model=\"user.name\" required>\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.userName.$error.required\">\n Required!</span>\n </div>\n <label>\n Last name:\n <input type=\"text\" name=\"lastName\" ng-model=\"user.last\"\n ng-minlength=\"3\" ng-maxlength=\"10\">\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.lastName.$error.minlength\">\n Too short!</span>\n <span class=\"error\" ng-show=\"myForm.lastName.$error.maxlength\">\n Too long!</span>\n </div>\n </form>\n <hr>\n <tt>user = {{user}}</tt><br/>\n <tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br/>\n <tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br/>\n <tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br/>\n <tt>myForm.lastName.$error = {{myForm.lastName.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n <tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br/>\n <tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br/>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var user = element(by.exactBinding('user'));\n var userNameValid = element(by.binding('myForm.userName.$valid'));\n var lastNameValid = element(by.binding('myForm.lastName.$valid'));\n var lastNameError = element(by.binding('myForm.lastName.$error'));\n var formValid = element(by.binding('myForm.$valid'));\n var userNameInput = element(by.model('user.name'));\n var userLastInput = element(by.model('user.last'));\n\n it('should initialize to model', function() {\n expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"visitor\"}');\n expect(userNameValid.getText()).toContain('true');\n expect(formValid.getText()).toContain('true');\n });\n\n it('should be invalid if empty when required', function() {\n userNameInput.clear();\n userNameInput.sendKeys('');\n\n expect(user.getText()).toContain('{\"last\":\"visitor\"}');\n expect(userNameValid.getText()).toContain('false');\n expect(formValid.getText()).toContain('false');\n });\n\n it('should be valid if empty when min length is set', function() {\n userLastInput.clear();\n userLastInput.sendKeys('');\n\n expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"\"}');\n expect(lastNameValid.getText()).toContain('true');\n expect(formValid.getText()).toContain('true');\n });\n\n it('should be invalid if less than required min length', function() {\n userLastInput.clear();\n userLastInput.sendKeys('xx');\n\n expect(user.getText()).toContain('{\"name\":\"guest\"}');\n expect(lastNameValid.getText()).toContain('false');\n expect(lastNameError.getText()).toContain('minlength');\n expect(formValid.getText()).toContain('false');\n });\n\n it('should be invalid if longer than max length', function() {\n userLastInput.clear();\n userLastInput.sendKeys('some ridiculously long name');\n\n expect(user.getText()).toContain('{\"name\":\"guest\"}');\n expect(lastNameValid.getText()).toContain('false');\n expect(lastNameError.getText()).toContain('maxlength');\n expect(formValid.getText()).toContain('false');\n });\n </file>\n </example>\n */\nvar inputDirective = ['$browser', '$sniffer', '$filter', '$parse',\n function($browser, $sniffer, $filter, $parse) {\n return {\n restrict: 'E',\n require: ['?ngModel'],\n link: {\n pre: function(scope, element, attr, ctrls) {\n if (ctrls[0]) {\n (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,\n $browser, $filter, $parse);\n }\n }\n }\n };\n}];\n\n\n\nvar CONSTANT_VALUE_REGEXP = /^(true|false|\\d+)$/;\n/**\n * @ngdoc directive\n * @name ngValue\n *\n * @description\n * Binds the given expression to the value of `<option>` or {@link input[radio] `input[radio]`},\n * so that when the element is selected, the {@link ngModel `ngModel`} of that element is set to\n * the bound value.\n *\n * `ngValue` is useful when dynamically generating lists of radio buttons using\n * {@link ngRepeat `ngRepeat`}, as shown below.\n *\n * Likewise, `ngValue` can be used to generate `<option>` elements for\n * the {@link select `select`} element. In that case however, only strings are supported\n * for the `value `attribute, so the resulting `ngModel` will always be a string.\n * Support for `select` models with non-string values is available via `ngOptions`.\n *\n * @element input\n * @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute\n * of the `input` element\n *\n * @example\n <example name=\"ngValue-directive\" module=\"valueExample\">\n <file name=\"index.html\">\n <script>\n angular.module('valueExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.names = ['pizza', 'unicorns', 'robots'];\n $scope.my = { favorite: 'unicorns' };\n }]);\n </script>\n <form ng-controller=\"ExampleController\">\n <h2>Which is your favorite?</h2>\n <label ng-repeat=\"name in names\" for=\"{{name}}\">\n {{name}}\n <input type=\"radio\"\n ng-model=\"my.favorite\"\n ng-value=\"name\"\n id=\"{{name}}\"\n name=\"favorite\">\n </label>\n <div>You chose {{my.favorite}}</div>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var favorite = element(by.binding('my.favorite'));\n\n it('should initialize to model', function() {\n expect(favorite.getText()).toContain('unicorns');\n });\n it('should bind the values to the inputs', function() {\n element.all(by.model('my.favorite')).get(0).click();\n expect(favorite.getText()).toContain('pizza');\n });\n </file>\n </example>\n */\nvar ngValueDirective = function() {\n return {\n restrict: 'A',\n priority: 100,\n compile: function(tpl, tplAttr) {\n if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {\n return function ngValueConstantLink(scope, elm, attr) {\n attr.$set('value', scope.$eval(attr.ngValue));\n };\n } else {\n return function ngValueLink(scope, elm, attr) {\n scope.$watch(attr.ngValue, function valueWatchAction(value) {\n attr.$set('value', value);\n });\n };\n }\n }\n };\n};\n\n/**\n * @ngdoc directive\n * @name ngBind\n * @restrict AC\n *\n * @description\n * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element\n * with the value of a given expression, and to update the text content when the value of that\n * expression changes.\n *\n * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like\n * `{{ expression }}` which is similar but less verbose.\n *\n * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily\n * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an\n * element attribute, it makes the bindings invisible to the user while the page is loading.\n *\n * An alternative solution to this problem would be using the\n * {@link ng.directive:ngCloak ngCloak} directive.\n *\n *\n * @element ANY\n * @param {expression} ngBind {@link guide/expression Expression} to evaluate.\n *\n * @example\n * Enter a name in the Live Preview text box; the greeting below the text box changes instantly.\n <example module=\"bindExample\">\n <file name=\"index.html\">\n <script>\n angular.module('bindExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.name = 'Whirled';\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>Enter name: <input type=\"text\" ng-model=\"name\"></label><br>\n Hello <span ng-bind=\"name\"></span>!\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-bind', function() {\n var nameInput = element(by.model('name'));\n\n expect(element(by.binding('name')).getText()).toBe('Whirled');\n nameInput.clear();\n nameInput.sendKeys('world');\n expect(element(by.binding('name')).getText()).toBe('world');\n });\n </file>\n </example>\n */\nvar ngBindDirective = ['$compile', function($compile) {\n return {\n restrict: 'AC',\n compile: function ngBindCompile(templateElement) {\n $compile.$$addBindingClass(templateElement);\n return function ngBindLink(scope, element, attr) {\n $compile.$$addBindingInfo(element, attr.ngBind);\n element = element[0];\n scope.$watch(attr.ngBind, function ngBindWatchAction(value) {\n element.textContent = isUndefined(value) ? '' : value;\n });\n };\n }\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngBindTemplate\n *\n * @description\n * The `ngBindTemplate` directive specifies that the element\n * text content should be replaced with the interpolation of the template\n * in the `ngBindTemplate` attribute.\n * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}`\n * expressions. This directive is needed since some HTML elements\n * (such as TITLE and OPTION) cannot contain SPAN elements.\n *\n * @element ANY\n * @param {string} ngBindTemplate template of form\n * <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.\n *\n * @example\n * Try it here: enter text in text box and watch the greeting change.\n <example module=\"bindExample\">\n <file name=\"index.html\">\n <script>\n angular.module('bindExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.salutation = 'Hello';\n $scope.name = 'World';\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>Salutation: <input type=\"text\" ng-model=\"salutation\"></label><br>\n <label>Name: <input type=\"text\" ng-model=\"name\"></label><br>\n <pre ng-bind-template=\"{{salutation}} {{name}}!\"></pre>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-bind', function() {\n var salutationElem = element(by.binding('salutation'));\n var salutationInput = element(by.model('salutation'));\n var nameInput = element(by.model('name'));\n\n expect(salutationElem.getText()).toBe('Hello World!');\n\n salutationInput.clear();\n salutationInput.sendKeys('Greetings');\n nameInput.clear();\n nameInput.sendKeys('user');\n\n expect(salutationElem.getText()).toBe('Greetings user!');\n });\n </file>\n </example>\n */\nvar ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate, $compile) {\n return {\n compile: function ngBindTemplateCompile(templateElement) {\n $compile.$$addBindingClass(templateElement);\n return function ngBindTemplateLink(scope, element, attr) {\n var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));\n $compile.$$addBindingInfo(element, interpolateFn.expressions);\n element = element[0];\n attr.$observe('ngBindTemplate', function(value) {\n element.textContent = isUndefined(value) ? '' : value;\n });\n };\n }\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngBindHtml\n *\n * @description\n * Evaluates the expression and inserts the resulting HTML into the element in a secure way. By default,\n * the resulting HTML content will be sanitized using the {@link ngSanitize.$sanitize $sanitize} service.\n * To utilize this functionality, ensure that `$sanitize` is available, for example, by including {@link\n * ngSanitize} in your module's dependencies (not in core Angular). In order to use {@link ngSanitize}\n * in your module's dependencies, you need to include \"angular-sanitize.js\" in your application.\n *\n * You may also bypass sanitization for values you know are safe. To do so, bind to\n * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}. See the example\n * under {@link ng.$sce#show-me-an-example-using-sce- Strict Contextual Escaping (SCE)}.\n *\n * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you\n * will have an exception (instead of an exploit.)\n *\n * @element ANY\n * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate.\n *\n * @example\n\n <example module=\"bindHtmlExample\" deps=\"angular-sanitize.js\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <p ng-bind-html=\"myHTML\"></p>\n </div>\n </file>\n\n <file name=\"script.js\">\n angular.module('bindHtmlExample', ['ngSanitize'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.myHTML =\n 'I am an <code>HTML</code>string with ' +\n '<a href=\"#\">links!</a> and other <em>stuff</em>';\n }]);\n </file>\n\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-bind-html', function() {\n expect(element(by.binding('myHTML')).getText()).toBe(\n 'I am an HTMLstring with links! and other stuff');\n });\n </file>\n </example>\n */\nvar ngBindHtmlDirective = ['$sce', '$parse', '$compile', function($sce, $parse, $compile) {\n return {\n restrict: 'A',\n compile: function ngBindHtmlCompile(tElement, tAttrs) {\n var ngBindHtmlGetter = $parse(tAttrs.ngBindHtml);\n var ngBindHtmlWatch = $parse(tAttrs.ngBindHtml, function getStringValue(value) {\n return (value || '').toString();\n });\n $compile.$$addBindingClass(tElement);\n\n return function ngBindHtmlLink(scope, element, attr) {\n $compile.$$addBindingInfo(element, attr.ngBindHtml);\n\n scope.$watch(ngBindHtmlWatch, function ngBindHtmlWatchAction() {\n // we re-evaluate the expr because we want a TrustedValueHolderType\n // for $sce, not a string\n element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');\n });\n };\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngChange\n *\n * @description\n * Evaluate the given expression when the user changes the input.\n * The expression is evaluated immediately, unlike the JavaScript onchange event\n * which only triggers at the end of a change (usually, when the user leaves the\n * form element or presses the return key).\n *\n * The `ngChange` expression is only evaluated when a change in the input value causes\n * a new value to be committed to the model.\n *\n * It will not be evaluated:\n * * if the value returned from the `$parsers` transformation pipeline has not changed\n * * if the input has continued to be invalid since the model will stay `null`\n * * if the model is changed programmatically and not by a change to the input value\n *\n *\n * Note, this directive requires `ngModel` to be present.\n *\n * @element input\n * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change\n * in input value.\n *\n * @example\n * <example name=\"ngChange-directive\" module=\"changeExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('changeExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.counter = 0;\n * $scope.change = function() {\n * $scope.counter++;\n * };\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <input type=\"checkbox\" ng-model=\"confirmed\" ng-change=\"change()\" id=\"ng-change-example1\" />\n * <input type=\"checkbox\" ng-model=\"confirmed\" id=\"ng-change-example2\" />\n * <label for=\"ng-change-example2\">Confirmed</label><br />\n * <tt>debug = {{confirmed}}</tt><br/>\n * <tt>counter = {{counter}}</tt><br/>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * var counter = element(by.binding('counter'));\n * var debug = element(by.binding('confirmed'));\n *\n * it('should evaluate the expression if changing from view', function() {\n * expect(counter.getText()).toContain('0');\n *\n * element(by.id('ng-change-example1')).click();\n *\n * expect(counter.getText()).toContain('1');\n * expect(debug.getText()).toContain('true');\n * });\n *\n * it('should not evaluate the expression if changing from model', function() {\n * element(by.id('ng-change-example2')).click();\n\n * expect(counter.getText()).toContain('0');\n * expect(debug.getText()).toContain('true');\n * });\n * </file>\n * </example>\n */\nvar ngChangeDirective = valueFn({\n restrict: 'A',\n require: 'ngModel',\n link: function(scope, element, attr, ctrl) {\n ctrl.$viewChangeListeners.push(function() {\n scope.$eval(attr.ngChange);\n });\n }\n});\n\nfunction classDirective(name, selector) {\n name = 'ngClass' + name;\n return ['$animate', function($animate) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var oldVal;\n\n scope.$watch(attr[name], ngClassWatchAction, true);\n\n attr.$observe('class', function(value) {\n ngClassWatchAction(scope.$eval(attr[name]));\n });\n\n\n if (name !== 'ngClass') {\n scope.$watch('$index', function($index, old$index) {\n // jshint bitwise: false\n var mod = $index & 1;\n if (mod !== (old$index & 1)) {\n var classes = arrayClasses(scope.$eval(attr[name]));\n mod === selector ?\n addClasses(classes) :\n removeClasses(classes);\n }\n });\n }\n\n function addClasses(classes) {\n var newClasses = digestClassCounts(classes, 1);\n attr.$addClass(newClasses);\n }\n\n function removeClasses(classes) {\n var newClasses = digestClassCounts(classes, -1);\n attr.$removeClass(newClasses);\n }\n\n function digestClassCounts(classes, count) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n var classCounts = element.data('$classCounts') || createMap();\n var classesToUpdate = [];\n forEach(classes, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n element.data('$classCounts', classCounts);\n return classesToUpdate.join(' ');\n }\n\n function updateClasses(oldClasses, newClasses) {\n var toAdd = arrayDifference(newClasses, oldClasses);\n var toRemove = arrayDifference(oldClasses, newClasses);\n toAdd = digestClassCounts(toAdd, 1);\n toRemove = digestClassCounts(toRemove, -1);\n if (toAdd && toAdd.length) {\n $animate.addClass(element, toAdd);\n }\n if (toRemove && toRemove.length) {\n $animate.removeClass(element, toRemove);\n }\n }\n\n function ngClassWatchAction(newVal) {\n if (selector === true || scope.$index % 2 === selector) {\n var newClasses = arrayClasses(newVal || []);\n if (!oldVal) {\n addClasses(newClasses);\n } else if (!equals(newVal,oldVal)) {\n var oldClasses = arrayClasses(oldVal);\n updateClasses(oldClasses, newClasses);\n }\n }\n oldVal = shallowCopy(newVal);\n }\n }\n };\n\n function arrayDifference(tokens1, tokens2) {\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token == tokens2[j]) continue outer;\n }\n values.push(token);\n }\n return values;\n }\n\n function arrayClasses(classVal) {\n var classes = [];\n if (isArray(classVal)) {\n forEach(classVal, function(v) {\n classes = classes.concat(arrayClasses(v));\n });\n return classes;\n } else if (isString(classVal)) {\n return classVal.split(' ');\n } else if (isObject(classVal)) {\n forEach(classVal, function(v, k) {\n if (v) {\n classes = classes.concat(k.split(' '));\n }\n });\n return classes;\n }\n return classVal;\n }\n }];\n}\n\n/**\n * @ngdoc directive\n * @name ngClass\n * @restrict AC\n *\n * @description\n * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding\n * an expression that represents all classes to be added.\n *\n * The directive operates in three different ways, depending on which of three types the expression\n * evaluates to:\n *\n * 1. If the expression evaluates to a string, the string should be one or more space-delimited class\n * names.\n *\n * 2. If the expression evaluates to an object, then for each key-value pair of the\n * object with a truthy value the corresponding key is used as a class name.\n *\n * 3. If the expression evaluates to an array, each element of the array should either be a string as in\n * type 1 or an object as in type 2. This means that you can mix strings and objects together in an array\n * to give you more control over what CSS classes appear. See the code below for an example of this.\n *\n *\n * The directive won't add duplicate classes if a particular class was already set.\n *\n * When the expression changes, the previously added classes are removed and only then are the\n * new classes added.\n *\n * @animations\n * **add** - happens just before the class is applied to the elements\n *\n * **remove** - happens just before the class is removed from the element\n *\n * @element ANY\n * @param {expression} ngClass {@link guide/expression Expression} to eval. The result\n * of the evaluation can be a string representing space delimited class\n * names, an array, or a map of class names to boolean values. In the case of a map, the\n * names of the properties whose values are truthy will be added as css classes to the\n * element.\n *\n * @example Example that demonstrates basic bindings via ngClass directive.\n <example>\n <file name=\"index.html\">\n <p ng-class=\"{strike: deleted, bold: important, 'has-error': error}\">Map Syntax Example</p>\n <label>\n <input type=\"checkbox\" ng-model=\"deleted\">\n deleted (apply \"strike\" class)\n </label><br>\n <label>\n <input type=\"checkbox\" ng-model=\"important\">\n important (apply \"bold\" class)\n </label><br>\n <label>\n <input type=\"checkbox\" ng-model=\"error\">\n error (apply \"has-error\" class)\n </label>\n <hr>\n <p ng-class=\"style\">Using String Syntax</p>\n <input type=\"text\" ng-model=\"style\"\n placeholder=\"Type: bold strike red\" aria-label=\"Type: bold strike red\">\n <hr>\n <p ng-class=\"[style1, style2, style3]\">Using Array Syntax</p>\n <input ng-model=\"style1\"\n placeholder=\"Type: bold, strike or red\" aria-label=\"Type: bold, strike or red\"><br>\n <input ng-model=\"style2\"\n placeholder=\"Type: bold, strike or red\" aria-label=\"Type: bold, strike or red 2\"><br>\n <input ng-model=\"style3\"\n placeholder=\"Type: bold, strike or red\" aria-label=\"Type: bold, strike or red 3\"><br>\n <hr>\n <p ng-class=\"[style4, {orange: warning}]\">Using Array and Map Syntax</p>\n <input ng-model=\"style4\" placeholder=\"Type: bold, strike\" aria-label=\"Type: bold, strike\"><br>\n <label><input type=\"checkbox\" ng-model=\"warning\"> warning (apply \"orange\" class)</label>\n </file>\n <file name=\"style.css\">\n .strike {\n text-decoration: line-through;\n }\n .bold {\n font-weight: bold;\n }\n .red {\n color: red;\n }\n .has-error {\n color: red;\n background-color: yellow;\n }\n .orange {\n color: orange;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var ps = element.all(by.css('p'));\n\n it('should let you toggle the class', function() {\n\n expect(ps.first().getAttribute('class')).not.toMatch(/bold/);\n expect(ps.first().getAttribute('class')).not.toMatch(/has-error/);\n\n element(by.model('important')).click();\n expect(ps.first().getAttribute('class')).toMatch(/bold/);\n\n element(by.model('error')).click();\n expect(ps.first().getAttribute('class')).toMatch(/has-error/);\n });\n\n it('should let you toggle string example', function() {\n expect(ps.get(1).getAttribute('class')).toBe('');\n element(by.model('style')).clear();\n element(by.model('style')).sendKeys('red');\n expect(ps.get(1).getAttribute('class')).toBe('red');\n });\n\n it('array example should have 3 classes', function() {\n expect(ps.get(2).getAttribute('class')).toBe('');\n element(by.model('style1')).sendKeys('bold');\n element(by.model('style2')).sendKeys('strike');\n element(by.model('style3')).sendKeys('red');\n expect(ps.get(2).getAttribute('class')).toBe('bold strike red');\n });\n\n it('array with map example should have 2 classes', function() {\n expect(ps.last().getAttribute('class')).toBe('');\n element(by.model('style4')).sendKeys('bold');\n element(by.model('warning')).click();\n expect(ps.last().getAttribute('class')).toBe('bold orange');\n });\n </file>\n </example>\n\n ## Animations\n\n The example below demonstrates how to perform animations using ngClass.\n\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n <input id=\"setbtn\" type=\"button\" value=\"set\" ng-click=\"myVar='my-class'\">\n <input id=\"clearbtn\" type=\"button\" value=\"clear\" ng-click=\"myVar=''\">\n <br>\n <span class=\"base-class\" ng-class=\"myVar\">Sample Text</span>\n </file>\n <file name=\"style.css\">\n .base-class {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n }\n\n .base-class.my-class {\n color: red;\n font-size:3em;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-class', function() {\n expect(element(by.css('.base-class')).getAttribute('class')).not.\n toMatch(/my-class/);\n\n element(by.id('setbtn')).click();\n\n expect(element(by.css('.base-class')).getAttribute('class')).\n toMatch(/my-class/);\n\n element(by.id('clearbtn')).click();\n\n expect(element(by.css('.base-class')).getAttribute('class')).not.\n toMatch(/my-class/);\n });\n </file>\n </example>\n\n\n ## ngClass and pre-existing CSS3 Transitions/Animations\n The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.\n Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder\n any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure\n to view the step by step details of {@link $animate#addClass $animate.addClass} and\n {@link $animate#removeClass $animate.removeClass}.\n */\nvar ngClassDirective = classDirective('', true);\n\n/**\n * @ngdoc directive\n * @name ngClassOdd\n * @restrict AC\n *\n * @description\n * The `ngClassOdd` and `ngClassEven` directives work exactly as\n * {@link ng.directive:ngClass ngClass}, except they work in\n * conjunction with `ngRepeat` and take effect only on odd (even) rows.\n *\n * This directive can be applied only within the scope of an\n * {@link ng.directive:ngRepeat ngRepeat}.\n *\n * @element ANY\n * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result\n * of the evaluation can be a string representing space delimited class names or an array.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <ol ng-init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n <li ng-repeat=\"name in names\">\n <span ng-class-odd=\"'odd'\" ng-class-even=\"'even'\">\n {{name}}\n </span>\n </li>\n </ol>\n </file>\n <file name=\"style.css\">\n .odd {\n color: red;\n }\n .even {\n color: blue;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-class-odd and ng-class-even', function() {\n expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).\n toMatch(/odd/);\n expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).\n toMatch(/even/);\n });\n </file>\n </example>\n */\nvar ngClassOddDirective = classDirective('Odd', 0);\n\n/**\n * @ngdoc directive\n * @name ngClassEven\n * @restrict AC\n *\n * @description\n * The `ngClassOdd` and `ngClassEven` directives work exactly as\n * {@link ng.directive:ngClass ngClass}, except they work in\n * conjunction with `ngRepeat` and take effect only on odd (even) rows.\n *\n * This directive can be applied only within the scope of an\n * {@link ng.directive:ngRepeat ngRepeat}.\n *\n * @element ANY\n * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The\n * result of the evaluation can be a string representing space delimited class names or an array.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <ol ng-init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n <li ng-repeat=\"name in names\">\n <span ng-class-odd=\"'odd'\" ng-class-even=\"'even'\">\n {{name}} \n </span>\n </li>\n </ol>\n </file>\n <file name=\"style.css\">\n .odd {\n color: red;\n }\n .even {\n color: blue;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-class-odd and ng-class-even', function() {\n expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).\n toMatch(/odd/);\n expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).\n toMatch(/even/);\n });\n </file>\n </example>\n */\nvar ngClassEvenDirective = classDirective('Even', 1);\n\n/**\n * @ngdoc directive\n * @name ngCloak\n * @restrict AC\n *\n * @description\n * The `ngCloak` directive is used to prevent the Angular html template from being briefly\n * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this\n * directive to avoid the undesirable flicker effect caused by the html template display.\n *\n * The directive can be applied to the `<body>` element, but the preferred usage is to apply\n * multiple `ngCloak` directives to small portions of the page to permit progressive rendering\n * of the browser view.\n *\n * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and\n * `angular.min.js`.\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```css\n * [ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {\n * display: none !important;\n * }\n * ```\n *\n * When this css rule is loaded by the browser, all html elements (including their children) that\n * are tagged with the `ngCloak` directive are hidden. When Angular encounters this directive\n * during the compilation of the template it deletes the `ngCloak` element attribute, making\n * the compiled element visible.\n *\n * For the best result, the `angular.js` script must be loaded in the head section of the html\n * document; alternatively, the css rule above must be included in the external stylesheet of the\n * application.\n *\n * @element ANY\n *\n * @example\n <example>\n <file name=\"index.html\">\n <div id=\"template1\" ng-cloak>{{ 'hello' }}</div>\n <div id=\"template2\" class=\"ng-cloak\">{{ 'world' }}</div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should remove the template directive and css class', function() {\n expect($('#template1').getAttribute('ng-cloak')).\n toBeNull();\n expect($('#template2').getAttribute('ng-cloak')).\n toBeNull();\n });\n </file>\n </example>\n *\n */\nvar ngCloakDirective = ngDirective({\n compile: function(element, attr) {\n attr.$set('ngCloak', undefined);\n element.removeClass('ng-cloak');\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngController\n *\n * @description\n * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular\n * supports the principles behind the Model-View-Controller design pattern.\n *\n * MVC components in angular:\n *\n * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties\n * are accessed through bindings.\n * * View — The template (HTML with data bindings) that is rendered into the View.\n * * Controller — The `ngController` directive specifies a Controller class; the class contains business\n * logic behind the application to decorate the scope with functions and values\n *\n * Note that you can also attach controllers to the DOM by declaring it in a route definition\n * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller\n * again using `ng-controller` in the template itself. This will cause the controller to be attached\n * and executed twice.\n *\n * @element ANY\n * @scope\n * @priority 500\n * @param {expression} ngController Name of a constructor function registered with the current\n * {@link ng.$controllerProvider $controllerProvider} or an {@link guide/expression expression}\n * that on the current scope evaluates to a constructor function.\n *\n * The controller instance can be published into a scope property by specifying\n * `ng-controller=\"as propertyName\"`.\n *\n * If the current `$controllerProvider` is configured to use globals (via\n * {@link ng.$controllerProvider#allowGlobals `$controllerProvider.allowGlobals()` }), this may\n * also be the name of a globally accessible constructor function (not recommended).\n *\n * @example\n * Here is a simple form for editing user contact information. Adding, removing, clearing, and\n * greeting are methods declared on the controller (see source tab). These methods can\n * easily be called from the angular markup. Any changes to the data are automatically reflected\n * in the View without the need for a manual update.\n *\n * Two different declaration styles are included below:\n *\n * * one binds methods and properties directly onto the controller using `this`:\n * `ng-controller=\"SettingsController1 as settings\"`\n * * one injects `$scope` into the controller:\n * `ng-controller=\"SettingsController2\"`\n *\n * The second option is more common in the Angular community, and is generally used in boilerplates\n * and in this guide. However, there are advantages to binding properties directly to the controller\n * and avoiding scope.\n *\n * * Using `controller as` makes it obvious which controller you are accessing in the template when\n * multiple controllers apply to an element.\n * * If you are writing your controllers as classes you have easier access to the properties and\n * methods, which will appear on the scope, from inside the controller code.\n * * Since there is always a `.` in the bindings, you don't have to worry about prototypal\n * inheritance masking primitives.\n *\n * This example demonstrates the `controller as` syntax.\n *\n * <example name=\"ngControllerAs\" module=\"controllerAsExample\">\n * <file name=\"index.html\">\n * <div id=\"ctrl-as-exmpl\" ng-controller=\"SettingsController1 as settings\">\n * <label>Name: <input type=\"text\" ng-model=\"settings.name\"/></label>\n * <button ng-click=\"settings.greet()\">greet</button><br/>\n * Contact:\n * <ul>\n * <li ng-repeat=\"contact in settings.contacts\">\n * <select ng-model=\"contact.type\" aria-label=\"Contact method\" id=\"select_{{$index}}\">\n * <option>phone</option>\n * <option>email</option>\n * </select>\n * <input type=\"text\" ng-model=\"contact.value\" aria-labelledby=\"select_{{$index}}\" />\n * <button ng-click=\"settings.clearContact(contact)\">clear</button>\n * <button ng-click=\"settings.removeContact(contact)\" aria-label=\"Remove\">X</button>\n * </li>\n * <li><button ng-click=\"settings.addContact()\">add</button></li>\n * </ul>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('controllerAsExample', [])\n * .controller('SettingsController1', SettingsController1);\n *\n * function SettingsController1() {\n * this.name = \"John Smith\";\n * this.contacts = [\n * {type: 'phone', value: '408 555 1212'},\n * {type: 'email', value: 'john.smith@example.org'} ];\n * }\n *\n * SettingsController1.prototype.greet = function() {\n * alert(this.name);\n * };\n *\n * SettingsController1.prototype.addContact = function() {\n * this.contacts.push({type: 'email', value: 'yourname@example.org'});\n * };\n *\n * SettingsController1.prototype.removeContact = function(contactToRemove) {\n * var index = this.contacts.indexOf(contactToRemove);\n * this.contacts.splice(index, 1);\n * };\n *\n * SettingsController1.prototype.clearContact = function(contact) {\n * contact.type = 'phone';\n * contact.value = '';\n * };\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should check controller as', function() {\n * var container = element(by.id('ctrl-as-exmpl'));\n * expect(container.element(by.model('settings.name'))\n * .getAttribute('value')).toBe('John Smith');\n *\n * var firstRepeat =\n * container.element(by.repeater('contact in settings.contacts').row(0));\n * var secondRepeat =\n * container.element(by.repeater('contact in settings.contacts').row(1));\n *\n * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('408 555 1212');\n *\n * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('john.smith@example.org');\n *\n * firstRepeat.element(by.buttonText('clear')).click();\n *\n * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('');\n *\n * container.element(by.buttonText('add')).click();\n *\n * expect(container.element(by.repeater('contact in settings.contacts').row(2))\n * .element(by.model('contact.value'))\n * .getAttribute('value'))\n * .toBe('yourname@example.org');\n * });\n * </file>\n * </example>\n *\n * This example demonstrates the \"attach to `$scope`\" style of controller.\n *\n * <example name=\"ngController\" module=\"controllerExample\">\n * <file name=\"index.html\">\n * <div id=\"ctrl-exmpl\" ng-controller=\"SettingsController2\">\n * <label>Name: <input type=\"text\" ng-model=\"name\"/></label>\n * <button ng-click=\"greet()\">greet</button><br/>\n * Contact:\n * <ul>\n * <li ng-repeat=\"contact in contacts\">\n * <select ng-model=\"contact.type\" id=\"select_{{$index}}\">\n * <option>phone</option>\n * <option>email</option>\n * </select>\n * <input type=\"text\" ng-model=\"contact.value\" aria-labelledby=\"select_{{$index}}\" />\n * <button ng-click=\"clearContact(contact)\">clear</button>\n * <button ng-click=\"removeContact(contact)\">X</button>\n * </li>\n * <li>[ <button ng-click=\"addContact()\">add</button> ]</li>\n * </ul>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('controllerExample', [])\n * .controller('SettingsController2', ['$scope', SettingsController2]);\n *\n * function SettingsController2($scope) {\n * $scope.name = \"John Smith\";\n * $scope.contacts = [\n * {type:'phone', value:'408 555 1212'},\n * {type:'email', value:'john.smith@example.org'} ];\n *\n * $scope.greet = function() {\n * alert($scope.name);\n * };\n *\n * $scope.addContact = function() {\n * $scope.contacts.push({type:'email', value:'yourname@example.org'});\n * };\n *\n * $scope.removeContact = function(contactToRemove) {\n * var index = $scope.contacts.indexOf(contactToRemove);\n * $scope.contacts.splice(index, 1);\n * };\n *\n * $scope.clearContact = function(contact) {\n * contact.type = 'phone';\n * contact.value = '';\n * };\n * }\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should check controller', function() {\n * var container = element(by.id('ctrl-exmpl'));\n *\n * expect(container.element(by.model('name'))\n * .getAttribute('value')).toBe('John Smith');\n *\n * var firstRepeat =\n * container.element(by.repeater('contact in contacts').row(0));\n * var secondRepeat =\n * container.element(by.repeater('contact in contacts').row(1));\n *\n * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('408 555 1212');\n * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('john.smith@example.org');\n *\n * firstRepeat.element(by.buttonText('clear')).click();\n *\n * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('');\n *\n * container.element(by.buttonText('add')).click();\n *\n * expect(container.element(by.repeater('contact in contacts').row(2))\n * .element(by.model('contact.value'))\n * .getAttribute('value'))\n * .toBe('yourname@example.org');\n * });\n * </file>\n *</example>\n\n */\nvar ngControllerDirective = [function() {\n return {\n restrict: 'A',\n scope: true,\n controller: '@',\n priority: 500\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngCsp\n *\n * @element html\n * @description\n *\n * Angular has some features that can break certain\n * [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) rules.\n *\n * If you intend to implement these rules then you must tell Angular not to use these features.\n *\n * This is necessary when developing things like Google Chrome Extensions or Universal Windows Apps.\n *\n *\n * The following rules affect Angular:\n *\n * * `unsafe-eval`: this rule forbids apps to use `eval` or `Function(string)` generated functions\n * (among other things). Angular makes use of this in the {@link $parse} service to provide a 30%\n * increase in the speed of evaluating Angular expressions.\n *\n * * `unsafe-inline`: this rule forbids apps from inject custom styles into the document. Angular\n * makes use of this to include some CSS rules (e.g. {@link ngCloak} and {@link ngHide}).\n * To make these directives work when a CSP rule is blocking inline styles, you must link to the\n * `angular-csp.css` in your HTML manually.\n *\n * If you do not provide `ngCsp` then Angular tries to autodetect if CSP is blocking unsafe-eval\n * and automatically deactivates this feature in the {@link $parse} service. This autodetection,\n * however, triggers a CSP error to be logged in the console:\n *\n * ```\n * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of\n * script in the following Content Security Policy directive: \"default-src 'self'\". Note that\n * 'script-src' was not explicitly set, so 'default-src' is used as a fallback.\n * ```\n *\n * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp`\n * directive on an element of the HTML document that appears before the `<script>` tag that loads\n * the `angular.js` file.\n *\n * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.*\n *\n * You can specify which of the CSP related Angular features should be deactivated by providing\n * a value for the `ng-csp` attribute. The options are as follows:\n *\n * * no-inline-style: this stops Angular from injecting CSS styles into the DOM\n *\n * * no-unsafe-eval: this stops Angular from optimizing $parse with unsafe eval of strings\n *\n * You can use these values in the following combinations:\n *\n *\n * * No declaration means that Angular will assume that you can do inline styles, but it will do\n * a runtime check for unsafe-eval. E.g. `<body>`. This is backwardly compatible with previous versions\n * of Angular.\n *\n * * A simple `ng-csp` (or `data-ng-csp`) attribute will tell Angular to deactivate both inline\n * styles and unsafe eval. E.g. `<body ng-csp>`. This is backwardly compatible with previous versions\n * of Angular.\n *\n * * Specifying only `no-unsafe-eval` tells Angular that we must not use eval, but that we can inject\n * inline styles. E.g. `<body ng-csp=\"no-unsafe-eval\">`.\n *\n * * Specifying only `no-inline-style` tells Angular that we must not inject styles, but that we can\n * run eval - no automatic check for unsafe eval will occur. E.g. `<body ng-csp=\"no-inline-style\">`\n *\n * * Specifying both `no-unsafe-eval` and `no-inline-style` tells Angular that we must not inject\n * styles nor use eval, which is the same as an empty: ng-csp.\n * E.g.`<body ng-csp=\"no-inline-style;no-unsafe-eval\">`\n *\n * @example\n * This example shows how to apply the `ngCsp` directive to the `html` tag.\n ```html\n <!doctype html>\n <html ng-app ng-csp>\n ...\n ...\n </html>\n ```\n * @example\n // Note: the suffix `.csp` in the example name triggers\n // csp mode in our http server!\n <example name=\"example.csp\" module=\"cspExample\" ng-csp=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"MainController as ctrl\">\n <div>\n <button ng-click=\"ctrl.inc()\" id=\"inc\">Increment</button>\n <span id=\"counter\">\n {{ctrl.counter}}\n </span>\n </div>\n\n <div>\n <button ng-click=\"ctrl.evil()\" id=\"evil\">Evil</button>\n <span id=\"evilError\">\n {{ctrl.evilError}}\n </span>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('cspExample', [])\n .controller('MainController', function() {\n this.counter = 0;\n this.inc = function() {\n this.counter++;\n };\n this.evil = function() {\n // jshint evil:true\n try {\n eval('1+2');\n } catch (e) {\n this.evilError = e.message;\n }\n };\n });\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var util, webdriver;\n\n var incBtn = element(by.id('inc'));\n var counter = element(by.id('counter'));\n var evilBtn = element(by.id('evil'));\n var evilError = element(by.id('evilError'));\n\n function getAndClearSevereErrors() {\n return browser.manage().logs().get('browser').then(function(browserLog) {\n return browserLog.filter(function(logEntry) {\n return logEntry.level.value > webdriver.logging.Level.WARNING.value;\n });\n });\n }\n\n function clearErrors() {\n getAndClearSevereErrors();\n }\n\n function expectNoErrors() {\n getAndClearSevereErrors().then(function(filteredLog) {\n expect(filteredLog.length).toEqual(0);\n if (filteredLog.length) {\n console.log('browser console errors: ' + util.inspect(filteredLog));\n }\n });\n }\n\n function expectError(regex) {\n getAndClearSevereErrors().then(function(filteredLog) {\n var found = false;\n filteredLog.forEach(function(log) {\n if (log.message.match(regex)) {\n found = true;\n }\n });\n if (!found) {\n throw new Error('expected an error that matches ' + regex);\n }\n });\n }\n\n beforeEach(function() {\n util = require('util');\n webdriver = require('protractor/node_modules/selenium-webdriver');\n });\n\n // For now, we only test on Chrome,\n // as Safari does not load the page with Protractor's injected scripts,\n // and Firefox webdriver always disables content security policy (#6358)\n if (browser.params.browser !== 'chrome') {\n return;\n }\n\n it('should not report errors when the page is loaded', function() {\n // clear errors so we are not dependent on previous tests\n clearErrors();\n // Need to reload the page as the page is already loaded when\n // we come here\n browser.driver.getCurrentUrl().then(function(url) {\n browser.get(url);\n });\n expectNoErrors();\n });\n\n it('should evaluate expressions', function() {\n expect(counter.getText()).toEqual('0');\n incBtn.click();\n expect(counter.getText()).toEqual('1');\n expectNoErrors();\n });\n\n it('should throw and report an error when using \"eval\"', function() {\n evilBtn.click();\n expect(evilError.getText()).toMatch(/Content Security Policy/);\n expectError(/Content Security Policy/);\n });\n </file>\n </example>\n */\n\n// ngCsp is not implemented as a proper directive any more, because we need it be processed while we\n// bootstrap the system (before $parse is instantiated), for this reason we just have\n// the csp() fn that looks for the `ng-csp` attribute anywhere in the current doc\n\n/**\n * @ngdoc directive\n * @name ngClick\n *\n * @description\n * The ngClick directive allows you to specify custom behavior when\n * an element is clicked.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon\n * click. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <button ng-click=\"count = count + 1\" ng-init=\"count=0\">\n Increment\n </button>\n <span>\n count: {{count}}\n </span>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-click', function() {\n expect(element(by.binding('count')).getText()).toMatch('0');\n element(by.css('button')).click();\n expect(element(by.binding('count')).getText()).toMatch('1');\n });\n </file>\n </example>\n */\n/*\n * A collection of directives that allows creation of custom event handlers that are defined as\n * angular expressions and are compiled and executed within the current scope.\n */\nvar ngEventDirectives = {};\n\n// For events that might fire synchronously during DOM manipulation\n// we need to execute their event handlers asynchronously using $evalAsync,\n// so that they are not executed in an inconsistent state.\nvar forceAsyncEvents = {\n 'blur': true,\n 'focus': true\n};\nforEach(\n 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),\n function(eventName) {\n var directiveName = directiveNormalize('ng-' + eventName);\n ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {\n return {\n restrict: 'A',\n compile: function($element, attr) {\n // We expose the powerful $event object on the scope that provides access to the Window,\n // etc. that isn't protected by the fast paths in $parse. We explicitly request better\n // checks at the cost of speed since event handler expressions are not executed as\n // frequently as regular change detection.\n var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true);\n return function ngEventHandler(scope, element) {\n element.on(eventName, function(event) {\n var callback = function() {\n fn(scope, {$event:event});\n };\n if (forceAsyncEvents[eventName] && $rootScope.$$phase) {\n scope.$evalAsync(callback);\n } else {\n scope.$apply(callback);\n }\n });\n };\n }\n };\n }];\n }\n);\n\n/**\n * @ngdoc directive\n * @name ngDblclick\n *\n * @description\n * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon\n * a dblclick. (The Event object is available as `$event`)\n *\n * @example\n <example>\n <file name=\"index.html\">\n <button ng-dblclick=\"count = count + 1\" ng-init=\"count=0\">\n Increment (on double click)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMousedown\n *\n * @description\n * The ngMousedown directive allows you to specify custom behavior on mousedown event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon\n * mousedown. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <button ng-mousedown=\"count = count + 1\" ng-init=\"count=0\">\n Increment (on mouse down)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseup\n *\n * @description\n * Specify custom behavior on mouseup event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon\n * mouseup. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <button ng-mouseup=\"count = count + 1\" ng-init=\"count=0\">\n Increment (on mouse up)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngMouseover\n *\n * @description\n * Specify custom behavior on mouseover event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon\n * mouseover. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <button ng-mouseover=\"count = count + 1\" ng-init=\"count=0\">\n Increment (when mouse is over)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseenter\n *\n * @description\n * Specify custom behavior on mouseenter event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon\n * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <button ng-mouseenter=\"count = count + 1\" ng-init=\"count=0\">\n Increment (when mouse enters)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseleave\n *\n * @description\n * Specify custom behavior on mouseleave event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon\n * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <button ng-mouseleave=\"count = count + 1\" ng-init=\"count=0\">\n Increment (when mouse leaves)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMousemove\n *\n * @description\n * Specify custom behavior on mousemove event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon\n * mousemove. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <button ng-mousemove=\"count = count + 1\" ng-init=\"count=0\">\n Increment (when mouse moves)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeydown\n *\n * @description\n * Specify custom behavior on keydown event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon\n * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n <example>\n <file name=\"index.html\">\n <input ng-keydown=\"count = count + 1\" ng-init=\"count=0\">\n key down count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeyup\n *\n * @description\n * Specify custom behavior on keyup event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon\n * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n <example>\n <file name=\"index.html\">\n <p>Typing in the input box below updates the key count</p>\n <input ng-keyup=\"count = count + 1\" ng-init=\"count=0\"> key up count: {{count}}\n\n <p>Typing in the input box below updates the keycode</p>\n <input ng-keyup=\"event=$event\">\n <p>event keyCode: {{ event.keyCode }}</p>\n <p>event altKey: {{ event.altKey }}</p>\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeypress\n *\n * @description\n * Specify custom behavior on keypress event.\n *\n * @element ANY\n * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon\n * keypress. ({@link guide/expression#-event- Event object is available as `$event`}\n * and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n <example>\n <file name=\"index.html\">\n <input ng-keypress=\"count = count + 1\" ng-init=\"count=0\">\n key press count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSubmit\n *\n * @description\n * Enables binding angular expressions to onsubmit events.\n *\n * Additionally it prevents the default action (which for form means sending the request to the\n * server and reloading the current page), but only if the form does not contain `action`,\n * `data-action`, or `x-action` attributes.\n *\n * <div class=\"alert alert-warning\">\n * **Warning:** Be careful not to cause \"double-submission\" by using both the `ngClick` and\n * `ngSubmit` handlers together. See the\n * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation}\n * for a detailed discussion of when `ngSubmit` may be triggered.\n * </div>\n *\n * @element form\n * @priority 0\n * @param {expression} ngSubmit {@link guide/expression Expression} to eval.\n * ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example module=\"submitExample\">\n <file name=\"index.html\">\n <script>\n angular.module('submitExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.list = [];\n $scope.text = 'hello';\n $scope.submit = function() {\n if ($scope.text) {\n $scope.list.push(this.text);\n $scope.text = '';\n }\n };\n }]);\n </script>\n <form ng-submit=\"submit()\" ng-controller=\"ExampleController\">\n Enter text and hit enter:\n <input type=\"text\" ng-model=\"text\" name=\"text\" />\n <input type=\"submit\" id=\"submit\" value=\"Submit\" />\n <pre>list={{list}}</pre>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-submit', function() {\n expect(element(by.binding('list')).getText()).toBe('list=[]');\n element(by.css('#submit')).click();\n expect(element(by.binding('list')).getText()).toContain('hello');\n expect(element(by.model('text')).getAttribute('value')).toBe('');\n });\n it('should ignore empty strings', function() {\n expect(element(by.binding('list')).getText()).toBe('list=[]');\n element(by.css('#submit')).click();\n element(by.css('#submit')).click();\n expect(element(by.binding('list')).getText()).toContain('hello');\n });\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngFocus\n *\n * @description\n * Specify custom behavior on focus event.\n *\n * Note: As the `focus` event is executed synchronously when calling `input.focus()`\n * AngularJS executes the expression using `scope.$evalAsync` if the event is fired\n * during an `$apply` to ensure a consistent state.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon\n * focus. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ngBlur\n *\n * @description\n * Specify custom behavior on blur event.\n *\n * A [blur event](https://developer.mozilla.org/en-US/docs/Web/Events/blur) fires when\n * an element has lost focus.\n *\n * Note: As the `blur` event is executed synchronously also during DOM manipulations\n * (e.g. removing a focussed input),\n * AngularJS executes the expression using `scope.$evalAsync` if the event is fired\n * during an `$apply` to ensure a consistent state.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon\n * blur. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ngCopy\n *\n * @description\n * Specify custom behavior on copy event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon\n * copy. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <input ng-copy=\"copied=true\" ng-init=\"copied=false; value='copy me'\" ng-model=\"value\">\n copied: {{copied}}\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngCut\n *\n * @description\n * Specify custom behavior on cut event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon\n * cut. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <input ng-cut=\"cut=true\" ng-init=\"cut=false; value='cut me'\" ng-model=\"value\">\n cut: {{cut}}\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngPaste\n *\n * @description\n * Specify custom behavior on paste event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon\n * paste. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example>\n <file name=\"index.html\">\n <input ng-paste=\"paste=true\" ng-init=\"paste=false\" placeholder='paste here'>\n pasted: {{paste}}\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngIf\n * @restrict A\n * @multiElement\n *\n * @description\n * The `ngIf` directive removes or recreates a portion of the DOM tree based on an\n * {expression}. If the expression assigned to `ngIf` evaluates to a false\n * value then the element is removed from the DOM, otherwise a clone of the\n * element is reinserted into the DOM.\n *\n * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the\n * element in the DOM rather than changing its visibility via the `display` css property. A common\n * case when this difference is significant is when using css selectors that rely on an element's\n * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes.\n *\n * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope\n * is created when the element is restored. The scope created within `ngIf` inherits from\n * its parent scope using\n * [prototypal inheritance](https://github.com/angular/angular.js/wiki/Understanding-Scopes#javascript-prototypal-inheritance).\n * An important implication of this is if `ngModel` is used within `ngIf` to bind to\n * a javascript primitive defined in the parent scope. In this case any modifications made to the\n * variable within the child scope will override (hide) the value in the parent scope.\n *\n * Also, `ngIf` recreates elements using their compiled state. An example of this behavior\n * is if an element's class attribute is directly modified after it's compiled, using something like\n * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element\n * the added class will be lost because the original compiled state is used to regenerate the element.\n *\n * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter`\n * and `leave` effects.\n *\n * @animations\n * enter - happens just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container\n * leave - happens just before the `ngIf` contents are removed from the DOM\n *\n * @element ANY\n * @scope\n * @priority 600\n * @param {expression} ngIf If the {@link guide/expression expression} is falsy then\n * the element is removed from the DOM tree. If it is truthy a copy of the compiled\n * element is added to the DOM tree.\n *\n * @example\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n <label>Click me: <input type=\"checkbox\" ng-model=\"checked\" ng-init=\"checked=true\" /></label><br/>\n Show when checked:\n <span ng-if=\"checked\" class=\"animate-if\">\n This is removed when the checkbox is unchecked.\n </span>\n </file>\n <file name=\"animations.css\">\n .animate-if {\n background:white;\n border:1px solid black;\n padding:10px;\n }\n\n .animate-if.ng-enter, .animate-if.ng-leave {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n }\n\n .animate-if.ng-enter,\n .animate-if.ng-leave.ng-leave-active {\n opacity:0;\n }\n\n .animate-if.ng-leave,\n .animate-if.ng-enter.ng-enter-active {\n opacity:1;\n }\n </file>\n </example>\n */\nvar ngIfDirective = ['$animate', function($animate) {\n return {\n multiElement: true,\n transclude: 'element',\n priority: 600,\n terminal: true,\n restrict: 'A',\n $$tlb: true,\n link: function($scope, $element, $attr, ctrl, $transclude) {\n var block, childScope, previousElements;\n $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {\n\n if (value) {\n if (!childScope) {\n $transclude(function(clone, newScope) {\n childScope = newScope;\n clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' ');\n // Note: We only need the first/last node of the cloned nodes.\n // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n // by a directive with templateUrl when its template arrives.\n block = {\n clone: clone\n };\n $animate.enter(clone, $element.parent(), $element);\n });\n }\n } else {\n if (previousElements) {\n previousElements.remove();\n previousElements = null;\n }\n if (childScope) {\n childScope.$destroy();\n childScope = null;\n }\n if (block) {\n previousElements = getBlockNodes(block.clone);\n $animate.leave(previousElements).then(function() {\n previousElements = null;\n });\n block = null;\n }\n }\n });\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngInclude\n * @restrict ECA\n *\n * @description\n * Fetches, compiles and includes an external HTML fragment.\n *\n * By default, the template URL is restricted to the same domain and protocol as the\n * application document. This is done by calling {@link $sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols\n * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or\n * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to Angular's {@link\n * ng.$sce Strict Contextual Escaping}.\n *\n * In addition, the browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy may further restrict whether the template is successfully loaded.\n * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://`\n * access on some browsers.\n *\n * @animations\n * enter - animation is used to bring new content into the browser.\n * leave - animation is used to animate existing content away.\n *\n * The enter and leave animation occur concurrently.\n *\n * @scope\n * @priority 400\n *\n * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,\n * make sure you wrap it in **single** quotes, e.g. `src=\"'myPartialTemplate.html'\"`.\n * @param {string=} onload Expression to evaluate when a new partial is loaded.\n * <div class=\"alert alert-warning\">\n * **Note:** When using onload on SVG elements in IE11, the browser will try to call\n * a function with the name on the window element, which will usually throw a\n * \"function is undefined\" error. To fix this, you can instead use `data-onload` or a\n * different form that {@link guide/directive#normalization matches} `onload`.\n * </div>\n *\n * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll\n * $anchorScroll} to scroll the viewport after the content is loaded.\n *\n * - If the attribute is not set, disable scrolling.\n * - If the attribute is set without value, enable scrolling.\n * - Otherwise enable scrolling only if the expression evaluates to truthy value.\n *\n * @example\n <example module=\"includeExample\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <select ng-model=\"template\" ng-options=\"t.name for t in templates\">\n <option value=\"\">(blank)</option>\n </select>\n url of the template: <code>{{template.url}}</code>\n <hr/>\n <div class=\"slide-animate-container\">\n <div class=\"slide-animate\" ng-include=\"template.url\"></div>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('includeExample', ['ngAnimate'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.templates =\n [ { name: 'template1.html', url: 'template1.html'},\n { name: 'template2.html', url: 'template2.html'} ];\n $scope.template = $scope.templates[0];\n }]);\n </file>\n <file name=\"template1.html\">\n Content of template1.html\n </file>\n <file name=\"template2.html\">\n Content of template2.html\n </file>\n <file name=\"animations.css\">\n .slide-animate-container {\n position:relative;\n background:white;\n border:1px solid black;\n height:40px;\n overflow:hidden;\n }\n\n .slide-animate {\n padding:10px;\n }\n\n .slide-animate.ng-enter, .slide-animate.ng-leave {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n position:absolute;\n top:0;\n left:0;\n right:0;\n bottom:0;\n display:block;\n padding:10px;\n }\n\n .slide-animate.ng-enter {\n top:-50px;\n }\n .slide-animate.ng-enter.ng-enter-active {\n top:0;\n }\n\n .slide-animate.ng-leave {\n top:0;\n }\n .slide-animate.ng-leave.ng-leave-active {\n top:50px;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var templateSelect = element(by.model('template'));\n var includeElem = element(by.css('[ng-include]'));\n\n it('should load template1.html', function() {\n expect(includeElem.getText()).toMatch(/Content of template1.html/);\n });\n\n it('should load template2.html', function() {\n if (browser.params.browser == 'firefox') {\n // Firefox can't handle using selects\n // See https://github.com/angular/protractor/issues/480\n return;\n }\n templateSelect.click();\n templateSelect.all(by.css('option')).get(2).click();\n expect(includeElem.getText()).toMatch(/Content of template2.html/);\n });\n\n it('should change to blank', function() {\n if (browser.params.browser == 'firefox') {\n // Firefox can't handle using selects\n return;\n }\n templateSelect.click();\n templateSelect.all(by.css('option')).get(0).click();\n expect(includeElem.isPresent()).toBe(false);\n });\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentRequested\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted every time the ngInclude content is requested.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentLoaded\n * @eventType emit on the current ngInclude scope\n * @description\n * Emitted every time the ngInclude content is reloaded.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentError\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted when a template HTTP request yields an erroneous response (status < 200 || status > 299)\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\nvar ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate',\n function($templateRequest, $anchorScroll, $animate) {\n return {\n restrict: 'ECA',\n priority: 400,\n terminal: true,\n transclude: 'element',\n controller: angular.noop,\n compile: function(element, attr) {\n var srcExp = attr.ngInclude || attr.src,\n onloadExp = attr.onload || '',\n autoScrollExp = attr.autoscroll;\n\n return function(scope, $element, $attr, ctrl, $transclude) {\n var changeCounter = 0,\n currentScope,\n previousElement,\n currentElement;\n\n var cleanupLastIncludeContent = function() {\n if (previousElement) {\n previousElement.remove();\n previousElement = null;\n }\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n if (currentElement) {\n $animate.leave(currentElement).then(function() {\n previousElement = null;\n });\n previousElement = currentElement;\n currentElement = null;\n }\n };\n\n scope.$watch(srcExp, function ngIncludeWatchAction(src) {\n var afterAnimation = function() {\n if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {\n $anchorScroll();\n }\n };\n var thisChangeId = ++changeCounter;\n\n if (src) {\n //set the 2nd param to true to ignore the template request error so that the inner\n //contents and scope can be cleaned up.\n $templateRequest(src, true).then(function(response) {\n if (scope.$$destroyed) return;\n\n if (thisChangeId !== changeCounter) return;\n var newScope = scope.$new();\n ctrl.template = response;\n\n // Note: This will also link all children of ng-include that were contained in the original\n // html. If that content contains controllers, ... they could pollute/change the scope.\n // However, using ng-include on an element with additional content does not make sense...\n // Note: We can't remove them in the cloneAttchFn of $transclude as that\n // function is called before linking the content, which would apply child\n // directives to non existing elements.\n var clone = $transclude(newScope, function(clone) {\n cleanupLastIncludeContent();\n $animate.enter(clone, null, $element).then(afterAnimation);\n });\n\n currentScope = newScope;\n currentElement = clone;\n\n currentScope.$emit('$includeContentLoaded', src);\n scope.$eval(onloadExp);\n }, function() {\n if (scope.$$destroyed) return;\n\n if (thisChangeId === changeCounter) {\n cleanupLastIncludeContent();\n scope.$emit('$includeContentError', src);\n }\n });\n scope.$emit('$includeContentRequested', src);\n } else {\n cleanupLastIncludeContent();\n ctrl.template = null;\n }\n });\n };\n }\n };\n}];\n\n// This directive is called during the $transclude call of the first `ngInclude` directive.\n// It will replace and compile the content of the element with the loaded template.\n// We need this directive so that the element content is already filled when\n// the link function of another directive on the same element as ngInclude\n// is called.\nvar ngIncludeFillContentDirective = ['$compile',\n function($compile) {\n return {\n restrict: 'ECA',\n priority: -400,\n require: 'ngInclude',\n link: function(scope, $element, $attr, ctrl) {\n if (toString.call($element[0]).match(/SVG/)) {\n // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not\n // support innerHTML, so detect this here and try to generate the contents\n // specially.\n $element.empty();\n $compile(jqLiteBuildFragment(ctrl.template, document).childNodes)(scope,\n function namespaceAdaptedClone(clone) {\n $element.append(clone);\n }, {futureParentElement: $element});\n return;\n }\n\n $element.html(ctrl.template);\n $compile($element.contents())(scope);\n }\n };\n }];\n\n/**\n * @ngdoc directive\n * @name ngInit\n * @restrict AC\n *\n * @description\n * The `ngInit` directive allows you to evaluate an expression in the\n * current scope.\n *\n * <div class=\"alert alert-danger\">\n * This directive can be abused to add unnecessary amounts of logic into your templates.\n * There are only a few appropriate uses of `ngInit`, such as for aliasing special properties of\n * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below; and for injecting data via\n * server side scripting. Besides these few cases, you should use {@link guide/controller controllers}\n * rather than `ngInit` to initialize values on a scope.\n * </div>\n *\n * <div class=\"alert alert-warning\">\n * **Note**: If you have assignment in `ngInit` along with a {@link ng.$filter `filter`}, make\n * sure you have parentheses to ensure correct operator precedence:\n * <pre class=\"prettyprint\">\n * `<div ng-init=\"test1 = ($index | toString)\"></div>`\n * </pre>\n * </div>\n *\n * @priority 450\n *\n * @element ANY\n * @param {expression} ngInit {@link guide/expression Expression} to eval.\n *\n * @example\n <example module=\"initExample\">\n <file name=\"index.html\">\n <script>\n angular.module('initExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.list = [['a', 'b'], ['c', 'd']];\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <div ng-repeat=\"innerList in list\" ng-init=\"outerIndex = $index\">\n <div ng-repeat=\"value in innerList\" ng-init=\"innerIndex = $index\">\n <span class=\"example-init\">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span>\n </div>\n </div>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should alias index positions', function() {\n var elements = element.all(by.css('.example-init'));\n expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;');\n expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;');\n expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;');\n expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;');\n });\n </file>\n </example>\n */\nvar ngInitDirective = ngDirective({\n priority: 450,\n compile: function() {\n return {\n pre: function(scope, element, attrs) {\n scope.$eval(attrs.ngInit);\n }\n };\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngList\n *\n * @description\n * Text input that converts between a delimited string and an array of strings. The default\n * delimiter is a comma followed by a space - equivalent to `ng-list=\", \"`. You can specify a custom\n * delimiter as the value of the `ngList` attribute - for example, `ng-list=\" | \"`.\n *\n * The behaviour of the directive is affected by the use of the `ngTrim` attribute.\n * * If `ngTrim` is set to `\"false\"` then whitespace around both the separator and each\n * list item is respected. This implies that the user of the directive is responsible for\n * dealing with whitespace but also allows you to use whitespace as a delimiter, such as a\n * tab or newline character.\n * * Otherwise whitespace around the delimiter is ignored when splitting (although it is respected\n * when joining the list items back together) and whitespace around each list item is stripped\n * before it is added to the model.\n *\n * ### Example with Validation\n *\n * <example name=\"ngList-directive\" module=\"listExample\">\n * <file name=\"app.js\">\n * angular.module('listExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.names = ['morpheus', 'neo', 'trinity'];\n * }]);\n * </file>\n * <file name=\"index.html\">\n * <form name=\"myForm\" ng-controller=\"ExampleController\">\n * <label>List: <input name=\"namesInput\" ng-model=\"names\" ng-list required></label>\n * <span role=\"alert\">\n * <span class=\"error\" ng-show=\"myForm.namesInput.$error.required\">\n * Required!</span>\n * </span>\n * <br>\n * <tt>names = {{names}}</tt><br/>\n * <tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>\n * <tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>\n * <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n * <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n * </form>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * var listInput = element(by.model('names'));\n * var names = element(by.exactBinding('names'));\n * var valid = element(by.binding('myForm.namesInput.$valid'));\n * var error = element(by.css('span.error'));\n *\n * it('should initialize to model', function() {\n * expect(names.getText()).toContain('[\"morpheus\",\"neo\",\"trinity\"]');\n * expect(valid.getText()).toContain('true');\n * expect(error.getCssValue('display')).toBe('none');\n * });\n *\n * it('should be invalid if empty', function() {\n * listInput.clear();\n * listInput.sendKeys('');\n *\n * expect(names.getText()).toContain('');\n * expect(valid.getText()).toContain('false');\n * expect(error.getCssValue('display')).not.toBe('none');\n * });\n * </file>\n * </example>\n *\n * ### Example - splitting on newline\n * <example name=\"ngList-directive-newlines\">\n * <file name=\"index.html\">\n * <textarea ng-model=\"list\" ng-list=\" \" ng-trim=\"false\"></textarea>\n * <pre>{{ list | json }}</pre>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it(\"should split the text by newlines\", function() {\n * var listInput = element(by.model('list'));\n * var output = element(by.binding('list | json'));\n * listInput.sendKeys('abc\\ndef\\nghi');\n * expect(output.getText()).toContain('[\\n \"abc\",\\n \"def\",\\n \"ghi\"\\n]');\n * });\n * </file>\n * </example>\n *\n * @element input\n * @param {string=} ngList optional delimiter that should be used to split the value.\n */\nvar ngListDirective = function() {\n return {\n restrict: 'A',\n priority: 100,\n require: 'ngModel',\n link: function(scope, element, attr, ctrl) {\n // We want to control whitespace trimming so we use this convoluted approach\n // to access the ngList attribute, which doesn't pre-trim the attribute\n var ngList = element.attr(attr.$attr.ngList) || ', ';\n var trimValues = attr.ngTrim !== 'false';\n var separator = trimValues ? trim(ngList) : ngList;\n\n var parse = function(viewValue) {\n // If the viewValue is invalid (say required but empty) it will be `undefined`\n if (isUndefined(viewValue)) return;\n\n var list = [];\n\n if (viewValue) {\n forEach(viewValue.split(separator), function(value) {\n if (value) list.push(trimValues ? trim(value) : value);\n });\n }\n\n return list;\n };\n\n ctrl.$parsers.push(parse);\n ctrl.$formatters.push(function(value) {\n if (isArray(value)) {\n return value.join(ngList);\n }\n\n return undefined;\n });\n\n // Override the standard $isEmpty because an empty array means the input is empty.\n ctrl.$isEmpty = function(value) {\n return !value || !value.length;\n };\n }\n };\n};\n\n/* global VALID_CLASS: true,\n INVALID_CLASS: true,\n PRISTINE_CLASS: true,\n DIRTY_CLASS: true,\n UNTOUCHED_CLASS: true,\n TOUCHED_CLASS: true,\n*/\n\nvar VALID_CLASS = 'ng-valid',\n INVALID_CLASS = 'ng-invalid',\n PRISTINE_CLASS = 'ng-pristine',\n DIRTY_CLASS = 'ng-dirty',\n UNTOUCHED_CLASS = 'ng-untouched',\n TOUCHED_CLASS = 'ng-touched',\n PENDING_CLASS = 'ng-pending',\n EMPTY_CLASS = 'ng-empty',\n NOT_EMPTY_CLASS = 'ng-not-empty';\n\nvar ngModelMinErr = minErr('ngModel');\n\n/**\n * @ngdoc type\n * @name ngModel.NgModelController\n *\n * @property {*} $viewValue The actual value from the control's view. For `input` elements, this is a\n * String. See {@link ngModel.NgModelController#$setViewValue} for information about when the $viewValue\n * is set.\n * @property {*} $modelValue The value in the model that the control is bound to.\n * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever\n the control reads value from the DOM. The functions are called in array order, each passing\n its return value through to the next. The last return value is forwarded to the\n {@link ngModel.NgModelController#$validators `$validators`} collection.\n\nParsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue\n`$viewValue`}.\n\nReturning `undefined` from a parser means a parse error occurred. In that case,\nno {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`\nwill be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}\nis set to `true`. The parse error is stored in `ngModel.$error.parse`.\n\n *\n * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever\n the model value changes. The functions are called in reverse array order, each passing the value through to the\n next. The last return value is used as the actual DOM value.\n Used to format / convert values for display in the control.\n * ```js\n * function formatter(value) {\n * if (value) {\n * return value.toUpperCase();\n * }\n * }\n * ngModel.$formatters.push(formatter);\n * ```\n *\n * @property {Object.<string, function>} $validators A collection of validators that are applied\n * whenever the model value changes. The key value within the object refers to the name of the\n * validator while the function refers to the validation operation. The validation operation is\n * provided with the model value as an argument and must return a true or false value depending\n * on the response of that validation.\n *\n * ```js\n * ngModel.$validators.validCharacters = function(modelValue, viewValue) {\n * var value = modelValue || viewValue;\n * return /[0-9]+/.test(value) &&\n * /[a-z]+/.test(value) &&\n * /[A-Z]+/.test(value) &&\n * /\\W+/.test(value);\n * };\n * ```\n *\n * @property {Object.<string, function>} $asyncValidators A collection of validations that are expected to\n * perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided\n * is expected to return a promise when it is run during the model validation process. Once the promise\n * is delivered then the validation status will be set to true when fulfilled and false when rejected.\n * When the asynchronous validators are triggered, each of the validators will run in parallel and the model\n * value will only be updated once all validators have been fulfilled. As long as an asynchronous validator\n * is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators\n * will only run once all synchronous validators have passed.\n *\n * Please note that if $http is used then it is important that the server returns a success HTTP response code\n * in order to fulfill the validation and a status level of `4xx` in order to reject the validation.\n *\n * ```js\n * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) {\n * var value = modelValue || viewValue;\n *\n * // Lookup user by username\n * return $http.get('/api/users/' + value).\n * then(function resolved() {\n * //username exists, this means validation fails\n * return $q.reject('exists');\n * }, function rejected() {\n * //username does not exist, therefore this validation passes\n * return true;\n * });\n * };\n * ```\n *\n * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever the\n * view value has changed. It is called with no arguments, and its return value is ignored.\n * This can be used in place of additional $watches against the model value.\n *\n * @property {Object} $error An object hash with all failing validator ids as keys.\n * @property {Object} $pending An object hash with all pending validator ids as keys.\n *\n * @property {boolean} $untouched True if control has not lost focus yet.\n * @property {boolean} $touched True if control has lost focus.\n * @property {boolean} $pristine True if user has not interacted with the control yet.\n * @property {boolean} $dirty True if user has already interacted with the control.\n * @property {boolean} $valid True if there is no error.\n * @property {boolean} $invalid True if at least one error on the control.\n * @property {string} $name The name attribute of the control.\n *\n * @description\n *\n * `NgModelController` provides API for the {@link ngModel `ngModel`} directive.\n * The controller contains services for data-binding, validation, CSS updates, and value formatting\n * and parsing. It purposefully does not contain any logic which deals with DOM rendering or\n * listening to DOM events.\n * Such DOM related logic should be provided by other directives which make use of\n * `NgModelController` for data-binding to control elements.\n * Angular provides this DOM logic for most {@link input `input`} elements.\n * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example\n * custom control example} that uses `ngModelController` to bind to `contenteditable` elements.\n *\n * @example\n * ### Custom Control Example\n * This example shows how to use `NgModelController` with a custom control to achieve\n * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)\n * collaborate together to achieve the desired result.\n *\n * `contenteditable` is an HTML5 attribute, which tells the browser to let the element\n * contents be edited in place by the user.\n *\n * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}\n * module to automatically remove \"bad\" content like inline event listener (e.g. `<span onclick=\"...\">`).\n * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks\n * that content using the `$sce` service.\n *\n * <example name=\"NgModelController\" module=\"customControl\" deps=\"angular-sanitize.js\">\n <file name=\"style.css\">\n [contenteditable] {\n border: 1px solid black;\n background-color: white;\n min-height: 20px;\n }\n\n .ng-invalid {\n border: 1px solid red;\n }\n\n </file>\n <file name=\"script.js\">\n angular.module('customControl', ['ngSanitize']).\n directive('contenteditable', ['$sce', function($sce) {\n return {\n restrict: 'A', // only activate on element attribute\n require: '?ngModel', // get a hold of NgModelController\n link: function(scope, element, attrs, ngModel) {\n if (!ngModel) return; // do nothing if no ng-model\n\n // Specify how UI should be updated\n ngModel.$render = function() {\n element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));\n };\n\n // Listen for change events to enable binding\n element.on('blur keyup change', function() {\n scope.$evalAsync(read);\n });\n read(); // initialize\n\n // Write data to the model\n function read() {\n var html = element.html();\n // When we clear the content editable the browser leaves a <br> behind\n // If strip-br attribute is provided then we strip this out\n if ( attrs.stripBr && html == '<br>' ) {\n html = '';\n }\n ngModel.$setViewValue(html);\n }\n }\n };\n }]);\n </file>\n <file name=\"index.html\">\n <form name=\"myForm\">\n <div contenteditable\n name=\"myWidget\" ng-model=\"userContent\"\n strip-br=\"true\"\n required>Change me!</div>\n <span ng-show=\"myForm.myWidget.$error.required\">Required!</span>\n <hr>\n <textarea ng-model=\"userContent\" aria-label=\"Dynamic textarea\"></textarea>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should data-bind and become invalid', function() {\n if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') {\n // SafariDriver can't handle contenteditable\n // and Firefox driver can't clear contenteditables very well\n return;\n }\n var contentEditable = element(by.css('[contenteditable]'));\n var content = 'Change me!';\n\n expect(contentEditable.getText()).toEqual(content);\n\n contentEditable.clear();\n contentEditable.sendKeys(protractor.Key.BACK_SPACE);\n expect(contentEditable.getText()).toEqual('');\n expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);\n });\n </file>\n * </example>\n *\n *\n */\nvar NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$rootScope', '$q', '$interpolate',\n function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {\n this.$viewValue = Number.NaN;\n this.$modelValue = Number.NaN;\n this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.\n this.$validators = {};\n this.$asyncValidators = {};\n this.$parsers = [];\n this.$formatters = [];\n this.$viewChangeListeners = [];\n this.$untouched = true;\n this.$touched = false;\n this.$pristine = true;\n this.$dirty = false;\n this.$valid = true;\n this.$invalid = false;\n this.$error = {}; // keep invalid keys here\n this.$$success = {}; // keep valid keys here\n this.$pending = undefined; // keep pending keys here\n this.$name = $interpolate($attr.name || '', false)($scope);\n this.$$parentForm = nullFormCtrl;\n\n var parsedNgModel = $parse($attr.ngModel),\n parsedNgModelAssign = parsedNgModel.assign,\n ngModelGet = parsedNgModel,\n ngModelSet = parsedNgModelAssign,\n pendingDebounce = null,\n parserValid,\n ctrl = this;\n\n this.$$setOptions = function(options) {\n ctrl.$options = options;\n if (options && options.getterSetter) {\n var invokeModelGetter = $parse($attr.ngModel + '()'),\n invokeModelSetter = $parse($attr.ngModel + '($$$p)');\n\n ngModelGet = function($scope) {\n var modelValue = parsedNgModel($scope);\n if (isFunction(modelValue)) {\n modelValue = invokeModelGetter($scope);\n }\n return modelValue;\n };\n ngModelSet = function($scope, newValue) {\n if (isFunction(parsedNgModel($scope))) {\n invokeModelSetter($scope, {$$$p: ctrl.$modelValue});\n } else {\n parsedNgModelAssign($scope, ctrl.$modelValue);\n }\n };\n } else if (!parsedNgModel.assign) {\n throw ngModelMinErr('nonassign', \"Expression '{0}' is non-assignable. Element: {1}\",\n $attr.ngModel, startingTag($element));\n }\n };\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$render\n *\n * @description\n * Called when the view needs to be updated. It is expected that the user of the ng-model\n * directive will implement this method.\n *\n * The `$render()` method is invoked in the following situations:\n *\n * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last\n * committed value then `$render()` is called to update the input control.\n * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and\n * the `$viewValue` are different from last time.\n *\n * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of\n * `$modelValue` and `$viewValue` are actually different from their previous value. If `$modelValue`\n * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be\n * invoked if you only change a property on the objects.\n */\n this.$render = noop;\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$isEmpty\n *\n * @description\n * This is called when we need to determine if the value of an input is empty.\n *\n * For instance, the required directive does this to work out if the input has data or not.\n *\n * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.\n *\n * You can override this for input directives whose concept of being empty is different from the\n * default. The `checkboxInputType` directive does this because in its case a value of `false`\n * implies empty.\n *\n * @param {*} value The value of the input to check for emptiness.\n * @returns {boolean} True if `value` is \"empty\".\n */\n this.$isEmpty = function(value) {\n return isUndefined(value) || value === '' || value === null || value !== value;\n };\n\n this.$$updateEmptyClasses = function(value) {\n if (ctrl.$isEmpty(value)) {\n $animate.removeClass($element, NOT_EMPTY_CLASS);\n $animate.addClass($element, EMPTY_CLASS);\n } else {\n $animate.removeClass($element, EMPTY_CLASS);\n $animate.addClass($element, NOT_EMPTY_CLASS);\n }\n };\n\n\n var currentValidationRunId = 0;\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setValidity\n *\n * @description\n * Change the validity state, and notify the form.\n *\n * This method can be called within $parsers/$formatters or a custom validation implementation.\n * However, in most cases it should be sufficient to use the `ngModel.$validators` and\n * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically.\n *\n * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned\n * to either `$error[validationErrorKey]` or `$pending[validationErrorKey]`\n * (for unfulfilled `$asyncValidators`), so that it is available for data-binding.\n * The `validationErrorKey` should be in camelCase and will get converted into dash-case\n * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`\n * class and can be bound to as `{{someForm.someControl.$error.myError}}` .\n * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),\n * or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n * Skipped is used by Angular when validators do not run because of parse errors and\n * when `$asyncValidators` do not run because any of the `$validators` failed.\n */\n addSetValidityMethod({\n ctrl: this,\n $element: $element,\n set: function(object, property) {\n object[property] = true;\n },\n unset: function(object, property) {\n delete object[property];\n },\n $animate: $animate\n });\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setPristine\n *\n * @description\n * Sets the control to its pristine state.\n *\n * This method can be called to remove the `ng-dirty` class and set the control to its pristine\n * state (`ng-pristine` class). A model is considered to be pristine when the control\n * has not been changed from when first compiled.\n */\n this.$setPristine = function() {\n ctrl.$dirty = false;\n ctrl.$pristine = true;\n $animate.removeClass($element, DIRTY_CLASS);\n $animate.addClass($element, PRISTINE_CLASS);\n };\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setDirty\n *\n * @description\n * Sets the control to its dirty state.\n *\n * This method can be called to remove the `ng-pristine` class and set the control to its dirty\n * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed\n * from when first compiled.\n */\n this.$setDirty = function() {\n ctrl.$dirty = true;\n ctrl.$pristine = false;\n $animate.removeClass($element, PRISTINE_CLASS);\n $animate.addClass($element, DIRTY_CLASS);\n ctrl.$$parentForm.$setDirty();\n };\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setUntouched\n *\n * @description\n * Sets the control to its untouched state.\n *\n * This method can be called to remove the `ng-touched` class and set the control to its\n * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched\n * by default, however this function can be used to restore that state if the model has\n * already been touched by the user.\n */\n this.$setUntouched = function() {\n ctrl.$touched = false;\n ctrl.$untouched = true;\n $animate.setClass($element, UNTOUCHED_CLASS, TOUCHED_CLASS);\n };\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setTouched\n *\n * @description\n * Sets the control to its touched state.\n *\n * This method can be called to remove the `ng-untouched` class and set the control to its\n * touched state (`ng-touched` class). A model is considered to be touched when the user has\n * first focused the control element and then shifted focus away from the control (blur event).\n */\n this.$setTouched = function() {\n ctrl.$touched = true;\n ctrl.$untouched = false;\n $animate.setClass($element, TOUCHED_CLASS, UNTOUCHED_CLASS);\n };\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$rollbackViewValue\n *\n * @description\n * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,\n * which may be caused by a pending debounced event or because the input is waiting for a some\n * future event.\n *\n * If you have an input that uses `ng-model-options` to set up debounced updates or updates that\n * depend on special events such as blur, you can have a situation where there is a period when\n * the `$viewValue` is out of sync with the ngModel's `$modelValue`.\n *\n * In this case, you can use `$rollbackViewValue()` to manually cancel the debounced / future update\n * and reset the input to the last committed view value.\n *\n * It is also possible that you run into difficulties if you try to update the ngModel's `$modelValue`\n * programmatically before these debounced/future events have resolved/occurred, because Angular's\n * dirty checking mechanism is not able to tell whether the model has actually changed or not.\n *\n * The `$rollbackViewValue()` method should be called before programmatically changing the model of an\n * input which may have such events pending. This is important in order to make sure that the\n * input field will be updated with the new model value and any pending operations are cancelled.\n *\n * <example name=\"ng-model-cancel-update\" module=\"cancel-update-example\">\n * <file name=\"app.js\">\n * angular.module('cancel-update-example', [])\n *\n * .controller('CancelUpdateController', ['$scope', function($scope) {\n * $scope.model = {};\n *\n * $scope.setEmpty = function(e, value, rollback) {\n * if (e.keyCode == 27) {\n * e.preventDefault();\n * if (rollback) {\n * $scope.myForm[value].$rollbackViewValue();\n * }\n * $scope.model[value] = '';\n * }\n * };\n * }]);\n * </file>\n * <file name=\"index.html\">\n * <div ng-controller=\"CancelUpdateController\">\n * <p>Both of these inputs are only updated if they are blurred. Hitting escape should\n * empty them. Follow these steps and observe the difference:</p>\n * <ol>\n * <li>Type something in the input. You will see that the model is not yet updated</li>\n * <li>Press the Escape key.\n * <ol>\n * <li> In the first example, nothing happens, because the model is already '', and no\n * update is detected. If you blur the input, the model will be set to the current view.\n * </li>\n * <li> In the second example, the pending update is cancelled, and the input is set back\n * to the last committed view value (''). Blurring the input does nothing.\n * </li>\n * </ol>\n * </li>\n * </ol>\n *\n * <form name=\"myForm\" ng-model-options=\"{ updateOn: 'blur' }\">\n * <div>\n * <p id=\"inputDescription1\">Without $rollbackViewValue():</p>\n * <input name=\"value1\" aria-describedby=\"inputDescription1\" ng-model=\"model.value1\"\n * ng-keydown=\"setEmpty($event, 'value1')\">\n * value1: \"{{ model.value1 }}\"\n * </div>\n *\n * <div>\n * <p id=\"inputDescription2\">With $rollbackViewValue():</p>\n * <input name=\"value2\" aria-describedby=\"inputDescription2\" ng-model=\"model.value2\"\n * ng-keydown=\"setEmpty($event, 'value2', true)\">\n * value2: \"{{ model.value2 }}\"\n * </div>\n * </form>\n * </div>\n * </file>\n <file name=\"style.css\">\n div {\n display: table-cell;\n }\n div:nth-child(1) {\n padding-right: 30px;\n }\n\n </file>\n * </example>\n */\n this.$rollbackViewValue = function() {\n $timeout.cancel(pendingDebounce);\n ctrl.$viewValue = ctrl.$$lastCommittedViewValue;\n ctrl.$render();\n };\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$validate\n *\n * @description\n * Runs each of the registered validators (first synchronous validators and then\n * asynchronous validators).\n * If the validity changes to invalid, the model will be set to `undefined`,\n * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.\n * If the validity changes to valid, it will set the model to the last available valid\n * `$modelValue`, i.e. either the last parsed value or the last value set from the scope.\n */\n this.$validate = function() {\n // ignore $validate before model is initialized\n if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {\n return;\n }\n\n var viewValue = ctrl.$$lastCommittedViewValue;\n // Note: we use the $$rawModelValue as $modelValue might have been\n // set to undefined during a view -> model update that found validation\n // errors. We can't parse the view here, since that could change\n // the model although neither viewValue nor the model on the scope changed\n var modelValue = ctrl.$$rawModelValue;\n\n var prevValid = ctrl.$valid;\n var prevModelValue = ctrl.$modelValue;\n\n var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;\n\n ctrl.$$runValidators(modelValue, viewValue, function(allValid) {\n // If there was no change in validity, don't update the model\n // This prevents changing an invalid modelValue to undefined\n if (!allowInvalid && prevValid !== allValid) {\n // Note: Don't check ctrl.$valid here, as we could have\n // external validators (e.g. calculated on the server),\n // that just call $setValidity and need the model value\n // to calculate their validity.\n ctrl.$modelValue = allValid ? modelValue : undefined;\n\n if (ctrl.$modelValue !== prevModelValue) {\n ctrl.$$writeModelToScope();\n }\n }\n });\n\n };\n\n this.$$runValidators = function(modelValue, viewValue, doneCallback) {\n currentValidationRunId++;\n var localValidationRunId = currentValidationRunId;\n\n // check parser error\n if (!processParseErrors()) {\n validationDone(false);\n return;\n }\n if (!processSyncValidators()) {\n validationDone(false);\n return;\n }\n processAsyncValidators();\n\n function processParseErrors() {\n var errorKey = ctrl.$$parserName || 'parse';\n if (isUndefined(parserValid)) {\n setValidity(errorKey, null);\n } else {\n if (!parserValid) {\n forEach(ctrl.$validators, function(v, name) {\n setValidity(name, null);\n });\n forEach(ctrl.$asyncValidators, function(v, name) {\n setValidity(name, null);\n });\n }\n // Set the parse error last, to prevent unsetting it, should a $validators key == parserName\n setValidity(errorKey, parserValid);\n return parserValid;\n }\n return true;\n }\n\n function processSyncValidators() {\n var syncValidatorsValid = true;\n forEach(ctrl.$validators, function(validator, name) {\n var result = validator(modelValue, viewValue);\n syncValidatorsValid = syncValidatorsValid && result;\n setValidity(name, result);\n });\n if (!syncValidatorsValid) {\n forEach(ctrl.$asyncValidators, function(v, name) {\n setValidity(name, null);\n });\n return false;\n }\n return true;\n }\n\n function processAsyncValidators() {\n var validatorPromises = [];\n var allValid = true;\n forEach(ctrl.$asyncValidators, function(validator, name) {\n var promise = validator(modelValue, viewValue);\n if (!isPromiseLike(promise)) {\n throw ngModelMinErr('nopromise',\n \"Expected asynchronous validator to return a promise but got '{0}' instead.\", promise);\n }\n setValidity(name, undefined);\n validatorPromises.push(promise.then(function() {\n setValidity(name, true);\n }, function(error) {\n allValid = false;\n setValidity(name, false);\n }));\n });\n if (!validatorPromises.length) {\n validationDone(true);\n } else {\n $q.all(validatorPromises).then(function() {\n validationDone(allValid);\n }, noop);\n }\n }\n\n function setValidity(name, isValid) {\n if (localValidationRunId === currentValidationRunId) {\n ctrl.$setValidity(name, isValid);\n }\n }\n\n function validationDone(allValid) {\n if (localValidationRunId === currentValidationRunId) {\n\n doneCallback(allValid);\n }\n }\n };\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$commitViewValue\n *\n * @description\n * Commit a pending update to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n this.$commitViewValue = function() {\n var viewValue = ctrl.$viewValue;\n\n $timeout.cancel(pendingDebounce);\n\n // If the view value has not changed then we should just exit, except in the case where there is\n // a native validator on the element. In this case the validation state may have changed even though\n // the viewValue has stayed empty.\n if (ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)) {\n return;\n }\n ctrl.$$updateEmptyClasses(viewValue);\n ctrl.$$lastCommittedViewValue = viewValue;\n\n // change to dirty\n if (ctrl.$pristine) {\n this.$setDirty();\n }\n this.$$parseAndValidate();\n };\n\n this.$$parseAndValidate = function() {\n var viewValue = ctrl.$$lastCommittedViewValue;\n var modelValue = viewValue;\n parserValid = isUndefined(modelValue) ? undefined : true;\n\n if (parserValid) {\n for (var i = 0; i < ctrl.$parsers.length; i++) {\n modelValue = ctrl.$parsers[i](modelValue);\n if (isUndefined(modelValue)) {\n parserValid = false;\n break;\n }\n }\n }\n if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {\n // ctrl.$modelValue has not been touched yet...\n ctrl.$modelValue = ngModelGet($scope);\n }\n var prevModelValue = ctrl.$modelValue;\n var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;\n ctrl.$$rawModelValue = modelValue;\n\n if (allowInvalid) {\n ctrl.$modelValue = modelValue;\n writeToModelIfNeeded();\n }\n\n // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.\n // This can happen if e.g. $setViewValue is called from inside a parser\n ctrl.$$runValidators(modelValue, ctrl.$$lastCommittedViewValue, function(allValid) {\n if (!allowInvalid) {\n // Note: Don't check ctrl.$valid here, as we could have\n // external validators (e.g. calculated on the server),\n // that just call $setValidity and need the model value\n // to calculate their validity.\n ctrl.$modelValue = allValid ? modelValue : undefined;\n writeToModelIfNeeded();\n }\n });\n\n function writeToModelIfNeeded() {\n if (ctrl.$modelValue !== prevModelValue) {\n ctrl.$$writeModelToScope();\n }\n }\n };\n\n this.$$writeModelToScope = function() {\n ngModelSet($scope, ctrl.$modelValue);\n forEach(ctrl.$viewChangeListeners, function(listener) {\n try {\n listener();\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n };\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setViewValue\n *\n * @description\n * Update the view value.\n *\n * This method should be called when a control wants to change the view value; typically,\n * this is done from within a DOM event handler. For example, the {@link ng.directive:input input}\n * directive calls it when the value of the input changes and {@link ng.directive:select select}\n * calls it when an option is selected.\n *\n * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers`\n * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged\n * value sent directly for processing, finally to be applied to `$modelValue` and then the\n * **expression** specified in the `ng-model` attribute. Lastly, all the registered change listeners,\n * in the `$viewChangeListeners` list, are called.\n *\n * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`\n * and the `default` trigger is not listed, all those actions will remain pending until one of the\n * `updateOn` events is triggered on the DOM element.\n * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}\n * directive is used with a custom debounce for this particular event.\n * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce`\n * is specified, once the timer runs out.\n *\n * When used with standard inputs, the view value will always be a string (which is in some cases\n * parsed into another type, such as a `Date` object for `input[date]`.)\n * However, custom controls might also pass objects to this method. In this case, we should make\n * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not\n * perform a deep watch of objects, it only looks for a change of identity. If you only change\n * the property of the object then ngModel will not realize that the object has changed and\n * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should\n * not change properties of the copy once it has been passed to `$setViewValue`.\n * Otherwise you may cause the model value on the scope to change incorrectly.\n *\n * <div class=\"alert alert-info\">\n * In any case, the value passed to the method should always reflect the current value\n * of the control. For example, if you are calling `$setViewValue` for an input element,\n * you should pass the input DOM value. Otherwise, the control and the scope model become\n * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change\n * the control's DOM value in any way. If we want to change the control's DOM value\n * programmatically, we should update the `ngModel` scope expression. Its new value will be\n * picked up by the model controller, which will run it through the `$formatters`, `$render` it\n * to update the DOM, and finally call `$validate` on it.\n * </div>\n *\n * @param {*} value value from the view.\n * @param {string} trigger Event that triggered the update.\n */\n this.$setViewValue = function(value, trigger) {\n ctrl.$viewValue = value;\n if (!ctrl.$options || ctrl.$options.updateOnDefault) {\n ctrl.$$debounceViewValueCommit(trigger);\n }\n };\n\n this.$$debounceViewValueCommit = function(trigger) {\n var debounceDelay = 0,\n options = ctrl.$options,\n debounce;\n\n if (options && isDefined(options.debounce)) {\n debounce = options.debounce;\n if (isNumber(debounce)) {\n debounceDelay = debounce;\n } else if (isNumber(debounce[trigger])) {\n debounceDelay = debounce[trigger];\n } else if (isNumber(debounce['default'])) {\n debounceDelay = debounce['default'];\n }\n }\n\n $timeout.cancel(pendingDebounce);\n if (debounceDelay) {\n pendingDebounce = $timeout(function() {\n ctrl.$commitViewValue();\n }, debounceDelay);\n } else if ($rootScope.$$phase) {\n ctrl.$commitViewValue();\n } else {\n $scope.$apply(function() {\n ctrl.$commitViewValue();\n });\n }\n };\n\n // model -> value\n // Note: we cannot use a normal scope.$watch as we want to detect the following:\n // 1. scope value is 'a'\n // 2. user enters 'b'\n // 3. ng-change kicks in and reverts scope value to 'a'\n // -> scope value did not change since the last digest as\n // ng-change executes in apply phase\n // 4. view should be changed back to 'a'\n $scope.$watch(function ngModelWatch() {\n var modelValue = ngModelGet($scope);\n\n // if scope model value and ngModel value are out of sync\n // TODO(perf): why not move this to the action fn?\n if (modelValue !== ctrl.$modelValue &&\n // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator\n (ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue)\n ) {\n ctrl.$modelValue = ctrl.$$rawModelValue = modelValue;\n parserValid = undefined;\n\n var formatters = ctrl.$formatters,\n idx = formatters.length;\n\n var viewValue = modelValue;\n while (idx--) {\n viewValue = formatters[idx](viewValue);\n }\n if (ctrl.$viewValue !== viewValue) {\n ctrl.$$updateEmptyClasses(viewValue);\n ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;\n ctrl.$render();\n\n ctrl.$$runValidators(modelValue, viewValue, noop);\n }\n }\n\n return modelValue;\n });\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngModel\n *\n * @element input\n * @priority 1\n *\n * @description\n * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a\n * property on the scope using {@link ngModel.NgModelController NgModelController},\n * which is created and exposed by this directive.\n *\n * `ngModel` is responsible for:\n *\n * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`\n * require.\n * - Providing validation behavior (i.e. required, number, email, url).\n * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).\n * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`,\n * `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations.\n * - Registering the control with its parent {@link ng.directive:form form}.\n *\n * Note: `ngModel` will try to bind to the property given by evaluating the expression on the\n * current scope. If the property doesn't already exist on this scope, it will be created\n * implicitly and added to the scope.\n *\n * For best practices on using `ngModel`, see:\n *\n * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)\n *\n * For basic examples, how to use `ngModel`, see:\n *\n * - {@link ng.directive:input input}\n * - {@link input[text] text}\n * - {@link input[checkbox] checkbox}\n * - {@link input[radio] radio}\n * - {@link input[number] number}\n * - {@link input[email] email}\n * - {@link input[url] url}\n * - {@link input[date] date}\n * - {@link input[datetime-local] datetime-local}\n * - {@link input[time] time}\n * - {@link input[month] month}\n * - {@link input[week] week}\n * - {@link ng.directive:select select}\n * - {@link ng.directive:textarea textarea}\n *\n * # Complex Models (objects or collections)\n *\n * By default, `ngModel` watches the model by reference, not value. This is important to know when\n * binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the\n * object or collection change, `ngModel` will not be notified and so the input will not be re-rendered.\n *\n * The model must be assigned an entirely new object or collection before a re-rendering will occur.\n *\n * Some directives have options that will cause them to use a custom `$watchCollection` on the model expression\n * - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or\n * if the select is given the `multiple` attribute.\n *\n * The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the\n * first level of the object (or only changing the properties of an item in the collection if it's an array) will still\n * not trigger a re-rendering of the model.\n *\n * # CSS classes\n * The following CSS classes are added and removed on the associated input/select/textarea element\n * depending on the validity of the model.\n *\n * - `ng-valid`: the model is valid\n * - `ng-invalid`: the model is invalid\n * - `ng-valid-[key]`: for each valid key added by `$setValidity`\n * - `ng-invalid-[key]`: for each invalid key added by `$setValidity`\n * - `ng-pristine`: the control hasn't been interacted with yet\n * - `ng-dirty`: the control has been interacted with\n * - `ng-touched`: the control has been blurred\n * - `ng-untouched`: the control hasn't been blurred\n * - `ng-pending`: any `$asyncValidators` are unfulfilled\n * - `ng-empty`: the view does not contain a value or the value is deemed \"empty\", as defined\n * by the {@link ngModel.NgModelController#$isEmpty} method\n * - `ng-not-empty`: the view contains a non-empty value\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n * ## Animation Hooks\n *\n * Animations within models are triggered when any of the associated CSS classes are added and removed\n * on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`,\n * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.\n * The animations that are triggered within ngModel are similar to how they work in ngClass and\n * animations can be hooked into using CSS transitions, keyframes as well as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style an input element\n * that has been rendered as invalid after it has been validated:\n *\n * <pre>\n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-input {\n * transition:0.5s linear all;\n * background: white;\n * }\n * .my-input.ng-invalid {\n * background: red;\n * color:white;\n * }\n * </pre>\n *\n * @example\n * <example deps=\"angular-animate.js\" animations=\"true\" fixBase=\"true\" module=\"inputExample\">\n <file name=\"index.html\">\n <script>\n angular.module('inputExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.val = '1';\n }]);\n </script>\n <style>\n .my-input {\n transition:all linear 0.5s;\n background: transparent;\n }\n .my-input.ng-invalid {\n color:white;\n background: red;\n }\n </style>\n <p id=\"inputDescription\">\n Update input to see transitions when valid/invalid.\n Integer is a valid value.\n </p>\n <form name=\"testForm\" ng-controller=\"ExampleController\">\n <input ng-model=\"val\" ng-pattern=\"/^\\d+$/\" name=\"anim\" class=\"my-input\"\n aria-describedby=\"inputDescription\" />\n </form>\n </file>\n * </example>\n *\n * ## Binding to a getter/setter\n *\n * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a\n * function that returns a representation of the model when called with zero arguments, and sets\n * the internal state of a model when called with an argument. It's sometimes useful to use this\n * for models that have an internal representation that's different from what the model exposes\n * to the view.\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:** It's best to keep getters fast because Angular is likely to call them more\n * frequently than other parts of your code.\n * </div>\n *\n * You use this behavior by adding `ng-model-options=\"{ getterSetter: true }\"` to an element that\n * has `ng-model` attached to it. You can also add `ng-model-options=\"{ getterSetter: true }\"` to\n * a `<form>`, which will enable this behavior for all `<input>`s within it. See\n * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.\n *\n * The following example shows how to use `ngModel` with a getter/setter:\n *\n * @example\n * <example name=\"ngModel-getter-setter\" module=\"getterSetterExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form name=\"userForm\">\n <label>Name:\n <input type=\"text\" name=\"userName\"\n ng-model=\"user.name\"\n ng-model-options=\"{ getterSetter: true }\" />\n </label>\n </form>\n <pre>user.name = <span ng-bind=\"user.name()\"></span></pre>\n </div>\n </file>\n <file name=\"app.js\">\n angular.module('getterSetterExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var _name = 'Brian';\n $scope.user = {\n name: function(newName) {\n // Note that newName can be undefined for two reasons:\n // 1. Because it is called as a getter and thus called with no arguments\n // 2. Because the property should actually be set to undefined. This happens e.g. if the\n // input is invalid\n return arguments.length ? (_name = newName) : _name;\n }\n };\n }]);\n </file>\n * </example>\n */\nvar ngModelDirective = ['$rootScope', function($rootScope) {\n return {\n restrict: 'A',\n require: ['ngModel', '^?form', '^?ngModelOptions'],\n controller: NgModelController,\n // Prelink needs to run before any input directive\n // so that we can set the NgModelOptions in NgModelController\n // before anyone else uses it.\n priority: 1,\n compile: function ngModelCompile(element) {\n // Setup initial state of the control\n element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);\n\n return {\n pre: function ngModelPreLink(scope, element, attr, ctrls) {\n var modelCtrl = ctrls[0],\n formCtrl = ctrls[1] || modelCtrl.$$parentForm;\n\n modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);\n\n // notify others, especially parent forms\n formCtrl.$addControl(modelCtrl);\n\n attr.$observe('name', function(newValue) {\n if (modelCtrl.$name !== newValue) {\n modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue);\n }\n });\n\n scope.$on('$destroy', function() {\n modelCtrl.$$parentForm.$removeControl(modelCtrl);\n });\n },\n post: function ngModelPostLink(scope, element, attr, ctrls) {\n var modelCtrl = ctrls[0];\n if (modelCtrl.$options && modelCtrl.$options.updateOn) {\n element.on(modelCtrl.$options.updateOn, function(ev) {\n modelCtrl.$$debounceViewValueCommit(ev && ev.type);\n });\n }\n\n element.on('blur', function(ev) {\n if (modelCtrl.$touched) return;\n\n if ($rootScope.$$phase) {\n scope.$evalAsync(modelCtrl.$setTouched);\n } else {\n scope.$apply(modelCtrl.$setTouched);\n }\n });\n }\n };\n }\n };\n}];\n\nvar DEFAULT_REGEXP = /(\\s+|^)default(\\s+|$)/;\n\n/**\n * @ngdoc directive\n * @name ngModelOptions\n *\n * @description\n * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of\n * events that will trigger a model update and/or a debouncing delay so that the actual update only\n * takes place when a timer expires; this timer will be reset after another change takes place.\n *\n * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might\n * be different from the value in the actual model. This means that if you update the model you\n * should also invoke {@link ngModel.NgModelController `$rollbackViewValue`} on the relevant input field in\n * order to make sure it is synchronized with the model and that any debounced action is canceled.\n *\n * The easiest way to reference the control's {@link ngModel.NgModelController `$rollbackViewValue`}\n * method is by making sure the input is placed inside a form that has a `name` attribute. This is\n * important because `form` controllers are published to the related scope under the name in their\n * `name` attribute.\n *\n * Any pending changes will take place immediately when an enclosing form is submitted via the\n * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * `ngModelOptions` has an effect on the element it's declared on and its descendants.\n *\n * @param {Object} ngModelOptions options to apply to the current model. Valid keys are:\n * - `updateOn`: string specifying which event should the input be bound to. You can set several\n * events using an space delimited list. There is a special event called `default` that\n * matches the default events belonging of the control.\n * - `debounce`: integer value which contains the debounce model update value in milliseconds. A\n * value of 0 triggers an immediate update. If an object is supplied instead, you can specify a\n * custom value for each event. For example:\n * `ng-model-options=\"{ updateOn: 'default blur', debounce: { 'default': 500, 'blur': 0 } }\"`\n * - `allowInvalid`: boolean value which indicates that the model can be set with values that did\n * not validate correctly instead of the default behavior of setting the model to undefined.\n * - `getterSetter`: boolean value which determines whether or not to treat functions bound to\n `ngModel` as getters/setters.\n * - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for\n * `<input type=\"date\">`, `<input type=\"time\">`, ... . It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n *\n * @example\n\n The following example shows how to override immediate updates. Changes on the inputs within the\n form will update the model only when the control loses focus (blur event). If `escape` key is\n pressed while the input field is focused, the value is reset to the value in the current model.\n\n <example name=\"ngModelOptions-directive-blur\" module=\"optionsExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form name=\"userForm\">\n <label>Name:\n <input type=\"text\" name=\"userName\"\n ng-model=\"user.name\"\n ng-model-options=\"{ updateOn: 'blur' }\"\n ng-keyup=\"cancel($event)\" />\n </label><br />\n <label>Other data:\n <input type=\"text\" ng-model=\"user.data\" />\n </label><br />\n </form>\n <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n <pre>user.data = <span ng-bind=\"user.data\"></span></pre>\n </div>\n </file>\n <file name=\"app.js\">\n angular.module('optionsExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.user = { name: 'John', data: '' };\n\n $scope.cancel = function(e) {\n if (e.keyCode == 27) {\n $scope.userForm.userName.$rollbackViewValue();\n }\n };\n }]);\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var model = element(by.binding('user.name'));\n var input = element(by.model('user.name'));\n var other = element(by.model('user.data'));\n\n it('should allow custom events', function() {\n input.sendKeys(' Doe');\n input.click();\n expect(model.getText()).toEqual('John');\n other.click();\n expect(model.getText()).toEqual('John Doe');\n });\n\n it('should $rollbackViewValue when model changes', function() {\n input.sendKeys(' Doe');\n expect(input.getAttribute('value')).toEqual('John Doe');\n input.sendKeys(protractor.Key.ESCAPE);\n expect(input.getAttribute('value')).toEqual('John');\n other.click();\n expect(model.getText()).toEqual('John');\n });\n </file>\n </example>\n\n This one shows how to debounce model changes. Model will be updated only 1 sec after last change.\n If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.\n\n <example name=\"ngModelOptions-directive-debounce\" module=\"optionsExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form name=\"userForm\">\n <label>Name:\n <input type=\"text\" name=\"userName\"\n ng-model=\"user.name\"\n ng-model-options=\"{ debounce: 1000 }\" />\n </label>\n <button ng-click=\"userForm.userName.$rollbackViewValue(); user.name=''\">Clear</button>\n <br />\n </form>\n <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n </div>\n </file>\n <file name=\"app.js\">\n angular.module('optionsExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.user = { name: 'Igor' };\n }]);\n </file>\n </example>\n\n This one shows how to bind to getter/setters:\n\n <example name=\"ngModelOptions-directive-getter-setter\" module=\"getterSetterExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form name=\"userForm\">\n <label>Name:\n <input type=\"text\" name=\"userName\"\n ng-model=\"user.name\"\n ng-model-options=\"{ getterSetter: true }\" />\n </label>\n </form>\n <pre>user.name = <span ng-bind=\"user.name()\"></span></pre>\n </div>\n </file>\n <file name=\"app.js\">\n angular.module('getterSetterExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var _name = 'Brian';\n $scope.user = {\n name: function(newName) {\n // Note that newName can be undefined for two reasons:\n // 1. Because it is called as a getter and thus called with no arguments\n // 2. Because the property should actually be set to undefined. This happens e.g. if the\n // input is invalid\n return arguments.length ? (_name = newName) : _name;\n }\n };\n }]);\n </file>\n </example>\n */\nvar ngModelOptionsDirective = function() {\n return {\n restrict: 'A',\n controller: ['$scope', '$attrs', function($scope, $attrs) {\n var that = this;\n this.$options = copy($scope.$eval($attrs.ngModelOptions));\n // Allow adding/overriding bound events\n if (isDefined(this.$options.updateOn)) {\n this.$options.updateOnDefault = false;\n // extract \"default\" pseudo-event from list of events that can trigger a model update\n this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() {\n that.$options.updateOnDefault = true;\n return ' ';\n }));\n } else {\n this.$options.updateOnDefault = true;\n }\n }]\n };\n};\n\n\n\n// helper methods\nfunction addSetValidityMethod(context) {\n var ctrl = context.ctrl,\n $element = context.$element,\n classCache = {},\n set = context.set,\n unset = context.unset,\n $animate = context.$animate;\n\n classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));\n\n ctrl.$setValidity = setValidity;\n\n function setValidity(validationErrorKey, state, controller) {\n if (isUndefined(state)) {\n createAndSet('$pending', validationErrorKey, controller);\n } else {\n unsetAndCleanup('$pending', validationErrorKey, controller);\n }\n if (!isBoolean(state)) {\n unset(ctrl.$error, validationErrorKey, controller);\n unset(ctrl.$$success, validationErrorKey, controller);\n } else {\n if (state) {\n unset(ctrl.$error, validationErrorKey, controller);\n set(ctrl.$$success, validationErrorKey, controller);\n } else {\n set(ctrl.$error, validationErrorKey, controller);\n unset(ctrl.$$success, validationErrorKey, controller);\n }\n }\n if (ctrl.$pending) {\n cachedToggleClass(PENDING_CLASS, true);\n ctrl.$valid = ctrl.$invalid = undefined;\n toggleValidationCss('', null);\n } else {\n cachedToggleClass(PENDING_CLASS, false);\n ctrl.$valid = isObjectEmpty(ctrl.$error);\n ctrl.$invalid = !ctrl.$valid;\n toggleValidationCss('', ctrl.$valid);\n }\n\n // re-read the state as the set/unset methods could have\n // combined state in ctrl.$error[validationError] (used for forms),\n // where setting/unsetting only increments/decrements the value,\n // and does not replace it.\n var combinedState;\n if (ctrl.$pending && ctrl.$pending[validationErrorKey]) {\n combinedState = undefined;\n } else if (ctrl.$error[validationErrorKey]) {\n combinedState = false;\n } else if (ctrl.$$success[validationErrorKey]) {\n combinedState = true;\n } else {\n combinedState = null;\n }\n\n toggleValidationCss(validationErrorKey, combinedState);\n ctrl.$$parentForm.$setValidity(validationErrorKey, combinedState, ctrl);\n }\n\n function createAndSet(name, value, controller) {\n if (!ctrl[name]) {\n ctrl[name] = {};\n }\n set(ctrl[name], value, controller);\n }\n\n function unsetAndCleanup(name, value, controller) {\n if (ctrl[name]) {\n unset(ctrl[name], value, controller);\n }\n if (isObjectEmpty(ctrl[name])) {\n ctrl[name] = undefined;\n }\n }\n\n function cachedToggleClass(className, switchValue) {\n if (switchValue && !classCache[className]) {\n $animate.addClass($element, className);\n classCache[className] = true;\n } else if (!switchValue && classCache[className]) {\n $animate.removeClass($element, className);\n classCache[className] = false;\n }\n }\n\n function toggleValidationCss(validationErrorKey, isValid) {\n validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';\n\n cachedToggleClass(VALID_CLASS + validationErrorKey, isValid === true);\n cachedToggleClass(INVALID_CLASS + validationErrorKey, isValid === false);\n }\n}\n\nfunction isObjectEmpty(obj) {\n if (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n }\n return true;\n}\n\n/**\n * @ngdoc directive\n * @name ngNonBindable\n * @restrict AC\n * @priority 1000\n *\n * @description\n * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current\n * DOM element. This is useful if the element contains what appears to be Angular directives and\n * bindings but which should be ignored by Angular. This could be the case if you have a site that\n * displays snippets of code, for instance.\n *\n * @element ANY\n *\n * @example\n * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,\n * but the one wrapped in `ngNonBindable` is left alone.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <div>Normal: {{1 + 2}}</div>\n <div ng-non-bindable>Ignored: {{1 + 2}}</div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-non-bindable', function() {\n expect(element(by.binding('1 + 2')).getText()).toContain('3');\n expect(element.all(by.css('div')).last().getText()).toMatch(/1 \\+ 2/);\n });\n </file>\n </example>\n */\nvar ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });\n\n/* global jqLiteRemove */\n\nvar ngOptionsMinErr = minErr('ngOptions');\n\n/**\n * @ngdoc directive\n * @name ngOptions\n * @restrict A\n *\n * @description\n *\n * The `ngOptions` attribute can be used to dynamically generate a list of `<option>`\n * elements for the `<select>` element using the array or object obtained by evaluating the\n * `ngOptions` comprehension expression.\n *\n * In many cases, `ngRepeat` can be used on `<option>` elements instead of `ngOptions` to achieve a\n * similar result. However, `ngOptions` provides some benefits such as reducing memory and\n * increasing speed by not creating a new scope for each repeated instance, as well as providing\n * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the\n * comprehension expression. `ngOptions` should be used when the `<select>` model needs to be bound\n * to a non-string value. This is because an option element can only be bound to string values at\n * present.\n *\n * When an item in the `<select>` menu is selected, the array element or object property\n * represented by the selected option will be bound to the model identified by the `ngModel`\n * directive.\n *\n * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can\n * be nested into the `<select>` element. This element will then represent the `null` or \"not selected\"\n * option. See example below for demonstration.\n *\n * ## Complex Models (objects or collections)\n *\n * By default, `ngModel` watches the model by reference, not value. This is important to know when\n * binding the select to a model that is an object or a collection.\n *\n * One issue occurs if you want to preselect an option. For example, if you set\n * the model to an object that is equal to an object in your collection, `ngOptions` won't be able to set the selection,\n * because the objects are not identical. So by default, you should always reference the item in your collection\n * for preselections, e.g.: `$scope.selected = $scope.collection[3]`.\n *\n * Another solution is to use a `track by` clause, because then `ngOptions` will track the identity\n * of the item not by reference, but by the result of the `track by` expression. For example, if your\n * collection items have an id property, you would `track by item.id`.\n *\n * A different issue with objects or collections is that ngModel won't detect if an object property or\n * a collection item changes. For that reason, `ngOptions` additionally watches the model using\n * `$watchCollection`, when the expression contains a `track by` clause or the the select has the `multiple` attribute.\n * This allows ngOptions to trigger a re-rendering of the options even if the actual object/collection\n * has not changed identity, but only a property on the object or an item in the collection changes.\n *\n * Note that `$watchCollection` does a shallow comparison of the properties of the object (or the items in the collection\n * if the model is an array). This means that changing a property deeper than the first level inside the\n * object/collection will not trigger a re-rendering.\n *\n * ## `select` **`as`**\n *\n * Using `select` **`as`** will bind the result of the `select` expression to the model, but\n * the value of the `<select>` and `<option>` html elements will be either the index (for array data sources)\n * or property name (for object data sources) of the value within the collection. If a **`track by`** expression\n * is used, the result of that expression will be set as the value of the `option` and `select` elements.\n *\n *\n * ### `select` **`as`** and **`track by`**\n *\n * <div class=\"alert alert-warning\">\n * Be careful when using `select` **`as`** and **`track by`** in the same expression.\n * </div>\n *\n * Given this array of items on the $scope:\n *\n * ```js\n * $scope.items = [{\n * id: 1,\n * label: 'aLabel',\n * subItem: { name: 'aSubItem' }\n * }, {\n * id: 2,\n * label: 'bLabel',\n * subItem: { name: 'bSubItem' }\n * }];\n * ```\n *\n * This will work:\n *\n * ```html\n * <select ng-options=\"item as item.label for item in items track by item.id\" ng-model=\"selected\"></select>\n * ```\n * ```js\n * $scope.selected = $scope.items[0];\n * ```\n *\n * but this will not work:\n *\n * ```html\n * <select ng-options=\"item.subItem as item.label for item in items track by item.id\" ng-model=\"selected\"></select>\n * ```\n * ```js\n * $scope.selected = $scope.items[0].subItem;\n * ```\n *\n * In both examples, the **`track by`** expression is applied successfully to each `item` in the\n * `items` array. Because the selected option has been set programmatically in the controller, the\n * **`track by`** expression is also applied to the `ngModel` value. In the first example, the\n * `ngModel` value is `items[0]` and the **`track by`** expression evaluates to `items[0].id` with\n * no issue. In the second example, the `ngModel` value is `items[0].subItem` and the **`track by`**\n * expression evaluates to `items[0].subItem.id` (which is undefined). As a result, the model value\n * is not matched against any `<option>` and the `<select>` appears as having no selected value.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required The control is considered valid only if value is entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {comprehension_expression=} ngOptions in one of the following forms:\n *\n * * for array data sources:\n * * `label` **`for`** `value` **`in`** `array`\n * * `select` **`as`** `label` **`for`** `value` **`in`** `array`\n * * `label` **`group by`** `group` **`for`** `value` **`in`** `array`\n * * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array`\n * * `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`\n * * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`\n * * `label` **`for`** `value` **`in`** `array` | orderBy:`orderexpr` **`track by`** `trackexpr`\n * (for including a filter with `track by`)\n * * for object data sources:\n * * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`\n * * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`\n * * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`\n * * `label` **`disable when`** `disable` **`for (`**`key`**`,`** `value`**`) in`** `object`\n * * `select` **`as`** `label` **`group by`** `group`\n * **`for` `(`**`key`**`,`** `value`**`) in`** `object`\n * * `select` **`as`** `label` **`disable when`** `disable`\n * **`for` `(`**`key`**`,`** `value`**`) in`** `object`\n *\n * Where:\n *\n * * `array` / `object`: an expression which evaluates to an array / object to iterate over.\n * * `value`: local variable which will refer to each item in the `array` or each property value\n * of `object` during iteration.\n * * `key`: local variable which will refer to a property name in `object` during iteration.\n * * `label`: The result of this expression will be the label for `<option>` element. The\n * `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).\n * * `select`: The result of this expression will be bound to the model of the parent `<select>`\n * element. If not specified, `select` expression will default to `value`.\n * * `group`: The result of this expression will be used to group options using the `<optgroup>`\n * DOM element.\n * * `disable`: The result of this expression will be used to disable the rendered `<option>`\n * element. Return `true` to disable.\n * * `trackexpr`: Used when working with an array of objects. The result of this expression will be\n * used to identify the objects in the array. The `trackexpr` will most likely refer to the\n * `value` variable (e.g. `value.propertyName`). With this the selection is preserved\n * even when the options are recreated (e.g. reloaded from the server).\n *\n * @example\n <example module=\"selectExample\">\n <file name=\"index.html\">\n <script>\n angular.module('selectExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.colors = [\n {name:'black', shade:'dark'},\n {name:'white', shade:'light', notAnOption: true},\n {name:'red', shade:'dark'},\n {name:'blue', shade:'dark', notAnOption: true},\n {name:'yellow', shade:'light', notAnOption: false}\n ];\n $scope.myColor = $scope.colors[2]; // red\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <ul>\n <li ng-repeat=\"color in colors\">\n <label>Name: <input ng-model=\"color.name\"></label>\n <label><input type=\"checkbox\" ng-model=\"color.notAnOption\"> Disabled?</label>\n <button ng-click=\"colors.splice($index, 1)\" aria-label=\"Remove\">X</button>\n </li>\n <li>\n <button ng-click=\"colors.push({})\">add</button>\n </li>\n </ul>\n <hr/>\n <label>Color (null not allowed):\n <select ng-model=\"myColor\" ng-options=\"color.name for color in colors\"></select>\n </label><br/>\n <label>Color (null allowed):\n <span class=\"nullable\">\n <select ng-model=\"myColor\" ng-options=\"color.name for color in colors\">\n <option value=\"\">-- choose color --</option>\n </select>\n </span></label><br/>\n\n <label>Color grouped by shade:\n <select ng-model=\"myColor\" ng-options=\"color.name group by color.shade for color in colors\">\n </select>\n </label><br/>\n\n <label>Color grouped by shade, with some disabled:\n <select ng-model=\"myColor\"\n ng-options=\"color.name group by color.shade disable when color.notAnOption for color in colors\">\n </select>\n </label><br/>\n\n\n\n Select <button ng-click=\"myColor = { name:'not in list', shade: 'other' }\">bogus</button>.\n <br/>\n <hr/>\n Currently selected: {{ {selected_color:myColor} }}\n <div style=\"border:solid 1px black; height:20px\"\n ng-style=\"{'background-color':myColor.name}\">\n </div>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-options', function() {\n expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');\n element.all(by.model('myColor')).first().click();\n element.all(by.css('select[ng-model=\"myColor\"] option')).first().click();\n expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');\n element(by.css('.nullable select[ng-model=\"myColor\"]')).click();\n element.all(by.css('.nullable select[ng-model=\"myColor\"] option')).first().click();\n expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null');\n });\n </file>\n </example>\n */\n\n// jshint maxlen: false\n// //00001111111111000000000002222222222000000000000000000000333333333300000000000000000000000004444444444400000000000005555555555555550000000006666666666666660000000777777777777777000000000000000888888888800000000000000000009999999999\nvar NG_OPTIONS_REGEXP = /^\\s*([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+group\\s+by\\s+([\\s\\S]+?))?(?:\\s+disable\\s+when\\s+([\\s\\S]+?))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+([\\s\\S]+?)(?:\\s+track\\s+by\\s+([\\s\\S]+?))?$/;\n // 1: value expression (valueFn)\n // 2: label expression (displayFn)\n // 3: group by expression (groupByFn)\n // 4: disable when expression (disableWhenFn)\n // 5: array item variable name\n // 6: object item key variable name\n // 7: object item value variable name\n // 8: collection expression\n // 9: track by expression\n// jshint maxlen: 100\n\n\nvar ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {\n\n function parseOptionsExpression(optionsExp, selectElement, scope) {\n\n var match = optionsExp.match(NG_OPTIONS_REGEXP);\n if (!(match)) {\n throw ngOptionsMinErr('iexp',\n \"Expected expression in form of \" +\n \"'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'\" +\n \" but got '{0}'. Element: {1}\",\n optionsExp, startingTag(selectElement));\n }\n\n // Extract the parts from the ngOptions expression\n\n // The variable name for the value of the item in the collection\n var valueName = match[5] || match[7];\n // The variable name for the key of the item in the collection\n var keyName = match[6];\n\n // An expression that generates the viewValue for an option if there is a label expression\n var selectAs = / as /.test(match[0]) && match[1];\n // An expression that is used to track the id of each object in the options collection\n var trackBy = match[9];\n // An expression that generates the viewValue for an option if there is no label expression\n var valueFn = $parse(match[2] ? match[1] : valueName);\n var selectAsFn = selectAs && $parse(selectAs);\n var viewValueFn = selectAsFn || valueFn;\n var trackByFn = trackBy && $parse(trackBy);\n\n // Get the value by which we are going to track the option\n // if we have a trackFn then use that (passing scope and locals)\n // otherwise just hash the given viewValue\n var getTrackByValueFn = trackBy ?\n function(value, locals) { return trackByFn(scope, locals); } :\n function getHashOfValue(value) { return hashKey(value); };\n var getTrackByValue = function(value, key) {\n return getTrackByValueFn(value, getLocals(value, key));\n };\n\n var displayFn = $parse(match[2] || match[1]);\n var groupByFn = $parse(match[3] || '');\n var disableWhenFn = $parse(match[4] || '');\n var valuesFn = $parse(match[8]);\n\n var locals = {};\n var getLocals = keyName ? function(value, key) {\n locals[keyName] = key;\n locals[valueName] = value;\n return locals;\n } : function(value) {\n locals[valueName] = value;\n return locals;\n };\n\n\n function Option(selectValue, viewValue, label, group, disabled) {\n this.selectValue = selectValue;\n this.viewValue = viewValue;\n this.label = label;\n this.group = group;\n this.disabled = disabled;\n }\n\n function getOptionValuesKeys(optionValues) {\n var optionValuesKeys;\n\n if (!keyName && isArrayLike(optionValues)) {\n optionValuesKeys = optionValues;\n } else {\n // if object, extract keys, in enumeration order, unsorted\n optionValuesKeys = [];\n for (var itemKey in optionValues) {\n if (optionValues.hasOwnProperty(itemKey) && itemKey.charAt(0) !== '$') {\n optionValuesKeys.push(itemKey);\n }\n }\n }\n return optionValuesKeys;\n }\n\n return {\n trackBy: trackBy,\n getTrackByValue: getTrackByValue,\n getWatchables: $parse(valuesFn, function(optionValues) {\n // Create a collection of things that we would like to watch (watchedArray)\n // so that they can all be watched using a single $watchCollection\n // that only runs the handler once if anything changes\n var watchedArray = [];\n optionValues = optionValues || [];\n\n var optionValuesKeys = getOptionValuesKeys(optionValues);\n var optionValuesLength = optionValuesKeys.length;\n for (var index = 0; index < optionValuesLength; index++) {\n var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];\n var value = optionValues[key];\n\n var locals = getLocals(optionValues[key], key);\n var selectValue = getTrackByValueFn(optionValues[key], locals);\n watchedArray.push(selectValue);\n\n // Only need to watch the displayFn if there is a specific label expression\n if (match[2] || match[1]) {\n var label = displayFn(scope, locals);\n watchedArray.push(label);\n }\n\n // Only need to watch the disableWhenFn if there is a specific disable expression\n if (match[4]) {\n var disableWhen = disableWhenFn(scope, locals);\n watchedArray.push(disableWhen);\n }\n }\n return watchedArray;\n }),\n\n getOptions: function() {\n\n var optionItems = [];\n var selectValueMap = {};\n\n // The option values were already computed in the `getWatchables` fn,\n // which must have been called to trigger `getOptions`\n var optionValues = valuesFn(scope) || [];\n var optionValuesKeys = getOptionValuesKeys(optionValues);\n var optionValuesLength = optionValuesKeys.length;\n\n for (var index = 0; index < optionValuesLength; index++) {\n var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];\n var value = optionValues[key];\n var locals = getLocals(value, key);\n var viewValue = viewValueFn(scope, locals);\n var selectValue = getTrackByValueFn(viewValue, locals);\n var label = displayFn(scope, locals);\n var group = groupByFn(scope, locals);\n var disabled = disableWhenFn(scope, locals);\n var optionItem = new Option(selectValue, viewValue, label, group, disabled);\n\n optionItems.push(optionItem);\n selectValueMap[selectValue] = optionItem;\n }\n\n return {\n items: optionItems,\n selectValueMap: selectValueMap,\n getOptionFromViewValue: function(value) {\n return selectValueMap[getTrackByValue(value)];\n },\n getViewValueFromOption: function(option) {\n // If the viewValue could be an object that may be mutated by the application,\n // we need to make a copy and not return the reference to the value on the option.\n return trackBy ? angular.copy(option.viewValue) : option.viewValue;\n }\n };\n }\n };\n }\n\n\n // we can't just jqLite('<option>') since jqLite is not smart enough\n // to create it in <select> and IE barfs otherwise.\n var optionTemplate = document.createElement('option'),\n optGroupTemplate = document.createElement('optgroup');\n\n function ngOptionsPostLink(scope, selectElement, attr, ctrls) {\n\n var selectCtrl = ctrls[0];\n var ngModelCtrl = ctrls[1];\n var multiple = attr.multiple;\n\n // The emptyOption allows the application developer to provide their own custom \"empty\"\n // option when the viewValue does not match any of the option values.\n var emptyOption;\n for (var i = 0, children = selectElement.children(), ii = children.length; i < ii; i++) {\n if (children[i].value === '') {\n emptyOption = children.eq(i);\n break;\n }\n }\n\n var providedEmptyOption = !!emptyOption;\n\n var unknownOption = jqLite(optionTemplate.cloneNode(false));\n unknownOption.val('?');\n\n var options;\n var ngOptions = parseOptionsExpression(attr.ngOptions, selectElement, scope);\n\n\n var renderEmptyOption = function() {\n if (!providedEmptyOption) {\n selectElement.prepend(emptyOption);\n }\n selectElement.val('');\n emptyOption.prop('selected', true); // needed for IE\n emptyOption.attr('selected', true);\n };\n\n var removeEmptyOption = function() {\n if (!providedEmptyOption) {\n emptyOption.remove();\n }\n };\n\n\n var renderUnknownOption = function() {\n selectElement.prepend(unknownOption);\n selectElement.val('?');\n unknownOption.prop('selected', true); // needed for IE\n unknownOption.attr('selected', true);\n };\n\n var removeUnknownOption = function() {\n unknownOption.remove();\n };\n\n // Update the controller methods for multiple selectable options\n if (!multiple) {\n\n selectCtrl.writeValue = function writeNgOptionsValue(value) {\n var option = options.getOptionFromViewValue(value);\n\n if (option && !option.disabled) {\n if (selectElement[0].value !== option.selectValue) {\n removeUnknownOption();\n removeEmptyOption();\n\n selectElement[0].value = option.selectValue;\n option.element.selected = true;\n option.element.setAttribute('selected', 'selected');\n }\n } else {\n if (value === null || providedEmptyOption) {\n removeUnknownOption();\n renderEmptyOption();\n } else {\n removeEmptyOption();\n renderUnknownOption();\n }\n }\n };\n\n selectCtrl.readValue = function readNgOptionsValue() {\n\n var selectedOption = options.selectValueMap[selectElement.val()];\n\n if (selectedOption && !selectedOption.disabled) {\n removeEmptyOption();\n removeUnknownOption();\n return options.getViewValueFromOption(selectedOption);\n }\n return null;\n };\n\n // If we are using `track by` then we must watch the tracked value on the model\n // since ngModel only watches for object identity change\n if (ngOptions.trackBy) {\n scope.$watch(\n function() { return ngOptions.getTrackByValue(ngModelCtrl.$viewValue); },\n function() { ngModelCtrl.$render(); }\n );\n }\n\n } else {\n\n ngModelCtrl.$isEmpty = function(value) {\n return !value || value.length === 0;\n };\n\n\n selectCtrl.writeValue = function writeNgOptionsMultiple(value) {\n options.items.forEach(function(option) {\n option.element.selected = false;\n });\n\n if (value) {\n value.forEach(function(item) {\n var option = options.getOptionFromViewValue(item);\n if (option && !option.disabled) option.element.selected = true;\n });\n }\n };\n\n\n selectCtrl.readValue = function readNgOptionsMultiple() {\n var selectedValues = selectElement.val() || [],\n selections = [];\n\n forEach(selectedValues, function(value) {\n var option = options.selectValueMap[value];\n if (option && !option.disabled) selections.push(options.getViewValueFromOption(option));\n });\n\n return selections;\n };\n\n // If we are using `track by` then we must watch these tracked values on the model\n // since ngModel only watches for object identity change\n if (ngOptions.trackBy) {\n\n scope.$watchCollection(function() {\n if (isArray(ngModelCtrl.$viewValue)) {\n return ngModelCtrl.$viewValue.map(function(value) {\n return ngOptions.getTrackByValue(value);\n });\n }\n }, function() {\n ngModelCtrl.$render();\n });\n\n }\n }\n\n\n if (providedEmptyOption) {\n\n // we need to remove it before calling selectElement.empty() because otherwise IE will\n // remove the label from the element. wtf?\n emptyOption.remove();\n\n // compile the element since there might be bindings in it\n $compile(emptyOption)(scope);\n\n // remove the class, which is added automatically because we recompile the element and it\n // becomes the compilation root\n emptyOption.removeClass('ng-scope');\n } else {\n emptyOption = jqLite(optionTemplate.cloneNode(false));\n }\n\n // We need to do this here to ensure that the options object is defined\n // when we first hit it in writeNgOptionsValue\n updateOptions();\n\n // We will re-render the option elements if the option values or labels change\n scope.$watchCollection(ngOptions.getWatchables, updateOptions);\n\n // ------------------------------------------------------------------ //\n\n\n function updateOptionElement(option, element) {\n option.element = element;\n element.disabled = option.disabled;\n // NOTE: The label must be set before the value, otherwise IE10/11/EDGE create unresponsive\n // selects in certain circumstances when multiple selects are next to each other and display\n // the option list in listbox style, i.e. the select is [multiple], or specifies a [size].\n // See https://github.com/angular/angular.js/issues/11314 for more info.\n // This is unfortunately untestable with unit / e2e tests\n if (option.label !== element.label) {\n element.label = option.label;\n element.textContent = option.label;\n }\n if (option.value !== element.value) element.value = option.selectValue;\n }\n\n function addOrReuseElement(parent, current, type, templateElement) {\n var element;\n // Check whether we can reuse the next element\n if (current && lowercase(current.nodeName) === type) {\n // The next element is the right type so reuse it\n element = current;\n } else {\n // The next element is not the right type so create a new one\n element = templateElement.cloneNode(false);\n if (!current) {\n // There are no more elements so just append it to the select\n parent.appendChild(element);\n } else {\n // The next element is not a group so insert the new one\n parent.insertBefore(element, current);\n }\n }\n return element;\n }\n\n\n function removeExcessElements(current) {\n var next;\n while (current) {\n next = current.nextSibling;\n jqLiteRemove(current);\n current = next;\n }\n }\n\n\n function skipEmptyAndUnknownOptions(current) {\n var emptyOption_ = emptyOption && emptyOption[0];\n var unknownOption_ = unknownOption && unknownOption[0];\n\n // We cannot rely on the extracted empty option being the same as the compiled empty option,\n // because the compiled empty option might have been replaced by a comment because\n // it had an \"element\" transclusion directive on it (such as ngIf)\n if (emptyOption_ || unknownOption_) {\n while (current &&\n (current === emptyOption_ ||\n current === unknownOption_ ||\n current.nodeType === NODE_TYPE_COMMENT ||\n (nodeName_(current) === 'option' && current.value === ''))) {\n current = current.nextSibling;\n }\n }\n return current;\n }\n\n\n function updateOptions() {\n\n var previousValue = options && selectCtrl.readValue();\n\n options = ngOptions.getOptions();\n\n var groupMap = {};\n var currentElement = selectElement[0].firstChild;\n\n // Ensure that the empty option is always there if it was explicitly provided\n if (providedEmptyOption) {\n selectElement.prepend(emptyOption);\n }\n\n currentElement = skipEmptyAndUnknownOptions(currentElement);\n\n options.items.forEach(function updateOption(option) {\n var group;\n var groupElement;\n var optionElement;\n\n if (isDefined(option.group)) {\n\n // This option is to live in a group\n // See if we have already created this group\n group = groupMap[option.group];\n\n if (!group) {\n\n // We have not already created this group\n groupElement = addOrReuseElement(selectElement[0],\n currentElement,\n 'optgroup',\n optGroupTemplate);\n // Move to the next element\n currentElement = groupElement.nextSibling;\n\n // Update the label on the group element\n groupElement.label = option.group;\n\n // Store it for use later\n group = groupMap[option.group] = {\n groupElement: groupElement,\n currentOptionElement: groupElement.firstChild\n };\n\n }\n\n // So now we have a group for this option we add the option to the group\n optionElement = addOrReuseElement(group.groupElement,\n group.currentOptionElement,\n 'option',\n optionTemplate);\n updateOptionElement(option, optionElement);\n // Move to the next element\n group.currentOptionElement = optionElement.nextSibling;\n\n } else {\n\n // This option is not in a group\n optionElement = addOrReuseElement(selectElement[0],\n currentElement,\n 'option',\n optionTemplate);\n updateOptionElement(option, optionElement);\n // Move to the next element\n currentElement = optionElement.nextSibling;\n }\n });\n\n\n // Now remove all excess options and group\n Object.keys(groupMap).forEach(function(key) {\n removeExcessElements(groupMap[key].currentOptionElement);\n });\n removeExcessElements(currentElement);\n\n ngModelCtrl.$render();\n\n // Check to see if the value has changed due to the update to the options\n if (!ngModelCtrl.$isEmpty(previousValue)) {\n var nextValue = selectCtrl.readValue();\n var isNotPrimitive = ngOptions.trackBy || multiple;\n if (isNotPrimitive ? !equals(previousValue, nextValue) : previousValue !== nextValue) {\n ngModelCtrl.$setViewValue(nextValue);\n ngModelCtrl.$render();\n }\n }\n\n }\n }\n\n return {\n restrict: 'A',\n terminal: true,\n require: ['select', 'ngModel'],\n link: {\n pre: function ngOptionsPreLink(scope, selectElement, attr, ctrls) {\n // Deactivate the SelectController.register method to prevent\n // option directives from accidentally registering themselves\n // (and unwanted $destroy handlers etc.)\n ctrls[0].registerOption = noop;\n },\n post: ngOptionsPostLink\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngPluralize\n * @restrict EA\n *\n * @description\n * `ngPluralize` is a directive that displays messages according to en-US localization rules.\n * These rules are bundled with angular.js, but can be overridden\n * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive\n * by specifying the mappings between\n * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)\n * and the strings to be displayed.\n *\n * # Plural categories and explicit number rules\n * There are two\n * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)\n * in Angular's default en-US locale: \"one\" and \"other\".\n *\n * While a plural category may match many numbers (for example, in en-US locale, \"other\" can match\n * any number that is not 1), an explicit number rule can only match one number. For example, the\n * explicit number rule for \"3\" matches the number 3. There are examples of plural categories\n * and explicit number rules throughout the rest of this documentation.\n *\n * # Configuring ngPluralize\n * You configure ngPluralize by providing 2 attributes: `count` and `when`.\n * You can also provide an optional attribute, `offset`.\n *\n * The value of the `count` attribute can be either a string or an {@link guide/expression\n * Angular expression}; these are evaluated on the current scope for its bound value.\n *\n * The `when` attribute specifies the mappings between plural categories and the actual\n * string to be displayed. The value of the attribute should be a JSON object.\n *\n * The following example shows how to configure ngPluralize:\n *\n * ```html\n * <ng-pluralize count=\"personCount\"\n when=\"{'0': 'Nobody is viewing.',\n * 'one': '1 person is viewing.',\n * 'other': '{} people are viewing.'}\">\n * </ng-pluralize>\n *```\n *\n * In the example, `\"0: Nobody is viewing.\"` is an explicit number rule. If you did not\n * specify this rule, 0 would be matched to the \"other\" category and \"0 people are viewing\"\n * would be shown instead of \"Nobody is viewing\". You can specify an explicit number rule for\n * other numbers, for example 12, so that instead of showing \"12 people are viewing\", you can\n * show \"a dozen people are viewing\".\n *\n * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted\n * into pluralized strings. In the previous example, Angular will replace `{}` with\n * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder\n * for <span ng-non-bindable>{{numberExpression}}</span>.\n *\n * If no rule is defined for a category, then an empty string is displayed and a warning is generated.\n * Note that some locales define more categories than `one` and `other`. For example, fr-fr defines `few` and `many`.\n *\n * # Configuring ngPluralize with offset\n * The `offset` attribute allows further customization of pluralized text, which can result in\n * a better user experience. For example, instead of the message \"4 people are viewing this document\",\n * you might display \"John, Kate and 2 others are viewing this document\".\n * The offset attribute allows you to offset a number by any desired value.\n * Let's take a look at an example:\n *\n * ```html\n * <ng-pluralize count=\"personCount\" offset=2\n * when=\"{'0': 'Nobody is viewing.',\n * '1': '{{person1}} is viewing.',\n * '2': '{{person1}} and {{person2}} are viewing.',\n * 'one': '{{person1}}, {{person2}} and one other person are viewing.',\n * 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}\">\n * </ng-pluralize>\n * ```\n *\n * Notice that we are still using two plural categories(one, other), but we added\n * three explicit number rules 0, 1 and 2.\n * When one person, perhaps John, views the document, \"John is viewing\" will be shown.\n * When three people view the document, no explicit number rule is found, so\n * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.\n * In this case, plural category 'one' is matched and \"John, Mary and one other person are viewing\"\n * is shown.\n *\n * Note that when you specify offsets, you must provide explicit number rules for\n * numbers from 0 up to and including the offset. If you use an offset of 3, for example,\n * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for\n * plural categories \"one\" and \"other\".\n *\n * @param {string|expression} count The variable to be bound to.\n * @param {string} when The mapping between plural category to its corresponding strings.\n * @param {number=} offset Offset to deduct from the total number.\n *\n * @example\n <example module=\"pluralizeExample\">\n <file name=\"index.html\">\n <script>\n angular.module('pluralizeExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.person1 = 'Igor';\n $scope.person2 = 'Misko';\n $scope.personCount = 1;\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>Person 1:<input type=\"text\" ng-model=\"person1\" value=\"Igor\" /></label><br/>\n <label>Person 2:<input type=\"text\" ng-model=\"person2\" value=\"Misko\" /></label><br/>\n <label>Number of People:<input type=\"text\" ng-model=\"personCount\" value=\"1\" /></label><br/>\n\n <!--- Example with simple pluralization rules for en locale --->\n Without Offset:\n <ng-pluralize count=\"personCount\"\n when=\"{'0': 'Nobody is viewing.',\n 'one': '1 person is viewing.',\n 'other': '{} people are viewing.'}\">\n </ng-pluralize><br>\n\n <!--- Example with offset --->\n With Offset(2):\n <ng-pluralize count=\"personCount\" offset=2\n when=\"{'0': 'Nobody is viewing.',\n '1': '{{person1}} is viewing.',\n '2': '{{person1}} and {{person2}} are viewing.',\n 'one': '{{person1}}, {{person2}} and one other person are viewing.',\n 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}\">\n </ng-pluralize>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should show correct pluralized string', function() {\n var withoutOffset = element.all(by.css('ng-pluralize')).get(0);\n var withOffset = element.all(by.css('ng-pluralize')).get(1);\n var countInput = element(by.model('personCount'));\n\n expect(withoutOffset.getText()).toEqual('1 person is viewing.');\n expect(withOffset.getText()).toEqual('Igor is viewing.');\n\n countInput.clear();\n countInput.sendKeys('0');\n\n expect(withoutOffset.getText()).toEqual('Nobody is viewing.');\n expect(withOffset.getText()).toEqual('Nobody is viewing.');\n\n countInput.clear();\n countInput.sendKeys('2');\n\n expect(withoutOffset.getText()).toEqual('2 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor and Misko are viewing.');\n\n countInput.clear();\n countInput.sendKeys('3');\n\n expect(withoutOffset.getText()).toEqual('3 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.');\n\n countInput.clear();\n countInput.sendKeys('4');\n\n expect(withoutOffset.getText()).toEqual('4 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.');\n });\n it('should show data-bound names', function() {\n var withOffset = element.all(by.css('ng-pluralize')).get(1);\n var personCount = element(by.model('personCount'));\n var person1 = element(by.model('person1'));\n var person2 = element(by.model('person2'));\n personCount.clear();\n personCount.sendKeys('4');\n person1.clear();\n person1.sendKeys('Di');\n person2.clear();\n person2.sendKeys('Vojta');\n expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.');\n });\n </file>\n </example>\n */\nvar ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) {\n var BRACE = /{}/g,\n IS_WHEN = /^when(Minus)?(.+)$/;\n\n return {\n link: function(scope, element, attr) {\n var numberExp = attr.count,\n whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs\n offset = attr.offset || 0,\n whens = scope.$eval(whenExp) || {},\n whensExpFns = {},\n startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol,\n watchRemover = angular.noop,\n lastCount;\n\n forEach(attr, function(expression, attributeName) {\n var tmpMatch = IS_WHEN.exec(attributeName);\n if (tmpMatch) {\n var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]);\n whens[whenKey] = element.attr(attr.$attr[attributeName]);\n }\n });\n forEach(whens, function(expression, key) {\n whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement));\n\n });\n\n scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) {\n var count = parseFloat(newVal);\n var countIsNaN = isNaN(count);\n\n if (!countIsNaN && !(count in whens)) {\n // If an explicit number rule such as 1, 2, 3... is defined, just use it.\n // Otherwise, check it against pluralization rules in $locale service.\n count = $locale.pluralCat(count - offset);\n }\n\n // If both `count` and `lastCount` are NaN, we don't need to re-register a watch.\n // In JS `NaN !== NaN`, so we have to explicitly check.\n if ((count !== lastCount) && !(countIsNaN && isNumber(lastCount) && isNaN(lastCount))) {\n watchRemover();\n var whenExpFn = whensExpFns[count];\n if (isUndefined(whenExpFn)) {\n if (newVal != null) {\n $log.debug(\"ngPluralize: no rule defined for '\" + count + \"' in \" + whenExp);\n }\n watchRemover = noop;\n updateElementText();\n } else {\n watchRemover = scope.$watch(whenExpFn, updateElementText);\n }\n lastCount = count;\n }\n });\n\n function updateElementText(newText) {\n element.text(newText || '');\n }\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngRepeat\n * @multiElement\n *\n * @description\n * The `ngRepeat` directive instantiates a template once per item from a collection. Each template\n * instance gets its own scope, where the given loop variable is set to the current collection item,\n * and `$index` is set to the item index or key.\n *\n * Special properties are exposed on the local scope of each template instance, including:\n *\n * | Variable | Type | Details |\n * |-----------|-----------------|-----------------------------------------------------------------------------|\n * | `$index` | {@type number} | iterator offset of the repeated element (0..length-1) |\n * | `$first` | {@type boolean} | true if the repeated element is first in the iterator. |\n * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. |\n * | `$last` | {@type boolean} | true if the repeated element is last in the iterator. |\n * | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). |\n * | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). |\n *\n * <div class=\"alert alert-info\">\n * Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}.\n * This may be useful when, for instance, nesting ngRepeats.\n * </div>\n *\n *\n * # Iterating over object properties\n *\n * It is possible to get `ngRepeat` to iterate over the properties of an object using the following\n * syntax:\n *\n * ```js\n * <div ng-repeat=\"(key, value) in myObj\"> ... </div>\n * ```\n *\n * You need to be aware that the JavaScript specification does not define the order of keys\n * returned for an object. (To mitigate this in Angular 1.3 the `ngRepeat` directive\n * used to sort the keys alphabetically.)\n *\n * Version 1.4 removed the alphabetic sorting. We now rely on the order returned by the browser\n * when running `for key in myObj`. It seems that browsers generally follow the strategy of providing\n * keys in the order in which they were defined, although there are exceptions when keys are deleted\n * and reinstated. See the [MDN page on `delete` for more info](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#Cross-browser_notes).\n *\n * If this is not desired, the recommended workaround is to convert your object into an array\n * that is sorted into the order that you prefer before providing it to `ngRepeat`. You could\n * do this with a filter such as [toArrayFilter](http://ngmodules.org/modules/angular-toArrayFilter)\n * or implement a `$watch` on the object yourself.\n *\n *\n * # Tracking and Duplicates\n *\n * `ngRepeat` uses {@link $rootScope.Scope#$watchCollection $watchCollection} to detect changes in\n * the collection. When a change happens, ngRepeat then makes the corresponding changes to the DOM:\n *\n * * When an item is added, a new instance of the template is added to the DOM.\n * * When an item is removed, its template instance is removed from the DOM.\n * * When items are reordered, their respective templates are reordered in the DOM.\n *\n * To minimize creation of DOM elements, `ngRepeat` uses a function\n * to \"keep track\" of all items in the collection and their corresponding DOM elements.\n * For example, if an item is added to the collection, ngRepeat will know that all other items\n * already have DOM elements, and will not re-render them.\n *\n * The default tracking function (which tracks items by their identity) does not allow\n * duplicate items in arrays. This is because when there are duplicates, it is not possible\n * to maintain a one-to-one mapping between collection items and DOM elements.\n *\n * If you do need to repeat duplicate items, you can substitute the default tracking behavior\n * with your own using the `track by` expression.\n *\n * For example, you may track items by the index of each item in the collection, using the\n * special scope property `$index`:\n * ```html\n * <div ng-repeat=\"n in [42, 42, 43, 43] track by $index\">\n * {{n}}\n * </div>\n * ```\n *\n * You may also use arbitrary expressions in `track by`, including references to custom functions\n * on the scope:\n * ```html\n * <div ng-repeat=\"n in [42, 42, 43, 43] track by myTrackingFunction(n)\">\n * {{n}}\n * </div>\n * ```\n *\n * <div class=\"alert alert-success\">\n * If you are working with objects that have an identifier property, you should track\n * by the identifier instead of the whole object. Should you reload your data later, `ngRepeat`\n * will not have to rebuild the DOM elements for items it has already rendered, even if the\n * JavaScript objects in the collection have been substituted for new ones. For large collections,\n * this significantly improves rendering performance. If you don't have a unique identifier,\n * `track by $index` can also provide a performance boost.\n * </div>\n * ```html\n * <div ng-repeat=\"model in collection track by model.id\">\n * {{model.name}}\n * </div>\n * ```\n *\n * When no `track by` expression is provided, it is equivalent to tracking by the built-in\n * `$id` function, which tracks items by their identity:\n * ```html\n * <div ng-repeat=\"obj in collection track by $id(obj)\">\n * {{obj.prop}}\n * </div>\n * ```\n *\n * <div class=\"alert alert-warning\">\n * **Note:** `track by` must always be the last expression:\n * </div>\n * ```\n * <div ng-repeat=\"model in collection | orderBy: 'id' as filtered_result track by model.id\">\n * {{model.name}}\n * </div>\n * ```\n *\n * # Special repeat start and end points\n * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending\n * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.\n * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)\n * up to and including the ending HTML tag where **ng-repeat-end** is placed.\n *\n * The example below makes use of this feature:\n * ```html\n * <header ng-repeat-start=\"item in items\">\n * Header {{ item }}\n * </header>\n * <div class=\"body\">\n * Body {{ item }}\n * </div>\n * <footer ng-repeat-end>\n * Footer {{ item }}\n * </footer>\n * ```\n *\n * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:\n * ```html\n * <header>\n * Header A\n * </header>\n * <div class=\"body\">\n * Body A\n * </div>\n * <footer>\n * Footer A\n * </footer>\n * <header>\n * Header B\n * </header>\n * <div class=\"body\">\n * Body B\n * </div>\n * <footer>\n * Footer B\n * </footer>\n * ```\n *\n * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such\n * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).\n *\n * @animations\n * **.enter** - when a new item is added to the list or when an item is revealed after a filter\n *\n * **.leave** - when an item is removed from the list or when an item is filtered out\n *\n * **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered\n *\n * See the example below for defining CSS animations with ngRepeat.\n *\n * @element ANY\n * @scope\n * @priority 1000\n * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These\n * formats are currently supported:\n *\n * * `variable in expression` – where variable is the user defined loop variable and `expression`\n * is a scope expression giving the collection to enumerate.\n *\n * For example: `album in artist.albums`.\n *\n * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,\n * and `expression` is the scope expression giving the collection to enumerate.\n *\n * For example: `(name, age) in {'adam':10, 'amalie':12}`.\n *\n * * `variable in expression track by tracking_expression` – You can also provide an optional tracking expression\n * which can be used to associate the objects in the collection with the DOM elements. If no tracking expression\n * is specified, ng-repeat associates elements by identity. It is an error to have\n * more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are\n * mapped to the same DOM element, which is not possible.)\n *\n * Note that the tracking expression must come last, after any filters, and the alias expression.\n *\n * For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements\n * will be associated by item identity in the array.\n *\n * For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique\n * `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements\n * with the corresponding item in the array by identity. Moving the same object in array would move the DOM\n * element in the same way in the DOM.\n *\n * For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this\n * case the object identity does not matter. Two objects are considered equivalent as long as their `id`\n * property is same.\n *\n * For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter\n * to items in conjunction with a tracking expression.\n *\n * * `variable in expression as alias_expression` – You can also provide an optional alias expression which will then store the\n * intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message\n * when a filter is active on the repeater, but the filtered result set is empty.\n *\n * For example: `item in items | filter:x as results` will store the fragment of the repeated items as `results`, but only after\n * the items have been processed through the filter.\n *\n * Please note that `as [variable name] is not an operator but rather a part of ngRepeat micro-syntax so it can be used only at the end\n * (and not as operator, inside an expression).\n *\n * For example: `item in items | filter : x | orderBy : order | limitTo : limit as results` .\n *\n * @example\n * This example uses `ngRepeat` to display a list of people. A filter is used to restrict the displayed\n * results by name. New (entering) and removed (leaving) items are animated.\n <example module=\"ngRepeat\" name=\"ngRepeat\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"repeatController\">\n I have {{friends.length}} friends. They are:\n <input type=\"search\" ng-model=\"q\" placeholder=\"filter friends...\" aria-label=\"filter friends\" />\n <ul class=\"example-animate-container\">\n <li class=\"animate-repeat\" ng-repeat=\"friend in friends | filter:q as results\">\n [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.\n </li>\n <li class=\"animate-repeat\" ng-if=\"results.length == 0\">\n <strong>No results found...</strong>\n </li>\n </ul>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngRepeat', ['ngAnimate']).controller('repeatController', function($scope) {\n $scope.friends = [\n {name:'John', age:25, gender:'boy'},\n {name:'Jessie', age:30, gender:'girl'},\n {name:'Johanna', age:28, gender:'girl'},\n {name:'Joy', age:15, gender:'girl'},\n {name:'Mary', age:28, gender:'girl'},\n {name:'Peter', age:95, gender:'boy'},\n {name:'Sebastian', age:50, gender:'boy'},\n {name:'Erika', age:27, gender:'girl'},\n {name:'Patrick', age:40, gender:'boy'},\n {name:'Samantha', age:60, gender:'girl'}\n ];\n });\n </file>\n <file name=\"animations.css\">\n .example-animate-container {\n background:white;\n border:1px solid black;\n list-style:none;\n margin:0;\n padding:0 10px;\n }\n\n .animate-repeat {\n line-height:30px;\n list-style:none;\n box-sizing:border-box;\n }\n\n .animate-repeat.ng-move,\n .animate-repeat.ng-enter,\n .animate-repeat.ng-leave {\n transition:all linear 0.5s;\n }\n\n .animate-repeat.ng-leave.ng-leave-active,\n .animate-repeat.ng-move,\n .animate-repeat.ng-enter {\n opacity:0;\n max-height:0;\n }\n\n .animate-repeat.ng-leave,\n .animate-repeat.ng-move.ng-move-active,\n .animate-repeat.ng-enter.ng-enter-active {\n opacity:1;\n max-height:30px;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var friends = element.all(by.repeater('friend in friends'));\n\n it('should render initial data set', function() {\n expect(friends.count()).toBe(10);\n expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.');\n expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.');\n expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.');\n expect(element(by.binding('friends.length')).getText())\n .toMatch(\"I have 10 friends. They are:\");\n });\n\n it('should update repeater when filter predicate changes', function() {\n expect(friends.count()).toBe(10);\n\n element(by.model('q')).sendKeys('ma');\n\n expect(friends.count()).toBe(2);\n expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.');\n expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');\n });\n </file>\n </example>\n */\nvar ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {\n var NG_REMOVED = '$$NG_REMOVED';\n var ngRepeatMinErr = minErr('ngRepeat');\n\n var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {\n // TODO(perf): generate setters to shave off ~40ms or 1-1.5%\n scope[valueIdentifier] = value;\n if (keyIdentifier) scope[keyIdentifier] = key;\n scope.$index = index;\n scope.$first = (index === 0);\n scope.$last = (index === (arrayLength - 1));\n scope.$middle = !(scope.$first || scope.$last);\n // jshint bitwise: false\n scope.$odd = !(scope.$even = (index&1) === 0);\n // jshint bitwise: true\n };\n\n var getBlockStart = function(block) {\n return block.clone[0];\n };\n\n var getBlockEnd = function(block) {\n return block.clone[block.clone.length - 1];\n };\n\n\n return {\n restrict: 'A',\n multiElement: true,\n transclude: 'element',\n priority: 1000,\n terminal: true,\n $$tlb: true,\n compile: function ngRepeatCompile($element, $attr) {\n var expression = $attr.ngRepeat;\n var ngRepeatEndComment = document.createComment(' end ngRepeat: ' + expression + ' ');\n\n var match = expression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);\n\n if (!match) {\n throw ngRepeatMinErr('iexp', \"Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.\",\n expression);\n }\n\n var lhs = match[1];\n var rhs = match[2];\n var aliasAs = match[3];\n var trackByExp = match[4];\n\n match = lhs.match(/^(?:(\\s*[\\$\\w]+)|\\(\\s*([\\$\\w]+)\\s*,\\s*([\\$\\w]+)\\s*\\))$/);\n\n if (!match) {\n throw ngRepeatMinErr('iidexp', \"'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.\",\n lhs);\n }\n var valueIdentifier = match[3] || match[1];\n var keyIdentifier = match[2];\n\n if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||\n /^(null|undefined|this|\\$index|\\$first|\\$middle|\\$last|\\$even|\\$odd|\\$parent|\\$root|\\$id)$/.test(aliasAs))) {\n throw ngRepeatMinErr('badident', \"alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.\",\n aliasAs);\n }\n\n var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;\n var hashFnLocals = {$id: hashKey};\n\n if (trackByExp) {\n trackByExpGetter = $parse(trackByExp);\n } else {\n trackByIdArrayFn = function(key, value) {\n return hashKey(value);\n };\n trackByIdObjFn = function(key) {\n return key;\n };\n }\n\n return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {\n\n if (trackByExpGetter) {\n trackByIdExpFn = function(key, value, index) {\n // assign key, value, and $index to the locals so that they can be used in hash functions\n if (keyIdentifier) hashFnLocals[keyIdentifier] = key;\n hashFnLocals[valueIdentifier] = value;\n hashFnLocals.$index = index;\n return trackByExpGetter($scope, hashFnLocals);\n };\n }\n\n // Store a list of elements from previous run. This is a hash where key is the item from the\n // iterator, and the value is objects with following properties.\n // - scope: bound scope\n // - element: previous element.\n // - index: position\n //\n // We are using no-proto object so that we don't need to guard against inherited props via\n // hasOwnProperty.\n var lastBlockMap = createMap();\n\n //watch props\n $scope.$watchCollection(rhs, function ngRepeatAction(collection) {\n var index, length,\n previousNode = $element[0], // node that cloned nodes should be inserted after\n // initialized to the comment node anchor\n nextNode,\n // Same as lastBlockMap but it has the current state. It will become the\n // lastBlockMap on the next iteration.\n nextBlockMap = createMap(),\n collectionLength,\n key, value, // key/value of iteration\n trackById,\n trackByIdFn,\n collectionKeys,\n block, // last object information {scope, element, id}\n nextBlockOrder,\n elementsToRemove;\n\n if (aliasAs) {\n $scope[aliasAs] = collection;\n }\n\n if (isArrayLike(collection)) {\n collectionKeys = collection;\n trackByIdFn = trackByIdExpFn || trackByIdArrayFn;\n } else {\n trackByIdFn = trackByIdExpFn || trackByIdObjFn;\n // if object, extract keys, in enumeration order, unsorted\n collectionKeys = [];\n for (var itemKey in collection) {\n if (hasOwnProperty.call(collection, itemKey) && itemKey.charAt(0) !== '$') {\n collectionKeys.push(itemKey);\n }\n }\n }\n\n collectionLength = collectionKeys.length;\n nextBlockOrder = new Array(collectionLength);\n\n // locate existing items\n for (index = 0; index < collectionLength; index++) {\n key = (collection === collectionKeys) ? index : collectionKeys[index];\n value = collection[key];\n trackById = trackByIdFn(key, value, index);\n if (lastBlockMap[trackById]) {\n // found previously seen block\n block = lastBlockMap[trackById];\n delete lastBlockMap[trackById];\n nextBlockMap[trackById] = block;\n nextBlockOrder[index] = block;\n } else if (nextBlockMap[trackById]) {\n // if collision detected. restore lastBlockMap and throw an error\n forEach(nextBlockOrder, function(block) {\n if (block && block.scope) lastBlockMap[block.id] = block;\n });\n throw ngRepeatMinErr('dupes',\n \"Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}\",\n expression, trackById, value);\n } else {\n // new never before seen block\n nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};\n nextBlockMap[trackById] = true;\n }\n }\n\n // remove leftover items\n for (var blockKey in lastBlockMap) {\n block = lastBlockMap[blockKey];\n elementsToRemove = getBlockNodes(block.clone);\n $animate.leave(elementsToRemove);\n if (elementsToRemove[0].parentNode) {\n // if the element was not removed yet because of pending animation, mark it as deleted\n // so that we can ignore it later\n for (index = 0, length = elementsToRemove.length; index < length; index++) {\n elementsToRemove[index][NG_REMOVED] = true;\n }\n }\n block.scope.$destroy();\n }\n\n // we are not using forEach for perf reasons (trying to avoid #call)\n for (index = 0; index < collectionLength; index++) {\n key = (collection === collectionKeys) ? index : collectionKeys[index];\n value = collection[key];\n block = nextBlockOrder[index];\n\n if (block.scope) {\n // if we have already seen this object, then we need to reuse the\n // associated scope/element\n\n nextNode = previousNode;\n\n // skip nodes that are already pending removal via leave animation\n do {\n nextNode = nextNode.nextSibling;\n } while (nextNode && nextNode[NG_REMOVED]);\n\n if (getBlockStart(block) != nextNode) {\n // existing item which got moved\n $animate.move(getBlockNodes(block.clone), null, jqLite(previousNode));\n }\n previousNode = getBlockEnd(block);\n updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n } else {\n // new item which we don't know about\n $transclude(function ngRepeatTransclude(clone, scope) {\n block.scope = scope;\n // http://jsperf.com/clone-vs-createcomment\n var endNode = ngRepeatEndComment.cloneNode(false);\n clone[clone.length++] = endNode;\n\n // TODO(perf): support naked previousNode in `enter` to avoid creation of jqLite wrapper?\n $animate.enter(clone, null, jqLite(previousNode));\n previousNode = endNode;\n // Note: We only need the first/last node of the cloned nodes.\n // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n // by a directive with templateUrl when its template arrives.\n block.clone = clone;\n nextBlockMap[block.id] = block;\n updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n });\n }\n }\n lastBlockMap = nextBlockMap;\n });\n };\n }\n };\n}];\n\nvar NG_HIDE_CLASS = 'ng-hide';\nvar NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';\n/**\n * @ngdoc directive\n * @name ngShow\n * @multiElement\n *\n * @description\n * The `ngShow` directive shows or hides the given HTML element based on the expression\n * provided to the `ngShow` attribute. The element is shown or hidden by removing or adding\n * the `.ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined\n * in AngularJS and sets the display style to none (using an !important flag).\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * <!-- when $scope.myValue is truthy (element is visible) -->\n * <div ng-show=\"myValue\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is hidden) -->\n * <div ng-show=\"myValue\" class=\"ng-hide\"></div>\n * ```\n *\n * When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added to the class\n * attribute on the element causing it to become hidden. When truthy, the `.ng-hide` CSS class is removed\n * from the element causing the element not to appear hidden.\n *\n * ## Why is !important used?\n *\n * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector\n * can be easily overridden by heavier selectors. For example, something as simple\n * as changing the display style on a HTML list item would make hidden elements appear visible.\n * This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector\n * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the\n * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change\n * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`\n * class CSS. Note that the selector that needs to be used is actually `.ng-hide:not(.ng-hide-animate)` to cope\n * with extra animation classes that can be added.\n *\n * ```css\n * .ng-hide:not(.ng-hide-animate) {\n * /* this is just another form of hiding an element */\n * display: block!important;\n * position: absolute;\n * top: -9999px;\n * left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the display style.\n *\n * ## A note about animations with `ngShow`\n *\n * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression\n * is true and false. This system works like the animation system present with ngClass except that\n * you must also include the !important flag to override the display property\n * so that you can perform an animation when the element is hidden during the time of the animation.\n *\n * ```css\n * //\n * //a working example can be found at the bottom of this page\n * //\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n * /* this is required as of 1.3x to properly\n * apply all styling in a show/hide animation */\n * transition: 0s linear all;\n * }\n *\n * .my-element.ng-hide-add-active,\n * .my-element.ng-hide-remove-active {\n * /* the transition is defined in the active class */\n * transition: 1s linear all;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display\n * property to block during animation states--ngAnimate will handle the style toggling automatically for you.\n *\n * @animations\n * addClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible\n * removeClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden\n *\n * @element ANY\n * @param {expression} ngShow If the {@link guide/expression expression} is truthy\n * then the element is shown or hidden respectively.\n *\n * @example\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n Click me: <input type=\"checkbox\" ng-model=\"checked\" aria-label=\"Toggle ngHide\"><br/>\n <div>\n Show:\n <div class=\"check-element animate-show\" ng-show=\"checked\">\n <span class=\"glyphicon glyphicon-thumbs-up\"></span> I show up when your checkbox is checked.\n </div>\n </div>\n <div>\n Hide:\n <div class=\"check-element animate-show\" ng-hide=\"checked\">\n <span class=\"glyphicon glyphicon-thumbs-down\"></span> I hide when your checkbox is checked.\n </div>\n </div>\n </file>\n <file name=\"glyphicons.css\">\n @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);\n </file>\n <file name=\"animations.css\">\n .animate-show {\n line-height: 20px;\n opacity: 1;\n padding: 10px;\n border: 1px solid black;\n background: white;\n }\n\n .animate-show.ng-hide-add, .animate-show.ng-hide-remove {\n transition: all linear 0.5s;\n }\n\n .animate-show.ng-hide {\n line-height: 0;\n opacity: 0;\n padding: 0 10px;\n }\n\n .check-element {\n padding: 10px;\n border: 1px solid black;\n background: white;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));\n var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));\n\n it('should check ng-show / ng-hide', function() {\n expect(thumbsUp.isDisplayed()).toBeFalsy();\n expect(thumbsDown.isDisplayed()).toBeTruthy();\n\n element(by.model('checked')).click();\n\n expect(thumbsUp.isDisplayed()).toBeTruthy();\n expect(thumbsDown.isDisplayed()).toBeFalsy();\n });\n </file>\n </example>\n */\nvar ngShowDirective = ['$animate', function($animate) {\n return {\n restrict: 'A',\n multiElement: true,\n link: function(scope, element, attr) {\n scope.$watch(attr.ngShow, function ngShowWatchAction(value) {\n // we're adding a temporary, animation-specific class for ng-hide since this way\n // we can control when the element is actually displayed on screen without having\n // to have a global/greedy CSS selector that breaks when other animations are run.\n // Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845\n $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {\n tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n });\n });\n }\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngHide\n * @multiElement\n *\n * @description\n * The `ngHide` directive shows or hides the given HTML element based on the expression\n * provided to the `ngHide` attribute. The element is shown or hidden by removing or adding\n * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined\n * in AngularJS and sets the display style to none (using an !important flag).\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * <!-- when $scope.myValue is truthy (element is hidden) -->\n * <div ng-hide=\"myValue\" class=\"ng-hide\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is visible) -->\n * <div ng-hide=\"myValue\"></div>\n * ```\n *\n * When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added to the class\n * attribute on the element causing it to become hidden. When falsy, the `.ng-hide` CSS class is removed\n * from the element causing the element not to appear hidden.\n *\n * ## Why is !important used?\n *\n * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector\n * can be easily overridden by heavier selectors. For example, something as simple\n * as changing the display style on a HTML list item would make hidden elements appear visible.\n * This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector\n * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the\n * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change\n * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`\n * class in CSS:\n *\n * ```css\n * .ng-hide {\n * /* this is just another form of hiding an element */\n * display: block!important;\n * position: absolute;\n * top: -9999px;\n * left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the display style.\n *\n * ## A note about animations with `ngHide`\n *\n * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression\n * is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide`\n * CSS class is added and removed for you instead of your own CSS class.\n *\n * ```css\n * //\n * //a working example can be found at the bottom of this page\n * //\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n * transition: 0.5s linear all;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display\n * property to block during animation states--ngAnimate will handle the style toggling automatically for you.\n *\n * @animations\n * removeClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden\n * addClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a non truthy value and just before the contents are set to visible\n *\n * @element ANY\n * @param {expression} ngHide If the {@link guide/expression expression} is truthy then\n * the element is shown or hidden respectively.\n *\n * @example\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n Click me: <input type=\"checkbox\" ng-model=\"checked\" aria-label=\"Toggle ngShow\"><br/>\n <div>\n Show:\n <div class=\"check-element animate-hide\" ng-show=\"checked\">\n <span class=\"glyphicon glyphicon-thumbs-up\"></span> I show up when your checkbox is checked.\n </div>\n </div>\n <div>\n Hide:\n <div class=\"check-element animate-hide\" ng-hide=\"checked\">\n <span class=\"glyphicon glyphicon-thumbs-down\"></span> I hide when your checkbox is checked.\n </div>\n </div>\n </file>\n <file name=\"glyphicons.css\">\n @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);\n </file>\n <file name=\"animations.css\">\n .animate-hide {\n transition: all linear 0.5s;\n line-height: 20px;\n opacity: 1;\n padding: 10px;\n border: 1px solid black;\n background: white;\n }\n\n .animate-hide.ng-hide {\n line-height: 0;\n opacity: 0;\n padding: 0 10px;\n }\n\n .check-element {\n padding: 10px;\n border: 1px solid black;\n background: white;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));\n var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));\n\n it('should check ng-show / ng-hide', function() {\n expect(thumbsUp.isDisplayed()).toBeFalsy();\n expect(thumbsDown.isDisplayed()).toBeTruthy();\n\n element(by.model('checked')).click();\n\n expect(thumbsUp.isDisplayed()).toBeTruthy();\n expect(thumbsDown.isDisplayed()).toBeFalsy();\n });\n </file>\n </example>\n */\nvar ngHideDirective = ['$animate', function($animate) {\n return {\n restrict: 'A',\n multiElement: true,\n link: function(scope, element, attr) {\n scope.$watch(attr.ngHide, function ngHideWatchAction(value) {\n // The comment inside of the ngShowDirective explains why we add and\n // remove a temporary class for the show/hide animation\n $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {\n tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n });\n });\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngStyle\n * @restrict AC\n *\n * @description\n * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.\n *\n * @element ANY\n * @param {expression} ngStyle\n *\n * {@link guide/expression Expression} which evals to an\n * object whose keys are CSS style names and values are corresponding values for those CSS\n * keys.\n *\n * Since some CSS style names are not valid keys for an object, they must be quoted.\n * See the 'background-color' style in the example below.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <input type=\"button\" value=\"set color\" ng-click=\"myStyle={color:'red'}\">\n <input type=\"button\" value=\"set background\" ng-click=\"myStyle={'background-color':'blue'}\">\n <input type=\"button\" value=\"clear\" ng-click=\"myStyle={}\">\n <br/>\n <span ng-style=\"myStyle\">Sample Text</span>\n <pre>myStyle={{myStyle}}</pre>\n </file>\n <file name=\"style.css\">\n span {\n color: black;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var colorSpan = element(by.css('span'));\n\n it('should check ng-style', function() {\n expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n element(by.css('input[value=\\'set color\\']')).click();\n expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');\n element(by.css('input[value=clear]')).click();\n expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n });\n </file>\n </example>\n */\nvar ngStyleDirective = ngDirective(function(scope, element, attr) {\n scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {\n if (oldStyles && (newStyles !== oldStyles)) {\n forEach(oldStyles, function(val, style) { element.css(style, '');});\n }\n if (newStyles) element.css(newStyles);\n }, true);\n});\n\n/**\n * @ngdoc directive\n * @name ngSwitch\n * @restrict EA\n *\n * @description\n * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.\n * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location\n * as specified in the template.\n *\n * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it\n * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element\n * matches the value obtained from the evaluated expression. In other words, you define a container element\n * (where you place the directive), place an expression on the **`on=\"...\"` attribute**\n * (or the **`ng-switch=\"...\"` attribute**), define any inner elements inside of the directive and place\n * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on\n * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default\n * attribute is displayed.\n *\n * <div class=\"alert alert-info\">\n * Be aware that the attribute values to match against cannot be expressions. They are interpreted\n * as literal string values to match against.\n * For example, **`ng-switch-when=\"someVal\"`** will match against the string `\"someVal\"` not against the\n * value of the expression `$scope.someVal`.\n * </div>\n\n * @animations\n * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container\n * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM\n *\n * @usage\n *\n * ```\n * <ANY ng-switch=\"expression\">\n * <ANY ng-switch-when=\"matchValue1\">...</ANY>\n * <ANY ng-switch-when=\"matchValue2\">...</ANY>\n * <ANY ng-switch-default>...</ANY>\n * </ANY>\n * ```\n *\n *\n * @scope\n * @priority 1200\n * @param {*} ngSwitch|on expression to match against <code>ng-switch-when</code>.\n * On child elements add:\n *\n * * `ngSwitchWhen`: the case statement to match against. If match then this\n * case will be displayed. If the same match appears multiple times, all the\n * elements will be displayed.\n * * `ngSwitchDefault`: the default case when no other case match. If there\n * are multiple default cases, all of them will be displayed when no other\n * case match.\n *\n *\n * @example\n <example module=\"switchExample\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <select ng-model=\"selection\" ng-options=\"item for item in items\">\n </select>\n <code>selection={{selection}}</code>\n <hr/>\n <div class=\"animate-switch-container\"\n ng-switch on=\"selection\">\n <div class=\"animate-switch\" ng-switch-when=\"settings\">Settings Div</div>\n <div class=\"animate-switch\" ng-switch-when=\"home\">Home Span</div>\n <div class=\"animate-switch\" ng-switch-default>default</div>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('switchExample', ['ngAnimate'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.items = ['settings', 'home', 'other'];\n $scope.selection = $scope.items[0];\n }]);\n </file>\n <file name=\"animations.css\">\n .animate-switch-container {\n position:relative;\n background:white;\n border:1px solid black;\n height:40px;\n overflow:hidden;\n }\n\n .animate-switch {\n padding:10px;\n }\n\n .animate-switch.ng-animate {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n position:absolute;\n top:0;\n left:0;\n right:0;\n bottom:0;\n }\n\n .animate-switch.ng-leave.ng-leave-active,\n .animate-switch.ng-enter {\n top:-50px;\n }\n .animate-switch.ng-leave,\n .animate-switch.ng-enter.ng-enter-active {\n top:0;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var switchElem = element(by.css('[ng-switch]'));\n var select = element(by.model('selection'));\n\n it('should start in settings', function() {\n expect(switchElem.getText()).toMatch(/Settings Div/);\n });\n it('should change to home', function() {\n select.all(by.css('option')).get(1).click();\n expect(switchElem.getText()).toMatch(/Home Span/);\n });\n it('should select default', function() {\n select.all(by.css('option')).get(2).click();\n expect(switchElem.getText()).toMatch(/default/);\n });\n </file>\n </example>\n */\nvar ngSwitchDirective = ['$animate', function($animate) {\n return {\n require: 'ngSwitch',\n\n // asks for $scope to fool the BC controller module\n controller: ['$scope', function ngSwitchController() {\n this.cases = {};\n }],\n link: function(scope, element, attr, ngSwitchController) {\n var watchExpr = attr.ngSwitch || attr.on,\n selectedTranscludes = [],\n selectedElements = [],\n previousLeaveAnimations = [],\n selectedScopes = [];\n\n var spliceFactory = function(array, index) {\n return function() { array.splice(index, 1); };\n };\n\n scope.$watch(watchExpr, function ngSwitchWatchAction(value) {\n var i, ii;\n for (i = 0, ii = previousLeaveAnimations.length; i < ii; ++i) {\n $animate.cancel(previousLeaveAnimations[i]);\n }\n previousLeaveAnimations.length = 0;\n\n for (i = 0, ii = selectedScopes.length; i < ii; ++i) {\n var selected = getBlockNodes(selectedElements[i].clone);\n selectedScopes[i].$destroy();\n var promise = previousLeaveAnimations[i] = $animate.leave(selected);\n promise.then(spliceFactory(previousLeaveAnimations, i));\n }\n\n selectedElements.length = 0;\n selectedScopes.length = 0;\n\n if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {\n forEach(selectedTranscludes, function(selectedTransclude) {\n selectedTransclude.transclude(function(caseElement, selectedScope) {\n selectedScopes.push(selectedScope);\n var anchor = selectedTransclude.element;\n caseElement[caseElement.length++] = document.createComment(' end ngSwitchWhen: ');\n var block = { clone: caseElement };\n\n selectedElements.push(block);\n $animate.enter(caseElement, anchor.parent(), anchor);\n });\n });\n }\n });\n }\n };\n}];\n\nvar ngSwitchWhenDirective = ngDirective({\n transclude: 'element',\n priority: 1200,\n require: '^ngSwitch',\n multiElement: true,\n link: function(scope, element, attrs, ctrl, $transclude) {\n ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);\n ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });\n }\n});\n\nvar ngSwitchDefaultDirective = ngDirective({\n transclude: 'element',\n priority: 1200,\n require: '^ngSwitch',\n multiElement: true,\n link: function(scope, element, attr, ctrl, $transclude) {\n ctrl.cases['?'] = (ctrl.cases['?'] || []);\n ctrl.cases['?'].push({ transclude: $transclude, element: element });\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngTransclude\n * @restrict EAC\n *\n * @description\n * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.\n *\n * You can specify that you want to insert a named transclusion slot, instead of the default slot, by providing the slot name\n * as the value of the `ng-transclude` or `ng-transclude-slot` attribute.\n *\n * If the transcluded content is not empty (i.e. contains one or more DOM nodes, including whitespace text nodes), any existing\n * content of this element will be removed before the transcluded content is inserted.\n * If the transcluded content is empty, the existing content is left intact. This lets you provide fallback content in the case\n * that no transcluded content is provided.\n *\n * @element ANY\n *\n * @param {string} ngTransclude|ngTranscludeSlot the name of the slot to insert at this point. If this is not provided, is empty\n * or its value is the same as the name of the attribute then the default slot is used.\n *\n * @example\n * ### Basic transclusion\n * This example demonstrates basic transclusion of content into a component directive.\n * <example name=\"simpleTranscludeExample\" module=\"transcludeExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('transcludeExample', [])\n * .directive('pane', function(){\n * return {\n * restrict: 'E',\n * transclude: true,\n * scope: { title:'@' },\n * template: '<div style=\"border: 1px solid black;\">' +\n * '<div style=\"background-color: gray\">{{title}}</div>' +\n * '<ng-transclude></ng-transclude>' +\n * '</div>'\n * };\n * })\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.title = 'Lorem Ipsum';\n * $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <input ng-model=\"title\" aria-label=\"title\"> <br/>\n * <textarea ng-model=\"text\" aria-label=\"text\"></textarea> <br/>\n * <pane title=\"{{title}}\">{{text}}</pane>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should have transcluded', function() {\n * var titleElement = element(by.model('title'));\n * titleElement.clear();\n * titleElement.sendKeys('TITLE');\n * var textElement = element(by.model('text'));\n * textElement.clear();\n * textElement.sendKeys('TEXT');\n * expect(element(by.binding('title')).getText()).toEqual('TITLE');\n * expect(element(by.binding('text')).getText()).toEqual('TEXT');\n * });\n * </file>\n * </example>\n *\n * @example\n * ### Transclude fallback content\n * This example shows how to use `NgTransclude` with fallback content, that\n * is displayed if no transcluded content is provided.\n *\n * <example module=\"transcludeFallbackContentExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('transcludeFallbackContentExample', [])\n * .directive('myButton', function(){\n * return {\n * restrict: 'E',\n * transclude: true,\n * scope: true,\n * template: '<button style=\"cursor: pointer;\">' +\n * '<ng-transclude>' +\n * '<b style=\"color: red;\">Button1</b>' +\n * '</ng-transclude>' +\n * '</button>'\n * };\n * });\n * </script>\n * <!-- fallback button content -->\n * <my-button id=\"fallback\"></my-button>\n * <!-- modified button content -->\n * <my-button id=\"modified\">\n * <i style=\"color: green;\">Button2</i>\n * </my-button>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should have different transclude element content', function() {\n * expect(element(by.id('fallback')).getText()).toBe('Button1');\n * expect(element(by.id('modified')).getText()).toBe('Button2');\n * });\n * </file>\n * </example>\n *\n * @example\n * ### Multi-slot transclusion\n * This example demonstrates using multi-slot transclusion in a component directive.\n * <example name=\"multiSlotTranscludeExample\" module=\"multiSlotTranscludeExample\">\n * <file name=\"index.html\">\n * <style>\n * .title, .footer {\n * background-color: gray\n * }\n * </style>\n * <div ng-controller=\"ExampleController\">\n * <input ng-model=\"title\" aria-label=\"title\"> <br/>\n * <textarea ng-model=\"text\" aria-label=\"text\"></textarea> <br/>\n * <pane>\n * <pane-title><a ng-href=\"{{link}}\">{{title}}</a></pane-title>\n * <pane-body><p>{{text}}</p></pane-body>\n * </pane>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('multiSlotTranscludeExample', [])\n * .directive('pane', function(){\n * return {\n * restrict: 'E',\n * transclude: {\n * 'title': '?paneTitle',\n * 'body': 'paneBody',\n * 'footer': '?paneFooter'\n * },\n * template: '<div style=\"border: 1px solid black;\">' +\n * '<div class=\"title\" ng-transclude=\"title\">Fallback Title</div>' +\n * '<div ng-transclude=\"body\"></div>' +\n * '<div class=\"footer\" ng-transclude=\"footer\">Fallback Footer</div>' +\n * '</div>'\n * };\n * })\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.title = 'Lorem Ipsum';\n * $scope.link = \"https://google.com\";\n * $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';\n * }]);\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should have transcluded the title and the body', function() {\n * var titleElement = element(by.model('title'));\n * titleElement.clear();\n * titleElement.sendKeys('TITLE');\n * var textElement = element(by.model('text'));\n * textElement.clear();\n * textElement.sendKeys('TEXT');\n * expect(element(by.css('.title')).getText()).toEqual('TITLE');\n * expect(element(by.binding('text')).getText()).toEqual('TEXT');\n * expect(element(by.css('.footer')).getText()).toEqual('Fallback Footer');\n * });\n * </file>\n * </example>\n */\nvar ngTranscludeMinErr = minErr('ngTransclude');\nvar ngTranscludeDirective = ngDirective({\n restrict: 'EAC',\n link: function($scope, $element, $attrs, controller, $transclude) {\n\n if ($attrs.ngTransclude === $attrs.$attr.ngTransclude) {\n // If the attribute is of the form: `ng-transclude=\"ng-transclude\"`\n // then treat it like the default\n $attrs.ngTransclude = '';\n }\n\n function ngTranscludeCloneAttachFn(clone) {\n if (clone.length) {\n $element.empty();\n $element.append(clone);\n }\n }\n\n if (!$transclude) {\n throw ngTranscludeMinErr('orphan',\n 'Illegal use of ngTransclude directive in the template! ' +\n 'No parent directive that requires a transclusion found. ' +\n 'Element: {0}',\n startingTag($element));\n }\n\n // If there is no slot name defined or the slot name is not optional\n // then transclude the slot\n var slotName = $attrs.ngTransclude || $attrs.ngTranscludeSlot;\n $transclude(ngTranscludeCloneAttachFn, null, slotName);\n }\n});\n\n/**\n * @ngdoc directive\n * @name script\n * @restrict E\n *\n * @description\n * Load the content of a `<script>` element into {@link ng.$templateCache `$templateCache`}, so that the\n * template can be used by {@link ng.directive:ngInclude `ngInclude`},\n * {@link ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the\n * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be\n * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.\n *\n * @param {string} type Must be set to `'text/ng-template'`.\n * @param {string} id Cache name of the template.\n *\n * @example\n <example>\n <file name=\"index.html\">\n <script type=\"text/ng-template\" id=\"/tpl.html\">\n Content of the template.\n </script>\n\n <a ng-click=\"currentTpl='/tpl.html'\" id=\"tpl-link\">Load inlined template</a>\n <div id=\"tpl-content\" ng-include src=\"currentTpl\"></div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should load template defined inside script tag', function() {\n element(by.css('#tpl-link')).click();\n expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);\n });\n </file>\n </example>\n */\nvar scriptDirective = ['$templateCache', function($templateCache) {\n return {\n restrict: 'E',\n terminal: true,\n compile: function(element, attr) {\n if (attr.type == 'text/ng-template') {\n var templateUrl = attr.id,\n text = element[0].text;\n\n $templateCache.put(templateUrl, text);\n }\n }\n };\n}];\n\nvar noopNgModelController = { $setViewValue: noop, $render: noop };\n\nfunction chromeHack(optionElement) {\n // Workaround for https://code.google.com/p/chromium/issues/detail?id=381459\n // Adding an <option selected=\"selected\"> element to a <select required=\"required\"> should\n // automatically select the new element\n if (optionElement[0].hasAttribute('selected')) {\n optionElement[0].selected = true;\n }\n}\n\n/**\n * @ngdoc type\n * @name select.SelectController\n * @description\n * The controller for the `<select>` directive. This provides support for reading\n * and writing the selected value(s) of the control and also coordinates dynamically\n * added `<option>` elements, perhaps by an `ngRepeat` directive.\n */\nvar SelectController =\n ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {\n\n var self = this,\n optionsMap = new HashMap();\n\n // If the ngModel doesn't get provided then provide a dummy noop version to prevent errors\n self.ngModelCtrl = noopNgModelController;\n\n // The \"unknown\" option is one that is prepended to the list if the viewValue\n // does not match any of the options. When it is rendered the value of the unknown\n // option is '? XXX ?' where XXX is the hashKey of the value that is not known.\n //\n // We can't just jqLite('<option>') since jqLite is not smart enough\n // to create it in <select> and IE barfs otherwise.\n self.unknownOption = jqLite(document.createElement('option'));\n self.renderUnknownOption = function(val) {\n var unknownVal = '? ' + hashKey(val) + ' ?';\n self.unknownOption.val(unknownVal);\n $element.prepend(self.unknownOption);\n $element.val(unknownVal);\n };\n\n $scope.$on('$destroy', function() {\n // disable unknown option so that we don't do work when the whole select is being destroyed\n self.renderUnknownOption = noop;\n });\n\n self.removeUnknownOption = function() {\n if (self.unknownOption.parent()) self.unknownOption.remove();\n };\n\n\n // Read the value of the select control, the implementation of this changes depending\n // upon whether the select can have multiple values and whether ngOptions is at work.\n self.readValue = function readSingleValue() {\n self.removeUnknownOption();\n return $element.val();\n };\n\n\n // Write the value to the select control, the implementation of this changes depending\n // upon whether the select can have multiple values and whether ngOptions is at work.\n self.writeValue = function writeSingleValue(value) {\n if (self.hasOption(value)) {\n self.removeUnknownOption();\n $element.val(value);\n if (value === '') self.emptyOption.prop('selected', true); // to make IE9 happy\n } else {\n if (value == null && self.emptyOption) {\n self.removeUnknownOption();\n $element.val('');\n } else {\n self.renderUnknownOption(value);\n }\n }\n };\n\n\n // Tell the select control that an option, with the given value, has been added\n self.addOption = function(value, element) {\n // Skip comment nodes, as they only pollute the `optionsMap`\n if (element[0].nodeType === NODE_TYPE_COMMENT) return;\n\n assertNotHasOwnProperty(value, '\"option value\"');\n if (value === '') {\n self.emptyOption = element;\n }\n var count = optionsMap.get(value) || 0;\n optionsMap.put(value, count + 1);\n self.ngModelCtrl.$render();\n chromeHack(element);\n };\n\n // Tell the select control that an option, with the given value, has been removed\n self.removeOption = function(value) {\n var count = optionsMap.get(value);\n if (count) {\n if (count === 1) {\n optionsMap.remove(value);\n if (value === '') {\n self.emptyOption = undefined;\n }\n } else {\n optionsMap.put(value, count - 1);\n }\n }\n };\n\n // Check whether the select control has an option matching the given value\n self.hasOption = function(value) {\n return !!optionsMap.get(value);\n };\n\n\n self.registerOption = function(optionScope, optionElement, optionAttrs, interpolateValueFn, interpolateTextFn) {\n\n if (interpolateValueFn) {\n // The value attribute is interpolated\n var oldVal;\n optionAttrs.$observe('value', function valueAttributeObserveAction(newVal) {\n if (isDefined(oldVal)) {\n self.removeOption(oldVal);\n }\n oldVal = newVal;\n self.addOption(newVal, optionElement);\n });\n } else if (interpolateTextFn) {\n // The text content is interpolated\n optionScope.$watch(interpolateTextFn, function interpolateWatchAction(newVal, oldVal) {\n optionAttrs.$set('value', newVal);\n if (oldVal !== newVal) {\n self.removeOption(oldVal);\n }\n self.addOption(newVal, optionElement);\n });\n } else {\n // The value attribute is static\n self.addOption(optionAttrs.value, optionElement);\n }\n\n optionElement.on('$destroy', function() {\n self.removeOption(optionAttrs.value);\n self.ngModelCtrl.$render();\n });\n };\n}];\n\n/**\n * @ngdoc directive\n * @name select\n * @restrict E\n *\n * @description\n * HTML `SELECT` element with angular data-binding.\n *\n * The `select` directive is used together with {@link ngModel `ngModel`} to provide data-binding\n * between the scope and the `<select>` control (including setting default values).\n * It also handles dynamic `<option>` elements, which can be added using the {@link ngRepeat `ngRepeat}` or\n * {@link ngOptions `ngOptions`} directives.\n *\n * When an item in the `<select>` menu is selected, the value of the selected option will be bound\n * to the model identified by the `ngModel` directive. With static or repeated options, this is\n * the content of the `value` attribute or the textContent of the `<option>`, if the value attribute is missing.\n * If you want dynamic value attributes, you can use interpolation inside the value attribute.\n *\n * <div class=\"alert alert-warning\">\n * Note that the value of a `select` directive used without `ngOptions` is always a string.\n * When the model needs to be bound to a non-string value, you must either explicitly convert it\n * using a directive (see example below) or use `ngOptions` to specify the set of options.\n * This is because an option element can only be bound to string values at present.\n * </div>\n *\n * If the viewValue of `ngModel` does not match any of the options, then the control\n * will automatically add an \"unknown\" option, which it then removes when the mismatch is resolved.\n *\n * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can\n * be nested into the `<select>` element. This element will then represent the `null` or \"not selected\"\n * option. See example below for demonstration.\n *\n * <div class=\"alert alert-info\">\n * In many cases, `ngRepeat` can be used on `<option>` elements instead of {@link ng.directive:ngOptions\n * ngOptions} to achieve a similar result. However, `ngOptions` provides some benefits, such as\n * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the\n * comprehension expression, and additionally in reducing memory and increasing speed by not creating\n * a new scope for each repeated instance.\n * </div>\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} multiple Allows multiple options to be selected. The selected values will be\n * bound to the model as an array.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds required attribute and required validation constraint to\n * the element when the ngRequired expression evaluates to true. Use ngRequired instead of required\n * when you want to data-bind to the required attribute.\n * @param {string=} ngChange Angular expression to be executed when selected option(s) changes due to user\n * interaction with the select element.\n * @param {string=} ngOptions sets the options that the select is populated with and defines what is\n * set on the model on selection. See {@link ngOptions `ngOptions`}.\n *\n * @example\n * ### Simple `select` elements with static options\n *\n * <example name=\"static-select\" module=\"staticSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"singleSelect\"> Single select: </label><br>\n * <select name=\"singleSelect\" ng-model=\"data.singleSelect\">\n * <option value=\"option-1\">Option 1</option>\n * <option value=\"option-2\">Option 2</option>\n * </select><br>\n *\n * <label for=\"singleSelect\"> Single select with \"not selected\" option and dynamic option values: </label><br>\n * <select name=\"singleSelect\" id=\"singleSelect\" ng-model=\"data.singleSelect\">\n * <option value=\"\">---Please select---</option> <!-- not selected / blank option -->\n * <option value=\"{{data.option1}}\">Option 1</option> <!-- interpolation -->\n * <option value=\"option-2\">Option 2</option>\n * </select><br>\n * <button ng-click=\"forceUnknownOption()\">Force unknown option</button><br>\n * <tt>singleSelect = {{data.singleSelect}}</tt>\n *\n * <hr>\n * <label for=\"multipleSelect\"> Multiple select: </label><br>\n * <select name=\"multipleSelect\" id=\"multipleSelect\" ng-model=\"data.multipleSelect\" multiple>\n * <option value=\"option-1\">Option 1</option>\n * <option value=\"option-2\">Option 2</option>\n * <option value=\"option-3\">Option 3</option>\n * </select><br>\n * <tt>multipleSelect = {{data.multipleSelect}}</tt><br/>\n * </form>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('staticSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.data = {\n * singleSelect: null,\n * multipleSelect: [],\n * option1: 'option-1',\n * };\n *\n * $scope.forceUnknownOption = function() {\n * $scope.data.singleSelect = 'nonsense';\n * };\n * }]);\n * </file>\n *</example>\n *\n * ### Using `ngRepeat` to generate `select` options\n * <example name=\"ngrepeat-select\" module=\"ngrepeatSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"repeatSelect\"> Repeat select: </label>\n * <select name=\"repeatSelect\" id=\"repeatSelect\" ng-model=\"data.repeatSelect\">\n * <option ng-repeat=\"option in data.availableOptions\" value=\"{{option.id}}\">{{option.name}}</option>\n * </select>\n * </form>\n * <hr>\n * <tt>repeatSelect = {{data.repeatSelect}}</tt><br/>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('ngrepeatSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.data = {\n * repeatSelect: null,\n * availableOptions: [\n * {id: '1', name: 'Option A'},\n * {id: '2', name: 'Option B'},\n * {id: '3', name: 'Option C'}\n * ],\n * };\n * }]);\n * </file>\n *</example>\n *\n *\n * ### Using `select` with `ngOptions` and setting a default value\n * See the {@link ngOptions ngOptions documentation} for more `ngOptions` usage examples.\n *\n * <example name=\"select-with-default-values\" module=\"defaultValueSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"mySelect\">Make a choice:</label>\n * <select name=\"mySelect\" id=\"mySelect\"\n * ng-options=\"option.name for option in data.availableOptions track by option.id\"\n * ng-model=\"data.selectedOption\"></select>\n * </form>\n * <hr>\n * <tt>option = {{data.selectedOption}}</tt><br/>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('defaultValueSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.data = {\n * availableOptions: [\n * {id: '1', name: 'Option A'},\n * {id: '2', name: 'Option B'},\n * {id: '3', name: 'Option C'}\n * ],\n * selectedOption: {id: '3', name: 'Option C'} //This sets the default value of the select in the ui\n * };\n * }]);\n * </file>\n *</example>\n *\n *\n * ### Binding `select` to a non-string value via `ngModel` parsing / formatting\n *\n * <example name=\"select-with-non-string-options\" module=\"nonStringSelect\">\n * <file name=\"index.html\">\n * <select ng-model=\"model.id\" convert-to-number>\n * <option value=\"0\">Zero</option>\n * <option value=\"1\">One</option>\n * <option value=\"2\">Two</option>\n * </select>\n * {{ model }}\n * </file>\n * <file name=\"app.js\">\n * angular.module('nonStringSelect', [])\n * .run(function($rootScope) {\n * $rootScope.model = { id: 2 };\n * })\n * .directive('convertToNumber', function() {\n * return {\n * require: 'ngModel',\n * link: function(scope, element, attrs, ngModel) {\n * ngModel.$parsers.push(function(val) {\n * return parseInt(val, 10);\n * });\n * ngModel.$formatters.push(function(val) {\n * return '' + val;\n * });\n * }\n * };\n * });\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should initialize to model', function() {\n * var select = element(by.css('select'));\n * expect(element(by.model('model.id')).$('option:checked').getText()).toEqual('Two');\n * });\n * </file>\n * </example>\n *\n */\nvar selectDirective = function() {\n\n return {\n restrict: 'E',\n require: ['select', '?ngModel'],\n controller: SelectController,\n priority: 1,\n link: {\n pre: selectPreLink,\n post: selectPostLink\n }\n };\n\n function selectPreLink(scope, element, attr, ctrls) {\n\n // if ngModel is not defined, we don't need to do anything\n var ngModelCtrl = ctrls[1];\n if (!ngModelCtrl) return;\n\n var selectCtrl = ctrls[0];\n\n selectCtrl.ngModelCtrl = ngModelCtrl;\n\n // When the selected item(s) changes we delegate getting the value of the select control\n // to the `readValue` method, which can be changed if the select can have multiple\n // selected values or if the options are being generated by `ngOptions`\n element.on('change', function() {\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(selectCtrl.readValue());\n });\n });\n\n // If the select allows multiple values then we need to modify how we read and write\n // values from and to the control; also what it means for the value to be empty and\n // we have to add an extra watch since ngModel doesn't work well with arrays - it\n // doesn't trigger rendering if only an item in the array changes.\n if (attr.multiple) {\n\n // Read value now needs to check each option to see if it is selected\n selectCtrl.readValue = function readMultipleValue() {\n var array = [];\n forEach(element.find('option'), function(option) {\n if (option.selected) {\n array.push(option.value);\n }\n });\n return array;\n };\n\n // Write value now needs to set the selected property of each matching option\n selectCtrl.writeValue = function writeMultipleValue(value) {\n var items = new HashMap(value);\n forEach(element.find('option'), function(option) {\n option.selected = isDefined(items.get(option.value));\n });\n };\n\n // we have to do it on each watch since ngModel watches reference, but\n // we need to work of an array, so we need to see if anything was inserted/removed\n var lastView, lastViewRef = NaN;\n scope.$watch(function selectMultipleWatch() {\n if (lastViewRef === ngModelCtrl.$viewValue && !equals(lastView, ngModelCtrl.$viewValue)) {\n lastView = shallowCopy(ngModelCtrl.$viewValue);\n ngModelCtrl.$render();\n }\n lastViewRef = ngModelCtrl.$viewValue;\n });\n\n // If we are a multiple select then value is now a collection\n // so the meaning of $isEmpty changes\n ngModelCtrl.$isEmpty = function(value) {\n return !value || value.length === 0;\n };\n\n }\n }\n\n function selectPostLink(scope, element, attrs, ctrls) {\n // if ngModel is not defined, we don't need to do anything\n var ngModelCtrl = ctrls[1];\n if (!ngModelCtrl) return;\n\n var selectCtrl = ctrls[0];\n\n // We delegate rendering to the `writeValue` method, which can be changed\n // if the select can have multiple selected values or if the options are being\n // generated by `ngOptions`.\n // This must be done in the postLink fn to prevent $render to be called before\n // all nodes have been linked correctly.\n ngModelCtrl.$render = function() {\n selectCtrl.writeValue(ngModelCtrl.$viewValue);\n };\n }\n};\n\n\n// The option directive is purely designed to communicate the existence (or lack of)\n// of dynamically created (and destroyed) option elements to their containing select\n// directive via its controller.\nvar optionDirective = ['$interpolate', function($interpolate) {\n return {\n restrict: 'E',\n priority: 100,\n compile: function(element, attr) {\n if (isDefined(attr.value)) {\n // If the value attribute is defined, check if it contains an interpolation\n var interpolateValueFn = $interpolate(attr.value, true);\n } else {\n // If the value attribute is not defined then we fall back to the\n // text content of the option element, which may be interpolated\n var interpolateTextFn = $interpolate(element.text(), true);\n if (!interpolateTextFn) {\n attr.$set('value', element.text());\n }\n }\n\n return function(scope, element, attr) {\n // This is an optimization over using ^^ since we don't want to have to search\n // all the way to the root of the DOM for every single option element\n var selectCtrlName = '$selectController',\n parent = element.parent(),\n selectCtrl = parent.data(selectCtrlName) ||\n parent.parent().data(selectCtrlName); // in case we are in optgroup\n\n if (selectCtrl) {\n selectCtrl.registerOption(scope, element, attr, interpolateValueFn, interpolateTextFn);\n }\n };\n }\n };\n}];\n\nvar styleDirective = valueFn({\n restrict: 'E',\n terminal: false\n});\n\n/**\n * @ngdoc directive\n * @name ngRequired\n *\n * @description\n *\n * ngRequired adds the required {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}.\n * It is most often used for {@link input `input`} and {@link select `select`} controls, but can also be\n * applied to custom controls.\n *\n * The directive sets the `required` attribute on the element if the Angular expression inside\n * `ngRequired` evaluates to true. A special directive for setting `required` is necessary because we\n * cannot use interpolation inside `required`. See the {@link guide/interpolation interpolation guide}\n * for more info.\n *\n * The validator will set the `required` error key to true if the `required` attribute is set and\n * calling {@link ngModel.NgModelController#$isEmpty `NgModelController.$isEmpty`} with the\n * {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} returns `true`. For example, the\n * `$isEmpty()` implementation for `input[text]` checks the length of the `$viewValue`. When developing\n * custom controls, `$isEmpty()` can be overwritten to account for a $viewValue that is not string-based.\n *\n * @example\n * <example name=\"ngRequiredDirective\" module=\"ngRequiredExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('ngRequiredExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.required = true;\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <form name=\"form\">\n * <label for=\"required\">Toggle required: </label>\n * <input type=\"checkbox\" ng-model=\"required\" id=\"required\" />\n * <br>\n * <label for=\"input\">This input must be filled if `required` is true: </label>\n * <input type=\"text\" ng-model=\"model\" id=\"input\" name=\"input\" ng-required=\"required\" /><br>\n * <hr>\n * required error set? = <code>{{form.input.$error.required}}</code><br>\n * model = <code>{{model}}</code>\n * </form>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n var required = element(by.binding('form.input.$error.required'));\n var model = element(by.binding('model'));\n var input = element(by.id('input'));\n\n it('should set the required error', function() {\n expect(required.getText()).toContain('true');\n\n input.sendKeys('123');\n expect(required.getText()).not.toContain('true');\n expect(model.getText()).toContain('123');\n });\n * </file>\n * </example>\n */\nvar requiredDirective = function() {\n return {\n restrict: 'A',\n require: '?ngModel',\n link: function(scope, elm, attr, ctrl) {\n if (!ctrl) return;\n attr.required = true; // force truthy in case we are on non input element\n\n ctrl.$validators.required = function(modelValue, viewValue) {\n return !attr.required || !ctrl.$isEmpty(viewValue);\n };\n\n attr.$observe('required', function() {\n ctrl.$validate();\n });\n }\n };\n};\n\n/**\n * @ngdoc directive\n * @name ngPattern\n *\n * @description\n *\n * ngPattern adds the pattern {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}.\n * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls.\n *\n * The validator sets the `pattern` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`}\n * does not match a RegExp which is obtained by evaluating the Angular expression given in the\n * `ngPattern` attribute value:\n * * If the expression evaluates to a RegExp object, then this is used directly.\n * * If the expression evaluates to a string, then it will be converted to a RegExp after wrapping it\n * in `^` and `$` characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n *\n * <div class=\"alert alert-info\">\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * </div>\n *\n * <div class=\"alert alert-info\">\n * **Note:** This directive is also added when the plain `pattern` attribute is used, with two\n * differences:\n * <ol>\n * <li>\n * `ngPattern` does not set the `pattern` attribute and therefore HTML5 constraint validation is\n * not available.\n * </li>\n * <li>\n * The `ngPattern` attribute must be an expression, while the `pattern` value must be\n * interpolated.\n * </li>\n * </ol>\n * </div>\n *\n * @example\n * <example name=\"ngPatternDirective\" module=\"ngPatternExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('ngPatternExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.regex = '\\\\d+';\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <form name=\"form\">\n * <label for=\"regex\">Set a pattern (regex string): </label>\n * <input type=\"text\" ng-model=\"regex\" id=\"regex\" />\n * <br>\n * <label for=\"input\">This input is restricted by the current pattern: </label>\n * <input type=\"text\" ng-model=\"model\" id=\"input\" name=\"input\" ng-pattern=\"regex\" /><br>\n * <hr>\n * input valid? = <code>{{form.input.$valid}}</code><br>\n * model = <code>{{model}}</code>\n * </form>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n var model = element(by.binding('model'));\n var input = element(by.id('input'));\n\n it('should validate the input with the default pattern', function() {\n input.sendKeys('aaa');\n expect(model.getText()).not.toContain('aaa');\n\n input.clear().then(function() {\n input.sendKeys('123');\n expect(model.getText()).toContain('123');\n });\n });\n * </file>\n * </example>\n */\nvar patternDirective = function() {\n return {\n restrict: 'A',\n require: '?ngModel',\n link: function(scope, elm, attr, ctrl) {\n if (!ctrl) return;\n\n var regexp, patternExp = attr.ngPattern || attr.pattern;\n attr.$observe('pattern', function(regex) {\n if (isString(regex) && regex.length > 0) {\n regex = new RegExp('^' + regex + '$');\n }\n\n if (regex && !regex.test) {\n throw minErr('ngPattern')('noregexp',\n 'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,\n regex, startingTag(elm));\n }\n\n regexp = regex || undefined;\n ctrl.$validate();\n });\n\n ctrl.$validators.pattern = function(modelValue, viewValue) {\n // HTML5 pattern constraint validates the input value, so we validate the viewValue\n return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);\n };\n }\n };\n};\n\n/**\n * @ngdoc directive\n * @name ngMaxlength\n *\n * @description\n *\n * ngMaxlength adds the maxlength {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}.\n * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls.\n *\n * The validator sets the `maxlength` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`}\n * is longer than the integer obtained by evaluating the Angular expression given in the\n * `ngMaxlength` attribute value.\n *\n * <div class=\"alert alert-info\">\n * **Note:** This directive is also added when the plain `maxlength` attribute is used, with two\n * differences:\n * <ol>\n * <li>\n * `ngMaxlength` does not set the `maxlength` attribute and therefore HTML5 constraint\n * validation is not available.\n * </li>\n * <li>\n * The `ngMaxlength` attribute must be an expression, while the `maxlength` value must be\n * interpolated.\n * </li>\n * </ol>\n * </div>\n *\n * @example\n * <example name=\"ngMaxlengthDirective\" module=\"ngMaxlengthExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('ngMaxlengthExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.maxlength = 5;\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <form name=\"form\">\n * <label for=\"maxlength\">Set a maxlength: </label>\n * <input type=\"number\" ng-model=\"maxlength\" id=\"maxlength\" />\n * <br>\n * <label for=\"input\">This input is restricted by the current maxlength: </label>\n * <input type=\"text\" ng-model=\"model\" id=\"input\" name=\"input\" ng-maxlength=\"maxlength\" /><br>\n * <hr>\n * input valid? = <code>{{form.input.$valid}}</code><br>\n * model = <code>{{model}}</code>\n * </form>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n var model = element(by.binding('model'));\n var input = element(by.id('input'));\n\n it('should validate the input with the default maxlength', function() {\n input.sendKeys('abcdef');\n expect(model.getText()).not.toContain('abcdef');\n\n input.clear().then(function() {\n input.sendKeys('abcde');\n expect(model.getText()).toContain('abcde');\n });\n });\n * </file>\n * </example>\n */\nvar maxlengthDirective = function() {\n return {\n restrict: 'A',\n require: '?ngModel',\n link: function(scope, elm, attr, ctrl) {\n if (!ctrl) return;\n\n var maxlength = -1;\n attr.$observe('maxlength', function(value) {\n var intVal = toInt(value);\n maxlength = isNaN(intVal) ? -1 : intVal;\n ctrl.$validate();\n });\n ctrl.$validators.maxlength = function(modelValue, viewValue) {\n return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);\n };\n }\n };\n};\n\n/**\n * @ngdoc directive\n * @name ngMinlength\n *\n * @description\n *\n * ngMinlength adds the minlength {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}.\n * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls.\n *\n * The validator sets the `minlength` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`}\n * is shorter than the integer obtained by evaluating the Angular expression given in the\n * `ngMinlength` attribute value.\n *\n * <div class=\"alert alert-info\">\n * **Note:** This directive is also added when the plain `minlength` attribute is used, with two\n * differences:\n * <ol>\n * <li>\n * `ngMinlength` does not set the `minlength` attribute and therefore HTML5 constraint\n * validation is not available.\n * </li>\n * <li>\n * The `ngMinlength` value must be an expression, while the `minlength` value must be\n * interpolated.\n * </li>\n * </ol>\n * </div>\n *\n * @example\n * <example name=\"ngMinlengthDirective\" module=\"ngMinlengthExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('ngMinlengthExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.minlength = 3;\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <form name=\"form\">\n * <label for=\"minlength\">Set a minlength: </label>\n * <input type=\"number\" ng-model=\"minlength\" id=\"minlength\" />\n * <br>\n * <label for=\"input\">This input is restricted by the current minlength: </label>\n * <input type=\"text\" ng-model=\"model\" id=\"input\" name=\"input\" ng-minlength=\"minlength\" /><br>\n * <hr>\n * input valid? = <code>{{form.input.$valid}}</code><br>\n * model = <code>{{model}}</code>\n * </form>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n var model = element(by.binding('model'));\n var input = element(by.id('input'));\n\n it('should validate the input with the default minlength', function() {\n input.sendKeys('ab');\n expect(model.getText()).not.toContain('ab');\n\n input.sendKeys('abc');\n expect(model.getText()).toContain('abc');\n });\n * </file>\n * </example>\n */\nvar minlengthDirective = function() {\n return {\n restrict: 'A',\n require: '?ngModel',\n link: function(scope, elm, attr, ctrl) {\n if (!ctrl) return;\n\n var minlength = 0;\n attr.$observe('minlength', function(value) {\n minlength = toInt(value) || 0;\n ctrl.$validate();\n });\n ctrl.$validators.minlength = function(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;\n };\n }\n };\n};\n\nif (window.angular.bootstrap) {\n //AngularJS is already loaded, so we can return here...\n console.log('WARNING: Tried to load angular more than once.');\n return;\n}\n\n//try to bind to jquery now so that one can write jqLite(document).ready()\n//but we will rebind on bootstrap again.\nbindJQuery();\n\npublishExternalAPI(angular);\n\nangular.module(\"ngLocale\", [], [\"$provide\", function($provide) {\nvar PLURAL_CATEGORY = {ZERO: \"zero\", ONE: \"one\", TWO: \"two\", FEW: \"few\", MANY: \"many\", OTHER: \"other\"};\nfunction getDecimals(n) {\n n = n + '';\n var i = n.indexOf('.');\n return (i == -1) ? 0 : n.length - i - 1;\n}\n\nfunction getVF(n, opt_precision) {\n var v = opt_precision;\n\n if (undefined === v) {\n v = Math.min(getDecimals(n), 3);\n }\n\n var base = Math.pow(10, v);\n var f = ((n * base) | 0) % base;\n return {v: v, f: f};\n}\n\n$provide.value(\"$locale\", {\n \"DATETIME_FORMATS\": {\n \"AMPMS\": [\n \"AM\",\n \"PM\"\n ],\n \"DAY\": [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ],\n \"ERANAMES\": [\n \"Before Christ\",\n \"Anno Domini\"\n ],\n \"ERAS\": [\n \"BC\",\n \"AD\"\n ],\n \"FIRSTDAYOFWEEK\": 6,\n \"MONTH\": [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ],\n \"SHORTDAY\": [\n \"Sun\",\n \"Mon\",\n \"Tue\",\n \"Wed\",\n \"Thu\",\n \"Fri\",\n \"Sat\"\n ],\n \"SHORTMONTH\": [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ],\n \"STANDALONEMONTH\": [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ],\n \"WEEKENDRANGE\": [\n 5,\n 6\n ],\n \"fullDate\": \"EEEE, MMMM d, y\",\n \"longDate\": \"MMMM d, y\",\n \"medium\": \"MMM d, y h:mm:ss a\",\n \"mediumDate\": \"MMM d, y\",\n \"mediumTime\": \"h:mm:ss a\",\n \"short\": \"M/d/yy h:mm a\",\n \"shortDate\": \"M/d/yy\",\n \"shortTime\": \"h:mm a\"\n },\n \"NUMBER_FORMATS\": {\n \"CURRENCY_SYM\": \"$\",\n \"DECIMAL_SEP\": \".\",\n \"GROUP_SEP\": \",\",\n \"PATTERNS\": [\n {\n \"gSize\": 3,\n \"lgSize\": 3,\n \"maxFrac\": 3,\n \"minFrac\": 0,\n \"minInt\": 1,\n \"negPre\": \"-\",\n \"negSuf\": \"\",\n \"posPre\": \"\",\n \"posSuf\": \"\"\n },\n {\n \"gSize\": 3,\n \"lgSize\": 3,\n \"maxFrac\": 2,\n \"minFrac\": 2,\n \"minInt\": 1,\n \"negPre\": \"-\\u00a4\",\n \"negSuf\": \"\",\n \"posPre\": \"\\u00a4\",\n \"posSuf\": \"\"\n }\n ]\n },\n \"id\": \"en-us\",\n \"localeID\": \"en_US\",\n \"pluralCat\": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}\n});\n}]);\n\n jqLite(document).ready(function() {\n angularInit(document, bootstrap);\n });\n\n})(window, document);\n\n!window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend('<style type=\"text/css\">@charset \"UTF-8\";[ng\\\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');\n/**\n * @license AngularJS v1.5.0\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/* jshint ignore:start */\nvar noop = angular.noop;\nvar copy = angular.copy;\nvar extend = angular.extend;\nvar jqLite = angular.element;\nvar forEach = angular.forEach;\nvar isArray = angular.isArray;\nvar isString = angular.isString;\nvar isObject = angular.isObject;\nvar isUndefined = angular.isUndefined;\nvar isDefined = angular.isDefined;\nvar isFunction = angular.isFunction;\nvar isElement = angular.isElement;\n\nvar ELEMENT_NODE = 1;\nvar COMMENT_NODE = 8;\n\nvar ADD_CLASS_SUFFIX = '-add';\nvar REMOVE_CLASS_SUFFIX = '-remove';\nvar EVENT_CLASS_PREFIX = 'ng-';\nvar ACTIVE_CLASS_SUFFIX = '-active';\nvar PREPARE_CLASS_SUFFIX = '-prepare';\n\nvar NG_ANIMATE_CLASSNAME = 'ng-animate';\nvar NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';\n\n// Detect proper transitionend/animationend event names.\nvar CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;\n\n// If unprefixed events are not supported but webkit-prefixed are, use the latter.\n// Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.\n// Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`\n// but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.\n// Register both events in case `window.onanimationend` is not supported because of that,\n// do the same for `transitionend` as Safari is likely to exhibit similar behavior.\n// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit\n// therefore there is no reason to test anymore for other vendor prefixes:\n// http://caniuse.com/#search=transition\nif (isUndefined(window.ontransitionend) && isDefined(window.onwebkittransitionend)) {\n CSS_PREFIX = '-webkit-';\n TRANSITION_PROP = 'WebkitTransition';\n TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n} else {\n TRANSITION_PROP = 'transition';\n TRANSITIONEND_EVENT = 'transitionend';\n}\n\nif (isUndefined(window.onanimationend) && isDefined(window.onwebkitanimationend)) {\n CSS_PREFIX = '-webkit-';\n ANIMATION_PROP = 'WebkitAnimation';\n ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';\n} else {\n ANIMATION_PROP = 'animation';\n ANIMATIONEND_EVENT = 'animationend';\n}\n\nvar DURATION_KEY = 'Duration';\nvar PROPERTY_KEY = 'Property';\nvar DELAY_KEY = 'Delay';\nvar TIMING_KEY = 'TimingFunction';\nvar ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';\nvar ANIMATION_PLAYSTATE_KEY = 'PlayState';\nvar SAFE_FAST_FORWARD_DURATION_VALUE = 9999;\n\nvar ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY;\nvar ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY;\nvar TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY;\nvar TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;\n\nvar isPromiseLike = function(p) {\n return p && p.then ? true : false;\n};\n\nvar ngMinErr = angular.$$minErr('ng');\nfunction assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', \"Argument '{0}' is {1}\", (name || '?'), (reason || \"required\"));\n }\n return arg;\n}\n\nfunction mergeClasses(a,b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n}\n\nfunction packageStyles(options) {\n var styles = {};\n if (options && (options.to || options.from)) {\n styles.to = options.to;\n styles.from = options.from;\n }\n return styles;\n}\n\nfunction pendClasses(classes, fix, isPrefix) {\n var className = '';\n classes = isArray(classes)\n ? classes\n : classes && isString(classes) && classes.length\n ? classes.split(/\\s+/)\n : [];\n forEach(classes, function(klass, i) {\n if (klass && klass.length > 0) {\n className += (i > 0) ? ' ' : '';\n className += isPrefix ? fix + klass\n : klass + fix;\n }\n });\n return className;\n}\n\nfunction removeFromArray(arr, val) {\n var index = arr.indexOf(val);\n if (val >= 0) {\n arr.splice(index, 1);\n }\n}\n\nfunction stripCommentsFromElement(element) {\n if (element instanceof jqLite) {\n switch (element.length) {\n case 0:\n return [];\n break;\n\n case 1:\n // there is no point of stripping anything if the element\n // is the only element within the jqLite wrapper.\n // (it's important that we retain the element instance.)\n if (element[0].nodeType === ELEMENT_NODE) {\n return element;\n }\n break;\n\n default:\n return jqLite(extractElementNode(element));\n break;\n }\n }\n\n if (element.nodeType === ELEMENT_NODE) {\n return jqLite(element);\n }\n}\n\nfunction extractElementNode(element) {\n if (!element[0]) return element;\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType == ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction $$addClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.addClass(elm, className);\n });\n}\n\nfunction $$removeClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.removeClass(elm, className);\n });\n}\n\nfunction applyAnimationClassesFactory($$jqLite) {\n return function(element, options) {\n if (options.addClass) {\n $$addClass($$jqLite, element, options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n $$removeClass($$jqLite, element, options.removeClass);\n options.removeClass = null;\n }\n }\n}\n\nfunction prepareAnimationOptions(options) {\n options = options || {};\n if (!options.$$prepared) {\n var domOperation = options.domOperation || noop;\n options.domOperation = function() {\n options.$$domOperationFired = true;\n domOperation();\n domOperation = noop;\n };\n options.$$prepared = true;\n }\n return options;\n}\n\nfunction applyAnimationStyles(element, options) {\n applyAnimationFromStyles(element, options);\n applyAnimationToStyles(element, options);\n}\n\nfunction applyAnimationFromStyles(element, options) {\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n}\n\nfunction applyAnimationToStyles(element, options) {\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n}\n\nfunction mergeAnimationDetails(element, oldAnimation, newAnimation) {\n var target = oldAnimation.options || {};\n var newOptions = newAnimation.options || {};\n\n var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');\n var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');\n var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);\n\n if (newOptions.preparationClasses) {\n target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses);\n delete newOptions.preparationClasses;\n }\n\n // noop is basically when there is no callback; otherwise something has been set\n var realDomOperation = target.domOperation !== noop ? target.domOperation : null;\n\n extend(target, newOptions);\n\n // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this.\n if (realDomOperation) {\n target.domOperation = realDomOperation;\n }\n\n if (classes.addClass) {\n target.addClass = classes.addClass;\n } else {\n target.addClass = null;\n }\n\n if (classes.removeClass) {\n target.removeClass = classes.removeClass;\n } else {\n target.removeClass = null;\n }\n\n oldAnimation.addClass = target.addClass;\n oldAnimation.removeClass = target.removeClass;\n\n return target;\n}\n\nfunction resolveElementClasses(existing, toAdd, toRemove) {\n var ADD_CLASS = 1;\n var REMOVE_CLASS = -1;\n\n var flags = {};\n existing = splitClassesToLookup(existing);\n\n toAdd = splitClassesToLookup(toAdd);\n forEach(toAdd, function(value, key) {\n flags[key] = ADD_CLASS;\n });\n\n toRemove = splitClassesToLookup(toRemove);\n forEach(toRemove, function(value, key) {\n flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;\n });\n\n var classes = {\n addClass: '',\n removeClass: ''\n };\n\n forEach(flags, function(val, klass) {\n var prop, allow;\n if (val === ADD_CLASS) {\n prop = 'addClass';\n allow = !existing[klass];\n } else if (val === REMOVE_CLASS) {\n prop = 'removeClass';\n allow = existing[klass];\n }\n if (allow) {\n if (classes[prop].length) {\n classes[prop] += ' ';\n }\n classes[prop] += klass;\n }\n });\n\n function splitClassesToLookup(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n var obj = {};\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n }\n\n return classes;\n}\n\nfunction getDomNode(element) {\n return (element instanceof angular.element) ? element[0] : element;\n}\n\nfunction applyGeneratedPreparationClasses(element, event, options) {\n var classes = '';\n if (event) {\n classes = pendClasses(event, EVENT_CLASS_PREFIX, true);\n }\n if (options.addClass) {\n classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX));\n }\n if (options.removeClass) {\n classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX));\n }\n if (classes.length) {\n options.preparationClasses = classes;\n element.addClass(classes);\n }\n}\n\nfunction clearGeneratedClasses(element, options) {\n if (options.preparationClasses) {\n element.removeClass(options.preparationClasses);\n options.preparationClasses = null;\n }\n if (options.activeClasses) {\n element.removeClass(options.activeClasses);\n options.activeClasses = null;\n }\n}\n\nfunction blockTransitions(node, duration) {\n // we use a negative delay value since it performs blocking\n // yet it doesn't kill any existing transitions running on the\n // same element which makes this safe for class-based animations\n var value = duration ? '-' + duration + 's' : '';\n applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);\n return [TRANSITION_DELAY_PROP, value];\n}\n\nfunction blockKeyframeAnimations(node, applyBlock) {\n var value = applyBlock ? 'paused' : '';\n var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;\n applyInlineStyle(node, [key, value]);\n return [key, value];\n}\n\nfunction applyInlineStyle(node, styleTuple) {\n var prop = styleTuple[0];\n var value = styleTuple[1];\n node.style[prop] = value;\n}\n\nfunction concatWithSpace(a,b) {\n if (!a) return b;\n if (!b) return a;\n return a + ' ' + b;\n}\n\nvar $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {\n var queue, cancelFn;\n\n function scheduler(tasks) {\n // we make a copy since RAFScheduler mutates the state\n // of the passed in array variable and this would be difficult\n // to track down on the outside code\n queue = queue.concat(tasks);\n nextTick();\n }\n\n queue = scheduler.queue = [];\n\n /* waitUntilQuiet does two things:\n * 1. It will run the FINAL `fn` value only when an uncanceled RAF has passed through\n * 2. It will delay the next wave of tasks from running until the quiet `fn` has run.\n *\n * The motivation here is that animation code can request more time from the scheduler\n * before the next wave runs. This allows for certain DOM properties such as classes to\n * be resolved in time for the next animation to run.\n */\n scheduler.waitUntilQuiet = function(fn) {\n if (cancelFn) cancelFn();\n\n cancelFn = $$rAF(function() {\n cancelFn = null;\n fn();\n nextTick();\n });\n };\n\n return scheduler;\n\n function nextTick() {\n if (!queue.length) return;\n\n var items = queue.shift();\n for (var i = 0; i < items.length; i++) {\n items[i]();\n }\n\n if (!cancelFn) {\n $$rAF(function() {\n if (!cancelFn) nextTick();\n });\n }\n }\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateChildren\n * @restrict AE\n * @element ANY\n *\n * @description\n *\n * ngAnimateChildren allows you to specify that children of this element should animate even if any\n * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move`\n * (structural) animation, child elements that also have an active structural animation are not animated.\n *\n * Note that even if `ngAnimteChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).\n *\n *\n * @param {string} ngAnimateChildren If the value is empty, `true` or `on`,\n * then child animations are allowed. If the value is `false`, child animations are not allowed.\n *\n * @example\n * <example module=\"ngAnimateChildren\" name=\"ngAnimateChildren\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"mainController as main\">\n <label>Show container? <input type=\"checkbox\" ng-model=\"main.enterElement\" /></label>\n <label>Animate children? <input type=\"checkbox\" ng-model=\"main.animateChildren\" /></label>\n <hr>\n <div ng-animate-children=\"{{main.animateChildren}}\">\n <div ng-if=\"main.enterElement\" class=\"container\">\n List of items:\n <div ng-repeat=\"item in [0, 1, 2, 3]\" class=\"item\">Item {{item}}</div>\n </div>\n </div>\n </div>\n </file>\n <file name=\"animations.css\">\n\n .container.ng-enter,\n .container.ng-leave {\n transition: all ease 1.5s;\n }\n\n .container.ng-enter,\n .container.ng-leave-active {\n opacity: 0;\n }\n\n .container.ng-leave,\n .container.ng-enter-active {\n opacity: 1;\n }\n\n .item {\n background: firebrick;\n color: #FFF;\n margin-bottom: 10px;\n }\n\n .item.ng-enter,\n .item.ng-leave {\n transition: transform 1.5s ease;\n }\n\n .item.ng-enter {\n transform: translateX(50px);\n }\n\n .item.ng-enter-active {\n transform: translateX(0);\n }\n </file>\n <file name=\"script.js\">\n angular.module('ngAnimateChildren', ['ngAnimate'])\n .controller('mainController', function() {\n this.animateChildren = false;\n this.enterElement = false;\n });\n </file>\n </example>\n */\nvar $$AnimateChildrenDirective = ['$interpolate', function($interpolate) {\n return {\n link: function(scope, element, attrs) {\n var val = attrs.ngAnimateChildren;\n if (angular.isString(val) && val.length === 0) { //empty attribute\n element.data(NG_ANIMATE_CHILDREN_DATA, true);\n } else {\n // Interpolate and set the value, so that it is available to\n // animations that run right after compilation\n setData($interpolate(val)(scope));\n attrs.$observe('ngAnimateChildren', setData);\n }\n\n function setData(value) {\n value = value === 'on' || value === 'true';\n element.data(NG_ANIMATE_CHILDREN_DATA, value);\n }\n }\n };\n}];\n\nvar ANIMATE_TIMER_KEY = '$$animateCss';\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n *\n * @description\n * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes\n * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT\n * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or\n * directives to create more complex animations that can be purely driven using CSS code.\n *\n * Note that only browsers that support CSS transitions and/or keyframe animations are capable of\n * rendering animations triggered via `$animateCss` (bad news for IE9 and lower).\n *\n * ## Usage\n * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that\n * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,\n * any automatic control over cancelling animations and/or preventing animations from being run on\n * child elements will not be handled by Angular. For this to work as expected, please use `$animate` to\n * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger\n * the CSS animation.\n *\n * The example below shows how we can create a folding animation on an element using `ng-if`:\n *\n * ```html\n * <!-- notice the `fold-animation` CSS class -->\n * <div ng-if=\"onOff\" class=\"fold-animation\">\n * This element will go BOOM\n * </div>\n * <button ng-click=\"onOff=true\">Fold In</button>\n * ```\n *\n * Now we create the **JavaScript animation** that will trigger the CSS transition:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * ## More Advanced Uses\n *\n * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks\n * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code.\n *\n * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation,\n * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with\n * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order\n * to provide a working animation that will run in CSS.\n *\n * The example below showcases a more advanced version of the `.fold-animation` from the example above:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * addClass: 'red large-text pulse-twice',\n * easing: 'ease-out',\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Since we're adding/removing CSS classes then the CSS transition will also pick those up:\n *\n * ```css\n * /* since a hardcoded duration value of 1 was provided in the JavaScript animation code,\n * the CSS classes below will be transitioned despite them being defined as regular CSS classes */\n * .red { background:red; }\n * .large-text { font-size:20px; }\n *\n * /* we can also use a keyframe animation and $animateCss will make it work alongside the transition */\n * .pulse-twice {\n * animation: 0.5s pulse linear 2;\n * -webkit-animation: 0.5s pulse linear 2;\n * }\n *\n * @keyframes pulse {\n * from { transform: scale(0.5); }\n * to { transform: scale(1.5); }\n * }\n *\n * @-webkit-keyframes pulse {\n * from { -webkit-transform: scale(0.5); }\n * to { -webkit-transform: scale(1.5); }\n * }\n * ```\n *\n * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen.\n *\n * ## How the Options are handled\n *\n * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation\n * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline\n * styles using the `from` and `to` properties.\n *\n * ```js\n * var animator = $animateCss(element, {\n * from: { background:'red' },\n * to: { background:'blue' }\n * });\n * animator.start();\n * ```\n *\n * ```css\n * .rotating-animation {\n * animation:0.5s rotate linear;\n * -webkit-animation:0.5s rotate linear;\n * }\n *\n * @keyframes rotate {\n * from { transform: rotate(0deg); }\n * to { transform: rotate(360deg); }\n * }\n *\n * @-webkit-keyframes rotate {\n * from { -webkit-transform: rotate(0deg); }\n * to { -webkit-transform: rotate(360deg); }\n * }\n * ```\n *\n * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is\n * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition\n * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition\n * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied\n * and spread across the transition and keyframe animation.\n *\n * ## What is returned\n *\n * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually\n * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are\n * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties:\n *\n * ```js\n * var animator = $animateCss(element, { ... });\n * ```\n *\n * Now what do the contents of our `animator` variable look like:\n *\n * ```js\n * {\n * // starts the animation\n * start: Function,\n *\n * // ends (aborts) the animation\n * end: Function\n * }\n * ```\n *\n * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends.\n * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and styles may have been\n * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties\n * and that changing them will not reconfigure the parameters of the animation.\n *\n * ### runner.done() vs runner.then()\n * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the\n * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**.\n * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()`\n * unless you really need a digest to kick off afterwards.\n *\n * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss\n * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code).\n * Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works.\n *\n * @param {DOMElement} element the element that will be animated\n * @param {object} options the animation-related options that will be applied during the animation\n *\n * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied\n * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.)\n * * `structural` - Indicates that the `ng-` prefix will be added to the event class. Setting to `false` or omitting will turn `ng-EVENT` and\n * `ng-EVENT-active` in `EVENT` and `EVENT-active`. Unused if `event` is omitted.\n * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both).\n * * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`).\n * * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`).\n * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation.\n * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.\n * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation.\n * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation.\n * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0`\n * is provided then the animation will be skipped entirely.\n * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is\n * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value\n * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same\n * CSS delay value.\n * * `stagger` - A numeric time value representing the delay between successively animated elements\n * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.})\n * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a\n * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)\n * * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occurring on the classes being added and removed.)\n * * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once\n * the animation is closed. This is useful for when the styles are used purely for the sake of\n * the animation and do not have a lasting visual effect on the element (e.g. a collapse and open animation).\n * By default this value is set to `false`.\n *\n * @return {object} an object with start and end methods and details about the animation.\n *\n * * `start` - The method to start the animation. This will return a `Promise` when called.\n * * `end` - This method will cancel the animation and remove all applied CSS classes and styles.\n */\nvar ONE_SECOND = 1000;\nvar BASE_TEN = 10;\n\nvar ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;\nvar CLOSING_TIME_BUFFER = 1.5;\n\nvar DETECT_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n transitionProperty: TRANSITION_PROP + PROPERTY_KEY,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP,\n animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY\n};\n\nvar DETECT_STAGGER_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP\n};\n\nfunction getCssKeyframeDurationStyle(duration) {\n return [ANIMATION_DURATION_PROP, duration + 's'];\n}\n\nfunction getCssDelayStyle(delay, isKeyframeAnimation) {\n var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP;\n return [prop, delay + 's'];\n}\n\nfunction computeCssStyles($window, element, properties) {\n var styles = Object.create(null);\n var detectedStyles = $window.getComputedStyle(element) || {};\n forEach(properties, function(formalStyleName, actualStyleName) {\n var val = detectedStyles[formalStyleName];\n if (val) {\n var c = val.charAt(0);\n\n // only numerical-based values have a negative sign or digit as the first value\n if (c === '-' || c === '+' || c >= 0) {\n val = parseMaxTime(val);\n }\n\n // by setting this to null in the event that the delay is not set or is set directly as 0\n // then we can still allow for negative values to be used later on and not mistake this\n // value for being greater than any other negative value.\n if (val === 0) {\n val = null;\n }\n styles[actualStyleName] = val;\n }\n });\n\n return styles;\n}\n\nfunction parseMaxTime(str) {\n var maxValue = 0;\n var values = str.split(/\\s*,\\s*/);\n forEach(values, function(value) {\n // it's always safe to consider only second values and omit `ms` values since\n // getComputedStyle will always handle the conversion for us\n if (value.charAt(value.length - 1) == 's') {\n value = value.substring(0, value.length - 1);\n }\n value = parseFloat(value) || 0;\n maxValue = maxValue ? Math.max(value, maxValue) : value;\n });\n return maxValue;\n}\n\nfunction truthyTimingValue(val) {\n return val === 0 || val != null;\n}\n\nfunction getCssTransitionDurationStyle(duration, applyOnlyDuration) {\n var style = TRANSITION_PROP;\n var value = duration + 's';\n if (applyOnlyDuration) {\n style += DURATION_KEY;\n } else {\n value += ' linear all';\n }\n return [style, value];\n}\n\nfunction createLocalCacheLookup() {\n var cache = Object.create(null);\n return {\n flush: function() {\n cache = Object.create(null);\n },\n\n count: function(key) {\n var entry = cache[key];\n return entry ? entry.total : 0;\n },\n\n get: function(key) {\n var entry = cache[key];\n return entry && entry.value;\n },\n\n put: function(key, value) {\n if (!cache[key]) {\n cache[key] = { total: 1, value: value };\n } else {\n cache[key].total++;\n }\n }\n };\n}\n\n// we do not reassign an already present style value since\n// if we detect the style property value again we may be\n// detecting styles that were added via the `from` styles.\n// We make use of `isDefined` here since an empty string\n// or null value (which is what getPropertyValue will return\n// for a non-existing style) will still be marked as a valid\n// value for the style (a falsy value implies that the style\n// is to be removed at the end of the animation). If we had a simple\n// \"OR\" statement then it would not be enough to catch that.\nfunction registerRestorableStyles(backup, node, properties) {\n forEach(properties, function(prop) {\n backup[prop] = isDefined(backup[prop])\n ? backup[prop]\n : node.style.getPropertyValue(prop);\n });\n}\n\nvar $AnimateCssProvider = ['$animateProvider', function($animateProvider) {\n var gcsLookup = createLocalCacheLookup();\n var gcsStaggerLookup = createLocalCacheLookup();\n\n this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout',\n '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',\n function($window, $$jqLite, $$AnimateRunner, $timeout,\n $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n var parentCounter = 0;\n function gcsHashFn(node, extraClasses) {\n var KEY = \"$$ngAnimateParentKey\";\n var parentNode = node.parentNode;\n var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);\n return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;\n }\n\n function computeCachedCssStyles(node, className, cacheKey, properties) {\n var timings = gcsLookup.get(cacheKey);\n\n if (!timings) {\n timings = computeCssStyles($window, node, properties);\n if (timings.animationIterationCount === 'infinite') {\n timings.animationIterationCount = 1;\n }\n }\n\n // we keep putting this in multiple times even though the value and the cacheKey are the same\n // because we're keeping an internal tally of how many duplicate animations are detected.\n gcsLookup.put(cacheKey, timings);\n return timings;\n }\n\n function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {\n var stagger;\n\n // if we have one or more existing matches of matching elements\n // containing the same parent + CSS styles (which is how cacheKey works)\n // then staggering is possible\n if (gcsLookup.count(cacheKey) > 0) {\n stagger = gcsStaggerLookup.get(cacheKey);\n\n if (!stagger) {\n var staggerClassName = pendClasses(className, '-stagger');\n\n $$jqLite.addClass(node, staggerClassName);\n\n stagger = computeCssStyles($window, node, properties);\n\n // force the conversion of a null value to zero incase not set\n stagger.animationDuration = Math.max(stagger.animationDuration, 0);\n stagger.transitionDuration = Math.max(stagger.transitionDuration, 0);\n\n $$jqLite.removeClass(node, staggerClassName);\n\n gcsStaggerLookup.put(cacheKey, stagger);\n }\n }\n\n return stagger || {};\n }\n\n var cancelLastRAFRequest;\n var rafWaitQueue = [];\n function waitUntilQuiet(callback) {\n rafWaitQueue.push(callback);\n $$rAFScheduler.waitUntilQuiet(function() {\n gcsLookup.flush();\n gcsStaggerLookup.flush();\n\n // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable.\n // PLEASE EXAMINE THE `$$forceReflow` service to understand why.\n var pageWidth = $$forceReflow();\n\n // we use a for loop to ensure that if the queue is changed\n // during this looping then it will consider new requests\n for (var i = 0; i < rafWaitQueue.length; i++) {\n rafWaitQueue[i](pageWidth);\n }\n rafWaitQueue.length = 0;\n });\n }\n\n function computeTimings(node, className, cacheKey) {\n var timings = computeCachedCssStyles(node, className, cacheKey, DETECT_CSS_PROPERTIES);\n var aD = timings.animationDelay;\n var tD = timings.transitionDelay;\n timings.maxDelay = aD && tD\n ? Math.max(aD, tD)\n : (aD || tD);\n timings.maxDuration = Math.max(\n timings.animationDuration * timings.animationIterationCount,\n timings.transitionDuration);\n\n return timings;\n }\n\n return function init(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = prepareAnimationOptions(copy(options));\n }\n\n var restoreStyles = {};\n var node = getDomNode(element);\n if (!node\n || !node.parentNode\n || !$$animateQueue.enabled()) {\n return closeAndReturnNoopAnimator();\n }\n\n var temporaryStyles = [];\n var classes = element.attr('class');\n var styles = packageStyles(options);\n var animationClosed;\n var animationPaused;\n var animationCompleted;\n var runner;\n var runnerHost;\n var maxDelay;\n var maxDelayTime;\n var maxDuration;\n var maxDurationTime;\n var startTime;\n var events = [];\n\n if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) {\n return closeAndReturnNoopAnimator();\n }\n\n var method = options.event && isArray(options.event)\n ? options.event.join(' ')\n : options.event;\n\n var isStructural = method && options.structural;\n var structuralClassName = '';\n var addRemoveClassName = '';\n\n if (isStructural) {\n structuralClassName = pendClasses(method, EVENT_CLASS_PREFIX, true);\n } else if (method) {\n structuralClassName = method;\n }\n\n if (options.addClass) {\n addRemoveClassName += pendClasses(options.addClass, ADD_CLASS_SUFFIX);\n }\n\n if (options.removeClass) {\n if (addRemoveClassName.length) {\n addRemoveClassName += ' ';\n }\n addRemoveClassName += pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX);\n }\n\n // there may be a situation where a structural animation is combined together\n // with CSS classes that need to resolve before the animation is computed.\n // However this means that there is no explicit CSS code to block the animation\n // from happening (by setting 0s none in the class name). If this is the case\n // we need to apply the classes before the first rAF so we know to continue if\n // there actually is a detected transition or keyframe animation\n if (options.applyClassesEarly && addRemoveClassName.length) {\n applyAnimationClasses(element, options);\n }\n\n var preparationClasses = [structuralClassName, addRemoveClassName].join(' ').trim();\n var fullClassName = classes + ' ' + preparationClasses;\n var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);\n var hasToStyles = styles.to && Object.keys(styles.to).length > 0;\n var containsKeyframeAnimation = (options.keyframeStyle || '').length > 0;\n\n // there is no way we can trigger an animation if no styles and\n // no classes are being applied which would then trigger a transition,\n // unless there a is raw keyframe value that is applied to the element.\n if (!containsKeyframeAnimation\n && !hasToStyles\n && !preparationClasses) {\n return closeAndReturnNoopAnimator();\n }\n\n var cacheKey, stagger;\n if (options.stagger > 0) {\n var staggerVal = parseFloat(options.stagger);\n stagger = {\n transitionDelay: staggerVal,\n animationDelay: staggerVal,\n transitionDuration: 0,\n animationDuration: 0\n };\n } else {\n cacheKey = gcsHashFn(node, fullClassName);\n stagger = computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES);\n }\n\n if (!options.$$skipPreparationClasses) {\n $$jqLite.addClass(element, preparationClasses);\n }\n\n var applyOnlyDuration;\n\n if (options.transitionStyle) {\n var transitionStyle = [TRANSITION_PROP, options.transitionStyle];\n applyInlineStyle(node, transitionStyle);\n temporaryStyles.push(transitionStyle);\n }\n\n if (options.duration >= 0) {\n applyOnlyDuration = node.style[TRANSITION_PROP].length > 0;\n var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration);\n\n // we set the duration so that it will be picked up by getComputedStyle later\n applyInlineStyle(node, durationStyle);\n temporaryStyles.push(durationStyle);\n }\n\n if (options.keyframeStyle) {\n var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle];\n applyInlineStyle(node, keyframeStyle);\n temporaryStyles.push(keyframeStyle);\n }\n\n var itemIndex = stagger\n ? options.staggerIndex >= 0\n ? options.staggerIndex\n : gcsLookup.count(cacheKey)\n : 0;\n\n var isFirst = itemIndex === 0;\n\n // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY\n // without causing any combination of transitions to kick in. By adding a negative delay value\n // it forces the setup class' transition to end immediately. We later then remove the negative\n // transition delay to allow for the transition to naturally do it's thing. The beauty here is\n // that if there is no transition defined then nothing will happen and this will also allow\n // other transitions to be stacked on top of each other without any chopping them out.\n if (isFirst && !options.skipBlocking) {\n blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);\n }\n\n var timings = computeTimings(node, fullClassName, cacheKey);\n var relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n var flags = {};\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty == 'all';\n flags.applyTransitionDuration = hasToStyles && (\n (flags.hasTransitions && !flags.hasTransitionAll)\n || (flags.hasAnimations && !flags.hasTransitions));\n flags.applyAnimationDuration = options.duration && flags.hasAnimations;\n flags.applyTransitionDelay = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions);\n flags.applyAnimationDelay = truthyTimingValue(options.delay) && flags.hasAnimations;\n flags.recalculateTimingStyles = addRemoveClassName.length > 0;\n\n if (flags.applyTransitionDuration || flags.applyAnimationDuration) {\n maxDuration = options.duration ? parseFloat(options.duration) : maxDuration;\n\n if (flags.applyTransitionDuration) {\n flags.hasTransitions = true;\n timings.transitionDuration = maxDuration;\n applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0;\n temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration));\n }\n\n if (flags.applyAnimationDuration) {\n flags.hasAnimations = true;\n timings.animationDuration = maxDuration;\n temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration));\n }\n }\n\n if (maxDuration === 0 && !flags.recalculateTimingStyles) {\n return closeAndReturnNoopAnimator();\n }\n\n if (options.delay != null) {\n var delayStyle;\n if (typeof options.delay !== \"boolean\") {\n delayStyle = parseFloat(options.delay);\n // number in options.delay means we have to recalculate the delay for the closing timeout\n maxDelay = Math.max(delayStyle, 0);\n }\n\n if (flags.applyTransitionDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle));\n }\n\n if (flags.applyAnimationDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle, true));\n }\n }\n\n // we need to recalculate the delay value since we used a pre-emptive negative\n // delay value and the delay value is required for the final event checking. This\n // property will ensure that this will happen after the RAF phase has passed.\n if (options.duration == null && timings.transitionDuration > 0) {\n flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst;\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n if (!options.skipBlocking) {\n flags.blockTransition = timings.transitionDuration > 0;\n flags.blockKeyframeAnimation = timings.animationDuration > 0 &&\n stagger.animationDelay > 0 &&\n stagger.animationDuration === 0;\n }\n\n if (options.from) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.from));\n }\n applyAnimationFromStyles(element, options);\n }\n\n if (flags.blockTransition || flags.blockKeyframeAnimation) {\n applyBlocking(maxDuration);\n } else if (!options.skipBlocking) {\n blockTransitions(node, false);\n }\n\n // TODO(matsko): for 1.5 change this code to have an animator object for better debugging\n return {\n $$willAnimate: true,\n end: endFn,\n start: function() {\n if (animationClosed) return;\n\n runnerHost = {\n end: endFn,\n cancel: cancelFn,\n resume: null, //this will be set during the start() phase\n pause: null\n };\n\n runner = new $$AnimateRunner(runnerHost);\n\n waitUntilQuiet(start);\n\n // we don't have access to pause/resume the animation\n // since it hasn't run yet. AnimateRunner will therefore\n // set noop functions for resume and pause and they will\n // later be overridden once the animation is triggered\n return runner;\n }\n };\n\n function endFn() {\n close();\n }\n\n function cancelFn() {\n close(true);\n }\n\n function close(rejected) { // jshint ignore:line\n // if the promise has been called already then we shouldn't close\n // the animation again\n if (animationClosed || (animationCompleted && animationPaused)) return;\n animationClosed = true;\n animationPaused = false;\n\n if (!options.$$skipPreparationClasses) {\n $$jqLite.removeClass(element, preparationClasses);\n }\n $$jqLite.removeClass(element, activeClasses);\n\n blockKeyframeAnimations(node, false);\n blockTransitions(node, false);\n\n forEach(temporaryStyles, function(entry) {\n // There is only one way to remove inline style properties entirely from elements.\n // By using `removeProperty` this works, but we need to convert camel-cased CSS\n // styles down to hyphenated values.\n node.style[entry[0]] = '';\n });\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n\n if (Object.keys(restoreStyles).length) {\n forEach(restoreStyles, function(value, prop) {\n value ? node.style.setProperty(prop, value)\n : node.style.removeProperty(prop);\n });\n }\n\n // the reason why we have this option is to allow a synchronous closing callback\n // that is fired as SOON as the animation ends (when the CSS is removed) or if\n // the animation never takes off at all. A good example is a leave animation since\n // the element must be removed just after the animation is over or else the element\n // will appear on screen for one animation frame causing an overbearing flicker.\n if (options.onDone) {\n options.onDone();\n }\n\n if (events && events.length) {\n // Remove the transitionend / animationend listener(s)\n element.off(events.join(' '), onAnimationProgress);\n }\n\n //Cancel the fallback closing timeout and remove the timer data\n var animationTimerData = element.data(ANIMATE_TIMER_KEY);\n if (animationTimerData) {\n $timeout.cancel(animationTimerData[0].timer);\n element.removeData(ANIMATE_TIMER_KEY);\n }\n\n // if the preparation function fails then the promise is not setup\n if (runner) {\n runner.complete(!rejected);\n }\n }\n\n function applyBlocking(duration) {\n if (flags.blockTransition) {\n blockTransitions(node, duration);\n }\n\n if (flags.blockKeyframeAnimation) {\n blockKeyframeAnimations(node, !!duration);\n }\n }\n\n function closeAndReturnNoopAnimator() {\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: cancelFn\n });\n\n // should flush the cache animation\n waitUntilQuiet(noop);\n close();\n\n return {\n $$willAnimate: false,\n start: function() {\n return runner;\n },\n end: endFn\n };\n }\n\n function onAnimationProgress(event) {\n event.stopPropagation();\n var ev = event.originalEvent || event;\n\n // we now always use `Date.now()` due to the recent changes with\n // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info)\n var timeStamp = ev.$manualTimeStamp || Date.now();\n\n /* Firefox (or possibly just Gecko) likes to not round values up\n * when a ms measurement is used for the animation */\n var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));\n\n /* $manualTimeStamp is a mocked timeStamp value which is set\n * within browserTrigger(). This is only here so that tests can\n * mock animations properly. Real events fallback to event.timeStamp,\n * or, if they don't, then a timeStamp is automatically created for them.\n * We're checking to see if the timeStamp surpasses the expected delay,\n * but we're using elapsedTime instead of the timeStamp on the 2nd\n * pre-condition since animationPauseds sometimes close off early */\n if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n // we set this flag to ensure that if the transition is paused then, when resumed,\n // the animation will automatically close itself since transitions cannot be paused.\n animationCompleted = true;\n close();\n }\n }\n\n function start() {\n if (animationClosed) return;\n if (!node.parentNode) {\n close();\n return;\n }\n\n // even though we only pause keyframe animations here the pause flag\n // will still happen when transitions are used. Only the transition will\n // not be paused since that is not possible. If the animation ends when\n // paused then it will not complete until unpaused or cancelled.\n var playPause = function(playAnimation) {\n if (!animationCompleted) {\n animationPaused = !playAnimation;\n if (timings.animationDuration) {\n var value = blockKeyframeAnimations(node, animationPaused);\n animationPaused\n ? temporaryStyles.push(value)\n : removeFromArray(temporaryStyles, value);\n }\n } else if (animationPaused && playAnimation) {\n animationPaused = false;\n close();\n }\n };\n\n // checking the stagger duration prevents an accidentally cascade of the CSS delay style\n // being inherited from the parent. If the transition duration is zero then we can safely\n // rely that the delay value is an intentional stagger delay style.\n var maxStagger = itemIndex > 0\n && ((timings.transitionDuration && stagger.transitionDuration === 0) ||\n (timings.animationDuration && stagger.animationDuration === 0))\n && Math.max(stagger.animationDelay, stagger.transitionDelay);\n if (maxStagger) {\n $timeout(triggerAnimationStart,\n Math.floor(maxStagger * itemIndex * ONE_SECOND),\n false);\n } else {\n triggerAnimationStart();\n }\n\n // this will decorate the existing promise runner with pause/resume methods\n runnerHost.resume = function() {\n playPause(true);\n };\n\n runnerHost.pause = function() {\n playPause(false);\n };\n\n function triggerAnimationStart() {\n // just incase a stagger animation kicks in when the animation\n // itself was cancelled entirely\n if (animationClosed) return;\n\n applyBlocking(false);\n\n forEach(temporaryStyles, function(entry) {\n var key = entry[0];\n var value = entry[1];\n node.style[key] = value;\n });\n\n applyAnimationClasses(element, options);\n $$jqLite.addClass(element, activeClasses);\n\n if (flags.recalculateTimingStyles) {\n fullClassName = node.className + ' ' + preparationClasses;\n cacheKey = gcsHashFn(node, fullClassName);\n\n timings = computeTimings(node, fullClassName, cacheKey);\n relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n if (maxDuration === 0) {\n close();\n return;\n }\n\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n }\n\n if (flags.applyAnimationDelay) {\n relativeDelay = typeof options.delay !== \"boolean\" && truthyTimingValue(options.delay)\n ? parseFloat(options.delay)\n : relativeDelay;\n\n maxDelay = Math.max(relativeDelay, 0);\n timings.animationDelay = relativeDelay;\n delayStyle = getCssDelayStyle(relativeDelay, true);\n temporaryStyles.push(delayStyle);\n node.style[delayStyle[0]] = delayStyle[1];\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n\n if (options.easing) {\n var easeProp, easeVal = options.easing;\n if (flags.hasTransitions) {\n easeProp = TRANSITION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n if (flags.hasAnimations) {\n easeProp = ANIMATION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n }\n\n if (timings.transitionDuration) {\n events.push(TRANSITIONEND_EVENT);\n }\n\n if (timings.animationDuration) {\n events.push(ANIMATIONEND_EVENT);\n }\n\n startTime = Date.now();\n var timerTime = maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime;\n var endTime = startTime + timerTime;\n\n var animationsData = element.data(ANIMATE_TIMER_KEY) || [];\n var setupFallbackTimer = true;\n if (animationsData.length) {\n var currentTimerData = animationsData[0];\n setupFallbackTimer = endTime > currentTimerData.expectedEndTime;\n if (setupFallbackTimer) {\n $timeout.cancel(currentTimerData.timer);\n } else {\n animationsData.push(close);\n }\n }\n\n if (setupFallbackTimer) {\n var timer = $timeout(onAnimationExpired, timerTime, false);\n animationsData[0] = {\n timer: timer,\n expectedEndTime: endTime\n };\n animationsData.push(close);\n element.data(ANIMATE_TIMER_KEY, animationsData);\n }\n\n if (events.length) {\n element.on(events.join(' '), onAnimationProgress);\n }\n\n if (options.to) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.to));\n }\n applyAnimationToStyles(element, options);\n }\n }\n\n function onAnimationExpired() {\n var animationsData = element.data(ANIMATE_TIMER_KEY);\n\n // this will be false in the event that the element was\n // removed from the DOM (via a leave animation or something\n // similar)\n if (animationsData) {\n for (var i = 1; i < animationsData.length; i++) {\n animationsData[i]();\n }\n element.removeData(ANIMATE_TIMER_KEY);\n }\n }\n }\n };\n }];\n}];\n\nvar $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateCssDriver');\n\n var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';\n var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';\n\n var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out';\n var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in';\n\n function isDocumentFragment(node) {\n return node.parentNode && node.parentNode.nodeType === 11;\n }\n\n this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document',\n function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $sniffer, $$jqLite, $document) {\n\n // only browsers that support these properties can render animations\n if (!$sniffer.animations && !$sniffer.transitions) return noop;\n\n var bodyNode = $document[0].body;\n var rootNode = getDomNode($rootElement);\n\n var rootBodyElement = jqLite(\n // this is to avoid using something that exists outside of the body\n // we also special case the doc fragment case because our unit test code\n // appends the $rootElement to the body after the app has been bootstrapped\n isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode\n );\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n return function initDriverFn(animationDetails) {\n return animationDetails.from && animationDetails.to\n ? prepareFromToAnchorAnimation(animationDetails.from,\n animationDetails.to,\n animationDetails.classes,\n animationDetails.anchors)\n : prepareRegularAnimation(animationDetails);\n };\n\n function filterCssClasses(classes) {\n //remove all the `ng-` stuff\n return classes.replace(/\\bng-\\S+\\b/g, '');\n }\n\n function getUniqueValues(a, b) {\n if (isString(a)) a = a.split(' ');\n if (isString(b)) b = b.split(' ');\n return a.filter(function(val) {\n return b.indexOf(val) === -1;\n }).join(' ');\n }\n\n function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {\n var clone = jqLite(getDomNode(outAnchor).cloneNode(true));\n var startingClasses = filterCssClasses(getClassVal(clone));\n\n outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n\n clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME);\n\n rootBodyElement.append(clone);\n\n var animatorIn, animatorOut = prepareOutAnimation();\n\n // the user may not end up using the `out` animation and\n // only making use of the `in` animation or vice-versa.\n // In either case we should allow this and not assume the\n // animation is over unless both animations are not used.\n if (!animatorOut) {\n animatorIn = prepareInAnimation();\n if (!animatorIn) {\n return end();\n }\n }\n\n var startingAnimator = animatorOut || animatorIn;\n\n return {\n start: function() {\n var runner;\n\n var currentAnimation = startingAnimator.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n if (!animatorIn) {\n animatorIn = prepareInAnimation();\n if (animatorIn) {\n currentAnimation = animatorIn.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n end();\n runner.complete();\n });\n return currentAnimation;\n }\n }\n // in the event that there is no `in` animation\n end();\n runner.complete();\n });\n\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn\n });\n\n return runner;\n\n function endFn() {\n if (currentAnimation) {\n currentAnimation.end();\n }\n }\n }\n };\n\n function calculateAnchorStyles(anchor) {\n var styles = {};\n\n var coords = getDomNode(anchor).getBoundingClientRect();\n\n // we iterate directly since safari messes up and doesn't return\n // all the keys for the coords object when iterated\n forEach(['width','height','top','left'], function(key) {\n var value = coords[key];\n switch (key) {\n case 'top':\n value += bodyNode.scrollTop;\n break;\n case 'left':\n value += bodyNode.scrollLeft;\n break;\n }\n styles[key] = Math.floor(value) + 'px';\n });\n return styles;\n }\n\n function prepareOutAnimation() {\n var animator = $animateCss(clone, {\n addClass: NG_OUT_ANCHOR_CLASS_NAME,\n delay: true,\n from: calculateAnchorStyles(outAnchor)\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function getClassVal(element) {\n return element.attr('class') || '';\n }\n\n function prepareInAnimation() {\n var endingClasses = filterCssClasses(getClassVal(inAnchor));\n var toAdd = getUniqueValues(endingClasses, startingClasses);\n var toRemove = getUniqueValues(startingClasses, endingClasses);\n\n var animator = $animateCss(clone, {\n to: calculateAnchorStyles(inAnchor),\n addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd,\n removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove,\n delay: true\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function end() {\n clone.remove();\n outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n }\n }\n\n function prepareFromToAnchorAnimation(from, to, classes, anchors) {\n var fromAnimation = prepareRegularAnimation(from, noop);\n var toAnimation = prepareRegularAnimation(to, noop);\n\n var anchorAnimations = [];\n forEach(anchors, function(anchor) {\n var outElement = anchor['out'];\n var inElement = anchor['in'];\n var animator = prepareAnchoredAnimation(classes, outElement, inElement);\n if (animator) {\n anchorAnimations.push(animator);\n }\n });\n\n // no point in doing anything when there are no elements to animate\n if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n forEach(anchorAnimations, function(animation) {\n animationRunners.push(animation.start());\n });\n\n var runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn // CSS-driven animations cannot be cancelled, only ended\n });\n\n $$AnimateRunner.all(animationRunners, function(status) {\n runner.complete(status);\n });\n\n return runner;\n\n function endFn() {\n forEach(animationRunners, function(runner) {\n runner.end();\n });\n }\n }\n };\n }\n\n function prepareRegularAnimation(animationDetails) {\n var element = animationDetails.element;\n var options = animationDetails.options || {};\n\n if (animationDetails.structural) {\n options.event = animationDetails.event;\n options.structural = true;\n options.applyClassesEarly = true;\n\n // we special case the leave animation since we want to ensure that\n // the element is removed as soon as the animation is over. Otherwise\n // a flicker might appear or the element may not be removed at all\n if (animationDetails.event === 'leave') {\n options.onDone = options.domOperation;\n }\n }\n\n // We assign the preparationClasses as the actual animation event since\n // the internals of $animateCss will just suffix the event token values\n // with `-active` to trigger the animation.\n if (options.preparationClasses) {\n options.event = concatWithSpace(options.event, options.preparationClasses);\n }\n\n var animator = $animateCss(element, options);\n\n // the driver lookup code inside of $$animation attempts to spawn a\n // driver one by one until a driver returns a.$$willAnimate animator object.\n // $animateCss will always return an object, however, it will pass in\n // a flag as a hint as to whether an animation was detected or not\n return animator.$$willAnimate ? animator : null;\n }\n }];\n}];\n\n// TODO(matsko): use caching here to speed things up for detection\n// TODO(matsko): add documentation\n// by the time...\n\nvar $$AnimateJsProvider = ['$animateProvider', function($animateProvider) {\n this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',\n function($injector, $$AnimateRunner, $$jqLite) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n // $animateJs(element, 'enter');\n return function(element, event, classes, options) {\n var animationClosed = false;\n\n // the `classes` argument is optional and if it is not used\n // then the classes will be resolved from the element's className\n // property as well as options.addClass/options.removeClass.\n if (arguments.length === 3 && isObject(classes)) {\n options = classes;\n classes = null;\n }\n\n options = prepareAnimationOptions(options);\n if (!classes) {\n classes = element.attr('class') || '';\n if (options.addClass) {\n classes += ' ' + options.addClass;\n }\n if (options.removeClass) {\n classes += ' ' + options.removeClass;\n }\n }\n\n var classesToAdd = options.addClass;\n var classesToRemove = options.removeClass;\n\n // the lookupAnimations function returns a series of animation objects that are\n // matched up with one or more of the CSS classes. These animation objects are\n // defined via the module.animation factory function. If nothing is detected then\n // we don't return anything which then makes $animation query the next driver.\n var animations = lookupAnimations(classes);\n var before, after;\n if (animations.length) {\n var afterFn, beforeFn;\n if (event == 'leave') {\n beforeFn = 'leave';\n afterFn = 'afterLeave'; // TODO(matsko): get rid of this\n } else {\n beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1);\n afterFn = event;\n }\n\n if (event !== 'enter' && event !== 'move') {\n before = packageAnimations(element, event, options, animations, beforeFn);\n }\n after = packageAnimations(element, event, options, animations, afterFn);\n }\n\n // no matching animations\n if (!before && !after) return;\n\n function applyOptions() {\n options.domOperation();\n applyAnimationClasses(element, options);\n }\n\n function close() {\n animationClosed = true;\n applyOptions();\n applyAnimationStyles(element, options);\n }\n\n var runner;\n\n return {\n $$willAnimate: true,\n end: function() {\n if (runner) {\n runner.end();\n } else {\n close();\n runner = new $$AnimateRunner();\n runner.complete(true);\n }\n return runner;\n },\n start: function() {\n if (runner) {\n return runner;\n }\n\n runner = new $$AnimateRunner();\n var closeActiveAnimations;\n var chain = [];\n\n if (before) {\n chain.push(function(fn) {\n closeActiveAnimations = before(fn);\n });\n }\n\n if (chain.length) {\n chain.push(function(fn) {\n applyOptions();\n fn(true);\n });\n } else {\n applyOptions();\n }\n\n if (after) {\n chain.push(function(fn) {\n closeActiveAnimations = after(fn);\n });\n }\n\n runner.setHost({\n end: function() {\n endAnimations();\n },\n cancel: function() {\n endAnimations(true);\n }\n });\n\n $$AnimateRunner.chain(chain, onComplete);\n return runner;\n\n function onComplete(success) {\n close(success);\n runner.complete(success);\n }\n\n function endAnimations(cancelled) {\n if (!animationClosed) {\n (closeActiveAnimations || noop)(cancelled);\n onComplete(cancelled);\n }\n }\n }\n };\n\n function executeAnimationFn(fn, element, event, options, onDone) {\n var args;\n switch (event) {\n case 'animate':\n args = [element, options.from, options.to, onDone];\n break;\n\n case 'setClass':\n args = [element, classesToAdd, classesToRemove, onDone];\n break;\n\n case 'addClass':\n args = [element, classesToAdd, onDone];\n break;\n\n case 'removeClass':\n args = [element, classesToRemove, onDone];\n break;\n\n default:\n args = [element, onDone];\n break;\n }\n\n args.push(options);\n\n var value = fn.apply(fn, args);\n if (value) {\n if (isFunction(value.start)) {\n value = value.start();\n }\n\n if (value instanceof $$AnimateRunner) {\n value.done(onDone);\n } else if (isFunction(value)) {\n // optional onEnd / onCancel callback\n return value;\n }\n }\n\n return noop;\n }\n\n function groupEventedAnimations(element, event, options, animations, fnName) {\n var operations = [];\n forEach(animations, function(ani) {\n var animation = ani[fnName];\n if (!animation) return;\n\n // note that all of these animations will run in parallel\n operations.push(function() {\n var runner;\n var endProgressCb;\n\n var resolved = false;\n var onAnimationComplete = function(rejected) {\n if (!resolved) {\n resolved = true;\n (endProgressCb || noop)(rejected);\n runner.complete(!rejected);\n }\n };\n\n runner = new $$AnimateRunner({\n end: function() {\n onAnimationComplete();\n },\n cancel: function() {\n onAnimationComplete(true);\n }\n });\n\n endProgressCb = executeAnimationFn(animation, element, event, options, function(result) {\n var cancelled = result === false;\n onAnimationComplete(cancelled);\n });\n\n return runner;\n });\n });\n\n return operations;\n }\n\n function packageAnimations(element, event, options, animations, fnName) {\n var operations = groupEventedAnimations(element, event, options, animations, fnName);\n if (operations.length === 0) {\n var a,b;\n if (fnName === 'beforeSetClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');\n } else if (fnName === 'setClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass');\n }\n\n if (a) {\n operations = operations.concat(a);\n }\n if (b) {\n operations = operations.concat(b);\n }\n }\n\n if (operations.length === 0) return;\n\n // TODO(matsko): add documentation\n return function startAnimation(callback) {\n var runners = [];\n if (operations.length) {\n forEach(operations, function(animateFn) {\n runners.push(animateFn());\n });\n }\n\n runners.length ? $$AnimateRunner.all(runners, callback) : callback();\n\n return function endFn(reject) {\n forEach(runners, function(runner) {\n reject ? runner.cancel() : runner.end();\n });\n };\n };\n }\n };\n\n function lookupAnimations(classes) {\n classes = isArray(classes) ? classes : classes.split(' ');\n var matches = [], flagMap = {};\n for (var i=0; i < classes.length; i++) {\n var klass = classes[i],\n animationFactory = $animateProvider.$$registeredAnimations[klass];\n if (animationFactory && !flagMap[klass]) {\n matches.push($injector.get(animationFactory));\n flagMap[klass] = true;\n }\n }\n return matches;\n }\n }];\n}];\n\nvar $$AnimateJsDriverProvider = ['$$animationProvider', function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateJsDriver');\n this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {\n return function initDriverFn(animationDetails) {\n if (animationDetails.from && animationDetails.to) {\n var fromAnimation = prepareAnimation(animationDetails.from);\n var toAnimation = prepareAnimation(animationDetails.to);\n if (!fromAnimation && !toAnimation) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n $$AnimateRunner.all(animationRunners, done);\n\n var runner = new $$AnimateRunner({\n end: endFnFactory(),\n cancel: endFnFactory()\n });\n\n return runner;\n\n function endFnFactory() {\n return function() {\n forEach(animationRunners, function(runner) {\n // at this point we cannot cancel animations for groups just yet. 1.5+\n runner.end();\n });\n };\n }\n\n function done(status) {\n runner.complete(status);\n }\n }\n };\n } else {\n return prepareAnimation(animationDetails);\n }\n };\n\n function prepareAnimation(animationDetails) {\n // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations\n var element = animationDetails.element;\n var event = animationDetails.event;\n var options = animationDetails.options;\n var classes = animationDetails.classes;\n return $$animateJs(element, event, classes, options);\n }\n }];\n}];\n\nvar NG_ANIMATE_ATTR_NAME = 'data-ng-animate';\nvar NG_ANIMATE_PIN_DATA = '$ngAnimatePin';\nvar $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {\n var PRE_DIGEST_STATE = 1;\n var RUNNING_STATE = 2;\n var ONE_SPACE = ' ';\n\n var rules = this.rules = {\n skip: [],\n cancel: [],\n join: []\n };\n\n function makeTruthyCssClassMap(classString) {\n if (!classString) {\n return null;\n }\n\n var keys = classString.split(ONE_SPACE);\n var map = Object.create(null);\n\n forEach(keys, function(key) {\n map[key] = true;\n });\n return map;\n }\n\n function hasMatchingClasses(newClassString, currentClassString) {\n if (newClassString && currentClassString) {\n var currentClassMap = makeTruthyCssClassMap(currentClassString);\n return newClassString.split(ONE_SPACE).some(function(className) {\n return currentClassMap[className];\n });\n }\n }\n\n function isAllowed(ruleType, element, currentAnimation, previousAnimation) {\n return rules[ruleType].some(function(fn) {\n return fn(element, currentAnimation, previousAnimation);\n });\n }\n\n function hasAnimationClasses(animation, and) {\n var a = (animation.addClass || '').length > 0;\n var b = (animation.removeClass || '').length > 0;\n return and ? a && b : a || b;\n }\n\n rules.join.push(function(element, newAnimation, currentAnimation) {\n // if the new animation is class-based then we can just tack that on\n return !newAnimation.structural && hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // there is no need to animate anything if no classes are being added and\n // there is no structural animation that will be triggered\n return !newAnimation.structural && !hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // why should we trigger a new structural animation if the element will\n // be removed from the DOM anyway?\n return currentAnimation.event == 'leave' && newAnimation.structural;\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // if there is an ongoing current animation then don't even bother running the class-based animation\n return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n // there can never be two structural animations running at the same time\n return currentAnimation.structural && newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n // if the previous animation is already running, but the new animation will\n // be triggered, but the new animation is structural\n return currentAnimation.state === RUNNING_STATE && newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n var nA = newAnimation.addClass;\n var nR = newAnimation.removeClass;\n var cA = currentAnimation.addClass;\n var cR = currentAnimation.removeClass;\n\n // early detection to save the global CPU shortage :)\n if ((isUndefined(nA) && isUndefined(nR)) || (isUndefined(cA) && isUndefined(cR))) {\n return false;\n }\n\n return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA);\n });\n\n this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap',\n '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',\n function($$rAF, $rootScope, $rootElement, $document, $$HashMap,\n $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow) {\n\n var activeAnimationsLookup = new $$HashMap();\n var disabledElementsLookup = new $$HashMap();\n var animationsEnabled = null;\n\n function postDigestTaskFactory() {\n var postDigestCalled = false;\n return function(fn) {\n // we only issue a call to postDigest before\n // it has first passed. This prevents any callbacks\n // from not firing once the animation has completed\n // since it will be out of the digest cycle.\n if (postDigestCalled) {\n fn();\n } else {\n $rootScope.$$postDigest(function() {\n postDigestCalled = true;\n fn();\n });\n }\n };\n }\n\n // Wait until all directive and route-related templates are downloaded and\n // compiled. The $templateRequest.totalPendingRequests variable keeps track of\n // all of the remote templates being currently downloaded. If there are no\n // templates currently downloading then the watcher will still fire anyway.\n var deregisterWatch = $rootScope.$watch(\n function() { return $templateRequest.totalPendingRequests === 0; },\n function(isEmpty) {\n if (!isEmpty) return;\n deregisterWatch();\n\n // Now that all templates have been downloaded, $animate will wait until\n // the post digest queue is empty before enabling animations. By having two\n // calls to $postDigest calls we can ensure that the flag is enabled at the\n // very end of the post digest queue. Since all of the animations in $animate\n // use $postDigest, it's important that the code below executes at the end.\n // This basically means that the page is fully downloaded and compiled before\n // any animations are triggered.\n $rootScope.$$postDigest(function() {\n $rootScope.$$postDigest(function() {\n // we check for null directly in the event that the application already called\n // .enabled() with whatever arguments that it provided it with\n if (animationsEnabled === null) {\n animationsEnabled = true;\n }\n });\n });\n }\n );\n\n var callbackRegistry = {};\n\n // remember that the classNameFilter is set during the provider/config\n // stage therefore we can optimize here and setup a helper function\n var classNameFilter = $animateProvider.classNameFilter();\n var isAnimatableClassName = !classNameFilter\n ? function() { return true; }\n : function(className) {\n return classNameFilter.test(className);\n };\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function normalizeAnimationDetails(element, animation) {\n return mergeAnimationDetails(element, animation, {});\n }\n\n // IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\n var contains = Node.prototype.contains || function(arg) {\n // jshint bitwise: false\n return this === arg || !!(this.compareDocumentPosition(arg) & 16);\n // jshint bitwise: true\n };\n\n function findCallbacks(parent, element, event) {\n var targetNode = getDomNode(element);\n var targetParentNode = getDomNode(parent);\n\n var matches = [];\n var entries = callbackRegistry[event];\n if (entries) {\n forEach(entries, function(entry) {\n if (contains.call(entry.node, targetNode)) {\n matches.push(entry.callback);\n } else if (event === 'leave' && contains.call(entry.node, targetParentNode)) {\n matches.push(entry.callback);\n }\n });\n }\n\n return matches;\n }\n\n return {\n on: function(event, container, callback) {\n var node = extractElementNode(container);\n callbackRegistry[event] = callbackRegistry[event] || [];\n callbackRegistry[event].push({\n node: node,\n callback: callback\n });\n },\n\n off: function(event, container, callback) {\n var entries = callbackRegistry[event];\n if (!entries) return;\n\n callbackRegistry[event] = arguments.length === 1\n ? null\n : filterFromRegistry(entries, container, callback);\n\n function filterFromRegistry(list, matchContainer, matchCallback) {\n var containerNode = extractElementNode(matchContainer);\n return list.filter(function(entry) {\n var isMatch = entry.node === containerNode &&\n (!matchCallback || entry.callback === matchCallback);\n return !isMatch;\n });\n }\n },\n\n pin: function(element, parentElement) {\n assertArg(isElement(element), 'element', 'not an element');\n assertArg(isElement(parentElement), 'parentElement', 'not an element');\n element.data(NG_ANIMATE_PIN_DATA, parentElement);\n },\n\n push: function(element, event, options, domOperation) {\n options = options || {};\n options.domOperation = domOperation;\n return queueAnimation(element, event, options);\n },\n\n // this method has four signatures:\n // () - global getter\n // (bool) - global setter\n // (element) - element getter\n // (element, bool) - element setter<F37>\n enabled: function(element, bool) {\n var argCount = arguments.length;\n\n if (argCount === 0) {\n // () - Global getter\n bool = !!animationsEnabled;\n } else {\n var hasElement = isElement(element);\n\n if (!hasElement) {\n // (bool) - Global setter\n bool = animationsEnabled = !!element;\n } else {\n var node = getDomNode(element);\n var recordExists = disabledElementsLookup.get(node);\n\n if (argCount === 1) {\n // (element) - Element getter\n bool = !recordExists;\n } else {\n // (element, bool) - Element setter\n disabledElementsLookup.put(node, !bool);\n }\n }\n }\n\n return bool;\n }\n };\n\n function queueAnimation(element, event, initialOptions) {\n // we always make a copy of the options since\n // there should never be any side effects on\n // the input data when running `$animateCss`.\n var options = copy(initialOptions);\n\n var node, parent;\n element = stripCommentsFromElement(element);\n if (element) {\n node = getDomNode(element);\n parent = element.parent();\n }\n\n options = prepareAnimationOptions(options);\n\n // we create a fake runner with a working promise.\n // These methods will become available after the digest has passed\n var runner = new $$AnimateRunner();\n\n // this is used to trigger callbacks in postDigest mode\n var runInNextPostDigestOrNow = postDigestTaskFactory();\n\n if (isArray(options.addClass)) {\n options.addClass = options.addClass.join(' ');\n }\n\n if (options.addClass && !isString(options.addClass)) {\n options.addClass = null;\n }\n\n if (isArray(options.removeClass)) {\n options.removeClass = options.removeClass.join(' ');\n }\n\n if (options.removeClass && !isString(options.removeClass)) {\n options.removeClass = null;\n }\n\n if (options.from && !isObject(options.from)) {\n options.from = null;\n }\n\n if (options.to && !isObject(options.to)) {\n options.to = null;\n }\n\n // there are situations where a directive issues an animation for\n // a jqLite wrapper that contains only comment nodes... If this\n // happens then there is no way we can perform an animation\n if (!node) {\n close();\n return runner;\n }\n\n var className = [node.className, options.addClass, options.removeClass].join(' ');\n if (!isAnimatableClassName(className)) {\n close();\n return runner;\n }\n\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n // this is a hard disable of all animations for the application or on\n // the element itself, therefore there is no need to continue further\n // past this point if not enabled\n // Animations are also disabled if the document is currently hidden (page is not visible\n // to the user), because browsers slow down or do not flush calls to requestAnimationFrame\n var skipAnimations = !animationsEnabled || $document[0].hidden || disabledElementsLookup.get(node);\n var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {};\n var hasExistingAnimation = !!existingAnimation.state;\n\n // there is no point in traversing the same collection of parent ancestors if a followup\n // animation will be run on the same element that already did all that checking work\n if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state != PRE_DIGEST_STATE)) {\n skipAnimations = !areAnimationsAllowed(element, parent, event);\n }\n\n if (skipAnimations) {\n close();\n return runner;\n }\n\n if (isStructural) {\n closeChildAnimations(element);\n }\n\n var newAnimation = {\n structural: isStructural,\n element: element,\n event: event,\n addClass: options.addClass,\n removeClass: options.removeClass,\n close: close,\n options: options,\n runner: runner\n };\n\n if (hasExistingAnimation) {\n var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation);\n if (skipAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n close();\n return runner;\n } else {\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n return existingAnimation.runner;\n }\n }\n var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation);\n if (cancelAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n // this will end the animation right away and it is safe\n // to do so since the animation is already running and the\n // runner callback code will run in async\n existingAnimation.runner.end();\n } else if (existingAnimation.structural) {\n // this means that the animation is queued into a digest, but\n // hasn't started yet. Therefore it is safe to run the close\n // method which will call the runner methods in async.\n existingAnimation.close();\n } else {\n // this will merge the new animation options into existing animation options\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n return existingAnimation.runner;\n }\n } else {\n // a joined animation means that this animation will take over the existing one\n // so an example would involve a leave animation taking over an enter. Then when\n // the postDigest kicks in the enter will be ignored.\n var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation);\n if (joinAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n normalizeAnimationDetails(element, newAnimation);\n } else {\n applyGeneratedPreparationClasses(element, isStructural ? event : null, options);\n\n event = newAnimation.event = existingAnimation.event;\n options = mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n //we return the same runner since only the option values of this animation will\n //be fed into the `existingAnimation`.\n return existingAnimation.runner;\n }\n }\n }\n } else {\n // normalization in this case means that it removes redundant CSS classes that\n // already exist (addClass) or do not exist (removeClass) on the element\n normalizeAnimationDetails(element, newAnimation);\n }\n\n // when the options are merged and cleaned up we may end up not having to do\n // an animation at all, therefore we should check this before issuing a post\n // digest callback. Structural animations will always run no matter what.\n var isValidAnimation = newAnimation.structural;\n if (!isValidAnimation) {\n // animate (from/to) can be quickly checked first, otherwise we check if any classes are present\n isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0)\n || hasAnimationClasses(newAnimation);\n }\n\n if (!isValidAnimation) {\n close();\n clearElementAnimationState(element);\n return runner;\n }\n\n // the counter keeps track of cancelled animations\n var counter = (existingAnimation.counter || 0) + 1;\n newAnimation.counter = counter;\n\n markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation);\n\n $rootScope.$$postDigest(function() {\n var animationDetails = activeAnimationsLookup.get(node);\n var animationCancelled = !animationDetails;\n animationDetails = animationDetails || {};\n\n // if addClass/removeClass is called before something like enter then the\n // registered parent element may not be present. The code below will ensure\n // that a final value for parent element is obtained\n var parentElement = element.parent() || [];\n\n // animate/structural/class-based animations all have requirements. Otherwise there\n // is no point in performing an animation. The parent node must also be set.\n var isValidAnimation = parentElement.length > 0\n && (animationDetails.event === 'animate'\n || animationDetails.structural\n || hasAnimationClasses(animationDetails));\n\n // this means that the previous animation was cancelled\n // even if the follow-up animation is the same event\n if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) {\n // if another animation did not take over then we need\n // to make sure that the domOperation and options are\n // handled accordingly\n if (animationCancelled) {\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n }\n\n // if the event changed from something like enter to leave then we do\n // it, otherwise if it's the same then the end result will be the same too\n if (animationCancelled || (isStructural && animationDetails.event !== event)) {\n options.domOperation();\n runner.end();\n }\n\n // in the event that the element animation was not cancelled or a follow-up animation\n // isn't allowed to animate from here then we need to clear the state of the element\n // so that any future animations won't read the expired animation data.\n if (!isValidAnimation) {\n clearElementAnimationState(element);\n }\n\n return;\n }\n\n // this combined multiple class to addClass / removeClass into a setClass event\n // so long as a structural event did not take over the animation\n event = !animationDetails.structural && hasAnimationClasses(animationDetails, true)\n ? 'setClass'\n : animationDetails.event;\n\n markElementAnimationState(element, RUNNING_STATE);\n var realRunner = $$animation(element, event, animationDetails.options);\n\n realRunner.done(function(status) {\n close(!status);\n var animationDetails = activeAnimationsLookup.get(node);\n if (animationDetails && animationDetails.counter === counter) {\n clearElementAnimationState(getDomNode(element));\n }\n notifyProgress(runner, event, 'close', {});\n });\n\n // this will update the runner's flow-control events based on\n // the `realRunner` object.\n runner.setHost(realRunner);\n notifyProgress(runner, event, 'start', {});\n });\n\n return runner;\n\n function notifyProgress(runner, event, phase, data) {\n runInNextPostDigestOrNow(function() {\n var callbacks = findCallbacks(parent, element, event);\n if (callbacks.length) {\n // do not optimize this call here to RAF because\n // we don't know how heavy the callback code here will\n // be and if this code is buffered then this can\n // lead to a performance regression.\n $$rAF(function() {\n forEach(callbacks, function(callback) {\n callback(element, phase, data);\n });\n });\n }\n });\n runner.progress(event, phase, data);\n }\n\n function close(reject) { // jshint ignore:line\n clearGeneratedClasses(element, options);\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n runner.complete(!reject);\n }\n }\n\n function closeChildAnimations(element) {\n var node = getDomNode(element);\n var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');\n forEach(children, function(child) {\n var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME));\n var animationDetails = activeAnimationsLookup.get(child);\n if (animationDetails) {\n switch (state) {\n case RUNNING_STATE:\n animationDetails.runner.end();\n /* falls through */\n case PRE_DIGEST_STATE:\n activeAnimationsLookup.remove(child);\n break;\n }\n }\n });\n }\n\n function clearElementAnimationState(element) {\n var node = getDomNode(element);\n node.removeAttribute(NG_ANIMATE_ATTR_NAME);\n activeAnimationsLookup.remove(node);\n }\n\n function isMatchingElement(nodeOrElmA, nodeOrElmB) {\n return getDomNode(nodeOrElmA) === getDomNode(nodeOrElmB);\n }\n\n /**\n * This fn returns false if any of the following is true:\n * a) animations on any parent element are disabled, and animations on the element aren't explicitly allowed\n * b) a parent element has an ongoing structural animation, and animateChildren is false\n * c) the element is not a child of the body\n * d) the element is not a child of the $rootElement\n */\n function areAnimationsAllowed(element, parentElement, event) {\n var bodyElement = jqLite($document[0].body);\n var bodyElementDetected = isMatchingElement(element, bodyElement) || element[0].nodeName === 'HTML';\n var rootElementDetected = isMatchingElement(element, $rootElement);\n var parentAnimationDetected = false;\n var animateChildren;\n var elementDisabled = disabledElementsLookup.get(getDomNode(element));\n\n var parentHost = element.data(NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n parentElement = parentHost;\n }\n\n while (parentElement && parentElement.length) {\n if (!rootElementDetected) {\n // angular doesn't want to attempt to animate elements outside of the application\n // therefore we need to ensure that the rootElement is an ancestor of the current element\n rootElementDetected = isMatchingElement(parentElement, $rootElement);\n }\n\n var parentNode = parentElement[0];\n if (parentNode.nodeType !== ELEMENT_NODE) {\n // no point in inspecting the #document element\n break;\n }\n\n var details = activeAnimationsLookup.get(parentNode) || {};\n // either an enter, leave or move animation will commence\n // therefore we can't allow any animations to take place\n // but if a parent animation is class-based then that's ok\n if (!parentAnimationDetected) {\n var parentElementDisabled = disabledElementsLookup.get(parentNode);\n\n if (parentElementDisabled === true && elementDisabled !== false) {\n // disable animations if the user hasn't explicitly enabled animations on the\n // current element\n elementDisabled = true;\n // element is disabled via parent element, no need to check anything else\n break;\n } else if (parentElementDisabled === false) {\n elementDisabled = false;\n }\n parentAnimationDetected = details.structural;\n }\n\n if (isUndefined(animateChildren) || animateChildren === true) {\n var value = parentElement.data(NG_ANIMATE_CHILDREN_DATA);\n if (isDefined(value)) {\n animateChildren = value;\n }\n }\n\n // there is no need to continue traversing at this point\n if (parentAnimationDetected && animateChildren === false) break;\n\n if (!bodyElementDetected) {\n // we also need to ensure that the element is or will be a part of the body element\n // otherwise it is pointless to even issue an animation to be rendered\n bodyElementDetected = isMatchingElement(parentElement, bodyElement);\n }\n\n if (bodyElementDetected && rootElementDetected) {\n // If both body and root have been found, any other checks are pointless,\n // as no animation data should live outside the application\n break;\n }\n\n if (!rootElementDetected) {\n // If no rootElement is detected, check if the parentElement is pinned to another element\n parentHost = parentElement.data(NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n // The pin target element becomes the next parent element\n parentElement = parentHost;\n continue;\n }\n }\n\n parentElement = parentElement.parent();\n }\n\n var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true;\n return allowAnimation && rootElementDetected && bodyElementDetected;\n }\n\n function markElementAnimationState(element, state, details) {\n details = details || {};\n details.state = state;\n\n var node = getDomNode(element);\n node.setAttribute(NG_ANIMATE_ATTR_NAME, state);\n\n var oldValue = activeAnimationsLookup.get(node);\n var newValue = oldValue\n ? extend(oldValue, details)\n : details;\n activeAnimationsLookup.put(node, newValue);\n }\n }];\n}];\n\nvar $$AnimationProvider = ['$animateProvider', function($animateProvider) {\n var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';\n\n var drivers = this.drivers = [];\n\n var RUNNER_STORAGE_KEY = '$$animationRunner';\n\n function setRunner(element, runner) {\n element.data(RUNNER_STORAGE_KEY, runner);\n }\n\n function removeRunner(element) {\n element.removeData(RUNNER_STORAGE_KEY);\n }\n\n function getRunner(element) {\n return element.data(RUNNER_STORAGE_KEY);\n }\n\n this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$HashMap', '$$rAFScheduler',\n function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$HashMap, $$rAFScheduler) {\n\n var animationQueue = [];\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function sortAnimations(animations) {\n var tree = { children: [] };\n var i, lookup = new $$HashMap();\n\n // this is done first beforehand so that the hashmap\n // is filled with a list of the elements that will be animated\n for (i = 0; i < animations.length; i++) {\n var animation = animations[i];\n lookup.put(animation.domNode, animations[i] = {\n domNode: animation.domNode,\n fn: animation.fn,\n children: []\n });\n }\n\n for (i = 0; i < animations.length; i++) {\n processNode(animations[i]);\n }\n\n return flatten(tree);\n\n function processNode(entry) {\n if (entry.processed) return entry;\n entry.processed = true;\n\n var elementNode = entry.domNode;\n var parentNode = elementNode.parentNode;\n lookup.put(elementNode, entry);\n\n var parentEntry;\n while (parentNode) {\n parentEntry = lookup.get(parentNode);\n if (parentEntry) {\n if (!parentEntry.processed) {\n parentEntry = processNode(parentEntry);\n }\n break;\n }\n parentNode = parentNode.parentNode;\n }\n\n (parentEntry || tree).children.push(entry);\n return entry;\n }\n\n function flatten(tree) {\n var result = [];\n var queue = [];\n var i;\n\n for (i = 0; i < tree.children.length; i++) {\n queue.push(tree.children[i]);\n }\n\n var remainingLevelEntries = queue.length;\n var nextLevelEntries = 0;\n var row = [];\n\n for (i = 0; i < queue.length; i++) {\n var entry = queue[i];\n if (remainingLevelEntries <= 0) {\n remainingLevelEntries = nextLevelEntries;\n nextLevelEntries = 0;\n result.push(row);\n row = [];\n }\n row.push(entry.fn);\n entry.children.forEach(function(childEntry) {\n nextLevelEntries++;\n queue.push(childEntry);\n });\n remainingLevelEntries--;\n }\n\n if (row.length) {\n result.push(row);\n }\n\n return result;\n }\n }\n\n // TODO(matsko): document the signature in a better way\n return function(element, event, options) {\n options = prepareAnimationOptions(options);\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n // there is no animation at the current moment, however\n // these runner methods will get later updated with the\n // methods leading into the driver's end/cancel methods\n // for now they just stop the animation from starting\n var runner = new $$AnimateRunner({\n end: function() { close(); },\n cancel: function() { close(true); }\n });\n\n if (!drivers.length) {\n close();\n return runner;\n }\n\n setRunner(element, runner);\n\n var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass));\n var tempClasses = options.tempClasses;\n if (tempClasses) {\n classes += ' ' + tempClasses;\n options.tempClasses = null;\n }\n\n var prepareClassName;\n if (isStructural) {\n prepareClassName = 'ng-' + event + PREPARE_CLASS_SUFFIX;\n $$jqLite.addClass(element, prepareClassName);\n }\n\n animationQueue.push({\n // this data is used by the postDigest code and passed into\n // the driver step function\n element: element,\n classes: classes,\n event: event,\n structural: isStructural,\n options: options,\n beforeStart: beforeStart,\n close: close\n });\n\n element.on('$destroy', handleDestroyedElement);\n\n // we only want there to be one function called within the post digest\n // block. This way we can group animations for all the animations that\n // were apart of the same postDigest flush call.\n if (animationQueue.length > 1) return runner;\n\n $rootScope.$$postDigest(function() {\n var animations = [];\n forEach(animationQueue, function(entry) {\n // the element was destroyed early on which removed the runner\n // form its storage. This means we can't animate this element\n // at all and it already has been closed due to destruction.\n if (getRunner(entry.element)) {\n animations.push(entry);\n } else {\n entry.close();\n }\n });\n\n // now any future animations will be in another postDigest\n animationQueue.length = 0;\n\n var groupedAnimations = groupAnimations(animations);\n var toBeSortedAnimations = [];\n\n forEach(groupedAnimations, function(animationEntry) {\n toBeSortedAnimations.push({\n domNode: getDomNode(animationEntry.from ? animationEntry.from.element : animationEntry.element),\n fn: function triggerAnimationStart() {\n // it's important that we apply the `ng-animate` CSS class and the\n // temporary classes before we do any driver invoking since these\n // CSS classes may be required for proper CSS detection.\n animationEntry.beforeStart();\n\n var startAnimationFn, closeFn = animationEntry.close;\n\n // in the event that the element was removed before the digest runs or\n // during the RAF sequencing then we should not trigger the animation.\n var targetElement = animationEntry.anchors\n ? (animationEntry.from.element || animationEntry.to.element)\n : animationEntry.element;\n\n if (getRunner(targetElement)) {\n var operation = invokeFirstDriver(animationEntry);\n if (operation) {\n startAnimationFn = operation.start;\n }\n }\n\n if (!startAnimationFn) {\n closeFn();\n } else {\n var animationRunner = startAnimationFn();\n animationRunner.done(function(status) {\n closeFn(!status);\n });\n updateAnimationRunners(animationEntry, animationRunner);\n }\n }\n });\n });\n\n // we need to sort each of the animations in order of parent to child\n // relationships. This ensures that the child classes are applied at the\n // right time.\n $$rAFScheduler(sortAnimations(toBeSortedAnimations));\n });\n\n return runner;\n\n // TODO(matsko): change to reference nodes\n function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }\n\n function groupAnimations(animations) {\n var preparedAnimations = [];\n var refLookup = {};\n forEach(animations, function(animation, index) {\n var element = animation.element;\n var node = getDomNode(element);\n var event = animation.event;\n var enterOrMove = ['enter', 'move'].indexOf(event) >= 0;\n var anchorNodes = animation.structural ? getAnchorNodes(node) : [];\n\n if (anchorNodes.length) {\n var direction = enterOrMove ? 'to' : 'from';\n\n forEach(anchorNodes, function(anchor) {\n var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR);\n refLookup[key] = refLookup[key] || {};\n refLookup[key][direction] = {\n animationID: index,\n element: jqLite(anchor)\n };\n });\n } else {\n preparedAnimations.push(animation);\n }\n });\n\n var usedIndicesLookup = {};\n var anchorGroups = {};\n forEach(refLookup, function(operations, key) {\n var from = operations.from;\n var to = operations.to;\n\n if (!from || !to) {\n // only one of these is set therefore we can't have an\n // anchor animation since all three pieces are required\n var index = from ? from.animationID : to.animationID;\n var indexKey = index.toString();\n if (!usedIndicesLookup[indexKey]) {\n usedIndicesLookup[indexKey] = true;\n preparedAnimations.push(animations[index]);\n }\n return;\n }\n\n var fromAnimation = animations[from.animationID];\n var toAnimation = animations[to.animationID];\n var lookupKey = from.animationID.toString();\n if (!anchorGroups[lookupKey]) {\n var group = anchorGroups[lookupKey] = {\n structural: true,\n beforeStart: function() {\n fromAnimation.beforeStart();\n toAnimation.beforeStart();\n },\n close: function() {\n fromAnimation.close();\n toAnimation.close();\n },\n classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes),\n from: fromAnimation,\n to: toAnimation,\n anchors: [] // TODO(matsko): change to reference nodes\n };\n\n // the anchor animations require that the from and to elements both have at least\n // one shared CSS class which effectively marries the two elements together to use\n // the same animation driver and to properly sequence the anchor animation.\n if (group.classes.length) {\n preparedAnimations.push(group);\n } else {\n preparedAnimations.push(fromAnimation);\n preparedAnimations.push(toAnimation);\n }\n }\n\n anchorGroups[lookupKey].anchors.push({\n 'out': from.element, 'in': to.element\n });\n });\n\n return preparedAnimations;\n }\n\n function cssClassesIntersection(a,b) {\n a = a.split(' ');\n b = b.split(' ');\n var matches = [];\n\n for (var i = 0; i < a.length; i++) {\n var aa = a[i];\n if (aa.substring(0,3) === 'ng-') continue;\n\n for (var j = 0; j < b.length; j++) {\n if (aa === b[j]) {\n matches.push(aa);\n break;\n }\n }\n }\n\n return matches.join(' ');\n }\n\n function invokeFirstDriver(animationDetails) {\n // we loop in reverse order since the more general drivers (like CSS and JS)\n // may attempt more elements, but custom drivers are more particular\n for (var i = drivers.length - 1; i >= 0; i--) {\n var driverName = drivers[i];\n if (!$injector.has(driverName)) continue; // TODO(matsko): remove this check\n\n var factory = $injector.get(driverName);\n var driver = factory(animationDetails);\n if (driver) {\n return driver;\n }\n }\n }\n\n function beforeStart() {\n element.addClass(NG_ANIMATE_CLASSNAME);\n if (tempClasses) {\n $$jqLite.addClass(element, tempClasses);\n }\n if (prepareClassName) {\n $$jqLite.removeClass(element, prepareClassName);\n prepareClassName = null;\n }\n }\n\n function updateAnimationRunners(animation, newRunner) {\n if (animation.from && animation.to) {\n update(animation.from.element);\n update(animation.to.element);\n } else {\n update(animation.element);\n }\n\n function update(element) {\n getRunner(element).setHost(newRunner);\n }\n }\n\n function handleDestroyedElement() {\n var runner = getRunner(element);\n if (runner && (event !== 'leave' || !options.$$domOperationFired)) {\n runner.end();\n }\n }\n\n function close(rejected) { // jshint ignore:line\n element.off('$destroy', handleDestroyedElement);\n removeRunner(element);\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n\n if (tempClasses) {\n $$jqLite.removeClass(element, tempClasses);\n }\n\n element.removeClass(NG_ANIMATE_CLASSNAME);\n runner.complete(!rejected);\n }\n };\n }];\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateSwap\n * @restrict A\n * @scope\n *\n * @description\n *\n * ngAnimateSwap is a animation-oriented directive that allows for the container to\n * be removed and entered in whenever the associated expression changes. A\n * common usecase for this directive is a rotating banner component which\n * contains one image being present at a time. When the active image changes\n * then the old image will perform a `leave` animation and the new element\n * will be inserted via an `enter` animation.\n *\n * @example\n * <example name=\"ngAnimateSwap-directive\" module=\"ngAnimateSwapExample\"\n * deps=\"angular-animate.js\"\n * animations=\"true\" fixBase=\"true\">\n * <file name=\"index.html\">\n * <div class=\"container\" ng-controller=\"AppCtrl\">\n * <div ng-animate-swap=\"number\" class=\"cell swap-animation\" ng-class=\"colorClass(number)\">\n * {{ number }}\n * </div>\n * </div>\n * </file>\n * <file name=\"script.js\">\n * angular.module('ngAnimateSwapExample', ['ngAnimate'])\n * .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) {\n * $scope.number = 0;\n * $interval(function() {\n * $scope.number++;\n * }, 1000);\n *\n * var colors = ['red','blue','green','yellow','orange'];\n * $scope.colorClass = function(number) {\n * return colors[number % colors.length];\n * };\n * }]);\n * </file>\n * <file name=\"animations.css\">\n * .container {\n * height:250px;\n * width:250px;\n * position:relative;\n * overflow:hidden;\n * border:2px solid black;\n * }\n * .container .cell {\n * font-size:150px;\n * text-align:center;\n * line-height:250px;\n * position:absolute;\n * top:0;\n * left:0;\n * right:0;\n * border-bottom:2px solid black;\n * }\n * .swap-animation.ng-enter, .swap-animation.ng-leave {\n * transition:0.5s linear all;\n * }\n * .swap-animation.ng-enter {\n * top:-250px;\n * }\n * .swap-animation.ng-enter-active {\n * top:0px;\n * }\n * .swap-animation.ng-leave {\n * top:0px;\n * }\n * .swap-animation.ng-leave-active {\n * top:250px;\n * }\n * .red { background:red; }\n * .green { background:green; }\n * .blue { background:blue; }\n * .yellow { background:yellow; }\n * .orange { background:orange; }\n * </file>\n * </example>\n */\nvar ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $rootScope) {\n return {\n restrict: 'A',\n transclude: 'element',\n terminal: true,\n priority: 600, // we use 600 here to ensure that the directive is caught before others\n link: function(scope, $element, attrs, ctrl, $transclude) {\n var previousElement, previousScope;\n scope.$watchCollection(attrs.ngAnimateSwap || attrs['for'], function(value) {\n if (previousElement) {\n $animate.leave(previousElement);\n }\n if (previousScope) {\n previousScope.$destroy();\n previousScope = null;\n }\n if (value || value === 0) {\n previousScope = scope.$new();\n $transclude(previousScope, function(element) {\n previousElement = element;\n $animate.enter(element, null, $element);\n });\n }\n });\n }\n };\n}];\n\n/* global angularAnimateModule: true,\n\n ngAnimateSwapDirective,\n $$AnimateAsyncRunFactory,\n $$rAFSchedulerFactory,\n $$AnimateChildrenDirective,\n $$AnimateQueueProvider,\n $$AnimationProvider,\n $AnimateCssProvider,\n $$AnimateCssDriverProvider,\n $$AnimateJsProvider,\n $$AnimateJsDriverProvider,\n*/\n\n/**\n * @ngdoc module\n * @name ngAnimate\n * @description\n *\n * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via\n * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an Angular app.\n *\n * <div doc-module-components=\"ngAnimate\"></div>\n *\n * # Usage\n * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based\n * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For\n * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within\n * the HTML element that the animation will be triggered on.\n *\n * ## Directive Support\n * The following directives are \"animation aware\":\n *\n * | Directive | Supported Animations |\n * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|\n * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move |\n * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |\n * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |\n * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |\n * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |\n * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) |\n * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) |\n * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |\n * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) |\n * | {@link module:ngMessages#animations ngMessage} | enter and leave |\n *\n * (More information can be found by visiting each the documentation associated with each directive.)\n *\n * ## CSS-based Animations\n *\n * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML\n * and CSS code we can create an animation that will be picked up by Angular when an the underlying directive performs an operation.\n *\n * The example below shows how an `enter` animation can be made possible on an element using `ng-if`:\n *\n * ```html\n * <div ng-if=\"bool\" class=\"fade\">\n * Fade me in out\n * </div>\n * <button ng-click=\"bool=true\">Fade In!</button>\n * <button ng-click=\"bool=false\">Fade Out!</button>\n * ```\n *\n * Notice the CSS class **fade**? We can now create the CSS transition code that references this class:\n *\n * ```css\n * /* The starting CSS styles for the enter animation */\n * .fade.ng-enter {\n * transition:0.5s linear all;\n * opacity:0;\n * }\n *\n * /* The finishing CSS styles for the enter animation */\n * .fade.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * ```\n *\n * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two\n * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition\n * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards.\n *\n * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions:\n *\n * ```css\n * /* now the element will fade out before it is removed from the DOM */\n * .fade.ng-leave {\n * transition:0.5s linear all;\n * opacity:1;\n * }\n * .fade.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class:\n *\n * ```css\n * /* there is no need to define anything inside of the destination\n * CSS class since the keyframe will take charge of the animation */\n * .fade.ng-leave {\n * animation: my_fade_animation 0.5s linear;\n * -webkit-animation: my_fade_animation 0.5s linear;\n * }\n *\n * @keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n *\n * @-webkit-keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n * ```\n *\n * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element.\n *\n * ### CSS Class-based Animations\n *\n * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different\n * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added\n * and removed.\n *\n * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class:\n *\n * ```html\n * <div ng-show=\"bool\" class=\"fade\">\n * Show and hide me\n * </div>\n * <button ng-click=\"bool=true\">Toggle</button>\n *\n * <style>\n * .fade.ng-hide {\n * transition:0.5s linear all;\n * opacity:0;\n * }\n * </style>\n * ```\n *\n * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since\n * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest.\n *\n * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation\n * with CSS styles.\n *\n * ```html\n * <div ng-class=\"{on:onOff}\" class=\"highlight\">\n * Highlight this box\n * </div>\n * <button ng-click=\"onOff=!onOff\">Toggle</button>\n *\n * <style>\n * .highlight {\n * transition:0.5s linear all;\n * }\n * .highlight.on-add {\n * background:white;\n * }\n * .highlight.on {\n * background:yellow;\n * }\n * .highlight.on-remove {\n * background:black;\n * }\n * </style>\n * ```\n *\n * We can also make use of CSS keyframes by placing them within the CSS classes.\n *\n *\n * ### CSS Staggering Animations\n * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a\n * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be\n * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for\n * the animation. The style property expected within the stagger class can either be a **transition-delay** or an\n * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).\n *\n * ```css\n * .my-animation.ng-enter {\n * /* standard transition code */\n * transition: 1s linear all;\n * opacity:0;\n * }\n * .my-animation.ng-enter-stagger {\n * /* this will have a 100ms delay between each successive leave animation */\n * transition-delay: 0.1s;\n *\n * /* As of 1.4.4, this must always be set: it signals ngAnimate\n * to not accidentally inherit a delay property from another CSS class */\n * transition-duration: 0s;\n * }\n * .my-animation.ng-enter.ng-enter-active {\n * /* standard transition styles */\n * opacity:1;\n * }\n * ```\n *\n * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations\n * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this\n * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation\n * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired.\n *\n * The following code will issue the **ng-leave-stagger** event on the element provided:\n *\n * ```js\n * var kids = parent.children();\n *\n * $animate.leave(kids[0]); //stagger index=0\n * $animate.leave(kids[1]); //stagger index=1\n * $animate.leave(kids[2]); //stagger index=2\n * $animate.leave(kids[3]); //stagger index=3\n * $animate.leave(kids[4]); //stagger index=4\n *\n * window.requestAnimationFrame(function() {\n * //stagger has reset itself\n * $animate.leave(kids[5]); //stagger index=0\n * $animate.leave(kids[6]); //stagger index=1\n *\n * $scope.$digest();\n * });\n * ```\n *\n * Stagger animations are currently only supported within CSS-defined animations.\n *\n * ### The `ng-animate` CSS class\n *\n * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation.\n * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations).\n *\n * Therefore, animations can be applied to an element using this temporary class directly via CSS.\n *\n * ```css\n * .zipper.ng-animate {\n * transition:0.5s linear all;\n * }\n * .zipper.ng-enter {\n * opacity:0;\n * }\n * .zipper.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * .zipper.ng-leave {\n * opacity:1;\n * }\n * .zipper.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove\n * the CSS class once an animation has completed.)\n *\n *\n * ### The `ng-[event]-prepare` class\n *\n * This is a special class that can be used to prevent unwanted flickering / flash of content before\n * the actual animation starts. The class is added as soon as an animation is initialized, but removed\n * before the actual animation starts (after waiting for a $digest).\n * It is also only added for *structural* animations (`enter`, `move`, and `leave`).\n *\n * In practice, flickering can appear when nesting elements with structural animations such as `ngIf`\n * into elements that have class-based animations such as `ngClass`.\n *\n * ```html\n * <div ng-class=\"{red: myProp}\">\n * <div ng-class=\"{blue: myProp}\">\n * <div class=\"message\" ng-if=\"myProp\"></div>\n * </div>\n * </div>\n * ```\n *\n * It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating.\n * In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts:\n *\n * ```css\n * .message.ng-enter-prepare {\n * opacity: 0;\n * }\n *\n * ```\n *\n * ## JavaScript-based Animations\n *\n * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared\n * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the\n * `module.animation()` module function we can register the animation.\n *\n * Let's see an example of a enter/leave animation using `ngRepeat`:\n *\n * ```html\n * <div ng-repeat=\"item in items\" class=\"slide\">\n * {{ item }}\n * </div>\n * ```\n *\n * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`:\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * // make note that other events (like addClass/removeClass)\n * // have different function input parameters\n * enter: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n *\n * // remember to call doneFn so that angular\n * // knows that the animation has concluded\n * },\n *\n * move: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n * },\n *\n * leave: function(element, doneFn) {\n * jQuery(element).fadeOut(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as\n * greensock.js and velocity.js.\n *\n * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define\n * our animations inside of the same registered animation, however, the function input arguments are a bit different:\n *\n * ```html\n * <div ng-class=\"color\" class=\"colorful\">\n * this box is moody\n * </div>\n * <button ng-click=\"color='red'\">Change to red</button>\n * <button ng-click=\"color='blue'\">Change to blue</button>\n * <button ng-click=\"color='green'\">Change to green</button>\n * ```\n *\n * ```js\n * myModule.animation('.colorful', [function() {\n * return {\n * addClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * removeClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * setClass: function(element, addedClass, removedClass, doneFn) {\n * // do some cool animation and call the doneFn\n * }\n * }\n * }]);\n * ```\n *\n * ## CSS + JS Animations Together\n *\n * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of Angular,\n * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking\n * charge of the animation**:\n *\n * ```html\n * <div ng-if=\"bool\" class=\"slide\">\n * Slide in and out\n * </div>\n * ```\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * enter: function(element, doneFn) {\n * jQuery(element).slideIn(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * ```css\n * .slide.ng-enter {\n * transition:0.5s linear all;\n * transform:translateY(-100px);\n * }\n * .slide.ng-enter.ng-enter-active {\n * transform:translateY(0);\n * }\n * ```\n *\n * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the\n * lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from\n * our own JS-based animation code:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n* // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`.\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true\n * });\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework.\n *\n * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or\n * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that\n * data into `$animateCss` directly:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true,\n * addClass: 'maroon-setting',\n * from: { height:0 },\n * to: { height: 200 }\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Now we can fill in the rest via our transition CSS code:\n *\n * ```css\n * /* the transition tells ngAnimate to make the animation happen */\n * .slide.ng-enter { transition:0.5s linear all; }\n *\n * /* this extra CSS class will be absorbed into the transition\n * since the $animateCss code is adding the class */\n * .maroon-setting { background:red; }\n * ```\n *\n * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over.\n *\n * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}.\n *\n * ## Animation Anchoring (via `ng-animate-ref`)\n *\n * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between\n * structural areas of an application (like views) by pairing up elements using an attribute\n * called `ng-animate-ref`.\n *\n * Let's say for example we have two views that are managed by `ng-view` and we want to show\n * that there is a relationship between two components situated in within these views. By using the\n * `ng-animate-ref` attribute we can identify that the two components are paired together and we\n * can then attach an animation, which is triggered when the view changes.\n *\n * Say for example we have the following template code:\n *\n * ```html\n * <!-- index.html -->\n * <div ng-view class=\"view-animation\">\n * </div>\n *\n * <!-- home.html -->\n * <a href=\"#/banner-page\">\n * <img src=\"./banner.jpg\" class=\"banner\" ng-animate-ref=\"banner\">\n * </a>\n *\n * <!-- banner-page.html -->\n * <img src=\"./banner.jpg\" class=\"banner\" ng-animate-ref=\"banner\">\n * ```\n *\n * Now, when the view changes (once the link is clicked), ngAnimate will examine the\n * HTML contents to see if there is a match reference between any components in the view\n * that is leaving and the view that is entering. It will scan both the view which is being\n * removed (leave) and inserted (enter) to see if there are any paired DOM elements that\n * contain a matching ref value.\n *\n * The two images match since they share the same ref value. ngAnimate will now create a\n * transport element (which is a clone of the first image element) and it will then attempt\n * to animate to the position of the second image element in the next view. For the animation to\n * work a special CSS class called `ng-anchor` will be added to the transported element.\n *\n * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then\n * ngAnimate will handle the entire transition for us as well as the addition and removal of\n * any changes of CSS classes between the elements:\n *\n * ```css\n * .banner.ng-anchor {\n * /* this animation will last for 1 second since there are\n * two phases to the animation (an `in` and an `out` phase) */\n * transition:0.5s linear all;\n * }\n * ```\n *\n * We also **must** include animations for the views that are being entered and removed\n * (otherwise anchoring wouldn't be possible since the new view would be inserted right away).\n *\n * ```css\n * .view-animation.ng-enter, .view-animation.ng-leave {\n * transition:0.5s linear all;\n * position:fixed;\n * left:0;\n * top:0;\n * width:100%;\n * }\n * .view-animation.ng-enter {\n * transform:translateX(100%);\n * }\n * .view-animation.ng-leave,\n * .view-animation.ng-enter.ng-enter-active {\n * transform:translateX(0%);\n * }\n * .view-animation.ng-leave.ng-leave-active {\n * transform:translateX(-100%);\n * }\n * ```\n *\n * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur:\n * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away\n * from its origin. Once that animation is over then the `in` stage occurs which animates the\n * element to its destination. The reason why there are two animations is to give enough time\n * for the enter animation on the new element to be ready.\n *\n * The example above sets up a transition for both the in and out phases, but we can also target the out or\n * in phases directly via `ng-anchor-out` and `ng-anchor-in`.\n *\n * ```css\n * .banner.ng-anchor-out {\n * transition: 0.5s linear all;\n *\n * /* the scale will be applied during the out animation,\n * but will be animated away when the in animation runs */\n * transform: scale(1.2);\n * }\n *\n * .banner.ng-anchor-in {\n * transition: 1s linear all;\n * }\n * ```\n *\n *\n *\n *\n * ### Anchoring Demo\n *\n <example module=\"anchoringExample\"\n name=\"anchoringExample\"\n id=\"anchoringExample\"\n deps=\"angular-animate.js;angular-route.js\"\n animations=\"true\">\n <file name=\"index.html\">\n <a href=\"#/\">Home</a>\n <hr />\n <div class=\"view-container\">\n <div ng-view class=\"view\"></div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('anchoringExample', ['ngAnimate', 'ngRoute'])\n .config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/', {\n templateUrl: 'home.html',\n controller: 'HomeController as home'\n });\n $routeProvider.when('/profile/:id', {\n templateUrl: 'profile.html',\n controller: 'ProfileController as profile'\n });\n }])\n .run(['$rootScope', function($rootScope) {\n $rootScope.records = [\n { id:1, title: \"Miss Beulah Roob\" },\n { id:2, title: \"Trent Morissette\" },\n { id:3, title: \"Miss Ava Pouros\" },\n { id:4, title: \"Rod Pouros\" },\n { id:5, title: \"Abdul Rice\" },\n { id:6, title: \"Laurie Rutherford Sr.\" },\n { id:7, title: \"Nakia McLaughlin\" },\n { id:8, title: \"Jordon Blanda DVM\" },\n { id:9, title: \"Rhoda Hand\" },\n { id:10, title: \"Alexandrea Sauer\" }\n ];\n }])\n .controller('HomeController', [function() {\n //empty\n }])\n .controller('ProfileController', ['$rootScope', '$routeParams', function($rootScope, $routeParams) {\n var index = parseInt($routeParams.id, 10);\n var record = $rootScope.records[index - 1];\n\n this.title = record.title;\n this.id = record.id;\n }]);\n </file>\n <file name=\"home.html\">\n <h2>Welcome to the home page</h1>\n <p>Please click on an element</p>\n <a class=\"record\"\n ng-href=\"#/profile/{{ record.id }}\"\n ng-animate-ref=\"{{ record.id }}\"\n ng-repeat=\"record in records\">\n {{ record.title }}\n </a>\n </file>\n <file name=\"profile.html\">\n <div class=\"profile record\" ng-animate-ref=\"{{ profile.id }}\">\n {{ profile.title }}\n </div>\n </file>\n <file name=\"animations.css\">\n .record {\n display:block;\n font-size:20px;\n }\n .profile {\n background:black;\n color:white;\n font-size:100px;\n }\n .view-container {\n position:relative;\n }\n .view-container > .view.ng-animate {\n position:absolute;\n top:0;\n left:0;\n width:100%;\n min-height:500px;\n }\n .view.ng-enter, .view.ng-leave,\n .record.ng-anchor {\n transition:0.5s linear all;\n }\n .view.ng-enter {\n transform:translateX(100%);\n }\n .view.ng-enter.ng-enter-active, .view.ng-leave {\n transform:translateX(0%);\n }\n .view.ng-leave.ng-leave-active {\n transform:translateX(-100%);\n }\n .record.ng-anchor-out {\n background:red;\n }\n </file>\n </example>\n *\n * ### How is the element transported?\n *\n * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting\n * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element\n * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The\n * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match\n * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied\n * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class\n * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element\n * will become visible since the shim class will be removed.\n *\n * ### How is the morphing handled?\n *\n * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out\n * what CSS classes differ between the starting element and the destination element. These different CSS classes\n * will be added/removed on the anchor element and a transition will be applied (the transition that is provided\n * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will\n * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that\n * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since\n * the cloned element is placed inside of root element which is likely close to the body element).\n *\n * Note that if the root element is on the `<html>` element then the cloned node will be placed inside of body.\n *\n *\n * ## Using $animate in your directive code\n *\n * So far we've explored how to feed in animations into an Angular application, but how do we trigger animations within our own directives in our application?\n * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's\n * imagine we have a greeting box that shows and hides itself when the data changes\n *\n * ```html\n * <greeting-box active=\"onOrOff\">Hi there</greeting-box>\n * ```\n *\n * ```js\n * ngModule.directive('greetingBox', ['$animate', function($animate) {\n * return function(scope, element, attrs) {\n * attrs.$observe('active', function(value) {\n * value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on');\n * });\n * });\n * }]);\n * ```\n *\n * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element\n * in our HTML code then we can trigger a CSS or JS animation to happen.\n *\n * ```css\n * /* normally we would create a CSS class to reference on the element */\n * greeting-box.on { transition:0.5s linear all; background:green; color:white; }\n * ```\n *\n * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's\n * possible be sure to visit the {@link ng.$animate $animate service API page}.\n *\n *\n * ### Preventing Collisions With Third Party Libraries\n *\n * Some third-party frameworks place animation duration defaults across many element or className\n * selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which\n * is expecting actual animations on these elements and has to wait for their completion.\n *\n * You can prevent this unwanted behavior by using a prefix on all your animation classes:\n *\n * ```css\n * /* prefixed with animate- */\n * .animate-fade-add.animate-fade-add-active {\n * transition:1s linear all;\n * opacity:0;\n * }\n * ```\n *\n * You then configure `$animate` to enforce this prefix:\n *\n * ```js\n * $animateProvider.classNameFilter(/animate-/);\n * ```\n *\n * This also may provide your application with a speed boost since only specific elements containing CSS class prefix\n * will be evaluated for animation when any DOM changes occur in the application.\n *\n * ## Callbacks and Promises\n *\n * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger\n * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has\n * ended by chaining onto the returned promise that animation method returns.\n *\n * ```js\n * // somewhere within the depths of the directive\n * $animate.enter(element, parent).then(function() {\n * //the animation has completed\n * });\n * ```\n *\n * (Note that earlier versions of Angular prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case\n * anymore.)\n *\n * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering\n * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view\n * routing controller to hook into that:\n *\n * ```js\n * ngModule.controller('HomePageController', ['$animate', function($animate) {\n * $animate.on('enter', ngViewElement, function(element) {\n * // the animation for this route has completed\n * }]);\n * }])\n * ```\n *\n * (Note that you will need to trigger a digest within the callback to get angular to notice any scope-related changes.)\n */\n\n/**\n * @ngdoc service\n * @name $animate\n * @kind object\n *\n * @description\n * The ngAnimate `$animate` service documentation is the same for the core `$animate` service.\n *\n * Click here {@link ng.$animate to learn more about animations with `$animate`}.\n */\nangular.module('ngAnimate', [])\n .directive('ngAnimateSwap', ngAnimateSwapDirective)\n\n .directive('ngAnimateChildren', $$AnimateChildrenDirective)\n .factory('$$rAFScheduler', $$rAFSchedulerFactory)\n\n .provider('$$animateQueue', $$AnimateQueueProvider)\n .provider('$$animation', $$AnimationProvider)\n\n .provider('$animateCss', $AnimateCssProvider)\n .provider('$$animateCssDriver', $$AnimateCssDriverProvider)\n\n .provider('$$animateJs', $$AnimateJsProvider)\n .provider('$$animateJsDriver', $$AnimateJsDriverProvider);\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.5.0\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/**\n * @ngdoc module\n * @name ngCookies\n * @description\n *\n * # ngCookies\n *\n * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.\n *\n *\n * <div doc-module-components=\"ngCookies\"></div>\n *\n * See {@link ngCookies.$cookies `$cookies`} for usage.\n */\n\n\nangular.module('ngCookies', ['ng']).\n /**\n * @ngdoc provider\n * @name $cookiesProvider\n * @description\n * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.\n * */\n provider('$cookies', [function $CookiesProvider() {\n /**\n * @ngdoc property\n * @name $cookiesProvider#defaults\n * @description\n *\n * Object containing default options to pass when setting cookies.\n *\n * The object may have following properties:\n *\n * - **path** - `{string}` - The cookie will be available only for this path and its\n * sub-paths. By default, this is the URL that appears in your `<base>` tag.\n * - **domain** - `{string}` - The cookie will be available only for this domain and\n * its sub-domains. For security reasons the user agent will not accept the cookie\n * if the current domain is not a sub-domain of this domain or equal to it.\n * - **expires** - `{string|Date}` - String of the form \"Wdy, DD Mon YYYY HH:MM:SS GMT\"\n * or a Date object indicating the exact date/time this cookie will expire.\n * - **secure** - `{boolean}` - If `true`, then the cookie will only be available through a\n * secured connection.\n *\n * Note: By default, the address that appears in your `<base>` tag will be used as the path.\n * This is important so that cookies will be visible for all routes when html5mode is enabled.\n *\n **/\n var defaults = this.defaults = {};\n\n function calcOptions(options) {\n return options ? angular.extend({}, defaults, options) : defaults;\n }\n\n /**\n * @ngdoc service\n * @name $cookies\n *\n * @description\n * Provides read/write access to browser's cookies.\n *\n * <div class=\"alert alert-info\">\n * Up until Angular 1.3, `$cookies` exposed properties that represented the\n * current browser cookie values. In version 1.4, this behavior has changed, and\n * `$cookies` now provides a standard api of getters, setters etc.\n * </div>\n *\n * Requires the {@link ngCookies `ngCookies`} module to be installed.\n *\n * @example\n *\n * ```js\n * angular.module('cookiesExample', ['ngCookies'])\n * .controller('ExampleController', ['$cookies', function($cookies) {\n * // Retrieving a cookie\n * var favoriteCookie = $cookies.get('myFavorite');\n * // Setting a cookie\n * $cookies.put('myFavorite', 'oatmeal');\n * }]);\n * ```\n */\n this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) {\n return {\n /**\n * @ngdoc method\n * @name $cookies#get\n *\n * @description\n * Returns the value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {string} Raw cookie value.\n */\n get: function(key) {\n return $$cookieReader()[key];\n },\n\n /**\n * @ngdoc method\n * @name $cookies#getObject\n *\n * @description\n * Returns the deserialized value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {Object} Deserialized cookie value.\n */\n getObject: function(key) {\n var value = this.get(key);\n return value ? angular.fromJson(value) : value;\n },\n\n /**\n * @ngdoc method\n * @name $cookies#getAll\n *\n * @description\n * Returns a key value object with all the cookies\n *\n * @returns {Object} All cookies\n */\n getAll: function() {\n return $$cookieReader();\n },\n\n /**\n * @ngdoc method\n * @name $cookies#put\n *\n * @description\n * Sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {string} value Raw value to be stored.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n put: function(key, value, options) {\n $$cookieWriter(key, value, calcOptions(options));\n },\n\n /**\n * @ngdoc method\n * @name $cookies#putObject\n *\n * @description\n * Serializes and sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {Object} value Value to be stored.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n putObject: function(key, value, options) {\n this.put(key, angular.toJson(value), options);\n },\n\n /**\n * @ngdoc method\n * @name $cookies#remove\n *\n * @description\n * Remove given cookie\n *\n * @param {string} key Id of the key-value pair to delete.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n remove: function(key, options) {\n $$cookieWriter(key, undefined, calcOptions(options));\n }\n };\n }];\n }]);\n\nangular.module('ngCookies').\n/**\n * @ngdoc service\n * @name $cookieStore\n * @deprecated\n * @requires $cookies\n *\n * @description\n * Provides a key-value (string-object) storage, that is backed by session cookies.\n * Objects put or retrieved from this storage are automatically serialized or\n * deserialized by angular's toJson/fromJson.\n *\n * Requires the {@link ngCookies `ngCookies`} module to be installed.\n *\n * <div class=\"alert alert-danger\">\n * **Note:** The $cookieStore service is **deprecated**.\n * Please use the {@link ngCookies.$cookies `$cookies`} service instead.\n * </div>\n *\n * @example\n *\n * ```js\n * angular.module('cookieStoreExample', ['ngCookies'])\n * .controller('ExampleController', ['$cookieStore', function($cookieStore) {\n * // Put cookie\n * $cookieStore.put('myFavorite','oatmeal');\n * // Get cookie\n * var favoriteCookie = $cookieStore.get('myFavorite');\n * // Removing a cookie\n * $cookieStore.remove('myFavorite');\n * }]);\n * ```\n */\n factory('$cookieStore', ['$cookies', function($cookies) {\n\n return {\n /**\n * @ngdoc method\n * @name $cookieStore#get\n *\n * @description\n * Returns the value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist.\n */\n get: function(key) {\n return $cookies.getObject(key);\n },\n\n /**\n * @ngdoc method\n * @name $cookieStore#put\n *\n * @description\n * Sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {Object} value Value to be stored.\n */\n put: function(key, value) {\n $cookies.putObject(key, value);\n },\n\n /**\n * @ngdoc method\n * @name $cookieStore#remove\n *\n * @description\n * Remove given cookie\n *\n * @param {string} key Id of the key-value pair to delete.\n */\n remove: function(key) {\n $cookies.remove(key);\n }\n };\n\n }]);\n\n/**\n * @name $$cookieWriter\n * @requires $document\n *\n * @description\n * This is a private service for writing cookies\n *\n * @param {string} name Cookie name\n * @param {string=} value Cookie value (if undefined, cookie will be deleted)\n * @param {Object=} options Object with options that need to be stored for the cookie.\n */\nfunction $$CookieWriter($document, $log, $browser) {\n var cookiePath = $browser.baseHref();\n var rawDocument = $document[0];\n\n function buildCookieString(name, value, options) {\n var path, expires;\n options = options || {};\n expires = options.expires;\n path = angular.isDefined(options.path) ? options.path : cookiePath;\n if (angular.isUndefined(value)) {\n expires = 'Thu, 01 Jan 1970 00:00:00 GMT';\n value = '';\n }\n if (angular.isString(expires)) {\n expires = new Date(expires);\n }\n\n var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);\n str += path ? ';path=' + path : '';\n str += options.domain ? ';domain=' + options.domain : '';\n str += expires ? ';expires=' + expires.toUTCString() : '';\n str += options.secure ? ';secure' : '';\n\n // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:\n // - 300 cookies\n // - 20 cookies per unique domain\n // - 4096 bytes per cookie\n var cookieLength = str.length + 1;\n if (cookieLength > 4096) {\n $log.warn(\"Cookie '\" + name +\n \"' possibly not set or overflowed because it was too large (\" +\n cookieLength + \" > 4096 bytes)!\");\n }\n\n return str;\n }\n\n return function(name, value, options) {\n rawDocument.cookie = buildCookieString(name, value, options);\n };\n}\n\n$$CookieWriter.$inject = ['$document', '$log', '$browser'];\n\nangular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() {\n this.$get = $$CookieWriter;\n});\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.5.0\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/* global ngTouchClickDirectiveFactory: false,\n */\n\n/**\n * @ngdoc module\n * @name ngTouch\n * @description\n *\n * # ngTouch\n *\n * The `ngTouch` module provides touch events and other helpers for touch-enabled devices.\n * The implementation is based on jQuery Mobile touch event handling\n * ([jquerymobile.com](http://jquerymobile.com/)).\n *\n *\n * See {@link ngTouch.$swipe `$swipe`} for usage.\n *\n * <div doc-module-components=\"ngTouch\"></div>\n *\n */\n\n// define ngTouch module\n/* global -ngTouch */\nvar ngTouch = angular.module('ngTouch', []);\n\nngTouch.provider('$touch', $TouchProvider);\n\nfunction nodeName_(element) {\n return angular.lowercase(element.nodeName || (element[0] && element[0].nodeName));\n}\n\n/**\n * @ngdoc provider\n * @name $touchProvider\n *\n * @description\n * The `$touchProvider` allows enabling / disabling {@link ngTouch.ngClick ngTouch's ngClick directive}.\n */\n$TouchProvider.$inject = ['$provide', '$compileProvider'];\nfunction $TouchProvider($provide, $compileProvider) {\n\n /**\n * @ngdoc method\n * @name $touchProvider#ngClickOverrideEnabled\n *\n * @param {boolean=} enabled update the ngClickOverrideEnabled state if provided, otherwise just return the\n * current ngClickOverrideEnabled state\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable/disable {@link ngTouch.ngClick ngTouch's ngClick directive}. If enabled,\n * the default ngClick directive will be replaced by a version that eliminates the 300ms delay for\n * click events on browser for touch-devices.\n *\n * The default is `false`.\n *\n */\n var ngClickOverrideEnabled = false;\n var ngClickDirectiveAdded = false;\n this.ngClickOverrideEnabled = function(enabled) {\n if (angular.isDefined(enabled)) {\n\n if (enabled && !ngClickDirectiveAdded) {\n ngClickDirectiveAdded = true;\n\n // Use this to identify the correct directive in the delegate\n ngTouchClickDirectiveFactory.$$moduleName = 'ngTouch';\n $compileProvider.directive('ngClick', ngTouchClickDirectiveFactory);\n\n $provide.decorator('ngClickDirective', ['$delegate', function($delegate) {\n if (ngClickOverrideEnabled) {\n // drop the default ngClick directive\n $delegate.shift();\n } else {\n // drop the ngTouch ngClick directive if the override has been re-disabled (because\n // we cannot de-register added directives)\n var i = $delegate.length - 1;\n while (i >= 0) {\n if ($delegate[i].$$moduleName === 'ngTouch') {\n $delegate.splice(i, 1);\n break;\n }\n i--;\n }\n }\n\n return $delegate;\n }]);\n }\n\n ngClickOverrideEnabled = enabled;\n return this;\n }\n\n return ngClickOverrideEnabled;\n };\n\n /**\n * @ngdoc service\n * @name $touch\n * @kind object\n *\n * @description\n * Provides the {@link ngTouch.$touch#ngClickOverrideEnabled `ngClickOverrideEnabled`} method.\n *\n */\n this.$get = function() {\n return {\n /**\n * @ngdoc method\n * @name $touch#ngClickOverrideEnabled\n *\n * @returns {*} current value of `ngClickOverrideEnabled` set in the {@link ngTouch.$touchProvider $touchProvider},\n * i.e. if {@link ngTouch.ngClick ngTouch's ngClick} directive is enabled.\n *\n * @kind function\n */\n ngClickOverrideEnabled: function() {\n return ngClickOverrideEnabled;\n }\n };\n };\n\n}\n\n/* global ngTouch: false */\n\n /**\n * @ngdoc service\n * @name $swipe\n *\n * @description\n * The `$swipe` service is a service that abstracts the messier details of hold-and-drag swipe\n * behavior, to make implementing swipe-related directives more convenient.\n *\n * Requires the {@link ngTouch `ngTouch`} module to be installed.\n *\n * `$swipe` is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngTouch`.\n *\n * # Usage\n * The `$swipe` service is an object with a single method: `bind`. `bind` takes an element\n * which is to be watched for swipes, and an object with four handler functions. See the\n * documentation for `bind` below.\n */\n\nngTouch.factory('$swipe', [function() {\n // The total distance in any direction before we make the call on swipe vs. scroll.\n var MOVE_BUFFER_RADIUS = 10;\n\n var POINTER_EVENTS = {\n 'mouse': {\n start: 'mousedown',\n move: 'mousemove',\n end: 'mouseup'\n },\n 'touch': {\n start: 'touchstart',\n move: 'touchmove',\n end: 'touchend',\n cancel: 'touchcancel'\n }\n };\n\n function getCoordinates(event) {\n var originalEvent = event.originalEvent || event;\n var touches = originalEvent.touches && originalEvent.touches.length ? originalEvent.touches : [originalEvent];\n var e = (originalEvent.changedTouches && originalEvent.changedTouches[0]) || touches[0];\n\n return {\n x: e.clientX,\n y: e.clientY\n };\n }\n\n function getEvents(pointerTypes, eventType) {\n var res = [];\n angular.forEach(pointerTypes, function(pointerType) {\n var eventName = POINTER_EVENTS[pointerType][eventType];\n if (eventName) {\n res.push(eventName);\n }\n });\n return res.join(' ');\n }\n\n return {\n /**\n * @ngdoc method\n * @name $swipe#bind\n *\n * @description\n * The main method of `$swipe`. It takes an element to be watched for swipe motions, and an\n * object containing event handlers.\n * The pointer types that should be used can be specified via the optional\n * third argument, which is an array of strings `'mouse'` and `'touch'`. By default,\n * `$swipe` will listen for `mouse` and `touch` events.\n *\n * The four events are `start`, `move`, `end`, and `cancel`. `start`, `move`, and `end`\n * receive as a parameter a coordinates object of the form `{ x: 150, y: 310 }` and the raw\n * `event`. `cancel` receives the raw `event` as its single parameter.\n *\n * `start` is called on either `mousedown` or `touchstart`. After this event, `$swipe` is\n * watching for `touchmove` or `mousemove` events. These events are ignored until the total\n * distance moved in either dimension exceeds a small threshold.\n *\n * Once this threshold is exceeded, either the horizontal or vertical delta is greater.\n * - If the horizontal distance is greater, this is a swipe and `move` and `end` events follow.\n * - If the vertical distance is greater, this is a scroll, and we let the browser take over.\n * A `cancel` event is sent.\n *\n * `move` is called on `mousemove` and `touchmove` after the above logic has determined that\n * a swipe is in progress.\n *\n * `end` is called when a swipe is successfully completed with a `touchend` or `mouseup`.\n *\n * `cancel` is called either on a `touchcancel` from the browser, or when we begin scrolling\n * as described above.\n *\n */\n bind: function(element, eventHandlers, pointerTypes) {\n // Absolute total movement, used to control swipe vs. scroll.\n var totalX, totalY;\n // Coordinates of the start position.\n var startCoords;\n // Last event's position.\n var lastPos;\n // Whether a swipe is active.\n var active = false;\n\n pointerTypes = pointerTypes || ['mouse', 'touch'];\n element.on(getEvents(pointerTypes, 'start'), function(event) {\n startCoords = getCoordinates(event);\n active = true;\n totalX = 0;\n totalY = 0;\n lastPos = startCoords;\n eventHandlers['start'] && eventHandlers['start'](startCoords, event);\n });\n var events = getEvents(pointerTypes, 'cancel');\n if (events) {\n element.on(events, function(event) {\n active = false;\n eventHandlers['cancel'] && eventHandlers['cancel'](event);\n });\n }\n\n element.on(getEvents(pointerTypes, 'move'), function(event) {\n if (!active) return;\n\n // Android will send a touchcancel if it thinks we're starting to scroll.\n // So when the total distance (+ or - or both) exceeds 10px in either direction,\n // we either:\n // - On totalX > totalY, we send preventDefault() and treat this as a swipe.\n // - On totalY > totalX, we let the browser handle it as a scroll.\n\n if (!startCoords) return;\n var coords = getCoordinates(event);\n\n totalX += Math.abs(coords.x - lastPos.x);\n totalY += Math.abs(coords.y - lastPos.y);\n\n lastPos = coords;\n\n if (totalX < MOVE_BUFFER_RADIUS && totalY < MOVE_BUFFER_RADIUS) {\n return;\n }\n\n // One of totalX or totalY has exceeded the buffer, so decide on swipe vs. scroll.\n if (totalY > totalX) {\n // Allow native scrolling to take over.\n active = false;\n eventHandlers['cancel'] && eventHandlers['cancel'](event);\n return;\n } else {\n // Prevent the browser from scrolling.\n event.preventDefault();\n eventHandlers['move'] && eventHandlers['move'](coords, event);\n }\n });\n\n element.on(getEvents(pointerTypes, 'end'), function(event) {\n if (!active) return;\n active = false;\n eventHandlers['end'] && eventHandlers['end'](getCoordinates(event), event);\n });\n }\n };\n}]);\n\n/* global ngTouch: false,\n nodeName_: false\n*/\n\n/**\n * @ngdoc directive\n * @name ngClick\n * @deprecated\n *\n * @description\n * <div class=\"alert alert-danger\">\n * **DEPRECATION NOTICE**: Beginning with Angular 1.5, this directive is deprecated and by default **disabled**.\n * The directive will receive no further support and might be removed from future releases.\n * If you need the directive, you can enable it with the {@link ngTouch.$touchProvider $touchProvider#ngClickOverrideEnabled}\n * function. We also recommend that you migrate to [FastClick](https://github.com/ftlabs/fastclick).\n * To learn more about the 300ms delay, this [Telerik article](http://developer.telerik.com/featured/300-ms-click-delay-ios-8/)\n * gives a good overview.\n * </div>\n * A more powerful replacement for the default ngClick designed to be used on touchscreen\n * devices. Most mobile browsers wait about 300ms after a tap-and-release before sending\n * the click event. This version handles them immediately, and then prevents the\n * following click event from propagating.\n *\n * Requires the {@link ngTouch `ngTouch`} module to be installed.\n *\n * This directive can fall back to using an ordinary click event, and so works on desktop\n * browsers as well as mobile.\n *\n * This directive also sets the CSS class `ng-click-active` while the element is being held\n * down (by a mouse click or touch) so you can restyle the depressed element if you wish.\n *\n * @element ANY\n * @param {expression} ngClick {@link guide/expression Expression} to evaluate\n * upon tap. (Event object is available as `$event`)\n *\n * @example\n <example module=\"ngClickExample\" deps=\"angular-touch.js\">\n <file name=\"index.html\">\n <button ng-click=\"count = count + 1\" ng-init=\"count=0\">\n Increment\n </button>\n count: {{ count }}\n </file>\n <file name=\"script.js\">\n angular.module('ngClickExample', ['ngTouch']);\n </file>\n </example>\n */\n\nvar ngTouchClickDirectiveFactory = ['$parse', '$timeout', '$rootElement',\n function($parse, $timeout, $rootElement) {\n var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag.\n var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers.\n var PREVENT_DURATION = 2500; // 2.5 seconds maximum from preventGhostClick call to click\n var CLICKBUSTER_THRESHOLD = 25; // 25 pixels in any dimension is the limit for busting clicks.\n\n var ACTIVE_CLASS_NAME = 'ng-click-active';\n var lastPreventedTime;\n var touchCoordinates;\n var lastLabelClickCoordinates;\n\n\n // TAP EVENTS AND GHOST CLICKS\n //\n // Why tap events?\n // Mobile browsers detect a tap, then wait a moment (usually ~300ms) to see if you're\n // double-tapping, and then fire a click event.\n //\n // This delay sucks and makes mobile apps feel unresponsive.\n // So we detect touchstart, touchcancel and touchend ourselves and determine when\n // the user has tapped on something.\n //\n // What happens when the browser then generates a click event?\n // The browser, of course, also detects the tap and fires a click after a delay. This results in\n // tapping/clicking twice. We do \"clickbusting\" to prevent it.\n //\n // How does it work?\n // We attach global touchstart and click handlers, that run during the capture (early) phase.\n // So the sequence for a tap is:\n // - global touchstart: Sets an \"allowable region\" at the point touched.\n // - element's touchstart: Starts a touch\n // (- touchcancel ends the touch, no click follows)\n // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold\n // too long) and fires the user's tap handler. The touchend also calls preventGhostClick().\n // - preventGhostClick() removes the allowable region the global touchstart created.\n // - The browser generates a click event.\n // - The global click handler catches the click, and checks whether it was in an allowable region.\n // - If preventGhostClick was called, the region will have been removed, the click is busted.\n // - If the region is still there, the click proceeds normally. Therefore clicks on links and\n // other elements without ngTap on them work normally.\n //\n // This is an ugly, terrible hack!\n // Yeah, tell me about it. The alternatives are using the slow click events, or making our users\n // deal with the ghost clicks, so I consider this the least of evils. Fortunately Angular\n // encapsulates this ugly logic away from the user.\n //\n // Why not just put click handlers on the element?\n // We do that too, just to be sure. If the tap event caused the DOM to change,\n // it is possible another element is now in that position. To take account for these possibly\n // distinct elements, the handlers are global and care only about coordinates.\n\n // Checks if the coordinates are close enough to be within the region.\n function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }\n\n // Checks a list of allowable regions against a click location.\n // Returns true if the click should be allowed.\n // Splices out the allowable region from the list after it has been used.\n function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }\n\n // Global click handler that prevents the click if it's in a bustable zone and preventGhostClick\n // was called recently.\n function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (nodeName_(event.target) === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur && event.target.blur();\n }\n\n\n // Global touchstart handler that creates an allowable region for a click event.\n // This allowable region can be removed by preventGhostClick if we want to bust it.\n function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function() {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }\n\n // On the first call, attaches some event handlers. Then whenever it gets called, it creates a\n // zone around the touchstart where clicks will get busted.\n function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }\n\n // Actual linking function.\n return function(scope, element, attr) {\n var clickHandler = $parse(attr.ngClick),\n tapping = false,\n tapElement, // Used to blur the element after a tap.\n startTime, // Used to check if the tap was held too long.\n touchStartX,\n touchStartY;\n\n function resetState() {\n tapping = false;\n element.removeClass(ACTIVE_CLASS_NAME);\n }\n\n element.on('touchstart', function(event) {\n tapping = true;\n tapElement = event.target ? event.target : event.srcElement; // IE uses srcElement.\n // Hack for Safari, which can target text nodes instead of containers.\n if (tapElement.nodeType == 3) {\n tapElement = tapElement.parentNode;\n }\n\n element.addClass(ACTIVE_CLASS_NAME);\n\n startTime = Date.now();\n\n // Use jQuery originalEvent\n var originalEvent = event.originalEvent || event;\n var touches = originalEvent.touches && originalEvent.touches.length ? originalEvent.touches : [originalEvent];\n var e = touches[0];\n touchStartX = e.clientX;\n touchStartY = e.clientY;\n });\n\n element.on('touchcancel', function(event) {\n resetState();\n });\n\n element.on('touchend', function(event) {\n var diff = Date.now() - startTime;\n\n // Use jQuery originalEvent\n var originalEvent = event.originalEvent || event;\n var touches = (originalEvent.changedTouches && originalEvent.changedTouches.length) ?\n originalEvent.changedTouches :\n ((originalEvent.touches && originalEvent.touches.length) ? originalEvent.touches : [originalEvent]);\n var e = touches[0];\n var x = e.clientX;\n var y = e.clientY;\n var dist = Math.sqrt(Math.pow(x - touchStartX, 2) + Math.pow(y - touchStartY, 2));\n\n if (tapping && diff < TAP_DURATION && dist < MOVE_TOLERANCE) {\n // Call preventGhostClick so the clickbuster will catch the corresponding click.\n preventGhostClick(x, y);\n\n // Blur the focused element (the button, probably) before firing the callback.\n // This doesn't work perfectly on Android Chrome, but seems to work elsewhere.\n // I couldn't get anything to work reliably on Android Chrome.\n if (tapElement) {\n tapElement.blur();\n }\n\n if (!angular.isDefined(attr.disabled) || attr.disabled === false) {\n element.triggerHandler('click', [event]);\n }\n }\n\n resetState();\n });\n\n // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click\n // something else nearby.\n element.onclick = function(event) { };\n\n // Actual click handler.\n // There are three different kinds of clicks, only two of which reach this point.\n // - On desktop browsers without touch events, their clicks will always come here.\n // - On mobile browsers, the simulated \"fast\" click will call this.\n // - But the browser's follow-up slow click will be \"busted\" before it reaches this handler.\n // Therefore it's safe to use this directive on both mobile and desktop.\n element.on('click', function(event, touchend) {\n scope.$apply(function() {\n clickHandler(scope, {$event: (touchend || event)});\n });\n });\n\n element.on('mousedown', function(event) {\n element.addClass(ACTIVE_CLASS_NAME);\n });\n\n element.on('mousemove mouseup', function(event) {\n element.removeClass(ACTIVE_CLASS_NAME);\n });\n\n };\n}];\n\n/* global ngTouch: false */\n\n/**\n * @ngdoc directive\n * @name ngSwipeLeft\n *\n * @description\n * Specify custom behavior when an element is swiped to the left on a touchscreen device.\n * A leftward swipe is a quick, right-to-left slide of the finger.\n * Though ngSwipeLeft is designed for touch-based devices, it will work with a mouse click and drag\n * too.\n *\n * To disable the mouse click and drag functionality, add `ng-swipe-disable-mouse` to\n * the `ng-swipe-left` or `ng-swipe-right` DOM Element.\n *\n * Requires the {@link ngTouch `ngTouch`} module to be installed.\n *\n * @element ANY\n * @param {expression} ngSwipeLeft {@link guide/expression Expression} to evaluate\n * upon left swipe. (Event object is available as `$event`)\n *\n * @example\n <example module=\"ngSwipeLeftExample\" deps=\"angular-touch.js\">\n <file name=\"index.html\">\n <div ng-show=\"!showActions\" ng-swipe-left=\"showActions = true\">\n Some list content, like an email in the inbox\n </div>\n <div ng-show=\"showActions\" ng-swipe-right=\"showActions = false\">\n <button ng-click=\"reply()\">Reply</button>\n <button ng-click=\"delete()\">Delete</button>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngSwipeLeftExample', ['ngTouch']);\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngSwipeRight\n *\n * @description\n * Specify custom behavior when an element is swiped to the right on a touchscreen device.\n * A rightward swipe is a quick, left-to-right slide of the finger.\n * Though ngSwipeRight is designed for touch-based devices, it will work with a mouse click and drag\n * too.\n *\n * Requires the {@link ngTouch `ngTouch`} module to be installed.\n *\n * @element ANY\n * @param {expression} ngSwipeRight {@link guide/expression Expression} to evaluate\n * upon right swipe. (Event object is available as `$event`)\n *\n * @example\n <example module=\"ngSwipeRightExample\" deps=\"angular-touch.js\">\n <file name=\"index.html\">\n <div ng-show=\"!showActions\" ng-swipe-left=\"showActions = true\">\n Some list content, like an email in the inbox\n </div>\n <div ng-show=\"showActions\" ng-swipe-right=\"showActions = false\">\n <button ng-click=\"reply()\">Reply</button>\n <button ng-click=\"delete()\">Delete</button>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngSwipeRightExample', ['ngTouch']);\n </file>\n </example>\n */\n\nfunction makeSwipeDirective(directiveName, direction, eventName) {\n ngTouch.directive(directiveName, ['$parse', '$swipe', function($parse, $swipe) {\n // The maximum vertical delta for a swipe should be less than 75px.\n var MAX_VERTICAL_DISTANCE = 75;\n // Vertical distance should not be more than a fraction of the horizontal distance.\n var MAX_VERTICAL_RATIO = 0.3;\n // At least a 30px lateral motion is necessary for a swipe.\n var MIN_HORIZONTAL_DISTANCE = 30;\n\n return function(scope, element, attr) {\n var swipeHandler = $parse(attr[directiveName]);\n\n var startCoords, valid;\n\n function validSwipe(coords) {\n // Check that it's within the coordinates.\n // Absolute vertical distance must be within tolerances.\n // Horizontal distance, we take the current X - the starting X.\n // This is negative for leftward swipes and positive for rightward swipes.\n // After multiplying by the direction (-1 for left, +1 for right), legal swipes\n // (ie. same direction as the directive wants) will have a positive delta and\n // illegal ones a negative delta.\n // Therefore this delta must be positive, and larger than the minimum.\n if (!startCoords) return false;\n var deltaY = Math.abs(coords.y - startCoords.y);\n var deltaX = (coords.x - startCoords.x) * direction;\n return valid && // Short circuit for already-invalidated swipes.\n deltaY < MAX_VERTICAL_DISTANCE &&\n deltaX > 0 &&\n deltaX > MIN_HORIZONTAL_DISTANCE &&\n deltaY / deltaX < MAX_VERTICAL_RATIO;\n }\n\n var pointerTypes = ['touch'];\n if (!angular.isDefined(attr['ngSwipeDisableMouse'])) {\n pointerTypes.push('mouse');\n }\n $swipe.bind(element, {\n 'start': function(coords, event) {\n startCoords = coords;\n valid = true;\n },\n 'cancel': function(event) {\n valid = false;\n },\n 'end': function(coords, event) {\n if (validSwipe(coords)) {\n scope.$apply(function() {\n element.triggerHandler(eventName);\n swipeHandler(scope, {$event: event});\n });\n }\n }\n }, pointerTypes);\n };\n }]);\n}\n\n// Left is negative X-coordinate, right is positive.\nmakeSwipeDirective('ngSwipeLeft', -1, 'swipeleft');\nmakeSwipeDirective('ngSwipeRight', 1, 'swiperight');\n\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.5.0\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $sanitizeMinErr = angular.$$minErr('$sanitize');\n\n/**\n * @ngdoc module\n * @name ngSanitize\n * @description\n *\n * # ngSanitize\n *\n * The `ngSanitize` module provides functionality to sanitize HTML.\n *\n *\n * <div doc-module-components=\"ngSanitize\"></div>\n *\n * See {@link ngSanitize.$sanitize `$sanitize`} for usage.\n */\n\n/**\n * @ngdoc service\n * @name $sanitize\n * @kind function\n *\n * @description\n * Sanitizes an html string by stripping all potentially dangerous tokens.\n *\n * The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are\n * then serialized back to properly escaped html string. This means that no unsafe input can make\n * it into the returned string.\n *\n * The whitelist for URL sanitization of attribute values is configured using the functions\n * `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider\n * `$compileProvider`}.\n *\n * The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}.\n *\n * @param {string} html HTML input.\n * @returns {string} Sanitized HTML.\n *\n * @example\n <example module=\"sanitizeExample\" deps=\"angular-sanitize.js\">\n <file name=\"index.html\">\n <script>\n angular.module('sanitizeExample', ['ngSanitize'])\n .controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {\n $scope.snippet =\n '<p style=\"color:blue\">an html\\n' +\n '<em onmouseover=\"this.textContent=\\'PWN3D!\\'\">click here</em>\\n' +\n 'snippet</p>';\n $scope.deliberatelyTrustDangerousSnippet = function() {\n return $sce.trustAsHtml($scope.snippet);\n };\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n <table>\n <tr>\n <td>Directive</td>\n <td>How</td>\n <td>Source</td>\n <td>Rendered</td>\n </tr>\n <tr id=\"bind-html-with-sanitize\">\n <td>ng-bind-html</td>\n <td>Automatically uses $sanitize</td>\n <td><pre><div ng-bind-html=\"snippet\"><br/></div></pre></td>\n <td><div ng-bind-html=\"snippet\"></div></td>\n </tr>\n <tr id=\"bind-html-with-trust\">\n <td>ng-bind-html</td>\n <td>Bypass $sanitize by explicitly trusting the dangerous value</td>\n <td>\n <pre><div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\">\n</div></pre>\n </td>\n <td><div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\"></div></td>\n </tr>\n <tr id=\"bind-default\">\n <td>ng-bind</td>\n <td>Automatically escapes</td>\n <td><pre><div ng-bind=\"snippet\"><br/></div></pre></td>\n <td><div ng-bind=\"snippet\"></div></td>\n </tr>\n </table>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should sanitize the html snippet by default', function() {\n expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n toBe('<p>an html\\n<em>click here</em>\\nsnippet</p>');\n });\n\n it('should inline raw snippet if bound to a trusted value', function() {\n expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it('should escape snippet without any filter', function() {\n expect(element(by.css('#bind-default div')).getInnerHtml()).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it('should update', function() {\n element(by.model('snippet')).clear();\n element(by.model('snippet')).sendKeys('new <b onclick=\"alert(1)\">text</b>');\n expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n toBe('new <b>text</b>');\n expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(\n 'new <b onclick=\"alert(1)\">text</b>');\n expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(\n \"new <b onclick=\\\"alert(1)\\\">text</b>\");\n });\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc provider\n * @name $sanitizeProvider\n *\n * @description\n * Creates and configures {@link $sanitize} instance.\n */\nfunction $SanitizeProvider() {\n var svgEnabled = false;\n\n this.$get = ['$$sanitizeUri', function($$sanitizeUri) {\n if (svgEnabled) {\n angular.extend(validElements, svgElements);\n }\n return function(html) {\n var buf = [];\n htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {\n return !/^unsafe:/.test($$sanitizeUri(uri, isImage));\n }));\n return buf.join('');\n };\n }];\n\n\n /**\n * @ngdoc method\n * @name $sanitizeProvider#enableSvg\n * @kind function\n *\n * @description\n * Enables a subset of svg to be supported by the sanitizer.\n *\n * <div class=\"alert alert-warning\">\n * <p>By enabling this setting without taking other precautions, you might expose your\n * application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned\n * outside of the containing element and be rendered over other elements on the page (e.g. a login\n * link). Such behavior can then result in phishing incidents.</p>\n *\n * <p>To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg\n * tags within the sanitized content:</p>\n *\n * <br>\n *\n * <pre><code>\n * .rootOfTheIncludedContent svg {\n * overflow: hidden !important;\n * }\n * </code></pre>\n * </div>\n *\n * @param {boolean=} regexp New regexp to whitelist urls with.\n * @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called\n * without an argument or self for chaining otherwise.\n */\n this.enableSvg = function(enableSvg) {\n if (angular.isDefined(enableSvg)) {\n svgEnabled = enableSvg;\n return this;\n } else {\n return svgEnabled;\n }\n };\n}\n\nfunction sanitizeText(chars) {\n var buf = [];\n var writer = htmlSanitizeWriter(buf, angular.noop);\n writer.chars(chars);\n return buf.join('');\n}\n\n\n// Regular Expressions for parsing tags and attributes\nvar SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n // Match everything outside of normal chars and \" (quote character)\n NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n\n\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nvar voidElements = toMap(\"area,br,col,hr,img,wbr\");\n\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nvar optionalEndTagBlockElements = toMap(\"colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr\"),\n optionalEndTagInlineElements = toMap(\"rp,rt\"),\n optionalEndTagElements = angular.extend({},\n optionalEndTagInlineElements,\n optionalEndTagBlockElements);\n\n// Safe Block Elements - HTML5\nvar blockElements = angular.extend({}, optionalEndTagBlockElements, toMap(\"address,article,\" +\n \"aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,\" +\n \"h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul\"));\n\n// Inline Elements - HTML5\nvar inlineElements = angular.extend({}, optionalEndTagInlineElements, toMap(\"a,abbr,acronym,b,\" +\n \"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,\" +\n \"samp,small,span,strike,strong,sub,sup,time,tt,u,var\"));\n\n// SVG Elements\n// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements\n// Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted.\n// They can potentially allow for arbitrary javascript to be executed. See #11290\nvar svgElements = toMap(\"circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,\" +\n \"hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,\" +\n \"radialGradient,rect,stop,svg,switch,text,title,tspan\");\n\n// Blocked Elements (will be stripped)\nvar blockedElements = toMap(\"script,style\");\n\nvar validElements = angular.extend({},\n voidElements,\n blockElements,\n inlineElements,\n optionalEndTagElements);\n\n//Attributes that have href and hence need to be sanitized\nvar uriAttrs = toMap(\"background,cite,href,longdesc,src,xlink:href\");\n\nvar htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +\n 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +\n 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' +\n 'valign,value,vspace,width');\n\n// SVG attributes (without \"id\" and \"name\" attributes)\n// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes\nvar svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +\n 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' +\n 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' +\n 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' +\n 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' +\n 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' +\n 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' +\n 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' +\n 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' +\n 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' +\n 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' +\n 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' +\n 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' +\n 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' +\n 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true);\n\nvar validAttrs = angular.extend({},\n uriAttrs,\n svgAttrs,\n htmlAttrs);\n\nfunction toMap(str, lowercaseKeys) {\n var obj = {}, items = str.split(','), i;\n for (i = 0; i < items.length; i++) {\n obj[lowercaseKeys ? angular.lowercase(items[i]) : items[i]] = true;\n }\n return obj;\n}\n\nvar inertBodyElement;\n(function(window) {\n var doc;\n if (window.document && window.document.implementation) {\n doc = window.document.implementation.createHTMLDocument(\"inert\");\n } else {\n throw $sanitizeMinErr('noinert', \"Can't create an inert html document\");\n }\n var docElement = doc.documentElement || doc.getDocumentElement();\n var bodyElements = docElement.getElementsByTagName('body');\n\n // usually there should be only one body element in the document, but IE doesn't have any, so we need to create one\n if (bodyElements.length === 1) {\n inertBodyElement = bodyElements[0];\n } else {\n var html = doc.createElement('html');\n inertBodyElement = doc.createElement('body');\n html.appendChild(inertBodyElement);\n doc.appendChild(html);\n }\n})(window);\n\n/**\n * @example\n * htmlParser(htmlString, {\n * start: function(tag, attrs) {},\n * end: function(tag) {},\n * chars: function(text) {},\n * comment: function(text) {}\n * });\n *\n * @param {string} html string\n * @param {object} handler\n */\nfunction htmlParser(html, handler) {\n if (html === null || html === undefined) {\n html = '';\n } else if (typeof html !== 'string') {\n html = '' + html;\n }\n inertBodyElement.innerHTML = html;\n\n //mXSS protection\n var mXSSAttempts = 5;\n do {\n if (mXSSAttempts === 0) {\n throw $sanitizeMinErr('uinput', \"Failed to sanitize html because the input is unstable\");\n }\n mXSSAttempts--;\n\n // strip custom-namespaced attributes on IE<=11\n if (document.documentMode <= 11) {\n stripCustomNsAttrs(inertBodyElement);\n }\n html = inertBodyElement.innerHTML; //trigger mXSS\n inertBodyElement.innerHTML = html;\n } while (html !== inertBodyElement.innerHTML);\n\n var node = inertBodyElement.firstChild;\n while (node) {\n switch (node.nodeType) {\n case 1: // ELEMENT_NODE\n handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes));\n break;\n case 3: // TEXT NODE\n handler.chars(node.textContent);\n break;\n }\n\n var nextNode;\n if (!(nextNode = node.firstChild)) {\n if (node.nodeType == 1) {\n handler.end(node.nodeName.toLowerCase());\n }\n nextNode = node.nextSibling;\n if (!nextNode) {\n while (nextNode == null) {\n node = node.parentNode;\n if (node === inertBodyElement) break;\n nextNode = node.nextSibling;\n if (node.nodeType == 1) {\n handler.end(node.nodeName.toLowerCase());\n }\n }\n }\n }\n node = nextNode;\n }\n\n while (node = inertBodyElement.firstChild) {\n inertBodyElement.removeChild(node);\n }\n}\n\nfunction attrToMap(attrs) {\n var map = {};\n for (var i = 0, ii = attrs.length; i < ii; i++) {\n var attr = attrs[i];\n map[attr.name] = attr.value;\n }\n return map;\n}\n\n\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n * @returns {string} escaped text\n */\nfunction encodeEntities(value) {\n return value.\n replace(/&/g, '&').\n replace(SURROGATE_PAIR_REGEXP, function(value) {\n var hi = value.charCodeAt(0);\n var low = value.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n }).\n replace(NON_ALPHANUMERIC_REGEXP, function(value) {\n return '&#' + value.charCodeAt(0) + ';';\n }).\n replace(/</g, '<').\n replace(/>/g, '>');\n}\n\n/**\n * create an HTML/XML writer which writes to buffer\n * @param {Array} buf use buf.join('') to get out sanitized html string\n * @returns {object} in the form of {\n * start: function(tag, attrs) {},\n * end: function(tag) {},\n * chars: function(text) {},\n * comment: function(text) {}\n * }\n */\nfunction htmlSanitizeWriter(buf, uriValidator) {\n var ignoreCurrentElement = false;\n var out = angular.bind(buf, buf.push);\n return {\n start: function(tag, attrs) {\n tag = angular.lowercase(tag);\n if (!ignoreCurrentElement && blockedElements[tag]) {\n ignoreCurrentElement = tag;\n }\n if (!ignoreCurrentElement && validElements[tag] === true) {\n out('<');\n out(tag);\n angular.forEach(attrs, function(value, key) {\n var lkey=angular.lowercase(key);\n var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');\n if (validAttrs[lkey] === true &&\n (uriAttrs[lkey] !== true || uriValidator(value, isImage))) {\n out(' ');\n out(key);\n out('=\"');\n out(encodeEntities(value));\n out('\"');\n }\n });\n out('>');\n }\n },\n end: function(tag) {\n tag = angular.lowercase(tag);\n if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) {\n out('</');\n out(tag);\n out('>');\n }\n if (tag == ignoreCurrentElement) {\n ignoreCurrentElement = false;\n }\n },\n chars: function(chars) {\n if (!ignoreCurrentElement) {\n out(encodeEntities(chars));\n }\n }\n };\n}\n\n\n/**\n * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare\n * ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want\n * to allow any of these custom attributes. This method strips them all.\n *\n * @param node Root element to process\n */\nfunction stripCustomNsAttrs(node) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n var attrs = node.attributes;\n for (var i = 0, l = attrs.length; i < l; i++) {\n var attrNode = attrs[i];\n var attrName = attrNode.name.toLowerCase();\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n node.removeAttributeNode(attrNode);\n i--;\n l--;\n }\n }\n }\n\n var nextNode = node.firstChild;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n\n nextNode = node.nextSibling;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n}\n\n\n\n// define ngSanitize module and register $sanitize service\nangular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);\n\n/* global sanitizeText: false */\n\n/**\n * @ngdoc filter\n * @name linky\n * @kind function\n *\n * @description\n * Finds links in text input and turns them into html links. Supports `http/https/ftp/mailto` and\n * plain email address links.\n *\n * Requires the {@link ngSanitize `ngSanitize`} module to be installed.\n *\n * @param {string} text Input text.\n * @param {string} target Window (`_blank|_self|_parent|_top`) or named frame to open links in.\n * @param {object|function(url)} [attributes] Add custom attributes to the link element.\n *\n * Can be one of:\n *\n * - `object`: A map of attributes\n * - `function`: Takes the url as a parameter and returns a map of attributes\n *\n * If the map of attributes contains a value for `target`, it overrides the value of\n * the target parameter.\n *\n *\n * @returns {string} Html-linkified and {@link $sanitize sanitized} text.\n *\n * @usage\n <span ng-bind-html=\"linky_expression | linky\"></span>\n *\n * @example\n <example module=\"linkyExample\" deps=\"angular-sanitize.js\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n <table>\n <tr>\n <th>Filter</th>\n <th>Source</th>\n <th>Rendered</th>\n </tr>\n <tr id=\"linky-filter\">\n <td>linky filter</td>\n <td>\n <pre><div ng-bind-html=\"snippet | linky\"><br></div></pre>\n </td>\n <td>\n <div ng-bind-html=\"snippet | linky\"></div>\n </td>\n </tr>\n <tr id=\"linky-target\">\n <td>linky target</td>\n <td>\n <pre><div ng-bind-html=\"snippetWithSingleURL | linky:'_blank'\"><br></div></pre>\n </td>\n <td>\n <div ng-bind-html=\"snippetWithSingleURL | linky:'_blank'\"></div>\n </td>\n </tr>\n <tr id=\"linky-custom-attributes\">\n <td>linky custom attributes</td>\n <td>\n <pre><div ng-bind-html=\"snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}\"><br></div></pre>\n </td>\n <td>\n <div ng-bind-html=\"snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}\"></div>\n </td>\n </tr>\n <tr id=\"escaped-html\">\n <td>no filter</td>\n <td><pre><div ng-bind=\"snippet\"><br></div></pre></td>\n <td><div ng-bind=\"snippet\"></div></td>\n </tr>\n </table>\n </file>\n <file name=\"script.js\">\n angular.module('linkyExample', ['ngSanitize'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.snippet =\n 'Pretty text with some links:\\n'+\n 'http://angularjs.org/,\\n'+\n 'mailto:us@somewhere.org,\\n'+\n 'another@somewhere.org,\\n'+\n 'and one more: ftp://127.0.0.1/.';\n $scope.snippetWithSingleURL = 'http://angularjs.org/';\n }]);\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should linkify the snippet with urls', function() {\n expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +\n 'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);\n });\n\n it('should not linkify snippet without the linky filter', function() {\n expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).\n toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +\n 'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);\n });\n\n it('should update', function() {\n element(by.model('snippet')).clear();\n element(by.model('snippet')).sendKeys('new http://link.');\n expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n toBe('new http://link.');\n expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);\n expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())\n .toBe('new http://link.');\n });\n\n it('should work with the target property', function() {\n expect(element(by.id('linky-target')).\n element(by.binding(\"snippetWithSingleURL | linky:'_blank'\")).getText()).\n toBe('http://angularjs.org/');\n expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');\n });\n\n it('should optionally add custom attributes', function() {\n expect(element(by.id('linky-custom-attributes')).\n element(by.binding(\"snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}\")).getText()).\n toBe('http://angularjs.org/');\n expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow');\n });\n </file>\n </example>\n */\nangular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"\\u201d\\u2019]/i,\n MAILTO_REGEXP = /^mailto:/i;\n\n var linkyMinErr = angular.$$minErr('linky');\n var isString = angular.isString;\n\n return function(text, target, attributes) {\n if (text == null || text === '') return text;\n if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text);\n\n var match;\n var raw = text;\n var html = [];\n var url;\n var i;\n while ((match = raw.match(LINKY_URL_REGEXP))) {\n // We can not end in these as they are sometimes found at the end of the sentence\n url = match[0];\n // if we did not match ftp/http/www/mailto then assume mailto\n if (!match[2] && !match[4]) {\n url = (match[3] ? 'http://' : 'mailto:') + url;\n }\n i = match.index;\n addText(raw.substr(0, i));\n addLink(url, match[0].replace(MAILTO_REGEXP, ''));\n raw = raw.substring(i + match[0].length);\n }\n addText(raw);\n return $sanitize(html.join(''));\n\n function addText(text) {\n if (!text) {\n return;\n }\n html.push(sanitizeText(text));\n }\n\n function addLink(url, text) {\n var key;\n html.push('<a ');\n if (angular.isFunction(attributes)) {\n attributes = attributes(url);\n }\n if (angular.isObject(attributes)) {\n for (key in attributes) {\n html.push(key + '=\"' + attributes[key] + '\" ');\n }\n } else {\n attributes = {};\n }\n if (angular.isDefined(target) && !('target' in attributes)) {\n html.push('target=\"',\n target,\n '\" ');\n }\n html.push('href=\"',\n url.replace(/\"/g, '"'),\n '\">');\n addText(text);\n html.push('</a>');\n }\n };\n}]);\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.5.0\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/* jshint ignore:start */\n// this code is in the core, but not in angular-messages.js\nvar isArray = angular.isArray;\nvar forEach = angular.forEach;\nvar isString = angular.isString;\nvar jqLite = angular.element;\n/* jshint ignore:end */\n\n/**\n * @ngdoc module\n * @name ngMessages\n * @description\n *\n * The `ngMessages` module provides enhanced support for displaying messages within templates\n * (typically within forms or when rendering message objects that return key/value data).\n * Instead of relying on JavaScript code and/or complex ng-if statements within your form template to\n * show and hide error messages specific to the state of an input field, the `ngMessages` and\n * `ngMessage` directives are designed to handle the complexity, inheritance and priority\n * sequencing based on the order of how the messages are defined in the template.\n *\n * Currently, the ngMessages module only contains the code for the `ngMessages`, `ngMessagesInclude`\n * `ngMessage` and `ngMessageExp` directives.\n *\n * # Usage\n * The `ngMessages` directive listens on a key/value collection which is set on the ngMessages attribute.\n * Since the {@link ngModel ngModel} directive exposes an `$error` object, this error object can be\n * used with `ngMessages` to display control error messages in an easier way than with just regular angular\n * template directives.\n *\n * ```html\n * <form name=\"myForm\">\n * <label>\n * Enter text:\n * <input type=\"text\" ng-model=\"field\" name=\"myField\" required minlength=\"5\" />\n * </label>\n * <div ng-messages=\"myForm.myField.$error\" role=\"alert\">\n * <div ng-message=\"required\">You did not enter a field</div>\n * <div ng-message=\"minlength, maxlength\">\n * Your email must be between 5 and 100 characters long\n * </div>\n * </div>\n * </form>\n * ```\n *\n * Now whatever key/value entries are present within the provided object (in this case `$error`) then\n * the ngMessages directive will render the inner first ngMessage directive (depending if the key values\n * match the attribute value present on each ngMessage directive). In other words, if your errors\n * object contains the following data:\n *\n * ```javascript\n * <!-- keep in mind that ngModel automatically sets these error flags -->\n * myField.$error = { minlength : true, required : true };\n * ```\n *\n * Then the `required` message will be displayed first. When required is false then the `minlength` message\n * will be displayed right after (since these messages are ordered this way in the template HTML code).\n * The prioritization of each message is determined by what order they're present in the DOM.\n * Therefore, instead of having custom JavaScript code determine the priority of what errors are\n * present before others, the presentation of the errors are handled within the template.\n *\n * By default, ngMessages will only display one error at a time. However, if you wish to display all\n * messages then the `ng-messages-multiple` attribute flag can be used on the element containing the\n * ngMessages directive to make this happen.\n *\n * ```html\n * <!-- attribute-style usage -->\n * <div ng-messages=\"myForm.myField.$error\" ng-messages-multiple>...</div>\n *\n * <!-- element-style usage -->\n * <ng-messages for=\"myForm.myField.$error\" multiple>...</ng-messages>\n * ```\n *\n * ## Reusing and Overriding Messages\n * In addition to prioritization, ngMessages also allows for including messages from a remote or an inline\n * template. This allows for generic collection of messages to be reused across multiple parts of an\n * application.\n *\n * ```html\n * <script type=\"text/ng-template\" id=\"error-messages\">\n * <div ng-message=\"required\">This field is required</div>\n * <div ng-message=\"minlength\">This field is too short</div>\n * </script>\n *\n * <div ng-messages=\"myForm.myField.$error\" role=\"alert\">\n * <div ng-messages-include=\"error-messages\"></div>\n * </div>\n * ```\n *\n * However, including generic messages may not be useful enough to match all input fields, therefore,\n * `ngMessages` provides the ability to override messages defined in the remote template by redefining\n * them within the directive container.\n *\n * ```html\n * <!-- a generic template of error messages known as \"my-custom-messages\" -->\n * <script type=\"text/ng-template\" id=\"my-custom-messages\">\n * <div ng-message=\"required\">This field is required</div>\n * <div ng-message=\"minlength\">This field is too short</div>\n * </script>\n *\n * <form name=\"myForm\">\n * <label>\n * Email address\n * <input type=\"email\"\n * id=\"email\"\n * name=\"myEmail\"\n * ng-model=\"email\"\n * minlength=\"5\"\n * required />\n * </label>\n * <!-- any ng-message elements that appear BEFORE the ng-messages-include will\n * override the messages present in the ng-messages-include template -->\n * <div ng-messages=\"myForm.myEmail.$error\" role=\"alert\">\n * <!-- this required message has overridden the template message -->\n * <div ng-message=\"required\">You did not enter your email address</div>\n *\n * <!-- this is a brand new message and will appear last in the prioritization -->\n * <div ng-message=\"email\">Your email address is invalid</div>\n *\n * <!-- and here are the generic error messages -->\n * <div ng-messages-include=\"my-custom-messages\"></div>\n * </div>\n * </form>\n * ```\n *\n * In the example HTML code above the message that is set on required will override the corresponding\n * required message defined within the remote template. Therefore, with particular input fields (such\n * email addresses, date fields, autocomplete inputs, etc...), specialized error messages can be applied\n * while more generic messages can be used to handle other, more general input errors.\n *\n * ## Dynamic Messaging\n * ngMessages also supports using expressions to dynamically change key values. Using arrays and\n * repeaters to list messages is also supported. This means that the code below will be able to\n * fully adapt itself and display the appropriate message when any of the expression data changes:\n *\n * ```html\n * <form name=\"myForm\">\n * <label>\n * Email address\n * <input type=\"email\"\n * name=\"myEmail\"\n * ng-model=\"email\"\n * minlength=\"5\"\n * required />\n * </label>\n * <div ng-messages=\"myForm.myEmail.$error\" role=\"alert\">\n * <div ng-message=\"required\">You did not enter your email address</div>\n * <div ng-repeat=\"errorMessage in errorMessages\">\n * <!-- use ng-message-exp for a message whose key is given by an expression -->\n * <div ng-message-exp=\"errorMessage.type\">{{ errorMessage.text }}</div>\n * </div>\n * </div>\n * </form>\n * ```\n *\n * The `errorMessage.type` expression can be a string value or it can be an array so\n * that multiple errors can be associated with a single error message:\n *\n * ```html\n * <label>\n * Email address\n * <input type=\"email\"\n * ng-model=\"data.email\"\n * name=\"myEmail\"\n * ng-minlength=\"5\"\n * ng-maxlength=\"100\"\n * required />\n * </label>\n * <div ng-messages=\"myForm.myEmail.$error\" role=\"alert\">\n * <div ng-message-exp=\"'required'\">You did not enter your email address</div>\n * <div ng-message-exp=\"['minlength', 'maxlength']\">\n * Your email must be between 5 and 100 characters long\n * </div>\n * </div>\n * ```\n *\n * Feel free to use other structural directives such as ng-if and ng-switch to further control\n * what messages are active and when. Be careful, if you place ng-message on the same element\n * as these structural directives, Angular may not be able to determine if a message is active\n * or not. Therefore it is best to place the ng-message on a child element of the structural\n * directive.\n *\n * ```html\n * <div ng-messages=\"myForm.myEmail.$error\" role=\"alert\">\n * <div ng-if=\"showRequiredError\">\n * <div ng-message=\"required\">Please enter something</div>\n * </div>\n * </div>\n * ```\n *\n * ## Animations\n * If the `ngAnimate` module is active within the application then the `ngMessages`, `ngMessage` and\n * `ngMessageExp` directives will trigger animations whenever any messages are added and removed from\n * the DOM by the `ngMessages` directive.\n *\n * Whenever the `ngMessages` directive contains one or more visible messages then the `.ng-active` CSS\n * class will be added to the element. The `.ng-inactive` CSS class will be applied when there are no\n * messages present. Therefore, CSS transitions and keyframes as well as JavaScript animations can\n * hook into the animations whenever these classes are added/removed.\n *\n * Let's say that our HTML code for our messages container looks like so:\n *\n * ```html\n * <div ng-messages=\"myMessages\" class=\"my-messages\" role=\"alert\">\n * <div ng-message=\"alert\" class=\"some-message\">...</div>\n * <div ng-message=\"fail\" class=\"some-message\">...</div>\n * </div>\n * ```\n *\n * Then the CSS animation code for the message container looks like so:\n *\n * ```css\n * .my-messages {\n * transition:1s linear all;\n * }\n * .my-messages.ng-active {\n * // messages are visible\n * }\n * .my-messages.ng-inactive {\n * // messages are hidden\n * }\n * ```\n *\n * Whenever an inner message is attached (becomes visible) or removed (becomes hidden) then the enter\n * and leave animation is triggered for each particular element bound to the `ngMessage` directive.\n *\n * Therefore, the CSS code for the inner messages looks like so:\n *\n * ```css\n * .some-message {\n * transition:1s linear all;\n * }\n *\n * .some-message.ng-enter {}\n * .some-message.ng-enter.ng-enter-active {}\n *\n * .some-message.ng-leave {}\n * .some-message.ng-leave.ng-leave-active {}\n * ```\n *\n * {@link ngAnimate Click here} to learn how to use JavaScript animations or to learn more about ngAnimate.\n */\nangular.module('ngMessages', [])\n\n /**\n * @ngdoc directive\n * @module ngMessages\n * @name ngMessages\n * @restrict AE\n *\n * @description\n * `ngMessages` is a directive that is designed to show and hide messages based on the state\n * of a key/value object that it listens on. The directive itself complements error message\n * reporting with the `ngModel` $error object (which stores a key/value state of validation errors).\n *\n * `ngMessages` manages the state of internal messages within its container element. The internal\n * messages use the `ngMessage` directive and will be inserted/removed from the page depending\n * on if they're present within the key/value object. By default, only one message will be displayed\n * at a time and this depends on the prioritization of the messages within the template. (This can\n * be changed by using the `ng-messages-multiple` or `multiple` attribute on the directive container.)\n *\n * A remote template can also be used to promote message reusability and messages can also be\n * overridden.\n *\n * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`.\n *\n * @usage\n * ```html\n * <!-- using attribute directives -->\n * <ANY ng-messages=\"expression\" role=\"alert\">\n * <ANY ng-message=\"stringValue\">...</ANY>\n * <ANY ng-message=\"stringValue1, stringValue2, ...\">...</ANY>\n * <ANY ng-message-exp=\"expressionValue\">...</ANY>\n * </ANY>\n *\n * <!-- or by using element directives -->\n * <ng-messages for=\"expression\" role=\"alert\">\n * <ng-message when=\"stringValue\">...</ng-message>\n * <ng-message when=\"stringValue1, stringValue2, ...\">...</ng-message>\n * <ng-message when-exp=\"expressionValue\">...</ng-message>\n * </ng-messages>\n * ```\n *\n * @param {string} ngMessages an angular expression evaluating to a key/value object\n * (this is typically the $error object on an ngModel instance).\n * @param {string=} ngMessagesMultiple|multiple when set, all messages will be displayed with true\n *\n * @example\n * <example name=\"ngMessages-directive\" module=\"ngMessagesExample\"\n * deps=\"angular-messages.js\"\n * animations=\"true\" fixBase=\"true\">\n * <file name=\"index.html\">\n * <form name=\"myForm\">\n * <label>\n * Enter your name:\n * <input type=\"text\"\n * name=\"myName\"\n * ng-model=\"name\"\n * ng-minlength=\"5\"\n * ng-maxlength=\"20\"\n * required />\n * </label>\n * <pre>myForm.myName.$error = {{ myForm.myName.$error | json }}</pre>\n *\n * <div ng-messages=\"myForm.myName.$error\" style=\"color:maroon\" role=\"alert\">\n * <div ng-message=\"required\">You did not enter a field</div>\n * <div ng-message=\"minlength\">Your field is too short</div>\n * <div ng-message=\"maxlength\">Your field is too long</div>\n * </div>\n * </form>\n * </file>\n * <file name=\"script.js\">\n * angular.module('ngMessagesExample', ['ngMessages']);\n * </file>\n * </example>\n */\n .directive('ngMessages', ['$animate', function($animate) {\n var ACTIVE_CLASS = 'ng-active';\n var INACTIVE_CLASS = 'ng-inactive';\n\n return {\n require: 'ngMessages',\n restrict: 'AE',\n controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {\n var ctrl = this;\n var latestKey = 0;\n var nextAttachId = 0;\n\n this.getAttachId = function getAttachId() { return nextAttachId++; };\n\n var messages = this.messages = {};\n var renderLater, cachedCollection;\n\n this.render = function(collection) {\n collection = collection || {};\n\n renderLater = false;\n cachedCollection = collection;\n\n // this is true if the attribute is empty or if the attribute value is truthy\n var multiple = isAttrTruthy($scope, $attrs.ngMessagesMultiple) ||\n isAttrTruthy($scope, $attrs.multiple);\n\n var unmatchedMessages = [];\n var matchedKeys = {};\n var messageItem = ctrl.head;\n var messageFound = false;\n var totalMessages = 0;\n\n // we use != instead of !== to allow for both undefined and null values\n while (messageItem != null) {\n totalMessages++;\n var messageCtrl = messageItem.message;\n\n var messageUsed = false;\n if (!messageFound) {\n forEach(collection, function(value, key) {\n if (!messageUsed && truthy(value) && messageCtrl.test(key)) {\n // this is to prevent the same error name from showing up twice\n if (matchedKeys[key]) return;\n matchedKeys[key] = true;\n\n messageUsed = true;\n messageCtrl.attach();\n }\n });\n }\n\n if (messageUsed) {\n // unless we want to display multiple messages then we should\n // set a flag here to avoid displaying the next message in the list\n messageFound = !multiple;\n } else {\n unmatchedMessages.push(messageCtrl);\n }\n\n messageItem = messageItem.next;\n }\n\n forEach(unmatchedMessages, function(messageCtrl) {\n messageCtrl.detach();\n });\n\n unmatchedMessages.length !== totalMessages\n ? $animate.setClass($element, ACTIVE_CLASS, INACTIVE_CLASS)\n : $animate.setClass($element, INACTIVE_CLASS, ACTIVE_CLASS);\n };\n\n $scope.$watchCollection($attrs.ngMessages || $attrs['for'], ctrl.render);\n\n this.reRender = function() {\n if (!renderLater) {\n renderLater = true;\n $scope.$evalAsync(function() {\n if (renderLater) {\n cachedCollection && ctrl.render(cachedCollection);\n }\n });\n }\n };\n\n this.register = function(comment, messageCtrl) {\n var nextKey = latestKey.toString();\n messages[nextKey] = {\n message: messageCtrl\n };\n insertMessageNode($element[0], comment, nextKey);\n comment.$$ngMessageNode = nextKey;\n latestKey++;\n\n ctrl.reRender();\n };\n\n this.deregister = function(comment) {\n var key = comment.$$ngMessageNode;\n delete comment.$$ngMessageNode;\n removeMessageNode($element[0], comment, key);\n delete messages[key];\n ctrl.reRender();\n };\n\n function findPreviousMessage(parent, comment) {\n var prevNode = comment;\n var parentLookup = [];\n while (prevNode && prevNode !== parent) {\n var prevKey = prevNode.$$ngMessageNode;\n if (prevKey && prevKey.length) {\n return messages[prevKey];\n }\n\n // dive deeper into the DOM and examine its children for any ngMessage\n // comments that may be in an element that appears deeper in the list\n if (prevNode.childNodes.length && parentLookup.indexOf(prevNode) == -1) {\n parentLookup.push(prevNode);\n prevNode = prevNode.childNodes[prevNode.childNodes.length - 1];\n } else {\n prevNode = prevNode.previousSibling || prevNode.parentNode;\n }\n }\n }\n\n function insertMessageNode(parent, comment, key) {\n var messageNode = messages[key];\n if (!ctrl.head) {\n ctrl.head = messageNode;\n } else {\n var match = findPreviousMessage(parent, comment);\n if (match) {\n messageNode.next = match.next;\n match.next = messageNode;\n } else {\n messageNode.next = ctrl.head;\n ctrl.head = messageNode;\n }\n }\n }\n\n function removeMessageNode(parent, comment, key) {\n var messageNode = messages[key];\n\n var match = findPreviousMessage(parent, comment);\n if (match) {\n match.next = messageNode.next;\n } else {\n ctrl.head = messageNode.next;\n }\n }\n }]\n };\n\n function isAttrTruthy(scope, attr) {\n return (isString(attr) && attr.length === 0) || //empty attribute\n truthy(scope.$eval(attr));\n }\n\n function truthy(val) {\n return isString(val) ? val.length : !!val;\n }\n }])\n\n /**\n * @ngdoc directive\n * @name ngMessagesInclude\n * @restrict AE\n * @scope\n *\n * @description\n * `ngMessagesInclude` is a directive with the purpose to import existing ngMessage template\n * code from a remote template and place the downloaded template code into the exact spot\n * that the ngMessagesInclude directive is placed within the ngMessages container. This allows\n * for a series of pre-defined messages to be reused and also allows for the developer to\n * determine what messages are overridden due to the placement of the ngMessagesInclude directive.\n *\n * @usage\n * ```html\n * <!-- using attribute directives -->\n * <ANY ng-messages=\"expression\" role=\"alert\">\n * <ANY ng-messages-include=\"remoteTplString\">...</ANY>\n * </ANY>\n *\n * <!-- or by using element directives -->\n * <ng-messages for=\"expression\" role=\"alert\">\n * <ng-messages-include src=\"expressionValue1\">...</ng-messages-include>\n * </ng-messages>\n * ```\n *\n * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`.\n *\n * @param {string} ngMessagesInclude|src a string value corresponding to the remote template.\n */\n .directive('ngMessagesInclude',\n ['$templateRequest', '$document', '$compile', function($templateRequest, $document, $compile) {\n\n return {\n restrict: 'AE',\n require: '^^ngMessages', // we only require this for validation sake\n link: function($scope, element, attrs) {\n var src = attrs.ngMessagesInclude || attrs.src;\n $templateRequest(src).then(function(html) {\n $compile(html)($scope, function(contents) {\n element.after(contents);\n\n // the anchor is placed for debugging purposes\n var anchor = jqLite($document[0].createComment(' ngMessagesInclude: ' + src + ' '));\n element.after(anchor);\n\n // we don't want to pollute the DOM anymore by keeping an empty directive element\n element.remove();\n });\n });\n }\n };\n }])\n\n /**\n * @ngdoc directive\n * @name ngMessage\n * @restrict AE\n * @scope\n *\n * @description\n * `ngMessage` is a directive with the purpose to show and hide a particular message.\n * For `ngMessage` to operate, a parent `ngMessages` directive on a parent DOM element\n * must be situated since it determines which messages are visible based on the state\n * of the provided key/value map that `ngMessages` listens on.\n *\n * More information about using `ngMessage` can be found in the\n * {@link module:ngMessages `ngMessages` module documentation}.\n *\n * @usage\n * ```html\n * <!-- using attribute directives -->\n * <ANY ng-messages=\"expression\" role=\"alert\">\n * <ANY ng-message=\"stringValue\">...</ANY>\n * <ANY ng-message=\"stringValue1, stringValue2, ...\">...</ANY>\n * </ANY>\n *\n * <!-- or by using element directives -->\n * <ng-messages for=\"expression\" role=\"alert\">\n * <ng-message when=\"stringValue\">...</ng-message>\n * <ng-message when=\"stringValue1, stringValue2, ...\">...</ng-message>\n * </ng-messages>\n * ```\n *\n * @param {expression} ngMessage|when a string value corresponding to the message key.\n */\n .directive('ngMessage', ngMessageDirectiveFactory())\n\n\n /**\n * @ngdoc directive\n * @name ngMessageExp\n * @restrict AE\n * @priority 1\n * @scope\n *\n * @description\n * `ngMessageExp` is a directive with the purpose to show and hide a particular message.\n * For `ngMessageExp` to operate, a parent `ngMessages` directive on a parent DOM element\n * must be situated since it determines which messages are visible based on the state\n * of the provided key/value map that `ngMessages` listens on.\n *\n * @usage\n * ```html\n * <!-- using attribute directives -->\n * <ANY ng-messages=\"expression\">\n * <ANY ng-message-exp=\"expressionValue\">...</ANY>\n * </ANY>\n *\n * <!-- or by using element directives -->\n * <ng-messages for=\"expression\">\n * <ng-message when-exp=\"expressionValue\">...</ng-message>\n * </ng-messages>\n * ```\n *\n * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`.\n *\n * @param {expression} ngMessageExp|whenExp an expression value corresponding to the message key.\n */\n .directive('ngMessageExp', ngMessageDirectiveFactory());\n\nfunction ngMessageDirectiveFactory() {\n return ['$animate', function($animate) {\n return {\n restrict: 'AE',\n transclude: 'element',\n priority: 1, // must run before ngBind, otherwise the text is set on the comment\n terminal: true,\n require: '^^ngMessages',\n link: function(scope, element, attrs, ngMessagesCtrl, $transclude) {\n var commentNode = element[0];\n\n var records;\n var staticExp = attrs.ngMessage || attrs.when;\n var dynamicExp = attrs.ngMessageExp || attrs.whenExp;\n var assignRecords = function(items) {\n records = items\n ? (isArray(items)\n ? items\n : items.split(/[\\s,]+/))\n : null;\n ngMessagesCtrl.reRender();\n };\n\n if (dynamicExp) {\n assignRecords(scope.$eval(dynamicExp));\n scope.$watchCollection(dynamicExp, assignRecords);\n } else {\n assignRecords(staticExp);\n }\n\n var currentElement, messageCtrl;\n ngMessagesCtrl.register(commentNode, messageCtrl = {\n test: function(name) {\n return contains(records, name);\n },\n attach: function() {\n if (!currentElement) {\n $transclude(scope, function(elm) {\n $animate.enter(elm, null, element);\n currentElement = elm;\n\n // Each time we attach this node to a message we get a new id that we can match\n // when we are destroying the node later.\n var $$attachId = currentElement.$$attachId = ngMessagesCtrl.getAttachId();\n\n // in the event that the parent element is destroyed\n // by any other structural directive then it's time\n // to deregister the message from the controller\n currentElement.on('$destroy', function() {\n if (currentElement && currentElement.$$attachId === $$attachId) {\n ngMessagesCtrl.deregister(commentNode);\n messageCtrl.detach();\n }\n });\n });\n }\n },\n detach: function() {\n if (currentElement) {\n var elm = currentElement;\n currentElement = null;\n $animate.leave(elm);\n }\n }\n });\n }\n };\n }];\n\n function contains(collection, key) {\n if (collection) {\n return isArray(collection)\n ? collection.indexOf(key) >= 0\n : collection.hasOwnProperty(key);\n }\n }\n}\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.5.0\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/**\n * @ngdoc module\n * @name ngAria\n * @description\n *\n * The `ngAria` module provides support for common\n * [<abbr title=\"Accessible Rich Internet Applications\">ARIA</abbr>](http://www.w3.org/TR/wai-aria/)\n * attributes that convey state or semantic information about the application for users\n * of assistive technologies, such as screen readers.\n *\n * <div doc-module-components=\"ngAria\"></div>\n *\n * ## Usage\n *\n * For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following\n * directives are supported:\n * `ngModel`, `ngChecked`, `ngRequired`, `ngValue`, `ngDisabled`, `ngShow`, `ngHide`, `ngClick`,\n * `ngDblClick`, and `ngMessages`.\n *\n * Below is a more detailed breakdown of the attributes handled by ngAria:\n *\n * | Directive | Supported Attributes |\n * |---------------------------------------------|----------------------------------------------------------------------------------------|\n * | {@link ng.directive:ngModel ngModel} | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles |\n * | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled |\n * | {@link ng.directive:ngRequired ngRequired} | aria-required |\n * | {@link ng.directive:ngChecked ngChecked} | aria-checked |\n * | {@link ng.directive:ngValue ngValue} | aria-checked |\n * | {@link ng.directive:ngShow ngShow} | aria-hidden |\n * | {@link ng.directive:ngHide ngHide} | aria-hidden |\n * | {@link ng.directive:ngDblclick ngDblclick} | tabindex |\n * | {@link module:ngMessages ngMessages} | aria-live |\n * | {@link ng.directive:ngClick ngClick} | tabindex, keypress event, button role |\n *\n * Find out more information about each directive by reading the\n * {@link guide/accessibility ngAria Developer Guide}.\n *\n * ##Example\n * Using ngDisabled with ngAria:\n * ```html\n * <md-checkbox ng-disabled=\"disabled\">\n * ```\n * Becomes:\n * ```html\n * <md-checkbox ng-disabled=\"disabled\" aria-disabled=\"true\">\n * ```\n *\n * ##Disabling Attributes\n * It's possible to disable individual attributes added by ngAria with the\n * {@link ngAria.$ariaProvider#config config} method. For more details, see the\n * {@link guide/accessibility Developer Guide}.\n */\n /* global -ngAriaModule */\nvar ngAriaModule = angular.module('ngAria', ['ng']).\n provider('$aria', $AriaProvider);\n\n/**\n* Internal Utilities\n*/\nvar nodeBlackList = ['BUTTON', 'A', 'INPUT', 'TEXTAREA', 'SELECT', 'DETAILS', 'SUMMARY'];\n\nvar isNodeOneOf = function(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) {\n return true;\n }\n};\n/**\n * @ngdoc provider\n * @name $ariaProvider\n *\n * @description\n *\n * Used for configuring the ARIA attributes injected and managed by ngAria.\n *\n * ```js\n * angular.module('myApp', ['ngAria'], function config($ariaProvider) {\n * $ariaProvider.config({\n * ariaValue: true,\n * tabindex: false\n * });\n * });\n *```\n *\n * ## Dependencies\n * Requires the {@link ngAria} module to be installed.\n *\n */\nfunction $AriaProvider() {\n var config = {\n ariaHidden: true,\n ariaChecked: true,\n ariaDisabled: true,\n ariaRequired: true,\n ariaInvalid: true,\n ariaValue: true,\n tabindex: true,\n bindKeypress: true,\n bindRoleForClick: true\n };\n\n /**\n * @ngdoc method\n * @name $ariaProvider#config\n *\n * @param {object} config object to enable/disable specific ARIA attributes\n *\n * - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags\n * - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags\n * - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags\n * - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags\n * - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags\n * - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and aria-valuenow tags\n * - **tabindex** – `{boolean}` – Enables/disables tabindex tags\n * - **bindKeypress** – `{boolean}` – Enables/disables keypress event binding on `div` and\n * `li` elements with ng-click\n * - **bindRoleForClick** – `{boolean}` – Adds role=button to non-interactive elements like `div`\n * using ng-click, making them more accessible to users of assistive technologies\n *\n * @description\n * Enables/disables various ARIA attributes\n */\n this.config = function(newConfig) {\n config = angular.extend(config, newConfig);\n };\n\n function watchExpr(attrName, ariaAttr, nodeBlackList, negate) {\n return function(scope, elem, attr) {\n var ariaCamelName = attr.$normalize(ariaAttr);\n if (config[ariaCamelName] && !isNodeOneOf(elem, nodeBlackList) && !attr[ariaCamelName]) {\n scope.$watch(attr[attrName], function(boolVal) {\n // ensure boolean value\n boolVal = negate ? !boolVal : !!boolVal;\n elem.attr(ariaAttr, boolVal);\n });\n }\n };\n }\n /**\n * @ngdoc service\n * @name $aria\n *\n * @description\n * @priority 200\n *\n * The $aria service contains helper methods for applying common\n * [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives.\n *\n * ngAria injects common accessibility attributes that tell assistive technologies when HTML\n * elements are enabled, selected, hidden, and more. To see how this is performed with ngAria,\n * let's review a code snippet from ngAria itself:\n *\n *```js\n * ngAriaModule.directive('ngDisabled', ['$aria', function($aria) {\n * return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nodeBlackList, false);\n * }])\n *```\n * Shown above, the ngAria module creates a directive with the same signature as the\n * traditional `ng-disabled` directive. But this ngAria version is dedicated to\n * solely managing accessibility attributes on custom elements. The internal `$aria` service is\n * used to watch the boolean attribute `ngDisabled`. If it has not been explicitly set by the\n * developer, `aria-disabled` is injected as an attribute with its value synchronized to the\n * value in `ngDisabled`.\n *\n * Because ngAria hooks into the `ng-disabled` directive, developers do not have to do\n * anything to enable this feature. The `aria-disabled` attribute is automatically managed\n * simply as a silent side-effect of using `ng-disabled` with the ngAria module.\n *\n * The full list of directives that interface with ngAria:\n * * **ngModel**\n * * **ngChecked**\n * * **ngRequired**\n * * **ngDisabled**\n * * **ngValue**\n * * **ngShow**\n * * **ngHide**\n * * **ngClick**\n * * **ngDblclick**\n * * **ngMessages**\n *\n * Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each\n * directive.\n *\n *\n * ## Dependencies\n * Requires the {@link ngAria} module to be installed.\n */\n this.$get = function() {\n return {\n config: function(key) {\n return config[key];\n },\n $$watchExpr: watchExpr\n };\n };\n}\n\n\nngAriaModule.directive('ngShow', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngShow', 'aria-hidden', [], true);\n}])\n.directive('ngHide', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngHide', 'aria-hidden', [], false);\n}])\n.directive('ngValue', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngValue', 'aria-checked', nodeBlackList, false);\n}])\n.directive('ngChecked', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngChecked', 'aria-checked', nodeBlackList, false);\n}])\n.directive('ngRequired', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngRequired', 'aria-required', nodeBlackList, false);\n}])\n.directive('ngModel', ['$aria', function($aria) {\n\n function shouldAttachAttr(attr, normalizedAttr, elem, allowBlacklistEls) {\n return $aria.config(normalizedAttr) && !elem.attr(attr) && (allowBlacklistEls || !isNodeOneOf(elem, nodeBlackList));\n }\n\n function shouldAttachRole(role, elem) {\n // if element does not have role attribute\n // AND element type is equal to role (if custom element has a type equaling shape) <-- remove?\n // AND element is not INPUT\n return !elem.attr('role') && (elem.attr('type') === role) && (elem[0].nodeName !== 'INPUT');\n }\n\n function getShape(attr, elem) {\n var type = attr.type,\n role = attr.role;\n\n return ((type || role) === 'checkbox' || role === 'menuitemcheckbox') ? 'checkbox' :\n ((type || role) === 'radio' || role === 'menuitemradio') ? 'radio' :\n (type === 'range' || role === 'progressbar' || role === 'slider') ? 'range' : '';\n }\n\n return {\n restrict: 'A',\n require: 'ngModel',\n priority: 200, //Make sure watches are fired after any other directives that affect the ngModel value\n compile: function(elem, attr) {\n var shape = getShape(attr, elem);\n\n return {\n pre: function(scope, elem, attr, ngModel) {\n if (shape === 'checkbox') {\n //Use the input[checkbox] $isEmpty implementation for elements with checkbox roles\n ngModel.$isEmpty = function(value) {\n return value === false;\n };\n }\n },\n post: function(scope, elem, attr, ngModel) {\n var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem, false);\n\n function ngAriaWatchModelValue() {\n return ngModel.$modelValue;\n }\n\n function getRadioReaction(newVal) {\n var boolVal = (attr.value == ngModel.$viewValue);\n elem.attr('aria-checked', boolVal);\n }\n\n function getCheckboxReaction() {\n elem.attr('aria-checked', !ngModel.$isEmpty(ngModel.$viewValue));\n }\n\n switch (shape) {\n case 'radio':\n case 'checkbox':\n if (shouldAttachRole(shape, elem)) {\n elem.attr('role', shape);\n }\n if (shouldAttachAttr('aria-checked', 'ariaChecked', elem, false)) {\n scope.$watch(ngAriaWatchModelValue, shape === 'radio' ?\n getRadioReaction : getCheckboxReaction);\n }\n if (needsTabIndex) {\n elem.attr('tabindex', 0);\n }\n break;\n case 'range':\n if (shouldAttachRole(shape, elem)) {\n elem.attr('role', 'slider');\n }\n if ($aria.config('ariaValue')) {\n var needsAriaValuemin = !elem.attr('aria-valuemin') &&\n (attr.hasOwnProperty('min') || attr.hasOwnProperty('ngMin'));\n var needsAriaValuemax = !elem.attr('aria-valuemax') &&\n (attr.hasOwnProperty('max') || attr.hasOwnProperty('ngMax'));\n var needsAriaValuenow = !elem.attr('aria-valuenow');\n\n if (needsAriaValuemin) {\n attr.$observe('min', function ngAriaValueMinReaction(newVal) {\n elem.attr('aria-valuemin', newVal);\n });\n }\n if (needsAriaValuemax) {\n attr.$observe('max', function ngAriaValueMinReaction(newVal) {\n elem.attr('aria-valuemax', newVal);\n });\n }\n if (needsAriaValuenow) {\n scope.$watch(ngAriaWatchModelValue, function ngAriaValueNowReaction(newVal) {\n elem.attr('aria-valuenow', newVal);\n });\n }\n }\n if (needsTabIndex) {\n elem.attr('tabindex', 0);\n }\n break;\n }\n\n if (!attr.hasOwnProperty('ngRequired') && ngModel.$validators.required\n && shouldAttachAttr('aria-required', 'ariaRequired', elem, false)) {\n // ngModel.$error.required is undefined on custom controls\n attr.$observe('required', function() {\n elem.attr('aria-required', !!attr['required']);\n });\n }\n\n if (shouldAttachAttr('aria-invalid', 'ariaInvalid', elem, true)) {\n scope.$watch(function ngAriaInvalidWatch() {\n return ngModel.$invalid;\n }, function ngAriaInvalidReaction(newVal) {\n elem.attr('aria-invalid', !!newVal);\n });\n }\n }\n };\n }\n };\n}])\n.directive('ngDisabled', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nodeBlackList, false);\n}])\n.directive('ngMessages', function() {\n return {\n restrict: 'A',\n require: '?ngMessages',\n link: function(scope, elem, attr, ngMessages) {\n if (!elem.attr('aria-live')) {\n elem.attr('aria-live', 'assertive');\n }\n }\n };\n})\n.directive('ngClick',['$aria', '$parse', function($aria, $parse) {\n return {\n restrict: 'A',\n compile: function(elem, attr) {\n var fn = $parse(attr.ngClick, /* interceptorFn */ null, /* expensiveChecks */ true);\n return function(scope, elem, attr) {\n\n if (!isNodeOneOf(elem, nodeBlackList)) {\n\n if ($aria.config('bindRoleForClick') && !elem.attr('role')) {\n elem.attr('role', 'button');\n }\n\n if ($aria.config('tabindex') && !elem.attr('tabindex')) {\n elem.attr('tabindex', 0);\n }\n\n if ($aria.config('bindKeypress') && !attr.ngKeypress) {\n elem.on('keypress', function(event) {\n var keyCode = event.which || event.keyCode;\n if (keyCode === 32 || keyCode === 13) {\n scope.$apply(callback);\n }\n\n function callback() {\n fn(scope, { $event: event });\n }\n });\n }\n }\n };\n }\n };\n}])\n.directive('ngDblclick', ['$aria', function($aria) {\n return function(scope, elem, attr) {\n if ($aria.config('tabindex') && !elem.attr('tabindex') && !isNodeOneOf(elem, nodeBlackList)) {\n elem.attr('tabindex', 0);\n }\n };\n}]);\n\n\n})(window, window.angular);\n\n/**\n * @license\n * lodash 3.10.1 (Custom Build) <https://lodash.com/>\n * Build: `lodash modern -o ./lodash.js`\n * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license <https://lodash.com/license>\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '3.10.1';\n\n /** Used to compose bitmasks for wrapper metadata. */\n var BIND_FLAG = 1,\n BIND_KEY_FLAG = 2,\n CURRY_BOUND_FLAG = 4,\n CURRY_FLAG = 8,\n CURRY_RIGHT_FLAG = 16,\n PARTIAL_FLAG = 32,\n PARTIAL_RIGHT_FLAG = 64,\n ARY_FLAG = 128,\n REARG_FLAG = 256;\n\n /** Used as default options for `_.trunc`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect when a function becomes hot. */\n var HOT_COUNT = 150,\n HOT_SPAN = 16;\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2;\n\n /** Used as the `TypeError` message for \"Functions\" methods. */\n var FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,\n reUnescapedHtml = /[&<>\"'`]/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\n\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\n\\\\]|\\\\.)*?)\\2)\\]/g;\n\n /**\n * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns)\n * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).\n */\n var reRegExpChars = /^[:!,]|[\\\\^$.*+?()[\\]{}|\\/]|(^[0-9a-fA-Fnrtuvx])|([\\n\\r\\u2028\\u2029])/g,\n reHasRegExpChars = RegExp(reRegExpChars.source);\n\n /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */\n var reComboMark = /[\\u0300-\\u036f\\ufe20-\\ufe23]/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect hexadecimal string values. */\n var reHasHexPrefix = /^0[xX]/;\n\n /** Used to detect host constructors (Safari > 5). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^\\d+$/;\n\n /** Used to match latin-1 supplementary letters (excluding mathematical operators). */\n var reLatin1 = /[\\xc0-\\xd6\\xd8-\\xde\\xdf-\\xf6\\xf8-\\xff]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to match words to create compound words. */\n var reWords = (function() {\n var upper = '[A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde]',\n lower = '[a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff]+';\n\n return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');\n }());\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',\n 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',\n 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dateTag] = typedArrayTags[errorTag] =\n typedArrayTags[funcTag] = typedArrayTags[mapTag] =\n typedArrayTags[numberTag] = typedArrayTags[objectTag] =\n typedArrayTags[regexpTag] = typedArrayTags[setTag] =\n typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =\n cloneableTags[dateTag] = cloneableTags[float32Tag] =\n cloneableTags[float64Tag] = cloneableTags[int8Tag] =\n cloneableTags[int16Tag] = cloneableTags[int32Tag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[stringTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[mapTag] = cloneableTags[setTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map latin-1 supplementary letters to basic latin letters. */\n var deburredLetters = {\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcC': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xeC': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\",\n '`': '`'\n };\n\n /** Used to determine if values are of the language type `Object`. */\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n /** Used to escape characters for inclusion in compiled regexes. */\n var regexpEscapes = {\n '0': 'x30', '1': 'x31', '2': 'x32', '3': 'x33', '4': 'x34',\n '5': 'x35', '6': 'x36', '7': 'x37', '8': 'x38', '9': 'x39',\n 'A': 'x41', 'B': 'x42', 'C': 'x43', 'D': 'x44', 'E': 'x45', 'F': 'x46',\n 'a': 'x61', 'b': 'x62', 'c': 'x63', 'd': 'x64', 'e': 'x65', 'f': 'x66',\n 'n': 'x6e', 'r': 'x72', 't': 'x74', 'u': 'x75', 'v': 'x76', 'x': 'x78'\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Detect free variable `exports`. */\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = objectTypes[typeof self] && self && self.Object && self;\n\n /** Detect free variable `window`. */\n var freeWindow = objectTypes[typeof window] && window && window.Object && window;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;\n\n /**\n * Used as a reference to the global object.\n *\n * The `this` value is used if it's the global object to avoid Greasemonkey's\n * restricted `window` object, otherwise the `window` object is used.\n */\n var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * The base implementation of `compareAscending` which compares values and\n * sorts them in ascending order without guaranteeing a stable sort.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function baseCompareAscending(value, other) {\n if (value !== other) {\n var valIsNull = value === null,\n valIsUndef = value === undefined,\n valIsReflexive = value === value;\n\n var othIsNull = other === null,\n othIsUndef = other === undefined,\n othIsReflexive = other === other;\n\n if ((value > other && !othIsNull) || !valIsReflexive ||\n (valIsNull && !othIsUndef && othIsReflexive) ||\n (valIsUndef && othIsReflexive)) {\n return 1;\n }\n if ((value < other && !valIsNull) || !othIsReflexive ||\n (othIsNull && !valIsUndef && valIsReflexive) ||\n (othIsUndef && valIsReflexive)) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without support for binary searches.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n if (value !== value) {\n return indexOfNaN(array, fromIndex);\n }\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isFunction` without support for environments\n * with incorrect `typeof` results.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n */\n function baseIsFunction(value) {\n // Avoid a Chakra JIT bug in compatibility modes of IE 11.\n // See https://github.com/jashkenas/underscore/issues/1621 for more details.\n return typeof value == 'function' || false;\n }\n\n /**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` or `undefined` values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n return value == null ? '' : (value + '');\n }\n\n /**\n * Used by `_.trim` and `_.trimLeft` to get the index of the first character\n * of `string` that is not found in `chars`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @param {string} chars The characters to find.\n * @returns {number} Returns the index of the first character not found in `chars`.\n */\n function charsLeftIndex(string, chars) {\n var index = -1,\n length = string.length;\n\n while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimRight` to get the index of the last character\n * of `string` that is not found in `chars`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @param {string} chars The characters to find.\n * @returns {number} Returns the index of the last character not found in `chars`.\n */\n function charsRightIndex(string, chars) {\n var index = string.length;\n\n while (index-- && chars.indexOf(string.charAt(index)) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.sortBy` to compare transformed elements of a collection and stable\n * sort them in ascending order.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareAscending(object, other) {\n return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);\n }\n\n /**\n * Used by `_.sortByOrder` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise,\n * a value is sorted in ascending order if its corresponding order is \"asc\", and\n * descending if \"desc\".\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = baseCompareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * ((order === 'asc' || order === true) ? 1 : -1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://code.google.com/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n function deburrLetter(letter) {\n return deburredLetters[letter];\n }\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeHtmlChar(chr) {\n return htmlEscapes[chr];\n }\n\n /**\n * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @param {string} leadingChar The capture group for a leading character.\n * @param {string} whitespaceChar The capture group for a whitespace character.\n * @returns {string} Returns the escaped character.\n */\n function escapeRegExpChar(chr, leadingChar, whitespaceChar) {\n if (leadingChar) {\n chr = regexpEscapes[chr];\n } else if (whitespaceChar) {\n chr = stringEscapes[chr];\n }\n return '\\\\' + chr;\n }\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the index at which the first occurrence of `NaN` is found in `array`.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched `NaN`, else `-1`.\n */\n function indexOfNaN(array, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 0 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n var other = array[index];\n if (other !== other) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * Checks if `value` is object-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n */\n function isObjectLike(value) {\n return !!value && typeof value == 'object';\n }\n\n /**\n * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a\n * character code is whitespace.\n *\n * @private\n * @param {number} charCode The character code to inspect.\n * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.\n */\n function isSpace(charCode) {\n return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||\n (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n if (array[index] === placeholder) {\n array[index] = PLACEHOLDER;\n result[++resIndex] = index;\n }\n }\n return result;\n }\n\n /**\n * An implementation of `_.uniq` optimized for sorted arrays without support\n * for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The function invoked per iteration.\n * @returns {Array} Returns the new duplicate free array.\n */\n function sortedUniq(array, iteratee) {\n var seen,\n index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value, index, array) : value;\n\n if (!index || seen !== computed) {\n seen = computed;\n result[++resIndex] = value;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the first non-whitespace character.\n */\n function trimmedLeftIndex(string) {\n var index = -1,\n length = string.length;\n\n while (++index < length && isSpace(string.charCodeAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedRightIndex(string) {\n var index = string.length;\n\n while (index-- && isSpace(string.charCodeAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n function unescapeHtmlChar(chr) {\n return htmlUnescapes[chr];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the given `context` object.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // using `context` to mock `Date#getTime` use in `_.now`\n * var mock = _.runInContext({\n * 'Date': function() {\n * return { 'getTime': getTimeMock };\n * }\n * });\n *\n * // or creating a suped-up `defer` in Node.js\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n function runInContext(context) {\n // Avoid issues with some ES3 environments that attempt to use values, named\n // after built-in constructors like `Object`, for the creation of literals.\n // ES5 clears this up by stating that literals must use built-in constructors.\n // See https://es5.github.io/#x11.1.5 for more details.\n context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;\n\n /** Native constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Number = context.Number,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for native method references. */\n var arrayProto = Array.prototype,\n objectProto = Object.prototype,\n stringProto = String.prototype;\n\n /** Used to resolve the decompiled source of functions. */\n var fnToString = Function.prototype.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\n var objToString = objectProto.toString;\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Native method references. */\n var ArrayBuffer = context.ArrayBuffer,\n clearTimeout = context.clearTimeout,\n parseFloat = context.parseFloat,\n pow = Math.pow,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n Set = getNative(context, 'Set'),\n setTimeout = context.setTimeout,\n splice = arrayProto.splice,\n Uint8Array = context.Uint8Array,\n WeakMap = getNative(context, 'WeakMap');\n\n /* Native method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeCreate = getNative(Object, 'create'),\n nativeFloor = Math.floor,\n nativeIsArray = getNative(Array, 'isArray'),\n nativeIsFinite = context.isFinite,\n nativeKeys = getNative(Object, 'keys'),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = getNative(Date, 'now'),\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random;\n\n /** Used as references for `-Infinity` and `Infinity`. */\n var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,\n POSITIVE_INFINITY = Number.POSITIVE_INFINITY;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /**\n * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n * of an array-like value.\n */\n var MAX_SAFE_INTEGER = 9007199254740991;\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit chaining.\n * Methods that operate on and return arrays, collections, and functions can\n * be chained together. Methods that retrieve a single value or may return a\n * primitive value will automatically end the chain returning the unwrapped\n * value. Explicit chaining may be enabled using `_.chain`. The execution of\n * chained methods is lazy, that is, execution is deferred until `_#value`\n * is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n * fusion is an optimization strategy which merge iteratee calls; this can help\n * to avoid the creation of intermediate data structures and greatly reduce the\n * number of iteratee executions.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,\n * `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,\n * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,\n * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,\n * and `where`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,\n * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,\n * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,\n * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,\n * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,\n * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,\n * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,\n * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,\n * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,\n * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,\n * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,\n * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,\n * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,\n * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,\n * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,\n * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,\n * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,\n * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,\n * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,\n * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,\n * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,\n * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,\n * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,\n * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,\n * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,\n * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,\n * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,\n * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,\n * `unescape`, `uniqueId`, `value`, and `words`\n *\n * The wrapper method `sample` will return a wrapped value when `n` is provided,\n * otherwise an unwrapped value is returned.\n *\n * @name _\n * @constructor\n * @category Chain\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // returns an unwrapped value\n * wrapped.reduce(function(total, n) {\n * return total + n;\n * });\n * // => 6\n *\n * // returns a wrapped value\n * var squares = wrapped.map(function(n) {\n * return n * n;\n * });\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The function whose prototype all chaining wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable chaining for all wrapper methods.\n * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.\n */\n function LodashWrapper(value, chainAll, actions) {\n this.__wrapped__ = value;\n this.__actions__ = actions || [];\n this.__chain__ = !!chainAll;\n }\n\n /**\n * An object environment feature flags.\n *\n * @static\n * @memberOf _\n * @type Object\n */\n var support = lodash.support = {};\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB). Change the following template settings to use\n * alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type Object\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type RegExp\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type RegExp\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type RegExp\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type string\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type Object\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type Function\n */\n '_': lodash\n }\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = POSITIVE_INFINITY;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = arrayCopy(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = arrayCopy(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = arrayCopy(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a cache object to store key/value pairs.\n *\n * @private\n * @static\n * @name Cache\n * @memberOf _.memoize\n */\n function MapCache() {\n this.__data__ = {};\n }\n\n /**\n * Removes `key` and its value from the cache.\n *\n * @private\n * @name delete\n * @memberOf _.memoize.Cache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.\n */\n function mapDelete(key) {\n return this.has(key) && delete this.__data__[key];\n }\n\n /**\n * Gets the cached value for `key`.\n *\n * @private\n * @name get\n * @memberOf _.memoize.Cache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the cached value.\n */\n function mapGet(key) {\n return key == '__proto__' ? undefined : this.__data__[key];\n }\n\n /**\n * Checks if a cached value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf _.memoize.Cache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapHas(key) {\n return key != '__proto__' && hasOwnProperty.call(this.__data__, key);\n }\n\n /**\n * Sets `value` to `key` of the cache.\n *\n * @private\n * @name set\n * @memberOf _.memoize.Cache\n * @param {string} key The key of the value to cache.\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache object.\n */\n function mapSet(key, value) {\n if (key != '__proto__') {\n this.__data__[key] = value;\n }\n return this;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates a cache object to store unique values.\n *\n * @private\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var length = values ? values.length : 0;\n\n this.data = { 'hash': nativeCreate(null), 'set': new Set };\n while (length--) {\n this.push(values[length]);\n }\n }\n\n /**\n * Checks if `value` is in `cache` mimicking the return signature of\n * `_.indexOf` by returning `0` if the value is found, else `-1`.\n *\n * @private\n * @param {Object} cache The cache to search.\n * @param {*} value The value to search for.\n * @returns {number} Returns `0` if `value` is found, else `-1`.\n */\n function cacheIndexOf(cache, value) {\n var data = cache.data,\n result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];\n\n return result ? 0 : -1;\n }\n\n /**\n * Adds `value` to the cache.\n *\n * @private\n * @name push\n * @memberOf SetCache\n * @param {*} value The value to cache.\n */\n function cachePush(value) {\n var data = this.data;\n if (typeof value == 'string' || isObject(value)) {\n data.set.add(value);\n } else {\n data.hash[value] = true;\n }\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a new array joining `array` with `other`.\n *\n * @private\n * @param {Array} array The array to join.\n * @param {Array} other The other array to join.\n * @returns {Array} Returns the new concatenated array.\n */\n function arrayConcat(array, other) {\n var index = -1,\n length = array.length,\n othIndex = -1,\n othLength = other.length,\n result = Array(length + othLength);\n\n while (++index < length) {\n result[index] = array[index];\n }\n while (++othIndex < othLength) {\n result[index++] = other[othIndex];\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function arrayCopy(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `baseExtremum` for arrays which invokes `iteratee`\n * with one argument: (value).\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} comparator The function used to compare values.\n * @param {*} exValue The initial extremum value.\n * @returns {*} Returns the extremum value.\n */\n function arrayExtremum(array, iteratee, comparator, exValue) {\n var index = -1,\n length = array.length,\n computed = exValue,\n result = computed;\n\n while (++index < length) {\n var value = array[index],\n current = +iteratee(value);\n\n if (comparator(current, computed)) {\n computed = current;\n result = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[++resIndex] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initFromArray] Specify using the first element of `array`\n * as the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initFromArray) {\n var index = -1,\n length = array.length;\n\n if (initFromArray && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initFromArray] Specify using the last element of `array`\n * as the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initFromArray) {\n var length = array.length;\n if (initFromArray && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.sum` for arrays without support for callback\n * shorthands and `this` binding..\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function arraySum(array, iteratee) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n result += +iteratee(array[length]) || 0;\n }\n return result;\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assign` use.\n *\n * @private\n * @param {*} objectValue The destination object property value.\n * @param {*} sourceValue The source object property value.\n * @returns {*} Returns the value to assign to the destination object.\n */\n function assignDefaults(objectValue, sourceValue) {\n return objectValue === undefined ? sourceValue : objectValue;\n }\n\n /**\n * Used by `_.template` to customize its `_.assign` use.\n *\n * **Note:** This function is like `assignDefaults` except that it ignores\n * inherited property values when checking if a property is `undefined`.\n *\n * @private\n * @param {*} objectValue The destination object property value.\n * @param {*} sourceValue The source object property value.\n * @param {string} key The key associated with the object and source values.\n * @param {Object} object The destination object.\n * @returns {*} Returns the value to assign to the destination object.\n */\n function assignOwnDefaults(objectValue, sourceValue, key, object) {\n return (objectValue === undefined || !hasOwnProperty.call(object, key))\n ? sourceValue\n : objectValue;\n }\n\n /**\n * A specialized version of `_.assign` for customizing assigned values without\n * support for argument juggling, multiple sources, and `this` binding `customizer`\n * functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n */\n function assignWith(object, source, customizer) {\n var index = -1,\n props = keys(source),\n length = props.length;\n\n while (++index < length) {\n var key = props[index],\n value = object[key],\n result = customizer(value, source[key], key, object, source);\n\n if ((result === result ? (result !== value) : (value === value)) ||\n (value === undefined && !(key in object))) {\n object[key] = result;\n }\n }\n return object;\n }\n\n /**\n * The base implementation of `_.assign` without support for argument juggling,\n * multiple sources, and `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return source == null\n ? object\n : baseCopy(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.at` without support for string collections\n * and individual key arguments.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {number[]|string[]} props The property names or indexes of elements to pick.\n * @returns {Array} Returns the new array of picked elements.\n */\n function baseAt(collection, props) {\n var index = -1,\n isNil = collection == null,\n isArr = !isNil && isArrayLike(collection),\n length = isArr ? collection.length : 0,\n propsLength = props.length,\n result = Array(propsLength);\n\n while(++index < propsLength) {\n var key = props[index];\n if (isArr) {\n result[index] = isIndex(key, length) ? collection[key] : undefined;\n } else {\n result[index] = isNil ? undefined : collection[key];\n }\n }\n return result;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\n function baseCopy(source, props, object) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n object[key] = source[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `_.callback` which supports specifying the\n * number of arguments to provide to `func`.\n *\n * @private\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\n function baseCallback(func, thisArg, argCount) {\n var type = typeof func;\n if (type == 'function') {\n return thisArg === undefined\n ? func\n : bindCallback(func, thisArg, argCount);\n }\n if (func == null) {\n return identity;\n }\n if (type == 'object') {\n return baseMatches(func);\n }\n return thisArg === undefined\n ? property(func)\n : baseMatchesProperty(func, thisArg);\n }\n\n /**\n * The base implementation of `_.clone` without support for argument juggling\n * and `this` binding `customizer` functions.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {Function} [customizer] The function to customize cloning values.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The object `value` belongs to.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates clones with source counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return arrayCopy(value, result);\n }\n } else {\n var tag = objToString.call(value),\n isFunc = tag == funcTag;\n\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return baseAssign(result, value);\n }\n } else {\n return cloneableTags[tag]\n ? initCloneByTag(value, tag, isDeep)\n : (object ? value : {});\n }\n }\n // Check for circular references and return its corresponding clone.\n stackA || (stackA = []);\n stackB || (stackB = []);\n\n var length = stackA.length;\n while (length--) {\n if (stackA[length] == value) {\n return stackB[length];\n }\n }\n // Add the source value to the stack of traversed objects and associate it with its clone.\n stackA.push(value);\n stackB.push(result);\n\n // Recursively populate clone (susceptible to call stack limits).\n (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {\n result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(prototype) {\n if (isObject(prototype)) {\n object.prototype = prototype;\n var result = new object;\n object.prototype = undefined;\n }\n return result || {};\n };\n }());\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts an index\n * of where to slice the arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Object} args The arguments provide to `func`.\n * @returns {number} Returns the timer id.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of `_.difference` which accepts a single array\n * of values to exclude.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values) {\n var length = array ? array.length : 0,\n result = [];\n\n if (!length) {\n return result;\n }\n var index = -1,\n indexOf = getIndexOf(),\n isCommon = indexOf === baseIndexOf,\n cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,\n valuesLength = values.length;\n\n if (cache) {\n indexOf = cacheIndexOf;\n isCommon = false;\n values = cache;\n }\n outer:\n while (++index < length) {\n var value = array[index];\n\n if (isCommon && value === value) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === value) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (indexOf(values, value, 0) < 0) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object|string} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object|string} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * Gets the extremum value of `collection` invoking `iteratee` for each value\n * in `collection` to generate the criterion by which the value is ranked.\n * The `iteratee` is invoked with three arguments: (value, index|key, collection).\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} comparator The function used to compare values.\n * @param {*} exValue The initial extremum value.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(collection, iteratee, comparator, exValue) {\n var computed = exValue,\n result = computed;\n\n baseEach(collection, function(value, index, collection) {\n var current = +iteratee(value, index, collection);\n if (comparator(current, computed) || (current === exValue && current === result)) {\n computed = current;\n result = value;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = start == null ? 0 : (+start || 0);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : (+end || 0);\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : (end >>> 0);\n start >>>= 0;\n\n while (start < length) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,\n * without support for callback shorthands and `this` binding, which iterates\n * over `collection` using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @param {boolean} [retKey] Specify returning the key of the found element\n * instead of the element itself.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFind(collection, predicate, eachFunc, retKey) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = retKey ? key : value;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with added support for restricting\n * flattening and specifying the start index.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, isDeep, isStrict, result) {\n result || (result = []);\n\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index];\n if (isObjectLike(value) && isArrayLike(value) &&\n (isStrict || isArray(value) || isArguments(value))) {\n if (isDeep) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, isDeep, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForIn` and `baseForOwn` which iterates\n * over `object` properties returned by `keysFunc` invoking `iteratee` for\n * each property. Iteratee functions may exit iteration early by explicitly\n * returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forIn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForIn(object, iteratee) {\n return baseFor(object, iteratee, keysIn);\n }\n\n /**\n * The base implementation of `_.forOwn` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from those provided.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the new array of filtered property names.\n */\n function baseFunctions(object, props) {\n var index = -1,\n length = props.length,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var key = props[index];\n if (isFunction(object[key])) {\n result[++resIndex] = key;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `get` without support for string paths\n * and default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path of the property to get.\n * @param {string} [pathKey] The key representation of path.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path, pathKey) {\n if (object == null) {\n return;\n }\n if (pathKey !== undefined && pathKey in toObject(object)) {\n path = [pathKey];\n }\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[path[index++]];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `_.isEqual` without support for `this` binding\n * `customizer` functions.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA=[]] Tracks traversed `value` objects.\n * @param {Array} [stackB=[]] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = objToString.call(object);\n if (objTag == argsTag) {\n objTag = objectTag;\n } else if (objTag != objectTag) {\n objIsArr = isTypedArray(object);\n }\n }\n if (!othIsArr) {\n othTag = objToString.call(other);\n if (othTag == argsTag) {\n othTag = objectTag;\n } else if (othTag != objectTag) {\n othIsArr = isTypedArray(other);\n }\n }\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && !(objIsArr || objIsObj)) {\n return equalByTag(object, other, objTag);\n }\n if (!isLoose) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);\n }\n }\n if (!isSameTag) {\n return false;\n }\n // Assume cyclic values are equal.\n // For more information on detecting circular references see https://es5.github.io/#JO.\n stackA || (stackA = []);\n stackB || (stackB = []);\n\n var length = stackA.length;\n while (length--) {\n if (stackA[length] == object) {\n return stackB[length] == other;\n }\n }\n // Add `object` and `other` to the stack of traversed objects.\n stackA.push(object);\n stackB.push(other);\n\n var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);\n\n stackA.pop();\n stackB.pop();\n\n return result;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for callback\n * shorthands and `this` binding.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} matchData The propery names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparing objects.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = toObject(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var result = customizer ? customizer(objValue, srcValue, key) : undefined;\n if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.map` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which does not clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n var key = matchData[0][0],\n value = matchData[0][1];\n\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === value && (value !== undefined || (key in toObject(object)));\n };\n }\n return function(object) {\n return baseIsMatch(object, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which does not clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to compare.\n * @returns {Function} Returns the new function.\n */\n function baseMatchesProperty(path, srcValue) {\n var isArr = isArray(path),\n isCommon = isKey(path) && isStrictComparable(srcValue),\n pathKey = (path + '');\n\n path = toPath(path);\n return function(object) {\n if (object == null) {\n return false;\n }\n var key = pathKey;\n object = toObject(object);\n if ((isArr || !isCommon) && !(key in object)) {\n object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n if (object == null) {\n return false;\n }\n key = last(path);\n object = toObject(object);\n }\n return object[key] === srcValue\n ? (srcValue !== undefined || (key in object))\n : baseIsEqual(srcValue, object[key], undefined, true);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for argument juggling,\n * multiple sources, and `this` binding `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {Object} Returns `object`.\n */\n function baseMerge(object, source, customizer, stackA, stackB) {\n if (!isObject(object)) {\n return object;\n }\n var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),\n props = isSrcArr ? undefined : keys(source);\n\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObjectLike(srcValue)) {\n stackA || (stackA = []);\n stackB || (stackB = []);\n baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n }\n else {\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n }\n if ((result !== undefined || (isSrcArr && !(key in object))) &&\n (isCommon || (result === result ? (result !== value) : (value === value)))) {\n object[key] = result;\n }\n }\n });\n return object;\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Array} [stackA=[]] Tracks traversed source objects.\n * @param {Array} [stackB=[]] Associates values with source counterparts.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n var length = stackA.length,\n srcValue = source[key];\n\n while (length--) {\n if (stackA[length] == srcValue) {\n object[key] = stackB[length];\n return;\n }\n }\n var value = object[key],\n result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n isCommon = result === undefined;\n\n if (isCommon) {\n result = srcValue;\n if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n result = isArray(value)\n ? value\n : (isArrayLike(value) ? arrayCopy(value) : []);\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n result = isArguments(value)\n ? toPlainObject(value)\n : (isPlainObject(value) ? value : {});\n }\n else {\n isCommon = false;\n }\n }\n // Add the source value to the stack of traversed objects and associate\n // it with its merged value.\n stackA.push(srcValue);\n stackB.push(result);\n\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n } else if (result === result ? (result !== value) : (value === value)) {\n object[key] = result;\n }\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n */\n function basePropertyDeep(path) {\n var pathKey = (path + '');\n path = toPath(path);\n return function(object) {\n return baseGet(object, path, pathKey);\n };\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * index arguments and capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0;\n while (length--) {\n var index = indexes[length];\n if (index != previous && isIndex(index)) {\n var previous = index;\n splice.call(array, index, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for argument juggling\n * and returning floating-point numbers.\n *\n * @private\n * @param {number} min The minimum possible value.\n * @param {number} max The maximum possible value.\n * @returns {number} Returns the random number.\n */\n function baseRandom(min, max) {\n return min + nativeFloor(nativeRandom() * (max - min + 1));\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight` without support\n * for callback shorthands and `this` binding, which iterates over `collection`\n * using the provided `eachFunc`.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initFromCollection Specify using the first or last element\n * of `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initFromCollection\n ? (initFromCollection = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop detection.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n start = start == null ? 0 : (+start || 0);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : (+end || 0);\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define\n * the sort order of `array` and replaces criteria objects with their\n * corresponding values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sortByOrder` without param guards.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {boolean[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseSortByOrder(collection, iteratees, orders) {\n var callback = getCallback(),\n index = -1;\n\n iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); });\n\n var result = baseMap(collection, function(value) {\n var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.sum` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(collection, iteratee) {\n var result = 0;\n baseEach(collection, function(value, index, collection) {\n result += +iteratee(value, index, collection) || 0;\n });\n return result;\n }\n\n /**\n * The base implementation of `_.uniq` without support for callback shorthands\n * and `this` binding.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The function invoked per iteration.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee) {\n var index = -1,\n indexOf = getIndexOf(),\n length = array.length,\n isCommon = indexOf === baseIndexOf,\n isLarge = isCommon && length >= LARGE_ARRAY_SIZE,\n seen = isLarge ? createCache() : null,\n result = [];\n\n if (seen) {\n indexOf = cacheIndexOf;\n isCommon = false;\n } else {\n isLarge = false;\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value, index, array) : value;\n\n if (isCommon && value === value) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (indexOf(seen, computed, 0) < 0) {\n if (iteratee || isLarge) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n var index = -1,\n length = props.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = object[props[index]];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,\n * and `_.takeWhile` without support for callback shorthands and `this` binding.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to peform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n var index = -1,\n length = actions.length;\n\n while (++index < length) {\n var action = actions[index];\n result = action.func.apply(action.thisArg, arrayPush([result], action.args));\n }\n return result;\n }\n\n /**\n * Performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function binaryIndex(array, value, retHighest) {\n var low = 0,\n high = array ? array.length : low;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return binaryIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * This function is like `binaryIndex` except that it invokes `iteratee` for\n * `value` and each element of `array` to compute their sort ranking. The\n * iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function binaryIndexBy(array, value, iteratee, retHighest) {\n value = iteratee(value);\n\n var low = 0,\n high = array ? array.length : 0,\n valIsNaN = value !== value,\n valIsNull = value === null,\n valIsUndef = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n isDef = computed !== undefined,\n isReflexive = computed === computed;\n\n if (valIsNaN) {\n var setLow = isReflexive || retHighest;\n } else if (valIsNull) {\n setLow = isReflexive && isDef && (retHighest || computed != null);\n } else if (valIsUndef) {\n setLow = isReflexive && (retHighest || isDef);\n } else if (computed == null) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * A specialized version of `baseCallback` which only supports `this` binding\n * and specifying the number of arguments to provide to `func`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {number} [argCount] The number of arguments to provide to `func`.\n * @returns {Function} Returns the callback.\n */\n function bindCallback(func, thisArg, argCount) {\n if (typeof func != 'function') {\n return identity;\n }\n if (thisArg === undefined) {\n return func;\n }\n switch (argCount) {\n case 1: return function(value) {\n return func.call(thisArg, value);\n };\n case 3: return function(value, index, collection) {\n return func.call(thisArg, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(thisArg, accumulator, value, index, collection);\n };\n case 5: return function(value, other, key, object, source) {\n return func.call(thisArg, value, other, key, object, source);\n };\n }\n return function() {\n return func.apply(thisArg, arguments);\n };\n }\n\n /**\n * Creates a clone of the given array buffer.\n *\n * @private\n * @param {ArrayBuffer} buffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function bufferClone(buffer) {\n var result = new ArrayBuffer(buffer.byteLength),\n view = new Uint8Array(result);\n\n view.set(new Uint8Array(buffer));\n return result;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array|Object} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders) {\n var holdersLength = holders.length,\n argsIndex = -1,\n argsLength = nativeMax(args.length - holdersLength, 0),\n leftIndex = -1,\n leftLength = partials.length,\n result = Array(leftLength + argsLength);\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n while (argsLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array|Object} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders) {\n var holdersIndex = -1,\n holdersLength = holders.length,\n argsIndex = -1,\n argsLength = nativeMax(args.length - holdersLength, 0),\n rightIndex = -1,\n rightLength = partials.length,\n result = Array(argsLength + rightLength);\n\n while (++argsIndex < argsLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.\n *\n * @private\n * @param {Function} setter The function to set keys and values of the accumulator object.\n * @param {Function} [initializer] The function to initialize the accumulator object.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee, thisArg) {\n var result = initializer ? initializer() : {};\n iteratee = getCallback(iteratee, thisArg, 3);\n\n if (isArray(collection)) {\n var index = -1,\n length = collection.length;\n\n while (++index < length) {\n var value = collection[index];\n setter(result, value, iteratee(value, index, collection), collection);\n }\n } else {\n baseEach(collection, function(value, key, collection) {\n setter(result, value, iteratee(value, key, collection), collection);\n });\n }\n return result;\n };\n }\n\n /**\n * Creates a `_.assign`, `_.defaults`, or `_.merge` function.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return restParam(function(object, sources) {\n var index = -1,\n length = object == null ? 0 : sources.length,\n customizer = length > 2 ? sources[length - 2] : undefined,\n guard = length > 2 ? sources[2] : undefined,\n thisArg = length > 1 ? sources[length - 1] : undefined;\n\n if (typeof customizer == 'function') {\n customizer = bindCallback(customizer, thisArg, 5);\n length -= 2;\n } else {\n customizer = typeof thisArg == 'function' ? thisArg : undefined;\n length -= (customizer ? 1 : 0);\n }\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n var length = collection ? getLength(collection) : 0;\n if (!isLength(length)) {\n return eachFunc(collection, iteratee);\n }\n var index = fromRight ? length : -1,\n iterable = toObject(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for `_.forIn` or `_.forInRight`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var iterable = toObject(object),\n props = keysFunc(object),\n length = props.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length)) {\n var key = props[index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` and invokes it with the `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to bind.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new bound function.\n */\n function createBindWrapper(func, thisArg) {\n var Ctor = createCtorWrapper(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(thisArg, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a `Set` cache object to optimize linear searches of large arrays.\n *\n * @private\n * @param {Array} [values] The values to cache.\n * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.\n */\n function createCache(values) {\n return (nativeCreate && Set) ? new SetCache(values) : null;\n }\n\n /**\n * Creates a function that produces compound words out of the words in a\n * given string.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n var index = -1,\n array = words(deburr(string)),\n length = array.length,\n result = '';\n\n while (++index < length) {\n result = callback(result, array[index], index);\n }\n return result;\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtorWrapper(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors.\n // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a `_.curry` or `_.curryRight` function.\n *\n * @private\n * @param {boolean} flag The curry bit flag.\n * @returns {Function} Returns the new curry function.\n */\n function createCurry(flag) {\n function curryFunc(func, arity, guard) {\n if (guard && isIterateeCall(func, arity, guard)) {\n arity = undefined;\n }\n var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryFunc.placeholder;\n return result;\n }\n return curryFunc;\n }\n\n /**\n * Creates a `_.defaults` or `_.defaultsDeep` function.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Function} Returns the new defaults function.\n */\n function createDefaults(assigner, customizer) {\n return restParam(function(args) {\n var object = args[0];\n if (object == null) {\n return object;\n }\n args.push(customizer);\n return assigner.apply(undefined, args);\n });\n }\n\n /**\n * Creates a `_.max` or `_.min` function.\n *\n * @private\n * @param {Function} comparator The function used to compare values.\n * @param {*} exValue The initial extremum value.\n * @returns {Function} Returns the new extremum function.\n */\n function createExtremum(comparator, exValue) {\n return function(collection, iteratee, thisArg) {\n if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {\n iteratee = undefined;\n }\n iteratee = getCallback(iteratee, thisArg, 3);\n if (iteratee.length == 1) {\n collection = isArray(collection) ? collection : toIterable(collection);\n var result = arrayExtremum(collection, iteratee, comparator, exValue);\n if (!(collection.length && result === exValue)) {\n return result;\n }\n }\n return baseExtremum(collection, iteratee, comparator, exValue);\n };\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new find function.\n */\n function createFind(eachFunc, fromRight) {\n return function(collection, predicate, thisArg) {\n predicate = getCallback(predicate, thisArg, 3);\n if (isArray(collection)) {\n var index = baseFindIndex(collection, predicate, fromRight);\n return index > -1 ? collection[index] : undefined;\n }\n return baseFind(collection, predicate, eachFunc);\n };\n }\n\n /**\n * Creates a `_.findIndex` or `_.findLastIndex` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new find function.\n */\n function createFindIndex(fromRight) {\n return function(array, predicate, thisArg) {\n if (!(array && array.length)) {\n return -1;\n }\n predicate = getCallback(predicate, thisArg, 3);\n return baseFindIndex(array, predicate, fromRight);\n };\n }\n\n /**\n * Creates a `_.findKey` or `_.findLastKey` function.\n *\n * @private\n * @param {Function} objectFunc The function to iterate over an object.\n * @returns {Function} Returns the new find function.\n */\n function createFindKey(objectFunc) {\n return function(object, predicate, thisArg) {\n predicate = getCallback(predicate, thisArg, 3);\n return baseFind(object, predicate, objectFunc, true);\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return function() {\n var wrapper,\n length = arguments.length,\n index = fromRight ? length : -1,\n leftIndex = 0,\n funcs = Array(length);\n\n while ((fromRight ? index-- : ++index < length)) {\n var func = funcs[leftIndex++] = arguments[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {\n wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? -1 : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n };\n }\n\n /**\n * Creates a function for `_.forEach` or `_.forEachRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\n function createForEach(arrayFunc, eachFunc) {\n return function(collection, iteratee, thisArg) {\n return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n ? arrayFunc(collection, iteratee)\n : eachFunc(collection, bindCallback(iteratee, thisArg, 3));\n };\n }\n\n /**\n * Creates a function for `_.forIn` or `_.forInRight`.\n *\n * @private\n * @param {Function} objectFunc The function to iterate over an object.\n * @returns {Function} Returns the new each function.\n */\n function createForIn(objectFunc) {\n return function(object, iteratee, thisArg) {\n if (typeof iteratee != 'function' || thisArg !== undefined) {\n iteratee = bindCallback(iteratee, thisArg, 3);\n }\n return objectFunc(object, iteratee, keysIn);\n };\n }\n\n /**\n * Creates a function for `_.forOwn` or `_.forOwnRight`.\n *\n * @private\n * @param {Function} objectFunc The function to iterate over an object.\n * @returns {Function} Returns the new each function.\n */\n function createForOwn(objectFunc) {\n return function(object, iteratee, thisArg) {\n if (typeof iteratee != 'function' || thisArg !== undefined) {\n iteratee = bindCallback(iteratee, thisArg, 3);\n }\n return objectFunc(object, iteratee);\n };\n }\n\n /**\n * Creates a function for `_.mapKeys` or `_.mapValues`.\n *\n * @private\n * @param {boolean} [isMapKeys] Specify mapping keys instead of values.\n * @returns {Function} Returns the new map function.\n */\n function createObjectMapper(isMapKeys) {\n return function(object, iteratee, thisArg) {\n var result = {};\n iteratee = getCallback(iteratee, thisArg, 3);\n\n baseForOwn(object, function(value, key, object) {\n var mapped = iteratee(value, key, object);\n key = isMapKeys ? mapped : key;\n value = isMapKeys ? value : mapped;\n result[key] = value;\n });\n return result;\n };\n }\n\n /**\n * Creates a function for `_.padLeft` or `_.padRight`.\n *\n * @private\n * @param {boolean} [fromRight] Specify padding from the right.\n * @returns {Function} Returns the new pad function.\n */\n function createPadDir(fromRight) {\n return function(string, length, chars) {\n string = baseToString(string);\n return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);\n };\n }\n\n /**\n * Creates a `_.partial` or `_.partialRight` function.\n *\n * @private\n * @param {boolean} flag The partial bit flag.\n * @returns {Function} Returns the new partial function.\n */\n function createPartial(flag) {\n var partialFunc = restParam(function(func, partials) {\n var holders = replaceHolders(partials, partialFunc.placeholder);\n return createWrapper(func, flag, undefined, partials, holders);\n });\n return partialFunc;\n }\n\n /**\n * Creates a function for `_.reduce` or `_.reduceRight`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over an array.\n * @param {Function} eachFunc The function to iterate over a collection.\n * @returns {Function} Returns the new each function.\n */\n function createReduce(arrayFunc, eachFunc) {\n return function(collection, iteratee, accumulator, thisArg) {\n var initFromArray = arguments.length < 3;\n return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n ? arrayFunc(collection, iteratee, accumulator, initFromArray)\n : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);\n };\n }\n\n /**\n * Creates a function that wraps `func` and invokes it with optional `this`\n * binding of, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to reference.\n * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & ARY_FLAG,\n isBind = bitmask & BIND_FLAG,\n isBindKey = bitmask & BIND_KEY_FLAG,\n isCurry = bitmask & CURRY_FLAG,\n isCurryBound = bitmask & CURRY_BOUND_FLAG,\n isCurryRight = bitmask & CURRY_RIGHT_FLAG,\n Ctor = isBindKey ? undefined : createCtorWrapper(func);\n\n function wrapper() {\n // Avoid `arguments` object use disqualifying optimizations by\n // converting it to an array before providing it to other functions.\n var length = arguments.length,\n index = length,\n args = Array(length);\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (partials) {\n args = composeArgs(args, partials, holders);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight);\n }\n if (isCurry || isCurryRight) {\n var placeholder = wrapper.placeholder,\n argsHolders = replaceHolders(args, placeholder);\n\n length -= argsHolders.length;\n if (length < arity) {\n var newArgPos = argPos ? arrayCopy(argPos) : undefined,\n newArity = nativeMax(arity - length, 0),\n newsHolders = isCurry ? argsHolders : undefined,\n newHoldersRight = isCurry ? undefined : argsHolders,\n newPartials = isCurry ? args : undefined,\n newPartialsRight = isCurry ? undefined : args;\n\n bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);\n\n if (!isCurryBound) {\n bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);\n }\n var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],\n result = createHybridWrapper.apply(undefined, newData);\n\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return result;\n }\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n if (argPos) {\n args = reorder(args, argPos);\n }\n if (isAry && ary < args.length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtorWrapper(func);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates the padding required for `string` based on the given `length`.\n * The `chars` string is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {string} string The string to create padding for.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the pad for `string`.\n */\n function createPadding(string, length, chars) {\n var strLength = string.length;\n length = +length;\n\n if (strLength >= length || !nativeIsFinite(length)) {\n return '';\n }\n var padLength = length - strLength;\n chars = chars == null ? ' ' : (chars + '');\n return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);\n }\n\n /**\n * Creates a function that wraps `func` and invokes it with the optional `this`\n * binding of `thisArg` and the `partials` prepended to those provided to\n * the wrapper.\n *\n * @private\n * @param {Function} func The function to partially apply arguments to.\n * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to the new function.\n * @returns {Function} Returns the new bound function.\n */\n function createPartialWrapper(func, bitmask, thisArg, partials) {\n var isBind = bitmask & BIND_FLAG,\n Ctor = createCtorWrapper(func);\n\n function wrapper() {\n // Avoid `arguments` object use disqualifying optimizations by\n // converting it to an array before providing it `func`.\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength);\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.ceil`, `_.floor`, or `_.round` function.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n precision = precision === undefined ? 0 : (+precision || 0);\n if (precision) {\n precision = pow(10, precision);\n return func(number * precision) / precision;\n }\n return func(number);\n };\n }\n\n /**\n * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.\n *\n * @private\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {Function} Returns the new index function.\n */\n function createSortedIndex(retHighest) {\n return function(array, value, iteratee, thisArg) {\n var callback = getCallback(iteratee);\n return (iteratee == null && callback === baseCallback)\n ? binaryIndex(array, value, retHighest)\n : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to reference.\n * @param {number} bitmask The bitmask of flags.\n * The bitmask may be composed of the following flags:\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n length -= (holders ? holders.length : 0);\n if (bitmask & PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func),\n newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];\n\n if (data) {\n mergeData(newData, data);\n bitmask = newData[1];\n arity = newData[9];\n }\n newData[9] = arity == null\n ? (isBindKey ? 0 : func.length)\n : (nativeMax(arity - length, 0) || 0);\n\n if (bitmask == BIND_FLAG) {\n var result = createBindWrapper(newData[0], newData[2]);\n } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {\n result = createPartialWrapper.apply(undefined, newData);\n } else {\n result = createHybridWrapper.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setter(result, newData);\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing arrays.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var index = -1,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isLoose && othLength > arrLength)) {\n return false;\n }\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index],\n result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;\n\n if (result !== undefined) {\n if (result) {\n continue;\n }\n return false;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (isLoose) {\n if (!arraySome(other, function(othValue) {\n return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n })) {\n return false;\n }\n } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag) {\n switch (tag) {\n case boolTag:\n case dateTag:\n // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n return +object == +other;\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case numberTag:\n // Treat `NaN` vs. `NaN` as equal.\n return (object != +object)\n ? other != +other\n : object == +other;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings primitives and string\n // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n return object == (other + '');\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparing values.\n * @param {boolean} [isLoose] Specify performing partial comparisons.\n * @param {Array} [stackA] Tracks traversed `value` objects.\n * @param {Array} [stackB] Tracks traversed `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n var objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isLoose) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n var skipCtor = isLoose;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key],\n result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;\n\n // Recursively compare objects (susceptible to call stack limits).\n if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {\n return false;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (!skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Gets the appropriate \"callback\" function. If the `_.callback` method is\n * customized this function returns the custom method, otherwise it returns\n * the `baseCallback` function. If arguments are provided the chosen function\n * is invoked with them and its result is returned.\n *\n * @private\n * @returns {Function} Returns the chosen function or its result.\n */\n function getCallback(func, thisArg, argCount) {\n var result = lodash.callback || callback;\n result = result === callback ? baseCallback : result;\n return argCount ? result(func, thisArg, argCount) : result;\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = array ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the appropriate \"indexOf\" function. If the `_.indexOf` method is\n * customized this function returns the custom method, otherwise it returns\n * the `baseIndexOf` function. If arguments are provided the chosen function\n * is invoked with them and its result is returned.\n *\n * @private\n * @returns {Function|number} Returns the chosen function or its result.\n */\n function getIndexOf(collection, target, fromIndex) {\n var result = lodash.indexOf || indexOf;\n result = result === indexOf ? baseIndexOf : result;\n return collection ? result(collection, target, fromIndex) : result;\n }\n\n /**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\n var getLength = baseProperty('length');\n\n /**\n * Gets the propery names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = pairs(object),\n length = result.length;\n\n while (length--) {\n result[length][2] = isStrictComparable(result[length][1]);\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = object == null ? undefined : object[key];\n return isNative(value) ? value : undefined;\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add array properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n var Ctor = object.constructor;\n if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {\n Ctor = Object;\n }\n return new Ctor;\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return bufferClone(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n var buffer = object.buffer;\n return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n var result = new Ctor(object.source, reFlags.exec(object));\n result.lastIndex = object.lastIndex;\n }\n return result;\n }\n\n /**\n * Invokes the method at `path` on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function invokePath(object, path, args) {\n if (object != null && !isKey(path, object)) {\n path = toPath(path);\n object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n path = last(path);\n }\n var func = object == null ? object : object[path];\n return func == null ? undefined : func.apply(object, args);\n }\n\n /**\n * Checks if `value` is array-like.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n */\n function isArrayLike(value) {\n return value != null && isLength(getLength(value));\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n }\n\n /**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n var other = object[index];\n return value === value ? (value === other) : (other !== other);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n var type = typeof value;\n if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {\n return true;\n }\n if (isArray(value)) {\n return false;\n }\n var result = !reIsDeepProp.test(value);\n return result || (object != null && value in toObject(object));\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n */\n function isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers required to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`\n * augment function arguments, making the order in which they are executed important,\n * preventing the merging of metadata. However, we make an exception for a safe\n * common case where curried functions have `_.ary` and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < ARY_FLAG;\n\n var isCombo =\n (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||\n (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||\n (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = arrayCopy(value);\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use.\n *\n * @private\n * @param {*} objectValue The destination object property value.\n * @param {*} sourceValue The source object property value.\n * @returns {*} Returns the value to assign to the destination object.\n */\n function mergeDefaults(objectValue, sourceValue) {\n return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);\n }\n\n /**\n * A specialized version of `_.pick` which picks `object` properties specified\n * by `props`.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} props The property names to pick.\n * @returns {Object} Returns the new object.\n */\n function pickByArray(object, props) {\n object = toObject(object);\n\n var index = -1,\n length = props.length,\n result = {};\n\n while (++index < length) {\n var key = props[index];\n if (key in object) {\n result[key] = object[key];\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.pick` which picks `object` properties `predicate`\n * returns truthy for.\n *\n * @private\n * @param {Object} object The source object.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Object} Returns the new object.\n */\n function pickByCallback(object, predicate) {\n var result = {};\n baseForIn(object, function(value, key, object) {\n if (predicate(value, key, object)) {\n result[key] = value;\n }\n });\n return result;\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = arrayCopy(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity function\n * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = (function() {\n var count = 0,\n lastCalled = 0;\n\n return function(key, value) {\n var stamp = now(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return key;\n }\n } else {\n count = 0;\n }\n return baseSetData(key, value);\n };\n }());\n\n /**\n * A fallback implementation of `Object.keys` which creates an array of the\n * own enumerable property names of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function shimKeys(object) {\n var props = keysIn(object),\n propsLength = props.length,\n length = propsLength && object.length;\n\n var allowIndexes = !!length && isLength(length) &&\n (isArray(object) || isArguments(object));\n\n var index = -1,\n result = [];\n\n while (++index < propsLength) {\n var key = props[index];\n if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to an array-like object if it's not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Array|Object} Returns the array-like object.\n */\n function toIterable(value) {\n if (value == null) {\n return [];\n }\n if (!isArrayLike(value)) {\n return values(value);\n }\n return isObject(value) ? value : Object(value);\n }\n\n /**\n * Converts `value` to an object if it's not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Object} Returns the object.\n */\n function toObject(value) {\n return isObject(value) ? value : Object(value);\n }\n\n /**\n * Converts `value` to property path array if it's not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Array} Returns the property path array.\n */\n function toPath(value) {\n if (isArray(value)) {\n return value;\n }\n var result = [];\n baseToString(value).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n return wrapper instanceof LazyWrapper\n ? wrapper.clone()\n : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `collection` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the new array containing chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if (guard ? isIterateeCall(array, size, guard) : size == null) {\n size = 1;\n } else {\n size = nativeMax(nativeFloor(size) || 1, 1);\n }\n var index = 0,\n length = array ? array.length : 0,\n resIndex = -1,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[++resIndex] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array ? array.length : 0,\n resIndex = -1,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[++resIndex] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates an array of unique `array` values not included in the other\n * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The arrays of values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.difference([1, 2, 3], [4, 2]);\n * // => [1, 3]\n */\n var difference = restParam(function(array, values) {\n return (isObjectLike(array) && isArrayLike(array))\n ? baseDifference(array, baseFlatten(values, false, true))\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n if (guard ? isIterateeCall(array, n, guard) : n == null) {\n n = 1;\n }\n return baseSlice(array, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n if (guard ? isIterateeCall(array, n, guard) : n == null) {\n n = 1;\n }\n n = length - (+n || 0);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * bound to `thisArg` and invoked with three arguments: (value, index, array).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that match the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRightWhile([1, 2, 3], function(n) {\n * return n > 1;\n * });\n * // => [1]\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');\n * // => ['barney', 'fred']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.dropRightWhile(users, 'active', false), 'user');\n * // => ['barney']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.dropRightWhile(users, 'active'), 'user');\n * // => ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate, thisArg) {\n return (array && array.length)\n ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * bound to `thisArg` and invoked with three arguments: (value, index, array).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropWhile([1, 2, 3], function(n) {\n * return n < 3;\n * });\n * // => [3]\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');\n * // => ['fred', 'pebbles']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.dropWhile(users, 'active', false), 'user');\n * // => ['pebbles']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.dropWhile(users, 'active'), 'user');\n * // => ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate, thisArg) {\n return (array && array.length)\n ? baseWhile(array, getCallback(predicate, thisArg, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8], '*', 1, 2);\n * // => [4, '*', 8]\n */\n function fill(array, value, start, end) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(chr) {\n * return chr.user == 'barney';\n * });\n * // => 0\n *\n * // using the `_.matches` callback shorthand\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.findIndex(users, 'active', false);\n * // => 0\n *\n * // using the `_.property` callback shorthand\n * _.findIndex(users, 'active');\n * // => 2\n */\n var findIndex = createFindIndex();\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(chr) {\n * return chr.user == 'pebbles';\n * });\n * // => 2\n *\n * // using the `_.matches` callback shorthand\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.findLastIndex(users, 'active', false);\n * // => 2\n *\n * // using the `_.property` callback shorthand\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n var findLastIndex = createFindIndex(true);\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @alias head\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.first([1, 2, 3]);\n * // => 1\n *\n * _.first([]);\n * // => undefined\n */\n function first(array) {\n return array ? array[0] : undefined;\n }\n\n /**\n * Flattens a nested array. If `isDeep` is `true` the array is recursively\n * flattened, otherwise it's only flattened a single level.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {boolean} [isDeep] Specify a deep flatten.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, 3, [4]]]);\n * // => [1, 2, 3, [4]]\n *\n * // using `isDeep`\n * _.flatten([1, [2, 3, [4]]], true);\n * // => [1, 2, 3, 4]\n */\n function flatten(array, isDeep, guard) {\n var length = array ? array.length : 0;\n if (guard && isIterateeCall(array, isDeep, guard)) {\n isDeep = false;\n }\n return length ? baseFlatten(array, isDeep) : [];\n }\n\n /**\n * Recursively flattens a nested array.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to recursively flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, 3, [4]]]);\n * // => [1, 2, 3, 4]\n */\n function flattenDeep(array) {\n var length = array ? array.length : 0;\n return length ? baseFlatten(array, true) : [];\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the offset\n * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`\n * performs a faster binary search.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {boolean|number} [fromIndex=0] The index to search from or `true`\n * to perform a binary search on a sorted array.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // using `fromIndex`\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n *\n * // performing a binary search\n * _.indexOf([1, 1, 2, 2], 2, true);\n * // => 2\n */\n function indexOf(array, value, fromIndex) {\n var length = array ? array.length : 0;\n if (!length) {\n return -1;\n }\n if (typeof fromIndex == 'number') {\n fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;\n } else if (fromIndex) {\n var index = binaryIndex(array, value);\n if (index < length &&\n (value === value ? (value === array[index]) : (array[index] !== array[index]))) {\n return index;\n }\n return -1;\n }\n return baseIndexOf(array, value, fromIndex || 0);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n return dropRight(array, 1);\n }\n\n /**\n * Creates an array of unique values that are included in all of the provided\n * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of shared values.\n * @example\n * _.intersection([1, 2], [4, 2], [2, 1]);\n * // => [2]\n */\n var intersection = restParam(function(arrays) {\n var othLength = arrays.length,\n othIndex = othLength,\n caches = Array(length),\n indexOf = getIndexOf(),\n isCommon = indexOf === baseIndexOf,\n result = [];\n\n while (othIndex--) {\n var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];\n caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;\n }\n var array = arrays[0],\n index = -1,\n length = array ? array.length : 0,\n seen = caches[0];\n\n outer:\n while (++index < length) {\n value = array[index];\n if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {\n var othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(value);\n }\n result.push(value);\n }\n }\n return result;\n });\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array ? array.length : 0;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {boolean|number} [fromIndex=array.length-1] The index to search from\n * or `true` to perform a binary search on a sorted array.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // using `fromIndex`\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n *\n * // performing a binary search\n * _.lastIndexOf([1, 1, 2, 2], 2, true);\n * // => 3\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array ? array.length : 0;\n if (!length) {\n return -1;\n }\n var index = length;\n if (typeof fromIndex == 'number') {\n index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;\n } else if (fromIndex) {\n index = binaryIndex(array, value, true) - 1;\n var other = array[index];\n if (value === value ? (value === other) : (other !== other)) {\n return index;\n }\n return -1;\n }\n if (value !== value) {\n return indexOfNaN(array, index, true);\n }\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * Removes all provided values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3, 1, 2, 3];\n *\n * _.pull(array, 2, 3);\n * console.log(array);\n * // => [1, 1]\n */\n function pull() {\n var args = arguments,\n array = args[0];\n\n if (!(array && array.length)) {\n return array;\n }\n var index = 0,\n indexOf = getIndexOf(),\n length = args.length;\n\n while (++index < length) {\n var fromIndex = 0,\n value = args[index];\n\n while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * Removes elements from `array` corresponding to the given indexes and returns\n * an array of the removed elements. Indexes may be specified as an array of\n * indexes or as individual arguments.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove,\n * specified as individual indexes or arrays of indexes.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [5, 10, 15, 20];\n * var evens = _.pullAt(array, 1, 3);\n *\n * console.log(array);\n * // => [5, 15]\n *\n * console.log(evens);\n * // => [10, 20]\n */\n var pullAt = restParam(function(array, indexes) {\n indexes = baseFlatten(indexes);\n\n var result = baseAt(array, indexes);\n basePullAt(array, indexes.sort(baseCompareAscending));\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is bound to\n * `thisArg` and invoked with three arguments: (value, index, array).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate, thisArg) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getCallback(predicate, thisArg, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @alias tail\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.rest([1, 2, 3]);\n * // => [2, 3]\n */\n function rest(array) {\n return drop(array, 1);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of `Array#slice` to support node\n * lists in IE < 9 and to ensure dense arrays are returned.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value` should\n * be inserted into `array` in order to maintain its sort order. If an iteratee\n * function is provided it's invoked for `value` and each element of `array`\n * to compute their sort ranking. The iteratee is bound to `thisArg` and\n * invoked with one argument; (value).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n *\n * _.sortedIndex([4, 4, 5, 5], 5);\n * // => 2\n *\n * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };\n *\n * // using an iteratee function\n * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {\n * return this.data[word];\n * }, dict);\n * // => 1\n *\n * // using the `_.property` callback shorthand\n * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');\n * // => 1\n */\n var sortedIndex = createSortedIndex();\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 4, 5, 5], 5);\n * // => 4\n */\n var sortedLastIndex = createSortedIndex(true);\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n if (guard ? isIterateeCall(array, n, guard) : n == null) {\n n = 1;\n }\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n if (guard ? isIterateeCall(array, n, guard) : n == null) {\n n = 1;\n }\n n = length - (+n || 0);\n return baseSlice(array, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is bound to `thisArg`\n * and invoked with three arguments: (value, index, array).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRightWhile([1, 2, 3], function(n) {\n * return n > 1;\n * });\n * // => [2, 3]\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');\n * // => ['pebbles']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.takeRightWhile(users, 'active', false), 'user');\n * // => ['fred', 'pebbles']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.takeRightWhile(users, 'active'), 'user');\n * // => []\n */\n function takeRightWhile(array, predicate, thisArg) {\n return (array && array.length)\n ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is bound to\n * `thisArg` and invoked with three arguments: (value, index, array).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeWhile([1, 2, 3], function(n) {\n * return n < 3;\n * });\n * // => [1, 2]\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false},\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');\n * // => ['barney']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.takeWhile(users, 'active', false), 'user');\n * // => ['barney', 'fred']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.takeWhile(users, 'active'), 'user');\n * // => []\n */\n function takeWhile(array, predicate, thisArg) {\n return (array && array.length)\n ? baseWhile(array, getCallback(predicate, thisArg, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all of the provided arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([1, 2], [4, 2], [2, 1]);\n * // => [1, 2, 4]\n */\n var union = restParam(function(arrays) {\n return baseUniq(baseFlatten(arrays, false, true));\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurence of each element\n * is kept. Providing `true` for `isSorted` performs a faster search algorithm\n * for sorted arrays. If an iteratee function is provided it's invoked for\n * each element in the array to generate the criterion by which uniqueness\n * is computed. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index, array).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias unique\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {boolean} [isSorted] Specify the array is sorted.\n * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new duplicate-value-free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n *\n * // using `isSorted`\n * _.uniq([1, 1, 2], true);\n * // => [1, 2]\n *\n * // using an iteratee function\n * _.uniq([1, 2.5, 1.5, 2], function(n) {\n * return this.floor(n);\n * }, Math);\n * // => [1, 2.5]\n *\n * // using the `_.property` callback shorthand\n * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniq(array, isSorted, iteratee, thisArg) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n if (isSorted != null && typeof isSorted != 'boolean') {\n thisArg = iteratee;\n iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;\n isSorted = false;\n }\n var callback = getCallback();\n if (!(iteratee == null && callback === baseCallback)) {\n iteratee = callback(iteratee, thisArg, 3);\n }\n return (isSorted && getIndexOf() === baseIndexOf)\n ? sortedUniq(array, iteratee)\n : baseUniq(array, iteratee);\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);\n * // => [['fred', 30, true], ['barney', 40, false]]\n *\n * _.unzip(zipped);\n * // => [['fred', 'barney'], [30, 40], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var index = -1,\n length = 0;\n\n array = arrayFilter(array, function(group) {\n if (isArrayLike(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n var result = Array(length);\n while (++index < length) {\n result[index] = arrayMap(array, baseProperty(index));\n }\n return result;\n }\n\n /**\n * This method is like `_.unzip` except that it accepts an iteratee to specify\n * how regrouped values should be combined. The `iteratee` is bound to `thisArg`\n * and invoked with four arguments: (accumulator, value, index, group).\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee] The function to combine regrouped values.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee, thisArg) {\n var length = array ? array.length : 0;\n if (!length) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n iteratee = bindCallback(iteratee, thisArg, 4);\n return arrayMap(result, function(group) {\n return arrayReduce(group, iteratee, undefined, true);\n });\n }\n\n /**\n * Creates an array excluding all provided values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} array The array to filter.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.without([1, 2, 1, 3], 1, 2);\n * // => [3]\n */\n var without = restParam(function(array, values) {\n return isArrayLike(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the provided arrays.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of values.\n * @example\n *\n * _.xor([1, 2], [4, 2]);\n * // => [1, 4]\n */\n function xor() {\n var index = -1,\n length = arguments.length;\n\n while (++index < length) {\n var array = arguments[index];\n if (isArrayLike(array)) {\n var result = result\n ? arrayPush(baseDifference(result, array), baseDifference(array, result))\n : array;\n }\n }\n return result ? baseUniq(result) : [];\n }\n\n /**\n * Creates an array of grouped elements, the first of which contains the first\n * elements of the given arrays, the second of which contains the second elements\n * of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['fred', 'barney'], [30, 40], [true, false]);\n * // => [['fred', 30, true], ['barney', 40, false]]\n */\n var zip = restParam(unzip);\n\n /**\n * The inverse of `_.pairs`; this method returns an object composed from arrays\n * of property names and values. Provide either a single two dimensional array,\n * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names\n * and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @alias object\n * @category Array\n * @param {Array} props The property names.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject([['fred', 30], ['barney', 40]]);\n * // => { 'fred': 30, 'barney': 40 }\n *\n * _.zipObject(['fred', 'barney'], [30, 40]);\n * // => { 'fred': 30, 'barney': 40 }\n */\n function zipObject(props, values) {\n var index = -1,\n length = props ? props.length : 0,\n result = {};\n\n if (length && !values && !isArray(props[0])) {\n values = [];\n }\n while (++index < length) {\n var key = props[index];\n if (values) {\n result[key] = values[index];\n } else if (key) {\n result[key[0]] = key[1];\n }\n }\n return result;\n }\n\n /**\n * This method is like `_.zip` except that it accepts an iteratee to specify\n * how grouped values should be combined. The `iteratee` is bound to `thisArg`\n * and invoked with four arguments: (accumulator, value, index, group).\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee] The function to combine grouped values.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], _.add);\n * // => [111, 222]\n */\n var zipWith = restParam(function(arrays) {\n var length = arrays.length,\n iteratee = length > 2 ? arrays[length - 2] : undefined,\n thisArg = length > 1 ? arrays[length - 1] : undefined;\n\n if (length > 2 && typeof iteratee == 'function') {\n length -= 2;\n } else {\n iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;\n thisArg = undefined;\n }\n arrays.length = length;\n return unzipWith(arrays, iteratee, thisArg);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object that wraps `value` with explicit method\n * chaining enabled.\n *\n * @static\n * @memberOf _\n * @category Chain\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _.chain(users)\n * .sortBy('age')\n * .map(function(chr) {\n * return chr.user + ' is ' + chr.age;\n * })\n * .first()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor is\n * bound to `thisArg` and invoked with one argument; (value). The purpose of\n * this method is to \"tap into\" a method chain in order to perform operations\n * on intermediate results within the chain.\n *\n * @static\n * @memberOf _\n * @category Chain\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @param {*} [thisArg] The `this` binding of `interceptor`.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor, thisArg) {\n interceptor.call(thisArg, value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n *\n * @static\n * @memberOf _\n * @category Chain\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @param {*} [thisArg] The `this` binding of `interceptor`.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor, thisArg) {\n return interceptor.call(thisArg, value);\n }\n\n /**\n * Enables explicit method chaining on the wrapper object.\n *\n * @name chain\n * @memberOf _\n * @category Chain\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // without explicit chaining\n * _(users).first();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // with explicit chaining\n * _(users).chain()\n * .first()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chained sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @category Chain\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Creates a new array joining a wrapped array with any additional arrays\n * and/or values.\n *\n * @name concat\n * @memberOf _\n * @category Chain\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var wrapped = _(array).concat(2, [3], [[4]]);\n *\n * console.log(wrapped.value());\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n var wrapperConcat = restParam(function(values) {\n values = baseFlatten(values);\n return this.thru(function(array) {\n return arrayConcat(isArray(array) ? array : [toObject(array)], values);\n });\n });\n\n /**\n * Creates a clone of the chained sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @category Chain\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).map(function(value) {\n * return Math.pow(value, 2);\n * });\n *\n * var other = [3, 4];\n * var otherWrapped = wrapped.plant(other);\n *\n * otherWrapped.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * Reverses the wrapped array so the first element becomes the last, the\n * second element becomes the second to last, and so on.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @category Chain\n * @returns {Object} Returns the new reversed `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n\n var interceptor = function(value) {\n return value.reverse();\n };\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(interceptor);\n }\n\n /**\n * Produces the result of coercing the unwrapped value to a string.\n *\n * @name toString\n * @memberOf _\n * @category Chain\n * @returns {string} Returns the coerced string value.\n * @example\n *\n * _([1, 2, 3]).toString();\n * // => '1,2,3'\n */\n function wrapperToString() {\n return (this.value() + '');\n }\n\n /**\n * Executes the chained sequence to extract the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @alias run, toJSON, valueOf\n * @category Chain\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements corresponding to the given keys, or indexes,\n * of `collection`. Keys may be specified as individual arguments or as arrays\n * of keys.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {...(number|number[]|string|string[])} [props] The property names\n * or indexes of elements to pick, specified individually or in arrays.\n * @returns {Array} Returns the new array of picked elements.\n * @example\n *\n * _.at(['a', 'b', 'c'], [0, 2]);\n * // => ['a', 'c']\n *\n * _.at(['barney', 'fred', 'pebbles'], 0, 2);\n * // => ['barney', 'pebbles']\n */\n var at = restParam(function(collection, props) {\n return baseAt(collection, baseFlatten(props));\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` through `iteratee`. The corresponding value\n * of each key is the number of times the key was returned by `iteratee`.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([4.3, 6.1, 6.4], function(n) {\n * return Math.floor(n);\n * });\n * // => { '4': 1, '6': 2 }\n *\n * _.countBy([4.3, 6.1, 6.4], function(n) {\n * return this.floor(n);\n * }, Math);\n * // => { '4': 1, '6': 2 }\n *\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * The predicate is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias all\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.every(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n predicate = undefined;\n }\n if (typeof predicate != 'function' || thisArg !== undefined) {\n predicate = getCallback(predicate, thisArg, 3);\n }\n return func(collection, predicate);\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias select\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the new filtered array.\n * @example\n *\n * _.filter([4, 5, 6], function(n) {\n * return n % 2 == 0;\n * });\n * // => [4, 6]\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');\n * // => ['barney']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.filter(users, 'active', false), 'user');\n * // => ['fred']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.filter(users, 'active'), 'user');\n * // => ['barney']\n */\n function filter(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n predicate = getCallback(predicate, thisArg, 3);\n return func(collection, predicate);\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n * invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias detect\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.result(_.find(users, function(chr) {\n * return chr.age < 40;\n * }), 'user');\n * // => 'barney'\n *\n * // using the `_.matches` callback shorthand\n * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');\n * // => 'pebbles'\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.result(_.find(users, 'active', false), 'user');\n * // => 'fred'\n *\n * // using the `_.property` callback shorthand\n * _.result(_.find(users, 'active'), 'user');\n * // => 'barney'\n */\n var find = createFind(baseEach);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(baseEachRight, true);\n\n /**\n * Performs a deep comparison between each element in `collection` and the\n * source object, returning the first element that has equivalent property\n * values.\n *\n * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n * numbers, `Object` objects, regexes, and strings. Objects are compared by\n * their own, not inherited, enumerable properties. For comparing a single\n * own or inherited property value see `_.matchesProperty`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {Object} source The object of property values to match.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');\n * // => 'barney'\n *\n * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');\n * // => 'fred'\n */\n function findWhere(collection, source) {\n return find(collection, baseMatches(source));\n }\n\n /**\n * Iterates over elements of `collection` invoking `iteratee` for each element.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection). Iteratee functions may exit iteration early\n * by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`\n * may be used for object iteration.\n *\n * @static\n * @memberOf _\n * @alias each\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array|Object|string} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEach(function(n) {\n * console.log(n);\n * }).value();\n * // => logs each value from left to right and returns the array\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {\n * console.log(n, key);\n * });\n * // => logs each value-key pair and returns the object (iteration order is not guaranteed)\n */\n var forEach = createForEach(arrayEach, baseEach);\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @alias eachRight\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array|Object|string} Returns `collection`.\n * @example\n *\n * _([1, 2]).forEachRight(function(n) {\n * console.log(n);\n * }).value();\n * // => logs each value from right to left and returns the array\n */\n var forEachRight = createForEach(arrayEachRight, baseEachRight);\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` through `iteratee`. The corresponding value\n * of each key is an array of the elements responsible for generating the key.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n * return Math.floor(n);\n * });\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * _.groupBy([4.2, 6.1, 6.4], function(n) {\n * return this.floor(n);\n * }, Math);\n * // => { '4': [4.2], '6': [6.1, 6.4] }\n *\n * // using the `_.property` callback shorthand\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n result[key] = [value];\n }\n });\n\n /**\n * Checks if `target` is in `collection` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the offset\n * from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @alias contains, include\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {*} target The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.\n * @returns {boolean} Returns `true` if a matching element is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');\n * // => true\n *\n * _.includes('pebbles', 'eb');\n * // => true\n */\n function includes(collection, target, fromIndex, guard) {\n var length = collection ? getLength(collection) : 0;\n if (!isLength(length)) {\n collection = values(collection);\n length = collection.length;\n }\n if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {\n fromIndex = 0;\n } else {\n fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);\n }\n return (typeof collection == 'string' || !isArray(collection) && isString(collection))\n ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)\n : (!!length && getIndexOf(collection, target, fromIndex) > -1);\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` through `iteratee`. The corresponding value\n * of each key is the last element responsible for generating the key. The\n * iteratee function is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var keyData = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.indexBy(keyData, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n *\n * _.indexBy(keyData, function(object) {\n * return String.fromCharCode(object.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.indexBy(keyData, function(object) {\n * return this.fromCharCode(object.code);\n * }, String);\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n */\n var indexBy = createAggregator(function(result, value, key) {\n result[key] = value;\n });\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `methodName` is a function it's\n * invoked for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invoke([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invoke = restParam(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n isProp = isKey(path),\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);\n result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an array of values by running each element in `collection` through\n * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,\n * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,\n * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,\n * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,\n * `sum`, `uniq`, and `words`\n *\n * @static\n * @memberOf _\n * @alias collect\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function timesThree(n) {\n * return n * 3;\n * }\n *\n * _.map([1, 2], timesThree);\n * // => [3, 6]\n *\n * _.map({ 'a': 1, 'b': 2 }, timesThree);\n * // => [3, 6] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // using the `_.property` callback shorthand\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee, thisArg) {\n var func = isArray(collection) ? arrayMap : baseMap;\n iteratee = getCallback(iteratee, thisArg, 3);\n return func(collection, iteratee);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, while the second of which\n * contains elements `predicate` returns falsey for. The predicate is bound\n * to `thisArg` and invoked with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * _.partition([1, 2, 3], function(n) {\n * return n % 2;\n * });\n * // => [[1, 3], [2]]\n *\n * _.partition([1.2, 2.3, 3.4], function(n) {\n * return this.floor(n) % 2;\n * }, Math);\n * // => [[1.2, 3.4], [2.3]]\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * var mapper = function(array) {\n * return _.pluck(array, 'user');\n * };\n *\n * // using the `_.matches` callback shorthand\n * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);\n * // => [['pebbles'], ['barney', 'fred']]\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.map(_.partition(users, 'active', false), mapper);\n * // => [['barney', 'pebbles'], ['fred']]\n *\n * // using the `_.property` callback shorthand\n * _.map(_.partition(users, 'active'), mapper);\n * // => [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Gets the property value of `path` from all elements in `collection`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Array|string} path The path of the property to pluck.\n * @returns {Array} Returns the property values.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * _.pluck(users, 'user');\n * // => ['barney', 'fred']\n *\n * var userIndex = _.indexBy(users, 'user');\n * _.pluck(userIndex, 'age');\n * // => [36, 40] (iteration order is not guaranteed)\n */\n function pluck(collection, path) {\n return map(collection, property(path));\n }\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` through `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not provided the first element of `collection` is used as the initial\n * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`,\n * and `sortByOrder`\n *\n * @static\n * @memberOf _\n * @alias foldl, inject\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.reduce([1, 2], function(total, n) {\n * return total + n;\n * });\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {\n * result[key] = n * 3;\n * return result;\n * }, {});\n * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)\n */\n var reduce = createReduce(arrayReduce, baseEach);\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @alias foldr\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n var reduceRight = createReduce(arrayReduceRight, baseEachRight);\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Array} Returns the new filtered array.\n * @example\n *\n * _.reject([1, 2, 3, 4], function(n) {\n * return n % 2 == 0;\n * });\n * // => [1, 3]\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');\n * // => ['barney']\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.pluck(_.reject(users, 'active', false), 'user');\n * // => ['fred']\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.reject(users, 'active'), 'user');\n * // => ['barney']\n */\n function reject(collection, predicate, thisArg) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n predicate = getCallback(predicate, thisArg, 3);\n return func(collection, function(value, index, collection) {\n return !predicate(value, index, collection);\n });\n }\n\n /**\n * Gets a random element or `n` random elements from a collection.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to sample.\n * @param {number} [n] The number of elements to sample.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {*} Returns the random sample(s).\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n *\n * _.sample([1, 2, 3, 4], 2);\n * // => [3, 1]\n */\n function sample(collection, n, guard) {\n if (guard ? isIterateeCall(collection, n, guard) : n == null) {\n collection = toIterable(collection);\n var length = collection.length;\n return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;\n }\n var index = -1,\n result = toArray(collection),\n length = result.length,\n lastIndex = length - 1;\n\n n = nativeMin(n < 0 ? 0 : (+n || 0), length);\n while (++index < n) {\n var rand = baseRandom(index, lastIndex),\n value = result[rand];\n\n result[rand] = result[index];\n result[index] = value;\n }\n result.length = n;\n return result;\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n return sample(collection, POSITIVE_INFINITY);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable properties for objects.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the size of `collection`.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n var length = collection ? getLength(collection) : 0;\n return isLength(length) ? length : keys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * The function returns as soon as it finds a passing value and does not iterate\n * over the entire collection. The predicate is bound to `thisArg` and invoked\n * with three arguments: (value, index|key, collection).\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @alias any\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // using the `_.matches` callback shorthand\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.some(users, 'active', false);\n * // => true\n *\n * // using the `_.property` callback shorthand\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, thisArg) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n predicate = undefined;\n }\n if (typeof predicate != 'function' || thisArg !== undefined) {\n predicate = getCallback(predicate, thisArg, 3);\n }\n return func(collection, predicate);\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection through `iteratee`. This method performs\n * a stable sort, that is, it preserves the original sort order of equal elements.\n * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n * (value, index|key, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * _.sortBy([1, 2, 3], function(n) {\n * return Math.sin(n);\n * });\n * // => [3, 1, 2]\n *\n * _.sortBy([1, 2, 3], function(n) {\n * return this.sin(n);\n * }, Math);\n * // => [3, 1, 2]\n *\n * var users = [\n * { 'user': 'fred' },\n * { 'user': 'pebbles' },\n * { 'user': 'barney' }\n * ];\n *\n * // using the `_.property` callback shorthand\n * _.pluck(_.sortBy(users, 'user'), 'user');\n * // => ['barney', 'fred', 'pebbles']\n */\n function sortBy(collection, iteratee, thisArg) {\n if (collection == null) {\n return [];\n }\n if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {\n iteratee = undefined;\n }\n var index = -1;\n iteratee = getCallback(iteratee, thisArg, 3);\n\n var result = baseMap(collection, function(value, key, collection) {\n return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };\n });\n return baseSortBy(result, compareAscending);\n }\n\n /**\n * This method is like `_.sortBy` except that it can sort by multiple iteratees\n * or property names.\n *\n * If a property name is provided for an iteratee the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If an object is provided for an iteratee the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees\n * The iteratees to sort by, specified as individual values or arrays of values.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 42 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.map(_.sortByAll(users, ['user', 'age']), _.values);\n * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]\n *\n * _.map(_.sortByAll(users, 'user', function(chr) {\n * return Math.floor(chr.age / 10);\n * }), _.values);\n * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n */\n var sortByAll = restParam(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var guard = iteratees[2];\n if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {\n iteratees.length = 1;\n }\n return baseSortByOrder(collection, baseFlatten(iteratees), []);\n });\n\n /**\n * This method is like `_.sortByAll` except that it allows specifying the\n * sort orders of the iteratees to sort by. If `orders` is unspecified, all\n * values are sorted in ascending order. Otherwise, a value is sorted in\n * ascending order if its corresponding order is \"asc\", and descending if \"desc\".\n *\n * If a property name is provided for an iteratee the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If an object is provided for an iteratee the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {boolean[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 42 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // sort by `user` in ascending order and by `age` in descending order\n * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);\n * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n */\n function sortByOrder(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (guard && isIterateeCall(iteratees, orders, guard)) {\n orders = undefined;\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseSortByOrder(collection, iteratees, orders);\n }\n\n /**\n * Performs a deep comparison between each element in `collection` and the\n * source object, returning an array of all elements that have equivalent\n * property values.\n *\n * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n * numbers, `Object` objects, regexes, and strings. Objects are compared by\n * their own, not inherited, enumerable properties. For comparing a single\n * own or inherited property value see `_.matchesProperty`.\n *\n * @static\n * @memberOf _\n * @category Collection\n * @param {Array|Object|string} collection The collection to search.\n * @param {Object} source The object of property values to match.\n * @returns {Array} Returns the new filtered array.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },\n * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }\n * ];\n *\n * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');\n * // => ['barney']\n *\n * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');\n * // => ['fred']\n */\n function where(collection, source) {\n return filter(collection, baseMatches(source));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the number of milliseconds that have elapsed since the Unix epoch\n * (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @category Date\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => logs the number of milliseconds it took for the deferred function to be invoked\n */\n var now = nativeNow || function() {\n return new Date().getTime();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => logs 'done saving!' after the two async saves have completed\n */\n function after(n, func) {\n if (typeof func != 'function') {\n if (typeof n == 'function') {\n var temp = n;\n n = func;\n func = temp;\n } else {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n }\n n = nativeIsFinite(n = +n) ? n : 0;\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that accepts up to `n` arguments ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Function} Returns the new function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n if (guard && isIterateeCall(func, n, guard)) {\n n = undefined;\n }\n n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);\n return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery('#add').on('click', _.before(5, addContactToList));\n * // => allows adding up to 4 contacts to the list\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n if (typeof n == 'function') {\n var temp = n;\n n = func;\n func = temp;\n } else {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n }\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and prepends any additional `_.bind` arguments to those provided to the\n * bound function.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind` this method does not set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var greet = function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * };\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // using placeholders\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = restParam(function(func, thisArg, partials) {\n var bitmask = BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, bind.placeholder);\n bitmask |= PARTIAL_FLAG;\n }\n return createWrapper(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Binds methods of an object to the object itself, overwriting the existing\n * method. Method names may be specified as individual arguments or as arrays\n * of method names. If no method names are provided all enumerable function\n * properties, own and inherited, of `object` are bound.\n *\n * **Note:** This method does not set the \"length\" property of bound functions.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Object} object The object to bind and assign the bound methods to.\n * @param {...(string|string[])} [methodNames] The object method names to bind,\n * specified as individual method names or arrays of method names.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var view = {\n * 'label': 'docs',\n * 'onClick': function() {\n * console.log('clicked ' + this.label);\n * }\n * };\n *\n * _.bindAll(view);\n * jQuery('#docs').on('click', view.onClick);\n * // => logs 'clicked docs' when the element is clicked\n */\n var bindAll = restParam(function(object, methodNames) {\n methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);\n\n var index = -1,\n length = methodNames.length;\n\n while (++index < length) {\n var key = methodNames[index];\n object[key] = createWrapper(object[key], BIND_FLAG, object);\n }\n return object;\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` and prepends\n * any additional `_.bindKey` arguments to those provided to the bound function.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist.\n * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Object} object The object the method belongs to.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // using placeholders\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = restParam(function(object, key, partials) {\n var bitmask = BIND_FLAG | BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, bindKey.placeholder);\n bitmask |= PARTIAL_FLAG;\n }\n return createWrapper(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts one or more arguments of `func` that when\n * called either invokes `func` returning its result, if all `func` arguments\n * have been provided, or returns a function that accepts one or more of the\n * remaining `func` arguments, and so on. The arity of `func` may be specified\n * if `func.length` is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method does not set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // using placeholders\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n var curry = createCurry(CURRY_FLAG);\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method does not set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // using placeholders\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n var curryRight = createCurry(CURRY_RIGHT_FLAG);\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed invocations. Provide an options object to indicate that `func`\n * should be invoked on the leading and/or trailing edge of the `wait` timeout.\n * Subsequent calls to the debounced function return the result of the last\n * `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=false] Specify invoking on the leading\n * edge of the timeout.\n * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n * delayed before it's invoked.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // avoid costly calculations while the window size is in flux\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // invoke `sendMail` when the click event is fired, debouncing subsequent calls\n * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // ensure `batchLog` is invoked once after 1 second of debounced calls\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', _.debounce(batchLog, 250, {\n * 'maxWait': 1000\n * }));\n *\n * // cancel a debounced call\n * var todoChanges = _.debounce(batchLog, 1000);\n * Object.observe(models.todo, todoChanges);\n *\n * Object.observe(models, function(changes) {\n * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {\n * todoChanges.cancel();\n * }\n * }, ['delete']);\n *\n * // ...at some point `models.todo` is changed\n * models.todo.completed = true;\n *\n * // ...before 1 second has passed `models.todo` is deleted\n * // which cancels the debounced `todoChanges` call\n * delete models.todo;\n */\n function debounce(func, wait, options) {\n var args,\n maxTimeoutId,\n result,\n stamp,\n thisArg,\n timeoutId,\n trailingCall,\n lastCalled = 0,\n maxWait = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = wait < 0 ? 0 : (+wait || 0);\n if (options === true) {\n var leading = true;\n trailing = false;\n } else if (isObject(options)) {\n leading = !!options.leading;\n maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n lastCalled = 0;\n maxTimeoutId = timeoutId = trailingCall = undefined;\n }\n\n function complete(isCalled, id) {\n if (id) {\n clearTimeout(id);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (isCalled) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTimeoutId) {\n args = thisArg = undefined;\n }\n }\n }\n\n function delayed() {\n var remaining = wait - (now() - stamp);\n if (remaining <= 0 || remaining > wait) {\n complete(trailingCall, maxTimeoutId);\n } else {\n timeoutId = setTimeout(delayed, remaining);\n }\n }\n\n function maxDelayed() {\n complete(trailing, timeoutId);\n }\n\n function debounced() {\n args = arguments;\n stamp = now();\n thisArg = this;\n trailingCall = trailing && (timeoutId || !leading);\n\n if (maxWait === false) {\n var leadingCall = leading && !timeoutId;\n } else {\n if (!maxTimeoutId && !leading) {\n lastCalled = stamp;\n }\n var remaining = maxWait - (stamp - lastCalled),\n isCalled = remaining <= 0 || remaining > maxWait;\n\n if (isCalled) {\n if (maxTimeoutId) {\n maxTimeoutId = clearTimeout(maxTimeoutId);\n }\n lastCalled = stamp;\n result = func.apply(thisArg, args);\n }\n else if (!maxTimeoutId) {\n maxTimeoutId = setTimeout(maxDelayed, remaining);\n }\n }\n if (isCalled && timeoutId) {\n timeoutId = clearTimeout(timeoutId);\n }\n else if (!timeoutId && wait !== maxWait) {\n timeoutId = setTimeout(delayed, wait);\n }\n if (leadingCall) {\n isCalled = true;\n result = func.apply(thisArg, args);\n }\n if (isCalled && !timeoutId && !maxTimeoutId) {\n args = thisArg = undefined;\n }\n return result;\n }\n debounced.cancel = cancel;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke the function with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // logs 'deferred' after one or more milliseconds\n */\n var defer = restParam(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke the function with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => logs 'later' after one second\n */\n var delay = restParam(function(func, wait, args) {\n return baseDelay(func, wait, args);\n });\n\n /**\n * Creates a function that returns the result of invoking the provided\n * functions with the `this` binding of the created function, where each\n * successive invocation is supplied the return value of the previous.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {...Function} [funcs] Functions to invoke.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flow(_.add, square);\n * addSquare(1, 2);\n * // => 9\n */\n var flow = createFlow();\n\n /**\n * This method is like `_.flow` except that it creates a function that\n * invokes the provided functions from right to left.\n *\n * @static\n * @memberOf _\n * @alias backflow, compose\n * @category Function\n * @param {...Function} [funcs] Functions to invoke.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flowRight(square, _.add);\n * addSquare(1, 2);\n * // => 9\n */\n var flowRight = createFlow(true);\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is coerced to a string and used as the\n * cache key. The `func` is invoked with the `this` binding of the memoized\n * function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoizing function.\n * @example\n *\n * var upperCase = _.memoize(function(string) {\n * return string.toUpperCase();\n * });\n *\n * upperCase('fred');\n * // => 'FRED'\n *\n * // modifying the result cache\n * upperCase.cache.set('fred', 'BARNEY');\n * upperCase('fred');\n * // => 'BARNEY'\n *\n * // replacing `_.memoize.Cache`\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'barney' };\n * var identity = _.memoize(_.identity);\n *\n * identity(object);\n * // => { 'user': 'fred' }\n * identity(other);\n * // => { 'user': 'fred' }\n *\n * _.memoize.Cache = WeakMap;\n * var identity = _.memoize(_.identity);\n *\n * identity(object);\n * // => { 'user': 'fred' }\n * identity(other);\n * // => { 'user': 'barney' }\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new memoize.Cache;\n return memoized;\n }\n\n /**\n * Creates a function that runs each argument through a corresponding\n * transform function.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms] The functions to transform\n * arguments, specified as individual functions or arrays of functions.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var modded = _.modArgs(function(x, y) {\n * return [x, y];\n * }, square, doubled);\n *\n * modded(1, 2);\n * // => [1, 4]\n *\n * modded(5, 10);\n * // => [25, 20]\n */\n var modArgs = restParam(function(func, transforms) {\n transforms = baseFlatten(transforms);\n if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = transforms.length;\n return restParam(function(args) {\n var index = nativeMin(args.length, length);\n while (index--) {\n args[index] = transforms[index](args[index]);\n }\n return func.apply(this, args);\n });\n });\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n return !predicate.apply(this, arguments);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first call. The `func` is invoked\n * with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // `initialize` invokes `createApplication` once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with `partial` arguments prepended\n * to those provided to the new function. This method is like `_.bind` except\n * it does **not** alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method does not set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * var greet = function(greeting, name) {\n * return greeting + ' ' + name;\n * };\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // using placeholders\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = createPartial(PARTIAL_FLAG);\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to those provided to the new function.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method does not set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * var greet = function(greeting, name) {\n * return greeting + ' ' + name;\n * };\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // using placeholders\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = createPartial(PARTIAL_RIGHT_FLAG);\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified indexes where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes,\n * specified as individual indexes or arrays of indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, 2, 0, 1);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n *\n * var map = _.rearg(_.map, [1, 0]);\n * map(function(n) {\n * return n * 3;\n * }, [1, 2, 3]);\n * // => [3, 6, 9]\n */\n var rearg = restParam(function(func, indexes) {\n return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.restParam(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function restParam(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n rest = Array(length);\n\n while (++index < length) {\n rest[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, args[0], rest);\n case 2: return func.call(this, args[0], args[1], rest);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = rest;\n return func.apply(this, otherArgs);\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the created\n * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).\n *\n * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/Web/JavaScript/Reference/Operators/Spread_operator).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * // with a Promise\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function(array) {\n return func.apply(this, array);\n };\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed invocations. Provide an options object to indicate\n * that `func` should be invoked on the leading and/or trailing edge of the\n * `wait` timeout. Subsequent calls to the throttled function return the\n * result of the last `func` call.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the throttled function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=true] Specify invoking on the leading\n * edge of the timeout.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // avoid excessively updating the position while scrolling\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes\n * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {\n * 'trailing': false\n * }));\n *\n * // cancel a trailing throttled call\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (options === false) {\n leading = false;\n } else if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });\n }\n\n /**\n * Creates a function that provides `value` to the wrapper function as its\n * first argument. Any additional arguments provided to the function are\n * appended to those provided to the wrapper function. The wrapper is invoked\n * with the `this` binding of the created function.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} wrapper The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '<p>' + func(text) + '</p>';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '<p>fred, barney, & pebbles</p>'\n */\n function wrap(value, wrapper) {\n wrapper = wrapper == null ? identity : wrapper;\n return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,\n * otherwise they are assigned by reference. If `customizer` is provided it's\n * invoked to produce the cloned values. If `customizer` returns `undefined`\n * cloning is handled by the method instead. The `customizer` is bound to\n * `thisArg` and invoked with up to three argument; (value [, index|key, object]).\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).\n * The enumerable properties of `arguments` objects and objects created by\n * constructors other than `Object` are cloned to plain `Object` objects. An\n * empty object is returned for uncloneable values such as functions, DOM nodes,\n * Maps, Sets, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {Function} [customizer] The function to customize cloning values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {*} Returns the cloned value.\n * @example\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * var shallow = _.clone(users);\n * shallow[0] === users[0];\n * // => true\n *\n * var deep = _.clone(users, true);\n * deep[0] === users[0];\n * // => false\n *\n * // using a customizer callback\n * var el = _.clone(document.body, function(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * });\n *\n * el === document.body\n * // => false\n * el.nodeName\n * // => BODY\n * el.childNodes.length;\n * // => 0\n */\n function clone(value, isDeep, customizer, thisArg) {\n if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {\n isDeep = false;\n }\n else if (typeof isDeep == 'function') {\n thisArg = customizer;\n customizer = isDeep;\n isDeep = false;\n }\n return typeof customizer == 'function'\n ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 3))\n : baseClone(value, isDeep);\n }\n\n /**\n * Creates a deep clone of `value`. If `customizer` is provided it's invoked\n * to produce the cloned values. If `customizer` returns `undefined` cloning\n * is handled by the method instead. The `customizer` is bound to `thisArg`\n * and invoked with up to three argument; (value [, index|key, object]).\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).\n * The enumerable properties of `arguments` objects and objects created by\n * constructors other than `Object` are cloned to plain `Object` objects. An\n * empty object is returned for uncloneable values such as functions, DOM nodes,\n * Maps, Sets, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to deep clone.\n * @param {Function} [customizer] The function to customize cloning values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {*} Returns the deep cloned value.\n * @example\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * var deep = _.cloneDeep(users);\n * deep[0] === users[0];\n * // => false\n *\n * // using a customizer callback\n * var el = _.cloneDeep(document.body, function(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * });\n *\n * el === document.body\n * // => false\n * el.nodeName\n * // => BODY\n * el.childNodes.length;\n * // => 20\n */\n function cloneDeep(value, customizer, thisArg) {\n return typeof customizer == 'function'\n ? baseClone(value, true, bindCallback(customizer, thisArg, 3))\n : baseClone(value, true);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n function gt(value, other) {\n return value > other;\n }\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n function gte(value, other) {\n return value >= other;\n }\n\n /**\n * Checks if `value` is classified as an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n function isArguments(value) {\n return isObjectLike(value) && isArrayLike(value) &&\n hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');\n }\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(function() { return arguments; }());\n * // => false\n */\n var isArray = nativeIsArray || function(value) {\n return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n };\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);\n }\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n function isDate(value) {\n return isObjectLike(value) && objToString.call(value) == dateTag;\n }\n\n /**\n * Checks if `value` is a DOM element.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('<body>');\n * // => false\n */\n function isElement(value) {\n return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is empty. A value is considered empty unless it's an\n * `arguments` object, array, string, or jQuery-like collection with a length\n * greater than `0` or an object with own enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {Array|Object|string} value The value to inspect.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||\n (isObjectLike(value) && isFunction(value.splice)))) {\n return !value.length;\n }\n return !keys(value).length;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent. If `customizer` is provided it's invoked to compare values.\n * If `customizer` returns `undefined` comparisons are handled by the method\n * instead. The `customizer` is bound to `thisArg` and invoked with up to\n * three arguments: (value, other [, index|key]).\n *\n * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n * numbers, `Object` objects, regexes, and strings. Objects are compared by\n * their own, not inherited, enumerable properties. Functions and DOM nodes\n * are **not** supported. Provide a customizer function to extend support\n * for comparing other values.\n *\n * @static\n * @memberOf _\n * @alias eq\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize value comparisons.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * object == other;\n * // => false\n *\n * _.isEqual(object, other);\n * // => true\n *\n * // using a customizer callback\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqual(array, other, function(value, other) {\n * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {\n * return true;\n * }\n * });\n * // => true\n */\n function isEqual(value, other, customizer, thisArg) {\n customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(10);\n * // => true\n *\n * _.isFinite('10');\n * // => false\n *\n * _.isFinite(true);\n * // => false\n *\n * _.isFinite(Object(10));\n * // => false\n *\n * _.isFinite(Infinity);\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in older versions of Chrome and Safari which return 'function' for regexes\n // and Safari 8 which returns 'object' for typed array constructors.\n return isObject(value) && objToString.call(value) == funcTag;\n }\n\n /**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(1);\n * // => false\n */\n function isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }\n\n /**\n * Performs a deep comparison between `object` and `source` to determine if\n * `object` contains equivalent property values. If `customizer` is provided\n * it's invoked to compare values. If `customizer` returns `undefined`\n * comparisons are handled by the method instead. The `customizer` is bound\n * to `thisArg` and invoked with three arguments: (value, other, index|key).\n *\n * **Note:** This method supports comparing properties of arrays, booleans,\n * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions\n * and DOM nodes are **not** supported. Provide a customizer function to extend\n * support for comparing other values.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize value comparisons.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.isMatch(object, { 'age': 40 });\n * // => true\n *\n * _.isMatch(object, { 'age': 36 });\n * // => false\n *\n * // using a customizer callback\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatch(object, source, function(value, other) {\n * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;\n * });\n * // => true\n */\n function isMatch(object, source, customizer, thisArg) {\n customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;\n return baseIsMatch(object, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)\n * which returns `true` for `undefined` and other non-numeric values.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some host objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a native function.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (value == null) {\n return false;\n }\n if (isFunction(value)) {\n return reIsNative.test(fnToString.call(value));\n }\n return isObjectLike(value) && reIsHostCtor.test(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n * as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isNumber(8.4);\n * // => true\n *\n * _.isNumber(NaN);\n * // => true\n *\n * _.isNumber('8.4');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * **Note:** This method assumes objects created by the `Object` constructor\n * have no inherited enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n var Ctor;\n\n // Exit early for non `Object` objects.\n if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||\n (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n return false;\n }\n // IE < 9 iterates inherited properties before own properties. If the first\n // iterated property is an object's own property then there are no inherited\n // enumerable properties.\n var result;\n // In most environments an object's own properties are iterated before\n // its inherited properties. If the last iterated property is an object's\n // own property then there are no inherited enumerable properties.\n baseForIn(value, function(subValue, key) {\n result = key;\n });\n return result === undefined || hasOwnProperty.call(value, result);\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n function isRegExp(value) {\n return isObject(value) && objToString.call(value) == regexpTag;\n }\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n function isTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n }\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n function lt(value, other) {\n return value < other;\n }\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n function lte(value, other) {\n return value <= other;\n }\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * (function() {\n * return _.toArray(arguments).slice(1);\n * }(1, 2, 3));\n * // => [2, 3]\n */\n function toArray(value) {\n var length = value ? getLength(value) : 0;\n if (!isLength(length)) {\n return values(value);\n }\n if (!length) {\n return [];\n }\n return arrayCopy(value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable\n * properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return baseCopy(value, keysIn(value));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Recursively merges own enumerable properties of the source object(s), that\n * don't resolve to `undefined` into the destination object. Subsequent sources\n * overwrite property assignments of previous sources. If `customizer` is\n * provided it's invoked to produce the merged values of the destination and\n * source properties. If `customizer` returns `undefined` merging is handled\n * by the method instead. The `customizer` is bound to `thisArg` and invoked\n * with five arguments: (objectValue, sourceValue, key, object, source).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var users = {\n * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n * };\n *\n * var ages = {\n * 'data': [{ 'age': 36 }, { 'age': 40 }]\n * };\n *\n * _.merge(users, ages);\n * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n *\n * // using a customizer callback\n * var object = {\n * 'fruits': ['apple'],\n * 'vegetables': ['beet']\n * };\n *\n * var other = {\n * 'fruits': ['banana'],\n * 'vegetables': ['carrot']\n * };\n *\n * _.merge(object, other, function(a, b) {\n * if (_.isArray(a)) {\n * return a.concat(b);\n * }\n * });\n * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n */\n var merge = createAssigner(baseMerge);\n\n /**\n * Assigns own enumerable properties of source object(s) to the destination\n * object. Subsequent sources overwrite property assignments of previous sources.\n * If `customizer` is provided it's invoked to produce the assigned values.\n * The `customizer` is bound to `thisArg` and invoked with five arguments:\n * (objectValue, sourceValue, key, object, source).\n *\n * **Note:** This method mutates `object` and is based on\n * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).\n *\n * @static\n * @memberOf _\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {*} [thisArg] The `this` binding of `customizer`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });\n * // => { 'user': 'fred', 'age': 40 }\n *\n * // using a customizer callback\n * var defaults = _.partialRight(_.assign, function(value, other) {\n * return _.isUndefined(value) ? other : value;\n * });\n *\n * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n * // => { 'user': 'barney', 'age': 36 }\n */\n var assign = createAssigner(function(object, source, customizer) {\n return customizer\n ? assignWith(object, source, customizer)\n : baseAssign(object, source);\n });\n\n /**\n * Creates an object that inherits from the given `prototype` object. If a\n * `properties` object is provided its own enumerable properties are assigned\n * to the created object.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties, guard) {\n var result = baseCreate(prototype);\n if (guard && isIterateeCall(prototype, properties, guard)) {\n properties = undefined;\n }\n return properties ? baseAssign(result, properties) : result;\n }\n\n /**\n * Assigns own enumerable properties of source object(s) to the destination\n * object for all destination properties that resolve to `undefined`. Once a\n * property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n * // => { 'user': 'barney', 'age': 36 }\n */\n var defaults = createDefaults(assign, assignDefaults);\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });\n * // => { 'user': { 'name': 'barney', 'age': 36 } }\n *\n */\n var defaultsDeep = createDefaults(merge, mergeDefaults);\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {string|undefined} Returns the key of the matched element, else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(chr) {\n * return chr.age < 40;\n * });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // using the `_.matches` callback shorthand\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.findKey(users, 'active', false);\n * // => 'fred'\n *\n * // using the `_.property` callback shorthand\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n var findKey = createFindKey(baseForOwn);\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * If a property name is provided for `predicate` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `predicate` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to search.\n * @param {Function|Object|string} [predicate=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {string|undefined} Returns the key of the matched element, else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(chr) {\n * return chr.age < 40;\n * });\n * // => returns `pebbles` assuming `_.findKey` returns `barney`\n *\n * // using the `_.matches` callback shorthand\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // using the `_.matchesProperty` callback shorthand\n * _.findLastKey(users, 'active', false);\n * // => 'fred'\n *\n * // using the `_.property` callback shorthand\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n var findLastKey = createFindKey(baseForOwnRight);\n\n /**\n * Iterates over own and inherited enumerable properties of an object invoking\n * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)\n */\n var forIn = createForIn(baseFor);\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'\n */\n var forInRight = createForIn(baseForRight);\n\n /**\n * Iterates over own enumerable properties of an object invoking `iteratee`\n * for each property. The `iteratee` is bound to `thisArg` and invoked with\n * three arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'a' and 'b' (iteration order is not guaranteed)\n */\n var forOwn = createForOwn(baseForOwn);\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'\n */\n var forOwnRight = createForOwn(baseForOwnRight);\n\n /**\n * Creates an array of function property names from all enumerable properties,\n * own and inherited, of `object`.\n *\n * @static\n * @memberOf _\n * @alias methods\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the new array of property names.\n * @example\n *\n * _.functions(_);\n * // => ['after', 'ary', 'assign', ...]\n */\n function functions(object) {\n return baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the property value at `path` of `object`. If the resolved value is\n * `undefined` the `defaultValue` is used in its place.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, toPath(path), (path + ''));\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': { 'c': 3 } } };\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b.c');\n * // => true\n *\n * _.has(object, ['a', 'b', 'c']);\n * // => true\n */\n function has(object, path) {\n if (object == null) {\n return false;\n }\n var result = hasOwnProperty.call(object, path);\n if (!result && !isKey(path)) {\n path = toPath(path);\n object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n if (object == null) {\n return false;\n }\n path = last(path);\n result = hasOwnProperty.call(object, path);\n }\n return result || (isLength(object.length) && isIndex(path, object.length) &&\n (isArray(object) || isArguments(object)));\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite property\n * assignments of previous values unless `multiValue` is `true`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to invert.\n * @param {boolean} [multiValue] Allow multiple values per key.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n *\n * // with `multiValue`\n * _.invert(object, true);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function invert(object, multiValue, guard) {\n if (guard && isIterateeCall(object, multiValue, guard)) {\n multiValue = undefined;\n }\n var index = -1,\n props = keys(object),\n length = props.length,\n result = {};\n\n while (++index < length) {\n var key = props[index],\n value = object[key];\n\n if (multiValue) {\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }\n else {\n result[value] = key;\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n var keys = !nativeKeys ? shimKeys : function(object) {\n var Ctor = object == null ? undefined : object.constructor;\n if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n (typeof object != 'function' && isArrayLike(object))) {\n return shimKeys(object);\n }\n return isObject(object) ? nativeKeys(object) : [];\n };\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n if (object == null) {\n return [];\n }\n if (!isObject(object)) {\n object = Object(object);\n }\n var length = object.length;\n length = (length && isLength(length) &&\n (isArray(object) || isArguments(object)) && length) || 0;\n\n var Ctor = object.constructor,\n index = -1,\n isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n result = Array(length),\n skipIndexes = length > 0;\n\n while (++index < length) {\n result[index] = (index + '');\n }\n for (var key in object) {\n if (!(skipIndexes && isIndex(key, length)) &&\n !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * property of `object` through `iteratee`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the new mapped object.\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n var mapKeys = createObjectMapper(true);\n\n /**\n * Creates an object with the same keys as `object` and values generated by\n * running each own enumerable property of `object` through `iteratee`. The\n * iteratee function is bound to `thisArg` and invoked with three arguments:\n * (value, key, object).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n * per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Object} Returns the new mapped object.\n * @example\n *\n * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {\n * return n * 3;\n * });\n * // => { 'a': 3, 'b': 6 }\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * // using the `_.property` callback shorthand\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n var mapValues = createObjectMapper();\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable properties of `object` that are not omitted.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n * iteration or property names to omit, specified as individual property\n * names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.omit(object, 'age');\n * // => { 'user': 'fred' }\n *\n * _.omit(object, _.isNumber);\n * // => { 'user': 'fred' }\n */\n var omit = restParam(function(object, props) {\n if (object == null) {\n return {};\n }\n if (typeof props[0] != 'function') {\n var props = arrayMap(baseFlatten(props), String);\n return pickByArray(object, baseDifference(keysIn(object), props));\n }\n var predicate = bindCallback(props[0], props[1], 3);\n return pickByCallback(object, function(value, key, object) {\n return !predicate(value, key, object);\n });\n });\n\n /**\n * Creates a two dimensional array of the key-value pairs for `object`,\n * e.g. `[[key1, value1], [key2, value2]]`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the new array of key-value pairs.\n * @example\n *\n * _.pairs({ 'barney': 36, 'fred': 40 });\n * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)\n */\n function pairs(object) {\n object = toObject(object);\n\n var index = -1,\n props = keys(object),\n length = props.length,\n result = Array(length);\n\n while (++index < length) {\n var key = props[index];\n result[index] = [key, object[key]];\n }\n return result;\n }\n\n /**\n * Creates an object composed of the picked `object` properties. Property\n * names may be specified as individual arguments or as arrays of property\n * names. If `predicate` is provided it's invoked for each property of `object`\n * picking the properties `predicate` returns truthy for. The predicate is\n * bound to `thisArg` and invoked with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {Function|...(string|string[])} [predicate] The function invoked per\n * iteration or property names to pick, specified as individual property\n * names or arrays of property names.\n * @param {*} [thisArg] The `this` binding of `predicate`.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'user': 'fred', 'age': 40 };\n *\n * _.pick(object, 'user');\n * // => { 'user': 'fred' }\n *\n * _.pick(object, _.isString);\n * // => { 'user': 'fred' }\n */\n var pick = restParam(function(object, props) {\n if (object == null) {\n return {};\n }\n return typeof props[0] == 'function'\n ? pickByCallback(object, bindCallback(props[0], props[1], 3))\n : pickByArray(object, baseFlatten(props));\n });\n\n /**\n * This method is like `_.get` except that if the resolved value is a function\n * it's invoked with the `this` binding of its parent object and its result\n * is returned.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a.b.c', 'default');\n * // => 'default'\n *\n * _.result(object, 'a.b.c', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n var result = object == null ? undefined : object[path];\n if (result === undefined) {\n if (object != null && !isKey(path, object)) {\n path = toPath(path);\n object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n result = object == null ? undefined : object[last(path)];\n }\n result = result === undefined ? defaultValue : result;\n }\n return isFunction(result) ? result.call(object) : result;\n }\n\n /**\n * Sets the property value of `path` on `object`. If a portion of `path`\n * does not exist it's created.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to augment.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, 'x[0].y.z', 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n if (object == null) {\n return object;\n }\n var pathKey = (path + '');\n path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = path[index];\n if (isObject(nested)) {\n if (index == lastIndex) {\n nested[key] = value;\n } else if (nested[key] == null) {\n nested[key] = isIndex(path[index + 1]) ? [] : {};\n }\n }\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own enumerable\n * properties through `iteratee`, with each invocation potentially mutating\n * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked\n * with four arguments: (accumulator, value, key, object). Iteratee functions\n * may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Array|Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * });\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {\n * result[key] = n * 3;\n * });\n * // => { 'a': 3, 'b': 6 }\n */\n function transform(object, iteratee, accumulator, thisArg) {\n var isArr = isArray(object) || isTypedArray(object);\n iteratee = getCallback(iteratee, thisArg, 4);\n\n if (accumulator == null) {\n if (isArr || isObject(object)) {\n var Ctor = object.constructor;\n if (isArr) {\n accumulator = isArray(object) ? new Ctor : [];\n } else {\n accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);\n }\n } else {\n accumulator = {};\n }\n }\n (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Creates an array of the own enumerable property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable property values\n * of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Checks if `n` is between `start` and up to but not including, `end`. If\n * `end` is not specified it's set to `start` with `start` then set to `0`.\n *\n * @static\n * @memberOf _\n * @category Number\n * @param {number} n The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `n` is in the range, else `false`.\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n */\n function inRange(value, start, end) {\n start = +start || 0;\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = +end || 0;\n }\n return value >= nativeMin(start, end) && value < nativeMax(start, end);\n }\n\n /**\n * Produces a random number between `min` and `max` (inclusive). If only one\n * argument is provided a number between `0` and the given number is returned.\n * If `floating` is `true`, or either `min` or `max` are floats, a floating-point\n * number is returned instead of an integer.\n *\n * @static\n * @memberOf _\n * @category Number\n * @param {number} [min=0] The minimum possible value.\n * @param {number} [max=1] The maximum possible value.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(min, max, floating) {\n if (floating && isIterateeCall(min, max, floating)) {\n max = floating = undefined;\n }\n var noMin = min == null,\n noMax = max == null;\n\n if (floating == null) {\n if (noMax && typeof min == 'boolean') {\n floating = min;\n min = 1;\n }\n else if (typeof max == 'boolean') {\n floating = max;\n noMax = true;\n }\n }\n if (noMin && noMax) {\n max = 1;\n noMax = false;\n }\n min = +min || 0;\n if (noMax) {\n max = min;\n min = 0;\n } else {\n max = +max || 0;\n }\n if (floating || min % 1 || max % 1) {\n var rand = nativeRandom();\n return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);\n }\n return baseRandom(min, max);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar');\n * // => 'fooBar'\n *\n * _.camelCase('__foo_bar__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);\n });\n\n /**\n * Capitalizes the first character of `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('fred');\n * // => 'Fred'\n */\n function capitalize(string) {\n string = baseToString(string);\n return string && (string.charAt(0).toUpperCase() + string.slice(1));\n }\n\n /**\n * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = baseToString(string);\n return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to search.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search from.\n * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = baseToString(string);\n target = (target + '');\n\n var length = string.length;\n position = position === undefined\n ? length\n : nativeMin(position < 0 ? 0 : (+position || 0), length);\n\n position -= target.length;\n return position >= 0 && string.indexOf(target, position) == position;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\", in `string` to\n * their corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional characters\n * use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value.\n * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * Backticks are escaped because in Internet Explorer < 9, they can break out\n * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n * for more details.\n *\n * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n * to reduce XSS vectors.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n // Reset `lastIndex` because in IE < 9 `String#replace` does not.\n string = baseToString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"\\\", \"/\", \"^\", \"$\", \".\", \"|\", \"?\",\n * \"*\", \"+\", \"(\", \")\", \"[\", \"]\", \"{\" and \"}\" in `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https:\\/\\/lodash\\.com\\/\\)'\n */\n function escapeRegExp(string) {\n string = baseToString(string);\n return (string && reHasRegExpChars.test(string))\n ? string.replace(reRegExpChars, escapeRegExpChar)\n : (string || '(?:)');\n }\n\n /**\n * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__foo_bar__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = baseToString(string);\n length = +length;\n\n var strLength = string.length;\n if (strLength >= length || !nativeIsFinite(length)) {\n return string;\n }\n var mid = (length - strLength) / 2,\n leftLength = nativeFloor(mid),\n rightLength = nativeCeil(mid);\n\n chars = createPadding('', rightLength, chars);\n return chars.slice(0, leftLength) + string + chars;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padLeft('abc', 6);\n * // => ' abc'\n *\n * _.padLeft('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padLeft('abc', 3);\n * // => 'abc'\n */\n var padLeft = createPadDir();\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padRight('abc', 6);\n * // => 'abc '\n *\n * _.padRight('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padRight('abc', 3);\n * // => 'abc'\n */\n var padRight = createPadDir(true);\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,\n * in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)\n * of `parseInt`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.\n // Chrome fails to trim leading <BOM> whitespace characters.\n // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.\n if (guard ? isIterateeCall(string, radix, guard) : radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n string = trim(string);\n return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=0] The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n) {\n var result = '';\n string = baseToString(string);\n n = +n;\n if (n < 1 || !string || !nativeIsFinite(n)) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n string += string;\n } while (n);\n\n return result;\n }\n\n /**\n * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--foo-bar');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__foo_bar__');\n * // => 'Foo Bar'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to search.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = baseToString(string);\n position = position == null\n ? 0\n : nativeMin(position < 0 ? 0 : (+position || 0), string.length);\n\n return string.lastIndexOf(target, position) == position;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is provided it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options] The options object.\n * @param {RegExp} [options.escape] The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate] The \"evaluate\" delimiter.\n * @param {Object} [options.imports] An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate] The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.\n * @param {string} [options.variable] The data object variable name.\n * @param- {Object} [otherOptions] Enables the legacy `options` param signature.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // using the \"interpolate\" delimiter to create a compiled template\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // using the HTML \"escape\" delimiter to escape data property values\n * var compiled = _.template('<b><%- value %></b>');\n * compiled({ 'value': '<script>' });\n * // => '<b><script></b>'\n *\n * // using the \"evaluate\" delimiter to execute JavaScript and generate HTML\n * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // using the internal `print` function in \"evaluate\" delimiters\n * var compiled = _.template('<% print(\"hello \" + user); %>!');\n * compiled({ 'user': 'barney' });\n * // => 'hello barney!'\n *\n * // using the ES delimiter as an alternative to the default \"interpolate\" delimiter\n * var compiled = _.template('hello ${ user }!');\n * compiled({ 'user': 'pebbles' });\n * // => 'hello pebbles!'\n *\n * // using custom template delimiters\n * _.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g;\n * var compiled = _.template('hello {{ user }}!');\n * compiled({ 'user': 'mustache' });\n * // => 'hello mustache!'\n *\n * // using backslashes to treat delimiters as plain text\n * var compiled = _.template('<%= \"\\\\<%- value %\\\\>\" %>');\n * compiled({ 'value': 'ignored' });\n * // => '<%- value %>'\n *\n * // using the `imports` option to import `jQuery` as `jq`\n * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';\n * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // using the `sourceURL` option to specify a custom sourceURL for the template\n * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });\n * compiled(data);\n * // => find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector\n *\n * // using the `variable` option to ensure a with-statement isn't used in the compiled template\n * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });\n * compiled.source;\n * // => function(data) {\n * // var __t, __p = '';\n * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';\n * // return __p;\n * // }\n *\n * // using the `source` property to inline compiled templates for meaningful\n * // line numbers in error messages and a stack trace\n * fs.writeFileSync(path.join(cwd, 'jst.js'), '\\\n * var JST = {\\\n * \"main\": ' + _.template(mainText).source + '\\\n * };\\\n * ');\n */\n function template(string, options, otherOptions) {\n // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)\n // and Laura Doktorova's doT.js (https://github.com/olado/doT).\n var settings = lodash.templateSettings;\n\n if (otherOptions && isIterateeCall(string, options, otherOptions)) {\n options = otherOptions = undefined;\n }\n string = baseToString(string);\n options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);\n\n var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),\n importsKeys = keys(imports),\n importsValues = baseValues(imports, importsKeys);\n\n var isEscaping,\n isEvaluating,\n index = 0,\n interpolate = options.interpolate || reNoMatch,\n source = \"__p += '\";\n\n // Compile the regexp to match each delimiter.\n var reDelimiters = RegExp(\n (options.escape || reNoMatch).source + '|' +\n interpolate.source + '|' +\n (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +\n (options.evaluate || reNoMatch).source + '|$'\n , 'g');\n\n // Use a sourceURL for easier debugging.\n var sourceURL = '//# sourceURL=' +\n ('sourceURL' in options\n ? options.sourceURL\n : ('lodash.templateSources[' + (++templateCounter) + ']')\n ) + '\\n';\n\n string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {\n interpolateValue || (interpolateValue = esTemplateValue);\n\n // Escape characters that can't be included in string literals.\n source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);\n\n // Replace delimiters with snippets.\n if (escapeValue) {\n isEscaping = true;\n source += \"' +\\n__e(\" + escapeValue + \") +\\n'\";\n }\n if (evaluateValue) {\n isEvaluating = true;\n source += \"';\\n\" + evaluateValue + \";\\n__p += '\";\n }\n if (interpolateValue) {\n source += \"' +\\n((__t = (\" + interpolateValue + \")) == null ? '' : __t) +\\n'\";\n }\n index = offset + match.length;\n\n // The JS engine embedded in Adobe products requires returning the `match`\n // string in order to produce the correct `offset` value.\n return match;\n });\n\n source += \"';\\n\";\n\n // If `variable` is not specified wrap a with-statement around the generated\n // code to add the data object to the top of the scope chain.\n var variable = options.variable;\n if (!variable) {\n source = 'with (obj) {\\n' + source + '\\n}\\n';\n }\n // Cleanup code by stripping empty strings.\n source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)\n .replace(reEmptyStringMiddle, '$1')\n .replace(reEmptyStringTrailing, '$1;');\n\n // Frame code as the function body.\n source = 'function(' + (variable || 'obj') + ') {\\n' +\n (variable\n ? ''\n : 'obj || (obj = {});\\n'\n ) +\n \"var __t, __p = ''\" +\n (isEscaping\n ? ', __e = _.escape'\n : ''\n ) +\n (isEvaluating\n ? ', __j = Array.prototype.join;\\n' +\n \"function print() { __p += __j.call(arguments, '') }\\n\"\n : ';\\n'\n ) +\n source +\n 'return __p\\n}';\n\n var result = attempt(function() {\n return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);\n });\n\n // Provide the compiled function's source by its `toString` method or\n // the `source` property as a convenience for inlining compiled templates.\n result.source = source;\n if (isError(result)) {\n throw result;\n }\n return result;\n }\n\n /**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\n function trim(string, chars, guard) {\n var value = string;\n string = baseToString(string);\n if (!string) {\n return string;\n }\n if (guard ? isIterateeCall(value, chars, guard) : chars == null) {\n return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);\n }\n chars = (chars + '');\n return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);\n }\n\n /**\n * Removes leading whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trimLeft(' abc ');\n * // => 'abc '\n *\n * _.trimLeft('-_-abc-_-', '_-');\n * // => 'abc-_-'\n */\n function trimLeft(string, chars, guard) {\n var value = string;\n string = baseToString(string);\n if (!string) {\n return string;\n }\n if (guard ? isIterateeCall(value, chars, guard) : chars == null) {\n return string.slice(trimmedLeftIndex(string));\n }\n return string.slice(charsLeftIndex(string, (chars + '')));\n }\n\n /**\n * Removes trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trimRight(' abc ');\n * // => ' abc'\n *\n * _.trimRight('-_-abc-_-', '_-');\n * // => '-_-abc'\n */\n function trimRight(string, chars, guard) {\n var value = string;\n string = baseToString(string);\n if (!string) {\n return string;\n }\n if (guard ? isIterateeCall(value, chars, guard) : chars == null) {\n return string.slice(0, trimmedRightIndex(string) + 1);\n }\n return string.slice(0, charsRightIndex(string, (chars + '')) + 1);\n }\n\n /**\n * Truncates `string` if it's longer than the given maximum string length.\n * The last characters of the truncated string are replaced with the omission\n * string which defaults to \"...\".\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to truncate.\n * @param {Object|number} [options] The options object or maximum string length.\n * @param {number} [options.length=30] The maximum string length.\n * @param {string} [options.omission='...'] The string to indicate text is omitted.\n * @param {RegExp|string} [options.separator] The separator pattern to truncate to.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {string} Returns the truncated string.\n * @example\n *\n * _.trunc('hi-diddly-ho there, neighborino');\n * // => 'hi-diddly-ho there, neighbo...'\n *\n * _.trunc('hi-diddly-ho there, neighborino', 24);\n * // => 'hi-diddly-ho there, n...'\n *\n * _.trunc('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': ' '\n * });\n * // => 'hi-diddly-ho there,...'\n *\n * _.trunc('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': /,? +/\n * });\n * // => 'hi-diddly-ho there...'\n *\n * _.trunc('hi-diddly-ho there, neighborino', {\n * 'omission': ' [...]'\n * });\n * // => 'hi-diddly-ho there, neig [...]'\n */\n function trunc(string, options, guard) {\n if (guard && isIterateeCall(string, options, guard)) {\n options = undefined;\n }\n var length = DEFAULT_TRUNC_LENGTH,\n omission = DEFAULT_TRUNC_OMISSION;\n\n if (options != null) {\n if (isObject(options)) {\n var separator = 'separator' in options ? options.separator : separator;\n length = 'length' in options ? (+options.length || 0) : length;\n omission = 'omission' in options ? baseToString(options.omission) : omission;\n } else {\n length = +options || 0;\n }\n }\n string = baseToString(string);\n if (length >= string.length) {\n return string;\n }\n var end = length - omission.length;\n if (end < 1) {\n return omission;\n }\n var result = string.slice(0, end);\n if (separator == null) {\n return result + omission;\n }\n if (isRegExp(separator)) {\n if (string.slice(end).search(separator)) {\n var match,\n newEnd,\n substring = string.slice(0, end);\n\n if (!separator.global) {\n separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');\n }\n separator.lastIndex = 0;\n while ((match = separator.exec(substring))) {\n newEnd = match.index;\n }\n result = result.slice(0, newEnd == null ? end : newEnd);\n }\n } else if (string.indexOf(separator, end) != end) {\n var index = result.lastIndexOf(separator);\n if (index > -1) {\n result = result.slice(0, index);\n }\n }\n return result + omission;\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their\n * corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional HTML\n * entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = baseToString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\n function words(string, pattern, guard) {\n if (guard && isIterateeCall(string, pattern, guard)) {\n pattern = undefined;\n }\n string = baseToString(string);\n return string.match(pattern || reWords) || [];\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Function} func The function to attempt.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // avoid throwing errors for invalid selectors\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\n var attempt = restParam(function(func, args) {\n try {\n return func.apply(undefined, args);\n } catch(e) {\n return isError(e) ? e : new Error(e);\n }\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and arguments of the created function. If `func` is a property name the\n * created callback returns the property value for a given element. If `func`\n * is an object the created callback returns `true` for elements that contain\n * the equivalent object properties, otherwise it returns `false`.\n *\n * @static\n * @memberOf _\n * @alias iteratee\n * @category Utility\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // wrap to create custom callback shorthands\n * _.callback = _.wrap(_.callback, function(callback, func, thisArg) {\n * var match = /^(.+?)__([gl]t)(.+)$/.exec(func);\n * if (!match) {\n * return callback(func, thisArg);\n * }\n * return function(object) {\n * return match[2] == 'gt'\n * ? object[match[1]] > match[3]\n * : object[match[1]] < match[3];\n * };\n * });\n *\n * _.filter(users, 'age__gt36');\n * // => [{ 'user': 'fred', 'age': 40 }]\n */\n function callback(func, thisArg, guard) {\n if (guard && isIterateeCall(func, thisArg, guard)) {\n thisArg = undefined;\n }\n return isObjectLike(func)\n ? matches(func)\n : baseCallback(func, thisArg);\n }\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var getter = _.constant(object);\n *\n * getter() === object;\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * This method returns the first argument provided to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.identity(object) === object;\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that performs a deep comparison between a given object\n * and `source`, returning `true` if the given object has equivalent property\n * values, else `false`.\n *\n * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n * numbers, `Object` objects, regexes, and strings. Objects are compared by\n * their own, not inherited, enumerable properties. For comparing a single\n * own or inherited property value see `_.matchesProperty`.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, _.matches({ 'age': 40, 'active': false }));\n * // => [{ 'user': 'fred', 'age': 40, 'active': false }]\n */\n function matches(source) {\n return baseMatches(baseClone(source, true));\n }\n\n /**\n * Creates a function that compares the property value of `path` on a given\n * object to `value`.\n *\n * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n * numbers, `Object` objects, regexes, and strings. Objects are compared by\n * their own, not inherited, enumerable properties.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Array|string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * _.find(users, _.matchesProperty('user', 'fred'));\n * // => { 'user': 'fred' }\n */\n function matchesProperty(path, srcValue) {\n return baseMatchesProperty(path, baseClone(srcValue, true));\n }\n\n /**\n * Creates a function that invokes the method at `path` on a given object.\n * Any additional arguments are provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': _.constant(2) } } },\n * { 'a': { 'b': { 'c': _.constant(1) } } }\n * ];\n *\n * _.map(objects, _.method('a.b.c'));\n * // => [2, 1]\n *\n * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\n var method = restParam(function(path, args) {\n return function(object) {\n return invokePath(object, path, args);\n };\n });\n\n /**\n * The opposite of `_.method`; this method creates a function that invokes\n * the method at a given path on `object`. Any additional arguments are\n * provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Object} object The object to query.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var array = _.times(3, _.constant),\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.methodOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.methodOf(object));\n * // => [2, 0]\n */\n var methodOf = restParam(function(object, args) {\n return function(path) {\n return invokePath(object, path, args);\n };\n });\n\n /**\n * Adds all own enumerable function properties of a source object to the\n * destination object. If `object` is a function then methods are added to\n * its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.chain=true] Specify whether the functions added\n * are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\n function mixin(object, source, options) {\n if (options == null) {\n var isObj = isObject(source),\n props = isObj ? keys(source) : undefined,\n methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;\n\n if (!(methodNames ? methodNames.length : isObj)) {\n methodNames = false;\n options = source;\n source = object;\n object = this;\n }\n }\n if (!methodNames) {\n methodNames = baseFunctions(source, keys(source));\n }\n var chain = true,\n index = -1,\n isFunc = isFunction(object),\n length = methodNames.length;\n\n if (options === false) {\n chain = false;\n } else if (isObject(options) && 'chain' in options) {\n chain = options.chain;\n }\n while (++index < length) {\n var methodName = methodNames[index],\n func = source[methodName];\n\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = (function(func) {\n return function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = arrayCopy(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }(func));\n }\n }\n return object;\n }\n\n /**\n * Reverts the `_` variable to its previous value and returns a reference to\n * the `lodash` function.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @returns {Function} Returns the `lodash` function.\n * @example\n *\n * var lodash = _.noConflict();\n */\n function noConflict() {\n root._ = oldDash;\n return this;\n }\n\n /**\n * A no-operation function that returns `undefined` regardless of the\n * arguments it receives.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @example\n *\n * var object = { 'user': 'fred' };\n *\n * _.noop(object) === undefined;\n * // => true\n */\n function noop() {\n // No operation performed.\n }\n\n /**\n * Creates a function that returns the property value at `path` on a\n * given object.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': { 'c': 2 } } },\n * { 'a': { 'b': { 'c': 1 } } }\n * ];\n *\n * _.map(objects, _.property('a.b.c'));\n * // => [2, 1]\n *\n * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n }\n\n /**\n * The opposite of `_.property`; this method creates a function that returns\n * the property value at a given path on `object`.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var array = [0, 1, 2],\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.propertyOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n * // => [2, 0]\n */\n function propertyOf(object) {\n return function(path) {\n return baseGet(object, toPath(path), (path + ''));\n };\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. If `end` is not specified it's\n * set to `start` with `start` then set to `0`. If `end` is less than `start`\n * a zero-length range is created unless a negative `step` is specified.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the new array of numbers.\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n function range(start, end, step) {\n if (step && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n start = +start || 0;\n step = step == null ? 1 : (+step || 0);\n\n if (end == null) {\n end = start;\n start = 0;\n } else {\n end = +end || 0;\n }\n // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.\n // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (++index < length) {\n result[index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * Invokes the iteratee function `n` times, returning an array of the results\n * of each invocation. The `iteratee` is bound to `thisArg` and invoked with\n * one argument; (index).\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false));\n * // => [3, 6, 4]\n *\n * _.times(3, function(n) {\n * mage.castSpell(n);\n * });\n * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`\n *\n * _.times(3, function(n) {\n * this.cast(n);\n * }, mage);\n * // => also invokes `mage.castSpell(n)` three times\n */\n function times(n, iteratee, thisArg) {\n n = nativeFloor(n);\n\n // Exit early to avoid a JSC JIT bug in Safari 8\n // where `Array(0)` is treated as `Array(1)`.\n if (n < 1 || !nativeIsFinite(n)) {\n return [];\n }\n var index = -1,\n result = Array(nativeMin(n, MAX_ARRAY_LENGTH));\n\n iteratee = bindCallback(iteratee, thisArg, 1);\n while (++index < n) {\n if (index < MAX_ARRAY_LENGTH) {\n result[index] = iteratee(index);\n } else {\n iteratee(index);\n }\n }\n return result;\n }\n\n /**\n * Generates a unique ID. If `prefix` is provided the ID is appended to it.\n *\n * @static\n * @memberOf _\n * @category Utility\n * @param {string} [prefix] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\n function uniqueId(prefix) {\n var id = ++idCounter;\n return baseToString(prefix) + id;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Adds two numbers.\n *\n * @static\n * @memberOf _\n * @category Math\n * @param {number} augend The first number to add.\n * @param {number} addend The second number to add.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.add(6, 4);\n * // => 10\n */\n function add(augend, addend) {\n return (+augend || 0) + (+addend || 0);\n }\n\n /**\n * Calculates `n` rounded up to `precision`.\n *\n * @static\n * @memberOf _\n * @category Math\n * @param {number} n The number to round up.\n * @param {number} [precision=0] The precision to round up to.\n * @returns {number} Returns the rounded up number.\n * @example\n *\n * _.ceil(4.006);\n * // => 5\n *\n * _.ceil(6.004, 2);\n * // => 6.01\n *\n * _.ceil(6040, -2);\n * // => 6100\n */\n var ceil = createRound('ceil');\n\n /**\n * Calculates `n` rounded down to `precision`.\n *\n * @static\n * @memberOf _\n * @category Math\n * @param {number} n The number to round down.\n * @param {number} [precision=0] The precision to round down to.\n * @returns {number} Returns the rounded down number.\n * @example\n *\n * _.floor(4.006);\n * // => 4\n *\n * _.floor(0.046, 2);\n * // => 0.04\n *\n * _.floor(4060, -2);\n * // => 4000\n */\n var floor = createRound('floor');\n\n /**\n * Gets the maximum value of `collection`. If `collection` is empty or falsey\n * `-Infinity` is returned. If an iteratee function is provided it's invoked\n * for each value in `collection` to generate the criterion by which the value\n * is ranked. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Math\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => -Infinity\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * _.max(users, function(chr) {\n * return chr.age;\n * });\n * // => { 'user': 'fred', 'age': 40 }\n *\n * // using the `_.property` callback shorthand\n * _.max(users, 'age');\n * // => { 'user': 'fred', 'age': 40 }\n */\n var max = createExtremum(gt, NEGATIVE_INFINITY);\n\n /**\n * Gets the minimum value of `collection`. If `collection` is empty or falsey\n * `Infinity` is returned. If an iteratee function is provided it's invoked\n * for each value in `collection` to generate the criterion by which the value\n * is ranked. The `iteratee` is bound to `thisArg` and invoked with three\n * arguments: (value, index, collection).\n *\n * If a property name is provided for `iteratee` the created `_.property`\n * style callback returns the property value of the given element.\n *\n * If a value is also provided for `thisArg` the created `_.matchesProperty`\n * style callback returns `true` for elements that have a matching property\n * value, else `false`.\n *\n * If an object is provided for `iteratee` the created `_.matches` style\n * callback returns `true` for elements that have the properties of the given\n * object, else `false`.\n *\n * @static\n * @memberOf _\n * @category Math\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => Infinity\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * _.min(users, function(chr) {\n * return chr.age;\n * });\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // using the `_.property` callback shorthand\n * _.min(users, 'age');\n * // => { 'user': 'barney', 'age': 36 }\n */\n var min = createExtremum(lt, POSITIVE_INFINITY);\n\n /**\n * Calculates `n` rounded to `precision`.\n *\n * @static\n * @memberOf _\n * @category Math\n * @param {number} n The number to round.\n * @param {number} [precision=0] The precision to round to.\n * @returns {number} Returns the rounded number.\n * @example\n *\n * _.round(4.006);\n * // => 4\n *\n * _.round(4.006, 2);\n * // => 4.01\n *\n * _.round(4060, -2);\n * // => 4100\n */\n var round = createRound('round');\n\n /**\n * Gets the sum of the values in `collection`.\n *\n * @static\n * @memberOf _\n * @category Math\n * @param {Array|Object|string} collection The collection to iterate over.\n * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n * @param {*} [thisArg] The `this` binding of `iteratee`.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.sum([4, 6]);\n * // => 10\n *\n * _.sum({ 'a': 4, 'b': 6 });\n * // => 10\n *\n * var objects = [\n * { 'n': 4 },\n * { 'n': 6 }\n * ];\n *\n * _.sum(objects, function(object) {\n * return object.n;\n * });\n * // => 10\n *\n * // using the `_.property` callback shorthand\n * _.sum(objects, 'n');\n * // => 10\n */\n function sum(collection, iteratee, thisArg) {\n if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {\n iteratee = undefined;\n }\n iteratee = getCallback(iteratee, thisArg, 3);\n return iteratee.length == 1\n ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee)\n : baseSum(collection, iteratee);\n }\n\n /*------------------------------------------------------------------------*/\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n // Add functions to the `Map` cache.\n MapCache.prototype['delete'] = mapDelete;\n MapCache.prototype.get = mapGet;\n MapCache.prototype.has = mapHas;\n MapCache.prototype.set = mapSet;\n\n // Add functions to the `Set` cache.\n SetCache.prototype.push = cachePush;\n\n // Assign cache to `_.memoize`.\n memoize.Cache = MapCache;\n\n // Add functions that return wrapped values when chaining.\n lodash.after = after;\n lodash.ary = ary;\n lodash.assign = assign;\n lodash.at = at;\n lodash.before = before;\n lodash.bind = bind;\n lodash.bindAll = bindAll;\n lodash.bindKey = bindKey;\n lodash.callback = callback;\n lodash.chain = chain;\n lodash.chunk = chunk;\n lodash.compact = compact;\n lodash.constant = constant;\n lodash.countBy = countBy;\n lodash.create = create;\n lodash.curry = curry;\n lodash.curryRight = curryRight;\n lodash.debounce = debounce;\n lodash.defaults = defaults;\n lodash.defaultsDeep = defaultsDeep;\n lodash.defer = defer;\n lodash.delay = delay;\n lodash.difference = difference;\n lodash.drop = drop;\n lodash.dropRight = dropRight;\n lodash.dropRightWhile = dropRightWhile;\n lodash.dropWhile = dropWhile;\n lodash.fill = fill;\n lodash.filter = filter;\n lodash.flatten = flatten;\n lodash.flattenDeep = flattenDeep;\n lodash.flow = flow;\n lodash.flowRight = flowRight;\n lodash.forEach = forEach;\n lodash.forEachRight = forEachRight;\n lodash.forIn = forIn;\n lodash.forInRight = forInRight;\n lodash.forOwn = forOwn;\n lodash.forOwnRight = forOwnRight;\n lodash.functions = functions;\n lodash.groupBy = groupBy;\n lodash.indexBy = indexBy;\n lodash.initial = initial;\n lodash.intersection = intersection;\n lodash.invert = invert;\n lodash.invoke = invoke;\n lodash.keys = keys;\n lodash.keysIn = keysIn;\n lodash.map = map;\n lodash.mapKeys = mapKeys;\n lodash.mapValues = mapValues;\n lodash.matches = matches;\n lodash.matchesProperty = matchesProperty;\n lodash.memoize = memoize;\n lodash.merge = merge;\n lodash.method = method;\n lodash.methodOf = methodOf;\n lodash.mixin = mixin;\n lodash.modArgs = modArgs;\n lodash.negate = negate;\n lodash.omit = omit;\n lodash.once = once;\n lodash.pairs = pairs;\n lodash.partial = partial;\n lodash.partialRight = partialRight;\n lodash.partition = partition;\n lodash.pick = pick;\n lodash.pluck = pluck;\n lodash.property = property;\n lodash.propertyOf = propertyOf;\n lodash.pull = pull;\n lodash.pullAt = pullAt;\n lodash.range = range;\n lodash.rearg = rearg;\n lodash.reject = reject;\n lodash.remove = remove;\n lodash.rest = rest;\n lodash.restParam = restParam;\n lodash.set = set;\n lodash.shuffle = shuffle;\n lodash.slice = slice;\n lodash.sortBy = sortBy;\n lodash.sortByAll = sortByAll;\n lodash.sortByOrder = sortByOrder;\n lodash.spread = spread;\n lodash.take = take;\n lodash.takeRight = takeRight;\n lodash.takeRightWhile = takeRightWhile;\n lodash.takeWhile = takeWhile;\n lodash.tap = tap;\n lodash.throttle = throttle;\n lodash.thru = thru;\n lodash.times = times;\n lodash.toArray = toArray;\n lodash.toPlainObject = toPlainObject;\n lodash.transform = transform;\n lodash.union = union;\n lodash.uniq = uniq;\n lodash.unzip = unzip;\n lodash.unzipWith = unzipWith;\n lodash.values = values;\n lodash.valuesIn = valuesIn;\n lodash.where = where;\n lodash.without = without;\n lodash.wrap = wrap;\n lodash.xor = xor;\n lodash.zip = zip;\n lodash.zipObject = zipObject;\n lodash.zipWith = zipWith;\n\n // Add aliases.\n lodash.backflow = flowRight;\n lodash.collect = map;\n lodash.compose = flowRight;\n lodash.each = forEach;\n lodash.eachRight = forEachRight;\n lodash.extend = assign;\n lodash.iteratee = callback;\n lodash.methods = functions;\n lodash.object = zipObject;\n lodash.select = filter;\n lodash.tail = rest;\n lodash.unique = uniq;\n\n // Add functions to `lodash.prototype`.\n mixin(lodash, lodash);\n\n /*------------------------------------------------------------------------*/\n\n // Add functions that return unwrapped values when chaining.\n lodash.add = add;\n lodash.attempt = attempt;\n lodash.camelCase = camelCase;\n lodash.capitalize = capitalize;\n lodash.ceil = ceil;\n lodash.clone = clone;\n lodash.cloneDeep = cloneDeep;\n lodash.deburr = deburr;\n lodash.endsWith = endsWith;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.every = every;\n lodash.find = find;\n lodash.findIndex = findIndex;\n lodash.findKey = findKey;\n lodash.findLast = findLast;\n lodash.findLastIndex = findLastIndex;\n lodash.findLastKey = findLastKey;\n lodash.findWhere = findWhere;\n lodash.first = first;\n lodash.floor = floor;\n lodash.get = get;\n lodash.gt = gt;\n lodash.gte = gte;\n lodash.has = has;\n lodash.identity = identity;\n lodash.includes = includes;\n lodash.indexOf = indexOf;\n lodash.inRange = inRange;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isBoolean = isBoolean;\n lodash.isDate = isDate;\n lodash.isElement = isElement;\n lodash.isEmpty = isEmpty;\n lodash.isEqual = isEqual;\n lodash.isError = isError;\n lodash.isFinite = isFinite;\n lodash.isFunction = isFunction;\n lodash.isMatch = isMatch;\n lodash.isNaN = isNaN;\n lodash.isNative = isNative;\n lodash.isNull = isNull;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isPlainObject = isPlainObject;\n lodash.isRegExp = isRegExp;\n lodash.isString = isString;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.kebabCase = kebabCase;\n lodash.last = last;\n lodash.lastIndexOf = lastIndexOf;\n lodash.lt = lt;\n lodash.lte = lte;\n lodash.max = max;\n lodash.min = min;\n lodash.noConflict = noConflict;\n lodash.noop = noop;\n lodash.now = now;\n lodash.pad = pad;\n lodash.padLeft = padLeft;\n lodash.padRight = padRight;\n lodash.parseInt = parseInt;\n lodash.random = random;\n lodash.reduce = reduce;\n lodash.reduceRight = reduceRight;\n lodash.repeat = repeat;\n lodash.result = result;\n lodash.round = round;\n lodash.runInContext = runInContext;\n lodash.size = size;\n lodash.snakeCase = snakeCase;\n lodash.some = some;\n lodash.sortedIndex = sortedIndex;\n lodash.sortedLastIndex = sortedLastIndex;\n lodash.startCase = startCase;\n lodash.startsWith = startsWith;\n lodash.sum = sum;\n lodash.template = template;\n lodash.trim = trim;\n lodash.trimLeft = trimLeft;\n lodash.trimRight = trimRight;\n lodash.trunc = trunc;\n lodash.unescape = unescape;\n lodash.uniqueId = uniqueId;\n lodash.words = words;\n\n // Add aliases.\n lodash.all = every;\n lodash.any = some;\n lodash.contains = includes;\n lodash.eq = isEqual;\n lodash.detect = find;\n lodash.foldl = reduce;\n lodash.foldr = reduceRight;\n lodash.head = first;\n lodash.include = includes;\n lodash.inject = reduce;\n\n mixin(lodash, (function() {\n var source = {};\n baseForOwn(lodash, function(func, methodName) {\n if (!lodash.prototype[methodName]) {\n source[methodName] = func;\n }\n });\n return source;\n }()), false);\n\n /*------------------------------------------------------------------------*/\n\n // Add functions capable of returning wrapped and unwrapped values when chaining.\n lodash.sample = sample;\n\n lodash.prototype.sample = function(n) {\n if (!this.__chain__ && n == null) {\n return sample(this.value());\n }\n return this.thru(function(value) {\n return sample(value, n);\n });\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type string\n */\n lodash.VERSION = VERSION;\n\n // Assign default placeholders.\n arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {\n lodash[methodName].placeholder = lodash;\n });\n\n // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.\n arrayEach(['drop', 'take'], function(methodName, index) {\n LazyWrapper.prototype[methodName] = function(n) {\n var filtered = this.__filtered__;\n if (filtered && !index) {\n return new LazyWrapper(this);\n }\n n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);\n\n var result = this.clone();\n if (filtered) {\n result.__takeCount__ = nativeMin(result.__takeCount__, n);\n } else {\n result.__views__.push({ 'size': n, 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') });\n }\n return result;\n };\n\n LazyWrapper.prototype[methodName + 'Right'] = function(n) {\n return this.reverse()[methodName](n).reverse();\n };\n });\n\n // Add `LazyWrapper` methods that accept an `iteratee` value.\n arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {\n var type = index + 1,\n isFilter = type != LAZY_MAP_FLAG;\n\n LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {\n var result = this.clone();\n result.__iteratees__.push({ 'iteratee': getCallback(iteratee, thisArg, 1), 'type': type });\n result.__filtered__ = result.__filtered__ || isFilter;\n return result;\n };\n });\n\n // Add `LazyWrapper` methods for `_.first` and `_.last`.\n arrayEach(['first', 'last'], function(methodName, index) {\n var takeName = 'take' + (index ? 'Right' : '');\n\n LazyWrapper.prototype[methodName] = function() {\n return this[takeName](1).value()[0];\n };\n });\n\n // Add `LazyWrapper` methods for `_.initial` and `_.rest`.\n arrayEach(['initial', 'rest'], function(methodName, index) {\n var dropName = 'drop' + (index ? '' : 'Right');\n\n LazyWrapper.prototype[methodName] = function() {\n return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);\n };\n });\n\n // Add `LazyWrapper` methods for `_.pluck` and `_.where`.\n arrayEach(['pluck', 'where'], function(methodName, index) {\n var operationName = index ? 'filter' : 'map',\n createCallback = index ? baseMatches : property;\n\n LazyWrapper.prototype[methodName] = function(value) {\n return this[operationName](createCallback(value));\n };\n });\n\n LazyWrapper.prototype.compact = function() {\n return this.filter(identity);\n };\n\n LazyWrapper.prototype.reject = function(predicate, thisArg) {\n predicate = getCallback(predicate, thisArg, 1);\n return this.filter(function(value) {\n return !predicate(value);\n });\n };\n\n LazyWrapper.prototype.slice = function(start, end) {\n start = start == null ? 0 : (+start || 0);\n\n var result = this;\n if (result.__filtered__ && (start > 0 || end < 0)) {\n return new LazyWrapper(result);\n }\n if (start < 0) {\n result = result.takeRight(-start);\n } else if (start) {\n result = result.drop(start);\n }\n if (end !== undefined) {\n end = (+end || 0);\n result = end < 0 ? result.dropRight(-end) : result.take(end - start);\n }\n return result;\n };\n\n LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {\n return this.reverse().takeWhile(predicate, thisArg).reverse();\n };\n\n LazyWrapper.prototype.toArray = function() {\n return this.take(POSITIVE_INFINITY);\n };\n\n // Add `LazyWrapper` methods to `lodash.prototype`.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),\n retUnwrapped = /^(?:first|last)$/.test(methodName),\n lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];\n\n if (!lodashFunc) {\n return;\n }\n lodash.prototype[methodName] = function() {\n var args = retUnwrapped ? [1] : arguments,\n chainAll = this.__chain__,\n value = this.__wrapped__,\n isHybrid = !!this.__actions__.length,\n isLazy = value instanceof LazyWrapper,\n iteratee = args[0],\n useLazy = isLazy || isArray(value);\n\n if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {\n // Avoid lazy use if the iteratee has a \"length\" value other than `1`.\n isLazy = useLazy = false;\n }\n var interceptor = function(value) {\n return (retUnwrapped && chainAll)\n ? lodashFunc(value, 1)[0]\n : lodashFunc.apply(undefined, arrayPush([value], args));\n };\n\n var action = { 'func': thru, 'args': [interceptor], 'thisArg': undefined },\n onlyLazy = isLazy && !isHybrid;\n\n if (retUnwrapped && !chainAll) {\n if (onlyLazy) {\n value = value.clone();\n value.__actions__.push(action);\n return func.call(value);\n }\n return lodashFunc.call(undefined, this.value())[0];\n }\n if (!retUnwrapped && useLazy) {\n value = onlyLazy ? value : new LazyWrapper(this);\n var result = func.apply(value, args);\n result.__actions__.push(action);\n return new LodashWrapper(result, chainAll);\n }\n return this.thru(interceptor);\n };\n });\n\n // Add `Array` and `String` methods to `lodash.prototype`.\n arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {\n var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],\n chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',\n retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);\n\n lodash.prototype[methodName] = function() {\n var args = arguments;\n if (retUnwrapped && !this.__chain__) {\n return func.apply(this.value(), args);\n }\n return this[chainName](function(value) {\n return func.apply(value, args);\n });\n };\n });\n\n // Map minified function names to their real names.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var lodashFunc = lodash[methodName];\n if (lodashFunc) {\n var key = (lodashFunc.name + ''),\n names = realNames[key] || (realNames[key] = []);\n\n names.push({ 'name': methodName, 'func': lodashFunc });\n }\n });\n\n realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }];\n\n // Add functions to the lazy wrapper.\n LazyWrapper.prototype.clone = lazyClone;\n LazyWrapper.prototype.reverse = lazyReverse;\n LazyWrapper.prototype.value = lazyValue;\n\n // Add chaining functions to the `lodash` wrapper.\n lodash.prototype.chain = wrapperChain;\n lodash.prototype.commit = wrapperCommit;\n lodash.prototype.concat = wrapperConcat;\n lodash.prototype.plant = wrapperPlant;\n lodash.prototype.reverse = wrapperReverse;\n lodash.prototype.toString = wrapperToString;\n lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;\n\n // Add function aliases to the `lodash` wrapper.\n lodash.prototype.collect = lodash.prototype.map;\n lodash.prototype.head = lodash.prototype.first;\n lodash.prototype.select = lodash.prototype.filter;\n lodash.prototype.tail = lodash.prototype.rest;\n\n return lodash;\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Export lodash.\n var _ = runInContext();\n\n // Some AMD build optimizers like r.js check for condition patterns like the following:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Expose lodash to the global object when an AMD loader is present to avoid\n // errors in cases where lodash is loaded by a script tag and not intended\n // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for\n // more details.\n root._ = _;\n\n // Define as an anonymous module so, through path mapping, it can be\n // referenced as the \"underscore\" module.\n define(function() {\n return _;\n });\n }\n // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\n else if (freeExports && freeModule) {\n // Export for Node.js or RingoJS.\n if (moduleExports) {\n (freeModule.exports = _)._ = _;\n }\n // Export for Rhino with CommonJS support.\n else {\n freeExports._ = _;\n }\n }\n else {\n // Export for a browser or Rhino.\n root._ = _;\n }\n}.call(this));\n\n/**\n * Restful Resources service for AngularJS apps\n * @version v1.5.2 - 2016-02-08 * @link https://github.com/mgonto/restangular\n * @author Martin Gontovnikas <martin@gon.to>\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */(function() {\n\nvar restangular = angular.module('restangular', []);\n\nrestangular.provider('Restangular', function() {\n // Configuration\n var Configurer = {};\n Configurer.init = function(object, config) {\n object.configuration = config;\n\n /**\n * Those are HTTP safe methods for which there is no need to pass any data with the request.\n */\n var safeMethods= ['get', 'head', 'options', 'trace', 'getlist'];\n config.isSafe = function(operation) {\n return _.includes(safeMethods, operation.toLowerCase());\n };\n\n var absolutePattern = /^https?:\\/\\//i;\n config.isAbsoluteUrl = function(string) {\n return _.isUndefined(config.absoluteUrl) || _.isNull(config.absoluteUrl) ?\n string && absolutePattern.test(string) :\n config.absoluteUrl;\n };\n\n config.absoluteUrl = _.isUndefined(config.absoluteUrl) ? true : config.absoluteUrl;\n object.setSelfLinkAbsoluteUrl = function(value) {\n config.absoluteUrl = value;\n };\n /**\n * This is the BaseURL to be used with Restangular\n */\n config.baseUrl = _.isUndefined(config.baseUrl) ? '' : config.baseUrl;\n object.setBaseUrl = function(newBaseUrl) {\n config.baseUrl = /\\/$/.test(newBaseUrl) ?\n newBaseUrl.substring(0, newBaseUrl.length-1) :\n newBaseUrl;\n return this;\n };\n\n /**\n * Sets the extra fields to keep from the parents\n */\n config.extraFields = config.extraFields || [];\n object.setExtraFields = function(newExtraFields) {\n config.extraFields = newExtraFields;\n return this;\n };\n\n /**\n * Some default $http parameter to be used in EVERY call\n **/\n config.defaultHttpFields = config.defaultHttpFields || {};\n object.setDefaultHttpFields = function(values) {\n config.defaultHttpFields = values;\n return this;\n };\n\n config.withHttpValues = function(httpLocalConfig, obj) {\n return _.defaults(obj, httpLocalConfig, config.defaultHttpFields);\n };\n\n config.encodeIds = _.isUndefined(config.encodeIds) ? true : config.encodeIds;\n object.setEncodeIds = function(encode) {\n config.encodeIds = encode;\n };\n\n config.defaultRequestParams = config.defaultRequestParams || {\n get: {},\n post: {},\n put: {},\n remove: {},\n common: {}\n };\n\n object.setDefaultRequestParams = function(param1, param2) {\n var methods = [],\n params = param2 || param1;\n if (!_.isUndefined(param2)) {\n if (_.isArray(param1)) {\n methods = param1;\n } else {\n methods.push(param1);\n }\n } else {\n methods.push('common');\n }\n\n _.each(methods, function (method) {\n config.defaultRequestParams[method] = params;\n });\n return this;\n };\n\n object.requestParams = config.defaultRequestParams;\n\n config.defaultHeaders = config.defaultHeaders || {};\n object.setDefaultHeaders = function(headers) {\n config.defaultHeaders = headers;\n object.defaultHeaders = config.defaultHeaders;\n return this;\n };\n\n object.defaultHeaders = config.defaultHeaders;\n\n /**\n * Method overriders will set which methods are sent via POST with an X-HTTP-Method-Override\n **/\n config.methodOverriders = config.methodOverriders || [];\n object.setMethodOverriders = function(values) {\n var overriders = _.extend([], values);\n if (config.isOverridenMethod('delete', overriders)) {\n overriders.push('remove');\n }\n config.methodOverriders = overriders;\n return this;\n };\n\n config.jsonp = _.isUndefined(config.jsonp) ? false : config.jsonp;\n object.setJsonp = function(active) {\n config.jsonp = active;\n };\n\n config.isOverridenMethod = function(method, values) {\n var search = values || config.methodOverriders;\n return !_.isUndefined(_.find(search, function(one) {\n return one.toLowerCase() === method.toLowerCase();\n }));\n };\n\n /**\n * Sets the URL creator type. For now, only Path is created. In the future we'll have queryParams\n **/\n config.urlCreator = config.urlCreator || 'path';\n object.setUrlCreator = function(name) {\n if (!_.has(config.urlCreatorFactory, name)) {\n throw new Error('URL Path selected isn\\'t valid');\n }\n\n config.urlCreator = name;\n return this;\n };\n\n /**\n * You can set the restangular fields here. The 3 required fields for Restangular are:\n *\n * id: Id of the element\n * route: name of the route of this element\n * parentResource: the reference to the parent resource\n *\n * All of this fields except for id, are handled (and created) by Restangular. By default,\n * the field values will be id, route and parentResource respectively\n */\n config.restangularFields = config.restangularFields || {\n id: 'id',\n route: 'route',\n parentResource: 'parentResource',\n restangularCollection: 'restangularCollection',\n cannonicalId: '__cannonicalId',\n etag: 'restangularEtag',\n selfLink: 'href',\n get: 'get',\n getList: 'getList',\n put: 'put',\n post: 'post',\n remove: 'remove',\n head: 'head',\n trace: 'trace',\n options: 'options',\n patch: 'patch',\n getRestangularUrl: 'getRestangularUrl',\n getRequestedUrl: 'getRequestedUrl',\n putElement: 'putElement',\n addRestangularMethod: 'addRestangularMethod',\n getParentList: 'getParentList',\n clone: 'clone',\n ids: 'ids',\n httpConfig: '_$httpConfig',\n reqParams: 'reqParams',\n one: 'one',\n all: 'all',\n several: 'several',\n oneUrl: 'oneUrl',\n allUrl: 'allUrl',\n customPUT: 'customPUT',\n customPOST: 'customPOST',\n customDELETE: 'customDELETE',\n customGET: 'customGET',\n customGETLIST: 'customGETLIST',\n customOperation: 'customOperation',\n doPUT: 'doPUT',\n doPOST: 'doPOST',\n doDELETE: 'doDELETE',\n doGET: 'doGET',\n doGETLIST: 'doGETLIST',\n fromServer: 'fromServer',\n withConfig: 'withConfig',\n withHttpConfig: 'withHttpConfig',\n singleOne: 'singleOne',\n plain: 'plain',\n save: 'save',\n restangularized: 'restangularized'\n };\n object.setRestangularFields = function(resFields) {\n config.restangularFields =\n _.extend(config.restangularFields, resFields);\n return this;\n };\n\n config.isRestangularized = function(obj) {\n return !!obj[config.restangularFields.restangularized];\n };\n\n config.setFieldToElem = function(field, elem, value) {\n var properties = field.split('.');\n var idValue = elem;\n _.each(_.initial(properties), function(prop) {\n idValue[prop] = {};\n idValue = idValue[prop];\n });\n idValue[_.last(properties)] = value;\n return this;\n };\n\n config.getFieldFromElem = function(field, elem) {\n var properties = field.split('.');\n var idValue = elem;\n _.each(properties, function(prop) {\n if (idValue) {\n idValue = idValue[prop];\n }\n });\n return angular.copy(idValue);\n };\n\n config.setIdToElem = function(elem, id /*, route */) {\n config.setFieldToElem(config.restangularFields.id, elem, id);\n return this;\n };\n\n config.getIdFromElem = function(elem) {\n return config.getFieldFromElem(config.restangularFields.id, elem);\n };\n\n config.isValidId = function(elemId) {\n return '' !== elemId && !_.isUndefined(elemId) && !_.isNull(elemId);\n };\n\n config.setUrlToElem = function(elem, url /*, route */) {\n config.setFieldToElem(config.restangularFields.selfLink, elem, url);\n return this;\n };\n\n config.getUrlFromElem = function(elem) {\n return config.getFieldFromElem(config.restangularFields.selfLink, elem);\n };\n\n config.useCannonicalId = _.isUndefined(config.useCannonicalId) ? false : config.useCannonicalId;\n object.setUseCannonicalId = function(value) {\n config.useCannonicalId = value;\n return this;\n };\n\n config.getCannonicalIdFromElem = function(elem) {\n var cannonicalId = elem[config.restangularFields.cannonicalId];\n var actualId = config.isValidId(cannonicalId) ? cannonicalId : config.getIdFromElem(elem);\n return actualId;\n };\n\n /**\n * Sets the Response parser. This is used in case your response isn't directly the data.\n * For example if you have a response like {meta: {'meta'}, data: {name: 'Gonto'}}\n * you can extract this data which is the one that needs wrapping\n *\n * The ResponseExtractor is a function that receives the response and the method executed.\n */\n\n config.responseInterceptors = config.responseInterceptors || [];\n\n config.defaultResponseInterceptor = function(data /*, operation, what, url, response, deferred */) {\n return data;\n };\n\n config.responseExtractor = function(data, operation, what, url, response, deferred) {\n var interceptors = angular.copy(config.responseInterceptors);\n interceptors.push(config.defaultResponseInterceptor);\n var theData = data;\n _.each(interceptors, function(interceptor) {\n theData = interceptor(theData, operation,\n what, url, response, deferred);\n });\n return theData;\n };\n\n object.addResponseInterceptor = function(extractor) {\n config.responseInterceptors.push(extractor);\n return this;\n };\n\n config.errorInterceptors = config.errorInterceptors || [];\n object.addErrorInterceptor = function(interceptor) {\n config.errorInterceptors.push(interceptor);\n return this;\n };\n\n object.setResponseInterceptor = object.addResponseInterceptor;\n object.setResponseExtractor = object.addResponseInterceptor;\n object.setErrorInterceptor = object.addErrorInterceptor;\n\n /**\n * Response interceptor is called just before resolving promises.\n */\n\n\n /**\n * Request interceptor is called before sending an object to the server.\n */\n config.requestInterceptors = config.requestInterceptors || [];\n\n config.defaultInterceptor = function(element, operation, path, url, headers, params, httpConfig) {\n return {\n element: element,\n headers: headers,\n params: params,\n httpConfig: httpConfig\n };\n };\n\n config.fullRequestInterceptor = function(element, operation, path, url, headers, params, httpConfig) {\n var interceptors = angular.copy(config.requestInterceptors);\n var defaultRequest = config.defaultInterceptor(element, operation, path, url, headers, params, httpConfig);\n return _.reduce(interceptors, function(request, interceptor) {\n return _.extend(request, interceptor(request.element, operation,\n path, url, request.headers, request.params, request.httpConfig));\n }, defaultRequest);\n };\n\n object.addRequestInterceptor = function(interceptor) {\n config.requestInterceptors.push(function(elem, operation, path, url, headers, params, httpConfig) {\n return {\n headers: headers,\n params: params,\n element: interceptor(elem, operation, path, url),\n httpConfig: httpConfig\n };\n });\n return this;\n };\n\n object.setRequestInterceptor = object.addRequestInterceptor;\n\n object.addFullRequestInterceptor = function(interceptor) {\n config.requestInterceptors.push(interceptor);\n return this;\n };\n\n object.setFullRequestInterceptor = object.addFullRequestInterceptor;\n\n config.onBeforeElemRestangularized = config.onBeforeElemRestangularized || function(elem) {\n return elem;\n };\n object.setOnBeforeElemRestangularized = function(post) {\n config.onBeforeElemRestangularized = post;\n return this;\n };\n\n object.setRestangularizePromiseInterceptor = function(interceptor) {\n config.restangularizePromiseInterceptor = interceptor;\n return this;\n };\n\n /**\n * This method is called after an element has been \"Restangularized\".\n *\n * It receives the element, a boolean indicating if it's an element or a collection\n * and the name of the model\n *\n */\n config.onElemRestangularized = config.onElemRestangularized || function(elem) {\n return elem;\n };\n object.setOnElemRestangularized = function(post) {\n config.onElemRestangularized = post;\n return this;\n };\n\n config.shouldSaveParent = config.shouldSaveParent || function() {\n return true;\n };\n object.setParentless = function(values) {\n if (_.isArray(values)) {\n config.shouldSaveParent = function(route) {\n return !_.includes(values, route);\n };\n } else if (_.isBoolean(values)) {\n config.shouldSaveParent = function() {\n return !values;\n };\n }\n return this;\n };\n\n /**\n * This lets you set a suffix to every request.\n *\n * For example, if your api requires that for JSon requests you do /users/123.json, you can set that\n * in here.\n *\n *\n * By default, the suffix is null\n */\n config.suffix = _.isUndefined(config.suffix) ? null : config.suffix;\n object.setRequestSuffix = function(newSuffix) {\n config.suffix = newSuffix;\n return this;\n };\n\n /**\n * Add element transformers for certain routes.\n */\n config.transformers = config.transformers || {};\n object.addElementTransformer = function(type, secondArg, thirdArg) {\n var isCollection = null;\n var transformer = null;\n if (arguments.length === 2) {\n transformer = secondArg;\n } else {\n transformer = thirdArg;\n isCollection = secondArg;\n }\n\n var typeTransformers = config.transformers[type];\n if (!typeTransformers) {\n typeTransformers = config.transformers[type] = [];\n }\n\n typeTransformers.push(function(coll, elem) {\n if (_.isNull(isCollection) || (coll === isCollection)) {\n return transformer(elem);\n }\n return elem;\n });\n\n return object;\n };\n\n object.extendCollection = function(route, fn) {\n return object.addElementTransformer(route, true, fn);\n };\n\n object.extendModel = function(route, fn) {\n return object.addElementTransformer(route, false, fn);\n };\n\n config.transformElem = function(elem, isCollection, route, Restangular, force) {\n if (!force && !config.transformLocalElements && !elem[config.restangularFields.fromServer]) {\n return elem;\n }\n var typeTransformers = config.transformers[route];\n var changedElem = elem;\n if (typeTransformers) {\n _.each(typeTransformers, function(transformer) {\n changedElem = transformer(isCollection, changedElem);\n });\n }\n return config.onElemRestangularized(changedElem, isCollection, route, Restangular);\n };\n\n config.transformLocalElements = _.isUndefined(config.transformLocalElements) ?\n false :\n config.transformLocalElements;\n\n object.setTransformOnlyServerElements = function(active) {\n config.transformLocalElements = !active;\n };\n\n config.fullResponse = _.isUndefined(config.fullResponse) ? false : config.fullResponse;\n object.setFullResponse = function(full) {\n config.fullResponse = full;\n return this;\n };\n\n\n //Internal values and functions\n config.urlCreatorFactory = {};\n\n /**\n * Base URL Creator. Base prototype for everything related to it\n **/\n\n var BaseCreator = function() {\n };\n\n BaseCreator.prototype.setConfig = function(config) {\n this.config = config;\n return this;\n };\n\n BaseCreator.prototype.parentsArray = function(current) {\n var parents = [];\n while(current) {\n parents.push(current);\n current = current[this.config.restangularFields.parentResource];\n }\n return parents.reverse();\n };\n\n function RestangularResource(config, $http, url, configurer) {\n var resource = {};\n _.each(_.keys(configurer), function(key) {\n var value = configurer[key];\n\n // Add default parameters\n value.params = _.extend({}, value.params, config.defaultRequestParams[value.method.toLowerCase()]);\n // We don't want the ? if no params are there\n if (_.isEmpty(value.params)) {\n delete value.params;\n }\n\n if (config.isSafe(value.method)) {\n\n resource[key] = function() {\n return $http(_.extend(value, {\n url: url\n }));\n };\n\n } else {\n\n resource[key] = function(data) {\n return $http(_.extend(value, {\n url: url,\n data: data\n }));\n };\n\n }\n });\n\n return resource;\n }\n\n BaseCreator.prototype.resource = function(current, $http, localHttpConfig, callHeaders, callParams, what, etag,operation) {\n\n var params = _.defaults(callParams || {}, this.config.defaultRequestParams.common);\n var headers = _.defaults(callHeaders || {}, this.config.defaultHeaders);\n\n if (etag) {\n if (!config.isSafe(operation)) {\n headers['If-Match'] = etag;\n } else {\n headers['If-None-Match'] = etag;\n }\n }\n\n var url = this.base(current);\n\n if (what) {\n var add = '';\n if (!/\\/$/.test(url)) {\n add += '/';\n }\n add += what;\n url += add;\n }\n\n if (this.config.suffix &&\n url.indexOf(this.config.suffix, url.length - this.config.suffix.length) === -1 &&\n !this.config.getUrlFromElem(current)) {\n url += this.config.suffix;\n }\n\n current[this.config.restangularFields.httpConfig] = undefined;\n\n return RestangularResource(this.config, $http, url, {\n getList: this.config.withHttpValues(localHttpConfig,\n {method: 'GET',\n params: params,\n headers: headers}),\n\n get: this.config.withHttpValues(localHttpConfig,\n {method: 'GET',\n params: params,\n headers: headers}),\n\n jsonp: this.config.withHttpValues(localHttpConfig,\n {method: 'jsonp',\n params: params,\n headers: headers}),\n\n put: this.config.withHttpValues(localHttpConfig,\n {method: 'PUT',\n params: params,\n headers: headers}),\n\n post: this.config.withHttpValues(localHttpConfig,\n {method: 'POST',\n params: params,\n headers: headers}),\n\n remove: this.config.withHttpValues(localHttpConfig,\n {method: 'DELETE',\n params: params,\n headers: headers}),\n\n head: this.config.withHttpValues(localHttpConfig,\n {method: 'HEAD',\n params: params,\n headers: headers}),\n\n trace: this.config.withHttpValues(localHttpConfig,\n {method: 'TRACE',\n params: params,\n headers: headers}),\n\n options: this.config.withHttpValues(localHttpConfig,\n {method: 'OPTIONS',\n params: params,\n headers: headers}),\n\n patch: this.config.withHttpValues(localHttpConfig,\n {method: 'PATCH',\n params: params,\n headers: headers})\n });\n };\n\n /**\n * This is the Path URL creator. It uses Path to show Hierarchy in the Rest API.\n * This means that if you have an Account that then has a set of Buildings, a URL to a building\n * would be /accounts/123/buildings/456\n **/\n var Path = function() {\n };\n\n Path.prototype = new BaseCreator();\n\n Path.prototype.normalizeUrl = function (url){\n var parts = /(http[s]?:\\/\\/)?(.*)?/.exec(url);\n parts[2] = parts[2].replace(/[\\\\\\/]+/g, '/');\n return (typeof parts[1] !== 'undefined')? parts[1] + parts[2] : parts[2];\n };\n\n Path.prototype.base = function(current) {\n var __this = this;\n return _.reduce(this.parentsArray(current), function(acum, elem) {\n var elemUrl;\n var elemSelfLink = __this.config.getUrlFromElem(elem);\n if (elemSelfLink) {\n if (__this.config.isAbsoluteUrl(elemSelfLink)) {\n return elemSelfLink;\n } else {\n elemUrl = elemSelfLink;\n }\n } else {\n elemUrl = elem[__this.config.restangularFields.route];\n\n if (elem[__this.config.restangularFields.restangularCollection]) {\n var ids = elem[__this.config.restangularFields.ids];\n if (ids) {\n elemUrl += '/' + ids.join(',');\n }\n } else {\n var elemId;\n if (__this.config.useCannonicalId) {\n elemId = __this.config.getCannonicalIdFromElem(elem);\n } else {\n elemId = __this.config.getIdFromElem(elem);\n }\n\n if (config.isValidId(elemId) && !elem.singleOne) {\n elemUrl += '/' + (__this.config.encodeIds ? encodeURIComponent(elemId) : elemId);\n }\n }\n }\n acum = acum.replace(/\\/$/, '') + '/' + elemUrl;\n return __this.normalizeUrl(acum);\n\n }, this.config.baseUrl);\n };\n\n\n\n Path.prototype.fetchUrl = function(current, what) {\n var baseUrl = this.base(current);\n if (what) {\n baseUrl += '/' + what;\n }\n return baseUrl;\n };\n\n Path.prototype.fetchRequestedUrl = function(current, what) {\n var url = this.fetchUrl(current, what);\n var params = current[config.restangularFields.reqParams];\n\n // From here on and until the end of fetchRequestedUrl,\n // the code has been kindly borrowed from angular.js\n // The reason for such code bloating is coherence:\n // If the user were to use this for cache management, the\n // serialization of parameters would need to be identical\n // to the one done by angular for cache keys to match.\n function sortedKeys(obj) {\n var keys = [];\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n keys.push(key);\n }\n }\n return keys.sort();\n }\n\n function forEachSorted(obj, iterator, context) {\n var keys = sortedKeys(obj);\n for ( var i = 0; i < keys.length; i++) {\n iterator.call(context, obj[keys[i]], keys[i]);\n }\n return keys;\n }\n\n function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }\n\n if (!params) { return url + (this.config.suffix || ''); }\n\n var parts = [];\n forEachSorted(params, function(value, key) {\n if (value === null || value === undefined) { return; }\n if (!angular.isArray(value)) { value = [value]; }\n\n angular.forEach(value, function(v) {\n if (angular.isObject(v)) {\n v = angular.toJson(v);\n }\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(v));\n });\n });\n\n return url + (this.config.suffix || '') + ((url.indexOf('?') === -1) ? '?' : '&') + parts.join('&');\n };\n\n config.urlCreatorFactory.path = Path;\n };\n\n var globalConfiguration = {};\n\n Configurer.init(this, globalConfiguration);\n\n\n\n this.$get = ['$http', '$q', function($http, $q) {\n\n function createServiceForConfiguration(config) {\n var service = {};\n\n var urlHandler = new config.urlCreatorFactory[config.urlCreator]();\n urlHandler.setConfig(config);\n\n function restangularizeBase(parent, elem, route, reqParams, fromServer) {\n elem[config.restangularFields.route] = route;\n elem[config.restangularFields.getRestangularUrl] = _.bind(urlHandler.fetchUrl, urlHandler, elem);\n elem[config.restangularFields.getRequestedUrl] = _.bind(urlHandler.fetchRequestedUrl, urlHandler, elem);\n elem[config.restangularFields.addRestangularMethod] = _.bind(addRestangularMethodFunction, elem);\n elem[config.restangularFields.clone] = _.bind(copyRestangularizedElement, elem, elem);\n elem[config.restangularFields.reqParams] = _.isEmpty(reqParams) ? null : reqParams;\n elem[config.restangularFields.withHttpConfig] = _.bind(withHttpConfig, elem);\n elem[config.restangularFields.plain] = _.bind(stripRestangular, elem, elem);\n\n // Tag element as restangularized\n elem[config.restangularFields.restangularized] = true;\n\n // RequestLess connection\n elem[config.restangularFields.one] = _.bind(one, elem, elem);\n elem[config.restangularFields.all] = _.bind(all, elem, elem);\n elem[config.restangularFields.several] = _.bind(several, elem, elem);\n elem[config.restangularFields.oneUrl] = _.bind(oneUrl, elem, elem);\n elem[config.restangularFields.allUrl] = _.bind(allUrl, elem, elem);\n\n elem[config.restangularFields.fromServer] = !!fromServer;\n\n if (parent && config.shouldSaveParent(route)) {\n var parentId = config.getIdFromElem(parent);\n var parentUrl = config.getUrlFromElem(parent);\n\n var restangularFieldsForParent = _.union(\n _.values( _.pick(config.restangularFields, ['route', 'singleOne', 'parentResource']) ),\n config.extraFields\n );\n var parentResource = _.pick(parent, restangularFieldsForParent);\n\n if (config.isValidId(parentId)) {\n config.setIdToElem(parentResource, parentId, route);\n }\n if (config.isValidId(parentUrl)) {\n config.setUrlToElem(parentResource, parentUrl, route);\n }\n\n elem[config.restangularFields.parentResource] = parentResource;\n } else {\n elem[config.restangularFields.parentResource] = null;\n }\n return elem;\n }\n\n function one(parent, route, id, singleOne) {\n var error;\n if (_.isNumber(route) || _.isNumber(parent)) {\n error = 'You\\'re creating a Restangular entity with the number ';\n error += 'instead of the route or the parent. For example, you can\\'t call .one(12).';\n throw new Error(error);\n }\n if (_.isUndefined(route)) {\n error = 'You\\'re creating a Restangular entity either without the path. ';\n error += 'For example you can\\'t call .one(). Please check if your arguments are valid.';\n throw new Error(error);\n }\n var elem = {};\n config.setIdToElem(elem, id, route);\n config.setFieldToElem(config.restangularFields.singleOne, elem, singleOne);\n return restangularizeElem(parent, elem , route, false);\n }\n\n\n function all(parent, route) {\n return restangularizeCollection(parent, [] , route, false);\n }\n\n function several(parent, route /*, ids */) {\n var collection = [];\n collection[config.restangularFields.ids] = Array.prototype.splice.call(arguments, 2);\n return restangularizeCollection(parent, collection , route, false);\n }\n\n function oneUrl(parent, route, url) {\n if (!route) {\n throw new Error('Route is mandatory when creating new Restangular objects.');\n }\n var elem = {};\n config.setUrlToElem(elem, url, route);\n return restangularizeElem(parent, elem , route, false);\n }\n\n\n function allUrl(parent, route, url) {\n if (!route) {\n throw new Error('Route is mandatory when creating new Restangular objects.');\n }\n var elem = {};\n config.setUrlToElem(elem, url, route);\n return restangularizeCollection(parent, elem , route, false);\n }\n // Promises\n function restangularizePromise(promise, isCollection, valueToFill) {\n promise.call = _.bind(promiseCall, promise);\n promise.get = _.bind(promiseGet, promise);\n promise[config.restangularFields.restangularCollection] = isCollection;\n if (isCollection) {\n promise.push = _.bind(promiseCall, promise, 'push');\n }\n promise.$object = valueToFill;\n if (config.restangularizePromiseInterceptor) {\n config.restangularizePromiseInterceptor(promise);\n }\n return promise;\n }\n\n function promiseCall(method) {\n var deferred = $q.defer();\n var callArgs = arguments;\n var filledValue = {};\n this.then(function(val) {\n var params = Array.prototype.slice.call(callArgs, 1);\n var func = val[method];\n func.apply(val, params);\n filledValue = val;\n deferred.resolve(val);\n });\n return restangularizePromise(deferred.promise, this[config.restangularFields.restangularCollection], filledValue);\n }\n\n function promiseGet(what) {\n var deferred = $q.defer();\n var filledValue = {};\n this.then(function(val) {\n filledValue = val[what];\n deferred.resolve(filledValue);\n });\n return restangularizePromise(deferred.promise, this[config.restangularFields.restangularCollection], filledValue);\n }\n\n function resolvePromise(deferred, response, data, filledValue) {\n _.extend(filledValue, data);\n\n // Trigger the full response interceptor.\n if (config.fullResponse) {\n return deferred.resolve(_.extend(response, {\n data: data\n }));\n } else {\n deferred.resolve(data);\n }\n }\n\n\n // Elements\n function stripRestangular(elem) {\n if (_.isArray(elem)) {\n var array = [];\n _.each(elem, function(value) {\n array.push(config.isRestangularized(value) ? stripRestangular(value) : value);\n });\n return array;\n } else {\n return _.omit(elem, _.values(_.omit(config.restangularFields, 'id')));\n }\n }\n\n function addCustomOperation(elem) {\n elem[config.restangularFields.customOperation] = _.bind(customFunction, elem);\n _.each(['put', 'post', 'get', 'delete'], function(oper) {\n _.each(['do', 'custom'], function(alias) {\n var callOperation = oper === 'delete' ? 'remove' : oper;\n var name = alias + oper.toUpperCase();\n var callFunction;\n\n if (callOperation !== 'put' && callOperation !== 'post') {\n callFunction = customFunction;\n } else {\n callFunction = function(operation, elem, path, params, headers) {\n return _.bind(customFunction, this)(operation, path, params, headers, elem);\n };\n }\n elem[name] = _.bind(callFunction, elem, callOperation);\n });\n });\n elem[config.restangularFields.customGETLIST] = _.bind(fetchFunction, elem);\n elem[config.restangularFields.doGETLIST] = elem[config.restangularFields.customGETLIST];\n }\n\n function copyRestangularizedElement(fromElement, toElement) {\n var copiedElement = angular.copy(fromElement, toElement);\n return restangularizeElem(copiedElement[config.restangularFields.parentResource],\n copiedElement, copiedElement[config.restangularFields.route], true);\n }\n\n function restangularizeElem(parent, element, route, fromServer, collection, reqParams) {\n var elem = config.onBeforeElemRestangularized(element, false, route);\n\n var localElem = restangularizeBase(parent, elem, route, reqParams, fromServer);\n\n if (config.useCannonicalId) {\n localElem[config.restangularFields.cannonicalId] = config.getIdFromElem(localElem);\n }\n\n if (collection) {\n localElem[config.restangularFields.getParentList] = function() {\n return collection;\n };\n }\n\n localElem[config.restangularFields.restangularCollection] = false;\n localElem[config.restangularFields.get] = _.bind(getFunction, localElem);\n localElem[config.restangularFields.getList] = _.bind(fetchFunction, localElem);\n localElem[config.restangularFields.put] = _.bind(putFunction, localElem);\n localElem[config.restangularFields.post] = _.bind(postFunction, localElem);\n localElem[config.restangularFields.remove] = _.bind(deleteFunction, localElem);\n localElem[config.restangularFields.head] = _.bind(headFunction, localElem);\n localElem[config.restangularFields.trace] = _.bind(traceFunction, localElem);\n localElem[config.restangularFields.options] = _.bind(optionsFunction, localElem);\n localElem[config.restangularFields.patch] = _.bind(patchFunction, localElem);\n localElem[config.restangularFields.save] = _.bind(save, localElem);\n\n addCustomOperation(localElem);\n return config.transformElem(localElem, false, route, service, true);\n }\n\n function restangularizeCollection(parent, element, route, fromServer, reqParams) {\n var elem = config.onBeforeElemRestangularized(element, true, route);\n\n var localElem = restangularizeBase(parent, elem, route, reqParams, fromServer);\n localElem[config.restangularFields.restangularCollection] = true;\n localElem[config.restangularFields.post] = _.bind(postFunction, localElem, null);\n localElem[config.restangularFields.remove] = _.bind(deleteFunction, localElem);\n localElem[config.restangularFields.head] = _.bind(headFunction, localElem);\n localElem[config.restangularFields.trace] = _.bind(traceFunction, localElem);\n localElem[config.restangularFields.putElement] = _.bind(putElementFunction, localElem);\n localElem[config.restangularFields.options] = _.bind(optionsFunction, localElem);\n localElem[config.restangularFields.patch] = _.bind(patchFunction, localElem);\n localElem[config.restangularFields.get] = _.bind(getById, localElem);\n localElem[config.restangularFields.getList] = _.bind(fetchFunction, localElem, null);\n\n addCustomOperation(localElem);\n return config.transformElem(localElem, true, route, service, true);\n }\n\n function restangularizeCollectionAndElements(parent, element, route) {\n var collection = restangularizeCollection(parent, element, route, false);\n _.each(collection, function(elem) {\n restangularizeElem(parent, elem, route, false);\n });\n return collection;\n }\n\n function getById(id, reqParams, headers){\n return this.customGET(id.toString(), reqParams, headers);\n }\n\n function putElementFunction(idx, params, headers) {\n var __this = this;\n var elemToPut = this[idx];\n var deferred = $q.defer();\n var filledArray = [];\n filledArray = config.transformElem(filledArray, true, elemToPut[config.restangularFields.route], service);\n elemToPut.put(params, headers).then(function(serverElem) {\n var newArray = copyRestangularizedElement(__this);\n newArray[idx] = serverElem;\n filledArray = newArray;\n deferred.resolve(newArray);\n }, function(response) {\n deferred.reject(response);\n });\n\n return restangularizePromise(deferred.promise, true, filledArray);\n }\n\n function parseResponse(resData, operation, route, fetchUrl, response, deferred) {\n var data = config.responseExtractor(resData, operation, route, fetchUrl, response, deferred);\n var etag = response.headers('ETag');\n if (data && etag) {\n data[config.restangularFields.etag] = etag;\n }\n return data;\n }\n\n\n function fetchFunction(what, reqParams, headers) {\n var __this = this;\n var deferred = $q.defer();\n var operation = 'getList';\n var url = urlHandler.fetchUrl(this, what);\n var whatFetched = what || __this[config.restangularFields.route];\n\n var request = config.fullRequestInterceptor(null, operation,\n whatFetched, url, headers || {}, reqParams || {}, this[config.restangularFields.httpConfig] || {});\n\n var filledArray = [];\n filledArray = config.transformElem(filledArray, true, whatFetched, service);\n\n var method = 'getList';\n\n if (config.jsonp) {\n method = 'jsonp';\n }\n\n var okCallback = function(response) {\n var resData = response.data;\n var fullParams = response.config.params;\n var data = parseResponse(resData, operation, whatFetched, url, response, deferred);\n\n // support empty response for getList() calls (some APIs respond with 204 and empty body)\n if (_.isUndefined(data) || '' === data) {\n data = [];\n }\n if (!_.isArray(data)) {\n throw new Error('Response for getList SHOULD be an array and not an object or something else');\n }\n var processedData = _.map(data, function(elem) {\n if (!__this[config.restangularFields.restangularCollection]) {\n return restangularizeElem(__this, elem, what, true, data);\n } else {\n return restangularizeElem(__this[config.restangularFields.parentResource],\n elem, __this[config.restangularFields.route], true, data);\n }\n });\n\n processedData = _.extend(data, processedData);\n\n if (!__this[config.restangularFields.restangularCollection]) {\n resolvePromise(\n deferred,\n response,\n restangularizeCollection(\n __this,\n processedData,\n what,\n true,\n fullParams\n ),\n filledArray\n );\n } else {\n resolvePromise(\n deferred,\n response,\n restangularizeCollection(\n __this[config.restangularFields.parentResource],\n processedData,\n __this[config.restangularFields.route],\n true,\n fullParams\n ),\n filledArray\n );\n }\n };\n\n urlHandler.resource(this, $http, request.httpConfig, request.headers, request.params, what,\n this[config.restangularFields.etag], operation)[method]().then(okCallback, function error(response) {\n if (response.status === 304 && __this[config.restangularFields.restangularCollection]) {\n resolvePromise(deferred, response, __this, filledArray);\n } else if ( _.every(config.errorInterceptors, function(cb) { return cb(response, deferred, okCallback) !== false; }) ) {\n // triggered if no callback returns false\n deferred.reject(response);\n }\n });\n\n return restangularizePromise(deferred.promise, true, filledArray);\n }\n\n function withHttpConfig(httpConfig) {\n this[config.restangularFields.httpConfig] = httpConfig;\n return this;\n }\n\n function save(params, headers) {\n if (this[config.restangularFields.fromServer]) {\n return this[config.restangularFields.put](params, headers);\n } else {\n return _.bind(elemFunction, this)('post', undefined, params, undefined, headers);\n }\n }\n\n function elemFunction(operation, what, params, obj, headers) {\n var __this = this;\n var deferred = $q.defer();\n var resParams = params || {};\n var route = what || this[config.restangularFields.route];\n var fetchUrl = urlHandler.fetchUrl(this, what);\n\n var callObj = obj || this;\n // fallback to etag on restangular object (since for custom methods we probably don't explicitly specify the etag field)\n var etag = callObj[config.restangularFields.etag] || (operation !== 'post' ? this[config.restangularFields.etag] : null);\n\n if (_.isObject(callObj) && config.isRestangularized(callObj)) {\n callObj = stripRestangular(callObj);\n }\n var request = config.fullRequestInterceptor(callObj, operation, route, fetchUrl,\n headers || {}, resParams || {}, this[config.restangularFields.httpConfig] || {});\n\n var filledObject = {};\n filledObject = config.transformElem(filledObject, false, route, service);\n\n var okCallback = function(response) {\n var resData = response.data;\n var fullParams = response.config.params;\n var elem = parseResponse(resData, operation, route, fetchUrl, response, deferred);\n if (elem) {\n var data;\n if (operation === 'post' && !__this[config.restangularFields.restangularCollection]) {\n data = restangularizeElem(\n __this[config.restangularFields.parentResource],\n elem,\n route,\n true,\n null,\n fullParams\n );\n resolvePromise(deferred, response, data, filledObject);\n } else {\n data = restangularizeElem(\n __this[config.restangularFields.parentResource],\n elem,\n __this[config.restangularFields.route],\n true,\n null,\n fullParams\n );\n\n data[config.restangularFields.singleOne] = __this[config.restangularFields.singleOne];\n resolvePromise(deferred, response, data, filledObject);\n }\n\n } else {\n resolvePromise(deferred, response, undefined, filledObject);\n }\n };\n\n var errorCallback = function(response) {\n if (response.status === 304 && config.isSafe(operation)) {\n resolvePromise(deferred, response, __this, filledObject);\n } else if ( _.every(config.errorInterceptors, function(cb) { return cb(response, deferred, okCallback) !== false; }) ) {\n // triggered if no callback returns false\n deferred.reject(response);\n }\n };\n // Overriding HTTP Method\n var callOperation = operation;\n var callHeaders = _.extend({}, request.headers);\n var isOverrideOperation = config.isOverridenMethod(operation);\n if (isOverrideOperation) {\n callOperation = 'post';\n callHeaders = _.extend(callHeaders, {'X-HTTP-Method-Override': operation === 'remove' ? 'DELETE' : operation.toUpperCase()});\n } else if (config.jsonp && callOperation === 'get') {\n callOperation = 'jsonp';\n }\n\n if (config.isSafe(operation)) {\n if (isOverrideOperation) {\n urlHandler.resource(this, $http, request.httpConfig, callHeaders, request.params,\n what, etag, callOperation)[callOperation]({}).then(okCallback, errorCallback);\n } else {\n urlHandler.resource(this, $http, request.httpConfig, callHeaders, request.params,\n what, etag, callOperation)[callOperation]().then(okCallback, errorCallback);\n }\n } else {\n urlHandler.resource(this, $http, request.httpConfig, callHeaders, request.params,\n what, etag, callOperation)[callOperation](request.element).then(okCallback, errorCallback);\n }\n\n return restangularizePromise(deferred.promise, false, filledObject);\n }\n\n function getFunction(params, headers) {\n return _.bind(elemFunction, this)('get', undefined, params, undefined, headers);\n }\n\n function deleteFunction(params, headers) {\n return _.bind(elemFunction, this)('remove', undefined, params, undefined, headers);\n }\n\n function putFunction(params, headers) {\n return _.bind(elemFunction, this)('put', undefined, params, undefined, headers);\n }\n\n function postFunction(what, elem, params, headers) {\n return _.bind(elemFunction, this)('post', what, params, elem, headers);\n }\n\n function headFunction(params, headers) {\n return _.bind(elemFunction, this)('head', undefined, params, undefined, headers);\n }\n\n function traceFunction(params, headers) {\n return _.bind(elemFunction, this)('trace', undefined, params, undefined, headers);\n }\n\n function optionsFunction(params, headers) {\n return _.bind(elemFunction, this)('options', undefined, params, undefined, headers);\n }\n\n function patchFunction(elem, params, headers) {\n return _.bind(elemFunction, this)('patch', undefined, params, elem, headers);\n }\n\n function customFunction(operation, path, params, headers, elem) {\n return _.bind(elemFunction, this)(operation, path, params, elem, headers);\n }\n\n function addRestangularMethodFunction(name, operation, path, defaultParams, defaultHeaders, defaultElem) {\n var bindedFunction;\n if (operation === 'getList') {\n bindedFunction = _.bind(fetchFunction, this, path);\n } else {\n bindedFunction = _.bind(customFunction, this, operation, path);\n }\n\n var createdFunction = function(params, headers, elem) {\n var callParams = _.defaults({\n params: params,\n headers: headers,\n elem: elem\n }, {\n params: defaultParams,\n headers: defaultHeaders,\n elem: defaultElem\n });\n return bindedFunction(callParams.params, callParams.headers, callParams.elem);\n };\n\n if (config.isSafe(operation)) {\n this[name] = createdFunction;\n } else {\n this[name] = function(elem, params, headers) {\n return createdFunction(params, headers, elem);\n };\n }\n }\n\n function withConfigurationFunction(configurer) {\n var newConfig = angular.copy(_.omit(config, 'configuration'));\n Configurer.init(newConfig, newConfig);\n configurer(newConfig);\n return createServiceForConfiguration(newConfig);\n }\n\n function toService(route, parent) {\n var knownCollectionMethods = _.values(config.restangularFields);\n var serv = {};\n var collection = (parent || service).all(route);\n serv.one = _.bind(one, (parent || service), parent, route);\n serv.post = _.bind(collection.post, collection);\n serv.getList = _.bind(collection.getList, collection);\n\n for (var prop in collection) {\n if (collection.hasOwnProperty(prop) && _.isFunction(collection[prop]) && !_.includes(knownCollectionMethods, prop)) {\n serv[prop] = _.bind(collection[prop], collection);\n }\n }\n\n return serv;\n }\n\n\n Configurer.init(service, config);\n\n service.copy = _.bind(copyRestangularizedElement, service);\n\n service.service = _.bind(toService, service);\n\n service.withConfig = _.bind(withConfigurationFunction, service);\n\n service.one = _.bind(one, service, null);\n\n service.all = _.bind(all, service, null);\n\n service.several = _.bind(several, service, null);\n\n service.oneUrl = _.bind(oneUrl, service, null);\n\n service.allUrl = _.bind(allUrl, service, null);\n\n service.stripRestangular = _.bind(stripRestangular, service);\n\n service.restangularizeElement = _.bind(restangularizeElem, service);\n\n service.restangularizeCollection = _.bind(restangularizeCollectionAndElements, service);\n\n return service;\n }\n\n return createServiceForConfiguration(globalConfiguration);\n }];\n});\n\n})();\n\n/**\n * State-based routing for AngularJS\n * @version v0.2.18\n * @link http://angular-ui.github.com/\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */\n\n/* commonjs package manager support (eg componentjs) */\nif (typeof module !== \"undefined\" && typeof exports !== \"undefined\" && module.exports === exports){\n module.exports = 'ui.router';\n}\n\n(function (window, angular, undefined) {\n/*jshint globalstrict:true*/\n/*global angular:false*/\n'use strict';\n\nvar isDefined = angular.isDefined,\n isFunction = angular.isFunction,\n isString = angular.isString,\n isObject = angular.isObject,\n isArray = angular.isArray,\n forEach = angular.forEach,\n extend = angular.extend,\n copy = angular.copy,\n toJson = angular.toJson;\n\nfunction inherit(parent, extra) {\n return extend(new (extend(function() {}, { prototype: parent }))(), extra);\n}\n\nfunction merge(dst) {\n forEach(arguments, function(obj) {\n if (obj !== dst) {\n forEach(obj, function(value, key) {\n if (!dst.hasOwnProperty(key)) dst[key] = value;\n });\n }\n });\n return dst;\n}\n\n/**\n * Finds the common ancestor path between two states.\n *\n * @param {Object} first The first state.\n * @param {Object} second The second state.\n * @return {Array} Returns an array of state names in descending order, not including the root.\n */\nfunction ancestors(first, second) {\n var path = [];\n\n for (var n in first.path) {\n if (first.path[n] !== second.path[n]) break;\n path.push(first.path[n]);\n }\n return path;\n}\n\n/**\n * IE8-safe wrapper for `Object.keys()`.\n *\n * @param {Object} object A JavaScript object.\n * @return {Array} Returns the keys of the object as an array.\n */\nfunction objectKeys(object) {\n if (Object.keys) {\n return Object.keys(object);\n }\n var result = [];\n\n forEach(object, function(val, key) {\n result.push(key);\n });\n return result;\n}\n\n/**\n * IE8-safe wrapper for `Array.prototype.indexOf()`.\n *\n * @param {Array} array A JavaScript array.\n * @param {*} value A value to search the array for.\n * @return {Number} Returns the array index value of `value`, or `-1` if not present.\n */\nfunction indexOf(array, value) {\n if (Array.prototype.indexOf) {\n return array.indexOf(value, Number(arguments[2]) || 0);\n }\n var len = array.length >>> 0, from = Number(arguments[2]) || 0;\n from = (from < 0) ? Math.ceil(from) : Math.floor(from);\n\n if (from < 0) from += len;\n\n for (; from < len; from++) {\n if (from in array && array[from] === value) return from;\n }\n return -1;\n}\n\n/**\n * Merges a set of parameters with all parameters inherited between the common parents of the\n * current state and a given destination state.\n *\n * @param {Object} currentParams The value of the current state parameters ($stateParams).\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\n * @param {Object} $current Internal definition of object representing the current state.\n * @param {Object} $to Internal definition of object representing state to transition to.\n */\nfunction inheritParams(currentParams, newParams, $current, $to) {\n var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];\n\n for (var i in parents) {\n if (!parents[i] || !parents[i].params) continue;\n parentParams = objectKeys(parents[i].params);\n if (!parentParams.length) continue;\n\n for (var j in parentParams) {\n if (indexOf(inheritList, parentParams[j]) >= 0) continue;\n inheritList.push(parentParams[j]);\n inherited[parentParams[j]] = currentParams[parentParams[j]];\n }\n }\n return extend({}, inherited, newParams);\n}\n\n/**\n * Performs a non-strict comparison of the subset of two objects, defined by a list of keys.\n *\n * @param {Object} a The first object.\n * @param {Object} b The second object.\n * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,\n * it defaults to the list of keys in `a`.\n * @return {Boolean} Returns `true` if the keys match, otherwise `false`.\n */\nfunction equalForKeys(a, b, keys) {\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n }\n\n for (var i=0; i<keys.length; i++) {\n var k = keys[i];\n if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n }\n return true;\n}\n\n/**\n * Returns the subset of an object, based on a list of keys.\n *\n * @param {Array} keys\n * @param {Object} values\n * @return {Boolean} Returns a subset of `values`.\n */\nfunction filterByKeys(keys, values) {\n var filtered = {};\n\n forEach(keys, function (name) {\n filtered[name] = values[name];\n });\n return filtered;\n}\n\n// like _.indexBy\n// when you know that your index values will be unique, or you want last-one-in to win\nfunction indexBy(array, propName) {\n var result = {};\n forEach(array, function(item) {\n result[item[propName]] = item;\n });\n return result;\n}\n\n// extracted from underscore.js\n// Return a copy of the object only containing the whitelisted properties.\nfunction pick(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n forEach(keys, function(key) {\n if (key in obj) copy[key] = obj[key];\n });\n return copy;\n}\n\n// extracted from underscore.js\n// Return a copy of the object omitting the blacklisted properties.\nfunction omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}\n\nfunction pluck(collection, key) {\n var result = isArray(collection) ? [] : {};\n\n forEach(collection, function(val, i) {\n result[i] = isFunction(key) ? key(val) : val[key];\n });\n return result;\n}\n\nfunction filter(collection, callback) {\n var array = isArray(collection);\n var result = array ? [] : {};\n forEach(collection, function(val, i) {\n if (callback(val, i)) {\n result[array ? result.length : i] = val;\n }\n });\n return result;\n}\n\nfunction map(collection, callback) {\n var result = isArray(collection) ? [] : {};\n\n forEach(collection, function(val, i) {\n result[i] = callback(val, i);\n });\n return result;\n}\n\n/**\n * @ngdoc overview\n * @name ui.router.util\n *\n * @description\n * # ui.router.util sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n *\n */\nangular.module('ui.router.util', ['ng']);\n\n/**\n * @ngdoc overview\n * @name ui.router.router\n * \n * @requires ui.router.util\n *\n * @description\n * # ui.router.router sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n */\nangular.module('ui.router.router', ['ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router.state\n * \n * @requires ui.router.router\n * @requires ui.router.util\n *\n * @description\n * # ui.router.state sub-module\n *\n * This module is a dependency of the main ui.router module. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n * \n */\nangular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router\n *\n * @requires ui.router.state\n *\n * @description\n * # ui.router\n * \n * ## The main module for ui.router \n * There are several sub-modules included with the ui.router module, however only this module is needed\n * as a dependency within your angular app. The other modules are for organization purposes. \n *\n * The modules are:\n * * ui.router - the main \"umbrella\" module\n * * ui.router.router - \n * \n * *You'll need to include **only** this module as the dependency within your angular app.*\n * \n * <pre>\n * <!doctype html>\n * <html ng-app=\"myApp\">\n * <head>\n * <script src=\"js/angular.js\"></script>\n * <!-- Include the ui-router script -->\n * <script src=\"js/angular-ui-router.min.js\"></script>\n * <script>\n * // ...and add 'ui.router' as a dependency\n * var myApp = angular.module('myApp', ['ui.router']);\n * </script>\n * </head>\n * <body>\n * </body>\n * </html>\n * </pre>\n */\nangular.module('ui.router', ['ui.router.state']);\n\nangular.module('ui.router.compat', ['ui.router']);\n\n/**\n * @ngdoc object\n * @name ui.router.util.$resolve\n *\n * @requires $q\n * @requires $injector\n *\n * @description\n * Manages resolution of (acyclic) graphs of promises.\n */\n$Resolve.$inject = ['$q', '$injector'];\nfunction $Resolve( $q, $injector) {\n \n var VISIT_IN_PROGRESS = 1,\n VISIT_DONE = 2,\n NOTHING = {},\n NO_DEPENDENCIES = [],\n NO_LOCALS = NOTHING,\n NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });\n \n\n /**\n * @ngdoc function\n * @name ui.router.util.$resolve#study\n * @methodOf ui.router.util.$resolve\n *\n * @description\n * Studies a set of invocables that are likely to be used multiple times.\n * <pre>\n * $resolve.study(invocables)(locals, parent, self)\n * </pre>\n * is equivalent to\n * <pre>\n * $resolve.resolve(invocables, locals, parent, self)\n * </pre>\n * but the former is more efficient (in fact `resolve` just calls `study` \n * internally).\n *\n * @param {object} invocables Invocable objects\n * @return {function} a function to pass in locals, parent and self\n */\n this.study = function (invocables) {\n if (!isObject(invocables)) throw new Error(\"'invocables' must be an object\");\n var invocableKeys = objectKeys(invocables || {});\n \n // Perform a topological sort of invocables to build an ordered plan\n var plan = [], cycle = [], visited = {};\n function visit(value, key) {\n if (visited[key] === VISIT_DONE) return;\n \n cycle.push(key);\n if (visited[key] === VISIT_IN_PROGRESS) {\n cycle.splice(0, indexOf(cycle, key));\n throw new Error(\"Cyclic dependency: \" + cycle.join(\" -> \"));\n }\n visited[key] = VISIT_IN_PROGRESS;\n \n if (isString(value)) {\n plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);\n } else {\n var params = $injector.annotate(value);\n forEach(params, function (param) {\n if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);\n });\n plan.push(key, value, params);\n }\n \n cycle.pop();\n visited[key] = VISIT_DONE;\n }\n forEach(invocables, visit);\n invocables = cycle = visited = null; // plan is all that's required\n \n function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }\n \n return function (locals, parent, self) {\n if (isResolve(locals) && self === undefined) {\n self = parent; parent = locals; locals = null;\n }\n if (!locals) locals = NO_LOCALS;\n else if (!isObject(locals)) {\n throw new Error(\"'locals' must be an object\");\n } \n if (!parent) parent = NO_PARENT;\n else if (!isResolve(parent)) {\n throw new Error(\"'parent' must be a promise returned by $resolve.resolve()\");\n }\n \n // To complete the overall resolution, we have to wait for the parent\n // promise and for the promise for each invokable in our plan.\n var resolution = $q.defer(),\n result = resolution.promise,\n promises = result.$$promises = {},\n values = extend({}, locals),\n wait = 1 + plan.length/3,\n merged = false;\n \n function done() {\n // Merge parent values we haven't got yet and publish our own $$values\n if (!--wait) {\n if (!merged) merge(values, parent.$$values); \n result.$$values = values;\n result.$$promises = result.$$promises || true; // keep for isResolve()\n delete result.$$inheritedValues;\n resolution.resolve(values);\n }\n }\n \n function fail(reason) {\n result.$$failure = reason;\n resolution.reject(reason);\n }\n\n // Short-circuit if parent has already failed\n if (isDefined(parent.$$failure)) {\n fail(parent.$$failure);\n return result;\n }\n \n if (parent.$$inheritedValues) {\n merge(values, omit(parent.$$inheritedValues, invocableKeys));\n }\n\n // Merge parent values if the parent has already resolved, or merge\n // parent promises and wait if the parent resolve is still in progress.\n extend(promises, parent.$$promises);\n if (parent.$$values) {\n merged = merge(values, omit(parent.$$values, invocableKeys));\n result.$$inheritedValues = omit(parent.$$values, invocableKeys);\n done();\n } else {\n if (parent.$$inheritedValues) {\n result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);\n } \n parent.then(done, fail);\n }\n \n // Process each invocable in the plan, but ignore any where a local of the same name exists.\n for (var i=0, ii=plan.length; i<ii; i+=3) {\n if (locals.hasOwnProperty(plan[i])) done();\n else invoke(plan[i], plan[i+1], plan[i+2]);\n }\n \n function invoke(key, invocable, params) {\n // Create a deferred for this invocation. Failures will propagate to the resolution as well.\n var invocation = $q.defer(), waitParams = 0;\n function onfailure(reason) {\n invocation.reject(reason);\n fail(reason);\n }\n // Wait for any parameter that we have a promise for (either from parent or from this\n // resolve; in that case study() will have made sure it's ordered before us in the plan).\n forEach(params, function (dep) {\n if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) {\n waitParams++;\n promises[dep].then(function (result) {\n values[dep] = result;\n if (!(--waitParams)) proceed();\n }, onfailure);\n }\n });\n if (!waitParams) proceed();\n function proceed() {\n if (isDefined(result.$$failure)) return;\n try {\n invocation.resolve($injector.invoke(invocable, self, values));\n invocation.promise.then(function (result) {\n values[key] = result;\n done();\n }, onfailure);\n } catch (e) {\n onfailure(e);\n }\n }\n // Publish promise synchronously; invocations further down in the plan may depend on it.\n promises[key] = invocation.promise;\n }\n \n return result;\n };\n };\n \n /**\n * @ngdoc function\n * @name ui.router.util.$resolve#resolve\n * @methodOf ui.router.util.$resolve\n *\n * @description\n * Resolves a set of invocables. An invocable is a function to be invoked via \n * `$injector.invoke()`, and can have an arbitrary number of dependencies. \n * An invocable can either return a value directly,\n * or a `$q` promise. If a promise is returned it will be resolved and the \n * resulting value will be used instead. Dependencies of invocables are resolved \n * (in this order of precedence)\n *\n * - from the specified `locals`\n * - from another invocable that is part of this `$resolve` call\n * - from an invocable that is inherited from a `parent` call to `$resolve` \n * (or recursively\n * - from any ancestor `$resolve` of that parent).\n *\n * The return value of `$resolve` is a promise for an object that contains \n * (in this order of precedence)\n *\n * - any `locals` (if specified)\n * - the resolved return values of all injectables\n * - any values inherited from a `parent` call to `$resolve` (if specified)\n *\n * The promise will resolve after the `parent` promise (if any) and all promises \n * returned by injectables have been resolved. If any invocable \n * (or `$injector.invoke`) throws an exception, or if a promise returned by an \n * invocable is rejected, the `$resolve` promise is immediately rejected with the \n * same error. A rejection of a `parent` promise (if specified) will likewise be \n * propagated immediately. Once the `$resolve` promise has been rejected, no \n * further invocables will be called.\n * \n * Cyclic dependencies between invocables are not permitted and will cause `$resolve`\n * to throw an error. As a special case, an injectable can depend on a parameter \n * with the same name as the injectable, which will be fulfilled from the `parent` \n * injectable of the same name. This allows inherited values to be decorated. \n * Note that in this case any other injectable in the same `$resolve` with the same\n * dependency would see the decorated value, not the inherited value.\n *\n * Note that missing dependencies -- unlike cyclic dependencies -- will cause an \n * (asynchronous) rejection of the `$resolve` promise rather than a (synchronous) \n * exception.\n *\n * Invocables are invoked eagerly as soon as all dependencies are available. \n * This is true even for dependencies inherited from a `parent` call to `$resolve`.\n *\n * As a special case, an invocable can be a string, in which case it is taken to \n * be a service name to be passed to `$injector.get()`. This is supported primarily \n * for backwards-compatibility with the `resolve` property of `$routeProvider` \n * routes.\n *\n * @param {object} invocables functions to invoke or \n * `$injector` services to fetch.\n * @param {object} locals values to make available to the injectables\n * @param {object} parent a promise returned by another call to `$resolve`.\n * @param {object} self the `this` for the invoked methods\n * @return {object} Promise for an object that contains the resolved return value\n * of all invocables, as well as any inherited and local values.\n */\n this.resolve = function (invocables, locals, parent, self) {\n return this.study(invocables)(locals, parent, self);\n };\n}\n\nangular.module('ui.router.util').service('$resolve', $Resolve);\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$templateFactory\n *\n * @requires $http\n * @requires $templateCache\n * @requires $injector\n *\n * @description\n * Service. Manages loading of templates.\n */\n$TemplateFactory.$inject = ['$http', '$templateCache', '$injector'];\nfunction $TemplateFactory( $http, $templateCache, $injector) {\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactory#fromConfig\n * @methodOf ui.router.util.$templateFactory\n *\n * @description\n * Creates a template from a configuration object. \n *\n * @param {object} config Configuration object for which to load a template. \n * The following properties are search in the specified order, and the first one \n * that is defined is used to create the template:\n *\n * @param {string|object} config.template html string template or function to \n * load via {@link ui.router.util.$templateFactory#fromString fromString}.\n * @param {string|object} config.templateUrl url to load or a function returning \n * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.\n * @param {Function} config.templateProvider function to invoke via \n * {@link ui.router.util.$templateFactory#fromProvider fromProvider}.\n * @param {object} params Parameters to pass to the template function.\n * @param {object} locals Locals to pass to `invoke` if the template is loaded \n * via a `templateProvider`. Defaults to `{ params: params }`.\n *\n * @return {string|object} The template html as a string, or a promise for \n * that string,or `null` if no template is configured.\n */\n this.fromConfig = function (config, params, locals) {\n return (\n isDefined(config.template) ? this.fromString(config.template, params) :\n isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :\n isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :\n null\n );\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactory#fromString\n * @methodOf ui.router.util.$templateFactory\n *\n * @description\n * Creates a template from a string or a function returning a string.\n *\n * @param {string|object} template html template as a string or function that \n * returns an html template as a string.\n * @param {object} params Parameters to pass to the template function.\n *\n * @return {string|object} The template html as a string, or a promise for that \n * string.\n */\n this.fromString = function (template, params) {\n return isFunction(template) ? template(params) : template;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactory#fromUrl\n * @methodOf ui.router.util.$templateFactory\n * \n * @description\n * Loads a template from the a URL via `$http` and `$templateCache`.\n *\n * @param {string|Function} url url of the template to load, or a function \n * that returns a url.\n * @param {Object} params Parameters to pass to the url function.\n * @return {string|Promise.<string>} The template html as a string, or a promise \n * for that string.\n */\n this.fromUrl = function (url, params) {\n if (isFunction(url)) url = url(params);\n if (url == null) return null;\n else return $http\n .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})\n .then(function(response) { return response.data; });\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactory#fromProvider\n * @methodOf ui.router.util.$templateFactory\n *\n * @description\n * Creates a template by invoking an injectable provider function.\n *\n * @param {Function} provider Function to invoke via `$injector.invoke`\n * @param {Object} params Parameters for the template.\n * @param {Object} locals Locals to pass to `invoke`. Defaults to \n * `{ params: params }`.\n * @return {string|Promise.<string>} The template html as a string, or a promise \n * for that string.\n */\n this.fromProvider = function (provider, params, locals) {\n return $injector.invoke(provider, null, locals || { params: params });\n };\n}\n\nangular.module('ui.router.util').service('$templateFactory', $TemplateFactory);\n\nvar $$UMFP; // reference to $UrlMatcherFactoryProvider\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:UrlMatcher\n *\n * @description\n * Matches URLs against patterns and extracts named parameters from the path or the search\n * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list\n * of search parameters. Multiple search parameter names are separated by '&'. Search parameters\n * do not influence whether or not a URL is matched, but their values are passed through into\n * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.\n *\n * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace\n * syntax, which optionally allows a regular expression for the parameter to be specified:\n *\n * * `':'` name - colon placeholder\n * * `'*'` name - catch-all placeholder\n * * `'{' name '}'` - curly placeholder\n * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the\n * regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n *\n * Parameter names may contain only word characters (latin letters, digits, and underscore) and\n * must be unique within the pattern (across both path and search parameters). For colon\n * placeholders or curly placeholders without an explicit regexp, a path parameter matches any\n * number of characters other than '/'. For catch-all placeholders the path parameter matches\n * any number of characters.\n *\n * Examples:\n *\n * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\n * trailing slashes, and patterns have to match the entire path, not just a prefix.\n * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\n * '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\n * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\n * * `'/user/{id:[^/]*}'` - Same as the previous example.\n * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\n * parameter consists of 1 to 8 hex digits.\n * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\n * path into the parameter 'path'.\n * * `'/files/*path'` - ditto.\n * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\n * in the built-in `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start\n *\n * @param {string} pattern The pattern to compile into a matcher.\n * @param {Object} config A configuration object hash:\n * @param {Object=} parentMatcher Used to concatenate the pattern/config onto\n * an existing UrlMatcher\n *\n * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.\n * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.\n *\n * @property {string} prefix A static prefix of this pattern. The matcher guarantees that any\n * URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns\n * non-null) will start with this prefix.\n *\n * @property {string} source The pattern that was passed into the constructor\n *\n * @property {string} sourcePath The path portion of the source property\n *\n * @property {string} sourceSearch The search portion of the source property\n *\n * @property {string} regex The constructed regex that will be used to match against the url when\n * it is time to determine which url will match.\n *\n * @returns {Object} New `UrlMatcher` object\n */\nfunction UrlMatcher(pattern, config, parentMatcher) {\n config = extend({ params: {} }, isObject(config) ? config : {});\n\n // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\n // '*' name\n // ':' name\n // '{' name '}'\n // '{' name ':' regexp '}'\n // The regular expression is somewhat complicated due to the need to allow curly braces\n // inside the regular expression. The placeholder regexp breaks down as follows:\n // ([:*])([\\w\\[\\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)\n // \\{([\\w\\[\\]]+)(?:\\:\\s*( ... ))?\\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\n // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either\n // [^{}\\\\]+ - anything other than curly braces or backslash\n // \\\\. - a backslash escape\n // \\{(?:[^{}\\\\]+|\\\\.)*\\} - a matched set of curly braces containing other atoms\n var placeholder = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n searchPlaceholder = /([:]?)([\\w\\[\\].-]+)|\\{([\\w\\[\\].-]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n compiled = '^', last = 0, m,\n segments = this.segments = [],\n parentParams = parentMatcher ? parentMatcher.params : {},\n params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),\n paramNames = [];\n\n function addParameter(id, type, config, location) {\n paramNames.push(id);\n if (parentParams[id]) return parentParams[id];\n if (!/^\\w+([-.]+\\w+)*(?:\\[\\])?$/.test(id)) throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n if (params[id]) throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n params[id] = new $$UMFP.Param(id, type, config, location);\n return params[id];\n }\n\n function quoteRegExp(string, pattern, squash, optional) {\n var surroundPattern = ['',''], result = string.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, \"\\\\$&\");\n if (!pattern) return result;\n switch(squash) {\n case false: surroundPattern = ['(', ')' + (optional ? \"?\" : \"\")]; break;\n case true:\n result = result.replace(/\\/$/, '');\n surroundPattern = ['(?:\\/(', ')|\\/)?'];\n break;\n default: surroundPattern = ['(' + squash + \"|\", ')?']; break;\n }\n return result + surroundPattern[0] + pattern + surroundPattern[1];\n }\n\n this.source = pattern;\n\n // Split into static segments separated by path parameter placeholders.\n // The number of segments is always 1 more than the number of parameters.\n function matchDetails(m, isSearch) {\n var id, regexp, segment, type, cfg, arrayMode;\n id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null\n cfg = config.params[id];\n segment = pattern.substring(last, m.index);\n regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);\n\n if (regexp) {\n type = $$UMFP.type(regexp) || inherit($$UMFP.type(\"string\"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });\n }\n\n return {\n id: id, regexp: regexp, segment: segment, type: type, cfg: cfg\n };\n }\n\n var p, param, segment;\n while ((m = placeholder.exec(pattern))) {\n p = matchDetails(m, false);\n if (p.segment.indexOf('?') >= 0) break; // we're into the search part\n\n param = addParameter(p.id, p.type, p.cfg, \"path\");\n compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional);\n segments.push(p.segment);\n last = placeholder.lastIndex;\n }\n segment = pattern.substring(last);\n\n // Find any search parameter names and remove them from the last segment\n var i = segment.indexOf('?');\n\n if (i >= 0) {\n var search = this.sourceSearch = segment.substring(i);\n segment = segment.substring(0, i);\n this.sourcePath = pattern.substring(0, last + i);\n\n if (search.length > 0) {\n last = 0;\n while ((m = searchPlaceholder.exec(search))) {\n p = matchDetails(m, true);\n param = addParameter(p.id, p.type, p.cfg, \"search\");\n last = placeholder.lastIndex;\n // check if ?&\n }\n }\n } else {\n this.sourcePath = pattern;\n this.sourceSearch = '';\n }\n\n compiled += quoteRegExp(segment) + (config.strict === false ? '\\/?' : '') + '$';\n segments.push(segment);\n\n this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);\n this.prefix = segments[0];\n this.$$paramNames = paramNames;\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#concat\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns a new matcher for a pattern constructed by appending the path part and adding the\n * search parameters of the specified pattern to this pattern. The current pattern is not\n * modified. This can be understood as creating a pattern for URLs that are relative to (or\n * suffixes of) the current pattern.\n *\n * @example\n * The following two matchers are equivalent:\n * <pre>\n * new UrlMatcher('/user/{id}?q').concat('/details?date');\n * new UrlMatcher('/user/{id}/details?q&date');\n * </pre>\n *\n * @param {string} pattern The pattern to append.\n * @param {Object} config An object hash of the configuration for the matcher.\n * @returns {UrlMatcher} A matcher for the concatenated pattern.\n */\nUrlMatcher.prototype.concat = function (pattern, config) {\n // Because order of search parameters is irrelevant, we can add our own search\n // parameters to the end of the new pattern. Parse the new pattern by itself\n // and then join the bits together, but it's much easier to do this on a string level.\n var defaultConfig = {\n caseInsensitive: $$UMFP.caseInsensitive(),\n strict: $$UMFP.strictMode(),\n squash: $$UMFP.defaultSquashPolicy()\n };\n return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);\n};\n\nUrlMatcher.prototype.toString = function () {\n return this.source;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#exec\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Tests the specified path against this matcher, and returns an object containing the captured\n * parameter values, or null if the path does not match. The returned object contains the values\n * of any search parameters that are mentioned in the pattern, but their value may be null if\n * they are not present in `searchParams`. This means that search parameters are always treated\n * as optional.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\n * x: '1', q: 'hello'\n * });\n * // returns { id: 'bob', q: 'hello', r: null }\n * </pre>\n *\n * @param {string} path The URL path to match, e.g. `$location.path()`.\n * @param {Object} searchParams URL search parameters, e.g. `$location.search()`.\n * @returns {Object} The captured parameter values.\n */\nUrlMatcher.prototype.exec = function (path, searchParams) {\n var m = this.regexp.exec(path);\n if (!m) return null;\n searchParams = searchParams || {};\n\n var paramNames = this.parameters(), nTotal = paramNames.length,\n nPath = this.segments.length - 1,\n values = {}, i, j, cfg, paramName;\n\n if (nPath !== m.length - 1) throw new Error(\"Unbalanced capture group in route '\" + this.source + \"'\");\n\n function decodePathArray(string) {\n function reverseString(str) { return str.split(\"\").reverse().join(\"\"); }\n function unquoteDashes(str) { return str.replace(/\\\\-/g, \"-\"); }\n\n var split = reverseString(string).split(/-(?!\\\\)/);\n var allReversed = map(split, reverseString);\n return map(allReversed, unquoteDashes).reverse();\n }\n\n var param, paramVal;\n for (i = 0; i < nPath; i++) {\n paramName = paramNames[i];\n param = this.params[paramName];\n paramVal = m[i+1];\n // if the param value matches a pre-replace pair, replace the value before decoding.\n for (j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n }\n if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);\n if (isDefined(paramVal)) paramVal = param.type.decode(paramVal);\n values[paramName] = param.value(paramVal);\n }\n for (/**/; i < nTotal; i++) {\n paramName = paramNames[i];\n values[paramName] = this.params[paramName].value(searchParams[paramName]);\n param = this.params[paramName];\n paramVal = searchParams[paramName];\n for (j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n }\n if (isDefined(paramVal)) paramVal = param.type.decode(paramVal);\n values[paramName] = param.value(paramVal);\n }\n\n return values;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#parameters\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns the names of all path and search parameters of this pattern in an unspecified order.\n *\n * @returns {Array.<string>} An array of parameter names. Must be treated as read-only. If the\n * pattern has no parameters, an empty array is returned.\n */\nUrlMatcher.prototype.parameters = function (param) {\n if (!isDefined(param)) return this.$$paramNames;\n return this.params[param] || null;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#validates\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Checks an object hash of parameters to validate their correctness according to the parameter\n * types of this `UrlMatcher`.\n *\n * @param {Object} params The object hash of parameters to validate.\n * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.\n */\nUrlMatcher.prototype.validates = function (params) {\n return this.params.$$validates(params);\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#format\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Creates a URL that matches this pattern by substituting the specified values\n * for the path and search parameters. Null values for path parameters are\n * treated as empty strings.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n * // returns '/user/bob?q=yes'\n * </pre>\n *\n * @param {Object} values the values to substitute for the parameters in this pattern.\n * @returns {string} the formatted URL (path and optionally search part).\n */\nUrlMatcher.prototype.format = function (values) {\n values = values || {};\n var segments = this.segments, params = this.parameters(), paramset = this.params;\n if (!this.validates(values)) return null;\n\n var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];\n\n function encodeDashes(str) { // Replace dashes with encoded \"\\-\"\n return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });\n }\n\n for (i = 0; i < nTotal; i++) {\n var isPathParam = i < nPath;\n var name = params[i], param = paramset[name], value = param.value(values[name]);\n var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);\n var squash = isDefaultValue ? param.squash : false;\n var encoded = param.type.encode(value);\n\n if (isPathParam) {\n var nextSegment = segments[i + 1];\n var isFinalPathParam = i + 1 === nPath;\n\n if (squash === false) {\n if (encoded != null) {\n if (isArray(encoded)) {\n result += map(encoded, encodeDashes).join(\"-\");\n } else {\n result += encodeURIComponent(encoded);\n }\n }\n result += nextSegment;\n } else if (squash === true) {\n var capture = result.match(/\\/$/) ? /\\/?(.*)/ : /(.*)/;\n result += nextSegment.match(capture)[1];\n } else if (isString(squash)) {\n result += squash + nextSegment;\n }\n\n if (isFinalPathParam && param.squash === true && result.slice(-1) === '/') result = result.slice(0, -1);\n } else {\n if (encoded == null || (isDefaultValue && squash !== false)) continue;\n if (!isArray(encoded)) encoded = [ encoded ];\n if (encoded.length === 0) continue;\n encoded = map(encoded, encodeURIComponent).join('&' + name + '=');\n result += (search ? '&' : '?') + (name + '=' + encoded);\n search = true;\n }\n }\n\n return result;\n};\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:Type\n *\n * @description\n * Implements an interface to define custom parameter types that can be decoded from and encoded to\n * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}\n * objects when matching or formatting URLs, or comparing or validating parameter values.\n *\n * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more\n * information on registering custom types.\n *\n * @param {Object} config A configuration object which contains the custom type definition. The object's\n * properties will override the default methods and/or pattern in `Type`'s public interface.\n * @example\n * <pre>\n * {\n * decode: function(val) { return parseInt(val, 10); },\n * encode: function(val) { return val && val.toString(); },\n * equals: function(a, b) { return this.is(a) && a === b; },\n * is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },\n * pattern: /\\d+/\n * }\n * </pre>\n *\n * @property {RegExp} pattern The regular expression pattern used to match values of this type when\n * coming from a substring of a URL.\n *\n * @returns {Object} Returns a new `Type` object.\n */\nfunction Type(config) {\n extend(this, config);\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#is\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Detects whether a value is of a particular type. Accepts a native (decoded) value\n * and determines whether it matches the current `Type` object.\n *\n * @param {*} val The value to check.\n * @param {string} key Optional. If the type check is happening in the context of a specific\n * {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the\n * parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.\n * @returns {Boolean} Returns `true` if the value matches the type, otherwise `false`.\n */\nType.prototype.is = function(val, key) {\n return true;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#encode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the\n * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it\n * only needs to be a representation of `val` that has been coerced to a string.\n *\n * @param {*} val The value to encode.\n * @param {string} key The name of the parameter in which `val` is stored. Can be used for\n * meta-programming of `Type` objects.\n * @returns {string} Returns a string representation of `val` that can be encoded in a URL.\n */\nType.prototype.encode = function(val, key) {\n return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#decode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Converts a parameter value (from URL string or transition param) to a custom/native value.\n *\n * @param {string} val The URL parameter value to decode.\n * @param {string} key The name of the parameter in which `val` is stored. Can be used for\n * meta-programming of `Type` objects.\n * @returns {*} Returns a custom representation of the URL parameter value.\n */\nType.prototype.decode = function(val, key) {\n return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#equals\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Determines whether two decoded values are equivalent.\n *\n * @param {*} a A value to compare against.\n * @param {*} b A value to compare against.\n * @returns {Boolean} Returns `true` if the values are equivalent/equal, otherwise `false`.\n */\nType.prototype.equals = function(a, b) {\n return a == b;\n};\n\nType.prototype.$subPattern = function() {\n var sub = this.pattern.toString();\n return sub.substr(1, sub.length - 2);\n};\n\nType.prototype.pattern = /.*/;\n\nType.prototype.toString = function() { return \"{Type:\" + this.name + \"}\"; };\n\n/** Given an encoded string, or a decoded object, returns a decoded object */\nType.prototype.$normalize = function(val) {\n return this.is(val) ? val : this.decode(val);\n};\n\n/*\n * Wraps an existing custom Type as an array of Type, depending on 'mode'.\n * e.g.:\n * - urlmatcher pattern \"/path?{queryParam[]:int}\"\n * - url: \"/path?queryParam=1&queryParam=2\n * - $stateParams.queryParam will be [1, 2]\n * if `mode` is \"auto\", then\n * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\n * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\n */\nType.prototype.$asArray = function(mode, isSearch) {\n if (!mode) return this;\n if (mode === \"auto\" && !isSearch) throw new Error(\"'auto' array mode is for query parameters only\");\n\n function ArrayType(type, mode) {\n function bindTo(type, callbackName) {\n return function() {\n return type[callbackName].apply(type, arguments);\n };\n }\n\n // Wrap non-array value as array\n function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n function falsey(val) { return !val; }\n\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }\n\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }\n\n this.encode = arrayHandler(bindTo(type, 'encode'));\n this.decode = arrayHandler(bindTo(type, 'decode'));\n this.is = arrayHandler(bindTo(type, 'is'), true);\n this.equals = arrayEqualsHandler(bindTo(type, 'equals'));\n this.pattern = type.pattern;\n this.$normalize = arrayHandler(bindTo(type, '$normalize'));\n this.name = type.name;\n this.$arrayMode = mode;\n }\n\n return new ArrayType(this, mode);\n};\n\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$urlMatcherFactory\n *\n * @description\n * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory\n * is also available to providers under the name `$urlMatcherFactoryProvider`.\n */\nfunction $UrlMatcherFactory() {\n $$UMFP = this;\n\n var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;\n\n // Use tildes to pre-encode slashes.\n // If the slashes are simply URLEncoded, the browser can choose to pre-decode them,\n // and bidirectional encoding/decoding fails.\n // Tilde was chosen because it's not a RFC 3986 section 2.2 Reserved Character\n function valToString(val) { return val != null ? val.toString().replace(/~/g, \"~~\").replace(/\\//g, \"~2F\") : val; }\n function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, \"/\").replace(/~~/g, \"~\") : val; }\n\n var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {\n \"string\": {\n encode: valToString,\n decode: valFromString,\n // TODO: in 1.0, make string .is() return false if value is undefined/null by default.\n // In 0.2.x, string params are optional by default for backwards compat\n is: function(val) { return val == null || !isDefined(val) || typeof val === \"string\"; },\n pattern: /[^/]*/\n },\n \"int\": {\n encode: valToString,\n decode: function(val) { return parseInt(val, 10); },\n is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },\n pattern: /\\d+/\n },\n \"bool\": {\n encode: function(val) { return val ? 1 : 0; },\n decode: function(val) { return parseInt(val, 10) !== 0; },\n is: function(val) { return val === true || val === false; },\n pattern: /0|1/\n },\n \"date\": {\n encode: function (val) {\n if (!this.is(val))\n return undefined;\n return [ val.getFullYear(),\n ('0' + (val.getMonth() + 1)).slice(-2),\n ('0' + val.getDate()).slice(-2)\n ].join(\"-\");\n },\n decode: function (val) {\n if (this.is(val)) return val;\n var match = this.capture.exec(val);\n return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n },\n is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },\n equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },\n pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/\n },\n \"json\": {\n encode: angular.toJson,\n decode: angular.fromJson,\n is: angular.isObject,\n equals: angular.equals,\n pattern: /[^/]*/\n },\n \"any\": { // does not encode/decode\n encode: angular.identity,\n decode: angular.identity,\n equals: angular.equals,\n pattern: /.*/\n }\n };\n\n function getDefaultConfig() {\n return {\n strict: isStrictMode,\n caseInsensitive: isCaseInsensitive\n };\n }\n\n function isInjectable(value) {\n return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));\n }\n\n /**\n * [Internal] Get the default value of a parameter, which may be an injectable function.\n */\n $UrlMatcherFactory.$$getDefaultValue = function(config) {\n if (!isInjectable(config.value)) return config.value;\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.value);\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#caseInsensitive\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Defines whether URL matching should be case sensitive (the default behavior), or not.\n *\n * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;\n * @returns {boolean} the current value of caseInsensitive\n */\n this.caseInsensitive = function(value) {\n if (isDefined(value))\n isCaseInsensitive = value;\n return isCaseInsensitive;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#strictMode\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Defines whether URLs should match trailing slashes, or not (the default behavior).\n *\n * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.\n * @returns {boolean} the current value of strictMode\n */\n this.strictMode = function(value) {\n if (isDefined(value))\n isStrictMode = value;\n return isStrictMode;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Sets the default behavior when generating or matching URLs with default parameter values.\n *\n * @param {string} value A string that defines the default parameter URL squashing behavior.\n * `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\n * `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\n * parameter is surrounded by slashes, squash (remove) one slash from the URL\n * any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\n * the parameter value from the URL and replace it with this string.\n */\n this.defaultSquashPolicy = function(value) {\n if (!isDefined(value)) return defaultSquashPolicy;\n if (value !== true && value !== false && !isString(value))\n throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n defaultSquashPolicy = value;\n return value;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#compile\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.\n *\n * @param {string} pattern The URL pattern.\n * @param {Object} config The config object hash.\n * @returns {UrlMatcher} The UrlMatcher.\n */\n this.compile = function (pattern, config) {\n return new UrlMatcher(pattern, extend(getDefaultConfig(), config));\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#isMatcher\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Returns true if the specified object is a `UrlMatcher`, or false otherwise.\n *\n * @param {Object} object The object to perform the type check against.\n * @returns {Boolean} Returns `true` if the object matches the `UrlMatcher` interface, by\n * implementing all the same methods.\n */\n this.isMatcher = function (o) {\n if (!isObject(o)) return false;\n var result = true;\n\n forEach(UrlMatcher.prototype, function(val, name) {\n if (isFunction(val)) {\n result = result && (isDefined(o[name]) && isFunction(o[name]));\n }\n });\n return result;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#type\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to\n * generate URLs with typed parameters.\n *\n * @param {string} name The type name.\n * @param {Object|Function} definition The type definition. See\n * {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n * @param {Object|Function} definitionFn (optional) A function that is injected before the app\n * runtime starts. The result of this function is merged into the existing `definition`.\n * See {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n *\n * @returns {Object} Returns `$urlMatcherFactoryProvider`.\n *\n * @example\n * This is a simple example of a custom type that encodes and decodes items from an\n * array, using the array index as the URL-encoded value:\n *\n * <pre>\n * var list = ['John', 'Paul', 'George', 'Ringo'];\n *\n * $urlMatcherFactoryProvider.type('listItem', {\n * encode: function(item) {\n * // Represent the list item in the URL using its corresponding index\n * return list.indexOf(item);\n * },\n * decode: function(item) {\n * // Look up the list item by index\n * return list[parseInt(item, 10)];\n * },\n * is: function(item) {\n * // Ensure the item is valid by checking to see that it appears\n * // in the list\n * return list.indexOf(item) > -1;\n * }\n * });\n *\n * $stateProvider.state('list', {\n * url: \"/list/{item:listItem}\",\n * controller: function($scope, $stateParams) {\n * console.log($stateParams.item);\n * }\n * });\n *\n * // ...\n *\n * // Changes URL to '/list/3', logs \"Ringo\" to the console\n * $state.go('list', { item: \"Ringo\" });\n * </pre>\n *\n * This is a more complex example of a type that relies on dependency injection to\n * interact with services, and uses the parameter name from the URL to infer how to\n * handle encoding and decoding parameter values:\n *\n * <pre>\n * // Defines a custom type that gets a value from a service,\n * // where each service gets different types of values from\n * // a backend API:\n * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {\n *\n * // Matches up services to URL parameter names\n * var services = {\n * user: Users,\n * post: Posts\n * };\n *\n * return {\n * encode: function(object) {\n * // Represent the object in the URL using its unique ID\n * return object.id;\n * },\n * decode: function(value, key) {\n * // Look up the object by ID, using the parameter\n * // name (key) to call the correct service\n * return services[key].findById(value);\n * },\n * is: function(object, key) {\n * // Check that object is a valid dbObject\n * return angular.isObject(object) && object.id && services[key];\n * }\n * equals: function(a, b) {\n * // Check the equality of decoded objects by comparing\n * // their unique IDs\n * return a.id === b.id;\n * }\n * };\n * });\n *\n * // In a config() block, you can then attach URLs with\n * // type-annotated parameters:\n * $stateProvider.state('users', {\n * url: \"/users\",\n * // ...\n * }).state('users.item', {\n * url: \"/{user:dbObject}\",\n * controller: function($scope, $stateParams) {\n * // $stateParams.user will now be an object returned from\n * // the Users service\n * },\n * // ...\n * });\n * </pre>\n */\n this.type = function (name, definition, definitionFn) {\n if (!isDefined(definition)) return $types[name];\n if ($types.hasOwnProperty(name)) throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n\n $types[name] = new Type(extend({ name: name }, definition));\n if (definitionFn) {\n typeQueue.push({ name: name, def: definitionFn });\n if (!enqueue) flushTypeQueue();\n }\n return this;\n };\n\n // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s\n function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }\n\n // Register default types. Store them in the prototype of $types.\n forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });\n $types = inherit($types, {});\n\n /* No need to document $get, since it returns this */\n this.$get = ['$injector', function ($injector) {\n injector = $injector;\n enqueue = false;\n flushTypeQueue();\n\n forEach(defaultTypes, function(type, name) {\n if (!$types[name]) $types[name] = new Type(type);\n });\n return this;\n }];\n\n this.Param = function Param(id, type, config, location) {\n var self = this;\n config = unwrapShorthand(config);\n type = getType(config, type, location);\n var arrayMode = getArrayMode();\n type = arrayMode ? type.$asArray(arrayMode, location === \"search\") : type;\n if (type.name === \"string\" && !arrayMode && location === \"path\" && config.value === undefined)\n config.value = \"\"; // for 0.2.x; in 0.3.0+ do not automatically default to \"\"\n var isOptional = config.value !== undefined;\n var squash = getSquashPolicy(config, isOptional);\n var replace = getReplace(config, arrayMode, isOptional, squash);\n\n function unwrapShorthand(config) {\n var keys = isObject(config) ? objectKeys(config) : [];\n var isShorthand = indexOf(keys, \"value\") === -1 && indexOf(keys, \"type\") === -1 &&\n indexOf(keys, \"squash\") === -1 && indexOf(keys, \"array\") === -1;\n if (isShorthand) config = { value: config };\n config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };\n return config;\n }\n\n function getType(config, urlType, location) {\n if (config.type && urlType) throw new Error(\"Param '\"+id+\"' has two type configurations.\");\n if (urlType) return urlType;\n if (!config.type) return (location === \"config\" ? $types.any : $types.string);\n\n if (angular.isString(config.type))\n return $types[config.type];\n if (config.type instanceof Type)\n return config.type;\n return new Type(config.type);\n }\n\n // array config: param name (param[]) overrides default settings. explicit config overrides param name.\n function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }\n\n /**\n * returns false, true, or the squash value to indicate the \"default parameter url squash policy\".\n */\n function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }\n\n function getReplace(config, arrayMode, isOptional, squash) {\n var replace, configuredKeys, defaultPolicy = [\n { from: \"\", to: (isOptional || arrayMode ? undefined : \"\") },\n { from: null, to: (isOptional || arrayMode ? undefined : \"\") }\n ];\n replace = isArray(config.replace) ? config.replace : [];\n if (isString(squash))\n replace.push({ from: squash, to: undefined });\n configuredKeys = map(replace, function(item) { return item.from; } );\n return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);\n }\n\n /**\n * [Internal] Get the default value of a parameter, which may be an injectable function.\n */\n function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }\n\n /**\n * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\n * default value, which may be the result of an injectable function.\n */\n function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }\n\n function toString() { return \"{Param:\" + id + \" \" + type + \" squash: '\" + squash + \"' optional: \" + isOptional + \"}\"; }\n\n extend(this, {\n id: id,\n type: type,\n location: location,\n array: arrayMode,\n squash: squash,\n replace: replace,\n isOptional: isOptional,\n value: $value,\n dynamic: undefined,\n config: config,\n toString: toString\n });\n };\n\n function ParamSet(params) {\n extend(this, params || {});\n }\n\n ParamSet.prototype = {\n $$new: function() {\n return inherit(this, extend(new ParamSet(), { $$parent: this}));\n },\n $$keys: function () {\n var keys = [], chain = [], parent = this,\n ignore = objectKeys(ParamSet.prototype);\n while (parent) { chain.push(parent); parent = parent.$$parent; }\n chain.reverse();\n forEach(chain, function(paramset) {\n forEach(objectKeys(paramset), function(key) {\n if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);\n });\n });\n return keys;\n },\n $$values: function(paramValues) {\n var values = {}, self = this;\n forEach(self.$$keys(), function(key) {\n values[key] = self[key].value(paramValues && paramValues[key]);\n });\n return values;\n },\n $$equals: function(paramValues1, paramValues2) {\n var equal = true, self = this;\n forEach(self.$$keys(), function(key) {\n var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];\n if (!self[key].type.equals(left, right)) equal = false;\n });\n return equal;\n },\n $$validates: function $$validate(paramValues) {\n var keys = this.$$keys(), i, param, rawVal, normalized, encoded;\n for (i = 0; i < keys.length; i++) {\n param = this[keys[i]];\n rawVal = paramValues[keys[i]];\n if ((rawVal === undefined || rawVal === null) && param.isOptional)\n break; // There was no parameter value, but the param is optional\n normalized = param.type.$normalize(rawVal);\n if (!param.type.is(normalized))\n return false; // The value was not of the correct Type, and could not be decoded to the correct Type\n encoded = param.type.encode(normalized);\n if (angular.isString(encoded) && !param.type.pattern.exec(encoded))\n return false; // The value was of the correct type, but when encoded, did not match the Type's regexp\n }\n return true;\n },\n $$parent: undefined\n };\n\n this.ParamSet = ParamSet;\n}\n\n// Register as a provider so it's available to other providers\nangular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);\nangular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);\n\n/**\n * @ngdoc object\n * @name ui.router.router.$urlRouterProvider\n *\n * @requires ui.router.util.$urlMatcherFactoryProvider\n * @requires $locationProvider\n *\n * @description\n * `$urlRouterProvider` has the responsibility of watching `$location`. \n * When `$location` changes it runs through a list of rules one by one until a \n * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify \n * a url in a state configuration. All urls are compiled into a UrlMatcher object.\n *\n * There are several methods on `$urlRouterProvider` that make it useful to use directly\n * in your module config.\n */\n$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];\nfunction $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {\n var rules = [], otherwise = null, interceptDeferred = false, listener;\n\n // Returns a string that is a prefix of all strings matching the RegExp\n function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }\n\n // Interpolates matched values into a String.replace()-style pattern\n function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }\n\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouterProvider#rule\n * @methodOf ui.router.router.$urlRouterProvider\n *\n * @description\n * Defines rules that are used by `$urlRouterProvider` to find matches for\n * specific URLs.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Here's an example of how you might allow case insensitive urls\n * $urlRouterProvider.rule(function ($injector, $location) {\n * var path = $location.path(),\n * normalized = path.toLowerCase();\n *\n * if (path !== normalized) {\n * return normalized;\n * }\n * });\n * });\n * </pre>\n *\n * @param {function} rule Handler function that takes `$injector` and `$location`\n * services as arguments. You can use them to return a valid path as a string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n this.rule = function (rule) {\n if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n rules.push(rule);\n return this;\n };\n\n /**\n * @ngdoc object\n * @name ui.router.router.$urlRouterProvider#otherwise\n * @methodOf ui.router.router.$urlRouterProvider\n *\n * @description\n * Defines a path that is used when an invalid route is requested.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // if the path doesn't match any of the urls you configured\n * // otherwise will take care of routing the user to the\n * // specified url\n * $urlRouterProvider.otherwise('/index');\n *\n * // Example of using function rule as param\n * $urlRouterProvider.otherwise(function ($injector, $location) {\n * return '/a/valid/url';\n * });\n * });\n * </pre>\n *\n * @param {string|function} rule The url path you want to redirect to or a function \n * rule that returns the url path. The function version is passed two params: \n * `$injector` and `$location` services, and must return a url string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n this.otherwise = function (rule) {\n if (isString(rule)) {\n var redirect = rule;\n rule = function () { return redirect; };\n }\n else if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n otherwise = rule;\n return this;\n };\n\n\n function handleIfMatch($injector, handler, match) {\n if (!match) return false;\n var result = $injector.invoke(handler, handler, { $match: match });\n return isDefined(result) ? result : true;\n }\n\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouterProvider#when\n * @methodOf ui.router.router.$urlRouterProvider\n *\n * @description\n * Registers a handler for a given url matching. \n * \n * If the handler is a string, it is\n * treated as a redirect, and is interpolated according to the syntax of match\n * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n *\n * If the handler is a function, it is injectable. It gets invoked if `$location`\n * matches. You have the option of inject the match object as `$match`.\n *\n * The handler can return\n *\n * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n * will continue trying to find another one that matches.\n * - **string** which is treated as a redirect and passed to `$location.url()`\n * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n * if ($state.$current.navigable !== state ||\n * !equalForKeys($match, $stateParams) {\n * $state.transitionTo(state, $match, false);\n * }\n * });\n * });\n * </pre>\n *\n * @param {string|object} what The incoming path that you want to redirect.\n * @param {string|function} handler The path you want to redirect your user to.\n */\n this.when = function (what, handler) {\n var redirect, handlerIsString = isString(handler);\n if (isString(what)) what = $urlMatcherFactory.compile(what);\n\n if (!handlerIsString && !isFunction(handler) && !isArray(handler))\n throw new Error(\"invalid 'handler' in when()\");\n\n var strategies = {\n matcher: function (what, handler) {\n if (handlerIsString) {\n redirect = $urlMatcherFactory.compile(handler);\n handler = ['$match', function ($match) { return redirect.format($match); }];\n }\n return extend(function ($injector, $location) {\n return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));\n }, {\n prefix: isString(what.prefix) ? what.prefix : ''\n });\n },\n regex: function (what, handler) {\n if (what.global || what.sticky) throw new Error(\"when() RegExp must not be global or sticky\");\n\n if (handlerIsString) {\n redirect = handler;\n handler = ['$match', function ($match) { return interpolate(redirect, $match); }];\n }\n return extend(function ($injector, $location) {\n return handleIfMatch($injector, handler, what.exec($location.path()));\n }, {\n prefix: regExpPrefix(what)\n });\n }\n };\n\n var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };\n\n for (var n in check) {\n if (check[n]) return this.rule(strategies[n](what, handler));\n }\n\n throw new Error(\"invalid 'what' in when()\");\n };\n\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouterProvider#deferIntercept\n * @methodOf ui.router.router.$urlRouterProvider\n *\n * @description\n * Disables (or enables) deferring location change interception.\n *\n * If you wish to customize the behavior of syncing the URL (for example, if you wish to\n * defer a transition but maintain the current URL), call this method at configuration time.\n * Then, at run time, call `$urlRouter.listen()` after you have configured your own\n * `$locationChangeSuccess` event handler.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n *\n * // Prevent $urlRouter from automatically intercepting URL changes;\n * // this allows you to configure custom behavior in between\n * // location changes and route synchronization:\n * $urlRouterProvider.deferIntercept();\n *\n * }).run(function ($rootScope, $urlRouter, UserService) {\n *\n * $rootScope.$on('$locationChangeSuccess', function(e) {\n * // UserService is an example service for managing user state\n * if (UserService.isLoggedIn()) return;\n *\n * // Prevent $urlRouter's default handler from firing\n * e.preventDefault();\n *\n * UserService.handleLogin().then(function() {\n * // Once the user has logged in, sync the current URL\n * // to the router:\n * $urlRouter.sync();\n * });\n * });\n *\n * // Configures $urlRouter's listener *after* your custom listener\n * $urlRouter.listen();\n * });\n * </pre>\n *\n * @param {boolean} defer Indicates whether to defer location change interception. Passing\n no parameter is equivalent to `true`.\n */\n this.deferIntercept = function (defer) {\n if (defer === undefined) defer = true;\n interceptDeferred = defer;\n };\n\n /**\n * @ngdoc object\n * @name ui.router.router.$urlRouter\n *\n * @requires $location\n * @requires $rootScope\n * @requires $injector\n * @requires $browser\n *\n * @description\n *\n */\n this.$get = $get;\n $get.$inject = ['$location', '$rootScope', '$injector', '$browser', '$sniffer'];\n function $get( $location, $rootScope, $injector, $browser, $sniffer) {\n\n var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;\n\n function appendBasePath(url, isHtml5, absolute) {\n if (baseHref === '/') return url;\n if (isHtml5) return baseHref.slice(0, -1) + url;\n if (absolute) return baseHref.slice(1) + url;\n return url;\n }\n\n // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree\n function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }\n\n function listen() {\n listener = listener || $rootScope.$on('$locationChangeSuccess', update);\n return listener;\n }\n\n if (!interceptDeferred) listen();\n\n return {\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouter#sync\n * @methodOf ui.router.router.$urlRouter\n *\n * @description\n * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.\n * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,\n * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed\n * with the transition by calling `$urlRouter.sync()`.\n *\n * @example\n * <pre>\n * angular.module('app', ['ui.router'])\n * .run(function($rootScope, $urlRouter) {\n * $rootScope.$on('$locationChangeSuccess', function(evt) {\n * // Halt state change from even starting\n * evt.preventDefault();\n * // Perform custom logic\n * var meetsRequirement = ...\n * // Continue with the update and state transition if logic allows\n * if (meetsRequirement) $urlRouter.sync();\n * });\n * });\n * </pre>\n */\n sync: function() {\n update();\n },\n\n listen: function() {\n return listen();\n },\n\n update: function(read) {\n if (read) {\n location = $location.url();\n return;\n }\n if ($location.url() === location) return;\n\n $location.url(location);\n $location.replace();\n },\n\n push: function(urlMatcher, params, options) {\n var url = urlMatcher.format(params || {});\n\n // Handle the special hash param, if needed\n if (url !== null && params && params['#']) {\n url += '#' + params['#'];\n }\n\n $location.url(url);\n lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;\n if (options && options.replace) $location.replace();\n },\n\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouter#href\n * @methodOf ui.router.router.$urlRouter\n *\n * @description\n * A URL generation method that returns the compiled URL for a given\n * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.\n *\n * @example\n * <pre>\n * $bob = $urlRouter.href(new UrlMatcher(\"/about/:person\"), {\n * person: \"bob\"\n * });\n * // $bob == \"/about/bob\";\n * </pre>\n *\n * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.\n * @param {object=} params An object of parameter values to fill the matcher's required parameters.\n * @param {object=} options Options object. The options are:\n *\n * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n *\n * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n */\n href: function(urlMatcher, params, options) {\n if (!urlMatcher.validates(params)) return null;\n\n var isHtml5 = $locationProvider.html5Mode();\n if (angular.isObject(isHtml5)) {\n isHtml5 = isHtml5.enabled;\n }\n\n isHtml5 = isHtml5 && $sniffer.history;\n \n var url = urlMatcher.format(params);\n options = options || {};\n\n if (!isHtml5 && url !== null) {\n url = \"#\" + $locationProvider.hashPrefix() + url;\n }\n\n // Handle special hash param, if needed\n if (url !== null && params && params['#']) {\n url += '#' + params['#'];\n }\n\n url = appendBasePath(url, isHtml5, options.absolute);\n\n if (!options.absolute || !url) {\n return url;\n }\n\n var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();\n port = (port === 80 || port === 443 ? '' : ':' + port);\n\n return [$location.protocol(), '://', $location.host(), port, slash, url].join('');\n }\n };\n }\n}\n\nangular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);\n\n/**\n * @ngdoc object\n * @name ui.router.state.$stateProvider\n *\n * @requires ui.router.router.$urlRouterProvider\n * @requires ui.router.util.$urlMatcherFactoryProvider\n *\n * @description\n * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\n$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];\nfunction $StateProvider( $urlRouterProvider, $urlMatcherFactory) {\n\n var root, states = {}, $state, queue = {}, abstractKey = 'abstract';\n\n // Builds state properties from definition passed to registerState()\n var stateBuilder = {\n\n // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.\n // state.children = [];\n // if (parent) parent.children.push(state);\n parent: function(state) {\n if (isDefined(state.parent) && state.parent) return findState(state.parent);\n // regex matches any valid composite state name\n // would match \"contact.list\" but not \"contacts\"\n var compositeName = /^(.+)\\.[^.]+$/.exec(state.name);\n return compositeName ? findState(compositeName[1]) : root;\n },\n\n // inherit 'data' from parent and override by own values (if any)\n data: function(state) {\n if (state.parent && state.parent.data) {\n state.data = state.self.data = inherit(state.parent.data, state.data);\n }\n return state.data;\n },\n\n // Build a URLMatcher if necessary, either via a relative or absolute URL\n url: function(state) {\n var url = state.url, config = { params: state.params || {} };\n\n if (isString(url)) {\n if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);\n return (state.parent.navigable || root).url.concat(url, config);\n }\n\n if (!url || $urlMatcherFactory.isMatcher(url)) return url;\n throw new Error(\"Invalid url '\" + url + \"' in state '\" + state + \"'\");\n },\n\n // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n navigable: function(state) {\n return state.url ? state : (state.parent ? state.parent.navigable : null);\n },\n\n // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params\n ownParams: function(state) {\n var params = state.url && state.url.params || new $$UMFP.ParamSet();\n forEach(state.params || {}, function(config, id) {\n if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, \"config\");\n });\n return params;\n },\n\n // Derive parameters for this state and ensure they're a super-set of parent's parameters\n params: function(state) {\n var ownParams = pick(state.ownParams, state.ownParams.$$keys());\n return state.parent && state.parent.params ? extend(state.parent.params.$$new(), ownParams) : new $$UMFP.ParamSet();\n },\n\n // If there is no explicit multi-view configuration, make one up so we don't have\n // to handle both cases in the view directive later. Note that having an explicit\n // 'views' property will mean the default unnamed view properties are ignored. This\n // is also a good time to resolve view names to absolute names, so everything is a\n // straight lookup at link time.\n views: function(state) {\n var views = {};\n\n forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {\n if (name.indexOf('@') < 0) name += '@' + state.parent.name;\n views[name] = view;\n });\n return views;\n },\n\n // Keep a full path from the root down to this state as this is needed for state activation.\n path: function(state) {\n return state.parent ? state.parent.path.concat(state) : []; // exclude root from path\n },\n\n // Speed up $state.contains() as it's used a lot\n includes: function(state) {\n var includes = state.parent ? extend({}, state.parent.includes) : {};\n includes[state.name] = true;\n return includes;\n },\n\n $delegates: {}\n };\n\n function isRelative(stateName) {\n return stateName.indexOf(\".\") === 0 || stateName.indexOf(\"^\") === 0;\n }\n\n function findState(stateOrName, base) {\n if (!stateOrName) return undefined;\n\n var isStr = isString(stateOrName),\n name = isStr ? stateOrName : stateOrName.name,\n path = isRelative(name);\n\n if (path) {\n if (!base) throw new Error(\"No reference point given for path '\" + name + \"'\");\n base = findState(base);\n \n var rel = name.split(\".\"), i = 0, pathLength = rel.length, current = base;\n\n for (; i < pathLength; i++) {\n if (rel[i] === \"\" && i === 0) {\n current = base;\n continue;\n }\n if (rel[i] === \"^\") {\n if (!current.parent) throw new Error(\"Path '\" + name + \"' not valid for state '\" + base.name + \"'\");\n current = current.parent;\n continue;\n }\n break;\n }\n rel = rel.slice(i).join(\".\");\n name = current.name + (current.name && rel ? \".\" : \"\") + rel;\n }\n var state = states[name];\n\n if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n return state;\n }\n return undefined;\n }\n\n function queueState(parentName, state) {\n if (!queue[parentName]) {\n queue[parentName] = [];\n }\n queue[parentName].push(state);\n }\n\n function flushQueuedChildren(parentName) {\n var queued = queue[parentName] || [];\n while(queued.length) {\n registerState(queued.shift());\n }\n }\n\n function registerState(state) {\n // Wrap a new object around the state so we can store our private details easily.\n state = inherit(state, {\n self: state,\n resolve: state.resolve || {},\n toString: function() { return this.name; }\n });\n\n var name = state.name;\n if (!isString(name) || name.indexOf('@') >= 0) throw new Error(\"State must have a valid name\");\n if (states.hasOwnProperty(name)) throw new Error(\"State '\" + name + \"' is already defined\");\n\n // Get parent name\n var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))\n : (isString(state.parent)) ? state.parent\n : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name\n : '';\n\n // If parent is not registered yet, add state to queue and register later\n if (parentName && !states[parentName]) {\n return queueState(parentName, state.self);\n }\n\n for (var key in stateBuilder) {\n if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);\n }\n states[name] = state;\n\n // Register the state in the global state list and with $urlRouter if necessary.\n if (!state[abstractKey] && state.url) {\n $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {\n if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {\n $state.transitionTo(state, $match, { inherit: true, location: false });\n }\n }]);\n }\n\n // Register any queued children\n flushQueuedChildren(name);\n\n return state;\n }\n\n // Checks text to see if it looks like a glob.\n function isGlob (text) {\n return text.indexOf('*') > -1;\n }\n\n // Returns true if glob matches current $state name.\n function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }\n\n\n // Implicit root state that is always active\n root = registerState({\n name: '',\n url: '^',\n views: null,\n 'abstract': true\n });\n root.navigable = null;\n\n\n /**\n * @ngdoc function\n * @name ui.router.state.$stateProvider#decorator\n * @methodOf ui.router.state.$stateProvider\n *\n * @description\n * Allows you to extend (carefully) or override (at your own peril) the \n * `stateBuilder` object used internally by `$stateProvider`. This can be used \n * to add custom functionality to ui-router, for example inferring templateUrl \n * based on the state name.\n *\n * When passing only a name, it returns the current (original or decorated) builder\n * function that matches `name`.\n *\n * The builder functions that can be decorated are listed below. Though not all\n * necessarily have a good use case for decoration, that is up to you to decide.\n *\n * In addition, users can attach custom decorators, which will generate new \n * properties within the state's internal definition. There is currently no clear \n * use-case for this beyond accessing internal states (i.e. $state.$current), \n * however, expect this to become increasingly relevant as we introduce additional \n * meta-programming features.\n *\n * **Warning**: Decorators should not be interdependent because the order of \n * execution of the builder functions in non-deterministic. Builder functions \n * should only be dependent on the state definition object and super function.\n *\n *\n * Existing builder functions and current return values:\n *\n * - **parent** `{object}` - returns the parent state object.\n * - **data** `{object}` - returns state data, including any inherited data that is not\n * overridden by own values (if any).\n * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n * or `null`.\n * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is \n * navigable).\n * - **params** `{object}` - returns an array of state params that are ensured to \n * be a super-set of parent's params.\n * - **views** `{object}` - returns a views object where each key is an absolute view \n * name (i.e. \"viewName@stateName\") and each value is the config object \n * (template, controller) for the view. Even when you don't use the views object \n * explicitly on a state config, one is still created for you internally.\n * So by decorating this builder function you have access to decorating template \n * and controller properties.\n * - **ownParams** `{object}` - returns an array of params that belong to the state, \n * not including any params defined by ancestor states.\n * - **path** `{string}` - returns the full path from the root down to this state. \n * Needed for state activation.\n * - **includes** `{object}` - returns an object that includes every state that \n * would pass a `$state.includes()` test.\n *\n * @example\n * <pre>\n * // Override the internal 'views' builder with a function that takes the state\n * // definition, and a reference to the internal function being overridden:\n * $stateProvider.decorator('views', function (state, parent) {\n * var result = {},\n * views = parent(state);\n *\n * angular.forEach(views, function (config, name) {\n * var autoName = (state.name + '.' + name).replace('.', '/');\n * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n * result[name] = config;\n * });\n * return result;\n * });\n *\n * $stateProvider.state('home', {\n * views: {\n * 'contact.list': { controller: 'ListController' },\n * 'contact.item': { controller: 'ItemController' }\n * }\n * });\n *\n * // ...\n *\n * $state.go('home');\n * // Auto-populates list and item views with /partials/home/contact/list.html,\n * // and /partials/home/contact/item.html, respectively.\n * </pre>\n *\n * @param {string} name The name of the builder function to decorate. \n * @param {object} func A function that is responsible for decorating the original \n * builder function. The function receives two parameters:\n *\n * - `{object}` - state - The state config object.\n * - `{object}` - super - The original builder function.\n *\n * @return {object} $stateProvider - $stateProvider instance\n */\n this.decorator = decorator;\n function decorator(name, func) {\n /*jshint validthis: true */\n if (isString(name) && !isDefined(func)) {\n return stateBuilder[name];\n }\n if (!isFunction(func) || !isString(name)) {\n return this;\n }\n if (stateBuilder[name] && !stateBuilder.$delegates[name]) {\n stateBuilder.$delegates[name] = stateBuilder[name];\n }\n stateBuilder[name] = func;\n return this;\n }\n\n /**\n * @ngdoc function\n * @name ui.router.state.$stateProvider#state\n * @methodOf ui.router.state.$stateProvider\n *\n * @description\n * Registers a state configuration under a given state name. The stateConfig object\n * has the following acceptable properties.\n *\n * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n * @param {object} stateConfig State configuration object.\n * @param {string|function=} stateConfig.template\n * <a id='template'></a>\n * html template as a string or a function that returns\n * an html template as a string which should be used by the uiView directives. This property \n * takes precedence over templateUrl.\n * \n * If `template` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by\n * applying the current state\n *\n * <pre>template:\n * \"<h1>inline template definition</h1>\" +\n * \"<div ui-view></div>\"</pre>\n * <pre>template: function(params) {\n * return \"<h1>generated template</h1>\"; }</pre>\n * </div>\n *\n * @param {string|function=} stateConfig.templateUrl\n * <a id='templateUrl'></a>\n *\n * path or function that returns a path to an html\n * template that should be used by uiView.\n * \n * If `templateUrl` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by \n * applying the current state\n *\n * <pre>templateUrl: \"home.html\"</pre>\n * <pre>templateUrl: function(params) {\n * return myTemplates[params.pageId]; }</pre>\n *\n * @param {function=} stateConfig.templateProvider\n * <a id='templateProvider'></a>\n * Provider function that returns HTML content string.\n * <pre> templateProvider:\n * function(MyTemplateService, params) {\n * return MyTemplateService.getTemplate(params.pageId);\n * }</pre>\n *\n * @param {string|function=} stateConfig.controller\n * <a id='controller'></a>\n *\n * Controller fn that should be associated with newly\n * related scope or the name of a registered controller if passed as a string.\n * Optionally, the ControllerAs may be declared here.\n * <pre>controller: \"MyRegisteredController\"</pre>\n * <pre>controller:\n * \"MyRegisteredController as fooCtrl\"}</pre>\n * <pre>controller: function($scope, MyService) {\n * $scope.data = MyService.getData(); }</pre>\n *\n * @param {function=} stateConfig.controllerProvider\n * <a id='controllerProvider'></a>\n *\n * Injectable provider function that returns the actual controller or string.\n * <pre>controllerProvider:\n * function(MyResolveData) {\n * if (MyResolveData.foo)\n * return \"FooCtrl\"\n * else if (MyResolveData.bar)\n * return \"BarCtrl\";\n * else return function($scope) {\n * $scope.baz = \"Qux\";\n * }\n * }</pre>\n *\n * @param {string=} stateConfig.controllerAs\n * <a id='controllerAs'></a>\n * \n * A controller alias name. If present the controller will be\n * published to scope under the controllerAs name.\n * <pre>controllerAs: \"myCtrl\"</pre>\n *\n * @param {string|object=} stateConfig.parent\n * <a id='parent'></a>\n * Optionally specifies the parent state of this state.\n *\n * <pre>parent: 'parentState'</pre>\n * <pre>parent: parentState // JS variable</pre>\n *\n * @param {object=} stateConfig.resolve\n * <a id='resolve'></a>\n *\n * An optional map<string, function> of dependencies which\n * should be injected into the controller. If any of these dependencies are promises, \n * the router will wait for them all to be resolved before the controller is instantiated.\n * If all the promises are resolved successfully, the $stateChangeSuccess event is fired\n * and the values of the resolved promises are injected into any controllers that reference them.\n * If any of the promises are rejected the $stateChangeError event is fired.\n *\n * The map object is:\n * \n * - key - {string}: name of dependency to be injected into controller\n * - factory - {string|function}: If string then it is alias for service. Otherwise if function, \n * it is injected and return value it treated as dependency. If result is a promise, it is \n * resolved before its value is injected into controller.\n *\n * <pre>resolve: {\n * myResolve1:\n * function($http, $stateParams) {\n * return $http.get(\"/api/foos/\"+stateParams.fooID);\n * }\n * }</pre>\n *\n * @param {string=} stateConfig.url\n * <a id='url'></a>\n *\n * A url fragment with optional parameters. When a state is navigated or\n * transitioned to, the `$stateParams` service will be populated with any \n * parameters that were passed.\n *\n * (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for\n * more details on acceptable patterns )\n *\n * examples:\n * <pre>url: \"/home\"\n * url: \"/users/:userid\"\n * url: \"/books/{bookid:[a-zA-Z_-]}\"\n * url: \"/books/{categoryid:int}\"\n * url: \"/books/{publishername:string}/{categoryid:int}\"\n * url: \"/messages?before&after\"\n * url: \"/messages?{before:date}&{after:date}\"\n * url: \"/messages/:mailboxid?{before:date}&{after:date}\"\n * </pre>\n *\n * @param {object=} stateConfig.views\n * <a id='views'></a>\n * an optional map<string, object> which defined multiple views, or targets views\n * manually/explicitly.\n *\n * Examples:\n *\n * Targets three named `ui-view`s in the parent state's template\n * <pre>views: {\n * header: {\n * controller: \"headerCtrl\",\n * templateUrl: \"header.html\"\n * }, body: {\n * controller: \"bodyCtrl\",\n * templateUrl: \"body.html\"\n * }, footer: {\n * controller: \"footCtrl\",\n * templateUrl: \"footer.html\"\n * }\n * }</pre>\n *\n * Targets named `ui-view=\"header\"` from grandparent state 'top''s template, and named `ui-view=\"body\" from parent state's template.\n * <pre>views: {\n * 'header@top': {\n * controller: \"msgHeaderCtrl\",\n * templateUrl: \"msgHeader.html\"\n * }, 'body': {\n * controller: \"messagesCtrl\",\n * templateUrl: \"messages.html\"\n * }\n * }</pre>\n *\n * @param {boolean=} [stateConfig.abstract=false]\n * <a id='abstract'></a>\n * An abstract state will never be directly activated,\n * but can provide inherited properties to its common children states.\n * <pre>abstract: true</pre>\n *\n * @param {function=} stateConfig.onEnter\n * <a id='onEnter'></a>\n *\n * Callback function for when a state is entered. Good way\n * to trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to explicitly annotate this function,\n * because it won't be automatically annotated by your build tools.\n *\n * <pre>onEnter: function(MyService, $stateParams) {\n * MyService.foo($stateParams.myParam);\n * }</pre>\n *\n * @param {function=} stateConfig.onExit\n * <a id='onExit'></a>\n *\n * Callback function for when a state is exited. Good way to\n * trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to explicitly annotate this function,\n * because it won't be automatically annotated by your build tools.\n *\n * <pre>onExit: function(MyService, $stateParams) {\n * MyService.cleanup($stateParams.myParam);\n * }</pre>\n *\n * @param {boolean=} [stateConfig.reloadOnSearch=true]\n * <a id='reloadOnSearch'></a>\n *\n * If `false`, will not retrigger the same state\n * just because a search/query parameter has changed (via $location.search() or $location.hash()). \n * Useful for when you'd like to modify $location.search() without triggering a reload.\n * <pre>reloadOnSearch: false</pre>\n *\n * @param {object=} stateConfig.data\n * <a id='data'></a>\n *\n * Arbitrary data object, useful for custom configuration. The parent state's `data` is\n * prototypally inherited. In other words, adding a data property to a state adds it to\n * the entire subtree via prototypal inheritance.\n *\n * <pre>data: {\n * requiredRole: 'foo'\n * } </pre>\n *\n * @param {object=} stateConfig.params\n * <a id='params'></a>\n *\n * A map which optionally configures parameters declared in the `url`, or\n * defines additional non-url parameters. For each parameter being\n * configured, add a configuration object keyed to the name of the parameter.\n *\n * Each parameter configuration object may contain the following properties:\n *\n * - ** value ** - {object|function=}: specifies the default value for this\n * parameter. This implicitly sets this parameter as optional.\n *\n * When UI-Router routes to a state and no value is\n * specified for this parameter in the URL or transition, the\n * default value will be used instead. If `value` is a function,\n * it will be injected and invoked, and the return value used.\n *\n * *Note*: `undefined` is treated as \"no default value\" while `null`\n * is treated as \"the default value is `null`\".\n *\n * *Shorthand*: If you only need to configure the default value of the\n * parameter, you may use a shorthand syntax. In the **`params`**\n * map, instead mapping the param name to a full parameter configuration\n * object, simply set map it to the default parameter value, e.g.:\n *\n * <pre>// define a parameter's default value\n * params: {\n * param1: { value: \"defaultValue\" }\n * }\n * // shorthand default values\n * params: {\n * param1: \"defaultValue\",\n * param2: \"param2Default\"\n * }</pre>\n *\n * - ** array ** - {boolean=}: *(default: false)* If true, the param value will be\n * treated as an array of values. If you specified a Type, the value will be\n * treated as an array of the specified Type. Note: query parameter values\n * default to a special `\"auto\"` mode.\n *\n * For query parameters in `\"auto\"` mode, if multiple values for a single parameter\n * are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values\n * are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`). However, if\n * only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single\n * value (e.g.: `{ foo: '1' }`).\n *\n * <pre>params: {\n * param1: { array: true }\n * }</pre>\n *\n * - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when\n * the current parameter value is the same as the default value. If `squash` is not set, it uses the\n * configured default squash policy.\n * (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})\n *\n * There are three squash settings:\n *\n * - false: The parameter's default value is not squashed. It is encoded and included in the URL\n * - true: The parameter's default value is omitted from the URL. If the parameter is preceeded and followed\n * by slashes in the state's `url` declaration, then one of those slashes are omitted.\n * This can allow for cleaner looking URLs.\n * - `\"<arbitrary string>\"`: The parameter's default value is replaced with an arbitrary placeholder of your choice.\n *\n * <pre>params: {\n * param1: {\n * value: \"defaultId\",\n * squash: true\n * } }\n * // squash \"defaultValue\" to \"~\"\n * params: {\n * param1: {\n * value: \"defaultValue\",\n * squash: \"~\"\n * } }\n * </pre>\n *\n *\n * @example\n * <pre>\n * // Some state name examples\n *\n * // stateName can be a single top-level name (must be unique).\n * $stateProvider.state(\"home\", {});\n *\n * // Or it can be a nested state name. This state is a child of the\n * // above \"home\" state.\n * $stateProvider.state(\"home.newest\", {});\n *\n * // Nest states as deeply as needed.\n * $stateProvider.state(\"home.newest.abc.xyz.inception\", {});\n *\n * // state() returns $stateProvider, so you can chain state declarations.\n * $stateProvider\n * .state(\"home\", {})\n * .state(\"about\", {})\n * .state(\"contacts\", {});\n * </pre>\n *\n */\n this.state = state;\n function state(name, definition) {\n /*jshint validthis: true */\n if (isObject(name)) definition = name;\n else definition.name = name;\n registerState(definition);\n return this;\n }\n\n /**\n * @ngdoc object\n * @name ui.router.state.$state\n *\n * @requires $rootScope\n * @requires $q\n * @requires ui.router.state.$view\n * @requires $injector\n * @requires ui.router.util.$resolve\n * @requires ui.router.state.$stateParams\n * @requires ui.router.router.$urlRouter\n *\n * @property {object} params A param object, e.g. {sectionId: section.id)}, that \n * you'd like to test against the current active state.\n * @property {object} current A reference to the state's config object. However \n * you passed it in. Useful for accessing custom data.\n * @property {object} transition Currently pending transition. A promise that'll \n * resolve or reject.\n *\n * @description\n * `$state` service is responsible for representing states as well as transitioning\n * between them. It also provides interfaces to ask for current state or even states\n * you're coming from.\n */\n this.$get = $get;\n $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];\n function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) {\n\n var TransitionSuperseded = $q.reject(new Error('transition superseded'));\n var TransitionPrevented = $q.reject(new Error('transition prevented'));\n var TransitionAborted = $q.reject(new Error('transition aborted'));\n var TransitionFailed = $q.reject(new Error('transition failed'));\n\n // Handles the case where a state which is the target of a transition is not found, and the user\n // can optionally retry or defer the transition\n function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) return TransitionSuperseded;\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }\n\n root.locals = { resolve: null, globals: { $stateParams: {} } };\n\n $state = {\n params: {},\n current: root.self,\n $current: root,\n transition: null\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#reload\n * @methodOf ui.router.state.$state\n *\n * @description\n * A method that force reloads the current state. All resolves are re-resolved,\n * controllers reinstantiated, and events re-fired.\n *\n * @example\n * <pre>\n * var app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * $state.reload();\n * }\n * });\n * </pre>\n *\n * `reload()` is just an alias for:\n * <pre>\n * $state.transitionTo($state.current, $stateParams, { \n * reload: true, inherit: false, notify: true\n * });\n * </pre>\n *\n * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved.\n * @example\n * <pre>\n * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' \n * //and current state is 'contacts.detail.item'\n * var app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * //will reload 'contact.detail' and 'contact.detail.item' states\n * $state.reload('contact.detail');\n * }\n * });\n * </pre>\n *\n * `reload()` is just an alias for:\n * <pre>\n * $state.transitionTo($state.current, $stateParams, { \n * reload: true, inherit: false, notify: true\n * });\n * </pre>\n\n * @returns {promise} A promise representing the state of the new transition. See\n * {@link ui.router.state.$state#methods_go $state.go}.\n */\n $state.reload = function reload(state) {\n return $state.transitionTo($state.current, $stateParams, { reload: state || true, inherit: false, notify: true});\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#go\n * @methodOf ui.router.state.$state\n *\n * @description\n * Convenience method for transitioning to a new state. `$state.go` calls \n * `$state.transitionTo` internally but automatically sets options to \n * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. \n * This allows you to easily use an absolute or relative to path and specify \n * only the parameters you'd like to update (while letting unspecified parameters \n * inherit from the currently active ancestor states).\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.changeState = function () {\n * $state.go('contact.detail');\n * };\n * });\n * </pre>\n * <img src='../ngdoc_assets/StateGoExamples.png'/>\n *\n * @param {string} to Absolute state name or relative state path. Some examples:\n *\n * - `$state.go('contact.detail')` - will go to the `contact.detail` state\n * - `$state.go('^')` - will go to a parent state\n * - `$state.go('^.sibling')` - will go to a sibling state\n * - `$state.go('.child.grandchild')` - will go to grandchild state\n *\n * @param {object=} params A map of the parameters that will be sent to the state, \n * will populate $stateParams. Any parameters that are not specified will be inherited from currently \n * defined parameters. Only parameters specified in the state definition can be overridden, new \n * parameters will be ignored. This allows, for example, going to a sibling state that shares parameters\n * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.\n * transitioning to a sibling will get you the parameters for all parents, transitioning to a child\n * will get you all current parameters, etc.\n * @param {object=} options Options object. The options are:\n *\n * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n * will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n * defines which state to be relative from.\n * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n * - **`reload`** (v0.2.5) - {boolean=false|string|object}, If `true` will force transition even if no state or params\n * have changed. It will reload the resolves and views of the current state and parent states.\n * If `reload` is a string (or state object), the state object is fetched (by name, or object reference); and \\\n * the transition reloads the resolves and views for that matched state, and all its children states.\n *\n * @returns {promise} A promise representing the state of the new transition.\n *\n * Possible success values:\n *\n * - $state.current\n *\n * <br/>Possible rejection values:\n *\n * - 'transition superseded' - when a newer transition has been started after this one\n * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener\n * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or\n * when a `$stateNotFound` `event.retry` promise errors.\n * - 'transition failed' - when a state has been unsuccessfully found after 2 tries.\n * - *resolve error* - when an error has occurred with a `resolve`\n *\n */\n $state.go = function go(to, params, options) {\n return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#transitionTo\n * @methodOf ui.router.state.$state\n *\n * @description\n * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}\n * uses `transitionTo` internally. `$state.go` is recommended in most situations.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.changeState = function () {\n * $state.transitionTo('contact.detail');\n * };\n * });\n * </pre>\n *\n * @param {string} to State name.\n * @param {object=} toParams A map of the parameters that will be sent to the state,\n * will populate $stateParams.\n * @param {object=} options Options object. The options are:\n *\n * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n * will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.\n * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), \n * defines which state to be relative from.\n * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n * - **`reload`** (v0.2.5) - {boolean=false|string=|object=}, If `true` will force transition even if the state or params \n * have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd\n * use this when you want to force a reload when *everything* is the same, including search params.\n * if String, then will reload the state with the name given in reload, and any children.\n * if Object, then a stateObj is expected, will reload the state found in stateObj, and any children.\n *\n * @returns {promise} A promise representing the state of the new transition. See\n * {@link ui.router.state.$state#methods_go $state.go}.\n */\n $state.transitionTo = function transitionTo(to, toParams, options) {\n toParams = toParams || {};\n options = extend({\n location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false\n }, options || {});\n\n var from = $state.$current, fromParams = $state.params, fromPath = from.path;\n var evt, toState = findState(to, options.relative);\n\n // Store the hash param for later (since it will be stripped out by various methods)\n var hash = toParams['#'];\n\n if (!isDefined(toState)) {\n var redirect = { to: to, toParams: toParams, options: options };\n var redirectResult = handleRedirect(redirect, from.self, fromParams, options);\n\n if (redirectResult) {\n return redirectResult;\n }\n\n // Always retry once if the $stateNotFound was not prevented\n // (handles either redirect changed or state lazy-definition)\n to = redirect.to;\n toParams = redirect.toParams;\n options = redirect.options;\n toState = findState(to, options.relative);\n\n if (!isDefined(toState)) {\n if (!options.relative) throw new Error(\"No such state '\" + to + \"'\");\n throw new Error(\"Could not resolve '\" + to + \"' from state '\" + options.relative + \"'\");\n }\n }\n if (toState[abstractKey]) throw new Error(\"Cannot transition to abstract state '\" + to + \"'\");\n if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);\n if (!toState.params.$$validates(toParams)) return TransitionFailed;\n\n toParams = toState.params.$$values(toParams);\n to = toState;\n\n var toPath = to.path;\n\n // Starting from the root of the path, keep all levels that haven't changed\n var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];\n\n if (!options.reload) {\n while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {\n locals = toLocals[keep] = state.locals;\n keep++;\n state = toPath[keep];\n }\n } else if (isString(options.reload) || isObject(options.reload)) {\n if (isObject(options.reload) && !options.reload.name) {\n throw new Error('Invalid reload state object');\n }\n \n var reloadState = options.reload === true ? fromPath[0] : findState(options.reload);\n if (options.reload && !reloadState) {\n throw new Error(\"No such reload state '\" + (isString(options.reload) ? options.reload : options.reload.name) + \"'\");\n }\n\n while (state && state === fromPath[keep] && state !== reloadState) {\n locals = toLocals[keep] = state.locals;\n keep++;\n state = toPath[keep];\n }\n }\n\n // If we're going to the same state and all locals are kept, we've got nothing to do.\n // But clear 'transition', as we still want to cancel any other pending transitions.\n // TODO: We may not want to bump 'transition' if we're called from a location change\n // that we've initiated ourselves, because we might accidentally abort a legitimate\n // transition initiated from code?\n if (shouldSkipReload(to, toParams, from, fromParams, locals, options)) {\n if (hash) toParams['#'] = hash;\n $state.params = toParams;\n copy($state.params, $stateParams);\n copy(filterByKeys(to.params.$$keys(), $stateParams), to.locals.globals.$stateParams);\n if (options.location && to.navigable && to.navigable.url) {\n $urlRouter.push(to.navigable.url, toParams, {\n $$avoidResync: true, replace: options.location === 'replace'\n });\n $urlRouter.update(true);\n }\n $state.transition = null;\n return $q.when($state.current);\n }\n\n // Filter parameters before we pass them to event handlers etc.\n toParams = filterByKeys(to.params.$$keys(), toParams || {});\n \n // Re-add the saved hash before we start returning things or broadcasting $stateChangeStart\n if (hash) toParams['#'] = hash;\n \n // Broadcast start event and cancel the transition if requested\n if (options.notify) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateChangeStart\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when the state transition **begins**. You can use `event.preventDefault()`\n * to prevent the transition from happening and then the transition promise will be\n * rejected with a `'transition prevented'` value.\n *\n * @param {Object} event Event object.\n * @param {State} toState The state being transitioned to.\n * @param {Object} toParams The params supplied to the `toState`.\n * @param {State} fromState The current state, pre-transition.\n * @param {Object} fromParams The params supplied to the `fromState`.\n *\n * @example\n *\n * <pre>\n * $rootScope.$on('$stateChangeStart',\n * function(event, toState, toParams, fromState, fromParams){\n * event.preventDefault();\n * // transitionTo() promise will be rejected with\n * // a 'transition prevented' error\n * })\n * </pre>\n */\n if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams, options).defaultPrevented) {\n $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);\n //Don't update and resync url if there's been a new transition started. see issue #2238, #600\n if ($state.transition == null) $urlRouter.update();\n return TransitionPrevented;\n }\n }\n\n // Resolve locals for the remaining states, but don't update any global state just\n // yet -- if anything fails to resolve the current state needs to remain untouched.\n // We also set up an inheritance chain for the locals here. This allows the view directive\n // to quickly look up the correct definition for each view in the current state. Even\n // though we create the locals object itself outside resolveState(), it is initially\n // empty and gets filled asynchronously. We need to keep track of the promise for the\n // (fully resolved) current locals, and pass this down the chain.\n var resolved = $q.when(locals);\n\n for (var l = keep; l < toPath.length; l++, state = toPath[l]) {\n locals = toLocals[l] = inherit(locals);\n resolved = resolveState(state, toParams, state === to, resolved, locals, options);\n }\n\n // Once everything is resolved, we are ready to perform the actual transition\n // and return a promise for the new state. We also keep track of what the\n // current promise is, so that we can detect overlapping transitions and\n // keep only the outcome of the last transition.\n var transition = $state.transition = resolved.then(function () {\n var l, entering, exiting;\n\n if ($state.transition !== transition) return TransitionSuperseded;\n\n // Exit 'from' states not kept\n for (l = fromPath.length - 1; l >= keep; l--) {\n exiting = fromPath[l];\n if (exiting.self.onExit) {\n $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);\n }\n exiting.locals = null;\n }\n\n // Enter 'to' states not kept\n for (l = keep; l < toPath.length; l++) {\n entering = toPath[l];\n entering.locals = toLocals[l];\n if (entering.self.onEnter) {\n $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);\n }\n }\n\n // Run it again, to catch any transitions in callbacks\n if ($state.transition !== transition) return TransitionSuperseded;\n\n // Update globals in $state\n $state.$current = to;\n $state.current = to.self;\n $state.params = toParams;\n copy($state.params, $stateParams);\n $state.transition = null;\n\n if (options.location && to.navigable) {\n $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {\n $$avoidResync: true, replace: options.location === 'replace'\n });\n }\n\n if (options.notify) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateChangeSuccess\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired once the state transition is **complete**.\n *\n * @param {Object} event Event object.\n * @param {State} toState The state being transitioned to.\n * @param {Object} toParams The params supplied to the `toState`.\n * @param {State} fromState The current state, pre-transition.\n * @param {Object} fromParams The params supplied to the `fromState`.\n */\n $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);\n }\n $urlRouter.update(true);\n\n return $state.current;\n }, function (error) {\n if ($state.transition !== transition) return TransitionSuperseded;\n\n $state.transition = null;\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateChangeError\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when an **error occurs** during transition. It's important to note that if you\n * have any errors in your resolve functions (javascript errors, non-existent services, etc)\n * they will not throw traditionally. You must listen for this $stateChangeError event to\n * catch **ALL** errors.\n *\n * @param {Object} event Event object.\n * @param {State} toState The state being transitioned to.\n * @param {Object} toParams The params supplied to the `toState`.\n * @param {State} fromState The current state, pre-transition.\n * @param {Object} fromParams The params supplied to the `fromState`.\n * @param {Error} error The resolve error object.\n */\n evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);\n\n if (!evt.defaultPrevented) {\n $urlRouter.update();\n }\n\n return $q.reject(error);\n });\n\n return transition;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#is\n * @methodOf ui.router.state.$state\n *\n * @description\n * Similar to {@link ui.router.state.$state#methods_includes $state.includes},\n * but only checks for the full state name. If params is supplied then it will be\n * tested for strict equality against the current active params object, so all params\n * must match with none missing and no extras.\n *\n * @example\n * <pre>\n * $state.$current.name = 'contacts.details.item';\n *\n * // absolute name\n * $state.is('contact.details.item'); // returns true\n * $state.is(contactDetailItemStateObject); // returns true\n *\n * // relative name (. and ^), typically from a template\n * // E.g. from the 'contacts.details' template\n * <div ng-class=\"{highlighted: $state.is('.item')}\">Item</div>\n * </pre>\n *\n * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.\n * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like\n * to test against the current active state.\n * @param {object=} options An options object. The options are:\n *\n * - **`relative`** - {string|object} - If `stateOrName` is a relative state name and `options.relative` is set, .is will\n * test relative to `options.relative` state (or name).\n *\n * @returns {boolean} Returns true if it is the state.\n */\n $state.is = function is(stateOrName, params, options) {\n options = extend({ relative: $state.$current }, options || {});\n var state = findState(stateOrName, options.relative);\n\n if (!isDefined(state)) { return undefined; }\n if ($state.$current !== state) { return false; }\n return params ? equalForKeys(state.params.$$values(params), $stateParams) : true;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#includes\n * @methodOf ui.router.state.$state\n *\n * @description\n * A method to determine if the current active state is equal to or is the child of the\n * state stateName. If any params are passed then they will be tested for a match as well.\n * Not all the parameters need to be passed, just the ones you'd like to test for equality.\n *\n * @example\n * Partial and relative names\n * <pre>\n * $state.$current.name = 'contacts.details.item';\n *\n * // Using partial names\n * $state.includes(\"contacts\"); // returns true\n * $state.includes(\"contacts.details\"); // returns true\n * $state.includes(\"contacts.details.item\"); // returns true\n * $state.includes(\"contacts.list\"); // returns false\n * $state.includes(\"about\"); // returns false\n *\n * // Using relative names (. and ^), typically from a template\n * // E.g. from the 'contacts.details' template\n * <div ng-class=\"{highlighted: $state.includes('.item')}\">Item</div>\n * </pre>\n *\n * Basic globbing patterns\n * <pre>\n * $state.$current.name = 'contacts.details.item.url';\n *\n * $state.includes(\"*.details.*.*\"); // returns true\n * $state.includes(\"*.details.**\"); // returns true\n * $state.includes(\"**.item.**\"); // returns true\n * $state.includes(\"*.details.item.url\"); // returns true\n * $state.includes(\"*.details.*.url\"); // returns true\n * $state.includes(\"*.details.*\"); // returns false\n * $state.includes(\"item.**\"); // returns false\n * </pre>\n *\n * @param {string} stateOrName A partial name, relative name, or glob pattern\n * to be searched for within the current state name.\n * @param {object=} params A param object, e.g. `{sectionId: section.id}`,\n * that you'd like to test against the current active state.\n * @param {object=} options An options object. The options are:\n *\n * - **`relative`** - {string|object=} - If `stateOrName` is a relative state reference and `options.relative` is set,\n * .includes will test relative to `options.relative` state (or name).\n *\n * @returns {boolean} Returns true if it does include the state\n */\n $state.includes = function includes(stateOrName, params, options) {\n options = extend({ relative: $state.$current }, options || {});\n if (isString(stateOrName) && isGlob(stateOrName)) {\n if (!doesStateMatchGlob(stateOrName)) {\n return false;\n }\n stateOrName = $state.$current.name;\n }\n\n var state = findState(stateOrName, options.relative);\n if (!isDefined(state)) { return undefined; }\n if (!isDefined($state.$current.includes[state.name])) { return false; }\n return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true;\n };\n\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#href\n * @methodOf ui.router.state.$state\n *\n * @description\n * A url generation method that returns the compiled url for the given state populated with the given params.\n *\n * @example\n * <pre>\n * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\n * </pre>\n *\n * @param {string|object} stateOrName The state name or state object you'd like to generate a url from.\n * @param {object=} params An object of parameter values to fill the state's required parameters.\n * @param {object=} options Options object. The options are:\n *\n * - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the\n * first parameter, then the constructed href url will be built from the first navigable ancestor (aka\n * ancestor with a valid url).\n * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n * defines which state to be relative from.\n * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n * \n * @returns {string} compiled state url\n */\n $state.href = function href(stateOrName, params, options) {\n options = extend({\n lossy: true,\n inherit: true,\n absolute: false,\n relative: $state.$current\n }, options || {});\n\n var state = findState(stateOrName, options.relative);\n\n if (!isDefined(state)) return null;\n if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);\n \n var nav = (state && options.lossy) ? state.navigable : state;\n\n if (!nav || nav.url === undefined || nav.url === null) {\n return null;\n }\n return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys().concat('#'), params || {}), {\n absolute: options.absolute\n });\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#get\n * @methodOf ui.router.state.$state\n *\n * @description\n * Returns the state configuration object for any specific state or all states.\n *\n * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for\n * the requested state. If not provided, returns an array of ALL state configs.\n * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.\n * @returns {Object|Array} State configuration object or array of all objects.\n */\n $state.get = function (stateOrName, context) {\n if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });\n var state = findState(stateOrName, context || $state.$current);\n return (state && state.self) ? state.self : null;\n };\n\n function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {\n // Make a restricted $stateParams with only the parameters that apply to this state if\n // necessary. In addition to being available to the controller and onEnter/onExit callbacks,\n // we also need $stateParams to be available for any $injector calls we make during the\n // dependency resolution process.\n var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);\n var locals = { $stateParams: $stateParams };\n\n // Resolve 'global' dependencies for the state, i.e. those not specific to a view.\n // We're also including $stateParams in this; that way the parameters are restricted\n // to the set that should be visible to the state, and are independent of when we update\n // the global $state and $stateParams values.\n dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);\n var promises = [dst.resolve.then(function (globals) {\n dst.globals = globals;\n })];\n if (inherited) promises.push(inherited);\n\n function resolveViews() {\n var viewsPromises = [];\n\n // Resolve template and dependencies for all views.\n forEach(state.views, function (view, name) {\n var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});\n injectables.$template = [ function () {\n return $view.load(name, { view: view, locals: dst.globals, params: $stateParams, notify: options.notify }) || '';\n }];\n\n viewsPromises.push($resolve.resolve(injectables, dst.globals, dst.resolve, state).then(function (result) {\n // References to the controller (only instantiated at link time)\n if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {\n var injectLocals = angular.extend({}, injectables, dst.globals);\n result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);\n } else {\n result.$$controller = view.controller;\n }\n // Provide access to the state itself for internal use\n result.$$state = state;\n result.$$controllerAs = view.controllerAs;\n dst[name] = result;\n }));\n });\n\n return $q.all(viewsPromises).then(function(){\n return dst.globals;\n });\n }\n\n // Wait for all the promises and then return the activation object\n return $q.all(promises).then(resolveViews).then(function (values) {\n return dst;\n });\n }\n\n return $state;\n }\n\n function shouldSkipReload(to, toParams, from, fromParams, locals, options) {\n // Return true if there are no differences in non-search (path/object) params, false if there are differences\n function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }\n\n // If reload was not explicitly requested\n // and we're transitioning to the same state we're already in\n // and the locals didn't change\n // or they changed in a way that doesn't merit reloading\n // (reloadOnParams:false, or reloadOnSearch.false and only search params changed)\n // Then return true.\n if (!options.reload && to === from &&\n (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) {\n return true;\n }\n }\n}\n\nangular.module('ui.router.state')\n .factory('$stateParams', function () { return {}; })\n .provider('$state', $StateProvider);\n\n\n$ViewProvider.$inject = [];\nfunction $ViewProvider() {\n\n this.$get = $get;\n /**\n * @ngdoc object\n * @name ui.router.state.$view\n *\n * @requires ui.router.util.$templateFactory\n * @requires $rootScope\n *\n * @description\n *\n */\n $get.$inject = ['$rootScope', '$templateFactory'];\n function $get( $rootScope, $templateFactory) {\n return {\n // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })\n /**\n * @ngdoc function\n * @name ui.router.state.$view#load\n * @methodOf ui.router.state.$view\n *\n * @description\n *\n * @param {string} name name\n * @param {object} options option object.\n */\n load: function load(name, options) {\n var result, defaults = {\n template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}\n };\n options = extend(defaults, options);\n\n if (options.view) {\n result = $templateFactory.fromConfig(options.view, options.params, options.locals);\n }\n return result;\n }\n };\n }\n}\n\nangular.module('ui.router.state').provider('$view', $ViewProvider);\n\n/**\n * @ngdoc object\n * @name ui.router.state.$uiViewScrollProvider\n *\n * @description\n * Provider that returns the {@link ui.router.state.$uiViewScroll} service function.\n */\nfunction $ViewScrollProvider() {\n\n var useAnchorScroll = false;\n\n /**\n * @ngdoc function\n * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll\n * @methodOf ui.router.state.$uiViewScrollProvider\n *\n * @description\n * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for\n * scrolling based on the url anchor.\n */\n this.useAnchorScroll = function () {\n useAnchorScroll = true;\n };\n\n /**\n * @ngdoc object\n * @name ui.router.state.$uiViewScroll\n *\n * @requires $anchorScroll\n * @requires $timeout\n *\n * @description\n * When called with a jqLite element, it scrolls the element into view (after a\n * `$timeout` so the DOM has time to refresh).\n *\n * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,\n * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.\n */\n this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {\n if (useAnchorScroll) {\n return $anchorScroll;\n }\n\n return function ($element) {\n return $timeout(function () {\n $element[0].scrollIntoView();\n }, 0, false);\n };\n }];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n\nvar ngMajorVer = angular.version.major;\nvar ngMinorVer = angular.version.minor;\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-view\n *\n * @requires ui.router.state.$state\n * @requires $compile\n * @requires $controller\n * @requires $injector\n * @requires ui.router.state.$uiViewScroll\n * @requires $document\n *\n * @restrict ECA\n *\n * @description\n * The ui-view directive tells $state where to place your templates.\n *\n * @param {string=} name A view name. The name should be unique amongst the other views in the\n * same state. You can have views of the same name that live in different states.\n *\n * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window\n * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll\n * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you\n * scroll ui-view elements into view when they are populated during a state activation.\n *\n * @param {string=} noanimation If truthy, the non-animated renderer will be selected (no animations\n * will be applied to the ui-view)\n *\n * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)\n * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*\n *\n * @param {string=} onload Expression to evaluate whenever the view updates.\n * \n * @example\n * A view can be unnamed or named. \n * <pre>\n * <!-- Unnamed -->\n * <div ui-view></div> \n * \n * <!-- Named -->\n * <div ui-view=\"viewName\"></div>\n * </pre>\n *\n * You can only have one unnamed view within any template (or root html). If you are only using a \n * single view and it is unnamed then you can populate it like so:\n * <pre>\n * <div ui-view></div> \n * $stateProvider.state(\"home\", {\n * template: \"<h1>HELLO!</h1>\"\n * })\n * </pre>\n * \n * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}\n * config property, by name, in this case an empty name:\n * <pre>\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"<h1>HELLO!</h1>\"\n * }\n * } \n * })\n * </pre>\n * \n * But typically you'll only use the views property if you name your view or have more than one view \n * in the same template. There's not really a compelling reason to name a view if its the only one, \n * but you could if you wanted, like so:\n * <pre>\n * <div ui-view=\"main\"></div>\n * </pre> \n * <pre>\n * $stateProvider.state(\"home\", {\n * views: {\n * \"main\": {\n * template: \"<h1>HELLO!</h1>\"\n * }\n * } \n * })\n * </pre>\n * \n * Really though, you'll use views to set up multiple views:\n * <pre>\n * <div ui-view></div>\n * <div ui-view=\"chart\"></div> \n * <div ui-view=\"data\"></div> \n * </pre>\n * \n * <pre>\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"<h1>HELLO!</h1>\"\n * },\n * \"chart\": {\n * template: \"<chart_thing/>\"\n * },\n * \"data\": {\n * template: \"<data_thing/>\"\n * }\n * } \n * })\n * </pre>\n *\n * Examples for `autoscroll`:\n *\n * <pre>\n * <!-- If autoscroll present with no expression,\n * then scroll ui-view into view -->\n * <ui-view autoscroll/>\n *\n * <!-- If autoscroll present with valid expression,\n * then scroll ui-view into view if expression evaluates to true -->\n * <ui-view autoscroll='true'/>\n * <ui-view autoscroll='false'/>\n * <ui-view autoscroll='scopeVariable'/>\n * </pre>\n */\n$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];\nfunction $ViewDirective( $state, $injector, $uiViewScroll, $interpolate) {\n\n function getService() {\n return ($injector.has) ? function(service) {\n return $injector.has(service) ? $injector.get(service) : null;\n } : function(service) {\n try {\n return $injector.get(service);\n } catch (e) {\n return null;\n }\n };\n }\n\n var service = getService(),\n $animator = service('$animator'),\n $animate = service('$animate');\n\n // Returns a set of DOM manipulation functions based on which Angular version\n // it should use\n function getRenderer(attrs, scope) {\n var statics = {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n\n if (!!attrs.noanimation) return statics;\n\n function animEnabled(element) {\n if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element);\n if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled();\n return (!!$animator);\n }\n\n // ng 1.2+\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (!animEnabled(element)) {\n statics.enter(element, target, cb);\n } else if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (!animEnabled(element)) {\n statics.leave(element, cb);\n } else if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n // ng 1.1.5\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics;\n }\n\n var directive = {\n restrict: 'ECA',\n terminal: true,\n priority: 400,\n transclude: 'element',\n compile: function (tElement, tAttrs, $transclude) {\n return function (scope, $element, attrs) {\n var previousEl, currentEl, currentScope, latestLocals,\n onloadExp = attrs.onload || '',\n autoScrollExp = attrs.autoscroll,\n renderer = getRenderer(attrs, scope);\n\n scope.$on('$stateChangeSuccess', function() {\n updateView(false);\n });\n\n updateView(true);\n\n function cleanupLastView() {\n var _previousEl = previousEl;\n var _currentScope = currentScope;\n\n if (_currentScope) {\n _currentScope._willBeDestroyed = true;\n }\n\n function cleanOld() {\n if (_previousEl) {\n _previousEl.remove();\n }\n\n if (_currentScope) {\n _currentScope.$destroy();\n }\n }\n\n if (currentEl) {\n renderer.leave(currentEl, function() {\n cleanOld();\n previousEl = null;\n });\n\n previousEl = currentEl;\n } else {\n cleanOld();\n previousEl = null;\n }\n\n currentEl = null;\n currentScope = null;\n }\n\n function updateView(firstTime) {\n var newScope,\n name = getUiViewName(scope, attrs, $element, $interpolate),\n previousLocals = name && $state.$current && $state.$current.locals[name];\n\n if (!firstTime && previousLocals === latestLocals || scope._willBeDestroyed) return; // nothing to do\n newScope = scope.$new();\n latestLocals = $state.$current.locals[name];\n\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoading\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive scope\n * @description\n *\n * Fired once the view **begins loading**, *before* the DOM is rendered.\n *\n * @param {Object} event Event object.\n * @param {string} viewName Name of the view.\n */\n newScope.$emit('$viewContentLoading', name);\n\n var clone = $transclude(newScope, function(clone) {\n renderer.enter(clone, $element, function onUiViewEnter() {\n if(currentScope) {\n currentScope.$emit('$viewContentAnimationEnded');\n }\n\n if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {\n $uiViewScroll(clone);\n }\n });\n cleanupLastView();\n });\n\n currentEl = clone;\n currentScope = newScope;\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoaded\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive scope\n * @description\n * Fired once the view is **loaded**, *after* the DOM is rendered.\n *\n * @param {Object} event Event object.\n * @param {string} viewName Name of the view.\n */\n currentScope.$emit('$viewContentLoaded', name);\n currentScope.$eval(onloadExp);\n }\n };\n }\n };\n\n return directive;\n}\n\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];\nfunction $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) {\n return {\n restrict: 'ECA',\n priority: -400,\n compile: function (tElement) {\n var initial = tElement.html();\n return function (scope, $element, attrs) {\n var current = $state.$current,\n name = getUiViewName(scope, attrs, $element, $interpolate),\n locals = current && current.locals[name];\n\n if (! locals) {\n return;\n }\n\n $element.data('$uiView', { name: name, state: locals.$$state });\n $element.html(locals.$template ? locals.$template : initial);\n\n var link = $compile($element.contents());\n\n if (locals.$$controller) {\n locals.$scope = scope;\n locals.$element = $element;\n var controller = $controller(locals.$$controller, locals);\n if (locals.$$controllerAs) {\n scope[locals.$$controllerAs] = controller;\n }\n $element.data('$ngControllerController', controller);\n $element.children().data('$ngControllerController', controller);\n }\n\n link(scope);\n };\n }\n };\n}\n\n/**\n * Shared ui-view code for both directives:\n * Given scope, element, and its attributes, return the view's name\n */\nfunction getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var inherited = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n}\n\nangular.module('ui.router.state').directive('uiView', $ViewDirective);\nangular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n\nfunction parseStateRef(ref, current) {\n var preparsed = ref.match(/^\\s*({[^}]*})\\s*$/), parsed;\n if (preparsed) ref = current + '(' + preparsed[1] + ')';\n parsed = ref.replace(/\\n/g, \" \").match(/^([^(]+?)\\s*(\\((.*)\\))?$/);\n if (!parsed || parsed.length !== 4) throw new Error(\"Invalid state ref '\" + ref + \"'\");\n return { state: parsed[1], paramExpr: parsed[3] || null };\n}\n\nfunction stateContext(el) {\n var stateData = el.parent().inheritedData('$uiView');\n\n if (stateData && stateData.state && stateData.state.name) {\n return stateData.state;\n }\n}\n\nfunction getTypeInfo(el) {\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';\n var isForm = el[0].nodeName === \"FORM\";\n\n return {\n attr: isForm ? \"action\" : (isSvg ? 'xlink:href' : 'href'),\n isAnchor: el.prop(\"tagName\").toUpperCase() === \"A\",\n clickable: !isForm\n };\n}\n\nfunction clickHook(el, $state, $timeout, type, current) {\n return function(e) {\n var button = e.which || e.button, target = current();\n\n if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) {\n // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\n var transition = $timeout(function() {\n $state.go(target.state, target.params, target.options);\n });\n e.preventDefault();\n\n // if the state has no URL, ignore one preventDefault from the <a> directive.\n var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1: 0;\n\n e.preventDefault = function() {\n if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition);\n };\n }\n };\n}\n\nfunction defaultOpts(el, $state) {\n return { relative: stateContext(el) || $state.$current, inherit: true };\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref\n *\n * @requires ui.router.state.$state\n * @requires $timeout\n *\n * @restrict A\n *\n * @description\n * A directive that binds a link (`<a>` tag) to a state. If the state has an associated\n * URL, the directive will automatically generate & update the `href` attribute via\n * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking\n * the link will trigger a state transition with optional parameters.\n *\n * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be\n * handled natively by the browser.\n *\n * You can also use relative state paths within ui-sref, just like the relative\n * paths passed to `$state.go()`. You just need to be aware that the path is relative\n * to the state that the link lives in, in other words the state that loaded the\n * template containing the link.\n *\n * You can specify options to pass to {@link ui.router.state.$state#go $state.go()}\n * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,\n * and `reload`.\n *\n * @example\n * Here's an example of how you'd use ui-sref and how it would compile. If you have the\n * following template:\n * <pre>\n * <a ui-sref=\"home\">Home</a> | <a ui-sref=\"about\">About</a> | <a ui-sref=\"{page: 2}\">Next page</a>\n *\n * <ul>\n * <li ng-repeat=\"contact in contacts\">\n * <a ui-sref=\"contacts.detail({ id: contact.id })\">{{ contact.name }}</a>\n * </li>\n * </ul>\n * </pre>\n *\n * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):\n * <pre>\n * <a href=\"#/home\" ui-sref=\"home\">Home</a> | <a href=\"#/about\" ui-sref=\"about\">About</a> | <a href=\"#/contacts?page=2\" ui-sref=\"{page: 2}\">Next page</a>\n *\n * <ul>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/1\" ui-sref=\"contacts.detail({ id: contact.id })\">Joe</a>\n * </li>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/2\" ui-sref=\"contacts.detail({ id: contact.id })\">Alice</a>\n * </li>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/3\" ui-sref=\"contacts.detail({ id: contact.id })\">Bob</a>\n * </li>\n * </ul>\n *\n * <a ui-sref=\"home\" ui-sref-opts=\"{reload: true}\">Home</a>\n * </pre>\n *\n * @param {string} ui-sref 'stateName' can be any valid absolute or relative state\n * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}\n */\n$StateRefDirective.$inject = ['$state', '$timeout'];\nfunction $StateRefDirective($state, $timeout) {\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function(scope, element, attrs, uiSrefActive) {\n var ref = parseStateRef(attrs.uiSref, $state.current.name);\n var def = { state: ref.state, href: null, params: null };\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n\n def.options = extend(defaultOpts(element, $state), attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {});\n\n var update = function(val) {\n if (val) def.params = angular.copy(val);\n def.href = $state.href(ref.state, def.params, def.options);\n\n if (active) active.$$addStateInfo(ref.state, def.params);\n if (def.href !== null) attrs.$set(type.attr, def.href);\n };\n\n if (ref.paramExpr) {\n scope.$watch(ref.paramExpr, function(val) { if (val !== def.params) update(val); }, true);\n def.params = angular.copy(scope.$eval(ref.paramExpr));\n }\n update();\n\n if (!type.clickable) return;\n element.bind(\"click\", clickHook(element, $state, $timeout, type, function() { return def; }));\n }\n };\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-state\n *\n * @requires ui.router.state.uiSref\n *\n * @restrict A\n *\n * @description\n * Much like ui-sref, but will accept named $scope properties to evaluate for a state definition,\n * params and override options.\n *\n * @param {string} ui-state 'stateName' can be any valid absolute or relative state\n * @param {Object} ui-state-params params to pass to {@link ui.router.state.$state#href $state.href()}\n * @param {Object} ui-state-opts options to pass to {@link ui.router.state.$state#go $state.go()}\n */\n$StateRefDynamicDirective.$inject = ['$state', '$timeout'];\nfunction $StateRefDynamicDirective($state, $timeout) {\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function(scope, element, attrs, uiSrefActive) {\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n var group = [attrs.uiState, attrs.uiStateParams || null, attrs.uiStateOpts || null];\n var watch = '[' + group.map(function(val) { return val || 'null'; }).join(', ') + ']';\n var def = { state: null, params: null, options: null, href: null };\n\n function runStateRefLink (group) {\n def.state = group[0]; def.params = group[1]; def.options = group[2];\n def.href = $state.href(def.state, def.params, def.options);\n\n if (active) active.$$addStateInfo(def.state, def.params);\n if (def.href) attrs.$set(type.attr, def.href);\n }\n\n scope.$watch(watch, runStateRefLink, true);\n runStateRefLink(scope.$eval(watch));\n\n if (!type.clickable) return;\n element.bind(\"click\", clickHook(element, $state, $timeout, type, function() { return def; }));\n }\n };\n}\n\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * A directive working alongside ui-sref to add classes to an element when the\n * related ui-sref directive's state is active, and removing them when it is inactive.\n * The primary use-case is to simplify the special appearance of navigation menus\n * relying on `ui-sref`, by having the \"active\" state's menu button appear different,\n * distinguishing it from the inactive menu items.\n *\n * ui-sref-active can live on the same element as ui-sref or on a parent element. The first\n * ui-sref-active found at the same level or above the ui-sref will be used.\n *\n * Will activate when the ui-sref's target state or any child state is active. If you\n * need to activate only when the ui-sref target state is active and *not* any of\n * it's children, then you will use\n * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}\n *\n * @example\n * Given the following template:\n * <pre>\n * <ul>\n * <li ui-sref-active=\"active\" class=\"item\">\n * <a href ui-sref=\"app.user({user: 'bilbobaggins'})\">@bilbobaggins</a>\n * </li>\n * </ul>\n * </pre>\n *\n *\n * When the app state is \"app.user\" (or any children states), and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n * <pre>\n * <ul>\n * <li ui-sref-active=\"active\" class=\"item active\">\n * <a ui-sref=\"app.user({user: 'bilbobaggins'})\" href=\"/users/bilbobaggins\">@bilbobaggins</a>\n * </li>\n * </ul>\n * </pre>\n *\n * The class name is interpolated **once** during the directives link time (any further changes to the\n * interpolated value are ignored).\n *\n * Multiple classes may be specified in a space-separated format:\n * <pre>\n * <ul>\n * <li ui-sref-active='class1 class2 class3'>\n * <a ui-sref=\"app.user\">link</a>\n * </li>\n * </ul>\n * </pre>\n *\n * It is also possible to pass ui-sref-active an expression that evaluates\n * to an object hash, whose keys represent active class names and whose\n * values represent the respective state names/globs.\n * ui-sref-active will match if the current active state **includes** any of\n * the specified state names/globs, even the abstract ones.\n *\n * @Example\n * Given the following template, with \"admin\" being an abstract state:\n * <pre>\n * <div ui-sref-active=\"{'active': 'admin.*'}\">\n * <a ui-sref-active=\"active\" ui-sref=\"admin.roles\">Roles</a>\n * </div>\n * </pre>\n *\n * When the current state is \"admin.roles\" the \"active\" class will be applied\n * to both the <div> and <a> elements. It is important to note that the state\n * names/globs passed to ui-sref-active shadow the state provided by ui-sref.\n */\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active-eq\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate\n * when the exact target state used in the `ui-sref` is active; no child states.\n *\n */\n$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];\nfunction $StateRefActiveDirective($state, $stateParams, $interpolate) {\n return {\n restrict: \"A\",\n controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) {\n var states = [], activeClasses = {}, activeEqClass, uiSrefActive;\n\n // There probably isn't much point in $observing this\n // uiSrefActive and uiSrefActiveEq share the same directive object with some\n // slight difference in logic routing\n activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope);\n\n try {\n uiSrefActive = $scope.$eval($attrs.uiSrefActive);\n } catch (e) {\n // Do nothing. uiSrefActive is not a valid expression.\n // Fall back to using $interpolate below\n }\n uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope);\n if (isObject(uiSrefActive)) {\n forEach(uiSrefActive, function(stateOrName, activeClass) {\n if (isString(stateOrName)) {\n var ref = parseStateRef(stateOrName, $state.current.name);\n addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);\n }\n });\n }\n\n // Allow uiSref to communicate with uiSrefActive[Equals]\n this.$$addStateInfo = function (newState, newParams) {\n // we already got an explicit state provided by ui-sref-active, so we\n // shadow the one that comes from ui-sref\n if (isObject(uiSrefActive) && states.length > 0) {\n return;\n }\n addState(newState, newParams, uiSrefActive);\n update();\n };\n\n $scope.$on('$stateChangeSuccess', update);\n\n function addState(stateName, stateParams, activeClass) {\n var state = $state.get(stateName, stateContext($element));\n var stateHash = createStateHash(stateName, stateParams);\n\n states.push({\n state: state || { name: stateName },\n params: stateParams,\n hash: stateHash\n });\n\n activeClasses[stateHash] = activeClass;\n }\n\n /**\n * @param {string} state\n * @param {Object|string} [params]\n * @return {string}\n */\n function createStateHash(state, params) {\n if (!isString(state)) {\n throw new Error('state should be a string');\n }\n if (isObject(params)) {\n return state + toJson(params);\n }\n params = $scope.$eval(params);\n if (isObject(params)) {\n return state + toJson(params);\n }\n return state;\n }\n\n // Update route state\n function update() {\n for (var i = 0; i < states.length; i++) {\n if (anyMatch(states[i].state, states[i].params)) {\n addClass($element, activeClasses[states[i].hash]);\n } else {\n removeClass($element, activeClasses[states[i].hash]);\n }\n\n if (exactMatch(states[i].state, states[i].params)) {\n addClass($element, activeEqClass);\n } else {\n removeClass($element, activeEqClass);\n }\n }\n }\n\n function addClass(el, className) { $timeout(function () { el.addClass(className); }); }\n function removeClass(el, className) { el.removeClass(className); }\n function anyMatch(state, params) { return $state.includes(state.name, params); }\n function exactMatch(state, params) { return $state.is(state.name, params); }\n\n update();\n }]\n };\n}\n\nangular.module('ui.router.state')\n .directive('uiSref', $StateRefDirective)\n .directive('uiSrefActive', $StateRefActiveDirective)\n .directive('uiSrefActiveEq', $StateRefActiveDirective)\n .directive('uiState', $StateRefDynamicDirective);\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:isState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_is $state.is(\"stateName\")}.\n */\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state) {\n var isFilter = function (state, params) {\n return $state.is(state, params);\n };\n isFilter.$stateful = true;\n return isFilter;\n}\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:includedByState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.\n */\n$IncludedByStateFilter.$inject = ['$state'];\nfunction $IncludedByStateFilter($state) {\n var includesFilter = function (state, params, options) {\n return $state.includes(state, params, options);\n };\n includesFilter.$stateful = true;\n return includesFilter;\n}\n\nangular.module('ui.router.state')\n .filter('isState', $IsStateFilter)\n .filter('includedByState', $IncludedByStateFilter);\n})(window, window.angular);\n/*\n * angular-ui-bootstrap\n * http://angular-ui.github.io/bootstrap/\n\n * Version: 0.13.4 - 2015-09-03\n * License: MIT\n */\nangular.module(\"ui.bootstrap\", [\"ui.bootstrap.tpls\", \"ui.bootstrap.collapse\",\"ui.bootstrap.accordion\",\"ui.bootstrap.alert\",\"ui.bootstrap.bindHtml\",\"ui.bootstrap.buttons\",\"ui.bootstrap.carousel\",\"ui.bootstrap.dateparser\",\"ui.bootstrap.position\",\"ui.bootstrap.datepicker\",\"ui.bootstrap.dropdown\",\"ui.bootstrap.modal\",\"ui.bootstrap.pagination\",\"ui.bootstrap.tooltip\",\"ui.bootstrap.popover\",\"ui.bootstrap.progressbar\",\"ui.bootstrap.rating\",\"ui.bootstrap.tabs\",\"ui.bootstrap.timepicker\",\"ui.bootstrap.transition\",\"ui.bootstrap.typeahead\"]);\nangular.module(\"ui.bootstrap.tpls\", [\"template/accordion/accordion-group.html\",\"template/accordion/accordion.html\",\"template/alert/alert.html\",\"template/carousel/carousel.html\",\"template/carousel/slide.html\",\"template/datepicker/datepicker.html\",\"template/datepicker/day.html\",\"template/datepicker/month.html\",\"template/datepicker/popup.html\",\"template/datepicker/year.html\",\"template/modal/backdrop.html\",\"template/modal/window.html\",\"template/pagination/pager.html\",\"template/pagination/pagination.html\",\"template/tooltip/tooltip-html-popup.html\",\"template/tooltip/tooltip-html-unsafe-popup.html\",\"template/tooltip/tooltip-popup.html\",\"template/tooltip/tooltip-template-popup.html\",\"template/popover/popover-html.html\",\"template/popover/popover-template.html\",\"template/popover/popover.html\",\"template/progressbar/bar.html\",\"template/progressbar/progress.html\",\"template/progressbar/progressbar.html\",\"template/rating/rating.html\",\"template/tabs/tab.html\",\"template/tabs/tabset.html\",\"template/timepicker/timepicker.html\",\"template/typeahead/typeahead-match.html\",\"template/typeahead/typeahead-popup.html\"]);\nangular.module('ui.bootstrap.collapse', [])\n\n .directive('collapse', ['$animate', function($animate) {\n return {\n link: function(scope, element, attrs) {\n function expand() {\n element.removeClass('collapse')\n .addClass('collapsing')\n .attr('aria-expanded', true)\n .attr('aria-hidden', false);\n\n $animate.addClass(element, 'in', {\n to: { height: element[0].scrollHeight + 'px' }\n }).then(expandDone);\n }\n\n function expandDone() {\n element.removeClass('collapsing');\n element.css({height: 'auto'});\n }\n\n function collapse() {\n if (!element.hasClass('collapse') && !element.hasClass('in')) {\n return collapseDone();\n }\n\n element\n // IMPORTANT: The height must be set before adding \"collapsing\" class.\n // Otherwise, the browser attempts to animate from height 0 (in\n // collapsing class) to the given height here.\n .css({height: element[0].scrollHeight + 'px'})\n // initially all panel collapse have the collapse class, this removal\n // prevents the animation from jumping to collapsed state\n .removeClass('collapse')\n .addClass('collapsing')\n .attr('aria-expanded', false)\n .attr('aria-hidden', true);\n\n $animate.removeClass(element, 'in', {\n to: {height: '0'}\n }).then(collapseDone);\n }\n\n function collapseDone() {\n element.css({height: '0'}); // Required so that collapse works when animation is disabled\n element.removeClass('collapsing');\n element.addClass('collapse');\n }\n\n scope.$watch(attrs.collapse, function(shouldCollapse) {\n if (shouldCollapse) {\n collapse();\n } else {\n expand();\n }\n });\n }\n };\n }]);\n\nangular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse'])\n\n.constant('accordionConfig', {\n closeOthers: true\n})\n\n.controller('AccordionController', ['$scope', '$attrs', 'accordionConfig', function($scope, $attrs, accordionConfig) {\n // This array keeps track of the accordion groups\n this.groups = [];\n\n // Ensure that all the groups in this accordion are closed, unless close-others explicitly says not to\n this.closeOthers = function(openGroup) {\n var closeOthers = angular.isDefined($attrs.closeOthers) ?\n $scope.$eval($attrs.closeOthers) : accordionConfig.closeOthers;\n if (closeOthers) {\n angular.forEach(this.groups, function(group) {\n if (group !== openGroup) {\n group.isOpen = false;\n }\n });\n }\n };\n\n // This is called from the accordion-group directive to add itself to the accordion\n this.addGroup = function(groupScope) {\n var that = this;\n this.groups.push(groupScope);\n\n groupScope.$on('$destroy', function(event) {\n that.removeGroup(groupScope);\n });\n };\n\n // This is called from the accordion-group directive when to remove itself\n this.removeGroup = function(group) {\n var index = this.groups.indexOf(group);\n if (index !== -1) {\n this.groups.splice(index, 1);\n }\n };\n\n}])\n\n// The accordion directive simply sets up the directive controller\n// and adds an accordion CSS class to itself element.\n.directive('accordion', function() {\n return {\n restrict: 'EA',\n controller: 'AccordionController',\n controllerAs: 'accordion',\n transclude: true,\n replace: false,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/accordion/accordion.html';\n }\n };\n})\n\n// The accordion-group directive indicates a block of html that will expand and collapse in an accordion\n.directive('accordionGroup', function() {\n return {\n require: '^accordion', // We need this directive to be inside an accordion\n restrict: 'EA',\n transclude: true, // It transcludes the contents of the directive into the template\n replace: true, // The element containing the directive will be replaced with the template\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/accordion/accordion-group.html';\n },\n scope: {\n heading: '@', // Interpolate the heading attribute onto this scope\n isOpen: '=?',\n isDisabled: '=?'\n },\n controller: function() {\n this.setHeading = function(element) {\n this.heading = element;\n };\n },\n link: function(scope, element, attrs, accordionCtrl) {\n accordionCtrl.addGroup(scope);\n\n scope.openClass = attrs.openClass || 'panel-open';\n scope.panelClass = attrs.panelClass;\n scope.$watch('isOpen', function(value) {\n element.toggleClass(scope.openClass, value);\n if (value) {\n accordionCtrl.closeOthers(scope);\n }\n });\n\n scope.toggleOpen = function($event) {\n if (!scope.isDisabled) {\n if (!$event || $event.which === 32) {\n scope.isOpen = !scope.isOpen;\n }\n }\n };\n }\n };\n})\n\n// Use accordion-heading below an accordion-group to provide a heading containing HTML\n// <accordion-group>\n// <accordion-heading>Heading containing HTML - <img src=\"...\"></accordion-heading>\n// </accordion-group>\n.directive('accordionHeading', function() {\n return {\n restrict: 'EA',\n transclude: true, // Grab the contents to be used as the heading\n template: '', // In effect remove this element!\n replace: true,\n require: '^accordionGroup',\n link: function(scope, element, attr, accordionGroupCtrl, transclude) {\n // Pass the heading to the accordion-group controller\n // so that it can be transcluded into the right place in the template\n // [The second parameter to transclude causes the elements to be cloned so that they work in ng-repeat]\n accordionGroupCtrl.setHeading(transclude(scope, angular.noop));\n }\n };\n})\n\n// Use in the accordion-group template to indicate where you want the heading to be transcluded\n// You must provide the property on the accordion-group controller that will hold the transcluded element\n// <div class=\"accordion-group\">\n// <div class=\"accordion-heading\" ><a ... accordion-transclude=\"heading\">...</a></div>\n// ...\n// </div>\n.directive('accordionTransclude', function() {\n return {\n require: '^accordionGroup',\n link: function(scope, element, attr, controller) {\n scope.$watch(function() { return controller[attr.accordionTransclude]; }, function(heading) {\n if (heading) {\n element.find('span').html('');\n element.find('span').append(heading);\n }\n });\n }\n };\n})\n\n;\n\nangular.module('ui.bootstrap.alert', [])\n\n.controller('AlertController', ['$scope', '$attrs', function($scope, $attrs) {\n $scope.closeable = !!$attrs.close;\n this.close = $scope.close;\n}])\n\n.directive('alert', function() {\n return {\n controller: 'AlertController',\n controllerAs: 'alert',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/alert/alert.html';\n },\n transclude: true,\n replace: true,\n scope: {\n type: '@',\n close: '&'\n }\n };\n})\n\n.directive('dismissOnTimeout', ['$timeout', function($timeout) {\n return {\n require: 'alert',\n link: function(scope, element, attrs, alertCtrl) {\n $timeout(function() {\n alertCtrl.close();\n }, parseInt(attrs.dismissOnTimeout, 10));\n }\n };\n}]);\n\nangular.module('ui.bootstrap.bindHtml', [])\n\n .value('$bindHtmlUnsafeSuppressDeprecated', false)\n\n .directive('bindHtmlUnsafe', ['$log', '$bindHtmlUnsafeSuppressDeprecated', function ($log, $bindHtmlUnsafeSuppressDeprecated) {\n return function (scope, element, attr) {\n if (!$bindHtmlUnsafeSuppressDeprecated) {\n $log.warn('bindHtmlUnsafe is now deprecated. Use ngBindHtml instead');\n }\n element.addClass('ng-binding').data('$binding', attr.bindHtmlUnsafe);\n scope.$watch(attr.bindHtmlUnsafe, function bindHtmlUnsafeWatchAction(value) {\n element.html(value || '');\n });\n };\n }]);\nangular.module('ui.bootstrap.buttons', [])\n\n.constant('buttonConfig', {\n activeClass: 'active',\n toggleEvent: 'click'\n})\n\n.controller('ButtonsController', ['buttonConfig', function(buttonConfig) {\n this.activeClass = buttonConfig.activeClass || 'active';\n this.toggleEvent = buttonConfig.toggleEvent || 'click';\n}])\n\n.directive('btnRadio', function() {\n return {\n require: ['btnRadio', 'ngModel'],\n controller: 'ButtonsController',\n controllerAs: 'buttons',\n link: function(scope, element, attrs, ctrls) {\n var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n element.find('input').css({display: 'none'});\n\n //model -> UI\n ngModelCtrl.$render = function() {\n element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, scope.$eval(attrs.btnRadio)));\n };\n\n //ui->model\n element.bind(buttonsCtrl.toggleEvent, function() {\n if (attrs.disabled) {\n return;\n }\n\n var isActive = element.hasClass(buttonsCtrl.activeClass);\n\n if (!isActive || angular.isDefined(attrs.uncheckable)) {\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(isActive ? null : scope.$eval(attrs.btnRadio));\n ngModelCtrl.$render();\n });\n }\n });\n }\n };\n})\n\n.directive('btnCheckbox', ['$document', function($document) {\n return {\n require: ['btnCheckbox', 'ngModel'],\n controller: 'ButtonsController',\n controllerAs: 'button',\n link: function(scope, element, attrs, ctrls) {\n var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n element.find('input').css({display: 'none'});\n\n function getTrueValue() {\n return getCheckboxValue(attrs.btnCheckboxTrue, true);\n }\n\n function getFalseValue() {\n return getCheckboxValue(attrs.btnCheckboxFalse, false);\n }\n\n function getCheckboxValue(attributeValue, defaultValue) {\n var val = scope.$eval(attributeValue);\n return angular.isDefined(val) ? val : defaultValue;\n }\n\n //model -> UI\n ngModelCtrl.$render = function() {\n element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue()));\n };\n\n //ui->model\n element.bind(buttonsCtrl.toggleEvent, function() {\n if (attrs.disabled) {\n return;\n }\n\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass) ? getFalseValue() : getTrueValue());\n ngModelCtrl.$render();\n });\n });\n\n //accessibility\n element.on('keypress', function(e) {\n if (attrs.disabled || e.which !== 32 || $document[0].activeElement !== element[0]) {\n return;\n }\n\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass) ? getFalseValue() : getTrueValue());\n ngModelCtrl.$render();\n });\n });\n }\n };\n}]);\n\n/**\n* @ngdoc overview\n* @name ui.bootstrap.carousel\n*\n* @description\n* AngularJS version of an image carousel.\n*\n*/\nangular.module('ui.bootstrap.carousel', [])\n.controller('CarouselController', ['$scope', '$element', '$interval', '$animate', function ($scope, $element, $interval, $animate) {\n var self = this,\n slides = self.slides = $scope.slides = [],\n NEW_ANIMATE = angular.version.minor >= 4,\n NO_TRANSITION = 'uib-noTransition',\n SLIDE_DIRECTION = 'uib-slideDirection',\n currentIndex = -1,\n currentInterval, isPlaying;\n self.currentSlide = null;\n\n var destroyed = false;\n /* direction: \"prev\" or \"next\" */\n self.select = $scope.select = function(nextSlide, direction) {\n var nextIndex = $scope.indexOfSlide(nextSlide);\n //Decide direction if it's not given\n if (direction === undefined) {\n direction = nextIndex > self.getCurrentIndex() ? 'next' : 'prev';\n }\n //Prevent this user-triggered transition from occurring if there is already one in progress\n if (nextSlide && nextSlide !== self.currentSlide && !$scope.$currentTransition) {\n goNext(nextSlide, nextIndex, direction);\n }\n };\n\n function goNext(slide, index, direction) {\n // Scope has been destroyed, stop here.\n if (destroyed) { return; }\n\n angular.extend(slide, {direction: direction, active: true});\n angular.extend(self.currentSlide || {}, {direction: direction, active: false});\n if ($animate.enabled() && !$scope.noTransition && !$scope.$currentTransition &&\n slide.$element && self.slides.length > 1) {\n slide.$element.data(SLIDE_DIRECTION, slide.direction);\n if (self.currentSlide && self.currentSlide.$element) {\n self.currentSlide.$element.data(SLIDE_DIRECTION, slide.direction);\n }\n\n $scope.$currentTransition = true;\n if (NEW_ANIMATE) {\n $animate.on('addClass', slide.$element, function (element, phase) {\n if (phase === 'close') {\n $scope.$currentTransition = null;\n $animate.off('addClass', element);\n }\n });\n } else {\n slide.$element.one('$animate:close', function closeFn() {\n $scope.$currentTransition = null;\n });\n }\n }\n\n self.currentSlide = slide;\n currentIndex = index;\n\n //every time you change slides, reset the timer\n restartTimer();\n }\n\n $scope.$on('$destroy', function () {\n destroyed = true;\n });\n\n function getSlideByIndex(index) {\n if (angular.isUndefined(slides[index].index)) {\n return slides[index];\n }\n var i, len = slides.length;\n for (i = 0; i < slides.length; ++i) {\n if (slides[i].index == index) {\n return slides[i];\n }\n }\n }\n\n self.getCurrentIndex = function() {\n if (self.currentSlide && angular.isDefined(self.currentSlide.index)) {\n return +self.currentSlide.index;\n }\n return currentIndex;\n };\n\n /* Allow outside people to call indexOf on slides array */\n $scope.indexOfSlide = function(slide) {\n return angular.isDefined(slide.index) ? +slide.index : slides.indexOf(slide);\n };\n\n $scope.next = function() {\n var newIndex = (self.getCurrentIndex() + 1) % slides.length;\n\n if (newIndex === 0 && $scope.noWrap()) {\n $scope.pause();\n return;\n }\n\n return self.select(getSlideByIndex(newIndex), 'next');\n };\n\n $scope.prev = function() {\n var newIndex = self.getCurrentIndex() - 1 < 0 ? slides.length - 1 : self.getCurrentIndex() - 1;\n\n if ($scope.noWrap() && newIndex === slides.length - 1){\n $scope.pause();\n return;\n }\n\n return self.select(getSlideByIndex(newIndex), 'prev');\n };\n\n $scope.isActive = function(slide) {\n return self.currentSlide === slide;\n };\n\n $scope.$watch('interval', restartTimer);\n $scope.$on('$destroy', resetTimer);\n\n function restartTimer() {\n resetTimer();\n var interval = +$scope.interval;\n if (!isNaN(interval) && interval > 0) {\n currentInterval = $interval(timerFn, interval);\n }\n }\n\n function resetTimer() {\n if (currentInterval) {\n $interval.cancel(currentInterval);\n currentInterval = null;\n }\n }\n\n function timerFn() {\n var interval = +$scope.interval;\n if (isPlaying && !isNaN(interval) && interval > 0 && slides.length) {\n $scope.next();\n } else {\n $scope.pause();\n }\n }\n\n $scope.play = function() {\n if (!isPlaying) {\n isPlaying = true;\n restartTimer();\n }\n };\n $scope.pause = function() {\n if (!$scope.noPause) {\n isPlaying = false;\n resetTimer();\n }\n };\n\n self.addSlide = function(slide, element) {\n slide.$element = element;\n slides.push(slide);\n //if this is the first slide or the slide is set to active, select it\n if(slides.length === 1 || slide.active) {\n self.select(slides[slides.length-1]);\n if (slides.length == 1) {\n $scope.play();\n }\n } else {\n slide.active = false;\n }\n };\n\n self.removeSlide = function(slide) {\n if (angular.isDefined(slide.index)) {\n slides.sort(function(a, b) {\n return +a.index > +b.index;\n });\n }\n //get the index of the slide inside the carousel\n var index = slides.indexOf(slide);\n slides.splice(index, 1);\n if (slides.length > 0 && slide.active) {\n if (index >= slides.length) {\n self.select(slides[index-1]);\n } else {\n self.select(slides[index]);\n }\n } else if (currentIndex > index) {\n currentIndex--;\n }\n \n //clean the currentSlide when no more slide\n if (slides.length === 0) {\n self.currentSlide = null;\n }\n };\n\n $scope.$watch('noTransition', function(noTransition) {\n $element.data(NO_TRANSITION, noTransition);\n });\n\n}])\n\n/**\n * @ngdoc directive\n * @name ui.bootstrap.carousel.directive:carousel\n * @restrict EA\n *\n * @description\n * Carousel is the outer container for a set of image 'slides' to showcase.\n *\n * @param {number=} interval The time, in milliseconds, that it will take the carousel to go to the next slide.\n * @param {boolean=} noTransition Whether to disable transitions on the carousel.\n * @param {boolean=} noPause Whether to disable pausing on the carousel (by default, the carousel interval pauses on hover).\n *\n * @example\n<example module=\"ui.bootstrap\">\n <file name=\"index.html\">\n <carousel>\n <slide>\n <img src=\"http://placekitten.com/150/150\" style=\"margin:auto;\">\n <div class=\"carousel-caption\">\n <p>Beautiful!</p>\n </div>\n </slide>\n <slide>\n <img src=\"http://placekitten.com/100/150\" style=\"margin:auto;\">\n <div class=\"carousel-caption\">\n <p>D'aww!</p>\n </div>\n </slide>\n </carousel>\n </file>\n <file name=\"demo.css\">\n .carousel-indicators {\n top: auto;\n bottom: 15px;\n }\n </file>\n</example>\n */\n.directive('carousel', [function() {\n return {\n restrict: 'EA',\n transclude: true,\n replace: true,\n controller: 'CarouselController',\n controllerAs: 'carousel',\n require: 'carousel',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/carousel/carousel.html';\n },\n scope: {\n interval: '=',\n noTransition: '=',\n noPause: '=',\n noWrap: '&'\n }\n };\n}])\n\n/**\n * @ngdoc directive\n * @name ui.bootstrap.carousel.directive:slide\n * @restrict EA\n *\n * @description\n * Creates a slide inside a {@link ui.bootstrap.carousel.directive:carousel carousel}. Must be placed as a child of a carousel element.\n *\n * @param {boolean=} active Model binding, whether or not this slide is currently active.\n * @param {number=} index The index of the slide. The slides will be sorted by this parameter.\n *\n * @example\n<example module=\"ui.bootstrap\">\n <file name=\"index.html\">\n<div ng-controller=\"CarouselDemoCtrl\">\n <carousel>\n <slide ng-repeat=\"slide in slides\" active=\"slide.active\" index=\"$index\">\n <img ng-src=\"{{slide.image}}\" style=\"margin:auto;\">\n <div class=\"carousel-caption\">\n <h4>Slide {{$index}}</h4>\n <p>{{slide.text}}</p>\n </div>\n </slide>\n </carousel>\n Interval, in milliseconds: <input type=\"number\" ng-model=\"myInterval\">\n <br />Enter a negative number to stop the interval.\n</div>\n </file>\n <file name=\"script.js\">\nfunction CarouselDemoCtrl($scope) {\n $scope.myInterval = 5000;\n}\n </file>\n <file name=\"demo.css\">\n .carousel-indicators {\n top: auto;\n bottom: 15px;\n }\n </file>\n</example>\n*/\n\n.directive('slide', function() {\n return {\n require: '^carousel',\n restrict: 'EA',\n transclude: true,\n replace: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/carousel/slide.html';\n },\n scope: {\n active: '=?',\n actual: '=?',\n index: '=?'\n },\n link: function (scope, element, attrs, carouselCtrl) {\n carouselCtrl.addSlide(scope, element);\n //when the scope is destroyed then remove the slide from the current slides array\n scope.$on('$destroy', function() {\n carouselCtrl.removeSlide(scope);\n });\n\n scope.$watch('active', function(active) {\n if (active) {\n carouselCtrl.select(scope);\n }\n });\n }\n };\n})\n\n.animation('.item', [\n '$injector', '$animate',\nfunction ($injector, $animate) {\n var NO_TRANSITION = 'uib-noTransition',\n SLIDE_DIRECTION = 'uib-slideDirection',\n $animateCss = null;\n\n if ($injector.has('$animateCss')) {\n $animateCss = $injector.get('$animateCss');\n }\n\n function removeClass(element, className, callback) {\n element.removeClass(className);\n if (callback) {\n callback();\n }\n }\n\n return {\n beforeAddClass: function (element, className, done) {\n // Due to transclusion, noTransition property is on parent's scope\n if (className == 'active' && element.parent() &&\n !element.parent().data(NO_TRANSITION)) {\n var stopped = false;\n var direction = element.data(SLIDE_DIRECTION);\n var directionClass = direction == 'next' ? 'left' : 'right';\n var removeClassFn = removeClass.bind(this, element,\n directionClass + ' ' + direction, done);\n element.addClass(direction);\n\n if ($animateCss) {\n $animateCss(element, {addClass: directionClass})\n .start()\n .done(removeClassFn);\n } else {\n $animate.addClass(element, directionClass).then(function () {\n if (!stopped) {\n removeClassFn();\n }\n done();\n });\n }\n\n return function () {\n stopped = true;\n };\n }\n done();\n },\n beforeRemoveClass: function (element, className, done) {\n // Due to transclusion, noTransition property is on parent's scope\n if (className === 'active' && element.parent() &&\n !element.parent().data(NO_TRANSITION)) {\n var stopped = false;\n var direction = element.data(SLIDE_DIRECTION);\n var directionClass = direction == 'next' ? 'left' : 'right';\n var removeClassFn = removeClass.bind(this, element, directionClass, done);\n\n if ($animateCss) {\n $animateCss(element, {addClass: directionClass})\n .start()\n .done(removeClassFn);\n } else {\n $animate.addClass(element, directionClass).then(function () {\n if (!stopped) {\n removeClassFn();\n }\n done();\n });\n }\n return function () {\n stopped = true;\n };\n }\n done();\n }\n };\n\n}])\n\n\n;\n\nangular.module('ui.bootstrap.dateparser', [])\n\n.service('dateParser', ['$log', '$locale', 'orderByFilter', function($log, $locale, orderByFilter) {\n // Pulled from https://github.com/mbostock/d3/blob/master/src/format/requote.js\n var SPECIAL_CHARACTERS_REGEXP = /[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g;\n\n this.parsers = {};\n\n var formatCodeToRegex = {\n 'yyyy': {\n regex: '\\\\d{4}',\n apply: function(value) { this.year = +value; }\n },\n 'yy': {\n regex: '\\\\d{2}',\n apply: function(value) { this.year = +value + 2000; }\n },\n 'y': {\n regex: '\\\\d{1,4}',\n apply: function(value) { this.year = +value; }\n },\n 'MMMM': {\n regex: $locale.DATETIME_FORMATS.MONTH.join('|'),\n apply: function(value) { this.month = $locale.DATETIME_FORMATS.MONTH.indexOf(value); }\n },\n 'MMM': {\n regex: $locale.DATETIME_FORMATS.SHORTMONTH.join('|'),\n apply: function(value) { this.month = $locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value); }\n },\n 'MM': {\n regex: '0[1-9]|1[0-2]',\n apply: function(value) { this.month = value - 1; }\n },\n 'M': {\n regex: '[1-9]|1[0-2]',\n apply: function(value) { this.month = value - 1; }\n },\n 'dd': {\n regex: '[0-2][0-9]{1}|3[0-1]{1}',\n apply: function(value) { this.date = +value; }\n },\n 'd': {\n regex: '[1-2]?[0-9]{1}|3[0-1]{1}',\n apply: function(value) { this.date = +value; }\n },\n 'EEEE': {\n regex: $locale.DATETIME_FORMATS.DAY.join('|')\n },\n 'EEE': {\n regex: $locale.DATETIME_FORMATS.SHORTDAY.join('|')\n },\n 'HH': {\n regex: '(?:0|1)[0-9]|2[0-3]',\n apply: function(value) { this.hours = +value; }\n },\n 'hh': {\n regex: '0[0-9]|1[0-2]',\n apply: function(value) { this.hours = +value; }\n },\n 'H': {\n regex: '1?[0-9]|2[0-3]',\n apply: function(value) { this.hours = +value; }\n },\n 'h': {\n regex: '[0-9]|1[0-2]',\n apply: function(value) { this.hours = +value; }\n },\n 'mm': {\n regex: '[0-5][0-9]',\n apply: function(value) { this.minutes = +value; }\n },\n 'm': {\n regex: '[0-9]|[1-5][0-9]',\n apply: function(value) { this.minutes = +value; }\n },\n 'sss': {\n regex: '[0-9][0-9][0-9]',\n apply: function(value) { this.milliseconds = +value; }\n },\n 'ss': {\n regex: '[0-5][0-9]',\n apply: function(value) { this.seconds = +value; }\n },\n 's': {\n regex: '[0-9]|[1-5][0-9]',\n apply: function(value) { this.seconds = +value; }\n },\n 'a': {\n regex: $locale.DATETIME_FORMATS.AMPMS.join('|'),\n apply: function(value) {\n if (this.hours === 12) {\n this.hours = 0;\n }\n\n if (value === 'PM') {\n this.hours += 12;\n }\n }\n }\n };\n\n function createParser(format) {\n var map = [], regex = format.split('');\n\n angular.forEach(formatCodeToRegex, function(data, code) {\n var index = format.indexOf(code);\n\n if (index > -1) {\n format = format.split('');\n\n regex[index] = '(' + data.regex + ')';\n format[index] = '$'; // Custom symbol to define consumed part of format\n for (var i = index + 1, n = index + code.length; i < n; i++) {\n regex[i] = '';\n format[i] = '$';\n }\n format = format.join('');\n\n map.push({ index: index, apply: data.apply });\n }\n });\n\n return {\n regex: new RegExp('^' + regex.join('') + '$'),\n map: orderByFilter(map, 'index')\n };\n }\n\n this.parse = function(input, format, baseDate) {\n if (!angular.isString(input) || !format) {\n return input;\n }\n\n format = $locale.DATETIME_FORMATS[format] || format;\n format = format.replace(SPECIAL_CHARACTERS_REGEXP, '\\\\$&');\n\n if (!this.parsers[format]) {\n this.parsers[format] = createParser(format);\n }\n\n var parser = this.parsers[format],\n regex = parser.regex,\n map = parser.map,\n results = input.match(regex);\n\n if (results && results.length) {\n var fields, dt;\n if (angular.isDate(baseDate) && !isNaN(baseDate.getTime())) {\n fields = {\n year: baseDate.getFullYear(),\n month: baseDate.getMonth(),\n date: baseDate.getDate(),\n hours: baseDate.getHours(),\n minutes: baseDate.getMinutes(),\n seconds: baseDate.getSeconds(),\n milliseconds: baseDate.getMilliseconds()\n };\n } else {\n if (baseDate) {\n $log.warn('dateparser:', 'baseDate is not a valid date');\n }\n fields = { year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 };\n }\n\n for (var i = 1, n = results.length; i < n; i++) {\n var mapper = map[i-1];\n if (mapper.apply) {\n mapper.apply.call(fields, results[i]);\n }\n }\n\n if (isValid(fields.year, fields.month, fields.date)) {\n dt = new Date(fields.year, fields.month, fields.date,\n fields.hours, fields.minutes, fields.seconds,\n fields.milliseconds || 0);\n }\n\n return dt;\n }\n };\n\n // Check if date is valid for specific month (and year for February).\n // Month: 0 = Jan, 1 = Feb, etc\n function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }\n}]);\n\nangular.module('ui.bootstrap.position', [])\n\n/**\n * A set of utility methods that can be use to retrieve position of DOM elements.\n * It is meant to be used where we need to absolute-position DOM elements in\n * relation to other, existing elements (this is the case for tooltips, popovers,\n * typeahead suggestions etc.).\n */\n .factory('$position', ['$document', '$window', function($document, $window) {\n function getStyle(el, cssprop) {\n if (el.currentStyle) { //IE\n return el.currentStyle[cssprop];\n } else if ($window.getComputedStyle) {\n return $window.getComputedStyle(el)[cssprop];\n }\n // finally try and get inline style\n return el.style[cssprop];\n }\n\n /**\n * Checks if a given element is statically positioned\n * @param element - raw DOM element\n */\n function isStaticPositioned(element) {\n return (getStyle(element, 'position') || 'static' ) === 'static';\n }\n\n /**\n * returns the closest, non-statically positioned parentOffset of a given element\n * @param element\n */\n var parentOffsetEl = function(element) {\n var docDomEl = $document[0];\n var offsetParent = element.offsetParent || docDomEl;\n while (offsetParent && offsetParent !== docDomEl && isStaticPositioned(offsetParent) ) {\n offsetParent = offsetParent.offsetParent;\n }\n return offsetParent || docDomEl;\n };\n\n return {\n /**\n * Provides read-only equivalent of jQuery's position function:\n * http://api.jquery.com/position/\n */\n position: function(element) {\n var elBCR = this.offset(element);\n var offsetParentBCR = { top: 0, left: 0 };\n var offsetParentEl = parentOffsetEl(element[0]);\n if (offsetParentEl != $document[0]) {\n offsetParentBCR = this.offset(angular.element(offsetParentEl));\n offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop;\n offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft;\n }\n\n var boundingClientRect = element[0].getBoundingClientRect();\n return {\n width: boundingClientRect.width || element.prop('offsetWidth'),\n height: boundingClientRect.height || element.prop('offsetHeight'),\n top: elBCR.top - offsetParentBCR.top,\n left: elBCR.left - offsetParentBCR.left\n };\n },\n\n /**\n * Provides read-only equivalent of jQuery's offset function:\n * http://api.jquery.com/offset/\n */\n offset: function(element) {\n var boundingClientRect = element[0].getBoundingClientRect();\n return {\n width: boundingClientRect.width || element.prop('offsetWidth'),\n height: boundingClientRect.height || element.prop('offsetHeight'),\n top: boundingClientRect.top + ($window.pageYOffset || $document[0].documentElement.scrollTop),\n left: boundingClientRect.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft)\n };\n },\n\n /**\n * Provides coordinates for the targetEl in relation to hostEl\n */\n positionElements: function(hostEl, targetEl, positionStr, appendToBody) {\n var positionStrParts = positionStr.split('-');\n var pos0 = positionStrParts[0], pos1 = positionStrParts[1] || 'center';\n\n var hostElPos,\n targetElWidth,\n targetElHeight,\n targetElPos;\n\n hostElPos = appendToBody ? this.offset(hostEl) : this.position(hostEl);\n\n targetElWidth = targetEl.prop('offsetWidth');\n targetElHeight = targetEl.prop('offsetHeight');\n\n var shiftWidth = {\n center: function() {\n return hostElPos.left + hostElPos.width / 2 - targetElWidth / 2;\n },\n left: function() {\n return hostElPos.left;\n },\n right: function() {\n return hostElPos.left + hostElPos.width;\n }\n };\n\n var shiftHeight = {\n center: function() {\n return hostElPos.top + hostElPos.height / 2 - targetElHeight / 2;\n },\n top: function() {\n return hostElPos.top;\n },\n bottom: function() {\n return hostElPos.top + hostElPos.height;\n }\n };\n\n switch (pos0) {\n case 'right':\n targetElPos = {\n top: shiftHeight[pos1](),\n left: shiftWidth[pos0]()\n };\n break;\n case 'left':\n targetElPos = {\n top: shiftHeight[pos1](),\n left: hostElPos.left - targetElWidth\n };\n break;\n case 'bottom':\n targetElPos = {\n top: shiftHeight[pos0](),\n left: shiftWidth[pos1]()\n };\n break;\n default:\n targetElPos = {\n top: hostElPos.top - targetElHeight,\n left: shiftWidth[pos1]()\n };\n break;\n }\n\n return targetElPos;\n }\n };\n }]);\n\nangular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.position'])\n\n.value('$datepickerSuppressError', false)\n\n.constant('datepickerConfig', {\n formatDay: 'dd',\n formatMonth: 'MMMM',\n formatYear: 'yyyy',\n formatDayHeader: 'EEE',\n formatDayTitle: 'MMMM yyyy',\n formatMonthTitle: 'yyyy',\n datepickerMode: 'day',\n minMode: 'day',\n maxMode: 'year',\n showWeeks: true,\n startingDay: 0,\n yearRange: 20,\n minDate: null,\n maxDate: null,\n shortcutPropagation: false\n})\n\n.controller('DatepickerController', ['$scope', '$attrs', '$parse', '$interpolate', '$log', 'dateFilter', 'datepickerConfig', '$datepickerSuppressError', function($scope, $attrs, $parse, $interpolate, $log, dateFilter, datepickerConfig, $datepickerSuppressError) {\n var self = this,\n ngModelCtrl = { $setViewValue: angular.noop }; // nullModelCtrl;\n\n // Modes chain\n this.modes = ['day', 'month', 'year'];\n\n // Configuration attributes\n angular.forEach(['formatDay', 'formatMonth', 'formatYear', 'formatDayHeader', 'formatDayTitle', 'formatMonthTitle',\n 'showWeeks', 'startingDay', 'yearRange', 'shortcutPropagation'], function(key, index) {\n self[key] = angular.isDefined($attrs[key]) ? (index < 6 ? $interpolate($attrs[key])($scope.$parent) : $scope.$parent.$eval($attrs[key])) : datepickerConfig[key];\n });\n\n // Watchable date attributes\n angular.forEach(['minDate', 'maxDate'], function(key) {\n if ($attrs[key]) {\n $scope.$parent.$watch($parse($attrs[key]), function(value) {\n self[key] = value ? new Date(value) : null;\n self.refreshView();\n });\n } else {\n self[key] = datepickerConfig[key] ? new Date(datepickerConfig[key]) : null;\n }\n });\n\n angular.forEach(['minMode', 'maxMode'], function(key) {\n if ($attrs[key]) {\n $scope.$parent.$watch($parse($attrs[key]), function(value) {\n self[key] = angular.isDefined(value) ? value : $attrs[key];\n $scope[key] = self[key];\n if ((key == 'minMode' && self.modes.indexOf($scope.datepickerMode) < self.modes.indexOf(self[key])) || (key == 'maxMode' && self.modes.indexOf($scope.datepickerMode) > self.modes.indexOf(self[key]))) {\n $scope.datepickerMode = self[key];\n }\n });\n } else {\n self[key] = datepickerConfig[key] || null;\n $scope[key] = self[key];\n }\n });\n\n $scope.datepickerMode = $scope.datepickerMode || datepickerConfig.datepickerMode;\n $scope.uniqueId = 'datepicker-' + $scope.$id + '-' + Math.floor(Math.random() * 10000);\n\n if (angular.isDefined($attrs.initDate)) {\n this.activeDate = $scope.$parent.$eval($attrs.initDate) || new Date();\n $scope.$parent.$watch($attrs.initDate, function(initDate) {\n if (initDate && (ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue) || ngModelCtrl.$invalid)) {\n self.activeDate = initDate;\n self.refreshView();\n }\n });\n } else {\n this.activeDate = new Date();\n }\n\n $scope.isActive = function(dateObject) {\n if (self.compare(dateObject.date, self.activeDate) === 0) {\n $scope.activeDateId = dateObject.uid;\n return true;\n }\n return false;\n };\n\n this.init = function(ngModelCtrl_) {\n ngModelCtrl = ngModelCtrl_;\n\n ngModelCtrl.$render = function() {\n self.render();\n };\n };\n\n this.render = function() {\n if (ngModelCtrl.$viewValue) {\n var date = new Date(ngModelCtrl.$viewValue),\n isValid = !isNaN(date);\n\n if (isValid) {\n this.activeDate = date;\n } else if (!$datepickerSuppressError) {\n $log.error('Datepicker directive: \"ng-model\" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.');\n }\n }\n this.refreshView();\n };\n\n this.refreshView = function() {\n if (this.element) {\n this._refreshView();\n\n var date = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;\n ngModelCtrl.$setValidity('dateDisabled', !date || (this.element && !this.isDisabled(date)));\n }\n };\n\n this.createDateObject = function(date, format) {\n var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;\n return {\n date: date,\n label: dateFilter(date, format),\n selected: model && this.compare(date, model) === 0,\n disabled: this.isDisabled(date),\n current: this.compare(date, new Date()) === 0,\n customClass: this.customClass(date)\n };\n };\n\n this.isDisabled = function(date) {\n return ((this.minDate && this.compare(date, this.minDate) < 0) || (this.maxDate && this.compare(date, this.maxDate) > 0) || ($attrs.dateDisabled && $scope.dateDisabled({date: date, mode: $scope.datepickerMode})));\n };\n\n this.customClass = function(date) {\n return $scope.customClass({date: date, mode: $scope.datepickerMode});\n };\n\n // Split array into smaller arrays\n this.split = function(arr, size) {\n var arrays = [];\n while (arr.length > 0) {\n arrays.push(arr.splice(0, size));\n }\n return arrays;\n };\n\n // Fix a hard-reprodusible bug with timezones\n // The bug depends on OS, browser, current timezone and current date\n // i.e.\n // var date = new Date(2014, 0, 1);\n // console.log(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours());\n // can result in \"2013 11 31 23\" because of the bug.\n this.fixTimeZone = function(date) {\n var hours = date.getHours();\n date.setHours(hours === 23 ? hours + 2 : 0);\n };\n\n $scope.select = function(date) {\n if ($scope.datepickerMode === self.minMode) {\n var dt = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : new Date(0, 0, 0, 0, 0, 0, 0);\n dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n ngModelCtrl.$setViewValue(dt);\n ngModelCtrl.$render();\n } else {\n self.activeDate = date;\n $scope.datepickerMode = self.modes[self.modes.indexOf($scope.datepickerMode) - 1];\n }\n };\n\n $scope.move = function(direction) {\n var year = self.activeDate.getFullYear() + direction * (self.step.years || 0),\n month = self.activeDate.getMonth() + direction * (self.step.months || 0);\n self.activeDate.setFullYear(year, month, 1);\n self.refreshView();\n };\n\n $scope.toggleMode = function(direction) {\n direction = direction || 1;\n\n if (($scope.datepickerMode === self.maxMode && direction === 1) || ($scope.datepickerMode === self.minMode && direction === -1)) {\n return;\n }\n\n $scope.datepickerMode = self.modes[self.modes.indexOf($scope.datepickerMode) + direction];\n };\n\n // Key event mapper\n $scope.keys = { 13: 'enter', 32: 'space', 33: 'pageup', 34: 'pagedown', 35: 'end', 36: 'home', 37: 'left', 38: 'up', 39: 'right', 40: 'down' };\n\n var focusElement = function() {\n self.element[0].focus();\n };\n\n // Listen for focus requests from popup directive\n $scope.$on('datepicker.focus', focusElement);\n\n $scope.keydown = function(evt) {\n var key = $scope.keys[evt.which];\n\n if (!key || evt.shiftKey || evt.altKey) {\n return;\n }\n\n evt.preventDefault();\n if (!self.shortcutPropagation) {\n evt.stopPropagation();\n }\n\n if (key === 'enter' || key === 'space') {\n if (self.isDisabled(self.activeDate)) {\n return; // do nothing\n }\n $scope.select(self.activeDate);\n focusElement();\n } else if (evt.ctrlKey && (key === 'up' || key === 'down')) {\n $scope.toggleMode(key === 'up' ? 1 : -1);\n focusElement();\n } else {\n self.handleKeyDown(key, evt);\n self.refreshView();\n }\n };\n}])\n\n.directive('datepicker', function() {\n return {\n restrict: 'EA',\n replace: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/datepicker/datepicker.html';\n },\n scope: {\n datepickerMode: '=?',\n dateDisabled: '&',\n customClass: '&',\n shortcutPropagation: '&?'\n },\n require: ['datepicker', '^ngModel'],\n controller: 'DatepickerController',\n controllerAs: 'datepicker',\n link: function(scope, element, attrs, ctrls) {\n var datepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n datepickerCtrl.init(ngModelCtrl);\n }\n };\n})\n\n.directive('daypicker', ['dateFilter', function(dateFilter) {\n return {\n restrict: 'EA',\n replace: true,\n templateUrl: 'template/datepicker/day.html',\n require: '^datepicker',\n link: function(scope, element, attrs, ctrl) {\n scope.showWeeks = ctrl.showWeeks;\n\n ctrl.step = { months: 1 };\n ctrl.element = element;\n\n var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n function getDaysInMonth(year, month) {\n return ((month === 1) && (year % 4 === 0) && ((year % 100 !== 0) || (year % 400 === 0))) ? 29 : DAYS_IN_MONTH[month];\n }\n\n function getDates(startDate, n) {\n var dates = new Array(n), current = new Date(startDate), i = 0, date;\n while (i < n) {\n date = new Date(current);\n ctrl.fixTimeZone(date);\n dates[i++] = date;\n current.setDate(current.getDate() + 1);\n }\n return dates;\n }\n\n ctrl._refreshView = function() {\n var year = ctrl.activeDate.getFullYear(),\n month = ctrl.activeDate.getMonth(),\n firstDayOfMonth = new Date(year, month, 1),\n difference = ctrl.startingDay - firstDayOfMonth.getDay(),\n numDisplayedFromPreviousMonth = (difference > 0) ? 7 - difference : - difference,\n firstDate = new Date(firstDayOfMonth);\n\n if (numDisplayedFromPreviousMonth > 0) {\n firstDate.setDate(-numDisplayedFromPreviousMonth + 1);\n }\n\n // 42 is the number of days on a six-month calendar\n var days = getDates(firstDate, 42);\n for (var i = 0; i < 42; i ++) {\n days[i] = angular.extend(ctrl.createDateObject(days[i], ctrl.formatDay), {\n secondary: days[i].getMonth() !== month,\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.labels = new Array(7);\n for (var j = 0; j < 7; j++) {\n scope.labels[j] = {\n abbr: dateFilter(days[j].date, ctrl.formatDayHeader),\n full: dateFilter(days[j].date, 'EEEE')\n };\n }\n\n scope.title = dateFilter(ctrl.activeDate, ctrl.formatDayTitle);\n scope.rows = ctrl.split(days, 7);\n\n if (scope.showWeeks) {\n scope.weekNumbers = [];\n var thursdayIndex = (4 + 7 - ctrl.startingDay) % 7,\n numWeeks = scope.rows.length;\n for (var curWeek = 0; curWeek < numWeeks; curWeek++) {\n scope.weekNumbers.push(\n getISO8601WeekNumber(scope.rows[curWeek][thursdayIndex].date));\n }\n }\n };\n\n ctrl.compare = function(date1, date2) {\n return (new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()));\n };\n\n function getISO8601WeekNumber(date) {\n var checkDate = new Date(date);\n checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // Thursday\n var time = checkDate.getTime();\n checkDate.setMonth(0); // Compare with Jan 1\n checkDate.setDate(1);\n return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;\n }\n\n ctrl.handleKeyDown = function(key, evt) {\n var date = ctrl.activeDate.getDate();\n\n if (key === 'left') {\n date = date - 1; // up\n } else if (key === 'up') {\n date = date - 7; // down\n } else if (key === 'right') {\n date = date + 1; // down\n } else if (key === 'down') {\n date = date + 7;\n } else if (key === 'pageup' || key === 'pagedown') {\n var month = ctrl.activeDate.getMonth() + (key === 'pageup' ? - 1 : 1);\n ctrl.activeDate.setMonth(month, 1);\n date = Math.min(getDaysInMonth(ctrl.activeDate.getFullYear(), ctrl.activeDate.getMonth()), date);\n } else if (key === 'home') {\n date = 1;\n } else if (key === 'end') {\n date = getDaysInMonth(ctrl.activeDate.getFullYear(), ctrl.activeDate.getMonth());\n }\n ctrl.activeDate.setDate(date);\n };\n\n ctrl.refreshView();\n }\n };\n}])\n\n.directive('monthpicker', ['dateFilter', function(dateFilter) {\n return {\n restrict: 'EA',\n replace: true,\n templateUrl: 'template/datepicker/month.html',\n require: '^datepicker',\n link: function(scope, element, attrs, ctrl) {\n ctrl.step = { years: 1 };\n ctrl.element = element;\n\n ctrl._refreshView = function() {\n var months = new Array(12),\n year = ctrl.activeDate.getFullYear(),\n date;\n\n for (var i = 0; i < 12; i++) {\n date = new Date(year, i, 1);\n ctrl.fixTimeZone(date);\n months[i] = angular.extend(ctrl.createDateObject(date, ctrl.formatMonth), {\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.title = dateFilter(ctrl.activeDate, ctrl.formatMonthTitle);\n scope.rows = ctrl.split(months, 3);\n };\n\n ctrl.compare = function(date1, date2) {\n return new Date(date1.getFullYear(), date1.getMonth()) - new Date(date2.getFullYear(), date2.getMonth());\n };\n\n ctrl.handleKeyDown = function(key, evt) {\n var date = ctrl.activeDate.getMonth();\n\n if (key === 'left') {\n date = date - 1; // up\n } else if (key === 'up') {\n date = date - 3; // down\n } else if (key === 'right') {\n date = date + 1; // down\n } else if (key === 'down') {\n date = date + 3;\n } else if (key === 'pageup' || key === 'pagedown') {\n var year = ctrl.activeDate.getFullYear() + (key === 'pageup' ? - 1 : 1);\n ctrl.activeDate.setFullYear(year);\n } else if (key === 'home') {\n date = 0;\n } else if (key === 'end') {\n date = 11;\n }\n ctrl.activeDate.setMonth(date);\n };\n\n ctrl.refreshView();\n }\n };\n}])\n\n.directive('yearpicker', ['dateFilter', function(dateFilter) {\n return {\n restrict: 'EA',\n replace: true,\n templateUrl: 'template/datepicker/year.html',\n require: '^datepicker',\n link: function(scope, element, attrs, ctrl) {\n var range = ctrl.yearRange;\n\n ctrl.step = { years: range };\n ctrl.element = element;\n\n function getStartingYear( year ) {\n return parseInt((year - 1) / range, 10) * range + 1;\n }\n\n ctrl._refreshView = function() {\n var years = new Array(range), date;\n\n for (var i = 0, start = getStartingYear(ctrl.activeDate.getFullYear()); i < range; i++) {\n date = new Date(start + i, 0, 1);\n ctrl.fixTimeZone(date);\n years[i] = angular.extend(ctrl.createDateObject(date, ctrl.formatYear), {\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.title = [years[0].label, years[range - 1].label].join(' - ');\n scope.rows = ctrl.split(years, 5);\n };\n\n ctrl.compare = function(date1, date2) {\n return date1.getFullYear() - date2.getFullYear();\n };\n\n ctrl.handleKeyDown = function(key, evt) {\n var date = ctrl.activeDate.getFullYear();\n\n if (key === 'left') {\n date = date - 1; // up\n } else if (key === 'up') {\n date = date - 5; // down\n } else if (key === 'right') {\n date = date + 1; // down\n } else if (key === 'down') {\n date = date + 5;\n } else if (key === 'pageup' || key === 'pagedown') {\n date += (key === 'pageup' ? - 1 : 1) * ctrl.step.years;\n } else if (key === 'home') {\n date = getStartingYear(ctrl.activeDate.getFullYear());\n } else if (key === 'end') {\n date = getStartingYear(ctrl.activeDate.getFullYear()) + range - 1;\n }\n ctrl.activeDate.setFullYear(date);\n };\n\n ctrl.refreshView();\n }\n };\n}])\n\n.constant('datepickerPopupConfig', {\n datepickerPopup: 'yyyy-MM-dd',\n datepickerPopupTemplateUrl: 'template/datepicker/popup.html',\n datepickerTemplateUrl: 'template/datepicker/datepicker.html',\n html5Types: {\n date: 'yyyy-MM-dd',\n 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',\n 'month': 'yyyy-MM'\n },\n currentText: 'Today',\n clearText: 'Clear',\n closeText: 'Done',\n closeOnDateSelection: true,\n appendToBody: false,\n showButtonBar: true,\n onOpenFocus: true\n})\n\n.directive('datepickerPopup', ['$compile', '$parse', '$document', '$rootScope', '$position', 'dateFilter', 'dateParser', 'datepickerPopupConfig', '$timeout',\nfunction($compile, $parse, $document, $rootScope, $position, dateFilter, dateParser, datepickerPopupConfig, $timeout) {\n return {\n restrict: 'EA',\n require: 'ngModel',\n scope: {\n isOpen: '=?',\n currentText: '@',\n clearText: '@',\n closeText: '@',\n dateDisabled: '&',\n customClass: '&'\n },\n link: function(scope, element, attrs, ngModel) {\n var dateFormat,\n closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? scope.$parent.$eval(attrs.closeOnDateSelection) : datepickerPopupConfig.closeOnDateSelection,\n appendToBody = angular.isDefined(attrs.datepickerAppendToBody) ? scope.$parent.$eval(attrs.datepickerAppendToBody) : datepickerPopupConfig.appendToBody,\n onOpenFocus = angular.isDefined(attrs.onOpenFocus) ? scope.$parent.$eval(attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus,\n datepickerPopupTemplateUrl = angular.isDefined(attrs.datepickerPopupTemplateUrl) ? attrs.datepickerPopupTemplateUrl : datepickerPopupConfig.datepickerPopupTemplateUrl,\n datepickerTemplateUrl = angular.isDefined(attrs.datepickerTemplateUrl) ? attrs.datepickerTemplateUrl : datepickerPopupConfig.datepickerTemplateUrl,\n cache = {};\n\n scope.showButtonBar = angular.isDefined(attrs.showButtonBar) ? scope.$parent.$eval(attrs.showButtonBar) : datepickerPopupConfig.showButtonBar;\n\n scope.getText = function(key) {\n return scope[key + 'Text'] || datepickerPopupConfig[key + 'Text'];\n };\n\n scope.isDisabled = function(date) {\n if (date === 'today') {\n date = new Date();\n }\n\n return ((scope.watchData.minDate && scope.compare(date, cache.minDate) < 0) ||\n (scope.watchData.maxDate && scope.compare(date, cache.maxDate) > 0));\n };\n\n scope.compare = function(date1, date2) {\n return (new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()));\n };\n\n var isHtml5DateInput = false;\n if (datepickerPopupConfig.html5Types[attrs.type]) {\n dateFormat = datepickerPopupConfig.html5Types[attrs.type];\n isHtml5DateInput = true;\n } else {\n dateFormat = attrs.datepickerPopup || datepickerPopupConfig.datepickerPopup;\n attrs.$observe('datepickerPopup', function(value, oldValue) {\n var newDateFormat = value || datepickerPopupConfig.datepickerPopup;\n // Invalidate the $modelValue to ensure that formatters re-run\n // FIXME: Refactor when PR is merged: https://github.com/angular/angular.js/pull/10764\n if (newDateFormat !== dateFormat) {\n dateFormat = newDateFormat;\n ngModel.$modelValue = null;\n\n if (!dateFormat) {\n throw new Error('datepickerPopup must have a date format specified.');\n }\n }\n });\n }\n\n if (!dateFormat) {\n throw new Error('datepickerPopup must have a date format specified.');\n }\n\n if (isHtml5DateInput && attrs.datepickerPopup) {\n throw new Error('HTML5 date input types do not support custom formats.');\n }\n\n // popup element used to display calendar\n var popupEl = angular.element('<div datepicker-popup-wrap><div datepicker></div></div>');\n popupEl.attr({\n 'ng-model': 'date',\n 'ng-change': 'dateSelection(date)',\n 'template-url': datepickerPopupTemplateUrl\n });\n\n function cameltoDash(string) {\n return string.replace(/([A-Z])/g, function($1) { return '-' + $1.toLowerCase(); });\n }\n\n // datepicker element\n var datepickerEl = angular.element(popupEl.children()[0]);\n datepickerEl.attr('template-url', datepickerTemplateUrl);\n\n if (isHtml5DateInput) {\n if (attrs.type === 'month') {\n datepickerEl.attr('datepicker-mode', '\"month\"');\n datepickerEl.attr('min-mode', 'month');\n }\n }\n\n if (attrs.datepickerOptions) {\n var options = scope.$parent.$eval(attrs.datepickerOptions);\n if (options && options.initDate) {\n scope.initDate = options.initDate;\n datepickerEl.attr('init-date', 'initDate');\n delete options.initDate;\n }\n angular.forEach(options, function(value, option) {\n datepickerEl.attr( cameltoDash(option), value );\n });\n }\n\n scope.watchData = {};\n angular.forEach(['minMode', 'maxMode', 'minDate', 'maxDate', 'datepickerMode', 'initDate', 'shortcutPropagation'], function(key) {\n if (attrs[key]) {\n var getAttribute = $parse(attrs[key]);\n scope.$parent.$watch(getAttribute, function(value) {\n scope.watchData[key] = value;\n if (key === 'minDate' || key === 'maxDate') {\n cache[key] = new Date(value);\n }\n });\n datepickerEl.attr(cameltoDash(key), 'watchData.' + key);\n\n // Propagate changes from datepicker to outside\n if (key === 'datepickerMode') {\n var setAttribute = getAttribute.assign;\n scope.$watch('watchData.' + key, function(value, oldvalue) {\n if (angular.isFunction(setAttribute) && value !== oldvalue) {\n setAttribute(scope.$parent, value);\n }\n });\n }\n }\n });\n if (attrs.dateDisabled) {\n datepickerEl.attr('date-disabled', 'dateDisabled({ date: date, mode: mode })');\n }\n\n if (attrs.showWeeks) {\n datepickerEl.attr('show-weeks', attrs.showWeeks);\n }\n\n if (attrs.customClass) {\n datepickerEl.attr('custom-class', 'customClass({ date: date, mode: mode })');\n }\n\n function parseDate(viewValue) {\n if (angular.isNumber(viewValue)) {\n // presumably timestamp to date object\n viewValue = new Date(viewValue);\n }\n\n if (!viewValue) {\n return null;\n } else if (angular.isDate(viewValue) && !isNaN(viewValue)) {\n return viewValue;\n } else if (angular.isString(viewValue)) {\n var date = dateParser.parse(viewValue, dateFormat, scope.date);\n if (isNaN(date)) {\n return undefined;\n } else {\n return date;\n }\n } else {\n return undefined;\n }\n }\n\n function validator(modelValue, viewValue) {\n var value = modelValue || viewValue;\n\n if (!attrs.ngRequired && !value) {\n return true;\n }\n\n if (angular.isNumber(value)) {\n value = new Date(value);\n }\n if (!value) {\n return true;\n } else if (angular.isDate(value) && !isNaN(value)) {\n return true;\n } else if (angular.isString(value)) {\n var date = dateParser.parse(value, dateFormat);\n return !isNaN(date);\n } else {\n return false;\n }\n }\n\n if (!isHtml5DateInput) {\n // Internal API to maintain the correct ng-invalid-[key] class\n ngModel.$$parserName = 'date';\n ngModel.$validators.date = validator;\n ngModel.$parsers.unshift(parseDate);\n ngModel.$formatters.push(function(value) {\n scope.date = value;\n return ngModel.$isEmpty(value) ? value : dateFilter(value, dateFormat);\n });\n } else {\n ngModel.$formatters.push(function(value) {\n scope.date = value;\n return value;\n });\n }\n\n // Inner change\n scope.dateSelection = function(dt) {\n if (angular.isDefined(dt)) {\n scope.date = dt;\n }\n var date = scope.date ? dateFilter(scope.date, dateFormat) : null; // Setting to NULL is necessary for form validators to function\n element.val(date);\n ngModel.$setViewValue(date);\n\n if (closeOnDateSelection) {\n scope.isOpen = false;\n element[0].focus();\n }\n };\n\n // Detect changes in the view from the text box\n ngModel.$viewChangeListeners.push(function() {\n scope.date = dateParser.parse(ngModel.$viewValue, dateFormat, scope.date);\n });\n\n var documentClickBind = function(event) {\n if (scope.isOpen && !(element[0].contains(event.target) || popupEl[0].contains(event.target))) {\n scope.$apply(function() {\n scope.isOpen = false;\n });\n }\n };\n\n var inputKeydownBind = function(evt) {\n if (evt.which === 27 && scope.isOpen) {\n evt.preventDefault();\n evt.stopPropagation();\n scope.$apply(function() {\n scope.isOpen = false;\n });\n element[0].focus();\n } else if (evt.which === 40 && !scope.isOpen) {\n evt.preventDefault();\n evt.stopPropagation();\n scope.$apply(function() {\n scope.isOpen = true;\n });\n }\n };\n element.bind('keydown', inputKeydownBind);\n\n scope.keydown = function(evt) {\n if (evt.which === 27) {\n scope.isOpen = false;\n element[0].focus();\n }\n };\n\n scope.$watch('isOpen', function(value) {\n if (value) {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top = scope.position.top + element.prop('offsetHeight');\n\n $timeout(function() {\n if (onOpenFocus) {\n scope.$broadcast('datepicker.focus');\n }\n $document.bind('click', documentClickBind);\n }, 0, false);\n } else {\n $document.unbind('click', documentClickBind);\n }\n });\n\n scope.select = function(date) {\n if (date === 'today') {\n var today = new Date();\n if (angular.isDate(scope.date)) {\n date = new Date(scope.date);\n date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());\n } else {\n date = new Date(today.setHours(0, 0, 0, 0));\n }\n }\n scope.dateSelection(date);\n };\n\n scope.close = function() {\n scope.isOpen = false;\n element[0].focus();\n };\n\n var $popup = $compile(popupEl)(scope);\n // Prevent jQuery cache memory leak (template is now redundant after linking)\n popupEl.remove();\n\n if (appendToBody) {\n $document.find('body').append($popup);\n } else {\n element.after($popup);\n }\n\n scope.$on('$destroy', function() {\n if (scope.isOpen === true) {\n if (!$rootScope.$$phase) {\n scope.$apply(function() {\n scope.isOpen = false;\n });\n }\n }\n\n $popup.remove();\n element.unbind('keydown', inputKeydownBind);\n $document.unbind('click', documentClickBind);\n });\n }\n };\n}])\n\n.directive('datepickerPopupWrap', function() {\n return {\n restrict:'EA',\n replace: true,\n transclude: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/datepicker/popup.html';\n }\n };\n});\n\nangular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])\n\n.constant('dropdownConfig', {\n openClass: 'open'\n})\n\n.service('dropdownService', ['$document', '$rootScope', function($document, $rootScope) {\n var openScope = null;\n\n this.open = function(dropdownScope) {\n if (!openScope) {\n $document.bind('click', closeDropdown);\n $document.bind('keydown', keybindFilter);\n }\n\n if (openScope && openScope !== dropdownScope) {\n openScope.isOpen = false;\n }\n\n openScope = dropdownScope;\n };\n\n this.close = function(dropdownScope) {\n if (openScope === dropdownScope) {\n openScope = null;\n $document.unbind('click', closeDropdown);\n $document.unbind('keydown', keybindFilter);\n }\n };\n\n var closeDropdown = function(evt) {\n // This method may still be called during the same mouse event that\n // unbound this event handler. So check openScope before proceeding.\n if (!openScope) { return; }\n\n if (evt && openScope.getAutoClose() === 'disabled') { return ; }\n\n var toggleElement = openScope.getToggleElement();\n if (evt && toggleElement && toggleElement[0].contains(evt.target)) {\n return;\n }\n\n var dropdownElement = openScope.getDropdownElement();\n if (evt && openScope.getAutoClose() === 'outsideClick' &&\n dropdownElement && dropdownElement[0].contains(evt.target)) {\n return;\n }\n\n openScope.isOpen = false;\n\n if (!$rootScope.$$phase) {\n openScope.$apply();\n }\n };\n\n var keybindFilter = function(evt) {\n if (evt.which === 27) {\n openScope.focusToggleElement();\n closeDropdown();\n } else if (openScope.isKeynavEnabled() && /(38|40)/.test(evt.which) && openScope.isOpen) {\n evt.preventDefault();\n evt.stopPropagation();\n openScope.focusDropdownEntry(evt.which);\n }\n };\n}])\n\n.controller('DropdownController', ['$scope', '$attrs', '$parse', 'dropdownConfig', 'dropdownService', '$animate', '$position', '$document', '$compile', '$templateRequest', function($scope, $attrs, $parse, dropdownConfig, dropdownService, $animate, $position, $document, $compile, $templateRequest) {\n var self = this,\n scope = $scope.$new(), // create a child scope so we are not polluting original one\n templateScope,\n openClass = dropdownConfig.openClass,\n getIsOpen,\n setIsOpen = angular.noop,\n toggleInvoker = $attrs.onToggle ? $parse($attrs.onToggle) : angular.noop,\n appendToBody = false,\n keynavEnabled = false,\n selectedOption = null,\n body = $document.find('body');\n\n this.init = function(element) {\n self.$element = element;\n\n if ($attrs.isOpen) {\n getIsOpen = $parse($attrs.isOpen);\n setIsOpen = getIsOpen.assign;\n\n $scope.$watch(getIsOpen, function(value) {\n scope.isOpen = !!value;\n });\n }\n\n appendToBody = angular.isDefined($attrs.dropdownAppendToBody);\n keynavEnabled = angular.isDefined($attrs.keyboardNav);\n\n if (appendToBody && self.dropdownMenu) {\n body.append(self.dropdownMenu);\n body.addClass('dropdown');\n element.on('$destroy', function handleDestroyEvent() {\n self.dropdownMenu.remove();\n });\n }\n };\n\n this.toggle = function(open) {\n return scope.isOpen = arguments.length ? !!open : !scope.isOpen;\n };\n\n // Allow other directives to watch status\n this.isOpen = function() {\n return scope.isOpen;\n };\n\n scope.getToggleElement = function() {\n return self.toggleElement;\n };\n\n scope.getAutoClose = function() {\n return $attrs.autoClose || 'always'; //or 'outsideClick' or 'disabled'\n };\n\n scope.getElement = function() {\n return self.$element;\n };\n\n scope.isKeynavEnabled = function() {\n return keynavEnabled;\n };\n\n scope.focusDropdownEntry = function(keyCode) {\n var elems = self.dropdownMenu ? //If append to body is used.\n (angular.element(self.dropdownMenu).find('a')) :\n (angular.element(self.$element).find('ul').eq(0).find('a'));\n\n switch (keyCode) {\n case (40): {\n if (!angular.isNumber(self.selectedOption)) {\n self.selectedOption = 0;\n } else {\n self.selectedOption = (self.selectedOption === elems.length -1 ?\n self.selectedOption :\n self.selectedOption + 1);\n }\n break;\n }\n case (38): {\n if (!angular.isNumber(self.selectedOption)) {\n self.selectedOption = elems.length - 1;\n } else {\n self.selectedOption = self.selectedOption === 0 ?\n 0 : self.selectedOption - 1;\n }\n break;\n }\n }\n elems[self.selectedOption].focus();\n };\n\n scope.getDropdownElement = function() {\n return self.dropdownMenu;\n };\n\n scope.focusToggleElement = function() {\n if (self.toggleElement) {\n self.toggleElement[0].focus();\n }\n };\n\n scope.$watch('isOpen', function(isOpen, wasOpen) {\n if (appendToBody && self.dropdownMenu) {\n var pos = $position.positionElements(self.$element, self.dropdownMenu, 'bottom-left', true);\n var css = {\n top: pos.top + 'px',\n display: isOpen ? 'block' : 'none'\n };\n\n var rightalign = self.dropdownMenu.hasClass('dropdown-menu-right');\n if (!rightalign) {\n css.left = pos.left + 'px';\n css.right = 'auto';\n } else {\n css.left = 'auto';\n css.right = (window.innerWidth - (pos.left + self.$element.prop('offsetWidth'))) + 'px';\n }\n\n self.dropdownMenu.css(css);\n }\n\n var openContainer = appendToBody ? body : self.$element;\n\n $animate[isOpen ? 'addClass' : 'removeClass'](openContainer, openClass).then(function() {\n if (angular.isDefined(isOpen) && isOpen !== wasOpen) {\n toggleInvoker($scope, { open: !!isOpen });\n }\n });\n\n if (isOpen) {\n if (self.dropdownMenuTemplateUrl) {\n $templateRequest(self.dropdownMenuTemplateUrl).then(function(tplContent) {\n templateScope = scope.$new();\n $compile(tplContent.trim())(templateScope, function(dropdownElement) {\n var newEl = dropdownElement;\n self.dropdownMenu.replaceWith(newEl);\n self.dropdownMenu = newEl;\n });\n });\n }\n\n scope.focusToggleElement();\n dropdownService.open(scope);\n } else {\n if (self.dropdownMenuTemplateUrl) {\n if (templateScope) {\n templateScope.$destroy();\n }\n var newEl = angular.element('<ul class=\"dropdown-menu\"></ul>');\n self.dropdownMenu.replaceWith(newEl);\n self.dropdownMenu = newEl;\n }\n\n dropdownService.close(scope);\n self.selectedOption = null;\n }\n\n if (angular.isFunction(setIsOpen)) {\n setIsOpen($scope, isOpen);\n }\n });\n\n $scope.$on('$locationChangeSuccess', function() {\n if (scope.getAutoClose() !== 'disabled') {\n scope.isOpen = false;\n }\n });\n\n var offDestroy = $scope.$on('$destroy', function() {\n scope.$destroy();\n });\n scope.$on('$destroy', offDestroy);\n}])\n\n.directive('dropdown', function() {\n return {\n controller: 'DropdownController',\n link: function(scope, element, attrs, dropdownCtrl) {\n dropdownCtrl.init( element );\n element.addClass('dropdown');\n }\n };\n})\n\n.directive('dropdownMenu', function() {\n return {\n restrict: 'AC',\n require: '?^dropdown',\n link: function(scope, element, attrs, dropdownCtrl) {\n if (!dropdownCtrl) {\n return;\n }\n var tplUrl = attrs.templateUrl;\n if (tplUrl) {\n dropdownCtrl.dropdownMenuTemplateUrl = tplUrl;\n }\n if (!dropdownCtrl.dropdownMenu) {\n dropdownCtrl.dropdownMenu = element;\n }\n }\n };\n})\n\n.directive('keyboardNav', function() {\n return {\n restrict: 'A',\n require: '?^dropdown',\n link: function (scope, element, attrs, dropdownCtrl) {\n\n element.bind('keydown', function(e) {\n if ([38, 40].indexOf(e.which) !== -1) {\n e.preventDefault();\n e.stopPropagation();\n\n var elems = dropdownCtrl.dropdownMenu.find('a');\n\n switch (e.which) {\n case (40): { // Down\n if (!angular.isNumber(dropdownCtrl.selectedOption)) {\n dropdownCtrl.selectedOption = 0;\n } else {\n dropdownCtrl.selectedOption = dropdownCtrl.selectedOption === elems.length -1 ?\n dropdownCtrl.selectedOption : dropdownCtrl.selectedOption + 1;\n }\n break;\n }\n case (38): { // Up\n if (!angular.isNumber(dropdownCtrl.selectedOption)) {\n dropdownCtrl.selectedOption = elems.length - 1;\n } else {\n dropdownCtrl.selectedOption = dropdownCtrl.selectedOption === 0 ?\n 0 : dropdownCtrl.selectedOption - 1;\n }\n break;\n }\n }\n elems[dropdownCtrl.selectedOption].focus();\n }\n });\n }\n };\n})\n\n.directive('dropdownToggle', function() {\n return {\n require: '?^dropdown',\n link: function(scope, element, attrs, dropdownCtrl) {\n if (!dropdownCtrl) {\n return;\n }\n\n element.addClass('dropdown-toggle');\n\n dropdownCtrl.toggleElement = element;\n\n var toggleDropdown = function(event) {\n event.preventDefault();\n\n if (!element.hasClass('disabled') && !attrs.disabled) {\n scope.$apply(function() {\n dropdownCtrl.toggle();\n });\n }\n };\n\n element.bind('click', toggleDropdown);\n\n // WAI-ARIA\n element.attr({ 'aria-haspopup': true, 'aria-expanded': false });\n scope.$watch(dropdownCtrl.isOpen, function( isOpen ) {\n element.attr('aria-expanded', !!isOpen);\n });\n\n scope.$on('$destroy', function() {\n element.unbind('click', toggleDropdown);\n });\n }\n };\n});\n\nangular.module('ui.bootstrap.modal', [])\n\n/**\n * A helper, internal data structure that acts as a map but also allows getting / removing\n * elements in the LIFO order\n */\n .factory('$$stackedMap', function() {\n return {\n createNew: function() {\n var stack = [];\n\n return {\n add: function(key, value) {\n stack.push({\n key: key,\n value: value\n });\n },\n get: function(key) {\n for (var i = 0; i < stack.length; i++) {\n if (key == stack[i].key) {\n return stack[i];\n }\n }\n },\n keys: function() {\n var keys = [];\n for (var i = 0; i < stack.length; i++) {\n keys.push(stack[i].key);\n }\n return keys;\n },\n top: function() {\n return stack[stack.length - 1];\n },\n remove: function(key) {\n var idx = -1;\n for (var i = 0; i < stack.length; i++) {\n if (key == stack[i].key) {\n idx = i;\n break;\n }\n }\n return stack.splice(idx, 1)[0];\n },\n removeTop: function() {\n return stack.splice(stack.length - 1, 1)[0];\n },\n length: function() {\n return stack.length;\n }\n };\n }\n };\n })\n\n/**\n * A helper, internal data structure that stores all references attached to key\n */\n .factory('$$multiMap', function() {\n return {\n createNew: function() {\n var map = {};\n\n return {\n entries: function() {\n return Object.keys(map).map(function(key) {\n return {\n key: key,\n value: map[key]\n };\n });\n },\n get: function(key) {\n return map[key];\n },\n hasKey: function(key) {\n return !!map[key];\n },\n keys: function() {\n return Object.keys(map);\n },\n put: function(key, value) {\n if (!map[key]) {\n map[key] = [];\n }\n\n map[key].push(value);\n },\n remove: function(key, value) {\n var values = map[key];\n\n if (!values) {\n return;\n }\n\n var idx = values.indexOf(value);\n\n if (idx !== -1) {\n values.splice(idx, 1);\n }\n\n if (!values.length) {\n delete map[key];\n }\n }\n };\n }\n };\n })\n\n/**\n * A helper directive for the $modal service. It creates a backdrop element.\n */\n .directive('modalBackdrop', [\n '$animate', '$injector', '$modalStack',\n function($animate , $injector, $modalStack) {\n var $animateCss = null;\n\n if ($injector.has('$animateCss')) {\n $animateCss = $injector.get('$animateCss');\n }\n\n return {\n restrict: 'EA',\n replace: true,\n templateUrl: 'template/modal/backdrop.html',\n compile: function(tElement, tAttrs) {\n tElement.addClass(tAttrs.backdropClass);\n return linkFn;\n }\n };\n\n function linkFn(scope, element, attrs) {\n if (attrs.modalInClass) {\n if ($animateCss) {\n $animateCss(element, {\n addClass: attrs.modalInClass\n }).start();\n } else {\n $animate.addClass(element, attrs.modalInClass);\n }\n\n scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {\n var done = setIsAsync();\n if ($animateCss) {\n $animateCss(element, {\n removeClass: attrs.modalInClass\n }).start().then(done);\n } else {\n $animate.removeClass(element, attrs.modalInClass).then(done);\n }\n });\n }\n }\n }])\n\n .directive('modalWindow', [\n '$modalStack', '$q', '$animate', '$injector',\n function($modalStack , $q , $animate, $injector) {\n var $animateCss = null;\n\n if ($injector.has('$animateCss')) {\n $animateCss = $injector.get('$animateCss');\n }\n\n return {\n restrict: 'EA',\n scope: {\n index: '@'\n },\n replace: true,\n transclude: true,\n templateUrl: function(tElement, tAttrs) {\n return tAttrs.templateUrl || 'template/modal/window.html';\n },\n link: function(scope, element, attrs) {\n element.addClass(attrs.windowClass || '');\n scope.size = attrs.size;\n\n scope.close = function(evt) {\n var modal = $modalStack.getTop();\n if (modal && modal.value.backdrop && modal.value.backdrop !== 'static' && (evt.target === evt.currentTarget)) {\n evt.preventDefault();\n evt.stopPropagation();\n $modalStack.dismiss(modal.key, 'backdrop click');\n }\n };\n\n // This property is only added to the scope for the purpose of detecting when this directive is rendered.\n // We can detect that by using this property in the template associated with this directive and then use\n // {@link Attribute#$observe} on it. For more details please see {@link TableColumnResize}.\n scope.$isRendered = true;\n\n // Deferred object that will be resolved when this modal is render.\n var modalRenderDeferObj = $q.defer();\n // Observe function will be called on next digest cycle after compilation, ensuring that the DOM is ready.\n // In order to use this way of finding whether DOM is ready, we need to observe a scope property used in modal's template.\n attrs.$observe('modalRender', function(value) {\n if (value == 'true') {\n modalRenderDeferObj.resolve();\n }\n });\n\n modalRenderDeferObj.promise.then(function() {\n var animationPromise = null;\n\n if (attrs.modalInClass) {\n if ($animateCss) {\n animationPromise = $animateCss(element, {\n addClass: attrs.modalInClass\n }).start();\n } else {\n animationPromise = $animate.addClass(element, attrs.modalInClass);\n }\n\n scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {\n var done = setIsAsync();\n if ($animateCss) {\n $animateCss(element, {\n removeClass: attrs.modalInClass\n }).start().then(done);\n } else {\n $animate.removeClass(element, attrs.modalInClass).then(done);\n }\n });\n }\n\n\n $q.when(animationPromise).then(function() {\n var inputsWithAutofocus = element[0].querySelectorAll('[autofocus]');\n /**\n * Auto-focusing of a freshly-opened modal element causes any child elements\n * with the autofocus attribute to lose focus. This is an issue on touch\n * based devices which will show and then hide the onscreen keyboard.\n * Attempts to refocus the autofocus element via JavaScript will not reopen\n * the onscreen keyboard. Fixed by updated the focusing logic to only autofocus\n * the modal element if the modal does not contain an autofocus element.\n */\n if (inputsWithAutofocus.length) {\n inputsWithAutofocus[0].focus();\n } else {\n element[0].focus();\n }\n });\n\n // Notify {@link $modalStack} that modal is rendered.\n var modal = $modalStack.getTop();\n if (modal) {\n $modalStack.modalRendered(modal.key);\n }\n });\n }\n };\n }])\n\n .directive('modalAnimationClass', [\n function () {\n return {\n compile: function(tElement, tAttrs) {\n if (tAttrs.modalAnimation) {\n tElement.addClass(tAttrs.modalAnimationClass);\n }\n }\n };\n }])\n\n .directive('modalTransclude', function() {\n return {\n link: function($scope, $element, $attrs, controller, $transclude) {\n $transclude($scope.$parent, function(clone) {\n $element.empty();\n $element.append(clone);\n });\n }\n };\n })\n\n .factory('$modalStack', [\n '$animate', '$timeout', '$document', '$compile', '$rootScope',\n '$q',\n '$injector',\n '$$multiMap',\n '$$stackedMap',\n function($animate , $timeout , $document , $compile , $rootScope ,\n $q,\n $injector,\n $$multiMap,\n $$stackedMap) {\n var $animateCss = null;\n\n if ($injector.has('$animateCss')) {\n $animateCss = $injector.get('$animateCss');\n }\n\n var OPENED_MODAL_CLASS = 'modal-open';\n\n var backdropDomEl, backdropScope;\n var openedWindows = $$stackedMap.createNew();\n var openedClasses = $$multiMap.createNew();\n var $modalStack = {\n NOW_CLOSING_EVENT: 'modal.stack.now-closing'\n };\n\n //Modal focus behavior\n var focusableElementList;\n var focusIndex = 0;\n var tababbleSelector = 'a[href], area[href], input:not([disabled]), ' +\n 'button:not([disabled]),select:not([disabled]), textarea:not([disabled]), ' +\n 'iframe, object, embed, *[tabindex], *[contenteditable=true]';\n\n function backdropIndex() {\n var topBackdropIndex = -1;\n var opened = openedWindows.keys();\n for (var i = 0; i < opened.length; i++) {\n if (openedWindows.get(opened[i]).value.backdrop) {\n topBackdropIndex = i;\n }\n }\n return topBackdropIndex;\n }\n\n $rootScope.$watch(backdropIndex, function(newBackdropIndex) {\n if (backdropScope) {\n backdropScope.index = newBackdropIndex;\n }\n });\n\n function removeModalWindow(modalInstance, elementToReceiveFocus) {\n var body = $document.find('body').eq(0);\n var modalWindow = openedWindows.get(modalInstance).value;\n\n //clean up the stack\n openedWindows.remove(modalInstance);\n\n removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, function() {\n var modalBodyClass = modalWindow.openedClass || OPENED_MODAL_CLASS;\n openedClasses.remove(modalBodyClass, modalInstance);\n body.toggleClass(modalBodyClass, openedClasses.hasKey(modalBodyClass));\n });\n checkRemoveBackdrop();\n\n //move focus to specified element if available, or else to body\n if (elementToReceiveFocus && elementToReceiveFocus.focus) {\n elementToReceiveFocus.focus();\n } else {\n body.focus();\n }\n }\n\n function checkRemoveBackdrop() {\n //remove backdrop if no longer needed\n if (backdropDomEl && backdropIndex() == -1) {\n var backdropScopeRef = backdropScope;\n removeAfterAnimate(backdropDomEl, backdropScope, function() {\n backdropScopeRef = null;\n });\n backdropDomEl = undefined;\n backdropScope = undefined;\n }\n }\n\n function removeAfterAnimate(domEl, scope, done) {\n var asyncDeferred;\n var asyncPromise = null;\n var setIsAsync = function() {\n if (!asyncDeferred) {\n asyncDeferred = $q.defer();\n asyncPromise = asyncDeferred.promise;\n }\n\n return function asyncDone() {\n asyncDeferred.resolve();\n };\n };\n scope.$broadcast($modalStack.NOW_CLOSING_EVENT, setIsAsync);\n\n // Note that it's intentional that asyncPromise might be null.\n // That's when setIsAsync has not been called during the\n // NOW_CLOSING_EVENT broadcast.\n return $q.when(asyncPromise).then(afterAnimating);\n\n function afterAnimating() {\n if (afterAnimating.done) {\n return;\n }\n afterAnimating.done = true;\n\n if ($animateCss) {\n $animateCss(domEl, {\n event: 'leave'\n }).start().then(function() {\n domEl.remove();\n });\n } else {\n $animate.leave(domEl);\n }\n scope.$destroy();\n if (done) {\n done();\n }\n }\n }\n\n $document.bind('keydown', function(evt) {\n if (evt.isDefaultPrevented()) {\n return evt;\n }\n\n var modal = openedWindows.top();\n if (modal && modal.value.keyboard) {\n switch (evt.which){\n case 27: {\n evt.preventDefault();\n $rootScope.$apply(function() {\n $modalStack.dismiss(modal.key, 'escape key press');\n });\n break;\n }\n case 9: {\n $modalStack.loadFocusElementList(modal);\n var focusChanged = false;\n if (evt.shiftKey) {\n if ($modalStack.isFocusInFirstItem(evt)) {\n focusChanged = $modalStack.focusLastFocusableElement();\n }\n } else {\n if ($modalStack.isFocusInLastItem(evt)) {\n focusChanged = $modalStack.focusFirstFocusableElement();\n }\n }\n\n if (focusChanged) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n break;\n }\n }\n }\n });\n\n $modalStack.open = function(modalInstance, modal) {\n var modalOpener = $document[0].activeElement,\n modalBodyClass = modal.openedClass || OPENED_MODAL_CLASS;\n\n openedWindows.add(modalInstance, {\n deferred: modal.deferred,\n renderDeferred: modal.renderDeferred,\n modalScope: modal.scope,\n backdrop: modal.backdrop,\n keyboard: modal.keyboard,\n openedClass: modal.openedClass\n });\n\n openedClasses.put(modalBodyClass, modalInstance);\n\n var body = $document.find('body').eq(0),\n currBackdropIndex = backdropIndex();\n\n if (currBackdropIndex >= 0 && !backdropDomEl) {\n backdropScope = $rootScope.$new(true);\n backdropScope.index = currBackdropIndex;\n var angularBackgroundDomEl = angular.element('<div modal-backdrop=\"modal-backdrop\"></div>');\n angularBackgroundDomEl.attr('backdrop-class', modal.backdropClass);\n if (modal.animation) {\n angularBackgroundDomEl.attr('modal-animation', 'true');\n }\n backdropDomEl = $compile(angularBackgroundDomEl)(backdropScope);\n body.append(backdropDomEl);\n }\n\n var angularDomEl = angular.element('<div modal-window=\"modal-window\"></div>');\n angularDomEl.attr({\n 'template-url': modal.windowTemplateUrl,\n 'window-class': modal.windowClass,\n 'size': modal.size,\n 'index': openedWindows.length() - 1,\n 'animate': 'animate'\n }).html(modal.content);\n if (modal.animation) {\n angularDomEl.attr('modal-animation', 'true');\n }\n\n var modalDomEl = $compile(angularDomEl)(modal.scope);\n openedWindows.top().value.modalDomEl = modalDomEl;\n openedWindows.top().value.modalOpener = modalOpener;\n body.append(modalDomEl);\n body.addClass(modalBodyClass);\n\n $modalStack.clearFocusListCache();\n };\n\n function broadcastClosing(modalWindow, resultOrReason, closing) {\n return !modalWindow.value.modalScope.$broadcast('modal.closing', resultOrReason, closing).defaultPrevented;\n }\n\n $modalStack.close = function(modalInstance, result) {\n var modalWindow = openedWindows.get(modalInstance);\n if (modalWindow && broadcastClosing(modalWindow, result, true)) {\n modalWindow.value.modalScope.$$uibDestructionScheduled = true;\n modalWindow.value.deferred.resolve(result);\n removeModalWindow(modalInstance, modalWindow.value.modalOpener);\n return true;\n }\n return !modalWindow;\n };\n\n $modalStack.dismiss = function(modalInstance, reason) {\n var modalWindow = openedWindows.get(modalInstance);\n if (modalWindow && broadcastClosing(modalWindow, reason, false)) {\n modalWindow.value.modalScope.$$uibDestructionScheduled = true;\n modalWindow.value.deferred.reject(reason);\n removeModalWindow(modalInstance, modalWindow.value.modalOpener);\n return true;\n }\n return !modalWindow;\n };\n\n $modalStack.dismissAll = function(reason) {\n var topModal = this.getTop();\n while (topModal && this.dismiss(topModal.key, reason)) {\n topModal = this.getTop();\n }\n };\n\n $modalStack.getTop = function() {\n return openedWindows.top();\n };\n\n $modalStack.modalRendered = function(modalInstance) {\n var modalWindow = openedWindows.get(modalInstance);\n if (modalWindow) {\n modalWindow.value.renderDeferred.resolve();\n }\n };\n\n $modalStack.focusFirstFocusableElement = function() {\n if (focusableElementList.length > 0) {\n focusableElementList[0].focus();\n return true;\n }\n return false;\n };\n $modalStack.focusLastFocusableElement = function() {\n if (focusableElementList.length > 0) {\n focusableElementList[focusableElementList.length - 1].focus();\n return true;\n }\n return false;\n };\n\n $modalStack.isFocusInFirstItem = function(evt) {\n if (focusableElementList.length > 0) {\n return (evt.target || evt.srcElement) == focusableElementList[0];\n }\n return false;\n };\n\n $modalStack.isFocusInLastItem = function(evt) {\n if (focusableElementList.length > 0) {\n return (evt.target || evt.srcElement) == focusableElementList[focusableElementList.length - 1];\n }\n return false;\n };\n\n $modalStack.clearFocusListCache = function() {\n focusableElementList = [];\n focusIndex = 0;\n };\n\n $modalStack.loadFocusElementList = function(modalWindow) {\n if (focusableElementList === undefined || !focusableElementList.length0) {\n if (modalWindow) {\n var modalDomE1 = modalWindow.value.modalDomEl;\n if (modalDomE1 && modalDomE1.length) {\n focusableElementList = modalDomE1[0].querySelectorAll(tababbleSelector);\n }\n }\n }\n };\n\n return $modalStack;\n }])\n\n .provider('$modal', function() {\n var $modalProvider = {\n options: {\n animation: true,\n backdrop: true, //can also be false or 'static'\n keyboard: true\n },\n $get: ['$injector', '$rootScope', '$q', '$templateRequest', '$controller', '$modalStack',\n function ($injector, $rootScope, $q, $templateRequest, $controller, $modalStack) {\n var $modal = {};\n\n function getTemplatePromise(options) {\n return options.template ? $q.when(options.template) :\n $templateRequest(angular.isFunction(options.templateUrl) ? (options.templateUrl)() : options.templateUrl);\n }\n\n function getResolvePromises(resolves) {\n var promisesArr = [];\n angular.forEach(resolves, function(value) {\n if (angular.isFunction(value) || angular.isArray(value)) {\n promisesArr.push($q.when($injector.invoke(value)));\n } else if (angular.isString(value)) {\n promisesArr.push($q.when($injector.get(value)));\n } else {\n promisesArr.push($q.when(value));\n }\n });\n return promisesArr;\n }\n\n var promiseChain = null;\n $modal.getPromiseChain = function() {\n return promiseChain;\n };\n\n $modal.open = function (modalOptions) {\n\n var modalResultDeferred = $q.defer();\n var modalOpenedDeferred = $q.defer();\n var modalRenderDeferred = $q.defer();\n\n //prepare an instance of a modal to be injected into controllers and returned to a caller\n var modalInstance = {\n result: modalResultDeferred.promise,\n opened: modalOpenedDeferred.promise,\n rendered: modalRenderDeferred.promise,\n close: function (result) {\n return $modalStack.close(modalInstance, result);\n },\n dismiss: function (reason) {\n return $modalStack.dismiss(modalInstance, reason);\n }\n };\n\n //merge and clean up options\n modalOptions = angular.extend({}, $modalProvider.options, modalOptions);\n modalOptions.resolve = modalOptions.resolve || {};\n\n //verify options\n if (!modalOptions.template && !modalOptions.templateUrl) {\n throw new Error('One of template or templateUrl options is required.');\n }\n\n var templateAndResolvePromise =\n $q.all([getTemplatePromise(modalOptions)].concat(getResolvePromises(modalOptions.resolve)));\n\n // Wait for the resolution of the existing promise chain.\n // Then switch to our own combined promise dependency (regardless of how the previous modal fared).\n // Then add to $modalStack and resolve opened.\n // Finally clean up the chain variable if no subsequent modal has overwritten it.\n var samePromise;\n samePromise = promiseChain = $q.all([promiseChain])\n .then(function() { return templateAndResolvePromise; }, function() { return templateAndResolvePromise; })\n .then(function resolveSuccess(tplAndVars) {\n\n var modalScope = (modalOptions.scope || $rootScope).$new();\n modalScope.$close = modalInstance.close;\n modalScope.$dismiss = modalInstance.dismiss;\n\n modalScope.$on('$destroy', function() {\n if (!modalScope.$$uibDestructionScheduled) {\n modalScope.$dismiss('$uibUnscheduledDestruction');\n }\n });\n\n var ctrlInstance, ctrlLocals = {};\n var resolveIter = 1;\n\n //controllers\n if (modalOptions.controller) {\n ctrlLocals.$scope = modalScope;\n ctrlLocals.$modalInstance = modalInstance;\n angular.forEach(modalOptions.resolve, function(value, key) {\n ctrlLocals[key] = tplAndVars[resolveIter++];\n });\n\n ctrlInstance = $controller(modalOptions.controller, ctrlLocals);\n if (modalOptions.controllerAs) {\n if (modalOptions.bindToController) {\n angular.extend(ctrlInstance, modalScope);\n }\n\n modalScope[modalOptions.controllerAs] = ctrlInstance;\n }\n }\n\n $modalStack.open(modalInstance, {\n scope: modalScope,\n deferred: modalResultDeferred,\n renderDeferred: modalRenderDeferred,\n content: tplAndVars[0],\n animation: modalOptions.animation,\n backdrop: modalOptions.backdrop,\n keyboard: modalOptions.keyboard,\n backdropClass: modalOptions.backdropClass,\n windowClass: modalOptions.windowClass,\n windowTemplateUrl: modalOptions.windowTemplateUrl,\n size: modalOptions.size,\n openedClass: modalOptions.openedClass\n });\n modalOpenedDeferred.resolve(true);\n\n }, function resolveError(reason) {\n modalOpenedDeferred.reject(reason);\n modalResultDeferred.reject(reason);\n })\n .finally(function() {\n if (promiseChain === samePromise) {\n promiseChain = null;\n }\n });\n\n return modalInstance;\n };\n\n return $modal;\n }]\n };\n\n return $modalProvider;\n });\n\nangular.module('ui.bootstrap.pagination', [])\n.controller('PaginationController', ['$scope', '$attrs', '$parse', function($scope, $attrs, $parse) {\n var self = this,\n ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl\n setNumPages = $attrs.numPages ? $parse($attrs.numPages).assign : angular.noop;\n\n this.init = function(ngModelCtrl_, config) {\n ngModelCtrl = ngModelCtrl_;\n this.config = config;\n\n ngModelCtrl.$render = function() {\n self.render();\n };\n\n if ($attrs.itemsPerPage) {\n $scope.$parent.$watch($parse($attrs.itemsPerPage), function(value) {\n self.itemsPerPage = parseInt(value, 10);\n $scope.totalPages = self.calculateTotalPages();\n });\n } else {\n this.itemsPerPage = config.itemsPerPage;\n }\n\n $scope.$watch('totalItems', function() {\n $scope.totalPages = self.calculateTotalPages();\n });\n\n $scope.$watch('totalPages', function(value) {\n setNumPages($scope.$parent, value); // Readonly variable\n\n if ( $scope.page > value ) {\n $scope.selectPage(value);\n } else {\n ngModelCtrl.$render();\n }\n });\n };\n\n this.calculateTotalPages = function() {\n var totalPages = this.itemsPerPage < 1 ? 1 : Math.ceil($scope.totalItems / this.itemsPerPage);\n return Math.max(totalPages || 0, 1);\n };\n\n this.render = function() {\n $scope.page = parseInt(ngModelCtrl.$viewValue, 10) || 1;\n };\n\n $scope.selectPage = function(page, evt) {\n if (evt) {\n evt.preventDefault();\n }\n\n var clickAllowed = !$scope.ngDisabled || !evt;\n if (clickAllowed && $scope.page !== page && page > 0 && page <= $scope.totalPages) {\n if (evt && evt.target) {\n evt.target.blur();\n }\n ngModelCtrl.$setViewValue(page);\n ngModelCtrl.$render();\n }\n };\n\n $scope.getText = function(key) {\n return $scope[key + 'Text'] || self.config[key + 'Text'];\n };\n\n $scope.noPrevious = function() {\n return $scope.page === 1;\n };\n\n $scope.noNext = function() {\n return $scope.page === $scope.totalPages;\n };\n}])\n\n.constant('paginationConfig', {\n itemsPerPage: 10,\n boundaryLinks: false,\n directionLinks: true,\n firstText: 'First',\n previousText: 'Previous',\n nextText: 'Next',\n lastText: 'Last',\n rotate: true\n})\n\n.directive('pagination', ['$parse', 'paginationConfig', function($parse, paginationConfig) {\n return {\n restrict: 'EA',\n scope: {\n totalItems: '=',\n firstText: '@',\n previousText: '@',\n nextText: '@',\n lastText: '@',\n ngDisabled:'='\n },\n require: ['pagination', '?ngModel'],\n controller: 'PaginationController',\n controllerAs: 'pagination',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/pagination/pagination.html';\n },\n replace: true,\n link: function(scope, element, attrs, ctrls) {\n var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (!ngModelCtrl) {\n return; // do nothing if no ng-model\n }\n\n // Setup configuration parameters\n var maxSize = angular.isDefined(attrs.maxSize) ? scope.$parent.$eval(attrs.maxSize) : paginationConfig.maxSize,\n rotate = angular.isDefined(attrs.rotate) ? scope.$parent.$eval(attrs.rotate) : paginationConfig.rotate;\n scope.boundaryLinks = angular.isDefined(attrs.boundaryLinks) ? scope.$parent.$eval(attrs.boundaryLinks) : paginationConfig.boundaryLinks;\n scope.directionLinks = angular.isDefined(attrs.directionLinks) ? scope.$parent.$eval(attrs.directionLinks) : paginationConfig.directionLinks;\n\n paginationCtrl.init(ngModelCtrl, paginationConfig);\n\n if (attrs.maxSize) {\n scope.$parent.$watch($parse(attrs.maxSize), function(value) {\n maxSize = parseInt(value, 10);\n paginationCtrl.render();\n });\n }\n\n // Create page object used in template\n function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }\n\n function getPages(currentPage, totalPages) {\n var pages = [];\n\n // Default page limits\n var startPage = 1, endPage = totalPages;\n var isMaxSized = angular.isDefined(maxSize) && maxSize < totalPages;\n\n // recompute if maxSize\n if (isMaxSized) {\n if (rotate) {\n // Current page is displayed in the middle of the visible ones\n startPage = Math.max(currentPage - Math.floor(maxSize/2), 1);\n endPage = startPage + maxSize - 1;\n\n // Adjust if limit is exceeded\n if (endPage > totalPages) {\n endPage = totalPages;\n startPage = endPage - maxSize + 1;\n }\n } else {\n // Visible pages are paginated with maxSize\n startPage = ((Math.ceil(currentPage / maxSize) - 1) * maxSize) + 1;\n\n // Adjust last page if limit is exceeded\n endPage = Math.min(startPage + maxSize - 1, totalPages);\n }\n }\n\n // Add page number links\n for (var number = startPage; number <= endPage; number++) {\n var page = makePage(number, number, number === currentPage);\n pages.push(page);\n }\n\n // Add links to move between page sets\n if (isMaxSized && ! rotate) {\n if (startPage > 1) {\n var previousPageSet = makePage(startPage - 1, '...', false);\n pages.unshift(previousPageSet);\n }\n\n if (endPage < totalPages) {\n var nextPageSet = makePage(endPage + 1, '...', false);\n pages.push(nextPageSet);\n }\n }\n\n return pages;\n }\n\n var originalRender = paginationCtrl.render;\n paginationCtrl.render = function() {\n originalRender();\n if (scope.page > 0 && scope.page <= scope.totalPages) {\n scope.pages = getPages(scope.page, scope.totalPages);\n }\n };\n }\n };\n}])\n\n.constant('pagerConfig', {\n itemsPerPage: 10,\n previousText: '« Previous',\n nextText: 'Next »',\n align: true\n})\n\n.directive('pager', ['pagerConfig', function(pagerConfig) {\n return {\n restrict: 'EA',\n scope: {\n totalItems: '=',\n previousText: '@',\n nextText: '@',\n ngDisabled: '='\n },\n require: ['pager', '?ngModel'],\n controller: 'PaginationController',\n controllerAs: 'pagination',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/pagination/pager.html';\n },\n replace: true,\n link: function(scope, element, attrs, ctrls) {\n var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (!ngModelCtrl) {\n return; // do nothing if no ng-model\n }\n\n scope.align = angular.isDefined(attrs.align) ? scope.$parent.$eval(attrs.align) : pagerConfig.align;\n paginationCtrl.init(ngModelCtrl, pagerConfig);\n }\n };\n}]);\n\n/**\n * The following features are still outstanding: animation as a\n * function, placement as a function, inside, support for more triggers than\n * just mouse enter/leave, html tooltips, and selector delegation.\n */\nangular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.bindHtml'])\n\n/**\n * The $tooltip service creates tooltip- and popover-like directives as well as\n * houses global options for them.\n */\n.provider('$tooltip', function() {\n // The default options tooltip and popover.\n var defaultOptions = {\n placement: 'top',\n animation: true,\n popupDelay: 0,\n useContentExp: false\n };\n\n // Default hide triggers for each show trigger\n var triggerMap = {\n 'mouseenter': 'mouseleave',\n 'click': 'click',\n 'focus': 'blur',\n 'none': ''\n };\n\n // The options specified to the provider globally.\n var globalOptions = {};\n\n /**\n * `options({})` allows global configuration of all tooltips in the\n * application.\n *\n * var app = angular.module( 'App', ['ui.bootstrap.tooltip'], function( $tooltipProvider ) {\n * // place tooltips left instead of top by default\n * $tooltipProvider.options( { placement: 'left' } );\n * });\n */\n\tthis.options = function(value) {\n\t\tangular.extend(globalOptions, value);\n\t};\n\n /**\n * This allows you to extend the set of trigger mappings available. E.g.:\n *\n * $tooltipProvider.setTriggers( 'openTrigger': 'closeTrigger' );\n */\n this.setTriggers = function setTriggers(triggers) {\n angular.extend(triggerMap, triggers);\n };\n\n /**\n * This is a helper function for translating camel-case to snake-case.\n */\n function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }\n\n /**\n * Returns the actual instance of the $tooltip service.\n * TODO support multiple triggers\n */\n this.$get = ['$window', '$compile', '$timeout', '$document', '$position', '$interpolate', '$rootScope', '$parse', function($window, $compile, $timeout, $document, $position, $interpolate, $rootScope, $parse) {\n return function $tooltip(type, prefix, defaultTriggerShow, options) {\n options = angular.extend({}, defaultOptions, globalOptions, options);\n\n /**\n * Returns an object of show and hide triggers.\n *\n * If a trigger is supplied,\n * it is used to show the tooltip; otherwise, it will use the `trigger`\n * option passed to the `$tooltipProvider.options` method; else it will\n * default to the trigger supplied to this directive factory.\n *\n * The hide trigger is based on the show trigger. If the `trigger` option\n * was passed to the `$tooltipProvider.options` method, it will use the\n * mapped trigger from `triggerMap` or the passed trigger if the map is\n * undefined; otherwise, it uses the `triggerMap` value of the show\n * trigger; else it will just use the show trigger.\n */\n function getTriggers(trigger) {\n var show = (trigger || options.trigger || defaultTriggerShow).split(' ');\n var hide = show.map(function(trigger) {\n return triggerMap[trigger] || trigger;\n });\n return {\n show: show,\n hide: hide\n };\n }\n\n var directiveName = snake_case(type);\n\n var startSym = $interpolate.startSymbol();\n var endSym = $interpolate.endSymbol();\n var template =\n '<div '+ directiveName +'-popup '+\n 'title=\"'+startSym+'title'+endSym+'\" '+\n (options.useContentExp ?\n 'content-exp=\"contentExp()\" ' :\n 'content=\"'+startSym+'content'+endSym+'\" ') +\n 'placement=\"'+startSym+'placement'+endSym+'\" '+\n 'popup-class=\"'+startSym+'popupClass'+endSym+'\" '+\n 'animation=\"animation\" '+\n 'is-open=\"isOpen\"'+\n 'origin-scope=\"origScope\" '+\n '>'+\n '</div>';\n\n return {\n restrict: 'EA',\n compile: function(tElem, tAttrs) {\n var tooltipLinker = $compile( template );\n\n return function link(scope, element, attrs, tooltipCtrl) {\n var tooltip;\n var tooltipLinkedScope;\n var transitionTimeout;\n var popupTimeout;\n var positionTimeout;\n var appendToBody = angular.isDefined(options.appendToBody) ? options.appendToBody : false;\n var triggers = getTriggers(undefined);\n var hasEnableExp = angular.isDefined(attrs[prefix + 'Enable']);\n var ttScope = scope.$new(true);\n var repositionScheduled = false;\n var isOpenExp = angular.isDefined(attrs[prefix + 'IsOpen']) ? $parse(attrs[prefix + 'IsOpen']) : false;\n\n var positionTooltip = function() {\n if (!tooltip) { return; }\n\n if (!positionTimeout) {\n positionTimeout = $timeout(function() {\n // Reset the positioning and box size for correct width and height values.\n tooltip.css({ top: 0, left: 0, width: 'auto', height: 'auto' });\n\n var ttBox = $position.position(tooltip);\n var ttCss = $position.positionElements(element, tooltip, ttScope.placement, appendToBody);\n ttCss.top += 'px';\n ttCss.left += 'px';\n\n ttCss.width = ttBox.width + 'px';\n ttCss.height = ttBox.height + 'px';\n\n // Now set the calculated positioning and size.\n tooltip.css(ttCss);\n\n positionTimeout = null;\n\n }, 0, false);\n }\n };\n\n // Set up the correct scope to allow transclusion later\n ttScope.origScope = scope;\n\n // By default, the tooltip is not open.\n // TODO add ability to start tooltip opened\n ttScope.isOpen = false;\n\n function toggleTooltipBind() {\n if (!ttScope.isOpen) {\n showTooltipBind();\n } else {\n hideTooltipBind();\n }\n }\n\n // Show the tooltip with delay if specified, otherwise show it immediately\n function showTooltipBind() {\n if (hasEnableExp && !scope.$eval(attrs[prefix + 'Enable'])) {\n return;\n }\n\n prepareTooltip();\n\n if (ttScope.popupDelay) {\n // Do nothing if the tooltip was already scheduled to pop-up.\n // This happens if show is triggered multiple times before any hide is triggered.\n if (!popupTimeout) {\n popupTimeout = $timeout(show, ttScope.popupDelay, false);\n }\n } else {\n show();\n }\n }\n\n function hideTooltipBind () {\n hide();\n if (!$rootScope.$$phase) {\n $rootScope.$digest();\n }\n }\n\n // Show the tooltip popup element.\n function show() {\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if (!(options.useContentExp ? ttScope.contentExp() : ttScope.content)) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n if (isOpenExp) {\n isOpenExp.assign(ttScope.origScope, ttScope.isOpen);\n }\n\n if (!$rootScope.$$phase) {\n ttScope.$apply(); // digest required as $apply is not called\n }\n\n tooltip.css({ display: 'block' });\n\n positionTooltip();\n }\n\n // Hide the tooltip popup element.\n function hide() {\n // First things first: we don't show it anymore.\n ttScope.isOpen = false;\n if (isOpenExp) {\n isOpenExp.assign(ttScope.origScope, ttScope.isOpen);\n }\n\n //if tooltip is going to be shown after delay, we must cancel this\n $timeout.cancel(popupTimeout);\n popupTimeout = null;\n\n $timeout.cancel(positionTimeout);\n positionTimeout = null;\n\n // And now we remove it from the DOM. However, if we have animation, we\n // need to wait for it to expire beforehand.\n // FIXME: this is a placeholder for a port of the transitions library.\n if (ttScope.animation) {\n if (!transitionTimeout) {\n transitionTimeout = $timeout(removeTooltip, 500);\n }\n } else {\n removeTooltip();\n }\n }\n\n function createTooltip() {\n // There can only be one tooltip element per directive shown at once.\n if (tooltip) {\n removeTooltip();\n }\n tooltipLinkedScope = ttScope.$new();\n tooltip = tooltipLinker(tooltipLinkedScope, function(tooltip) {\n if (appendToBody) {\n $document.find('body').append(tooltip);\n } else {\n element.after(tooltip);\n }\n });\n\n if (options.useContentExp) {\n tooltipLinkedScope.$watch('contentExp()', function(val) {\n if (!val && ttScope.isOpen) {\n hide();\n }\n });\n\n tooltipLinkedScope.$watch(function() {\n if (!repositionScheduled) {\n repositionScheduled = true;\n tooltipLinkedScope.$$postDigest(function() {\n repositionScheduled = false;\n if (ttScope.isOpen) {\n positionTooltip();\n }\n });\n }\n });\n\n }\n }\n\n function removeTooltip() {\n transitionTimeout = null;\n if (tooltip) {\n tooltip.remove();\n tooltip = null;\n }\n if (tooltipLinkedScope) {\n tooltipLinkedScope.$destroy();\n tooltipLinkedScope = null;\n }\n }\n\n function prepareTooltip() {\n prepPopupClass();\n prepPlacement();\n prepPopupDelay();\n }\n\n ttScope.contentExp = function() {\n return scope.$eval(attrs[type]);\n };\n\n /**\n * Observe the relevant attributes.\n */\n if (!options.useContentExp) {\n attrs.$observe(type, function(val) {\n ttScope.content = val;\n\n if (!val && ttScope.isOpen) {\n hide();\n } else {\n positionTooltip();\n }\n });\n }\n\n attrs.$observe('disabled', function(val) {\n if (popupTimeout && val) {\n $timeout.cancel(popupTimeout);\n popupTimeout = null;\n }\n\n if (val && ttScope.isOpen) {\n hide();\n }\n });\n\n attrs.$observe(prefix + 'Title', function(val) {\n ttScope.title = val;\n positionTooltip();\n });\n\n attrs.$observe(prefix + 'Placement', function() {\n if (ttScope.isOpen) {\n prepPlacement();\n positionTooltip();\n }\n });\n\n if (isOpenExp) {\n scope.$watch(isOpenExp, function(val) {\n if (val !== ttScope.isOpen) {\n toggleTooltipBind();\n }\n });\n }\n\n function prepPopupClass() {\n ttScope.popupClass = attrs[prefix + 'Class'];\n }\n\n function prepPlacement() {\n var val = attrs[prefix + 'Placement'];\n ttScope.placement = angular.isDefined(val) ? val : options.placement;\n }\n\n function prepPopupDelay() {\n var val = attrs[prefix + 'PopupDelay'];\n var delay = parseInt(val, 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n }\n\n var unregisterTriggers = function() {\n triggers.show.forEach(function(trigger) {\n element.unbind(trigger, showTooltipBind);\n });\n triggers.hide.forEach(function(trigger) {\n element.unbind(trigger, hideTooltipBind);\n });\n };\n\n function prepTriggers() {\n var val = attrs[prefix + 'Trigger'];\n unregisterTriggers();\n\n triggers = getTriggers(val);\n\n if (triggers.show !== 'none') {\n triggers.show.forEach(function(trigger, idx) {\n // Using raw addEventListener due to jqLite/jQuery bug - #4060\n if (trigger === triggers.hide[idx]) {\n element[0].addEventListener(trigger, toggleTooltipBind);\n } else if (trigger) {\n element[0].addEventListener(trigger, showTooltipBind);\n element[0].addEventListener(triggers.hide[idx], hideTooltipBind);\n }\n });\n }\n }\n prepTriggers();\n\n var animation = scope.$eval(attrs[prefix + 'Animation']);\n ttScope.animation = angular.isDefined(animation) ? !!animation : options.animation;\n\n var appendToBodyVal = scope.$eval(attrs[prefix + 'AppendToBody']);\n appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody;\n\n // if a tooltip is attached to <body> we need to remove it on\n // location change as its parent scope will probably not be destroyed\n // by the change.\n if (appendToBody) {\n scope.$on('$locationChangeSuccess', function closeTooltipOnLocationChangeSuccess() {\n if (ttScope.isOpen) {\n hide();\n }\n });\n }\n\n // Make sure tooltip is destroyed and removed.\n scope.$on('$destroy', function onDestroyTooltip() {\n $timeout.cancel(transitionTimeout);\n $timeout.cancel(popupTimeout);\n $timeout.cancel(positionTimeout);\n unregisterTriggers();\n removeTooltip();\n ttScope = null;\n });\n };\n }\n };\n };\n }];\n})\n\n// This is mostly ngInclude code but with a custom scope\n.directive('tooltipTemplateTransclude', [\n '$animate', '$sce', '$compile', '$templateRequest',\nfunction ($animate , $sce , $compile , $templateRequest) {\n return {\n link: function(scope, elem, attrs) {\n var origScope = scope.$eval(attrs.tooltipTemplateTranscludeScope);\n\n var changeCounter = 0,\n currentScope,\n previousElement,\n currentElement;\n\n var cleanupLastIncludeContent = function() {\n if (previousElement) {\n previousElement.remove();\n previousElement = null;\n }\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n if (currentElement) {\n $animate.leave(currentElement).then(function() {\n previousElement = null;\n });\n previousElement = currentElement;\n currentElement = null;\n }\n };\n\n scope.$watch($sce.parseAsResourceUrl(attrs.tooltipTemplateTransclude), function(src) {\n var thisChangeId = ++changeCounter;\n\n if (src) {\n //set the 2nd param to true to ignore the template request error so that the inner\n //contents and scope can be cleaned up.\n $templateRequest(src, true).then(function(response) {\n if (thisChangeId !== changeCounter) { return; }\n var newScope = origScope.$new();\n var template = response;\n\n var clone = $compile(template)(newScope, function(clone) {\n cleanupLastIncludeContent();\n $animate.enter(clone, elem);\n });\n\n currentScope = newScope;\n currentElement = clone;\n\n currentScope.$emit('$includeContentLoaded', src);\n }, function() {\n if (thisChangeId === changeCounter) {\n cleanupLastIncludeContent();\n scope.$emit('$includeContentError', src);\n }\n });\n scope.$emit('$includeContentRequested', src);\n } else {\n cleanupLastIncludeContent();\n }\n });\n\n scope.$on('$destroy', cleanupLastIncludeContent);\n }\n };\n}])\n\n/**\n * Note that it's intentional that these classes are *not* applied through $animate.\n * They must not be animated as they're expected to be present on the tooltip on\n * initialization.\n */\n.directive('tooltipClasses', function() {\n return {\n restrict: 'A',\n link: function(scope, element, attrs) {\n if (scope.placement) {\n element.addClass(scope.placement);\n }\n if (scope.popupClass) {\n element.addClass(scope.popupClass);\n }\n if (scope.animation()) {\n element.addClass(attrs.tooltipAnimationClass);\n }\n }\n };\n})\n\n.directive('tooltipPopup', function() {\n return {\n restrict: 'EA',\n replace: true,\n scope: { content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },\n templateUrl: 'template/tooltip/tooltip-popup.html'\n };\n})\n\n.directive('tooltip', [ '$tooltip', function($tooltip) {\n return $tooltip('tooltip', 'tooltip', 'mouseenter');\n}])\n\n.directive('tooltipTemplatePopup', function() {\n return {\n restrict: 'EA',\n replace: true,\n scope: { contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&',\n originScope: '&' },\n templateUrl: 'template/tooltip/tooltip-template-popup.html'\n };\n})\n\n.directive('tooltipTemplate', ['$tooltip', function($tooltip) {\n return $tooltip('tooltipTemplate', 'tooltip', 'mouseenter', {\n useContentExp: true\n });\n}])\n\n.directive('tooltipHtmlPopup', function() {\n return {\n restrict: 'EA',\n replace: true,\n scope: { contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },\n templateUrl: 'template/tooltip/tooltip-html-popup.html'\n };\n})\n\n.directive('tooltipHtml', ['$tooltip', function($tooltip) {\n return $tooltip('tooltipHtml', 'tooltip', 'mouseenter', {\n useContentExp: true\n });\n}])\n\n/*\nDeprecated\n*/\n.directive('tooltipHtmlUnsafePopup', function() {\n return {\n restrict: 'EA',\n replace: true,\n scope: { content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },\n templateUrl: 'template/tooltip/tooltip-html-unsafe-popup.html'\n };\n})\n\n.value('tooltipHtmlUnsafeSuppressDeprecated', false)\n.directive('tooltipHtmlUnsafe', [\n '$tooltip', 'tooltipHtmlUnsafeSuppressDeprecated', '$log',\nfunction($tooltip , tooltipHtmlUnsafeSuppressDeprecated , $log) {\n if (!tooltipHtmlUnsafeSuppressDeprecated) {\n $log.warn('tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead.');\n }\n return $tooltip('tooltipHtmlUnsafe', 'tooltip', 'mouseenter');\n}]);\n\n/**\n * The following features are still outstanding: popup delay, animation as a\n * function, placement as a function, inside, support for more triggers than\n * just mouse enter/leave, and selector delegatation.\n */\nangular.module( 'ui.bootstrap.popover', ['ui.bootstrap.tooltip'])\n\n.directive('popoverTemplatePopup', function() {\n return {\n restrict: 'EA',\n replace: true,\n scope: { title: '@', contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&',\n originScope: '&' },\n templateUrl: 'template/popover/popover-template.html'\n };\n})\n\n.directive('popoverTemplate', ['$tooltip', function($tooltip) {\n return $tooltip('popoverTemplate', 'popover', 'click', {\n useContentExp: true\n });\n}])\n\n.directive('popoverHtmlPopup', function() {\n return {\n restrict: 'EA',\n replace: true,\n scope: { contentExp: '&', title: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },\n templateUrl: 'template/popover/popover-html.html'\n };\n})\n\n.directive('popoverHtml', ['$tooltip', function($tooltip) {\n return $tooltip( 'popoverHtml', 'popover', 'click', {\n useContentExp: true\n });\n}])\n\n.directive('popoverPopup', function() {\n return {\n restrict: 'EA',\n replace: true,\n scope: { title: '@', content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },\n templateUrl: 'template/popover/popover.html'\n };\n})\n\n.directive('popover', ['$tooltip', function($tooltip) {\n return $tooltip( 'popover', 'popover', 'click' );\n}]);\n\nangular.module('ui.bootstrap.progressbar', [])\n\n.constant('progressConfig', {\n animate: true,\n max: 100\n})\n\n.value('$progressSuppressWarning', false)\n\n.controller('ProgressController', ['$scope', '$attrs', 'progressConfig', function($scope, $attrs, progressConfig) {\n var self = this,\n animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate;\n\n this.bars = [];\n $scope.max = angular.isDefined($scope.max) ? $scope.max : progressConfig.max;\n\n this.addBar = function(bar, element) {\n if (!animate) {\n element.css({'transition': 'none'});\n }\n\n this.bars.push(bar);\n\n bar.max = $scope.max;\n\n bar.$watch('value', function(value) {\n bar.recalculatePercentage();\n });\n\n bar.recalculatePercentage = function() {\n bar.percent = +(100 * bar.value / bar.max).toFixed(2);\n\n var totalPercentage = self.bars.reduce(function(total, bar) {\n return total + bar.percent;\n }, 0);\n\n if (totalPercentage > 100) {\n bar.percent -= totalPercentage - 100;\n }\n };\n\n bar.$on('$destroy', function() {\n element = null;\n self.removeBar(bar);\n });\n };\n\n this.removeBar = function(bar) {\n this.bars.splice(this.bars.indexOf(bar), 1);\n };\n\n $scope.$watch('max', function(max) {\n self.bars.forEach(function(bar) {\n bar.max = $scope.max;\n bar.recalculatePercentage();\n });\n });\n}])\n\n.directive('uibProgress', function() {\n return {\n restrict: 'EA',\n replace: true,\n transclude: true,\n controller: 'ProgressController',\n require: 'uibProgress',\n scope: {\n max: '=?'\n },\n templateUrl: 'template/progressbar/progress.html'\n };\n})\n\n.directive('progress', ['$log', '$progressSuppressWarning', function($log, $progressSuppressWarning) {\n return {\n restrict: 'EA',\n replace: true,\n transclude: true,\n controller: 'ProgressController',\n require: 'progress',\n scope: {\n max: '=?'\n },\n templateUrl: 'template/progressbar/progress.html',\n link: function() {\n if ($progressSuppressWarning) {\n $log.warn('progress is now deprecated. Use uib-progress instead');\n }\n }\n };\n}])\n\n.directive('uibBar', function() {\n return {\n restrict: 'EA',\n replace: true,\n transclude: true,\n require: '^uibProgress',\n scope: {\n value: '=',\n type: '@'\n },\n templateUrl: 'template/progressbar/bar.html',\n link: function(scope, element, attrs, progressCtrl) {\n progressCtrl.addBar(scope, element);\n }\n };\n})\n\n.directive('bar', ['$log', '$progressSuppressWarning', function($log, $progressSuppressWarning) {\n return {\n restrict: 'EA',\n replace: true,\n transclude: true,\n require: '^progress',\n scope: {\n value: '=',\n type: '@'\n },\n templateUrl: 'template/progressbar/bar.html',\n link: function(scope, element, attrs, progressCtrl) {\n if ($progressSuppressWarning) {\n $log.warn('bar is now deprecated. Use uib-bar instead');\n }\n progressCtrl.addBar(scope, element);\n }\n };\n}])\n\n.directive('progressbar', function() {\n return {\n restrict: 'EA',\n replace: true,\n transclude: true,\n controller: 'ProgressController',\n scope: {\n value: '=',\n max: '=?',\n type: '@'\n },\n templateUrl: 'template/progressbar/progressbar.html',\n link: function(scope, element, attrs, progressCtrl) {\n progressCtrl.addBar(scope, angular.element(element.children()[0]));\n }\n };\n});\n\nangular.module('ui.bootstrap.rating', [])\n\n.constant('ratingConfig', {\n max: 5,\n stateOn: null,\n stateOff: null,\n titles : ['one', 'two', 'three', 'four', 'five']\n})\n\n.controller('RatingController', ['$scope', '$attrs', 'ratingConfig', function($scope, $attrs, ratingConfig) {\n var ngModelCtrl = { $setViewValue: angular.noop };\n\n this.init = function(ngModelCtrl_) {\n ngModelCtrl = ngModelCtrl_;\n ngModelCtrl.$render = this.render;\n\n ngModelCtrl.$formatters.push(function(value) {\n if (angular.isNumber(value) && value << 0 !== value) {\n value = Math.round(value);\n }\n return value;\n });\n\n this.stateOn = angular.isDefined($attrs.stateOn) ? $scope.$parent.$eval($attrs.stateOn) : ratingConfig.stateOn;\n this.stateOff = angular.isDefined($attrs.stateOff) ? $scope.$parent.$eval($attrs.stateOff) : ratingConfig.stateOff;\n var tmpTitles = angular.isDefined($attrs.titles) ? $scope.$parent.$eval($attrs.titles) : ratingConfig.titles ; \n this.titles = angular.isArray(tmpTitles) && tmpTitles.length > 0 ?\n tmpTitles : ratingConfig.titles;\n \n var ratingStates = angular.isDefined($attrs.ratingStates) ?\n $scope.$parent.$eval($attrs.ratingStates) :\n new Array(angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : ratingConfig.max);\n $scope.range = this.buildTemplateObjects(ratingStates);\n };\n\n this.buildTemplateObjects = function(states) {\n for (var i = 0, n = states.length; i < n; i++) {\n states[i] = angular.extend({ index: i }, { stateOn: this.stateOn, stateOff: this.stateOff, title: this.getTitle(i) }, states[i]);\n }\n return states;\n };\n \n this.getTitle = function(index) {\n if (index >= this.titles.length) {\n return index + 1;\n } else {\n return this.titles[index];\n }\n };\n \n $scope.rate = function(value) {\n if (!$scope.readonly && value >= 0 && value <= $scope.range.length) {\n ngModelCtrl.$setViewValue(ngModelCtrl.$viewValue === value ? 0 : value);\n ngModelCtrl.$render();\n }\n };\n\n $scope.enter = function(value) {\n if (!$scope.readonly) {\n $scope.value = value;\n }\n $scope.onHover({value: value});\n };\n\n $scope.reset = function() {\n $scope.value = ngModelCtrl.$viewValue;\n $scope.onLeave();\n };\n\n $scope.onKeydown = function(evt) {\n if (/(37|38|39|40)/.test(evt.which)) {\n evt.preventDefault();\n evt.stopPropagation();\n $scope.rate($scope.value + (evt.which === 38 || evt.which === 39 ? 1 : -1));\n }\n };\n\n this.render = function() {\n $scope.value = ngModelCtrl.$viewValue;\n };\n}])\n\n.directive('rating', function() {\n return {\n restrict: 'EA',\n require: ['rating', 'ngModel'],\n scope: {\n readonly: '=?',\n onHover: '&',\n onLeave: '&'\n },\n controller: 'RatingController',\n templateUrl: 'template/rating/rating.html',\n replace: true,\n link: function(scope, element, attrs, ctrls) {\n var ratingCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n ratingCtrl.init( ngModelCtrl );\n }\n };\n});\n\n\n/**\n * @ngdoc overview\n * @name ui.bootstrap.tabs\n *\n * @description\n * AngularJS version of the tabs directive.\n */\n\nangular.module('ui.bootstrap.tabs', [])\n\n.controller('TabsetController', ['$scope', function TabsetCtrl($scope) {\n var ctrl = this,\n tabs = ctrl.tabs = $scope.tabs = [];\n\n ctrl.select = function(selectedTab) {\n angular.forEach(tabs, function(tab) {\n if (tab.active && tab !== selectedTab) {\n tab.active = false;\n tab.onDeselect();\n selectedTab.selectCalled = false;\n }\n });\n selectedTab.active = true;\n // only call select if it has not already been called\n if (!selectedTab.selectCalled) {\n selectedTab.onSelect();\n selectedTab.selectCalled = true;\n }\n };\n\n ctrl.addTab = function addTab(tab) {\n tabs.push(tab);\n // we can't run the select function on the first tab\n // since that would select it twice\n if (tabs.length === 1 && tab.active !== false) {\n tab.active = true;\n } else if (tab.active) {\n ctrl.select(tab);\n } else {\n tab.active = false;\n }\n };\n\n ctrl.removeTab = function removeTab(tab) {\n var index = tabs.indexOf(tab);\n //Select a new tab if the tab to be removed is selected and not destroyed\n if (tab.active && tabs.length > 1 && !destroyed) {\n //If this is the last tab, select the previous tab. else, the next tab.\n var newActiveIndex = index == tabs.length - 1 ? index - 1 : index + 1;\n ctrl.select(tabs[newActiveIndex]);\n }\n tabs.splice(index, 1);\n };\n\n var destroyed;\n $scope.$on('$destroy', function() {\n destroyed = true;\n });\n}])\n\n/**\n * @ngdoc directive\n * @name ui.bootstrap.tabs.directive:tabset\n * @restrict EA\n *\n * @description\n * Tabset is the outer container for the tabs directive\n *\n * @param {boolean=} vertical Whether or not to use vertical styling for the tabs.\n * @param {boolean=} justified Whether or not to use justified styling for the tabs.\n *\n * @example\n<example module=\"ui.bootstrap\">\n <file name=\"index.html\">\n <tabset>\n <tab heading=\"Tab 1\"><b>First</b> Content!</tab>\n <tab heading=\"Tab 2\"><i>Second</i> Content!</tab>\n </tabset>\n <hr />\n <tabset vertical=\"true\">\n <tab heading=\"Vertical Tab 1\"><b>First</b> Vertical Content!</tab>\n <tab heading=\"Vertical Tab 2\"><i>Second</i> Vertical Content!</tab>\n </tabset>\n <tabset justified=\"true\">\n <tab heading=\"Justified Tab 1\"><b>First</b> Justified Content!</tab>\n <tab heading=\"Justified Tab 2\"><i>Second</i> Justified Content!</tab>\n </tabset>\n </file>\n</example>\n */\n.directive('tabset', function() {\n return {\n restrict: 'EA',\n transclude: true,\n replace: true,\n scope: {\n type: '@'\n },\n controller: 'TabsetController',\n templateUrl: 'template/tabs/tabset.html',\n link: function(scope, element, attrs) {\n scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false;\n scope.justified = angular.isDefined(attrs.justified) ? scope.$parent.$eval(attrs.justified) : false;\n }\n };\n})\n\n/**\n * @ngdoc directive\n * @name ui.bootstrap.tabs.directive:tab\n * @restrict EA\n *\n * @param {string=} heading The visible heading, or title, of the tab. Set HTML headings with {@link ui.bootstrap.tabs.directive:tabHeading tabHeading}.\n * @param {string=} select An expression to evaluate when the tab is selected.\n * @param {boolean=} active A binding, telling whether or not this tab is selected.\n * @param {boolean=} disabled A binding, telling whether or not this tab is disabled.\n *\n * @description\n * Creates a tab with a heading and content. Must be placed within a {@link ui.bootstrap.tabs.directive:tabset tabset}.\n *\n * @example\n<example module=\"ui.bootstrap\">\n <file name=\"index.html\">\n <div ng-controller=\"TabsDemoCtrl\">\n <button class=\"btn btn-small\" ng-click=\"items[0].active = true\">\n Select item 1, using active binding\n </button>\n <button class=\"btn btn-small\" ng-click=\"items[1].disabled = !items[1].disabled\">\n Enable/disable item 2, using disabled binding\n </button>\n <br />\n <tabset>\n <tab heading=\"Tab 1\">First Tab</tab>\n <tab select=\"alertMe()\">\n <tab-heading><i class=\"icon-bell\"></i> Alert me!</tab-heading>\n Second Tab, with alert callback and html heading!\n </tab>\n <tab ng-repeat=\"item in items\"\n heading=\"{{item.title}}\"\n disabled=\"item.disabled\"\n active=\"item.active\">\n {{item.content}}\n </tab>\n </tabset>\n </div>\n </file>\n <file name=\"script.js\">\n function TabsDemoCtrl($scope) {\n $scope.items = [\n { title:\"Dynamic Title 1\", content:\"Dynamic Item 0\" },\n { title:\"Dynamic Title 2\", content:\"Dynamic Item 1\", disabled: true }\n ];\n\n $scope.alertMe = function() {\n setTimeout(function() {\n alert(\"You've selected the alert tab!\");\n });\n };\n };\n </file>\n</example>\n */\n\n/**\n * @ngdoc directive\n * @name ui.bootstrap.tabs.directive:tabHeading\n * @restrict EA\n *\n * @description\n * Creates an HTML heading for a {@link ui.bootstrap.tabs.directive:tab tab}. Must be placed as a child of a tab element.\n *\n * @example\n<example module=\"ui.bootstrap\">\n <file name=\"index.html\">\n <tabset>\n <tab>\n <tab-heading><b>HTML</b> in my titles?!</tab-heading>\n And some content, too!\n </tab>\n <tab>\n <tab-heading><i class=\"icon-heart\"></i> Icon heading?!?</tab-heading>\n That's right.\n </tab>\n </tabset>\n </file>\n</example>\n */\n.directive('tab', ['$parse', '$log', function($parse, $log) {\n return {\n require: '^tabset',\n restrict: 'EA',\n replace: true,\n templateUrl: 'template/tabs/tab.html',\n transclude: true,\n scope: {\n active: '=?',\n heading: '@',\n onSelect: '&select', //This callback is called in contentHeadingTransclude\n //once it inserts the tab's content into the dom\n onDeselect: '&deselect'\n },\n controller: function() {\n //Empty controller so other directives can require being 'under' a tab\n },\n link: function(scope, elm, attrs, tabsetCtrl, transclude) {\n scope.$watch('active', function(active) {\n if (active) {\n tabsetCtrl.select(scope);\n }\n });\n\n scope.disabled = false;\n if (attrs.disable) {\n scope.$parent.$watch($parse(attrs.disable), function(value) {\n scope.disabled = !! value;\n });\n }\n\n // Deprecation support of \"disabled\" parameter\n // fix(tab): IE9 disabled attr renders grey text on enabled tab #2677\n // This code is duplicated from the lines above to make it easy to remove once\n // the feature has been completely deprecated\n if (attrs.disabled) {\n $log.warn('Use of \"disabled\" attribute has been deprecated, please use \"disable\"');\n scope.$parent.$watch($parse(attrs.disabled), function(value) {\n scope.disabled = !! value;\n });\n }\n\n scope.select = function() {\n if (!scope.disabled) {\n scope.active = true;\n }\n };\n\n tabsetCtrl.addTab(scope);\n scope.$on('$destroy', function() {\n tabsetCtrl.removeTab(scope);\n });\n\n //We need to transclude later, once the content container is ready.\n //when this link happens, we're inside a tab heading.\n scope.$transcludeFn = transclude;\n }\n };\n}])\n\n.directive('tabHeadingTransclude', function() {\n return {\n restrict: 'A',\n require: '^tab',\n link: function(scope, elm, attrs, tabCtrl) {\n scope.$watch('headingElement', function updateHeadingElement(heading) {\n if (heading) {\n elm.html('');\n elm.append(heading);\n }\n });\n }\n };\n})\n\n.directive('tabContentTransclude', function() {\n return {\n restrict: 'A',\n require: '^tabset',\n link: function(scope, elm, attrs) {\n var tab = scope.$eval(attrs.tabContentTransclude);\n\n //Now our tab is ready to be transcluded: both the tab heading area\n //and the tab content area are loaded. Transclude 'em both.\n tab.$transcludeFn(tab.$parent, function(contents) {\n angular.forEach(contents, function(node) {\n if (isTabHeading(node)) {\n //Let tabHeadingTransclude know.\n tab.headingElement = node;\n } else {\n elm.append(node);\n }\n });\n });\n }\n };\n\n function isTabHeading(node) {\n return node.tagName && (\n node.hasAttribute('tab-heading') ||\n node.hasAttribute('data-tab-heading') ||\n node.hasAttribute('x-tab-heading') ||\n node.tagName.toLowerCase() === 'tab-heading' ||\n node.tagName.toLowerCase() === 'data-tab-heading' ||\n node.tagName.toLowerCase() === 'x-tab-heading'\n );\n }\n});\n\nangular.module('ui.bootstrap.timepicker', [])\n\n.constant('timepickerConfig', {\n hourStep: 1,\n minuteStep: 1,\n showMeridian: true,\n meridians: null,\n readonlyInput: false,\n mousewheel: true,\n arrowkeys: true,\n showSpinners: true\n})\n\n.controller('TimepickerController', ['$scope', '$attrs', '$parse', '$log', '$locale', 'timepickerConfig', function($scope, $attrs, $parse, $log, $locale, timepickerConfig) {\n var selected = new Date(),\n ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl\n meridians = angular.isDefined($attrs.meridians) ? $scope.$parent.$eval($attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS;\n\n this.init = function(ngModelCtrl_, inputs) {\n ngModelCtrl = ngModelCtrl_;\n ngModelCtrl.$render = this.render;\n\n ngModelCtrl.$formatters.unshift(function(modelValue) {\n return modelValue ? new Date(modelValue) : null;\n });\n\n var hoursInputEl = inputs.eq(0),\n minutesInputEl = inputs.eq(1);\n\n var mousewheel = angular.isDefined($attrs.mousewheel) ? $scope.$parent.$eval($attrs.mousewheel) : timepickerConfig.mousewheel;\n if (mousewheel) {\n this.setupMousewheelEvents(hoursInputEl, minutesInputEl);\n }\n\n var arrowkeys = angular.isDefined($attrs.arrowkeys) ? $scope.$parent.$eval($attrs.arrowkeys) : timepickerConfig.arrowkeys;\n if (arrowkeys) {\n this.setupArrowkeyEvents(hoursInputEl, minutesInputEl);\n }\n\n $scope.readonlyInput = angular.isDefined($attrs.readonlyInput) ? $scope.$parent.$eval($attrs.readonlyInput) : timepickerConfig.readonlyInput;\n this.setupInputEvents(hoursInputEl, minutesInputEl);\n };\n\n var hourStep = timepickerConfig.hourStep;\n if ($attrs.hourStep) {\n $scope.$parent.$watch($parse($attrs.hourStep), function(value) {\n hourStep = parseInt(value, 10);\n });\n }\n\n var minuteStep = timepickerConfig.minuteStep;\n if ($attrs.minuteStep) {\n $scope.$parent.$watch($parse($attrs.minuteStep), function(value) {\n minuteStep = parseInt(value, 10);\n });\n }\n\n var min;\n $scope.$parent.$watch($parse($attrs.min), function(value) {\n var dt = new Date(value);\n min = isNaN(dt) ? undefined : dt;\n });\n\n var max;\n $scope.$parent.$watch($parse($attrs.max), function(value) {\n var dt = new Date(value);\n max = isNaN(dt) ? undefined : dt;\n });\n\n $scope.noIncrementHours = function() {\n var incrementedSelected = addMinutes(selected, hourStep * 60);\n return incrementedSelected > max ||\n (incrementedSelected < selected && incrementedSelected < min);\n };\n\n $scope.noDecrementHours = function() {\n var decrementedSelected = addMinutes(selected, -hourStep * 60);\n return decrementedSelected < min ||\n (decrementedSelected > selected && decrementedSelected > max);\n };\n\n $scope.noIncrementMinutes = function() {\n var incrementedSelected = addMinutes(selected, minuteStep);\n return incrementedSelected > max ||\n (incrementedSelected < selected && incrementedSelected < min);\n };\n\n $scope.noDecrementMinutes = function() {\n var decrementedSelected = addMinutes(selected, -minuteStep);\n return decrementedSelected < min ||\n (decrementedSelected > selected && decrementedSelected > max);\n };\n\n $scope.noToggleMeridian = function() {\n if (selected.getHours() < 13) {\n return addMinutes(selected, 12 * 60) > max;\n } else {\n return addMinutes(selected, -12 * 60) < min;\n }\n };\n\n // 12H / 24H mode\n $scope.showMeridian = timepickerConfig.showMeridian;\n if ($attrs.showMeridian) {\n $scope.$parent.$watch($parse($attrs.showMeridian), function(value) {\n $scope.showMeridian = !!value;\n\n if (ngModelCtrl.$error.time) {\n // Evaluate from template\n var hours = getHoursFromTemplate(), minutes = getMinutesFromTemplate();\n if (angular.isDefined(hours) && angular.isDefined(minutes)) {\n selected.setHours(hours);\n refresh();\n }\n } else {\n updateTemplate();\n }\n });\n }\n\n // Get $scope.hours in 24H mode if valid\n function getHoursFromTemplate() {\n var hours = parseInt($scope.hours, 10);\n var valid = $scope.showMeridian ? (hours > 0 && hours < 13) : (hours >= 0 && hours < 24);\n if (!valid) {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }\n\n function getMinutesFromTemplate() {\n var minutes = parseInt($scope.minutes, 10);\n return (minutes >= 0 && minutes < 60) ? minutes : undefined;\n }\n\n function pad(value) {\n return (angular.isDefined(value) && value.toString().length < 2) ? '0' + value : value.toString();\n }\n\n // Respond on mousewheel spin\n this.setupMousewheelEvents = function(hoursInputEl, minutesInputEl) {\n var isScrollingUp = function(e) {\n if (e.originalEvent) {\n e = e.originalEvent;\n }\n //pick correct delta variable depending on event\n var delta = (e.wheelDelta) ? e.wheelDelta : -e.deltaY;\n return (e.detail || delta > 0);\n };\n\n hoursInputEl.bind('mousewheel wheel', function(e) {\n $scope.$apply(isScrollingUp(e) ? $scope.incrementHours() : $scope.decrementHours());\n e.preventDefault();\n });\n\n minutesInputEl.bind('mousewheel wheel', function(e) {\n $scope.$apply(isScrollingUp(e) ? $scope.incrementMinutes() : $scope.decrementMinutes());\n e.preventDefault();\n });\n\n };\n\n // Respond on up/down arrowkeys\n this.setupArrowkeyEvents = function(hoursInputEl, minutesInputEl) {\n hoursInputEl.bind('keydown', function(e) {\n if (e.which === 38) { // up\n e.preventDefault();\n $scope.incrementHours();\n $scope.$apply();\n } else if (e.which === 40) { // down\n e.preventDefault();\n $scope.decrementHours();\n $scope.$apply();\n }\n });\n\n minutesInputEl.bind('keydown', function(e) {\n if (e.which === 38) { // up\n e.preventDefault();\n $scope.incrementMinutes();\n $scope.$apply();\n } else if (e.which === 40) { // down\n e.preventDefault();\n $scope.decrementMinutes();\n $scope.$apply();\n }\n });\n };\n\n this.setupInputEvents = function(hoursInputEl, minutesInputEl) {\n if ($scope.readonlyInput) {\n $scope.updateHours = angular.noop;\n $scope.updateMinutes = angular.noop;\n return;\n }\n\n var invalidate = function(invalidHours, invalidMinutes) {\n ngModelCtrl.$setViewValue(null);\n ngModelCtrl.$setValidity('time', false);\n if (angular.isDefined(invalidHours)) {\n $scope.invalidHours = invalidHours;\n }\n if (angular.isDefined(invalidMinutes)) {\n $scope.invalidMinutes = invalidMinutes;\n }\n };\n\n $scope.updateHours = function() {\n var hours = getHoursFromTemplate(),\n minutes = getMinutesFromTemplate();\n\n if (angular.isDefined(hours) && angular.isDefined(minutes)) {\n selected.setHours(hours);\n if (selected < min || selected > max) {\n invalidate(true);\n } else {\n refresh('h');\n }\n } else {\n invalidate(true);\n }\n };\n\n hoursInputEl.bind('blur', function(e) {\n if (!$scope.invalidHours && $scope.hours < 10) {\n $scope.$apply(function() {\n $scope.hours = pad($scope.hours);\n });\n }\n });\n\n $scope.updateMinutes = function() {\n var minutes = getMinutesFromTemplate(),\n hours = getHoursFromTemplate();\n\n if (angular.isDefined(minutes) && angular.isDefined(hours)) {\n selected.setMinutes(minutes);\n if (selected < min || selected > max) {\n invalidate(undefined, true);\n } else {\n refresh('m');\n }\n } else {\n invalidate(undefined, true);\n }\n };\n\n minutesInputEl.bind('blur', function(e) {\n if (!$scope.invalidMinutes && $scope.minutes < 10) {\n $scope.$apply(function() {\n $scope.minutes = pad($scope.minutes);\n });\n }\n });\n\n };\n\n this.render = function() {\n var date = ngModelCtrl.$viewValue;\n\n if (isNaN(date)) {\n ngModelCtrl.$setValidity('time', false);\n $log.error('Timepicker directive: \"ng-model\" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.');\n } else {\n if (date) {\n selected = date;\n }\n\n if (selected < min || selected > max) {\n ngModelCtrl.$setValidity('time', false);\n $scope.invalidHours = true;\n $scope.invalidMinutes = true;\n } else {\n makeValid();\n }\n updateTemplate();\n }\n };\n\n // Call internally when we know that model is valid.\n function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }\n\n function makeValid() {\n ngModelCtrl.$setValidity('time', true);\n $scope.invalidHours = false;\n $scope.invalidMinutes = false;\n }\n\n function updateTemplate(keyboardChange) {\n var hours = selected.getHours(), minutes = selected.getMinutes();\n\n if ($scope.showMeridian) {\n hours = (hours === 0 || hours === 12) ? 12 : hours % 12; // Convert 24 to 12 hour system\n }\n\n $scope.hours = keyboardChange === 'h' ? hours : pad(hours);\n if (keyboardChange !== 'm') {\n $scope.minutes = pad(minutes);\n }\n $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1];\n }\n\n function addMinutes(date, minutes) {\n var dt = new Date(date.getTime() + minutes * 60000);\n var newDate = new Date(date);\n newDate.setHours(dt.getHours(), dt.getMinutes());\n return newDate;\n }\n\n function addMinutesToSelected(minutes) {\n selected = addMinutes(selected, minutes);\n refresh();\n }\n\n $scope.showSpinners = angular.isDefined($attrs.showSpinners) ?\n $scope.$parent.$eval($attrs.showSpinners) : timepickerConfig.showSpinners;\n\n $scope.incrementHours = function() {\n if (!$scope.noIncrementHours()) {\n addMinutesToSelected(hourStep * 60);\n }\n };\n\n $scope.decrementHours = function() {\n if (!$scope.noDecrementHours()) {\n addMinutesToSelected(-hourStep * 60);\n }\n };\n\n $scope.incrementMinutes = function() {\n if (!$scope.noIncrementMinutes()) {\n addMinutesToSelected(minuteStep);\n }\n };\n\n $scope.decrementMinutes = function() {\n if (!$scope.noDecrementMinutes()) {\n addMinutesToSelected(-minuteStep);\n }\n };\n\n $scope.toggleMeridian = function() {\n if (!$scope.noToggleMeridian()) {\n addMinutesToSelected(12 * 60 * (selected.getHours() < 12 ? 1 : -1));\n }\n };\n}])\n\n.directive('timepicker', function() {\n return {\n restrict: 'EA',\n require: ['timepicker', '?^ngModel'],\n controller:'TimepickerController',\n controllerAs: 'timepicker',\n replace: true,\n scope: {},\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'template/timepicker/timepicker.html';\n },\n link: function(scope, element, attrs, ctrls) {\n var timepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (ngModelCtrl) {\n timepickerCtrl.init(ngModelCtrl, element.find('input'));\n }\n }\n };\n});\n\nangular.module('ui.bootstrap.transition', [])\n\n.value('$transitionSuppressDeprecated', false)\n/**\n * $transition service provides a consistent interface to trigger CSS 3 transitions and to be informed when they complete.\n * @param {DOMElement} element The DOMElement that will be animated.\n * @param {string|object|function} trigger The thing that will cause the transition to start:\n * - As a string, it represents the css class to be added to the element.\n * - As an object, it represents a hash of style attributes to be applied to the element.\n * - As a function, it represents a function to be called that will cause the transition to occur.\n * @return {Promise} A promise that is resolved when the transition finishes.\n */\n.factory('$transition', [\n '$q', '$timeout', '$rootScope', '$log', '$transitionSuppressDeprecated',\nfunction($q , $timeout , $rootScope , $log , $transitionSuppressDeprecated) {\n\n if (!$transitionSuppressDeprecated) {\n $log.warn('$transition is now deprecated. Use $animate from ngAnimate instead.');\n }\n\n var $transition = function(element, trigger, options) {\n options = options || {};\n var deferred = $q.defer();\n var endEventName = $transition[options.animation ? 'animationEndEventName' : 'transitionEndEventName'];\n\n var transitionEndHandler = function(event) {\n $rootScope.$apply(function() {\n element.unbind(endEventName, transitionEndHandler);\n deferred.resolve(element);\n });\n };\n\n if (endEventName) {\n element.bind(endEventName, transitionEndHandler);\n }\n\n // Wrap in a timeout to allow the browser time to update the DOM before the transition is to occur\n $timeout(function() {\n if ( angular.isString(trigger) ) {\n element.addClass(trigger);\n } else if ( angular.isFunction(trigger) ) {\n trigger(element);\n } else if ( angular.isObject(trigger) ) {\n element.css(trigger);\n }\n //If browser does not support transitions, instantly resolve\n if ( !endEventName ) {\n deferred.resolve(element);\n }\n });\n\n // Add our custom cancel function to the promise that is returned\n // We can call this if we are about to run a new transition, which we know will prevent this transition from ending,\n // i.e. it will therefore never raise a transitionEnd event for that transition\n deferred.promise.cancel = function() {\n if ( endEventName ) {\n element.unbind(endEventName, transitionEndHandler);\n }\n deferred.reject('Transition cancelled');\n };\n\n return deferred.promise;\n };\n\n // Work out the name of the transitionEnd event\n var transElement = document.createElement('trans');\n var transitionEndEventNames = {\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'transitionend',\n 'OTransition': 'oTransitionEnd',\n 'transition': 'transitionend'\n };\n var animationEndEventNames = {\n 'WebkitTransition': 'webkitAnimationEnd',\n 'MozTransition': 'animationend',\n 'OTransition': 'oAnimationEnd',\n 'transition': 'animationend'\n };\n function findEndEventName(endEventNames) {\n for (var name in endEventNames){\n if (transElement.style[name] !== undefined) {\n return endEventNames[name];\n }\n }\n }\n $transition.transitionEndEventName = findEndEventName(transitionEndEventNames);\n $transition.animationEndEventName = findEndEventName(animationEndEventNames);\n return $transition;\n}]);\n\nangular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])\n\n/**\n * A helper service that can parse typeahead's syntax (string provided by users)\n * Extracted to a separate service for ease of unit testing\n */\n .factory('typeaheadParser', ['$parse', function($parse) {\n\n // 00000111000000000000022200000000000000003333333333333330000000000044000\n var TYPEAHEAD_REGEXP = /^\\s*([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?\\s+for\\s+(?:([\\$\\w][\\$\\w\\d]*))\\s+in\\s+([\\s\\S]+?)$/;\n\n return {\n parse: function(input) {\n var match = input.match(TYPEAHEAD_REGEXP);\n if (!match) {\n throw new Error(\n 'Expected typeahead specification in form of \"_modelValue_ (as _label_)? for _item_ in _collection_\"' +\n ' but got \"' + input + '\".');\n }\n\n return {\n itemName:match[3],\n source:$parse(match[4]),\n viewMapper:$parse(match[2] || match[1]),\n modelMapper:$parse(match[1])\n };\n }\n };\n}])\n\n .directive('typeahead', ['$compile', '$parse', '$q', '$timeout', '$document', '$window', '$rootScope', '$position', 'typeaheadParser',\n function($compile, $parse, $q, $timeout, $document, $window, $rootScope, $position, typeaheadParser) {\n var HOT_KEYS = [9, 13, 27, 38, 40];\n var eventDebounceTime = 200;\n\n return {\n require: ['ngModel', '^?ngModelOptions'],\n link: function(originalScope, element, attrs, ctrls) {\n var modelCtrl = ctrls[0];\n var ngModelOptions = ctrls[1];\n //SUPPORTED ATTRIBUTES (OPTIONS)\n\n //minimal no of characters that needs to be entered before typeahead kicks-in\n var minLength = originalScope.$eval(attrs.typeaheadMinLength);\n if (!minLength && minLength !== 0) {\n minLength = 1;\n }\n\n //minimal wait time after last character typed before typeahead kicks-in\n var waitTime = originalScope.$eval(attrs.typeaheadWaitMs) || 0;\n\n //should it restrict model values to the ones selected from the popup only?\n var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false;\n\n //binding to a variable that indicates if matches are being retrieved asynchronously\n var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop;\n\n //a callback executed when a match is selected\n var onSelectCallback = $parse(attrs.typeaheadOnSelect);\n\n //should it select highlighted popup value when losing focus?\n var isSelectOnBlur = angular.isDefined(attrs.typeaheadSelectOnBlur) ? originalScope.$eval(attrs.typeaheadSelectOnBlur) : false;\n\n //binding to a variable that indicates if there were no results after the query is completed\n var isNoResultsSetter = $parse(attrs.typeaheadNoResults).assign || angular.noop;\n\n var inputFormatter = attrs.typeaheadInputFormatter ? $parse(attrs.typeaheadInputFormatter) : undefined;\n\n var appendToBody = attrs.typeaheadAppendToBody ? originalScope.$eval(attrs.typeaheadAppendToBody) : false;\n\n var focusFirst = originalScope.$eval(attrs.typeaheadFocusFirst) !== false;\n\n //If input matches an item of the list exactly, select it automatically\n var selectOnExact = attrs.typeaheadSelectOnExact ? originalScope.$eval(attrs.typeaheadSelectOnExact) : false;\n\n //INTERNAL VARIABLES\n\n //model setter executed upon match selection\n var parsedModel = $parse(attrs.ngModel);\n var invokeModelSetter = $parse(attrs.ngModel + '($$$p)');\n var $setModelValue = function(scope, newValue) {\n if (angular.isFunction(parsedModel(originalScope)) &&\n ngModelOptions && ngModelOptions.$options && ngModelOptions.$options.getterSetter) {\n return invokeModelSetter(scope, {$$$p: newValue});\n } else {\n return parsedModel.assign(scope, newValue);\n }\n };\n\n //expressions used by typeahead\n var parserResult = typeaheadParser.parse(attrs.typeahead);\n\n var hasFocus;\n\n //Used to avoid bug in iOS webview where iOS keyboard does not fire\n //mousedown & mouseup events\n //Issue #3699\n var selected;\n\n //create a child scope for the typeahead directive so we are not polluting original scope\n //with typeahead-specific data (matches, query etc.)\n var scope = originalScope.$new();\n var offDestroy = originalScope.$on('$destroy', function() {\n\t\t\t scope.$destroy();\n });\n scope.$on('$destroy', offDestroy);\n\n // WAI-ARIA\n var popupId = 'typeahead-' + scope.$id + '-' + Math.floor(Math.random() * 10000);\n element.attr({\n 'aria-autocomplete': 'list',\n 'aria-expanded': false,\n 'aria-owns': popupId\n });\n\n //pop-up element used to display matches\n var popUpEl = angular.element('<div typeahead-popup></div>');\n popUpEl.attr({\n id: popupId,\n matches: 'matches',\n active: 'activeIdx',\n select: 'select(activeIdx)',\n 'move-in-progress': 'moveInProgress',\n query: 'query',\n position: 'position'\n });\n //custom item template\n if (angular.isDefined(attrs.typeaheadTemplateUrl)) {\n popUpEl.attr('template-url', attrs.typeaheadTemplateUrl);\n }\n\n if (angular.isDefined(attrs.typeaheadPopupTemplateUrl)) {\n popUpEl.attr('popup-template-url', attrs.typeaheadPopupTemplateUrl);\n }\n\n var resetMatches = function() {\n scope.matches = [];\n scope.activeIdx = -1;\n element.attr('aria-expanded', false);\n };\n\n var getMatchId = function(index) {\n return popupId + '-option-' + index;\n };\n\n // Indicate that the specified match is the active (pre-selected) item in the list owned by this typeahead.\n // This attribute is added or removed automatically when the `activeIdx` changes.\n scope.$watch('activeIdx', function(index) {\n if (index < 0) {\n element.removeAttr('aria-activedescendant');\n } else {\n element.attr('aria-activedescendant', getMatchId(index));\n }\n });\n\n var inputIsExactMatch = function(inputValue, index) {\n if (scope.matches.length > index && inputValue) {\n return inputValue.toUpperCase() === scope.matches[index].label.toUpperCase();\n }\n\n return false;\n };\n\n var getMatchesAsync = function(inputValue) {\n var locals = {$viewValue: inputValue};\n isLoadingSetter(originalScope, true);\n isNoResultsSetter(originalScope, false);\n $q.when(parserResult.source(originalScope, locals)).then(function(matches) {\n //it might happen that several async queries were in progress if a user were typing fast\n //but we are interested only in responses that correspond to the current view value\n var onCurrentRequest = (inputValue === modelCtrl.$viewValue);\n if (onCurrentRequest && hasFocus) {\n if (matches && matches.length > 0) {\n\n scope.activeIdx = focusFirst ? 0 : -1;\n isNoResultsSetter(originalScope, false);\n scope.matches.length = 0;\n\n //transform labels\n for (var i = 0; i < matches.length; i++) {\n locals[parserResult.itemName] = matches[i];\n scope.matches.push({\n id: getMatchId(i),\n label: parserResult.viewMapper(scope, locals),\n model: matches[i]\n });\n }\n\n scope.query = inputValue;\n //position pop-up with matches - we need to re-calculate its position each time we are opening a window\n //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page\n //due to other elements being rendered\n recalculatePosition();\n\n element.attr('aria-expanded', true);\n\n //Select the single remaining option if user input matches\n if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) {\n scope.select(0);\n }\n } else {\n resetMatches();\n isNoResultsSetter(originalScope, true);\n }\n }\n if (onCurrentRequest) {\n isLoadingSetter(originalScope, false);\n }\n }, function() {\n resetMatches();\n isLoadingSetter(originalScope, false);\n isNoResultsSetter(originalScope, true);\n });\n };\n\n // bind events only if appendToBody params exist - performance feature\n if (appendToBody) {\n angular.element($window).bind('resize', fireRecalculating);\n $document.find('body').bind('scroll', fireRecalculating);\n }\n\n // Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later\n var timeoutEventPromise;\n\n // Default progress type\n scope.moveInProgress = false;\n\n function fireRecalculating() {\n if (!scope.moveInProgress) {\n scope.moveInProgress = true;\n scope.$digest();\n }\n\n // Cancel previous timeout\n if (timeoutEventPromise) {\n $timeout.cancel(timeoutEventPromise);\n }\n\n // Debounced executing recalculate after events fired\n timeoutEventPromise = $timeout(function() {\n // if popup is visible\n if (scope.matches.length) {\n recalculatePosition();\n }\n\n scope.moveInProgress = false;\n scope.$digest();\n }, eventDebounceTime);\n }\n\n // recalculate actual position and set new values to scope\n // after digest loop is popup in right position\n function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }\n\n resetMatches();\n\n //we need to propagate user's query so we can higlight matches\n scope.query = undefined;\n\n //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later\n var timeoutPromise;\n\n var scheduleSearchWithTimeout = function(inputValue) {\n timeoutPromise = $timeout(function() {\n getMatchesAsync(inputValue);\n }, waitTime);\n };\n\n var cancelPreviousTimeout = function() {\n if (timeoutPromise) {\n $timeout.cancel(timeoutPromise);\n }\n };\n\n //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM\n //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue\n modelCtrl.$parsers.unshift(function(inputValue) {\n hasFocus = true;\n\n if (minLength === 0 || inputValue && inputValue.length >= minLength) {\n if (waitTime > 0) {\n cancelPreviousTimeout();\n scheduleSearchWithTimeout(inputValue);\n } else {\n getMatchesAsync(inputValue);\n }\n } else {\n isLoadingSetter(originalScope, false);\n cancelPreviousTimeout();\n resetMatches();\n }\n\n if (isEditable) {\n return inputValue;\n } else {\n if (!inputValue) {\n // Reset in case user had typed something previously.\n modelCtrl.$setValidity('editable', true);\n return null;\n } else {\n modelCtrl.$setValidity('editable', false);\n return undefined;\n }\n }\n });\n\n modelCtrl.$formatters.push(function(modelValue) {\n var candidateViewValue, emptyViewValue;\n var locals = {};\n\n // The validity may be set to false via $parsers (see above) if\n // the model is restricted to selected values. If the model\n // is set manually it is considered to be valid.\n if (!isEditable) {\n modelCtrl.$setValidity('editable', true);\n }\n\n if (inputFormatter) {\n locals.$model = modelValue;\n return inputFormatter(originalScope, locals);\n } else {\n //it might happen that we don't have enough info to properly render input value\n //we need to check for this situation and simply return model value if we can't apply custom formatting\n locals[parserResult.itemName] = modelValue;\n candidateViewValue = parserResult.viewMapper(originalScope, locals);\n locals[parserResult.itemName] = undefined;\n emptyViewValue = parserResult.viewMapper(originalScope, locals);\n\n return candidateViewValue!== emptyViewValue ? candidateViewValue : modelValue;\n }\n });\n\n scope.select = function(activeIdx) {\n //called from within the $digest() cycle\n var locals = {};\n var model, item;\n\n selected = true;\n locals[parserResult.itemName] = item = scope.matches[activeIdx].model;\n model = parserResult.modelMapper(originalScope, locals);\n $setModelValue(originalScope, model);\n modelCtrl.$setValidity('editable', true);\n modelCtrl.$setValidity('parse', true);\n\n onSelectCallback(originalScope, {\n $item: item,\n $model: model,\n $label: parserResult.viewMapper(originalScope, locals)\n });\n\n resetMatches();\n\n //return focus to the input element if a match was selected via a mouse click event\n // use timeout to avoid $rootScope:inprog error\n if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) {\n $timeout(function() { element[0].focus(); }, 0, false);\n }\n };\n\n //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27)\n element.bind('keydown', function(evt) {\n //typeahead is open and an \"interesting\" key was pressed\n if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) {\n return;\n }\n\n // if there's nothing selected (i.e. focusFirst) and enter or tab is hit, clear the results\n if (scope.activeIdx === -1 && (evt.which === 9 || evt.which === 13)) {\n resetMatches();\n scope.$digest();\n return;\n }\n\n evt.preventDefault();\n\n if (evt.which === 40) {\n scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;\n scope.$digest();\n\n } else if (evt.which === 38) {\n scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;\n scope.$digest();\n\n } else if (evt.which === 13 || evt.which === 9) {\n scope.$apply(function () {\n scope.select(scope.activeIdx);\n });\n\n } else if (evt.which === 27) {\n evt.stopPropagation();\n\n resetMatches();\n scope.$digest();\n }\n });\n\n element.bind('blur', function() {\n if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) {\n selected = true;\n scope.$apply(function() {\n scope.select(scope.activeIdx);\n });\n }\n hasFocus = false;\n selected = false;\n });\n\n // Keep reference to click handler to unbind it.\n var dismissClickHandler = function(evt) {\n // Issue #3973\n // Firefox treats right click as a click on document\n if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) {\n resetMatches();\n if (!$rootScope.$$phase) {\n scope.$digest();\n }\n }\n };\n\n $document.bind('click', dismissClickHandler);\n\n originalScope.$on('$destroy', function() {\n $document.unbind('click', dismissClickHandler);\n if (appendToBody) {\n $popup.remove();\n }\n // Prevent jQuery cache memory leak\n popUpEl.remove();\n });\n\n var $popup = $compile(popUpEl)(scope);\n\n if (appendToBody) {\n $document.find('body').append($popup);\n } else {\n element.after($popup);\n }\n }\n };\n\n }])\n\n .directive('typeaheadPopup', function() {\n return {\n restrict: 'EA',\n scope: {\n matches: '=',\n query: '=',\n active: '=',\n position: '&',\n moveInProgress: '=',\n select: '&'\n },\n replace: true,\n templateUrl: function(element, attrs) {\n return attrs.popupTemplateUrl || 'template/typeahead/typeahead-popup.html';\n },\n link: function(scope, element, attrs) {\n scope.templateUrl = attrs.templateUrl;\n\n scope.isOpen = function() {\n return scope.matches.length > 0;\n };\n\n scope.isActive = function(matchIdx) {\n return scope.active == matchIdx;\n };\n\n scope.selectActive = function(matchIdx) {\n scope.active = matchIdx;\n };\n\n scope.selectMatch = function(activeIdx) {\n scope.select({activeIdx:activeIdx});\n };\n }\n };\n })\n\n .directive('typeaheadMatch', ['$templateRequest', '$compile', '$parse', function($templateRequest, $compile, $parse) {\n return {\n restrict: 'EA',\n scope: {\n index: '=',\n match: '=',\n query: '='\n },\n link:function(scope, element, attrs) {\n var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'template/typeahead/typeahead-match.html';\n $templateRequest(tplUrl).then(function(tplContent) {\n $compile(tplContent.trim())(scope, function(clonedElement) {\n element.replaceWith(clonedElement);\n });\n });\n }\n };\n }])\n\n .filter('typeaheadHighlight', ['$sce', '$injector', '$log', function($sce, $injector, $log) {\n var isSanitizePresent;\n isSanitizePresent = $injector.has('$sanitize');\n\n function escapeRegexp(queryToEscape) {\n // Regex: capture the whole query string and replace it with the string that will be used to match\n // the results, for example if the capture is \"a\" the result will be \\a\n return queryToEscape.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1');\n }\n\n function containsHtml(matchItem) {\n return /<.*>/g.test(matchItem);\n }\n\n return function(matchItem, query) {\n if (!isSanitizePresent && containsHtml(matchItem)) {\n $log.warn('Unsafe use of typeahead please use ngSanitize'); // Warn the user about the danger\n }\n matchItem = query? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), '<strong>$&</strong>') : matchItem; // Replaces the capture string with a the same string inside of a \"strong\" tag\n if (!isSanitizePresent) {\n matchItem = $sce.trustAsHtml(matchItem); // If $sanitize is not present we pack the string in a $sce object for the ng-bind-html directive\n }\n return matchItem;\n };\n }]);\n\nangular.module(\"template/accordion/accordion-group.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/accordion/accordion-group.html\",\n \"<div class=\\\"panel {{panelClass || 'panel-default'}}\\\">\\n\" +\n \" <div class=\\\"panel-heading\\\" ng-keypress=\\\"toggleOpen($event)\\\">\\n\" +\n \" <h4 class=\\\"panel-title\\\">\\n\" +\n \" <a href tabindex=\\\"0\\\" class=\\\"accordion-toggle\\\" ng-click=\\\"toggleOpen()\\\" accordion-transclude=\\\"heading\\\"><span ng-class=\\\"{'text-muted': isDisabled}\\\">{{heading}}</span></a>\\n\" +\n \" </h4>\\n\" +\n \" </div>\\n\" +\n \" <div class=\\\"panel-collapse collapse\\\" collapse=\\\"!isOpen\\\">\\n\" +\n \"\t <div class=\\\"panel-body\\\" ng-transclude></div>\\n\" +\n \" </div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/accordion/accordion.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/accordion/accordion.html\",\n \"<div class=\\\"panel-group\\\" ng-transclude></div>\");\n}]);\n\nangular.module(\"template/alert/alert.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/alert/alert.html\",\n \"<div class=\\\"alert\\\" ng-class=\\\"['alert-' + (type || 'warning'), closeable ? 'alert-dismissible' : null]\\\" role=\\\"alert\\\">\\n\" +\n \" <button ng-show=\\\"closeable\\\" type=\\\"button\\\" class=\\\"close\\\" ng-click=\\\"close($event)\\\">\\n\" +\n \" <span aria-hidden=\\\"true\\\">×</span>\\n\" +\n \" <span class=\\\"sr-only\\\">Close</span>\\n\" +\n \" </button>\\n\" +\n \" <div ng-transclude></div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/carousel/carousel.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/carousel/carousel.html\",\n \"<div ng-mouseenter=\\\"pause()\\\" ng-mouseleave=\\\"play()\\\" class=\\\"carousel\\\" ng-swipe-right=\\\"prev()\\\" ng-swipe-left=\\\"next()\\\">\\n\" +\n \" <ol class=\\\"carousel-indicators\\\" ng-show=\\\"slides.length > 1\\\">\\n\" +\n \" <li ng-repeat=\\\"slide in slides | orderBy:indexOfSlide track by $index\\\" ng-class=\\\"{active: isActive(slide)}\\\" ng-click=\\\"select(slide)\\\"></li>\\n\" +\n \" </ol>\\n\" +\n \" <div class=\\\"carousel-inner\\\" ng-transclude></div>\\n\" +\n \" <a class=\\\"left carousel-control\\\" ng-click=\\\"prev()\\\" ng-show=\\\"slides.length > 1\\\"><span class=\\\"glyphicon glyphicon-chevron-left\\\"></span></a>\\n\" +\n \" <a class=\\\"right carousel-control\\\" ng-click=\\\"next()\\\" ng-show=\\\"slides.length > 1\\\"><span class=\\\"glyphicon glyphicon-chevron-right\\\"></span></a>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/carousel/slide.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/carousel/slide.html\",\n \"<div ng-class=\\\"{\\n\" +\n \" 'active': active\\n\" +\n \" }\\\" class=\\\"item text-center\\\" ng-transclude></div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/datepicker/datepicker.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/datepicker/datepicker.html\",\n \"<div ng-switch=\\\"datepickerMode\\\" role=\\\"application\\\" ng-keydown=\\\"keydown($event)\\\">\\n\" +\n \" <daypicker ng-switch-when=\\\"day\\\" tabindex=\\\"0\\\"></daypicker>\\n\" +\n \" <monthpicker ng-switch-when=\\\"month\\\" tabindex=\\\"0\\\"></monthpicker>\\n\" +\n \" <yearpicker ng-switch-when=\\\"year\\\" tabindex=\\\"0\\\"></yearpicker>\\n\" +\n \"</div>\");\n}]);\n\nangular.module(\"template/datepicker/day.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/datepicker/day.html\",\n \"<table role=\\\"grid\\\" aria-labelledby=\\\"{{::uniqueId}}-title\\\" aria-activedescendant=\\\"{{activeDateId}}\\\">\\n\" +\n \" <thead>\\n\" +\n \" <tr>\\n\" +\n \" <th><button type=\\\"button\\\" class=\\\"btn btn-default btn-sm pull-left\\\" ng-click=\\\"move(-1)\\\" tabindex=\\\"-1\\\"><i class=\\\"glyphicon glyphicon-chevron-left\\\"></i></button></th>\\n\" +\n \" <th colspan=\\\"{{::5 + showWeeks}}\\\"><button id=\\\"{{::uniqueId}}-title\\\" role=\\\"heading\\\" aria-live=\\\"assertive\\\" aria-atomic=\\\"true\\\" type=\\\"button\\\" class=\\\"btn btn-default btn-sm\\\" ng-click=\\\"toggleMode()\\\" ng-disabled=\\\"datepickerMode === maxMode\\\" tabindex=\\\"-1\\\" style=\\\"width:100%;\\\"><strong>{{title}}</strong></button></th>\\n\" +\n \" <th><button type=\\\"button\\\" class=\\\"btn btn-default btn-sm pull-right\\\" ng-click=\\\"move(1)\\\" tabindex=\\\"-1\\\"><i class=\\\"glyphicon glyphicon-chevron-right\\\"></i></button></th>\\n\" +\n \" </tr>\\n\" +\n \" <tr>\\n\" +\n \" <th ng-if=\\\"showWeeks\\\" class=\\\"text-center\\\"></th>\\n\" +\n \" <th ng-repeat=\\\"label in ::labels track by $index\\\" class=\\\"text-center\\\"><small aria-label=\\\"{{::label.full}}\\\">{{::label.abbr}}</small></th>\\n\" +\n \" </tr>\\n\" +\n \" </thead>\\n\" +\n \" <tbody>\\n\" +\n \" <tr ng-repeat=\\\"row in rows track by $index\\\">\\n\" +\n \" <td ng-if=\\\"showWeeks\\\" class=\\\"text-center h6\\\"><em>{{ weekNumbers[$index] }}</em></td>\\n\" +\n \" <td ng-repeat=\\\"dt in row track by dt.date\\\" class=\\\"text-center\\\" role=\\\"gridcell\\\" id=\\\"{{::dt.uid}}\\\" ng-class=\\\"::dt.customClass\\\">\\n\" +\n \" <button type=\\\"button\\\" style=\\\"min-width:100%;\\\" class=\\\"btn btn-default btn-sm\\\" ng-class=\\\"{'btn-info': dt.selected, active: isActive(dt)}\\\" ng-click=\\\"select(dt.date)\\\" ng-disabled=\\\"dt.disabled\\\" tabindex=\\\"-1\\\"><span ng-class=\\\"::{'text-muted': dt.secondary, 'text-info': dt.current}\\\">{{::dt.label}}</span></button>\\n\" +\n \" </td>\\n\" +\n \" </tr>\\n\" +\n \" </tbody>\\n\" +\n \"</table>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/datepicker/month.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/datepicker/month.html\",\n \"<table role=\\\"grid\\\" aria-labelledby=\\\"{{::uniqueId}}-title\\\" aria-activedescendant=\\\"{{activeDateId}}\\\">\\n\" +\n \" <thead>\\n\" +\n \" <tr>\\n\" +\n \" <th><button type=\\\"button\\\" class=\\\"btn btn-default btn-sm pull-left\\\" ng-click=\\\"move(-1)\\\" tabindex=\\\"-1\\\"><i class=\\\"glyphicon glyphicon-chevron-left\\\"></i></button></th>\\n\" +\n \" <th><button id=\\\"{{::uniqueId}}-title\\\" role=\\\"heading\\\" aria-live=\\\"assertive\\\" aria-atomic=\\\"true\\\" type=\\\"button\\\" class=\\\"btn btn-default btn-sm\\\" ng-click=\\\"toggleMode()\\\" ng-disabled=\\\"datepickerMode === maxMode\\\" tabindex=\\\"-1\\\" style=\\\"width:100%;\\\"><strong>{{title}}</strong></button></th>\\n\" +\n \" <th><button type=\\\"button\\\" class=\\\"btn btn-default btn-sm pull-right\\\" ng-click=\\\"move(1)\\\" tabindex=\\\"-1\\\"><i class=\\\"glyphicon glyphicon-chevron-right\\\"></i></button></th>\\n\" +\n \" </tr>\\n\" +\n \" </thead>\\n\" +\n \" <tbody>\\n\" +\n \" <tr ng-repeat=\\\"row in rows track by $index\\\">\\n\" +\n \" <td ng-repeat=\\\"dt in row track by dt.date\\\" class=\\\"text-center\\\" role=\\\"gridcell\\\" id=\\\"{{::dt.uid}}\\\" ng-class=\\\"::dt.customClass\\\">\\n\" +\n \" <button type=\\\"button\\\" style=\\\"min-width:100%;\\\" class=\\\"btn btn-default\\\" ng-class=\\\"{'btn-info': dt.selected, active: isActive(dt)}\\\" ng-click=\\\"select(dt.date)\\\" ng-disabled=\\\"dt.disabled\\\" tabindex=\\\"-1\\\"><span ng-class=\\\"::{'text-info': dt.current}\\\">{{::dt.label}}</span></button>\\n\" +\n \" </td>\\n\" +\n \" </tr>\\n\" +\n \" </tbody>\\n\" +\n \"</table>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/datepicker/popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/datepicker/popup.html\",\n \"<ul class=\\\"dropdown-menu\\\" ng-if=\\\"isOpen\\\" style=\\\"display: block\\\" ng-style=\\\"{top: position.top+'px', left: position.left+'px'}\\\" ng-keydown=\\\"keydown($event)\\\" ng-click=\\\"$event.stopPropagation()\\\">\\n\" +\n \"\t<li ng-transclude></li>\\n\" +\n \"\t<li ng-if=\\\"showButtonBar\\\" style=\\\"padding:10px 9px 2px\\\">\\n\" +\n \"\t\t<span class=\\\"btn-group pull-left\\\">\\n\" +\n \"\t\t\t<button type=\\\"button\\\" class=\\\"btn btn-sm btn-info\\\" ng-click=\\\"select('today')\\\" ng-disabled=\\\"isDisabled('today')\\\">{{ getText('current') }}</button>\\n\" +\n \"\t\t\t<button type=\\\"button\\\" class=\\\"btn btn-sm btn-danger\\\" ng-click=\\\"select(null)\\\">{{ getText('clear') }}</button>\\n\" +\n \"\t\t</span>\\n\" +\n \"\t\t<button type=\\\"button\\\" class=\\\"btn btn-sm btn-success pull-right\\\" ng-click=\\\"close()\\\">{{ getText('close') }}</button>\\n\" +\n \"\t</li>\\n\" +\n \"</ul>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/datepicker/year.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/datepicker/year.html\",\n \"<table role=\\\"grid\\\" aria-labelledby=\\\"{{::uniqueId}}-title\\\" aria-activedescendant=\\\"{{activeDateId}}\\\">\\n\" +\n \" <thead>\\n\" +\n \" <tr>\\n\" +\n \" <th><button type=\\\"button\\\" class=\\\"btn btn-default btn-sm pull-left\\\" ng-click=\\\"move(-1)\\\" tabindex=\\\"-1\\\"><i class=\\\"glyphicon glyphicon-chevron-left\\\"></i></button></th>\\n\" +\n \" <th colspan=\\\"3\\\"><button id=\\\"{{::uniqueId}}-title\\\" role=\\\"heading\\\" aria-live=\\\"assertive\\\" aria-atomic=\\\"true\\\" type=\\\"button\\\" class=\\\"btn btn-default btn-sm\\\" ng-click=\\\"toggleMode()\\\" ng-disabled=\\\"datepickerMode === maxMode\\\" tabindex=\\\"-1\\\" style=\\\"width:100%;\\\"><strong>{{title}}</strong></button></th>\\n\" +\n \" <th><button type=\\\"button\\\" class=\\\"btn btn-default btn-sm pull-right\\\" ng-click=\\\"move(1)\\\" tabindex=\\\"-1\\\"><i class=\\\"glyphicon glyphicon-chevron-right\\\"></i></button></th>\\n\" +\n \" </tr>\\n\" +\n \" </thead>\\n\" +\n \" <tbody>\\n\" +\n \" <tr ng-repeat=\\\"row in rows track by $index\\\">\\n\" +\n \" <td ng-repeat=\\\"dt in row track by dt.date\\\" class=\\\"text-center\\\" role=\\\"gridcell\\\" id=\\\"{{::dt.uid}}\\\">\\n\" +\n \" <button type=\\\"button\\\" style=\\\"min-width:100%;\\\" class=\\\"btn btn-default\\\" ng-class=\\\"{'btn-info': dt.selected, active: isActive(dt)}\\\" ng-click=\\\"select(dt.date)\\\" ng-disabled=\\\"dt.disabled\\\" tabindex=\\\"-1\\\"><span ng-class=\\\"::{'text-info': dt.current}\\\">{{::dt.label}}</span></button>\\n\" +\n \" </td>\\n\" +\n \" </tr>\\n\" +\n \" </tbody>\\n\" +\n \"</table>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/modal/backdrop.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/modal/backdrop.html\",\n \"<div class=\\\"modal-backdrop\\\"\\n\" +\n \" modal-animation-class=\\\"fade\\\"\\n\" +\n \" modal-in-class=\\\"in\\\"\\n\" +\n \" ng-style=\\\"{'z-index': 1040 + (index && 1 || 0) + index*10}\\\"\\n\" +\n \"></div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/modal/window.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/modal/window.html\",\n \"<div modal-render=\\\"{{$isRendered}}\\\" tabindex=\\\"-1\\\" role=\\\"dialog\\\" class=\\\"modal\\\"\\n\" +\n \" modal-animation-class=\\\"fade\\\"\\n\" +\n \" modal-in-class=\\\"in\\\"\\n\" +\n \"\tng-style=\\\"{'z-index': 1050 + index*10, display: 'block'}\\\" ng-click=\\\"close($event)\\\">\\n\" +\n \" <div class=\\\"modal-dialog\\\" ng-class=\\\"size ? 'modal-' + size : ''\\\"><div class=\\\"modal-content\\\" modal-transclude></div></div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/pagination/pager.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/pagination/pager.html\",\n \"<ul class=\\\"pager\\\">\\n\" +\n \" <li ng-class=\\\"{disabled: noPrevious()||ngDisabled, previous: align}\\\"><a href ng-click=\\\"selectPage(page - 1, $event)\\\">{{::getText('previous')}}</a></li>\\n\" +\n \" <li ng-class=\\\"{disabled: noNext()||ngDisabled, next: align}\\\"><a href ng-click=\\\"selectPage(page + 1, $event)\\\">{{::getText('next')}}</a></li>\\n\" +\n \"</ul>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/pagination/pagination.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/pagination/pagination.html\",\n \"<ul class=\\\"pagination\\\">\\n\" +\n \" <li ng-if=\\\"::boundaryLinks\\\" ng-class=\\\"{disabled: noPrevious()||ngDisabled}\\\" class=\\\"pagination-first\\\"><a href ng-click=\\\"selectPage(1, $event)\\\">{{::getText('first')}}</a></li>\\n\" +\n \" <li ng-if=\\\"::directionLinks\\\" ng-class=\\\"{disabled: noPrevious()||ngDisabled}\\\" class=\\\"pagination-prev\\\"><a href ng-click=\\\"selectPage(page - 1, $event)\\\">{{::getText('previous')}}</a></li>\\n\" +\n \" <li ng-repeat=\\\"page in pages track by $index\\\" ng-class=\\\"{active: page.active,disabled: ngDisabled&&!page.active}\\\" class=\\\"pagination-page\\\"><a href ng-click=\\\"selectPage(page.number, $event)\\\">{{page.text}}</a></li>\\n\" +\n \" <li ng-if=\\\"::directionLinks\\\" ng-class=\\\"{disabled: noNext()||ngDisabled}\\\" class=\\\"pagination-next\\\"><a href ng-click=\\\"selectPage(page + 1, $event)\\\">{{::getText('next')}}</a></li>\\n\" +\n \" <li ng-if=\\\"::boundaryLinks\\\" ng-class=\\\"{disabled: noNext()||ngDisabled}\\\" class=\\\"pagination-last\\\"><a href ng-click=\\\"selectPage(totalPages, $event)\\\">{{::getText('last')}}</a></li>\\n\" +\n \"</ul>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/tooltip/tooltip-html-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/tooltip/tooltip-html-popup.html\",\n \"<div class=\\\"tooltip\\\"\\n\" +\n \" tooltip-animation-class=\\\"fade\\\"\\n\" +\n \" tooltip-classes\\n\" +\n \" ng-class=\\\"{ in: isOpen() }\\\">\\n\" +\n \" <div class=\\\"tooltip-arrow\\\"></div>\\n\" +\n \" <div class=\\\"tooltip-inner\\\" ng-bind-html=\\\"contentExp()\\\"></div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/tooltip/tooltip-html-unsafe-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/tooltip/tooltip-html-unsafe-popup.html\",\n \"<div class=\\\"tooltip\\\"\\n\" +\n \" tooltip-animation-class=\\\"fade\\\"\\n\" +\n \" tooltip-classes\\n\" +\n \" ng-class=\\\"{ in: isOpen() }\\\">\\n\" +\n \" <div class=\\\"tooltip-arrow\\\"></div>\\n\" +\n \" <div class=\\\"tooltip-inner\\\" bind-html-unsafe=\\\"content\\\"></div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/tooltip/tooltip-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/tooltip/tooltip-popup.html\",\n \"<div class=\\\"tooltip\\\"\\n\" +\n \" tooltip-animation-class=\\\"fade\\\"\\n\" +\n \" tooltip-classes\\n\" +\n \" ng-class=\\\"{ in: isOpen() }\\\">\\n\" +\n \" <div class=\\\"tooltip-arrow\\\"></div>\\n\" +\n \" <div class=\\\"tooltip-inner\\\" ng-bind=\\\"content\\\"></div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/tooltip/tooltip-template-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/tooltip/tooltip-template-popup.html\",\n \"<div class=\\\"tooltip\\\"\\n\" +\n \" tooltip-animation-class=\\\"fade\\\"\\n\" +\n \" tooltip-classes\\n\" +\n \" ng-class=\\\"{ in: isOpen() }\\\">\\n\" +\n \" <div class=\\\"tooltip-arrow\\\"></div>\\n\" +\n \" <div class=\\\"tooltip-inner\\\"\\n\" +\n \" tooltip-template-transclude=\\\"contentExp()\\\"\\n\" +\n \" tooltip-template-transclude-scope=\\\"originScope()\\\"></div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/popover/popover-html.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/popover/popover-html.html\",\n \"<div class=\\\"popover\\\"\\n\" +\n \" tooltip-animation-class=\\\"fade\\\"\\n\" +\n \" tooltip-classes\\n\" +\n \" ng-class=\\\"{ in: isOpen() }\\\">\\n\" +\n \" <div class=\\\"arrow\\\"></div>\\n\" +\n \"\\n\" +\n \" <div class=\\\"popover-inner\\\">\\n\" +\n \" <h3 class=\\\"popover-title\\\" ng-bind=\\\"title\\\" ng-if=\\\"title\\\"></h3>\\n\" +\n \" <div class=\\\"popover-content\\\" ng-bind-html=\\\"contentExp()\\\"></div>\\n\" +\n \" </div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/popover/popover-template.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/popover/popover-template.html\",\n \"<div class=\\\"popover\\\"\\n\" +\n \" tooltip-animation-class=\\\"fade\\\"\\n\" +\n \" tooltip-classes\\n\" +\n \" ng-class=\\\"{ in: isOpen() }\\\">\\n\" +\n \" <div class=\\\"arrow\\\"></div>\\n\" +\n \"\\n\" +\n \" <div class=\\\"popover-inner\\\">\\n\" +\n \" <h3 class=\\\"popover-title\\\" ng-bind=\\\"title\\\" ng-if=\\\"title\\\"></h3>\\n\" +\n \" <div class=\\\"popover-content\\\"\\n\" +\n \" tooltip-template-transclude=\\\"contentExp()\\\"\\n\" +\n \" tooltip-template-transclude-scope=\\\"originScope()\\\"></div>\\n\" +\n \" </div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/popover/popover.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/popover/popover.html\",\n \"<div class=\\\"popover\\\"\\n\" +\n \" tooltip-animation-class=\\\"fade\\\"\\n\" +\n \" tooltip-classes\\n\" +\n \" ng-class=\\\"{ in: isOpen() }\\\">\\n\" +\n \" <div class=\\\"arrow\\\"></div>\\n\" +\n \"\\n\" +\n \" <div class=\\\"popover-inner\\\">\\n\" +\n \" <h3 class=\\\"popover-title\\\" ng-bind=\\\"title\\\" ng-if=\\\"title\\\"></h3>\\n\" +\n \" <div class=\\\"popover-content\\\" ng-bind=\\\"content\\\"></div>\\n\" +\n \" </div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/progressbar/bar.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/progressbar/bar.html\",\n \"<div class=\\\"progress-bar\\\" ng-class=\\\"type && 'progress-bar-' + type\\\" role=\\\"progressbar\\\" aria-valuenow=\\\"{{value}}\\\" aria-valuemin=\\\"0\\\" aria-valuemax=\\\"{{max}}\\\" ng-style=\\\"{width: (percent < 100 ? percent : 100) + '%'}\\\" aria-valuetext=\\\"{{percent | number:0}}%\\\" style=\\\"min-width: 0;\\\" ng-transclude></div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/progressbar/progress.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/progressbar/progress.html\",\n \"<div class=\\\"progress\\\" ng-transclude></div>\");\n}]);\n\nangular.module(\"template/progressbar/progressbar.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/progressbar/progressbar.html\",\n \"<div class=\\\"progress\\\">\\n\" +\n \" <div class=\\\"progress-bar\\\" ng-class=\\\"type && 'progress-bar-' + type\\\" role=\\\"progressbar\\\" aria-valuenow=\\\"{{value}}\\\" aria-valuemin=\\\"0\\\" aria-valuemax=\\\"{{max}}\\\" ng-style=\\\"{width: (percent < 100 ? percent : 100) + '%'}\\\" aria-valuetext=\\\"{{percent | number:0}}%\\\" style=\\\"min-width: 0;\\\" ng-transclude></div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/rating/rating.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/rating/rating.html\",\n \"<span ng-mouseleave=\\\"reset()\\\" ng-keydown=\\\"onKeydown($event)\\\" tabindex=\\\"0\\\" role=\\\"slider\\\" aria-valuemin=\\\"0\\\" aria-valuemax=\\\"{{range.length}}\\\" aria-valuenow=\\\"{{value}}\\\">\\n\" +\n \" <span ng-repeat-start=\\\"r in range track by $index\\\" class=\\\"sr-only\\\">({{ $index < value ? '*' : ' ' }})</span>\\n\" +\n \" <i ng-repeat-end ng-mouseenter=\\\"enter($index + 1)\\\" ng-click=\\\"rate($index + 1)\\\" class=\\\"glyphicon\\\" ng-class=\\\"$index < value && (r.stateOn || 'glyphicon-star') || (r.stateOff || 'glyphicon-star-empty')\\\" ng-attr-title=\\\"{{r.title}}\\\" ></i>\\n\" +\n \"</span>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/tabs/tab.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/tabs/tab.html\",\n \"<li ng-class=\\\"{active: active, disabled: disabled}\\\">\\n\" +\n \" <a href ng-click=\\\"select()\\\" tab-heading-transclude>{{heading}}</a>\\n\" +\n \"</li>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/tabs/tabset.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/tabs/tabset.html\",\n \"<div>\\n\" +\n \" <ul class=\\\"nav nav-{{type || 'tabs'}}\\\" ng-class=\\\"{'nav-stacked': vertical, 'nav-justified': justified}\\\" ng-transclude></ul>\\n\" +\n \" <div class=\\\"tab-content\\\">\\n\" +\n \" <div class=\\\"tab-pane\\\" \\n\" +\n \" ng-repeat=\\\"tab in tabs\\\" \\n\" +\n \" ng-class=\\\"{active: tab.active}\\\"\\n\" +\n \" tab-content-transclude=\\\"tab\\\">\\n\" +\n \" </div>\\n\" +\n \" </div>\\n\" +\n \"</div>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/timepicker/timepicker.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/timepicker/timepicker.html\",\n \"<table>\\n\" +\n \" <tbody>\\n\" +\n \" <tr class=\\\"text-center\\\" ng-show=\\\"::showSpinners\\\">\\n\" +\n \" <td><a ng-click=\\\"incrementHours()\\\" ng-class=\\\"{disabled: noIncrementHours()}\\\" class=\\\"btn btn-link\\\"><span class=\\\"glyphicon glyphicon-chevron-up\\\"></span></a></td>\\n\" +\n \" <td> </td>\\n\" +\n \" <td><a ng-click=\\\"incrementMinutes()\\\" ng-class=\\\"{disabled: noIncrementMinutes()}\\\" class=\\\"btn btn-link\\\"><span class=\\\"glyphicon glyphicon-chevron-up\\\"></span></a></td>\\n\" +\n \" <td ng-show=\\\"showMeridian\\\"></td>\\n\" +\n \" </tr>\\n\" +\n \" <tr>\\n\" +\n \" <td class=\\\"form-group\\\" ng-class=\\\"{'has-error': invalidHours}\\\">\\n\" +\n \" <input style=\\\"width:50px;\\\" type=\\\"text\\\" ng-model=\\\"hours\\\" ng-change=\\\"updateHours()\\\" class=\\\"form-control text-center\\\" ng-readonly=\\\"::readonlyInput\\\" maxlength=\\\"2\\\">\\n\" +\n \" </td>\\n\" +\n \" <td>:</td>\\n\" +\n \" <td class=\\\"form-group\\\" ng-class=\\\"{'has-error': invalidMinutes}\\\">\\n\" +\n \" <input style=\\\"width:50px;\\\" type=\\\"text\\\" ng-model=\\\"minutes\\\" ng-change=\\\"updateMinutes()\\\" class=\\\"form-control text-center\\\" ng-readonly=\\\"::readonlyInput\\\" maxlength=\\\"2\\\">\\n\" +\n \" </td>\\n\" +\n \" <td ng-show=\\\"showMeridian\\\"><button type=\\\"button\\\" ng-class=\\\"{disabled: noToggleMeridian()}\\\" class=\\\"btn btn-default text-center\\\" ng-click=\\\"toggleMeridian()\\\">{{meridian}}</button></td>\\n\" +\n \" </tr>\\n\" +\n \" <tr class=\\\"text-center\\\" ng-show=\\\"::showSpinners\\\">\\n\" +\n \" <td><a ng-click=\\\"decrementHours()\\\" ng-class=\\\"{disabled: noDecrementHours()}\\\" class=\\\"btn btn-link\\\"><span class=\\\"glyphicon glyphicon-chevron-down\\\"></span></a></td>\\n\" +\n \" <td> </td>\\n\" +\n \" <td><a ng-click=\\\"decrementMinutes()\\\" ng-class=\\\"{disabled: noDecrementMinutes()}\\\" class=\\\"btn btn-link\\\"><span class=\\\"glyphicon glyphicon-chevron-down\\\"></span></a></td>\\n\" +\n \" <td ng-show=\\\"showMeridian\\\"></td>\\n\" +\n \" </tr>\\n\" +\n \" </tbody>\\n\" +\n \"</table>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/typeahead/typeahead-match.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/typeahead/typeahead-match.html\",\n \"<a href tabindex=\\\"-1\\\" ng-bind-html=\\\"match.label | typeaheadHighlight:query\\\"></a>\\n\" +\n \"\");\n}]);\n\nangular.module(\"template/typeahead/typeahead-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"template/typeahead/typeahead-popup.html\",\n \"<ul class=\\\"dropdown-menu\\\" ng-show=\\\"isOpen() && !moveInProgress\\\" ng-style=\\\"{top: position().top+'px', left: position().left+'px'}\\\" style=\\\"display: block;\\\" role=\\\"listbox\\\" aria-hidden=\\\"{{!isOpen()}}\\\">\\n\" +\n \" <li ng-repeat=\\\"match in matches track by $index\\\" ng-class=\\\"{active: isActive($index) }\\\" ng-mouseenter=\\\"selectActive($index)\\\" ng-click=\\\"selectMatch($index)\\\" role=\\\"option\\\" id=\\\"{{::match.id}}\\\">\\n\" +\n \" <div typeahead-match index=\\\"$index\\\" match=\\\"match\\\" query=\\\"query\\\" template-url=\\\"templateUrl\\\"></div>\\n\" +\n \" </li>\\n\" +\n \"</ul>\\n\" +\n \"\");\n}]);\n!angular.$$csp() && angular.element(document).find('head').prepend('<style type=\"text/css\">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>');\n!function(n){\"use strict\";function t(n,t){return-1!==n.indexOf(t,n.length-t.length)}function e(){}function u(n,f){function c(n,t){return b.push(n),H.push(t),R!=o&&(R=o,setTimeout(function(){l()},0)),d}function l(){if(R!=o)return R=i,S(n),void(S=e);if(++L==b.length){if(!h)return L=b.length-1,void(R=i);L=0}b[L].apply(null,[].concat(l,H[L]))}function s(t,e,u){var i=e.length;return i?void function r(o){setTimeout(function(){M(n,x(n)+e[o]),o+=1,i>o?r(o):t()},u)}(0):t()}function a(e,u,i){var r=x(n),o=r.length;return null!=u&&(\"string\"==typeof u?o=t(r,u+T)?u.length+T.length:0:u>-1&&(o=Math.min(u,o))),o?void function f(t){setTimeout(function(){var u=x(n);t?(M(n,u.substring(0,u.length-1)),f(t-1)):e()},i)}(o):e()}function g(t){M(n,\"\"),t()}function p(t,e){e.call(t,n)}var d=this;if(!(d instanceof u))return new u(n,f);f=f||{};var h=f.loop,v=f.speed||f.typeSpeed||50,m=f.speed||f.deleteSpeed||50,y=f.delay||f.pauseDelay||2e3,T=f.postfix||\"\",x=f.getter||function(n){return n.innerHTML},M=f.setter||function(n,t){n.innerHTML=t},b=[],H=[],L=-1,R=i,S=e;d.type=function(n,t){return c(s,[n+T,t||v])},d[\"delete\"]=function(n,t){return c(a,[n,t||m])},d.clear=function(){return c(g)},d.pause=function(n){return c(setTimeout,[n||y])},d.call=function(n){return c(p,[n])},d.triggerPause=function(n){return R=r,S=n||e,d},d.triggerResume=function(){if(R!=o){var n=R;R=o,n==i&&l()}return d},d.isRunning=function(){return R!=i}}var i=0,r=1,o=2;\"object\"==typeof module?module.exports=u:n.malarkey=u}(this);\n(function() {\n 'use strict';\n\n angular.module('toastr', [])\n .factory('toastr', toastr);\n\n toastr.$inject = ['$animate', '$injector', '$document', '$rootScope', '$sce', 'toastrConfig', '$q'];\n\n function toastr($animate, $injector, $document, $rootScope, $sce, toastrConfig, $q) {\n var container;\n var index = 0;\n var toasts = [];\n\n var previousToastMessage = '';\n var openToasts = {};\n\n var containerDefer = $q.defer();\n\n var toast = {\n active: active,\n clear: clear,\n error: error,\n info: info,\n remove: remove,\n success: success,\n warning: warning\n };\n\n return toast;\n\n /* Public API */\n function active() {\n return toasts.length;\n }\n\n function clear(toast) {\n // Bit of a hack, I will remove this soon with a BC\n if (arguments.length === 1 && !toast) { return; }\n\n if (toast) {\n remove(toast.toastId);\n } else {\n for (var i = 0; i < toasts.length; i++) {\n remove(toasts[i].toastId);\n }\n }\n }\n\n function error(message, title, optionsOverride) {\n var type = _getOptions().iconClasses.error;\n return _buildNotification(type, message, title, optionsOverride);\n }\n\n function info(message, title, optionsOverride) {\n var type = _getOptions().iconClasses.info;\n return _buildNotification(type, message, title, optionsOverride);\n }\n\n function success(message, title, optionsOverride) {\n var type = _getOptions().iconClasses.success;\n return _buildNotification(type, message, title, optionsOverride);\n }\n\n function warning(message, title, optionsOverride) {\n var type = _getOptions().iconClasses.warning;\n return _buildNotification(type, message, title, optionsOverride);\n }\n\n function remove(toastId, wasClicked) {\n var toast = findToast(toastId);\n\n if (toast && ! toast.deleting) { // Avoid clicking when fading out\n toast.deleting = true;\n toast.isOpened = false;\n $animate.leave(toast.el).then(function() {\n if (toast.scope.options.onHidden) {\n toast.scope.options.onHidden(!!wasClicked, toast);\n }\n toast.scope.$destroy();\n var index = toasts.indexOf(toast);\n delete openToasts[toast.scope.message];\n toasts.splice(index, 1);\n var maxOpened = toastrConfig.maxOpened;\n if (maxOpened && toasts.length >= maxOpened) {\n toasts[maxOpened - 1].open.resolve();\n }\n if (lastToast()) {\n container.remove();\n container = null;\n containerDefer = $q.defer();\n }\n });\n }\n\n function findToast(toastId) {\n for (var i = 0; i < toasts.length; i++) {\n if (toasts[i].toastId === toastId) {\n return toasts[i];\n }\n }\n }\n\n function lastToast() {\n return !toasts.length;\n }\n }\n\n /* Internal functions */\n function _buildNotification(type, message, title, optionsOverride) {\n if (angular.isObject(title)) {\n optionsOverride = title;\n title = null;\n }\n\n return _notify({\n iconClass: type,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function _getOptions() {\n return angular.extend({}, toastrConfig);\n }\n\n function _createOrGetContainer(options) {\n if(container) { return containerDefer.promise; }\n\n container = angular.element('<div></div>');\n container.attr('id', options.containerId);\n container.addClass(options.positionClass);\n container.css({'pointer-events': 'auto'});\n\n var target = angular.element(document.querySelector(options.target));\n\n if ( ! target || ! target.length) {\n throw 'Target for toasts doesn\\'t exist';\n }\n\n $animate.enter(container, target).then(function() {\n containerDefer.resolve();\n });\n\n return containerDefer.promise;\n }\n\n function _notify(map) {\n var options = _getOptions();\n\n if (shouldExit()) { return; }\n\n var newToast = createToast();\n\n toasts.push(newToast);\n\n if (ifMaxOpenedAndAutoDismiss()) {\n var oldToasts = toasts.slice(0, (toasts.length - options.maxOpened));\n for (var i = 0, len = oldToasts.length; i < len; i++) {\n remove(oldToasts[i].toastId);\n }\n }\n\n if (maxOpenedNotReached()) {\n newToast.open.resolve();\n }\n\n newToast.open.promise.then(function() {\n _createOrGetContainer(options).then(function() {\n newToast.isOpened = true;\n if (options.newestOnTop) {\n $animate.enter(newToast.el, container).then(function() {\n newToast.scope.init();\n });\n } else {\n var sibling = container[0].lastChild ? angular.element(container[0].lastChild) : null;\n $animate.enter(newToast.el, container, sibling).then(function() {\n newToast.scope.init();\n });\n }\n });\n });\n\n return newToast;\n\n function ifMaxOpenedAndAutoDismiss() {\n return options.autoDismiss && options.maxOpened && toasts.length > options.maxOpened;\n }\n\n function createScope(toast, map, options) {\n if (options.allowHtml) {\n toast.scope.allowHtml = true;\n toast.scope.title = $sce.trustAsHtml(map.title);\n toast.scope.message = $sce.trustAsHtml(map.message);\n } else {\n toast.scope.title = map.title;\n toast.scope.message = map.message;\n }\n\n toast.scope.toastType = toast.iconClass;\n toast.scope.toastId = toast.toastId;\n toast.scope.extraData = options.extraData;\n\n toast.scope.options = {\n extendedTimeOut: options.extendedTimeOut,\n messageClass: options.messageClass,\n onHidden: options.onHidden,\n onShown: generateEvent('onShown'),\n onTap: generateEvent('onTap'),\n progressBar: options.progressBar,\n tapToDismiss: options.tapToDismiss,\n timeOut: options.timeOut,\n titleClass: options.titleClass,\n toastClass: options.toastClass\n };\n\n if (options.closeButton) {\n toast.scope.options.closeHtml = options.closeHtml;\n }\n\n function generateEvent(event) {\n if (options[event]) {\n return function() {\n options[event](toast);\n };\n }\n }\n }\n\n function createToast() {\n var newToast = {\n toastId: index++,\n isOpened: false,\n scope: $rootScope.$new(),\n open: $q.defer()\n };\n newToast.iconClass = map.iconClass;\n if (map.optionsOverride) {\n angular.extend(options, cleanOptionsOverride(map.optionsOverride));\n newToast.iconClass = map.optionsOverride.iconClass || newToast.iconClass;\n }\n\n createScope(newToast, map, options);\n\n newToast.el = createToastEl(newToast.scope);\n\n return newToast;\n\n function cleanOptionsOverride(options) {\n var badOptions = ['containerId', 'iconClasses', 'maxOpened', 'newestOnTop',\n 'positionClass', 'preventDuplicates', 'preventOpenDuplicates', 'templates'];\n for (var i = 0, l = badOptions.length; i < l; i++) {\n delete options[badOptions[i]];\n }\n\n return options;\n }\n }\n\n function createToastEl(scope) {\n var angularDomEl = angular.element('<div toast></div>'),\n $compile = $injector.get('$compile');\n return $compile(angularDomEl)(scope);\n }\n\n function maxOpenedNotReached() {\n return options.maxOpened && toasts.length <= options.maxOpened || !options.maxOpened;\n }\n\n function shouldExit() {\n var isDuplicateOfLast = options.preventDuplicates && map.message === previousToastMessage;\n var isDuplicateOpen = options.preventOpenDuplicates && openToasts[map.message];\n\n if (isDuplicateOfLast || isDuplicateOpen) {\n return true;\n }\n\n previousToastMessage = map.message;\n openToasts[map.message] = true;\n\n return false;\n }\n }\n }\n}());\n\n(function() {\n 'use strict';\n\n angular.module('toastr')\n .constant('toastrConfig', {\n allowHtml: false,\n autoDismiss: false,\n closeButton: false,\n closeHtml: '<button>×</button>',\n containerId: 'toast-container',\n extendedTimeOut: 1000,\n iconClasses: {\n error: 'toast-error',\n info: 'toast-info',\n success: 'toast-success',\n warning: 'toast-warning'\n },\n maxOpened: 0,\n messageClass: 'toast-message',\n newestOnTop: true,\n onHidden: null,\n onShown: null,\n onTap: null,\n positionClass: 'toast-top-right',\n preventDuplicates: false,\n preventOpenDuplicates: false,\n progressBar: false,\n tapToDismiss: true,\n target: 'body',\n templates: {\n toast: 'directives/toast/toast.html',\n progressbar: 'directives/progressbar/progressbar.html'\n },\n timeOut: 5000,\n titleClass: 'toast-title',\n toastClass: 'toast'\n });\n}());\n\n(function() {\n 'use strict';\n\n angular.module('toastr')\n .directive('progressBar', progressBar);\n\n progressBar.$inject = ['toastrConfig'];\n\n function progressBar(toastrConfig) {\n return {\n replace: true,\n require: '^toast',\n templateUrl: function() {\n return toastrConfig.templates.progressbar;\n },\n link: linkFunction\n };\n\n function linkFunction(scope, element, attrs, toastCtrl) {\n var intervalId, currentTimeOut, hideTime;\n\n toastCtrl.progressBar = scope;\n\n scope.start = function(duration) {\n if (intervalId) {\n clearInterval(intervalId);\n }\n\n currentTimeOut = parseFloat(duration);\n hideTime = new Date().getTime() + currentTimeOut;\n intervalId = setInterval(updateProgress, 10);\n };\n\n scope.stop = function() {\n if (intervalId) {\n clearInterval(intervalId);\n }\n };\n\n function updateProgress() {\n var percentage = ((hideTime - (new Date().getTime())) / currentTimeOut) * 100;\n element.css('width', percentage + '%');\n }\n\n scope.$on('$destroy', function() {\n // Failsafe stop\n clearInterval(intervalId);\n });\n }\n }\n}());\n\n(function() {\n 'use strict';\n\n angular.module('toastr')\n .controller('ToastController', ToastController);\n\n function ToastController() {\n this.progressBar = null;\n\n this.startProgressBar = function(duration) {\n if (this.progressBar) {\n this.progressBar.start(duration);\n }\n };\n\n this.stopProgressBar = function() {\n if (this.progressBar) {\n this.progressBar.stop();\n }\n };\n }\n}());\n\n(function() {\n 'use strict';\n\n angular.module('toastr')\n .directive('toast', toast);\n\n toast.$inject = ['$injector', '$interval', 'toastrConfig', 'toastr'];\n\n function toast($injector, $interval, toastrConfig, toastr) {\n return {\n replace: true,\n templateUrl: function() {\n return toastrConfig.templates.toast;\n },\n controller: 'ToastController',\n link: toastLinkFunction\n };\n\n function toastLinkFunction(scope, element, attrs, toastCtrl) {\n var timeout;\n\n scope.toastClass = scope.options.toastClass;\n scope.titleClass = scope.options.titleClass;\n scope.messageClass = scope.options.messageClass;\n scope.progressBar = scope.options.progressBar;\n\n if (wantsCloseButton()) {\n var button = angular.element(scope.options.closeHtml),\n $compile = $injector.get('$compile');\n button.addClass('toast-close-button');\n button.attr('ng-click', 'close(true, $event)');\n $compile(button)(scope);\n element.prepend(button);\n }\n\n scope.init = function() {\n if (scope.options.timeOut) {\n timeout = createTimeout(scope.options.timeOut);\n }\n if (scope.options.onShown) {\n scope.options.onShown();\n }\n };\n\n element.on('mouseenter', function() {\n hideAndStopProgressBar();\n if (timeout) {\n $interval.cancel(timeout);\n }\n });\n\n scope.tapToast = function () {\n if (angular.isFunction(scope.options.onTap)) {\n scope.options.onTap();\n }\n if (scope.options.tapToDismiss) {\n scope.close(true);\n }\n };\n\n scope.close = function (wasClicked, $event) {\n if ($event && angular.isFunction($event.stopPropagation)) {\n $event.stopPropagation();\n }\n toastr.remove(scope.toastId, wasClicked);\n };\n\n element.on('mouseleave', function() {\n if (scope.options.timeOut === 0 && scope.options.extendedTimeOut === 0) { return; }\n scope.$apply(function() {\n scope.progressBar = scope.options.progressBar;\n });\n timeout = createTimeout(scope.options.extendedTimeOut);\n });\n\n function createTimeout(time) {\n toastCtrl.startProgressBar(time);\n return $interval(function() {\n toastCtrl.stopProgressBar();\n toastr.remove(scope.toastId);\n }, time, 1);\n }\n\n function hideAndStopProgressBar() {\n scope.progressBar = false;\n toastCtrl.stopProgressBar();\n }\n\n function wantsCloseButton() {\n return scope.options.closeHtml;\n }\n }\n }\n}());\n\nangular.module(\"toastr\").run([\"$templateCache\", function($templateCache) {$templateCache.put(\"directives/progressbar/progressbar.html\",\"<div class=\\\"toast-progress\\\"></div>\\n\");\n$templateCache.put(\"directives/toast/toast.html\",\"<div class=\\\"{{toastClass}} {{toastType}}\\\" ng-click=\\\"tapToast()\\\">\\n <div ng-switch on=\\\"allowHtml\\\">\\n <div ng-switch-default ng-if=\\\"title\\\" class=\\\"{{titleClass}}\\\" aria-label=\\\"{{title}}\\\">{{title}}</div>\\n <div ng-switch-default class=\\\"{{messageClass}}\\\" aria-label=\\\"{{message}}\\\">{{message}}</div>\\n <div ng-switch-when=\\\"true\\\" ng-if=\\\"title\\\" class=\\\"{{titleClass}}\\\" ng-bind-html=\\\"title\\\"></div>\\n <div ng-switch-when=\\\"true\\\" class=\\\"{{messageClass}}\\\" ng-bind-html=\\\"message\\\"></div>\\n </div>\\n <progress-bar ng-if=\\\"progressBar\\\"></progress-bar>\\n</div>\\n\");}]);\n//! moment.js\n//! version : 2.10.6\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n}(this, function () { 'use strict';\n\n var hookCallback;\n\n function utils_hooks__hooks () {\n return hookCallback.apply(null, arguments);\n }\n\n // This is done to register the method called with moment()\n // without creating circular dependencies.\n function setHookCallback (callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }\n\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n\n function map(arr, fn) {\n var res = [], i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function create_utc__createUTC (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty : false,\n unusedTokens : [],\n unusedInput : [],\n overflow : -2,\n charsLeftOver : 0,\n nullInput : false,\n invalidMonth : null,\n invalidFormat : false,\n userInvalidated : false,\n iso : false\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n function valid__isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n m._isValid = !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated;\n\n if (m._strict) {\n m._isValid = m._isValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n }\n return m._isValid;\n }\n\n function valid__createInvalid (flags) {\n var m = create_utc__createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n }\n else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n var momentProperties = utils_hooks__hooks.momentProperties = [];\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (typeof from._isAMomentObject !== 'undefined') {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (typeof from._i !== 'undefined') {\n to._i = from._i;\n }\n if (typeof from._f !== 'undefined') {\n to._f = from._f;\n }\n if (typeof from._l !== 'undefined') {\n to._l = from._l;\n }\n if (typeof from._strict !== 'undefined') {\n to._strict = from._strict;\n }\n if (typeof from._tzm !== 'undefined') {\n to._tzm = from._tzm;\n }\n if (typeof from._isUTC !== 'undefined') {\n to._isUTC = from._isUTC;\n }\n if (typeof from._offset !== 'undefined') {\n to._offset = from._offset;\n }\n if (typeof from._pf !== 'undefined') {\n to._pf = getParsingFlags(from);\n }\n if (typeof from._locale !== 'undefined') {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i in momentProperties) {\n prop = momentProperties[i];\n val = from[prop];\n if (typeof val !== 'undefined') {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n var updateInProgress = false;\n\n // Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n utils_hooks__hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment (obj) {\n return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);\n }\n\n function absFloor (number) {\n if (number < 0) {\n return Math.ceil(number);\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n function Locale() {\n }\n\n var locales = {};\n var globalLocale;\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n // pick the locale from the array\n // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }\n\n function loadLocale(name) {\n var oldLocale = null;\n // TODO: Find a better way to register and load all the locales in Node\n if (!locales[name] && typeof module !== 'undefined' &&\n module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n require('./locale/' + name);\n // because defineLocale currently also sets the global locale, we\n // want to undo that for lazy loaded locales\n locale_locales__getSetGlobalLocale(oldLocale);\n } catch (e) { }\n }\n return locales[name];\n }\n\n // This function will load locale and then set the global locale. If\n // no arguments are passed in, it will simply return the current global\n // locale key.\n function locale_locales__getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (typeof values === 'undefined') {\n data = locale_locales__getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale (name, values) {\n if (values !== null) {\n values.abbr = name;\n locales[name] = locales[name] || new Locale();\n locales[name].set(values);\n\n // backwards compat for now: also set the locale\n locale_locales__getSetGlobalLocale(name);\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n // returns locale data\n function locale_locales__getLocale (key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n var aliases = {};\n\n function addUnitAlias (unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n function makeGetSet (unit, keepTime) {\n return function (value) {\n if (value != null) {\n get_set__set(this, unit, value);\n utils_hooks__hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get_set__get(this, unit);\n }\n };\n }\n\n function get_set__get (mom, unit) {\n return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]();\n }\n\n function get_set__set (mom, unit, value) {\n return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n\n // MOMENTS\n\n function getSet (units, value) {\n var unit;\n if (typeof units === 'object') {\n for (unit in units) {\n this.set(unit, units[unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (typeof this[units] === 'function') {\n return this[units](value);\n }\n }\n return this;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;\n\n var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\n var formatFunctions = {};\n\n var formatTokenFunctions = {};\n\n // token: 'M'\n // padded: ['MM', 2]\n // ordinal: 'Mo'\n // callback: function () { this.month() + 1 }\n function addFormatToken (token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens), i, length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '';\n for (i = 0; i < length; i++) {\n output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n }\n\n // format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var match1 = /\\d/; // 0 - 9\n var match2 = /\\d\\d/; // 00 - 99\n var match3 = /\\d{3}/; // 000 - 999\n var match4 = /\\d{4}/; // 0000 - 9999\n var match6 = /[+-]?\\d{6}/; // -999999 - 999999\n var match1to2 = /\\d\\d?/; // 0 - 99\n var match1to3 = /\\d{1,3}/; // 0 - 999\n var match1to4 = /\\d{1,4}/; // 0 - 9999\n var match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\n var matchUnsigned = /\\d+/; // 0 - inf\n var matchSigned = /[+-]?\\d+/; // -inf - inf\n\n var matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n\n var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n // any word (or two) characters or numbers including two/three word month in arabic.\n var matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\n var regexes = {};\n\n function isFunction (sth) {\n // https://github.com/moment/moment/issues/2325\n return typeof sth === 'function' &&\n Object.prototype.toString.call(sth) === '[object Function]';\n }\n\n\n function addRegexToken (token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict) {\n return (isStrict && strictRegex) ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken (token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }).replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken (token, callback) {\n var i, func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (typeof callback === 'number') {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken (token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0;\n var MONTH = 1;\n var DATE = 2;\n var HOUR = 3;\n var MINUTE = 4;\n var SECOND = 5;\n var MILLISECOND = 6;\n\n function daysInMonth(year, month) {\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n }\n\n // FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n // ALIASES\n\n addUnitAlias('month', 'M');\n\n // PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', matchWord);\n addRegexToken('MMMM', matchWord);\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n // LOCALES\n\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n function localeMonths (m) {\n return this._months[m.month()];\n }\n\n var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n function localeMonthsShort (m) {\n return this._monthsShort[m.month()];\n }\n\n function localeMonthsParse (monthName, format, strict) {\n var i, mom, regex;\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = create_utc__createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function setMonth (mom, value) {\n var dayOfMonth;\n\n // TODO: Move this out of here!\n if (typeof value === 'string') {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (typeof value !== 'number') {\n return mom;\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth (value) {\n if (value != null) {\n setMonth(this, value);\n utils_hooks__hooks.updateOffset(this, true);\n return this;\n } else {\n return get_set__get(this, 'Month');\n }\n }\n\n function getDaysInMonth () {\n return daysInMonth(this.year(), this.month());\n }\n\n function checkOverflow (m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :\n a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :\n a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :\n a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n -1;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n function warn(msg) {\n if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (firstTime) {\n warn(msg + '\\n' + (new Error()).stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n utils_hooks__hooks.suppressDeprecationWarnings = false;\n\n var from_string__isoRegex = /^\\s*(?:[+-]\\d{6}|\\d{4})-(?:(\\d\\d-\\d\\d)|(W\\d\\d$)|(W\\d\\d-\\d)|(\\d\\d\\d))((T| )(\\d\\d(:\\d\\d(:\\d\\d(\\.\\d+)?)?)?)?([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n\n var isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d{2}-\\d{2}/],\n ['YYYY-MM-DD', /\\d{4}-\\d{2}-\\d{2}/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d{2}-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d{2}/],\n ['YYYY-DDD', /\\d{4}-\\d{3}/]\n ];\n\n // iso time formats and regexes\n var isoTimes = [\n ['HH:mm:ss.SSSS', /(T| )\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss', /(T| )\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /(T| )\\d\\d:\\d\\d/],\n ['HH', /(T| )\\d\\d/]\n ];\n\n var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n // date from iso format\n function configFromISO(config) {\n var i, l,\n string = config._i,\n match = from_string__isoRegex.exec(string);\n\n if (match) {\n getParsingFlags(config).iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n config._f = isoDates[i][0];\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n // match[6] should be 'T' or space\n config._f += (match[6] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (string.match(matchOffset)) {\n config._f += 'Z';\n }\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n // date from iso format or fallback\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n utils_hooks__hooks.createFromInputFallback(config);\n }\n }\n\n utils_hooks__hooks.createFromInputFallback = deprecate(\n 'moment construction falls back to js Date. This is ' +\n 'discouraged and will be removed in upcoming major ' +\n 'release. Please refer to ' +\n 'https://github.com/moment/moment/issues/1407 for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n function createDate (y, m, d, h, M, s, ms) {\n //can't just apply() to create a date:\n //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply\n var date = new Date(y, m, d, h, M, s, ms);\n\n //the date constructor doesn't accept years < 1970\n if (y < 1970) {\n date.setFullYear(y);\n }\n return date;\n }\n\n function createUTCDate (y) {\n var date = new Date(Date.UTC.apply(null, arguments));\n if (y < 1970) {\n date.setUTCFullYear(y);\n }\n return date;\n }\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n // ALIASES\n\n addUnitAlias('year', 'y');\n\n // PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);\n });\n\n // HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n // HOOKS\n\n utils_hooks__hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n // MOMENTS\n\n var getSetYear = makeGetSet('FullYear', false);\n\n function getIsLeapYear () {\n return isLeapYear(this.year());\n }\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n // ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n // PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n // HELPERS\n\n // firstDayOfWeek 0 = sun, 6 = sat\n // the day of the week that starts the week\n // (usually sunday or monday)\n // firstDayOfWeekOfYear 0 = sun, 6 = sat\n // the first week is the week that contains the first\n // of this day of the week\n // (eg. ISO weeks use thursday (4))\n function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {\n var end = firstDayOfWeekOfYear - firstDayOfWeek,\n daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),\n adjustedMoment;\n\n\n if (daysToDayOfWeek > end) {\n daysToDayOfWeek -= 7;\n }\n\n if (daysToDayOfWeek < end - 7) {\n daysToDayOfWeek += 7;\n }\n\n adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd');\n return {\n week: Math.ceil(adjustedMoment.dayOfYear() / 7),\n year: adjustedMoment.year()\n };\n }\n\n // LOCALES\n\n function localeWeek (mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n };\n\n function localeFirstDayOfWeek () {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear () {\n return this._week.doy;\n }\n\n // MOMENTS\n\n function getSetWeek (input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek (input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n // ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n // PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n // HELPERS\n\n //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {\n var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear;\n if (d < firstDayOfWeek) {\n d += 7;\n }\n\n weekday = weekday != null ? 1 * weekday : firstDayOfWeek;\n\n dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday;\n\n return {\n year: dayOfYear > 0 ? year : year - 1,\n dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear\n };\n }\n\n // MOMENTS\n\n function getSetDayOfYear (input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n }\n\n // Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n var now = new Date();\n if (config._useUTC) {\n return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()];\n }\n return [now.getFullYear(), now.getMonth(), now.getDate()];\n }\n\n // convert an array to a date.\n // the array should mirror the parameters below\n // note: all values past the year are optional and will default to the lowest possible value.\n // [year, month, day , hour, minute, second, millisecond]\n function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);\n week = defaults(w.w, 1);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < dow) {\n ++week;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from begining of week\n weekday = w.e + dow;\n } else {\n // default to begining of week\n weekday = dow;\n }\n }\n temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);\n\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n\n utils_hooks__hooks.ISO_8601 = function () {};\n\n // date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === utils_hooks__hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (getParsingFlags(config).bigHour === true &&\n config._a[HOUR] <= 12 &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n\n function meridiemFixWrap (locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!valid__isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond];\n\n configFromArray(config);\n }\n\n function createFromConfig (config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig (config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || locale_locales__getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return valid__createInvalid({nullInput: true});\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else if (isDate(input)) {\n config._d = input;\n } else {\n configFromInput(config);\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (input === undefined) {\n config._d = new Date();\n } else if (isDate(input)) {\n config._d = new Date(+input);\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (typeof(input) === 'object') {\n configFromObject(config);\n } else if (typeof(input) === 'number') {\n // from milliseconds\n config._d = new Date(input);\n } else {\n utils_hooks__hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC (input, format, locale, strict, isUTC) {\n var c = {};\n\n if (typeof(locale) === 'boolean') {\n strict = locale;\n locale = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function local__createLocal (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',\n function () {\n var other = local__createLocal.apply(null, arguments);\n return other < this ? this : other;\n }\n );\n\n var prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',\n function () {\n var other = local__createLocal.apply(null, arguments);\n return other > this ? this : other;\n }\n );\n\n // Pick a moment m from moments so that m[fn](other) is true for all\n // other. This relies on the function fn to be transitive.\n //\n // moments should either be an array of moment objects or an array, whose\n // first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return local__createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n // TODO: Use [].sort instead?\n function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n function Duration (duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 36e5; // 1000 * 60 * 60\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days +\n weeks * 7;\n // It is impossible translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months +\n quarters * 3 +\n years * 12;\n\n this._data = {};\n\n this._locale = locale_locales__getLocale();\n\n this._bubble();\n }\n\n function isDuration (obj) {\n return obj instanceof Duration;\n }\n\n function offset (token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n // PARSING\n\n addRegexToken('Z', matchOffset);\n addRegexToken('ZZ', matchOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(input);\n });\n\n // HELPERS\n\n // timezone chunker\n // '+10:00' > ['10', '00']\n // '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(string) {\n var matches = ((string || '').match(matchOffset) || []);\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return parts[0] === '+' ? minutes : -minutes;\n }\n\n // Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(+res._d + diff);\n utils_hooks__hooks.updateOffset(res, false);\n return res;\n } else {\n return local__createLocal(input).local();\n }\n }\n\n function getDateOffset (m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n }\n\n // HOOKS\n\n // This function will be called whenever a moment is mutated.\n // It is intended to keep the offset in sync with the timezone.\n utils_hooks__hooks.updateOffset = function () {};\n\n // MOMENTS\n\n // keepLocalTime = true means only change the timezone, without\n // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n // +0200, so we adjust the time as needed, to be valid.\n //\n // Keeping the time actually adds/subtracts (one hour)\n // from the actual represented time. That is why we call updateOffset\n // a second time. In case it wants us to change the offset again\n // _changeInProgress == true case, then we have to adjust, because\n // there is no such time in the given timezone.\n function getSetOffset (input, keepLocalTime) {\n var offset = this._offset || 0,\n localAdjust;\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(input);\n }\n if (Math.abs(input) < 16) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n utils_hooks__hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone (input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC (keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal (keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset () {\n if (this._tzm) {\n this.utcOffset(this._tzm);\n } else if (typeof this._i === 'string') {\n this.utcOffset(offsetFromString(this._i));\n }\n return this;\n }\n\n function hasAlignedHourOffset (input) {\n input = input ? local__createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime () {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted () {\n if (typeof this._isDSTShifted !== 'undefined') {\n return this._isDSTShifted;\n }\n\n var c = {};\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);\n this._isDSTShifted = this.isValid() &&\n compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal () {\n return !this._isUTC;\n }\n\n function isUtcOffset () {\n return this._isUTC;\n }\n\n function isUtc () {\n return this._isUTC && this._offset === 0;\n }\n\n var aspNetRegex = /(\\-)?(?:(\\d*)\\.)?(\\d+)\\:(\\d+)(?:\\:(\\d+)\\.?(\\d{3})?)?/;\n\n // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;\n\n function create__createDuration (input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms : input._milliseconds,\n d : input._days,\n M : input._months\n };\n } else if (typeof input === 'number') {\n duration = {};\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : 0,\n d : toInt(match[DATE]) * sign,\n h : toInt(match[HOUR]) * sign,\n m : toInt(match[MINUTE]) * sign,\n s : toInt(match[SECOND]) * sign,\n ms : toInt(match[MILLISECOND]) * sign\n };\n } else if (!!(match = create__isoRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : parseIso(match[2], sign),\n M : parseIso(match[3], sign),\n d : parseIso(match[4], sign),\n h : parseIso(match[5], sign),\n m : parseIso(match[6], sign),\n s : parseIso(match[7], sign),\n w : parseIso(match[8], sign)\n };\n } else if (duration == null) {// checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n }\n\n create__createDuration.fn = Duration.prototype;\n\n function parseIso (inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {milliseconds: 0, months: 0};\n\n res.months = other.month() - base.month() +\n (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = create__createDuration(val, period);\n add_subtract__addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = duration._days,\n months = duration._months;\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (milliseconds) {\n mom._d.setTime(+mom._d + milliseconds * isAdding);\n }\n if (days) {\n get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);\n }\n if (months) {\n setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);\n }\n if (updateOffset) {\n utils_hooks__hooks.updateOffset(mom, days || months);\n }\n }\n\n var add_subtract__add = createAdder(1, 'add');\n var add_subtract__subtract = createAdder(-1, 'subtract');\n\n function moment_calendar__calendar (time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || local__createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n diff = this.diff(sod, 'days', true),\n format = diff < -6 ? 'sameElse' :\n diff < -1 ? 'lastWeek' :\n diff < 0 ? 'lastDay' :\n diff < 1 ? 'sameDay' :\n diff < 2 ? 'nextDay' :\n diff < 7 ? 'nextWeek' : 'sameElse';\n return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now)));\n }\n\n function clone () {\n return new Moment(this);\n }\n\n function isAfter (input, units) {\n var inputMs;\n units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');\n if (units === 'millisecond') {\n input = isMoment(input) ? input : local__createLocal(input);\n return +this > +input;\n } else {\n inputMs = isMoment(input) ? +input : +local__createLocal(input);\n return inputMs < +this.clone().startOf(units);\n }\n }\n\n function isBefore (input, units) {\n var inputMs;\n units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');\n if (units === 'millisecond') {\n input = isMoment(input) ? input : local__createLocal(input);\n return +this < +input;\n } else {\n inputMs = isMoment(input) ? +input : +local__createLocal(input);\n return +this.clone().endOf(units) < inputMs;\n }\n }\n\n function isBetween (from, to, units) {\n return this.isAfter(from, units) && this.isBefore(to, units);\n }\n\n function isSame (input, units) {\n var inputMs;\n units = normalizeUnits(units || 'millisecond');\n if (units === 'millisecond') {\n input = isMoment(input) ? input : local__createLocal(input);\n return +this === +input;\n } else {\n inputMs = +local__createLocal(input);\n return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));\n }\n }\n\n function diff (input, units, asFloat) {\n var that = cloneWithOffset(input, this),\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4,\n delta, output;\n\n units = normalizeUnits(units);\n\n if (units === 'year' || units === 'month' || units === 'quarter') {\n output = monthDiff(this, that);\n if (units === 'quarter') {\n output = output / 3;\n } else if (units === 'year') {\n output = output / 12;\n }\n } else {\n delta = this - that;\n output = units === 'second' ? delta / 1e3 : // 1000\n units === 'minute' ? delta / 6e4 : // 1000 * 60\n units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n delta;\n }\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff (a, b) {\n // difference in months\n var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2, adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n return -(wholeMonthDiff + adjust);\n }\n\n utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n\n function toString () {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function moment_format__toISOString () {\n var m = this.clone().utc();\n if (0 < m.year() && m.year() <= 9999) {\n if ('function' === typeof Date.prototype.toISOString) {\n // native implementation is ~50x faster, use it when we can\n return this.toDate().toISOString();\n } else {\n return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n } else {\n return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n }\n\n function format (inputString) {\n var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat);\n return this.localeData().postformat(output);\n }\n\n function from (time, withoutSuffix) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n }\n\n function fromNow (withoutSuffix) {\n return this.from(local__createLocal(), withoutSuffix);\n }\n\n function to (time, withoutSuffix) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);\n }\n\n function toNow (withoutSuffix) {\n return this.to(local__createLocal(), withoutSuffix);\n }\n\n function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = locale_locales__getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData () {\n return this._locale;\n }\n\n function startOf (units) {\n units = normalizeUnits(units);\n // the following switch intentionally omits break keywords\n // to utilize falling through the cases.\n switch (units) {\n case 'year':\n this.month(0);\n /* falls through */\n case 'quarter':\n case 'month':\n this.date(1);\n /* falls through */\n case 'week':\n case 'isoWeek':\n case 'day':\n this.hours(0);\n /* falls through */\n case 'hour':\n this.minutes(0);\n /* falls through */\n case 'minute':\n this.seconds(0);\n /* falls through */\n case 'second':\n this.milliseconds(0);\n }\n\n // weeks are a special case\n if (units === 'week') {\n this.weekday(0);\n }\n if (units === 'isoWeek') {\n this.isoWeekday(1);\n }\n\n // quarters are also special\n if (units === 'quarter') {\n this.month(Math.floor(this.month() / 3) * 3);\n }\n\n return this;\n }\n\n function endOf (units) {\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond') {\n return this;\n }\n return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n }\n\n function to_type__valueOf () {\n return +this._d - ((this._offset || 0) * 60000);\n }\n\n function unix () {\n return Math.floor(+this / 1000);\n }\n\n function toDate () {\n return this._offset ? new Date(+this) : this._d;\n }\n\n function toArray () {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n\n function toObject () {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n\n function moment_valid__isValid () {\n return valid__isValid(this);\n }\n\n function parsingFlags () {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt () {\n return getParsingFlags(this).overflow;\n }\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken (token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n // ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n // PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = utils_hooks__hooks.parseTwoDigitYear(input);\n });\n\n // HELPERS\n\n function weeksInYear(year, dow, doy) {\n return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week;\n }\n\n // MOMENTS\n\n function getSetWeekYear (input) {\n var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;\n return input == null ? year : this.add((input - year), 'y');\n }\n\n function getSetISOWeekYear (input) {\n var year = weekOfYear(this, 1, 4).year;\n return input == null ? year : this.add((input - year), 'y');\n }\n\n function getISOWeeksInYear () {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getWeeksInYear () {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n addFormatToken('Q', 0, 0, 'quarter');\n\n // ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n // PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n // MOMENTS\n\n function getSetQuarter (input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n }\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n // ALIASES\n\n addUnitAlias('date', 'D');\n\n // PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0], 10);\n });\n\n // MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n // ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n // PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', matchWord);\n addRegexToken('ddd', matchWord);\n addRegexToken('dddd', matchWord);\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) {\n var weekday = config._locale.weekdaysParse(input);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n // HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n // LOCALES\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n function localeWeekdays (m) {\n return this._weekdays[m.day()];\n }\n\n var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n function localeWeekdaysShort (m) {\n return this._weekdaysShort[m.day()];\n }\n\n var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n function localeWeekdaysMin (m) {\n return this._weekdaysMin[m.day()];\n }\n\n function localeWeekdaysParse (weekdayName) {\n var i, mom, regex;\n\n this._weekdaysParse = this._weekdaysParse || [];\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n if (!this._weekdaysParse[i]) {\n mom = local__createLocal([2000, 1]).day(i);\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n // MOMENTS\n\n function getSetDayOfWeek (input) {\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek (input) {\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek (input) {\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, function () {\n return this.hours() % 12 || 12;\n });\n\n function meridiem (token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n // ALIASES\n\n addUnitAlias('hour', 'h');\n\n // PARSING\n\n function matchMeridiem (isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n\n // LOCALES\n\n function localeIsPM (input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return ((input + '').toLowerCase().charAt(0) === 'p');\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n function localeMeridiem (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n\n // MOMENTS\n\n // Setting the hour should keep the time, because the user explicitly\n // specified which hour he wants. So trying to maintain the same hour (in\n // a new timezone) makes sense. Adding/subtracting hours does not follow\n // this rule.\n var getSetHour = makeGetSet('Hours', true);\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n // ALIASES\n\n addUnitAlias('minute', 'm');\n\n // PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n // MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n // ALIASES\n\n addUnitAlias('second', 's');\n\n // PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n // MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n\n // ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n // PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n // MOMENTS\n\n var getSetMillisecond = makeGetSet('Milliseconds', false);\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n // MOMENTS\n\n function getZoneAbbr () {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName () {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var momentPrototype__proto = Moment.prototype;\n\n momentPrototype__proto.add = add_subtract__add;\n momentPrototype__proto.calendar = moment_calendar__calendar;\n momentPrototype__proto.clone = clone;\n momentPrototype__proto.diff = diff;\n momentPrototype__proto.endOf = endOf;\n momentPrototype__proto.format = format;\n momentPrototype__proto.from = from;\n momentPrototype__proto.fromNow = fromNow;\n momentPrototype__proto.to = to;\n momentPrototype__proto.toNow = toNow;\n momentPrototype__proto.get = getSet;\n momentPrototype__proto.invalidAt = invalidAt;\n momentPrototype__proto.isAfter = isAfter;\n momentPrototype__proto.isBefore = isBefore;\n momentPrototype__proto.isBetween = isBetween;\n momentPrototype__proto.isSame = isSame;\n momentPrototype__proto.isValid = moment_valid__isValid;\n momentPrototype__proto.lang = lang;\n momentPrototype__proto.locale = locale;\n momentPrototype__proto.localeData = localeData;\n momentPrototype__proto.max = prototypeMax;\n momentPrototype__proto.min = prototypeMin;\n momentPrototype__proto.parsingFlags = parsingFlags;\n momentPrototype__proto.set = getSet;\n momentPrototype__proto.startOf = startOf;\n momentPrototype__proto.subtract = add_subtract__subtract;\n momentPrototype__proto.toArray = toArray;\n momentPrototype__proto.toObject = toObject;\n momentPrototype__proto.toDate = toDate;\n momentPrototype__proto.toISOString = moment_format__toISOString;\n momentPrototype__proto.toJSON = moment_format__toISOString;\n momentPrototype__proto.toString = toString;\n momentPrototype__proto.unix = unix;\n momentPrototype__proto.valueOf = to_type__valueOf;\n\n // Year\n momentPrototype__proto.year = getSetYear;\n momentPrototype__proto.isLeapYear = getIsLeapYear;\n\n // Week Year\n momentPrototype__proto.weekYear = getSetWeekYear;\n momentPrototype__proto.isoWeekYear = getSetISOWeekYear;\n\n // Quarter\n momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;\n\n // Month\n momentPrototype__proto.month = getSetMonth;\n momentPrototype__proto.daysInMonth = getDaysInMonth;\n\n // Week\n momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;\n momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;\n momentPrototype__proto.weeksInYear = getWeeksInYear;\n momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;\n\n // Day\n momentPrototype__proto.date = getSetDayOfMonth;\n momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;\n momentPrototype__proto.weekday = getSetLocaleDayOfWeek;\n momentPrototype__proto.isoWeekday = getSetISODayOfWeek;\n momentPrototype__proto.dayOfYear = getSetDayOfYear;\n\n // Hour\n momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;\n\n // Minute\n momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;\n\n // Second\n momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;\n\n // Millisecond\n momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;\n\n // Offset\n momentPrototype__proto.utcOffset = getSetOffset;\n momentPrototype__proto.utc = setOffsetToUTC;\n momentPrototype__proto.local = setOffsetToLocal;\n momentPrototype__proto.parseZone = setOffsetToParsedOffset;\n momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;\n momentPrototype__proto.isDST = isDaylightSavingTime;\n momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted;\n momentPrototype__proto.isLocal = isLocal;\n momentPrototype__proto.isUtcOffset = isUtcOffset;\n momentPrototype__proto.isUtc = isUtc;\n momentPrototype__proto.isUTC = isUtc;\n\n // Timezone\n momentPrototype__proto.zoneAbbr = getZoneAbbr;\n momentPrototype__proto.zoneName = getZoneName;\n\n // Deprecations\n momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);\n\n var momentPrototype = momentPrototype__proto;\n\n function moment__createUnix (input) {\n return local__createLocal(input * 1000);\n }\n\n function moment__createInZone () {\n return local__createLocal.apply(null, arguments).parseZone();\n }\n\n var defaultCalendar = {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n };\n\n function locale_calendar__calendar (key, mom, now) {\n var output = this._calendar[key];\n return typeof output === 'function' ? output.call(mom, now) : output;\n }\n\n var defaultLongDateFormat = {\n LTS : 'h:mm:ss A',\n LT : 'h:mm A',\n L : 'MM/DD/YYYY',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY h:mm A',\n LLLL : 'dddd, MMMM D, YYYY h:mm A'\n };\n\n function longDateFormat (key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate () {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d';\n var defaultOrdinalParse = /\\d{1,2}/;\n\n function ordinal (number) {\n return this._ordinal.replace('%d', number);\n }\n\n function preParsePostFormat (string) {\n return string;\n }\n\n var defaultRelativeTime = {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n };\n\n function relative__relativeTime (number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return (typeof output === 'function') ?\n output(number, withoutSuffix, string, isFuture) :\n output.replace(/%d/i, number);\n }\n\n function pastFuture (diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return typeof format === 'function' ? format(output) : format.replace(/%s/i, output);\n }\n\n function locale_set__set (config) {\n var prop, i;\n for (i in config) {\n prop = config[i];\n if (typeof prop === 'function') {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _ordinalParseLenient.\n this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\\d{1,2}/).source);\n }\n\n var prototype__proto = Locale.prototype;\n\n prototype__proto._calendar = defaultCalendar;\n prototype__proto.calendar = locale_calendar__calendar;\n prototype__proto._longDateFormat = defaultLongDateFormat;\n prototype__proto.longDateFormat = longDateFormat;\n prototype__proto._invalidDate = defaultInvalidDate;\n prototype__proto.invalidDate = invalidDate;\n prototype__proto._ordinal = defaultOrdinal;\n prototype__proto.ordinal = ordinal;\n prototype__proto._ordinalParse = defaultOrdinalParse;\n prototype__proto.preparse = preParsePostFormat;\n prototype__proto.postformat = preParsePostFormat;\n prototype__proto._relativeTime = defaultRelativeTime;\n prototype__proto.relativeTime = relative__relativeTime;\n prototype__proto.pastFuture = pastFuture;\n prototype__proto.set = locale_set__set;\n\n // Month\n prototype__proto.months = localeMonths;\n prototype__proto._months = defaultLocaleMonths;\n prototype__proto.monthsShort = localeMonthsShort;\n prototype__proto._monthsShort = defaultLocaleMonthsShort;\n prototype__proto.monthsParse = localeMonthsParse;\n\n // Week\n prototype__proto.week = localeWeek;\n prototype__proto._week = defaultLocaleWeek;\n prototype__proto.firstDayOfYear = localeFirstDayOfYear;\n prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;\n\n // Day of Week\n prototype__proto.weekdays = localeWeekdays;\n prototype__proto._weekdays = defaultLocaleWeekdays;\n prototype__proto.weekdaysMin = localeWeekdaysMin;\n prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin;\n prototype__proto.weekdaysShort = localeWeekdaysShort;\n prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;\n prototype__proto.weekdaysParse = localeWeekdaysParse;\n\n // Hours\n prototype__proto.isPM = localeIsPM;\n prototype__proto._meridiemParse = defaultLocaleMeridiemParse;\n prototype__proto.meridiem = localeMeridiem;\n\n function lists__get (format, index, field, setter) {\n var locale = locale_locales__getLocale();\n var utc = create_utc__createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function list (format, index, field, count, setter) {\n if (typeof format === 'number') {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return lists__get(format, index, field, setter);\n }\n\n var i;\n var out = [];\n for (i = 0; i < count; i++) {\n out[i] = lists__get(format, i, field, setter);\n }\n return out;\n }\n\n function lists__listMonths (format, index) {\n return list(format, index, 'months', 12, 'month');\n }\n\n function lists__listMonthsShort (format, index) {\n return list(format, index, 'monthsShort', 12, 'month');\n }\n\n function lists__listWeekdays (format, index) {\n return list(format, index, 'weekdays', 7, 'day');\n }\n\n function lists__listWeekdaysShort (format, index) {\n return list(format, index, 'weekdaysShort', 7, 'day');\n }\n\n function lists__listWeekdaysMin (format, index) {\n return list(format, index, 'weekdaysMin', 7, 'day');\n }\n\n locale_locales__getSetGlobalLocale('en', {\n ordinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (toInt(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n }\n });\n\n // Side effect imports\n utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);\n utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);\n\n var mathAbs = Math.abs;\n\n function duration_abs__abs () {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function duration_add_subtract__addSubtract (duration, input, value, direction) {\n var other = create__createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n // supports only 2.0-style add(1, 's') or add(duration)\n function duration_add_subtract__add (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, 1);\n }\n\n // supports only 2.0-style subtract(1, 's') or subtract(duration)\n function duration_add_subtract__subtract (input, value) {\n return duration_add_subtract__addSubtract(this, input, value, -1);\n }\n\n function absCeil (number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble () {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0))) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths (days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n\n function monthsToDays (months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n\n function as (units) {\n var days;\n var months;\n var milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n return units === 'month' ? months : months / 12;\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week' : return days / 7 + milliseconds / 6048e5;\n case 'day' : return days + milliseconds / 864e5;\n case 'hour' : return days * 24 + milliseconds / 36e5;\n case 'minute' : return days * 1440 + milliseconds / 6e4;\n case 'second' : return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond': return Math.floor(days * 864e5) + milliseconds;\n default: throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n // TODO: Use this.as('ms')?\n function duration_as__valueOf () {\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs (alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms');\n var asSeconds = makeAs('s');\n var asMinutes = makeAs('m');\n var asHours = makeAs('h');\n var asDays = makeAs('d');\n var asWeeks = makeAs('w');\n var asMonths = makeAs('M');\n var asYears = makeAs('y');\n\n function duration_get__get (units) {\n units = normalizeUnits(units);\n return this[units + 's']();\n }\n\n function makeGetter(name) {\n return function () {\n return this._data[name];\n };\n }\n\n var milliseconds = makeGetter('milliseconds');\n var seconds = makeGetter('seconds');\n var minutes = makeGetter('minutes');\n var hours = makeGetter('hours');\n var days = makeGetter('days');\n var months = makeGetter('months');\n var years = makeGetter('years');\n\n function weeks () {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round;\n var thresholds = {\n s: 45, // seconds to minute\n m: 45, // minutes to hour\n h: 22, // hours to day\n d: 26, // days to month\n M: 11 // months to year\n };\n\n // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {\n var duration = create__createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n\n var a = seconds < thresholds.s && ['s', seconds] ||\n minutes === 1 && ['m'] ||\n minutes < thresholds.m && ['mm', minutes] ||\n hours === 1 && ['h'] ||\n hours < thresholds.h && ['hh', hours] ||\n days === 1 && ['d'] ||\n days < thresholds.d && ['dd', days] ||\n months === 1 && ['M'] ||\n months < thresholds.M && ['MM', months] ||\n years === 1 && ['y'] || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n // This function allows you to set a threshold for relative time strings\n function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n return true;\n }\n\n function humanize (withSuffix) {\n var locale = this.localeData();\n var output = duration_humanize__relativeTime(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var iso_string__abs = Math.abs;\n\n function iso_string__toISOString() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n var seconds = iso_string__abs(this._milliseconds) / 1000;\n var days = iso_string__abs(this._days);\n var months = iso_string__abs(this._months);\n var minutes, hours, years;\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds;\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n return (total < 0 ? '-' : '') +\n 'P' +\n (Y ? Y + 'Y' : '') +\n (M ? M + 'M' : '') +\n (D ? D + 'D' : '') +\n ((h || m || s) ? 'T' : '') +\n (h ? h + 'H' : '') +\n (m ? m + 'M' : '') +\n (s ? s + 'S' : '');\n }\n\n var duration_prototype__proto = Duration.prototype;\n\n duration_prototype__proto.abs = duration_abs__abs;\n duration_prototype__proto.add = duration_add_subtract__add;\n duration_prototype__proto.subtract = duration_add_subtract__subtract;\n duration_prototype__proto.as = as;\n duration_prototype__proto.asMilliseconds = asMilliseconds;\n duration_prototype__proto.asSeconds = asSeconds;\n duration_prototype__proto.asMinutes = asMinutes;\n duration_prototype__proto.asHours = asHours;\n duration_prototype__proto.asDays = asDays;\n duration_prototype__proto.asWeeks = asWeeks;\n duration_prototype__proto.asMonths = asMonths;\n duration_prototype__proto.asYears = asYears;\n duration_prototype__proto.valueOf = duration_as__valueOf;\n duration_prototype__proto._bubble = bubble;\n duration_prototype__proto.get = duration_get__get;\n duration_prototype__proto.milliseconds = milliseconds;\n duration_prototype__proto.seconds = seconds;\n duration_prototype__proto.minutes = minutes;\n duration_prototype__proto.hours = hours;\n duration_prototype__proto.days = days;\n duration_prototype__proto.weeks = weeks;\n duration_prototype__proto.months = months;\n duration_prototype__proto.years = years;\n duration_prototype__proto.humanize = humanize;\n duration_prototype__proto.toISOString = iso_string__toISOString;\n duration_prototype__proto.toString = iso_string__toISOString;\n duration_prototype__proto.toJSON = iso_string__toISOString;\n duration_prototype__proto.locale = locale;\n duration_prototype__proto.localeData = localeData;\n\n // Deprecations\n duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);\n duration_prototype__proto.lang = lang;\n\n // Side effect imports\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n // PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n // Side effect imports\n\n\n utils_hooks__hooks.version = '2.10.6';\n\n setHookCallback(local__createLocal);\n\n utils_hooks__hooks.fn = momentPrototype;\n utils_hooks__hooks.min = min;\n utils_hooks__hooks.max = max;\n utils_hooks__hooks.utc = create_utc__createUTC;\n utils_hooks__hooks.unix = moment__createUnix;\n utils_hooks__hooks.months = lists__listMonths;\n utils_hooks__hooks.isDate = isDate;\n utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;\n utils_hooks__hooks.invalid = valid__createInvalid;\n utils_hooks__hooks.duration = create__createDuration;\n utils_hooks__hooks.isMoment = isMoment;\n utils_hooks__hooks.weekdays = lists__listWeekdays;\n utils_hooks__hooks.parseZone = moment__createInZone;\n utils_hooks__hooks.localeData = locale_locales__getLocale;\n utils_hooks__hooks.isDuration = isDuration;\n utils_hooks__hooks.monthsShort = lists__listMonthsShort;\n utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;\n utils_hooks__hooks.defineLocale = defineLocale;\n utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;\n utils_hooks__hooks.normalizeUnits = normalizeUnits;\n utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;\n\n var _moment = utils_hooks__hooks;\n\n return _moment;\n\n}));\n(function (root, factory) {\n 'use strict';\n\n if (typeof define === 'function' && define.amd) {\n define(['angular'], factory);\n } else if (root.hasOwnProperty('angular')) {\n // Browser globals (root is window), we don't register it.\n factory(root.angular);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('angular'));\n }\n}(this , function (angular) {\n 'use strict';\n\n // In cases where Angular does not get passed or angular is a truthy value\n // but misses .module we can fall back to using window.\n angular = (angular && angular.module ) ? angular : window.angular;\n\n /**\n * @ngdoc overview\n * @name ngStorage\n */\n\n return angular.module('ngStorage', [])\n\n /**\n * @ngdoc object\n * @name ngStorage.$localStorage\n * @requires $rootScope\n * @requires $window\n */\n\n .provider('$localStorage', _storageProvider('localStorage'))\n\n /**\n * @ngdoc object\n * @name ngStorage.$sessionStorage\n * @requires $rootScope\n * @requires $window\n */\n\n .provider('$sessionStorage', _storageProvider('sessionStorage'));\n\n function _storageProvider(storageType) {\n return function () {\n var storageKeyPrefix = 'ngStorage-';\n\n this.setKeyPrefix = function (prefix) {\n if (typeof prefix !== 'string') {\n throw new TypeError('[ngStorage] - ' + storageType + 'Provider.setKeyPrefix() expects a String.');\n }\n storageKeyPrefix = prefix;\n };\n\n var serializer = angular.toJson;\n var deserializer = angular.fromJson;\n\n this.setSerializer = function (s) {\n if (typeof s !== 'function') {\n throw new TypeError('[ngStorage] - ' + storageType + 'Provider.setSerializer expects a function.');\n }\n\n serializer = s;\n };\n\n this.setDeserializer = function (d) {\n if (typeof d !== 'function') {\n throw new TypeError('[ngStorage] - ' + storageType + 'Provider.setDeserializer expects a function.');\n }\n\n deserializer = d;\n };\n\n // Note: This is not very elegant at all.\n this.get = function (key) {\n return deserializer(window[storageType].getItem(storageKeyPrefix + key));\n };\n\n // Note: This is not very elegant at all.\n this.set = function (key, value) {\n return window[storageType].setItem(storageKeyPrefix + key, serializer(value));\n };\n\n this.$get = [\n '$rootScope',\n '$window',\n '$log',\n '$timeout',\n '$document',\n\n function(\n $rootScope,\n $window,\n $log,\n $timeout,\n $document\n ){\n function isStorageSupported(storageType) {\n\n // Some installations of IE, for an unknown reason, throw \"SCRIPT5: Error: Access is denied\"\n // when accessing window.localStorage. This happens before you try to do anything with it. Catch\n // that error and allow execution to continue.\n\n // fix 'SecurityError: DOM Exception 18' exception in Desktop Safari, Mobile Safari\n // when \"Block cookies\": \"Always block\" is turned on\n var supported;\n try {\n supported = $window[storageType];\n }\n catch (err) {\n supported = false;\n }\n\n // When Safari (OS X or iOS) is in private browsing mode, it appears as though localStorage\n // is available, but trying to call .setItem throws an exception below:\n // \"QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.\"\n if (supported && storageType === 'localStorage') {\n var key = '__' + Math.round(Math.random() * 1e7);\n\n try {\n localStorage.setItem(key, key);\n localStorage.removeItem(key);\n }\n catch (err) {\n supported = false;\n }\n }\n\n return supported;\n }\n\n // The magic number 10 is used which only works for some keyPrefixes...\n // See https://github.com/gsklee/ngStorage/issues/137\n var prefixLength = storageKeyPrefix.length;\n\n // #9: Assign a placeholder object if Web Storage is unavailable to prevent breaking the entire AngularJS app\n var webStorage = isStorageSupported(storageType) || ($log.warn('This browser does not support Web Storage!'), {setItem: angular.noop, getItem: angular.noop, removeItem: angular.noop}),\n $storage = {\n $default: function(items) {\n for (var k in items) {\n angular.isDefined($storage[k]) || ($storage[k] = angular.copy(items[k]) );\n }\n\n $storage.$sync();\n return $storage;\n },\n $reset: function(items) {\n for (var k in $storage) {\n '$' === k[0] || (delete $storage[k] && webStorage.removeItem(storageKeyPrefix + k));\n }\n\n return $storage.$default(items);\n },\n $sync: function () {\n for (var i = 0, l = webStorage.length, k; i < l; i++) {\n // #8, #10: `webStorage.key(i)` may be an empty string (or throw an exception in IE9 if `webStorage` is empty)\n (k = webStorage.key(i)) && storageKeyPrefix === k.slice(0, prefixLength) && ($storage[k.slice(prefixLength)] = deserializer(webStorage.getItem(k)));\n }\n },\n $apply: function() {\n var temp$storage;\n\n _debounce = null;\n\n if (!angular.equals($storage, _last$storage)) {\n temp$storage = angular.copy(_last$storage);\n angular.forEach($storage, function(v, k) {\n if (angular.isDefined(v) && '$' !== k[0]) {\n webStorage.setItem(storageKeyPrefix + k, serializer(v));\n delete temp$storage[k];\n }\n });\n\n for (var k in temp$storage) {\n webStorage.removeItem(storageKeyPrefix + k);\n }\n\n _last$storage = angular.copy($storage);\n }\n }\n },\n _last$storage,\n _debounce;\n\n $storage.$sync();\n\n _last$storage = angular.copy($storage);\n\n $rootScope.$watch(function() {\n _debounce || (_debounce = $timeout($storage.$apply, 100, false));\n });\n\n // #6: Use `$window.addEventListener` instead of `angular.element` to avoid the jQuery-specific `event.originalEvent`\n $window.addEventListener && $window.addEventListener('storage', function(event) {\n if (!event.key) {\n return;\n }\n\n // Reference doc.\n var doc = $document[0];\n\n if ( (!doc.hasFocus || !doc.hasFocus()) && storageKeyPrefix === event.key.slice(0, prefixLength) ) {\n event.newValue ? $storage[event.key.slice(prefixLength)] = deserializer(event.newValue) : delete $storage[event.key.slice(prefixLength)];\n\n _last$storage = angular.copy($storage);\n\n $rootScope.$apply();\n }\n });\n\n $window.addEventListener && $window.addEventListener('beforeunload', function() {\n $storage.$apply();\n });\n\n return $storage;\n }\n ];\n };\n }\n\n}));\n\n/* angular-moment.js / v0.10.3 / (c) 2013, 2014, 2015 Uri Shaked / MIT Licence */\n\n'format amd';\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tfunction angularMoment(angular, moment) {\n\n\t\t/**\n\t\t * @ngdoc overview\n\t\t * @name angularMoment\n\t\t *\n\t\t * @description\n\t\t * angularMoment module provides moment.js functionality for angular.js apps.\n\t\t */\n\t\treturn angular.module('angularMoment', [])\n\n\t\t/**\n\t\t * @ngdoc object\n\t\t * @name angularMoment.config:angularMomentConfig\n\t\t *\n\t\t * @description\n\t\t * Common configuration of the angularMoment module\n\t\t */\n\t\t\t.constant('angularMomentConfig', {\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.angularMomentConfig#preprocess\n\t\t\t\t * @propertyOf angularMoment.config:angularMomentConfig\n\t\t\t\t * @returns {string} The default preprocessor to apply\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Defines a default preprocessor to apply (e.g. 'unix', 'etc', ...). The default value is null,\n\t\t\t\t * i.e. no preprocessor will be applied.\n\t\t\t\t */\n\t\t\t\tpreprocess: null, // e.g. 'unix', 'utc', ...\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.angularMomentConfig#timezone\n\t\t\t\t * @propertyOf angularMoment.config:angularMomentConfig\n\t\t\t\t * @returns {string} The default timezone\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * The default timezone (e.g. 'Europe/London'). Empty string by default (does not apply\n\t\t\t\t * any timezone shift).\n\t\t\t\t */\n\t\t\t\ttimezone: '',\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.angularMomentConfig#format\n\t\t\t\t * @propertyOf angularMoment.config:angularMomentConfig\n\t\t\t\t * @returns {string} The pre-conversion format of the date\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Specify the format of the input date. Essentially it's a\n\t\t\t\t * default and saves you from specifying a format in every\n\t\t\t\t * element. Overridden by element attr. Null by default.\n\t\t\t\t */\n\t\t\t\tformat: null,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.angularMomentConfig#statefulFilters\n\t\t\t\t * @propertyOf angularMoment.config:angularMomentConfig\n\t\t\t\t * @returns {boolean} Whether angular-moment filters should be stateless (or not)\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Specifies whether the filters included with angular-moment are stateful.\n\t\t\t\t * Stateful filters will automatically re-evaluate whenever you change the timezone\n\t\t\t\t * or language settings, but may negatively impact performance. true by default.\n\t\t\t\t */\n\t\t\t\tstatefulFilters: true\n\t\t\t})\n\n\t\t/**\n\t\t * @ngdoc object\n\t\t * @name angularMoment.object:moment\n\t\t *\n\t\t * @description\n\t\t * moment global (as provided by the moment.js library)\n\t\t */\n\t\t\t.constant('moment', moment)\n\n\t\t/**\n\t\t * @ngdoc object\n\t\t * @name angularMoment.config:amTimeAgoConfig\n\t\t * @module angularMoment\n\t\t *\n\t\t * @description\n\t\t * configuration specific to the amTimeAgo directive\n\t\t */\n\t\t\t.constant('amTimeAgoConfig', {\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#withoutSuffix\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {boolean} Whether to include a suffix in am-time-ago directive\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Defaults to false.\n\t\t\t\t */\n\t\t\t\twithoutSuffix: false,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#serverTime\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {number} Server time in milliseconds since the epoch\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * If set, time ago will be calculated relative to the given value.\n\t\t\t\t * If null, local time will be used. Defaults to null.\n\t\t\t\t */\n\t\t\t\tserverTime: null,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#titleFormat\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {string} The format of the date to be displayed in the title of the element. If null,\n\t\t\t\t * the directive set the title of the element.\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * The format of the date used for the title of the element. null by default.\n\t\t\t\t */\n\t\t\t\ttitleFormat: null,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#fullDateThreshold\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {number} The minimum number of days for showing a full date instead of relative time\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * The threshold for displaying a full date. The default is null, which means the date will always\n\t\t\t\t * be relative, and full date will never be displayed.\n\t\t\t\t */\n\t\t\t\tfullDateThreshold: null,\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment.config.amTimeAgoConfig#fullDateFormat\n\t\t\t\t * @propertyOf angularMoment.config:amTimeAgoConfig\n\t\t\t\t * @returns {string} The format to use when displaying a full date.\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Specify the format of the date when displayed as full date. null by default.\n\t\t\t\t */\n\t\t\t\tfullDateFormat: null\n\t\t\t})\n\n\t\t/**\n\t\t * @ngdoc directive\n\t\t * @name angularMoment.directive:amTimeAgo\n\t\t * @module angularMoment\n\t\t *\n\t\t * @restrict A\n\t\t */\n\t\t\t.directive('amTimeAgo', ['$window', 'moment', 'amMoment', 'amTimeAgoConfig', 'angularMomentConfig', function ($window, moment, amMoment, amTimeAgoConfig, angularMomentConfig) {\n\n\t\t\t\treturn function (scope, element, attr) {\n\t\t\t\t\tvar activeTimeout = null;\n\t\t\t\t\tvar currentValue;\n\t\t\t\t\tvar currentFormat = angularMomentConfig.format;\n\t\t\t\t\tvar withoutSuffix = amTimeAgoConfig.withoutSuffix;\n\t\t\t\t\tvar titleFormat = amTimeAgoConfig.titleFormat;\n\t\t\t\t\tvar fullDateThreshold = amTimeAgoConfig.fullDateThreshold;\n\t\t\t\t\tvar fullDateFormat = amTimeAgoConfig.fullDateFormat;\n\t\t\t\t\tvar localDate = new Date().getTime();\n\t\t\t\t\tvar preprocess = angularMomentConfig.preprocess;\n\t\t\t\t\tvar modelName = attr.amTimeAgo;\n\t\t\t\t\tvar currentFrom;\n\t\t\t\t\tvar isTimeElement = ('TIME' === element[0].nodeName.toUpperCase());\n\n\t\t\t\t\tfunction getNow() {\n\t\t\t\t\t\tvar now;\n\t\t\t\t\t\tif (currentFrom) {\n\t\t\t\t\t\t\tnow = currentFrom;\n\t\t\t\t\t\t} else if (amTimeAgoConfig.serverTime) {\n\t\t\t\t\t\t\tvar localNow = new Date().getTime();\n\t\t\t\t\t\t\tvar nowMillis = localNow - localDate + amTimeAgoConfig.serverTime;\n\t\t\t\t\t\t\tnow = moment(nowMillis);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnow = moment();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn now;\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction cancelTimer() {\n\t\t\t\t\t\tif (activeTimeout) {\n\t\t\t\t\t\t\t$window.clearTimeout(activeTimeout);\n\t\t\t\t\t\t\tactiveTimeout = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction updateTime(momentInstance) {\n\t\t\t\t\t\tvar daysAgo = getNow().diff(momentInstance, 'day');\n\t\t\t\t\t\tvar showFullDate = fullDateThreshold && daysAgo >= fullDateThreshold;\n\n\t\t\t\t\t\tif (showFullDate) {\n\t\t\t\t\t\t\telement.text(momentInstance.format(fullDateFormat));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telement.text(momentInstance.from(getNow(), withoutSuffix));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (titleFormat && !element.attr('title')) {\n\t\t\t\t\t\t\telement.attr('title', momentInstance.local().format(titleFormat));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!showFullDate) {\n\t\t\t\t\t\t\tvar howOld = Math.abs(getNow().diff(momentInstance, 'minute'));\n\t\t\t\t\t\t\tvar secondsUntilUpdate = 3600;\n\t\t\t\t\t\t\tif (howOld < 1) {\n\t\t\t\t\t\t\t\tsecondsUntilUpdate = 1;\n\t\t\t\t\t\t\t} else if (howOld < 60) {\n\t\t\t\t\t\t\t\tsecondsUntilUpdate = 30;\n\t\t\t\t\t\t\t} else if (howOld < 180) {\n\t\t\t\t\t\t\t\tsecondsUntilUpdate = 300;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tactiveTimeout = $window.setTimeout(function () {\n\t\t\t\t\t\t\t\tupdateTime(momentInstance);\n\t\t\t\t\t\t\t}, secondsUntilUpdate * 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction updateDateTimeAttr(value) {\n\t\t\t\t\t\tif (isTimeElement) {\n\t\t\t\t\t\t\telement.attr('datetime', value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction updateMoment() {\n\t\t\t\t\t\tcancelTimer();\n\t\t\t\t\t\tif (currentValue) {\n\t\t\t\t\t\t\tvar momentValue = amMoment.preprocessDate(currentValue, preprocess, currentFormat);\n\t\t\t\t\t\t\tupdateTime(momentValue);\n\t\t\t\t\t\t\tupdateDateTimeAttr(momentValue.toISOString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.$watch(modelName, function (value) {\n\t\t\t\t\t\tif ((typeof value === 'undefined') || (value === null) || (value === '')) {\n\t\t\t\t\t\t\tcancelTimer();\n\t\t\t\t\t\t\tif (currentValue) {\n\t\t\t\t\t\t\t\telement.text('');\n\t\t\t\t\t\t\t\tupdateDateTimeAttr('');\n\t\t\t\t\t\t\t\tcurrentValue = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentValue = value;\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\n\t\t\t\t\tif (angular.isDefined(attr.amFrom)) {\n\t\t\t\t\t\tscope.$watch(attr.amFrom, function (value) {\n\t\t\t\t\t\t\tif ((typeof value === 'undefined') || (value === null) || (value === '')) {\n\t\t\t\t\t\t\t\tcurrentFrom = null;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcurrentFrom = moment(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (angular.isDefined(attr.amWithoutSuffix)) {\n\t\t\t\t\t\tscope.$watch(attr.amWithoutSuffix, function (value) {\n\t\t\t\t\t\t\tif (typeof value === 'boolean') {\n\t\t\t\t\t\t\t\twithoutSuffix = value;\n\t\t\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twithoutSuffix = amTimeAgoConfig.withoutSuffix;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tattr.$observe('amFormat', function (format) {\n\t\t\t\t\t\tif (typeof format !== 'undefined') {\n\t\t\t\t\t\t\tcurrentFormat = format;\n\t\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tattr.$observe('amPreprocess', function (newValue) {\n\t\t\t\t\t\tpreprocess = newValue;\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\n\t\t\t\t\tattr.$observe('amFullDateThreshold', function (newValue) {\n\t\t\t\t\t\tfullDateThreshold = newValue;\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\n\t\t\t\t\tattr.$observe('amFullDateFormat', function (newValue) {\n\t\t\t\t\t\tfullDateFormat = newValue;\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\n\t\t\t\t\tscope.$on('$destroy', function () {\n\t\t\t\t\t\tcancelTimer();\n\t\t\t\t\t});\n\n\t\t\t\t\tscope.$on('amMoment:localeChanged', function () {\n\t\t\t\t\t\tupdateMoment();\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc service\n\t\t * @name angularMoment.service.amMoment\n\t\t * @module angularMoment\n\t\t */\n\t\t\t.service('amMoment', ['moment', '$rootScope', '$log', 'angularMomentConfig', function (moment, $rootScope, $log, angularMomentConfig) {\n\t\t\t\t/**\n\t\t\t\t * @ngdoc property\n\t\t\t\t * @name angularMoment:amMoment#preprocessors\n\t\t\t\t * @module angularMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Defines the preprocessors for the preprocessDate method. By default, the following preprocessors\n\t\t\t\t * are defined: utc, unix.\n\t\t\t\t */\n\t\t\t\tthis.preprocessors = {\n\t\t\t\t\tutc: moment.utc,\n\t\t\t\t\tunix: moment.unix\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc function\n\t\t\t\t * @name angularMoment.service.amMoment#changeLocale\n\t\t\t\t * @methodOf angularMoment.service.amMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Changes the locale for moment.js and updates all the am-time-ago directive instances\n\t\t\t\t * with the new locale. Also broadcasts an `amMoment:localeChanged` event on $rootScope.\n\t\t\t\t *\n\t\t\t\t * @param {string} locale Locale code (e.g. en, es, ru, pt-br, etc.)\n\t\t\t\t * @param {object} customization object of locale strings to override\n\t\t\t\t */\n\t\t\t\tthis.changeLocale = function (locale, customization) {\n\t\t\t\t\tvar result = moment.locale(locale, customization);\n\t\t\t\t\tif (angular.isDefined(locale)) {\n\t\t\t\t\t\t$rootScope.$broadcast('amMoment:localeChanged');\n\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc function\n\t\t\t\t * @name angularMoment.service.amMoment#changeTimezone\n\t\t\t\t * @methodOf angularMoment.service.amMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Changes the default timezone for amCalendar, amDateFormat and amTimeAgo. Also broadcasts an\n\t\t\t\t * `amMoment:timezoneChanged` event on $rootScope.\n\t\t\t\t *\n\t\t\t\t * @param {string} timezone Timezone name (e.g. UTC)\n\t\t\t\t */\n\t\t\t\tthis.changeTimezone = function (timezone) {\n\t\t\t\t\tangularMomentConfig.timezone = timezone;\n\t\t\t\t\t$rootScope.$broadcast('amMoment:timezoneChanged');\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc function\n\t\t\t\t * @name angularMoment.service.amMoment#preprocessDate\n\t\t\t\t * @methodOf angularMoment.service.amMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Preprocess a given value and convert it into a Moment instance appropriate for use in the\n\t\t\t\t * am-time-ago directive and the filters.\n\t\t\t\t *\n\t\t\t\t * @param {*} value The value to be preprocessed\n\t\t\t\t * @param {string} preprocess The name of the preprocessor the apply (e.g. utc, unix)\n\t\t\t\t * @param {string=} format Specifies how to parse the value (see {@link http://momentjs.com/docs/#/parsing/string-format/})\n\t\t\t\t * @return {Moment} A value that can be parsed by the moment library\n\t\t\t\t */\n\t\t\t\tthis.preprocessDate = function (value, preprocess, format) {\n\t\t\t\t\tif (angular.isUndefined(preprocess)) {\n\t\t\t\t\t\tpreprocess = angularMomentConfig.preprocess;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.preprocessors[preprocess]) {\n\t\t\t\t\t\treturn this.preprocessors[preprocess](value, format);\n\t\t\t\t\t}\n\t\t\t\t\tif (preprocess) {\n\t\t\t\t\t\t$log.warn('angular-moment: Ignoring unsupported value for preprocess: ' + preprocess);\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(parseFloat(value)) && isFinite(value)) {\n\t\t\t\t\t\t// Milliseconds since the epoch\n\t\t\t\t\t\treturn moment(parseInt(value, 10));\n\t\t\t\t\t}\n\t\t\t\t\t// else just returns the value as-is.\n\t\t\t\t\treturn moment(value, format);\n\t\t\t\t};\n\n\t\t\t\t/**\n\t\t\t\t * @ngdoc function\n\t\t\t\t * @name angularMoment.service.amMoment#applyTimezone\n\t\t\t\t * @methodOf angularMoment.service.amMoment\n\t\t\t\t *\n\t\t\t\t * @description\n\t\t\t\t * Apply a timezone onto a given moment object. It can be a named timezone (e.g. 'America/Phoenix') or an offset from UTC (e.g. '+0300')\n\t\t\t\t * moment-timezone.js is needed when a named timezone is used, otherwise, it'll not apply any timezone shift.\n\t\t\t\t *\n\t\t\t\t * @param {Moment} aMoment a moment() instance to apply the timezone shift to\n\t\t\t\t * @param {string=} timezone The timezone to apply. If none given, will apply the timezone\n\t\t\t\t * configured in angularMomentConfig.timezone. It can be a named timezone (e.g. 'America/Phoenix') or an offset from UTC (e.g. '+0300')\n\t\t\t\t *\n\t\t\t\t * @returns {Moment} The given moment with the timezone shift applied\n\t\t\t\t */\n\t\t\t\tthis.applyTimezone = function (aMoment, timezone) {\n\t\t\t\t\ttimezone = timezone || angularMomentConfig.timezone;\n\t\t\t\t\tif (!timezone) {\n\t\t\t\t\t\treturn aMoment;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (timezone.match(/^Z|[+-]\\d\\d:?\\d\\d$/i)) {\n\t\t\t\t\t\taMoment = aMoment.utcOffset(timezone);\n\t\t\t\t\t} else if (aMoment.tz) {\n\t\t\t\t\t\taMoment = aMoment.tz(timezone);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$log.warn('angular-moment: named timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn aMoment;\n\t\t\t\t};\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amCalendar\n\t\t * @module angularMoment\n\t\t */\n\t\t\t.filter('amCalendar', ['moment', 'amMoment', 'angularMomentConfig', function (moment, amMoment, angularMomentConfig) {\n\t\t\t\tfunction amCalendarFilter(value, preprocess, timezone) {\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = amMoment.preprocessDate(value, preprocess);\n\t\t\t\t\tvar date = moment(value);\n\t\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn amMoment.applyTimezone(date, timezone).calendar();\n\t\t\t\t}\n\n\t\t\t\t// Since AngularJS 1.3, filters have to explicitly define being stateful\n\t\t\t\t// (this is no longer the default).\n\t\t\t\tamCalendarFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amCalendarFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amDifference\n\t\t * @module angularMoment\n\t\t */\n\t\t\t.filter('amDifference', ['moment', 'amMoment', 'angularMomentConfig', function (moment, amMoment, angularMomentConfig) {\n\t\t\t\tfunction amDifferenceFilter(value, otherValue, unit, usePrecision, preprocessValue, preprocessOtherValue) {\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = amMoment.preprocessDate(value, preprocessValue);\n\t\t\t\t\tvar date = moment(value);\n\t\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar date2;\n\t\t\t\t\tif (typeof otherValue === 'undefined' || otherValue === null) {\n\t\t\t\t\t\tdate2 = moment();\n\t\t\t\t\t} else {\n\t\t\t\t\t\totherValue = amMoment.preprocessDate(otherValue, preprocessOtherValue);\n\t\t\t\t\t\tdate2 = moment(otherValue);\n\t\t\t\t\t\tif (!date2.isValid()) {\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn amMoment.applyTimezone(date).diff(amMoment.applyTimezone(date2), unit, usePrecision);\n\t\t\t\t}\n\n\t\t\t\tamDifferenceFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amDifferenceFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amDateFormat\n\t\t * @module angularMoment\n\t\t * @function\n\t\t */\n\t\t\t.filter('amDateFormat', ['moment', 'amMoment', 'angularMomentConfig', function (moment, amMoment, angularMomentConfig) {\n\t\t\t\tfunction amDateFormatFilter(value, format, preprocess, timezone, inputFormat) {\n\t\t\t\t\tvar currentFormat = inputFormat || angularMomentConfig.format;\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = amMoment.preprocessDate(value, preprocess, currentFormat);\n\t\t\t\t\tvar date = moment(value);\n\t\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn amMoment.applyTimezone(date, timezone).format(format);\n\t\t\t\t}\n\n\t\t\t\tamDateFormatFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amDateFormatFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amDurationFormat\n\t\t * @module angularMoment\n\t\t * @function\n\t\t */\n\t\t\t.filter('amDurationFormat', ['moment', 'angularMomentConfig', function (moment, angularMomentConfig) {\n\t\t\t\tfunction amDurationFormatFilter(value, format, suffix) {\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn moment.duration(value, format).humanize(suffix);\n\t\t\t\t}\n\n\t\t\t\tamDurationFormatFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amDurationFormatFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amTimeAgo\n\t\t * @module angularMoment\n\t\t * @function\n\t\t */\n\t\t\t.filter('amTimeAgo', ['moment', 'amMoment', 'angularMomentConfig', function (moment, amMoment, angularMomentConfig) {\n\t\t\t\tfunction amTimeAgoFilter(value, preprocess, suffix, from) {\n\t\t\t\t\tvar date, dateFrom;\n\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = amMoment.preprocessDate(value, preprocess);\n\t\t\t\t\tdate = moment(value);\n\t\t\t\t\tif (!date.isValid()) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\tdateFrom = moment(from);\n\t\t\t\t\tif (typeof from !== 'undefined' && dateFrom.isValid()) {\n\t\t\t\t\t\treturn amMoment.applyTimezone(date).from(dateFrom, suffix);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn amMoment.applyTimezone(date).fromNow(suffix);\n\t\t\t\t}\n\n\t\t\t\tamTimeAgoFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amTimeAgoFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amSubtract\n\t\t * @module angularMoment\n\t\t * @function\n\t\t */\n\t\t\t.filter('amSubtract', ['moment', 'angularMomentConfig', function (moment, angularMomentConfig) {\n\t\t\t\tfunction amSubtractFilter(value, amount, type) {\n\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn moment(value).subtract(parseInt(amount, 10), type);\n\t\t\t\t}\n\n\t\t\t\tamSubtractFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amSubtractFilter;\n\t\t\t}])\n\n\t\t/**\n\t\t * @ngdoc filter\n\t\t * @name angularMoment.filter:amAdd\n\t\t * @module angularMoment\n\t\t * @function\n\t\t */\n\t\t\t.filter('amAdd', ['moment', 'angularMomentConfig', function (moment, angularMomentConfig) {\n\t\t\t\tfunction amAddFilter(value, amount, type) {\n\n\t\t\t\t\tif (typeof value === 'undefined' || value === null) {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn moment(value).add(parseInt(amount, 10), type);\n\t\t\t\t}\n\n\t\t\t\tamAddFilter.$stateful = angularMomentConfig.statefulFilters;\n\n\t\t\t\treturn amAddFilter;\n\t\t\t}]);\n\t}\n\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(['angular', 'moment'], angularMoment);\n\t} else if (typeof module !== 'undefined' && module && module.exports) {\n\t\tangularMoment(angular, require('moment'));\n\t\tmodule.exports = 'angularMoment';\n\t} else {\n\t\tangularMoment(angular, (typeof global !== 'undefined' ? global : window).moment);\n\t}\n})();\n\n/**\n * Bunch of useful filters for angularJS(with no external dependencies!)\n * @version v0.5.7 - 2015-10-04 * @link https://github.com/a8m/angular-filter\n * @author Ariel Mashraki <ariel@mashraki.co.il>\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */!function(a,b,c){\"use strict\";function d(a){return D(a)?a:Object.keys(a).map(function(b){return a[b]})}function e(a){return null===a}function f(a,b){var d=Object.keys(a);return-1==d.map(function(d){return b[d]!==c&&b[d]==a[d]}).indexOf(!1)}function g(a,b){if(\"\"===b)return a;var c=a.indexOf(b.charAt(0));return-1===c?!1:g(a.substr(c+1),b.substr(1))}function h(a,b,c){var d=0;return a.filter(function(a){var e=x(c)?b>d&&c(a):b>d;return d=e?d+1:d,e})}function i(a,b,c){return c.round(a*c.pow(10,b))/c.pow(10,b)}function j(a,b,c){b=b||[];var d=Object.keys(a);return d.forEach(function(d){if(C(a[d])&&!D(a[d])){var e=c?c+\".\"+d:c;j(a[d],b,e||d)}else{var f=c?c+\".\"+d:d;b.push(f)}}),b}function k(a){return a&&a.$evalAsync&&a.$watch}function l(){return function(a,b){return a>b}}function m(){return function(a,b){return a>=b}}function n(){return function(a,b){return b>a}}function o(){return function(a,b){return b>=a}}function p(){return function(a,b){return a==b}}function q(){return function(a,b){return a!=b}}function r(){return function(a,b){return a===b}}function s(){return function(a,b){return a!==b}}function t(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?!1:b.some(function(b){return C(b)||z(c)?a(c)(b):b===c})}}function u(a,b){return b=b||0,b>=a.length?a:D(a[b])?u(a.slice(0,b).concat(a[b],a.slice(b+1)),b):u(a,b+1)}function v(a){return function(b,c){function e(a,b){return y(b)?!1:a.some(function(a){return H(a,b)})}if(b=C(b)?d(b):b,!D(b))return b;var f=[],g=a(c);return y(c)?b.filter(function(a,b,c){return c.indexOf(a)===b}):b.filter(function(a){var b=g(a);return e(f,b)?!1:(f.push(b),!0)})}}function w(a,b,c){return b?a+c+w(a,--b,c):a}var x=b.isDefined,y=b.isUndefined,z=b.isFunction,A=b.isString,B=b.isNumber,C=b.isObject,D=b.isArray,E=b.forEach,F=b.extend,G=b.copy,H=b.equals;String.prototype.contains||(String.prototype.contains=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),b.module(\"a8m.angular\",[]).filter(\"isUndefined\",function(){return function(a){return b.isUndefined(a)}}).filter(\"isDefined\",function(){return function(a){return b.isDefined(a)}}).filter(\"isFunction\",function(){return function(a){return b.isFunction(a)}}).filter(\"isString\",function(){return function(a){return b.isString(a)}}).filter(\"isNumber\",function(){return function(a){return b.isNumber(a)}}).filter(\"isArray\",function(){return function(a){return b.isArray(a)}}).filter(\"isObject\",function(){return function(a){return b.isObject(a)}}).filter(\"isEqual\",function(){return function(a,c){return b.equals(a,c)}}),b.module(\"a8m.conditions\",[]).filter({isGreaterThan:l,\">\":l,isGreaterThanOrEqualTo:m,\">=\":m,isLessThan:n,\"<\":n,isLessThanOrEqualTo:o,\"<=\":o,isEqualTo:p,\"==\":p,isNotEqualTo:q,\"!=\":q,isIdenticalTo:r,\"===\":r,isNotIdenticalTo:s,\"!==\":s}),b.module(\"a8m.is-null\",[]).filter(\"isNull\",function(){return function(a){return e(a)}}),b.module(\"a8m.after-where\",[]).filter(\"afterWhere\",function(){return function(a,b){if(a=C(a)?d(a):a,!D(a)||y(b))return a;var c=a.map(function(a){return f(b,a)}).indexOf(!0);return a.slice(-1===c?0:c)}}),b.module(\"a8m.after\",[]).filter(\"after\",function(){return function(a,b){return a=C(a)?d(a):a,D(a)?a.slice(b):a}}),b.module(\"a8m.before-where\",[]).filter(\"beforeWhere\",function(){return function(a,b){if(a=C(a)?d(a):a,!D(a)||y(b))return a;var c=a.map(function(a){return f(b,a)}).indexOf(!0);return a.slice(0,-1===c?a.length:++c)}}),b.module(\"a8m.before\",[]).filter(\"before\",function(){return function(a,b){return a=C(a)?d(a):a,D(a)?a.slice(0,b?--b:b):a}}),b.module(\"a8m.chunk-by\",[\"a8m.filter-watcher\"]).filter(\"chunkBy\",[\"filterWatcher\",function(a){return function(b,c,d){function e(a,b){for(var c=[];a--;)c[a]=b;return c}function f(a,b,c){return D(a)?a.map(function(a,d,f){return d*=b,a=f.slice(d,d+b),!y(c)&&a.length<b?a.concat(e(b-a.length,c)):a}).slice(0,Math.ceil(a.length/b)):a}return a.isMemoized(\"chunkBy\",arguments)||a.memoize(\"chunkBy\",arguments,this,f(b,c,d))}}]),b.module(\"a8m.concat\",[]).filter(\"concat\",[function(){return function(a,b){if(y(b))return a;if(D(a))return C(b)?a.concat(d(b)):a.concat(b);if(C(a)){var c=d(a);return C(b)?c.concat(d(b)):c.concat(b)}return a}}]),b.module(\"a8m.contains\",[]).filter({contains:[\"$parse\",t],some:[\"$parse\",t]}),b.module(\"a8m.count-by\",[]).filter(\"countBy\",[\"$parse\",function(a){return function(b,c){var e,f={},g=a(c);return b=C(b)?d(b):b,!D(b)||y(c)?b:(b.forEach(function(a){e=g(a),f[e]||(f[e]=0),f[e]++}),f)}}]),b.module(\"a8m.defaults\",[]).filter(\"defaults\",[\"$parse\",function(a){return function(b,c){if(b=C(b)?d(b):b,!D(b)||!C(c))return b;var e=j(c);return b.forEach(function(b){e.forEach(function(d){var e=a(d),f=e.assign;y(e(b))&&f(b,e(c))})}),b}}]),b.module(\"a8m.every\",[]).filter(\"every\",[\"$parse\",function(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?!0:b.every(function(b){return C(b)||z(c)?a(c)(b):b===c})}}]),b.module(\"a8m.filter-by\",[]).filter(\"filterBy\",[\"$parse\",function(a){return function(b,e,f){var g;return f=A(f)||B(f)?String(f).toLowerCase():c,b=C(b)?d(b):b,!D(b)||y(f)?b:b.filter(function(b){return e.some(function(c){if(~c.indexOf(\"+\")){var d=c.replace(new RegExp(\"\\\\s\",\"g\"),\"\").split(\"+\");g=d.reduce(function(c,d,e){return 1===e?a(c)(b)+\" \"+a(d)(b):c+\" \"+a(d)(b)})}else g=a(c)(b);return A(g)||B(g)?String(g).toLowerCase().contains(f):!1})})}}]),b.module(\"a8m.first\",[]).filter(\"first\",[\"$parse\",function(a){return function(b){var e,f,g;return b=C(b)?d(b):b,D(b)?(g=Array.prototype.slice.call(arguments,1),e=B(g[0])?g[0]:1,f=B(g[0])?B(g[1])?c:g[1]:g[0],g.length?h(b,e,f?a(f):f):b[0]):b}}]),b.module(\"a8m.flatten\",[]).filter(\"flatten\",function(){return function(a,b){return b=b||!1,a=C(a)?d(a):a,D(a)?b?[].concat.apply([],a):u(a,0):a}}),b.module(\"a8m.fuzzy-by\",[]).filter(\"fuzzyBy\",[\"$parse\",function(a){return function(b,c,e,f){var h,i,j=f||!1;return b=C(b)?d(b):b,!D(b)||y(c)||y(e)?b:(i=a(c),b.filter(function(a){return h=i(a),A(h)?(h=j?h:h.toLowerCase(),e=j?e:e.toLowerCase(),g(h,e)!==!1):!1}))}}]),b.module(\"a8m.fuzzy\",[]).filter(\"fuzzy\",function(){return function(a,b,c){function e(a,b){var c,d,e=Object.keys(a);return 0<e.filter(function(e){return c=a[e],d?!0:A(c)?(c=f?c:c.toLowerCase(),d=g(c,b)!==!1):!1}).length}var f=c||!1;return a=C(a)?d(a):a,!D(a)||y(b)?a:(b=f?b:b.toLowerCase(),a.filter(function(a){return A(a)?(a=f?a:a.toLowerCase(),g(a,b)!==!1):C(a)?e(a,b):!1}))}}),b.module(\"a8m.group-by\",[\"a8m.filter-watcher\"]).filter(\"groupBy\",[\"$parse\",\"filterWatcher\",function(a,b){return function(c,d){function e(a,b){var c,d={};return E(a,function(a){c=b(a),d[c]||(d[c]=[]),d[c].push(a)}),d}return!C(c)||y(d)?c:b.isMemoized(\"groupBy\",arguments)||b.memoize(\"groupBy\",arguments,this,e(c,a(d)))}}]),b.module(\"a8m.is-empty\",[]).filter(\"isEmpty\",function(){return function(a){return C(a)?!d(a).length:!a.length}}),b.module(\"a8m.join\",[]).filter(\"join\",function(){return function(a,b){return y(a)||!D(a)?a:(y(b)&&(b=\" \"),a.join(b))}}),b.module(\"a8m.last\",[]).filter(\"last\",[\"$parse\",function(a){return function(b){var e,f,g,i=G(b);return i=C(i)?d(i):i,D(i)?(g=Array.prototype.slice.call(arguments,1),e=B(g[0])?g[0]:1,f=B(g[0])?B(g[1])?c:g[1]:g[0],g.length?h(i.reverse(),e,f?a(f):f).reverse():i[i.length-1]):i}}]),b.module(\"a8m.map\",[]).filter(\"map\",[\"$parse\",function(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?b:b.map(function(b){return a(c)(b)})}}]),b.module(\"a8m.omit\",[]).filter(\"omit\",[\"$parse\",function(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?b:b.filter(function(b){return!a(c)(b)})}}]),b.module(\"a8m.pick\",[]).filter(\"pick\",[\"$parse\",function(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?b:b.filter(function(b){return a(c)(b)})}}]),b.module(\"a8m.range\",[]).filter(\"range\",function(){return function(a,b){for(var c=0;c<parseInt(b);c++)a.push(c);return a}}),b.module(\"a8m.remove-with\",[]).filter(\"removeWith\",function(){return function(a,b){return y(b)?a:(a=C(a)?d(a):a,a.filter(function(a){return!f(b,a)}))}}),b.module(\"a8m.remove\",[]).filter(\"remove\",function(){return function(a){a=C(a)?d(a):a;var b=Array.prototype.slice.call(arguments,1);return D(a)?a.filter(function(a){return!b.some(function(b){return H(b,a)})}):a}}),b.module(\"a8m.reverse\",[]).filter(\"reverse\",[function(){return function(a){return a=C(a)?d(a):a,A(a)?a.split(\"\").reverse().join(\"\"):D(a)?a.slice().reverse():a}}]),b.module(\"a8m.search-field\",[]).filter(\"searchField\",[\"$parse\",function(a){return function(b){var c,e;b=C(b)?d(b):b;var f=Array.prototype.slice.call(arguments,1);return D(b)&&f.length?b.map(function(b){return e=f.map(function(d){return(c=a(d))(b)}).join(\" \"),F(b,{searchField:e})}):b}}]),b.module(\"a8m.to-array\",[]).filter(\"toArray\",function(){return function(a,b){return C(a)?b?Object.keys(a).map(function(b){return F(a[b],{$key:b})}):d(a):a}}),b.module(\"a8m.unique\",[]).filter({unique:[\"$parse\",v],uniq:[\"$parse\",v]}),b.module(\"a8m.where\",[]).filter(\"where\",function(){return function(a,b){return y(b)?a:(a=C(a)?d(a):a,a.filter(function(a){return f(b,a)}))}}),b.module(\"a8m.xor\",[]).filter(\"xor\",[\"$parse\",function(a){return function(b,c,e){function f(b,c){var d=a(e);return c.some(function(a){return e?H(d(a),d(b)):H(a,b)})}return e=e||!1,b=C(b)?d(b):b,c=C(c)?d(c):c,D(b)&&D(c)?b.concat(c).filter(function(a){return!(f(a,b)&&f(a,c))}):b}}]),b.module(\"a8m.math.byteFmt\",[\"a8m.math\"]).filter(\"byteFmt\",[\"$math\",function(a){return function(b,c){return B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)?1024>b?i(b,c,a)+\" B\":1048576>b?i(b/1024,c,a)+\" KB\":1073741824>b?i(b/1048576,c,a)+\" MB\":i(b/1073741824,c,a)+\" GB\":\"NaN\"}}]),b.module(\"a8m.math.degrees\",[\"a8m.math\"]).filter(\"degrees\",[\"$math\",function(a){return function(b,c){if(B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)){var d=180*b/a.PI;return a.round(d*a.pow(10,c))/a.pow(10,c)}return\"NaN\"}}]),b.module(\"a8m.math.kbFmt\",[\"a8m.math\"]).filter(\"kbFmt\",[\"$math\",function(a){return function(b,c){return B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)?1024>b?i(b,c,a)+\" KB\":1048576>b?i(b/1024,c,a)+\" MB\":i(b/1048576,c,a)+\" GB\":\"NaN\"}}]),b.module(\"a8m.math\",[]).factory(\"$math\",[\"$window\",function(a){return a.Math}]),b.module(\"a8m.math.max\",[\"a8m.math\"]).filter(\"max\",[\"$math\",\"$parse\",function(a,b){function c(c,d){var e=c.map(function(a){return b(d)(a)});return e.indexOf(a.max.apply(a,e))}return function(b,d){return D(b)?y(d)?a.max.apply(a,b):b[c(b,d)]:b}}]),b.module(\"a8m.math.min\",[\"a8m.math\"]).filter(\"min\",[\"$math\",\"$parse\",function(a,b){function c(c,d){var e=c.map(function(a){return b(d)(a)});return e.indexOf(a.min.apply(a,e))}return function(b,d){return D(b)?y(d)?a.min.apply(a,b):b[c(b,d)]:b}}]),b.module(\"a8m.math.percent\",[\"a8m.math\"]).filter(\"percent\",[\"$math\",\"$window\",function(a,b){return function(c,d,e){var f=A(c)?b.Number(c):c;return d=d||100,e=e||!1,!B(f)||b.isNaN(f)?c:e?a.round(f/d*100):f/d*100}}]),b.module(\"a8m.math.radians\",[\"a8m.math\"]).filter(\"radians\",[\"$math\",function(a){return function(b,c){if(B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)){var d=3.14159265359*b/180;return a.round(d*a.pow(10,c))/a.pow(10,c)}return\"NaN\"}}]),b.module(\"a8m.math.radix\",[]).filter(\"radix\",function(){return function(a,b){var c=/^[2-9]$|^[1-2]\\d$|^3[0-6]$/;return B(a)&&c.test(b)?a.toString(b).toUpperCase():a}}),b.module(\"a8m.math.shortFmt\",[\"a8m.math\"]).filter(\"shortFmt\",[\"$math\",function(a){return function(b,c){return B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)?1e3>b?b:1e6>b?i(b/1e3,c,a)+\" K\":1e9>b?i(b/1e6,c,a)+\" M\":i(b/1e9,c,a)+\" B\":\"NaN\"}}]),b.module(\"a8m.math.sum\",[]).filter(\"sum\",function(){return function(a,b){return D(a)?a.reduce(function(a,b){return a+b},b||0):a}}),b.module(\"a8m.ends-with\",[]).filter(\"endsWith\",function(){return function(a,b,c){var d,e=c||!1;return!A(a)||y(b)?a:(a=e?a:a.toLowerCase(),d=a.length-b.length,-1!==a.indexOf(e?b:b.toLowerCase(),d))}}),b.module(\"a8m.latinize\",[]).filter(\"latinize\",[function(){function a(a){return a.replace(/[^\\u0000-\\u007E]/g,function(a){return c[a]||a})}for(var b=[{base:\"A\",letters:\"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ\"},{base:\"AA\",letters:\"Ꜳ\"},{base:\"AE\",letters:\"ÆǼǢ\"},{base:\"AO\",letters:\"Ꜵ\"},{base:\"AU\",letters:\"Ꜷ\"},{base:\"AV\",letters:\"ꜸꜺ\"},{base:\"AY\",letters:\"Ꜽ\"},{base:\"B\",letters:\"BⒷBḂḄḆɃƂƁ\"},{base:\"C\",letters:\"CⒸCĆĈĊČÇḈƇȻꜾ\"},{base:\"D\",letters:\"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ\"},{base:\"DZ\",letters:\"DZDŽ\"},{base:\"Dz\",letters:\"DzDž\"},{base:\"E\",letters:\"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ\"},{base:\"F\",letters:\"FⒻFḞƑꝻ\"},{base:\"G\",letters:\"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ\"},{base:\"H\",letters:\"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ\"},{base:\"I\",letters:\"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ\"},{base:\"J\",letters:\"JⒿJĴɈ\"},{base:\"K\",letters:\"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ\"},{base:\"L\",letters:\"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ\"},{base:\"LJ\",letters:\"LJ\"},{base:\"Lj\",letters:\"Lj\"},{base:\"M\",letters:\"MⓂMḾṀṂⱮƜ\"},{base:\"N\",letters:\"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ\"},{base:\"NJ\",letters:\"NJ\"},{base:\"Nj\",letters:\"Nj\"},{base:\"O\",letters:\"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ\"},{base:\"OI\",letters:\"Ƣ\"},{base:\"OO\",letters:\"Ꝏ\"},{base:\"OU\",letters:\"Ȣ\"},{base:\"OE\",letters:\"Œ\"},{base:\"oe\",letters:\"œ\"},{base:\"P\",letters:\"PⓅPṔṖƤⱣꝐꝒꝔ\"},{base:\"Q\",letters:\"QⓆQꝖꝘɊ\"},{base:\"R\",letters:\"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ\"},{base:\"S\",letters:\"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ\"},{base:\"T\",letters:\"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ\"},{base:\"TZ\",letters:\"Ꜩ\"},{base:\"U\",letters:\"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ\"},{base:\"V\",letters:\"VⓋVṼṾƲꝞɅ\"},{base:\"VY\",letters:\"Ꝡ\"},{base:\"W\",letters:\"WⓌWẀẂŴẆẄẈⱲ\"},{base:\"X\",letters:\"XⓍXẊẌ\"},{base:\"Y\",letters:\"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ\"},{base:\"Z\",letters:\"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ\"},{base:\"a\",letters:\"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ\"},{base:\"aa\",letters:\"ꜳ\"},{base:\"ae\",letters:\"æǽǣ\"},{base:\"ao\",letters:\"ꜵ\"},{base:\"au\",letters:\"ꜷ\"},{base:\"av\",letters:\"ꜹꜻ\"},{base:\"ay\",letters:\"ꜽ\"},{base:\"b\",letters:\"bⓑbḃḅḇƀƃɓ\"},{base:\"c\",letters:\"cⓒcćĉċčçḉƈȼꜿↄ\"},{base:\"d\",letters:\"dⓓdḋďḍḑḓḏđƌɖɗꝺ\"},{base:\"dz\",letters:\"dzdž\"},{base:\"e\",letters:\"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ\"},{base:\"f\",letters:\"fⓕfḟƒꝼ\"},{base:\"g\",letters:\"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ\"},{base:\"h\",letters:\"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ\"},{base:\"hv\",letters:\"ƕ\"},{base:\"i\",letters:\"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı\"},{base:\"j\",letters:\"jⓙjĵǰɉ\"},{base:\"k\",letters:\"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ\"},{base:\"l\",letters:\"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ\"},{base:\"lj\",letters:\"lj\"},{base:\"m\",letters:\"mⓜmḿṁṃɱɯ\"},{base:\"n\",letters:\"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ\"},{base:\"nj\",letters:\"nj\"},{base:\"o\",letters:\"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ\"},{base:\"oi\",letters:\"ƣ\"},{base:\"ou\",letters:\"ȣ\"},{base:\"oo\",letters:\"ꝏ\"},{base:\"p\",letters:\"pⓟpṕṗƥᵽꝑꝓꝕ\"},{base:\"q\",letters:\"qⓠqɋꝗꝙ\"},{base:\"r\",letters:\"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ\"},{base:\"s\",letters:\"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ\"},{base:\"t\",letters:\"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ\"},{base:\"tz\",letters:\"ꜩ\"},{base:\"u\",letters:\"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ\"},{base:\"v\",letters:\"vⓥvṽṿʋꝟʌ\"},{base:\"vy\",letters:\"ꝡ\"},{base:\"w\",letters:\"wⓦwẁẃŵẇẅẘẉⱳ\"},{base:\"x\",letters:\"xⓧxẋẍ\"},{base:\"y\",letters:\"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ\"},{base:\"z\",letters:\"zⓩzźẑżžẓẕƶȥɀⱬꝣ\"}],c={},d=0;d<b.length;d++)for(var e=b[d].letters.split(\"\"),f=0;f<e.length;f++)c[e[f]]=b[d].base;return function(b){return A(b)?a(b):b}}]),b.module(\"a8m.ltrim\",[]).filter(\"ltrim\",function(){return function(a,b){var c=b||\"\\\\s\";return A(a)?a.replace(new RegExp(\"^\"+c+\"+\"),\"\"):a}}),b.module(\"a8m.match\",[]).filter(\"match\",function(){return function(a,b,c){var d=new RegExp(b,c);return A(a)?a.match(d):null}}),b.module(\"a8m.repeat\",[]).filter(\"repeat\",[function(){return function(a,b,c){var d=~~b;return A(a)&&d?w(a,--b,c||\"\"):a}}]),b.module(\"a8m.rtrim\",[]).filter(\"rtrim\",function(){return function(a,b){var c=b||\"\\\\s\";return A(a)?a.replace(new RegExp(c+\"+$\"),\"\"):a}}),b.module(\"a8m.slugify\",[]).filter(\"slugify\",[function(){return function(a,b){var c=y(b)?\"-\":b;return A(a)?a.toLowerCase().replace(/\\s+/g,c):a}}]),b.module(\"a8m.starts-with\",[]).filter(\"startsWith\",function(){return function(a,b,c){var d=c||!1;return!A(a)||y(b)?a:(a=d?a:a.toLowerCase(),!a.indexOf(d?b:b.toLowerCase()))}}),b.module(\"a8m.stringular\",[]).filter(\"stringular\",function(){return function(a){var b=Array.prototype.slice.call(arguments,1);return a.replace(/{(\\d+)}/g,function(a,c){return y(b[c])?a:b[c]})}}),b.module(\"a8m.strip-tags\",[]).filter(\"stripTags\",function(){return function(a){return A(a)?a.replace(/<\\S[^><]*>/g,\"\"):a}}),b.module(\"a8m.test\",[]).filter(\"test\",function(){return function(a,b,c){var d=new RegExp(b,c);return A(a)?d.test(a):a}}),b.module(\"a8m.trim\",[]).filter(\"trim\",function(){return function(a,b){var c=b||\"\\\\s\";return A(a)?a.replace(new RegExp(\"^\"+c+\"+|\"+c+\"+$\",\"g\"),\"\"):a}}),b.module(\"a8m.truncate\",[]).filter(\"truncate\",function(){return function(a,b,c,d){return b=y(b)?a.length:b,d=d||!1,c=c||\"\",!A(a)||a.length<=b?a:a.substring(0,d?-1===a.indexOf(\" \",b)?a.length:a.indexOf(\" \",b):b)+c}}),b.module(\"a8m.ucfirst\",[]).filter(\"ucfirst\",[function(){return function(a){return A(a)?a.split(\" \").map(function(a){return a.charAt(0).toUpperCase()+a.substring(1)}).join(\" \"):a}}]),b.module(\"a8m.uri-component-encode\",[]).filter(\"uriComponentEncode\",[\"$window\",function(a){return function(b){return A(b)?a.encodeURIComponent(b):b}}]),b.module(\"a8m.uri-encode\",[]).filter(\"uriEncode\",[\"$window\",function(a){return function(b){return A(b)?a.encodeURI(b):b}}]),b.module(\"a8m.wrap\",[]).filter(\"wrap\",function(){return function(a,b,c){return A(a)&&x(b)?[b,a,c||b].join(\"\"):a}}),b.module(\"a8m.filter-watcher\",[]).provider(\"filterWatcher\",function(){this.$get=[\"$window\",\"$rootScope\",function(a,b){function c(b,c){function d(){var b=[];return function(c,d){if(C(d)&&!e(d)){if(~b.indexOf(d))return\"[Circular]\";b.push(d)}return a==d?\"$WINDOW\":a.document==d?\"$DOCUMENT\":k(d)?\"$SCOPE\":d}}return[b,JSON.stringify(c,d())].join(\"#\").replace(/\"/g,\"\")}function d(a){var b=a.targetScope.$id;E(l[b],function(a){delete j[a]}),delete l[b]}function f(){m(function(){b.$$phase||(j={})},2e3)}function g(a,b){var c=a.$id;return y(l[c])&&(a.$on(\"$destroy\",d),l[c]=[]),l[c].push(b)}function h(a,b){var d=c(a,b);return j[d]}function i(a,b,d,e){var h=c(a,b);return j[h]=e,k(d)?g(d,h):f(),e}var j={},l={},m=a.setTimeout;return{isMemoized:h,memoize:i}}]}),b.module(\"angular.filter\",[\"a8m.ucfirst\",\"a8m.uri-encode\",\"a8m.uri-component-encode\",\"a8m.slugify\",\"a8m.latinize\",\"a8m.strip-tags\",\"a8m.stringular\",\"a8m.truncate\",\"a8m.starts-with\",\"a8m.ends-with\",\"a8m.wrap\",\"a8m.trim\",\"a8m.ltrim\",\"a8m.rtrim\",\"a8m.repeat\",\"a8m.test\",\"a8m.match\",\"a8m.to-array\",\"a8m.concat\",\"a8m.contains\",\"a8m.unique\",\"a8m.is-empty\",\"a8m.after\",\"a8m.after-where\",\"a8m.before\",\"a8m.before-where\",\"a8m.defaults\",\"a8m.where\",\"a8m.reverse\",\"a8m.remove\",\"a8m.remove-with\",\"a8m.group-by\",\"a8m.count-by\",\"a8m.chunk-by\",\"a8m.search-field\",\"a8m.fuzzy-by\",\"a8m.fuzzy\",\"a8m.omit\",\"a8m.pick\",\"a8m.every\",\"a8m.filter-by\",\"a8m.xor\",\"a8m.map\",\"a8m.first\",\"a8m.last\",\"a8m.flatten\",\"a8m.join\",\"a8m.range\",\"a8m.math\",\"a8m.math.max\",\"a8m.math.min\",\"a8m.math.percent\",\"a8m.math.radix\",\"a8m.math.sum\",\"a8m.math.degrees\",\"a8m.math.radians\",\"a8m.math.byteFmt\",\"a8m.math.kbFmt\",\"a8m.math.shortFmt\",\"a8m.angular\",\"a8m.conditions\",\"a8m.is-null\",\"a8m.filter-watcher\"])}(window,window.angular);\n/*! angular-deckgrid (v0.5.0) - Copyright: 2013 - 2014, André König (andre.koenig@posteo.de) - MIT */\n/*\n * angular-deckgrid\n *\n * Copyright(c) 2013-2014 André König <andre.koenig@posteo.de>\n * MIT Licensed\n *\n */\n\n/**\n * @author André König (andre.koenig@posteo.de)\n *\n */\n\nangular.module('akoenig.deckgrid', []);\n\nangular.module('akoenig.deckgrid').directive('deckgrid', [\n\n 'DeckgridDescriptor',\n\n function initialize (DeckgridDescriptor) {\n\n 'use strict';\n\n return DeckgridDescriptor.create();\n }\n]);\n/*\n * angular-deckgrid\n *\n * Copyright(c) 2013-2014 André König <andre.koenig@posteo.de>\n * MIT Licensed\n *\n */\n\n/**\n * @author André König (andre.koenig@posteo.de)\n *\n */\n\nangular.module('akoenig.deckgrid').factory('DeckgridDescriptor', [\n\n 'Deckgrid',\n '$templateCache',\n\n function initialize (Deckgrid, $templateCache) {\n\n 'use strict';\n\n /**\n * This is a wrapper around the AngularJS\n * directive description object.\n *\n */\n function Descriptor () {\n this.restrict = 'AE';\n\n this.template = '<div data-ng-repeat=\"column in columns\" class=\"{{layout.classList}}\">' +\n '<div data-ng-repeat=\"card in column\" data-ng-include=\"cardTemplate\"></div>' +\n '</div>';\n\n this.scope = {\n 'model': '=source'\n };\n\n //\n // Will be created in the linking function.\n //\n this.$$deckgrid = null;\n\n this.transclude = true;\n this.link = this.$$link.bind(this);\n\n //\n // Will be incremented if using inline templates.\n //\n this.$$templateKeyIndex = 0;\n\n }\n\n /**\n * @private\n *\n * Cleanup method. Will be called when the\n * deckgrid directive should be destroyed.\n *\n */\n Descriptor.prototype.$$destroy = function $$destroy () {\n this.$$deckgrid.destroy();\n };\n\n /**\n * @private\n *\n * The deckgrid link method. Will instantiate the deckgrid.\n *\n */\n Descriptor.prototype.$$link = function $$link (scope, elem, attrs, nullController, transclude) {\n var templateKey = 'deckgrid/innerHtmlTemplate' + (++this.$$templateKeyIndex) + '.html';\n\n scope.$on('$destroy', this.$$destroy.bind(this));\n\n if (angular.isUndefined(attrs.cardtemplate)) {\n if (angular.isUndefined(attrs.cardtemplatestring)) {\n // use the provided inner html as template\n transclude(scope, function onTransclude (innerHTML) {\n var extractedInnerHTML = [],\n i = 0,\n len = innerHTML.length,\n outerHTML;\n\n for (i; i < len; i = i + 1) {\n outerHTML = innerHTML[i].outerHTML;\n\n if (angular.isDefined(outerHTML)) {\n extractedInnerHTML.push(outerHTML);\n }\n }\n\n $templateCache.put(templateKey, extractedInnerHTML.join());\n });\n } else {\n // use the provided template string\n //\n // note: the attr is accessed via the elem object, as the attrs content\n // is already compiled and thus lacks the {{...}} expressions\n $templateCache.put(templateKey, elem.attr('cardtemplatestring'));\n }\n\n scope.cardTemplate = templateKey;\n } else {\n // use the provided template file\n scope.cardTemplate = attrs.cardtemplate;\n }\n\n scope.mother = scope.$parent;\n\n this.$$deckgrid = Deckgrid.create(scope, elem[0]);\n };\n\n return {\n create : function create () {\n return new Descriptor();\n }\n };\n }\n]);\n\n/*\n * angular-deckgrid\n *\n * Copyright(c) 2013-2014 André König <andre.koenig@posteo.de>\n * MIT Licensed\n *\n */\n\n/**\n * @author André König (andre.koenig@posteo.de)\n *\n */\n\nangular.module('akoenig.deckgrid').factory('Deckgrid', [\n\n '$window',\n '$log',\n\n function initialize ($window, $log) {\n\n 'use strict';\n\n /**\n * The deckgrid directive.\n *\n */\n function Deckgrid (scope, element) {\n var self = this,\n watcher,\n mql;\n\n this.$$elem = element;\n this.$$watchers = [];\n\n this.$$scope = scope;\n this.$$scope.columns = [];\n\n //\n // The layout configuration will be parsed from\n // the pseudo \"before element.\" There you have to save all\n // the column configurations.\n //\n this.$$scope.layout = this.$$getLayout();\n\n this.$$createColumns();\n\n //\n // Register model change.\n //\n watcher = this.$$scope.$watchCollection('model', this.$$onModelChange.bind(this));\n\n this.$$watchers.push(watcher);\n\n //\n // Register media query change events.\n //\n angular.forEach(self.$$getMediaQueries(), function onIteration (rule) {\n var handler = self.$$onMediaQueryChange.bind(self);\n\n function onDestroy () {\n rule.removeListener(handler);\n }\n\n rule.addListener(handler);\n\n self.$$watchers.push(onDestroy);\n });\n \n mql = $window.matchMedia('(orientation: portrait)');\n mql.addListener(self.$$onMediaQueryChange.bind(self));\n\n }\n\n /**\n * @private\n *\n * Extracts the media queries out of the stylesheets.\n *\n * This method will fetch the media queries out of the stylesheets that are\n * responsible for styling the angular-deckgrid.\n *\n * @return {array} An array with all respective styles.\n *\n */\n Deckgrid.prototype.$$getMediaQueries = function $$getMediaQueries () {\n var stylesheets = [],\n mediaQueries = [];\n\n stylesheets = Array.prototype.concat.call(\n Array.prototype.slice.call(document.querySelectorAll('style[type=\\'text/css\\']')),\n Array.prototype.slice.call(document.querySelectorAll('link[rel=\\'stylesheet\\']'))\n );\n\n function extractRules (stylesheet) {\n try {\n return (stylesheet.sheet.cssRules || []);\n } catch (e) {\n return [];\n }\n }\n\n function hasDeckgridStyles (rule) {\n var regexe = /\\[(\\w*-)?deckgrid\\]::?before/g,\n i = 0,\n selector = '';\n\n if (!rule.media || angular.isUndefined(rule.cssRules)) {\n return false;\n }\n\n i = rule.cssRules.length - 1;\n\n for (i; i >= 0; i = i - 1) {\n selector = rule.cssRules[i].selectorText;\n\n if (angular.isDefined(selector) && selector.match(regexe)) {\n return true;\n }\n }\n\n return false;\n }\n\n angular.forEach(stylesheets, function onIteration (stylesheet) {\n var rules = extractRules(stylesheet);\n\n angular.forEach(rules, function inRuleIteration (rule) {\n if (hasDeckgridStyles(rule)) {\n mediaQueries.push($window.matchMedia(rule.media.mediaText));\n }\n });\n });\n\n return mediaQueries;\n };\n\n /**\n * @private\n *\n * Creates the column segmentation. With other words:\n * This method creates the internal data structure from the\n * passed \"source\" attribute. Every card within this \"source\"\n * model will be passed into this internal column structure by\n * reference. So if you modify the data within your controller\n * this directive will reflect these changes immediately.\n *\n * NOTE that calling this method will trigger a complete template \"redraw\".\n *\n */\n Deckgrid.prototype.$$createColumns = function $$createColumns () {\n var self = this;\n\n if (!this.$$scope.layout) {\n return $log.error('angular-deckgrid: No CSS configuration found (see ' +\n 'https://github.com/akoenig/angular-deckgrid#the-grid-configuration)');\n }\n\n this.$$scope.columns = [];\n\n angular.forEach(this.$$scope.model, function onIteration (card, index) {\n var column = (index % self.$$scope.layout.columns) | 0;\n\n if (!self.$$scope.columns[column]) {\n self.$$scope.columns[column] = [];\n }\n\n card.$index = index;\n self.$$scope.columns[column].push(card);\n });\n };\n\n /**\n * @private\n *\n * Parses the configuration out of the configured CSS styles.\n *\n * Example:\n *\n * .deckgrid::before {\n * content: '3 .column.size-1-3';\n * }\n *\n * Will result in a three column grid where each column will have the\n * classes: \"column size-1-3\".\n *\n * You are responsible for defining the respective styles within your CSS.\n *\n */\n Deckgrid.prototype.$$getLayout = function $$getLayout () {\n var content = $window.getComputedStyle(this.$$elem, ':before').content,\n layout;\n\n if (content) {\n content = content.replace(/'/g, ''); // before e.g. '3 .column.size-1of3'\n content = content.replace(/\"/g, ''); // before e.g. \"3 .column.size-1of3\"\n content = content.split(' ');\n\n if (2 === content.length) {\n layout = {};\n layout.columns = (content[0] | 0);\n layout.classList = content[1].replace(/\\./g, ' ').trim();\n }\n }\n\n return layout;\n };\n\n /**\n * @private\n *\n * Event that will be triggered if a CSS media query changed.\n *\n */\n Deckgrid.prototype.$$onMediaQueryChange = function $$onMediaQueryChange () {\n var self = this,\n layout = this.$$getLayout();\n\n //\n // Okay, the layout has changed.\n // Creating a new column structure is not avoidable.\n //\n if (layout.columns !== this.$$scope.layout.columns) {\n self.$$scope.layout = layout;\n\n self.$$scope.$apply(function onApply () {\n self.$$createColumns();\n });\n }\n };\n\n /**\n * @private\n *\n * Event that will be triggered when the source model has changed.\n *\n */\n Deckgrid.prototype.$$onModelChange = function $$onModelChange (newModel, oldModel) {\n var self = this;\n\n newModel = newModel || [];\n oldModel = oldModel || [];\n\n if (!angular.equals(oldModel, newModel)) {\n self.$$createColumns();\n }\n };\n\n /**\n * Destroys the directive. Takes care of cleaning all\n * watchers and event handlers.\n *\n */\n Deckgrid.prototype.destroy = function destroy () {\n var i = this.$$watchers.length - 1;\n\n for (i; i >= 0; i = i - 1) {\n this.$$watchers[i]();\n }\n };\n\n return {\n create : function create (scope, element) {\n return new Deckgrid(scope, element);\n }\n };\n }\n]);\n\n'use strict';\nangular.module('angular-timeline', []);// Source: src/timeline-badge-directive.js\n/**\n * @ngdoc directive\n * @name angular-timeline.directive:timeline-badge\n * @restrict AE\n *\n * @description\n * Shown in the centre pane (or left on narrow devices) to indicate the activity.\n */\nangular.module('angular-timeline').directive('timelineBadge', function() {\n return {\n require: '^timelineEvent',\n restrict: 'AE',\n transclude: true,\n template: '<div ng-transclude class=\"timeline-badge\"></div>'\n };\n});\n\n// Source: src/timeline-directive.js\n/**\n * @ngdoc directive\n * @name angular-timeline\n * @restrict AE\n *\n * @description\n * Primary container for displaying a vertical set of timeline events.\n */\nangular.module('angular-timeline').directive('timeline', function() {\n return {\n restrict: 'AE',\n transclude: true,\n template: '<ul class=\"timeline\" ng-transclude></ul>',\n controller: function() {}\n };\n});\n\n// Source: src/timeline-event-directive.js\n/**\n * @ngdoc directive\n * @name angular-timeline.directive:timeline\n * @restrict AE\n *\n * @description\n * Represents an event occuring at a point in time, displayed on the left or the right\n * of the timeline line.\n *\n * You typically embed a `timeline-badge` and `timeline-panel` element within a `timeline-event`.\n *\n * @param {string=} side Define the side of the element (i.e. side=\"left\", side=\"right\", or use an {{ expression }}).\n */\n\nangular.module('angular-timeline').directive('timelineEvent', function() {\n return {\n require: '^timeline',\n restrict: 'AE',\n transclude: true,\n template: '<li ng-class-odd=\"oddClass\" ng-class-even=\"evenClass\" ng-transclude></li>',\n link: function(scope, element, attrs, controller) {\n\n var checkClass = function(side, leftSide) {\n\n var leftClass = '';\n var rightClass = 'timeline-inverted';\n\n if (side === 'left' || (!side && leftSide === true)) {\n return leftClass;\n }\n else if ((side === 'alternate' || !side) && leftSide === false) {\n return rightClass;\n }\n else if (side === 'right') {\n return rightClass;\n }\n else {\n return leftClass;\n }\n };\n\n var updateRowClasses = function(value) {\n scope.oddClass = checkClass(value, true);\n scope.evenClass = checkClass(value, false);\n };\n\n attrs.$observe('side', function(newValue) {\n updateRowClasses(newValue);\n });\n\n updateRowClasses(attrs.side);\n }\n };\n});\n\n// Source: src/timeline-footer-directive.js\n/**\n * @ngdoc directive\n * @name angular-timeline.directive:timeline-footer\n * @restrict AE\n *\n * @description\n * Optional element to add a footer section to the `timeline-panel` for links or other actions.\n */\nangular.module('angular-timeline').directive('timelineFooter', function() {\n return {\n require: '^timelinePanel',\n restrict: 'AE',\n transclude: true,\n template: '<div class=\"timeline-footer\" ng-transclude></div>'\n };\n});\n\n// Source: src/timeline-heading-directive.js\n/**\n * @ngdoc directive\n * @name angular-timeline.directive:timeline-heading\n * @restrict AE\n *\n * @description\n * Optional element to show the heading for a `timeline-panel`.\n */\nangular.module('angular-timeline').directive('timelineHeading', function() {\n return {\n require: '^timelinePanel',\n restrict: 'AE',\n transclude: true,\n template: '<div class=\"timeline-heading\" ng-transclude></div>'\n };\n});\n\n// Source: src/timeline-panel-directive.js\n/**\n * @ngdoc directive\n * @name angular-timeline.directive:timeline-panel\n * @restrict AE\n *\n * @description\n * An panel inside the `timeline-event` which shows detailed information about the event.\n */\nangular.module('angular-timeline').directive('timelinePanel', function() {\n return {\n require: '^timeline',\n restrict: 'AE',\n transclude: true,\n template: '<div class=\"timeline-panel\" ng-transclude></div>'\n };\n});\n\n/**\n * x is a value between 0 and 1, indicating where in the animation you are.\n */\nvar duScrollDefaultEasing = function (x) {\n 'use strict';\n\n if(x < 0.5) {\n return Math.pow(x*2, 2)/2;\n }\n return 1-Math.pow((1-x)*2, 2)/2;\n};\n\nvar duScroll = angular.module('duScroll', [\n 'duScroll.scrollspy',\n 'duScroll.smoothScroll',\n 'duScroll.scrollContainer',\n 'duScroll.spyContext',\n 'duScroll.scrollHelpers'\n])\n //Default animation duration for smoothScroll directive\n .value('duScrollDuration', 350)\n //Scrollspy debounce interval, set to 0 to disable\n .value('duScrollSpyWait', 100)\n //Wether or not multiple scrollspies can be active at once\n .value('duScrollGreedy', false)\n //Default offset for smoothScroll directive\n .value('duScrollOffset', 0)\n //Default easing function for scroll animation\n .value('duScrollEasing', duScrollDefaultEasing)\n //Which events on the container (such as body) should cancel scroll animations\n .value('duScrollCancelOnEvents', 'scroll mousedown mousewheel touchmove keydown')\n //Whether or not to activate the last scrollspy, when page/container bottom is reached\n .value('duScrollBottomSpy', false)\n //Active class name\n .value('duScrollActiveClass', 'active');\n\nif (typeof module !== 'undefined' && module && module.exports) {\n module.exports = duScroll;\n}\n\n\nangular.module('duScroll.scrollHelpers', ['duScroll.requestAnimation'])\n.run([\"$window\", \"$q\", \"cancelAnimation\", \"requestAnimation\", \"duScrollEasing\", \"duScrollDuration\", \"duScrollOffset\", \"duScrollCancelOnEvents\", function($window, $q, cancelAnimation, requestAnimation, duScrollEasing, duScrollDuration, duScrollOffset, duScrollCancelOnEvents) {\n 'use strict';\n\n var proto = {};\n\n var isDocument = function(el) {\n return (typeof HTMLDocument !== 'undefined' && el instanceof HTMLDocument) || (el.nodeType && el.nodeType === el.DOCUMENT_NODE);\n };\n\n var isElement = function(el) {\n return (typeof HTMLElement !== 'undefined' && el instanceof HTMLElement) || (el.nodeType && el.nodeType === el.ELEMENT_NODE);\n };\n\n var unwrap = function(el) {\n return isElement(el) || isDocument(el) ? el : el[0];\n };\n\n proto.duScrollTo = function(left, top, duration, easing) {\n var aliasFn;\n if(angular.isElement(left)) {\n aliasFn = this.duScrollToElement;\n } else if(angular.isDefined(duration)) {\n aliasFn = this.duScrollToAnimated;\n }\n if(aliasFn) {\n return aliasFn.apply(this, arguments);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollTo(left, top);\n }\n el.scrollLeft = left;\n el.scrollTop = top;\n };\n\n var scrollAnimation, deferred;\n proto.duScrollToAnimated = function(left, top, duration, easing) {\n if(duration && !easing) {\n easing = duScrollEasing;\n }\n var startLeft = this.duScrollLeft(),\n startTop = this.duScrollTop(),\n deltaLeft = Math.round(left - startLeft),\n deltaTop = Math.round(top - startTop);\n\n var startTime = null, progress = 0;\n var el = this;\n\n var cancelScrollAnimation = function($event) {\n if (!$event || (progress && $event.which > 0)) {\n if(duScrollCancelOnEvents) {\n el.unbind(duScrollCancelOnEvents, cancelScrollAnimation);\n }\n cancelAnimation(scrollAnimation);\n deferred.reject();\n scrollAnimation = null;\n }\n };\n\n if(scrollAnimation) {\n cancelScrollAnimation();\n }\n deferred = $q.defer();\n\n if(duration === 0 || (!deltaLeft && !deltaTop)) {\n if(duration === 0) {\n el.duScrollTo(left, top);\n }\n deferred.resolve();\n return deferred.promise;\n }\n\n var animationStep = function(timestamp) {\n if (startTime === null) {\n startTime = timestamp;\n }\n\n progress = timestamp - startTime;\n var percent = (progress >= duration ? 1 : easing(progress/duration));\n\n el.scrollTo(\n startLeft + Math.ceil(deltaLeft * percent),\n startTop + Math.ceil(deltaTop * percent)\n );\n if(percent < 1) {\n scrollAnimation = requestAnimation(animationStep);\n } else {\n if(duScrollCancelOnEvents) {\n el.unbind(duScrollCancelOnEvents, cancelScrollAnimation);\n }\n scrollAnimation = null;\n deferred.resolve();\n }\n };\n\n //Fix random mobile safari bug when scrolling to top by hitting status bar\n el.duScrollTo(startLeft, startTop);\n\n if(duScrollCancelOnEvents) {\n el.bind(duScrollCancelOnEvents, cancelScrollAnimation);\n }\n\n scrollAnimation = requestAnimation(animationStep);\n return deferred.promise;\n };\n\n proto.duScrollToElement = function(target, offset, duration, easing) {\n var el = unwrap(this);\n if(!angular.isNumber(offset) || isNaN(offset)) {\n offset = duScrollOffset;\n }\n var top = this.duScrollTop() + unwrap(target).getBoundingClientRect().top - offset;\n if(isElement(el)) {\n top -= el.getBoundingClientRect().top;\n }\n return this.duScrollTo(0, top, duration, easing);\n };\n\n proto.duScrollLeft = function(value, duration, easing) {\n if(angular.isNumber(value)) {\n return this.duScrollTo(value, this.duScrollTop(), duration, easing);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;\n }\n return el.scrollLeft;\n };\n proto.duScrollTop = function(value, duration, easing) {\n if(angular.isNumber(value)) {\n return this.duScrollTo(this.duScrollLeft(), value, duration, easing);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;\n }\n return el.scrollTop;\n };\n\n proto.duScrollToElementAnimated = function(target, offset, duration, easing) {\n return this.duScrollToElement(target, offset, duration || duScrollDuration, easing);\n };\n\n proto.duScrollTopAnimated = function(top, duration, easing) {\n return this.duScrollTop(top, duration || duScrollDuration, easing);\n };\n\n proto.duScrollLeftAnimated = function(left, duration, easing) {\n return this.duScrollLeft(left, duration || duScrollDuration, easing);\n };\n\n angular.forEach(proto, function(fn, key) {\n angular.element.prototype[key] = fn;\n\n //Remove prefix if not already claimed by jQuery / ui.utils\n var unprefixed = key.replace(/^duScroll/, 'scroll');\n if(angular.isUndefined(angular.element.prototype[unprefixed])) {\n angular.element.prototype[unprefixed] = fn;\n }\n });\n\n}]);\n\n\n//Adapted from https://gist.github.com/paulirish/1579671\nangular.module('duScroll.polyfill', [])\n.factory('polyfill', [\"$window\", function($window) {\n 'use strict';\n\n var vendors = ['webkit', 'moz', 'o', 'ms'];\n\n return function(fnName, fallback) {\n if($window[fnName]) {\n return $window[fnName];\n }\n var suffix = fnName.substr(0, 1).toUpperCase() + fnName.substr(1);\n for(var key, i = 0; i < vendors.length; i++) {\n key = vendors[i]+suffix;\n if($window[key]) {\n return $window[key];\n }\n }\n return fallback;\n };\n}]);\n\nangular.module('duScroll.requestAnimation', ['duScroll.polyfill'])\n.factory('requestAnimation', [\"polyfill\", \"$timeout\", function(polyfill, $timeout) {\n 'use strict';\n\n var lastTime = 0;\n var fallback = function(callback, element) {\n var currTime = new Date().getTime();\n var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n var id = $timeout(function() { callback(currTime + timeToCall); },\n timeToCall);\n lastTime = currTime + timeToCall;\n return id;\n };\n\n return polyfill('requestAnimationFrame', fallback);\n}])\n.factory('cancelAnimation', [\"polyfill\", \"$timeout\", function(polyfill, $timeout) {\n 'use strict';\n\n var fallback = function(promise) {\n $timeout.cancel(promise);\n };\n\n return polyfill('cancelAnimationFrame', fallback);\n}]);\n\n\nangular.module('duScroll.spyAPI', ['duScroll.scrollContainerAPI'])\n.factory('spyAPI', [\"$rootScope\", \"$timeout\", \"$window\", \"$document\", \"scrollContainerAPI\", \"duScrollGreedy\", \"duScrollSpyWait\", \"duScrollBottomSpy\", \"duScrollActiveClass\", function($rootScope, $timeout, $window, $document, scrollContainerAPI, duScrollGreedy, duScrollSpyWait, duScrollBottomSpy, duScrollActiveClass) {\n 'use strict';\n\n var createScrollHandler = function(context) {\n var timer = false, queued = false;\n var handler = function() {\n queued = false;\n var container = context.container,\n containerEl = container[0],\n containerOffset = 0,\n bottomReached;\n\n if (typeof HTMLElement !== 'undefined' && containerEl instanceof HTMLElement || containerEl.nodeType && containerEl.nodeType === containerEl.ELEMENT_NODE) {\n containerOffset = containerEl.getBoundingClientRect().top;\n bottomReached = Math.round(containerEl.scrollTop + containerEl.clientHeight) >= containerEl.scrollHeight;\n } else {\n var documentScrollHeight = $document[0].body.scrollHeight || $document[0].documentElement.scrollHeight; // documentElement for IE11\n bottomReached = Math.round($window.pageYOffset + $window.innerHeight) >= documentScrollHeight;\n }\n var compareProperty = (duScrollBottomSpy && bottomReached ? 'bottom' : 'top');\n\n var i, currentlyActive, toBeActive, spies, spy, pos;\n spies = context.spies;\n currentlyActive = context.currentlyActive;\n toBeActive = undefined;\n\n for(i = 0; i < spies.length; i++) {\n spy = spies[i];\n pos = spy.getTargetPosition();\n if (!pos) continue;\n\n if((duScrollBottomSpy && bottomReached) || (pos.top + spy.offset - containerOffset < 20 && (duScrollGreedy || pos.top*-1 + containerOffset) < pos.height)) {\n //Find the one closest the viewport top or the page bottom if it's reached\n if(!toBeActive || toBeActive[compareProperty] < pos[compareProperty]) {\n toBeActive = {\n spy: spy\n };\n toBeActive[compareProperty] = pos[compareProperty];\n }\n }\n }\n\n if(toBeActive) {\n toBeActive = toBeActive.spy;\n }\n if(currentlyActive === toBeActive || (duScrollGreedy && !toBeActive)) return;\n if(currentlyActive) {\n currentlyActive.$element.removeClass(duScrollActiveClass);\n $rootScope.$broadcast(\n 'duScrollspy:becameInactive',\n currentlyActive.$element,\n angular.element(currentlyActive.getTargetElement())\n );\n }\n if(toBeActive) {\n toBeActive.$element.addClass(duScrollActiveClass);\n $rootScope.$broadcast(\n 'duScrollspy:becameActive',\n toBeActive.$element,\n angular.element(toBeActive.getTargetElement())\n );\n }\n context.currentlyActive = toBeActive;\n };\n\n if(!duScrollSpyWait) {\n return handler;\n }\n\n //Debounce for potential performance savings\n return function() {\n if(!timer) {\n handler();\n timer = $timeout(function() {\n timer = false;\n if(queued) {\n handler();\n }\n }, duScrollSpyWait, false);\n } else {\n queued = true;\n }\n };\n };\n\n var contexts = {};\n\n var createContext = function($scope) {\n var id = $scope.$id;\n var context = {\n spies: []\n };\n\n context.handler = createScrollHandler(context);\n contexts[id] = context;\n\n $scope.$on('$destroy', function() {\n destroyContext($scope);\n });\n\n return id;\n };\n\n var destroyContext = function($scope) {\n var id = $scope.$id;\n var context = contexts[id], container = context.container;\n if(container) {\n container.off('scroll', context.handler);\n }\n delete contexts[id];\n };\n\n var defaultContextId = createContext($rootScope);\n\n var getContextForScope = function(scope) {\n if(contexts[scope.$id]) {\n return contexts[scope.$id];\n }\n if(scope.$parent) {\n return getContextForScope(scope.$parent);\n }\n return contexts[defaultContextId];\n };\n\n var getContextForSpy = function(spy) {\n var context, contextId, scope = spy.$scope;\n if(scope) {\n return getContextForScope(scope);\n }\n //No scope, most likely destroyed\n for(contextId in contexts) {\n context = contexts[contextId];\n if(context.spies.indexOf(spy) !== -1) {\n return context;\n }\n }\n };\n\n var isElementInDocument = function(element) {\n while (element.parentNode) {\n element = element.parentNode;\n if (element === document) {\n return true;\n }\n }\n return false;\n };\n\n var addSpy = function(spy) {\n var context = getContextForSpy(spy);\n if (!context) return;\n context.spies.push(spy);\n if (!context.container || !isElementInDocument(context.container)) {\n if(context.container) {\n context.container.off('scroll', context.handler);\n }\n context.container = scrollContainerAPI.getContainer(spy.$scope);\n context.container.on('scroll', context.handler).triggerHandler('scroll');\n }\n };\n\n var removeSpy = function(spy) {\n var context = getContextForSpy(spy);\n if(spy === context.currentlyActive) {\n $rootScope.$broadcast('duScrollspy:becameInactive', context.currentlyActive.$element);\n context.currentlyActive = null;\n }\n var i = context.spies.indexOf(spy);\n if(i !== -1) {\n context.spies.splice(i, 1);\n }\n\t\tspy.$element = null;\n };\n\n return {\n addSpy: addSpy,\n removeSpy: removeSpy,\n createContext: createContext,\n destroyContext: destroyContext,\n getContextForScope: getContextForScope\n };\n}]);\n\n\nangular.module('duScroll.scrollContainerAPI', [])\n.factory('scrollContainerAPI', [\"$document\", function($document) {\n 'use strict';\n\n var containers = {};\n\n var setContainer = function(scope, element) {\n var id = scope.$id;\n containers[id] = element;\n return id;\n };\n\n var getContainerId = function(scope) {\n if(containers[scope.$id]) {\n return scope.$id;\n }\n if(scope.$parent) {\n return getContainerId(scope.$parent);\n }\n return;\n };\n\n var getContainer = function(scope) {\n var id = getContainerId(scope);\n return id ? containers[id] : $document;\n };\n\n var removeContainer = function(scope) {\n var id = getContainerId(scope);\n if(id) {\n delete containers[id];\n }\n };\n\n return {\n getContainerId: getContainerId,\n getContainer: getContainer,\n setContainer: setContainer,\n removeContainer: removeContainer\n };\n}]);\n\n\nangular.module('duScroll.smoothScroll', ['duScroll.scrollHelpers', 'duScroll.scrollContainerAPI'])\n.directive('duSmoothScroll', [\"duScrollDuration\", \"duScrollOffset\", \"scrollContainerAPI\", function(duScrollDuration, duScrollOffset, scrollContainerAPI) {\n 'use strict';\n\n return {\n link : function($scope, $element, $attr) {\n $element.on('click', function(e) {\n if((!$attr.href || $attr.href.indexOf('#') === -1) && $attr.duSmoothScroll === '') return;\n\n var id = $attr.href ? $attr.href.replace(/.*(?=#[^\\s]+$)/, '').substring(1) : $attr.duSmoothScroll;\n\n var target = document.getElementById(id) || document.getElementsByName(id)[0];\n if(!target || !target.getBoundingClientRect) return;\n\n if (e.stopPropagation) e.stopPropagation();\n if (e.preventDefault) e.preventDefault();\n\n var offset = $attr.offset ? parseInt($attr.offset, 10) : duScrollOffset;\n var duration = $attr.duration ? parseInt($attr.duration, 10) : duScrollDuration;\n var container = scrollContainerAPI.getContainer($scope);\n\n container.duScrollToElement(\n angular.element(target),\n isNaN(offset) ? 0 : offset,\n isNaN(duration) ? 0 : duration\n );\n });\n }\n };\n}]);\n\n\nangular.module('duScroll.spyContext', ['duScroll.spyAPI'])\n.directive('duSpyContext', [\"spyAPI\", function(spyAPI) {\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function compile(tElement, tAttrs, transclude) {\n return {\n pre: function preLink($scope, iElement, iAttrs, controller) {\n spyAPI.createContext($scope);\n }\n };\n }\n };\n}]);\n\n\nangular.module('duScroll.scrollContainer', ['duScroll.scrollContainerAPI'])\n.directive('duScrollContainer', [\"scrollContainerAPI\", function(scrollContainerAPI){\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function compile(tElement, tAttrs, transclude) {\n return {\n pre: function preLink($scope, iElement, iAttrs, controller) {\n iAttrs.$observe('duScrollContainer', function(element) {\n if(angular.isString(element)) {\n element = document.getElementById(element);\n }\n\n element = (angular.isElement(element) ? angular.element(element) : iElement);\n scrollContainerAPI.setContainer($scope, element);\n $scope.$on('$destroy', function() {\n scrollContainerAPI.removeContainer($scope);\n });\n });\n }\n };\n }\n };\n}]);\n\n\nangular.module('duScroll.scrollspy', ['duScroll.spyAPI'])\n.directive('duScrollspy', [\"spyAPI\", \"duScrollOffset\", \"$timeout\", \"$rootScope\", function(spyAPI, duScrollOffset, $timeout, $rootScope) {\n 'use strict';\n\n var Spy = function(targetElementOrId, $scope, $element, offset) {\n if(angular.isElement(targetElementOrId)) {\n this.target = targetElementOrId;\n } else if(angular.isString(targetElementOrId)) {\n this.targetId = targetElementOrId;\n }\n this.$scope = $scope;\n this.$element = $element;\n this.offset = offset;\n };\n\n Spy.prototype.getTargetElement = function() {\n if (!this.target && this.targetId) {\n this.target = document.getElementById(this.targetId) || document.getElementsByName(this.targetId)[0];\n }\n return this.target;\n };\n\n Spy.prototype.getTargetPosition = function() {\n var target = this.getTargetElement();\n if(target) {\n return target.getBoundingClientRect();\n }\n };\n\n Spy.prototype.flushTargetCache = function() {\n if(this.targetId) {\n this.target = undefined;\n }\n };\n\n return {\n link: function ($scope, $element, $attr) {\n var href = $attr.ngHref || $attr.href;\n var targetId;\n\n if (href && href.indexOf('#') !== -1) {\n targetId = href.replace(/.*(?=#[^\\s]+$)/, '').substring(1);\n } else if($attr.duScrollspy) {\n targetId = $attr.duScrollspy;\n } else if($attr.duSmoothScroll) {\n targetId = $attr.duSmoothScroll;\n }\n if(!targetId) return;\n\n // Run this in the next execution loop so that the scroll context has a chance\n // to initialize\n var timeoutPromise = $timeout(function() {\n var spy = new Spy(targetId, $scope, $element, -($attr.offset ? parseInt($attr.offset, 10) : duScrollOffset));\n spyAPI.addSpy(spy);\n\n $scope.$on('$locationChangeSuccess', spy.flushTargetCache.bind(spy));\n var deregisterOnStateChange = $rootScope.$on('$stateChangeSuccess', spy.flushTargetCache.bind(spy));\n $scope.$on('$destroy', function() {\n spyAPI.removeSpy(spy);\n deregisterOnStateChange();\n });\n }, 0, false);\n $scope.$on('$destroy', function() {$timeout.cancel(timeoutPromise);});\n }\n };\n}]);\n\n!function(e,t,n){\"use strict\";!function o(e,t,n){function a(s,l){if(!t[s]){if(!e[s]){var i=\"function\"==typeof require&&require;if(!l&&i)return i(s,!0);if(r)return r(s,!0);var u=new Error(\"Cannot find module '\"+s+\"'\");throw u.code=\"MODULE_NOT_FOUND\",u}var c=t[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return a(n?n:t)},c,c.exports,o,e,t,n)}return t[s].exports}for(var r=\"function\"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(o,a,r){var s=function(e){return e&&e.__esModule?e:{\"default\":e}};Object.defineProperty(r,\"__esModule\",{value:!0});var l,i,u,c,d=o(\"./modules/handle-dom\"),f=o(\"./modules/utils\"),p=o(\"./modules/handle-swal-dom\"),m=o(\"./modules/handle-click\"),v=o(\"./modules/handle-key\"),y=s(v),h=o(\"./modules/default-params\"),b=s(h),g=o(\"./modules/set-params\"),w=s(g);r[\"default\"]=u=c=function(){function o(e){var t=a;return t[e]===n?b[\"default\"][e]:t[e]}var a=arguments[0];if(d.addClass(t.body,\"stop-scrolling\"),p.resetInput(),a===n)return f.logStr(\"SweetAlert expects at least 1 attribute!\"),!1;var r=f.extend({},b[\"default\"]);switch(typeof a){case\"string\":r.title=a,r.text=arguments[1]||\"\",r.type=arguments[2]||\"\";break;case\"object\":if(a.title===n)return f.logStr('Missing \"title\" argument!'),!1;r.title=a.title;for(var s in b[\"default\"])r[s]=o(s);r.confirmButtonText=r.showCancelButton?\"Confirm\":b[\"default\"].confirmButtonText,r.confirmButtonText=o(\"confirmButtonText\"),r.doneFunction=arguments[1]||null;break;default:return f.logStr('Unexpected type of argument! Expected \"string\" or \"object\", got '+typeof a),!1}w[\"default\"](r),p.fixVerticalPosition(),p.openModal(arguments[1]);for(var u=p.getModal(),v=u.querySelectorAll(\"button\"),h=[\"onclick\",\"onmouseover\",\"onmouseout\",\"onmousedown\",\"onmouseup\",\"onfocus\"],g=function(e){return m.handleButton(e,r,u)},C=0;C<v.length;C++)for(var S=0;S<h.length;S++){var x=h[S];v[C][x]=g}p.getOverlay().onclick=g,l=e.onkeydown;var k=function(e){return y[\"default\"](e,r,u)};e.onkeydown=k,e.onfocus=function(){setTimeout(function(){i!==n&&(i.focus(),i=n)},0)},c.enableButtons()},u.setDefaults=c.setDefaults=function(e){if(!e)throw new Error(\"userParams is required\");if(\"object\"!=typeof e)throw new Error(\"userParams has to be a object\");f.extend(b[\"default\"],e)},u.close=c.close=function(){var o=p.getModal();d.fadeOut(p.getOverlay(),5),d.fadeOut(o,5),d.removeClass(o,\"showSweetAlert\"),d.addClass(o,\"hideSweetAlert\"),d.removeClass(o,\"visible\");var a=o.querySelector(\".sa-icon.sa-success\");d.removeClass(a,\"animate\"),d.removeClass(a.querySelector(\".sa-tip\"),\"animateSuccessTip\"),d.removeClass(a.querySelector(\".sa-long\"),\"animateSuccessLong\");var r=o.querySelector(\".sa-icon.sa-error\");d.removeClass(r,\"animateErrorIcon\"),d.removeClass(r.querySelector(\".sa-x-mark\"),\"animateXMark\");var s=o.querySelector(\".sa-icon.sa-warning\");return d.removeClass(s,\"pulseWarning\"),d.removeClass(s.querySelector(\".sa-body\"),\"pulseWarningIns\"),d.removeClass(s.querySelector(\".sa-dot\"),\"pulseWarningIns\"),setTimeout(function(){var e=o.getAttribute(\"data-custom-class\");d.removeClass(o,e)},300),d.removeClass(t.body,\"stop-scrolling\"),e.onkeydown=l,e.previousActiveElement&&e.previousActiveElement.focus(),i=n,clearTimeout(o.timeout),!0},u.showInputError=c.showInputError=function(e){var t=p.getModal(),n=t.querySelector(\".sa-input-error\");d.addClass(n,\"show\");var o=t.querySelector(\".sa-error-container\");d.addClass(o,\"show\"),o.querySelector(\"p\").innerHTML=e,setTimeout(function(){u.enableButtons()},1),t.querySelector(\"input\").focus()},u.resetInputError=c.resetInputError=function(e){if(e&&13===e.keyCode)return!1;var t=p.getModal(),n=t.querySelector(\".sa-input-error\");d.removeClass(n,\"show\");var o=t.querySelector(\".sa-error-container\");d.removeClass(o,\"show\")},u.disableButtons=c.disableButtons=function(){var e=p.getModal(),t=e.querySelector(\"button.confirm\"),n=e.querySelector(\"button.cancel\");t.disabled=!0,n.disabled=!0},u.enableButtons=c.enableButtons=function(){var e=p.getModal(),t=e.querySelector(\"button.confirm\"),n=e.querySelector(\"button.cancel\");t.disabled=!1,n.disabled=!1},\"undefined\"!=typeof e?e.sweetAlert=e.swal=u:f.logStr(\"SweetAlert is a frontend module!\"),a.exports=r[\"default\"]},{\"./modules/default-params\":2,\"./modules/handle-click\":3,\"./modules/handle-dom\":4,\"./modules/handle-key\":5,\"./modules/handle-swal-dom\":6,\"./modules/set-params\":8,\"./modules/utils\":9}],2:[function(e,t,n){Object.defineProperty(n,\"__esModule\",{value:!0});var o={title:\"\",text:\"\",type:null,allowOutsideClick:!1,showConfirmButton:!0,showCancelButton:!1,closeOnConfirm:!0,closeOnCancel:!0,confirmButtonText:\"OK\",confirmButtonColor:\"#8CD4F5\",cancelButtonText:\"Cancel\",imageUrl:null,imageSize:null,timer:null,customClass:\"\",html:!1,animation:!0,allowEscapeKey:!0,inputType:\"text\",inputPlaceholder:\"\",inputValue:\"\",showLoaderOnConfirm:!1};n[\"default\"]=o,t.exports=n[\"default\"]},{}],3:[function(t,n,o){Object.defineProperty(o,\"__esModule\",{value:!0});var a=t(\"./utils\"),r=(t(\"./handle-swal-dom\"),t(\"./handle-dom\")),s=function(t,n,o){function s(e){m&&n.confirmButtonColor&&(p.style.backgroundColor=e)}var u,c,d,f=t||e.event,p=f.target||f.srcElement,m=-1!==p.className.indexOf(\"confirm\"),v=-1!==p.className.indexOf(\"sweet-overlay\"),y=r.hasClass(o,\"visible\"),h=n.doneFunction&&\"true\"===o.getAttribute(\"data-has-done-function\");switch(m&&n.confirmButtonColor&&(u=n.confirmButtonColor,c=a.colorLuminance(u,-.04),d=a.colorLuminance(u,-.14)),f.type){case\"mouseover\":s(c);break;case\"mouseout\":s(u);break;case\"mousedown\":s(d);break;case\"mouseup\":s(c);break;case\"focus\":var b=o.querySelector(\"button.confirm\"),g=o.querySelector(\"button.cancel\");m?g.style.boxShadow=\"none\":b.style.boxShadow=\"none\";break;case\"click\":var w=o===p,C=r.isDescendant(o,p);if(!w&&!C&&y&&!n.allowOutsideClick)break;m&&h&&y?l(o,n):h&&y||v?i(o,n):r.isDescendant(o,p)&&\"BUTTON\"===p.tagName&&sweetAlert.close()}},l=function(e,t){var n=!0;r.hasClass(e,\"show-input\")&&(n=e.querySelector(\"input\").value,n||(n=\"\")),t.doneFunction(n),t.closeOnConfirm&&sweetAlert.close(),t.showLoaderOnConfirm&&sweetAlert.disableButtons()},i=function(e,t){var n=String(t.doneFunction).replace(/\\s/g,\"\"),o=\"function(\"===n.substring(0,9)&&\")\"!==n.substring(9,10);o&&t.doneFunction(!1),t.closeOnCancel&&sweetAlert.close()};o[\"default\"]={handleButton:s,handleConfirm:l,handleCancel:i},n.exports=o[\"default\"]},{\"./handle-dom\":4,\"./handle-swal-dom\":6,\"./utils\":9}],4:[function(n,o,a){Object.defineProperty(a,\"__esModule\",{value:!0});var r=function(e,t){return new RegExp(\" \"+t+\" \").test(\" \"+e.className+\" \")},s=function(e,t){r(e,t)||(e.className+=\" \"+t)},l=function(e,t){var n=\" \"+e.className.replace(/[\\t\\r\\n]/g,\" \")+\" \";if(r(e,t)){for(;n.indexOf(\" \"+t+\" \")>=0;)n=n.replace(\" \"+t+\" \",\" \");e.className=n.replace(/^\\s+|\\s+$/g,\"\")}},i=function(e){var n=t.createElement(\"div\");return n.appendChild(t.createTextNode(e)),n.innerHTML},u=function(e){e.style.opacity=\"\",e.style.display=\"block\"},c=function(e){if(e&&!e.length)return u(e);for(var t=0;t<e.length;++t)u(e[t])},d=function(e){e.style.opacity=\"\",e.style.display=\"none\"},f=function(e){if(e&&!e.length)return d(e);for(var t=0;t<e.length;++t)d(e[t])},p=function(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1},m=function(e){e.style.left=\"-9999px\",e.style.display=\"block\";var t,n=e.clientHeight;return t=\"undefined\"!=typeof getComputedStyle?parseInt(getComputedStyle(e).getPropertyValue(\"padding-top\"),10):parseInt(e.currentStyle.padding),e.style.left=\"\",e.style.display=\"none\",\"-\"+parseInt((n+t)/2)+\"px\"},v=function(e,t){if(+e.style.opacity<1){t=t||16,e.style.opacity=0,e.style.display=\"block\";var n=+new Date,o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){e.style.opacity=+e.style.opacity+(new Date-n)/100,n=+new Date,+e.style.opacity<1&&setTimeout(o,t)});o()}e.style.display=\"block\"},y=function(e,t){t=t||16,e.style.opacity=1;var n=+new Date,o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){e.style.opacity=+e.style.opacity-(new Date-n)/100,n=+new Date,+e.style.opacity>0?setTimeout(o,t):e.style.display=\"none\"});o()},h=function(n){if(\"function\"==typeof MouseEvent){var o=new MouseEvent(\"click\",{view:e,bubbles:!1,cancelable:!0});n.dispatchEvent(o)}else if(t.createEvent){var a=t.createEvent(\"MouseEvents\");a.initEvent(\"click\",!1,!1),n.dispatchEvent(a)}else t.createEventObject?n.fireEvent(\"onclick\"):\"function\"==typeof n.onclick&&n.onclick()},b=function(t){\"function\"==typeof t.stopPropagation?(t.stopPropagation(),t.preventDefault()):e.event&&e.event.hasOwnProperty(\"cancelBubble\")&&(e.event.cancelBubble=!0)};a.hasClass=r,a.addClass=s,a.removeClass=l,a.escapeHtml=i,a._show=u,a.show=c,a._hide=d,a.hide=f,a.isDescendant=p,a.getTopMargin=m,a.fadeIn=v,a.fadeOut=y,a.fireClick=h,a.stopEventPropagation=b},{}],5:[function(t,o,a){Object.defineProperty(a,\"__esModule\",{value:!0});var r=t(\"./handle-dom\"),s=t(\"./handle-swal-dom\"),l=function(t,o,a){var l=t||e.event,i=l.keyCode||l.which,u=a.querySelector(\"button.confirm\"),c=a.querySelector(\"button.cancel\"),d=a.querySelectorAll(\"button[tabindex]\");if(-1!==[9,13,32,27].indexOf(i)){for(var f=l.target||l.srcElement,p=-1,m=0;m<d.length;m++)if(f===d[m]){p=m;break}9===i?(f=-1===p?u:p===d.length-1?d[0]:d[p+1],r.stopEventPropagation(l),f.focus(),o.confirmButtonColor&&s.setFocusStyle(f,o.confirmButtonColor)):13===i?(\"INPUT\"===f.tagName&&(f=u,u.focus()),f=-1===p?u:n):27===i&&o.allowEscapeKey===!0?(f=c,r.fireClick(f,l)):f=n}};a[\"default\"]=l,o.exports=a[\"default\"]},{\"./handle-dom\":4,\"./handle-swal-dom\":6}],6:[function(n,o,a){var r=function(e){return e&&e.__esModule?e:{\"default\":e}};Object.defineProperty(a,\"__esModule\",{value:!0});var s=n(\"./utils\"),l=n(\"./handle-dom\"),i=n(\"./default-params\"),u=r(i),c=n(\"./injected-html\"),d=r(c),f=\".sweet-alert\",p=\".sweet-overlay\",m=function(){var e=t.createElement(\"div\");for(e.innerHTML=d[\"default\"];e.firstChild;)t.body.appendChild(e.firstChild)},v=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){var e=t.querySelector(f);return e||(m(),e=v()),e}),y=function(){var e=v();return e?e.querySelector(\"input\"):void 0},h=function(){return t.querySelector(p)},b=function(e,t){var n=s.hexToRgb(t);e.style.boxShadow=\"0 0 2px rgba(\"+n+\", 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)\"},g=function(n){var o=v();l.fadeIn(h(),10),l.show(o),l.addClass(o,\"showSweetAlert\"),l.removeClass(o,\"hideSweetAlert\"),e.previousActiveElement=t.activeElement;var a=o.querySelector(\"button.confirm\");a.focus(),setTimeout(function(){l.addClass(o,\"visible\")},500);var r=o.getAttribute(\"data-timer\");if(\"null\"!==r&&\"\"!==r){var s=n;o.timeout=setTimeout(function(){var e=(s||null)&&\"true\"===o.getAttribute(\"data-has-done-function\");e?s(null):sweetAlert.close()},r)}},w=function(){var e=v(),t=y();l.removeClass(e,\"show-input\"),t.value=u[\"default\"].inputValue,t.setAttribute(\"type\",u[\"default\"].inputType),t.setAttribute(\"placeholder\",u[\"default\"].inputPlaceholder),C()},C=function(e){if(e&&13===e.keyCode)return!1;var t=v(),n=t.querySelector(\".sa-input-error\");l.removeClass(n,\"show\");var o=t.querySelector(\".sa-error-container\");l.removeClass(o,\"show\")},S=function(){var e=v();e.style.marginTop=l.getTopMargin(v())};a.sweetAlertInitialize=m,a.getModal=v,a.getOverlay=h,a.getInput=y,a.setFocusStyle=b,a.openModal=g,a.resetInput=w,a.resetInputError=C,a.fixVerticalPosition=S},{\"./default-params\":2,\"./handle-dom\":4,\"./injected-html\":7,\"./utils\":9}],7:[function(e,t,n){Object.defineProperty(n,\"__esModule\",{value:!0});var o='<div class=\"sweet-overlay\" tabIndex=\"-1\"></div><div class=\"sweet-alert\"><div class=\"sa-icon sa-error\">\\n <span class=\"sa-x-mark\">\\n <span class=\"sa-line sa-left\"></span>\\n <span class=\"sa-line sa-right\"></span>\\n </span>\\n </div><div class=\"sa-icon sa-warning\">\\n <span class=\"sa-body\"></span>\\n <span class=\"sa-dot\"></span>\\n </div><div class=\"sa-icon sa-info\"></div><div class=\"sa-icon sa-success\">\\n <span class=\"sa-line sa-tip\"></span>\\n <span class=\"sa-line sa-long\"></span>\\n\\n <div class=\"sa-placeholder\"></div>\\n <div class=\"sa-fix\"></div>\\n </div><div class=\"sa-icon sa-custom\"></div><h2>Title</h2>\\n <p>Text</p>\\n <fieldset>\\n <input type=\"text\" tabIndex=\"3\" />\\n <div class=\"sa-input-error\"></div>\\n </fieldset><div class=\"sa-error-container\">\\n <div class=\"icon\">!</div>\\n <p>Not valid!</p>\\n </div><div class=\"sa-button-container\">\\n <button class=\"cancel\" tabIndex=\"2\">Cancel</button>\\n <div class=\"sa-confirm-button-container\">\\n <button class=\"confirm\" tabIndex=\"1\">OK</button><div class=\"la-ball-fall\">\\n <div></div>\\n <div></div>\\n <div></div>\\n </div>\\n </div>\\n </div></div>';n[\"default\"]=o,t.exports=n[\"default\"]},{}],8:[function(e,t,o){Object.defineProperty(o,\"__esModule\",{value:!0});var a=e(\"./utils\"),r=e(\"./handle-swal-dom\"),s=e(\"./handle-dom\"),l=[\"error\",\"warning\",\"info\",\"success\",\"input\",\"prompt\"],i=function(e){var t=r.getModal(),o=t.querySelector(\"h2\"),i=t.querySelector(\"p\"),u=t.querySelector(\"button.cancel\"),c=t.querySelector(\"button.confirm\");if(o.innerHTML=e.html?e.title:s.escapeHtml(e.title).split(\"\\n\").join(\"<br>\"),i.innerHTML=e.html?e.text:s.escapeHtml(e.text||\"\").split(\"\\n\").join(\"<br>\"),e.text&&s.show(i),e.customClass)s.addClass(t,e.customClass),t.setAttribute(\"data-custom-class\",e.customClass);else{var d=t.getAttribute(\"data-custom-class\");s.removeClass(t,d),t.setAttribute(\"data-custom-class\",\"\")}if(s.hide(t.querySelectorAll(\".sa-icon\")),e.type&&!a.isIE8()){var f=function(){for(var o=!1,a=0;a<l.length;a++)if(e.type===l[a]){o=!0;break}if(!o)return logStr(\"Unknown alert type: \"+e.type),{v:!1};var i=[\"success\",\"error\",\"warning\",\"info\"],u=n;-1!==i.indexOf(e.type)&&(u=t.querySelector(\".sa-icon.sa-\"+e.type),s.show(u));var c=r.getInput();switch(e.type){case\"success\":s.addClass(u,\"animate\"),s.addClass(u.querySelector(\".sa-tip\"),\"animateSuccessTip\"),s.addClass(u.querySelector(\".sa-long\"),\"animateSuccessLong\");break;case\"error\":s.addClass(u,\"animateErrorIcon\"),s.addClass(u.querySelector(\".sa-x-mark\"),\"animateXMark\");break;case\"warning\":s.addClass(u,\"pulseWarning\"),s.addClass(u.querySelector(\".sa-body\"),\"pulseWarningIns\"),s.addClass(u.querySelector(\".sa-dot\"),\"pulseWarningIns\");break;case\"input\":case\"prompt\":c.setAttribute(\"type\",e.inputType),c.value=e.inputValue,c.setAttribute(\"placeholder\",e.inputPlaceholder),s.addClass(t,\"show-input\"),setTimeout(function(){c.focus(),c.addEventListener(\"keyup\",swal.resetInputError)},400)}}();if(\"object\"==typeof f)return f.v}if(e.imageUrl){var p=t.querySelector(\".sa-icon.sa-custom\");p.style.backgroundImage=\"url(\"+e.imageUrl+\")\",s.show(p);var m=80,v=80;if(e.imageSize){var y=e.imageSize.toString().split(\"x\"),h=y[0],b=y[1];h&&b?(m=h,v=b):logStr(\"Parameter imageSize expects value with format WIDTHxHEIGHT, got \"+e.imageSize)}p.setAttribute(\"style\",p.getAttribute(\"style\")+\"width:\"+m+\"px; height:\"+v+\"px\")}t.setAttribute(\"data-has-cancel-button\",e.showCancelButton),e.showCancelButton?u.style.display=\"inline-block\":s.hide(u),t.setAttribute(\"data-has-confirm-button\",e.showConfirmButton),e.showConfirmButton?c.style.display=\"inline-block\":s.hide(c),e.cancelButtonText&&(u.innerHTML=s.escapeHtml(e.cancelButtonText)),e.confirmButtonText&&(c.innerHTML=s.escapeHtml(e.confirmButtonText)),e.confirmButtonColor&&(c.style.backgroundColor=e.confirmButtonColor,c.style.borderLeftColor=e.confirmLoadingButtonColor,c.style.borderRightColor=e.confirmLoadingButtonColor,r.setFocusStyle(c,e.confirmButtonColor)),t.setAttribute(\"data-allow-outside-click\",e.allowOutsideClick);var g=e.doneFunction?!0:!1;t.setAttribute(\"data-has-done-function\",g),e.animation?\"string\"==typeof e.animation?t.setAttribute(\"data-animation\",e.animation):t.setAttribute(\"data-animation\",\"pop\"):t.setAttribute(\"data-animation\",\"none\"),t.setAttribute(\"data-timer\",e.timer)};o[\"default\"]=i,t.exports=o[\"default\"]},{\"./handle-dom\":4,\"./handle-swal-dom\":6,\"./utils\":9}],9:[function(t,n,o){Object.defineProperty(o,\"__esModule\",{value:!0});var a=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},r=function(e){var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?parseInt(t[1],16)+\", \"+parseInt(t[2],16)+\", \"+parseInt(t[3],16):null},s=function(){return e.attachEvent&&!e.addEventListener},l=function(t){e.console&&e.console.log(\"SweetAlert: \"+t)},i=function(e,t){e=String(e).replace(/[^0-9a-f]/gi,\"\"),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var n,o,a=\"#\";for(o=0;3>o;o++)n=parseInt(e.substr(2*o,2),16),n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16),a+=(\"00\"+n).substr(n.length);return a};o.extend=a,o.hexToRgb=r,o.isIE8=s,o.logStr=l,o.colorLuminance=i},{}]},{},[1]),\"function\"==typeof define&&define.amd?define(function(){return sweetAlert}):\"undefined\"!=typeof module&&module.exports&&(module.exports=sweetAlert)}(window,document);\n/**\r\n@fileOverview\r\n\r\n@toc\r\n\r\n*/\r\n\r\n'use strict';\r\n\r\nangular.module('oitozero.ngSweetAlert', [])\r\n.factory('SweetAlert', [ '$rootScope', function ( $rootScope ) {\r\n\r\n\tvar swal = window.swal;\r\n\r\n\t//public methods\r\n\tvar self = {\r\n\r\n\t\tswal: function ( arg1, arg2, arg3 ) {\r\n\t\t\t$rootScope.$evalAsync(function(){\r\n\t\t\t\tif( typeof(arg2) === 'function' ) {\r\n\t\t\t\t\tswal( arg1, function(isConfirm){\r\n\t\t\t\t\t\t$rootScope.$evalAsync( function(){\r\n\t\t\t\t\t\t\targ2(isConfirm);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}, arg3 );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tswal( arg1, arg2, arg3 );\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t},\r\n\t\tsuccess: function(title, message) {\r\n\t\t\t$rootScope.$evalAsync(function(){\r\n\t\t\t\tswal( title, message, 'success' );\r\n\t\t\t});\r\n\t\t},\r\n\t\terror: function(title, message) {\r\n\t\t\t$rootScope.$evalAsync(function(){\r\n\t\t\t\tswal( title, message, 'error' );\r\n\t\t\t});\r\n\t\t},\r\n\t\twarning: function(title, message) {\r\n\t\t\t$rootScope.$evalAsync(function(){\r\n\t\t\t\tswal( title, message, 'warning' );\r\n\t\t\t});\r\n\t\t},\r\n\t\tinfo: function(title, message) {\t\r\n\t\t\t$rootScope.$evalAsync(function(){\r\n\t\t\t\tswal( title, message, 'info' );\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\t\r\n\treturn self;\r\n}]);\r\n\n/**\n * @license AngularJS v1.5.0\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {\n\n'use strict';\n\n/**\n * @ngdoc object\n * @name angular.mock\n * @description\n *\n * Namespace from 'angular-mocks.js' which contains testing related code.\n */\nangular.mock = {};\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $browser\n *\n * @description\n * This service is a mock implementation of {@link ng.$browser}. It provides fake\n * implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr,\n * cookies, etc...\n *\n * The api of this service is the same as that of the real {@link ng.$browser $browser}, except\n * that there are several helper methods available which can be used in tests.\n */\nangular.mock.$BrowserProvider = function() {\n this.$get = function() {\n return new angular.mock.$Browser();\n };\n};\n\nangular.mock.$Browser = function() {\n var self = this;\n\n this.isMock = true;\n self.$$url = \"http://server/\";\n self.$$lastUrl = self.$$url; // used by url polling fn\n self.pollFns = [];\n\n // TODO(vojta): remove this temporary api\n self.$$completeOutstandingRequest = angular.noop;\n self.$$incOutstandingRequestCount = angular.noop;\n\n\n // register url polling fn\n\n self.onUrlChange = function(listener) {\n self.pollFns.push(\n function() {\n if (self.$$lastUrl !== self.$$url || self.$$state !== self.$$lastState) {\n self.$$lastUrl = self.$$url;\n self.$$lastState = self.$$state;\n listener(self.$$url, self.$$state);\n }\n }\n );\n\n return listener;\n };\n\n self.$$applicationDestroyed = angular.noop;\n self.$$checkUrlChange = angular.noop;\n\n self.deferredFns = [];\n self.deferredNextId = 0;\n\n self.defer = function(fn, delay) {\n delay = delay || 0;\n self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId});\n self.deferredFns.sort(function(a, b) { return a.time - b.time;});\n return self.deferredNextId++;\n };\n\n\n /**\n * @name $browser#defer.now\n *\n * @description\n * Current milliseconds mock time.\n */\n self.defer.now = 0;\n\n\n self.defer.cancel = function(deferId) {\n var fnIndex;\n\n angular.forEach(self.deferredFns, function(fn, index) {\n if (fn.id === deferId) fnIndex = index;\n });\n\n if (angular.isDefined(fnIndex)) {\n self.deferredFns.splice(fnIndex, 1);\n return true;\n }\n\n return false;\n };\n\n\n /**\n * @name $browser#defer.flush\n *\n * @description\n * Flushes all pending requests and executes the defer callbacks.\n *\n * @param {number=} number of milliseconds to flush. See {@link #defer.now}\n */\n self.defer.flush = function(delay) {\n if (angular.isDefined(delay)) {\n self.defer.now += delay;\n } else {\n if (self.deferredFns.length) {\n self.defer.now = self.deferredFns[self.deferredFns.length - 1].time;\n } else {\n throw new Error('No deferred tasks to be flushed');\n }\n }\n\n while (self.deferredFns.length && self.deferredFns[0].time <= self.defer.now) {\n self.deferredFns.shift().fn();\n }\n };\n\n self.$$baseHref = '/';\n self.baseHref = function() {\n return this.$$baseHref;\n };\n};\nangular.mock.$Browser.prototype = {\n\n/**\n * @name $browser#poll\n *\n * @description\n * run all fns in pollFns\n */\n poll: function poll() {\n angular.forEach(this.pollFns, function(pollFn) {\n pollFn();\n });\n },\n\n url: function(url, replace, state) {\n if (angular.isUndefined(state)) {\n state = null;\n }\n if (url) {\n this.$$url = url;\n // Native pushState serializes & copies the object; simulate it.\n this.$$state = angular.copy(state);\n return this;\n }\n\n return this.$$url;\n },\n\n state: function() {\n return this.$$state;\n },\n\n notifyWhenNoOutstandingRequests: function(fn) {\n fn();\n }\n};\n\n\n/**\n * @ngdoc provider\n * @name $exceptionHandlerProvider\n *\n * @description\n * Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors\n * passed to the `$exceptionHandler`.\n */\n\n/**\n * @ngdoc service\n * @name $exceptionHandler\n *\n * @description\n * Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed\n * to it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration\n * information.\n *\n *\n * ```js\n * describe('$exceptionHandlerProvider', function() {\n *\n * it('should capture log messages and exceptions', function() {\n *\n * module(function($exceptionHandlerProvider) {\n * $exceptionHandlerProvider.mode('log');\n * });\n *\n * inject(function($log, $exceptionHandler, $timeout) {\n * $timeout(function() { $log.log(1); });\n * $timeout(function() { $log.log(2); throw 'banana peel'; });\n * $timeout(function() { $log.log(3); });\n * expect($exceptionHandler.errors).toEqual([]);\n * expect($log.assertEmpty());\n * $timeout.flush();\n * expect($exceptionHandler.errors).toEqual(['banana peel']);\n * expect($log.log.logs).toEqual([[1], [2], [3]]);\n * });\n * });\n * });\n * ```\n */\n\nangular.mock.$ExceptionHandlerProvider = function() {\n var handler;\n\n /**\n * @ngdoc method\n * @name $exceptionHandlerProvider#mode\n *\n * @description\n * Sets the logging mode.\n *\n * @param {string} mode Mode of operation, defaults to `rethrow`.\n *\n * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`\n * mode stores an array of errors in `$exceptionHandler.errors`, to allow later\n * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and\n * {@link ngMock.$log#reset reset()}\n * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there\n * is a bug in the application or test, so this mock will make these tests fail.\n * For any implementations that expect exceptions to be thrown, the `rethrow` mode\n * will also maintain a log of thrown errors.\n */\n this.mode = function(mode) {\n\n switch (mode) {\n case 'log':\n case 'rethrow':\n var errors = [];\n handler = function(e) {\n if (arguments.length == 1) {\n errors.push(e);\n } else {\n errors.push([].slice.call(arguments, 0));\n }\n if (mode === \"rethrow\") {\n throw e;\n }\n };\n handler.errors = errors;\n break;\n default:\n throw new Error(\"Unknown mode '\" + mode + \"', only 'log'/'rethrow' modes are allowed!\");\n }\n };\n\n this.$get = function() {\n return handler;\n };\n\n this.mode('rethrow');\n};\n\n\n/**\n * @ngdoc service\n * @name $log\n *\n * @description\n * Mock implementation of {@link ng.$log} that gathers all logged messages in arrays\n * (one array per logging level). These arrays are exposed as `logs` property of each of the\n * level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`.\n *\n */\nangular.mock.$LogProvider = function() {\n var debug = true;\n\n function concat(array1, array2, index) {\n return array1.concat(Array.prototype.slice.call(array2, index));\n }\n\n this.debugEnabled = function(flag) {\n if (angular.isDefined(flag)) {\n debug = flag;\n return this;\n } else {\n return debug;\n }\n };\n\n this.$get = function() {\n var $log = {\n log: function() { $log.log.logs.push(concat([], arguments, 0)); },\n warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },\n info: function() { $log.info.logs.push(concat([], arguments, 0)); },\n error: function() { $log.error.logs.push(concat([], arguments, 0)); },\n debug: function() {\n if (debug) {\n $log.debug.logs.push(concat([], arguments, 0));\n }\n }\n };\n\n /**\n * @ngdoc method\n * @name $log#reset\n *\n * @description\n * Reset all of the logging arrays to empty.\n */\n $log.reset = function() {\n /**\n * @ngdoc property\n * @name $log#log.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#log `log()`}.\n *\n * @example\n * ```js\n * $log.log('Some Log');\n * var first = $log.log.logs.unshift();\n * ```\n */\n $log.log.logs = [];\n /**\n * @ngdoc property\n * @name $log#info.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#info `info()`}.\n *\n * @example\n * ```js\n * $log.info('Some Info');\n * var first = $log.info.logs.unshift();\n * ```\n */\n $log.info.logs = [];\n /**\n * @ngdoc property\n * @name $log#warn.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#warn `warn()`}.\n *\n * @example\n * ```js\n * $log.warn('Some Warning');\n * var first = $log.warn.logs.unshift();\n * ```\n */\n $log.warn.logs = [];\n /**\n * @ngdoc property\n * @name $log#error.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#error `error()`}.\n *\n * @example\n * ```js\n * $log.error('Some Error');\n * var first = $log.error.logs.unshift();\n * ```\n */\n $log.error.logs = [];\n /**\n * @ngdoc property\n * @name $log#debug.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#debug `debug()`}.\n *\n * @example\n * ```js\n * $log.debug('Some Error');\n * var first = $log.debug.logs.unshift();\n * ```\n */\n $log.debug.logs = [];\n };\n\n /**\n * @ngdoc method\n * @name $log#assertEmpty\n *\n * @description\n * Assert that all of the logging methods have no logged messages. If any messages are present,\n * an exception is thrown.\n */\n $log.assertEmpty = function() {\n var errors = [];\n angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) {\n angular.forEach($log[logLevel].logs, function(log) {\n angular.forEach(log, function(logItem) {\n errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\\n' +\n (logItem.stack || ''));\n });\n });\n });\n if (errors.length) {\n errors.unshift(\"Expected $log to be empty! Either a message was logged unexpectedly, or \" +\n \"an expected log message was not checked and removed:\");\n errors.push('');\n throw new Error(errors.join('\\n---------\\n'));\n }\n };\n\n $log.reset();\n return $log;\n };\n};\n\n\n/**\n * @ngdoc service\n * @name $interval\n *\n * @description\n * Mock implementation of the $interval service.\n *\n * Use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n * time.\n *\n * @param {function()} fn A function that should be called repeatedly.\n * @param {number} delay Number of milliseconds between each function call.\n * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n * indefinitely.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {promise} A promise which will be notified on each iteration.\n */\nangular.mock.$IntervalProvider = function() {\n this.$get = ['$browser', '$rootScope', '$q', '$$q',\n function($browser, $rootScope, $q, $$q) {\n var repeatFns = [],\n nextRepeatId = 0,\n now = 0;\n\n var $interval = function(fn, delay, count, invokeApply) {\n var hasParams = arguments.length > 4,\n args = hasParams ? Array.prototype.slice.call(arguments, 4) : [],\n iteration = 0,\n skipApply = (angular.isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise;\n\n count = (angular.isDefined(count)) ? count : 0;\n promise.then(null, null, (!hasParams) ? fn : function() {\n fn.apply(null, args);\n });\n\n promise.$$intervalId = nextRepeatId;\n\n function tick() {\n deferred.notify(iteration++);\n\n if (count > 0 && iteration >= count) {\n var fnIndex;\n deferred.resolve(iteration);\n\n angular.forEach(repeatFns, function(fn, index) {\n if (fn.id === promise.$$intervalId) fnIndex = index;\n });\n\n if (angular.isDefined(fnIndex)) {\n repeatFns.splice(fnIndex, 1);\n }\n }\n\n if (skipApply) {\n $browser.defer.flush();\n } else {\n $rootScope.$apply();\n }\n }\n\n repeatFns.push({\n nextTime:(now + delay),\n delay: delay,\n fn: tick,\n id: nextRepeatId,\n deferred: deferred\n });\n repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});\n\n nextRepeatId++;\n return promise;\n };\n /**\n * @ngdoc method\n * @name $interval#cancel\n *\n * @description\n * Cancels a task associated with the `promise`.\n *\n * @param {promise} promise A promise from calling the `$interval` function.\n * @returns {boolean} Returns `true` if the task was successfully cancelled.\n */\n $interval.cancel = function(promise) {\n if (!promise) return false;\n var fnIndex;\n\n angular.forEach(repeatFns, function(fn, index) {\n if (fn.id === promise.$$intervalId) fnIndex = index;\n });\n\n if (angular.isDefined(fnIndex)) {\n repeatFns[fnIndex].deferred.reject('canceled');\n repeatFns.splice(fnIndex, 1);\n return true;\n }\n\n return false;\n };\n\n /**\n * @ngdoc method\n * @name $interval#flush\n * @description\n *\n * Runs interval tasks scheduled to be run in the next `millis` milliseconds.\n *\n * @param {number=} millis maximum timeout amount to flush up until.\n *\n * @return {number} The amount of time moved forward.\n */\n $interval.flush = function(millis) {\n now += millis;\n while (repeatFns.length && repeatFns[0].nextTime <= now) {\n var task = repeatFns[0];\n task.fn();\n task.nextTime += task.delay;\n repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});\n }\n return millis;\n };\n\n return $interval;\n }];\n};\n\n\n/* jshint -W101 */\n/* The R_ISO8061_STR regex is never going to fit into the 100 char limit!\n * This directive should go inside the anonymous function but a bug in JSHint means that it would\n * not be enacted early enough to prevent the warning.\n */\nvar R_ISO8061_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?:\\:?(\\d\\d)(?:\\:?(\\d\\d)(?:\\.(\\d{3}))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d)))?$/;\n\nfunction jsonStringToDate(string) {\n var match;\n if (match = string.match(R_ISO8061_STR)) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0;\n if (match[9]) {\n tzHour = toInt(match[9] + match[10]);\n tzMin = toInt(match[9] + match[11]);\n }\n date.setUTCFullYear(toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));\n date.setUTCHours(toInt(match[4] || 0) - tzHour,\n toInt(match[5] || 0) - tzMin,\n toInt(match[6] || 0),\n toInt(match[7] || 0));\n return date;\n }\n return string;\n}\n\nfunction toInt(str) {\n return parseInt(str, 10);\n}\n\nfunction padNumber(num, digits, trim) {\n var neg = '';\n if (num < 0) {\n neg = '-';\n num = -num;\n }\n num = '' + num;\n while (num.length < digits) num = '0' + num;\n if (trim) {\n num = num.substr(num.length - digits);\n }\n return neg + num;\n}\n\n\n/**\n * @ngdoc type\n * @name angular.mock.TzDate\n * @description\n *\n * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`.\n *\n * Mock of the Date type which has its timezone specified via constructor arg.\n *\n * The main purpose is to create Date-like instances with timezone fixed to the specified timezone\n * offset, so that we can test code that depends on local timezone settings without dependency on\n * the time zone settings of the machine where the code is running.\n *\n * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored)\n * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC*\n *\n * @example\n * !!!! WARNING !!!!!\n * This is not a complete Date object so only methods that were implemented can be called safely.\n * To make matters worse, TzDate instances inherit stuff from Date via a prototype.\n *\n * We do our best to intercept calls to \"unimplemented\" methods, but since the list of methods is\n * incomplete we might be missing some non-standard methods. This can result in errors like:\n * \"Date.prototype.foo called on incompatible Object\".\n *\n * ```js\n * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');\n * newYearInBratislava.getTimezoneOffset() => -60;\n * newYearInBratislava.getFullYear() => 2010;\n * newYearInBratislava.getMonth() => 0;\n * newYearInBratislava.getDate() => 1;\n * newYearInBratislava.getHours() => 0;\n * newYearInBratislava.getMinutes() => 0;\n * newYearInBratislava.getSeconds() => 0;\n * ```\n *\n */\nangular.mock.TzDate = function(offset, timestamp) {\n var self = new Date(0);\n if (angular.isString(timestamp)) {\n var tsStr = timestamp;\n\n self.origDate = jsonStringToDate(timestamp);\n\n timestamp = self.origDate.getTime();\n if (isNaN(timestamp)) {\n throw {\n name: \"Illegal Argument\",\n message: \"Arg '\" + tsStr + \"' passed into TzDate constructor is not a valid date string\"\n };\n }\n } else {\n self.origDate = new Date(timestamp);\n }\n\n var localOffset = new Date(timestamp).getTimezoneOffset();\n self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60;\n self.date = new Date(timestamp + self.offsetDiff);\n\n self.getTime = function() {\n return self.date.getTime() - self.offsetDiff;\n };\n\n self.toLocaleDateString = function() {\n return self.date.toLocaleDateString();\n };\n\n self.getFullYear = function() {\n return self.date.getFullYear();\n };\n\n self.getMonth = function() {\n return self.date.getMonth();\n };\n\n self.getDate = function() {\n return self.date.getDate();\n };\n\n self.getHours = function() {\n return self.date.getHours();\n };\n\n self.getMinutes = function() {\n return self.date.getMinutes();\n };\n\n self.getSeconds = function() {\n return self.date.getSeconds();\n };\n\n self.getMilliseconds = function() {\n return self.date.getMilliseconds();\n };\n\n self.getTimezoneOffset = function() {\n return offset * 60;\n };\n\n self.getUTCFullYear = function() {\n return self.origDate.getUTCFullYear();\n };\n\n self.getUTCMonth = function() {\n return self.origDate.getUTCMonth();\n };\n\n self.getUTCDate = function() {\n return self.origDate.getUTCDate();\n };\n\n self.getUTCHours = function() {\n return self.origDate.getUTCHours();\n };\n\n self.getUTCMinutes = function() {\n return self.origDate.getUTCMinutes();\n };\n\n self.getUTCSeconds = function() {\n return self.origDate.getUTCSeconds();\n };\n\n self.getUTCMilliseconds = function() {\n return self.origDate.getUTCMilliseconds();\n };\n\n self.getDay = function() {\n return self.date.getDay();\n };\n\n // provide this method only on browsers that already have it\n if (self.toISOString) {\n self.toISOString = function() {\n return padNumber(self.origDate.getUTCFullYear(), 4) + '-' +\n padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' +\n padNumber(self.origDate.getUTCDate(), 2) + 'T' +\n padNumber(self.origDate.getUTCHours(), 2) + ':' +\n padNumber(self.origDate.getUTCMinutes(), 2) + ':' +\n padNumber(self.origDate.getUTCSeconds(), 2) + '.' +\n padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z';\n };\n }\n\n //hide all methods not implemented in this mock that the Date prototype exposes\n var unimplementedMethods = ['getUTCDay',\n 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',\n 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',\n 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',\n 'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString',\n 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];\n\n angular.forEach(unimplementedMethods, function(methodName) {\n self[methodName] = function() {\n throw new Error(\"Method '\" + methodName + \"' is not implemented in the TzDate mock\");\n };\n });\n\n return self;\n};\n\n//make \"tzDateInstance instanceof Date\" return true\nangular.mock.TzDate.prototype = Date.prototype;\n/* jshint +W101 */\n\n\n/**\n * @ngdoc service\n * @name $animate\n *\n * @description\n * Mock implementation of the {@link ng.$animate `$animate`} service. Exposes two additional methods\n * for testing animations.\n */\nangular.mock.animate = angular.module('ngAnimateMock', ['ng'])\n\n .config(['$provide', function($provide) {\n\n $provide.factory('$$forceReflow', function() {\n function reflowFn() {\n reflowFn.totalReflows++;\n }\n reflowFn.totalReflows = 0;\n return reflowFn;\n });\n\n $provide.factory('$$animateAsyncRun', function() {\n var queue = [];\n var queueFn = function() {\n return function(fn) {\n queue.push(fn);\n };\n };\n queueFn.flush = function() {\n if (queue.length === 0) return false;\n\n for (var i = 0; i < queue.length; i++) {\n queue[i]();\n }\n queue = [];\n\n return true;\n };\n return queueFn;\n });\n\n $provide.decorator('$$animateJs', ['$delegate', function($delegate) {\n var runners = [];\n\n var animateJsConstructor = function() {\n var animator = $delegate.apply($delegate, arguments);\n // If no javascript animation is found, animator is undefined\n if (animator) {\n runners.push(animator);\n }\n return animator;\n };\n\n animateJsConstructor.$closeAndFlush = function() {\n runners.forEach(function(runner) {\n runner.end();\n });\n runners = [];\n };\n\n return animateJsConstructor;\n }]);\n\n $provide.decorator('$animateCss', ['$delegate', function($delegate) {\n var runners = [];\n\n var animateCssConstructor = function(element, options) {\n var animator = $delegate(element, options);\n runners.push(animator);\n return animator;\n };\n\n animateCssConstructor.$closeAndFlush = function() {\n runners.forEach(function(runner) {\n runner.end();\n });\n runners = [];\n };\n\n return animateCssConstructor;\n }]);\n\n $provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF', '$animateCss', '$$animateJs',\n '$$forceReflow', '$$animateAsyncRun', '$rootScope',\n function($delegate, $timeout, $browser, $$rAF, $animateCss, $$animateJs,\n $$forceReflow, $$animateAsyncRun, $rootScope) {\n var animate = {\n queue: [],\n cancel: $delegate.cancel,\n on: $delegate.on,\n off: $delegate.off,\n pin: $delegate.pin,\n get reflows() {\n return $$forceReflow.totalReflows;\n },\n enabled: $delegate.enabled,\n /**\n * @ngdoc method\n * @name $animate#closeAndFlush\n * @description\n *\n * This method will close all pending animations (both {@link ngAnimate#javascript-based-animations Javascript}\n * and {@link ngAnimate.$animateCss CSS}) and it will also flush any remaining animation frames and/or callbacks.\n */\n closeAndFlush: function() {\n // we allow the flush command to swallow the errors\n // because depending on whether CSS or JS animations are\n // used, there may not be a RAF flush. The primary flush\n // at the end of this function must throw an exception\n // because it will track if there were pending animations\n this.flush(true);\n $animateCss.$closeAndFlush();\n $$animateJs.$closeAndFlush();\n this.flush();\n },\n /**\n * @ngdoc method\n * @name $animate#flush\n * @description\n *\n * This method is used to flush the pending callbacks and animation frames to either start\n * an animation or conclude an animation. Note that this will not actually close an\n * actively running animation (see {@link ngMock.$animate#closeAndFlush `closeAndFlush()`} for that).\n */\n flush: function(hideErrors) {\n $rootScope.$digest();\n\n var doNextRun, somethingFlushed = false;\n do {\n doNextRun = false;\n\n if ($$rAF.queue.length) {\n $$rAF.flush();\n doNextRun = somethingFlushed = true;\n }\n\n if ($$animateAsyncRun.flush()) {\n doNextRun = somethingFlushed = true;\n }\n } while (doNextRun);\n\n if (!somethingFlushed && !hideErrors) {\n throw new Error('No pending animations ready to be closed or flushed');\n }\n\n $rootScope.$digest();\n }\n };\n\n angular.forEach(\n ['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) {\n animate[method] = function() {\n animate.queue.push({\n event: method,\n element: arguments[0],\n options: arguments[arguments.length - 1],\n args: arguments\n });\n return $delegate[method].apply($delegate, arguments);\n };\n });\n\n return animate;\n }]);\n\n }]);\n\n\n/**\n * @ngdoc function\n * @name angular.mock.dump\n * @description\n *\n * *NOTE*: this is not an injectable instance, just a globally available function.\n *\n * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for\n * debugging.\n *\n * This method is also available on window, where it can be used to display objects on debug\n * console.\n *\n * @param {*} object - any object to turn into string.\n * @return {string} a serialized string of the argument\n */\nangular.mock.dump = function(object) {\n return serialize(object);\n\n function serialize(object) {\n var out;\n\n if (angular.isElement(object)) {\n object = angular.element(object);\n out = angular.element('<div></div>');\n angular.forEach(object, function(element) {\n out.append(angular.element(element).clone());\n });\n out = out.html();\n } else if (angular.isArray(object)) {\n out = [];\n angular.forEach(object, function(o) {\n out.push(serialize(o));\n });\n out = '[ ' + out.join(', ') + ' ]';\n } else if (angular.isObject(object)) {\n if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) {\n out = serializeScope(object);\n } else if (object instanceof Error) {\n out = object.stack || ('' + object.name + ': ' + object.message);\n } else {\n // TODO(i): this prevents methods being logged,\n // we should have a better way to serialize objects\n out = angular.toJson(object, true);\n }\n } else {\n out = String(object);\n }\n\n return out;\n }\n\n function serializeScope(scope, offset) {\n offset = offset || ' ';\n var log = [offset + 'Scope(' + scope.$id + '): {'];\n for (var key in scope) {\n if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\\$|this)/)) {\n log.push(' ' + key + ': ' + angular.toJson(scope[key]));\n }\n }\n var child = scope.$$childHead;\n while (child) {\n log.push(serializeScope(child, offset + ' '));\n child = child.$$nextSibling;\n }\n log.push('}');\n return log.join('\\n' + offset);\n }\n};\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @description\n * Fake HTTP backend implementation suitable for unit testing applications that use the\n * {@link ng.$http $http service}.\n *\n * *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less\n * development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}.\n *\n * During unit testing, we want our unit tests to run quickly and have no external dependencies so\n * we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or\n * [JSONP](http://en.wikipedia.org/wiki/JSONP) requests to a real server. All we really need is\n * to verify whether a certain request has been sent or not, or alternatively just let the\n * application make requests, respond with pre-trained responses and assert that the end result is\n * what we expect it to be.\n *\n * This mock implementation can be used to respond with static or dynamic responses via the\n * `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc).\n *\n * When an Angular application needs some data from a server, it calls the $http service, which\n * sends the request to a real server using $httpBackend service. With dependency injection, it is\n * easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify\n * the requests and respond with some testing data without sending a request to a real server.\n *\n * There are two ways to specify what test data should be returned as http responses by the mock\n * backend when the code under test makes http requests:\n *\n * - `$httpBackend.expect` - specifies a request expectation\n * - `$httpBackend.when` - specifies a backend definition\n *\n *\n * ## Request Expectations vs Backend Definitions\n *\n * Request expectations provide a way to make assertions about requests made by the application and\n * to define responses for those requests. The test will fail if the expected requests are not made\n * or they are made in the wrong order.\n *\n * Backend definitions allow you to define a fake backend for your application which doesn't assert\n * if a particular request was made or not, it just returns a trained response if a request is made.\n * The test will pass whether or not the request gets made during testing.\n *\n *\n * <table class=\"table\">\n * <tr><th width=\"220px\"></th><th>Request expectations</th><th>Backend definitions</th></tr>\n * <tr>\n * <th>Syntax</th>\n * <td>.expect(...).respond(...)</td>\n * <td>.when(...).respond(...)</td>\n * </tr>\n * <tr>\n * <th>Typical usage</th>\n * <td>strict unit tests</td>\n * <td>loose (black-box) unit testing</td>\n * </tr>\n * <tr>\n * <th>Fulfills multiple requests</th>\n * <td>NO</td>\n * <td>YES</td>\n * </tr>\n * <tr>\n * <th>Order of requests matters</th>\n * <td>YES</td>\n * <td>NO</td>\n * </tr>\n * <tr>\n * <th>Request required</th>\n * <td>YES</td>\n * <td>NO</td>\n * </tr>\n * <tr>\n * <th>Response required</th>\n * <td>optional (see below)</td>\n * <td>YES</td>\n * </tr>\n * </table>\n *\n * In cases where both backend definitions and request expectations are specified during unit\n * testing, the request expectations are evaluated first.\n *\n * If a request expectation has no response specified, the algorithm will search your backend\n * definitions for an appropriate response.\n *\n * If a request didn't match any expectation or if the expectation doesn't have the response\n * defined, the backend definitions are evaluated in sequential order to see if any of them match\n * the request. The response from the first matched definition is returned.\n *\n *\n * ## Flushing HTTP requests\n *\n * The $httpBackend used in production always responds to requests asynchronously. If we preserved\n * this behavior in unit testing, we'd have to create async unit tests, which are hard to write,\n * to follow and to maintain. But neither can the testing mock respond synchronously; that would\n * change the execution of the code under test. For this reason, the mock $httpBackend has a\n * `flush()` method, which allows the test to explicitly flush pending requests. This preserves\n * the async api of the backend, while allowing the test to execute synchronously.\n *\n *\n * ## Unit testing with mock $httpBackend\n * The following code shows how to setup and use the mock backend when unit testing a controller.\n * First we create the controller under test:\n *\n ```js\n // The module code\n angular\n .module('MyApp', [])\n .controller('MyController', MyController);\n\n // The controller code\n function MyController($scope, $http) {\n var authToken;\n\n $http.get('/auth.py').then(function(response) {\n authToken = response.headers('A-Token');\n $scope.user = response.data;\n });\n\n $scope.saveMessage = function(message) {\n var headers = { 'Authorization': authToken };\n $scope.status = 'Saving...';\n\n $http.post('/add-msg.py', message, { headers: headers } ).then(function(response) {\n $scope.status = '';\n }).catch(function() {\n $scope.status = 'Failed...';\n });\n };\n }\n ```\n *\n * Now we setup the mock backend and create the test specs:\n *\n ```js\n // testing controller\n describe('MyController', function() {\n var $httpBackend, $rootScope, createController, authRequestHandler;\n\n // Set up the module\n beforeEach(module('MyApp'));\n\n beforeEach(inject(function($injector) {\n // Set up the mock http service responses\n $httpBackend = $injector.get('$httpBackend');\n // backend definition common for all tests\n authRequestHandler = $httpBackend.when('GET', '/auth.py')\n .respond({userId: 'userX'}, {'A-Token': 'xxx'});\n\n // Get hold of a scope (i.e. the root scope)\n $rootScope = $injector.get('$rootScope');\n // The $controller service is used to create instances of controllers\n var $controller = $injector.get('$controller');\n\n createController = function() {\n return $controller('MyController', {'$scope' : $rootScope });\n };\n }));\n\n\n afterEach(function() {\n $httpBackend.verifyNoOutstandingExpectation();\n $httpBackend.verifyNoOutstandingRequest();\n });\n\n\n it('should fetch authentication token', function() {\n $httpBackend.expectGET('/auth.py');\n var controller = createController();\n $httpBackend.flush();\n });\n\n\n it('should fail authentication', function() {\n\n // Notice how you can change the response even after it was set\n authRequestHandler.respond(401, '');\n\n $httpBackend.expectGET('/auth.py');\n var controller = createController();\n $httpBackend.flush();\n expect($rootScope.status).toBe('Failed...');\n });\n\n\n it('should send msg to server', function() {\n var controller = createController();\n $httpBackend.flush();\n\n // now you don’t care about the authentication, but\n // the controller will still send the request and\n // $httpBackend will respond without you having to\n // specify the expectation and response for this request\n\n $httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, '');\n $rootScope.saveMessage('message content');\n expect($rootScope.status).toBe('Saving...');\n $httpBackend.flush();\n expect($rootScope.status).toBe('');\n });\n\n\n it('should send auth header', function() {\n var controller = createController();\n $httpBackend.flush();\n\n $httpBackend.expectPOST('/add-msg.py', undefined, function(headers) {\n // check if the header was sent, if it wasn't the expectation won't\n // match the request and the test will fail\n return headers['Authorization'] == 'xxx';\n }).respond(201, '');\n\n $rootScope.saveMessage('whatever');\n $httpBackend.flush();\n });\n });\n ```\n *\n * ## Dynamic responses\n *\n * You define a response to a request by chaining a call to `respond()` onto a definition or expectation.\n * If you provide a **callback** as the first parameter to `respond(callback)` then you can dynamically generate\n * a response based on the properties of the request.\n *\n * The `callback` function should be of the form `function(method, url, data, headers, params)`.\n *\n * ### Query parameters\n *\n * By default, query parameters on request URLs are parsed into the `params` object. So a request URL\n * of `/list?q=searchstr&orderby=-name` would set `params` to be `{q: 'searchstr', orderby: '-name'}`.\n *\n * ### Regex parameter matching\n *\n * If an expectation or definition uses a **regex** to match the URL, you can provide an array of **keys** via a\n * `params` argument. The index of each **key** in the array will match the index of a **group** in the\n * **regex**.\n *\n * The `params` object in the **callback** will now have properties with these keys, which hold the value of the\n * corresponding **group** in the **regex**.\n *\n * This also applies to the `when` and `expect` shortcut methods.\n *\n *\n * ```js\n * $httpBackend.expect('GET', /\\/user\\/(.+)/, undefined, undefined, ['id'])\n * .respond(function(method, url, data, headers, params) {\n * // for requested url of '/user/1234' params is {id: '1234'}\n * });\n *\n * $httpBackend.whenPATCH(/\\/user\\/(.+)\\/article\\/(.+)/, undefined, undefined, ['user', 'article'])\n * .respond(function(method, url, data, headers, params) {\n * // for url of '/user/1234/article/567' params is {user: '1234', article: '567'}\n * });\n * ```\n *\n * ## Matching route requests\n *\n * For extra convenience, `whenRoute` and `expectRoute` shortcuts are available. These methods offer colon\n * delimited matching of the url path, ignoring the query string. This allows declarations\n * similar to how application routes are configured with `$routeProvider`. Because these methods convert\n * the definition url to regex, declaration order is important. Combined with query parameter parsing,\n * the following is possible:\n *\n ```js\n $httpBackend.whenRoute('GET', '/users/:id')\n .respond(function(method, url, data, headers, params) {\n return [200, MockUserList[Number(params.id)]];\n });\n\n $httpBackend.whenRoute('GET', '/users')\n .respond(function(method, url, data, headers, params) {\n var userList = angular.copy(MockUserList),\n defaultSort = 'lastName',\n count, pages, isPrevious, isNext;\n\n // paged api response '/v1/users?page=2'\n params.page = Number(params.page) || 1;\n\n // query for last names '/v1/users?q=Archer'\n if (params.q) {\n userList = $filter('filter')({lastName: params.q});\n }\n\n pages = Math.ceil(userList.length / pagingLength);\n isPrevious = params.page > 1;\n isNext = params.page < pages;\n\n return [200, {\n count: userList.length,\n previous: isPrevious,\n next: isNext,\n // sort field -> '/v1/users?sortBy=firstName'\n results: $filter('orderBy')(userList, params.sortBy || defaultSort)\n .splice((params.page - 1) * pagingLength, pagingLength)\n }];\n });\n ```\n */\nangular.mock.$HttpBackendProvider = function() {\n this.$get = ['$rootScope', '$timeout', createHttpBackendMock];\n};\n\n/**\n * General factory function for $httpBackend mock.\n * Returns instance for unit testing (when no arguments specified):\n * - passing through is disabled\n * - auto flushing is disabled\n *\n * Returns instance for e2e testing (when `$delegate` and `$browser` specified):\n * - passing through (delegating request to real backend) is enabled\n * - auto flushing is enabled\n *\n * @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified)\n * @param {Object=} $browser Auto-flushing enabled if specified\n * @return {Object} Instance of $httpBackend mock\n */\nfunction createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {\n var definitions = [],\n expectations = [],\n responses = [],\n responsesPush = angular.bind(responses, responses.push),\n copy = angular.copy;\n\n function createResponse(status, data, headers, statusText) {\n if (angular.isFunction(status)) return status;\n\n return function() {\n return angular.isNumber(status)\n ? [status, data, headers, statusText]\n : [200, status, data, headers];\n };\n }\n\n // TODO(vojta): change params to: method, url, data, headers, callback\n function $httpBackend(method, url, data, callback, headers, timeout, withCredentials) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n function wrapResponse(wrapped) {\n if (!$browser && timeout) {\n timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);\n }\n\n return handleResponse;\n\n function handleResponse() {\n var response = wrapped.response(method, url, data, headers, wrapped.params(url));\n xhr.$$respHeaders = response[2];\n callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),\n copy(response[3] || ''));\n }\n\n function handleTimeout() {\n for (var i = 0, ii = responses.length; i < ii; i++) {\n if (responses[i] === handleResponse) {\n responses.splice(i, 1);\n callback(-1, undefined, '');\n break;\n }\n }\n }\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data)) {\n throw new Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n }\n\n if (!expectation.matchHeaders(headers)) {\n throw new Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n }\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(wrapResponse(expectation));\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers, timeout, withCredentials);\n } else throw new Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n new Error('No response defined !') :\n new Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }\n\n /**\n * @ngdoc method\n * @name $httpBackend#when\n * @description\n * Creates a new backend definition.\n *\n * @param {string} method HTTP method.\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives\n * data string and returns true if the data is as expected.\n * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header\n * object and returns true if the headers match the current definition.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n *\n * - respond –\n * `{function([status,] data[, headers, statusText])\n * | function(function(method, url, data, headers, params)}`\n * – The respond method takes a set of static data to be returned or a function that can\n * return an array containing response status (number), response data (string), response\n * headers (Object), and the text for the status (string). The respond method returns the\n * `requestHandler` object for possible overrides.\n */\n $httpBackend.when = function(method, url, data, headers, keys) {\n var definition = new MockHttpExpectation(method, url, data, headers, keys),\n chain = {\n respond: function(status, data, headers, statusText) {\n definition.passThrough = undefined;\n definition.response = createResponse(status, data, headers, statusText);\n return chain;\n }\n };\n\n if ($browser) {\n chain.passThrough = function() {\n definition.response = undefined;\n definition.passThrough = true;\n return chain;\n };\n }\n\n definitions.push(definition);\n return chain;\n };\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenGET\n * @description\n * Creates a new backend definition for GET requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenHEAD\n * @description\n * Creates a new backend definition for HEAD requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenDELETE\n * @description\n * Creates a new backend definition for DELETE requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenPOST\n * @description\n * Creates a new backend definition for POST requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives\n * data string and returns true if the data is as expected.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenPUT\n * @description\n * Creates a new backend definition for PUT requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives\n * data string and returns true if the data is as expected.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenJSONP\n * @description\n * Creates a new backend definition for JSONP requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n createShortMethods('when');\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenRoute\n * @description\n * Creates a new backend definition that compares only with the requested route.\n *\n * @param {string} method HTTP method.\n * @param {string} url HTTP url string that supports colon param matching.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled. See #when for more info.\n */\n $httpBackend.whenRoute = function(method, url) {\n var pathObj = parseRoute(url);\n return $httpBackend.when(method, pathObj.regexp, undefined, undefined, pathObj.keys);\n };\n\n function parseRoute(url) {\n var ret = {\n regexp: url\n },\n keys = ret.keys = [];\n\n if (!url || !angular.isString(url)) return ret;\n\n url = url\n .replace(/([().])/g, '\\\\$1')\n .replace(/(\\/)?:(\\w+)([\\?\\*])?/g, function(_, slash, key, option) {\n var optional = option === '?' ? option : null;\n var star = option === '*' ? option : null;\n keys.push({ name: key, optional: !!optional });\n slash = slash || '';\n return ''\n + (optional ? '' : slash)\n + '(?:'\n + (optional ? slash : '')\n + (star && '(.+?)' || '([^/]+)')\n + (optional || '')\n + ')'\n + (optional || '');\n })\n .replace(/([\\/$\\*])/g, '\\\\$1');\n\n ret.regexp = new RegExp('^' + url, 'i');\n return ret;\n }\n\n /**\n * @ngdoc method\n * @name $httpBackend#expect\n * @description\n * Creates a new request expectation.\n *\n * @param {string} method HTTP method.\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that\n * receives data string and returns true if the data is as expected, or Object if request body\n * is in JSON format.\n * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header\n * object and returns true if the headers match the current expectation.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n *\n * - respond –\n * `{function([status,] data[, headers, statusText])\n * | function(function(method, url, data, headers, params)}`\n * – The respond method takes a set of static data to be returned or a function that can\n * return an array containing response status (number), response data (string), response\n * headers (Object), and the text for the status (string). The respond method returns the\n * `requestHandler` object for possible overrides.\n */\n $httpBackend.expect = function(method, url, data, headers, keys) {\n var expectation = new MockHttpExpectation(method, url, data, headers, keys),\n chain = {\n respond: function(status, data, headers, statusText) {\n expectation.response = createResponse(status, data, headers, statusText);\n return chain;\n }\n };\n\n expectations.push(expectation);\n return chain;\n };\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectGET\n * @description\n * Creates a new request expectation for GET requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {Object=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled. See #expect for more info.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectHEAD\n * @description\n * Creates a new request expectation for HEAD requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {Object=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectDELETE\n * @description\n * Creates a new request expectation for DELETE requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {Object=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectPOST\n * @description\n * Creates a new request expectation for POST requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that\n * receives data string and returns true if the data is as expected, or Object if request body\n * is in JSON format.\n * @param {Object=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectPUT\n * @description\n * Creates a new request expectation for PUT requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that\n * receives data string and returns true if the data is as expected, or Object if request body\n * is in JSON format.\n * @param {Object=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectPATCH\n * @description\n * Creates a new request expectation for PATCH requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that\n * receives data string and returns true if the data is as expected, or Object if request body\n * is in JSON format.\n * @param {Object=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectJSONP\n * @description\n * Creates a new request expectation for JSONP requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives an url\n * and returns true if the url matches the current definition.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described above.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n createShortMethods('expect');\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectRoute\n * @description\n * Creates a new request expectation that compares only with the requested route.\n *\n * @param {string} method HTTP method.\n * @param {string} url HTTP url string that supports colon param matching.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled. See #expect for more info.\n */\n $httpBackend.expectRoute = function(method, url) {\n var pathObj = parseRoute(url);\n return $httpBackend.expect(method, pathObj.regexp, undefined, undefined, pathObj.keys);\n };\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#flush\n * @description\n * Flushes all pending requests using the trained responses.\n *\n * @param {number=} count Number of responses to flush (in the order they arrived). If undefined,\n * all pending requests will be flushed. If there are no pending requests when the flush method\n * is called an exception is thrown (as this typically a sign of programming error).\n */\n $httpBackend.flush = function(count, digest) {\n if (digest !== false) $rootScope.$digest();\n if (!responses.length) throw new Error('No pending request to flush !');\n\n if (angular.isDefined(count) && count !== null) {\n while (count--) {\n if (!responses.length) throw new Error('No more pending request to flush !');\n responses.shift()();\n }\n } else {\n while (responses.length) {\n responses.shift()();\n }\n }\n $httpBackend.verifyNoOutstandingExpectation(digest);\n };\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#verifyNoOutstandingExpectation\n * @description\n * Verifies that all of the requests defined via the `expect` api were made. If any of the\n * requests were not made, verifyNoOutstandingExpectation throws an exception.\n *\n * Typically, you would call this method following each test case that asserts requests using an\n * \"afterEach\" clause.\n *\n * ```js\n * afterEach($httpBackend.verifyNoOutstandingExpectation);\n * ```\n */\n $httpBackend.verifyNoOutstandingExpectation = function(digest) {\n if (digest !== false) $rootScope.$digest();\n if (expectations.length) {\n throw new Error('Unsatisfied requests: ' + expectations.join(', '));\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#verifyNoOutstandingRequest\n * @description\n * Verifies that there are no outstanding requests that need to be flushed.\n *\n * Typically, you would call this method following each test case that asserts requests using an\n * \"afterEach\" clause.\n *\n * ```js\n * afterEach($httpBackend.verifyNoOutstandingRequest);\n * ```\n */\n $httpBackend.verifyNoOutstandingRequest = function() {\n if (responses.length) {\n throw new Error('Unflushed requests: ' + responses.length);\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#resetExpectations\n * @description\n * Resets all request expectations, but preserves all backend definitions. Typically, you would\n * call resetExpectations during a multiple-phase test when you want to reuse the same instance of\n * $httpBackend mock.\n */\n $httpBackend.resetExpectations = function() {\n expectations.length = 0;\n responses.length = 0;\n };\n\n return $httpBackend;\n\n\n function createShortMethods(prefix) {\n angular.forEach(['GET', 'DELETE', 'JSONP', 'HEAD'], function(method) {\n $httpBackend[prefix + method] = function(url, headers, keys) {\n return $httpBackend[prefix](method, url, undefined, headers, keys);\n };\n });\n\n angular.forEach(['PUT', 'POST', 'PATCH'], function(method) {\n $httpBackend[prefix + method] = function(url, data, headers, keys) {\n return $httpBackend[prefix](method, url, data, headers, keys);\n };\n });\n }\n}\n\nfunction MockHttpExpectation(method, url, data, headers, keys) {\n\n this.data = data;\n this.headers = headers;\n\n this.match = function(m, u, d, h) {\n if (method != m) return false;\n if (!this.matchUrl(u)) return false;\n if (angular.isDefined(d) && !this.matchData(d)) return false;\n if (angular.isDefined(h) && !this.matchHeaders(h)) return false;\n return true;\n };\n\n this.matchUrl = function(u) {\n if (!url) return true;\n if (angular.isFunction(url.test)) return url.test(u);\n if (angular.isFunction(url)) return url(u);\n return url == u;\n };\n\n this.matchHeaders = function(h) {\n if (angular.isUndefined(headers)) return true;\n if (angular.isFunction(headers)) return headers(h);\n return angular.equals(headers, h);\n };\n\n this.matchData = function(d) {\n if (angular.isUndefined(data)) return true;\n if (data && angular.isFunction(data.test)) return data.test(d);\n if (data && angular.isFunction(data)) return data(d);\n if (data && !angular.isString(data)) {\n return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d));\n }\n return data == d;\n };\n\n this.toString = function() {\n return method + ' ' + url;\n };\n\n this.params = function(u) {\n return angular.extend(parseQuery(), pathParams());\n\n function pathParams() {\n var keyObj = {};\n if (!url || !angular.isFunction(url.test) || !keys || keys.length === 0) return keyObj;\n\n var m = url.exec(u);\n if (!m) return keyObj;\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = keys[i - 1];\n var val = m[i];\n if (key && val) {\n keyObj[key.name || key] = val;\n }\n }\n\n return keyObj;\n }\n\n function parseQuery() {\n var obj = {}, key_value, key,\n queryStr = u.indexOf('?') > -1\n ? u.substring(u.indexOf('?') + 1)\n : \"\";\n\n angular.forEach(queryStr.split('&'), function(keyValue) {\n if (keyValue) {\n key_value = keyValue.replace(/\\+/g,'%20').split('=');\n key = tryDecodeURIComponent(key_value[0]);\n if (angular.isDefined(key)) {\n var val = angular.isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true;\n if (!hasOwnProperty.call(obj, key)) {\n obj[key] = val;\n } else if (angular.isArray(obj[key])) {\n obj[key].push(val);\n } else {\n obj[key] = [obj[key],val];\n }\n }\n }\n });\n return obj;\n }\n function tryDecodeURIComponent(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n // Ignore any invalid uri component\n }\n }\n };\n}\n\nfunction createMockXhr() {\n return new MockXhr();\n}\n\nfunction MockXhr() {\n\n // hack for testing $http, $httpBackend\n MockXhr.$$lastInstance = this;\n\n this.open = function(method, url, async) {\n this.$$method = method;\n this.$$url = url;\n this.$$async = async;\n this.$$reqHeaders = {};\n this.$$respHeaders = {};\n };\n\n this.send = function(data) {\n this.$$data = data;\n };\n\n this.setRequestHeader = function(key, value) {\n this.$$reqHeaders[key] = value;\n };\n\n this.getResponseHeader = function(name) {\n // the lookup must be case insensitive,\n // that's why we try two quick lookups first and full scan last\n var header = this.$$respHeaders[name];\n if (header) return header;\n\n name = angular.lowercase(name);\n header = this.$$respHeaders[name];\n if (header) return header;\n\n header = undefined;\n angular.forEach(this.$$respHeaders, function(headerVal, headerName) {\n if (!header && angular.lowercase(headerName) == name) header = headerVal;\n });\n return header;\n };\n\n this.getAllResponseHeaders = function() {\n var lines = [];\n\n angular.forEach(this.$$respHeaders, function(value, key) {\n lines.push(key + ': ' + value);\n });\n return lines.join('\\n');\n };\n\n this.abort = angular.noop;\n}\n\n\n/**\n * @ngdoc service\n * @name $timeout\n * @description\n *\n * This service is just a simple decorator for {@link ng.$timeout $timeout} service\n * that adds a \"flush\" and \"verifyNoPendingTasks\" methods.\n */\n\nangular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $browser) {\n\n /**\n * @ngdoc method\n * @name $timeout#flush\n * @description\n *\n * Flushes the queue of pending tasks.\n *\n * @param {number=} delay maximum timeout amount to flush up until\n */\n $delegate.flush = function(delay) {\n $browser.defer.flush(delay);\n };\n\n /**\n * @ngdoc method\n * @name $timeout#verifyNoPendingTasks\n * @description\n *\n * Verifies that there are no pending tasks that need to be flushed.\n */\n $delegate.verifyNoPendingTasks = function() {\n if ($browser.deferredFns.length) {\n throw new Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' +\n formatPendingTasksAsString($browser.deferredFns));\n }\n };\n\n function formatPendingTasksAsString(tasks) {\n var result = [];\n angular.forEach(tasks, function(task) {\n result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}');\n });\n\n return result.join(', ');\n }\n\n return $delegate;\n}];\n\nangular.mock.$RAFDecorator = ['$delegate', function($delegate) {\n var rafFn = function(fn) {\n var index = rafFn.queue.length;\n rafFn.queue.push(fn);\n return function() {\n rafFn.queue.splice(index, 1);\n };\n };\n\n rafFn.queue = [];\n rafFn.supported = $delegate.supported;\n\n rafFn.flush = function() {\n if (rafFn.queue.length === 0) {\n throw new Error('No rAF callbacks present');\n }\n\n var length = rafFn.queue.length;\n for (var i = 0; i < length; i++) {\n rafFn.queue[i]();\n }\n\n rafFn.queue = rafFn.queue.slice(i);\n };\n\n return rafFn;\n}];\n\n/**\n *\n */\nangular.mock.$RootElementProvider = function() {\n this.$get = function() {\n return angular.element('<div ng-app></div>');\n };\n};\n\n/**\n * @ngdoc service\n * @name $controller\n * @description\n * A decorator for {@link ng.$controller} with additional `bindings` parameter, useful when testing\n * controllers of directives that use {@link $compile#-bindtocontroller- `bindToController`}.\n *\n *\n * ## Example\n *\n * ```js\n *\n * // Directive definition ...\n *\n * myMod.directive('myDirective', {\n * controller: 'MyDirectiveController',\n * bindToController: {\n * name: '@'\n * }\n * });\n *\n *\n * // Controller definition ...\n *\n * myMod.controller('MyDirectiveController', ['$log', function($log) {\n * $log.info(this.name);\n * })];\n *\n *\n * // In a test ...\n *\n * describe('myDirectiveController', function() {\n * it('should write the bound name to the log', inject(function($controller, $log) {\n * var ctrl = $controller('MyDirectiveController', { /* no locals */ }, { name: 'Clark Kent' });\n * expect(ctrl.name).toEqual('Clark Kent');\n * expect($log.info.logs).toEqual(['Clark Kent']);\n * });\n * });\n *\n * ```\n *\n * @param {Function|string} constructor If called with a function then it's considered to be the\n * controller constructor function. Otherwise it's considered to be a string which is used\n * to retrieve the controller constructor using the following steps:\n *\n * * check if a controller with given name is registered via `$controllerProvider`\n * * check if evaluating the string on the current scope returns a constructor\n * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global\n * `window` object (not recommended)\n *\n * The string can use the `controller as property` syntax, where the controller instance is published\n * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n * to work correctly.\n *\n * @param {Object} locals Injection locals for Controller.\n * @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used\n * to simulate the `bindToController` feature and simplify certain kinds of tests.\n * @return {Object} Instance of given controller.\n */\nangular.mock.$ControllerDecorator = ['$delegate', function($delegate) {\n return function(expression, locals, later, ident) {\n if (later && typeof later === 'object') {\n var create = $delegate(expression, locals, true, ident);\n angular.extend(create.instance, later);\n return create();\n }\n return $delegate(expression, locals, later, ident);\n };\n}];\n\n/**\n * @ngdoc service\n * @name $componentController\n * @description\n * A service that can be used to create instances of component controllers.\n * <div class=\"alert alert-info\">\n * Be aware that the controller will be instantiated and attached to the scope as specified in\n * the component definition object. That means that you must always provide a `$scope` object\n * in the `locals` param.\n * </div>\n * @param {string} componentName the name of the component whose controller we want to instantiate\n * @param {Object} locals Injection locals for Controller.\n * @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used\n * to simulate the `bindToController` feature and simplify certain kinds of tests.\n * @param {string=} ident Override the property name to use when attaching the controller to the scope.\n * @return {Object} Instance of requested controller.\n */\nangular.mock.$ComponentControllerProvider = ['$compileProvider', function($compileProvider) {\n return {\n $get: ['$controller','$injector', function($controller,$injector) {\n return function $componentController(componentName, locals, bindings, ident) {\n // get all directives associated to the component name\n var directives = $injector.get(componentName + 'Directive');\n // look for those directives that are components\n var candidateDirectives = directives.filter(function(directiveInfo) {\n // components have controller, controllerAs and restrict:'E'\n return directiveInfo.controller && directiveInfo.controllerAs && directiveInfo.restrict === 'E';\n });\n // check if valid directives found\n if (candidateDirectives.length === 0) {\n throw new Error('No component found');\n }\n if (candidateDirectives.length > 1) {\n throw new Error('Too many components found');\n }\n // get the info of the component\n var directiveInfo = candidateDirectives[0];\n return $controller(directiveInfo.controller, locals, bindings, ident || directiveInfo.controllerAs);\n };\n }]\n };\n}];\n\n\n/**\n * @ngdoc module\n * @name ngMock\n * @packageName angular-mocks\n * @description\n *\n * # ngMock\n *\n * The `ngMock` module provides support to inject and mock Angular services into unit tests.\n * In addition, ngMock also extends various core ng services such that they can be\n * inspected and controlled in a synchronous manner within test code.\n *\n *\n * <div doc-module-components=\"ngMock\"></div>\n *\n */\nangular.module('ngMock', ['ng']).provider({\n $browser: angular.mock.$BrowserProvider,\n $exceptionHandler: angular.mock.$ExceptionHandlerProvider,\n $log: angular.mock.$LogProvider,\n $interval: angular.mock.$IntervalProvider,\n $httpBackend: angular.mock.$HttpBackendProvider,\n $rootElement: angular.mock.$RootElementProvider,\n $componentController: angular.mock.$ComponentControllerProvider\n}).config(['$provide', function($provide) {\n $provide.decorator('$timeout', angular.mock.$TimeoutDecorator);\n $provide.decorator('$$rAF', angular.mock.$RAFDecorator);\n $provide.decorator('$rootScope', angular.mock.$RootScopeDecorator);\n $provide.decorator('$controller', angular.mock.$ControllerDecorator);\n}]);\n\n/**\n * @ngdoc module\n * @name ngMockE2E\n * @module ngMockE2E\n * @packageName angular-mocks\n * @description\n *\n * The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing.\n * Currently there is only one mock present in this module -\n * the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock.\n */\nangular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {\n $provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);\n}]);\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @module ngMockE2E\n * @description\n * Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of\n * applications that use the {@link ng.$http $http service}.\n *\n * *Note*: For fake http backend implementation suitable for unit testing please see\n * {@link ngMock.$httpBackend unit-testing $httpBackend mock}.\n *\n * This implementation can be used to respond with static or dynamic responses via the `when` api\n * and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the\n * real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch\n * templates from a webserver).\n *\n * As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application\n * is being developed with the real backend api replaced with a mock, it is often desirable for\n * certain category of requests to bypass the mock and issue a real http request (e.g. to fetch\n * templates or static files from the webserver). To configure the backend with this behavior\n * use the `passThrough` request handler of `when` instead of `respond`.\n *\n * Additionally, we don't want to manually have to flush mocked out requests like we do during unit\n * testing. For this reason the e2e $httpBackend flushes mocked out requests\n * automatically, closely simulating the behavior of the XMLHttpRequest object.\n *\n * To setup the application to run with this http backend, you have to create a module that depends\n * on the `ngMockE2E` and your application modules and defines the fake backend:\n *\n * ```js\n * myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);\n * myAppDev.run(function($httpBackend) {\n * phones = [{name: 'phone1'}, {name: 'phone2'}];\n *\n * // returns the current list of phones\n * $httpBackend.whenGET('/phones').respond(phones);\n *\n * // adds a new phone to the phones array\n * $httpBackend.whenPOST('/phones').respond(function(method, url, data) {\n * var phone = angular.fromJson(data);\n * phones.push(phone);\n * return [200, phone, {}];\n * });\n * $httpBackend.whenGET(/^\\/templates\\//).passThrough();\n * //...\n * });\n * ```\n *\n * Afterwards, bootstrap your app with this new module.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#when\n * @module ngMockE2E\n * @description\n * Creates a new backend definition.\n *\n * @param {string} method HTTP method.\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp)=} data HTTP request body.\n * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header\n * object and returns true if the headers match the current definition.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on\n * {@link ngMock.$httpBackend $httpBackend mock}.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n *\n * - respond –\n * `{function([status,] data[, headers, statusText])\n * | function(function(method, url, data, headers, params)}`\n * – The respond method takes a set of static data to be returned or a function that can return\n * an array containing response status (number), response data (string), response headers\n * (Object), and the text for the status (string).\n * - passThrough – `{function()}` – Any request matching a backend definition with\n * `passThrough` handler will be passed through to the real backend (an XHR request will be made\n * to the server.)\n * - Both methods return the `requestHandler` object for possible overrides.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenGET\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for GET requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on\n * {@link ngMock.$httpBackend $httpBackend mock}.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenHEAD\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for HEAD requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on\n * {@link ngMock.$httpBackend $httpBackend mock}.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenDELETE\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for DELETE requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on\n * {@link ngMock.$httpBackend $httpBackend mock}.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenPOST\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for POST requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp)=} data HTTP request body.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on\n * {@link ngMock.$httpBackend $httpBackend mock}.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenPUT\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for PUT requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp)=} data HTTP request body.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on\n * {@link ngMock.$httpBackend $httpBackend mock}.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenPATCH\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for PATCH requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp)=} data HTTP request body.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on\n * {@link ngMock.$httpBackend $httpBackend mock}.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenJSONP\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for JSONP requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Array)=} keys Array of keys to assign to regex matches in request url described on\n * {@link ngMock.$httpBackend $httpBackend mock}.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n/**\n * @ngdoc method\n * @name $httpBackend#whenRoute\n * @module ngMockE2E\n * @description\n * Creates a new backend definition that compares only with the requested route.\n *\n * @param {string} method HTTP method.\n * @param {string} url HTTP url string that supports colon param matching.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\nangular.mock.e2e = {};\nangular.mock.e2e.$httpBackendDecorator =\n ['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock];\n\n\n/**\n * @ngdoc type\n * @name $rootScope.Scope\n * @module ngMock\n * @description\n * {@link ng.$rootScope.Scope Scope} type decorated with helper methods useful for testing. These\n * methods are automatically available on any {@link ng.$rootScope.Scope Scope} instance when\n * `ngMock` module is loaded.\n *\n * In addition to all the regular `Scope` methods, the following helper methods are available:\n */\nangular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {\n\n var $rootScopePrototype = Object.getPrototypeOf($delegate);\n\n $rootScopePrototype.$countChildScopes = countChildScopes;\n $rootScopePrototype.$countWatchers = countWatchers;\n\n return $delegate;\n\n // ------------------------------------------------------------------------------------------ //\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$countChildScopes\n * @module ngMock\n * @description\n * Counts all the direct and indirect child scopes of the current scope.\n *\n * The current scope is excluded from the count. The count includes all isolate child scopes.\n *\n * @returns {number} Total number of child scopes.\n */\n function countChildScopes() {\n // jshint validthis: true\n var count = 0; // exclude the current scope\n var pendingChildHeads = [this.$$childHead];\n var currentScope;\n\n while (pendingChildHeads.length) {\n currentScope = pendingChildHeads.shift();\n\n while (currentScope) {\n count += 1;\n pendingChildHeads.push(currentScope.$$childHead);\n currentScope = currentScope.$$nextSibling;\n }\n }\n\n return count;\n }\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$countWatchers\n * @module ngMock\n * @description\n * Counts all the watchers of direct and indirect child scopes of the current scope.\n *\n * The watchers of the current scope are included in the count and so are all the watchers of\n * isolate child scopes.\n *\n * @returns {number} Total number of watchers.\n */\n function countWatchers() {\n // jshint validthis: true\n var count = this.$$watchers ? this.$$watchers.length : 0; // include the current scope\n var pendingChildHeads = [this.$$childHead];\n var currentScope;\n\n while (pendingChildHeads.length) {\n currentScope = pendingChildHeads.shift();\n\n while (currentScope) {\n count += currentScope.$$watchers ? currentScope.$$watchers.length : 0;\n pendingChildHeads.push(currentScope.$$childHead);\n currentScope = currentScope.$$nextSibling;\n }\n }\n\n return count;\n }\n}];\n\n\nif (window.jasmine || window.mocha) {\n\n var currentSpec = null,\n annotatedFunctions = [],\n isSpecRunning = function() {\n return !!currentSpec;\n };\n\n angular.mock.$$annotate = angular.injector.$$annotate;\n angular.injector.$$annotate = function(fn) {\n if (typeof fn === 'function' && !fn.$inject) {\n annotatedFunctions.push(fn);\n }\n return angular.mock.$$annotate.apply(this, arguments);\n };\n\n\n (window.beforeEach || window.setup)(function() {\n annotatedFunctions = [];\n currentSpec = this;\n });\n\n (window.afterEach || window.teardown)(function() {\n var injector = currentSpec.$injector;\n\n annotatedFunctions.forEach(function(fn) {\n delete fn.$inject;\n });\n\n angular.forEach(currentSpec.$modules, function(module) {\n if (module && module.$$hashKey) {\n module.$$hashKey = undefined;\n }\n });\n\n currentSpec.$injector = null;\n currentSpec.$modules = null;\n currentSpec.$providerInjector = null;\n currentSpec = null;\n\n if (injector) {\n injector.get('$rootElement').off();\n injector.get('$rootScope').$destroy();\n }\n\n // clean up jquery's fragment cache\n angular.forEach(angular.element.fragments, function(val, key) {\n delete angular.element.fragments[key];\n });\n\n MockXhr.$$lastInstance = null;\n\n angular.forEach(angular.callbacks, function(val, key) {\n delete angular.callbacks[key];\n });\n angular.callbacks.counter = 0;\n });\n\n /**\n * @ngdoc function\n * @name angular.mock.module\n * @description\n *\n * *NOTE*: This function is also published on window for easy access.<br>\n * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha\n *\n * This function registers a module configuration code. It collects the configuration information\n * which will be used when the injector is created by {@link angular.mock.inject inject}.\n *\n * See {@link angular.mock.inject inject} for usage example\n *\n * @param {...(string|Function|Object)} fns any number of modules which are represented as string\n * aliases or as anonymous module initialization functions. The modules are used to\n * configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an\n * object literal is passed each key-value pair will be registered on the module via\n * {@link auto.$provide $provide}.value, the key being the string name (or token) to associate\n * with the value on the injector.\n */\n window.module = angular.mock.module = function() {\n var moduleFns = Array.prototype.slice.call(arguments, 0);\n return isSpecRunning() ? workFn() : workFn;\n /////////////////////\n function workFn() {\n if (currentSpec.$injector) {\n throw new Error('Injector already created, can not register a module!');\n } else {\n var fn, modules = currentSpec.$modules || (currentSpec.$modules = []);\n angular.forEach(moduleFns, function(module) {\n if (angular.isObject(module) && !angular.isArray(module)) {\n fn = function($provide) {\n angular.forEach(module, function(value, key) {\n $provide.value(key, value);\n });\n };\n } else {\n fn = module;\n }\n if (currentSpec.$providerInjector) {\n currentSpec.$providerInjector.invoke(fn);\n } else {\n modules.push(fn);\n }\n });\n }\n }\n };\n\n /**\n * @ngdoc function\n * @name angular.mock.inject\n * @description\n *\n * *NOTE*: This function is also published on window for easy access.<br>\n * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha\n *\n * The inject function wraps a function into an injectable function. The inject() creates new\n * instance of {@link auto.$injector $injector} per test, which is then used for\n * resolving references.\n *\n *\n * ## Resolving References (Underscore Wrapping)\n * Often, we would like to inject a reference once, in a `beforeEach()` block and reuse this\n * in multiple `it()` clauses. To be able to do this we must assign the reference to a variable\n * that is declared in the scope of the `describe()` block. Since we would, most likely, want\n * the variable to have the same name of the reference we have a problem, since the parameter\n * to the `inject()` function would hide the outer variable.\n *\n * To help with this, the injected parameters can, optionally, be enclosed with underscores.\n * These are ignored by the injector when the reference name is resolved.\n *\n * For example, the parameter `_myService_` would be resolved as the reference `myService`.\n * Since it is available in the function body as _myService_, we can then assign it to a variable\n * defined in an outer scope.\n *\n * ```\n * // Defined out reference variable outside\n * var myService;\n *\n * // Wrap the parameter in underscores\n * beforeEach( inject( function(_myService_){\n * myService = _myService_;\n * }));\n *\n * // Use myService in a series of tests.\n * it('makes use of myService', function() {\n * myService.doStuff();\n * });\n *\n * ```\n *\n * See also {@link angular.mock.module angular.mock.module}\n *\n * ## Example\n * Example of what a typical jasmine tests looks like with the inject method.\n * ```js\n *\n * angular.module('myApplicationModule', [])\n * .value('mode', 'app')\n * .value('version', 'v1.0.1');\n *\n *\n * describe('MyApp', function() {\n *\n * // You need to load modules that you want to test,\n * // it loads only the \"ng\" module by default.\n * beforeEach(module('myApplicationModule'));\n *\n *\n * // inject() is used to inject arguments of all given functions\n * it('should provide a version', inject(function(mode, version) {\n * expect(version).toEqual('v1.0.1');\n * expect(mode).toEqual('app');\n * }));\n *\n *\n * // The inject and module method can also be used inside of the it or beforeEach\n * it('should override a version and test the new version is injected', function() {\n * // module() takes functions or strings (module aliases)\n * module(function($provide) {\n * $provide.value('version', 'overridden'); // override version here\n * });\n *\n * inject(function(version) {\n * expect(version).toEqual('overridden');\n * });\n * });\n * });\n *\n * ```\n *\n * @param {...Function} fns any number of functions which will be injected using the injector.\n */\n\n\n\n var ErrorAddingDeclarationLocationStack = function(e, errorForStack) {\n this.message = e.message;\n this.name = e.name;\n if (e.line) this.line = e.line;\n if (e.sourceId) this.sourceId = e.sourceId;\n if (e.stack && errorForStack)\n this.stack = e.stack + '\\n' + errorForStack.stack;\n if (e.stackArray) this.stackArray = e.stackArray;\n };\n ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString;\n\n window.inject = angular.mock.inject = function() {\n var blockFns = Array.prototype.slice.call(arguments, 0);\n var errorForStack = new Error('Declaration Location');\n return isSpecRunning() ? workFn.call(currentSpec) : workFn;\n /////////////////////\n function workFn() {\n var modules = currentSpec.$modules || [];\n var strictDi = !!currentSpec.$injectorStrict;\n modules.unshift(function($injector) {\n currentSpec.$providerInjector = $injector;\n });\n modules.unshift('ngMock');\n modules.unshift('ng');\n var injector = currentSpec.$injector;\n if (!injector) {\n if (strictDi) {\n // If strictDi is enabled, annotate the providerInjector blocks\n angular.forEach(modules, function(moduleFn) {\n if (typeof moduleFn === \"function\") {\n angular.injector.$$annotate(moduleFn);\n }\n });\n }\n injector = currentSpec.$injector = angular.injector(modules, strictDi);\n currentSpec.$injectorStrict = strictDi;\n }\n for (var i = 0, ii = blockFns.length; i < ii; i++) {\n if (currentSpec.$injectorStrict) {\n // If the injector is strict / strictDi, and the spec wants to inject using automatic\n // annotation, then annotate the function here.\n injector.annotate(blockFns[i]);\n }\n try {\n /* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */\n injector.invoke(blockFns[i] || angular.noop, this);\n /* jshint +W040 */\n } catch (e) {\n if (e.stack && errorForStack) {\n throw new ErrorAddingDeclarationLocationStack(e, errorForStack);\n }\n throw e;\n } finally {\n errorForStack = null;\n }\n }\n }\n };\n\n\n angular.mock.inject.strictDi = function(value) {\n value = arguments.length ? !!value : true;\n return isSpecRunning() ? workFn() : workFn;\n\n function workFn() {\n if (value !== currentSpec.$injectorStrict) {\n if (currentSpec.$injector) {\n throw new Error('Injector already created, can not modify strict annotations');\n } else {\n currentSpec.$injectorStrict = value;\n }\n }\n }\n };\n}\n\n\n})(window, window.angular);\n"],"sourceRoot":"/source/"} | |
2 | 0 | \ No newline at end of file |
dist/maps/styles/app-1cbf5925d3.css.map
... | ... | @@ -1 +0,0 @@ |
1 | -{"version":3,"sources":["styles/app-1cbf5925d3.css"],"names":[],"mappings":";;;4EA4EA,iBAaA,cACE,aAAc,KA7ChB,OAWA,OA4GE,WAAY,OAjJd,IAqIA,UA+6DE,QAAS,aApjEX,IAqwEA,WASE,wBAAyB,UAg0B3B,gBAQA,eAw6BA,OAsOA,MAEE,UAAW,KAw5Cb,sCADA,mCAvpEA,gBAypEE,WAAY,MAtoLd,WACE,YAAa,YACb,IAAK,8CACL,IAAK,qDAAoD,4BAA6B,gDAA+C,gBAAiB,+CAA8C,eAAgB,8CAA6C,mBAAoB,iEAAgE,cACrV,YAAa,IACb,WAAY,OAEd,IAEE,KAAM,OAAO,OAAO,OAAO,IAAK,CAAC,EAAE,YACnC,UAAW,QACX,eAAgB,KAChB,uBAAwB,YAI1B,OACE,UAAW,UACX,YAAa,MACb,eAAgB,KAyHlB,UAm+DA,IAo+BE,eAAgB,OA9jGlB,OACE,UAAW,IAEb,OACE,UAAW,IAEb,OACE,UAAW,IAEb,OACE,UAAW,IAEb,OACE,MAAO,UAGT,OACE,aAAc,EACd,YAAa,UACb,gBAAiB,KA2BnB,kBAaA,eACE,YAAa,KAxCb,UACE,SAAU,SAEd,OACE,SAAU,SACV,KAAM,WACN,MAAO,UACP,IAAK,SAEL,aACE,KAAM,WAEV,WACE,QAAS,KAAK,MAAM,MACpB,OAAc,MAAN,MAAa,KACrB,cAAe,KAojGjB,GA7/BA,IAoDE,OAAQ,EAzmEV,cACE,MAAO,KAET,eACE,MAAO,MA4rKT,sBAvBE,kBACA,wBACA,0BAtsDF,UAAmG,WA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Atb,UAAud,WAAgD,WAAgD,WAA3gB,UAA4C,UAAyD,UAA0G,UAA4C,UAA4C,UAA4C,UAA4C,UACza,SAAU,SACV,WAAY,IACZ,aAAc,KACd,cAAe,KAKjB,UACE,MAAO,SAET,UACE,MAAO,UAET,UACE,MAAO,IAET,UACE,MAAO,UAET,UACE,MAAO,UAET,UACE,MAAO,IAET,UACE,MAAO,UAET,UACE,MAAO,UAET,UACE,MAAO,IAET,WACE,MAAO,UAET,WACE,MAAO,UAET,WACE,MAAO,KAET,eACE,MAAO,KAET,eACE,MAAO,SAET,eACE,MAAO,UAET,eACE,MAAO,IAET,eACE,MAAO,UAET,eACE,MAAO,UAET,eACE,MAAO,IAET,eACE,MAAO,UAET,eACE,MAAO,UAET,eACE,MAAO,IAET,gBACE,MAAO,UAET,gBACE,MAAO,UAET,gBACE,MAAO,KAET,eACE,KAAM,KAER,eACE,KAAM,SAER,eACE,KAAM,UAER,eACE,KAAM,IAER,eACE,KAAM,UAER,eACE,KAAM,UAER,eACE,KAAM,IAER,eACE,KAAM,UAER,eACE,KAAM,UAER,eACE,KAAM,IAER,gBACE,KAAM,UAER,gBACE,KAAM,UAER,gBACE,KAAM,KAER,iBACE,YAAa,EAEf,iBACE,YAAa,SAEf,iBACE,YAAa,UAEf,iBACE,YAAa,IAEf,iBACE,YAAa,UAEf,iBACE,YAAa,UAEf,iBACE,YAAa,IAEf,iBACE,YAAa,UAEf,iBACE,YAAa,UAEf,iBACE,YAAa,IAEf,kBACE,YAAa,UAEf,kBACE,YAAa,UAEf,kBACE,YAAa,KAEf,yBACE,UAAmG,WAAY,WAAY,WAAhH,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UACtF,MAAO,KACT,UACE,MAAO,SACT,UACE,MAAO,UACT,UACE,MAAO,IACT,UACE,MAAO,UACT,UACE,MAAO,UACT,UACE,MAAO,IACT,UACE,MAAO,UACT,UACE,MAAO,UACT,UACE,MAAO,IACT,WACE,MAAO,UACT,WACE,MAAO,UACT,WACE,MAAO,KACT,eACE,MAAO,KACT,eACE,MAAO,SACT,eACE,MAAO,UACT,eACE,MAAO,IACT,eACE,MAAO,UACT,eACE,MAAO,UACT,eACE,MAAO,IACT,eACE,MAAO,UACT,eACE,MAAO,UACT,eACE,MAAO,IACT,gBACE,MAAO,UACT,gBACE,MAAO,UACT,gBACE,MAAO,KACT,eACE,KAAM,KACR,eACE,KAAM,SACR,eACE,KAAM,UACR,eACE,KAAM,IACR,eACE,KAAM,UACR,eACE,KAAM,UACR,eACE,KAAM,IACR,eACE,KAAM,UACR,eACE,KAAM,UACR,eACE,KAAM,IACR,gBACE,KAAM,UACR,gBACE,KAAM,UACR,gBACE,KAAM,KACR,iBACE,YAAa,EACf,iBACE,YAAa,SACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,iBACE,YAAa,UACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,iBACE,YAAa,UACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,kBACE,YAAa,UACf,kBACE,YAAa,UACf,kBACE,YAAa,MAEjB,yBACE,UAA8K,WAAY,WAAY,WAA3L,UAAsB,YAAX,UAAwB,UAAyE,UAAW,UAAW,UAApF,6DAA+F,UAAW,UACjK,MAAO,KACT,UACE,MAAO,SACT,UACE,MAAO,UACE,YAAX,UACE,MAAO,IACT,UAAW,6DACT,MAAO,UACT,UACE,MAAO,UACT,UACE,MAAO,IACT,UACE,MAAO,UACT,UACE,MAAO,UACT,UACE,MAAO,IACT,WACE,MAAO,UACT,WACE,MAAO,UACT,WACE,MAAO,KACT,eACE,MAAO,KACT,eACE,MAAO,SACT,eACE,MAAO,UACT,eACE,MAAO,IACT,eACE,MAAO,UACT,eACE,MAAO,UACT,eACE,MAAO,IACT,eACE,MAAO,UACT,eACE,MAAO,UACT,eACE,MAAO,IACT,gBACE,MAAO,UACT,gBACE,MAAO,UACT,gBACE,MAAO,KACT,eACE,KAAM,KACR,eACE,KAAM,SACR,eACE,KAAM,UACR,eACE,KAAM,IACR,eACE,KAAM,UACR,eACE,KAAM,UACR,eACE,KAAM,IACR,eACE,KAAM,UACR,eACE,KAAM,UACR,eACE,KAAM,IACR,gBACE,KAAM,UACR,gBACE,KAAM,UACR,gBACE,KAAM,KACR,iBACE,YAAa,EACf,iBACE,YAAa,SACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,iBACE,YAAa,UACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,iBACE,YAAa,UACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,kBACE,YAAa,UACf,kBACE,YAAa,UACf,kBACE,YAAa,MAEjB,0BACE,UAAmG,WAAY,WAAY,WAAhH,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UACtF,MAAO,KACT,UACE,MAAO,SACT,UACE,MAAO,UACT,UACE,MAAO,IACT,UACE,MAAO,UACT,UACE,MAAO,UACT,UACE,MAAO,IACT,UACE,MAAO,UACT,UACE,MAAO,UACT,UACE,MAAO,IACT,WACE,MAAO,UACT,WACE,MAAO,UACT,WACE,MAAO,KACT,eACE,MAAO,KACT,eACE,MAAO,SACT,eACE,MAAO,UACT,eACE,MAAO,IACT,eACE,MAAO,UACT,eACE,MAAO,UACT,eACE,MAAO,IACT,eACE,MAAO,UACT,eACE,MAAO,UACT,eACE,MAAO,IACT,gBACE,MAAO,UACT,gBACE,MAAO,UACT,gBACE,MAAO,KACT,eACE,KAAM,KACR,eACE,KAAM,SACR,eACE,KAAM,UACR,eACE,KAAM,IACR,eACE,KAAM,UACR,eACE,KAAM,UACR,eACE,KAAM,IACR,eACE,KAAM,UACR,eACE,KAAM,UACR,eACE,KAAM,IACR,gBACE,KAAM,UACR,gBACE,KAAM,UACR,gBACE,KAAM,KACR,iBACE,YAAa,EACf,iBACE,YAAa,SACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,iBACE,YAAa,UACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,iBACE,YAAa,UACf,iBACE,YAAa,UACf,iBACE,YAAa,IACf,kB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QAEmB,sCAAvC,sCACE,iBAAkB,QAKpB,cAHA,sBAMA,SALE,MAAO","file":"styles/app-1cbf5925d3.css","sourceRoot":"/source/","sourcesContent":[]} | |
2 | 0 | \ No newline at end of file |
dist/scripts/app-da900f6af6.js
... | ... | @@ -1,2 +0,0 @@ |
1 | -!function(){"use strict";angular.module("angular",["ngAnimate","ngCookies","ngStorage","ngTouch","ngSanitize","ngMessages","ngAria","restangular","ui.router","ui.bootstrap","toastr","angularMoment","angular.filter","akoenig.deckgrid","angular-timeline","duScroll","oitozero.ngSweetAlert"])}(),function(){"use strict";function e(e,t){var o=this;o.profile=o.owner,o.documents=[],o.openDocument=function(e){t.go("main.profile.page",{page:e.path,profile:e.profile.identifier})};var i=o.block.settings.limit||5;e.profiles.one(o.profile.id).one("articles").get({content_type:"TinyMceArticle",per_page:i}).then(function(e){o.documents=e.data.articles})}e.$inject=["noosfero","$state"],angular.module("angular").component("noosferoRecentDocumentsBlock",{restrict:"E",templateUrl:"app/components/noosfero-blocks/recent-documents/recent-documents.html",bindings:{block:"<",owner:"<"},controller:e})}(),function(){"use strict";function e(){var e=this;e.profile=e.owner}angular.module("angular").component("noosferoProfileImageBlock",{restrict:"E",templateUrl:"app/components/noosfero-blocks/profile-image/profile-image.html",bindings:{block:"<",owner:"<"},controller:e})}(),function(){"use strict";function e(e){var t=this;t.members=[],e.members(e.profiles.one(t.owner.id)).one().get({per_page:6}).then(function(e){t.members=e.data.people})}e.$inject=["noosfero"],angular.module("angular").component("noosferoMembersBlock",{restrict:"E",templateUrl:"app/components/noosfero-blocks/members-block/members-block.html",bindings:{block:"<",owner:"<"},controller:e})}(),function(){"use strict";function e(){}angular.module("angular").component("noosferoMainBlock",{restrict:"E",templateUrl:"app/components/noosfero-blocks/main-block/main-block.html",bindings:{block:"<",owner:"<"},controller:e})}(),function(){"use strict";function e(){this.links=this.block.settings.links}angular.module("angular").component("noosferoLinkListBlock",{restrict:"E",templateUrl:"app/components/noosfero-blocks/link-list/link-list.html",bindings:{block:"<",owner:"<"},controller:e})}(),function(){"use strict";function e(e){var t=this;t.posts=[],t.perPage=3,t.currentPage=1,t.loadPage=function(){e.articles.one(t.article.id).customGET("children",{content_type:"TinyMceArticle",per_page:t.perPage,page:t.currentPage}).then(function(e){t.totalPosts=e.headers("total"),t.posts=e.data.articles})},t.loadPage()}e.$inject=["noosfero"],angular.module("angular").component("noosferoBlog",{restrict:"E",templateUrl:"app/components/noosfero-articles/blog/blog.html",bindings:{article:"<",profile:"<"},controller:e})}(),function(){"use strict";function e(e,t){function o(){}var i={restrict:"E",templateUrl:"app/components/noosfero-articles/article/article.html",scope:{article:"<",profile:"<"},controller:o,controllerAs:"vm",bindToController:!0,link:function(o,i){var n="noosfero"+o.vm.article.type;if(e.has(n+"Directive")){var r=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();i.replaceWith(t("<"+r+' article="vm.article" profile="vm.profile"></'+r+">")(o))}}};return i}e.$inject=["$injector","$compile"],angular.module("angular").directive("noosferoArticle",e)}(),function(){"use strict";function e(){var e=this;e.getActivityTemplate=function(e){return"app/components/noosfero-activities/activity/"+e.verb+".html"}}angular.module("angular").component("noosferoActivity",{restrict:"E",bindings:{activity:"<"},templateUrl:"app/components/noosfero-activities/activity/activity.html",replace:!0,controller:e})}(),function(){"use strict";function e(){var e=this;e.defaultIcon="fa-users",e.profile&&"Person"===e.profile.type&&(e.defaultIcon="fa-user")}angular.module("angular").component("noosferoProfileImage",{restrict:"E",templateUrl:"app/components/noosfero/profile-image/profile-image.html",bindings:{profile:"<"},controller:e})}(),function(){"use strict";function e(){var e=this;e.boxesOrder=function(e){return 2==e.position?0:e.position}}angular.module("angular").component("noosferoBoxes",{restrict:"E",bindings:{boxes:"<",owner:"<"},templateUrl:"app/components/noosfero-boxes/boxes.html",controller:e})}(),function(){"use strict";function e(e){var t={restrict:"E",scope:{block:"<",owner:"<"},link:function(t,o){var i=t.block.type.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();o.replaceWith(e("<noosfero-"+i+' block="block" owner="owner"></noosfero-'+i+">")(t))}};return t}e.$inject=["$compile"],angular.module("angular").directive("noosferoBlock",e)}(),function(){"use strict";angular.module("angular").component("noosferoActivities",{restrict:"E",bindings:{activities:"<"},templateUrl:"app/components/noosfero-activities/activities.html"})}(),function(){"use strict";angular.module("angular").factory("noosfero",["Restangular","$q",function(e,t){var o=t.defer();return{currentProfile:o.promise,setCurrentProfile:function(e){o.resolve(e)},profiles:e.service("profiles"),articles:e.service("articles"),profile:function(t){return e.one("profiles",t)},members:function(t){return e.service("members",t)},boxes:function(t){return e.service("boxes",e.one("profiles",t))}}}])}(),function(){"use strict";angular.module("angular").filter("noosferoTemplateFilter",function(){return function(e,t){for(var o in t)e=e.replace("{"+o+"}",t[o]);return e}})}(),function(){"use strict";function e(){function e(e,t,o,i,n,r,a){var l=this;l.currentUser=i.getCurrentUser(),l.modalInstance=null,l.openLogin=function(){l.modalInstance=t.open({templateUrl:"app/components/auth/login.html",controller:"AuthController",controllerAs:"vm",bindToController:!0})},l.logout=function(){o.logout(),r.go(r.current,{},{reload:!0})},n.$on(a.loginSuccess,function(){l.modalInstance&&(l.modalInstance.close(),l.modalInstance=null),r.go(r.current,{},{reload:!0})}),n.$on(a.logoutSuccess,function(){l.currentUser=i.getCurrentUser()}),l.activate=function(){l.currentUser||l.openLogin()},l.activate()}e.$inject=["moment","$modal","AuthService","Session","$scope","$state","AUTH_EVENTS"];var t={restrict:"E",templateUrl:"app/components/navbar/navbar.html",scope:{},controller:e,controllerAs:"vm",bindToController:!0};return t}angular.module("angular").directive("acmeNavbar",e)}(),function(){"use strict";function e(e,t,o,i,n,r){function a(e){var o="/api/v1/login",i="login="+e.username+"&password="+e.password;return t.post(o,i).then(s,c)}function l(){var e="/api/v1/login_from_cookie";return t.post(e).then(s,c)}function s(e){n.debug("AuthService.login [SUCCESS] response",e);var t=i.create(e.data);return o.currentUser=t,o.$broadcast(r.loginSuccess,t),t}function c(e){return n.debug("AuthService.login [FAIL] response",e),o.$broadcast(r.loginFailed),null}function p(){i.destroy(),o.currentUser=void 0,o.$broadcast(r.logoutSuccess),t.jsonp("/account/logout")}function u(){return!!i.userId}function f(e){return angular.isArray(e)||(e=[e]),m.isAuthenticated()&&-1!==e.indexOf(i.userRole)}var m={login:a,loginFromCookie:l,logout:p,isAuthenticated:u,isAuthorized:f};return m}function t(e,t){var o={};return o.create=function(o){return e.currentUser=o.user,t.debug("User session created.",e.currentUser),e.currentUser},o.destroy=function(){delete e.currentUser,t.debug("User session destroyed.")},o.getCurrentUser=function(){return e.currentUser},o}e.$inject=["$q","$http","$rootScope","Session","$log","AUTH_EVENTS"],t.$inject=["$localStorage","$log"],angular.module("angular").factory("Session",t).factory("AuthService",e)}(),function(){"use strict";function e(e,t,o,i){var n=this;n.credentials={},n.login=function(){i.login(n.credentials)}}e.$inject=["noosfero","$log","$stateParams","AuthService"],angular.module("angular").controller("AuthController",e)}(),function(){"use strict";function e(e){function t(){e.currentProfile.then(function(t){return o.profile=t,e.profiles.one(o.profile.id).one("activities").get()}).then(function(e){o.activities=e.data.activities})}var o=this;o.profile=null,o.activities=[],t()}e.$inject=["noosfero"],angular.module("angular").controller("ProfileInfoController",e)}(),function(){"use strict";function e(e,t,o){function i(){e.profiles.one().get({identifier:o.profile}).then(function(t){return n.profile=t.data[0],e.setCurrentProfile(n.profile),e.boxes(n.profile.id).one().get()}).then(function(e){n.boxes=e.data.boxes})}var n=this;n.boxes=[],i()}e.$inject=["noosfero","$log","$stateParams"],angular.module("angular").controller("ProfileController",e)}(),function(){"use strict";function e(e,t,o,i,n){function r(){e.currentProfile.then(function(t){return a.profile=t,e.profile(a.profile.id).customGET("home_page",{fields:"path"})}).then(function(e){e.data.article?n.transitionTo("main.profile.page",{page:e.data.article.path,profile:a.profile.identifier},{location:!1}):n.transitionTo("main.profile.info",{profile:a.profile.identifier},{location:!1})})}var a=this;r()}e.$inject=["noosfero","$log","$stateParams","$scope","$state"],angular.module("angular").controller("ProfileHomeController",e)}(),function(){"use strict";function e(){}angular.module("angular").controller("MainController",e)}(),function(){"use strict";function e(e,t,o){function i(){e.currentProfile.then(function(t){return n.profile=t,e.profiles.one(n.profile.id).one("articles").get({path:o.page})}).then(function(e){n.article=e.data.article})}var n=this;n.article=null,n.profile=null,i()}e.$inject=["noosfero","$log","$stateParams"],angular.module("angular").controller("ContentViewerController",e)}(),function(){"use strict";function e(e){function t(){e.currentProfile.then(function(e){o.profile=e})}var o=this;o.article=null,o.profile=null,t()}e.$inject=["noosfero"],angular.module("angular").controller("ContentViewerActionsController",e)}(),function(){"use strict";function e(e,t,o,i,n){var r=this;r.article={},r.profile=null,r.save=function(){e.currentProfile.then(function(t){return e.profiles.one(t.id).customPOST({article:r.article},"articles",{},{"Content-Type":"application/json"})}).then(function(e){i.transitionTo("main.profile.page",{page:e.data.article.path,profile:e.data.article.profile.identifier}),n.swal({title:"Good job!",text:"Article saved!",type:"success",timer:1e3})})}}e.$inject=["noosfero","$stateParams","$httpParamSerializer","$state","SweetAlert"],angular.module("angular").controller("CmsController",e)}(),function(){"use strict";function e(e,t,o){t.addFullRequestInterceptor(function(e,t,i,n,r){return o.getCurrentUser()&&(r["Private-Token"]=o.getCurrentUser().private_token),{headers:r}})}e.$inject=["$log","Restangular","Session"],angular.module("angular").run(e)}(),function(){"use strict";function e(e,t){e.state("main",{url:"/",templateUrl:"app/main/main.html",controller:"MainController",controllerAs:"vm",resolve:{currentUser:["AuthService",function(e){return e.loginFromCookie()}]}}).state("main.profile.cms",{url:"^/myprofile/:profile/cms",views:{mainBlockContent:{templateUrl:"app/cms/cms.html",controller:"CmsController",controllerAs:"vm"}}}).state("main.profile.settings",{url:"^/myprofile/:profile"}).state("main.profile",{url:"^/:profile","abstract":!0,views:{content:{templateUrl:"app/profile/profile.html",controller:"ProfileController",controllerAs:"vm"}}}).state("main.profile.home",{url:"",views:{mainBlockContent:{controller:"ProfileHomeController",controllerAs:"vm"}}}).state("main.profile.info",{url:"^/profile/:profile",views:{mainBlockContent:{templateUrl:"app/profile-info/profile-info.html",controller:"ProfileInfoController",controllerAs:"vm"}}}).state("main.profile.page",{url:"/{page:any}",views:{mainBlockContent:{templateUrl:"app/content-viewer/page.html",controller:"ContentViewerController",controllerAs:"vm"},"actions@main":{templateUrl:"app/content-viewer/navbar-actions.html",controller:"ContentViewerActionsController",controllerAs:"vm"}}}),t.otherwise("/")}e.$inject=["$stateProvider","$urlRouterProvider"],angular.module("angular").config(e)}(),function(){"use strict";angular.module("angular").constant("moment",moment).constant("AUTH_EVENTS",{loginSuccess:"auth-login-success",loginFailed:"auth-login-failed",logoutSuccess:"auth-logout-success"})}(),function(){"use strict";function e(e,t,o,i,n){e.debugEnabled(!0),t.html5Mode({enabled:!0}),o.setBaseUrl("/api/v1"),o.setFullResponse(!0),i.defaults.headers.post={"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},n.decorator("$uiViewScroll",["$delegate","$document",function(e,t){return function(e){t.scrollToElementAnimated(e)}}])}e.$inject=["$logProvider","$locationProvider","RestangularProvider","$httpProvider","$provide"],angular.module("angular").config(e)}(),angular.module("angular").run(["$templateCache",function(e){e.put("app/cms/cms.html",'<form><div class="form-group"><label for="titleInput">Title</label> <input type="text" class="form-control" id="titleInput" placeholder="title" ng-model="vm.article.name"></div><div class="form-group"><label for="bodyInput">Text</label> <textarea class="form-control" id="bodyInput" rows="10" ng-model="vm.article.body"></textarea></div><button type="submit" class="btn btn-default" ng-click="vm.save()">Save</button></form>'),e.put("app/content-viewer/navbar-actions.html",'<ul class="nav navbar-nav"><li ng-show="vm.profile"><a href="#" role="button" ui-sref="main.profile.cms({profile: vm.profile.identifier})"><i class="fa fa-file fa-fw fa-lg"></i> New Post</a></li></ul>'),e.put("app/content-viewer/page.html",'<noosfero-article ng-if="vm.article" article="vm.article" profile="vm.profile"></noosfero-article>'),e.put("app/main/main.html",'<acme-navbar></acme-navbar><div ui-view="content"></div>'),e.put("app/profile/profile.html",'<div class="profile-container"><div class="row"><noosfero-boxes boxes="vm.boxes" owner="vm.profile"></noosfero-boxes></div></div>'),e.put("app/profile-info/profile-info.html",'<h3>{{vm.profile.name}}</h3><div class="profile-wall"><h4>Profile Wall</h4><noosfero-activities activities="vm.activities"></noosfero-activities></div>'),e.put("app/components/auth/login.html",'<div class="modal-header"><h3 class="modal-title">Login</h3></div><div class="modal-body"><form><div class="form-group"><label for="exampleInputEmail1">Login / Email address</label> <input type="text" class="form-control" id="exampleInputEmail1" placeholder="Login / Email" ng-model="vm.credentials.username"></div><div class="form-group"><label for="exampleInputPassword1">Password</label> <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password" ng-model="vm.credentials.password"></div><button type="submit" class="btn btn-default" ng-click="vm.login()">Login</button></form></div>'),e.put("app/components/navbar/navbar.html",'<nav class="navbar navbar-static-top navbar-inverse"><div class="container-fluid"><div class="navbar-header"><button type="button" class="navbar-toggle collapsed" ng-click="isCollapsed = !isCollapsed"><span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button> <a class="navbar-brand" ui-sref="main"><span class="noosfero-logo"><img src="/designs/themes/angular-theme/dist/assets/images/logo-noosfero.png"></span> Noosfero</a></div><div class="collapse navbar-collapse" id="navbar-collapse" collapse="isCollapsed"><ul class="nav navbar-nav"></ul><ul class="nav navbar-nav navbar-right"><li ng-show="!vm.currentUser"><a ng-href="#" ng-click="vm.openLogin()">Login</a></li><li class="dropdown profile-menu" ng-show="vm.currentUser" dropdown=""><a href="#" class="dropdown-toggle" aria-expanded="false" dropdown-toggle=""><noosfero-profile-image profile="vm.currentUser.person" class="profile-image"></noosfero-profile-image><span ng-bind="vm.currentUser.person.name"></span> <b class="caret"></b></a><ul class="dropdown-menu" dropdown-menu=""><li><a ui-sref="main.profile.info({profile: vm.currentUser.person.identifier})"><i class="fa fa-fw fa-user"></i> Profile</a></li><li><a target="_self" ui-sref="main.profile.settings({profile: vm.currentUser.person.identifier})"><i class="fa fa-fw fa-gear"></i> Settings</a></li><li class="divider"></li><li><a href="#" ng-click="vm.logout()"><i class="fa fa-fw fa-power-off"></i> Log Out</a></li></ul></li></ul><div ui-view="actions"></div></div></div></nav>'),e.put("app/components/noosfero-activities/activities.html",'<timeline><timeline-event ng-repeat="activity in $ctrl.activities | orderBy: \'created_at\':true"><noosfero-activity activity="activity"></noosfero-activity></timeline-event></timeline>'),e.put("app/components/noosfero-boxes/box.html",'<div ng-class="{\'col-md-2-5\': box.position!=1, \'col-md-7\': box.position==1}"><div ng-repeat="block in box.blocks | orderBy: \'position\'" class="panel panel-default block {{block.type | lowercase}}"><div class="panel-heading" ng-show="block.title"><h3 class="panel-title">{{block.title}}</h3></div><div class="panel-body"><noosfero-block block="block" owner="$ctrl.owner"></noosfero-block></div></div></div>'),e.put("app/components/noosfero-boxes/boxes.html",'<ng-include ng-repeat="box in $ctrl.boxes | orderBy: $ctrl.boxesOrder" src="\'app/components/noosfero-boxes/box.html\'"></ng-include>'),e.put("app/components/noosfero/profile-image/profile-image.html",'<span title="{{$ctrl.profile.name}}"><img ng-if="$ctrl.profile.image" ng-src="{{$ctrl.profile.image.url}}" class="img-responsive profile-image"> <i ng-if="!$ctrl.profile.image" class="fa {{$ctrl.defaultIcon}} fa-5x profile-image"></i></span>'),e.put("app/components/noosfero-activities/activity/activity.html",'<div class="activity"><ng-include src="$ctrl.getActivityTemplate($ctrl.activity)"></ng-include></div>'),e.put("app/components/noosfero-activities/activity/add_member_in_community.html",'<timeline-badge class="info"><i class="fa fa-user-plus"></i></timeline-badge><timeline-panel><timeline-heading><h4 class="timeline-title"><a ui-sref="main.profile.info({profile: $ctrl.activity.user.identifier})"><strong ng-bind="$ctrl.activity.user.name"></strong></a> <span>has joined the community</span></h4><p><small class="text-muted"><i class="fa fa-clock-o"></i> <span am-time-ago="$ctrl.activity.created_at"></span></small></p></timeline-heading><div class="timeline-body"></div></timeline-panel>'),e.put("app/components/noosfero-activities/activity/create_article.html",'<timeline-badge class="success"><i class="fa fa-file-text"></i></timeline-badge><timeline-panel><timeline-heading><h4 class="timeline-title"><a ui-sref="main.profile.info({profile: $ctrl.activity.user.identifier})"><strong ng-bind="$ctrl.activity.user.name"></strong></a> <span>has published on</span> <a ui-sref="main.profile.info({profile: $ctrl.activity.target.article.profile.identifier})"><strong ng-bind="$ctrl.activity.target.article.profile.name"></strong></a></h4><p><small class="text-muted"><i class="fa fa-clock-o"></i> <span am-time-ago="$ctrl.activity.created_at"></span></small></p></timeline-heading><div class="timeline-body"><div class="article"><div class="title"><a ui-sref="main.profile.page({profile: $ctrl.activity.target.article.profile.identifier, page: $ctrl.activity.target.article.path})" ng-bind="$ctrl.activity.target.article.title"></a></div><div class="lead small"><div ng-bind-html="$ctrl.activity.target.article.body | stripTags | truncate: 100 : \'...\': true"></div></div></div></div></timeline-panel>'),e.put("app/components/noosfero-activities/activity/new_friendship.html",'<timeline-badge class="info"><i class="fa fa-user-plus"></i></timeline-badge><timeline-panel><timeline-heading><h4 class="timeline-title"><a ui-sref="main.profile.info({profile: $ctrl.activity.user.identifier})"><strong ng-bind="$ctrl.activity.user.name"></strong></a> <span>has made <span ng-bind="$ctrl.activity.params.friend_name.length"></span> new friend(s):</span> <span class="comma-separated"><a class="separated-item" ui-sref="main.profile.info({profile: $ctrl.activity.params.friend_url[$index].profile})" ng-repeat="friend in $ctrl.activity.params.friend_name"><strong ng-bind="friend"></strong></a></span></h4><p><small class="text-muted"><i class="fa fa-clock-o"></i> <span am-time-ago="$ctrl.activity.created_at"></span></small></p></timeline-heading><div class="timeline-body"></div></timeline-panel>'),e.put("app/components/noosfero-articles/article/article.html",'<div class="article"><div class="page-header"><h3 ng-bind="vm.article.title"></h3></div><div class="sub-header clearfix"><div class="page-info pull-right small text-muted"><span class="time"><i class="fa fa-clock-o"></i> <span am-time-ago="vm.article.created_at"></span></span> <span class="author" ng-if="vm.article.author"><i class="fa fa-user"></i> <a ui-sref="main.profile({profile: vm.article.author.identifier})"><span class="author-name" ng-bind="vm.article.author.name"></span></a></span></div></div><div class="page-body"><div ng-bind-html="vm.article.body"></div></div></div>'),e.put("app/components/noosfero-articles/blog/blog.html",'<div class="blog"><div class="blog-cover" ng-show="$ctrl.article.image"><img ng-src="{{$ctrl.article.image.url}}" class="img-responsive"><h3 ng-bind="$ctrl.article.title"></h3></div><div class="page-header" ng-show="!$ctrl.article.image"><h3 ng-bind="$ctrl.article.title"></h3></div><div><div ng-repeat="child in $ctrl.posts | orderBy: \'created_at\':true"><div class="page-header"><a class="title" ui-sref="main.profile.page({profile: $ctrl.profile.identifier, page: child.path})"><h4 ng-bind="child.title"></h4></a><div class="post-lead" ng-bind-html="child.body | truncate: 500: \'...\': true"></div></div></div></div><pagination ng-model="$ctrl.currentPage" total-items="$ctrl.totalPosts" class="pagination-sm center-block" boundary-links="true" items-per-page="$ctrl.perPage" ng-change="$ctrl.loadPage()" first-text="«" last-text="»" previous-text="‹" next-text="›"></pagination></div>'),e.put("app/components/noosfero-blocks/link-list/link-list.html",'<div class="link-list-block"><div ng-repeat="link in $ctrl.links"><a ng-href="{{link.address | noosferoTemplateFilter:{profile: $ctrl.owner.identifier} }}"><i class="fa fa-fw icon-{{link.icon}}"></i> <span>{{link.name}}</span></a></div></div>'),e.put("app/components/noosfero-blocks/main-block/main-block.html",'<div ui-view="mainBlockContent" autoscroll=""></div>'),e.put("app/components/noosfero-blocks/members-block/members-block.html",'<div class="members-block"><a ng-repeat="member in $ctrl.members" ui-sref="main.profile({profile: member.identifier})" class="member"><noosfero-profile-image profile="member"></noosfero-profile-image></a></div>'),e.put("app/components/noosfero-blocks/profile-image/profile-image.html",'<div class="center-block text-center profile-image-block"><a ui-sref="main.profile.info({profile: $ctrl.owner.identifier})"><noosfero-profile-image profile="$ctrl.owner"></noosfero-profile-image></a> <a class="settings-link" target="_self" ui-sref="main.profile.settings({profile: $ctrl.owner.identifier})">Control panel</a></div>'),e.put("app/components/noosfero-blocks/recent-documents/recent-documents.html",'<div deckgrid="" source="$ctrl.documents" class="deckgrid"><div class="a-card panel media" ng-click="mother.$ctrl.openDocument(card);"><div class="author media-left" ng-show="card.author.image"><img ng-src="{{card.author.image.url}}" class="img-circle"></div><div class="header media-body"><h5 class="title media-heading" ng-bind="card.title"></h5><div class="subheader"><span class="time"><i class="fa fa-clock-o"></i> <span am-time-ago="card.created_at"></span></span></div></div><img ng-show="card.image" ng-src="{{card.image.url}}" class="img-responsive article-image"><div class="post-lead" ng-bind-html="card.body | stripTags | truncate: 100: \'...\': true"></div></div></div>')}]); | |
2 | -//# sourceMappingURL=../maps/scripts/app-da900f6af6.js.map |
dist/scripts/vendor-bcf412b41d.js
No preview for this file type
dist/styles/app-1cbf5925d3.css
... | ... | @@ -1,9 +0,0 @@ |
1 | -@charset "UTF-8";/*! | |
2 | - * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome | |
3 | - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) | |
4 | - */@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic);.fa.fa-pull-left,.fa.pull-left{margin-right:.3em}.fa-fw,.fa-li{text-align:center}.fa,.fa-stack{display:inline-block}.fa,.glyphicon{-moz-osx-font-smoothing:grayscale}.img-responsive,.img-thumbnail,.table,label{max-width:100%}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.pre-scrollable{max-height:340px}@font-face{font-family:FontAwesome;src:url(../fonts/fontawesome-webfont.eot?v=4.5.0);src:url(../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0) format("embedded-opentype"),url(../fonts/fontawesome-webfont.woff2?v=4.5.0) format("woff2"),url(../fonts/fontawesome-webfont.woff?v=4.5.0) format("woff"),url(../fonts/fontawesome-webfont.ttf?v=4.5.0) format("truetype"),url(../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-stack,img{vertical-align:middle}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa.fa-pull-right,.fa.pull-right{margin-left:.3em}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}hr,img{border:0}.fa-pull-left{float:left}.fa-pull-right{float:right}.btn-group>.btn-group,.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.dropdown-menu{float:left}body,figure{margin:0}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{position:relative;width:2em;height:2em;line-height:2em}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before,.icon-menu-people:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before,.icon-ok:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before{content:""}.fa-file-o:before,.icon-new:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before,.icon-photos:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before,.icon-edit:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before{content:""}.fa-check-circle:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before,.icon-event:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before,.icon-forum:before{content:""}.fa-chain:before,.fa-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before,.icon-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before,.icon-send:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}/*! | |
5 | - * Bootstrap v3.3.6 (http://getbootstrap.com) | |
6 | - * Copyright 2011-2015 Twitter, Inc. | |
7 | - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |
8 | - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{blockquote,img,pre,tr{page-break-inside:avoid}*,:after,:before{background:0 0!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999}thead{display:table-header-group}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.btn,.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-warning.active,.btn-warning:active,.btn.active,.btn:active,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover,.form-control,.navbar-toggle,.open>.btn-danger.dropdown-toggle,.open>.btn-default.dropdown-toggle,.open>.btn-info.dropdown-toggle,.open>.btn-primary.dropdown-toggle,.open>.btn-warning.dropdown-toggle{background-image:none}.img-thumbnail,body{background-color:#f5f8fa}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"),url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"),url(../fonts/glyphicons-halflings-regular.woff) format("woff"),url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before,.glyphicon-btc:before,.glyphicon-xbt:before{content:"\e227"}.glyphicon-jpy:before,.glyphicon-yen:before{content:"\00a5"}.glyphicon-rub:before,.glyphicon-ruble:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*,:after,:before{box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:1.42857;color:#676767}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#007EBB;text-decoration:none}a:focus,a:hover{color:#007EBB;text-decoration:underline}a:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.img-responsive{display:block;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;height:auto}.img-circle,.navbar .container-fluid .navbar-nav .profile-menu .profile-image img,.navbar .profile-container .navbar-nav .profile-menu .profile-image img{border-radius:50%}hr{margin-top:32px;margin-bottom:32px;border-top:1px solid #ecf0f1}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#b4bcc2}.h1,.h2,.h3,h1,h2,h3{margin-top:32px;margin-bottom:16px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:16px;margin-bottom:16px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:39px}.h2,h2{font-size:32px}.h3,h3{font-size:26px}.h4,h4{font-size:19px}.h5,h5{font-size:15px}.h6,h6{font-size:13px}p{margin:0 0 16px}.lead{margin-bottom:32px;font-size:17px;font-weight:300;line-height:1.4}dt,kbd kbd,label{font-weight:700}@media (min-width:768px){.lead{font-size:22.5px}}.small,small{font-size:86%}.mark,mark{background-color:#F39C12;padding:.2em}.list-inline,.list-unstyled{padding-left:0;list-style:none}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.initialism,.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#b4bcc2}.text-primary{color:#2C3E50}a.text-primary:focus,a.text-primary:hover{color:#1a252f}a.text-danger:focus,a.text-danger:hover,a.text-info:focus,a.text-info:hover,a.text-success:focus,a.text-success:hover,a.text-warning:focus,a.text-warning:hover{color:#e6e6e6}.bg-primary{color:#fff;background-color:#2C3E50}a.bg-primary:focus,a.bg-primary:hover{background-color:#1a252f}.bg-success{background-color:#1E96D0}a.bg-success:focus,a.bg-success:hover{background-color:#1876a3}.bg-info{background-color:#3498DB}a.bg-info:focus,a.bg-info:hover{background-color:#217dbb}.bg-warning{background-color:#F39C12}a.bg-warning:focus,a.bg-warning:hover{background-color:#c87f0a}.bg-danger{background-color:#E74C3C}a.bg-danger:focus,a.bg-danger:hover{background-color:#d62c1a}pre code,table{background-color:transparent}.page-header{padding-bottom:15px;margin:64px 0 32px;border-bottom:1px solid #eee}dl,ol,ul{margin-top:0}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child,ol ol,ol ul,ul ol,ul ul{margin-bottom:0}address,dl{margin-bottom:32px}ol,ul{margin-bottom:16px}.list-inline{margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dd,dt{line-height:1.42857}dd{margin-left:0}.dl-horizontal dd:after,.dl-horizontal dd:before{content:" ";display:table}.dl-horizontal dd:after{clear:both}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.container{width:750px}}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dropdown-menu>li>a,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.profile-container:after,.row:after{clear:both}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #b4bcc2}.initialism{font-size:90%}blockquote{padding:16px 32px;margin:0 0 32px;font-size:18.75px;border-left:5px solid #ecf0f1}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857;color:#b4bcc2}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #ecf0f1;border-left:0;text-align:right}code,kbd{padding:2px 4px;font-size:90%}caption,th{text-align:left}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{font-style:normal;line-height:1.42857}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;box-shadow:none}pre{display:block;padding:15.5px;margin:0 0 16px;font-size:14px;line-height:1.42857;word-break:break-all;word-wrap:break-word;color:#7b8a8b;background-color:#ecf0f1;border:1px solid #ccc;border-radius:4px}.container-fluid:after,.container-fluid:before,.container:after,.container:before,.profile-container:after,.profile-container:before,.row:after,.row:before{display:table;content:" "}.container,.container-fluid,.profile-container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;border-radius:0}.pre-scrollable{overflow-y:scroll}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.row{margin-left:-15px;margin-right:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-2-5,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-7 .block.recentdocumentsblock .deckgrid .deck-column,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1{width:8.33333%}.col-xs-2{width:16.66667%}.col-xs-3{width:25%}.col-xs-4{width:33.33333%}.col-xs-5{width:41.66667%}.col-xs-6{width:50%}.col-xs-7{width:58.33333%}.col-xs-8{width:66.66667%}.col-xs-9{width:75%}.col-xs-10{width:83.33333%}.col-xs-11{width:91.66667%}.col-xs-12{width:100%}.col-xs-pull-0{right:auto}.col-xs-pull-1{right:8.33333%}.col-xs-pull-2{right:16.66667%}.col-xs-pull-3{right:25%}.col-xs-pull-4{right:33.33333%}.col-xs-pull-5{right:41.66667%}.col-xs-pull-6{right:50%}.col-xs-pull-7{right:58.33333%}.col-xs-pull-8{right:66.66667%}.col-xs-pull-9{right:75%}.col-xs-pull-10{right:83.33333%}.col-xs-pull-11{right:91.66667%}.col-xs-pull-12{right:100%}.col-xs-push-0{left:auto}.col-xs-push-1{left:8.33333%}.col-xs-push-2{left:16.66667%}.col-xs-push-3{left:25%}.col-xs-push-4{left:33.33333%}.col-xs-push-5{left:41.66667%}.col-xs-push-6{left:50%}.col-xs-push-7{left:58.33333%}.col-xs-push-8{left:66.66667%}.col-xs-push-9{left:75%}.col-xs-push-10{left:83.33333%}.col-xs-push-11{left:91.66667%}.col-xs-push-12{left:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333%}.col-xs-offset-2{margin-left:16.66667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333%}.col-xs-offset-5{margin-left:41.66667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333%}.col-xs-offset-8{margin-left:66.66667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333%}.col-xs-offset-11{margin-left:91.66667%}.col-xs-offset-12{margin-left:100%}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-1{width:8.33333%}.col-sm-2{width:16.66667%}.col-sm-3{width:25%}.col-sm-4{width:33.33333%}.col-sm-5{width:41.66667%}.col-sm-6{width:50%}.col-sm-7{width:58.33333%}.col-sm-8{width:66.66667%}.col-sm-9{width:75%}.col-sm-10{width:83.33333%}.col-sm-11{width:91.66667%}.col-sm-12{width:100%}.col-sm-pull-0{right:auto}.col-sm-pull-1{right:8.33333%}.col-sm-pull-2{right:16.66667%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333%}.col-sm-pull-5{right:41.66667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.33333%}.col-sm-pull-8{right:66.66667%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333%}.col-sm-pull-11{right:91.66667%}.col-sm-pull-12{right:100%}.col-sm-push-0{left:auto}.col-sm-push-1{left:8.33333%}.col-sm-push-2{left:16.66667%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333%}.col-sm-push-5{left:41.66667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.33333%}.col-sm-push-8{left:66.66667%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333%}.col-sm-push-11{left:91.66667%}.col-sm-push-12{left:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333%}.col-sm-offset-2{margin-left:16.66667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333%}.col-sm-offset-5{margin-left:41.66667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333%}.col-sm-offset-8{margin-left:66.66667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333%}.col-sm-offset-11{margin-left:91.66667%}.col-sm-offset-12{margin-left:100%}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-2-5,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-7 .block.recentdocumentsblock .deckgrid .deck-column,.col-md-8,.col-md-9{float:left}.col-md-1{width:8.33333%}.col-md-2{width:16.66667%}.col-md-2-5,.col-md-3{width:25%}.col-md-4,.col-md-7 .block.recentdocumentsblock .deckgrid .deck-column{width:33.33333%}.col-md-5{width:41.66667%}.col-md-6{width:50%}.col-md-7{width:58.33333%}.col-md-8{width:66.66667%}.col-md-9{width:75%}.col-md-10{width:83.33333%}.col-md-11{width:91.66667%}.col-md-12{width:100%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.33333%}.col-md-pull-2{right:16.66667%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333%}.col-md-pull-5{right:41.66667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.33333%}.col-md-pull-8{right:66.66667%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333%}.col-md-pull-11{right:91.66667%}.col-md-pull-12{right:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.33333%}.col-md-push-2{left:16.66667%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333%}.col-md-push-5{left:41.66667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.33333%}.col-md-push-8{left:66.66667%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333%}.col-md-push-11{left:91.66667%}.col-md-push-12{left:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333%}.col-md-offset-2{margin-left:16.66667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333%}.col-md-offset-5{margin-left:41.66667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333%}.col-md-offset-8{margin-left:66.66667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333%}.col-md-offset-11{margin-left:91.66667%}.col-md-offset-12{margin-left:100%}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-1{width:8.33333%}.col-lg-2{width:16.66667%}.col-lg-3{width:25%}.col-lg-4{width:33.33333%}.col-lg-5{width:41.66667%}.col-lg-6{width:50%}.col-lg-7{width:58.33333%}.col-lg-8{width:66.66667%}.col-lg-9{width:75%}.col-lg-10{width:83.33333%}.col-lg-11{width:91.66667%}.col-lg-12{width:100%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.33333%}.col-lg-pull-2{right:16.66667%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333%}.col-lg-pull-5{right:41.66667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.33333%}.col-lg-pull-8{right:66.66667%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333%}.col-lg-pull-11{right:91.66667%}.col-lg-pull-12{right:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.33333%}.col-lg-push-2{left:16.66667%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333%}.col-lg-push-5{left:41.66667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.33333%}.col-lg-push-8{left:66.66667%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333%}.col-lg-push-11{left:91.66667%}.col-lg-push-12{left:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333%}.col-lg-offset-2{margin-left:16.66667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333%}.col-lg-offset-5{margin-left:41.66667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333%}.col-lg-offset-8{margin-left:66.66667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333%}.col-lg-offset-11{margin-left:91.66667%}.col-lg-offset-12{margin-left:100%}}caption{padding-top:8px;padding-bottom:8px;color:#b4bcc2}.table{width:100%;margin-bottom:32px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857;vertical-align:top;border-top:1px solid #ecf0f1}.table>thead>tr>th{vertical-align:bottom}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ecf0f1}.table .table{background-color:#f5f8fa}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ecf0f1}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover,.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#ecf0f1}table col[class*=col-]{position:static;float:none;display:table-column}table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#dde4e6}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#1E96D0}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#1b86ba}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#3498DB}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#258cd1}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#F39C12}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#e08e0b}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#E74C3C}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#e43725}.table-responsive{overflow-x:auto;min-height:.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:24px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ecf0f1}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset,legend{padding:0;border:0}fieldset{margin:0;min-width:0}legend{display:block;width:100%;margin-bottom:32px;font-size:22.5px;line-height:inherit;color:#676767;border-bottom:1px solid transparent}label{display:inline-block;margin-bottom:5px}input[type=search]{box-sizing:border-box;-webkit-appearance:none}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}.form-control,output{font-size:15px;line-height:1.42857;color:#676767;display:block}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=radio]:focus,input[type=file]:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}output{padding-top:11px}.form-control{width:100%;height:56px;padding:10px 15px;background-color:#fff;border:1px solid #dce4ec;border-radius:4px;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#2C3E50;outline:0}.form-control::-moz-placeholder{color:#acb6c0;opacity:1}.form-control:-ms-input-placeholder{color:#acb6c0}.form-control::-webkit-input-placeholder{color:#acb6c0}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#ecf0f1;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:56px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm>.input-group-btn>input[type=date].btn,.input-group-sm>.input-group-btn>input[type=time].btn,.input-group-sm>.input-group-btn>input[type=datetime-local].btn,.input-group-sm>.input-group-btn>input[type=month].btn,.input-group-sm>input[type=date].form-control,.input-group-sm>input[type=date].input-group-addon,.input-group-sm>input[type=time].form-control,.input-group-sm>input[type=time].input-group-addon,.input-group-sm>input[type=datetime-local].form-control,.input-group-sm>input[type=datetime-local].input-group-addon,.input-group-sm>input[type=month].form-control,.input-group-sm>input[type=month].input-group-addon,input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:35px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg>.input-group-btn>input[type=date].btn,.input-group-lg>.input-group-btn>input[type=time].btn,.input-group-lg>.input-group-btn>input[type=datetime-local].btn,.input-group-lg>.input-group-btn>input[type=month].btn,.input-group-lg>input[type=date].form-control,.input-group-lg>input[type=date].input-group-addon,.input-group-lg>input[type=time].form-control,.input-group-lg>input[type=time].input-group-addon,.input-group-lg>input[type=datetime-local].form-control,.input-group-lg>input[type=datetime-local].input-group-addon,.input-group-lg>input[type=month].form-control,.input-group-lg>input[type=month].input-group-addon,input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:66px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:32px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-left:-20px;margin-top:4px\9}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.checkbox-inline.disabled,.checkbox.disabled label,.radio-inline.disabled,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio label,fieldset[disabled] .radio-inline,fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.form-control-static{padding-top:11px;padding-bottom:11px;margin-bottom:0;min-height:47px}.form-control-static.input-lg,.form-control-static.input-sm,.input-group-lg>.form-control-static.form-control,.input-group-lg>.form-control-static.input-group-addon,.input-group-lg>.input-group-btn>.form-control-static.btn,.input-group-sm>.form-control-static.form-control,.input-group-sm>.form-control-static.input-group-addon,.input-group-sm>.input-group-btn>.form-control-static.btn{padding-left:0;padding-right:0}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn,.input-sm{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.input-group-sm>.input-group-btn>select.btn,.input-group-sm>select.form-control,.input-group-sm>select.input-group-addon,select.input-sm{height:35px;line-height:35px}.input-group-sm>.input-group-btn>select[multiple].btn,.input-group-sm>.input-group-btn>textarea.btn,.input-group-sm>select[multiple].form-control,.input-group-sm>select[multiple].input-group-addon,.input-group-sm>textarea.form-control,.input-group-sm>textarea.input-group-addon,select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:35px;line-height:35px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:35px;min-height:45px;padding:7px 9px;font-size:13px;line-height:1.5}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn,.input-lg{height:66px;padding:18px 27px;font-size:19px;line-height:1.33333;border-radius:6px}.input-group-lg>.input-group-btn>select.btn,.input-group-lg>select.form-control,.input-group-lg>select.input-group-addon,select.input-lg{height:66px;line-height:66px}.input-group-lg>.input-group-btn>select[multiple].btn,.input-group-lg>.input-group-btn>textarea.btn,.input-group-lg>select[multiple].form-control,.input-group-lg>select[multiple].input-group-addon,.input-group-lg>textarea.form-control,.input-group-lg>textarea.input-group-addon,select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:66px;padding:18px 27px;font-size:19px;line-height:1.33333;border-radius:6px}.form-group-lg select.form-control{height:66px;line-height:66px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:66px;min-height:51px;padding:19px 27px;font-size:19px;line-height:1.33333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:70px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:56px;height:56px;line-height:56px;text-align:center;pointer-events:none}.collapsing,.dropdown,.dropup{position:relative}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-group-lg>.form-control+.form-control-feedback,.input-group-lg>.input-group-addon+.form-control-feedback,.input-group-lg>.input-group-btn>.btn+.form-control-feedback,.input-lg+.form-control-feedback{width:66px;height:66px;line-height:66px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-group-sm>.form-control+.form-control-feedback,.input-group-sm>.input-group-addon+.form-control-feedback,.input-group-sm>.input-group-btn>.btn+.form-control-feedback,.input-sm+.form-control-feedback{width:35px;height:35px;line-height:35px}.has-success .form-control{box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff}.has-success .input-group-addon{color:#fff;background-color:#1E96D0}.has-warning .form-control{box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff}.has-warning .input-group-addon{color:#fff;background-color:#F39C12}.has-error .form-control{box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff}.has-error .input-group-addon{color:#fff;background-color:#E74C3C}.has-feedback label~.form-control-feedback{top:37px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#a7a7a7}@media (min-width:768px){.form-inline .form-control-static,.form-inline .form-group{display:inline-block}.form-inline .control-label,.form-inline .form-group{margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:11px}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{margin-top:0;margin-bottom:0;padding-top:11px}.form-horizontal .checkbox,.form-horizontal .radio{min-height:43px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-group:after,.form-horizontal .form-group:before{content:" ";display:table}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:19px;font-size:19px}.form-horizontal .form-group-sm .control-label{padding-top:7px;font-size:13px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;border:1px solid transparent;white-space:nowrap;padding:10px 15px;font-size:15px;line-height:1.42857;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#fff;text-decoration:none}.btn.active,.btn:active{outline:0;box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#fff;background-color:#95a5a6;border-color:#95a5a6}.btn-default.focus,.btn-default:focus{color:#fff;background-color:#798d8f;border-color:#566566}.btn-default.active,.btn-default:active,.btn-default:hover,.open>.btn-default.dropdown-toggle{color:#fff;background-color:#798d8f;border-color:#74898a}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.btn-default.dropdown-toggle.focus,.open>.btn-default.dropdown-toggle:focus,.open>.btn-default.dropdown-toggle:hover{color:#fff;background-color:#687b7c;border-color:#566566}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#95a5a6;border-color:#95a5a6}.btn-default .badge{color:#95a5a6;background-color:#fff}.btn-primary{color:#fff;background-color:#2C3E50;border-color:#2C3E50}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#1a252f;border-color:#000}.btn-primary.active,.btn-primary:active,.btn-primary:hover,.open>.btn-primary.dropdown-toggle{color:#fff;background-color:#1a252f;border-color:#161f29}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.btn-primary.dropdown-toggle.focus,.open>.btn-primary.dropdown-toggle:focus,.open>.btn-primary.dropdown-toggle:hover{color:#fff;background-color:#0d1318;border-color:#000}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#2C3E50;border-color:#2C3E50}.btn-primary .badge{color:#2C3E50;background-color:#fff}.btn-success{color:#fff;background-color:#1E96D0;border-color:#1E96D0}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#1876a3;border-color:#0e4661}.btn-success.active,.btn-success:active,.btn-success:hover,.open>.btn-success.dropdown-toggle{color:#fff;background-color:#1876a3;border-color:#166f9b}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.btn-success.dropdown-toggle.focus,.open>.btn-success.dropdown-toggle:focus,.open>.btn-success.dropdown-toggle:hover{color:#fff;background-color:#135f84;border-color:#0e4661}.btn-success.active,.btn-success:active,.open>.btn-success.dropdown-toggle{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#1E96D0;border-color:#1E96D0}.btn-success .badge{color:#1E96D0;background-color:#fff}.btn-info{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#217dbb;border-color:#16527a}.btn-info.active,.btn-info:active,.btn-info:hover,.open>.btn-info.dropdown-toggle{color:#fff;background-color:#217dbb;border-color:#2077b2}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.btn-info.dropdown-toggle.focus,.open>.btn-info.dropdown-toggle:focus,.open>.btn-info.dropdown-toggle:hover{color:#fff;background-color:#1c699d;border-color:#16527a}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#3498DB;border-color:#3498DB}.btn-info .badge{color:#3498DB;background-color:#fff}.btn-warning{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#c87f0a;border-color:#7f5006}.btn-warning.active,.btn-warning:active,.btn-warning:hover,.open>.btn-warning.dropdown-toggle{color:#fff;background-color:#c87f0a;border-color:#be780a}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.btn-warning.dropdown-toggle.focus,.open>.btn-warning.dropdown-toggle:focus,.open>.btn-warning.dropdown-toggle:hover{color:#fff;background-color:#a66908;border-color:#7f5006}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#F39C12;border-color:#F39C12}.btn-warning .badge{color:#F39C12;background-color:#fff}.btn-danger{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#d62c1a;border-color:#921e12}.btn-danger.active,.btn-danger:active,.btn-danger:hover,.open>.btn-danger.dropdown-toggle{color:#fff;background-color:#d62c1a;border-color:#cd2a19}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.btn-danger.dropdown-toggle.focus,.open>.btn-danger.dropdown-toggle:focus,.open>.btn-danger.dropdown-toggle:hover{color:#fff;background-color:#b62516;border-color:#921e12}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#E74C3C;border-color:#E74C3C}.btn-danger .badge{color:#E74C3C;background-color:#fff}.btn-link{color:#007EBB;font-weight:400;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#007EBB;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#b4bcc2;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:18px 27px;font-size:19px;line-height:1.33333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:13px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{height:0;overflow:hidden;-webkit-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:15px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu-right,.dropdown-menu.pull-right{left:auto;right:0}.dropdown-header,.dropdown-menu>li>a{display:block;padding:3px 20px;line-height:1.42857;white-space:nowrap}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle,.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child,.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child),.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn,.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.dropdown-menu .divider{height:1px;margin:15px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{font-weight:400;color:#7b8a8b}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#fff;background-color:#2C3E50}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;outline:0;background-color:#2C3E50}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#b4bcc2}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{font-size:13px;color:#b4bcc2}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar:after,.btn-toolbar:before{content:" ";display:table}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn .caret,.btn-group>.btn:first-child{margin-left:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group-lg.btn-group>.btn+.dropdown-toggle,.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle.btn-link{box-shadow:none}.btn-group-lg>.btn .caret,.btn-lg .caret{border-width:5px 5px 0}.dropup .btn-group-lg>.btn .caret,.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before{content:" ";display:table}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child:not(:first-child){border-radius:0 0 4px 4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn,.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group,.input-group-btn,.input-group-btn>.btn{position:relative}.input-group{display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:10px 15px;font-size:15px;font-weight:400;line-height:1;color:#676767;text-align:center;background-color:#ecf0f1;border:1px solid #dce4ec;border-radius:4px}.input-group-addon.input-sm,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.input-group-addon.btn{padding:6px 9px;font-size:13px;border-radius:3px}.input-group-addon.input-lg,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.input-group-addon.btn{padding:18px 27px;font-size:19px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{font-size:0;white-space:nowrap}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav:after,.nav:before{content:" ";display:table}.nav>li,.nav>li>a{display:block;position:relative}.nav:after{clear:both}.nav>li>a{padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#ecf0f1}.nav>li.disabled>a{color:#b4bcc2}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#b4bcc2;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#ecf0f1}.nav .nav-divider{height:1px;margin:15px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ecf0f1}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#ecf0f1}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#2C3E50;background-color:#f5f8fa;border:1px solid #ecf0f1;border-bottom-color:transparent;cursor:default}.nav-pills>li{float:left}.nav-justified>li,.nav-stacked>li,.nav-tabs.nav-justified>li{float:none}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#2C3E50}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified,.nav-tabs.nav-justified{width:100%}.nav-justified>li>a,.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}.nav-tabs-justified,.nav-tabs.nav-justified{border-bottom:0}.nav-tabs-justified>li>a,.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ecf0f1}@media (min-width:768px){.nav-justified>li,.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a,.nav-tabs.nav-justified>li>a{margin-bottom:0}.nav-tabs-justified>li>a,.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#f5f8fa}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before{content:" ";display:table}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:32px;border:1px solid transparent}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar{border-radius:4px}.navbar-header{float:left}.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-left:0;padding-right:0}}.carousel-inner,.embed-responsive,.modal,.modal-open,.progress{overflow:hidden}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header,.profile-container>.navbar-collapse,.profile-container>.navbar-header{margin-right:-15px;margin-left:-15px}.navbar-static-top{z-index:1000;border-width:0 0 1px}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:9px 15px;font-size:19px;height:50px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header,.profile-container>.navbar-collapse,.profile-container>.navbar-header{margin-right:0;margin-left:0}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand,.navbar>.profile-container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}.navbar-nav{margin:4.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:32px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:32px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}.progress-bar-striped,.progress-striped .progress-bar,.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}@media (min-width:768px){.navbar-toggle{display:none}.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:9px;padding-bottom:9px}}.navbar-form{padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin:-3px -15px}@media (min-width:768px){.navbar-form .form-control-static,.navbar-form .form-group{display:inline-block}.navbar-form .control-label,.navbar-form .form-group{margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;box-shadow:none}}.breadcrumb>li,.pagination{display:inline-block}.btn .badge,.btn .label{top:-1px;position:relative}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-radius:4px 4px 0 0}.navbar-btn{margin-top:-3px;margin-bottom:-3px}.btn-group-sm>.navbar-btn.btn,.navbar-btn.btn-sm{margin-top:7.5px;margin-bottom:7.5px}.btn-group-xs>.navbar-btn.btn,.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:9px;margin-bottom:9px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#2C3E50;border-color:transparent}.navbar-default .navbar-brand{color:#fff}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#1E96D0;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#fff}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#1E96D0;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#fff;background-color:#1a252f}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#1a252f}.navbar-default .navbar-collapse,.navbar-default .navbar-form,.navbar-inverse{border-color:transparent}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#1a252f}.navbar-default .navbar-toggle .icon-bar{background-color:#fff}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{background-color:#1a252f;color:#fff}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#fff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#1E96D0;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#1a252f}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#fff}.navbar-default .navbar-link:hover{color:#1E96D0}.navbar-default .btn-link{color:#fff}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#1E96D0}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#1E96D0}.navbar-inverse .navbar-brand{color:#fff}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#2C3E50;background-color:transparent}.navbar-inverse .navbar-nav>li>a,.navbar-inverse .navbar-text{color:#fff}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#2C3E50;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#1b86ba}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#1876a3}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#1876a3}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#1a80b1}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{background-color:#1b86ba;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#fff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#2C3E50;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#1b86ba}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-inverse .navbar-link{color:#fff}.navbar-inverse .navbar-link:hover{color:#2C3E50}.navbar-inverse .btn-link{color:#fff}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#2C3E50}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#ccc}.breadcrumb{padding:8px 15px;margin-bottom:32px;list-style:none;background-color:#ecf0f1;border-radius:4px}.breadcrumb>li+li:before{content:"/ ";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#95a5a6}.pagination{padding-left:0;margin:32px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:10px 15px;line-height:1.42857;text-decoration:none;color:#fff;background-color:#1E96D0;border:1px solid transparent;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#fff;background-color:#14668d;border-color:transparent}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;background-color:#14668d;border-color:transparent;cursor:default}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#ecf0f1;background-color:#54b7e6;border-color:transparent;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:18px 27px;font-size:19px;line-height:1.33333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:6px 9px;font-size:13px;line-height:1.5}.badge,.label{font-weight:700;color:#fff;line-height:1;white-space:nowrap;text-align:center}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:32px 0;list-style:none;text-align:center}.pager:after,.pager:before{content:" ";display:table}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#1E96D0;border:1px solid transparent;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#14668d}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;vertical-align:baseline;border-radius:.25em}.label:empty{display:none}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label-default{background-color:#95a5a6}.label-default[href]:focus,.label-default[href]:hover{background-color:#798d8f}.label-primary{background-color:#2C3E50}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#1a252f}.label-success{background-color:#1E96D0}.label-success[href]:focus,.label-success[href]:hover{background-color:#1876a3}.label-info{background-color:#3498DB}.label-info[href]:focus,.label-info[href]:hover{background-color:#217dbb}.label-warning{background-color:#F39C12}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#c87f0a}.label-danger{background-color:#E74C3C}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#d62c1a}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:13px;vertical-align:middle;background-color:#2C3E50;border-radius:10px}.badge:empty{display:none}.media-object,.thumbnail{display:block}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#2C3E50;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.jumbotron,.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;background-color:#ecf0f1}.jumbotron p{margin-bottom:15px;font-size:23px;font-weight:200}.alert,.thumbnail{margin-bottom:32px}.alert .alert-link,.close{font-weight:700}.jumbotron>hr{border-top-color:#cfd9db}.container .jumbotron,.container-fluid .jumbotron,.profile-container .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron,.profile-container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron .h1,.jumbotron h1{font-size:68px}}.thumbnail{padding:4px;line-height:1.42857;background-color:#f5f8fa;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto;margin-left:auto;margin-right:auto}.thumbnail .caption{padding:9px;color:#676767}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#007EBB}.alert{padding:15px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.modal,.modal-backdrop{top:0;right:0;bottom:0;left:0}.alert-success{background-color:#1E96D0;border-color:#1E96D0;color:#fff}.alert-success hr{border-top-color:#1b86ba}.alert-success .alert-link{color:#e6e6e6}.alert-info{background-color:#3498DB;border-color:#3498DB;color:#fff}.alert-info hr{border-top-color:#258cd1}.alert-info .alert-link{color:#e6e6e6}.alert-warning{background-color:#F39C12;border-color:#F39C12;color:#fff}.alert-warning hr{border-top-color:#e08e0b}.alert-warning .alert-link{color:#e6e6e6}.alert-danger{background-color:#E74C3C;border-color:#E74C3C;color:#fff}.alert-danger hr{border-top-color:#e43725}.alert-danger .alert-link{color:#e6e6e6}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{margin-bottom:32px;background-color:#ecf0f1;border-radius:4px}.progress-bar{float:left;width:0;height:100%;font-size:13px;line-height:32px;color:#fff;text-align:center;background-color:#2C3E50;box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#1E96D0}.progress-striped .progress-bar-success{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-striped .progress-bar-info,.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#3498DB}.progress-striped .progress-bar-info{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#F39C12}.progress-striped .progress-bar-warning{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#E74C3C}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ecf0f1}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{text-decoration:none;color:#555;background-color:#ecf0f1}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{background-color:#ecf0f1;color:#b4bcc2;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#b4bcc2}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#2C3E50;border-color:#2C3E50}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#8aa4be}.list-group-item-success{color:#fff;background-color:#1E96D0}a.list-group-item-success,button.list-group-item-success{color:#fff}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#fff;background-color:#1b86ba}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#fff;border-color:#fff}.list-group-item-info{color:#fff;background-color:#3498DB}a.list-group-item-info,button.list-group-item-info{color:#fff}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#fff;background-color:#258cd1}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#fff;border-color:#fff}.list-group-item-warning{color:#fff;background-color:#F39C12}a.list-group-item-warning,button.list-group-item-warning{color:#fff}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#fff;background-color:#e08e0b}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#fff;border-color:#fff}.list-group-item-danger{color:#fff;background-color:#E74C3C}a.list-group-item-danger,button.list-group-item-danger{color:#fff}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#fff;background-color:#e43725}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#fff;border-color:#fff}.panel-heading>.dropdown .dropdown-toggle,.panel-title,.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:32px;background-color:#fff;border:1px solid transparent;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-title,.panel>.list-group,.panel>.panel-collapse>.list-group,.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel-body{padding:15px}.panel-body:after,.panel-body:before{content:" ";display:table}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-title{margin-top:0;font-size:17px}.panel-footer{padding:10px 15px;background-color:#ecf0f1;border-top:1px solid #ecf0f1;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel-group .panel-heading,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-responsive:last-child>.table:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.table-responsive:first-child>.table:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.list-group+.panel-footer,.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-left:15px;padding-right:15px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ecf0f1}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:32px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ecf0f1}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ecf0f1}.panel-default{border-color:#ecf0f1}.panel-default>.panel-heading{color:#2c3e50;background-color:#ecf0f1;border-color:#ecf0f1}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ecf0f1}.panel-default>.panel-heading .badge{color:#ecf0f1;background-color:#2c3e50}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ecf0f1}.panel-primary{border-color:#2C3E50}.panel-primary>.panel-heading{color:#fff;background-color:#2C3E50;border-color:#2C3E50}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#2C3E50}.panel-primary>.panel-heading .badge{color:#2C3E50;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#2C3E50}.panel-success{border-color:#1E96D0}.panel-success>.panel-heading{color:#fff;background-color:#1E96D0;border-color:#1E96D0}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#1E96D0}.panel-success>.panel-heading .badge{color:#1E96D0;background-color:#fff}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#1E96D0}.panel-info{border-color:#3498DB}.panel-info>.panel-heading{color:#fff;background-color:#3498DB;border-color:#3498DB}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3498DB}.panel-info>.panel-heading .badge{color:#3498DB;background-color:#fff}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3498DB}.panel-warning{border-color:#F39C12}.panel-warning>.panel-heading{color:#fff;background-color:#F39C12;border-color:#F39C12}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#F39C12}.panel-warning>.panel-heading .badge{color:#F39C12;background-color:#fff}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#F39C12}.panel-danger{border-color:#E74C3C}.panel-danger>.panel-heading{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#E74C3C}.panel-danger>.panel-heading .badge{color:#E74C3C;background-color:#fff}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#E74C3C}.embed-responsive{position:relative;display:block;height:0;padding:0}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#ecf0f1;border:1px solid transparent;border-radius:4px}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:22.5px;line-height:1;text-shadow:none;filter:alpha(opacity=20)}.popover,.tooltip{font-family:Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;text-decoration:none}.modal-title,.popover,.tooltip{line-height:1.42857}.close:focus,.close:hover{text-decoration:none;cursor:pointer;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.modal-content,.popover{background-clip:padding-box}.modal{display:none;position:fixed;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before{display:table;content:" "}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0}.modal-backdrop{position:fixed;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0}.modal-body{position:relative;padding:20px}.modal-footer{padding:20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}.tooltip.top-left .tooltip-arrow,.tooltip.top-right .tooltip-arrow{bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;text-align:left;text-align:start;font-size:13px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px}.tooltip.top-right .tooltip-arrow{left:5px}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow,.tooltip.bottom-left .tooltip-arrow,.tooltip.bottom-right .tooltip-arrow{border-width:0 5px 5px;border-bottom-color:#000;top:0}.tooltip.bottom .tooltip-arrow{left:50%;margin-left:-5px}.tooltip.bottom-left .tooltip-arrow{right:5px;margin-top:-5px}.tooltip.bottom-right .tooltip-arrow{left:5px;margin-top:-5px}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;text-align:left;text-align:start;font-size:15px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;box-shadow:0 5px 10px rgba(0,0,0,.2)}.carousel-caption,.carousel-control{color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.6);text-align:center}.btn-group.open .dropdown-toggle,.btn:active,.form-control:focus,.progress,.well,input:focus{box-shadow:none}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:15px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.carousel,.carousel-inner{position:relative}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:fadein(rgba(0,0,0,.2),5%);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.left>.arrow:after,.popover.right>.arrow:after{content:" ";bottom:-10px}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:fadein(rgba(0,0,0,.2),5%)}.popover.right>.arrow:after{left:1px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:fadein(rgba(0,0,0,.2),5%);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:fadein(rgba(0,0,0,.2),5%)}.popover.left>.arrow:after{right:1px;border-right-width:0;border-left-color:#fff}.carousel-inner{width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{display:block;max-width:100%;height:auto;line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;background-color:transparent}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:focus,.carousel-control:hover{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000\9;background-color:transparent}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px}.carousel-caption .btn,.text-hide{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:after,.clearfix:before{content:" ";display:table}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.hidden,.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;background-color:transparent;border:0}.affix{position:fixed}@-ms-viewport{width:device-width}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}.visible-xs-block{display:block!important}.visible-xs-inline{display:inline!important}.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}.visible-sm-block{display:block!important}.visible-sm-inline{display:inline!important}.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}.visible-md-block{display:block!important}.visible-md-inline{display:inline!important}.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}.visible-lg-block{display:block!important}.visible-lg-inline{display:inline!important}.visible-lg-inline-block{display:inline-block!important}.hidden-lg{display:none!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}.hidden-print{display:none!important}}.browsehappy{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.thumbnail{height:200px}.thumbnail img.pull-right{width:50px}h1,h2,h3,h4,h5{color:#237394}.profile-container{padding:0 12%}@media (max-width:978px){.profile-container{padding:0 2%}}.navbar .container-fluid,.navbar .profile-container{padding-right:12%;padding-left:12%}@media (max-width:978px){.navbar .container-fluid,.navbar .profile-container{padding-right:2%;padding-left:2%}}.navbar .container-fluid .navbar-brand .noosfero-logo img,.navbar .profile-container .navbar-brand .noosfero-logo img{height:35px}.navbar .container-fluid .navbar-nav .profile-menu .profile-image img,.navbar .profile-container .navbar-nav .profile-menu .profile-image img{height:30px;width:30px;display:inline-block}.navbar .container-fluid .navbar-nav .profile-menu .profile-image i,.navbar .profile-container .navbar-nav .profile-menu .profile-image i{font-size:1.7em}.comma-separated .separated-item:after{content:", ";margin-left:-3px}.comma-separated .separated-item:last-child:after{content:""}.block .panel-title{font-size:15px;font-weight:700}.block .panel-heading{background-color:transparent;border:0}@media (min-width:920px){.col-md-2-5{width:20.83%}}i.profile-image{color:#2c3e50}.article .page-info .author a{color:#b4bcc2}.article .page-header{margin-bottom:5px}.article .sub-header{margin-bottom:20px}.blog .blog-cover{margin:-15px;position:relative}.blog .blog-cover h3{position:absolute;bottom:0;background-color:rgba(0,0,0,.4);color:#fff;padding:10px 15px;margin:0;width:100%}.col-md-7 .block.recentdocumentsblock .deckgrid .deck-column,.col-md-7 .block.recentdocumentsblock .panel-body{padding:0}.link-list-block a i{line-height:25px;color:#949494}.members-block .member i.profile-image,.members-block .member img{width:60px}.members-block .member img{display:inline-block;vertical-align:top}.members-block .member i.profile-image{text-align:center;background-color:#889DB1;color:#F1F1F1;font-size:4.5em}.profile-image-block .settings-link{display:block}.block.recentdocumentsblock .deckgrid[deckgrid]::before{font-size:0;visibility:hidden}.block.recentdocumentsblock .author img{width:30px;height:30px}.block.recentdocumentsblock .header .subheader{color:#C1C1C1;font-size:10px}.block.recentdocumentsblock .post-lead{color:#8E8E8E;font-size:14px}.block.recentdocumentsblock .article-image{margin:10px 0}.col-md-2-5 .deckgrid[deckgrid]::before{content:'1 .deck-column'}.col-md-7 .block.recentdocumentsblock{background-color:transparent;border:0}.col-md-7 .block.recentdocumentsblock .deckgrid[deckgrid]::before{content:'3 .deck-column'}.col-md-7 .block.recentdocumentsblock .panel-heading{display:none}.col-md-7 .block.recentdocumentsblock .deckgrid .column{float:left}.col-md-7 .block.recentdocumentsblock .deckgrid .deck-column .a-card{padding:10px;margin:3px}.navbar{border-width:0}.navbar-default .badge{background-color:#fff;color:#2C3E50}.navbar-inverse .badge{background-color:#fff;color:#1E96D0}.navbar-brand{line-height:1}.btn{border-width:2px}.text-primary,.text-primary:hover{color:#2C3E50}.text-success,.text-success:hover{color:#1E96D0}.text-danger,.text-danger:hover{color:#E74C3C}.text-warning,.text-warning:hover{color:#F39C12}.text-info,.text-info:hover{color:#3498DB}.table a:not(.btn),table a:not(.btn){text-decoration:underline}.close,.table .dropdown-menu a,table .dropdown-menu a{text-decoration:none}.table .danger,.table .danger>a,.table .danger>td>a,.table .danger>th>a,.table .info,.table .info>a,.table .info>td>a,.table .info>th>a,.table .success,.table .success>a,.table .success>td>a,.table .success>th>a,.table .warning,.table .warning>a,.table .warning>td>a,.table .warning>th>a,table .danger,table .danger>a,table .danger>td>a,table .danger>th>a,table .info,table .info>a,table .info>td>a,table .info>th>a,table .success,table .success>a,table .success>td>a,table .success>th>a,table .warning,table .warning>a,table .warning>td>a,table .warning>th>a{color:#fff}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th,table>tbody>tr>td,table>tbody>tr>th,table>tfoot>tr>td,table>tfoot>tr>th,table>thead>tr>td,table>thead>tr>th{border:none}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th,table-bordered>tbody>tr>td,table-bordered>tbody>tr>th,table-bordered>tfoot>tr>td,table-bordered>tfoot>tr>th,table-bordered>thead>tr>td,table-bordered>thead>tr>th{border:1px solid #ecf0f1}.form-control,input{border-width:2px;box-shadow:none}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .form-control-feedback,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#F39C12}.has-warning .form-control,.has-warning .form-control:focus{border:2px solid #F39C12}.has-warning .input-group-addon{border-color:#F39C12}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .form-control-feedback,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#E74C3C}.has-error .form-control,.has-error .form-control:focus{border:2px solid #E74C3C}.has-error .input-group-addon{border-color:#E74C3C}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .form-control-feedback,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#1E96D0}.has-success .form-control,.has-success .form-control:focus{border:2px solid #1E96D0}.has-success .input-group-addon{border-color:#1E96D0}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{border-color:transparent}.pager a,.pager a:hover{color:#fff}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{background-color:#54b7e6}.close{color:#fff;opacity:.4}.close:focus,.close:hover{color:#fff;opacity:1}.alert .alert-link{color:#fff;text-decoration:underline}.progress{height:10px}.progress .progress-bar{font-size:10px;line-height:10px}a.list-group-item.active,a.list-group-item.active:focus,a.list-group-item.active:hover{border-color:#ecf0f1}a.list-group-item-success.active{background-color:#1E96D0}a.list-group-item-success.active:focus,a.list-group-item-success.active:hover{background-color:#1b86ba}a.list-group-item-warning.active{background-color:#F39C12}a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover{background-color:#e08e0b}a.list-group-item-danger.active{background-color:#E74C3C}a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover{background-color:#e43725}.modal .close,.panel-default .close,.popover{color:#676767} | |
9 | -/*# sourceMappingURL=../maps/styles/app-1cbf5925d3.css.map */ |
gulp/build.js
... | ... | @@ -88,7 +88,7 @@ gulp.task('other', function () { |
88 | 88 | |
89 | 89 | return gulp.src([ |
90 | 90 | path.join(conf.paths.src, '/**/*'), |
91 | - path.join('!' + conf.paths.src, '/**/*.{html,css,js,scss}') | |
91 | + path.join('!' + conf.paths.src, '/**/*.{map,ts,html,css,js,scss}') | |
92 | 92 | ]) |
93 | 93 | .pipe(fileFilter) |
94 | 94 | .pipe(gulp.dest(path.join(conf.paths.dist, '/'))); | ... | ... |
gulp/scripts.js
... | ... | @@ -19,8 +19,6 @@ gulp.task('scripts', function() { |
19 | 19 | }); |
20 | 20 | |
21 | 21 | function buildScripts() { |
22 | - return gulp.src(path.join(conf.paths.src, '/app/**/*.js')) | |
23 | - .pipe($.eslint()) | |
24 | - .pipe($.eslint.format()) | |
22 | + return gulp.src(path.join(conf.paths.src, '/**/*.js')) | |
25 | 23 | .pipe($.size()) |
26 | 24 | }; | ... | ... |
gulp/watch.js
... | ... | @@ -25,7 +25,7 @@ gulp.task('watch', ['inject'], function () { |
25 | 25 | } |
26 | 26 | }); |
27 | 27 | |
28 | - gulp.watch(path.join(conf.paths.src, '/app/**/*.js'), function(event) { | |
28 | + gulp.watch(path.join(conf.paths.src, '/**/*.js'), function(event) { | |
29 | 29 | if(isOnlyChange(event)) { |
30 | 30 | gulp.start('scripts-reload'); |
31 | 31 | } else { | ... | ... |
package.json
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | "moment": "^2.11.2" |
8 | 8 | }, |
9 | 9 | "scripts": { |
10 | + "build": "webpack; gulp build", | |
10 | 11 | "webpack": "webpack", |
11 | 12 | "karma": "karma", |
12 | 13 | "coverage": "karma start --single-run; npm run remap-coverage", |
... | ... | @@ -77,6 +78,8 @@ |
77 | 78 | "replace": "^0.3.0", |
78 | 79 | "ts-loader": "^0.8.1", |
79 | 80 | "ts-node": "^0.5.5", |
81 | + "tslint": "^3.5.0", | |
82 | + "tslint-loader": "^2.1.3", | |
80 | 83 | "typescript": "^1.8.2", |
81 | 84 | "typings": "^0.6.8", |
82 | 85 | "uglify-save-license": "~0.4.1", | ... | ... |
src/index.html
... | ... | @@ -32,11 +32,14 @@ |
32 | 32 | <!-- run `gulp inject` to automatically populate bower script dependencies --> |
33 | 33 | <!-- endbower --> |
34 | 34 | <!-- endbuild --> |
35 | - | |
35 | + | |
36 | + <!-- build:js({.tmp/serve,.tmp/partials,src}) scripts/app.js --> | |
36 | 37 | <script src="commons.js"></script> |
37 | 38 | <script src="vendor.bundle.js"></script> |
38 | - | |
39 | 39 | <script src="noosfero.js"></script> |
40 | + <!-- endinject --> | |
41 | + | |
42 | + | |
40 | 43 | <!-- inject:partials --> |
41 | 44 | <!-- angular templates will be automatically converted in js and inserted here --> |
42 | 45 | <!-- endinject --> | ... | ... |
webpack.config.js
... | ... | @@ -27,18 +27,10 @@ var testingFiles = glob.sync("./src/app/**/**/*.[sS]pec.ts"); |
27 | 27 | |
28 | 28 | var entries = { |
29 | 29 | noosfero: './src/app/index.ts', |
30 | - 'noosfero-specs': testFiles,// './src/specs.ts', | |
30 | + 'noosfero-specs': testFiles, // './src/specs.ts', | |
31 | 31 | 'vendor.bundle': ['core-js', 'reflect-metadata', 'ng-forward', 'ng-forward/cjs/testing/test-component-builder'] |
32 | 32 | }; |
33 | 33 | |
34 | - | |
35 | -// if (argv.test) { | |
36 | -// entries = { | |
37 | -// 'noosfero-src': './src/app/index.ts', | |
38 | -// 'noosfero-specs': testFiles,// './src/specs.ts', | |
39 | -// 'vendor.bundle': ['core-js', 'reflect-metadata', 'ng-forward', 'ng-forward/cjs/testing/test-component-builder'] | |
40 | -// }; | |
41 | -// } | |
42 | 34 | var webpackConfig = { |
43 | 35 | entry: entries, |
44 | 36 | |
... | ... | @@ -48,8 +40,6 @@ var webpackConfig = { |
48 | 40 | path: path.join(__dirname, "src"), |
49 | 41 | filename: "[name]" + extension, |
50 | 42 | }, |
51 | - | |
52 | - /*plugins: [ new webpack.optimize.CommonsChunkPlugin("common.js") ],*/ | |
53 | 43 | |
54 | 44 | resolve: { |
55 | 45 | // Add `.ts` and `.tsx` as a resolvable extension. |
... | ... | @@ -63,15 +53,18 @@ var webpackConfig = { |
63 | 53 | test: /\.css$/, |
64 | 54 | loader: "style!css" |
65 | 55 | }, { |
66 | - test: /\.scss$/, | |
67 | - loaders: ["style", "css?sourceMap", "sass?sourceMap"] | |
68 | - }, { | |
69 | - test: /.(png|woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/, | |
70 | - loader: 'url-loader?limit=100000' | |
71 | - }, { | |
72 | - test: /\.tsx?$/, | |
73 | - loader: 'ts-loader' | |
74 | - }] | |
56 | + test: /\.scss$/, | |
57 | + loaders: ["style", "css?sourceMap", "sass?sourceMap"] | |
58 | + }, { | |
59 | + test: /.(png|woff(2)?|eot|ttf|svg)(\?[a-z0-9=\.]+)?$/, | |
60 | + loader: 'url-loader?limit=100000' | |
61 | + }, { | |
62 | + test: /\.tsx?$/, | |
63 | + loader: 'ts-loader' | |
64 | + }, { | |
65 | + test: /\.ts?$/, | |
66 | + loader: "tslint" | |
67 | + }] | |
75 | 68 | } |
76 | 69 | }; |
77 | 70 | |
... | ... | @@ -91,24 +84,28 @@ var stdinPatched = false; |
91 | 84 | if (argv.test) { |
92 | 85 | function spawnChildProcessTest() { |
93 | 86 | if (!testProcess) { |
94 | - testProcess = child_process.spawn("npm", ["run", "coverage"], { stdio: 'inherit' }); | |
95 | - testProcess.on('exit', function () { testProcess = null }); | |
87 | + testProcess = child_process.spawn("npm", ["run", "coverage"], { | |
88 | + stdio: 'inherit' | |
89 | + }); | |
90 | + testProcess.on('exit', function() { | |
91 | + testProcess = null | |
92 | + }); | |
96 | 93 | } |
97 | 94 | } |
98 | 95 | // configure the webPackOnBuildPlugin with our post-compilation function as argument |
99 | - var onBuildPluginConfigured = new WebpackOnBuildPlugin(function (stats) { | |
96 | + var onBuildPluginConfigured = new WebpackOnBuildPlugin(function(stats) { | |
100 | 97 | |
101 | 98 | // here we are patching the stdin to allow trigger tests when pressing 'Enter' |
102 | 99 | // on terminal |
103 | 100 | if (!stdinPatched) { |
104 | - process.stdin.on('data', function (info) { | |
101 | + process.stdin.on('data', function(info) { | |
105 | 102 | if (info == '\n') { |
106 | 103 | spawnChildProcessTest(); |
107 | 104 | } |
108 | 105 | }); |
109 | 106 | stdinPatched = true; |
110 | 107 | } |
111 | - | |
108 | + | |
112 | 109 | // webpack in watch mode call this twice for just one compilation |
113 | 110 | // so, here we are checking if the process is still running before trigger another test execution |
114 | 111 | if (testProcess == null) { |
... | ... | @@ -122,4 +119,4 @@ if (argv.test) { |
122 | 119 | webpackConfig.plugins.push(onBuildPluginConfigured); |
123 | 120 | } |
124 | 121 | |
125 | 122 | -module.exports = webpackConfig; |
123 | +module.exports = webpackConfig; | |
126 | 124 | \ No newline at end of file | ... | ... |