From fa38a594987d958bab7b154d6afdca461081aa83 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 9 Dec 2015 17:18:04 +0100 Subject: Initial commit --- afb-client/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 afb-client/README.md diff --git a/afb-client/README.md b/afb-client/README.md new file mode 100644 index 0000000..11a8f45 --- /dev/null +++ b/afb-client/README.md @@ -0,0 +1,2 @@ +# afb-client-sample +Simple HTML5 Application Framework Client base on Angular & Zurb Foundation + Gulp -- cgit 1.2.3-korg From c4e1fc1d683701400491a6ccfd8ccb0514dbd74b Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Dec 2015 16:54:56 +0100 Subject: Initial Version. Support both AfbDaemon & Backend Mock server. --- afb-client/.gitignore | 7 + afb-client/LICENSE | 17 ++ afb-client/README.md | 97 +++++++++- afb-client/bower.json | 18 ++ afb-client/gulpfile.js | 456 ++++++++++++++++++++++++++++++++++++++++++++++++ afb-client/index.html | 41 +++++ afb-client/package.json | 61 +++++++ 7 files changed, 695 insertions(+), 2 deletions(-) create mode 100644 afb-client/.gitignore create mode 100644 afb-client/LICENSE create mode 100644 afb-client/bower.json create mode 100644 afb-client/gulpfile.js create mode 100644 afb-client/index.html create mode 100644 afb-client/package.json diff --git a/afb-client/.gitignore b/afb-client/.gitignore new file mode 100644 index 0000000..bb6f2ab --- /dev/null +++ b/afb-client/.gitignore @@ -0,0 +1,7 @@ +bower_components/ +node_modules/ +dist.dev/ +dist.prod/ +*.DS_Store +nbproject/private/ +.noderc* diff --git a/afb-client/LICENSE b/afb-client/LICENSE new file mode 100644 index 0000000..89f9ced --- /dev/null +++ b/afb-client/LICENSE @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ diff --git a/afb-client/README.md b/afb-client/README.md index 11a8f45..e31390e 100644 --- a/afb-client/README.md +++ b/afb-client/README.md @@ -1,2 +1,95 @@ -# afb-client-sample -Simple HTML5 Application Framework Client base on Angular & Zurb Foundation + Gulp + +## Installation + +Install HTML5 development toolchain on your host + +1. Check out this repository + git clone https://github.com/iotbzh/afb-client-sample.git + +2) Install NodeJs [not used on target] + zypper install nodejs + yum install nodejs + +3) Install building tools [bower, gulp, ....] + npm install # this install all development tool chain dependencies + sudo npm install --global gulp # this is not mandatory but it will make your live simpler + +4. For livereload functionality [automatic refresh of HTML/CSS] + install [livereload Chrome extension](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei) + + +### Overload ./etc/Defaults.js with '.noderc.js' + var config= { + APPNAME : 'AFBclient', // AppName is use as main Angular Module name + FRONTEND: "Frontend", // HTML5 frontend [no leading ./] + BACKEND : "Backend", // NodeJS Rest API [no leading ./] + URLBASE : '/opa/', // HTML basedir when running in production [should end with a /] + APIBASE : '/api/', // Api url base dir [should end with a /] + DEBUG : 4001, // Node Debug Port [for mock API debug only] + DBG_LVL : 5, // Debug Trace Level 0=no trace. + }; + module.exports = config; + + WARNING: in current version Frontend/services/ConfigApp.js is not updated automatically + you should make sure than your backend config fit with your frontend config. + Note: FCS version should have ConfigApp.js configurated automatically from GULP, but this is for "tomorrow" + +### Build project + gulp help + gulp build-app-dev + gulp watch-dev + http://localhost:3001/opa /* debug mock api base on Backend/RestApi */ + +### Test with Application server binder [you may safely run gulp 'watch-dev' + 'afb-daemon' simultaneously] + export MYWORKSPACE=$HOME/Workspace + $MYWORKSPACE/afb-daemon/build/afb-daemon --port=1234 --verbose --token=123456789 --rootdir=$MYWORKSPACE/afb-client/dist.dev + http://localhost:1234/opa + + Note: + - do not forget "/opa" that should match with your config.URLBASE + - if you change --token=xxxx do not forget to update ./Frontend/pages/HomeModules.js + - Force HTML/OPA reload with F5 after each HTML5/OPA update or new pages may not be loaded. + - When reloading HTML/OPA with F5 do not forget that your initial token wont be accepted anymore. You should either restart to clean existing session or cleanup AJB_session cookie. + +### Move to Target + cd $MYWORKSPACE/afb-client + gulp build-app-prod + scp -r ./dist.pro/* user@mytarget:/rootdir/apfDaemon + + /AppClient + | + |---- package.json + |---- bower.json + |---- gulpfile.js + |---- .noderc.js [Warning: contains private keys should not uploaded in Github] + | + |---- /Frontend + | | + | |---- index.html + | |---- app.js + | | + | |---- /styles + | | | + | | |---- _settings.scss + | | |---- app.scss + | | + | |---- /Widgets + | | | + | | |--- Widget-1 + | | |... + | | + | |-----/Pages + | |--- Home-Page + | |... + | + | + |---- /Backend + | |-- server.js // launcher + | |----/ models // mogoose database schemas + | |----/ providers // authentication services + | |----/ restapis // application APIs + | + |---- (/dist.dev) + |---- (/dist.prod) + + \ No newline at end of file diff --git a/afb-client/bower.json b/afb-client/bower.json new file mode 100644 index 0000000..84dbe1e --- /dev/null +++ b/afb-client/bower.json @@ -0,0 +1,18 @@ +{ + "name": "healthy-gulp-angular", + "version": "0.0.0", + "authors": "", + "private": true, + "dependencies": { + "angular": "~1.3.4", + "angular-cookies": "~1.3.4", + "foundation-apps": "~1.1.0", + "angular-ui-notification": "~0.0.14", + "foundation-icon-fonts": "*" + }, + "overrides": { + "foundation": { + "main": ["dist/js/foundation-apps-templates.js", "dist/js/foundation-apps.js"] + } + } +} diff --git a/afb-client/gulpfile.js b/afb-client/gulpfile.js new file mode 100644 index 0000000..f483431 --- /dev/null +++ b/afb-client/gulpfile.js @@ -0,0 +1,456 @@ +// BUG Symlink not working + +var gulp = require('gulp'); +var debug = require('gulp-debug'); +var plugins = require('gulp-load-plugins')(); +var del = require('del'); +var es = require('event-stream'); +var bowerFiles = require('main-bower-files'); +var print = require('gulp-print'); +var Q = require('q'); +var imagemin = require('gulp-imagemin'), pngquant = require('imagemin-pngquant'); +var taskListing = require('gulp-task-listing'); +var symlink = require('gulp-sym'); +var rename = require("gulp-rename"); + +// addon for Foundation6 +var router = require('front-router'); + +// == PATH STRINGS ======== +var appdir = "./app/"; // Warning to not forget trailling '/' +config=require (appdir + "etc/_Config"); // upload user local preferences if any + +// Run node in debug mode in developpement mode ? +var nodeopts = config.DEBUG !== undefined ? '--debug='+config.DEBUG : ''; +var frontend= appdir + config.FRONTEND; +var backend = appdir + config.BACKEND; + +var paths = { + application : frontend, + scripts : frontend+'/**/*.js', + appStyles : [frontend+'/**/*.scss', '!'+frontend+'/styles/*/*-conf.scss'], + globalStyles: [frontend+'/styles/**/*.scss'], + images : [frontend+'/**/*.png',frontend+'/**/*.jpg',frontend+'/**/*.jpeg',frontend+'/**/*.svg',frontend+'/**/*.ttf'], + index : frontend+'/index.html', + partials : [frontend + '/**/*.html', '!' + frontend +'/index.html'], + distDev : './dist.dev', + distProd : './dist.prod', + scriptsDevServer: backend + '/**/*.js', + sass: [frontend+'/styles', 'bower_components/foundation-apps/scss','bower_components/foundation-icon-fonts'], + fonts: ['bower_components/**/*.woff'], + favicon: frontend+'/favicon.ico' +}; + +paths['distAppDev'] = paths.distDev + config.URLBASE; +paths['distAppProd'] = paths.distProd + config.URLBASE; + +// Run node in debug mode in developpement mode ? +var nodeopts = config.DEBUG !== undefined ? '--debug='+config.DEBUG : ''; + +// == PIPE SEGMENTS ======== +var pipes = {}; + +pipes.orderedVendorScripts = function() { + return plugins.order(['jquery.js', 'angular.js']); +}; + +pipes.orderedAppScripts = function() { + return plugins.angularFilesort(); +}; + +pipes.minifiedFileName = function() { + return plugins.rename(function (path) { + path.extname = '.min' + path.extname; + }); +}; + +pipes.validatedAppScripts = function() { + return gulp.src(paths.scripts) + .pipe(plugins.replace('@@APPNAME@@', config.APPNAME)) + .pipe(plugins.jshint()) + .pipe(plugins.jshint.reporter('jshint-stylish')); +}; + +pipes.builtAppScriptsDev = function() { + return pipes.validatedAppScripts() + .pipe(gulp.dest(paths.distAppDev)); +}; + +pipes.builtAppScriptsProd = function() { + var scriptedPartials = pipes.scriptedPartials(); + var validatedAppScripts = pipes.validatedAppScripts(); + + return es.merge(scriptedPartials, validatedAppScripts) + .pipe(plugins.ngAnnotate()) + .pipe(pipes.orderedAppScripts()) + .pipe(plugins.sourcemaps.init()) + .pipe(plugins.concat(config.APPNAME+'.min.js')) + .pipe(plugins.uglify({compress: {drop_console: true}})) + .pipe(plugins.sourcemaps.write()) + .pipe(gulp.dest(paths.distAppProd)); +}; + +pipes.builtVendorScriptsDev = function() { + return gulp.src(bowerFiles()) + .pipe(gulp.dest( paths.distDev +'/bower_components')); +}; + +pipes.builtVendorScriptsProd = function() { + return gulp.src(bowerFiles('**/*.js')) + .pipe(pipes.orderedVendorScripts()) + .pipe(plugins.concat('vendor.min.js')) + .pipe(plugins.uglify()) + .pipe(gulp.dest(paths.distProd+ '/bower_components')); +}; + +pipes.validatedDevServerScripts = function() { + return gulp.src(paths.scriptsDevServer) + .pipe(plugins.jshint()) + .pipe(plugins.jshint.reporter('jshint-stylish')); +}; + +pipes.validatedPartials = function() { + return gulp.src(paths.partials) + .pipe(plugins.htmlhint({'doctype-first': false})) + .pipe(router({path: paths.application+'/tmp/routes.js', root: paths.application})) + .pipe(plugins.htmlhint.reporter()); +}; + +pipes.builtPartialsDev = function() { + return pipes.validatedPartials() + .pipe(gulp.dest(paths.distAppDev)); +}; + +pipes.scriptedPartials = function() { + return pipes.validatedPartials() + .pipe(plugins.htmlhint.failReporter()) + .pipe(plugins.htmlmin({collapseWhitespace: true, removeComments: true})) + .pipe(plugins.ngHtml2js({ + moduleName: config.APPNAME, + template: "(function() {" + + "angular.module('<%= moduleName %>').run(['$templateCache', function($templateCache) {" + + "$templateCache.put('<%= template.url %>',\n '<%= template.escapedContent %>');" + + "}]);\n" + + "})();\n" + })); +}; + +pipes.builtAppStylesDev = function() { + return gulp.src(paths.appStyles) + .pipe(plugins.sass({includePaths: paths.sass})) + .pipe(gulp.dest(paths.distAppDev + '/styles')); +}; + +pipes.builtglobalStylesDev = function() { + return gulp.src(paths.globalStyles) + .pipe(plugins.sass({includePaths: paths.sass})) + .pipe(gulp.dest(paths.distDev + '/global_styles')); +}; + +pipes.builtAppStylesProd = function() { + return gulp.src(paths.appStyles) + .pipe(plugins.sourcemaps.init()) + .pipe(plugins.sass({includePaths: frontend + '/styles'})) + // .pipe(debug({title: '***** appStyle:'})) + .pipe(plugins.minifyCss()) + .pipe(plugins.concat(config.APPNAME+'.css')) + .pipe(plugins.sourcemaps.write()) + .pipe(pipes.minifiedFileName()) + .pipe(gulp.dest(paths.distAppProd)); +}; + +pipes.builtglobalStylesProd = function() { + return gulp.src(paths.globalStyles) + .pipe(plugins.sourcemaps.init()) + .pipe(plugins.sass({includePaths: paths.sass})) + .pipe(plugins.minifyCss()) + .pipe(plugins.sourcemaps.write()) + .pipe(pipes.minifiedFileName()) + .pipe(rename(function (path) {path.dirname="";return path;})) + .pipe(gulp.dest(paths.distProd + '/global_styles')); +}; + +pipes.processedFontsDev = function() { + return gulp.src(paths.fonts) + .pipe(rename(function (path) {path.dirname="";return path;})) + .pipe(gulp.dest(paths.distDev+'/bower_components')); +}; + +pipes.processedFontsProd = function() { + return gulp.src(paths.fonts) + .pipe(rename(function (path) {path.dirname="";return path;})) + .pipe(gulp.dest(paths.distProd+'/bower_components')); +}; + + +pipes.processedImagesDev = function() { + return gulp.src(paths.images) + .pipe(gulp.dest(paths.distAppDev)); +}; + +pipes.processedFaviconDev = function() { + return gulp.src(paths.favicon) + .pipe(gulp.dest(paths.distDev)); +}; + +pipes.processedImagesProd = function() { + return gulp.src(paths.images) + .pipe(imagemin({ + progressive: true, + svgoPlugins: [{removeViewBox: false}], + use: [pngquant()] + })) + .pipe(gulp.dest(paths.distAppProd)); +}; + +pipes.processedFaviconProd = function() { + return gulp.src(paths.favicon) + .pipe(gulp.dest(paths.distProd)); +}; + +// Create an Symlink when config.URLBASE exist +pipes.createDevSymLink = function() { + return gulp.src(paths.distDev).pipe(symlink(paths.distDev+config.URLBASE, {force: true})); +}; + +pipes.createProdSymLink = function() { + return gulp.src(paths.distProd).pipe(symlink(paths.distDev+config.URLBASE,{force: true})); +}; + +pipes.validatedIndex = function() { + return gulp.src(paths.index) + .pipe(plugins.replace('@@APPNAME@@', config.APPNAME)) + .pipe(plugins.replace('@@URLBASE@@', config.URLBASE)) + .pipe(plugins.htmlhint()) + .pipe(plugins.htmlhint.reporter()); +}; + +pipes.builtIndexDev = function() { + + var orderedVendorScripts = pipes.builtVendorScriptsDev() + .pipe(pipes.orderedVendorScripts()); + + var orderedAppScripts = pipes.builtAppScriptsDev() + .pipe(pipes.orderedAppScripts()); + + var appStyles = pipes.builtAppStylesDev(); + var globalStyles = pipes.builtglobalStylesDev(); + + return pipes.validatedIndex() + // Vendor and Global should have absolute path to rootdir application one are relative to BaseURL + .pipe(plugins.inject(orderedVendorScripts, {relative: false, ignorePath: "/dist.dev", name: 'bower'})) + .pipe(plugins.inject(globalStyles, {relative: false, ignorePath: "/dist.dev", name:'vendor'})) + .pipe(gulp.dest(paths.distAppDev)) // write first to get relative path for inject + .pipe(plugins.inject(orderedAppScripts, {relative: true})) + .pipe(plugins.inject(appStyles, {relative: true, name: 'appli'})) + .pipe(gulp.dest(paths.distAppDev)); +}; + +pipes.builtIndexProd = function() { + + var vendorScripts= pipes.builtVendorScriptsProd(); + var appScripts = pipes.builtAppScriptsProd(); + var appStyles = pipes.builtAppStylesProd(); + var globalStyles = pipes.builtglobalStylesProd(); + + return pipes.validatedIndex() + // Vendor and Global should have absolute path to rootdir application one are relative to BaseURL + .pipe(plugins.inject(vendorScripts, {relative: false, ignorePath: "/dist.prod", name: 'bower'})) + .pipe(plugins.inject(globalStyles, {relative: false, ignorePath: "/dist.prod", name:'vendor'})) + .pipe(gulp.dest(paths.distAppProd)) // write first to get relative path for inject + .pipe(plugins.inject(appScripts, {relative: true})) + .pipe(plugins.inject(appStyles, {relative: true, name:'appli'})) + .pipe(plugins.htmlmin({collapseWhitespace: true, removeComments: true})) + .pipe(gulp.dest(paths.distAppProd)); +}; + +pipes.builtAppDev = function() { + return es.merge(pipes.builtIndexDev(), pipes.builtPartialsDev(), pipes.processedFaviconDev(), pipes.processedImagesDev(), pipes.processedFontsDev() ); +}; + +pipes.builtAppProd = function() { + return es.merge(pipes.builtIndexProd(), pipes.processedFaviconProd(), pipes.processedImagesProd(), pipes.processedFontsProd()); +}; + + +// == TASKS ======== + +// Add a task to render the output +gulp.task('help', taskListing.withFilters(/-/)); + +// clean, build of production environement +gulp.task('build', ['clean-build-app-prod', 'validate-devserver-scripts']); + +gulp.task('run', function() { + // start nodemon to auto-reload the dev server + plugins.nodemon({ script: 'server.js', ext: 'js', watch: ['devServer/']}) + .on('change', ['validate-devserver-scripts']) + .on('restart', function () { + console.log('[nodemon] restarted dev server'); + }); +}); + +// removes all compiled dev files +gulp.task('clean-dev', function() { + var deferred = Q.defer(); + del(paths.distDev, function() { + deferred.resolve(); + }); + return deferred.promise; +}); + +// removes all compiled production files +gulp.task('clean-prod', function() { + var deferred = Q.defer(); + del(paths.distProd, function() { + deferred.resolve(); + }); + return deferred.promise; +}); + +// checks html source files for syntax errors +gulp.task('validate-partials', pipes.validatedPartials); + +// checks index.html for syntax errors +gulp.task('validate-index', pipes.validatedIndex); + +// moves html source files into the dev environment +gulp.task('build-partials-dev', pipes.builtPartialsDev); + +// converts partials to javascript using html2js +gulp.task('convert-partials-to-js', pipes.scriptedPartials); + +// runs jshint on the dev server scripts +gulp.task('validate-devserver-scripts', pipes.validatedDevServerScripts); + +// runs jshint on the app scripts +gulp.task('validate-app-scripts', pipes.validatedAppScripts); + +// moves app scripts into the dev environment +gulp.task('build-app-scripts-dev', pipes.builtAppScriptsDev); + +// concatenates, uglifies, and moves app scripts and partials into the prod environment +gulp.task('build-app-scripts-prod', pipes.builtAppScriptsProd); + +// compiles app sass and moves to the dev environment +gulp.task('build-app-styles-dev', pipes.builtAppStylesDev); + +// compiles and minifies app sass to css and moves to the prod environment +gulp.task('build-app-styles-prod', pipes.builtAppStylesProd); + +// moves vendor scripts into the dev environment +gulp.task('build-vendor-scripts-dev', pipes.builtVendorScriptsDev); + +// concatenates, uglifies, and moves vendor scripts into the prod environment +gulp.task('build-vendor-scripts-prod', pipes.builtVendorScriptsProd); + +// validates and injects sources into index.html and moves it to the dev environment +gulp.task('build-index-dev', pipes.builtIndexDev); + +// validates and injects sources into index.html, minifies and moves it to the dev environment +gulp.task('build-index-prod', pipes.builtIndexProd); + +// builds a complete dev environment +gulp.task('build-app-dev', pipes.builtAppDev); + +// builds a complete prod environment +gulp.task('build-app-prod', pipes.builtAppProd); + +// cleans and builds a complete dev environment +gulp.task('clean-build-app-dev', ['clean-dev'], pipes.builtAppDev); + +// cleans and builds a complete prod environment +gulp.task('clean-build-app-prod', ['clean-prod'], pipes.builtAppProd); + +// clean, build, and watch live changes to the dev environment +gulp.task('watch-dev', ['clean-build-app-dev', 'validate-devserver-scripts'], function() { + + // start nodemon to auto-reload the dev server + plugins.nodemon({ exec: 'node ' + nodeopts, script: backend+'/server.js', ext: 'js', watch: [backend], env: {NODE_ENV : 'dev'} }) + .on('change', ['validate-devserver-scripts']) + .on('restart', function () { + console.log('[nodemon] restarted dev server'); + }); + + // start live-reload server + plugins.livereload.listen({ start: true }); + + // watch index + gulp.watch(paths.index, function() { + return pipes.builtIndexDev() + .pipe(plugins.livereload()); + }); + + // watch app scripts + gulp.watch(paths.scripts, function() { + return pipes.builtAppScriptsDev() + .pipe(plugins.livereload()); + }); + + // watch html partials + gulp.watch(paths.partials, function() { + return pipes.builtPartialsDev() + .pipe(plugins.livereload()); + }); + + // watch Images + gulp.watch(paths.images, function() { + return pipes.processedImagesDev() + .pipe(plugins.livereload()); + }); + + // watch styles + gulp.watch(paths.appStyles, function() { + return pipes.builtAppStylesDev() + .pipe(plugins.livereload()); + }); + +}); + +// clean, build, and watch live changes to the prod environment +gulp.task('watch-prod', ['clean-build-app-prod', 'validate-devserver-scripts'], function() { + + // start nodemon to auto-reload the dev server + plugins.nodemon({ script: backend +'/server.js', ext: 'js', watch: [backend], env: {MODE : 'prod'} }) + .on('change', ['validate-devserver-scripts']) + .on('restart', function () { + console.log('[nodemon] restarted dev server'); + }); + + // start live-reload server + plugins.livereload.listen({start: true}); + + // watch index + gulp.watch(paths.index, function() { + return pipes.builtIndexProd() + .pipe(plugins.livereload()); + }); + + // watch app scripts + gulp.watch(paths.scripts, function() { + return pipes.builtAppScriptsProd() + .pipe(plugins.livereload()); + }); + + // watch hhtml partials + gulp.watch(paths.partials, function() { + return pipes.builtAppScriptsProd() + .pipe(plugins.livereload()); + }); + + // watch Images + gulp.watch(paths.images, function() { + return pipes.processedImagesProd() + .pipe(plugins.livereload()); + }); + + // watch styles + gulp.watch(paths.appStyles, function() { + return pipes.builtAppStylesProd() + .pipe(plugins.livereload()); + }); + +}); + +// default task builds for prod +gulp.task('default', ['clean-build-app-prod']); diff --git a/afb-client/index.html b/afb-client/index.html new file mode 100644 index 0000000..32e0efe --- /dev/null +++ b/afb-client/index.html @@ -0,0 +1,41 @@ + + + + + + + + + Simple Sample Application + + + + + + + + + + + + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/afb-client/package.json b/afb-client/package.json new file mode 100644 index 0000000..3b11ee1 --- /dev/null +++ b/afb-client/package.json @@ -0,0 +1,61 @@ +{ + "name": "AudioClient", + "private": true, + "version": "0.0.0", + "repository": { + "type": "git", + "url": "https://github.com/iotbzh/healthy-gulp-angular-foundation6" + }, + "scripts": { + "postinstall": "bower install", + "build": "./node_modules/.bin/gulp clean-build-app-dev", + "start": "node node_modules/.bin/gulp watch-dev" + }, + "devDependencies": { + "body-parser": "^1.5.2", + "bower": "^1.3.1", + "cookie-parser": "^1.4.0", + "del": "^1.1.1", + "event-stream": "^3.2.2", + "express": "^4.7.2", + "express-session": "^1.12.1", + "front-router": "^1.0.0", + "gulp": "^3.9.0", + "gulp-angular-filesort": "^1.0.4", + "gulp-debug": "^2.1.2", + "gulp-concat": "^2.4.3", + "gulp-htmlhint": "0.0.9", + "gulp-htmlmin": "^1.0.0", + "gulp-imagemin": "*", + "gulp-inject": "^1.1.1", + "gulp-jshint": "^1.9.2", + "gulp-livereload": "^3.7.0", + "gulp-load-plugins": "^0.8.0", + "gulp-minify-css": "^0.4.5", + "gulp-ng-annotate": "^1.1.0", + "gulp-ng-html2js": "^0.2.0", + "gulp-nodemon": "^2.0.0", + "gulp-order": "^1.1.1", + "gulp-print": "^1.1.0", + "gulp-rename": "^1.2.0", + "gulp-replace": "^0.5.4", + "gulp-sass": "^2.0.3", + "gulp-sourcemaps": "^1.3.0", + "gulp-task-listing": "^1.0.1", + "gulp-uglify": "^1.2.0", + "imagemin-pngquant": "*", + "jshint-stylish": "^1.0.0", + "karma": "^0.10", + "karma-junit-reporter": "^0.2.2", + "main-bower-files": "^2.5.0", + "method-override": "^2.1.2", + "protractor": "^1.1.1", + "q": "^1.1.2", + "shelljs": "^0.2.6", + "traceback": "^0.3.1", + "gulp-sym": "0.0.14" + }, + "dependencies": { + "multer": "^1.1.0" + } +} -- cgit 1.2.3-korg From 043898a1d4ab86e275e7e5981382a07eac530587 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Dec 2015 17:02:55 +0100 Subject: Doc --- afb-client/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/afb-client/README.md b/afb-client/README.md index e31390e..3893f1f 100644 --- a/afb-client/README.md +++ b/afb-client/README.md @@ -3,19 +3,19 @@ Install HTML5 development toolchain on your host -1. Check out this repository - git clone https://github.com/iotbzh/afb-client-sample.git + 1. Check out this repository + git clone https://github.com/iotbzh/afb-client-sample.git -2) Install NodeJs [not used on target] - zypper install nodejs - yum install nodejs + 2) Install NodeJs [not used on target] + zypper install nodejs + yum install nodejs -3) Install building tools [bower, gulp, ....] - npm install # this install all development tool chain dependencies - sudo npm install --global gulp # this is not mandatory but it will make your live simpler + 3) Install building tools [bower, gulp, ....] + npm install # this install all development tool chain dependencies + sudo npm install --global gulp # this is not mandatory but it will make your live simpler -4. For livereload functionality [automatic refresh of HTML/CSS] - install [livereload Chrome extension](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei) + 4. For livereload functionality [automatic refresh of HTML/CSS] + install [livereload Chrome extension](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei) ### Overload ./etc/Defaults.js with '.noderc.js' -- cgit 1.2.3-korg From f4ec97c2f12a03fc5e6d29c6226c980b5c00cc8d Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Dec 2015 17:05:28 +0100 Subject: Doc --- afb-client/README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/afb-client/README.md b/afb-client/README.md index 3893f1f..8216a25 100644 --- a/afb-client/README.md +++ b/afb-client/README.md @@ -40,13 +40,16 @@ Install HTML5 development toolchain on your host gulp watch-dev http://localhost:3001/opa /* debug mock api base on Backend/RestApi */ -### Test with Application server binder [you may safely run gulp 'watch-dev' + 'afb-daemon' simultaneously] - export MYWORKSPACE=$HOME/Workspace - $MYWORKSPACE/afb-daemon/build/afb-daemon --port=1234 --verbose --token=123456789 --rootdir=$MYWORKSPACE/afb-client/dist.dev - http://localhost:1234/opa +### Test with Application server binder + + # Start AppFramework Binder + export MYWORKSPACE=$HOME/Workspace + $MYWORKSPACE/afb-daemon/build/afb-daemon --port=1234 --verbose --token=123456789 --rootdir=$MYWORKSPACE/afb-client/dist.dev + + Point your browser onto: http://localhost:1234/opa Note: - - do not forget "/opa" that should match with your config.URLBASE + - do not forget '/opa' that should match with your config.URLBASE - if you change --token=xxxx do not forget to update ./Frontend/pages/HomeModules.js - Force HTML/OPA reload with F5 after each HTML5/OPA update or new pages may not be loaded. - When reloading HTML/OPA with F5 do not forget that your initial token wont be accepted anymore. You should either restart to clean existing session or cleanup AJB_session cookie. -- cgit 1.2.3-korg From f7e443f996dceb928a047d06e45f59579f1fbc0e Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Dec 2015 17:08:42 +0100 Subject: Add Netbeans Project --- afb-client/nbproject/project.properties | 35 +++++++++++++++++++++++++++++++++ afb-client/nbproject/project.xml | 10 ++++++++++ 2 files changed, 45 insertions(+) create mode 100644 afb-client/nbproject/project.properties create mode 100644 afb-client/nbproject/project.xml diff --git a/afb-client/nbproject/project.properties b/afb-client/nbproject/project.properties new file mode 100644 index 0000000..770258f --- /dev/null +++ b/afb-client/nbproject/project.properties @@ -0,0 +1,35 @@ +auxiliary.org-netbeans-modules-css-prep.less_2e_compiler_2e_options= +auxiliary.org-netbeans-modules-css-prep.less_2e_enabled=false +auxiliary.org-netbeans-modules-css-prep.less_2e_mappings=/less:/css +auxiliary.org-netbeans-modules-css-prep.sass_2e_compiler_2e_options= +auxiliary.org-netbeans-modules-css-prep.sass_2e_configured=true +auxiliary.org-netbeans-modules-css-prep.sass_2e_enabled=false +auxiliary.org-netbeans-modules-css-prep.sass_2e_mappings=/scss:/css +auxiliary.org-netbeans-modules-javascript-gulp.action_2e_build=build-app-dev +auxiliary.org-netbeans-modules-javascript-gulp.action_2e_clean=clean-dev +auxiliary.org-netbeans-modules-javascript-gulp.action_2e_debug=watch-dev +auxiliary.org-netbeans-modules-javascript-gulp.action_2e_rebuild=clean-build-app-dev +auxiliary.org-netbeans-modules-javascript-gulp.action_2e_run=watch-prod +auxiliary.org-netbeans-modules-javascript-nodejs.enabled=true +auxiliary.org-netbeans-modules-javascript-nodejs.node_2e_default=true +auxiliary.org-netbeans-modules-javascript-nodejs.run_2e_enabled=true +auxiliary.org-netbeans-modules-javascript-nodejs.run_2e_restart=false +auxiliary.org-netbeans-modules-javascript-nodejs.start_2e_args=watch-dev +auxiliary.org-netbeans-modules-javascript-nodejs.start_2e_file=node_modules/.bin/gulp +auxiliary.org-netbeans-modules-javascript-nodejs.sync_2e_enabled=true +auxiliary.org-netbeans-modules-javascript2-requirejs.enabled=true +auxiliary.org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder=js/libs +browser.autorefresh.Chrome.INTEGRATED=true +browser.highlightselection.Chrome.INTEGRATED=true +browser.run=false +file.reference.app-Frontend=app/Frontend +file.reference.healthy-gulp-angular-foundation6-app=app +file.reference.l4a-hypervisor-app=app +file.reference.l4a-hypervisor-Frontend=Frontend +files.encoding=UTF-8 +project.license=gpl30 +run.as=node.js +site.root.folder=${file.reference.app-Frontend} +source.folder=${file.reference.l4a-hypervisor-app} +start.file=index.html +web.context.root=/l4a-hypervisor diff --git a/afb-client/nbproject/project.xml b/afb-client/nbproject/project.xml new file mode 100644 index 0000000..4979f19 --- /dev/null +++ b/afb-client/nbproject/project.xml @@ -0,0 +1,10 @@ + + + org.netbeans.modules.web.clientproject + + + afb-client + + + + -- cgit 1.2.3-korg From 475508baa9f0b21087eb85048d51af342aa09692 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Dec 2015 17:15:43 +0100 Subject: Add the app!!! --- afb-client/README.md | 4 +- afb-client/app/Backend/RestApis/PostMockApi.js | 37 ++ afb-client/app/Backend/RestApis/TokenMockApi.js | 114 ++++ afb-client/app/Backend/RestApis/_all.js | 29 + afb-client/app/Backend/server.js | 58 ++ afb-client/app/Frontend/app.js | 44 ++ afb-client/app/Frontend/favicon.ico | Bin 0 -> 1150 bytes .../app/Frontend/images/avatars/istoobig.jpg | Bin 0 -> 7204 bytes .../app/Frontend/images/avatars/tux-admin.png | Bin 0 -> 58558 bytes afb-client/app/Frontend/images/avatars/tux-bzh.png | Bin 0 -> 65172 bytes .../app/Frontend/images/avatars/tux-visitor.png | Bin 0 -> 84573 bytes afb-client/app/Frontend/images/login/fb-logo.png | Bin 0 -> 2482 bytes afb-client/app/Frontend/images/login/gg-logo.png | Bin 0 -> 3554 bytes afb-client/app/Frontend/images/login/gh-logo.png | Bin 0 -> 4946 bytes afb-client/app/Frontend/images/login/iot-logo.png | Bin 0 -> 3471 bytes afb-client/app/Frontend/images/login/lk-logo.png | Bin 0 -> 4579 bytes afb-client/app/Frontend/images/login/ms-logo.png | Bin 0 -> 6036 bytes afb-client/app/Frontend/images/login/og-logo.png | Bin 0 -> 2706 bytes afb-client/app/Frontend/images/login/pp-logo.png | Bin 0 -> 3222 bytes afb-client/app/Frontend/images/login/yh-logo.png | Bin 0 -> 5491 bytes .../app/Frontend/images/logo/logo_iot_bzh.svg | 139 +++++ .../app/Frontend/images/logo/logo_iot_bzhx350.png | Bin 0 -> 14449 bytes .../Frontend/images/logo/tampon-iot-bzhx450.png | Bin 0 -> 44996 bytes .../app/Frontend/images/logo/triskel_iot_bzh.png | Bin 0 -> 55940 bytes .../app/Frontend/images/logo/triskel_iot_bzh.svg | 110 ++++ .../Frontend/images/logo/triskel_iot_bzhx250.png | Bin 0 -> 18787 bytes afb-client/app/Frontend/index.html | 41 ++ afb-client/app/Frontend/pages/Home/Home.html | 33 ++ afb-client/app/Frontend/pages/Home/HomeModule.js | 90 +++ afb-client/app/Frontend/pages/Home/HomeModule.scss | 65 +++ afb-client/app/Frontend/pages/Sample/Sample.html | 22 + .../app/Frontend/pages/Sample/SampleModule.js | 48 ++ .../app/Frontend/pages/Sample/SampleModule.scss | 41 ++ afb-client/app/Frontend/services/ConfigApp.js | 25 + afb-client/app/Frontend/services/JQueryEmu.js | 42 ++ afb-client/app/Frontend/styles/README.md | 28 + .../app/Frontend/styles/app/_ibz-mixins.scss | 52 ++ afb-client/app/Frontend/styles/app/ibz-global.scss | 43 ++ .../styles/foundation/_foundation-icons.scss | 591 ++++++++++++++++++++ .../styles/foundation/_foundation-settings.scss | 605 +++++++++++++++++++++ .../styles/foundation/foundation-conf.scss | 19 + afb-client/app/Frontend/tmp/routes.js | 1 + .../widgets/Buttons/SubmitButtons/SubmitButtons.js | 52 ++ .../Buttons/SubmitButtons/SubmitButtons.scss | 22 + .../app/Frontend/widgets/FormInput/FormInput.scss | 69 +++ .../Frontend/widgets/FormInput/InputPassword.js | 79 +++ .../app/Frontend/widgets/FormInput/InputText.js | 179 ++++++ .../app/Frontend/widgets/FormInput/UploadFile.js | 113 ++++ .../app/Frontend/widgets/Navigation/LinkButton.js | 57 ++ .../Frontend/widgets/Navigation/Navigation.scss | 26 + .../widgets/Notifications/ModalNotification.js | 85 +++ .../widgets/Notifications/Notifications.scss | 47 ++ afb-client/app/etc/AppDefaults.js | 41 ++ afb-client/app/etc/_Config.js | 44 ++ afb-client/app/etc/_Trace.js | 55 ++ 55 files changed, 3148 insertions(+), 2 deletions(-) create mode 100644 afb-client/app/Backend/RestApis/PostMockApi.js create mode 100644 afb-client/app/Backend/RestApis/TokenMockApi.js create mode 100644 afb-client/app/Backend/RestApis/_all.js create mode 100644 afb-client/app/Backend/server.js create mode 100644 afb-client/app/Frontend/app.js create mode 100644 afb-client/app/Frontend/favicon.ico create mode 100644 afb-client/app/Frontend/images/avatars/istoobig.jpg create mode 100644 afb-client/app/Frontend/images/avatars/tux-admin.png create mode 100644 afb-client/app/Frontend/images/avatars/tux-bzh.png create mode 100644 afb-client/app/Frontend/images/avatars/tux-visitor.png create mode 100644 afb-client/app/Frontend/images/login/fb-logo.png create mode 100644 afb-client/app/Frontend/images/login/gg-logo.png create mode 100644 afb-client/app/Frontend/images/login/gh-logo.png create mode 100644 afb-client/app/Frontend/images/login/iot-logo.png create mode 100644 afb-client/app/Frontend/images/login/lk-logo.png create mode 100644 afb-client/app/Frontend/images/login/ms-logo.png create mode 100644 afb-client/app/Frontend/images/login/og-logo.png create mode 100644 afb-client/app/Frontend/images/login/pp-logo.png create mode 100644 afb-client/app/Frontend/images/login/yh-logo.png create mode 100644 afb-client/app/Frontend/images/logo/logo_iot_bzh.svg create mode 100644 afb-client/app/Frontend/images/logo/logo_iot_bzhx350.png create mode 100644 afb-client/app/Frontend/images/logo/tampon-iot-bzhx450.png create mode 100644 afb-client/app/Frontend/images/logo/triskel_iot_bzh.png create mode 100644 afb-client/app/Frontend/images/logo/triskel_iot_bzh.svg create mode 100644 afb-client/app/Frontend/images/logo/triskel_iot_bzhx250.png create mode 100644 afb-client/app/Frontend/index.html create mode 100644 afb-client/app/Frontend/pages/Home/Home.html create mode 100644 afb-client/app/Frontend/pages/Home/HomeModule.js create mode 100644 afb-client/app/Frontend/pages/Home/HomeModule.scss create mode 100644 afb-client/app/Frontend/pages/Sample/Sample.html create mode 100644 afb-client/app/Frontend/pages/Sample/SampleModule.js create mode 100644 afb-client/app/Frontend/pages/Sample/SampleModule.scss create mode 100644 afb-client/app/Frontend/services/ConfigApp.js create mode 100644 afb-client/app/Frontend/services/JQueryEmu.js create mode 100644 afb-client/app/Frontend/styles/README.md create mode 100644 afb-client/app/Frontend/styles/app/_ibz-mixins.scss create mode 100644 afb-client/app/Frontend/styles/app/ibz-global.scss create mode 100644 afb-client/app/Frontend/styles/foundation/_foundation-icons.scss create mode 100644 afb-client/app/Frontend/styles/foundation/_foundation-settings.scss create mode 100644 afb-client/app/Frontend/styles/foundation/foundation-conf.scss create mode 100644 afb-client/app/Frontend/tmp/routes.js create mode 100644 afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.js create mode 100644 afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.scss create mode 100644 afb-client/app/Frontend/widgets/FormInput/FormInput.scss create mode 100644 afb-client/app/Frontend/widgets/FormInput/InputPassword.js create mode 100644 afb-client/app/Frontend/widgets/FormInput/InputText.js create mode 100644 afb-client/app/Frontend/widgets/FormInput/UploadFile.js create mode 100644 afb-client/app/Frontend/widgets/Navigation/LinkButton.js create mode 100644 afb-client/app/Frontend/widgets/Navigation/Navigation.scss create mode 100644 afb-client/app/Frontend/widgets/Notifications/ModalNotification.js create mode 100644 afb-client/app/Frontend/widgets/Notifications/Notifications.scss create mode 100644 afb-client/app/etc/AppDefaults.js create mode 100644 afb-client/app/etc/_Config.js create mode 100644 afb-client/app/etc/_Trace.js diff --git a/afb-client/README.md b/afb-client/README.md index 8216a25..6b628da 100644 --- a/afb-client/README.md +++ b/afb-client/README.md @@ -4,7 +4,7 @@ Install HTML5 development toolchain on your host 1. Check out this repository - git clone https://github.com/iotbzh/afb-client-sample.git + git clone https://github.com/iotbzh/afb-client.git 2) Install NodeJs [not used on target] zypper install nodejs @@ -18,7 +18,7 @@ Install HTML5 development toolchain on your host install [livereload Chrome extension](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei) -### Overload ./etc/Defaults.js with '.noderc.js' +### Overload ./app/etc/AppDefaults.js with '.noderc.js' var config= { APPNAME : 'AFBclient', // AppName is use as main Angular Module name FRONTEND: "Frontend", // HTML5 frontend [no leading ./] diff --git a/afb-client/app/Backend/RestApis/PostMockApi.js b/afb-client/app/Backend/RestApis/PostMockApi.js new file mode 100644 index 0000000..6299f39 --- /dev/null +++ b/afb-client/app/Backend/RestApis/PostMockApi.js @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +var fs = require('fs'); +var multer = require('multer'); + +function NewApi(handle, prefix) { + var self=this; + handle.trace (this,1, "Mock PostApi url=%s", prefix +'/ping'); + var upload = multer({ dest: '/tmp/uploads/' }); + + handle.app.post(prefix +'/upload', upload.single('avatar'), function (req, res) { + handle.trace (self, 1, "%s/upload file=", prefix, req.file.originalname); + var upload = multer({ dest: '/tmp/uploads/' }); + + res.send({"jtype": "TEST_message", "status": "success", "info": "done"}); + }); + +} + +// Export Class +module.exports = NewApi; \ No newline at end of file diff --git a/afb-client/app/Backend/RestApis/TokenMockApi.js b/afb-client/app/Backend/RestApis/TokenMockApi.js new file mode 100644 index 0000000..74b565a --- /dev/null +++ b/afb-client/app/Backend/RestApis/TokenMockApi.js @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* ---------------------------------------------------------------------- + * This module simulate Application Framework Binder + * + * /api/afbs/create + * /api/afbs/check?token=123456789 + * /api/afbs/refresh?token=123456789-xxxxx + * /api/afbs/reset?123456789-xxxxx + * + * Note: this MOCK api does not handle any session login. It only returns + * a fake valid or false message depending on call order. + * Its goal is to get a quick way to check you HTML5 client rendering & behaviour. + * + * When you're happy with you HTML5 client OnePageApp check it with afb-daemon + * ----------------------------------------------------------------------*/ + + +function NewApi(handle, prefix) { + var scope=this; // I hate JavaScript + scope.connected=false; + + // Simulate Client Context Session Creation + handle.app.post(prefix +'/create', function (req, res) { + handle.trace (scope, 1, "%s/create body=%s", prefix, req.body.action); + var okResponse= '{ "jtype": "AJB_reply"' + + ', "request": { "prefix": "afbs", "api": "create", "uuid": "e4ef5e66-xxxx", "token": "123456789-xxxxx", "status": "processed" }'+ + ', "response": { "token": "Token was refreshed" }'+ + '}'; + + var fxResponse= '{ "jtype": "AJB_reply" ' + + ', "request": { "prefix": "afbs", "api": "create", "status": "fail", "info": "AFB_SESSION_REFRESH Not Initial Token Chain" }'+ + '}'; + + if (scope.connected) res.status(401).send(fxResponse); + else { + res.send(okResponse); + scope.connected=true; + } + }); + + + // Simulate Client Context Check + handle.app.post(prefix +'/check', function (req, res) { + handle.trace (scope, 1, "%s/check query=%s", prefix, req.query.token); + var okResponse= '{"jtype":"AJB_reply"'+ + ',"request":{"prefix":"afbs","api":"check", "status":"processed"}'+ + ',"response":{"isvalid":true}'+ + '}'; + + var fxResponse= '{"jtype":"AJB_reply",'+ + '"request":{"prefix":"afbs","api":"check","status":"empty","info":"AFB_SESSION_CHECK Not a Valid Active Token"}'+ + '}'; + + if (!scope.connected) res.status(401).send(fxResponse); + else res.send(okResponse); + }); + + // Simulate Client Context Check + handle.app.post(prefix +'/refresh', function (req, res) { + handle.trace (scope, 1, "%s/refresh query=%s", prefix, req.query.token); + var okResponse= '{"jtype":"AJB_reply"'+ + ',"request":{"prefix":"afbs","api":"refresh","uuid": "e4ef5e66-xxxx", "token": "123456789-xxxxx","status":"processed"}'+ + ',"response":{"isvalid":true}'+ + '}'; + + var fxResponse= '{"jtype":"AJB_reply",'+ + '"request":{"prefix":"afbs","api":"refresh","status":"empty","info":"AFB_SESSION_REFRESH Not a Valid Active Token"}'+ + '}'; + + if (!scope.connected) res.status(401).send(fxResponse); + else res.send(okResponse); + }); + + // Simulate Client Context Session Closing + handle.app.post(prefix +'/reset', function (req, res) { + handle.trace (scope, 1, "%s/reset query=%s", prefix, req.query.token); + var okResponse= '{"jtype":"AJB_reply"'+ + ',"request":{"prefix":"afbs","api":"reset","uuid": "e4ef5e66-xxxx","status":"processed"}'+ + ',"response":{"uuid":"b028b883-8b47-4c6d-9c6e-e79b9e2b81b9"}'+ + '}'; + + var fxResponse= '{"jtype":"AJB_reply",'+ + '"request":{"prefix":"afbs","api":"reset","status":"empty","info":"AFB_SESSION_CLOSE Not a Valid Access Token"}'+ + '}'; + + if (!scope.connected) res.status(401).send(fxResponse); + else { + res.send(okResponse); + scope.connected=false; + } + }); + + +} + +// Export Class +module.exports = NewApi; \ No newline at end of file diff --git a/afb-client/app/Backend/RestApis/_all.js b/afb-client/app/Backend/RestApis/_all.js new file mode 100644 index 0000000..aacf19e --- /dev/null +++ b/afb-client/app/Backend/RestApis/_all.js @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +PostMockApi = require ('./PostMockApi'); +TokenMockApi = require ('./TokenMockApi'); + +// Include here every application APIs routes modules. +function Initialise (handle) { + + this.sample= new TokenMockApi (handle, config.APIBASE + 'token'); + this.sample= new PostMockApi (handle, config.APIBASE + 'post'); +} + +module.exports = Initialise; + diff --git a/afb-client/app/Backend/server.js b/afb-client/app/Backend/server.js new file mode 100644 index 0000000..11c5486 --- /dev/null +++ b/afb-client/app/Backend/server.js @@ -0,0 +1,58 @@ +var config = require('../etc/_Config'); +var trace = require('../etc/_Trace'); +var RestAPI = require('./RestApis/_all'); +var fs = require('fs'); + +var express = require('express'); +var session = require('express-session'); +var bodyParser = require('body-parser'); +var methodOverride = require('method-override'); + +// instanciate express HTTP server +var app = express(); + +// chose dev or prod rootdir +var staticdir = 'dist.dev'; +if (process.env.MODE) staticdir = process.env.MODE === 'prod' ? 'dist.prod' : 'dist.dev'; +else staticdir = config.MODE === 'prod' ? 'dist.prod' : 'dist.dev'; + +var rootdir = __dirname + '/../../' + staticdir; +if (!fs.existsSync(rootdir)) { + console.log("### HOOPS Rootdir not found rootdir=%s\n", rootdir); + process.exit(); +} + +// get all data/stuff of the body (POST) parameters +app.use(bodyParser.json()); // parse application/json +app.use(methodOverride('X-HTTP-Method-Override')); // override with the X-HTTP-Method-Override header in the request. simulate DELETE/PUT + +// This handle should contain enough for application logic +var serverHandle = { + app : app, // Express server + config: config, + trace: config.DBG_LVL > 0 ? trace : function(){/*empty function */} +}; + +// set the static files location /public/img will be /img for users +app.use(express.static(rootdir)); + +// Load Mock APIs +var apirest = new RestAPI(serverHandle); + +app.get(config.URLBASE, function (req, res) { + console.log ("Angular OPA %s", req.originalUrl); + res.sendfile(config.URLBASE +"index.html", {root: rootdir}); +}); + +// rewrite requested URL to include Angular hashPrompt and set session flag for RestAPI +app.get(config.URLBASE + '*', function(req, res) { + // Warning redirect should be under exact "/opa/#!page" or a redirect to home will be done + var redirect=config.URLBASE + '#!' + req.originalUrl.substring(config.URLBASE.length); + res.redirect(redirect); + console.log ("Redirect to: ", redirect); +}); + + +// start app =============================================== +app.listen(config.EXPRESS_PORT, config.EXPRESS_HOST); +console.log('Server Listening http://%s:%d (rootdir=%s)', config.EXPRESS_HOST, config.EXPRESS_PORT, rootdir); \ No newline at end of file diff --git a/afb-client/app/Frontend/app.js b/afb-client/app/Frontend/app.js new file mode 100644 index 0000000..dc1d489 --- /dev/null +++ b/afb-client/app/Frontend/app.js @@ -0,0 +1,44 @@ +(function() { + 'use strict'; + + angular.module('@@APPNAME@@', [ // Warning: Appname should fit with gulpfile.js & index.html + 'ui.router', + 'ngAnimate', + + //foundation + 'foundation', + 'foundation.dynamicRouting', + 'foundation.dynamicRouting.animations', + + // external components + 'ui-notification', + + // Application Components + 'ConfigApp', + 'JQueryEmu', + 'HomeModule', + 'SampleModule', + 'UploadFile', + 'LinkButton', + 'ModalNotification' + ]) + .config(config) + .run(run) + ; + + config.$inject = ['$urlRouterProvider', '$locationProvider']; + + function config($urlProvider, $locationProvider) { + $urlProvider.otherwise('/home'); + + // https://docs.angularjs.org/error/$location/nobase + $locationProvider.html5Mode(true).hashPrefix('!'); + + } + + function run() { + FastClick.attach(document.body); + } + +console.log ("@@APPNAME@@ Loaded"); +})(); diff --git a/afb-client/app/Frontend/favicon.ico b/afb-client/app/Frontend/favicon.ico new file mode 100644 index 0000000..eeb7ab7 Binary files /dev/null and b/afb-client/app/Frontend/favicon.ico differ diff --git a/afb-client/app/Frontend/images/avatars/istoobig.jpg b/afb-client/app/Frontend/images/avatars/istoobig.jpg new file mode 100644 index 0000000..da0f255 Binary files /dev/null and b/afb-client/app/Frontend/images/avatars/istoobig.jpg differ diff --git a/afb-client/app/Frontend/images/avatars/tux-admin.png b/afb-client/app/Frontend/images/avatars/tux-admin.png new file mode 100644 index 0000000..ee40d2a Binary files /dev/null and b/afb-client/app/Frontend/images/avatars/tux-admin.png differ diff --git a/afb-client/app/Frontend/images/avatars/tux-bzh.png b/afb-client/app/Frontend/images/avatars/tux-bzh.png new file mode 100644 index 0000000..16e001b Binary files /dev/null and b/afb-client/app/Frontend/images/avatars/tux-bzh.png differ diff --git a/afb-client/app/Frontend/images/avatars/tux-visitor.png b/afb-client/app/Frontend/images/avatars/tux-visitor.png new file mode 100644 index 0000000..bd491b0 Binary files /dev/null and b/afb-client/app/Frontend/images/avatars/tux-visitor.png differ diff --git a/afb-client/app/Frontend/images/login/fb-logo.png b/afb-client/app/Frontend/images/login/fb-logo.png new file mode 100644 index 0000000..fcf7847 Binary files /dev/null and b/afb-client/app/Frontend/images/login/fb-logo.png differ diff --git a/afb-client/app/Frontend/images/login/gg-logo.png b/afb-client/app/Frontend/images/login/gg-logo.png new file mode 100644 index 0000000..0c372eb Binary files /dev/null and b/afb-client/app/Frontend/images/login/gg-logo.png differ diff --git a/afb-client/app/Frontend/images/login/gh-logo.png b/afb-client/app/Frontend/images/login/gh-logo.png new file mode 100644 index 0000000..ff856fc Binary files /dev/null and b/afb-client/app/Frontend/images/login/gh-logo.png differ diff --git a/afb-client/app/Frontend/images/login/iot-logo.png b/afb-client/app/Frontend/images/login/iot-logo.png new file mode 100644 index 0000000..ca594d7 Binary files /dev/null and b/afb-client/app/Frontend/images/login/iot-logo.png differ diff --git a/afb-client/app/Frontend/images/login/lk-logo.png b/afb-client/app/Frontend/images/login/lk-logo.png new file mode 100644 index 0000000..d9bc51f Binary files /dev/null and b/afb-client/app/Frontend/images/login/lk-logo.png differ diff --git a/afb-client/app/Frontend/images/login/ms-logo.png b/afb-client/app/Frontend/images/login/ms-logo.png new file mode 100644 index 0000000..d4f23eb Binary files /dev/null and b/afb-client/app/Frontend/images/login/ms-logo.png differ diff --git a/afb-client/app/Frontend/images/login/og-logo.png b/afb-client/app/Frontend/images/login/og-logo.png new file mode 100644 index 0000000..a6f6e9a Binary files /dev/null and b/afb-client/app/Frontend/images/login/og-logo.png differ diff --git a/afb-client/app/Frontend/images/login/pp-logo.png b/afb-client/app/Frontend/images/login/pp-logo.png new file mode 100644 index 0000000..dbb8866 Binary files /dev/null and b/afb-client/app/Frontend/images/login/pp-logo.png differ diff --git a/afb-client/app/Frontend/images/login/yh-logo.png b/afb-client/app/Frontend/images/login/yh-logo.png new file mode 100644 index 0000000..6ab90cf Binary files /dev/null and b/afb-client/app/Frontend/images/login/yh-logo.png differ diff --git a/afb-client/app/Frontend/images/logo/logo_iot_bzh.svg b/afb-client/app/Frontend/images/logo/logo_iot_bzh.svg new file mode 100644 index 0000000..6e60c95 --- /dev/null +++ b/afb-client/app/Frontend/images/logo/logo_iot_bzh.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + IOT + + BZH + + + + diff --git a/afb-client/app/Frontend/images/logo/logo_iot_bzhx350.png b/afb-client/app/Frontend/images/logo/logo_iot_bzhx350.png new file mode 100644 index 0000000..2c3b2ae Binary files /dev/null and b/afb-client/app/Frontend/images/logo/logo_iot_bzhx350.png differ diff --git a/afb-client/app/Frontend/images/logo/tampon-iot-bzhx450.png b/afb-client/app/Frontend/images/logo/tampon-iot-bzhx450.png new file mode 100644 index 0000000..f365e19 Binary files /dev/null and b/afb-client/app/Frontend/images/logo/tampon-iot-bzhx450.png differ diff --git a/afb-client/app/Frontend/images/logo/triskel_iot_bzh.png b/afb-client/app/Frontend/images/logo/triskel_iot_bzh.png new file mode 100644 index 0000000..832dc1f Binary files /dev/null and b/afb-client/app/Frontend/images/logo/triskel_iot_bzh.png differ diff --git a/afb-client/app/Frontend/images/logo/triskel_iot_bzh.svg b/afb-client/app/Frontend/images/logo/triskel_iot_bzh.svg new file mode 100644 index 0000000..096f424 --- /dev/null +++ b/afb-client/app/Frontend/images/logo/triskel_iot_bzh.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/afb-client/app/Frontend/images/logo/triskel_iot_bzhx250.png b/afb-client/app/Frontend/images/logo/triskel_iot_bzhx250.png new file mode 100644 index 0000000..f4e41ae Binary files /dev/null and b/afb-client/app/Frontend/images/logo/triskel_iot_bzhx250.png differ diff --git a/afb-client/app/Frontend/index.html b/afb-client/app/Frontend/index.html new file mode 100644 index 0000000..0d55267 --- /dev/null +++ b/afb-client/app/Frontend/index.html @@ -0,0 +1,41 @@ + + + + + + + + + Simple Sample Application + + + + + + + + + + + + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/afb-client/app/Frontend/pages/Home/Home.html b/afb-client/app/Frontend/pages/Home/Home.html new file mode 100644 index 0000000..9803b63 --- /dev/null +++ b/afb-client/app/Frontend/pages/Home/Home.html @@ -0,0 +1,33 @@ + + +--- +name: myhome +url: /home +controller: HomeController as ctrl +animationIn: slideInRight +--- + +

+ + App Framework Binder Simple Client +

+ + + +
+ + + + + + +
+
+
+ req= {{ctrl.request}} + res= {{ctrl.response}} + status= {{ctrl.errcode}} +
+
+ + diff --git a/afb-client/app/Frontend/pages/Home/HomeModule.js b/afb-client/app/Frontend/pages/Home/HomeModule.js new file mode 100644 index 0000000..11b3882 --- /dev/null +++ b/afb-client/app/Frontend/pages/Home/HomeModule.js @@ -0,0 +1,90 @@ +(function() { +'use strict'; + + var INITIAL_TOKEN=123456789; // should match with --token=xxxx binder command line + +// list all rependencies within the page + controler if needed +angular.module('HomeModule', ['SubmitButton']) + + .controller('HomeController', function ($http, ConfigApp) { + var scope = this; // I hate JavaScript + scope.uuid ="none"; + scope.token ="none"; + scope.session="none"; + scope.status ="err-no"; + + console.log ("Home Controller"); + + scope.ProcessResponse= function(data, errcode, headers, config) { + var apiname= 'API'+ data.request.api.replace('-','_'); + scope.status = "err-ok"; + scope.errcode= errcode; + scope.request = data.request; + scope.response = data.response; + + // Make sure we clean everything when Open/Close is called + if (apiname === "APIcreate" || apiname === "APIreset") { + scope["APIreset"]=''; + scope["APIcreate"]=''; + scope["APIrefresh"]=''; + scope["APIcheck"]=''; + } + scope[apiname]="success"; + + // If we have a new token let's update it + if (data.request.token) scope.token=data.request.token; + + console.log ("OK: "+ JSON.stringify(data)); + }; + + scope.ProcessError= function(data, errcode, headers, config) { + var apiname= 'API'+data.request.api.replace('-','_'); + scope.status = "err-fx"; + scope.errcode = errcode; + scope.request = data.request; + scope.response = ""; + scope[apiname]="fail"; + + console.log ("FX: "+ JSON.stringify(data)); + }; + + scope.OpenSession = function() { + console.log ("OpenSession"); + var postdata= {/* any json your application may need */}; + var handler = $http.post(ConfigApp.api.token + 'create?token='+INITIAL_TOKEN, postdata); + + handler.success(scope.ProcessResponse); + handler.error(scope.ProcessError); + }; + + scope.CheckSession = function() { + console.log ("CloseSession"); + var postdata= {/* any json your application may need */}; + var handler = $http.post(ConfigApp.api.token + 'check?token='+scope.token, postdata); + + handler.success(scope.ProcessResponse); + handler.error(scope.ProcessError); + }; + + scope.RefreshSession = function() { + console.log ("RefreshSession"); + var postdata= {/* any json your application may need */}; + var handler = $http.post(ConfigApp.api.token + 'refresh?token='+scope.token, postdata); + + handler.success(scope.ProcessResponse); + handler.error(scope.ProcessError); + }; + + scope.ResetSession = function() { + console.log ("ResetSession"); + var postdata= {/* any json your application may need */}; + var handler = $http.post(ConfigApp.api.token + 'reset?token='+scope.token, postdata); + + handler.success(scope.ProcessResponse); + handler.error(scope.ProcessError); + }; + + }); + +console.log ("SampleControler Loaded"); +})(); \ No newline at end of file diff --git a/afb-client/app/Frontend/pages/Home/HomeModule.scss b/afb-client/app/Frontend/pages/Home/HomeModule.scss new file mode 100644 index 0000000..34e1181 --- /dev/null +++ b/afb-client/app/Frontend/pages/Home/HomeModule.scss @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@import "app/ibz-mixins"; + +$COLOR_SUCCESS: green; +$COLOR_FAIL: red; + +.button-box { + height : 4.5rem; + + .session-button { + float: left; + width: 5rem; + }; + + .response > span{ + display: block; + margin: .3rem .5rem .3rem .5rem; + } + + .fail { + color:$COLOR_FAIL; + border: 1px solid darken($COLOR_FAIL,10%); + } + .success { + color:$COLOR_SUCCESS; + border: 1px solid darken($COLOR_SUCCESS,10%); + } + +}; + +.message-box { + height : auto; + width: 100%; + font-size: .75rem; + + .response { + .err-no { color:grey; } + .res.err-ok { color: blue; } + .req.err-ok { color:blueviolet; } + .status.err-ok { color:green; } + .status.err-fx { color:red; } + } + + +}; + + + diff --git a/afb-client/app/Frontend/pages/Sample/Sample.html b/afb-client/app/Frontend/pages/Sample/Sample.html new file mode 100644 index 0000000..00a6f3b --- /dev/null +++ b/afb-client/app/Frontend/pages/Sample/Sample.html @@ -0,0 +1,22 @@ + + +--- +name: mysample +url: /sample +controller: SampleController as ctrl +animationIn: slideInRight +--- + +

Sample Page

+ +
+ + + + + + + +
+ + diff --git a/afb-client/app/Frontend/pages/Sample/SampleModule.js b/afb-client/app/Frontend/pages/Sample/SampleModule.js new file mode 100644 index 0000000..2a2e777 --- /dev/null +++ b/afb-client/app/Frontend/pages/Sample/SampleModule.js @@ -0,0 +1,48 @@ +(function() { +'use strict'; + +// list all rependencies within the page + controler if needed +angular.module('SampleModule', ['SubmitButton','UploadFile']) + + .controller('SampleController', function ($http) { + var self = this; // I hate JavaScript + this.status='muted-off'; + + console.log ("sample controller"); + + this.MuteOn = function() { + console.log ("Muted"); + // send AJAX request to server + var handler = $http.post('/api/dbus/ping', {type:'mute', action: "on"}); + + handler.success(function(response, errcode, headers, config) { + self.status = 'muted-on'; + }); + + handler.error(function(status, errcode, headers) { + console.log ("Oops /api/dbus/pring err=" + errcode); + self.status = 'muted-error'; + }); + }; + + this.MuteOff = function() { + console.log ("UnMuted"); + // send AJAX request to server + var handler = $http.post('/api/dbus/ping', {type:'mute', action: "off"}); + + handler.success(function(response, errcode, headers, config) { + self.status = 'muted-off'; + }); + + handler.error(function(status, errcode, headers) { + console.log ("Oops /api/dbus/ping err=" + errcode); + self.status = 'muted-error'; + }); + + }; + + + }); + +console.log ("SampleControler Loaded"); +})(); \ No newline at end of file diff --git a/afb-client/app/Frontend/pages/Sample/SampleModule.scss b/afb-client/app/Frontend/pages/Sample/SampleModule.scss new file mode 100644 index 0000000..2e54c53 --- /dev/null +++ b/afb-client/app/Frontend/pages/Sample/SampleModule.scss @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@import "app/ibz-mixins"; + + +.sample-box { + display: block; + height : 4.5rem; + + .sample-button { + float: left; + width: 5rem; + }; + + .muted-on-on,.muted-off-off{ + background: blueviolet; + }; + + .muted-error{ + background: red; + }; +}; + + + diff --git a/afb-client/app/Frontend/services/ConfigApp.js b/afb-client/app/Frontend/services/ConfigApp.js new file mode 100644 index 0000000..f36d79b --- /dev/null +++ b/afb-client/app/Frontend/services/ConfigApp.js @@ -0,0 +1,25 @@ +(function () { + 'use strict'; + + // _all modules only reference dependencies + angular.module('ConfigApp', []) + + // Factory is a singleton and share its context within all instances. + .factory('ConfigApp', function () { + + + var myConfig = { + paths: { // Warning paths should end with / + images : 'images/', + avatars: 'images/avatars/' + }, + + api: { // Warning paths should end with / + token : '/api/token/' + } + }; + + return myConfig; + }); + +})(); \ No newline at end of file diff --git a/afb-client/app/Frontend/services/JQueryEmu.js b/afb-client/app/Frontend/services/JQueryEmu.js new file mode 100644 index 0000000..5112052 --- /dev/null +++ b/afb-client/app/Frontend/services/JQueryEmu.js @@ -0,0 +1,42 @@ +(function () { + 'use strict'; + + // _all modules only reference dependencies + angular.module('JQueryEmu', []) + + // Factory is a singleton and share its context within all instances. + .factory('JQemu', function () { + + // JQueryLight cannot search a tag within ancestrors + var parent = function (element, selector) { + var parent = element; + var search = selector.toUpperCase(); + while (parent[0]) { + if (search === parent[0].tagName) { + return parent; + } // HTMLDivElement properties + parent = parent.parent(); + } + }; + + // JQueryLight cannot search by type + var findByType= function (element, selector) { + var search = selector.toLowerCase(); + var children = element.children(); + while (children[0]) { + if (search === children[0].type) { + return children; + } // HTMLDivElement properties + children = children.next(); + } + }; + + var myMethods = { + parent: parent, + findByType: findByType + }; + + return myMethods; + }); + +})(); \ No newline at end of file diff --git a/afb-client/app/Frontend/styles/README.md b/afb-client/app/Frontend/styles/README.md new file mode 100644 index 0000000..dc50ced --- /dev/null +++ b/afb-client/app/Frontend/styles/README.md @@ -0,0 +1,28 @@ +WARNING note about global style dir +------------------------------------- + + - styles placed in Frontend/styles is global and will be posted in dist.prod/styles + - styles defined within widget or page directory will be place in dist.prof/opa/styles + +This model allows to share global styles by multiple applications. + +To change this behaviour just rename styles directory on something else [eg: appstyles] + + + |---- /Frontend + | | + | |---- /styles + | | | + | | |---- _settings.scss + | | |---- app.scss + | | + | |---- /Widgets + | | | + | | |--- widget.js + | | |--- widget.sccs + | | + | |-----/Pages + | |--- page-partial.html + | |--- page-cntrl.js + | |--- page-style.scss + | diff --git a/afb-client/app/Frontend/styles/app/_ibz-mixins.scss b/afb-client/app/Frontend/styles/app/_ibz-mixins.scss new file mode 100644 index 0000000..ed9dba8 --- /dev/null +++ b/afb-client/app/Frontend/styles/app/_ibz-mixins.scss @@ -0,0 +1,52 @@ +/* + Every SCSS files will be injected into main HTML page +*/ +%shadow-transition { + transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s; + border-radius: 5px; +} + +@mixin ibz-box-content { + border: 2px solid gainsboro !important; + border-radius: 5px; + + margin-left: auto; + margin-right: auto; + min-width: 98% !important; + margin: .5rem .5rem .5rem .5rem; + background: rgba(200,205,200,.3); +} + +@mixin ibz-button ($color, $size:2rem) { + display: inline-block; + border: 1px solid darken($color,10%); + box-shadow: 2px 2px 1px adjust-hue($color,20deg); + color: $color; + border-radius: 5px; + font-style: italic; + padding: 0rem .5rem 0rem .5rem; + margin:.5rem; + background: lighten(#9494b7, 20%); + i { + padding-right: 0.3rem; + font-size: $size; + } + span {font-size: 1rem} + + &:hover { + background: lighten($color, 45%); + border: 2px solid darken($color,20%); + + } +} + +@mixin ibz-input-alert ($color, $background) { + position :fixed; + margin: -2.2rem 0 0 15rem; + border-radius: 5px; + font-style: italic; + border-color: darken($background,10%); + color: $color; + background-color: $background !important; + padding: 0.2rem !important; +} diff --git a/afb-client/app/Frontend/styles/app/ibz-global.scss b/afb-client/app/Frontend/styles/app/ibz-global.scss new file mode 100644 index 0000000..1f5017e --- /dev/null +++ b/afb-client/app/Frontend/styles/app/ibz-global.scss @@ -0,0 +1,43 @@ +/* +Copyright (C) 2015 "IoT.bzh" +Author "Fulup Ar Foll" + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +@import "app/ibz-mixins"; + +submit-button { + float: right; + @include ibz-button(grey); +} + +zf-modal { + background-color: rgba(180,180,180,.5); +} + +.box-content { + @include ibz-box-content; + + .box-title { + display: block; + font-size: 1.3rem; + } +} + +// Change Notifications default size +.ui-notification { + width: auto; + border-radius: 5px; +} \ No newline at end of file diff --git a/afb-client/app/Frontend/styles/foundation/_foundation-icons.scss b/afb-client/app/Frontend/styles/foundation/_foundation-icons.scss new file mode 100644 index 0000000..d401f3c --- /dev/null +++ b/afb-client/app/Frontend/styles/foundation/_foundation-icons.scss @@ -0,0 +1,591 @@ +/* + * Foundation Icons v 3.0 + * Made by ZURB 2013 http://zurb.com/playground/foundation-icon-fonts-3 + * MIT License + */ + +@font-face { + font-family: "foundation-icons"; + src: url("/bower_components/foundation-icons.woff") format("woff"); + font-weight: normal; + font-style: normal; +} + + +.fi-address-book:before, +.fi-alert:before, +.fi-align-center:before, +.fi-align-justify:before, +.fi-align-left:before, +.fi-align-right:before, +.fi-anchor:before, +.fi-annotate:before, +.fi-archive:before, +.fi-arrow-down:before, +.fi-arrow-left:before, +.fi-arrow-right:before, +.fi-arrow-up:before, +.fi-arrows-compress:before, +.fi-arrows-expand:before, +.fi-arrows-in:before, +.fi-arrows-out:before, +.fi-asl:before, +.fi-asterisk:before, +.fi-at-sign:before, +.fi-background-color:before, +.fi-battery-empty:before, +.fi-battery-full:before, +.fi-battery-half:before, +.fi-bitcoin-circle:before, +.fi-bitcoin:before, +.fi-blind:before, +.fi-bluetooth:before, +.fi-bold:before, +.fi-book-bookmark:before, +.fi-book:before, +.fi-bookmark:before, +.fi-braille:before, +.fi-burst-new:before, +.fi-burst-sale:before, +.fi-burst:before, +.fi-calendar:before, +.fi-camera:before, +.fi-check:before, +.fi-checkbox:before, +.fi-clipboard-notes:before, +.fi-clipboard-pencil:before, +.fi-clipboard:before, +.fi-clock:before, +.fi-closed-caption:before, +.fi-cloud:before, +.fi-comment-minus:before, +.fi-comment-quotes:before, +.fi-comment-video:before, +.fi-comment:before, +.fi-comments:before, +.fi-compass:before, +.fi-contrast:before, +.fi-credit-card:before, +.fi-crop:before, +.fi-crown:before, +.fi-css3:before, +.fi-database:before, +.fi-die-five:before, +.fi-die-four:before, +.fi-die-one:before, +.fi-die-six:before, +.fi-die-three:before, +.fi-die-two:before, +.fi-dislike:before, +.fi-dollar-bill:before, +.fi-dollar:before, +.fi-download:before, +.fi-eject:before, +.fi-elevator:before, +.fi-euro:before, +.fi-eye:before, +.fi-fast-forward:before, +.fi-female-symbol:before, +.fi-female:before, +.fi-filter:before, +.fi-first-aid:before, +.fi-flag:before, +.fi-folder-add:before, +.fi-folder-lock:before, +.fi-folder:before, +.fi-foot:before, +.fi-foundation:before, +.fi-graph-bar:before, +.fi-graph-horizontal:before, +.fi-graph-pie:before, +.fi-graph-trend:before, +.fi-guide-dog:before, +.fi-hearing-aid:before, +.fi-heart:before, +.fi-home:before, +.fi-html5:before, +.fi-indent-less:before, +.fi-indent-more:before, +.fi-info:before, +.fi-italic:before, +.fi-key:before, +.fi-laptop:before, +.fi-layout:before, +.fi-lightbulb:before, +.fi-like:before, +.fi-link:before, +.fi-list-bullet:before, +.fi-list-number:before, +.fi-list-thumbnails:before, +.fi-list:before, +.fi-lock:before, +.fi-loop:before, +.fi-magnifying-glass:before, +.fi-mail:before, +.fi-male-female:before, +.fi-male-symbol:before, +.fi-male:before, +.fi-map:before, +.fi-marker:before, +.fi-megaphone:before, +.fi-microphone:before, +.fi-minus-circle:before, +.fi-minus:before, +.fi-mobile-signal:before, +.fi-mobile:before, +.fi-monitor:before, +.fi-mountains:before, +.fi-music:before, +.fi-next:before, +.fi-no-dogs:before, +.fi-no-smoking:before, +.fi-page-add:before, +.fi-page-copy:before, +.fi-page-csv:before, +.fi-page-delete:before, +.fi-page-doc:before, +.fi-page-edit:before, +.fi-page-export-csv:before, +.fi-page-export-doc:before, +.fi-page-export-pdf:before, +.fi-page-export:before, +.fi-page-filled:before, +.fi-page-multiple:before, +.fi-page-pdf:before, +.fi-page-remove:before, +.fi-page-search:before, +.fi-page:before, +.fi-paint-bucket:before, +.fi-paperclip:before, +.fi-pause:before, +.fi-paw:before, +.fi-paypal:before, +.fi-pencil:before, +.fi-photo:before, +.fi-play-circle:before, +.fi-play-video:before, +.fi-play:before, +.fi-plus:before, +.fi-pound:before, +.fi-power:before, +.fi-previous:before, +.fi-price-tag:before, +.fi-pricetag-multiple:before, +.fi-print:before, +.fi-prohibited:before, +.fi-projection-screen:before, +.fi-puzzle:before, +.fi-quote:before, +.fi-record:before, +.fi-refresh:before, +.fi-results-demographics:before, +.fi-results:before, +.fi-rewind-ten:before, +.fi-rewind:before, +.fi-rss:before, +.fi-safety-cone:before, +.fi-save:before, +.fi-share:before, +.fi-sheriff-badge:before, +.fi-shield:before, +.fi-shopping-bag:before, +.fi-shopping-cart:before, +.fi-shuffle:before, +.fi-skull:before, +.fi-social-500px:before, +.fi-social-adobe:before, +.fi-social-amazon:before, +.fi-social-android:before, +.fi-social-apple:before, +.fi-social-behance:before, +.fi-social-bing:before, +.fi-social-blogger:before, +.fi-social-delicious:before, +.fi-social-designer-news:before, +.fi-social-deviant-art:before, +.fi-social-digg:before, +.fi-social-dribbble:before, +.fi-social-drive:before, +.fi-social-dropbox:before, +.fi-social-evernote:before, +.fi-social-facebook:before, +.fi-social-flickr:before, +.fi-social-forrst:before, +.fi-social-foursquare:before, +.fi-social-game-center:before, +.fi-social-github:before, +.fi-social-google-plus:before, +.fi-social-hacker-news:before, +.fi-social-hi5:before, +.fi-social-instagram:before, +.fi-social-joomla:before, +.fi-social-lastfm:before, +.fi-social-linkedin:before, +.fi-social-medium:before, +.fi-social-myspace:before, +.fi-social-orkut:before, +.fi-social-path:before, +.fi-social-picasa:before, +.fi-social-pinterest:before, +.fi-social-rdio:before, +.fi-social-reddit:before, +.fi-social-skillshare:before, +.fi-social-skype:before, +.fi-social-smashing-mag:before, +.fi-social-snapchat:before, +.fi-social-spotify:before, +.fi-social-squidoo:before, +.fi-social-stack-overflow:before, +.fi-social-steam:before, +.fi-social-stumbleupon:before, +.fi-social-treehouse:before, +.fi-social-tumblr:before, +.fi-social-twitter:before, +.fi-social-vimeo:before, +.fi-social-windows:before, +.fi-social-xbox:before, +.fi-social-yahoo:before, +.fi-social-yelp:before, +.fi-social-youtube:before, +.fi-social-zerply:before, +.fi-social-zurb:before, +.fi-sound:before, +.fi-star:before, +.fi-stop:before, +.fi-strikethrough:before, +.fi-subscript:before, +.fi-superscript:before, +.fi-tablet-landscape:before, +.fi-tablet-portrait:before, +.fi-target-two:before, +.fi-target:before, +.fi-telephone-accessible:before, +.fi-telephone:before, +.fi-text-color:before, +.fi-thumbnails:before, +.fi-ticket:before, +.fi-torso-business:before, +.fi-torso-female:before, +.fi-torso:before, +.fi-torsos-all-female:before, +.fi-torsos-all:before, +.fi-torsos-female-male:before, +.fi-torsos-male-female:before, +.fi-torsos:before, +.fi-trash:before, +.fi-trees:before, +.fi-trophy:before, +.fi-underline:before, +.fi-universal-access:before, +.fi-unlink:before, +.fi-unlock:before, +.fi-upload-cloud:before, +.fi-upload:before, +.fi-usb:before, +.fi-video:before, +.fi-volume-none:before, +.fi-volume-strike:before, +.fi-volume:before, +.fi-web:before, +.fi-wheelchair:before, +.fi-widget:before, +.fi-wrench:before, +.fi-x-circle:before, +.fi-x:before, +.fi-yen:before, +.fi-zoom-in:before, +.fi-zoom-out:before { + font-family: "foundation-icons"; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + display: inline-block; + text-decoration: inherit; +} + +.fi-address-book:before { content: "\f100"; } +.fi-alert:before { content: "\f101"; } +.fi-align-center:before { content: "\f102"; } +.fi-align-justify:before { content: "\f103"; } +.fi-align-left:before { content: "\f104"; } +.fi-align-right:before { content: "\f105"; } +.fi-anchor:before { content: "\f106"; } +.fi-annotate:before { content: "\f107"; } +.fi-archive:before { content: "\f108"; } +.fi-arrow-down:before { content: "\f109"; } +.fi-arrow-left:before { content: "\f10a"; } +.fi-arrow-right:before { content: "\f10b"; } +.fi-arrow-up:before { content: "\f10c"; } +.fi-arrows-compress:before { content: "\f10d"; } +.fi-arrows-expand:before { content: "\f10e"; } +.fi-arrows-in:before { content: "\f10f"; } +.fi-arrows-out:before { content: "\f110"; } +.fi-asl:before { content: "\f111"; } +.fi-asterisk:before { content: "\f112"; } +.fi-at-sign:before { content: "\f113"; } +.fi-background-color:before { content: "\f114"; } +.fi-battery-empty:before { content: "\f115"; } +.fi-battery-full:before { content: "\f116"; } +.fi-battery-half:before { content: "\f117"; } +.fi-bitcoin-circle:before { content: "\f118"; } +.fi-bitcoin:before { content: "\f119"; } +.fi-blind:before { content: "\f11a"; } +.fi-bluetooth:before { content: "\f11b"; } +.fi-bold:before { content: "\f11c"; } +.fi-book-bookmark:before { content: "\f11d"; } +.fi-book:before { content: "\f11e"; } +.fi-bookmark:before { content: "\f11f"; } +.fi-braille:before { content: "\f120"; } +.fi-burst-new:before { content: "\f121"; } +.fi-burst-sale:before { content: "\f122"; } +.fi-burst:before { content: "\f123"; } +.fi-calendar:before { content: "\f124"; } +.fi-camera:before { content: "\f125"; } +.fi-check:before { content: "\f126"; } +.fi-checkbox:before { content: "\f127"; } +.fi-clipboard-notes:before { content: "\f128"; } +.fi-clipboard-pencil:before { content: "\f129"; } +.fi-clipboard:before { content: "\f12a"; } +.fi-clock:before { content: "\f12b"; } +.fi-closed-caption:before { content: "\f12c"; } +.fi-cloud:before { content: "\f12d"; } +.fi-comment-minus:before { content: "\f12e"; } +.fi-comment-quotes:before { content: "\f12f"; } +.fi-comment-video:before { content: "\f130"; } +.fi-comment:before { content: "\f131"; } +.fi-comments:before { content: "\f132"; } +.fi-compass:before { content: "\f133"; } +.fi-contrast:before { content: "\f134"; } +.fi-credit-card:before { content: "\f135"; } +.fi-crop:before { content: "\f136"; } +.fi-crown:before { content: "\f137"; } +.fi-css3:before { content: "\f138"; } +.fi-database:before { content: "\f139"; } +.fi-die-five:before { content: "\f13a"; } +.fi-die-four:before { content: "\f13b"; } +.fi-die-one:before { content: "\f13c"; } +.fi-die-six:before { content: "\f13d"; } +.fi-die-three:before { content: "\f13e"; } +.fi-die-two:before { content: "\f13f"; } +.fi-dislike:before { content: "\f140"; } +.fi-dollar-bill:before { content: "\f141"; } +.fi-dollar:before { content: "\f142"; } +.fi-download:before { content: "\f143"; } +.fi-eject:before { content: "\f144"; } +.fi-elevator:before { content: "\f145"; } +.fi-euro:before { content: "\f146"; } +.fi-eye:before { content: "\f147"; } +.fi-fast-forward:before { content: "\f148"; } +.fi-female-symbol:before { content: "\f149"; } +.fi-female:before { content: "\f14a"; } +.fi-filter:before { content: "\f14b"; } +.fi-first-aid:before { content: "\f14c"; } +.fi-flag:before { content: "\f14d"; } +.fi-folder-add:before { content: "\f14e"; } +.fi-folder-lock:before { content: "\f14f"; } +.fi-folder:before { content: "\f150"; } +.fi-foot:before { content: "\f151"; } +.fi-foundation:before { content: "\f152"; } +.fi-graph-bar:before { content: "\f153"; } +.fi-graph-horizontal:before { content: "\f154"; } +.fi-graph-pie:before { content: "\f155"; } +.fi-graph-trend:before { content: "\f156"; } +.fi-guide-dog:before { content: "\f157"; } +.fi-hearing-aid:before { content: "\f158"; } +.fi-heart:before { content: "\f159"; } +.fi-home:before { content: "\f15a"; } +.fi-html5:before { content: "\f15b"; } +.fi-indent-less:before { content: "\f15c"; } +.fi-indent-more:before { content: "\f15d"; } +.fi-info:before { content: "\f15e"; } +.fi-italic:before { content: "\f15f"; } +.fi-key:before { content: "\f160"; } +.fi-laptop:before { content: "\f161"; } +.fi-layout:before { content: "\f162"; } +.fi-lightbulb:before { content: "\f163"; } +.fi-like:before { content: "\f164"; } +.fi-link:before { content: "\f165"; } +.fi-list-bullet:before { content: "\f166"; } +.fi-list-number:before { content: "\f167"; } +.fi-list-thumbnails:before { content: "\f168"; } +.fi-list:before { content: "\f169"; } +.fi-lock:before { content: "\f16a"; } +.fi-loop:before { content: "\f16b"; } +.fi-magnifying-glass:before { content: "\f16c"; } +.fi-mail:before { content: "\f16d"; } +.fi-male-female:before { content: "\f16e"; } +.fi-male-symbol:before { content: "\f16f"; } +.fi-male:before { content: "\f170"; } +.fi-map:before { content: "\f171"; } +.fi-marker:before { content: "\f172"; } +.fi-megaphone:before { content: "\f173"; } +.fi-microphone:before { content: "\f174"; } +.fi-minus-circle:before { content: "\f175"; } +.fi-minus:before { content: "\f176"; } +.fi-mobile-signal:before { content: "\f177"; } +.fi-mobile:before { content: "\f178"; } +.fi-monitor:before { content: "\f179"; } +.fi-mountains:before { content: "\f17a"; } +.fi-music:before { content: "\f17b"; } +.fi-next:before { content: "\f17c"; } +.fi-no-dogs:before { content: "\f17d"; } +.fi-no-smoking:before { content: "\f17e"; } +.fi-page-add:before { content: "\f17f"; } +.fi-page-copy:before { content: "\f180"; } +.fi-page-csv:before { content: "\f181"; } +.fi-page-delete:before { content: "\f182"; } +.fi-page-doc:before { content: "\f183"; } +.fi-page-edit:before { content: "\f184"; } +.fi-page-export-csv:before { content: "\f185"; } +.fi-page-export-doc:before { content: "\f186"; } +.fi-page-export-pdf:before { content: "\f187"; } +.fi-page-export:before { content: "\f188"; } +.fi-page-filled:before { content: "\f189"; } +.fi-page-multiple:before { content: "\f18a"; } +.fi-page-pdf:before { content: "\f18b"; } +.fi-page-remove:before { content: "\f18c"; } +.fi-page-search:before { content: "\f18d"; } +.fi-page:before { content: "\f18e"; } +.fi-paint-bucket:before { content: "\f18f"; } +.fi-paperclip:before { content: "\f190"; } +.fi-pause:before { content: "\f191"; } +.fi-paw:before { content: "\f192"; } +.fi-paypal:before { content: "\f193"; } +.fi-pencil:before { content: "\f194"; } +.fi-photo:before { content: "\f195"; } +.fi-play-circle:before { content: "\f196"; } +.fi-play-video:before { content: "\f197"; } +.fi-play:before { content: "\f198"; } +.fi-plus:before { content: "\f199"; } +.fi-pound:before { content: "\f19a"; } +.fi-power:before { content: "\f19b"; } +.fi-previous:before { content: "\f19c"; } +.fi-price-tag:before { content: "\f19d"; } +.fi-pricetag-multiple:before { content: "\f19e"; } +.fi-print:before { content: "\f19f"; } +.fi-prohibited:before { content: "\f1a0"; } +.fi-projection-screen:before { content: "\f1a1"; } +.fi-puzzle:before { content: "\f1a2"; } +.fi-quote:before { content: "\f1a3"; } +.fi-record:before { content: "\f1a4"; } +.fi-refresh:before { content: "\f1a5"; } +.fi-results-demographics:before { content: "\f1a6"; } +.fi-results:before { content: "\f1a7"; } +.fi-rewind-ten:before { content: "\f1a8"; } +.fi-rewind:before { content: "\f1a9"; } +.fi-rss:before { content: "\f1aa"; } +.fi-safety-cone:before { content: "\f1ab"; } +.fi-save:before { content: "\f1ac"; } +.fi-share:before { content: "\f1ad"; } +.fi-sheriff-badge:before { content: "\f1ae"; } +.fi-shield:before { content: "\f1af"; } +.fi-shopping-bag:before { content: "\f1b0"; } +.fi-shopping-cart:before { content: "\f1b1"; } +.fi-shuffle:before { content: "\f1b2"; } +.fi-skull:before { content: "\f1b3"; } +.fi-social-500px:before { content: "\f1b4"; } +.fi-social-adobe:before { content: "\f1b5"; } +.fi-social-amazon:before { content: "\f1b6"; } +.fi-social-android:before { content: "\f1b7"; } +.fi-social-apple:before { content: "\f1b8"; } +.fi-social-behance:before { content: "\f1b9"; } +.fi-social-bing:before { content: "\f1ba"; } +.fi-social-blogger:before { content: "\f1bb"; } +.fi-social-delicious:before { content: "\f1bc"; } +.fi-social-designer-news:before { content: "\f1bd"; } +.fi-social-deviant-art:before { content: "\f1be"; } +.fi-social-digg:before { content: "\f1bf"; } +.fi-social-dribbble:before { content: "\f1c0"; } +.fi-social-drive:before { content: "\f1c1"; } +.fi-social-dropbox:before { content: "\f1c2"; } +.fi-social-evernote:before { content: "\f1c3"; } +.fi-social-facebook:before { content: "\f1c4"; } +.fi-social-flickr:before { content: "\f1c5"; } +.fi-social-forrst:before { content: "\f1c6"; } +.fi-social-foursquare:before { content: "\f1c7"; } +.fi-social-game-center:before { content: "\f1c8"; } +.fi-social-github:before { content: "\f1c9"; } +.fi-social-google-plus:before { content: "\f1ca"; } +.fi-social-hacker-news:before { content: "\f1cb"; } +.fi-social-hi5:before { content: "\f1cc"; } +.fi-social-instagram:before { content: "\f1cd"; } +.fi-social-joomla:before { content: "\f1ce"; } +.fi-social-lastfm:before { content: "\f1cf"; } +.fi-social-linkedin:before { content: "\f1d0"; } +.fi-social-medium:before { content: "\f1d1"; } +.fi-social-myspace:before { content: "\f1d2"; } +.fi-social-orkut:before { content: "\f1d3"; } +.fi-social-path:before { content: "\f1d4"; } +.fi-social-picasa:before { content: "\f1d5"; } +.fi-social-pinterest:before { content: "\f1d6"; } +.fi-social-rdio:before { content: "\f1d7"; } +.fi-social-reddit:before { content: "\f1d8"; } +.fi-social-skillshare:before { content: "\f1d9"; } +.fi-social-skype:before { content: "\f1da"; } +.fi-social-smashing-mag:before { content: "\f1db"; } +.fi-social-snapchat:before { content: "\f1dc"; } +.fi-social-spotify:before { content: "\f1dd"; } +.fi-social-squidoo:before { content: "\f1de"; } +.fi-social-stack-overflow:before { content: "\f1df"; } +.fi-social-steam:before { content: "\f1e0"; } +.fi-social-stumbleupon:before { content: "\f1e1"; } +.fi-social-treehouse:before { content: "\f1e2"; } +.fi-social-tumblr:before { content: "\f1e3"; } +.fi-social-twitter:before { content: "\f1e4"; } +.fi-social-vimeo:before { content: "\f1e5"; } +.fi-social-windows:before { content: "\f1e6"; } +.fi-social-xbox:before { content: "\f1e7"; } +.fi-social-yahoo:before { content: "\f1e8"; } +.fi-social-yelp:before { content: "\f1e9"; } +.fi-social-youtube:before { content: "\f1ea"; } +.fi-social-zerply:before { content: "\f1eb"; } +.fi-social-zurb:before { content: "\f1ec"; } +.fi-sound:before { content: "\f1ed"; } +.fi-star:before { content: "\f1ee"; } +.fi-stop:before { content: "\f1ef"; } +.fi-strikethrough:before { content: "\f1f0"; } +.fi-subscript:before { content: "\f1f1"; } +.fi-superscript:before { content: "\f1f2"; } +.fi-tablet-landscape:before { content: "\f1f3"; } +.fi-tablet-portrait:before { content: "\f1f4"; } +.fi-target-two:before { content: "\f1f5"; } +.fi-target:before { content: "\f1f6"; } +.fi-telephone-accessible:before { content: "\f1f7"; } +.fi-telephone:before { content: "\f1f8"; } +.fi-text-color:before { content: "\f1f9"; } +.fi-thumbnails:before { content: "\f1fa"; } +.fi-ticket:before { content: "\f1fb"; } +.fi-torso-business:before { content: "\f1fc"; } +.fi-torso-female:before { content: "\f1fd"; } +.fi-torso:before { content: "\f1fe"; } +.fi-torsos-all-female:before { content: "\f1ff"; } +.fi-torsos-all:before { content: "\f200"; } +.fi-torsos-female-male:before { content: "\f201"; } +.fi-torsos-male-female:before { content: "\f202"; } +.fi-torsos:before { content: "\f203"; } +.fi-trash:before { content: "\f204"; } +.fi-trees:before { content: "\f205"; } +.fi-trophy:before { content: "\f206"; } +.fi-underline:before { content: "\f207"; } +.fi-universal-access:before { content: "\f208"; } +.fi-unlink:before { content: "\f209"; } +.fi-unlock:before { content: "\f20a"; } +.fi-upload-cloud:before { content: "\f20b"; } +.fi-upload:before { content: "\f20c"; } +.fi-usb:before { content: "\f20d"; } +.fi-video:before { content: "\f20e"; } +.fi-volume-none:before { content: "\f20f"; } +.fi-volume-strike:before { content: "\f210"; } +.fi-volume:before { content: "\f211"; } +.fi-web:before { content: "\f212"; } +.fi-wheelchair:before { content: "\f213"; } +.fi-widget:before { content: "\f214"; } +.fi-wrench:before { content: "\f215"; } +.fi-x-circle:before { content: "\f216"; } +.fi-x:before { content: "\f217"; } +.fi-yen:before { content: "\f218"; } +.fi-zoom-in:before { content: "\f219"; } +.fi-zoom-out:before { content: "\f21a"; } diff --git a/afb-client/app/Frontend/styles/foundation/_foundation-settings.scss b/afb-client/app/Frontend/styles/foundation/_foundation-settings.scss new file mode 100644 index 0000000..d4c6415 --- /dev/null +++ b/afb-client/app/Frontend/styles/foundation/_foundation-settings.scss @@ -0,0 +1,605 @@ +// FOUNDATION FOR APPS SETTINGS +// ---------------------------- +// +// Table of Contents: +// +// 1. CSS Exports +// 2. Global Styles +// 3. Breakpoints +// 4. Typography +// 5. Grid +// 6. Button +// 7. Accordion +// 8. Action Sheet +// 9. Block List +// 10. Button Group +// 11. Card +// 12. Extras +// 13. Forms +// 14. Iconic +// 15. Label +// 16. Menu Bar +// 17. Modal +// 18. Motion UI +// 19. Notification +// 20. Off-canvas +// 21. Panel +// 22. Popup +// 23. Switch +// 24. Tabs +// 25. Title Bar + +@import "helpers/functions"; + +// 1. CSS Exports +// - - - - - - - - - - - - - - - + +// Change any value in this map from "true" to "false" to disable that component's CSS class output. You'll still be able to use the component's mixins, but none of our pre-written classes will be in your CSS. + + $include-css: ( + accordion: true, + action-sheet: true, + block-list: true, + button: true, + button-group: true, + card: true, + coloring: true, + extras: true, + forms: true, + grid: true, + iconic: true, + label: true, + badge: true, + list: true, + menu-bar: true, + modal: true, + motion: true, + notification: true, + off-canvas: true, + panel: true, + popup: true, + switch: true, + tabs: true, + title-bar: true, + typography: true, + utilities: true, + ); + +// 2. Global Styles +// - - - - - - - - - - - - - - - + +// This sets 1rem to be 16px +// $rem-base: 16px; + +// The default font-size is set to 100% of the browser style sheet (usually 16px) +// for compatibility with browser-based text zoom or user-set defaults. + +// Since the typical default browser font-size is 16px, that makes the calculation for grid size. +// If you want your base font-size to be different and not have it affect the grid breakpoints, +// set $rem-base to $base-font-size and make sure $base-font-size is a px value. +// $base-font-size: 100%; + +// $base-line-height is 24px while $base-font-size is 16px +// $base-line-height: 1.5; + +// Text selector helpers +// $headers: "h1,h2,h3,h4,h5,h6"; + +// We use these to define default font weights +// $font-weight-normal: normal; +// $font-weight-bold: bold; + +// We use these to control various global styles +// $body-background: #fff; +// $body-font-color: #222; +// $body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; +// $body-font-weight: $font-weight-normal; +// $body-font-style: normal; +// $body-antialiased: true; + +// Application Colors +// $primary-color: #00558b; +// $secondary-color: #f1f1f1; +// $alert-color: #F04124; +// $info-color: #A0D3E8; +// $success-color: #43AC6A; +// $warning-color: #F08A24; +// $dark-color: #232323; +// $gray: #dfdfdf; +// $gray-dark: darken($gray, 8); +// $gray-light: lighten($gray, 8); + +// We use these to make sure border radius matches unless we want it different. +// $global-radius: 4px; +// $global-rounded: 1000px; + +// We use this for default spacing +// $global-padding: 1rem; +// $global-spacing: rem-calc(15); + +// 3. Breakpoints +// - - - - - - - - - - - - - - - + +// These are our named breakpoints. You can use them in our breakpoint function like this: @include breakpoint(medium) { // Medium and larger styles } +// $breakpoints: ( +// small: rem-calc(0), +// medium: rem-calc(640), +// large: rem-calc(1200), +// xlarge: rem-calc(1440), +// xxlarge: rem-calc(1920), +// ); + +// All of the names in this list will be output as classes in your CSS, like small-12, medium-6, and so on. +// $breakpoint-classes: (small medium large); + +// 4. Typography +// - - - - - - - - - - - - - - - + +// We use these to control header font styles +// $header-font-family: $body-font-family; +// $header-font-weight: $font-weight-normal; +// $header-font-style: $font-weight-normal; +// $header-font-color: #222; +// $header-line-height: 1.4; +// $header-top-margin: .2rem; +// $header-bottom-margin: .5rem; +// $header-text-rendering: optimizeLegibility; + +// We use these to control header font sizes +// $h1-font-size: rem-calc(44); +// $h2-font-size: rem-calc(37); +// $h3-font-size: rem-calc(27); +// $h4-font-size: rem-calc(23); +// $h5-font-size: rem-calc(18); +// $h6-font-size: 1rem; + +// We use these to control header size reduction on small screens +// $h1-font-reduction: rem-calc(10); +// $h2-font-reduction: rem-calc(10); +// $h3-font-reduction: rem-calc(5); +// $h4-font-reduction: rem-calc(5); +// $h5-font-reduction: 0; +// $h6-font-reduction: 0; + +// These control how subheaders are styled. +// $subheader-line-height: 1.4; +// $subheader-font-color: scale-color($header-font-color, $lightness: 35%); +// $subheader-font-weight: $font-weight-normal; +// $subheader-top-margin: .2rem; +// $subheader-bottom-margin: .5rem; + +// A general styling +// $small-font-size: 60%; +// $small-font-color: scale-color($header-font-color, $lightness: 35%); + +// We use these to style paragraphs +// $paragraph-font-family: inherit; +// $paragraph-font-weight: $font-weight-normal; +// $paragraph-font-size: 1rem; +// $paragraph-line-height: 1.6; +// $paragraph-margin-bottom: rem-calc(20); +// $paragraph-aside-font-size: rem-calc(14); +// $paragraph-aside-line-height: 1.35; +// $paragraph-aside-font-style: italic; +// $paragraph-text-rendering: optimizeLegibility; + +// We use these to style tags +// $code-color: grayscale($primary-color); +// $code-font-family: Consolas, 'Liberation Mono', Courier, monospace; +// $code-font-weight: $font-weight-normal; +// $code-background-color: scale-color($secondary-color, $lightness: 70%); +// $code-border-size: 1px; +// $code-border-style: solid; +// $code-border-color: scale-color($code-background-color, $lightness: -10%); +// $code-padding: rem-calc(2) rem-calc(5) rem-calc(1); + +// We use these to style anchors +// $anchor-text-decoration: none; +// $anchor-text-decoration-hover: none; +// $anchor-font-color: $primary-color; +// $anchor-font-color-hover: scale-color($anchor-font-color, $lightness: -14%); + +// We use these to style the
element +// $hr-border-width: 1px; +// $hr-border-style: solid; +// $hr-border-color: #ddd; +// $hr-margin: rem-calc(20); + +// We use these to style lists +// $list-font-family: $paragraph-font-family; +// $list-font-size: $paragraph-font-size; +// $list-line-height: $paragraph-line-height; +// $list-margin-bottom: $paragraph-margin-bottom; +// $list-style-position: outside; +// $list-side-margin: 1.1rem; +// $list-ordered-side-margin: 1.4rem; +// $list-side-margin-no-bullet: 0; +// $list-nested-margin: rem-calc(20); +// $definition-list-header-weight: $font-weight-bold; +// $definition-list-header-margin-bottom: .3rem; +// $definition-list-margin-bottom: rem-calc(12); + +// We use these to style blockquotes +// $blockquote-font-color: scale-color($header-font-color, $lightness: 35%); +// $blockquote-padding: rem-calc(9 20 0 19); +// $blockquote-border: 1px solid #ddd; +// $blockquote-cite-font-size: rem-calc(13); +// $blockquote-cite-font-color: scale-color($header-font-color, $lightness: 23%); +// $blockquote-cite-link-color: $blockquote-cite-font-color; + +// Acronym styles +// $acronym-underline: 1px dotted #ddd; + +// 5. Grid +// - - - - - - - - - - - - - - - + +// $container-width: rem-calc(900); +// $block-padding: $global-padding; +// $total-columns: 12; +// $block-grid-max-size: 6; + +// 6. Button +// - - - - - - - - - - - - - - - + +// $button-padding: 0.85em 1em; +// $button-margin: 0 $global-padding $global-padding 0; +// $button-style: solid; +// $button-background: $primary-color; +// $button-color: auto; +// $button-radius: 0; +// $button-sizes: ( +// tiny: 0.7, +// small: 0.8, +// medium: 1, +// large: 1.3, +// ); +// $button-font-size: 0.9rem; +// $button-opacity-disabled: 0.5; +// $button-tag-selector: false; + +// 7. Accordion +// - - - - - - - - - - - - - - - + +// $accordion-border: 1px solid $gray-dark; + +// $accordion-title-background: $gray-light; +// $accordion-title-background-hover: smartscale($accordion-title-background, 5%); +// $accordion-title-background-active: smartscale($accordion-title-background, 3%); +// $accordion-title-color: isitlight($accordion-title-background); +// $accordion-title-color-active: isitlight($accordion-title-background); + +// $accordion-title-padding: $global-padding; +// $accordion-content-padding: $global-padding; + +// 8. Action Sheet +// - - - - - - - - - - - - - - - + +// $actionsheet-background: white; +// $actionsheet-border-color: #ccc; +// $actionsheet-animate: transform opacity; +// $actionsheet-animation-speed: 0.25s; +// $actionsheet-width: 300px; +// $actionsheet-radius: 4px; +// $actionsheet-shadow: 0 -3px 10px rgba(black, 0.25); +// $actionsheet-padding: $global-padding; +// $actionsheet-tail-size: 10px; + +// $actionsheet-popup-shadow: 0 0 10px rgba(black, 0.25); + +// $actionsheet-link-color: #000; +// $actionsheet-link-background-hover: smartscale($actionsheet-background); + +// 9. Block List +// - - - - - - - - - - - - - - - + +// $blocklist-background: #fff; +// $blocklist-fullbleed: true; +// $blocklist-fontsize: 1rem; + +// $blocklist-item-padding: 0.8rem 1rem; +// $blocklist-item-color: isitlight($blocklist-background, #000, #fff); +// $blocklist-item-background-hover: smartscale($blocklist-background, 4.5%); +// $blocklist-item-color-disabled: #999; +// $blocklist-item-border: 1px solid smartscale($blocklist-background, 18.5%); + +// $blocklist-item-label-color: scale-color($blocklist-item-color, $lightness: 60%); +// $blocklist-item-icon-size: 0.8; + +// $blocklist-header-fontsize: 0.8em; +// $blocklist-header-color: smartscale($blocklist-item-color, 40%); +// $blocklist-header-uppercase: true; + +// $blocklist-check-icons: true; + +// 10. Button Group +// - - - - - - - - - - - - - - - + +// $btngroup-background: $primary-color; +// $btngroup-color: #fff; +// $btngroup-radius: $button-radius; + +// 11. Card +// - - - - - - - - - - - - - - - + +// $card-background: #fff; +// $card-color: isitlight($card-background); +// $card-border: 1px solid smartscale($card-background, 7%); +// $card-radius: $global-radius; +// $card-shadow: 0 1px 2px rgba(#000, 0.2); +// $card-padding: $global-padding; +// $card-margin: 0.5rem; + +// $card-divider-background: smartscale($card-background, 7%); + +// 12. Extras +// - - - - - - - - - - - - - - - + +// $closebutton-position: (top right); +// $closebutton-size: 2em; +// $closebutton-lineheight: 0.5; +// $closebutton-color: #999; +// $closebutton-color-hover: #333; + +// $thumbnail-padding: 0.5rem; +// $thumbnail-shadow: 0 3px 15px rgba(black, 0.25); + +// 13. Forms +// - - - - - - - - - - - - - - - + +// Basic form variables +// $form-fontsize: 1rem; +// $form-padding: 0.5rem; + +// Text fields +// $input-color: #000; +// $input-color-hover: $input-color; +// $input-color-focus: $input-color; +// $input-background: #fff; +// $input-background-hover: $input-background; +// $input-background-focus: $input-background; +// $input-border: 1px solid #ccc; +// $input-border-hover: 1px solid #bbb; +// $input-border-focus: 1px solid #999; + +// Select menus +// $select-color: #000; +// $select-background: #fafafa; +// $select-background-hover: smartscale($select-background, 4%); +// $select-arrow: true; +// $select-arrow-color: $select-color; + +// Labels +// $form-label-fontsize: 0.9rem; +// $form-label-margin: 0.5rem; +// $form-label-color: #333; + +// Inline labels +// $inlinelabel-color: #333; +// $inlinelabel-background: #eee; +// $inlinelabel-border: $input-border; + +// Range slider +// $slider-background: #ddd; +// $slider-height: 1rem; +// $slider-radius: 0px; +// $slider-thumb-height: 1.5rem; +// $slider-thumb-color: $primary-color; +// $slider-thumb-radius: 0px; + +// Progress and meter +// $meter-height: 1.5rem; +// $meter-background: #ccc; +// $meter-fill: $primary-color; +// $meter-fill-high: $success-color; +// $meter-fill-medium: #e7cf00; +// $meter-fill-low: $alert-color; +// $meter-radius: 0; + +// 14. Iconic +// - - - - - - - - - - - - - - - + +// $iconic-primary-fill: $primary-color; +// $iconic-primary-stroke: $primary-color; +// $iconic-accent-fill: $iconic-primary-fill; +// $iconic-accent-stroke: $iconic-accent-fill; + +// 15. Label +// - - - - - - - - - - - - - - - + +// $label-fontsize: 0.8rem; +// $label-padding: ($global-padding / 3) ($global-padding / 2); +// $label-radius: 0; +// $label-background: $primary-color; +// $label-color: isitlight($primary-color); + +// $badge-fontsize: 0.8em; +// $badge-diameter: 1.5rem; +// $badge-background: $primary-color; +// $badge-color: #fff; + +// DEPRECATED: these variables will be removed in v1.1. +// $badge-padding: .1em .61em; +// $badge-radius: $global-rounded; +// $badge-font-color: #fff; + +// 16. Menu Bar +// - - - - - - - - - - - - - - - + +// $menubar-fontsize: 1rem; +// $menubar-background: #fff; +// $menubar-background-hover: smartscale($menubar-background, 7%); +// $menubar-background-active: $menubar-background-hover; +// $menubar-color: isitlight($menubar-background); +// $menubar-color-hover: $menubar-color; +// $menubar-color-active: $menubar-color-hover; + +// $menubar-item-padding: $global-padding; +// $menubar-icon-size: 25px; +// $menubar-icon-spacing: $menubar-item-padding; + +// 17. Modal +// - - - - - - - - - - - - - - - + +// $modal-background: #fff; +// $modal-border: 0; +// $modal-radius: 0px; +// $modal-shadow: none; +// $modal-zindex: 1000; +// $modal-sizes: ( +// tiny: 300px, +// small: 500px, +// medium: 600px, +// large: 800px, +// ); + +// $modal-overlay-class: 'modal-overlay'; +// $modal-overlay-background: rgba(#333, 0.7); + +// 18. Motion UI +// - - - - - - - - - - - - - - - + +// Classes to use when triggering in/out animations +// $motion-class: ( +// in: "ng-enter", +// out: "ng-leave", +// ); +// $motion-class-active: ( +// in: "ng-enter-active", +// out: "ng-leave-active", +// ); +// $motion-class-stagger: ( +// in: "ng-enter-stagger", +// out: "ng-leave-stagger", +// ); + +// Set if movement-based transitions should also fade the element in and out +// $motion-slide-and-fade: false; +// $motion-hinge-and-fade: true; +// $motion-scale-and-fade: true; +// $motion-spin-and-fade: true; + +// Default speed for transitions and animations +// $motion-duration-default: 500ms; +// Slow and fast modifiders +// $motion-duration-slow: 750ms; +// $motion-duration-fast: 250ms; +// $motion-stagger-duration-default: 150ms; +// $motion-stagger-duration-short: 50ms; +// $motion-stagger-duration-long: 300ms; + +// Default timing function for transitions and animations +// $motion-timing-default: ease; +// Built-in and custom easing functions +// Every item in this map becomes a CSS class +// $motion-timings: ( +// linear: linear, +// ease: ease, +// easeIn: ease-in, +// easeOut: ease-out, +// easeInOut: ease-in-out, +// bounceIn: cubic-bezier(0.485, 0.155, 0.240, 1.245), +// bounceOut: cubic-bezier(0.485, 0.155, 0.515, 0.845), +// bounceInOut: cubic-bezier(0.760, -0.245, 0.240, 1.245), +// ); + +// Default delay for all transitions and animations +// $motion-delay-default: 0; +// Short and long delay modifiers +// $motion-delay-short: 300ms; +// $motion-delay-long: 700ms; + +// 19. Notification +// - - - - - - - - - - - - - - - + +// $notification-default-position: right top; +// $notification-width: rem-calc(400); +// $notification-offset: $global-padding; + +// $notification-background: $primary-color; +// $notification-color: white; +// $notification-padding: $global-padding; +// $notification-radius: 4px; + +// $notification-icon-size: 60px; +// $notification-icon-margin: $global-padding; +// $notification-icon-align: top; + + +// 20. Off-canvas +// - - - - - - - - - - - - - - - + +// $offcanvas-size-horizontal: 250px; +// $offcanvas-size-vertical: 250px; + +// $offcanvas-background: #fff; +// $offcanvas-color: isitlight($offcanvas-background); +// $offcanvas-padding: 0; +// $offcanvas-shadow: 3px 0 10px rgba(black, 0.25); +// $offcanvas-animation-speed: 0.25s; + +// $offcanvas-frame-selector: '.grid-frame'; + +// 21. Panel +// - - - - - - - - - - - - - - - + +// $panel-size-horizontal: 300px; +// $panel-size-vertical: 300px; +// $panel-padding: 0; + +// $panel-background: #fff; +// $panel-shadow: 3px 0 10px rgba(black, 0.25); +// $panel-animation-speed: 0.25s; + +// 22. Popup +// - - - - - - - - - - - - - - - + +// $popup-width: rem-calc(300); +// $popup-background: #fff; +// $popup-border: 0; +// $popup-radius: 0; +// $popup-shadow: 0 0 10px rgba(#000, 0.25); + +// 23. Switch +// - - - - - - - - - - - - - - - + +// $switch-width: rem-calc(50); +// $switch-height: rem-calc(32); +// $switch-background: #ccc; +// $switch-background-active: $primary-color; +// $switch-border: 0; +// $switch-radius: 9999px; +// $switch-animation-speed: 0.15s; + +// $switch-paddle-color: white; +// $switch-paddle-offset: 4px; + +// 24. Tabs +// - - - - - - - - - - - - - - - + +// $tabstrip-background: transparent; + +// $tab-title-background: $gray-light; +// $tab-title-background-hover: smartscale($tab-title-background, 5%); +// $tab-title-background-active: smartscale($tab-title-background, 3%); +// $tab-title-color: isitlight($tab-title-background); +// $tab-title-color-active: $tab-title-color; + +// $tab-title-padding: $global-padding; +// $tab-content-padding: $global-padding; + +// 25. Title Bar +// - - - - - - - - - - - - - - - + +// $titlebar-center-width: 50%; +// $titlebar-side-width: (100% - $titlebar-center-width) / 2; +// $titlebar-background: #eee; +// $titlebar-color: #000; +// $titlebar-border: 1px solid #ccc; +// $titlebar-padding: $global-padding; +// $titlebar-item-classes: ( +// center: 'center', +// left: 'left', +// right: 'right', +// title: 'title', +// ); + diff --git a/afb-client/app/Frontend/styles/foundation/foundation-conf.scss b/afb-client/app/Frontend/styles/foundation/foundation-conf.scss new file mode 100644 index 0000000..bdcfe1f --- /dev/null +++ b/afb-client/app/Frontend/styles/foundation/foundation-conf.scss @@ -0,0 +1,19 @@ +@import "foundation-settings"; +@import "foundation-icons"; +@import "foundation"; + + +/*.sidebar { + // Panel on small screens + @extend %panel-base; + @include panel-position(left); + // Override styles to become a block on medium screens + @include breakpoint(medium) { + @include grid-panel-reset; + @include grid-block(4); + } + // Change size to 3 columns on large screens + @include breakpoint(large) { + @include grid-size(3); + } +}*/ \ No newline at end of file diff --git a/afb-client/app/Frontend/tmp/routes.js b/afb-client/app/Frontend/tmp/routes.js new file mode 100644 index 0000000..c3c5ba4 --- /dev/null +++ b/afb-client/app/Frontend/tmp/routes.js @@ -0,0 +1 @@ +var foundationRoutes = [{"name":"mysample","url":"/sample","controller":"SampleController as ctrl","animationIn":"slideInRight","path":"pages/Sample/Sample.html"},{"name":"myhome","url":"/home","controller":"HomeController as ctrl","animationIn":"slideInRight","path":"pages/Home/Home.html"}]; diff --git a/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.js b/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.js new file mode 100644 index 0000000..1b94e25 --- /dev/null +++ b/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.js @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Bugs: Input with Callback SHOULD BE get 'required' class + */ + +(function () { + 'use strict'; + + var tmpl = '
' + + '' + + '{{label}}' + + '
'; + + angular.module('SubmitButton', []) + .directive('submitButton', function () { + + function mymethods(scope, elem, attrs) { + + // ajust icon or use default + scope.icon = attrs.icon || 'fi-foot'; + scope.label = attrs.label || 'Next'; + + // add label as class + elem.addClass (scope.label.toLowerCase()); + + // note: clicked in imported and when template is clicked + // it will call clicked method passed in param. + } + + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: {clicked : '='} + }; + }); +})(); diff --git a/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.scss b/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.scss new file mode 100644 index 0000000..2150e4d --- /dev/null +++ b/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.scss @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@import "app/ibz-mixins"; + +// place here your submit buttons customization + diff --git a/afb-client/app/Frontend/widgets/FormInput/FormInput.scss b/afb-client/app/Frontend/widgets/FormInput/FormInput.scss new file mode 100644 index 0000000..37519fd --- /dev/null +++ b/afb-client/app/Frontend/widgets/FormInput/FormInput.scss @@ -0,0 +1,69 @@ +/* + Sample of style overload for a specific widget + + Note: this SCSS is injected with main HTML page, it scope should be reduce + to a specific widget or it value will be propagated at a global level. +*/ + +@import "app/ibz-mixins"; + +upload-file { + height: 5rem; + display: inline-block; + float: right; + img { height: inherit;} +} + +input-text { + + alert {@include ibz-input-alert(darkblue, rgba(200, 200, 200, 0.6))}; + + input { + margin-bottom: .5rem !important; + } + + label { + margin-top: 1rem !important; + } + + .required { + color: blue; + float: right; + color: lightskyblue; + } + .required.valid { + color: green; + } + + .required.invalid { + color: plum; + } + + .status-untouch { + border-color: rgba(200, 200, 200, 0.6) !important; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(200, 200, 200, 0.6) !important; + color: #696969 !important; + } + + input:focus { + border-color: rgba(82,168,236,0.8) ; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(82,168,236,0.8) !important; + transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s; + color: darkslateblue !important; + @extend shadow-transition; + } + + .status-valid { + border-color: rgba(154, 205, 50, 0.6)!important; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(154, 205, 50, 0.6)!important; + @extend shadow-transition; + } + + .status-invalid { + border-color: rgba(154, 17, 69, 0.6); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(154, 17, 69, 0.6)!important; + color: rgb(154, 17, 69); + @extend shadow-transition; + } + +} diff --git a/afb-client/app/Frontend/widgets/FormInput/InputPassword.js b/afb-client/app/Frontend/widgets/FormInput/InputPassword.js new file mode 100644 index 0000000..157009c --- /dev/null +++ b/afb-client/app/Frontend/widgets/FormInput/InputPassword.js @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +(function() { +'use strict'; + +var tmpl = '' + + '' + + ' '+ + ''; + +angular.module('InputPassword',[]) + +.directive('inputPassword', function() { + function mymethods(scope, elem, attrs) { + + scope.valid1 = function (name, value) { + console.log ("Clicked InputPassword1 name=%s value=%s", name, value); + scope.firstpwd = value; + }; + + scope.valid2 = function (name, value, done) { + console.log ("Clicked InputPassword2 name=%s value=%s", name, value); + + // if both passwd equal then call form CB + if (scope.firstpwd !== value) { + done({valid: false, status: 'invalid', errmsg: "both password should match"}); + } else { + scope.callback (attrs.name, value); + } + + }; + + // this method can be called from controller to update widget status + scope.done=function (data) { + console.log ("Text-Input Callback ID="+ attrs.name + " data=", data); + for (var i in data) scope[i] = data[i]; + }; + + // Export some attributes within directive scope for template + scope.name = attrs.name; + scope.label1 = attrs.label || 'Password'; + scope.label2 = attrs.label || 'Password Verification'; + scope.place1 = attrs.placeholder1 || 'User Password'; + scope.tip1 = attrs.tip || 'Choose a Password'; + scope.place2 = attrs.placeholder1 || 'Password Verification'; + scope.tip2 = attrs.tip || 'Confirme your Password'; + scope.minlen = attrs.minlen || 10; + + if ("required" in attrs) scope.required = 'required'; + + } + + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: { + callback : '=', + } + }; +}); + +console.log ("InputPassword Loaded"); +})(); diff --git a/afb-client/app/Frontend/widgets/FormInput/InputText.js b/afb-client/app/Frontend/widgets/FormInput/InputText.js new file mode 100644 index 0000000..2653175 --- /dev/null +++ b/afb-client/app/Frontend/widgets/FormInput/InputText.js @@ -0,0 +1,179 @@ + +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details.. + */ + + + +(function() { +'use strict'; + +var tmpl = '' + + ''+ + '{{errmsg}}'; + +var emailpatern = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i; + +angular.module('InputText',['JQueryEmu']) + +.directive('inputText', function(JQemu) { + function mymethods(scope, elem, attrs) { + + // default value at 1st rendering + scope.error = false; + scope.valid = false; + scope.status = 'untouch'; + + scope.input = elem.find ("input"); + scope.required = 0; + + // requirer is use to increment requested counter + if ("required" in attrs) { + scope.required = 1; + elem.addClass ("required"); + } + + // user enter input reset error status + scope.selected = function () { + scope.error=false; + scope.errmsg=false; + scope.status = 'touch'; + }; + + scope.validate = function () { + + // get value from input field bypassing Angular ng-model + console.log ("Clicked InputText name=%s value=%s valid=%s", scope.name, scope.value, scope.valid); + + // form is not untouched anymore + scope.parent.removeClass ("ng-pristine"); + + // if value not null clean up string + if (scope.value) { + scope.error=false; + // remove leading and trailling space + scope.value = scope.value.trim(); + + // remove any space is not allowed + if ('nospace' in attrs) { + scope.value=scope.value.replace(/\s/g, ''); + } + + if ('lowercase' in attrs) { + scope.value = scope.value.toLowerCase(); + } + + // check minimum lenght + if ("minlen" in attrs) { + if (scope.value.length < attrs.minlen) { + scope.status='invalid'; + scope.errmsg=scope.name + ': Mininum Lengh= ' + attrs.minlen + ' Characters'; + scope.error=true; + } + } + + if ('email' in attrs) { + if (!emailpatern.test (scope.value)) { + scope.status='invalid'; + scope.errmsg='invalid email address'; + scope.error=true; + } + } + + } else { + if (scope.required) { + scope.status='invalid'; + scope.errmsg=scope.name + ': Required Attribute'; + scope.error=true; + } + } + + // If local control fail let's refuse input + if (scope.error) { + if (scope.required && scope.valid) { + scope.valid = false; + if (scope.l4acounter.validated > 0) scope.l4acounter.validated --; + } + // use call to update form scope on form completeness + scope.callback (attrs.name, null, scope.done); + } else { + // localcheck is OK backup may nevertheless change status to false + if (scope.required && !scope.valid) scope.l4acounter.validated ++; + scope.status='valid'; + scope.valid=true; + scope.callback (attrs.name, scope.value, scope.done); + } + + }; + + // this method can be called from controller to update widget status + scope.done=function (data) { + console.log ("Text-Input Callback ID="+ attrs.name + " data=", data); + for (var i in data) scope[i] = data[i]; + }; + + // Export some attributes within directive scope for template + scope.label = attrs.label; + scope.name = attrs.name; + scope.placeholder = attrs.placeholder; + scope.type = attrs.type || "text"; + scope.tip = attrs.tip; + + // search for form within parent elemnts + scope.parent = JQemu.parent (elem, "FORM"); + + // email enforce lowercase and nospace + if ("email" in attrs) { + attrs.lowercase=true; + attrs.nospace=true; + attrs.minlen=6; + } + + if (scope.required) { + scope.l4acounter = scope.parent.data ("l4acounter"); + if (!scope.l4acounter) { + scope.l4acounter = {required:1, validated:0}; + console.log("Field "+scope.name+" is required (1st)"); + scope.parent.data ("l4acounter", scope.l4acounter); + } else { + console.log("Field "+scope.name+" is required"); + scope.l4acounter.required ++; + } + } + + // refresh validation each time controler update value + scope.$watch ('value', function(){ + if(scope.value) scope.validate(); } + ); + + } + + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: { + callback : '=', + value: '=' + } + }; +}); + +console.log ("InputText Loaded"); +})(); diff --git a/afb-client/app/Frontend/widgets/FormInput/UploadFile.js b/afb-client/app/Frontend/widgets/FormInput/UploadFile.js new file mode 100644 index 0000000..9a2f031 --- /dev/null +++ b/afb-client/app/Frontend/widgets/FormInput/UploadFile.js @@ -0,0 +1,113 @@ + +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details.. + * + * Reference: + * https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications#Using_hidden_file_input_elements_using_the_click%28%29_method + * https://uncorkedstudios.com/blog/multipartformdata-file-upload-with-angularjs + * https://www.terlici.com/2015/05/16/uploading-files-locally.html + * https://github.com/nervgh/angular-file-upload/blob/master/src/services/FileUploader.js + */ + + +function changeInput() { + console.log ('input imgClicked'); +} + +(function() { +'use strict'; + +// WARNING: Angular ng-change does not work on input/file. Let's hook our callback through standard JS function +var tmpl = '
'+ + ''+ + ' ' + + '
' + + '' ; + +function basename(path) { + return path.split('/').reverse()[0]; +} + +angular.module('UploadFile',['ConfigApp']) + +.directive('uploadFile', function(ConfigApp, $http, JQemu) { + function mymethods(scope, elem, attrs) { + + // get widget image handle from template + scope.imgElem = elem.find('img'); + scope.inputElem = elem.find('input'); + scope.submitElem = JQemu.findByType (elem.children(), "submit"); + + + // Image was ckick let's simulate an input (file) click + scope.imgClicked = function () { + scope.inputElem[0].click(); // Warning Angular TriggerEvent does not work!!! + }; + + // upload file to server + scope.UpLoadFile= function(files) { + + + for (var i = 0; i < files.length; i++) { + var file = files[i]; + console.log ("Selected file=" + file.name + " size="+ file.size/1024); + var mimeType = /image.*/; // build regular expression from Mime + if (!file.type.match(mimeType)) { + continue; + } + + if (file.size > scope.sizemax*1024) { + scope.imagepath = scope.istoobig; // warning is path is wrong nothing happen + scope.$apply('imagepath'); // we short-circuit Angular resync Image + } else { + + scope.basename=basename(file.name); + scope.imgElem[0].file = file; + + var reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = function (upload) { + scope.imagepath = upload.target.result; + scope.$apply('imagepath'); // we short-circuit Angular resync image + scope.submitElem[0].click(); // Warning Angular TriggerEvent does not work!!! + }; + } + } + }; + + // Initiallize default values from attributes values + if (attrs.icon) scope.imagepath= ConfigApp.paths[attrs.category] + attrs.icon; + else scope.imagepath=ConfigApp.paths.avatars + 'tux-bzh.png'; + + if (attrs.istoobig) scope.istoobig= ConfigApp.paths[attrs.category] + attrs.istoobig; + else scope.istoobig=ConfigApp.paths.avatars + 'istoobig.jpg'; + + scope.name= attrs.name || 'avatar'; + scope.mime= attrs.mime || 'image'; + scope.sizemax= attrs.sizemax || 100; // default max size 100KB + + } + + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: { + callback : '=' + } + }; +}); + +console.log ("UploadFile Loaded"); +})(); diff --git a/afb-client/app/Frontend/widgets/Navigation/LinkButton.js b/afb-client/app/Frontend/widgets/Navigation/LinkButton.js new file mode 100644 index 0000000..3e83425 --- /dev/null +++ b/afb-client/app/Frontend/widgets/Navigation/LinkButton.js @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Bugs: Input with Callback SHOULD BE get 'required' class + */ + +(function () { + 'use strict'; + + var tmpl = '' + + '' + + '{{label}}' + + ''; + + + angular.module('LinkButton', []) + .directive('linkButton', function ($location) { + + function mymethods(scope, elem, attrs) { + + scope.clicked = function () { + + if (!attrs.query) $location.path(attrs.href); + else $location.path(attrs.href).search(attrs.query); + }; + + // ajust icon or use default + scope.icon = attrs.icon || 'fi-link'; + scope.label = attrs.label || 'Jump'; + scope.href = attrs.href || '/home'; + + // add label as class + elem.addClass (scope.label.toLowerCase()); + } + + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: {} + }; + }); +})(); diff --git a/afb-client/app/Frontend/widgets/Navigation/Navigation.scss b/afb-client/app/Frontend/widgets/Navigation/Navigation.scss new file mode 100644 index 0000000..2babf24 --- /dev/null +++ b/afb-client/app/Frontend/widgets/Navigation/Navigation.scss @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +@import "app/ibz-mixins"; + + +link-button {@include ibz-button(#3366ff,1rem)}; + +//pale blue for secondaty link +link-button.secondary {@include ibz-button(#99b3ff,1rem)}; + diff --git a/afb-client/app/Frontend/widgets/Notifications/ModalNotification.js b/afb-client/app/Frontend/widgets/Notifications/ModalNotification.js new file mode 100644 index 0000000..37ba047 --- /dev/null +++ b/afb-client/app/Frontend/widgets/Notifications/ModalNotification.js @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Bugs: Input with Callback SHOULD BE get 'required' class + * + * ref: https://developer.mozilla.org/en-US/docs/Web/Events/mouseover + * + * usage: + * + * tipModal: listen event from elem.parent() to display tip-modal + *
+ * + * + *
+ * + * Note: use CSS.visibility to avoid display flickering at initial display. + */ + +(function () { + 'use strict'; + + var tmpl = '
' + + '' + + '{{tip}}' + + '
' ; + + angular.module('ModalNotification', []) + .directive('tipModal', function ($timeout) { + + function mymethods(scope, elem, attrs) { + scope.parent = elem.parent(); + scope.modal = elem.find("div"); + + + // delay tip display to avoid blinking when moving mouse fast + function display () { + function action() { + if (scope.show) scope.modal.css({opacity: 1, visibility:'visible'}); + } + scope.show = true; + scope.timeout = $timeout(action, scope.delay); + } + + function close () { + scope.show = false; + scope.modal.css({opacity: 0, visibility:'hidden'}); + } + + + // ajust icon or use default + scope.icon = attrs.icon || 'fi-lightbulb'; + + // Update Parent element to get mouse event + scope.parent.addClass ('as-modal-tip'); + scope.parent.bind('click', close); + scope.parent.bind('focus', display); + scope.parent.bind('mouseover', display); + scope.parent.bind('mouseleave', close); + scope.parent.bind('blur', close); + + scope.delay = attrs.delay || 1000; // wait 1s before displaying tip + } + + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: {tip: "="} // tip may not be defined when widget is display + }; + }); +})(); diff --git a/afb-client/app/Frontend/widgets/Notifications/Notifications.scss b/afb-client/app/Frontend/widgets/Notifications/Notifications.scss new file mode 100644 index 0000000..5d42d2a --- /dev/null +++ b/afb-client/app/Frontend/widgets/Notifications/Notifications.scss @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Reference: http://www.greywyvern.com/?post=337 + */ + +@import "app/ibz-mixins"; + + +link-button {@include ibz-button(#3366ff,1rem)}; + +// Modal should be relative and tip-modal-popup absolute +tip-modal { + position:relative; +} + +.tip-modal-popup { + //visibility: hidden; + width: 20rem; + position:absolute; + top:1em; + padding: 0.2em 0.6em; + border:1px solid #996633; + background-color:#e5ffff; + color:#000; + opacity:0; + transition:visibility .5s linear 1s,opacity 1s linear; + border-radius: 5px; + i { + margin: 0 .3rem 0 0; + display: inline; + } +} diff --git a/afb-client/app/etc/AppDefaults.js b/afb-client/app/etc/AppDefaults.js new file mode 100644 index 0000000..7b5326a --- /dev/null +++ b/afb-client/app/etc/AppDefaults.js @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +var SESSION_TIMEOUT= 3600000; // default is 1h loggin session + +// Default config will be superseaded by ProjectRoot/.config-l4a.js $HOME/.config-l4a.js /etc/default/config-l4a.js +config = { + + APPNAME : 'AFBclient', // AppName is use as main Angular Module name + FRONTEND: "Frontend", // HTML5 frontend [no leading ./] + BACKEND : "Backend", // NodeJS Rest API [no leading ./] + URLBASE : '/opa/', // HTML basedir when running in production [should end with a /] + APIBASE : '/api/', // Api url base dir [should end with a /] + DEBUG : 4001, // Node Debug Port + DBG_LVL : 5, // Debug Trace Level 0=no trace. + + // EXPRESS WEB server config [note: URLBASE generate rewriting rules] + EXPRESS_HOST : 'localhost', // HTTP will only listen on related Internet interface + EXPRESS_PORT : 4000, // HTTP port + EXPRESS_LOGDIR : __dirname + '/../../log', // httpd log file + EXPRESS_SECRET : Math.random().toString(36).slice(2), // [default cookie session] + EXPRESS_SESSION : SESSION_TIMEOUT +}; + +module.exports = config; + diff --git a/afb-client/app/etc/_Config.js b/afb-client/app/etc/_Config.js new file mode 100644 index 0000000..ce93d43 --- /dev/null +++ b/afb-client/app/etc/_Config.js @@ -0,0 +1,44 @@ +/* + * Copyright 2014 Fulup Ar Foll + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var fs = require('fs'); + +function Config () { + 'use strict'; + var values=[]; + var extention='-l4a.js'; + var conf; + + // Configs file path last one supersead first one. + var files= [__dirname + "/AppDefaults.js", "/etc/default/noderc"+ extention, process.env.NODERC, process.env.HOME + "/.noderc"+ extention , __dirname +"/../../.noderc.js" ]; + + // Parse any existing files within config list & merge them + for (var idx in files) { + if (files[idx]) { + //console.log ("files=", files[idx]); + if (fs.existsSync (files[idx])) conf=require (files[idx]); + for (var i in conf) values[i] = conf[i]; + } + } + + // set path to search for node_module within parent directory + process.env.NODE_PATH= process.env.NODE_PATH + '../node_modules'; + + // console.log ("values=", values); + return values; +} + +module.exports = Config(); diff --git a/afb-client/app/etc/_Trace.js b/afb-client/app/etc/_Trace.js new file mode 100644 index 0000000..79ef4f5 --- /dev/null +++ b/afb-client/app/etc/_Trace.js @@ -0,0 +1,55 @@ +/* + * Copyright 2014 Fulup Ar Foll + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var util = require("util"); +var path = require("path"); +var config= require('./_Config'); + +function TracePoint () { + var saved = Error.prepareStackTrace; // save default prepareStack function + Error.prepareStackTrace = function(_, stack){ return stack; }; // overload err stack handling + Error.captureStackTrace(this, arguments.callee); // request a stack + this.trace = this.stack; // effectively build trace + Error.prepareStackTrace = saved; // restore original nodejs function +} + +// ------- Public Methods -------------- +var dbgLevel = function(target, level, format) { //+ arguments + // try to get debugLevel from calling object or global config + if (target && target.dbgLevel) dbgLevel = target.dbgLevel; + else dbgLevel = config.DBG_LVL || 1; + + if (dbgLevel >= level ) { + + var args = [].slice.call(arguments, 2); // copy argument in a real array leaving out level + var message = util.format.apply(null, args); + + var trace = new TracePoint().trace; + var info = { + fullpath : trace[1].getFileName(), + linenum : trace[1].getLineNumber(), + basename : path.basename (trace[1].getFileName()) + }; + + if (dbgLevel >= 5) { + console.log("%s:%d", info.fullpath, info.linenum); + console.log("\t[%d] %j", dbgLevel, message); + } + else console.log("--%d-- [%s:%d] -- %j", dbgLevel, info.basename, info.linenum, message); + } +}; + +module.exports = dbgLevel; -- cgit 1.2.3-korg From 72eb409f785b23038d87f3513687e2e1ed4dbb7d Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Dec 2015 17:25:52 +0100 Subject: Doc --- afb-client/README.md | 4 ++-- afb-client/nbproject/project.xml | 2 +- afb-client/package.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/afb-client/README.md b/afb-client/README.md index 6b628da..e506468 100644 --- a/afb-client/README.md +++ b/afb-client/README.md @@ -7,8 +7,8 @@ Install HTML5 development toolchain on your host git clone https://github.com/iotbzh/afb-client.git 2) Install NodeJs [not used on target] - zypper install nodejs - yum install nodejs + zypper install nodejs + yum install nodejs 3) Install building tools [bower, gulp, ....] npm install # this install all development tool chain dependencies diff --git a/afb-client/nbproject/project.xml b/afb-client/nbproject/project.xml index 4979f19..438e3ff 100644 --- a/afb-client/nbproject/project.xml +++ b/afb-client/nbproject/project.xml @@ -3,7 +3,7 @@ org.netbeans.modules.web.clientproject - afb-client + AFBclient diff --git a/afb-client/package.json b/afb-client/package.json index 3b11ee1..26cf47f 100644 --- a/afb-client/package.json +++ b/afb-client/package.json @@ -1,7 +1,7 @@ { - "name": "AudioClient", + "name": "AFBclient", "private": true, - "version": "0.0.0", + "version": "0.0.1", "repository": { "type": "git", "url": "https://github.com/iotbzh/healthy-gulp-angular-foundation6" -- cgit 1.2.3-korg From fbdd26b4a4aa8eb3d83333fe44e93590bc174e11 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Dec 2015 19:17:46 +0100 Subject: Work in Progress --- afb-client/app/Frontend/app.js | 1 + afb-client/app/Frontend/pages/Home/Home.html | 1 + afb-client/app/Frontend/pages/Home/HomeModule.js | 11 ++- afb-client/app/Frontend/pages/Home/HomeModule.scss | 6 ++ afb-client/app/Frontend/pages/Sample/Sample.html | 4 +- afb-client/app/Frontend/services/ConfigApp.js | 9 ++ .../widgets/Notifications/Notifications.scss | 8 ++ .../widgets/Notifications/TokenRefreshSvc.js | 104 +++++++++++++++++++++ afb-client/nbproject/project.xml | 2 +- afb-client/package.json | 2 +- 10 files changed, 142 insertions(+), 6 deletions(-) create mode 100644 afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js diff --git a/afb-client/app/Frontend/app.js b/afb-client/app/Frontend/app.js index dc1d489..e539062 100644 --- a/afb-client/app/Frontend/app.js +++ b/afb-client/app/Frontend/app.js @@ -20,6 +20,7 @@ 'SampleModule', 'UploadFile', 'LinkButton', + 'TokenRefresh', 'ModalNotification' ]) .config(config) diff --git a/afb-client/app/Frontend/pages/Home/Home.html b/afb-client/app/Frontend/pages/Home/Home.html index 9803b63..9b9cc01 100644 --- a/afb-client/app/Frontend/pages/Home/Home.html +++ b/afb-client/app/Frontend/pages/Home/Home.html @@ -12,6 +12,7 @@ animationIn: slideInRight App Framework Binder Simple Client +
diff --git a/afb-client/app/Frontend/pages/Home/HomeModule.js b/afb-client/app/Frontend/pages/Home/HomeModule.js index 11b3882..ba6c5ea 100644 --- a/afb-client/app/Frontend/pages/Home/HomeModule.js +++ b/afb-client/app/Frontend/pages/Home/HomeModule.js @@ -1,10 +1,10 @@ (function() { 'use strict'; - var INITIAL_TOKEN=123456789; // should match with --token=xxxx binder command line +// WARNING: make sure than app/frontend/services/ConfigApp.js match your server // list all rependencies within the page + controler if needed -angular.module('HomeModule', ['SubmitButton']) +angular.module('HomeModule', ['SubmitButton', 'TokenRefresh']) .controller('HomeController', function ($http, ConfigApp) { var scope = this; // I hate JavaScript @@ -21,6 +21,11 @@ angular.module('HomeModule', ['SubmitButton']) scope.errcode= errcode; scope.request = data.request; scope.response = data.response; + + // if token was refresh let's update ConfigApp + if (data.request.token) ConfigApp.session.token = data.request.token; + if (data.request.uuid) ConfigApp.session.uuid = data.request.uuid; + if (data.request.timeout) ConfigApp.session.timeout = data.request.timeout; // Make sure we clean everything when Open/Close is called if (apiname === "APIcreate" || apiname === "APIreset") { @@ -51,7 +56,7 @@ angular.module('HomeModule', ['SubmitButton']) scope.OpenSession = function() { console.log ("OpenSession"); var postdata= {/* any json your application may need */}; - var handler = $http.post(ConfigApp.api.token + 'create?token='+INITIAL_TOKEN, postdata); + var handler = $http.post(ConfigApp.api.token + 'create?token='+ConfigApp.session.token, postdata); handler.success(scope.ProcessResponse); handler.error(scope.ProcessError); diff --git a/afb-client/app/Frontend/pages/Home/HomeModule.scss b/afb-client/app/Frontend/pages/Home/HomeModule.scss index 34e1181..8bf04a1 100644 --- a/afb-client/app/Frontend/pages/Home/HomeModule.scss +++ b/afb-client/app/Frontend/pages/Home/HomeModule.scss @@ -21,6 +21,12 @@ $COLOR_SUCCESS: green; $COLOR_FAIL: red; +token-refresh { + display: block; + float: right; + margin: .5rem 1rem 0 0; +} + .button-box { height : 4.5rem; diff --git a/afb-client/app/Frontend/pages/Sample/Sample.html b/afb-client/app/Frontend/pages/Sample/Sample.html index 00a6f3b..e7e9164 100644 --- a/afb-client/app/Frontend/pages/Sample/Sample.html +++ b/afb-client/app/Frontend/pages/Sample/Sample.html @@ -7,7 +7,9 @@ controller: SampleController as ctrl animationIn: slideInRight --- -

Sample Page

+

+ Not Working +

diff --git a/afb-client/app/Frontend/services/ConfigApp.js b/afb-client/app/Frontend/services/ConfigApp.js index f36d79b..cafda3f 100644 --- a/afb-client/app/Frontend/services/ConfigApp.js +++ b/afb-client/app/Frontend/services/ConfigApp.js @@ -16,6 +16,15 @@ api: { // Warning paths should end with / token : '/api/token/' + }, + + session: { // Those data are updated by session service + refresh : '/api/token/refresh', + check : '/api/token/check', + token : '123456789', // typical dev initial token + timeout : 3600, // timeout is updated client sessin context creation + uuid : '', // uuid map with cookie or long term session access key + pingrate: 60 // Ping rate to check if server is still alive } }; diff --git a/afb-client/app/Frontend/widgets/Notifications/Notifications.scss b/afb-client/app/Frontend/widgets/Notifications/Notifications.scss index 5d42d2a..5a4adc1 100644 --- a/afb-client/app/Frontend/widgets/Notifications/Notifications.scss +++ b/afb-client/app/Frontend/widgets/Notifications/Notifications.scss @@ -45,3 +45,11 @@ tip-modal { display: inline; } } + +token-refresh.online { + color: blue; +} + +token-refresh.offline { + color: red; +} diff --git a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js new file mode 100644 index 0000000..1671748 --- /dev/null +++ b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js @@ -0,0 +1,104 @@ +/* + alsa-gateway -- provide a REST/HTTP interface to ALSA-Mixer + + Copyright (C) 2015, Fulup Ar Foll + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with scope program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + References: + + */ + +(function () { + 'use strict'; + + var template = + '
' + + 'afb://{{hostname}}:{{httpdport}}' + + '' + + '
' + ; + + +// scope module is load statically before any route is cativated +angular.module('TokenRefresh', []) + + .directive ('tokenRefresh', function($timeout, $http, $location, Notification, ConfigApp) { + + function mymethods(scope, elem, attrs) { + + scope.status; + + scope.online = function () { + elem.addClass ("online"); + elem.removeClass ("offline"); + }; + + scope.offline = function(){ + elem.addClass ("offline"); + elem.removeClass ("online"); + }; + + // Check Binder status + scope.getping = function() { + + var handler = $http.get(ConfigApp.api.ping+'xx?token='+ ConfigApp.session.token); + handler.success(function(response, errcode, headers, config) { + if (!scope.status) { + Notification.success ({message: "AFB Back to Live", delay: 3000}); + scope.online(); + } + scope.status = 1; + }); + + handler.error(function(response, errcode, headers) { + if (scope.status) { + Notification.warning ({message: "AFB Lost", delay: 5000}); + scope.offline(); + } + scope.status = 0; + }); + + // restart a new timer for next ping + $timeout (scope.getping, ConfigApp.session.pingrate*1000); + }; + + // Check Binder status + scope.refresh = function() { + var handler = $http.get(ConfigApp.api.refresh+'?token='+ ConfigApp.session.token); + $timeout (scope.refresh, ConfigApp.session.timeout *800); + }; + + scope.icon = attrs.icon || "fi-lightbulb"; + scope.hostname = $location.host(); + scope.httpdport = $location.port(); + + scope.getping(); + scope.refresh(); + } + + return { + template: template, + scope: { + callback : "=" + }, + restrict: 'E', + link: mymethods + }; +}); + +})(); +console.log ("Token Refresh Loaded"); + diff --git a/afb-client/nbproject/project.xml b/afb-client/nbproject/project.xml index 438e3ff..4979f19 100644 --- a/afb-client/nbproject/project.xml +++ b/afb-client/nbproject/project.xml @@ -3,7 +3,7 @@ org.netbeans.modules.web.clientproject - AFBclient + afb-client diff --git a/afb-client/package.json b/afb-client/package.json index 26cf47f..e8198f6 100644 --- a/afb-client/package.json +++ b/afb-client/package.json @@ -1,5 +1,5 @@ { - "name": "AFBclient", + "name": "afb-client", "private": true, "version": "0.0.1", "repository": { -- cgit 1.2.3-korg From 98522d2a6ce7c7a709728872ed892970d0a1df7b Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 16 Dec 2015 21:38:04 +0100 Subject: Added AFB monitoring and token auto-refresh --- afb-client/app/Frontend/pages/Home/Home.html | 2 ++ afb-client/app/Frontend/services/ConfigApp.js | 2 +- .../widgets/Notifications/Notifications.scss | 12 ++++++++++-- .../widgets/Notifications/TokenRefreshSvc.js | 21 ++++++++++----------- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/afb-client/app/Frontend/pages/Home/Home.html b/afb-client/app/Frontend/pages/Home/Home.html index 9b9cc01..6eda66d 100644 --- a/afb-client/app/Frontend/pages/Home/Home.html +++ b/afb-client/app/Frontend/pages/Home/Home.html @@ -31,4 +31,6 @@ animationIn: slideInRight
+ diff --git a/afb-client/app/Frontend/services/ConfigApp.js b/afb-client/app/Frontend/services/ConfigApp.js index cafda3f..adec5ac 100644 --- a/afb-client/app/Frontend/services/ConfigApp.js +++ b/afb-client/app/Frontend/services/ConfigApp.js @@ -20,7 +20,7 @@ session: { // Those data are updated by session service refresh : '/api/token/refresh', - check : '/api/token/check', + ping : '/api/token/check', token : '123456789', // typical dev initial token timeout : 3600, // timeout is updated client sessin context creation uuid : '', // uuid map with cookie or long term session access key diff --git a/afb-client/app/Frontend/widgets/Notifications/Notifications.scss b/afb-client/app/Frontend/widgets/Notifications/Notifications.scss index 5a4adc1..fb740b7 100644 --- a/afb-client/app/Frontend/widgets/Notifications/Notifications.scss +++ b/afb-client/app/Frontend/widgets/Notifications/Notifications.scss @@ -46,10 +46,18 @@ tip-modal { } } +token-refresh { + @include ibz-button(grey,1rem) + i {margin-left: .5rem;} + margin-right: 1rem; +} + token-refresh.online { - color: blue; + color: #0066cc; + i {color: lime;} } token-refresh.offline { - color: red; + color: #ff00ff; + i {color: red;} } diff --git a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js index 1671748..2b1e9db 100644 --- a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js +++ b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js @@ -25,11 +25,10 @@ 'use strict'; var template = - '
' - + 'afb://{{hostname}}:{{httpdport}}' - + '' - + '
' - ; + '
' + + 'afb://{{hostname}}:{{httpdport}}' + + '' + + '
'; // scope module is load statically before any route is cativated @@ -39,7 +38,7 @@ angular.module('TokenRefresh', []) function mymethods(scope, elem, attrs) { - scope.status; + scope.status=false; scope.online = function () { elem.addClass ("online"); @@ -54,10 +53,10 @@ angular.module('TokenRefresh', []) // Check Binder status scope.getping = function() { - var handler = $http.get(ConfigApp.api.ping+'xx?token='+ ConfigApp.session.token); + var handler = $http.post(ConfigApp.session.ping+'?token='+ ConfigApp.session.token); handler.success(function(response, errcode, headers, config) { if (!scope.status) { - Notification.success ({message: "AFB Back to Live", delay: 3000}); + Notification.success ({message: "AppFramework Binder Back to Live", delay: 3000}); scope.online(); } scope.status = 1; @@ -65,7 +64,7 @@ angular.module('TokenRefresh', []) handler.error(function(response, errcode, headers) { if (scope.status) { - Notification.warning ({message: "AFB Lost", delay: 5000}); + Notification.warning ({message: "AppFramework Binder Lost", delay: 5000}); scope.offline(); } scope.status = 0; @@ -77,8 +76,8 @@ angular.module('TokenRefresh', []) // Check Binder status scope.refresh = function() { - var handler = $http.get(ConfigApp.api.refresh+'?token='+ ConfigApp.session.token); - $timeout (scope.refresh, ConfigApp.session.timeout *800); + var handler = $http.post(ConfigApp.session.refresh+'?token='+ ConfigApp.session.token); + $timeout (scope.refresh, ConfigApp.session.timeout *250); }; scope.icon = attrs.icon || "fi-lightbulb"; -- cgit 1.2.3-korg From 5669aa501d13221bbbedb93b5358d3f8073310c7 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Thu, 17 Dec 2015 00:47:38 +0100 Subject: Cleanup --- afb-client/app/Frontend/pages/Home/Home.html | 4 ++-- afb-client/app/Frontend/pages/Home/HomeModule.js | 2 +- afb-client/app/Frontend/services/ConfigApp.js | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/afb-client/app/Frontend/pages/Home/Home.html b/afb-client/app/Frontend/pages/Home/Home.html index 6eda66d..69c4dbe 100644 --- a/afb-client/app/Frontend/pages/Home/Home.html +++ b/afb-client/app/Frontend/pages/Home/Home.html @@ -11,8 +11,8 @@ animationIn: slideInRight App Framework Binder Simple Client - - +
diff --git a/afb-client/app/Frontend/pages/Home/HomeModule.js b/afb-client/app/Frontend/pages/Home/HomeModule.js index ba6c5ea..30e796e 100644 --- a/afb-client/app/Frontend/pages/Home/HomeModule.js +++ b/afb-client/app/Frontend/pages/Home/HomeModule.js @@ -56,7 +56,7 @@ angular.module('HomeModule', ['SubmitButton', 'TokenRefresh']) scope.OpenSession = function() { console.log ("OpenSession"); var postdata= {/* any json your application may need */}; - var handler = $http.post(ConfigApp.api.token + 'create?token='+ConfigApp.session.token, postdata); + var handler = $http.post(ConfigApp.api.token + 'create?token='+ConfigApp.session.initial, postdata); handler.success(scope.ProcessResponse); handler.error(scope.ProcessError); diff --git a/afb-client/app/Frontend/services/ConfigApp.js b/afb-client/app/Frontend/services/ConfigApp.js index adec5ac..310ef88 100644 --- a/afb-client/app/Frontend/services/ConfigApp.js +++ b/afb-client/app/Frontend/services/ConfigApp.js @@ -21,10 +21,11 @@ session: { // Those data are updated by session service refresh : '/api/token/refresh', ping : '/api/token/check', - token : '123456789', // typical dev initial token + initial : '123456789', // typical dev initial token timeout : 3600, // timeout is updated client sessin context creation + pingrate: 60, // Ping rate to check if server is still alive uuid : '', // uuid map with cookie or long term session access key - pingrate: 60 // Ping rate to check if server is still alive + token : '' // will be returned from authentication } }; -- cgit 1.2.3-korg From 07eb8e102607da8d6a4c1cd9835e8465c9280161 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Thu, 17 Dec 2015 00:51:55 +0100 Subject: Activated Token-Refresh Monitoring --- afb-client/app/Frontend/pages/Home/Home.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afb-client/app/Frontend/pages/Home/Home.html b/afb-client/app/Frontend/pages/Home/Home.html index 69c4dbe..6eda66d 100644 --- a/afb-client/app/Frontend/pages/Home/Home.html +++ b/afb-client/app/Frontend/pages/Home/Home.html @@ -11,8 +11,8 @@ animationIn: slideInRight App Framework Binder Simple Client - + +
-- cgit 1.2.3-korg From 4136c1506e0c894e604ec069339313987a7e05e7 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Sun, 20 Dec 2015 21:04:34 +0100 Subject: Implemented client upload with rangeslider and zip open --- afb-client/app/Backend/RestApis/PostMockApi.js | 28 +- afb-client/app/Frontend/app.js | 9 +- afb-client/app/Frontend/etc/ConfigApp.js | 38 ++ afb-client/app/Frontend/etc/routes.js | 1 + .../app/Frontend/images/appli/isnotvalid.png | Bin 0 -> 58558 bytes afb-client/app/Frontend/images/appli/istoobig.png | Bin 0 -> 35678 bytes .../app/Frontend/images/appli/upload-appli.png | Bin 0 -> 24483 bytes afb-client/app/Frontend/images/audio/istoobig.png | Bin 0 -> 35678 bytes .../app/Frontend/images/audio/upload-music.png | Bin 0 -> 69741 bytes .../app/Frontend/images/avatars/istoobig.png | Bin 0 -> 35678 bytes afb-client/app/Frontend/pages/Home/Home.html | 7 +- afb-client/app/Frontend/pages/Home/HomeModule.js | 8 +- afb-client/app/Frontend/pages/Sample/Sample.html | 25 +- .../app/Frontend/pages/Sample/SampleModule.js | 40 +- afb-client/app/Frontend/services/ConfigApp.js | 35 -- afb-client/app/Frontend/services/JQueryEmu.js | 51 +- afb-client/app/Frontend/tmp/routes.js | 1 - .../app/Frontend/widgets/FormInput/FormInput.scss | 26 +- .../app/Frontend/widgets/FormInput/UploadFile.js | 113 ---- .../app/Frontend/widgets/FormInput/UploadFiles.js | 309 ++++++++++ .../Frontend/widgets/FormInput/newjavascript.js | 55 ++ .../widgets/Notifications/TokenRefreshSvc.js | 2 +- .../widgets/RangeSliders/RangeSliderMod.js | 631 +++++++++++++++++++++ .../Frontend/widgets/RangeSliders/Rangeslider.scss | 67 +++ afb-client/app/etc/AppDefaults.js | 2 + afb-client/bower.json | 8 +- afb-client/gulpfile.js | 2 +- 27 files changed, 1237 insertions(+), 221 deletions(-) create mode 100644 afb-client/app/Frontend/etc/ConfigApp.js create mode 100644 afb-client/app/Frontend/etc/routes.js create mode 100644 afb-client/app/Frontend/images/appli/isnotvalid.png create mode 100644 afb-client/app/Frontend/images/appli/istoobig.png create mode 100644 afb-client/app/Frontend/images/appli/upload-appli.png create mode 100644 afb-client/app/Frontend/images/audio/istoobig.png create mode 100644 afb-client/app/Frontend/images/audio/upload-music.png create mode 100644 afb-client/app/Frontend/images/avatars/istoobig.png delete mode 100644 afb-client/app/Frontend/services/ConfigApp.js delete mode 100644 afb-client/app/Frontend/tmp/routes.js delete mode 100644 afb-client/app/Frontend/widgets/FormInput/UploadFile.js create mode 100644 afb-client/app/Frontend/widgets/FormInput/UploadFiles.js create mode 100644 afb-client/app/Frontend/widgets/FormInput/newjavascript.js create mode 100644 afb-client/app/Frontend/widgets/RangeSliders/RangeSliderMod.js create mode 100644 afb-client/app/Frontend/widgets/RangeSliders/Rangeslider.scss diff --git a/afb-client/app/Backend/RestApis/PostMockApi.js b/afb-client/app/Backend/RestApis/PostMockApi.js index 6299f39..022f774 100644 --- a/afb-client/app/Backend/RestApis/PostMockApi.js +++ b/afb-client/app/Backend/RestApis/PostMockApi.js @@ -14,20 +14,36 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * References: https://github.com/expressjs/multer */ var fs = require('fs'); var multer = require('multer'); function NewApi(handle, prefix) { - var self=this; - handle.trace (this,1, "Mock PostApi url=%s", prefix +'/ping'); - var upload = multer({ dest: '/tmp/uploads/' }); + var scope=this; // make sure not to loose object context in async callback - handle.app.post(prefix +'/upload', upload.single('avatar'), function (req, res) { - handle.trace (self, 1, "%s/upload file=", prefix, req.file.originalname); - var upload = multer({ dest: '/tmp/uploads/' }); + // defined upload directory and check it's a valid one + var upload = multer({ dest: handle.config.UPLOAD_DIR}); + // WARNING: single('avatar') should match with + handle.app.post(prefix +'/upload-image', upload.single('avatar'), function (req, res) { + handle.trace (scope, 1, "%s/upload file=%s dest=%s/%s", prefix, req.file.originalname, req.file.destination, req.file.filename); + res.send({"jtype": "TEST_message", "status": "success", "info": "done"}); + }); + + // WARNING: single('music') should match with + handle.app.post(prefix +'/upload-music', upload.single('music'), function (req, res) { + + handle.trace (scope, 1, "%s/upload file=%s dest=%s/%s", prefix, req.file.originalname, req.file.destination, req.file.filename); + res.send({"jtype": "TEST_message", "status": "success", "info": "done"}); + }); + + // WARNING: single('appli') should match with + handle.app.post(prefix +'/upload-appli', upload.single('appli'), function (req, res) { + + handle.trace (scope, 1, "%s/upload file=%s dest=%s/%s", prefix, req.file.originalname, req.file.destination, req.file.filename); res.send({"jtype": "TEST_message", "status": "success", "info": "done"}); }); diff --git a/afb-client/app/Frontend/app.js b/afb-client/app/Frontend/app.js index e539062..5e99d77 100644 --- a/afb-client/app/Frontend/app.js +++ b/afb-client/app/Frontend/app.js @@ -18,9 +18,10 @@ 'JQueryEmu', 'HomeModule', 'SampleModule', - 'UploadFile', + 'UploadFiles', 'LinkButton', 'TokenRefresh', + 'RangeSlider', 'ModalNotification' ]) .config(config) @@ -28,8 +29,10 @@ ; config.$inject = ['$urlRouterProvider', '$locationProvider']; + + console.log ("***location=" + window.location + " search" + window.search) - function config($urlProvider, $locationProvider) { + function config($urlProvider, $locationProvider, ConfigApp) { $urlProvider.otherwise('/home'); // https://docs.angularjs.org/error/$location/nobase @@ -41,5 +44,5 @@ FastClick.attach(document.body); } -console.log ("@@APPNAME@@ Loaded"); +console.log ("opa=@@APPNAME@@ Loaded"); })(); diff --git a/afb-client/app/Frontend/etc/ConfigApp.js b/afb-client/app/Frontend/etc/ConfigApp.js new file mode 100644 index 0000000..22cf220 --- /dev/null +++ b/afb-client/app/Frontend/etc/ConfigApp.js @@ -0,0 +1,38 @@ +(function () { + 'use strict'; + + // _all modules only reference dependencies + angular.module('ConfigApp', []) + + // Factory is a singleton and share its context within all instances. + .factory('ConfigApp', function ($location, $window) { + + // console.log ("URL="+ $location.url() + " Query=" + location.href+ " window=" + document.referrer); + + var myConfig = { + paths: { // Warning paths should end with / + image : 'images/', + avatar: 'images/avatars/', + audio : 'images/audio/', + appli : 'images/appli/' + }, + + api: { // Warning paths should end with / + token : '/api/token/' + }, + + session: { // Those data are updated by session service + refresh : '/api/token/refresh', + ping : '/api/token/check', + initial : '123456789', // typical dev initial token + timeout : 3600, // timeout is updated client sessin context creation + pingrate: 60, // Ping rate to check if server is still alive + uuid : '', // uuid map with cookie or long term session access key + token : '' // will be returned from authentication + } + }; + + return myConfig; + }); + +})(); \ No newline at end of file diff --git a/afb-client/app/Frontend/etc/routes.js b/afb-client/app/Frontend/etc/routes.js new file mode 100644 index 0000000..c3c5ba4 --- /dev/null +++ b/afb-client/app/Frontend/etc/routes.js @@ -0,0 +1 @@ +var foundationRoutes = [{"name":"mysample","url":"/sample","controller":"SampleController as ctrl","animationIn":"slideInRight","path":"pages/Sample/Sample.html"},{"name":"myhome","url":"/home","controller":"HomeController as ctrl","animationIn":"slideInRight","path":"pages/Home/Home.html"}]; diff --git a/afb-client/app/Frontend/images/appli/isnotvalid.png b/afb-client/app/Frontend/images/appli/isnotvalid.png new file mode 100644 index 0000000..ee40d2a Binary files /dev/null and b/afb-client/app/Frontend/images/appli/isnotvalid.png differ diff --git a/afb-client/app/Frontend/images/appli/istoobig.png b/afb-client/app/Frontend/images/appli/istoobig.png new file mode 100644 index 0000000..5614073 Binary files /dev/null and b/afb-client/app/Frontend/images/appli/istoobig.png differ diff --git a/afb-client/app/Frontend/images/appli/upload-appli.png b/afb-client/app/Frontend/images/appli/upload-appli.png new file mode 100644 index 0000000..a35fd3a Binary files /dev/null and b/afb-client/app/Frontend/images/appli/upload-appli.png differ diff --git a/afb-client/app/Frontend/images/audio/istoobig.png b/afb-client/app/Frontend/images/audio/istoobig.png new file mode 100644 index 0000000..5614073 Binary files /dev/null and b/afb-client/app/Frontend/images/audio/istoobig.png differ diff --git a/afb-client/app/Frontend/images/audio/upload-music.png b/afb-client/app/Frontend/images/audio/upload-music.png new file mode 100644 index 0000000..2006ef0 Binary files /dev/null and b/afb-client/app/Frontend/images/audio/upload-music.png differ diff --git a/afb-client/app/Frontend/images/avatars/istoobig.png b/afb-client/app/Frontend/images/avatars/istoobig.png new file mode 100644 index 0000000..5614073 Binary files /dev/null and b/afb-client/app/Frontend/images/avatars/istoobig.png differ diff --git a/afb-client/app/Frontend/pages/Home/Home.html b/afb-client/app/Frontend/pages/Home/Home.html index 6eda66d..25bb983 100644 --- a/afb-client/app/Frontend/pages/Home/Home.html +++ b/afb-client/app/Frontend/pages/Home/Home.html @@ -1,5 +1,4 @@ - - + --- name: myhome url: /home @@ -31,6 +30,6 @@ animationIn: slideInRight
- + diff --git a/afb-client/app/Frontend/pages/Home/HomeModule.js b/afb-client/app/Frontend/pages/Home/HomeModule.js index 30e796e..6ebaefc 100644 --- a/afb-client/app/Frontend/pages/Home/HomeModule.js +++ b/afb-client/app/Frontend/pages/Home/HomeModule.js @@ -29,10 +29,10 @@ angular.module('HomeModule', ['SubmitButton', 'TokenRefresh']) // Make sure we clean everything when Open/Close is called if (apiname === "APIcreate" || apiname === "APIreset") { - scope["APIreset"]=''; - scope["APIcreate"]=''; - scope["APIrefresh"]=''; - scope["APIcheck"]=''; + scope.APIreset =''; + scope.APIcreate =''; + scope.APIrefresh=''; + scope.APIcheck =''; } scope[apiname]="success"; diff --git a/afb-client/app/Frontend/pages/Sample/Sample.html b/afb-client/app/Frontend/pages/Sample/Sample.html index e7e9164..35523a9 100644 --- a/afb-client/app/Frontend/pages/Sample/Sample.html +++ b/afb-client/app/Frontend/pages/Sample/Sample.html @@ -1,5 +1,4 @@ - - + --- name: mysample url: /sample @@ -8,16 +7,28 @@ animationIn: slideInRight ---

- Not Working + Post File Upload

- + + + - - - + + + + +
diff --git a/afb-client/app/Frontend/pages/Sample/SampleModule.js b/afb-client/app/Frontend/pages/Sample/SampleModule.js index 2a2e777..8ae82ea 100644 --- a/afb-client/app/Frontend/pages/Sample/SampleModule.js +++ b/afb-client/app/Frontend/pages/Sample/SampleModule.js @@ -2,46 +2,16 @@ 'use strict'; // list all rependencies within the page + controler if needed -angular.module('SampleModule', ['SubmitButton','UploadFile']) +angular.module('SampleModule', ['SubmitButton','UploadFiles']) .controller('SampleController', function ($http) { - var self = this; // I hate JavaScript - this.status='muted-off'; + var scope = this; // I hate JavaScript - console.log ("sample controller"); - - this.MuteOn = function() { - console.log ("Muted"); - // send AJAX request to server - var handler = $http.post('/api/dbus/ping', {type:'mute', action: "on"}); - - handler.success(function(response, errcode, headers, config) { - self.status = 'muted-on'; - }); - - handler.error(function(status, errcode, headers) { - console.log ("Oops /api/dbus/pring err=" + errcode); - self.status = 'muted-error'; - }); - }; + console.log ("sample Init"); - this.MuteOff = function() { - console.log ("UnMuted"); - // send AJAX request to server - var handler = $http.post('/api/dbus/ping', {type:'mute', action: "off"}); - - handler.success(function(response, errcode, headers, config) { - self.status = 'muted-off'; - }); - - handler.error(function(status, errcode, headers) { - console.log ("Oops /api/dbus/ping err=" + errcode); - self.status = 'muted-error'; - }); - + scope.FileUploaded = function (response) { + console.log ("FileUploaded response=%s", JSON.stringify(response)); }; - - }); console.log ("SampleControler Loaded"); diff --git a/afb-client/app/Frontend/services/ConfigApp.js b/afb-client/app/Frontend/services/ConfigApp.js deleted file mode 100644 index 310ef88..0000000 --- a/afb-client/app/Frontend/services/ConfigApp.js +++ /dev/null @@ -1,35 +0,0 @@ -(function () { - 'use strict'; - - // _all modules only reference dependencies - angular.module('ConfigApp', []) - - // Factory is a singleton and share its context within all instances. - .factory('ConfigApp', function () { - - - var myConfig = { - paths: { // Warning paths should end with / - images : 'images/', - avatars: 'images/avatars/' - }, - - api: { // Warning paths should end with / - token : '/api/token/' - }, - - session: { // Those data are updated by session service - refresh : '/api/token/refresh', - ping : '/api/token/check', - initial : '123456789', // typical dev initial token - timeout : 3600, // timeout is updated client sessin context creation - pingrate: 60, // Ping rate to check if server is still alive - uuid : '', // uuid map with cookie or long term session access key - token : '' // will be returned from authentication - } - }; - - return myConfig; - }); - -})(); \ No newline at end of file diff --git a/afb-client/app/Frontend/services/JQueryEmu.js b/afb-client/app/Frontend/services/JQueryEmu.js index 5112052..6d6e338 100644 --- a/afb-client/app/Frontend/services/JQueryEmu.js +++ b/afb-client/app/Frontend/services/JQueryEmu.js @@ -1,14 +1,39 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Usage: + * + * // mouse event probably point on icon and not on button div + * ... ng-click="LockChannel($event) + var target= angular.element(event.currentTarget); + var button= JQemu.FindInParent (target, 'div'); + * + */ + + (function () { 'use strict'; + + // _all modules only reference dependencies angular.module('JQueryEmu', []) // Factory is a singleton and share its context within all instances. .factory('JQemu', function () { - // JQueryLight cannot search a tag within ancestrors - var parent = function (element, selector) { + var FindInParent = function (element, selector) { var parent = element; var search = selector.toUpperCase(); while (parent[0]) { @@ -19,12 +44,23 @@ } }; - // JQueryLight cannot search by type - var findByType= function (element, selector) { + var FindByTag= function (element, tag, selector) { + var search = selector.toLowerCase(); + var type = tag.toLowerCase()+ "Name"; + var children = element.children(); + while (children[0]) { + if (search === children[0][type]) { + return children; + } // HTMLDivElement properties + children = children.next(); + } + }; + + var FindByClass= function (element, selector) { var search = selector.toLowerCase(); var children = element.children(); while (children[0]) { - if (search === children[0].type) { + if (children.hasClass(search)) { return children; } // HTMLDivElement properties children = children.next(); @@ -32,8 +68,9 @@ }; var myMethods = { - parent: parent, - findByType: findByType + FindInParent: FindInParent, + FindByTag: FindByTag, + FindByClass: FindByClass }; return myMethods; diff --git a/afb-client/app/Frontend/tmp/routes.js b/afb-client/app/Frontend/tmp/routes.js deleted file mode 100644 index c3c5ba4..0000000 --- a/afb-client/app/Frontend/tmp/routes.js +++ /dev/null @@ -1 +0,0 @@ -var foundationRoutes = [{"name":"mysample","url":"/sample","controller":"SampleController as ctrl","animationIn":"slideInRight","path":"pages/Sample/Sample.html"},{"name":"myhome","url":"/home","controller":"HomeController as ctrl","animationIn":"slideInRight","path":"pages/Home/Home.html"}]; diff --git a/afb-client/app/Frontend/widgets/FormInput/FormInput.scss b/afb-client/app/Frontend/widgets/FormInput/FormInput.scss index 37519fd..77aed6e 100644 --- a/afb-client/app/Frontend/widgets/FormInput/FormInput.scss +++ b/afb-client/app/Frontend/widgets/FormInput/FormInput.scss @@ -7,11 +7,33 @@ @import "app/ibz-mixins"; -upload-file { - height: 5rem; +.upload-file { display: inline-block; float: right; + height : 5rem; + width : 5rem; + margin: 0.5rem; + img { height: inherit;} + + .ibz-range-slider { + height: 10% !important; + border-radius: 5px; + background-color: lightgrey !important; + + .range-slider-handle { + width: 10% !important; + height: 100% !important; + margin-top: .2rem; + background-color: purple !important; + } + + .range-slider-active-segment { + height: 80% !important; + background-color: lightgreen; + } + } + } input-text { diff --git a/afb-client/app/Frontend/widgets/FormInput/UploadFile.js b/afb-client/app/Frontend/widgets/FormInput/UploadFile.js deleted file mode 100644 index 9a2f031..0000000 --- a/afb-client/app/Frontend/widgets/FormInput/UploadFile.js +++ /dev/null @@ -1,113 +0,0 @@ - -/* - * Copyright (C) 2015 "IoT.bzh" - * Author "Fulup Ar Foll" - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details.. - * - * Reference: - * https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications#Using_hidden_file_input_elements_using_the_click%28%29_method - * https://uncorkedstudios.com/blog/multipartformdata-file-upload-with-angularjs - * https://www.terlici.com/2015/05/16/uploading-files-locally.html - * https://github.com/nervgh/angular-file-upload/blob/master/src/services/FileUploader.js - */ - - -function changeInput() { - console.log ('input imgClicked'); -} - -(function() { -'use strict'; - -// WARNING: Angular ng-change does not work on input/file. Let's hook our callback through standard JS function -var tmpl = '
'+ - ''+ - ' ' + - '
' + - '' ; - -function basename(path) { - return path.split('/').reverse()[0]; -} - -angular.module('UploadFile',['ConfigApp']) - -.directive('uploadFile', function(ConfigApp, $http, JQemu) { - function mymethods(scope, elem, attrs) { - - // get widget image handle from template - scope.imgElem = elem.find('img'); - scope.inputElem = elem.find('input'); - scope.submitElem = JQemu.findByType (elem.children(), "submit"); - - - // Image was ckick let's simulate an input (file) click - scope.imgClicked = function () { - scope.inputElem[0].click(); // Warning Angular TriggerEvent does not work!!! - }; - - // upload file to server - scope.UpLoadFile= function(files) { - - - for (var i = 0; i < files.length; i++) { - var file = files[i]; - console.log ("Selected file=" + file.name + " size="+ file.size/1024); - var mimeType = /image.*/; // build regular expression from Mime - if (!file.type.match(mimeType)) { - continue; - } - - if (file.size > scope.sizemax*1024) { - scope.imagepath = scope.istoobig; // warning is path is wrong nothing happen - scope.$apply('imagepath'); // we short-circuit Angular resync Image - } else { - - scope.basename=basename(file.name); - scope.imgElem[0].file = file; - - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function (upload) { - scope.imagepath = upload.target.result; - scope.$apply('imagepath'); // we short-circuit Angular resync image - scope.submitElem[0].click(); // Warning Angular TriggerEvent does not work!!! - }; - } - } - }; - - // Initiallize default values from attributes values - if (attrs.icon) scope.imagepath= ConfigApp.paths[attrs.category] + attrs.icon; - else scope.imagepath=ConfigApp.paths.avatars + 'tux-bzh.png'; - - if (attrs.istoobig) scope.istoobig= ConfigApp.paths[attrs.category] + attrs.istoobig; - else scope.istoobig=ConfigApp.paths.avatars + 'istoobig.jpg'; - - scope.name= attrs.name || 'avatar'; - scope.mime= attrs.mime || 'image'; - scope.sizemax= attrs.sizemax || 100; // default max size 100KB - - } - - return { - restrict: 'E', - template: tmpl, - link: mymethods, - scope: { - callback : '=' - } - }; -}); - -console.log ("UploadFile Loaded"); -})(); diff --git a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js new file mode 100644 index 0000000..6c68960 --- /dev/null +++ b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js @@ -0,0 +1,309 @@ + +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details.. + * + * Reference: + * https://developer.mozilla.org/en/docs/Web/API/FileReader + * https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications#Using_hidden_file_input_elements_using_the_click%28%29_method + * https://uncorkedstudios.com/blog/multipartformdata-file-upload-with-angularjs + * https://www.terlici.com/2015/05/16/uploading-files-locally.html + * https://github.com/nervgh/angular-file-upload/blob/master/src/services/FileUploader.js + * https://stuk.github.io/jszip/documentation/howto/read_zip.html + * http://onehungrymind.com/zip-parsing-jszip-angular/ + */ + + +function changeInput() { + console.log ('input imgClicked'); +} + +(function() { +'use strict'; + +// WARNING: Angular ng-change does not work on input/file. Let's hook our callback through standard JS function +var tmpl = ''+ + '
' + + '' + + '' + + '
'; + + +function Basename(path) { + return path.split('/').reverse()[0]; +} + +// Service Create xform insert files in and Post it to url +function LoadFileSvc (scope, elem, posturl, files, thumbnailCB) { + var xmlReq = new XMLHttpRequest(); + var xform = new FormData(); + + // Update slider during Upload + xmlReq.upload.onprogress = function (event) { + var progress = Math.round(event.lengthComputable ? event.loaded * 100 / event.total : 0); + if (scope.slider) scope.slider.setValue (progress); + }; + + // Upload is finish let's notify controler callback + xmlReq.onload = function () { + elem.addClass ("success"); + var response ={ + status : xmlReq.status, + headers: xmlReq.getAllResponseHeaders() + }; + scope.callback (response); + }; + + xmlReq.onerror = function () { + elem.addClass ("error fail"); + var response ={ + status : xmlReq.status, + headers: xmlReq.getAllResponseHeaders() + }; + scope.callback (response); + }; + + xmlReq.onabort = function () { + elem.addClass ("error abort"); + var response ={ + status : xmlReq.status, + headers: xmlReq.getAllResponseHeaders() + }; + scope.callback (response); + }; + + for (var i = 0; i < files.length; i++) { + var file = files[i]; + if (!file.type.match(scope.mimetype)) { + continue; + } + + console.log ("Selected file=" + file.name + " size="+ file.size/1024 + " Type="+ file.type); + + // File to upload is too big + if (file.size > scope.maxsize*1024) { + scope.thumbnail = scope.istoobig; // warning if image path is wrong nothing happen + scope.$apply('thumbnail'); // we short-circuit Angular resync Image + return; + } + + // This is not an uploadable file + if(isNaN(file.size)) { + scope.thumbnail = scope.isnotvalid; + scope.$apply('thumbnail'); + return; + } + + scope.Basename=Basename(file.name); + scope.imgElem[0].file = file; + + // If File is an image let display it now + if (thumbnailCB) { + var reader = new FileReader(); + reader.readAsArrayBuffer(file); + reader.onload = thumbnailCB; + } + + // if everything is OK let's add file to xform + xform.append(scope.name, file, file.name); + } + + + // everything looks OK let's Post it + xmlReq.open("POST", posturl , true); + xmlReq.send(xform); +}; + +angular.module('UploadFiles',['ConfigApp', 'ModalNotification', 'RangeSlider']) + +.directive('uploadImage', function(ConfigApp, JQemu, Notification) { + function mymethods(scope, elem, attrs) { + + // get widget image handle from template + scope.imgElem = elem.find('img'); + scope.inputElem = elem.find('input'); + + // Image was ckick let's simulate an input (file) click + scope.imgClicked = function () { + scope.inputElem[0].click(); // Warning Angular TriggerEvent does not work!!! + }; + + // Slider control handle registration after creation + scope.SliderInitCB=function (slider) { + scope.slider= slider; + }; + + // Upload is delegated to a shared function + scope.UpLoadFile=function (files) { + var readerCB = function (upload) { + // scope.thumbnail = upload.target.result; + scope.imgElem[0].src = window.URL.createObjectURL(new Blob([upload.target.result], {type: "image"})); + scope.$apply('thumbnail'); // we short-circuit Angular resync image + }; + var posturl = attrs.posturl + "?token=" + ConfigApp.session.token; + LoadFileSvc (scope, elem, posturl, files, readerCB); + }; + + // Initiallize default values from attributes values + scope.name= attrs.name || 'avatar'; + scope.category= attrs.category || 'image'; + scope.mimetype= (attrs.accept || 'image') + '/*'; + scope.maxsize= attrs.maxsize || 100; // default max size 100KB + scope.regexp = new RegExp (attrs.accept+ '.*','i'); + + if (attrs.thumbnail) scope.thumbnail= ConfigApp.paths[scope.category] + attrs.thumbnail; + else scope.thumbnail=ConfigApp.paths[scope.category] + 'tux-bzh.png'; + + if (attrs.thumbnail) scope.isnotvalid= ConfigApp.paths[scope.category] + attrs.isnotvalid; + else scope.isnotvalid=ConfigApp.paths[scope.category] + 'isnotvalid.png'; + + if (attrs.istoobig) scope.istoobig= ConfigApp.paths[scope.category] + attrs.istoobig; + else scope.istoobig=ConfigApp.paths[scope.category] + 'istoobig.png'; + scope.noslider = attrs.noslider || false; + + if (!attrs.posturl) throw new TypeError('file-upload %s posturl=/api/xxxx/xxxx required', scope.attrs); + } + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: { + callback : '=' + } + }; +}) + +.directive('uploadAudio', function(ConfigApp, JQemu, Notification) { + function mymethods(scope, elem, attrs) { + + // get widget image handle from template + scope.imgElem = elem.find('img'); + scope.inputElem = elem.find('input'); + + // Image was ckick let's simulate an input (file) click + scope.imgClicked = function () { + scope.inputElem[0].click(); // Warning Angular TriggerEvent does not work!!! + }; + + // Slider control handle registration after creation + scope.SliderInitCB=function (slider) { + scope.slider= slider; + }; + + // Upload is delegated to a shared function + scope.UpLoadFile=function (files) { + var posturl = attrs.posturl + "?token=" + ConfigApp.session.token; + LoadFileSvc (scope, elem, posturl, files, false); + }; + + // Initiallize default values from attributes values + scope.name= attrs.name || 'audio'; + scope.category= attrs.category || 'audio'; + scope.mimetype= (attrs.accept || 'audio') + '/*'; + scope.maxsize= attrs.maxsize || 10000; // default max size 10MB + scope.regexp = new RegExp (attrs.accept+ '.*','i'); + + if (attrs.thumbnail) scope.thumbnail= ConfigApp.paths[scope.category] + attrs.thumbnail; + else scope.thumbnail=ConfigApp.paths[scope.category] + 'upload-music.png'; + + if (attrs.thumbnail) scope.isnotvalid= ConfigApp.paths[scope.category] + attrs.isnotvalid; + else scope.isnotvalid=ConfigApp.paths[scope.category] + 'isnotvalid.png'; + + if (attrs.istoobig) scope.istoobig= ConfigApp.paths[scope.category] + attrs.istoobig; + else scope.istoobig=ConfigApp.paths[scope.category] + 'istoobig.png'; + scope.noslider = attrs.noslider || false; + + if (!attrs.posturl) throw new TypeError('file-upload %s posturl=/api/xxxx/xxxx required', scope.attrs); + } + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: { + callback : '=' + } + }; + +}) + +.directive('uploadAppli', function(ConfigApp, JQemu, Notification) { + function mymethods(scope, elem, attrs) { + + // get widget image handle from template + scope.imgElem = elem.find('img'); + scope.inputElem = elem.find('input'); + + // Image was ckick let's simulate an input (file) click + scope.imgClicked = function () { + scope.inputElem[0].click(); // Warning Angular TriggerEvent does not work!!! + }; + + // Slider control handle registration after creation + scope.SliderInitCB=function (slider) { + scope.slider= slider; + }; + + // Upload is delegated to a shared function + scope.UpLoadFile=function (files) { + + var readerCB = function (upload) { + var zipapp = new JSZip(upload.target.result); + var thumbnail = zipapp.file("afa-pkg/thumbnail.jpg"); + + // Check is we have a thumbnail within loaded Zipfile + if (!thumbnail) { + console.log ("This is not a valid Application Framework APP"); + scope.thumbnail=ConfigApp.paths[scope.category] + 'isnotvalid.png'; + scope.$apply('thumbnail'); // we short-circuit Angular resync image + return; + } + scope.imgElem[0].src = window.URL.createObjectURL(new Blob([thumbnail.asArrayBuffer()], {type: "image"})); + scope.$apply('thumbnail'); // we short-circuit Angular resync image + }; + + var posturl = attrs.posturl + "?token=" + ConfigApp.session.token; + LoadFileSvc (scope, elem, posturl, files, readerCB); + }; + + // Initiallize default values from attributes values + scope.name= attrs.name || 'appli'; + scope.category= attrs.category || 'appli'; + scope.mimetype= (attrs.accept || '.zip'); + scope.maxsize= attrs.maxsize || 100000; // default max size 100MB + scope.regexp = new RegExp (attrs.accept+ '.*','i'); + + if (attrs.thumbnail) scope.thumbnail= ConfigApp.paths[scope.category] + attrs.thumbnail; + else scope.thumbnail=ConfigApp.paths[scope.category] + 'upload-appli.png'; + + if (attrs.thumbnail) scope.isnotvalid= ConfigApp.paths[scope.category] + attrs.isnotvalid; + else scope.isnotvalid=ConfigApp.paths[scope.category] + 'isnotvalid.png'; + + if (attrs.istoobig) scope.istoobig= ConfigApp.paths[scope.category] + attrs.istoobig; + else scope.istoobig=ConfigApp.paths[scope.category] + 'istoobig.png'; + scope.noslider = attrs.noslider || false; + + if (!attrs.posturl) throw new TypeError('file-upload %s posturl=/api/xxxx/xxxx required', scope.attrs); + } + return { + restrict: 'E', + template: tmpl, + link: mymethods, + scope: { + callback : '=' + } + }; + +}); + +console.log ("UploadFile Loaded"); +})(); diff --git a/afb-client/app/Frontend/widgets/FormInput/newjavascript.js b/afb-client/app/Frontend/widgets/FormInput/newjavascript.js new file mode 100644 index 0000000..10280c7 --- /dev/null +++ b/afb-client/app/Frontend/widgets/FormInput/newjavascript.js @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2015 fulup + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + var reader = new FileReader(); + // Closure to capture the file information. + reader.onload = (function(theFile) { + return function(e) { + var $title = $("

", { + text : theFile.name + }); + $result.append($title); + var $fileContent = $("
    "); + try { + + var dateBefore = new Date(); + // read the content of the file with JSZip + var zip = new JSZip(e.target.result); + var dateAfter = new Date(); + + $title.append($("", { + text:" (parsed in " + (dateAfter - dateBefore) + "ms)" + })); + + // that, or a good ol' for(var entryName in zip.files) + $.each(zip.files, function (index, zipEntry) { + $fileContent.append($("
  • ", { + text : zipEntry.name + })); + // the content is here : zipEntry.asText() + }); + // end of the magic ! + + } catch(e) { + $fileContent = $("
    ", { + "class" : "alert alert-danger", + text : "Error reading " + theFile.name + " : " + e.message + }); + } + $result.append($fileContent); + } + })(f); \ No newline at end of file diff --git a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js index 2b1e9db..0d1cf38 100644 --- a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js +++ b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js @@ -32,7 +32,7 @@ // scope module is load statically before any route is cativated -angular.module('TokenRefresh', []) +angular.module('TokenRefresh', ['ConfigApp', 'ModalNotification']) .directive ('tokenRefresh', function($timeout, $http, $location, Notification, ConfigApp) { diff --git a/afb-client/app/Frontend/widgets/RangeSliders/RangeSliderMod.js b/afb-client/app/Frontend/widgets/RangeSliders/RangeSliderMod.js new file mode 100644 index 0000000..77f0fce --- /dev/null +++ b/afb-client/app/Frontend/widgets/RangeSliders/RangeSliderMod.js @@ -0,0 +1,631 @@ +/* + * Copyright (C) 2015 "IoT.bzh" + * Author "Fulup Ar Foll" + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Bugs: Input with Callback SHOULD BE get 'required' class + * + * ref: https://developer.mozilla.org/en-US/docs/Web/Events/mouseover + * + * usage: +Usage +--------------------- + + class="radius" // check Zurb foundation doc for further info. + class="ibz-handle-display" // increase handle width to hold slider current value + + + callback="myCallBack" // $scope.myCallBack(sliderhandle) is called when ever slider handle blur + formatter="SliderFormatCB" // $scope.myFormatter(value, sliderid) when exist is call when ever slider handle moves. Should return external form of slider value. + ng-model="xxxxxx" // xxx Must be defined, script will store a new RangerObject within provided ng-model variable. + start-at="ScopeVar" // Dynamic limitation when slider is constrains by an external componant [ex: check in/out] + stop-at="ScopeVar" // Idem but for end. + + + not-less="integer" // Fixed starting value for slider [default 0] + not-more="integer" // Fixed end value for sliders [default 100] + by-step="+-integer" // If by-step is >0 then slider use it as step-value, when negative use it for decimal precision + display-target="handle" // display slider external formated value in the handle [requirer calss="ibz-handle-display"] + dual-handles='true' // add a second handle to slider for min/max range + initial='value|[start/stop]' // slider initial value [dual-handles] may have initial values + /> + */ + +(function () { + 'use strict'; + +var RangeSlider = angular.module('RangeSlider',[]); + +function RangeSliderHandle (scope) { + var internals = []; + var externals = []; + + this.getId = function() { + return scope.sliderid; + }; + + this.getCbHandle = function() { + return scope.cbhandle; + }; + + this.getView= function (handle) { + if (!handle) handle = 0; + + // if value did not change return current external representation + if (scope.value[handle] === internals[handle]) return externals[handle]; + + // build external representation and save it for further requests + internals[handle] = scope.value[handle]; + if (scope.formatter) externals[handle] = scope.formatter(scope.value[handle], scope.ctrlhandle); + else externals[handle] = scope.value[handle]; + + return externals[handle]; + }; + + this.updateClass = function (classe, status) { + scope.updateClass (classe, status); + }; + + this.forceRefresh = function (timer) { + scope.forceRefresh(timer); + }; + + this.getValue= function (handle) { + if (!handle) handle = 0; + return scope.value[handle]; + }; + + this.getRelative= function (handle) { + if (!handle) handle = 0; + return scope.relative[handle]; + }; + + this.setValue= function (value, handle) { + if (!handle) handle = 0; + scope.setValue (value, handle); + }; + + this.setDisable= function (flag) { + scope.setDisable(flag); + }; +} + +RangeSlider.directive('rangeSlider', function ($log, $document, $timeout) { + + var template= '
    '+ + ''+ + ''+ + ''+ + ' '+ + ' '+ + ''+ + '
    '; + + + function link (scope, element, attrs, model) { + // full initialisation of slider from a single object + scope.initWidget = function (initvalues) { + + if (initvalues.byStep) scope.byStep = parseInt(initvalues.byStep); + if (initvalues.notMore) scope.notMore = parseInt(initvalues.notMore); + if (initvalues.notLess) scope.notLess = parseInt(initvalues.notLess); + if (initvalues.id) scope.sliderid= initvalues.id; + + // hugely but in some case DOM is not finish when we try to set values !!! + if (initvalues.value !== undefined) { + scope.value = initvalues.value; + scope.forceRefresh (50); // wait 50ms for DOM to be ready + } + }; + + // this function recompute slide positioning + scope.forceRefresh = function (timer) { + var value = scope.value; + scope.value = [undefined,undefined]; + $timeout (function() { + scope.setValue(value[0],0); + if (scope.dual) scope.setValue(value[1],1); + }, timer); + }; + + // handler to change class from slider handle + scope.updateClass = function (classe, status) { + + if (status) element.addClass (classe); + else element.removeClass (classe); + }; + + scope.setDisable = function (disabled) { + + if (disabled) { + element.addClass ("disable"); + scope.handles[0].css ('visibility','hidden'); + if (scope.dual) { + scope.handles[1].css ('visibility','hidden'); + } + } else { + element.removeClass ("disable"); + scope.handles[0].css ('visibility','visible'); + if (scope.dual) scope.handles[1].css ('visibility','visible'); + } + + }; + + scope.normalize = function (value) { + var result; + var range = scope.notMore - scope.notLess; + var point = value * range; + + // if step is positive let's round step by step + if (scope.byStep > 0) { + var mod = (point - (point % scope.byStep)) / scope.byStep; + var rem = point % scope.byStep; + + var round = (rem >= scope.byStep * 0.5 ? scope.byStep : 0); + result= (mod * scope.byStep + round) + scope.notLess; + //console.log ("range=%d value=%d point=%d mod=%d rem=%d round=%d result=%d", range, value, point, mod, rem, round, result) + return result; + } + + // if step is negative return round to asked decimal + if (scope.byStep < 0) { + var power = Math.pow (10,(scope.byStep * -1)); + result = scope.notLess + parseInt (point * power) / power; + return (result); + } + + // if step is null return full value + return point; + }; + + // return current value + scope.getValue = function (offset, handle) { + if (scope.vertical) { + scope.relative[handle] = (offset - scope.bounds.handles[handle].getBoundingClientRect().height) / (scope.bounds.bar.getBoundingClientRect().height - scope.bounds.handles[handle].getBoundingClientRect().height); + } else { + scope.relative[handle] = offset / (scope.bounds.bar.getBoundingClientRect().width - scope.bounds.handles[handle].getBoundingClientRect().width); + } + + var newvalue = scope.normalize (scope.relative[handle]); + + + // if internal value change update or model + if (newvalue !== scope.value[handle]) { + if (newvalue < scope.startValue) newvalue=scope.startValue; + if (newvalue > scope.stopValue) newvalue=scope.stopValue; + + + if (scope.formatter) { + scope.viewValue = scope.formatter (newvalue, scope.ctrlhandle); + } else { + scope.viewValue = newvalue; + } + if (scope.displays[handle]) { + scope.displays[handle].html (scope.viewValue); + } + + // update external representation of the model + scope.value[handle] = newvalue; + if (model) model.$setViewValue (scope.viewValue); + scope.$apply(); + if (newvalue > scope.startValue && newvalue < scope.stopValue) scope.translate(offset, handle); + } + }; + + + scope.setStart = function (value) { + var offset; + + if (value > scope.value[0]) { + if (!scope.dual) scope.setValue (value,0); + else scope.setValue (value,1); + } + + if (scope.vertical) { + offset = scope.bounds.bar.getBoundingClientRect().height * (value - scope.notLess) / (scope.notMore - scope.notLess); + scope.start.css('height',offset + 'px'); + } else { + offset = scope.bounds.bar.getBoundingClientRect().width * (value - scope.notLess) / (scope.notMore - scope.notLess); + scope.start.css('width',offset + 'px'); + } + + scope.startValue= value; + }; + + scope.setStop = function (value) { + var offset; + + if (value < scope.value[0]) { + if (!scope.dual) scope.setValue (value,0); + else scope.setValue (value,1); + } + + if (scope.vertical) { + offset = scope.bounds.bar.getBoundingClientRect().height * (value - scope.notLess) / (scope.notMore - scope.notLess); + scope.start.css('height',offset + 'px'); + } else { + offset = scope.bounds.bar.getBoundingClientRect().width * (value - scope.notLess) / (scope.notMore - scope.notLess); + scope.stop.css({'right': 0, 'width': (scope.bounds.bar.getBoundingClientRect().width - offset) + 'px'}); + } + + scope.stopValue= value; + }; + + scope.translate = function (offset, handle) { + var start; + + if (scope.vertical) { + // take handle size in account to compute middle + var voffset = scope.bounds.bar.getBoundingClientRect().height - offset; + + scope.handles[handle].css({ + '-webkit-transform': 'translateY(' + voffset + 'px)', + '-moz-transform': 'translateY(' + voffset + 'px)', + '-ms-transform': 'translateY(' + voffset + 'px)', + '-o-transform': 'translateY(' + voffset + 'px)', + 'transform': 'translateY(' + voffset + 'px)' + }); + if (!scope.dual) scope.slider.css('height', offset + 'px'); + else if (scope.relative[1] && scope.relative[0]) { + var height = (scope.relative[1] - scope.relative[0]) * scope.bounds.bar.getBoundingClientRect().height; + start = (scope.relative[0] * scope.bounds.bar.getBoundingClientRect().height); + scope.slider.css ({'bottom': start+'px','height': height + 'px'}); + } + } else { + + scope.handles[handle].css({ + '-webkit-transform': 'translateX(' + offset + 'px)', + '-moz-transform': 'translateX(' + offset + 'px)', + '-ms-transform': 'translateX(' + offset + 'px)', + '-o-transform': 'translateX(' + offset + 'px)', + 'transform': 'translateX(' + offset + 'px)' + }); + if (!scope.dual) scope.slider.css('width',offset + 'px'); + else if (scope.relative[1] && scope.relative[0]) { + var width = (scope.relative[1] - scope.relative[0]) * scope.bounds.bar.getBoundingClientRect().width; + start = (scope.relative[0] * scope.bounds.bar.getBoundingClientRect().width); + scope.slider.css ({'left': start+'px','width': width + 'px'}); + } + } + }; + + // position handle on the bar depending a given value + scope.setValue = function (value , handle) { + var offset; + + // if value did not change ignore + if (value === scope.value[handle]) return; + if (value === undefined) value=0; + if (value > scope.notMore) value=scope.notMore; + if (value < scope.notLess) value=scope.notLess; + + if (scope.vertical) { + scope.relative[handle] = (value - scope.notLess) / (scope.notMore - scope.notLess); + if (handle === 0) offset = (scope.relative[handle] * scope.bounds.bar.getBoundingClientRect().height) + scope.bounds.handles[handle].getBoundingClientRect().height/2; + if (handle === 1) offset = scope.relative[handle] * scope.bounds.bar.getBoundingClientRect().height; + + } else { + scope.relative[handle] = (value - scope.notLess) / (scope.notMore - scope.notLess); + offset = scope.relative[handle] * (scope.bounds.bar.getBoundingClientRect().width - scope.bounds.handles[handle].getBoundingClientRect().width); + } + + scope.translate (offset,handle); + scope.value[handle] = value; + + if (scope.formatter) { + // when call through setValue we do not pass cbHandle + scope.viewValue = scope.formatter (value, undefined); + } else { + scope.viewValue = value; + } + + if (model) model.$setViewValue( scope.viewValue); + + if (scope.displays[handle]) { + scope.displays[handle].html (scope.viewValue); + } + }; + + + // Minimal keystroke handling to close picker with ESC [scope.actif is current handle index] + scope.keydown= function(e){ + + switch(e.keyCode){ + case 39: // Right + case 38: // up + if (scope.byStep > 0) scope.$apply(scope.setValue ((scope.value[scope.actif]+scope.byStep), scope.actif)); + if (scope.byStep < 0) scope.$apply(scope.setValue ((scope.value[scope.actif]+(1 / Math.pow(10, scope.byStep*-1))),scope.actif)); + if (scope.callback) scope.callback (scope.value[scope.actif], scope.ctrlhandle); + break; + case 37: // left + case 40: // down + if (scope.byStep > 0) scope.$apply(scope.setValue ((scope.value[scope.actif] - scope.byStep), scope.actif)); + if (scope.byStep < 0) scope.$apply(scope.setValue ((scope.value[scope.actif] - (1 / Math.pow(10, scope.byStep*-1))),scope.actif)); + if (scope.callback) scope.callback (scope.value[scope.actif], scope.ctrlhandle); + break; + case 27: // esc + scope.handles[scope.actif][0].blur(); + } + }; + + scope.moveHandle = function (handle, clientX, clientY) { + var offset; + if (scope.vertical) { + offset = scope.bounds.bar.getBoundingClientRect().bottom - clientY; + if (offset > scope.bounds.bar.getBoundingClientRect().height) offset = scope.bounds.bar.getBoundingClientRect().height; + if (offset < scope.bounds.handles[handle].getBoundingClientRect().height) offset = scope.bounds.handles[handle].getBoundingClientRect().height; + } else { + offset = clientX - scope.bounds.bar.getBoundingClientRect().left; + + if (offset < 0) offset = 0; + if ((clientX + scope.bounds.handles[handle].getBoundingClientRect().width) > scope.bounds.bar.getBoundingClientRect().right) { + offset = scope.bounds.bar.getBoundingClientRect().width - scope.bounds.handles[handle].getBoundingClientRect().width; + } + } + + scope.getValue (offset, handle); + + // prevent dual handle to cross + if (scope.dual && scope.value [0] > scope.value[1]) { + if (handle === 0) scope.setValue (scope.value[0] , 1); + else scope.setValue(scope.value[1],0); + } + }; + + + scope.focusCB = function (inside) { + if (inside) { + $document.on('keydown',scope.keydown); + } else { + $document.unbind('keydown',scope.keydown); + } + }; + + // bar was touch let move handle to this point + scope.touchBarCB = function (event) { + var handle=0; + var relative; + var touches = event.changedTouches; + var oldvalue = scope.value[handle]; + + event.preventDefault(); + + // if we have two handles select closest one from touch point + if (scope.dual) { + if (scope.vertical) relative = (touches[0].pageY - scope.bounds.bar.getBoundingClientRect().bottom) / scope.bounds.bar.getBoundingClientRect().height; + else relative= (touches[0].pageX - scope.bounds.bar.getBoundingClientRect().left) / scope.bounds.bar.getBoundingClientRect().width; + + var distance0 = Math.abs(relative - scope.relative[0]); + var distance1 = Math.abs(relative - scope.relative[1]); + if (distance1 < distance0) handle=1; + } + + // move handle to new place + scope.moveHandle (handle,touches[0].pageX, touches[0].pageY); + if (scope.callback && oldvalue !== scope.value[handle]) scope.callback (scope.value[handle], scope.ctrlhandle); + }; + + // handle was touch and drag + scope.touchHandleCB = function (touchevt, handle) { + var oldvalue = scope.value[handle]; + + touchevt.preventDefault(); + $document.on('touchmove',touchmove); + $document.on('touchend' ,touchend); + element.unbind('touchstart', scope.touchBarCB); + + function touchmove(event) { + event.preventDefault(); + var touches = event.changedTouches; + for (var idx = 0; idx < touches.length; idx++) { + scope.moveHandle (handle,touches[idx].pageX, touches[idx].pageY); + } + } + + function touchend(event) { + $document.unbind('touchmove',touchmove); + $document.unbind('touchend' ,touchend); + element.on('touchstart', scope.touchBarCB); + + // if value change notify application callback + if (scope.callback && oldvalue !== scope.value[handle]) scope.callback (scope.value[handle], scope.ctrlhandle); + } + }; + + scope.handleCB = function (clickevent, handle) { + + if (attrs.automatic) return; + + var oldvalue = scope.value[handle]; + // register mouse event to track handle + clickevent.preventDefault(); + + $document.on('mousemove',mousemove); + $document.on('mouseup', mouseup); + scope.handles[handle][0].focus(); + scope.actif=handle; + + // slider handle is moving + function mousemove(event) { + scope.moveHandle (handle, event.clientX, event.clientY); + } + + // mouse is up dans leave slider send resize events + function mouseup() { + $document.unbind('mousemove', mousemove); + $document.unbind('mouseup', mouseup); + + // if value change notify application callback + if (scope.callback && oldvalue !== scope.value[handle]) scope.callback (scope.value[handle], scope.ctrlhandle); + } + }; + + // simulate jquery find by classes capabilities [warning only return 1st elements] + scope.find = function (select, elem) { + var domelem; + + if (elem) domelem = elem[0].querySelector(select); + else domelem = element[0].querySelector(select); + + var angelem = angular.element(domelem); + return (angelem); + }; + + + + scope.initialSettings = function (initial) { + var decimal_places_match_result; + scope.value=[]; // store low/height value when two handles + scope.relative=[]; + + if (scope.precision === null) { + decimal_places_match_result = ('' + scope.byStep).match(/\.([\d]*)/); + scope.precision = decimal_places_match_result && decimal_places_match_result[1] ? decimal_places_match_result[1].length : 0; + } + + // position handle to initial value(s) + element.on('touchstart', scope.touchBarCB); + scope.handles[0].on('touchstart', function(evt){scope.touchHandleCB(evt,0);}); + + // this slider has two handles low/hight + if (scope.dual) { + scope.handles[1].addClass('range-slider-handle'); + scope.handles[1].on('touchstart', function(evt){scope.touchHandleCB(evt,1);}); + if (!scope.initvalues) scope.setValue (initial[1],1); + } + + // if we have an initstate object apply it + if (scope.initvalues) scope.initWidget (scope.initvalues); + else scope.setValue (initial[0],0); + }; + + scope.init = function () { + scope.sliderid = attrs.id || "slider-" + parseInt (Math.random() * 1000); + scope.startValue = -Infinity; + scope.stopValue = Infinity; + scope.byStep = parseInt(attrs.byStep) || 1; + scope.vertical = attrs.vertical || false; + scope.dual = attrs.dualHandles|| false; + scope.trigger_input_change= false; + scope.notMore = parseInt(attrs.notMore) || 100; + scope.notLess = parseInt(attrs.notLess) || 0; + + if (scope.vertical) element.addClass("vertical-range"); + + scope.handles= [scope.find('.handle-min'), scope.find('.handle-max')]; + scope.bar = element; + scope.slider = scope.find('.range-slider-active-segment'); + scope.start = scope.find('.ibz-range-slider-start'); + scope.stop = scope.find('.ibz-range-slider-stop'); + scope.disable= attrs.disable || false; + + scope.ctrlhandle = new RangeSliderHandle (scope); + + // prepare DOM object pointer to compute size dynamically + scope.bounds = { + bar : element[0], + handles: [scope.handles[0][0], scope.handles[1][0]] + }; + + if (attrs.disable === 'true') scope.setDisable(true); + + if (attrs.displayTarget) { + switch (attrs.displayTarget) { + case true : + case 'handle' : + scope.displays = scope.handles; + scope.handles[0].addClass('ibz-range-slider-display'); + if (scope.dual) scope.handles[1].addClass('ibz-range-slider-display'); + break; + default: + scope.displays = [$document.getElementById (attrs.displayTarget)]; + } + } else scope.displays=[]; + + // extract initial values from attrs and parse into int + if (!attrs.initial) { + scope.initial = [scope.ngModel, scope.ngModel]; // initialize to model values + } else { + var initial = attrs.initial.split(','); + scope.initial = [ + initial[0] !== undefined ? parseInt (initial[0]) : scope.notLess, + initial[1] !== undefined ? parseInt (initial[1]) : scope.notMore + ]; + } + + // Monitor any changes on start/stop dates. + scope.$watch('startAt', function() { + if (scope.value < scope.startAt ) { + //scope.setValue (scope.startAt); + } + if (scope.startAt) scope.setStart (scope.startAt); + }); + + scope.$watch('stopAt' , function() { + if (scope.value > scope.stopAt) { + //scope.setValue (scope.stopAt); + } + if (scope.stopAt) scope.setStop (scope.stopAt); + }); + + // finish widget initialisation + scope.initialSettings (scope.initial); + + }; + + scope.init(); + + // slider is ready provide control handle to application controller + scope.$watch ('inithook', function () { // init Values may arrive late + if (scope.inithook) scope.inithook (scope.ctrlhandle); + }); + + scope.$watch ('initvalues', function () { // init Values may arrive late + if (scope.initvalues) scope.initWidget(scope.initvalues); + }); + + // two-way binding if model value changes + scope.$watch ('ngModel', function (newValue) { + scope.setValue(newValue, 0); + }); + } + +return { + restrict: "E", // restrict to HTML element name + scope: { + startAt :'=', // First acceptable date + stopAt :'=', // Last acceptable date + callback :'=', // Callback to actif when a date is selected + formatter:'=', // Callback for drag event call each time internal value changes + inithook :'=', // Hook point to control slider from API + cbhandle :'=', // Argument added to every callback + initvalues:'=', // Initial values as a single object + ngModel: '=' // the model value + }, + require: '?ngModel', + template: template, // html template is build from JS + replace: true, // replace current directive with template while inheriting of class + link: link // pickadate object's methods +}; +}); + +console.log ("RangeSlider Loaded"); + +})(); \ No newline at end of file diff --git a/afb-client/app/Frontend/widgets/RangeSliders/Rangeslider.scss b/afb-client/app/Frontend/widgets/RangeSliders/Rangeslider.scss new file mode 100644 index 0000000..6717d0e --- /dev/null +++ b/afb-client/app/Frontend/widgets/RangeSliders/Rangeslider.scss @@ -0,0 +1,67 @@ +/* + * ibz-Datepicker for Foundation + * + * Author: Fulup Ar Foll + * Date : March-2015 + * Object: SASS stylesheet, customized to Foundation + * References: https://css-tricks.com/stripes-css/ + * + */ +@import "app/ibz-mixins"; + +.range-slider-handle { + display: inline-block; + position: absolute; + z-index: 1; + top: -0.2rem; + width: 2rem; + height: 1.375rem; + border: 1px solid none; + cursor: pointer; + background: #008cba; +} + +.range-slider.radius, .range-slider-handle { + background: #008cba; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.range-slider-active-segment { + display: inline-block; + top: 0.07rem; + position: absolute; + height: 0.80rem; + background: #e5e5e5; +} + +.ibz-range-slider { + background-color: rgba(154, 205, 50, 0.6) !important; + height: 1rem; + position: relative; + + .range-slider-active-segment { + background-color: rgba(82, 168, 200, 0.6); + } + + &-display { + background-color: rgba(82, 168, 200, 0.6) !important; + width : 4rem !important; + padding: .25rem; + text-align:center + } + + &-start,&-stop { + display: inline-block; + position: absolute; + padding-top: 2px; + height: 95%; + background: repeating-linear-gradient( + 45deg, + #606dbc, + #606dbc 10px, + #465298 10px, + #465298 20px + );} + +} diff --git a/afb-client/app/etc/AppDefaults.js b/afb-client/app/etc/AppDefaults.js index 7b5326a..b0eb1a8 100644 --- a/afb-client/app/etc/AppDefaults.js +++ b/afb-client/app/etc/AppDefaults.js @@ -29,6 +29,8 @@ config = { DEBUG : 4001, // Node Debug Port DBG_LVL : 5, // Debug Trace Level 0=no trace. + UPLOAD_DIR: '/tmp/uploads', // directory destination for uploaded files [/api/post/upload] + // EXPRESS WEB server config [note: URLBASE generate rewriting rules] EXPRESS_HOST : 'localhost', // HTTP will only listen on related Internet interface EXPRESS_PORT : 4000, // HTTP port diff --git a/afb-client/bower.json b/afb-client/bower.json index 84dbe1e..c78c624 100644 --- a/afb-client/bower.json +++ b/afb-client/bower.json @@ -8,11 +8,15 @@ "angular-cookies": "~1.3.4", "foundation-apps": "~1.1.0", "angular-ui-notification": "~0.0.14", - "foundation-icon-fonts": "*" + "foundation-icon-fonts": "*", + "jszip": "Stuk/jszip#~2.5.0" }, "overrides": { "foundation": { - "main": ["dist/js/foundation-apps-templates.js", "dist/js/foundation-apps.js"] + "main": [ + "dist/js/foundation-apps-templates.js", + "dist/js/foundation-apps.js" + ] } } } diff --git a/afb-client/gulpfile.js b/afb-client/gulpfile.js index f483431..3ec8774 100644 --- a/afb-client/gulpfile.js +++ b/afb-client/gulpfile.js @@ -112,7 +112,7 @@ pipes.validatedDevServerScripts = function() { pipes.validatedPartials = function() { return gulp.src(paths.partials) .pipe(plugins.htmlhint({'doctype-first': false})) - .pipe(router({path: paths.application+'/tmp/routes.js', root: paths.application})) + .pipe(router({path: paths.application+'/etc/routes.js', root: paths.application})) .pipe(plugins.htmlhint.reporter()); }; -- cgit 1.2.3-korg From 6700ae902ee16d9474098c5435e4cdf210962851 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Sun, 20 Dec 2015 21:06:07 +0100 Subject: Implemented client upload with rangeslider and zip open --- afb-client/app/Frontend/widgets/FormInput/UploadFiles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js index 6c68960..65269f3 100644 --- a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js +++ b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js @@ -21,6 +21,7 @@ * https://github.com/nervgh/angular-file-upload/blob/master/src/services/FileUploader.js * https://stuk.github.io/jszip/documentation/howto/read_zip.html * http://onehungrymind.com/zip-parsing-jszip-angular/ + * http://stackoverflow.com/questions/15341912/how-to-go-from-blob-to-arraybuffer */ -- cgit 1.2.3-korg From 3b1b2ddc4692776318a135a66c1da8c5dee13f64 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Sun, 20 Dec 2015 21:59:32 +0100 Subject: Fixed valid/invalid status for app --- .../app/Frontend/images/appli/isnotvalid.png | Bin 58558 -> 11124 bytes afb-client/app/Frontend/pages/Sample/Sample.html | 6 +-- .../app/Frontend/widgets/FormInput/UploadFiles.js | 42 +++++++--------- .../Frontend/widgets/FormInput/newjavascript.js | 55 --------------------- 4 files changed, 22 insertions(+), 81 deletions(-) delete mode 100644 afb-client/app/Frontend/widgets/FormInput/newjavascript.js diff --git a/afb-client/app/Frontend/images/appli/isnotvalid.png b/afb-client/app/Frontend/images/appli/isnotvalid.png index ee40d2a..057c215 100644 Binary files a/afb-client/app/Frontend/images/appli/isnotvalid.png and b/afb-client/app/Frontend/images/appli/isnotvalid.png differ diff --git a/afb-client/app/Frontend/pages/Sample/Sample.html b/afb-client/app/Frontend/pages/Sample/Sample.html index 35523a9..7461d49 100644 --- a/afb-client/app/Frontend/pages/Sample/Sample.html +++ b/afb-client/app/Frontend/pages/Sample/Sample.html @@ -21,14 +21,14 @@ animationIn: slideInRight accept = [image] acceptable accept for upload --> + posturl="/api/post/upload-image" callback="ctrl.FileUploaded" accept="image" title="Change your Avatar"> - + - +
    diff --git a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js index 65269f3..88669a9 100644 --- a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js +++ b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js @@ -22,12 +22,11 @@ * https://stuk.github.io/jszip/documentation/howto/read_zip.html * http://onehungrymind.com/zip-parsing-jszip-angular/ * http://stackoverflow.com/questions/15341912/how-to-go-from-blob-to-arraybuffer + * + * Bugs: zip file sent even when flag as invalid */ - -function changeInput() { - console.log ('input imgClicked'); -} + (function() { 'use strict'; @@ -40,10 +39,6 @@ var tmpl = '", { - text : theFile.name - }); - $result.append($title); - var $fileContent = $("
      "); - try { - - var dateBefore = new Date(); - // read the content of the file with JSZip - var zip = new JSZip(e.target.result); - var dateAfter = new Date(); - - $title.append($("", { - text:" (parsed in " + (dateAfter - dateBefore) + "ms)" - })); - - // that, or a good ol' for(var entryName in zip.files) - $.each(zip.files, function (index, zipEntry) { - $fileContent.append($("
    • ", { - text : zipEntry.name - })); - // the content is here : zipEntry.asText() - }); - // end of the magic ! - - } catch(e) { - $fileContent = $("
      ", { - "class" : "alert alert-danger", - text : "Error reading " + theFile.name + " : " + e.message - }); - } - $result.append($fileContent); - } - })(f); \ No newline at end of file -- cgit 1.2.3-korg From 20853066884b9d3cddfa29c9741d625ba625c5f3 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Mon, 21 Dec 2015 01:52:39 +0100 Subject: Few hack for Post --- afb-client/app/Frontend/pages/Sample/SampleModule.scss | 2 +- afb-client/app/Frontend/widgets/FormInput/UploadFiles.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/afb-client/app/Frontend/pages/Sample/SampleModule.scss b/afb-client/app/Frontend/pages/Sample/SampleModule.scss index 2e54c53..7654424 100644 --- a/afb-client/app/Frontend/pages/Sample/SampleModule.scss +++ b/afb-client/app/Frontend/pages/Sample/SampleModule.scss @@ -24,7 +24,7 @@ height : 4.5rem; .sample-button { - float: left; + float: right; width: 5rem; }; diff --git a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js index 88669a9..8bc8eca 100644 --- a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js +++ b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js @@ -53,6 +53,7 @@ function LoadFileSvc (scope, elem, posturl, files, thumbnailCB) { // Upload is finish let's notify controler callback xmlReq.onload = function () { elem.addClass ("success"); + elem.removeClass ("error"); var response ={ status : xmlReq.status, headers: xmlReq.getAllResponseHeaders() @@ -61,7 +62,8 @@ function LoadFileSvc (scope, elem, posturl, files, thumbnailCB) { }; xmlReq.onerror = function () { - elem.addClass ("error fail"); + elem.addClass ("error"); + elem.removeClass ("success"); var response ={ status : xmlReq.status, headers: xmlReq.getAllResponseHeaders() @@ -70,7 +72,8 @@ function LoadFileSvc (scope, elem, posturl, files, thumbnailCB) { }; xmlReq.onabort = function () { - elem.addClass ("error abort"); + elem.addClass ("error"); + elem.removeClass ("success"); var response ={ status : xmlReq.status, headers: xmlReq.getAllResponseHeaders() -- cgit 1.2.3-korg From 4c75745c475edfbb6a9258ee80944e655fdf89f6 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Mon, 21 Dec 2015 16:10:40 +0100 Subject: Fixed Warning --- afb-client/app/Frontend/pages/Sample/Sample.html | 4 ++-- afb-client/app/Frontend/widgets/FormInput/UploadFiles.js | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/afb-client/app/Frontend/pages/Sample/Sample.html b/afb-client/app/Frontend/pages/Sample/Sample.html index 7461d49..03a4558 100644 --- a/afb-client/app/Frontend/pages/Sample/Sample.html +++ b/afb-client/app/Frontend/pages/Sample/Sample.html @@ -25,10 +25,10 @@ animationIn: slideInRight - + - +
      diff --git a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js index 8bc8eca..8c0a4c2 100644 --- a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js +++ b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js @@ -43,8 +43,12 @@ var tmpl = ' - App Framework Binder Simple Client + App Framework Binder Simple Client

-- cgit 1.2.3-korg From 07bbb1900acc411da012291f6c0530230a1110e0 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Wed, 23 Dec 2015 00:54:27 +0100 Subject: Added Autolog to TokenRefresh Widget --- afb-client/app/Frontend/etc/ConfigApp.js | 7 ++- afb-client/app/Frontend/pages/Home/Home.html | 2 +- afb-client/app/Frontend/pages/Home/HomeModule.js | 8 +-- .../widgets/Notifications/TokenRefreshSvc.js | 63 +++++++++++++++------- 4 files changed, 55 insertions(+), 25 deletions(-) diff --git a/afb-client/app/Frontend/etc/ConfigApp.js b/afb-client/app/Frontend/etc/ConfigApp.js index 22cf220..27e2e3e 100644 --- a/afb-client/app/Frontend/etc/ConfigApp.js +++ b/afb-client/app/Frontend/etc/ConfigApp.js @@ -17,12 +17,15 @@ appli : 'images/appli/' }, - api: { // Warning paths should end with / - token : '/api/token/' + myapi: { // Warning paths should end with / + token : '/api/myplugin/xxxx' }, session: { // Those data are updated by session service + create : '/api/token/create', refresh : '/api/token/refresh', + check : '/api/token/check', + reset : '/api/token/reset', ping : '/api/token/check', initial : '123456789', // typical dev initial token timeout : 3600, // timeout is updated client sessin context creation diff --git a/afb-client/app/Frontend/pages/Home/Home.html b/afb-client/app/Frontend/pages/Home/Home.html index 307bd2d..d3c6719 100644 --- a/afb-client/app/Frontend/pages/Home/Home.html +++ b/afb-client/app/Frontend/pages/Home/Home.html @@ -11,7 +11,7 @@ animationIn: slideInRight App Framework Binder Simple Client - +
diff --git a/afb-client/app/Frontend/pages/Home/HomeModule.js b/afb-client/app/Frontend/pages/Home/HomeModule.js index 6ebaefc..6a73bdf 100644 --- a/afb-client/app/Frontend/pages/Home/HomeModule.js +++ b/afb-client/app/Frontend/pages/Home/HomeModule.js @@ -56,7 +56,7 @@ angular.module('HomeModule', ['SubmitButton', 'TokenRefresh']) scope.OpenSession = function() { console.log ("OpenSession"); var postdata= {/* any json your application may need */}; - var handler = $http.post(ConfigApp.api.token + 'create?token='+ConfigApp.session.initial, postdata); + var handler = $http.post(ConfigApp.session.create + '?token='+ConfigApp.session.initial, postdata); handler.success(scope.ProcessResponse); handler.error(scope.ProcessError); @@ -65,7 +65,7 @@ angular.module('HomeModule', ['SubmitButton', 'TokenRefresh']) scope.CheckSession = function() { console.log ("CloseSession"); var postdata= {/* any json your application may need */}; - var handler = $http.post(ConfigApp.api.token + 'check?token='+scope.token, postdata); + var handler = $http.post(ConfigApp.session.check + '?token='+ConfigApp.session.token, postdata); handler.success(scope.ProcessResponse); handler.error(scope.ProcessError); @@ -74,7 +74,7 @@ angular.module('HomeModule', ['SubmitButton', 'TokenRefresh']) scope.RefreshSession = function() { console.log ("RefreshSession"); var postdata= {/* any json your application may need */}; - var handler = $http.post(ConfigApp.api.token + 'refresh?token='+scope.token, postdata); + var handler = $http.post(ConfigApp.session.refresh + '?token='+ConfigApp.session.token, postdata); handler.success(scope.ProcessResponse); handler.error(scope.ProcessError); @@ -83,7 +83,7 @@ angular.module('HomeModule', ['SubmitButton', 'TokenRefresh']) scope.ResetSession = function() { console.log ("ResetSession"); var postdata= {/* any json your application may need */}; - var handler = $http.post(ConfigApp.api.token + 'reset?token='+scope.token, postdata); + var handler = $http.post(ConfigApp.session.reset + '?token='+ConfigApp.session.token, postdata); handler.success(scope.ProcessResponse); handler.error(scope.ProcessError); diff --git a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js index 0d1cf38..834aaff 100644 --- a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js +++ b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js @@ -37,8 +37,8 @@ angular.module('TokenRefresh', ['ConfigApp', 'ModalNotification']) .directive ('tokenRefresh', function($timeout, $http, $location, Notification, ConfigApp) { function mymethods(scope, elem, attrs) { + scope.status=undefined; // neither thu neither false - scope.status=false; scope.online = function () { elem.addClass ("online"); @@ -49,26 +49,35 @@ angular.module('TokenRefresh', ['ConfigApp', 'ModalNotification']) elem.addClass ("offline"); elem.removeClass ("online"); }; + + scope.onerror = function(data, errcode, headers) { + if (scope.status !== false) { + Notification.warning ({message: "AppFramework Binder Lost", delay: 5000}); + scope.offline(); + } + scope.status = 0; + }; + + scope.onsuccess = function(data, errcode, headers, config) { + if (scope.status !== true) { + if (data.request.token) ConfigApp.session.token = data.request.token; + if (data.request.uuid) ConfigApp.session.uuid = data.request.uuid; + if (data.request.timeout) ConfigApp.session.timeout = data.request.timeout; + + Notification.success ({message: "AppFramework Binder Back to Live", delay: 3000}); + scope.online(); + } + scope.status = 1; + }; // Check Binder status scope.getping = function() { var handler = $http.post(ConfigApp.session.ping+'?token='+ ConfigApp.session.token); - handler.success(function(response, errcode, headers, config) { - if (!scope.status) { - Notification.success ({message: "AppFramework Binder Back to Live", delay: 3000}); - scope.online(); - } - scope.status = 1; - }); - - handler.error(function(response, errcode, headers) { - if (scope.status) { - Notification.warning ({message: "AppFramework Binder Lost", delay: 5000}); - scope.offline(); - } - scope.status = 0; - }); + + // process success and error + handler.success(scope.onsuccess); + handler.error(scope.onerror); // restart a new timer for next ping $timeout (scope.getping, ConfigApp.session.pingrate*1000); @@ -77,15 +86,33 @@ angular.module('TokenRefresh', ['ConfigApp', 'ModalNotification']) // Check Binder status scope.refresh = function() { var handler = $http.post(ConfigApp.session.refresh+'?token='+ ConfigApp.session.token); + + // process success and error + handler.success(scope.onsuccess); + handler.error(scope.onerror); + // restart a new timer for next refresh to 1/4 of timeout session $timeout (scope.refresh, ConfigApp.session.timeout *250); }; + + // Initial connection + scope.tkcreate = function() { + var handler = $http.post(ConfigApp.session.create+'?token='+ ConfigApp.session.initial); + + // process success and error + handler.success(scope.onsuccess); + handler.error(scope.onerror); + }; scope.icon = attrs.icon || "fi-lightbulb"; scope.hostname = $location.host(); scope.httpdport = $location.port(); + scope.autolog = JSON.parse(attrs.autolog || false); - scope.getping(); - scope.refresh(); + if (scope.autolog) scope.tkcreate(); + + // Init ping and refresh process + $timeout (scope.getping, ConfigApp.session.pingrate*1000); + $timeout (scope.refresh, ConfigApp.session.timeout *250); } return { -- cgit 1.2.3-korg From 0878627c7c4ca29e04621a48513018cbd4195124 Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Tue, 29 Dec 2015 21:55:10 +0100 Subject: Switch TokenRefresh to HTTP GET We are doing HTTP POST calls with no data in TokenRefresh widget, which is time-consuming and can lead to crashes with libmicrohttpd > 0.9.30. Use HTTP GETs instead. Signed-off-by: Manuel Bachmann --- afb-client/app/Frontend/app.js | 2 +- afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/afb-client/app/Frontend/app.js b/afb-client/app/Frontend/app.js index 5e99d77..72e8123 100644 --- a/afb-client/app/Frontend/app.js +++ b/afb-client/app/Frontend/app.js @@ -30,7 +30,7 @@ config.$inject = ['$urlRouterProvider', '$locationProvider']; - console.log ("***location=" + window.location + " search" + window.search) + console.log ("***location=" + window.location + " search" + window.search); function config($urlProvider, $locationProvider, ConfigApp) { $urlProvider.otherwise('/home'); diff --git a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js index 834aaff..82e43a5 100644 --- a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js +++ b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js @@ -73,7 +73,7 @@ angular.module('TokenRefresh', ['ConfigApp', 'ModalNotification']) // Check Binder status scope.getping = function() { - var handler = $http.post(ConfigApp.session.ping+'?token='+ ConfigApp.session.token); + var handler = $http.get(ConfigApp.session.ping+'?token='+ ConfigApp.session.token); // process success and error handler.success(scope.onsuccess); @@ -85,7 +85,7 @@ angular.module('TokenRefresh', ['ConfigApp', 'ModalNotification']) // Check Binder status scope.refresh = function() { - var handler = $http.post(ConfigApp.session.refresh+'?token='+ ConfigApp.session.token); + var handler = $http.get(ConfigApp.session.refresh+'?token='+ ConfigApp.session.token); // process success and error handler.success(scope.onsuccess); @@ -96,7 +96,7 @@ angular.module('TokenRefresh', ['ConfigApp', 'ModalNotification']) // Initial connection scope.tkcreate = function() { - var handler = $http.post(ConfigApp.session.create+'?token='+ ConfigApp.session.initial); + var handler = $http.get(ConfigApp.session.create+'?token='+ ConfigApp.session.initial); // process success and error handler.success(scope.onsuccess); -- cgit 1.2.3-korg From f12e5a28b1cd86d5de95e53fcef56dedf55e0475 Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Tue, 5 Jan 2016 11:32:05 +0100 Subject: Add "dist.prod" directory, modify .gitignore "dist.prod" is a snapshot of compiled application ; it is useful for demos, and because compiling AngularJS code (using npm, gulp...) within Yocto means lots of efforts for little gain. Signed-off-by: Manuel Bachmann --- afb-client/.gitignore | 4 ++-- .../dist.prod/bower_components/foundation-icons.woff | Bin 0 -> 32020 bytes afb-client/dist.prod/bower_components/vendor.min.js | 12 ++++++++++++ afb-client/dist.prod/favicon.ico | Bin 0 -> 1150 bytes .../dist.prod/global_styles/foundation-conf.min.css | 2 ++ afb-client/dist.prod/global_styles/ibz-global.min.css | 2 ++ afb-client/dist.prod/opa/AFBclient.min.css | 9 +++++++++ afb-client/dist.prod/opa/AFBclient.min.js | 2 ++ afb-client/dist.prod/opa/images/appli/isnotvalid.png | Bin 0 -> 11124 bytes afb-client/dist.prod/opa/images/appli/istoobig.png | Bin 0 -> 15144 bytes afb-client/dist.prod/opa/images/appli/upload-appli.png | Bin 0 -> 10094 bytes afb-client/dist.prod/opa/images/audio/istoobig.png | Bin 0 -> 15144 bytes afb-client/dist.prod/opa/images/audio/upload-music.png | Bin 0 -> 19411 bytes afb-client/dist.prod/opa/images/avatars/istoobig.jpg | Bin 0 -> 7204 bytes afb-client/dist.prod/opa/images/avatars/istoobig.png | Bin 0 -> 15144 bytes afb-client/dist.prod/opa/images/avatars/tux-admin.png | Bin 0 -> 15107 bytes afb-client/dist.prod/opa/images/avatars/tux-bzh.png | Bin 0 -> 18451 bytes afb-client/dist.prod/opa/images/avatars/tux-visitor.png | Bin 0 -> 29307 bytes afb-client/dist.prod/opa/images/login/fb-logo.png | Bin 0 -> 2092 bytes afb-client/dist.prod/opa/images/login/gg-logo.png | Bin 0 -> 2465 bytes afb-client/dist.prod/opa/images/login/gh-logo.png | Bin 0 -> 2779 bytes afb-client/dist.prod/opa/images/login/iot-logo.png | Bin 0 -> 2349 bytes afb-client/dist.prod/opa/images/login/lk-logo.png | Bin 0 -> 2511 bytes afb-client/dist.prod/opa/images/login/ms-logo.png | Bin 0 -> 3024 bytes afb-client/dist.prod/opa/images/login/og-logo.png | Bin 0 -> 2181 bytes afb-client/dist.prod/opa/images/login/pp-logo.png | Bin 0 -> 2236 bytes afb-client/dist.prod/opa/images/login/yh-logo.png | Bin 0 -> 3309 bytes afb-client/dist.prod/opa/images/logo/logo_iot_bzh.svg | 1 + .../dist.prod/opa/images/logo/logo_iot_bzhx350.png | Bin 0 -> 9416 bytes .../dist.prod/opa/images/logo/tampon-iot-bzhx450.png | Bin 0 -> 19420 bytes .../dist.prod/opa/images/logo/triskel_iot_bzh.png | Bin 0 -> 30976 bytes .../dist.prod/opa/images/logo/triskel_iot_bzh.svg | 1 + .../dist.prod/opa/images/logo/triskel_iot_bzhx250.png | Bin 0 -> 9799 bytes afb-client/dist.prod/opa/index.html | 3 +++ 34 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 afb-client/dist.prod/bower_components/foundation-icons.woff create mode 100644 afb-client/dist.prod/bower_components/vendor.min.js create mode 100644 afb-client/dist.prod/favicon.ico create mode 100644 afb-client/dist.prod/global_styles/foundation-conf.min.css create mode 100644 afb-client/dist.prod/global_styles/ibz-global.min.css create mode 100644 afb-client/dist.prod/opa/AFBclient.min.css create mode 100644 afb-client/dist.prod/opa/AFBclient.min.js create mode 100644 afb-client/dist.prod/opa/images/appli/isnotvalid.png create mode 100644 afb-client/dist.prod/opa/images/appli/istoobig.png create mode 100644 afb-client/dist.prod/opa/images/appli/upload-appli.png create mode 100644 afb-client/dist.prod/opa/images/audio/istoobig.png create mode 100644 afb-client/dist.prod/opa/images/audio/upload-music.png create mode 100644 afb-client/dist.prod/opa/images/avatars/istoobig.jpg create mode 100644 afb-client/dist.prod/opa/images/avatars/istoobig.png create mode 100644 afb-client/dist.prod/opa/images/avatars/tux-admin.png create mode 100644 afb-client/dist.prod/opa/images/avatars/tux-bzh.png create mode 100644 afb-client/dist.prod/opa/images/avatars/tux-visitor.png create mode 100644 afb-client/dist.prod/opa/images/login/fb-logo.png create mode 100644 afb-client/dist.prod/opa/images/login/gg-logo.png create mode 100644 afb-client/dist.prod/opa/images/login/gh-logo.png create mode 100644 afb-client/dist.prod/opa/images/login/iot-logo.png create mode 100644 afb-client/dist.prod/opa/images/login/lk-logo.png create mode 100644 afb-client/dist.prod/opa/images/login/ms-logo.png create mode 100644 afb-client/dist.prod/opa/images/login/og-logo.png create mode 100644 afb-client/dist.prod/opa/images/login/pp-logo.png create mode 100644 afb-client/dist.prod/opa/images/login/yh-logo.png create mode 100644 afb-client/dist.prod/opa/images/logo/logo_iot_bzh.svg create mode 100644 afb-client/dist.prod/opa/images/logo/logo_iot_bzhx350.png create mode 100644 afb-client/dist.prod/opa/images/logo/tampon-iot-bzhx450.png create mode 100644 afb-client/dist.prod/opa/images/logo/triskel_iot_bzh.png create mode 100644 afb-client/dist.prod/opa/images/logo/triskel_iot_bzh.svg create mode 100644 afb-client/dist.prod/opa/images/logo/triskel_iot_bzhx250.png create mode 100644 afb-client/dist.prod/opa/index.html diff --git a/afb-client/.gitignore b/afb-client/.gitignore index bb6f2ab..ba5820b 100644 --- a/afb-client/.gitignore +++ b/afb-client/.gitignore @@ -1,7 +1,7 @@ -bower_components/ +#bower_components/ node_modules/ dist.dev/ -dist.prod/ +#dist.prod/ *.DS_Store nbproject/private/ .noderc* diff --git a/afb-client/dist.prod/bower_components/foundation-icons.woff b/afb-client/dist.prod/bower_components/foundation-icons.woff new file mode 100644 index 0000000..e2cfe25 Binary files /dev/null and b/afb-client/dist.prod/bower_components/foundation-icons.woff differ diff --git a/afb-client/dist.prod/bower_components/vendor.min.js b/afb-client/dist.prod/bower_components/vendor.min.js new file mode 100644 index 0000000..3a9b8fe --- /dev/null +++ b/afb-client/dist.prod/bower_components/vendor.min.js @@ -0,0 +1,12 @@ +!function(t,e,n){"use strict";function r(t,e){return e=e||Error,function(){var n,r,i=arguments[0],o="["+(t?t+":":"")+i+"] ",a=arguments[1],s=arguments;for(n=o+a.replace(/\{\d+\}/g,function(t){var e=+t.slice(1,-1);return e+20&&e-1 in t}function o(t,e,n){var r,a;if(t)if(x(t))for(r in t)"prototype"==r||"length"==r||"name"==r||t.hasOwnProperty&&!t.hasOwnProperty(r)||e.call(n,t[r],r,t);else if(dr(t)||i(t)){var s="object"!=typeof t;for(r=0,a=t.length;a>r;r++)(s||r in t)&&e.call(n,t[r],r,t)}else if(t.forEach&&t.forEach!==o)t.forEach(e,n,t);else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t);return t}function a(t){return Object.keys(t).sort()}function s(t,e,n){for(var r=a(t),i=0;in;n++){var i=arguments[n];if(i)for(var o=Object.keys(i),a=0,s=o.length;s>a;a++){var u=o[a];t[u]=i[u]}}return l(t,e),t}function h(t){return parseInt(t,10)}function d(t,e){return f(Object.create(t),e)}function p(){}function m(t){return t}function v(t){return function(){return t}}function g(t){return"undefined"==typeof t}function $(t){return"undefined"!=typeof t}function y(t){return null!==t&&"object"==typeof t}function b(t){return"string"==typeof t}function w(t){return"number"==typeof t}function _(t){return"[object Date]"===ur.call(t)}function x(t){return"function"==typeof t}function C(t){return"[object RegExp]"===ur.call(t)}function E(t){return t&&t.window===t}function k(t){return t&&t.$evalAsync&&t.$watch}function A(t){return"[object File]"===ur.call(t)}function S(t){return"[object FormData]"===ur.call(t)}function T(t){return"[object Blob]"===ur.call(t)}function O(t){return"boolean"==typeof t}function I(t){return t&&x(t.then)}function z(t){return!(!t||!(t.nodeName||t.prop&&t.attr&&t.find))}function M(t){var e,n={},r=t.split(",");for(e=0;e=0&&t.splice(n,1),e}function N(t,e,n,r){if(E(t)||k(t))throw cr("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");if(e){if(t===e)throw cr("cpi","Can't copy! Source and destination are identical.");if(n=n||[],r=r||[],y(t)){var i=n.indexOf(t);if(-1!==i)return r[i];n.push(t),r.push(e)}var a;if(dr(t)){e.length=0;for(var s=0;sn;n++)e[n]=t[n]}else if(y(t)){e=e||{};for(var i in t)("$"!==i.charAt(0)||"$"!==i.charAt(1))&&(e[i]=t[i])}return e||t}function P(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var r,i,o,a=typeof t,s=typeof e;if(a==s&&"object"==a){if(!dr(t)){if(_(t))return _(e)?P(t.getTime(),e.getTime()):!1;if(C(t))return C(e)?t.toString()==e.toString():!1;if(k(t)||k(e)||E(t)||E(e)||dr(e)||_(e)||C(e))return!1;o={};for(i in t)if("$"!==i.charAt(0)&&!x(t[i])){if(!P(t[i],e[i]))return!1;o[i]=!0}for(i in e)if(!o.hasOwnProperty(i)&&"$"!==i.charAt(0)&&e[i]!==n&&!x(e[i]))return!1;return!0}if(!dr(e))return!1;if((r=t.length)==e.length){for(i=0;r>i;i++)if(!P(t[i],e[i]))return!1;return!0}}return!1}function F(t,e,n){return t.concat(or.call(e,n))}function B(t,e){return or.call(t,e||0)}function L(t,e){var n=arguments.length>2?B(arguments,2):[];return!x(e)||e instanceof RegExp?e:n.length?function(){return arguments.length?e.apply(t,F(n,arguments,0)):e.apply(t,n)}:function(){return arguments.length?e.apply(t,arguments):e.call(t)}}function U(t,r){var i=r;return"string"==typeof t&&"$"===t.charAt(0)&&"$"===t.charAt(1)?i=n:E(r)?i="$WINDOW":r&&e===r?i="$DOCUMENT":k(r)&&(i="$SCOPE"),i}function V(t,e){return"undefined"==typeof t?n:(w(e)||(e=e?2:null),JSON.stringify(t,U,e))}function q(t){return b(t)?JSON.parse(t):t}function H(t){t=nr(t).clone();try{t.empty()}catch(e){}var n=nr("
").append(t).html();try{return t[0].nodeType===_r?Gn(n):n.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(t,e){return"<"+Gn(e)})}catch(e){return Gn(n)}}function W(t){try{return decodeURIComponent(t)}catch(e){}}function X(t){var e,n,r={};return o((t||"").split("&"),function(t){if(t&&(e=t.replace(/\+/g,"%20").split("="),n=W(e[0]),$(n))){var i=$(e[1])?W(e[1]):!0;Kn.call(r,n)?dr(r[n])?r[n].push(i):r[n]=[r[n],i]:r[n]=i}}),r}function Y(t){var e=[];return o(t,function(t,n){dr(t)?o(t,function(t){e.push(G(n,!0)+(t===!0?"":"="+G(t,!0)))}):e.push(G(n,!0)+(t===!0?"":"="+G(t,!0)))}),e.length?e.join("&"):""}function Z(t){return G(t,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function G(t,e){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,e?"%20":"+")}function K(t,e){var n,r,i=gr.length;for(t=nr(t),r=0;i>r;++r)if(n=gr[r]+e,b(n=t.attr(n)))return n;return null}function J(t,e){var n,r,i={};o(gr,function(e){var i=e+"app";!n&&t.hasAttribute&&t.hasAttribute(i)&&(n=t,r=t.getAttribute(i))}),o(gr,function(e){var i,o=e+"app";!n&&(i=t.querySelector("["+o.replace(":","\\:")+"]"))&&(n=i,r=i.getAttribute(o))}),n&&(i.strictDi=null!==K(n,"strict-di"),e(n,r?[r]:[],i))}function Q(n,r,i){y(i)||(i={});var a={strictDi:!1};i=f(a,i);var s=function(){if(n=nr(n),n.injector()){var t=n[0]===e?"document":H(n);throw cr("btstrpd","App Already Bootstrapped with this Element '{0}'",t.replace(//,">"))}r=r||[],r.unshift(["$provide",function(t){t.value("$rootElement",n)}]),i.debugInfoEnabled&&r.push(["$compileProvider",function(t){t.debugInfoEnabled(!0)}]),r.unshift("ng");var o=qt(r,i.strictDi);return o.invoke(["$rootScope","$rootElement","$compile","$injector",function(t,e,n,r){t.$apply(function(){e.data("$injector",r),n(e)(t)})}]),o},u=/^NG_ENABLE_DEBUG_INFO!/,c=/^NG_DEFER_BOOTSTRAP!/;return t&&u.test(t.name)&&(i.debugInfoEnabled=!0,t.name=t.name.replace(u,"")),t&&!c.test(t.name)?s():(t.name=t.name.replace(c,""),lr.resumeBootstrap=function(t){return o(t,function(t){r.push(t)}),s()},void(x(lr.resumeDeferredBootstrap)&&lr.resumeDeferredBootstrap()))}function tt(){t.name="NG_ENABLE_DEBUG_INFO!"+t.name,t.location.reload()}function et(t){var e=lr.element(t).injector();if(!e)throw cr("test","no injector found for element argument to getTestability");return e.get("$$testability")}function nt(t,e){return e=e||"_",t.replace($r,function(t,n){return(n?e:"")+t.toLowerCase()})}function rt(){var e;yr||(rr=t.jQuery,rr&&rr.fn.on?(nr=rr,f(rr.fn,{scope:Br.scope,isolateScope:Br.isolateScope,controller:Br.controller,injector:Br.injector,inheritedData:Br.inheritedData}),e=rr.cleanData,rr.cleanData=function(t){var n;if(hr)hr=!1;else for(var r,i=0;null!=(r=t[i]);i++)n=rr._data(r,"events"),n&&n.$destroy&&rr(r).triggerHandler("$destroy");e(t)}):nr=bt,lr.element=nr,yr=!0)}function it(t,e,n){if(!t)throw cr("areq","Argument '{0}' is {1}",e||"?",n||"required");return t}function ot(t,e,n){return n&&dr(t)&&(t=t[t.length-1]),it(x(t),e,"not a function, got "+(t&&"object"==typeof t?t.constructor.name||"Object":typeof t)),t}function at(t,e){if("hasOwnProperty"===t)throw cr("badname","hasOwnProperty is not a valid {0} name",e)}function st(t,e,n){if(!e)return t;for(var r,i=e.split("."),o=t,a=i.length,s=0;a>s;s++)r=i[s],t&&(t=(o=t)[r]);return!n&&x(t)?L(o,t):t}function ut(t){var e=t[0],n=t[t.length-1],r=[e];do{if(e=e.nextSibling,!e)break;r.push(e)}while(e!==n);return nr(r)}function ct(){return Object.create(null)}function lt(t){function e(t,e,n){return t[e]||(t[e]=n())}var n=r("$injector"),i=r("ng"),o=e(t,"angular",Object);return o.$$minErr=o.$$minErr||r,e(o,"module",function(){var t={};return function(r,o,a){var s=function(t,e){if("hasOwnProperty"===t)throw i("badname","hasOwnProperty is not a valid {0} name",e)};return s(r,"module"),o&&t.hasOwnProperty(r)&&(t[r]=null),e(t,r,function(){function t(t,n,r,i){return i||(i=e),function(){return i[r||"push"]([t,n,arguments]),c}}if(!o)throw n("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",r);var e=[],i=[],s=[],u=t("$injector","invoke","push",i),c={_invokeQueue:e,_configBlocks:i,_runBlocks:s,requires:o,name:r,provider:t("$provide","provider"),factory:t("$provide","factory"),service:t("$provide","service"),value:t("$provide","value"),constant:t("$provide","constant","unshift"),animation:t("$animateProvider","register"),filter:t("$filterProvider","register"),controller:t("$controllerProvider","register"),directive:t("$compileProvider","directive"),config:u,run:function(t){return s.push(t),this}};return a&&u(a),c})}})}function ft(t){var e=[];return JSON.stringify(t,function(t,n){if(n=U(t,n),y(n)){if(e.indexOf(n)>=0)return"<>";e.push(n)}return n})}function ht(t){return"function"==typeof t?t.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof t?"undefined":"string"!=typeof t?ft(t):t}function dt(e){f(e,{bootstrap:Q,copy:N,extend:f,equals:P,element:nr,forEach:o,injector:qt,noop:p,bind:L,toJson:V,fromJson:q,identity:m,isUndefined:g,isDefined:$,isString:b,isFunction:x,isObject:y,isNumber:w,isElement:z,isArray:dr,version:kr,isDate:_,lowercase:Gn,uppercase:Jn,callbacks:{counter:0},getTestability:et,$$minErr:r,$$csp:vr,reloadWithDebugInfo:tt}),ir=lt(t);try{ir("ngLocale")}catch(n){ir("ngLocale",[]).provider("$locale",ve)}ir("ng",["ngLocale"],["$provide",function(t){t.provider({$$sanitizeUri:Ze}),t.provider("$compile",Kt).directive({a:zi,input:Zi,textarea:Zi,form:Ri,script:Fo,select:Uo,style:qo,option:Vo,ngBind:Ji,ngBindHtml:to,ngBindTemplate:Qi,ngClass:no,ngClassEven:io,ngClassOdd:ro,ngCloak:oo,ngController:ao,ngForm:Pi,ngHide:Mo,ngIf:co,ngInclude:lo,ngInit:ho,ngNonBindable:Ao,ngPluralize:So,ngRepeat:To,ngShow:zo,ngStyle:Do,ngSwitch:jo,ngSwitchWhen:No,ngSwitchDefault:Ro,ngOptions:Lo,ngTransclude:Po,ngModel:Co,ngList:po,ngChange:eo,pattern:Wo,ngPattern:Wo,required:Ho,ngRequired:Ho,minlength:Yo,ngMinlength:Yo,maxlength:Xo,ngMaxlength:Xo,ngValue:Ki,ngModelOptions:ko}).directive({ngInclude:fo}).directive(Mi).directive(so),t.provider({$anchorScroll:Ht,$animate:Gr,$browser:Yt,$cacheFactory:Zt,$controller:ee,$document:ne,$exceptionHandler:re,$filter:un,$interpolate:pe,$interval:me,$http:le,$httpBackend:he,$location:Oe,$log:Ie,$parse:Ve,$rootScope:Ye,$q:qe,$$q:He,$sce:Qe,$sceDelegate:Je,$sniffer:tn,$templateCache:Gt,$templateRequest:en,$$testability:nn,$timeout:rn,$window:sn,$$rAF:Xe,$$asyncCallback:Wt,$$jqLite:Ft})}])}function pt(){return++Sr}function mt(t){return t.replace(Ir,function(t,e,n,r){return r?n.toUpperCase():n}).replace(zr,"Moz$1")}function vt(t){return!Nr.test(t)}function gt(t){var e=t.nodeType;return e===br||!e||e===Cr}function $t(t,e){var n,r,i,a,s=e.createDocumentFragment(),u=[];if(vt(t))u.push(e.createTextNode(t));else{for(n=n||s.appendChild(e.createElement("div")),r=(Rr.exec(t)||["",""])[1].toLowerCase(),i=Fr[r]||Fr._default,n.innerHTML=i[1]+t.replace(Pr,"<$1>")+i[2],a=i[0];a--;)n=n.lastChild;u=F(u,n.childNodes),n=s.firstChild,n.textContent=""}return s.textContent="",s.innerHTML="",o(u,function(t){s.appendChild(t)}),s}function yt(t,n){n=n||e;var r;return(r=jr.exec(t))?[n.createElement(r[1])]:(r=$t(t,n))?r.childNodes:[]}function bt(t){if(t instanceof bt)return t;var e;if(b(t)&&(t=pr(t),e=!0),!(this instanceof bt)){if(e&&"<"!=t.charAt(0))throw Dr("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new bt(t)}e?Ot(this,yt(t)):Ot(this,t)}function wt(t){return t.cloneNode(!0)}function _t(t,e){if(e||Ct(t),t.querySelectorAll)for(var n=t.querySelectorAll("*"),r=0,i=n.length;i>r;r++)Ct(n[r])}function xt(t,e,n,r){if($(r))throw Dr("offargs","jqLite#off() does not support the `selector` argument");var i=Et(t),a=i&&i.events,s=i&&i.handle;if(s)if(e)o(e.split(" "),function(e){if($(n)){var r=a[e];if(j(r||[],n),r&&r.length>0)return}Or(t,e,s),delete a[e]});else for(e in a)"$destroy"!==e&&Or(t,e,s),delete a[e]}function Ct(t,e){var r=t.ng339,i=r&&Ar[r];if(i){if(e)return void delete i.data[e];i.handle&&(i.events.$destroy&&i.handle({},"$destroy"),xt(t)),delete Ar[r],t.ng339=n}}function Et(t,e){var r=t.ng339,i=r&&Ar[r];return e&&!i&&(t.ng339=r=pt(),i=Ar[r]={events:{},data:{},handle:n}),i}function kt(t,e,n){if(gt(t)){var r=$(n),i=!r&&e&&!y(e),o=!e,a=Et(t,!i),s=a&&a.data;if(r)s[e]=n;else{if(o)return s;if(i)return s&&s[e];f(s,e)}}}function At(t,e){return t.getAttribute?(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+e+" ")>-1:!1}function St(t,e){e&&t.setAttribute&&o(e.split(" "),function(e){t.setAttribute("class",pr((" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+pr(e)+" "," ")))})}function Tt(t,e){if(e&&t.setAttribute){var n=(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");o(e.split(" "),function(t){t=pr(t),-1===n.indexOf(" "+t+" ")&&(n+=t+" ")}),t.setAttribute("class",pr(n))}}function Ot(t,e){if(e)if(e.nodeType)t[t.length++]=e;else{var n=e.length;if("number"==typeof n&&e.window!==e){if(n)for(var r=0;n>r;r++)t[t.length++]=e[r]}else t[t.length++]=e}}function It(t,e){return zt(t,"$"+(e||"ngController")+"Controller")}function zt(t,e,r){t.nodeType==Cr&&(t=t.documentElement);for(var i=dr(e)?e:[e];t;){for(var o=0,a=i.length;a>o;o++)if((r=nr.data(t,i[o]))!==n)return r;t=t.parentNode||t.nodeType===Er&&t.host}}function Mt(t){for(_t(t,!0);t.firstChild;)t.removeChild(t.firstChild)}function Dt(t,e){e||_t(t);var n=t.parentNode;n&&n.removeChild(t)}function jt(e,n){n=n||t,"complete"===n.document.readyState?n.setTimeout(e):nr(n).on("load",e)}function Nt(t,e){var n=Lr[e.toLowerCase()];return n&&Ur[D(t)]&&n}function Rt(t,e){var n=t.nodeName;return("INPUT"===n||"TEXTAREA"===n)&&Vr[e]}function Pt(t,e){var n=function(n,r){n.isDefaultPrevented=function(){return n.defaultPrevented};var i=e[r||n.type],o=i?i.length:0;if(o){if(g(n.immediatePropagationStopped)){var a=n.stopImmediatePropagation;n.stopImmediatePropagation=function(){n.immediatePropagationStopped=!0,n.stopPropagation&&n.stopPropagation(),a&&a.call(n)}}n.isImmediatePropagationStopped=function(){return n.immediatePropagationStopped===!0},o>1&&(i=R(i));for(var s=0;o>s;s++)n.isImmediatePropagationStopped()||i[s].call(t,n)}};return n.elem=t,n}function Ft(){this.$get=function(){return f(bt,{hasClass:function(t,e){return t.attr&&(t=t[0]),At(t,e)},addClass:function(t,e){return t.attr&&(t=t[0]),Tt(t,e)},removeClass:function(t,e){return t.attr&&(t=t[0]),St(t,e)}})}}function Bt(t,e){var n=t&&t.$$hashKey;if(n)return"function"==typeof n&&(n=t.$$hashKey()),n;var r=typeof t;return n="function"==r||"object"==r&&null!==t?t.$$hashKey=r+":"+(e||c)():r+":"+t}function Lt(t,e){if(e){var n=0;this.nextUid=function(){return++n}}o(t,this.put,this)}function Ut(t){var e=t.toString().replace(Xr,""),n=e.match(qr);return n?"function("+(n[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function Vt(t,e,n){var r,i,a,s;if("function"==typeof t){if(!(r=t.$inject)){if(r=[],t.length){if(e)throw b(n)&&n||(n=t.name||Ut(t)),Yr("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",n);i=t.toString().replace(Xr,""),a=i.match(qr),o(a[1].split(Hr),function(t){t.replace(Wr,function(t,e,n){r.push(n)})})}t.$inject=r}}else dr(t)?(s=t.length-1,ot(t[s],"fn"),r=t.slice(0,s)):ot(t,"fn",!0);return r}function qt(t,e){function r(t){return function(e,n){return y(e)?void o(e,u(t)):t(e,n)}}function i(t,e){if(at(t,"service"),(x(e)||dr(e))&&(e=k.instantiate(e)),!e.$get)throw Yr("pget","Provider '{0}' must define $get factory method.",t);return E[t+w]=e}function a(t,e){return function(){var n=S.invoke(e,this);if(g(n))throw Yr("undef","Provider '{0}' must return a value from $get factory method.",t);return n}}function s(t,e,n){return i(t,{$get:n!==!1?a(t,e):e})}function c(t,e){return s(t,["$injector",function(t){return t.instantiate(e)}])}function l(t,e){return s(t,v(e),!1)}function f(t,e){at(t,"constant"),E[t]=e,A[t]=e}function h(t,e){var n=k.get(t+w),r=n.$get;n.$get=function(){var t=S.invoke(r,n);return S.invoke(e,null,{$delegate:t})}}function d(t){var e,n=[];return o(t,function(t){function r(t){var e,n;for(e=0,n=t.length;n>e;e++){var r=t[e],i=k.get(r[0]);i[r[1]].apply(i,r[2])}}if(!C.get(t)){C.put(t,!0);try{b(t)?(e=ir(t),n=n.concat(d(e.requires)).concat(e._runBlocks),r(e._invokeQueue),r(e._configBlocks)):x(t)?n.push(k.invoke(t)):dr(t)?n.push(k.invoke(t)):ot(t,"module")}catch(i){throw dr(t)&&(t=t[t.length-1]),i.message&&i.stack&&-1==i.stack.indexOf(i.message)&&(i=i.message+"\n"+i.stack),Yr("modulerr","Failed to instantiate module {0} due to:\n{1}",t,i.stack||i.message||i)}}}),n}function m(t,n){function r(e,r){if(t.hasOwnProperty(e)){if(t[e]===$)throw Yr("cdep","Circular dependency found: {0}",e+" <- "+_.join(" <- "));return t[e]}try{return _.unshift(e),t[e]=$,t[e]=n(e,r)}catch(i){throw t[e]===$&&delete t[e],i}finally{_.shift()}}function i(t,n,i,o){"string"==typeof i&&(o=i,i=null);var a,s,u,c=[],l=qt.$$annotate(t,e,o);for(s=0,a=l.length;a>s;s++){if(u=l[s],"string"!=typeof u)throw Yr("itkn","Incorrect injection token! Expected service name as string, got {0}",u);c.push(i&&i.hasOwnProperty(u)?i[u]:r(u,o))}return dr(t)&&(t=t[a]),t.apply(n,c)}function o(t,e,n){var r=Object.create((dr(t)?t[t.length-1]:t).prototype||null),o=i(t,r,e,n);return y(o)||x(o)?o:r}return{invoke:i,instantiate:o,get:r,annotate:qt.$$annotate,has:function(e){return E.hasOwnProperty(e+w)||t.hasOwnProperty(e)}}}e=e===!0;var $={},w="Provider",_=[],C=new Lt([],!0),E={$provide:{provider:r(i),factory:r(s),service:r(c),value:r(l),constant:r(f),decorator:h}},k=E.$injector=m(E,function(t,e){throw lr.isString(e)&&_.push(e),Yr("unpr","Unknown provider: {0}",_.join(" <- "))}),A={},S=A.$injector=m(A,function(t,e){var r=k.get(t+w,e);return S.invoke(r.$get,r,n,t)});return o(d(t),function(t){S.invoke(t||p)}),S}function Ht(){var t=!0;this.disableAutoScrolling=function(){t=!1},this.$get=["$window","$location","$rootScope",function(e,n,r){function i(t){var e=null;return Array.prototype.some.call(t,function(t){return"a"===D(t)?(e=t,!0):void 0}),e}function o(){var t=s.yOffset;if(x(t))t=t();else if(z(t)){var n=t[0],r=e.getComputedStyle(n);t="fixed"!==r.position?0:n.getBoundingClientRect().bottom}else w(t)||(t=0);return t}function a(t){if(t){t.scrollIntoView();var n=o();if(n){var r=t.getBoundingClientRect().top;e.scrollBy(0,r-n)}}else e.scrollTo(0,0)}function s(){var t,e=n.hash();e?(t=u.getElementById(e))?a(t):(t=i(u.getElementsByName(e)))?a(t):"top"===e&&a(null):a(null)}var u=e.document;return t&&r.$watch(function(){return n.hash()},function(t,e){(t!==e||""!==t)&&jt(function(){r.$evalAsync(s)})}),s}]}function Wt(){this.$get=["$$rAF","$timeout",function(t,e){return t.supported?function(e){return t(e)}:function(t){return e(t,0,!1)}}]}function Xt(t,e,r,i){function a(t){try{t.apply(null,B(arguments,1))}finally{if(C--,0===C)for(;E.length;)try{E.pop()()}catch(e){r.error(e)}}}function s(t){var e=t.indexOf("#");return-1===e?"":t.substr(e)}function u(t,e){!function n(){o(A,function(t){t()}),k=e(n,t)}()}function c(){f(),h()}function l(){try{return y.state}catch(t){}}function f(){S=l(),S=g(S)?null:S,P(S,j)&&(S=j),j=S}function h(){(O!==m.url()||T!==S)&&(O=m.url(),T=S,o(M,function(t){t(m.url(),S)}))}function d(t){try{return decodeURIComponent(t)}catch(e){return t}}var m=this,v=e[0],$=t.location,y=t.history,w=t.setTimeout,_=t.clearTimeout,x={};m.isMock=!1;var C=0,E=[];m.$$completeOutstandingRequest=a,m.$$incOutstandingRequestCount=function(){C++},m.notifyWhenNoOutstandingRequests=function(t){o(A,function(t){t()}),0===C?t():E.push(t)};var k,A=[];m.addPollFn=function(t){return g(k)&&u(100,w),A.push(t),t};var S,T,O=$.href,I=e.find("base"),z=null;f(),T=S,m.url=function(e,n,r){if(g(r)&&(r=null),$!==t.location&&($=t.location),y!==t.history&&(y=t.history),e){var o=T===r;if(O===e&&(!i.history||o))return m;var a=O&&we(O)===we(e);return O=e,T=r,!i.history||a&&o?((!a||z)&&(z=e),n?$.replace(e):a?$.hash=s(e):$.href=e):(y[n?"replaceState":"pushState"](r,"",e),f(),T=S),m}return z||$.href.replace(/%27/g,"'")},m.state=function(){return S};var M=[],D=!1,j=null;m.onUrlChange=function(e){return D||(i.history&&nr(t).on("popstate",c),nr(t).on("hashchange",c),D=!0),M.push(e),e},m.$$checkUrlChange=h,m.baseHref=function(){var t=I.attr("href");return t?t.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var N={},R="",F=m.baseHref();m.cookies=function(t,e){var i,o,a,s,u;if(!t){if(v.cookie!==R)for(R=v.cookie,o=R.split("; "),N={},s=0;s0&&(t=d(a.substring(0,u)),N[t]===n&&(N[t]=d(a.substring(u+1))));return N}e===n?v.cookie=encodeURIComponent(t)+"=;path="+F+";expires=Thu, 01 Jan 1970 00:00:00 GMT":b(e)&&(i=(v.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path="+F).length+1,i>4096&&r.warn("Cookie '"+t+"' possibly not set or overflowed because it was too large ("+i+" > 4096 bytes)!"))},m.defer=function(t,e){var n;return C++,n=w(function(){delete x[n],a(t)},e||0),x[n]=!0,n},m.defer.cancel=function(t){return x[t]?(delete x[t],_(t),a(p),!0):!1}}function Yt(){this.$get=["$window","$log","$sniffer","$document",function(t,e,n,r){return new Xt(t,r,e,n)}]}function Zt(){this.$get=function(){function t(t,n){function i(t){t!=h&&(d?d==t&&(d=t.n):d=t,o(t.n,t.p),o(t,h),h=t,h.n=null)}function o(t,e){t!=e&&(t&&(t.p=e),e&&(e.n=t))}if(t in e)throw r("$cacheFactory")("iid","CacheId '{0}' is already taken!",t);var a=0,s=f({},n,{id:t}),u={},c=n&&n.capacity||Number.MAX_VALUE,l={},h=null,d=null;return e[t]={put:function(t,e){if(cc&&this.remove(d.key),e},get:function(t){if(c").parent()[0])});var a=M(t,e,t,n,r,i);I.$$addScopeClass(t);var s=null;return function(e,n,r){it(e,"scope"),r=r||{};var i=r.parentBoundTranscludeFn,o=r.transcludeControllers,u=r.futureParentElement;i&&i.$$boundTransclude&&(i=i.$$boundTransclude),s||(s=z(u));var c;if(c="html"!==s?nr(J(s,nr("
").append(t).html())):n?Br.clone.call(t):t,o)for(var l in o)c.data("$"+l+"Controller",o[l].instance);return I.$$addScopeInfo(c,e),n&&n(c,e),a&&a(e,c,c,i),c}}function z(t){var e=t&&t[0];return e&&"foreignobject"!==D(e)&&e.toString().match(/SVG/)?"svg":"html"}function M(t,e,r,i,o,a){function s(t,r,i,o){var a,s,u,c,l,f,h,d,v;if(p){var g=r.length;for(v=new Array(g),l=0;ll;)u=v[m[l++]],a=m[l++],s=m[l++],a?(a.scope?(c=t.$new(),I.$$addScopeInfo(nr(u),c)):c=t,d=a.transcludeOnThisElement?N(t,a.transclude,o,a.elementTranscludeOnThisElement):!a.templateOnThisElement&&o?o:!o&&e?N(t,e):null,a(s,c,u,i,d)):s&&s(t,u.childNodes,n,o)}for(var u,c,l,f,h,d,p,m=[],v=0;v$;$++){var _=!1,x=!1;f=g[$],h=f.name,m=pr(f.value),p=Jt(h),(v=ft.test(p))&&(h=h.replace(Jr,"").substr(8).replace(/_(.)/g,function(t,e){return e.toUpperCase()}));var C=p.replace(/(Start|End)$/,"");W(C)&&p===C+"Start"&&(_=h,x=h.substr(0,h.length-5)+"end",h=h.substr(0,h.length-6)),d=Jt(h.toLowerCase()),u[d]=h,(v||!n.hasOwnProperty(d))&&(n[d]=m,Nt(t,d)&&(n[d]=!0)),tt(t,e,m,d,v),q(e,d,"A",r,i,_,x)}if(a=t.className,y(a)&&(a=a.animVal),b(a)&&""!==a)for(;o=l.exec(a);)d=Jt(o[2]),q(e,d,"C",r,i)&&(n[d]=pr(o[3])),a=a.substr(o.index+o[0].length);break;case _r:K(e,t.nodeValue);break;case xr:try{o=c.exec(t.nodeValue),o&&(d=Jt(o[1]),q(e,d,"M",r,i)&&(n[d]=pr(o[2])))}catch(E){}}return e.sort(Z),e}function F(t,e,n){var r=[],i=0;if(e&&t.hasAttribute&&t.hasAttribute(e)){do{if(!t)throw Kr("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",e,n);t.nodeType==br&&(t.hasAttribute(e)&&i++,t.hasAttribute(n)&&i--),r.push(t),t=t.nextSibling}while(i>0)}else r.push(t);return nr(r)}function L(t,e,n){return function(r,i,o,a,s){return i=F(i[0],e,n),t(r,i,o,a,s)}}function U(t,a,s,u,c,l,f,h,d){function p(t,e,n,r){t&&(n&&(t=L(t,n,r)),t.require=E.require,t.directiveName=A,(D===E||E.$$isolateScope)&&(t=rt(t,{isolateScope:!0})),f.push(t)),e&&(n&&(e=L(e,n,r)),e.require=E.require,e.directiveName=A,(D===E||E.$$isolateScope)&&(e=rt(e,{isolateScope:!0})),h.push(e))}function m(t,e,n,r){var i,a,s="data",u=!1,c=n;if(b(e)){if(a=e.match(g),e=e.substring(a[0].length),a[3]&&(a[1]?a[3]=null:a[1]=a[3]),"^"===a[1]?s="inheritedData":"^^"===a[1]&&(s="inheritedData",c=n.parent()),"?"===a[2]&&(u=!0),i=null,r&&"data"===s&&(i=r[e])&&(i=i.instance),i=i||c[s]("$"+e+"Controller"),!i&&!u)throw Kr("ctreq","Controller '{0}', required by directive '{1}', can't be found!",e,t);return i||null}return dr(e)&&(i=[],o(e,function(e){i.push(m(t,e,n,r))})),i}function w(t,e,i,u,c){function l(t,e,r){var i;return k(t)||(r=e,e=t,t=n),W&&(i=w),r||(r=W?x.parent():x),c(t,e,i,r,T)}var d,p,g,y,b,w,_,x,E;if(a===i?(E=s,x=s.$$element):(x=nr(i),E=new at(x,s)),D&&(b=e.$new(!0)),c&&(_=l,_.$$boundTransclude=c),M&&(C={},w={},o(M,function(t){var n,r={$scope:t===D||t.$$isolateScope?b:e,$element:x,$attrs:E,$transclude:_};y=t.controller,"@"==y&&(y=E[t.name]),n=$(y,r,!0,t.controllerAs),w[t.name]=n,W||x.data("$"+t.name+"Controller",n.instance),C[t.name]=n})),D){I.$$addScopeInfo(x,b,!0,!(j&&(j===D||j===D.$$originalDirective))),I.$$addScopeClass(x,!0);var A=C&&C[D.name],S=b;A&&A.identifier&&D.bindToController===!0&&(S=A.instance),o(b.$$isolateBindings=D.$$isolateBindings,function(t,n){var i,o,a,s,u=t.attrName,c=t.optional,l=t.mode;switch(l){case"@":E.$observe(u,function(t){S[n]=t}),E.$$observers[u].$$scope=e,E[u]&&(S[n]=r(E[u])(e));break;case"=":if(c&&!E[u])return;o=v(E[u]),s=o.literal?P:function(t,e){return t===e||t!==t&&e!==e},a=o.assign||function(){throw i=S[n]=o(e),Kr("nonassign","Expression '{0}' used with directive '{1}' is non-assignable!",E[u],D.name)},i=S[n]=o(e);var f=function(t){return s(t,S[n])||(s(t,i)?a(e,t=S[n]):S[n]=t),i=t};f.$stateful=!0;var h;h=t.collection?e.$watchCollection(E[u],f):e.$watch(v(E[u],f),null,o.literal),b.$on("$destroy",h);break;case"&":o=v(E[u]),S[n]=function(t){return o(e,t)}}})}for(C&&(o(C,function(t){t()}),C=null),d=0,p=f.length;p>d;d++)g=f[d],ot(g,g.isolateScope?b:e,x,E,g.require&&m(g.directiveName,g.require,x,w),_);var T=e;for(D&&(D.template||null===D.templateUrl)&&(T=b),t&&t(T,i.childNodes,n,c),d=h.length-1;d>=0;d--)g=h[d],ot(g,g.isolateScope?b:e,x,E,g.require&&m(g.directiveName,g.require,x,w),_)}d=d||{};for(var _,C,E,A,S,T,O,z=-Number.MAX_VALUE,M=d.controllerDirectives,D=d.newIsolateScopeDirective,j=d.templateDirective,N=d.nonTlbTranscludeDirective,U=!1,q=!1,W=d.hasElementTranscludeDirective,Z=s.$$element=nr(a),K=l,Q=u,tt=0,nt=t.length;nt>tt;tt++){E=t[tt];var it=E.$$start,st=E.$$end;if(it&&(Z=F(a,it,st)),S=n,z>E.priority)break;if((O=E.scope)&&(E.templateUrl||(y(O)?(G("new/isolated scope",D||_,E,Z),D=E):G("new/isolated scope",D,E,Z)),_=_||E),A=E.name,!E.templateUrl&&E.controller&&(O=E.controller,M=M||{},G("'"+A+"' controller",M[A],E,Z),M[A]=E),(O=E.transclude)&&(U=!0,E.$$tlb||(G("transclusion",N,E,Z),N=E),"element"==O?(W=!0,z=E.priority,S=Z,Z=s.$$element=nr(e.createComment(" "+A+": "+s[A]+" ")),a=Z[0],et(c,B(S),a),Q=I(S,u,z,K&&K.name,{nonTlbTranscludeDirective:N})):(S=nr(wt(a)).contents(),Z.empty(),Q=I(S,u))),E.template)if(q=!0,G("template",j,E,Z),j=E,O=x(E.template)?E.template(Z,s):E.template,O=lt(O),E.replace){if(K=E,S=vt(O)?[]:te(J(E.templateNamespace,pr(O))),a=S[0],1!=S.length||a.nodeType!==br)throw Kr("tplrt","Template for directive '{0}' must have exactly one root element. {1}",A,"");et(c,Z,a);var ut={$attr:{}},ct=R(a,[],ut),ft=t.splice(tt+1,t.length-(tt+1));D&&V(ct),t=t.concat(ct).concat(ft),X(s,ut),nt=t.length}else Z.html(O);if(E.templateUrl)q=!0,G("template",j,E,Z),j=E,E.replace&&(K=E),w=Y(t.splice(tt,t.length-tt),Z,s,c,U&&Q,f,h,{controllerDirectives:M,newIsolateScopeDirective:D,templateDirective:j,nonTlbTranscludeDirective:N}),nt=t.length;else if(E.compile)try{T=E.compile(Z,s,Q),x(T)?p(null,T,it,st):T&&p(T.pre,T.post,it,st)}catch(ht){i(ht,H(Z))}E.terminal&&(w.terminal=!0,z=Math.max(z,E.priority))}return w.scope=_&&_.scope===!0,w.transcludeOnThisElement=U,w.elementTranscludeOnThisElement=W,w.templateOnThisElement=q,w.transclude=Q,d.hasElementTranscludeDirective=W,w}function V(t){for(var e=0,n=t.length;n>e;e++)t[e]=d(t[e],{$$isolateScope:!0})}function q(e,r,o,u,c,l,f){if(r===c)return null;var h=null;if(a.hasOwnProperty(r))for(var p,m=t.get(r+s),v=0,g=m.length;g>v;v++)try{p=m[v],(u===n||u>p.priority)&&-1!=p.restrict.indexOf(o)&&(l&&(p=d(p,{ +$$start:l,$$end:f})),e.push(p),h=p)}catch($){i($)}return h}function W(e){if(a.hasOwnProperty(e))for(var n,r=t.get(e+s),i=0,o=r.length;o>i;i++)if(n=r[i],n.multiElement)return!0;return!1}function X(t,e){var n=e.$attr,r=t.$attr,i=t.$$element;o(t,function(r,i){"$"!=i.charAt(0)&&(e[i]&&e[i]!==r&&(r+=("style"===i?";":" ")+e[i]),t.$set(i,r,!0,n[i]))}),o(e,function(e,o){"class"==o?(O(i,e),t["class"]=(t["class"]?t["class"]+" ":"")+e):"style"==o?(i.attr("style",i.attr("style")+";"+e),t.style=(t.style?t.style+";":"")+e):"$"==o.charAt(0)||t.hasOwnProperty(o)||(t[o]=e,r[o]=n[o])})}function Y(t,e,n,r,i,a,s,c){var l,f,h=[],p=e[0],m=t.shift(),v=d(m,{templateUrl:null,transclude:null,replace:null,$$originalDirective:m}),g=x(m.templateUrl)?m.templateUrl(e,n):m.templateUrl,$=m.templateNamespace;return e.empty(),u(g).then(function(u){var d,b,w,_;if(u=lt(u),m.replace){if(w=vt(u)?[]:te(J($,pr(u))),d=w[0],1!=w.length||d.nodeType!==br)throw Kr("tplrt","Template for directive '{0}' must have exactly one root element. {1}",m.name,g);b={$attr:{}},et(r,e,d);var x=R(d,[],b);y(m.scope)&&V(x),t=x.concat(t),X(n,b)}else d=p,e.html(u);for(t.unshift(v),l=U(t,d,n,i,e,m,a,s,c),o(r,function(t,n){t==d&&(r[n]=e[0])}),f=M(e[0].childNodes,i);h.length;){var C=h.shift(),E=h.shift(),k=h.shift(),A=h.shift(),S=e[0];if(!C.$$destroyed){if(E!==p){var T=E.className;c.hasElementTranscludeDirective&&m.replace||(S=wt(d)),et(k,nr(E),S),O(nr(S),T)}_=l.transcludeOnThisElement?N(C,l.transclude,A):A,l(f,C,S,r,_)}}h=null}),function(t,e,n,r,i){var o=i;e.$$destroyed||(h?h.push(e,n,r,o):(l.transcludeOnThisElement&&(o=N(e,l.transclude,i)),l(f,e,n,r,o)))}}function Z(t,e){var n=e.priority-t.priority;return 0!==n?n:t.name!==e.name?t.name"+n+"",r.childNodes[0].childNodes;default:return n}}function Q(t,e){if("srcdoc"==e)return A.HTML;var n=D(t);return"xlinkHref"==e||"form"==n&&"action"==e||"img"!=n&&("src"==e||"ngSrc"==e)?A.RESOURCE_URL:void 0}function tt(t,e,n,i,o){var a=Q(t,i);o=h[i]||o;var s=r(n,!0,a,o);if(s){if("multiple"===i&&"select"===D(t))throw Kr("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",H(t));e.push({priority:100,compile:function(){return{pre:function(t,e,u){var c=u.$$observers||(u.$$observers={});if(w.test(i))throw Kr("nodomevents","Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.");var l=u[i];l!==n&&(s=l&&r(l,!0,a,o),n=l),s&&(u[i]=s(t),(c[i]||(c[i]=[])).$$inter=!0,(u.$$observers&&u.$$observers[i].$$scope||t).$watch(s,function(t,e){"class"===i&&t!=e?u.$updateClass(t,e):u.$set(i,t)}))}}}})}}function et(t,n,r){var i,o,a=n[0],s=n.length,u=a.parentNode;if(t)for(i=0,o=t.length;o>i;i++)if(t[i]==a){t[i++]=r;for(var c=i,l=c+s-1,f=t.length;f>c;c++,l++)f>l?t[c]=t[l]:delete t[c];t.length-=s-1,t.context===a&&(t.context=r);break}u&&u.replaceChild(r,a);var h=e.createDocumentFragment();h.appendChild(a),nr(r).data(nr(a).data()),rr?(hr=!0,rr.cleanData([a])):delete nr.cache[a[nr.expando]];for(var d=1,p=n.length;p>d;d++){var m=n[d];nr(m).remove(),h.appendChild(m),delete n[d]}n[0]=r,n.length=1}function rt(t,e){return f(function(){return t.apply(null,arguments)},t,e)}function ot(t,e,n,r,o,a){try{t(e,n,r,o,a)}catch(s){i(s,H(n))}}var at=function(t,e){if(e){var n,r,i,o=Object.keys(e);for(n=0,r=o.length;r>n;n++)i=o[n],this[i]=e[i]}else this.$attr={};this.$$element=t};at.prototype={$normalize:Jt,$addClass:function(t){t&&t.length>0&&S.addClass(this.$$element,t)},$removeClass:function(t){t&&t.length>0&&S.removeClass(this.$$element,t)},$updateClass:function(t,e){var n=Qt(t,e);n&&n.length&&S.addClass(this.$$element,n);var r=Qt(e,t);r&&r.length&&S.removeClass(this.$$element,r)},$set:function(t,e,r,a){var s,u=this.$$element[0],c=Nt(u,t),l=Rt(u,t),f=t;if(c?(this.$$element.prop(t,e),a=c):l&&(this[l]=e,f=l),this[t]=e,a?this.$attr[t]=a:(a=this.$attr[t],a||(this.$attr[t]=a=nt(t,"-"))),s=D(this.$$element),"a"===s&&"href"===t||"img"===s&&"src"===t)this[t]=e=T(e,"src"===t);else if("img"===s&&"srcset"===t){for(var h="",d=pr(e),p=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,m=/\s/.test(d)?p:/(,)/,v=d.split(m),g=Math.floor(v.length/2),$=0;g>$;$++){var y=2*$;h+=T(pr(v[y]),!0),h+=" "+pr(v[y+1])}var b=pr(v[2*$]).split(/\s/);h+=T(pr(b[0]),!0),2===b.length&&(h+=" "+pr(b[1])),this[t]=e=h}r!==!1&&(null===e||e===n?this.$$element.removeAttr(a):this.$$element.attr(a,e));var w=this.$$observers;w&&o(w[f],function(t){try{t(e)}catch(n){i(n)}})},$observe:function(t,e){var n=this,r=n.$$observers||(n.$$observers=ct()),i=r[t]||(r[t]=[]);return i.push(e),C.$evalAsync(function(){!i.$$inter&&n.hasOwnProperty(t)&&e(n[t])}),function(){j(i,e)}}};var st=r.startSymbol(),ut=r.endSymbol(),lt="{{"==st||"}}"==ut?m:function(t){return t.replace(/\{\{/g,st).replace(/}}/g,ut)},ft=/^ngAttr[A-Z]/;return I.$$addBindingInfo=_?function(t,e){var n=t.data("$binding")||[];dr(e)?n=n.concat(e):n.push(e),t.data("$binding",n)}:p,I.$$addBindingClass=_?function(t){O(t,"ng-binding")}:p,I.$$addScopeInfo=_?function(t,e,n,r){var i=n?r?"$isolateScopeNoTemplate":"$isolateScope":"$scope";t.data(i,e)}:p,I.$$addScopeClass=_?function(t,e){O(t,e?"ng-isolate-scope":"ng-scope")}:p,I}]}function Jt(t){return mt(t.replace(Jr,""))}function Qt(t,e){var n="",r=t.split(/\s+/),i=e.split(/\s+/);t:for(var o=0;o0?" ":"")+a}return n}function te(t){t=nr(t);var e=t.length;if(1>=e)return t;for(;e--;){var n=t[e];n.nodeType===xr&&ar.call(t,e,1)}return t}function ee(){var t={},e=!1,i=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(e,n){at(e,"controller"),y(e)?f(t,e):t[e]=n},this.allowGlobals=function(){e=!0},this.$get=["$injector","$window",function(o,a){function s(t,e,n,i){if(!t||!y(t.$scope))throw r("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",i,e);t.$scope[e]=n}return function(r,u,c,l){var h,d,p,m;if(c=c===!0,l&&b(l)&&(m=l),b(r)){if(d=r.match(i),!d)throw Qr("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",r);p=d[1],m=m||d[3],r=t.hasOwnProperty(p)?t[p]:st(u.$scope,p,!0)||(e?st(a,p,!0):n),ot(r,p,!0)}if(c){var v=(dr(r)?r[r.length-1]:r).prototype;return h=Object.create(v||null),m&&s(u,m,h,p||r.name),f(function(){return o.invoke(r,h,u,p),h},{instance:h,identifier:m})}return h=o.instantiate(r,u,p),m&&s(u,m,h,p||r.name),h}}]}function ne(){this.$get=["$window",function(t){return nr(t.document)}]}function re(){this.$get=["$log",function(t){return function(e,n){t.error.apply(t,arguments)}}]}function ie(t,e){if(b(t)){var n=t.replace(ii,"").trim();if(n){var r=e("Content-Type");(r&&0===r.indexOf(ti)||oe(n))&&(t=q(n))}}return t}function oe(t){var e=t.match(ni);return e&&ri[e[0]].test(t)}function ae(t){var e,n,r,i=ct();return t?(o(t.split("\n"),function(t){r=t.indexOf(":"),e=Gn(pr(t.substr(0,r))),n=pr(t.substr(r+1)),e&&(i[e]=i[e]?i[e]+", "+n:n)}),i):i}function se(t){var e=y(t)?t:n;return function(n){if(e||(e=ae(t)),n){var r=e[Gn(n)];return void 0===r&&(r=null),r}return e}}function ue(t,e,n,r){return x(r)?r(t,e,n):(o(r,function(r){t=r(t,e,n)}),t)}function ce(t){return t>=200&&300>t}function le(){var t=this.defaults={transformResponse:[ie],transformRequest:[function(t){return!y(t)||A(t)||T(t)||S(t)?t:V(t)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:R(ei),put:R(ei),patch:R(ei)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},e=!1;this.useApplyAsync=function(t){return $(t)?(e=!!t,this):e};var i=this.interceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,u,c,l,h,d){function p(e){function i(t){var e=f({},t);return t.data?e.data=ue(t.data,t.headers,t.status,u.transformResponse):e.data=t.data,ce(t.status)?e:h.reject(e)}function a(t){var e,n={};return o(t,function(t,r){x(t)?(e=t(),null!=e&&(n[r]=e)):n[r]=t}),n}function s(e){var n,r,i,o=t.headers,s=f({},e.headers);o=f({},o.common,o[Gn(e.method)]);t:for(n in o){r=Gn(n);for(i in s)if(Gn(i)===r)continue t;s[n]=o[n]}return a(s)}if(!lr.isObject(e))throw r("$http")("badreq","Http request configuration must be an object. Received: {0}",e);var u=f({method:"get",transformRequest:t.transformRequest,transformResponse:t.transformResponse},e);u.headers=s(e),u.method=Jn(u.method);var c=function(e){var r=e.headers,a=ue(e.data,se(r),n,e.transformRequest);return g(a)&&o(r,function(t,e){"content-type"===Gn(e)&&delete r[e]}),g(e.withCredentials)&&!g(t.withCredentials)&&(e.withCredentials=t.withCredentials),w(e,a).then(i,i)},l=[c,n],d=h.when(u);for(o(k,function(t){(t.request||t.requestError)&&l.unshift(t.request,t.requestError),(t.response||t.responseError)&&l.push(t.response,t.responseError)});l.length;){var p=l.shift(),m=l.shift();d=d.then(p,m)}return d.success=function(t){return ot(t,"fn"),d.then(function(e){t(e.data,e.status,e.headers,u)}),d},d.error=function(t){return ot(t,"fn"),d.then(null,function(e){t(e.data,e.status,e.headers,u)}),d},d}function m(t){o(arguments,function(t){p[t]=function(e,n){return p(f(n||{},{method:t,url:e}))}})}function v(t){o(arguments,function(t){p[t]=function(e,n,r){return p(f(r||{},{method:t,url:e,data:n}))}})}function w(r,i){function o(t,n,r,i){function o(){s(n,t,r,i)}d&&(ce(t)?d.put(_,[t,n,ae(r),i]):d.remove(_)),e?l.$applyAsync(o):(o(),l.$$phase||l.$apply())}function s(t,e,n,i){e=e>=-1?e:0,(ce(e)?v.resolve:v.reject)({data:t,status:e,headers:se(n),config:r,statusText:i})}function c(t){s(t.data,t.status,R(t.headers()),t.statusText)}function f(){var t=p.pendingRequests.indexOf(r);-1!==t&&p.pendingRequests.splice(t,1)}var d,m,v=h.defer(),b=v.promise,w=r.headers,_=C(r.url,r.params);if(p.pendingRequests.push(r),b.then(f,f),!r.cache&&!t.cache||r.cache===!1||"GET"!==r.method&&"JSONP"!==r.method||(d=y(r.cache)?r.cache:y(t.cache)?t.cache:E),d&&(m=d.get(_),$(m)?I(m)?m.then(c,c):dr(m)?s(m[1],m[0],R(m[2]),m[3]):s(m,200,{},"OK"):d.put(_,b)),g(m)){var x=an(r.url)?u.cookies()[r.xsrfCookieName||t.xsrfCookieName]:n;x&&(w[r.xsrfHeaderName||t.xsrfHeaderName]=x),a(r.method,_,i,o,w,r.timeout,r.withCredentials,r.responseType)}return b}function C(t,e){if(!e)return t;var n=[];return s(e,function(t,e){null===t||g(t)||(dr(t)||(t=[t]),o(t,function(t){y(t)&&(t=_(t)?t.toISOString():V(t)),n.push(G(e)+"="+G(t))}))}),n.length>0&&(t+=(-1==t.indexOf("?")?"?":"&")+n.join("&")),t}var E=c("$http"),k=[];return o(i,function(t){k.unshift(b(t)?d.get(t):d.invoke(t))}),p.pendingRequests=[],m("get","delete","head","jsonp"),v("post","put","patch"),p.defaults=t,p}]}function fe(){return new t.XMLHttpRequest}function he(){this.$get=["$browser","$window","$document",function(t,e,n){return de(t,fe,t.defer,e.angular.callbacks,n[0])}]}function de(t,e,r,i,a){function s(t,e,n){var r=a.createElement("script"),o=null;return r.type="text/javascript",r.src=t,r.async=!0,o=function(t){Or(r,"load",o),Or(r,"error",o),a.body.removeChild(r),r=null;var s=-1,u="unknown";t&&("load"!==t.type||i[e].called||(t={type:"error"}),u=t.type,s="error"===t.type?404:200),n&&n(s,u)},Tr(r,"load",o),Tr(r,"error",o),a.body.appendChild(r),o}return function(a,u,c,l,f,h,d,m){function v(){b&&b(),w&&w.abort()}function g(e,i,o,a,s){C!==n&&r.cancel(C),b=w=null,e(i,o,a,s),t.$$completeOutstandingRequest(p)}if(t.$$incOutstandingRequestCount(),u=u||t.url(),"jsonp"==Gn(a)){var y="_"+(i.counter++).toString(36);i[y]=function(t){i[y].data=t,i[y].called=!0};var b=s(u.replace("JSON_CALLBACK","angular.callbacks."+y),y,function(t,e){g(l,t,i[y].data,"",e),i[y]=p})}else{var w=e();w.open(a,u,!0),o(f,function(t,e){$(t)&&w.setRequestHeader(e,t)}),w.onload=function(){var t=w.statusText||"",e="response"in w?w.response:w.responseText,n=1223===w.status?204:w.status;0===n&&(n=e?200:"file"==on(u).protocol?404:0),g(l,n,e,w.getAllResponseHeaders(),t)};var _=function(){g(l,-1,null,null,"")};if(w.onerror=_,w.onabort=_,d&&(w.withCredentials=!0),m)try{w.responseType=m}catch(x){if("json"!==m)throw x}w.send(c||null)}if(h>0)var C=r(v,h);else I(h)&&h.then(v)}}function pe(){var t="{{",e="}}";this.startSymbol=function(e){return e?(t=e,this):t},this.endSymbol=function(t){return t?(e=t,this):e},this.$get=["$parse","$exceptionHandler","$sce",function(n,r,i){function o(t){return"\\\\\\"+t}function a(o,a,h,d){function p(n){return n.replace(c,t).replace(l,e)}function m(t){try{return t=T(t),d&&!$(t)?t:O(t)}catch(e){var n=oi("interr","Can't interpolate: {0}\n{1}",o,e.toString());r(n)}}d=!!d;for(var v,y,b,w=0,_=[],C=[],E=o.length,k=[],A=[];E>w;){if(-1==(v=o.indexOf(t,w))||-1==(y=o.indexOf(e,v+s))){w!==E&&k.push(p(o.substring(w)));break}w!==v&&k.push(p(o.substring(w,v))),b=o.substring(v+s,y),_.push(b),C.push(n(b,m)),w=y+u,A.push(k.length),k.push("")}if(h&&k.length>1)throw oi("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",o);if(!a||_.length){var S=function(t){for(var e=0,n=_.length;n>e;e++){if(d&&g(t[e]))return;k[A[e]]=t[e]}return k.join("")},T=function(t){return h?i.getTrusted(h,t):i.valueOf(t)},O=function(t){if(null==t)return"";switch(typeof t){case"string":break;case"number":t=""+t;break;default:t=V(t)}return t};return f(function(t){var e=0,n=_.length,i=new Array(n);try{for(;n>e;e++)i[e]=C[e](t);return S(i)}catch(a){var s=oi("interr","Can't interpolate: {0}\n{1}",o,a.toString());r(s)}},{exp:o,expressions:_,$$watchDelegate:function(t,e,n){var r;return t.$watchGroup(C,function(n,i){var o=S(n);x(e)&&e.call(this,o,n!==i?r:o,t),r=o},n)}})}}var s=t.length,u=e.length,c=new RegExp(t.replace(/./g,o),"g"),l=new RegExp(e.replace(/./g,o),"g");return a.startSymbol=function(){return t},a.endSymbol=function(){return e},a}]}function me(){this.$get=["$rootScope","$window","$q","$$q",function(t,e,n,r){function i(i,a,s,u){var c=e.setInterval,l=e.clearInterval,f=0,h=$(u)&&!u,d=(h?r:n).defer(),p=d.promise;return s=$(s)?s:0,p.then(null,null,i),p.$$intervalId=c(function(){d.notify(f++),s>0&&f>=s&&(d.resolve(f),l(p.$$intervalId),delete o[p.$$intervalId]),h||t.$apply()},a),o[p.$$intervalId]=d,p}var o={};return i.cancel=function(t){return t&&t.$$intervalId in o?(o[t.$$intervalId].reject("canceled"),e.clearInterval(t.$$intervalId),delete o[t.$$intervalId],!0):!1},i}]}function ve(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(t){return 1===t?"one":"other"}}}}function ge(t){for(var e=t.split("/"),n=e.length;n--;)e[n]=Z(e[n]);return e.join("/")}function $e(t,e){var n=on(t);e.$$protocol=n.protocol,e.$$host=n.hostname,e.$$port=h(n.port)||si[n.protocol]||null}function ye(t,e){var n="/"!==t.charAt(0);n&&(t="/"+t);var r=on(t);e.$$path=decodeURIComponent(n&&"/"===r.pathname.charAt(0)?r.pathname.substring(1):r.pathname),e.$$search=X(r.search),e.$$hash=decodeURIComponent(r.hash),e.$$path&&"/"!=e.$$path.charAt(0)&&(e.$$path="/"+e.$$path)}function be(t,e){return 0===e.indexOf(t)?e.substr(t.length):void 0}function we(t){var e=t.indexOf("#");return-1==e?t:t.substr(0,e)}function _e(t){return t.replace(/(#.+)|#$/,"$1")}function xe(t){return t.substr(0,we(t).lastIndexOf("/")+1)}function Ce(t){return t.substring(0,t.indexOf("/",t.indexOf("//")+2))}function Ee(t,e,r){this.$$html5=!0,r=r||"",$e(t,this),this.$$parse=function(t){var n=be(e,t);if(!b(n))throw ui("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',t,e);ye(n,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var t=Y(this.$$search),n=this.$$hash?"#"+Z(this.$$hash):"";this.$$url=ge(this.$$path)+(t?"?"+t:"")+n,this.$$absUrl=e+this.$$url.substr(1)},this.$$parseLinkUrl=function(i,o){if(o&&"#"===o[0])return this.hash(o.slice(1)),!0;var a,s,u;return(a=be(t,i))!==n?(s=a,u=(a=be(r,a))!==n?e+(be("/",a)||a):t+s):(a=be(e,i))!==n?u=e+a:e==i+"/"&&(u=e),u&&this.$$parse(u),!!u}}function ke(t,e,n){$e(t,this),this.$$parse=function(r){function i(t,e,n){var r,i=/^\/[A-Z]:(\/.*)/;return 0===e.indexOf(n)&&(e=e.replace(n,"")),i.exec(e)?t:(r=i.exec(t),r?r[1]:t)}var o,a=be(t,r)||be(e,r);g(a)||"#"!==a.charAt(0)?this.$$html5?o=a:(o="",g(a)&&(t=r,this.replace())):(o=be(n,a),g(o)&&(o=a)),ye(o,this),this.$$path=i(this.$$path,o,t),this.$$compose()},this.$$compose=function(){var e=Y(this.$$search),r=this.$$hash?"#"+Z(this.$$hash):"";this.$$url=ge(this.$$path)+(e?"?"+e:"")+r,this.$$absUrl=t+(this.$$url?n+this.$$url:"")},this.$$parseLinkUrl=function(e,n){return we(t)==we(e)?(this.$$parse(e),!0):!1}}function Ae(t,e,n){this.$$html5=!0,ke.apply(this,arguments),this.$$parseLinkUrl=function(r,i){if(i&&"#"===i[0])return this.hash(i.slice(1)),!0;var o,a;return t==we(r)?o=r:(a=be(e,r))?o=t+n+a:e===r+"/"&&(o=e),o&&this.$$parse(o),!!o},this.$$compose=function(){var e=Y(this.$$search),r=this.$$hash?"#"+Z(this.$$hash):"";this.$$url=ge(this.$$path)+(e?"?"+e:"")+r,this.$$absUrl=t+n+this.$$url}}function Se(t){return function(){return this[t]}}function Te(t,e){return function(n){return g(n)?this[t]:(this[t]=e(n),this.$$compose(),this)}}function Oe(){var t="",e={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(e){return $(e)?(t=e,this):t},this.html5Mode=function(t){return O(t)?(e.enabled=t,this):y(t)?(O(t.enabled)&&(e.enabled=t.enabled),O(t.requireBase)&&(e.requireBase=t.requireBase),O(t.rewriteLinks)&&(e.rewriteLinks=t.rewriteLinks),this):e},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(n,r,i,o,a){function s(t,e,n){var i=c.url(),o=c.$$state;try{r.url(t,e,n),c.$$state=r.state()}catch(a){throw c.url(i),c.$$state=o,a}}function u(t,e){n.$broadcast("$locationChangeSuccess",c.absUrl(),t,c.$$state,e)}var c,l,f,h=r.baseHref(),d=r.url();if(e.enabled){if(!h&&e.requireBase)throw ui("nobase","$location in HTML5 mode requires a tag to be present!");f=Ce(d)+(h||"/"),l=i.history?Ee:Ae}else f=we(d),l=ke;var p=xe(f);c=new l(f,p,"#"+t),c.$$parseLinkUrl(d,d),c.$$state=r.state();var m=/^\s*(javascript|mailto):/i;o.on("click",function(t){if(e.rewriteLinks&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&2!=t.which&&2!=t.button){for(var i=nr(t.target);"a"!==D(i[0]);)if(i[0]===o[0]||!(i=i.parent())[0])return;var s=i.prop("href"),u=i.attr("href")||i.attr("xlink:href");y(s)&&"[object SVGAnimatedString]"===s.toString()&&(s=on(s.animVal).href),m.test(s)||!s||i.attr("target")||t.isDefaultPrevented()||c.$$parseLinkUrl(s,u)&&(t.preventDefault(),c.absUrl()!=r.url()&&(n.$apply(),a.angular["ff-684208-preventDefault"]=!0))}}),_e(c.absUrl())!=_e(d)&&r.url(c.absUrl(),!0);var v=!0;return r.onUrlChange(function(t,e){return g(be(p,t))?void(a.location.href=t):(n.$evalAsync(function(){var r,i=c.absUrl(),o=c.$$state;c.$$parse(t),c.$$state=e,r=n.$broadcast("$locationChangeStart",t,i,e,o).defaultPrevented,c.absUrl()===t&&(r?(c.$$parse(i),c.$$state=o,s(i,!1,o)):(v=!1,u(i,o)))}),void(n.$$phase||n.$digest()))}),n.$watch(function(){var t=_e(r.url()),e=_e(c.absUrl()),o=r.state(),a=c.$$replace,l=t!==e||c.$$html5&&i.history&&o!==c.$$state;(v||l)&&(v=!1,n.$evalAsync(function(){var e=c.absUrl(),r=n.$broadcast("$locationChangeStart",e,t,c.$$state,o).defaultPrevented;c.absUrl()===e&&(r?(c.$$parse(t),c.$$state=o):(l&&s(e,a,o===c.$$state?null:c.$$state),u(t,o)))})),c.$$replace=!1}),c}]}function Ie(){var t=!0,e=this;this.debugEnabled=function(e){return $(e)?(t=e,this):t},this.$get=["$window",function(n){function r(t){return t instanceof Error&&(t.stack?t=t.message&&-1===t.stack.indexOf(t.message)?"Error: "+t.message+"\n"+t.stack:t.stack:t.sourceURL&&(t=t.message+"\n"+t.sourceURL+":"+t.line)),t}function i(t){var e=n.console||{},i=e[t]||e.log||p,a=!1;try{a=!!i.apply}catch(s){}return a?function(){var t=[];return o(arguments,function(e){t.push(r(e))}),i.apply(e,t)}:function(t,e){i(t,null==e?"":e)}}return{log:i("log"),info:i("info"),warn:i("warn"),error:i("error"),debug:function(){var n=i("debug");return function(){t&&n.apply(e,arguments)}}()}}]}function ze(t,e){if("__defineGetter__"===t||"__defineSetter__"===t||"__lookupGetter__"===t||"__lookupSetter__"===t||"__proto__"===t)throw li("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",e);return t}function Me(t,e){if(t+="",!b(t))throw li("iseccst","Cannot convert object to primitive value! Expression: {0}",e);return t}function De(t,e){if(t){if(t.constructor===t)throw li("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",e);if(t.window===t)throw li("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",e);if(t.children&&(t.nodeName||t.prop&&t.attr&&t.find))throw li("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",e);if(t===Object)throw li("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",e)}return t}function je(t,e){if(t){if(t.constructor===t)throw li("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",e);if(t===fi||t===hi||t===di)throw li("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",e)}}function Ne(t){return t.constant}function Re(t,e,n,r,i){De(t,i),De(e,i);for(var o,a=n.split("."),s=0;a.length>1;s++){o=ze(a.shift(),i);var u=0===s&&e&&e[o]||t[o];u||(u={},t[o]=u),t=De(u,i)}return o=ze(a.shift(),i),De(t[o],i),t[o]=r,r}function Pe(t){return"constructor"==t}function Fe(t,e,r,i,o,a,s){ze(t,a),ze(e,a),ze(r,a),ze(i,a),ze(o,a);var u=function(t){return De(t,a)},c=s||Pe(t)?u:m,l=s||Pe(e)?u:m,f=s||Pe(r)?u:m,h=s||Pe(i)?u:m,d=s||Pe(o)?u:m;return function(a,s){var u=s&&s.hasOwnProperty(t)?s:a;return null==u?u:(u=c(u[t]),e?null==u?n:(u=l(u[e]),r?null==u?n:(u=f(u[r]),i?null==u?n:(u=h(u[i]),o?null==u?n:u=d(u[o]):u):u):u):u)}}function Be(t,e){return function(n,r){return t(n,r,De,e)}}function Le(t,e,r){var i=e.expensiveChecks,a=i?bi:yi,s=a[t];if(s)return s;var u=t.split("."),c=u.length;if(e.csp)s=6>c?Fe(u[0],u[1],u[2],u[3],u[4],r,i):function(t,e){var o,a=0;do o=Fe(u[a++],u[a++],u[a++],u[a++],u[a++],r,i)(t,e),e=n,t=o;while(c>a);return o};else{var l="";i&&(l+="s = eso(s, fe);\nl = eso(l, fe);\n");var f=i;o(u,function(t,e){ze(t,r);var n=(e?"s":'((l&&l.hasOwnProperty("'+t+'"))?l:s)')+"."+t;(i||Pe(t))&&(n="eso("+n+", fe)",f=!0),l+="if(s == null) return undefined;\ns="+n+";\n"}),l+="return s;";var h=new Function("s","l","eso","fe",l);h.toString=v(l),f&&(h=Be(h,r)),s=h}return s.sharedGetter=!0,s.assign=function(e,n,r){return Re(e,r,t,n,t)},a[t]=s,s}function Ue(t){return x(t.valueOf)?t.valueOf():wi.call(t)}function Ve(){var t=ct(),e=ct();this.$get=["$filter","$sniffer",function(n,r){function i(t){var e=t;return t.sharedGetter&&(e=function(e,n){return t(e,n)},e.literal=t.literal,e.constant=t.constant,e.assign=t.assign),e}function a(t,e){for(var n=0,r=t.length;r>n;n++){var i=t[n];i.constant||(i.inputs?a(i.inputs,e):-1===e.indexOf(i)&&e.push(i))}return e}function s(t,e){return null==t||null==e?t===e:"object"==typeof t&&(t=Ue(t),"object"==typeof t)?!1:t===e||t!==t&&e!==e}function u(t,e,n,r){var i,o=r.$$inputs||(r.$$inputs=a(r.inputs,[]));if(1===o.length){var u=s;return o=o[0],t.$watch(function(t){var e=o(t);return s(e,u)||(i=r(t),u=e&&Ue(e)),i},e,n)}for(var c=[],l=0,f=o.length;f>l;l++)c[l]=s;return t.$watch(function(t){for(var e=!1,n=0,a=o.length;a>n;n++){var u=o[n](t);(e||(e=!s(u,c[n])))&&(c[n]=u&&Ue(u))}return e&&(i=r(t)),i},e,n)}function c(t,e,n,r){var i,o;return i=t.$watch(function(t){return r(t)},function(t,n,r){o=t,x(e)&&e.apply(this,arguments),$(t)&&r.$$postDigest(function(){$(o)&&i()})},n)}function l(t,e,n,r){function i(t){var e=!0;return o(t,function(t){$(t)||(e=!1)}),e}var a,s;return a=t.$watch(function(t){return r(t)},function(t,n,r){s=t,x(e)&&e.call(this,t,n,r),i(t)&&r.$$postDigest(function(){i(s)&&a()})},n)}function f(t,e,n,r){var i;return i=t.$watch(function(t){return r(t)},function(t,n,r){x(e)&&e.apply(this,arguments),i()},n)}function h(t,e){if(!e)return t;var n=t.$$watchDelegate,r=n!==l&&n!==c,i=r?function(n,r){var i=t(n,r);return e(i,n,r)}:function(n,r){var i=t(n,r),o=e(i,n,r);return $(i)?o:i};return t.$$watchDelegate&&t.$$watchDelegate!==u?i.$$watchDelegate=t.$$watchDelegate:e.$stateful||(i.$$watchDelegate=u,i.inputs=[t]),i}var d={csp:r.csp,expensiveChecks:!1},m={csp:r.csp,expensiveChecks:!0};return function(r,o,a){var s,v,g;switch(typeof r){case"string":g=r=r.trim();var $=a?e:t;if(s=$[g],!s){":"===r.charAt(0)&&":"===r.charAt(1)&&(v=!0,r=r.substring(2));var y=a?m:d,b=new gi(y),w=new $i(b,n,y);s=w.parse(r),s.constant?s.$$watchDelegate=f:v?(s=i(s),s.$$watchDelegate=s.literal?l:c):s.inputs&&(s.$$watchDelegate=u),$[g]=s}return h(s,o);case"function":return h(r,o);default:return h(p,o)}}}]}function qe(){this.$get=["$rootScope","$exceptionHandler",function(t,e){return We(function(e){t.$evalAsync(e)},e)}]}function He(){this.$get=["$browser","$exceptionHandler",function(t,e){return We(function(e){t.defer(e)},e)}]}function We(t,e){function i(t,e,n){function r(e){return function(n){i||(i=!0,e.call(t,n))}}var i=!1;return[r(e),r(n)]}function a(){this.$$state={status:0}}function s(t,e){return function(n){e.call(t,n)}}function u(t){var r,i,o;o=t.pending,t.processScheduled=!1,t.pending=n;for(var a=0,s=o.length;s>a;++a){i=o[a][0],r=o[a][t.status];try{x(r)?i.resolve(r(t.value)):1===t.status?i.resolve(t.value):i.reject(t.value)}catch(u){i.reject(u),e(u)}}}function c(e){!e.processScheduled&&e.pending&&(e.processScheduled=!0,t(function(){u(e)}))}function l(){this.promise=new a,this.resolve=s(this,this.resolve),this.reject=s(this,this.reject),this.notify=s(this,this.notify)}function f(t){var e=new l,n=0,r=dr(t)?[]:{};return o(t,function(t,i){n++,g(t).then(function(t){r.hasOwnProperty(i)||(r[i]=t,--n||e.resolve(r))},function(t){r.hasOwnProperty(i)||e.reject(t)})}),0===n&&e.resolve(r),e.promise}var h=r("$q",TypeError),d=function(){return new l};a.prototype={then:function(t,e,n){var r=new l;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([r,t,e,n]),this.$$state.status>0&&c(this.$$state),r.promise},"catch":function(t){return this.then(null,t)},"finally":function(t,e){return this.then(function(e){return v(e,!0,t)},function(e){return v(e,!1,t)},e)}},l.prototype={resolve:function(t){this.promise.$$state.status||(t===this.promise?this.$$reject(h("qcycle","Expected promise to be resolved with value other than itself '{0}'",t)):this.$$resolve(t))},$$resolve:function(t){var n,r;r=i(this,this.$$resolve,this.$$reject);try{(y(t)||x(t))&&(n=t&&t.then),x(n)?(this.promise.$$state.status=-1,n.call(t,r[0],r[1],this.notify)):(this.promise.$$state.value=t,this.promise.$$state.status=1,c(this.promise.$$state))}catch(o){r[1](o),e(o)}},reject:function(t){this.promise.$$state.status||this.$$reject(t)},$$reject:function(t){this.promise.$$state.value=t,this.promise.$$state.status=2,c(this.promise.$$state)},notify:function(n){var r=this.promise.$$state.pending;this.promise.$$state.status<=0&&r&&r.length&&t(function(){for(var t,i,o=0,a=r.length;a>o;o++){i=r[o][0],t=r[o][3];try{i.notify(x(t)?t(n):n)}catch(s){e(s)}}})}};var p=function(t){var e=new l;return e.reject(t),e.promise},m=function(t,e){var n=new l;return e?n.resolve(t):n.reject(t),n.promise},v=function(t,e,n){var r=null;try{x(n)&&(r=n())}catch(i){return m(i,!1)}return I(r)?r.then(function(){return m(t,e)},function(t){return m(t,!1)}):m(t,e)},g=function(t,e,n,r){var i=new l;return i.resolve(t),i.promise.then(e,n,r)},$=function b(t){function e(t){r.resolve(t)}function n(t){r.reject(t)}if(!x(t))throw h("norslvr","Expected resolverFn, got '{0}'",t);if(!(this instanceof b))return new b(t);var r=new l;return t(e,n),r.promise};return $.defer=d,$.reject=p,$.when=g,$.all=f,$}function Xe(){this.$get=["$window","$timeout",function(t,e){function n(){for(var t=0;t=0&&(l[e]=null,e=null,0===--c&&u&&(u(),u=null,l.length=0))}}var i=t.requestAnimationFrame||t.webkitRequestAnimationFrame,o=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.webkitCancelRequestAnimationFrame,a=!!i,s=a?function(t){var e=i(t);return function(){o(e)}}:function(t){var n=e(t,16.66,!1);return function(){e.cancel(n)}};r.supported=a;var u,c=0,l=[];return r}]}function Ye(){function t(t){function e(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$id=c(),this.$$ChildScope=null}return e.prototype=t,e}var e=10,n=r("$rootScope"),a=null,s=null;this.digestTtl=function(t){return arguments.length&&(e=t),e},this.$get=["$injector","$exceptionHandler","$parse","$browser",function(r,u,l,f){function h(t){t.currentScope.$$destroyed=!0}function d(){this.$id=c(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$isolateBindings=null}function m(t){if(C.$$phase)throw n("inprog","{0} already in progress",C.$$phase);C.$$phase=t}function v(){C.$$phase=null}function $(t,e,n){do t.$$listenerCount[n]-=e,0===t.$$listenerCount[n]&&delete t.$$listenerCount[n];while(t=t.$parent)}function b(){}function w(){for(;A.length;)try{A.shift()()}catch(t){u(t)}s=null}function _(){null===s&&(s=f.defer(function(){C.$apply(w)}))}d.prototype={constructor:d,$new:function(e,n){var r;return n=n||this,e?(r=new d,r.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=t(this)),r=new this.$$ChildScope),r.$parent=n,r.$$prevSibling=n.$$childTail,n.$$childHead?(n.$$childTail.$$nextSibling=r,n.$$childTail=r):n.$$childHead=n.$$childTail=r,(e||n!=this)&&r.$on("$destroy",h),r},$watch:function(t,e,n){var r=l(t);if(r.$$watchDelegate)return r.$$watchDelegate(this,e,n,r);var i=this,o=i.$$watchers,s={fn:e,last:b,get:r,exp:t,eq:!!n};return a=null,x(e)||(s.fn=p),o||(o=i.$$watchers=[]),o.unshift(s),function(){j(o,s),a=null}},$watchGroup:function(t,e){function n(){u=!1,c?(c=!1,e(i,i,s)):e(i,r,s)}var r=new Array(t.length),i=new Array(t.length),a=[],s=this,u=!1,c=!0;if(!t.length){var l=!0;return s.$evalAsync(function(){l&&e(i,i,s)}),function(){l=!1}}return 1===t.length?this.$watch(t[0],function(t,n,o){i[0]=t,r[0]=n,e(i,t===n?i:r,o)}):(o(t,function(t,e){var o=s.$watch(t,function(t,o){i[e]=t,r[e]=o,u||(u=!0,s.$evalAsync(n))});a.push(o)}),function(){for(;a.length;)a.shift()()})},$watchCollection:function(t,e){function n(t){o=t;var e,n,r,s,u;if(!g(o)){if(y(o))if(i(o)){a!==d&&(a=d,v=a.length=0,f++),e=o.length,v!==e&&(f++,a.length=v=e);for(var c=0;e>c;c++)u=a[c],s=o[c],r=u!==u&&s!==s,r||u===s||(f++,a[c]=s)}else{a!==p&&(a=p={},v=0,f++),e=0;for(n in o)o.hasOwnProperty(n)&&(e++,s=o[n],u=a[n],n in a?(r=u!==u&&s!==s,r||u===s||(f++,a[n]=s)):(v++,a[n]=s,f++));if(v>e){f++;for(n in a)o.hasOwnProperty(n)||(v--,delete a[n])}}else a!==o&&(a=o,f++);return f; +}}function r(){if(m?(m=!1,e(o,o,u)):e(o,s,u),c)if(y(o))if(i(o)){s=new Array(o.length);for(var t=0;t1,f=0,h=l(t,n),d=[],p={},m=!0,v=0;return this.$watch(h,r)},$digest:function(){var t,r,i,o,c,l,h,d,p,g,$=e,y=this,_=[];m("$digest"),f.$$checkUrlChange(),this===C&&null!==s&&(f.defer.cancel(s),w()),a=null;do{for(l=!1,d=y;E.length;){try{g=E.shift(),g.scope.$eval(g.expression,g.locals)}catch(A){u(A)}a=null}t:do{if(o=d.$$watchers)for(c=o.length;c--;)try{if(t=o[c])if((r=t.get(d))===(i=t.last)||(t.eq?P(r,i):"number"==typeof r&&"number"==typeof i&&isNaN(r)&&isNaN(i))){if(t===a){l=!1;break t}}else l=!0,a=t,t.last=t.eq?N(r,null):r,t.fn(r,i===b?r:i,d),5>$&&(p=4-$,_[p]||(_[p]=[]),_[p].push({msg:x(t.exp)?"fn: "+(t.exp.name||t.exp.toString()):t.exp,newVal:r,oldVal:i}))}catch(A){u(A)}if(!(h=d.$$childHead||d!==y&&d.$$nextSibling))for(;d!==y&&!(h=d.$$nextSibling);)d=d.$parent}while(d=h);if((l||E.length)&&!$--)throw v(),n("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",e,_)}while(l||E.length);for(v();k.length;)try{k.shift()()}catch(A){u(A)}},$destroy:function(){if(!this.$$destroyed){var t=this.$parent;if(this.$broadcast("$destroy"),this.$$destroyed=!0,this!==C){for(var e in this.$$listenerCount)$(this,this.$$listenerCount[e],e);t.$$childHead==this&&(t.$$childHead=this.$$nextSibling),t.$$childTail==this&&(t.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=p,this.$on=this.$watch=this.$watchGroup=function(){return p},this.$$listeners={},this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}}},$eval:function(t,e){return l(t)(this,e)},$evalAsync:function(t,e){C.$$phase||E.length||f.defer(function(){E.length&&C.$digest()}),E.push({scope:this,expression:t,locals:e})},$$postDigest:function(t){k.push(t)},$apply:function(t){try{return m("$apply"),this.$eval(t)}catch(e){u(e)}finally{v();try{C.$digest()}catch(e){throw u(e),e}}},$applyAsync:function(t){function e(){n.$eval(t)}var n=this;t&&A.push(e),_()},$on:function(t,e){var n=this.$$listeners[t];n||(this.$$listeners[t]=n=[]),n.push(e);var r=this;do r.$$listenerCount[t]||(r.$$listenerCount[t]=0),r.$$listenerCount[t]++;while(r=r.$parent);var i=this;return function(){var r=n.indexOf(e);-1!==r&&(n[r]=null,$(i,1,t))}},$emit:function(t,e){var n,r,i,o=[],a=this,s=!1,c={name:t,targetScope:a,stopPropagation:function(){s=!0},preventDefault:function(){c.defaultPrevented=!0},defaultPrevented:!1},l=F([c],arguments,1);do{for(n=a.$$listeners[t]||o,c.currentScope=a,r=0,i=n.length;i>r;r++)if(n[r])try{n[r].apply(null,l)}catch(f){u(f)}else n.splice(r,1),r--,i--;if(s)return c.currentScope=null,c;a=a.$parent}while(a);return c.currentScope=null,c},$broadcast:function(t,e){var n=this,r=n,i=n,o={name:t,targetScope:n,preventDefault:function(){o.defaultPrevented=!0},defaultPrevented:!1};if(!n.$$listenerCount[t])return o;for(var a,s,c,l=F([o],arguments,1);r=i;){for(o.currentScope=r,a=r.$$listeners[t]||[],s=0,c=a.length;c>s;s++)if(a[s])try{a[s].apply(null,l)}catch(f){u(f)}else a.splice(s,1),s--,c--;if(!(i=r.$$listenerCount[t]&&r.$$childHead||r!==n&&r.$$nextSibling))for(;r!==n&&!(i=r.$$nextSibling);)r=r.$parent}return o.currentScope=null,o}};var C=new d,E=C.$$asyncQueue=[],k=C.$$postDigestQueue=[],A=C.$$applyAsyncQueue=[];return C}]}function Ze(){var t=/^\s*(https?|ftp|mailto|tel|file):/,e=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(e){return $(e)?(t=e,this):t},this.imgSrcSanitizationWhitelist=function(t){return $(t)?(e=t,this):e},this.$get=function(){return function(n,r){var i,o=r?e:t;return i=on(n).href,""===i||i.match(o)?n:"unsafe:"+i}}}function Ge(t){if("self"===t)return t;if(b(t)){if(t.indexOf("***")>-1)throw _i("iwcard","Illegal sequence *** in string matcher. String: {0}",t);return t=mr(t).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+t+"$")}if(C(t))return new RegExp("^"+t.source+"$");throw _i("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function Ke(t){var e=[];return $(t)&&o(t,function(t){e.push(Ge(t))}),e}function Je(){this.SCE_CONTEXTS=xi;var t=["self"],e=[];this.resourceUrlWhitelist=function(e){return arguments.length&&(t=Ke(e)),t},this.resourceUrlBlacklist=function(t){return arguments.length&&(e=Ke(t)),e},this.$get=["$injector",function(r){function i(t,e){return"self"===t?an(e):!!t.exec(e.href)}function o(n){var r,o,a=on(n.toString()),s=!1;for(r=0,o=t.length;o>r;r++)if(i(t[r],a)){s=!0;break}if(s)for(r=0,o=e.length;o>r;r++)if(i(e[r],a)){s=!1;break}return s}function a(t){var e=function(t){this.$$unwrapTrustedValue=function(){return t}};return t&&(e.prototype=new t),e.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},e.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},e}function s(t,e){var r=h.hasOwnProperty(t)?h[t]:null;if(!r)throw _i("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",t,e);if(null===e||e===n||""===e)return e;if("string"!=typeof e)throw _i("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",t);return new r(e)}function u(t){return t instanceof f?t.$$unwrapTrustedValue():t}function c(t,e){if(null===e||e===n||""===e)return e;var r=h.hasOwnProperty(t)?h[t]:null;if(r&&e instanceof r)return e.$$unwrapTrustedValue();if(t===xi.RESOURCE_URL){if(o(e))return e;throw _i("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",e.toString())}if(t===xi.HTML)return l(e);throw _i("unsafe","Attempting to use an unsafe value in a safe context.")}var l=function(t){throw _i("unsafe","Attempting to use an unsafe value in a safe context.")};r.has("$sanitize")&&(l=r.get("$sanitize"));var f=a(),h={};return h[xi.HTML]=a(f),h[xi.CSS]=a(f),h[xi.URL]=a(f),h[xi.JS]=a(f),h[xi.RESOURCE_URL]=a(h[xi.URL]),{trustAs:s,getTrusted:c,valueOf:u}}]}function Qe(){var t=!0;this.enabled=function(e){return arguments.length&&(t=!!e),t},this.$get=["$parse","$sceDelegate",function(e,n){if(t&&8>er)throw _i("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode. You can fix this by adding the text to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var r=R(xi);r.isEnabled=function(){return t},r.trustAs=n.trustAs,r.getTrusted=n.getTrusted,r.valueOf=n.valueOf,t||(r.trustAs=r.getTrusted=function(t,e){return e},r.valueOf=m),r.parseAs=function(t,n){var i=e(n);return i.literal&&i.constant?i:e(n,function(e){return r.getTrusted(t,e)})};var i=r.parseAs,a=r.getTrusted,s=r.trustAs;return o(xi,function(t,e){var n=Gn(e);r[mt("parse_as_"+n)]=function(e){return i(t,e)},r[mt("get_trusted_"+n)]=function(e){return a(t,e)},r[mt("trust_as_"+n)]=function(e){return s(t,e)}}),r}]}function tn(){this.$get=["$window","$document",function(t,e){var n,r,i={},o=h((/android (\d+)/.exec(Gn((t.navigator||{}).userAgent))||[])[1]),a=/Boxee/i.test((t.navigator||{}).userAgent),s=e[0]||{},u=/^(Moz|webkit|ms)(?=[A-Z])/,c=s.body&&s.body.style,l=!1,f=!1;if(c){for(var d in c)if(r=u.exec(d)){n=r[0],n=n.substr(0,1).toUpperCase()+n.substr(1);break}n||(n="WebkitOpacity"in c&&"webkit"),l=!!("transition"in c||n+"Transition"in c),f=!!("animation"in c||n+"Animation"in c),!o||l&&f||(l=b(s.body.style.webkitTransition),f=b(s.body.style.webkitAnimation))}return{history:!(!t.history||!t.history.pushState||4>o||a),hasEvent:function(t){if("input"===t&&11>=er)return!1;if(g(i[t])){var e=s.createElement("div");i[t]="on"+t in e}return i[t]},csp:vr(),vendorPrefix:n,transitions:l,animations:f,android:o}}]}function en(){this.$get=["$templateCache","$http","$q","$sce",function(t,e,n,r){function i(o,a){function s(t){if(!a)throw Kr("tpload","Failed to load template: {0}",o);return n.reject(t)}i.totalPendingRequests++,b(o)&&t.get(o)||(o=r.getTrustedResourceUrl(o));var u=e.defaults&&e.defaults.transformResponse;dr(u)?u=u.filter(function(t){return t!==ie}):u===ie&&(u=null);var c={cache:t,transformResponse:u};return e.get(o,c)["finally"](function(){i.totalPendingRequests--}).then(function(t){return t.data},s)}return i.totalPendingRequests=0,i}]}function nn(){this.$get=["$rootScope","$browser","$location",function(t,e,n){var r={};return r.findBindings=function(t,e,n){var r=t.getElementsByClassName("ng-binding"),i=[];return o(r,function(t){var r=lr.element(t).data("$binding");r&&o(r,function(r){if(n){var o=new RegExp("(^|\\s)"+mr(e)+"(\\s|\\||$)");o.test(r)&&i.push(t)}else-1!=r.indexOf(e)&&i.push(t)})}),i},r.findModels=function(t,e,n){for(var r=["ng-","data-ng-","ng\\:"],i=0;it;t=Math.abs(t);var a=t+"",s="",u=[],c=!1;if(-1!==a.indexOf("e")){var l=a.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&l[3]>i+1?t=0:(s=a,c=!0)}if(c)i>0&&1>t&&(s=t.toFixed(i),t=parseFloat(s));else{var f=(a.split(ki)[1]||"").length;g(i)&&(i=Math.min(Math.max(e.minFrac,f),e.maxFrac)),t=+(Math.round(+(t.toString()+"e"+i)).toString()+"e"+-i);var h=(""+t).split(ki),d=h[0];h=h[1]||"";var p,m=0,v=e.lgSize,$=e.gSize;if(d.length>=v+$)for(m=d.length-v,p=0;m>p;p++)(m-p)%$===0&&0!==p&&(s+=n),s+=d.charAt(p);for(p=m;pt&&(r="-",t=-t),t=""+t;t.length0||o>-n)&&(o+=n),0===o&&-12==n&&(o=12),mn(o,e,r)}}function gn(t,e){return function(n,r){var i=n["get"+t](),o=Jn(e?"SHORT"+t:t);return r[o][i]}}function $n(t){var e=-1*t.getTimezoneOffset(),n=e>=0?"+":"";return n+=mn(Math[e>0?"floor":"ceil"](e/60),2)+mn(Math.abs(e%60),2)}function yn(t){var e=new Date(t,0,1).getDay();return new Date(t,0,(4>=e?5:12)-e)}function bn(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+(4-t.getDay()))}function wn(t){return function(e){var n=yn(e.getFullYear()),r=bn(e),i=+r-+n,o=1+Math.round(i/6048e5);return mn(o,t)}}function _n(t,e){return t.getHours()<12?e.AMPMS[0]:e.AMPMS[1]}function xn(t,e){return t.getFullYear()<=0?e.ERAS[0]:e.ERAS[1]}function Cn(t,e){return t.getFullYear()<=0?e.ERANAMES[0]:e.ERANAMES[1]}function En(t){function e(t){var e;if(e=t.match(n)){var r=new Date(0),i=0,o=0,a=e[8]?r.setUTCFullYear:r.setFullYear,s=e[8]?r.setUTCHours:r.setHours;e[9]&&(i=h(e[9]+e[10]),o=h(e[9]+e[11])),a.call(r,h(e[1]),h(e[2])-1,h(e[3]));var u=h(e[4]||0)-i,c=h(e[5]||0)-o,l=h(e[6]||0),f=Math.round(1e3*parseFloat("0."+(e[7]||0)));return s.call(r,u,c,l,f),r}return t}var n=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,r,i){var a,s,u="",c=[];if(r=r||"mediumDate",r=t.DATETIME_FORMATS[r]||r,b(n)&&(n=Ti.test(n)?h(n):e(n)),w(n)&&(n=new Date(n)),!_(n))return n;for(;r;)s=Si.exec(r),s?(c=F(c,s,1),r=c.pop()):(c.push(r),r=null);return i&&"UTC"===i&&(n=new Date(n.getTime()),n.setMinutes(n.getMinutes()+n.getTimezoneOffset())),o(c,function(e){a=Ai[e],u+=a?a(n,t.DATETIME_FORMATS):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),u}}function kn(){return function(t,e){return g(e)&&(e=2),V(t,e)}}function An(){return function(t,e){return w(t)&&(t=t.toString()),dr(t)||b(t)?(e=Math.abs(Number(e))===1/0?Number(e):h(e),e?e>0?t.slice(0,e):t.slice(e):b(t)?"":[]):t}}function Sn(t){return function(e,n,r){function o(t,e){for(var r=0;rt?-1:1):r>n?-1:1}return i(e)?(n=dr(n)?n:[n],0===n.length&&(n=["+"]),n=n.map(function(e){var n=!1,r=e||m;if(b(e)){if(("+"==e.charAt(0)||"-"==e.charAt(0))&&(n="-"==e.charAt(0),e=e.substring(1)),""===e)return a(c,n);if(r=t(e),r.constant){var i=r();return a(function(t,e){return c(t[i],e[i])},n)}}return a(function(t,e){return c(r(t),r(e))},n)}),or.call(e).sort(a(o,r))):e}}function Tn(t){return x(t)&&(t={link:t}),t.restrict=t.restrict||"AC",v(t)}function On(t,e){t.$name=e}function In(t,e,r,i,a){var s=this,u=[],c=s.$$parentForm=t.parent().controller("form")||Di;s.$error={},s.$$success={},s.$pending=n,s.$name=a(e.name||e.ngForm||"")(r),s.$dirty=!1,s.$pristine=!0,s.$valid=!0,s.$invalid=!1,s.$submitted=!1,c.$addControl(s),s.$rollbackViewValue=function(){o(u,function(t){t.$rollbackViewValue()})},s.$commitViewValue=function(){o(u,function(t){t.$commitViewValue()})},s.$addControl=function(t){at(t.$name,"input"),u.push(t),t.$name&&(s[t.$name]=t)},s.$$renameControl=function(t,e){var n=t.$name;s[n]===t&&delete s[n],s[e]=t,t.$name=e},s.$removeControl=function(t){t.$name&&s[t.$name]===t&&delete s[t.$name],o(s.$pending,function(e,n){s.$setValidity(n,null,t)}),o(s.$error,function(e,n){s.$setValidity(n,null,t)}),o(s.$$success,function(e,n){s.$setValidity(n,null,t)}),j(u,t)},Wn({ctrl:this,$element:t,set:function(t,e,n){var r=t[e];if(r){var i=r.indexOf(n);-1===i&&r.push(n)}else t[e]=[n]},unset:function(t,e,n){var r=t[e];r&&(j(r,n),0===r.length&&delete t[e])},parentForm:c,$animate:i}),s.$setDirty=function(){i.removeClass(t,go),i.addClass(t,$o),s.$dirty=!0,s.$pristine=!1,c.$setDirty()},s.$setPristine=function(){i.setClass(t,go,$o+" "+ji),s.$dirty=!1,s.$pristine=!0,s.$submitted=!1,o(u,function(t){t.$setPristine()})},s.$setUntouched=function(){o(u,function(t){t.$setUntouched()})},s.$setSubmitted=function(){i.addClass(t,ji),s.$submitted=!0,c.$setSubmitted()}}function zn(t){t.$formatters.push(function(e){return t.$isEmpty(e)?e:e.toString()})}function Mn(t,e,n,r,i,o){Dn(t,e,n,r,i,o),zn(r)}function Dn(t,e,n,r,i,o){var a=Gn(e[0].type);if(!i.android){var s=!1;e.on("compositionstart",function(t){s=!0}),e.on("compositionend",function(){s=!1,u()})}var u=function(t){if(c&&(o.defer.cancel(c),c=null),!s){var i=e.val(),u=t&&t.type;"password"===a||n.ngTrim&&"false"===n.ngTrim||(i=pr(i)),(r.$viewValue!==i||""===i&&r.$$hasNativeValidators)&&r.$setViewValue(i,u)}};if(i.hasEvent("input"))e.on("input",u);else{var c,l=function(t,e,n){c||(c=o.defer(function(){c=null,e&&e.value===n||u(t)}))};e.on("keydown",function(t){var e=t.keyCode;91===e||e>15&&19>e||e>=37&&40>=e||l(t,this,this.value)}),i.hasEvent("paste")&&e.on("paste cut",l)}e.on("change",u),r.$render=function(){e.val(r.$isEmpty(r.$viewValue)?"":r.$viewValue)}}function jn(t,e){if(_(t))return t;if(b(t)){Hi.lastIndex=0;var n=Hi.exec(t);if(n){var r=+n[1],i=+n[2],o=0,a=0,s=0,u=0,c=yn(r),l=7*(i-1);return e&&(o=e.getHours(),a=e.getMinutes(),s=e.getSeconds(),u=e.getMilliseconds()),new Date(r,0,c.getDate()+l,o,a,s,u)}}return NaN}function Nn(t,e){return function(n,r){var i,a;if(_(n))return n;if(b(n)){if('"'==n.charAt(0)&&'"'==n.charAt(n.length-1)&&(n=n.substring(1,n.length-1)),Fi.test(n))return new Date(n);if(t.lastIndex=0,i=t.exec(n))return i.shift(),a=r?{yyyy:r.getFullYear(),MM:r.getMonth()+1,dd:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds(),sss:r.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},o(i,function(t,n){n=v},s.$observe("min",function(t){v=d(t),u.$validate()})}if($(s.max)||s.ngMax){var y;u.$validators.max=function(t){return!h(t)||g(y)||r(t)<=y},s.$observe("max",function(t){y=d(t),u.$validate()})}}}function Pn(t,e,r,i){var o=e[0],a=i.$$hasNativeValidators=y(o.validity);a&&i.$parsers.push(function(t){var r=e.prop(Zn)||{};return r.badInput&&!r.typeMismatch?n:t})}function Fn(t,e,r,i,o,a){if(Pn(t,e,r,i),Dn(t,e,r,i,o,a),i.$$parserName="number",i.$parsers.push(function(t){return i.$isEmpty(t)?null:Ui.test(t)?parseFloat(t):n}),i.$formatters.push(function(t){if(!i.$isEmpty(t)){if(!w(t))throw _o("numfmt","Expected `{0}` to be a number",t);t=t.toString()}return t}),$(r.min)||r.ngMin){var s;i.$validators.min=function(t){return i.$isEmpty(t)||g(s)||t>=s},r.$observe("min",function(t){$(t)&&!w(t)&&(t=parseFloat(t,10)),s=w(t)&&!isNaN(t)?t:n,i.$validate()})}if($(r.max)||r.ngMax){var u;i.$validators.max=function(t){return i.$isEmpty(t)||g(u)||u>=t},r.$observe("max",function(t){$(t)&&!w(t)&&(t=parseFloat(t,10)),u=w(t)&&!isNaN(t)?t:n,i.$validate()})}}function Bn(t,e,n,r,i,o){Dn(t,e,n,r,i,o),zn(r),r.$$parserName="url",r.$validators.url=function(t,e){var n=t||e;return r.$isEmpty(n)||Bi.test(n)}}function Ln(t,e,n,r,i,o){Dn(t,e,n,r,i,o),zn(r),r.$$parserName="email",r.$validators.email=function(t,e){var n=t||e;return r.$isEmpty(n)||Li.test(n)}}function Un(t,e,n,r){g(n.name)&&e.attr("name",c());var i=function(t){e[0].checked&&r.$setViewValue(n.value,t&&t.type)};e.on("click",i),r.$render=function(){var t=n.value;e[0].checked=t==r.$viewValue},n.$observe("value",r.$render)}function Vn(t,e,n,r,i){var o;if($(r)){if(o=t(r),!o.constant)throw _o("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",n,r);return o(e)}return i}function qn(t,e,n,r,i,o,a,s){var u=Vn(s,t,"ngTrueValue",n.ngTrueValue,!0),c=Vn(s,t,"ngFalseValue",n.ngFalseValue,!1),l=function(t){r.$setViewValue(e[0].checked,t&&t.type)};e.on("click",l),r.$render=function(){e[0].checked=r.$viewValue},r.$isEmpty=function(t){return t===!1},r.$formatters.push(function(t){return P(t,u)}),r.$parsers.push(function(t){return t?u:c})}function Hn(t,e){return t="ngClass"+t,["$animate",function(n){function r(t,e){var n=[];t:for(var r=0;r0||n[t])&&(n[t]=(n[t]||0)+e,n[t]===+(e>0)&&r.push(t))}),s.data("$classCounts",n),r.join(" ")}function h(t,e){var i=r(e,t),o=r(t,e);i=f(i,1),o=f(o,-1),i&&i.length&&n.addClass(s,i),o&&o.length&&n.removeClass(s,o)}function d(t){if(e===!0||a.$index%2===e){var n=i(t||[]);if(p){if(!P(t,p)){var r=i(p);h(r,n)}}else c(n)}p=R(t)}var p;a.$watch(u[t],d,!0),u.$observe("class",function(e){d(a.$eval(u[t]))}),"ngClass"!==t&&a.$watch("$index",function(n,r){var o=1&n;if(o!==(1&r)){var s=i(a.$eval(u[t]));o===e?c(s):l(s)}})}}}]}function Wn(t){function e(t,e,u){e===n?r("$pending",t,u):i("$pending",t,u),O(e)?e?(f(s.$error,t,u),l(s.$$success,t,u)):(l(s.$error,t,u),f(s.$$success,t,u)):(f(s.$error,t,u),f(s.$$success,t,u)),s.$pending?(o(wo,!0),s.$valid=s.$invalid=n,a("",null)):(o(wo,!1),s.$valid=Xn(s.$error),s.$invalid=!s.$valid,a("",s.$valid));var c;c=s.$pending&&s.$pending[t]?n:s.$error[t]?!1:s.$$success[t]?!0:null,a(t,c),h.$setValidity(t,c,s)}function r(t,e,n){s[t]||(s[t]={}),l(s[t],e,n)}function i(t,e,r){s[t]&&f(s[t],e,r),Xn(s[t])&&(s[t]=n)}function o(t,e){e&&!c[t]?(d.addClass(u,t),c[t]=!0):!e&&c[t]&&(d.removeClass(u,t),c[t]=!1)}function a(t,e){t=t?"-"+nt(t,"-"):"",o(mo+t,e===!0),o(vo+t,e===!1)}var s=t.ctrl,u=t.$element,c={},l=t.set,f=t.unset,h=t.parentForm,d=t.$animate;c[vo]=!(c[mo]=u.hasClass(mo)),s.$setValidity=e}function Xn(t){if(t)for(var e in t)return!1;return!0}var Yn=/^\/(.+)\/([a-z]*)$/,Zn="validity",Gn=function(t){return b(t)?t.toLowerCase():t},Kn=Object.prototype.hasOwnProperty,Jn=function(t){return b(t)?t.toUpperCase():t},Qn=function(t){return b(t)?t.replace(/[A-Z]/g,function(t){return String.fromCharCode(32|t.charCodeAt(0))}):t},tr=function(t){return b(t)?t.replace(/[a-z]/g,function(t){return String.fromCharCode(-33&t.charCodeAt(0))}):t};"i"!=="I".toLowerCase()&&(Gn=Qn,Jn=tr);var er,nr,rr,ir,or=[].slice,ar=[].splice,sr=[].push,ur=Object.prototype.toString,cr=r("ng"),lr=t.angular||(t.angular={}),fr=0;er=e.documentMode,p.$inject=[],m.$inject=[];var hr,dr=Array.isArray,pr=function(t){return b(t)?t.trim():t},mr=function(t){return t.replace(/([-()\[\]{}+?*.$\^|,:#(?:<\/\1>|)$/,Nr=/<|&#?\w+;/,Rr=/<([\w:]+)/,Pr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Fr={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Fr.optgroup=Fr.option,Fr.tbody=Fr.tfoot=Fr.colgroup=Fr.caption=Fr.thead,Fr.th=Fr.td;var Br=bt.prototype={ready:function(n){function r(){i||(i=!0,n())}var i=!1;"complete"===e.readyState?setTimeout(r):(this.on("DOMContentLoaded",r),bt(t).on("load",r))},toString:function(){var t=[];return o(this,function(e){t.push(""+e)}),"["+t.join(", ")+"]"},eq:function(t){return nr(t>=0?this[t]:this[this.length+t])},length:0,push:sr,sort:[].sort,splice:[].splice},Lr={};o("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(t){Lr[Gn(t)]=t});var Ur={};o("input,select,option,textarea,button,form,details".split(","),function(t){Ur[t]=!0});var Vr={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};o({data:kt,removeData:Ct},function(t,e){bt[e]=t}),o({data:kt,inheritedData:zt,scope:function(t){return nr.data(t,"$scope")||zt(t.parentNode||t,["$isolateScope","$scope"])},isolateScope:function(t){return nr.data(t,"$isolateScope")||nr.data(t,"$isolateScopeNoTemplate")},controller:It,injector:function(t){return zt(t,"$injector")},removeAttr:function(t,e){t.removeAttribute(e)},hasClass:At,css:function(t,e,n){return e=mt(e),$(n)?void(t.style[e]=n):t.style[e]},attr:function(t,e,r){var i=t.nodeType;if(i!==_r&&i!==wr&&i!==xr){var o=Gn(e);if(Lr[o]){if(!$(r))return t[e]||(t.attributes.getNamedItem(e)||p).specified?o:n;r?(t[e]=!0,t.setAttribute(e,o)):(t[e]=!1,t.removeAttribute(o))}else if($(r))t.setAttribute(e,r);else if(t.getAttribute){var a=t.getAttribute(e,2);return null===a?n:a}}},prop:function(t,e,n){return $(n)?void(t[e]=n):t[e]},text:function(){function t(t,e){if(g(e)){var n=t.nodeType;return n===br||n===_r?t.textContent:""}t.textContent=e}return t.$dv="",t}(),val:function(t,e){if(g(e)){if(t.multiple&&"select"===D(t)){var n=[];return o(t.options,function(t){t.selected&&n.push(t.value||t.text)}),0===n.length?null:n}return t.value}t.value=e},html:function(t,e){return g(e)?t.innerHTML:(_t(t,!0),void(t.innerHTML=e))},empty:Mt},function(t,e){bt.prototype[e]=function(e,r){var i,o,a=this.length;if(t!==Mt&&(2==t.length&&t!==At&&t!==It?e:r)===n){if(y(e)){for(i=0;a>i;i++)if(t===kt)t(this[i],e);else for(o in e)t(this[i],o,e[o]);return this}for(var s=t.$dv,u=s===n?Math.min(a,1):a,c=0;u>c;c++){var l=t(this[c],e,r);s=s?s+l:l}return s}for(i=0;a>i;i++)t(this[i],e,r);return this}}),o({removeData:Ct,on:function Zo(t,e,n,r){if($(r))throw Dr("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(gt(t)){var i=Et(t,!0),o=i.events,a=i.handle;a||(a=i.handle=Pt(t,o));for(var s=e.indexOf(" ")>=0?e.split(" "):[e],u=s.length;u--;){e=s[u];var c=o[e];c||(o[e]=[],"mouseenter"===e||"mouseleave"===e?Zo(t,Mr[e],function(t){var n=this,r=t.relatedTarget;(!r||r!==n&&!n.contains(r))&&a(t,e)}):"$destroy"!==e&&Tr(t,e,a),c=o[e]),c.push(n)}}},off:xt,one:function(t,e,n){t=nr(t),t.on(e,function r(){t.off(e,n),t.off(e,r)}),t.on(e,n)},replaceWith:function(t,e){var n,r=t.parentNode;_t(t),o(new bt(e),function(e){n?r.insertBefore(e,n.nextSibling):r.replaceChild(e,t),n=e})},children:function(t){var e=[];return o(t.childNodes,function(t){t.nodeType===br&&e.push(t)}),e},contents:function(t){return t.contentDocument||t.childNodes||[]},append:function(t,e){var n=t.nodeType;if(n===br||n===Er){e=new bt(e);for(var r=0,i=e.length;i>r;r++){var o=e[r];t.appendChild(o)}}},prepend:function(t,e){if(t.nodeType===br){var n=t.firstChild;o(new bt(e),function(e){t.insertBefore(e,n)})}},wrap:function(t,e){e=nr(e).eq(0).clone()[0];var n=t.parentNode;n&&n.replaceChild(e,t),e.appendChild(t)},remove:Dt,detach:function(t){Dt(t,!0)},after:function(t,e){var n=t,r=t.parentNode;e=new bt(e);for(var i=0,o=e.length;o>i;i++){var a=e[i];r.insertBefore(a,n.nextSibling),n=a}},addClass:Tt,removeClass:St,toggleClass:function(t,e,n){e&&o(e.split(" "),function(e){var r=n;g(r)&&(r=!At(t,e)),(r?Tt:St)(t,e)})},parent:function(t){var e=t.parentNode;return e&&e.nodeType!==Er?e:null},next:function(t){return t.nextElementSibling},find:function(t,e){return t.getElementsByTagName?t.getElementsByTagName(e):[]},clone:wt,triggerHandler:function(t,e,n){var r,i,a,s=e.type||e,u=Et(t),c=u&&u.events,l=c&&c[s];l&&(r={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented===!0},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return this.immediatePropagationStopped===!0},stopPropagation:p,type:s,target:t},e.type&&(r=f(r,e)),i=R(l),a=n?[r].concat(n):[r],o(i,function(e){r.isImmediatePropagationStopped()||e.apply(t,a)}))}},function(t,e){bt.prototype[e]=function(e,n,r){for(var i,o=0,a=this.length;a>o;o++)g(i)?(i=t(this[o],e,n,r),$(i)&&(i=nr(i))):Ot(i,t(this[o],e,n,r));return $(i)?i:this},bt.prototype.bind=bt.prototype.on,bt.prototype.unbind=bt.prototype.off}),Lt.prototype={put:function(t,e){this[Bt(t,this.nextUid)]=e},get:function(t){return this[Bt(t,this.nextUid)]},remove:function(t){var e=this[t=Bt(t,this.nextUid)];return delete this[t],e}};var qr=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,Hr=/,/,Wr=/^\s*(_?)(\S+?)\1\s*$/,Xr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Yr=r("$injector");qt.$$annotate=Vt;var Zr=r("$animate"),Gr=["$provide",function(t){this.$$selectors={},this.register=function(e,n){var r=e+"-animation";if(e&&"."!=e.charAt(0))throw Zr("notcsel","Expecting class selector starting with '.' got '{0}'.",e);this.$$selectors[e.substr(1)]=r,t.factory(r,n)},this.classNameFilter=function(t){return 1===arguments.length&&(this.$$classNameFilter=t instanceof RegExp?t:null),this.$$classNameFilter},this.$get=["$$q","$$asyncCallback","$rootScope",function(t,e,n){function r(e){var r,i=t.defer();return i.promise.$$cancelFn=function(){r&&r()},n.$$postDigest(function(){r=e(function(){i.resolve()})}),i.promise}function i(t,e){var n=[],r=[],i=ct();return o((t.attr("class")||"").split(/\s+/),function(t){i[t]=!0}),o(e,function(t,e){var o=i[e];t===!1&&o?r.push(e):t!==!0||o||n.push(e)}),n.length+r.length>0&&[n.length?n:null,r.length?r:null]}function a(t,e,n){for(var r=0,i=e.length;i>r;++r){var o=e[r];t[o]=n}}function s(){return c||(c=t.defer(),e(function(){c.resolve(),c=null})),c.promise}function u(t,e){if(lr.isObject(e)){var n=f(e.from||{},e.to||{});t.css(n)}}var c;return{animate:function(t,e,n){return u(t,{from:e,to:n}),s()},enter:function(t,e,n,r){return u(t,r),n?n.after(t):e.prepend(t),s()},leave:function(t,e){return u(t,e),t.remove(),s()},move:function(t,e,n,r){return this.enter(t,e,n,r)},addClass:function(t,e,n){return this.setClass(t,e,[],n)},$$addClassImmediately:function(t,e,n){return t=nr(t),e=b(e)?e:dr(e)?e.join(" "):"",o(t,function(t){Tt(t,e)}),u(t,n),s()},removeClass:function(t,e,n){return this.setClass(t,[],e,n); +},$$removeClassImmediately:function(t,e,n){return t=nr(t),e=b(e)?e:dr(e)?e.join(" "):"",o(t,function(t){St(t,e)}),u(t,n),s()},setClass:function(t,e,n,o){var s=this,u="$$animateClasses",c=!1;t=nr(t);var l=t.data(u);l?o&&l.options&&(l.options=lr.extend(l.options||{},o)):(l={classes:{},options:o},c=!0);var f=l.classes;return e=dr(e)?e:e.split(" "),n=dr(n)?n:n.split(" "),a(f,e,!0),a(f,n,!1),c&&(l.promise=r(function(e){var n=t.data(u);if(t.removeData(u),n){var r=i(t,n.classes);r&&s.$$setClassImmediately(t,r[0],r[1],n.options)}e()}),t.data(u,l)),l.promise},$$setClassImmediately:function(t,e,n,r){return e&&this.$$addClassImmediately(t,e),n&&this.$$removeClassImmediately(t,n),u(t,r),s()},enabled:p,cancel:p}}]}],Kr=r("$compile");Kt.$inject=["$provide","$$sanitizeUriProvider"];var Jr=/^((?:x|data)[\:\-_])/i,Qr=r("$controller"),ti="application/json",ei={"Content-Type":ti+";charset=utf-8"},ni=/^\[|^\{(?!\{)/,ri={"[":/]$/,"{":/}$/},ii=/^\)\]\}',?\n/,oi=r("$interpolate"),ai=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,si={http:80,https:443,ftp:21},ui=r("$location"),ci={$$html5:!1,$$replace:!1,absUrl:Se("$$absUrl"),url:function(t){if(g(t))return this.$$url;var e=ai.exec(t);return(e[1]||""===t)&&this.path(decodeURIComponent(e[1])),(e[2]||e[1]||""===t)&&this.search(e[3]||""),this.hash(e[5]||""),this},protocol:Se("$$protocol"),host:Se("$$host"),port:Se("$$port"),path:Te("$$path",function(t){return t=null!==t?t.toString():"","/"==t.charAt(0)?t:"/"+t}),search:function(t,e){switch(arguments.length){case 0:return this.$$search;case 1:if(b(t)||w(t))t=t.toString(),this.$$search=X(t);else{if(!y(t))throw ui("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");t=N(t,{}),o(t,function(e,n){null==e&&delete t[n]}),this.$$search=t}break;default:g(e)||null===e?delete this.$$search[t]:this.$$search[t]=e}return this.$$compose(),this},hash:Te("$$hash",function(t){return null!==t?t.toString():""}),replace:function(){return this.$$replace=!0,this}};o([Ae,ke,Ee],function(t){t.prototype=Object.create(ci),t.prototype.state=function(e){if(!arguments.length)return this.$$state;if(t!==Ee||!this.$$html5)throw ui("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=g(e)?null:e,this}});var li=r("$parse"),fi=Function.prototype.call,hi=Function.prototype.apply,di=Function.prototype.bind,pi=ct();o({"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:function(){}},function(t,e){t.constant=t.literal=t.sharedGetter=!0,pi[e]=t}),pi["this"]=function(t){return t},pi["this"].sharedGetter=!0;var mi=f(ct(),{"+":function(t,e,r,i){return r=r(t,e),i=i(t,e),$(r)?$(i)?r+i:r:$(i)?i:n},"-":function(t,e,n,r){return n=n(t,e),r=r(t,e),($(n)?n:0)-($(r)?r:0)},"*":function(t,e,n,r){return n(t,e)*r(t,e)},"/":function(t,e,n,r){return n(t,e)/r(t,e)},"%":function(t,e,n,r){return n(t,e)%r(t,e)},"===":function(t,e,n,r){return n(t,e)===r(t,e)},"!==":function(t,e,n,r){return n(t,e)!==r(t,e)},"==":function(t,e,n,r){return n(t,e)==r(t,e)},"!=":function(t,e,n,r){return n(t,e)!=r(t,e)},"<":function(t,e,n,r){return n(t,e)":function(t,e,n,r){return n(t,e)>r(t,e)},"<=":function(t,e,n,r){return n(t,e)<=r(t,e)},">=":function(t,e,n,r){return n(t,e)>=r(t,e)},"&&":function(t,e,n,r){return n(t,e)&&r(t,e)},"||":function(t,e,n,r){return n(t,e)||r(t,e)},"!":function(t,e,n){return!n(t,e)},"=":!0,"|":!0}),vi={n:"\n",f:"\f",r:"\r",t:" ",v:"\x0B","'":"'",'"':'"'},gi=function(t){this.options=t};gi.prototype={constructor:gi,lex:function(t){for(this.text=t,this.index=0,this.tokens=[];this.index="0"&&"9">=t&&"string"==typeof t},isWhitespace:function(t){return" "===t||"\r"===t||" "===t||"\n"===t||"\x0B"===t||" "===t},isIdent:function(t){return t>="a"&&"z">=t||t>="A"&&"Z">=t||"_"===t||"$"===t},isExpOperator:function(t){return"-"===t||"+"===t||this.isNumber(t)},throwError:function(t,e,n){n=n||this.index;var r=$(e)?"s "+e+"-"+this.index+" ["+this.text.substring(e,n)+"]":" "+n;throw li("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",t,r,this.text)},readNumber:function(){for(var t="",e=this.index;this.indext){var o=this.tokens[t],a=o.text;if(a===e||a===n||a===r||a===i||!e&&!n&&!r&&!i)return o}return!1},expect:function(t,e,n,r){var i=this.peek(t,e,n,r);return i?(this.tokens.shift(),i):!1},consume:function(t){if(0===this.tokens.length)throw li("ueoe","Unexpected end of expression: {0}",this.text);var e=this.expect(t);return e||this.throwError("is unexpected, expecting ["+t+"]",this.peek()),e},unaryFn:function(t,e){var n=mi[t];return f(function(t,r){return n(t,r,e)},{constant:e.constant,inputs:[e]})},binaryFn:function(t,e,n,r){var i=mi[e];return f(function(e,r){return i(e,r,t,n)},{constant:t.constant&&n.constant,inputs:!r&&[t,n]})},identifier:function(){for(var t=this.consume().text;this.peek(".")&&this.peekAhead(1).identifier&&!this.peekAhead(2,"(");)t+=this.consume().text+this.consume().text;return Le(t,this.options,this.text)},constant:function(){var t=this.consume().value;return f(function(){return t},{constant:!0,literal:!0})},statements:function(){for(var t=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&t.push(this.filterChain()),!this.expect(";"))return 1===t.length?t[0]:function(e,n){for(var r,i=0,o=t.length;o>i;i++)r=t[i](e,n);return r}},filterChain:function(){for(var t,e=this.expression();t=this.expect("|");)e=this.filter(e);return e},filter:function(t){var e,r,i=this.$filter(this.consume().text);if(this.peek(":"))for(e=[],r=[];this.expect(":");)e.push(this.expression());var o=[t].concat(e||[]);return f(function(o,a){var s=t(o,a);if(r){r[0]=s;for(var u=e.length;u--;)r[u+1]=e[u](o,a);return i.apply(n,r)}return i(s)},{constant:!i.$stateful&&o.every(Ne),inputs:!i.$stateful&&o})},expression:function(){return this.assignment()},assignment:function(){var t,e,n=this.ternary();return(e=this.expect("="))?(n.assign||this.throwError("implies assignment but ["+this.text.substring(0,e.index)+"] can not be assigned to",e),t=this.ternary(),f(function(e,r){return n.assign(e,t(e,r),r)},{inputs:[n,t]})):n},ternary:function(){var t,e,n=this.logicalOR();if((e=this.expect("?"))&&(t=this.assignment(),this.consume(":"))){var r=this.assignment();return f(function(e,i){return n(e,i)?t(e,i):r(e,i)},{constant:n.constant&&t.constant&&r.constant})}return n},logicalOR:function(){for(var t,e=this.logicalAND();t=this.expect("||");)e=this.binaryFn(e,t.text,this.logicalAND(),!0);return e},logicalAND:function(){for(var t,e=this.equality();t=this.expect("&&");)e=this.binaryFn(e,t.text,this.equality(),!0);return e},equality:function(){for(var t,e=this.relational();t=this.expect("==","!=","===","!==");)e=this.binaryFn(e,t.text,this.relational());return e},relational:function(){for(var t,e=this.additive();t=this.expect("<",">","<=",">=");)e=this.binaryFn(e,t.text,this.additive());return e},additive:function(){for(var t,e=this.multiplicative();t=this.expect("+","-");)e=this.binaryFn(e,t.text,this.multiplicative());return e},multiplicative:function(){for(var t,e=this.unary();t=this.expect("*","/","%");)e=this.binaryFn(e,t.text,this.unary());return e},unary:function(){var t;return this.expect("+")?this.primary():(t=this.expect("-"))?this.binaryFn($i.ZERO,t.text,this.unary()):(t=this.expect("!"))?this.unaryFn(t.text,this.unary()):this.primary()},fieldAccess:function(t){var e=this.identifier();return f(function(r,i,o){var a=o||t(r,i);return null==a?n:e(a)},{assign:function(n,r,i){var o=t(n,i);return o||t.assign(n,o={},i),e.assign(o,r)}})},objectIndex:function(t){var e=this.text,r=this.expression();return this.consume("]"),f(function(i,o){var a,s=t(i,o),u=Me(r(i,o),e);return ze(u,e),s?a=De(s[u],e):n},{assign:function(n,i,o){var a=ze(Me(r(n,o),e),e),s=De(t(n,o),e);return s||t.assign(n,s={},o),s[a]=i}})},functionCall:function(t,e){var r=[];if(")"!==this.peekToken().text)do r.push(this.expression());while(this.expect(","));this.consume(")");var i=this.text,o=r.length?[]:null;return function(a,s){var u=e?e(a,s):$(e)?n:a,c=t(a,s,u)||p;if(o)for(var l=r.length;l--;)o[l]=De(r[l](a,s),i);De(u,i),je(c,i);var f=c.apply?c.apply(u,o):c(o[0],o[1],o[2],o[3],o[4]);return o&&(o.length=0),De(f,i)}},arrayDeclaration:function(){var t=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;t.push(this.expression())}while(this.expect(","));return this.consume("]"),f(function(e,n){for(var r=[],i=0,o=t.length;o>i;i++)r.push(t[i](e,n));return r},{literal:!0,constant:t.every(Ne),inputs:t})},object:function(){var t=[],e=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;var n=this.consume();n.constant?t.push(n.value):n.identifier?t.push(n.text):this.throwError("invalid key",n),this.consume(":"),e.push(this.expression())}while(this.expect(","));return this.consume("}"),f(function(n,r){for(var i={},o=0,a=e.length;a>o;o++)i[t[o]]=e[o](n,r);return i},{literal:!0,constant:e.every(Ne),inputs:e})}};var yi=ct(),bi=ct(),wi=Object.prototype.valueOf,_i=r("$sce"),xi={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Kr=r("$compile"),Ci=e.createElement("a"),Ei=on(t.location.href);un.$inject=["$provide"],hn.$inject=["$locale"],dn.$inject=["$locale"];var ki=".",Ai={yyyy:vn("FullYear",4),yy:vn("FullYear",2,0,!0),y:vn("FullYear",1),MMMM:gn("Month"),MMM:gn("Month",!0),MM:vn("Month",2,1),M:vn("Month",1,1),dd:vn("Date",2),d:vn("Date",1),HH:vn("Hours",2),H:vn("Hours",1),hh:vn("Hours",2,-12),h:vn("Hours",1,-12),mm:vn("Minutes",2),m:vn("Minutes",1),ss:vn("Seconds",2),s:vn("Seconds",1),sss:vn("Milliseconds",3),EEEE:gn("Day"),EEE:gn("Day",!0),a:_n,Z:$n,ww:wn(2),w:wn(1),G:xn,GG:xn,GGG:xn,GGGG:Cn},Si=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,Ti=/^\-?\d+$/;En.$inject=["$locale"];var Oi=v(Gn),Ii=v(Jn);Sn.$inject=["$parse"];var zi=v({restrict:"E",compile:function(t,e){return e.href||e.xlinkHref||e.name?void 0:function(t,e){if("a"===e[0].nodeName.toLowerCase()){var n="[object SVGAnimatedString]"===ur.call(e.prop("href"))?"xlink:href":"href";e.on("click",function(t){e.attr(n)||t.preventDefault()})}}}}),Mi={};o(Lr,function(t,e){if("multiple"!=t){var n=Jt("ng-"+e);Mi[n]=function(){return{restrict:"A",priority:100,link:function(t,r,i){t.$watch(i[n],function(t){i.$set(e,!!t)})}}}}}),o(Vr,function(t,e){Mi[e]=function(){return{priority:100,link:function(t,n,r){if("ngPattern"===e&&"/"==r.ngPattern.charAt(0)){var i=r.ngPattern.match(Yn);if(i)return void r.$set("ngPattern",new RegExp(i[1],i[2]))}t.$watch(r[e],function(t){r.$set(e,t)})}}}}),o(["src","srcset","href"],function(t){var e=Jt("ng-"+t);Mi[e]=function(){return{priority:99,link:function(n,r,i){var o=t,a=t;"href"===t&&"[object SVGAnimatedString]"===ur.call(r.prop("href"))&&(a="xlinkHref",i.$attr[a]="xlink:href",o=null),i.$observe(e,function(e){return e?(i.$set(a,e),void(er&&o&&r.prop(o,i[a]))):void("href"===t&&i.$set(a,null))})}}}});var Di={$addControl:p,$$renameControl:On,$removeControl:p,$setValidity:p,$setDirty:p,$setPristine:p,$setSubmitted:p},ji="ng-submitted";In.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Ni=function(t){return["$timeout",function(e){var r={name:"form",restrict:t?"EAC":"E",controller:In,compile:function(r,i){r.addClass(go).addClass(mo);var o=i.name?"name":t&&i.ngForm?"ngForm":!1;return{pre:function(t,r,i,a){if(!("action"in i)){var s=function(e){t.$apply(function(){a.$commitViewValue(),a.$setSubmitted()}),e.preventDefault()};Tr(r[0],"submit",s),r.on("$destroy",function(){e(function(){Or(r[0],"submit",s)},0,!1)})}var u=a.$$parentForm;o&&(Re(t,null,a.$name,a,a.$name),i.$observe(o,function(e){a.$name!==e&&(Re(t,null,a.$name,n,a.$name),u.$$renameControl(a,e),Re(t,null,a.$name,a,a.$name))})),r.on("$destroy",function(){u.$removeControl(a),o&&Re(t,null,i[o],n,a.$name),f(a,Di)})}}}};return r}]},Ri=Ni(),Pi=Ni(!0),Fi=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,Bi=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Li=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Ui=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Vi=/^(\d{4})-(\d{2})-(\d{2})$/,qi=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Hi=/^(\d{4})-W(\d\d)$/,Wi=/^(\d{4})-(\d\d)$/,Xi=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Yi={text:Mn,date:Rn("date",Vi,Nn(Vi,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":Rn("datetimelocal",qi,Nn(qi,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:Rn("time",Xi,Nn(Xi,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:Rn("week",Hi,jn,"yyyy-Www"),month:Rn("month",Wi,Nn(Wi,["yyyy","MM"]),"yyyy-MM"),number:Fn,url:Bn,email:Ln,radio:Un,checkbox:qn,hidden:p,button:p,submit:p,reset:p,file:p},Zi=["$browser","$sniffer","$filter","$parse",function(t,e,n,r){return{restrict:"E",require:["?ngModel"],link:{pre:function(i,o,a,s){s[0]&&(Yi[Gn(a.type)]||Yi.text)(i,o,a,s[0],e,t,n,r)}}}}],Gi=/^(true|false|\d+)$/,Ki=function(){return{restrict:"A",priority:100,compile:function(t,e){return Gi.test(e.ngValue)?function(t,e,n){n.$set("value",t.$eval(n.ngValue))}:function(t,e,n){t.$watch(n.ngValue,function(t){n.$set("value",t)})}}}},Ji=["$compile",function(t){return{restrict:"AC",compile:function(e){return t.$$addBindingClass(e),function(e,r,i){t.$$addBindingInfo(r,i.ngBind),r=r[0],e.$watch(i.ngBind,function(t){r.textContent=t===n?"":t})}}}}],Qi=["$interpolate","$compile",function(t,e){return{compile:function(r){return e.$$addBindingClass(r),function(r,i,o){var a=t(i.attr(o.$attr.ngBindTemplate));e.$$addBindingInfo(i,a.expressions),i=i[0],o.$observe("ngBindTemplate",function(t){i.textContent=t===n?"":t})}}}}],to=["$sce","$parse","$compile",function(t,e,n){return{restrict:"A",compile:function(r,i){var o=e(i.ngBindHtml),a=e(i.ngBindHtml,function(t){return(t||"").toString()});return n.$$addBindingClass(r),function(e,r,i){n.$$addBindingInfo(r,i.ngBindHtml),e.$watch(a,function(){r.html(t.getTrustedHtml(o(e))||"")})}}}}],eo=v({restrict:"A",require:"ngModel",link:function(t,e,n,r){r.$viewChangeListeners.push(function(){t.$eval(n.ngChange)})}}),no=Hn("",!0),ro=Hn("Odd",0),io=Hn("Even",1),oo=Tn({compile:function(t,e){e.$set("ngCloak",n),t.removeClass("ng-cloak")}}),ao=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],so={},uo={blur:!0,focus:!0};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(t){var e=Jt("ng-"+t);so[e]=["$parse","$rootScope",function(n,r){return{restrict:"A",compile:function(i,o){var a=n(o[e],null,!0);return function(e,n){n.on(t,function(n){var i=function(){a(e,{$event:n})};uo[t]&&r.$$phase?e.$evalAsync(i):e.$apply(i)})}}}}]});var co=["$animate",function(t){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(n,r,i,o,a){var s,u,c;n.$watch(i.ngIf,function(n){n?u||a(function(n,o){u=o,n[n.length++]=e.createComment(" end ngIf: "+i.ngIf+" "),s={clone:n},t.enter(n,r.parent(),r)}):(c&&(c.remove(),c=null),u&&(u.$destroy(),u=null),s&&(c=ut(s.clone),t.leave(c).then(function(){c=null}),s=null))})}}}],lo=["$templateRequest","$anchorScroll","$animate",function(t,e,n){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:lr.noop,compile:function(r,i){var o=i.ngInclude||i.src,a=i.onload||"",s=i.autoscroll;return function(r,i,u,c,l){var f,h,d,p=0,m=function(){h&&(h.remove(),h=null),f&&(f.$destroy(),f=null),d&&(n.leave(d).then(function(){h=null}),h=d,d=null)};r.$watch(o,function(o){var u=function(){!$(s)||s&&!r.$eval(s)||e()},h=++p;o?(t(o,!0).then(function(t){if(h===p){var e=r.$new();c.template=t;var s=l(e,function(t){m(),n.enter(t,null,i).then(u)});f=e,d=s,f.$emit("$includeContentLoaded",o),r.$eval(a)}},function(){h===p&&(m(),r.$emit("$includeContentError",o))}),r.$emit("$includeContentRequested",o)):(m(),c.template=null)})}}}}],fo=["$compile",function(t){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(n,r,i,o){return/SVG/.test(r[0].toString())?(r.empty(),void t($t(o.template,e).childNodes)(n,function(t){r.append(t)},{futureParentElement:r})):(r.html(o.template),void t(r.contents())(n))}}}],ho=Tn({priority:450,compile:function(){return{pre:function(t,e,n){t.$eval(n.ngInit)}}}}),po=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(t,e,r,i){var a=e.attr(r.$attr.ngList)||", ",s="false"!==r.ngTrim,u=s?pr(a):a,c=function(t){if(!g(t)){var e=[];return t&&o(t.split(u),function(t){t&&e.push(s?pr(t):t)}),e}};i.$parsers.push(c),i.$formatters.push(function(t){return dr(t)?t.join(a):n}),i.$isEmpty=function(t){return!t||!t.length}}}},mo="ng-valid",vo="ng-invalid",go="ng-pristine",$o="ng-dirty",yo="ng-untouched",bo="ng-touched",wo="ng-pending",_o=r("ngModel"),xo=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(t,e,r,i,a,s,u,c,l,f){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=n,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=n,this.$name=f(r.name||"",!1)(t);var h,d=a(r.ngModel),m=d.assign,v=d,y=m,b=null,_=this;this.$$setOptions=function(t){if(_.$options=t,t&&t.getterSetter){var e=a(r.ngModel+"()"),n=a(r.ngModel+"($$$p)");v=function(t){var n=d(t);return x(n)&&(n=e(t)),n},y=function(t,e){x(d(t))?n(t,{$$$p:_.$modelValue}):m(t,_.$modelValue)}}else if(!d.assign)throw _o("nonassign","Expression '{0}' is non-assignable. Element: {1}",r.ngModel,H(i))},this.$render=p,this.$isEmpty=function(t){return g(t)||""===t||null===t||t!==t};var C=i.inheritedData("$formController")||Di,E=0;Wn({ctrl:this,$element:i,set:function(t,e){t[e]=!0},unset:function(t,e){delete t[e]},parentForm:C,$animate:s}),this.$setPristine=function(){_.$dirty=!1,_.$pristine=!0,s.removeClass(i,$o),s.addClass(i,go)},this.$setDirty=function(){_.$dirty=!0,_.$pristine=!1,s.removeClass(i,go),s.addClass(i,$o),C.$setDirty()},this.$setUntouched=function(){_.$touched=!1,_.$untouched=!0,s.setClass(i,yo,bo)},this.$setTouched=function(){_.$touched=!0,_.$untouched=!1,s.setClass(i,bo,yo)},this.$rollbackViewValue=function(){u.cancel(b),_.$viewValue=_.$$lastCommittedViewValue,_.$render()},this.$validate=function(){if(!w(_.$modelValue)||!isNaN(_.$modelValue)){var t=_.$$lastCommittedViewValue,e=_.$$rawModelValue,r=_.$valid,i=_.$modelValue,o=_.$options&&_.$options.allowInvalid;_.$$runValidators(e,t,function(t){o||r===t||(_.$modelValue=t?e:n,_.$modelValue!==i&&_.$$writeModelToScope())})}},this.$$runValidators=function(t,e,r){function i(){var t=_.$$parserName||"parse";return h!==n?(h||(o(_.$validators,function(t,e){u(e,null)}),o(_.$asyncValidators,function(t,e){u(e,null)})),u(t,h),h):(u(t,null),!0)}function a(){var n=!0;return o(_.$validators,function(r,i){var o=r(t,e);n=n&&o,u(i,o)}),n?!0:(o(_.$asyncValidators,function(t,e){u(e,null)}),!1)}function s(){var r=[],i=!0;o(_.$asyncValidators,function(o,a){var s=o(t,e);if(!I(s))throw _o("$asyncValidators","Expected asynchronous validator to return a promise but got '{0}' instead.",s);u(a,n),r.push(s.then(function(){u(a,!0)},function(t){i=!1,u(a,!1)}))}),r.length?l.all(r).then(function(){c(i)},p):c(!0)}function u(t,e){f===E&&_.$setValidity(t,e)}function c(t){f===E&&r(t)}E++;var f=E;return i()&&a()?void s():void c(!1)},this.$commitViewValue=function(){var t=_.$viewValue;u.cancel(b),(_.$$lastCommittedViewValue!==t||""===t&&_.$$hasNativeValidators)&&(_.$$lastCommittedViewValue=t,_.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){function e(){_.$modelValue!==a&&_.$$writeModelToScope()}var r=_.$$lastCommittedViewValue,i=r;if(h=g(i)?n:!0)for(var o=0;o<_.$parsers.length;o++)if(i=_.$parsers[o](i),g(i)){h=!1;break}w(_.$modelValue)&&isNaN(_.$modelValue)&&(_.$modelValue=v(t));var a=_.$modelValue,s=_.$options&&_.$options.allowInvalid;_.$$rawModelValue=i,s&&(_.$modelValue=i,e()),_.$$runValidators(i,_.$$lastCommittedViewValue,function(t){s||(_.$modelValue=t?i:n,e())})},this.$$writeModelToScope=function(){y(t,_.$modelValue),o(_.$viewChangeListeners,function(t){try{t()}catch(n){e(n)}})},this.$setViewValue=function(t,e){_.$viewValue=t,(!_.$options||_.$options.updateOnDefault)&&_.$$debounceViewValueCommit(e)},this.$$debounceViewValueCommit=function(e){var n,r=0,i=_.$options;i&&$(i.debounce)&&(n=i.debounce,w(n)?r=n:w(n[e])?r=n[e]:w(n["default"])&&(r=n["default"])),u.cancel(b),r?b=u(function(){_.$commitViewValue()},r):c.$$phase?_.$commitViewValue():t.$apply(function(){_.$commitViewValue()})},t.$watch(function(){var e=v(t);if(e!==_.$modelValue&&(_.$modelValue===_.$modelValue||e===e)){_.$modelValue=_.$$rawModelValue=e,h=n;for(var r=_.$formatters,i=r.length,o=e;i--;)o=r[i](o);_.$viewValue!==o&&(_.$viewValue=_.$$lastCommittedViewValue=o,_.$render(),_.$$runValidators(e,o,p))}return e})}],Co=["$rootScope",function(t){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:xo,priority:1,compile:function(e){return e.addClass(go).addClass(yo).addClass(mo),{pre:function(t,e,n,r){var i=r[0],o=r[1]||Di;i.$$setOptions(r[2]&&r[2].$options),o.$addControl(i),n.$observe("name",function(t){i.$name!==t&&o.$$renameControl(i,t)}),t.$on("$destroy",function(){o.$removeControl(i)})},post:function(e,n,r,i){var o=i[0];o.$options&&o.$options.updateOn&&n.on(o.$options.updateOn,function(t){o.$$debounceViewValueCommit(t&&t.type)}),n.on("blur",function(n){o.$touched||(t.$$phase?e.$evalAsync(o.$setTouched):e.$apply(o.$setTouched))})}}}}}],Eo=/(\s+|^)default(\s+|$)/,ko=function(){return{restrict:"A",controller:["$scope","$attrs",function(t,e){var r=this;this.$options=t.$eval(e.ngModelOptions),this.$options.updateOn!==n?(this.$options.updateOnDefault=!1,this.$options.updateOn=pr(this.$options.updateOn.replace(Eo,function(){return r.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},Ao=Tn({terminal:!0,priority:1e3}),So=["$locale","$interpolate",function(t,e){var n=/{}/g,r=/^when(Minus)?(.+)$/;return{restrict:"EA",link:function(i,a,s){function u(t){a.text(t||"")}var c,l=s.count,f=s.$attr.when&&a.attr(s.$attr.when),h=s.offset||0,d=i.$eval(f)||{},p={},m=e.startSymbol(),v=e.endSymbol(),g=m+l+"-"+h+v,$=lr.noop;o(s,function(t,e){var n=r.exec(e);if(n){var i=(n[1]?"-":"")+Gn(n[2]);d[i]=a.attr(s.$attr[e])}}),o(d,function(t,r){p[r]=e(t.replace(n,g))}),i.$watch(l,function(e){var n=parseFloat(e),r=isNaN(n);r||n in d||(n=t.pluralCat(n-h)),n===c||r&&isNaN(c)||($(),$=i.$watch(p[n],u),c=n)})}}}],To=["$parse","$animate",function(t,a){var s="$$NG_REMOVED",u=r("ngRepeat"),c=function(t,e,n,r,i,o,a){t[n]=r,i&&(t[i]=o),t.$index=e,t.$first=0===e,t.$last=e===a-1,t.$middle=!(t.$first||t.$last),t.$odd=!(t.$even=0===(1&e))},l=function(t){return t.clone[0]},f=function(t){return t.clone[t.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(r,h){var d=h.ngRepeat,p=e.createComment(" end ngRepeat: "+d+" "),m=d.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!m)throw u("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",d);var v=m[1],g=m[2],$=m[3],y=m[4];if(m=v.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/),!m)throw u("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",v);var b=m[3]||m[1],w=m[2];if($&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test($)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test($)))throw u("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",$);var _,x,C,E,k={$id:Bt};return y?_=t(y):(C=function(t,e){return Bt(e)},E=function(t){return t}),function(t,e,r,h,m){_&&(x=function(e,n,r){return w&&(k[w]=e),k[b]=n,k.$index=r,_(t,k)});var v=ct();t.$watchCollection(g,function(r){var h,g,y,_,k,A,S,T,O,I,z,M,D=e[0],j=ct();if($&&(t[$]=r),i(r))O=r,T=x||C;else{T=x||E,O=[];for(var N in r)r.hasOwnProperty(N)&&"$"!=N.charAt(0)&&O.push(N);O.sort()}for(_=O.length,z=new Array(_),h=0;_>h;h++)if(k=r===O?h:O[h],A=r[k],S=T(k,A,h),v[S])I=v[S],delete v[S],j[S]=I,z[h]=I;else{if(j[S])throw o(z,function(t){t&&t.scope&&(v[t.id]=t)}),u("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",d,S,A);z[h]={id:S,scope:n,clone:n},j[S]=!0}for(var R in v){if(I=v[R],M=ut(I.clone),a.leave(M),M[0].parentNode)for(h=0,g=M.length;g>h;h++)M[h][s]=!0;I.scope.$destroy()}for(h=0;_>h;h++)if(k=r===O?h:O[h],A=r[k],I=z[h],I.scope){y=D;do y=y.nextSibling;while(y&&y[s]);l(I)!=y&&a.move(ut(I.clone),null,nr(D)),D=f(I),c(I.scope,h,b,A,w,k,_)}else m(function(t,e){I.scope=e;var n=p.cloneNode(!1);t[t.length++]=n,a.enter(t,null,nr(D)),D=n,I.clone=t,j[I.id]=I,c(I.scope,h,b,A,w,k,_)});v=j})}}}}],Oo="ng-hide",Io="ng-hide-animate",zo=["$animate",function(t){return{restrict:"A",multiElement:!0,link:function(e,n,r){e.$watch(r.ngShow,function(e){t[e?"removeClass":"addClass"](n,Oo,{tempClasses:Io})})}}}],Mo=["$animate",function(t){return{restrict:"A",multiElement:!0,link:function(e,n,r){e.$watch(r.ngHide,function(e){t[e?"addClass":"removeClass"](n,Oo,{tempClasses:Io})})}}}],Do=Tn(function(t,e,n){t.$watch(n.ngStyle,function(t,n){n&&t!==n&&o(n,function(t,n){e.css(n,"")}),t&&e.css(t)},!0)}),jo=["$animate",function(t){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(n,r,i,a){var s=i.ngSwitch||i.on,u=[],c=[],l=[],f=[],h=function(t,e){return function(){t.splice(e,1)}};n.$watch(s,function(n){var r,i;for(r=0,i=l.length;i>r;++r)t.cancel(l[r]);for(l.length=0,r=0,i=f.length;i>r;++r){var s=ut(c[r].clone);f[r].$destroy();var d=l[r]=t.leave(s);d.then(h(l,r))}c.length=0,f.length=0,(u=a.cases["!"+n]||a.cases["?"])&&o(u,function(n){n.transclude(function(r,i){f.push(i);var o=n.element;r[r.length++]=e.createComment(" end ngSwitchWhen: ");var a={clone:r};c.push(a),t.enter(r,o.parent(),o)})})})}}}],No=Tn({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(t,e,n,r,i){r.cases["!"+n.ngSwitchWhen]=r.cases["!"+n.ngSwitchWhen]||[],r.cases["!"+n.ngSwitchWhen].push({transclude:i,element:e})}}),Ro=Tn({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(t,e,n,r,i){r.cases["?"]=r.cases["?"]||[],r.cases["?"].push({transclude:i,element:e})}}),Po=Tn({restrict:"EAC",link:function(t,e,n,i,o){if(!o)throw r("ngTransclude")("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",H(e));o(function(t){e.empty(),e.append(t)})}}),Fo=["$templateCache",function(t){return{restrict:"E",terminal:!0,compile:function(e,n){if("text/ng-template"==n.type){var r=n.id,i=e[0].text;t.put(r,i)}}}}],Bo=r("ngOptions"),Lo=v({restrict:"A",terminal:!0}),Uo=["$compile","$parse",function(t,r){var i=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\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]+?))?$/,s={$setViewValue:p};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(t,e,n){var r,i,o=this,a={},u=s;o.databound=n.ngModel,o.init=function(t,e,n){u=t,r=e,i=n},o.addOption=function(e,n){at(e,'"option value"'),a[e]=!0,u.$viewValue==e&&(t.val(e),i.parent()&&i.remove()),n&&n[0].hasAttribute("selected")&&(n[0].selected=!0)},o.removeOption=function(t){this.hasOption(t)&&(delete a[t],u.$viewValue===t&&this.renderUnknownOption(t))},o.renderUnknownOption=function(e){var n="? "+Bt(e)+" ?";i.val(n),t.prepend(i),t.val(n),i.prop("selected",!0)},o.hasOption=function(t){return a.hasOwnProperty(t)},e.$on("$destroy",function(){o.renderUnknownOption=p})}],link:function(s,u,c,l){function f(t,e,n,r){n.$render=function(){var t=n.$viewValue;r.hasOption(t)?(C.parent()&&C.remove(),e.val(t),""===t&&p.prop("selected",!0)):null==t&&p?e.val(""):r.renderUnknownOption(t)},e.on("change",function(){t.$apply(function(){C.parent()&&C.remove(),n.$setViewValue(e.val())})})}function h(t,e,n){var r;n.$render=function(){var t=new Lt(n.$viewValue);o(e.find("option"),function(e){e.selected=$(t.get(e.value))})},t.$watch(function(){P(r,n.$viewValue)||(r=R(n.$viewValue),n.$render())}),e.on("change",function(){t.$apply(function(){var t=[];o(e.find("option"),function(e){ +e.selected&&t.push(e.value)}),n.$setViewValue(t)})})}function d(e,s,u){function c(t,n,r){return P[A]=r,O&&(P[O]=n),t(e,P)}function l(){e.$apply(function(){var t,n=M(e)||[];if(g)t=[],o(s.val(),function(e){e=j?N[e]:e,t.push(f(e,n[e]))});else{var r=j?N[s.val()]:s.val();t=f(r,n[r])}u.$setViewValue(t),C()})}function f(t,e){if("?"===t)return n;if(""===t)return null;var r=T?T:z;return c(r,t,e)}function h(){var t,n=M(e);if(n&&dr(n)){t=new Array(n.length);for(var r=0,i=n.length;i>r;r++)t[r]=c(k,r,n[r]);return t}if(n){t={};for(var o in n)n.hasOwnProperty(o)&&(t[o]=c(k,o,n[o]))}return t}function d(t){var e;if(g)if(j&&dr(t)){e=new Lt([]);for(var n=0;nA;A++)h=A,O&&(h=q[A],"$"===h.charAt(0))||(p=V[h],t=c(I,h,p)||"",(n=B[t])||(n=B[t]=[],L.push(t)),S=W(h,p),X=X||S,D=c(k,h,p),D=$(D)?D:"",F=j?j(e,P):O?q[A]:A,j&&(N[F]=h),n.push({id:F,label:D,selected:S}));for(g||(b||null===U?B[""].unshift({id:"",label:"",selected:!X}):X||B[""].unshift({id:"?",label:"",selected:!0})),E=0,y=L.length;y>E;E++){for(t=L[E],n=B[t],R.length<=E?(i={element:x.clone().attr("label",t),label:n.label},l=[i],R.push(l),s.append(i.element)):(l=R[E],i=l[0],i.label!=t&&i.element.attr("label",i.label=t)),T=null,A=0,C=n.length;C>A;A++)r=n[A],(f=l[A+1])?(T=f.element,f.label!==r.label&&(v(H,f.label,!1),v(H,r.label,!0),T.text(f.label=r.label),T.prop("label",f.label)),f.id!==r.id&&T.val(f.id=r.id),T[0].selected!==r.selected&&(T.prop("selected",f.selected=r.selected),er&&T.prop("selected",f.selected))):(""===r.id&&b?z=b:(z=_.clone()).val(r.id).prop("selected",r.selected).attr("selected",r.selected).prop("label",r.label).text(r.label),l.push(f={element:z,label:r.label,id:r.id,selected:r.selected}),v(H,r.label,!0),T?T.after(z):i.element.append(z),T=z);for(A++;l.length>A;)r=l.pop(),v(H,r.label,!1),r.element.remove()}for(;R.length>E;){for(n=R.pop(),A=1;A0?m.addOption(e):0>t&&m.removeOption(e)})}var E;if(!(E=y.match(i)))throw Bo("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",y,H(s));var k=r(E[2]||E[1]),A=E[4]||E[6],S=/ as /.test(E[0])&&E[1],T=S?r(S):null,O=E[5],I=r(E[3]||""),z=r(E[2]?E[1]:A),M=r(E[7]),D=E[8],j=D?r(E[8]):null,N={},R=[[{element:s,label:""}]],P={};b&&(t(b)(e),b.removeClass("ng-scope"),b.remove()),s.empty(),s.on("change",l),u.$render=C,e.$watchCollection(M,p),e.$watchCollection(h,p),g&&e.$watchCollection(function(){return u.$modelValue},p)}if(l[1]){for(var p,m=l[0],v=l[1],g=c.multiple,y=c.ngOptions,b=!1,w=!1,_=nr(e.createElement("option")),x=nr(e.createElement("optgroup")),C=_.clone(),E=0,k=u.children(),A=k.length;A>E;E++)if(""===k[E].value){p=b=k.eq(E);break}m.init(v,b,C),g&&(v.$isEmpty=function(t){return!t||0===t.length}),y?d(s,u,v):g?h(s,u,v):f(s,u,v,m)}}}}],Vo=["$interpolate",function(t){var e={addOption:p,removeOption:p};return{restrict:"E",priority:100,compile:function(n,r){if(g(r.value)){var i=t(n.text(),!0);i||r.$set("value",n.text())}return function(t,n,r){var o="$selectController",a=n.parent(),s=a.data(o)||a.parent().data(o);s&&s.databound||(s=e),i?t.$watch(i,function(t,e){r.$set("value",t),e!==t&&s.removeOption(e),s.addOption(t,n)}):s.addOption(r.value,n),n.on("$destroy",function(){s.removeOption(r.value)})}}}}],qo=v({restrict:"E",terminal:!1}),Ho=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,r){r&&(n.required=!0,r.$validators.required=function(t,e){return!n.required||!r.$isEmpty(e)},n.$observe("required",function(){r.$validate()}))}}},Wo=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,i,o){if(o){var a,s=i.ngPattern||i.pattern;i.$observe("pattern",function(t){if(b(t)&&t.length>0&&(t=new RegExp("^"+t+"$")),t&&!t.test)throw r("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",s,t,H(e));a=t||n,o.$validate()}),o.$validators.pattern=function(t,e){return o.$isEmpty(e)||g(a)||a.test(e)}}}}},Xo=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,r){if(r){var i=-1;n.$observe("maxlength",function(t){var e=h(t);i=isNaN(e)?-1:e,r.$validate()}),r.$validators.maxlength=function(t,e){return 0>i||r.$isEmpty(e)||e.length<=i}}}}},Yo=function(){return{restrict:"A",require:"?ngModel",link:function(t,e,n,r){if(r){var i=0;n.$observe("minlength",function(t){i=h(t)||0,r.$validate()}),r.$validators.minlength=function(t,e){return r.$isEmpty(e)||e.length>=i}}}}};return t.angular.bootstrap?void console.log("WARNING: Tried to load angular more than once."):(rt(),dt(lr),void nr(e).ready(function(){J(e,Q)}))}(window,document),!window.angular.$$csp()&&window.angular.element(document.head).prepend(''),function(t,e,n){"use strict";e.module("ngAnimate",["ng"]).directive("ngAnimateChildren",function(){var t="$$ngAnimateChildren";return function(n,r,i){var o=i.ngAnimateChildren;e.isString(o)&&0===o.length?r.data(t,!0):n.$watch(o,function(e){r.data(t,!!e)})}}).factory("$$animateReflow",["$$rAF","$document",function(t,e){var n=e[0].body;return function(e){return t(function(){e(n.offsetWidth)})}}]).config(["$provide","$animateProvider",function(r,i){function o(t){for(var e=0;e0&&[o.join(" "),a.join(" ")]}function I(t){if(t){var e=[],n={},i=t.substr(1).split(".");(v.transitions||v.animations)&&e.push(r.get(h[""]));for(var o=0;o0&&_(function(){r.triggerHandler(i,{event:t,className:n})})}function d(){h("before")}function p(){h("after")}function m(){h("close"),u()}function v(){v.hasBeenRun||(v.hasBeenRun=!0,a())}function $(){if(!$.hasBeenRun){w&&w.applyStyles(),$.hasBeenRun=!0,s&&s.tempClasses&&f(s.tempClasses,function(t){c.removeClass(r,t)});var e=r.data(g);e&&(w&&w.isClassBased?j(r,n):(_(function(){var e=r.data(g)||{};M==e.index&&j(r,n,t)}),r.data(g,e))),m()}}var b=l,w=z(r,t,n,s);if(!w)return v(),d(),p(),$(),b;t=w.event,n=w.className;var x=e.element._data(w.node);if(x=x&&x.events,i||(i=o?o.parent():r.parent()),N(r,i))return v(),d(),p(),$(),b;var C=r.data(g)||{},E=C.active||{},k=C.totalActive||0,A=C.last,S=!1;if(k>0){var T=[];if(w.isClassBased){if("setClass"==A.event)T.push(A),j(r,n);else if(E[n]){var O=E[n];O.event==t?S=!0:(T.push(O),j(r,n))}}else if("leave"==t&&E["ng-leave"])S=!0;else{for(var I in E)T.push(E[I]);C={},j(r,!0)}T.length>0&&f(T,function(t){t.cancel()})}if(!w.isClassBased||w.isSetClassOperation||"animate"==t||S||(S="addClass"==t==r.hasClass(n)),S)return v(),d(),p(),m(),b;E=C.active||{},k=C.totalActive||0,"leave"==t&&r.one("$destroy",function(t){var n=e.element(this),r=n.data(g);if(r){var i=r.active["ng-leave"];i&&(i.cancel(),j(n,"ng-leave"))}}),c.addClass(r,y),s&&s.tempClasses&&f(s.tempClasses,function(t){c.addClass(r,t)});var M=P++;return k++,E[n]=w,r.data(g,{last:w,active:E,index:M,totalActive:k}),d(),w.before(function(e){var i=r.data(g);e=e||!i||!i.active[n]||w.isClassBased&&i.active[n].event!=t,v(),e===!0?$():(p(),w.after($))}),w.cancel}function D(t){var n=o(t);if(n){var r=e.isFunction(n.getElementsByClassName)?n.getElementsByClassName(y):n.querySelectorAll("."+y);f(r,function(t){t=e.element(t);var n=t.data(g);n&&n.active&&f(n.active,function(t){t.cancel()})})}}function j(t,e){if(u(t,w))b.disabled||(b.running=!1,b.structural=!1);else if(e){var n=t.data(g)||{},r=e===!0;!r&&n.active&&n.active[e]&&(n.totalActive--,delete n.active[e]),(r||!n.totalActive)&&(c.removeClass(t,y),t.removeData(g))}}function N(t,n){if(b.disabled)return!0;if(u(t,w))return b.running;var r,i,o;do{if(0===n.length)break;var a=u(n,w),s=a?b:n.data(g)||{};if(s.disabled)return!0;if(a&&(o=!0),r!==!1){var c=n.data($);e.isDefined(c)&&(r=c)}i=i||s.running||s.last&&!s.last.isClassBased}while(n=n.parent());return!o||!r&&i}c=k,w.data(g,b);var R=x.$watch(function(){return E.totalPendingRequests},function(t,e){0===t&&(R(),x.$$postDigest(function(){x.$$postDigest(function(){b.running=!1})}))}),P=0,F=i.classNameFilter(),B=F?function(t){return F.test(t)}:function(){return!0};return{animate:function(t,e,n,r,i){return r=r||"ng-inline-animate",i=T(i)||{},i.from=n?e:null,i.to=n?n:e,S(function(e){return M("animate",r,s(t),null,null,l,i,e)})},enter:function(n,r,i,o){return o=T(o),n=e.element(n),r=a(r),i=a(i),A(n,!0),t.enter(n,r,i),S(function(t){return M("enter","ng-enter",s(n),r,i,l,o,t)})},leave:function(n,r){return r=T(r),n=e.element(n),D(n),A(n,!0),S(function(e){return M("leave","ng-leave",s(n),null,null,function(){t.leave(n)},r,e)})},move:function(n,r,i,o){return o=T(o),n=e.element(n),r=a(r),i=a(i),D(n),A(n,!0),t.move(n,r,i),S(function(t){return M("move","ng-move",s(n),r,i,l,o,t)})},addClass:function(t,e,n){return this.setClass(t,e,[],n)},removeClass:function(t,e,n){return this.setClass(t,[],e,n)},setClass:function(n,r,i,a){a=T(a);var u="$$animateClasses";if(n=e.element(n),n=s(n),A(n))return t.$$setClassImmediately(n,r,i,a);var c,l=n.data(u),h=!!l;return l||(l={},l.classes={}),c=l.classes,r=d(r)?r:r.split(" "),f(r,function(t){t&&t.length&&(c[t]=!0)}),i=d(i)?i:i.split(" "),f(i,function(t){t&&t.length&&(c[t]=!1)}),h?(a&&l.options&&(l.options=e.extend(l.options||{},a)),l.promise):(n.data(u,l={classes:c,options:a}),l.promise=S(function(e){var r,i,a,s=o(n);if(s&&(r=n.data(u),n.removeData(u),a=n.parent(),i=s.parentNode),!i||i.$$NG_REMOVED||s.$$NG_REMOVED)return void e();var c=n.data(g)||{},l=O(n,r,c.active);return l?M("setClass",l,n,a,null,function(){l[0]&&t.$$addClassImmediately(n,l[0]),l[1]&&t.$$removeClassImmediately(n,l[1])},r.options,e):e()}))},cancel:function(t){t.$$cancelFn()},enabled:function(t,e){switch(arguments.length){case 2:if(t)j(e);else{var n=e.data(g)||{};n.disabled=!0,e.data(g,n)}break;case 1:b.disabled=!t;break;default:t=!b.disabled}return!!t}}}]),i.register("",["$window","$sniffer","$timeout","$$animateReflow",function(r,i,a,s){function u(){j||(j=s(function(){Y=[],j=null,W={}}))}function h(t,e){j&&j(),Y.push(e),j=s(function(){f(Y,function(t){t()}),Y=[],j=null,W={}})}function m(t,n){var r=o(t);t=e.element(r),K.push(t);var i=Date.now()+n;G>=i||(a.cancel(Z),G=i,Z=a(function(){g(K),K=[]},n,!1))}function g(t){f(t,function(t){var e=t.data(U);e&&f(e.closeAnimationFns,function(t){t()})})}function $(t,e){var n=e?W[e]:null;if(!n){var i=0,o=0,a=0,s=0;f(t,function(t){if(t.nodeType==v){var e=r.getComputedStyle(t)||{},n=e[O+N];i=Math.max(y(n),i);var u=e[O+P];o=Math.max(y(u),o);e[z+P];s=Math.max(y(e[z+P]),s);var c=y(e[z+N]);c>0&&(c*=parseInt(e[z+F],10)||1),a=Math.max(c,a)}}),n={total:0,transitionDelay:o,transitionDuration:i,animationDelay:s,animationDuration:a},e&&(W[e]=n)}return n}function y(t){var e=0,n=p(t)?t.split(/\s*,\s*/):[];return f(n,function(t){e=Math.max(parseFloat(t)||0,e)}),e}function b(t){var e=t.parent(),n=e.data(L);return n||(e.data(L,++X),n=X),n+"-"+o(t).getAttribute("class")}function w(t,e,n,r){var i=["ng-enter","ng-leave","ng-move"].indexOf(n)>=0,a=b(e),s=a+" "+n,u=W[s]?++W[s].total:0,l={};if(u>0){var f=n+"-stagger",h=a+" "+f,d=!W[h];d&&c.addClass(e,f),l=$(e,h),d&&c.removeClass(e,f)}c.addClass(e,n);var p=e.data(U)||{},m=$(e,s),v=m.transitionDuration,g=m.animationDuration;if(i&&0===v&&0===g)return c.removeClass(e,n),!1;var y=r||i&&v>0,w=g>0&&l.animationDelay>0&&0===l.animationDuration,_=p.closeAnimationFns||[];e.data(U,{stagger:l,cacheKey:s,running:p.running||0,itemIndex:u,blockTransition:y,closeAnimationFns:_});var E=o(e);return y&&(x(E,!0),r&&e.css(r)),w&&C(E,!0),!0}function _(t,e,n,r,i){function s(){e.off(P,u),c.removeClass(e,d),c.removeClass(e,p),N&&a.cancel(N),S(e,n);var t=o(e);for(var r in g)t.style.removeProperty(g[r])}function u(t){t.stopPropagation();var e=t.originalEvent||t,n=e.$manualTimeStamp||e.timeStamp||Date.now(),i=parseFloat(e.elapsedTime.toFixed(V));Math.max(n-R,0)>=z&&i>=T&&r()}var l=o(e),h=e.data(U);if(-1==l.getAttribute("class").indexOf(n)||!h)return void r();var d="",p="";f(n.split(" "),function(t,e){var n=(e>0?" ":"")+t;d+=n+"-active",p+=n+"-pending"});var v="",g=[],y=h.itemIndex,b=h.stagger,w=0;if(y>0){var _=0;b.transitionDelay>0&&0===b.transitionDuration&&(_=b.transitionDelay*y);var E=0;b.animationDelay>0&&0===b.animationDuration&&(E=b.animationDelay*y,g.push(D+"animation-play-state")),w=Math.round(100*Math.max(_,E))/100}w||(c.addClass(e,d),h.blockTransition&&x(l,!1));var k=h.cacheKey+" "+d,A=$(e,k),T=Math.max(A.transitionDuration,A.animationDuration);if(0===T)return c.removeClass(e,d),S(e,n),void r();!w&&i&&Object.keys(i).length>0&&(A.transitionDuration||(e.css("transition",A.animationDuration+"s linear all"),g.push("transition")),e.css(i));var O=Math.max(A.transitionDelay,A.animationDelay),z=O*H;if(g.length>0){var j=l.getAttribute("style")||"";";"!==j.charAt(j.length-1)&&(j+=";"),l.setAttribute("style",j+" "+v)}var N,R=Date.now(),P=M+" "+I,F=(O+T)*q,B=(w+F)*H;return w>0&&(c.addClass(e,p),N=a(function(){N=null,A.transitionDuration>0&&x(l,!1),A.animationDuration>0&&C(l,!1),c.addClass(e,d),c.removeClass(e,p),i&&(0===A.transitionDuration&&e.css("transition",A.animationDuration+"s linear all"),e.css(i),g.push("transition"))},w*H,!1)),e.on(P,u),h.closeAnimationFns.push(function(){s(),r()}),h.running++,m(e,B),s}function x(t,e){t.style[O+R]=e?"none":""}function C(t,e){t.style[z+B]=e?"paused":""}function E(t,e,n,r){return w(t,e,n,r)?function(t){t&&S(e,n)}:void 0}function k(t,e,n,r,i){return e.data(U)?_(t,e,n,r,i):(S(e,n),void r())}function A(t,e,n,r,i){var o=E(t,e,n,i.from);if(!o)return u(),void r();var a=o;return h(e,function(){a=k(t,e,n,r,i.to)}),function(t){(a||l)(t)}}function S(t,e){c.removeClass(t,e);var n=t.data(U);n&&(n.running&&n.running--,n.running&&0!==n.running||t.removeData(U))}function T(t,e){var n="";return t=d(t)?t:t.split(/\s+/),f(t,function(t,r){t&&t.length>0&&(n+=(r>0?" ":"")+t+e)}),n}var O,I,z,M,D="";t.ontransitionend===n&&t.onwebkittransitionend!==n?(D="-webkit-",O="WebkitTransition",I="webkitTransitionEnd transitionend"):(O="transition",I="transitionend"),t.onanimationend===n&&t.onwebkitanimationend!==n?(D="-webkit-",z="WebkitAnimation",M="webkitAnimationEnd animationend"):(z="animation",M="animationend");var j,N="Duration",R="Property",P="Delay",F="IterationCount",B="PlayState",L="$$ngAnimateKey",U="$$ngAnimateCSS3Data",V=3,q=1.5,H=1e3,W={},X=0,Y=[],Z=null,G=0,K=[];return{animate:function(t,e,n,r,i,o){return o=o||{},o.from=n,o.to=r,A("animate",t,e,i,o)},enter:function(t,e,n){return n=n||{},A("enter",t,"ng-enter",e,n)},leave:function(t,e,n){return n=n||{},A("leave",t,"ng-leave",e,n)},move:function(t,e,n){return n=n||{},A("move",t,"ng-move",e,n)},beforeSetClass:function(t,e,n,r,i){i=i||{};var o=T(n,"-remove")+" "+T(e,"-add"),a=E("setClass",t,o,i.from);return a?(h(t,r),a):(u(),void r())},beforeAddClass:function(t,e,n,r){r=r||{};var i=E("addClass",t,T(e,"-add"),r.from);return i?(h(t,n),i):(u(),void n())},beforeRemoveClass:function(t,e,n,r){r=r||{};var i=E("removeClass",t,T(e,"-remove"),r.from);return i?(h(t,n),i):(u(),void n())},setClass:function(t,e,n,r,i){i=i||{},n=T(n,"-remove"),e=T(e,"-add");var o=n+" "+e;return k("setClass",t,o,r,i.to)},addClass:function(t,e,n,r){return r=r||{},k("addClass",t,T(e,"-add"),n,r.to)},removeClass:function(t,e,n,r){return r=r||{},k("removeClass",t,T(e,"-remove"),n,r.to)}}}])}])}(window,window.angular),function(t,e,n){"use strict";e.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(t,r){function i(){var t,i,o,u;for(t in s)l(a[t])&&(r.cookies(t,n),delete s[t]);for(t in a)i=a[t],e.isString(i)||(i=""+i,a[t]=i),i!==s[t]&&(r.cookies(t,i),s[t]=i,u=!0);if(u){o=r.cookies();for(t in a)a[t]!==o[t]&&(l(o[t])?(delete a[t],delete s[t]):a[t]=s[t]=o[t])}}var o,a={},s={},u=!1,c=e.copy,l=e.isUndefined;return r.addPollFn(function(){var e=r.cookies();o!=e&&(o=e,c(e,s),c(e,a),u&&t.$apply())})(),u=!0,t.$watch(i),a}]).factory("$cookieStore",["$cookies",function(t){return{get:function(n){var r=t[n];return r?e.fromJson(r):r},put:function(n,r){t[n]=e.toJson(r)},remove:function(e){delete t[e]}}}])}(window,window.angular),angular.module("ui-notification",[]),angular.module("ui-notification").provider("Notification",function(){this.options={delay:5e3,startTop:10,startRight:10,verticalSpacing:10,horizontalSpacing:10,positionX:"right",positionY:"top",replaceMessage:!1,templateUrl:"angular-ui-notification.html"},this.setOptions=function(t){if(!angular.isObject(t))throw new Error("Options should be an object!");this.options=angular.extend({},this.options,t)},this.$get=["$timeout","$http","$compile","$templateCache","$rootScope","$injector","$sce","$q","$window",function(t,e,n,r,i,o,a,s,u){var c=this.options,l=c.startTop,f=c.startRight,h=c.verticalSpacing,d=c.horizontalSpacing,p=c.delay,m=[],v=!1,g=function(o,g){var $=s.defer();return"object"!=typeof o&&(o={message:o}),o.scope=o.scope?o.scope:i,o.template=o.templateUrl?o.templateUrl:c.templateUrl,o.delay=angular.isUndefined(o.delay)?p:o.delay,o.type=g?g:"",o.positionY=o.positionY?o.positionY:c.positionY,o.positionX=o.positionX?o.positionX:c.positionX,o.replaceMessage=o.replaceMessage?o.replaceMessage:c.replaceMessage,e.get(o.template,{cache:r}).success(function(e){var r=o.scope.$new();r.message=a.trustAsHtml(o.message),r.title=a.trustAsHtml(o.title),r.t=o.type.substr(0,1),r.delay=o.delay;var i=function(){for(var t=0,e=0,n=l,r=f,i=[],a=m.length-1;a>=0;a--){var s=m[a];if(o.replaceMessage&&awindow.innerHeight&&(p=l,e++,t=0);var v=n=p?0===t?p:p+h:l,g=r+e*(d+c);s.css(s._positionY,v+"px"),"center"==s._positionX?s.css("left",parseInt(window.innerWidth/2-c/2)+"px"):s.css(s._positionX,g+"px"),i[s._positionY+s._positionX]=v+u,t++}}},s=n(e)(r);s._positionY=o.positionY,s._positionX=o.positionX,s.addClass(o.type),s.bind("webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd click",function(t){t=t.originalEvent||t,("click"===t.type||"opacity"===t.propertyName&&t.elapsedTime>=1)&&(s.remove(),m.splice(m.indexOf(s),1),i())}),angular.isNumber(o.delay)&&t(function(){s.addClass("killed")},o.delay),angular.element(document.getElementsByTagName("body")).append(s);var c=-(parseInt(s[0].offsetHeight)+50);s.css(s._positionY,c+"px"),m.push(s),r._templateElement=s,r.kill=function(e){e?(m.splice(m.indexOf(r._templateElement),1),r._templateElement.remove(),t(i)):r._templateElement.addClass("killed")},t(i),v||(angular.element(u).bind("resize",function(){t(i)}),v=!0),$.resolve(r)}).error(function(t){throw new Error("Template ("+o.template+") could not be loaded. "+t)}),$.promise};return g.primary=function(t){return this(t,"primary")},g.error=function(t){return this(t,"error")},g.success=function(t){return this(t,"success")},g.info=function(t){return this(t,"info")},g.warning=function(t){return this(t,"warning")},g.clearAll=function(){angular.forEach(m,function(t){t.addClass("killed")})},g}]}),angular.module("ui-notification").run(["$templateCache",function(t){t.put("angular-ui-notification.html",'

')}]),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(t,e,n){"use strict";function r(t,e){return F(new(F(function(){},{prototype:t})),e)}function i(t){return P(arguments,function(e){e!==t&&P(e,function(e,n){t.hasOwnProperty(n)||(t[n]=e)})}),t}function o(t,e){var n=[];for(var r in t.path){if(t.path[r]!==e.path[r])break;n.push(t.path[r])}return n}function a(t){if(Object.keys)return Object.keys(t);var e=[];return P(t,function(t,n){e.push(n)}),e}function s(t,e){if(Array.prototype.indexOf)return t.indexOf(e,Number(arguments[2])||0);var n=t.length>>>0,r=Number(arguments[2])||0;for(r=0>r?Math.ceil(r):Math.floor(r),0>r&&(r+=n);n>r;r++)if(r in t&&t[r]===e)return r;return-1}function u(t,e,n,r){var i,u=o(n,r),c={},l=[];for(var f in u)if(u[f].params&&(i=a(u[f].params),i.length))for(var h in i)s(l,i[h])>=0||(l.push(i[h]),c[i[h]]=t[i[h]]);return F({},c,e)}function c(t,e,n){if(!n){n=[];for(var r in t)n.push(r)}for(var i=0;i "));if($[n]=r,j(t))v.push(n,[function(){return e.get(t)}],c);else{var i=e.annotate(t);P(i,function(t){t!==n&&u.hasOwnProperty(t)&&d(u[t],t)}),v.push(n,t,i)}g.pop(),$[n]=o}}function p(t){return N(t)&&t.then&&t.$$promises}if(!N(u))throw new Error("'invocables' must be an object");var m=a(u||{}),v=[],g=[],$={};return P(u,d),u=g=$=null,function(r,o,a){function s(){--b||(w||i(y,o.$$values),g.$$values=y,g.$$promises=g.$$promises||!0,delete g.$$inheritedValues,d.resolve(y))}function u(t){g.$$failure=t,d.reject(t)}function c(n,i,o){function c(t){f.reject(t),u(t)}function l(){if(!M(g.$$failure))try{f.resolve(e.invoke(i,a,y)),f.promise.then(function(t){y[n]=t,s()},c)}catch(t){c(t)}}var f=t.defer(),h=0;P(o,function(t){$.hasOwnProperty(t)&&!r.hasOwnProperty(t)&&(h++,$[t].then(function(e){y[t]=e,--h||l()},c))}),h||l(),$[n]=f.promise}if(p(r)&&a===n&&(a=o,o=r,r=null),r){if(!N(r))throw new Error("'locals' must be an object")}else r=l;if(o){if(!p(o))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else o=f;var d=t.defer(),g=d.promise,$=g.$$promises={},y=F({},r),b=1+v.length/3,w=!1;if(M(o.$$failure))return u(o.$$failure),g;o.$$inheritedValues&&i(y,h(o.$$inheritedValues,m)),F($,o.$$promises),o.$$values?(w=i(y,h(o.$$values,m)),g.$$inheritedValues=h(o.$$values,m),s()):(o.$$inheritedValues&&(g.$$inheritedValues=h(o.$$inheritedValues,m)),o.then(s,u));for(var _=0,x=v.length;x>_;_+=3)r.hasOwnProperty(v[_])?s():c(v[_],v[_+1],v[_+2]);return g}},this.resolve=function(t,e,n,r){return this.study(t)(e,n,r)}}function v(t,e,n){this.fromConfig=function(t,e,n){return M(t.template)?this.fromString(t.template,e):M(t.templateUrl)?this.fromUrl(t.templateUrl,e):M(t.templateProvider)?this.fromProvider(t.templateProvider,e,n):null},this.fromString=function(t,e){return D(t)?t(e):t},this.fromUrl=function(n,r){return D(n)&&(n=n(r)),null==n?null:t.get(n,{cache:e,headers:{Accept:"text/html"}}).then(function(t){return t.data})},this.fromProvider=function(t,e,r){return n.invoke(t,null,r||{params:e})}}function g(t,e,i){function o(e,n,r,i){if(v.push(e),p[e])return p[e];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(e))throw new Error("Invalid parameter name '"+e+"' in pattern '"+t+"'");if(m[e])throw new Error("Duplicate parameter name '"+e+"' in pattern '"+t+"'");return m[e]=new L.Param(e,n,r,i),m[e]}function a(t,e,n,r){var i=["",""],o=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return o;switch(n){case!1:i=["(",")"+(r?"?":"")];break;case!0:i=["?(",")?"];break;default:i=["("+n+"|",")?"]}return o+i[0]+e+i[1]}function s(i,o){var a,s,u,c,l;return a=i[2]||i[3],l=e.params[a],u=t.substring(h,i.index),s=o?i[4]:i[4]||("*"==i[1]?".*":null),c=L.type(s||"string")||r(L.type("string"),{pattern:new RegExp(s,e.caseInsensitive?"i":n)}),{id:a,regexp:s,segment:u,type:c,cfg:l}}e=F({params:{}},N(e)?e:{});var u,c=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,f="^",h=0,d=this.segments=[],p=i?i.params:{},m=this.params=i?i.params.$$new():new L.ParamSet,v=[];this.source=t;for(var g,$,y;(u=c.exec(t))&&(g=s(u,!1),!(g.segment.indexOf("?")>=0));)$=o(g.id,g.type,g.cfg,"path"),f+=a(g.segment,$.type.pattern.source,$.squash,$.isOptional),d.push(g.segment),h=c.lastIndex;y=t.substring(h);var b=y.indexOf("?");if(b>=0){var w=this.sourceSearch=y.substring(b);if(y=y.substring(0,b),this.sourcePath=t.substring(0,h+b),w.length>0)for(h=0;u=l.exec(w);)g=s(u,!0),$=o(g.id,g.type,g.cfg,"search"),h=c.lastIndex}else this.sourcePath=t,this.sourceSearch="";f+=a(y)+(e.strict===!1?"/?":"")+"$",d.push(y),this.regexp=new RegExp(f,e.caseInsensitive?"i":n),this.prefix=d[0],this.$$paramNames=v}function $(t){F(this,t)}function y(){function t(t){return null!=t?t.toString().replace(/\//g,"%2F"):t}function i(t){return null!=t?t.toString().replace(/%2F/g,"/"):t}function o(){return{strict:m,caseInsensitive:h}}function u(t){return D(t)||R(t)&&D(t[t.length-1])}function c(){for(;_.length;){var t=_.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");e.extend(b[t.name],f.invoke(t.def))}}function l(t){F(this,t||{})}L=this;var f,h=!1,m=!0,v=!1,b={},w=!0,_=[],x={string:{encode:t,decode:i,is:function(t){return null==t||!M(t)||"string"==typeof t},pattern:/[^\/]*/},"int":{encode:t,decode:function(t){return parseInt(t,10)},is:function(t){return M(t)&&this.decode(t.toString())===t},pattern:/\d+/},bool:{encode:function(t){return t?1:0},decode:function(t){return 0!==parseInt(t,10)},is:function(t){return t===!0||t===!1},pattern:/0|1/},date:{encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):n},decode:function(t){if(this.is(t))return t;var e=this.capture.exec(t);return e?new Date(e[1],e[2]-1,e[3]):n},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return this.is(t)&&this.is(e)&&t.toISOString()===e.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:e.toJson,decode:e.fromJson,is:e.isObject,equals:e.equals,pattern:/[^\/]*/},any:{encode:e.identity,decode:e.identity,equals:e.equals,pattern:/.*/}};y.$$getDefaultValue=function(t){if(!u(t.value))return t.value;if(!f)throw new Error("Injectable functions cannot be called at configuration time");return f.invoke(t.value)},this.caseInsensitive=function(t){return M(t)&&(h=t),h},this.strictMode=function(t){return M(t)&&(m=t),m},this.defaultSquashPolicy=function(t){if(!M(t))return v;if(t!==!0&&t!==!1&&!j(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return v=t,t},this.compile=function(t,e){return new g(t,F(o(),e))},this.isMatcher=function(t){if(!N(t))return!1;var e=!0;return P(g.prototype,function(n,r){D(n)&&(e=e&&M(t[r])&&D(t[r]))}),e},this.type=function(t,e,n){if(!M(e))return b[t];if(b.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return b[t]=new $(F({name:t},e)),n&&(_.push({name:t,def:n}),w||c()),this},P(x,function(t,e){b[e]=new $(F({name:e},t))}),b=r(b,{}),this.$get=["$injector",function(t){return f=t,w=!1,c(),P(x,function(t,e){b[e]||(b[e]=new $(t))}),this}],this.Param=function(t,e,r,i){function o(t){var e=N(t)?a(t):[],n=-1===s(e,"value")&&-1===s(e,"type")&&-1===s(e,"squash")&&-1===s(e,"array");return n&&(t={value:t}),t.$$fn=u(t.value)?t.value:function(){return t.value},t}function c(e,n,r){if(e.type&&n)throw new Error("Param '"+t+"' has two type configurations.");return n?n:e.type?e.type instanceof $?e.type:new $(e.type):"config"===r?b.any:b.string}function l(){var e={array:"search"===i?"auto":!1},n=t.match(/\[\]$/)?{array:!0}:{};return F(e,n,r).array}function h(t,e){var n=t.squash;if(!e||n===!1)return!1;if(!M(n)||null==n)return v;if(n===!0||j(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}function m(t,e,r,i){var o,a,u=[{from:"",to:r||e?n:""},{from:null,to:r||e?n:""}];return o=R(t.replace)?t.replace:[],j(i)&&o.push({from:i,to:n}),a=p(o,function(t){return t.from}),d(u,function(t){return-1===s(a,t.from)}).concat(o)}function g(){if(!f)throw new Error("Injectable functions cannot be called at configuration time");var t=f.invoke(r.$$fn);if(null!==t&&t!==n&&!_.type.is(t))throw new Error("Default value ("+t+") for parameter '"+_.id+"' is not an instance of Type ("+_.type.name+")");return t}function y(t){function e(t){return function(e){return e.from===t}}function n(t){var n=p(d(_.replace,e(t)),function(t){return t.to});return n.length?n[0]:t}return t=n(t),M(t)?_.type.$normalize(t):g()}function w(){return"{Param:"+t+" "+e+" squash: '"+E+"' optional: "+C+"}"}var _=this;r=o(r),e=c(r,e,i);var x=l();e=x?e.$asArray(x,"search"===i):e,"string"!==e.name||x||"path"!==i||r.value!==n||(r.value="");var C=r.value!==n,E=h(r,C),k=m(r,x,C,E); +F(this,{id:t,type:e,location:i,array:x,squash:E,replace:k,isOptional:C,value:y,dynamic:n,config:r,toString:w})},l.prototype={$$new:function(){return r(this,F(new l,{$$parent:this}))},$$keys:function(){for(var t=[],e=[],n=this,r=a(l.prototype);n;)e.push(n),n=n.$$parent;return e.reverse(),P(e,function(e){P(a(e),function(e){-1===s(t,e)&&-1===s(r,e)&&t.push(e)})}),t},$$values:function(t){var e={},n=this;return P(n.$$keys(),function(r){e[r]=n[r].value(t&&t[r])}),e},$$equals:function(t,e){var n=!0,r=this;return P(r.$$keys(),function(i){var o=t&&t[i],a=e&&e[i];r[i].type.equals(o,a)||(n=!1)}),n},$$validates:function(t){var r,i,o,a,s,u=this.$$keys();for(r=0;ri;i++)if(e(c[i]))return;l&&e(l)}}function d(){return u=u||i.$on("$locationChangeSuccess",h)}var p,m=a.baseHref(),v=r.url();return f||d(),{sync:function(){h()},listen:function(){return d()},update:function(t){return t?void(v=r.url()):void(r.url()!==v&&(r.url(v),r.replace()))},push:function(t,e,i){var o=t.format(e||{});null!==o&&e&&e["#"]&&(o+="#"+e["#"]),r.url(o),p=i&&i.$$avoidResync?r.url():n,i&&i.replace&&r.replace()},href:function(n,i,o){if(!n.validates(i))return null;var a=t.html5Mode();e.isObject(a)&&(a=a.enabled);var u=n.format(i);if(o=o||{},a||null===u||(u="#"+t.hashPrefix()+u),null!==u&&i&&i["#"]&&(u+="#"+i["#"]),u=s(u,a,o.absolute),!o.absolute||!u)return u;var c=!a&&u?"/":"",l=r.port();return l=80===l||443===l?"":":"+l,[r.protocol(),"://",r.host(),l,c,u].join("")}}}var u,c=[],l=null,f=!1;this.rule=function(t){if(!D(t))throw new Error("'rule' must be a function");return c.push(t),this},this.otherwise=function(t){if(j(t)){var e=t;t=function(){return e}}else if(!D(t))throw new Error("'rule' must be a function");return l=t,this},this.when=function(t,e){var n,s=j(e);if(j(t)&&(t=r.compile(t)),!s&&!D(e)&&!R(e))throw new Error("invalid 'handler' in when()");var u={matcher:function(t,e){return s&&(n=r.compile(e),e=["$match",function(t){return n.format(t)}]),F(function(n,r){return a(n,e,t.exec(r.path(),r.search()))},{prefix:j(t.prefix)?t.prefix:""})},regex:function(t,e){if(t.global||t.sticky)throw new Error("when() RegExp must not be global or sticky");return s&&(n=e,e=["$match",function(t){return o(n,t)}]),F(function(n,r){return a(n,e,t.exec(r.path()))},{prefix:i(t)})}},c={matcher:r.isMatcher(t),regex:t instanceof RegExp};for(var l in c)if(c[l])return this.rule(u[l](t,e));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(t){t===n&&(t=!0),f=t},this.$get=s,s.$inject=["$location","$rootScope","$injector","$browser"]}function w(t,i){function o(t){return 0===t.indexOf(".")||0===t.indexOf("^")}function h(t,e){if(!t)return n;var r=j(t),i=r?t:t.name,a=o(i);if(a){if(!e)throw new Error("No reference point given for path '"+i+"'");e=h(e);for(var s=i.split("."),u=0,c=s.length,l=e;c>u;u++)if(""!==s[u]||0!==u){if("^"!==s[u])break;if(!l.parent)throw new Error("Path '"+i+"' not valid for state '"+e.name+"'");l=l.parent}else l=e;s=s.slice(u).join("."),i=l.name+(l.name&&s?".":"")+s}var f=E[i];return!f||!r&&(r||f!==t&&f.self!==t)?n:f}function d(t,e){k[t]||(k[t]=[]),k[t].push(e)}function m(t){for(var e=k[t]||[];e.length;)v(e.shift())}function v(e){e=r(e,{self:e,resolve:e.resolve||{},toString:function(){return this.name}});var n=e.name;if(!j(n)||n.indexOf("@")>=0)throw new Error("State must have a valid name");if(E.hasOwnProperty(n))throw new Error("State '"+n+"'' is already defined");var i=-1!==n.indexOf(".")?n.substring(0,n.lastIndexOf(".")):j(e.parent)?e.parent:N(e.parent)&&j(e.parent.name)?e.parent.name:"";if(i&&!E[i])return d(i,e.self);for(var o in S)D(S[o])&&(e[o]=S[o](e,S.$delegates[o]));return E[n]=e,!e[A]&&e.url&&t.when(e.url,["$match","$stateParams",function(t,n){C.$current.navigable==e&&c(t,n)||C.transitionTo(e,t,{inherit:!0,location:!1})}]),m(n),e}function g(t){return t.indexOf("*")>-1}function $(t){for(var e=t.split("."),n=C.$current.name.split("."),r=0,i=e.length;i>r;r++)"*"===e[r]&&(n[r]="*");return"**"===e[0]&&(n=n.slice(s(n,e[1])),n.unshift("**")),"**"===e[e.length-1]&&(n.splice(s(n,e[e.length-2])+1,Number.MAX_VALUE),n.push("**")),e.length!=n.length?!1:n.join("")===e.join("")}function y(t,e){return j(t)&&!M(e)?S[t]:D(e)&&j(t)?(S[t]&&!S.$delegates[t]&&(S.$delegates[t]=S[t]),S[t]=e,this):this}function b(t,e){return N(t)?e=t:e.name=t,v(e),this}function w(t,i,o,s,f,d,m,v,y){function b(e,n,r,o){var a=t.$broadcast("$stateNotFound",e,n,r);if(a.defaultPrevented)return m.update(),T;if(!a.retry)return null;if(o.$retry)return m.update(),O;var s=C.transition=i.when(a.retry);return s.then(function(){return s!==C.transition?k:(e.options.$retry=!0,C.transitionTo(e.to,e.toParams,e.options))},function(){return T}),m.update(),s}function w(t,n,r,a,u,c){function h(){var n=[];return P(t.views,function(r,i){var a=r.resolve&&r.resolve!==t.resolve?r.resolve:{};a.$template=[function(){return o.load(i,{view:r,locals:u.globals,params:d,notify:c.notify})||""}],n.push(f.resolve(a,u.globals,u.resolve,t).then(function(n){if(D(r.controllerProvider)||R(r.controllerProvider)){var o=e.extend({},a,u.globals);n.$$controller=s.invoke(r.controllerProvider,null,o)}else n.$$controller=r.controller;n.$$state=t,n.$$controllerAs=r.controllerAs,u[i]=n}))}),i.all(n).then(function(){return u.globals})}var d=r?n:l(t.params.$$keys(),n),p={$stateParams:d};u.resolve=f.resolve(t.resolve,p,u.resolve,t);var m=[u.resolve.then(function(t){u.globals=t})];return a&&m.push(a),i.all(m).then(h).then(function(t){return u})}var k=i.reject(new Error("transition superseded")),S=i.reject(new Error("transition prevented")),T=i.reject(new Error("transition aborted")),O=i.reject(new Error("transition failed"));return x.locals={resolve:null,globals:{$stateParams:{}}},C={params:{},current:x.self,$current:x,transition:null},C.reload=function(t){return C.transitionTo(C.current,d,{reload:t||!0,inherit:!1,notify:!0})},C.go=function(t,e,n){return C.transitionTo(t,e,F({inherit:!0,relative:C.$current},n))},C.transitionTo=function(e,n,o){n=n||{},o=F({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},o||{});var a,c=C.$current,f=C.params,p=c.path,v=h(e,o.relative),g=n["#"];if(!M(v)){var $={to:e,toParams:n,options:o},y=b($,c.self,f,o);if(y)return y;if(e=$.to,n=$.toParams,o=$.options,v=h(e,o.relative),!M(v)){if(!o.relative)throw new Error("No such state '"+e+"'");throw new Error("Could not resolve '"+e+"' from state '"+o.relative+"'")}}if(v[A])throw new Error("Cannot transition to abstract state '"+e+"'");if(o.inherit&&(n=u(d,n||{},C.$current,v)),!v.params.$$validates(n))return O;n=v.params.$$values(n),e=v;var E=e.path,T=0,I=E[T],z=x.locals,D=[];if(o.reload){if(j(o.reload)||N(o.reload)){if(N(o.reload)&&!o.reload.name)throw new Error("Invalid reload state object");var R=o.reload===!0?p[0]:h(o.reload);if(o.reload&&!R)throw new Error("No such reload state '"+(j(o.reload)?o.reload:o.reload.name)+"'");for(;I&&I===p[T]&&I!==R;)z=D[T]=I.locals,T++,I=E[T]}}else for(;I&&I===p[T]&&I.ownParams.$$equals(n,f);)z=D[T]=I.locals,T++,I=E[T];if(_(e,n,c,f,z,o))return g&&(n["#"]=g),C.params=n,B(C.params,d),o.location&&e.navigable&&e.navigable.url&&(m.push(e.navigable.url,n,{$$avoidResync:!0,replace:"replace"===o.location}),m.update(!0)),C.transition=null,i.when(C.current);if(n=l(e.params.$$keys(),n||{}),o.notify&&t.$broadcast("$stateChangeStart",e.self,n,c.self,f).defaultPrevented)return t.$broadcast("$stateChangeCancel",e.self,n,c.self,f),m.update(),S;for(var P=i.when(z),L=T;L=T;r--)a=p[r],a.self.onExit&&s.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(r=T;r=0?i:i+"@"+(o?o.state.name:"")}function A(t,e){var n,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t=e+"("+r[1]+")"),n=t.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!n||4!==n.length)throw new Error("Invalid state ref '"+t+"'");return{state:n[1],paramExpr:n[3]||null}}function S(t){var e=t.parent().inheritedData("$uiView");return e&&e.state&&e.state.name?e.state:void 0}function T(t,n){var r=["location","inherit","reload","absolute"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(i,o,a,s){var u=A(a.uiSref,t.current.name),c=null,l=S(o)||t.$current,f="[object SVGAnimatedString]"===Object.prototype.toString.call(o.prop("href"))?"xlink:href":"href",h=null,d="A"===o.prop("tagName").toUpperCase(),p="FORM"===o[0].nodeName,m=p?"action":f,v=!0,g={relative:l,inherit:!0},$=i.$eval(a.uiSrefOpts)||{};e.forEach(r,function(t){t in $&&(g[t]=$[t])});var y=function(n){if(n&&(c=e.copy(n)),v){h=t.href(u.state,c,g);var r=s[1]||s[0];return r&&r.$$addStateInfo(u.state,c),null===h?(v=!1,!1):void a.$set(m,h)}};u.paramExpr&&(i.$watch(u.paramExpr,function(t,e){t!==c&&y(t)},!0),c=e.copy(i.$eval(u.paramExpr))),y(),p||o.bind("click",function(e){var r=e.which||e.button;if(!(r>1||e.ctrlKey||e.metaKey||e.shiftKey||o.attr("target"))){var i=n(function(){t.go(u.state,c,g)});e.preventDefault();var a=d&&!h?1:0;e.preventDefault=function(){a--<=0&&n.cancel(i)}}})}}}function O(t,e,n){return{restrict:"A",controller:["$scope","$element","$attrs",function(e,r,i){function o(){a()?r.addClass(u):r.removeClass(u)}function a(){for(var t=0;ti;i++){a=s[i];var f=this.params[a],h=r[i+1];for(o=0;oi;i++)a=s[i],l[a]=this.params[a].value(e[a]);return l},g.prototype.parameters=function(t){return M(t)?this.params[t]||null:this.$$paramNames},g.prototype.validates=function(t){return this.params.$$validates(t)},g.prototype.format=function(t){function e(t){return encodeURIComponent(t).replace(/-/g,function(t){return"%5C%"+t.charCodeAt(0).toString(16).toUpperCase()})}t=t||{};var n=this.segments,r=this.parameters(),i=this.params;if(!this.validates(t))return null;var o,a=!1,s=n.length-1,u=r.length,c=n[0];for(o=0;u>o;o++){var l=s>o,f=r[o],h=i[f],d=h.value(t[f]),m=h.isOptional&&h.type.equals(h.value(),d),v=m?h.squash:!1,g=h.type.encode(d);if(l){var $=n[o+1];if(v===!1)null!=g&&(c+=R(g)?p(g,e).join("-"):encodeURIComponent(g)),c+=$;else if(v===!0){var y=c.match(/\/$/)?/\/?(.*)/:/(.*)/;c+=$.match(y)[1]}else j(v)&&(c+=v+$)}else{if(null==g||m&&v!==!1)continue;R(g)||(g=[g]),g=p(g,encodeURIComponent).join("&"+f+"="),c+=(a?"&":"?")+(f+"="+g),a=!0}}return c},$.prototype.is=function(t,e){return!0},$.prototype.encode=function(t,e){return t},$.prototype.decode=function(t,e){return t},$.prototype.equals=function(t,e){return t==e},$.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},$.prototype.pattern=/.*/,$.prototype.toString=function(){return"{Type:"+this.name+"}"},$.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},$.prototype.$asArray=function(t,e){function r(t,e){function r(t,e){return function(){return t[e].apply(t,arguments)}}function i(t){return R(t)?t:M(t)?[t]:[]}function o(t){switch(t.length){case 0:return n;case 1:return"auto"===e?t[0]:t;default:return t}}function a(t){return!t}function s(t,e){return function(n){n=i(n);var r=p(n,t);return e===!0?0===d(r,a).length:o(r)}}function u(t){return function(e,n){var r=i(e),o=i(n);if(r.length!==o.length)return!1;for(var a=0;au;u++)s[a[u]]=i(s[a[u]],s);n&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,r){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,r):i.call(e,t,n,r)},e.addEventListener=function(t,n,r){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),r):i.call(e,t,n,r)}),"function"==typeof e.onclick&&(o=e.onclick,e.addEventListener("click",function(t){o(t)},!1),e.onclick=null)}}var e=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!e,r=/iP(ad|hone|od)/.test(navigator.userAgent)&&!e,i=r&&/OS 4_\d(_\d)?/.test(navigator.userAgent),o=r&&/OS [6-7]_\d/.test(navigator.userAgent),a=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(r&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return n&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;r&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,o;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],r){if(o=window.getSelection(),o.rangeCount&&!o.isCollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTimen||Math.abs(e.pageY-this.touchStartY)>n?!0:!1},t.prototype.onTouchMove=function(t){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,a,s,u,c,l=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,a=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,o&&(c=t.changedTouches[0],l=document.elementFromPoint(c.pageX-window.pageXOffset,c.pageY-window.pageYOffset)||l,l.fastClickScrollParent=this.targetElement.fastClickScrollParent),s=l.tagName.toLowerCase(),"label"===s){if(e=this.findControl(l)){if(this.focus(l),n)return!1;l=e}}else if(this.needsFocus(l))return t.timeStamp-a>100||r&&window.top!==window&&"input"===s?(this.targetElement=null,!1):(this.focus(l),this.sendClick(l,t),r&&"select"===s||(this.targetElement=null,t.preventDefault()),!1);return r&&!i&&(u=l.fastClickScrollParent,u&&u.fastClickLastScrollTop!==u.scrollTop)?!0:(this.needsClick(l)||(t.preventDefault(),this.sendClick(l,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return this.targetElement?t.forwardedTouchEvent?!0:t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1):!0:!0},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail?!0:(e=this.onMouse(t),e||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,r,i,o;if("undefined"==typeof window.ontouchstart)return!0;if(r=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(r>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(a&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction?!0:(o=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],o>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(-1!==e.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===t.style.touchAction||"manipulation"===t.style.touchAction?!0:!1)},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?(module.exports=t.attach,module.exports.FastClick=t):window.FastClick=t}(),!function(t){"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):"undefined"!=typeof window?window.IconicJS=t():"undefined"!=typeof global?global.IconicJS=t():"undefined"!=typeof self&&(self.IconicJS=t())}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a>>0;for(n=0;r>n;++n)n in this&&t.call(e,this[n],n,this)}),function(){if(Event.prototype.preventDefault||(Event.prototype.preventDefault=function(){this.returnValue=!1}),Event.prototype.stopPropagation||(Event.prototype.stopPropagation=function(){this.cancelBubble=!0}),!Element.prototype.addEventListener){var t=[],e=function(e,n){var r=this,i=function(t){t.target=t.srcElement,t.currentTarget=r,n.handleEvent?n.handleEvent(t):n.call(r,t)};if("DOMContentLoaded"==e){var o=function(t){"complete"==document.readyState&&i(t)};if(document.attachEvent("onreadystatechange",o),t.push({object:this,type:e,listener:n,wrapper:o}),"complete"==document.readyState){var a=new Event;a.srcElement=window,o(a)}}else this.attachEvent("on"+e,i),t.push({object:this,type:e,listener:n,wrapper:i})},n=function(e,n){for(var r=0;ro?r.width:r.height;var a;a=32>e?"iconic-sm":e>=32&&128>e?"iconic-md":"iconic-lg";var s=t.getAttribute("class"),u=n.test(s)?s.replace(n,a):s+" "+a;t.setAttribute("class",u)}},s=function(){var t=document.querySelectorAll(".injected-svg.iconic-fluid");Array.prototype.forEach.call(t,function(t){a(t)})};document.addEventListener("DOMContentLoaded",function(){o()}),window.addEventListener("resize",function(){s()}),e.exports={refresh:a,refreshAll:s}},{}],8:[function(e,n,r){!function(e,i){"use strict";function o(t){t=t.split(" ");for(var e={},n=t.length,r=[];n--;)e.hasOwnProperty(t[n])||(e[t[n]]=1,r.unshift(t[n]));return r.join(" ")}var a="file:"===e.location.protocol,s=i.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),u=Array.prototype.forEach||function(t,e){if(void 0===this||null===this||"function"!=typeof t)throw new TypeError;var n,r=this.length>>>0;for(n=0;r>n;++n)n in this&&t.call(e,this[n],n,this)},c={},l=0,f=[],h=[],d={},p=function(t){return t.cloneNode(!0)},m=function(t,e){h[t]=h[t]||[],h[t].push(e)},v=function(t){for(var e=0,n=h[t].length;n>e;e++)!function(e){setTimeout(function(){h[t][e](p(c[t]))},0)}(e)},g=function(t,n){if(void 0!==c[t])c[t]instanceof SVGSVGElement?n(p(c[t])):m(t,n);else{if(!e.XMLHttpRequest)return n("Browser does not support XMLHttpRequest"),!1;c[t]={},m(t,n);var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(404===r.status||null===r.responseXML)return n("Unable to load SVG file: "+t),a&&n("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),n(),!1;if(!(200===r.status||a&&0===r.status))return n("There was a problem injecting the SVG: "+r.status+" "+r.statusText),!1;if(r.responseXML instanceof Document)c[t]=r.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var e;try{var i=new DOMParser;e=i.parseFromString(r.responseText,"text/xml")}catch(o){e=void 0}if(!e||e.getElementsByTagName("parsererror").length)return n("Unable to parse SVG file: "+t),!1;c[t]=e.documentElement}v(t)}},r.open("GET",t),r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()}},$=function(t,n,r,i){var a=t.getAttribute("data-src")||t.getAttribute("src");if(!/svg$/i.test(a))return void i("Attempted to inject a file with a non-svg extension: "+a);if(!s){var c=t.getAttribute("data-fallback")||t.getAttribute("data-png");return void(c?(t.setAttribute("src",c),i(null)):r?(t.setAttribute("src",r+"/"+a.split("/").pop().replace(".svg",".png")),i(null)):i("This browser does not support SVG and no PNG fallback was defined."))}-1===f.indexOf(t)&&(f.push(t),t.setAttribute("src",""),g(a,function(r){if("undefined"==typeof r||"string"==typeof r)return i(r),!1;var s=t.getAttribute("id");s&&r.setAttribute("id",s);var c=t.getAttribute("title");c&&r.setAttribute("title",c);var h=[].concat(r.getAttribute("class")||[],"injected-svg",t.getAttribute("class")||[]).join(" ");r.setAttribute("class",o(h));var p=t.getAttribute("style");p&&r.setAttribute("style",p);var m=[].filter.call(t.attributes,function(t){return/^data-\w[\w\-]*$/.test(t.name)});u.call(m,function(t){t.name&&t.value&&r.setAttribute(t.name,t.value)});for(var v,g=r.querySelectorAll("defs clipPath[id]"),$=0,y=g.length;y>$;$++){v=g[$].id+"-"+l;for(var b=r.querySelectorAll('[clip-path*="'+g[$].id+'"]'),w=0,_=b.length;_>w;w++)b[w].setAttribute("clip-path","url(#"+v+")");g[$].id=v}r.removeAttribute("xmlns:a");for(var x,C,E=r.querySelectorAll("script"),k=[],A=0,S=E.length;S>A;A++)C=E[A].getAttribute("type"),C&&"application/ecmascript"!==C&&"application/javascript"!==C||(x=E[A].innerText||E[A].textContent,k.push(x),r.removeChild(E[A]));if(k.length>0&&("always"===n||"once"===n&&!d[a])){for(var T=0,O=k.length;O>T;T++)new Function(k[T])(e);d[a]=!0}t.parentNode.replaceChild(r,t),delete f[f.indexOf(t)],t=null,l++,i(r)}))},y=function(t,e,n){e=e||{};var r=e.evalScripts||"always",i=e.pngFallback||!1,o=e.each;if(void 0!==t.length){var a=0;u.call(t,function(e){$(e,r,i,function(e){o&&"function"==typeof o&&o(e),n&&t.length===++a&&n(a)})})}else t?$(t,r,i,function(e){o&&"function"==typeof o&&o(e),n&&n(1),t=null}):n&&n(0)};"object"==typeof n&&"object"==typeof n.exports?n.exports=r=y:"function"==typeof t&&t.amd?t(function(){return y}):"object"==typeof e&&(e.SVGInjector=y)}(window,document)},{}]},{},[1])(1)}),function(){"use strict";function t(){function t(t,e){e?t.addClass(a):t.removeClass(a)}function e(t,e,r,u){function c(){h(t),p(),t[0].style.transitionDuration="",t.removeClass($?"":a),d(),m=!1}function l(t){h(t),angular.element(t).off(s.join(" ")),m=!1}function f(t){var e={el:t,animation:v},r=n.filter(function(e){return e.el===t});if(r.length>0){var i=r[0].el[0];r[0].animation.cancelAnimation(i)}n.push(e)}function h(t){var e;n.filter(function(n,r){n.el===t&&(e=r)});e>=0&&n.splice(e,1)}function d(){return t[0].offsetWidth}function p(){t[0].style.transitionDuration=0,t.removeClass(i.join(" ")+" "+o.join(" ")+" "+r+" "+u)}var m=!0,v=this;v.cancelAnimation=l;var g=e?r:u,$=e,y=$?i[0]:i[1],b=$?o[0]:o[1];f(t),p(),t.addClass(g),t.addClass(y),t.addClass(a),d(),t[0].style.transitionDuration="",t.addClass(b),t.one(s.join(" "),function(){c()}),setTimeout(function(){m&&c()},3e3)}var n=[],r={},i=["ng-enter","ng-leave"],o=["ng-enter-active","ng-leave-active"],a="is-active",s=["webkitAnimationEnd","mozAnimationEnd","MSAnimationEnd","oanimationend","animationend","webkitTransitionEnd","otransitionend","transitionend"];return r.animate=e,r.toggleAnimation=t,r}angular.module("foundation.core.animation",[]).service("FoundationAnimation",t)}(),function(){"use strict";function t(t){function e(t,e){return l[t]||(l[t]=[]),l[t].push(e),!0}function n(t,e){void 0!==l[t]&&delete l[t],"function"==typeof e&&e.call(this)}function r(t,e){l[t]||(l[t]=[]),l[t].forEach(function(t){t(e)})}function i(){return f}function o(t){return f=angular.extend(f,t)}function a(){var t="";do{t+="zf-uuid-";for(var e=0;15>e;e++)t+=Math.floor(16*Math.random()).toString(16)}while(!h.indexOf(t));return h.push(t),t}function s(e,n){t.toggleAnimate(e,n)}function u(t){var e=this;t=t||{};var n=document.querySelectorAll(".is-active[zf-closable]"),r=document.querySelectorAll("[zf-closable] > .is-active");n.length&&angular.forEach(n,function(n){t.exclude!==n.id&&e.publish(n.id,"close")}),r.length&&angular.forEach(r,function(n){var r=n.parentNode.id;t.exclude!==r&&e.publish(r,"close")})}function c(e,n,r,i){t.animate(e,n,r,i)}var l={},f={},h=[],d={};return d.subscribe=e,d.unsubscribe=n,d.publish=r,d.getSettings=i,d.modifySettings=o,d.generateUuid=a,d.toggleAnimate=s,d.closeActiveElements=u,d.animate=c,d}function e(t){function e(e){t.publish(e,"show")}function n(e){t.publish(e,"hide")}var r={};return r.activate=e,r.deactivate=n,r}function n(){function t(t,e){var n=null;return function(){var r=this,i=arguments;null===n&&(n=setTimeout(function(){t.apply(r,i),n=null},e))}}var e={};return e.throttle=t,e}angular.module("foundation.core",["foundation.core.animation"]).service("FoundationApi",t).service("FoundationAdapter",e).factory("Utils",n),t.$inject=["FoundationAnimation"],e.$inject=["FoundationApi"]}(),function(){"use strict";function t(t,e){function n(n,r){function i(t,e,n,r,i){if(r.animation){if(!r.animation.leave&&!e.animation.leave)return;o(t,e,r)}}function o(t,e,n){p?(f(),r.addClass(n.animation.leave)):(l(),f(),r.removeClass(n.animation.leave))}function a(){d.leave&&r.removeClass(d.leave),l()}function s(){l(),e.includes(c())&&d.enter&&r.addClass(d.enter)}function u(t){t.targetScope===n&&d.enter&&r.removeClass(d.enter),p=!0}function c(){var t=r.data("$uiView"),e=t&&t.state&&t.state.self;return e&&angular.extend(d,e.animation),e}function l(){r.parent().removeClass("position-absolute"),h!==!0&&(r.parent()[0].style.height=null)}function f(){var t=parseInt(r.parent()[0].style.height),e=parseInt(window.getComputedStyle(r[0],null).getPropertyValue("height")),n=t>0?t:e>0?e:"";t>0&&(h=!0),r.parent()[0].style.height=n+"px",r.parent().addClass("position-absolute")}var h,d={},p=!1,m=[t.$on("$stateChangeStart",i),t.$on("$stateChangeError",a),n.$on("$stateChangeSuccess",s),n.$on("$viewContentAnimationEnded",u)],v=n.$on("$destroy",function(){angular.forEach(m,function(t){angular.isFunction(t)&&t()}),v()})}var r={restrict:"ECA",priority:-400,link:n};return r}angular.module("foundation.dynamicRouting.animations",["foundation.dynamicRouting"]).directive("uiView",t),t.$inject=["$rootScope","$state"]}(),function(){"use strict";function t(t){function e(t){var e={vars:{}};return t.data&&("object"==typeof t.data.vars&&(e.vars=t.data.vars),delete t.data.vars,angular.extend(e,t.data)),delete t.data,angular.extend(e.vars,t),e}function n(t,e){return{templateUrl:t,controller:r(e)}}function r(t){var e=t.controller||"DefaultController";return/\w\s+as\s+\w/.test(e)||(e+=" as PageCtrl"),e}function i(t){var e={};return t.animationIn&&(e.enter=t.animationIn),t.animationOut&&(e.leave=t.animationOut),e}var o={};this.registerDynamicRoutes=function(a){var s=a||foundationRoutes;angular.forEach(s,function(n){if(n.hasComposed)angular.isDefined(o[n.parent])||(o[n.parent]={children:{}}),n.controller&&(n.controller=r(n)),o[n.parent].children[n.name]=n;else if(n.composed)angular.isDefined(o[n.name])||(o[n.name]={children:{}}),n.controller&&(n.controller=r(n)),angular.extend(o[n.name],n);else{var a={url:n.url,templateUrl:n.path,"abstract":n["abstract"]||!1,parent:n.parent||"",controller:r(n),data:e(n),animation:i(n)};t.state(n.name,a)}}),angular.forEach(o,function(r){var o={url:r.url,parent:r.parent||"","abstract":r["abstract"]||!1,data:e(r),animation:i(r),views:{"":n(r.path,r)}};angular.forEach(r.children,function(t){o.views[t.name+"@"+r.name]=n(t.path,r)}),t.state(r.name,o)})},this.$get=angular.noop}function e(t,e,n){var r={};angular.forEach(e,function(t,e){r[e]=t}),t.params=r,t.current=n.current.name,n.current.views?(t.vars=n.current.data.vars,t.composed=n.current.data.vars.children):t.vars=n.current.data.vars}function n(t){t.registerDynamicRoutes(foundationRoutes)}function r(t,e,n){t.$state=e,t.$stateParams=n}angular.module("foundation.dynamicRouting",["ui.router"]).provider("$FoundationState",t).controller("DefaultController",e).config(n).run(r),t.$inject=["$stateProvider"],e.$inject=["$scope","$stateParams","$state"],n.$inject=["$FoundationStateProvider"],r.$inject=["$rootScope","$state","$stateParams"]}(),function(){"use strict";function t(t){t.init()}function e(t,e,n){function r(){var r,i;t.headerHelper(["foundation-mq"]),i=t.getStyle(".foundation-mq","font-family"),r=t.parseStyleToObject(i);for(var a in r)r[a]="only screen and (min-width: "+r[a].replace("rem","em")+")";e.modifySettings({mediaQueries:angular.extend(r,o)}),window.addEventListener("resize",n.throttle(function(){e.publish("resize","window resized")},50))}var i={},o={"default":"only screen",landscape:"only screen and (orientation: landscape)",portrait:"only screen and (orientation: portrait)",retina:"only screen and (-webkit-min-device-pixel-ratio: 2),only screen and (min--moz-device-pixel-ratio: 2),only screen and (-o-min-device-pixel-ratio: 2/1),only screen and (min-device-pixel-ratio: 2),only screen and (min-resolution: 192dpi),only screen and (min-resolution: 2dppx)"};return i.init=r,i}function n(){function t(t){for(var e=t.length,n=angular.element(document.querySelectorAll("head"));e--;)n.append('')}function e(t,e){var n=document.querySelectorAll(t)[0],r=window.getComputedStyle(n,null);return r.getPropertyValue("font-family")}function n(t){var e={};return"string"!=typeof t?e:(t=t.trim().slice(1,-1))?e=t.split("&").reduce(function(t,e){var n=e.replace(/\+/g," ").split("="),r=n[0],i=n[1];return r=decodeURIComponent(r),i=void 0===i?null:decodeURIComponent(i),t.hasOwnProperty(r)?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i,t},{}):e}var r={};return r.headerHelper=t,r.getStyle=e,r.parseStyleToObject=n,r}function r(t){function e(){return t.getSettings().mediaQueries}function n(t){var e=t.length,n=i.getMediaQueries(),r=[];if(e>0)for(;e--;){var o,a=t[e].media;o=n[a]?matchMedia(n[a]):matchMedia(a),o.matches&&r.push({ind:e})}return r}function r(t){var e=[],n=[],r=t.children(),i=0;return angular.forEach(r,function(t){var r=angular.element(t);r.attr("src")&&r.attr("src").match(/.html$/)?e[i]={media:r.attr("media"),src:r.attr("src")}:(n[i]=r,e[i]={media:r.attr("media"),templ:i}),i++}),{scenarios:e,templates:n}}var i=[];return i.getMediaQueries=e,i.match=n,i.collectScenariosFromElement=r,i}angular.module("foundation.mediaquery",["foundation.core"]).run(t).factory("FoundationMQInit",e).factory("mqHelpers",n).service("FoundationMQ",r),t.$inject=["FoundationMQInit"],e.$inject=["mqHelpers","FoundationApi","Utils"],r.$inject=["FoundationApi"]}(),angular.module("markdown",[]).directive("markdown",function(){return{restrict:"A",link:function(t,e,n,r){e.html(marked(e.html()))}}}),function(){var t={};angular.forEach(["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke"],function(e){t[e]=["$rootScope","$location","$interpolate","$sniffer","urlResolve","computeSVGAttrValue","svgAttrExpressions",function(t,n,r,i,o,a,s){return{restrict:"A",link:function(r,o,u){function c(){var t=a(l);t&&u[e]!==t&&u.$set(e,t)}var l;s.SVG_ELEMENT.test(o[0]&&o[0].toString())&&n.$$html5&&i.history&&(l=u[e],u.$observe(e,c),t.$on("$locationChangeSuccess",c))}}}]}),angular.module("ngSVGAttributes",[]).factory("urlResolve",[function(){var t=document.createElement("a");return function(e){return t.setAttribute("href",e),t}}]).value("svgAttrExpressions",{FUNC_URI:/^url\((.*)\)$/,SVG_ELEMENT:/SVG[a-zA-Z]*Element/,HASH_PART:/#.*/}).factory("computeSVGAttrValue",["$location","$sniffer","svgAttrExpressions","urlResolve",function(t,e,n,r){return function(e){var i,o;return(i=n.FUNC_URI.exec(e))&&(o=0===i[1].indexOf("#")?t.absUrl().replace(n.HASH_PART,"")+i[1]:r(i[1])),o?"url("+o+")":null}}]).directive(t)}(),function(){"use strict";function t(t){var e=this,n=e.sections=t.sections=[],r=(e.multiOpen=t.multiOpen=t.multiOpen||!1,e.collapsible=t.collapsible=t.multiOpen||t.collapsible||!0),i=e.autoOpen=t.autoOpen=t.autoOpen||!0;e.select=function(t){n.forEach(function(n){e.multiOpen?n.scope===t&&(n.scope.active=!n.scope.active):n.scope===t?n.scope.active=r?!n.scope.active:!0:n.scope.active=!1})},e.addSection=function(t){n.push({scope:t}),1===n.length&&i===!0&&(n[0].active=!0,n[0].scope.active=!0)},e.closeAll=function(){n.forEach(function(t){t.scope.active=!1})}}function e(){function t(t,e,n,r){t.multiOpen=r.multiOpen="true"===t.multiOpen?!0:!1,t.collapsible=r.collapsible="true"===t.collapsible?!0:!1,t.autoOpen=r.autoOpen="true"===t.autoOpen?!0:!1}var e={restrict:"EA",transclude:"true",replace:!0,templateUrl:"components/accordion/accordion.html",controller:"ZfAccordionController",scope:{multiOpen:"@?",collapsible:"@?",autoOpen:"@?"},link:t};return e}function n(){function t(t,e,n,r,i){t.active=!1,r.addSection(t),t.activate=function(){r.select(t)}}var e={restrict:"EA",templateUrl:"components/accordion/accordion-item.html",transclude:!0,scope:{title:"@"},require:"^zfAccordion",replace:!0,controller:function(){},link:t};return e}angular.module("foundation.accordion",[]).controller("ZfAccordionController",t).directive("zfAccordion",e).directive("zfAccordionItem",n),t.$inject=["$scope"]}(),function(){"use strict";function t(t){function e(e){t.publish(e,"show")}function n(e){t.publish(e,"hide")}var r={};return r.activate=e,r.deactivate=n,r}function e(t,e){function n(t){var e=t.target,n=!1;do if(e.classList&&e.classList.contains("action-sheet-container")){n=!0;break}while(e=e.parentNode);if(!n){if(t.target.attributes["zf-toggle"]||t.target.attributes["zf-hard-toggle"])return;r()}}function r(){a.hide(),s.hide(),a.$apply(),s.$apply()}function i(){a.toggle(),s.toggle(),a.$apply(),s.$apply()}var o=this,a=o.content=t.content,s=o.container=t.container;angular.element(document.body);o.registerContent=function(t){a=t,a.active=!1},o.registerContainer=function(t){s=t,s.active=!1},o.toggle=i,o.hide=r,o.registerListener=function(){document.body.addEventListener("click",n)},o.deregisterListener=function(){document.body.removeEventListener("click",n)}}function n(t){function e(){function e(t,e,n){n.$set("zf-closable","actionsheet")}function n(e,n,r,i){var o=r.id||t.generateUuid();r.$set("id",o),e.active=!1,t.subscribe(o,function(t){"toggle"===t&&i.toggle(),("hide"===t||"close"===t)&&i.hide()}),i.registerContainer(e),e.toggle=function(){e.active=!e.active},e.hide=function(){e.active=!1}}return{pre:e,post:n}}var n={restrict:"EA",transclude:!0,replace:!0,templateUrl:"components/actionsheet/actionsheet.html",controller:"ZfActionSheetController",compile:e};return n}function r(t){function e(t,e,n,r){t.active=!1,t.position=t.position||"bottom",r.registerContent(t),t.toggle=function(){t.active=!t.active,t.active?r.registerListener():r.deregisterListener()},t.hide=function(){t.active=!1,r.deregisterListener()}}var n={restrict:"EA",transclude:!0,replace:!0,templateUrl:"components/actionsheet/actionsheet-content.html",require:"^zfActionSheet",scope:{position:"@?"},link:e};return n}function i(t){function e(t,e,n,r){e.on("click",function(t){r.toggle(),t.preventDefault()})}var n={restrict:"EA",transclude:!0,replace:!0,templateUrl:"components/actionsheet/actionsheet-button.html",require:"^zfActionSheet",scope:{title:"@?"},link:e};return n}angular.module("foundation.actionsheet",["foundation.core"]).controller("ZfActionSheetController",e).directive("zfActionSheet",n).directive("zfAsContent",r).directive("zfAsButton",i).service("FoundationActionSheet",t),t.$inject=["FoundationApi"],e.$inject=["$scope","FoundationApi"],n.$inject=["FoundationApi"],r.$inject=["FoundationApi"],i.$inject=["FoundationApi"]}(),function(){"use strict";function t(t){function e(e,n,r){var i="";if(r.zfClose)i=r.zfClose;else{for(var o=!1,a=n.parent();o===!1;)"BODY"==a[0].nodeName&&(o=""),"undefined"!=typeof a.attr("zf-closable")&&a.attr("zf-closable")!==!1&&(o=a),a=a.parent();i=o.attr("id")}n.on("click",function(e){t.publish(i,"close"),e.preventDefault()})}var n={restrict:"A",link:e};return n}function e(t){function e(e,n,r){n.on("click",function(e){t.publish(r.zfOpen,"open"),e.preventDefault()})}var n={restrict:"A",link:e};return n}function n(t){function e(e,n,r){n.on("click",function(e){t.publish(r.zfToggle,"toggle"),e.preventDefault()})}var n={restrict:"A",link:e};return n}function r(t){function e(e,n,r){n.on("keyup",function(e){27===e.keyCode&&t.closeActiveElements(),e.preventDefault()})}var n={restrict:"A",link:e};return n}function i(t){function e(e,n,r){var i,o;switch(Hammer&&(o=new Hammer(n[0]),o.get("swipe").set({direction:Hammer.DIRECTION_ALL,threshold:5,velocity:.5})),r.zfSwipeClose){case"right":i="swiperight";break;case"left":i="swipeleft";break;case"up":i="swipeup";break;case"down":i="swipedown";break;default:i="swipe"}o.on(i,function(){t.publish(r.id,"close")})}var n={restrict:"A",link:e};return n}function o(t){function e(e,n,r){n.on("click",function(e){t.closeActiveElements({exclude:r.zfHardToggle}),t.publish(r.zfHardToggle,"toggle"),e.preventDefault()})}var n={restrict:"A",link:e};return n}angular.module("foundation.common",["foundation.core"]).directive("zfClose",t).directive("zfOpen",e).directive("zfToggle",n).directive("zfEscClose",r).directive("zfSwipeClose",i).directive("zfHardToggle",o),t.$inject=["FoundationApi"],e.$inject=["FoundationApi"],n.$inject=["FoundationApi"],r.$inject=["FoundationApi"],i.$inject=["FoundationApi"],o.$inject=["FoundationApi"]}(),function(){"use strict";function t(){var t="assets/img/iconic/";this.setAssetPath=function(e){t=angular.isString(e)?e:t},this.$get=function(){function e(){return r}function n(){return t}var r=new IconicJS,i={getAccess:e,getAssetPath:n};return i}}function e(t,e,n){function r(){function r(e,n,r){if(a=e.iconDir?e.iconDir:t.getAssetPath(),"/"!==a.charAt(a.length-1)&&(a+="/"),e.dynSrc?r.$set("data-src",e.dynSrc):e.dynIcon?r.$set("data-src",a+e.dynIcon+".svg"):e.icon?r.$set("data-src",a+e.icon+".svg"):r.$set("data-src",r.src),!n.hasClass("iconic-sm")&&!n.hasClass("iconic-md")&&!n.hasClass("iconic-lg")){var i;switch(e.size){case"small":i="iconic-sm";break;case"medium":i="iconic-md";break;case"large":i="iconic-lg";break;default:i="iconic-fluid"}n.addClass(i)}o=n[0].outerHTML}function i(r,i,s){function u(t){l&&(l.empty(),l.append(angular.element(o)),l.attr("data-src",t),c(l[0]))}function c(t){f.inject(t,{each:function(t){var e=angular.element(t);l=n(e)(e.scope())}})}var l,f=t.getAccess();c(i[0]),e.subscribe("resize",function(){f.update(i[0])}),r.dynSrc&&r.$watch("dynSrc",function(t,e){t&&t!==e&&u(r.dynSrc)}),r.dynIcon&&r.$watch("dynIcon",function(t,e){t&&t!==e&&u(a+r.dynIcon+".svg")})}var o,a;return{pre:r,post:i}}var i={restrict:"A",template:"",transclude:!0,replace:!0,scope:{dynSrc:"=?",dynIcon:"=?",size:"@?",icon:"@",iconDir:"@?"},compile:r};return i}angular.module("foundation.iconic",[]).provider("Iconic",t).directive("zfIconic",e),e.$inject=["Iconic","FoundationApi","$compile"]}(),function(){"use strict";function t(t,e,n,r,i){function o(o,a,s,u,c){function l(t){return e.get(t,{cache:n})}function f(t){var e=i.collectScenariosFromElement(t);m=e.scenarios,v=e.templates}function h(t){return!p||p!==t}var d,p,m,v;i.getMediaQueries();r.subscribe("resize",function(e){c(function(e,n){m&&v||f(e);var r=i.match(m),o=0===r.length?null:m[r[0].ind];if(o&&h(o)){if(d&&(d.$destroy(),d=null),"undefined"!=typeof o.templ){d=n;var s=document.createElement("div");s.appendChild(v[o.templ][0]),a.html(s.innerHTML),t(a.contents())(d),p=o}else{var u=l(o.src);u.success(function(t){d=n,a.html(t)}).then(function(){t(a.contents())(d),p=o})}}})}),r.publish("resize","initial resize")}var a={restrict:"EA",transclude:"element",scope:{position:"@"},replace:!0,template:"
",link:o};return a}angular.module("foundation.interchange",["foundation.core","foundation.mediaquery"]).directive("zfInterchange",t),t.$inject=["$compile","$http","$templateCache","FoundationApi","FoundationMQ"]}(),function(){"use strict";function t(t,e){function n(e){t.publish(e,"show")}function r(e){t.publish(e,"hide")}function i(t){return new e(t)}var o={};return o.activate=n,o.deactivate=r,o.newModal=i,o}function e(t){function e(e,n,r){function i(t,e,n,r){n.$set("zf-closable",a)}function o(e,n,r){function i(){e.overlay||n.css("background","transparent"),t.animate(n,e.active,c,l),t.animate(a,e.active,s,u)}function o(){e.active&&e.show()}var a=angular.element(n.children()[0]);e.active=e.active||!1,e.overlay="false"===r.overlay?!1:!0,e.overlayClose="false"===r.overlayClose?!1:!0;var s=r.animationIn||"fadeIn",u=r.animationOut||"fadeOut",c="fadeIn",l="fadeOut";e.hideOverlay=function(){e.overlayClose&&e.hide()},e.hide=function(){e.active=!1,i()},e.show=function(){e.active=!0,i(),a.tabIndex=-1,a[0].focus()},e.toggle=function(){e.active=!e.active,i()},o(),t.subscribe(r.id,function(t){"show"===t||"open"===t?e.show():"close"===t||"hide"===t?e.hide():"toggle"===t&&e.toggle(),e.$root&&!e.$root.$$phase&&e.$apply()})}var a="modal";return{pre:i,post:o}}var n={restrict:"EA",templateUrl:"components/modal/modal.html",transclude:!0,scope:!0,replace:!0,compile:e};return n}function n(t,e,n,r,i,o,a){function s(s){function u(){if(C)throw"Error: Modal was destroyed. Delete the object and create a new ModalFactory instance."}function c(){u(),i(function(){h(!0),a.publish(_,"show")},0,!1)}function l(){u(),i(function(){h(!1),a.publish(_,"hide")},0,!1)}function f(){u(),i(function(){h(!0),a.publish(_,"toggle")},0,!1)}function h(t){o.when(g).then(function(){if(!x&&m.length>0){w.append(v);$.active=t,r(v)($),x=!0}})}function d(){if(!document.getElementById(_)){m=''+m+"",v=angular.element(m),$=n.$new();for(var t=0;t0;)t.notifications.pop()}}function n(t){function e(e,n,r,i){e.position=e.position?e.position.split(" ").join("-"):"top-right",t.subscribe(r.id,function(t){"clearall"===t?i.clearAll():(i.addNotification(t),e.$root.$$phase||e.$apply())})}var n={restrict:"EA",templateUrl:"components/notification/notification-set.html",controller:"ZfNotificationController",replace:!0,scope:{position:"@"},link:e};return n}function r(t){function e(){function e(t,e,n){n.$set("zf-closable","notification")}function n(e,n,r,i){e.active=!1;var o,a=r.animationIn||"fadeIn",s=r.animationOut||"fadeOut";setTimeout(function(){e.active=!0,t.animate(n,e.active,a,s)},50),e.hide=function(){e.active=!1,t.animate(n,e.active,a,s),setTimeout(function(){i.removeNotification(e.notifId)},50)},e.autoclose&&setTimeout(function(){e.active&&e.hide()},parseInt(e.autoclose)),Hammer&&(o=new Hammer(n[0]),o.get("swipe").set({direction:Hammer.DIRECTION_ALL,threshold:5,velocity:.5})),o.on("swipe",function(){e.active&&e.hide()})}return{pre:e,post:n}}var n={restrict:"EA",templateUrl:"components/notification/notification.html",replace:!0,transclude:!0,require:"^zfNotificationSet",controller:function(){},scope:{title:"=?",content:"=?",image:"=?",notifId:"=",color:"=?",autoclose:"=?"},compile:e};return n}function i(t){function e(){function e(t,e,n,i){n.$set("zf-closable",r)}function n(e,n,r,i){e.position=r.position?r.position.split(" ").join("-"):"top-right";var o=r.animationIn||"fadeIn",a=r.animationOut||"fadeOut";t.subscribe(r.id,function(r){"show"==r||"open"==r?(e.show(),e.autoclose&&setTimeout(function(){e.active&&e.hide()},parseInt(e.autoclose))):"close"==r||"hide"==r?e.hide():"toggle"==r&&(e.toggle(), +e.autoclose&&setTimeout(function(){e.active&&e.toggle()},parseInt(e.autoclose))),t.animate(n,e.active,o,a),e.$apply()}),e.hide=function(){e.active=!1,t.animate(n,e.active,o,a)},e.show=function(){e.active=!0,t.animate(n,e.active,o,a)},e.toggle=function(){e.active=!e.active,t.animate(n,e.active,o,a)}}var r="notification";return{pre:e,post:n}}var n={restrict:"EA",templateUrl:"components/notification/notification-static.html",replace:!0,transclude:!0,scope:{title:"@?",content:"@?",image:"@?",color:"@?",autoclose:"@?"},compile:e};return n}function o(t){function e(e,n,r,i){n.on("click",function(n){t.publish(r.zfNotify,{title:e.title,content:e.content,color:e.color,image:e.image,autoclose:e.autoclose}),n.preventDefault()})}var n={restrict:"A",scope:{title:"@?",content:"@?",color:"@?",image:"@?",autoclose:"@?"},link:e};return n}function a(t,e,n,r,i,o){function a(t){function e(){if(y)throw"Error: Notification Set was destroyed. Delete the object and create a new NotificationFactory instance."}function a(t){e(),i(function(){o.publish(g,t)},0,!1)}function s(){e(),i(function(){o.publish(g,"clearall")},0,!1)}function u(t){if(!$&&f.length>0){v.append(h);d.active=t,r(h)(d),$=!0}}function c(){if(!document.getElementById(g)){f='',h=angular.element(f),d=n.$new();for(var e=0;e0&&(n.hide(),t.animate(r,n.active,o,a))})}var s="panel";return{pre:o,post:a}}var r={restrict:"EA",templateUrl:"components/panel/panel.html",transclude:!0,scope:{position:"@?"},replace:!0,compile:n};return r}angular.module("foundation.panel",["foundation.core"]).directive("zfPanel",e).service("FoundationPanel",t),t.$inject=["FoundationApi"],e.$inject=["FoundationApi","$window"]}(),function(){"use strict";function t(t){function e(e){t.publish(e,"show")}function n(e){t.publish(e,"hide")}var r={};return r.activate=e,r.deactivate=n,r}function e(t){function e(){function e(t,e,n){n.$set("zf-closable","popup")}function n(e,n,r){function i(t){s||(e.target=e.target?document.getElementById(e.target):document.getElementById(t),u=new Tether({element:n[0],target:e.target,attachment:o,targetAttachment:a,enable:!1}),s=!0)}e.active=!1,e.target=e.target||!1;var o=e.pinTo||"top center",a=e.pinAt||"bottom center",s=!1,u={};t.subscribe(r.id,function(t){"show"===t[0]||"open"===t[0]?e.show(t[1]):"close"===t[0]||"hide"===t[0]?e.hide():"toggle"===t[0]&&e.toggle(t[1]),e.$apply()}),e.hide=function(){e.active=!1,i(),u.disable()},e.show=function(t){e.active=!0,i(t),u.enable()},e.toggle=function(t){e.active=!e.active,i(t),e.active?u.enable():u.disable()}}return{pre:e,post:n}}var n={restrict:"EA",transclude:!0,replace:!0,templateUrl:"components/popup/popup.html",scope:{pinTo:"@?",pinAt:"@?",target:"@?"},compile:e};return n}function n(t){function e(e,n,r){var i=r.zfPopupToggle,o=r.id||t.generateUuid();r.$set("id",o),n.on("click",function(e){t.publish(i,["toggle",o]),e.preventDefault()})}var n={restrict:"A",link:e};return n}angular.module("foundation.popup",["foundation.core"]).directive("zfPopup",e).directive("zfPopupToggle",n).service("FoundationPopup",t),t.$inject=["FoundationApi"],e.$inject=["FoundationApi"],n.$inject=["FoundationApi"]}(),function(){"use strict";function t(t){function e(e){t.publish(e,"show")}var n={};return n.activate=e,n}function e(t,e){var n=this,r=n.tabs=t.tabs=[],i="";n.select=function(t){r.forEach(function(n){n.active=!1,n.scope.active=!1,n.scope===t&&(e.publish(i,["activate",n]),n.active=!0,n.scope.active=!0)})},n.addTab=function(t){r.push({scope:t,active:!1,parentContent:n.id}),1===r.length&&(r[0].active=!0,t.active=!0)},n.getId=function(){return i},n.setId=function(t){i=t}}function n(t){function e(e,n,r,i){e.id=r.id||t.generateUuid(),e.showTabContent="true"!==e.displaced,r.$set("id",e.id),i.setId(e.id);var o=function(){t.publish(e.id+"-tabs",e.tabs)};t.subscribe(e.id+"-get-tabs",function(){o()})}var n={restrict:"EA",transclude:"true",replace:!0,templateUrl:"components/tabs/tabs.html",controller:"ZfTabsController",scope:{displaced:"@?"},link:e};return n}function r(t){function e(e,n,r,i){e.tabs=e.tabs||[];var o=e.target;t.subscribe(o,function(t){if("activate"===t[0]){t[1];e.tabs.forEach(function(t){t.scope.active=!1,t.active=!1,t.scope.id===o&&(t.scope.active=!0,t.active=!0)})}}),0===e.tabs.length&&(t.subscribe(o+"-tabs",function(t){e.tabs=t}),t.publish(o+"-get-tabs",""))}var n={restrict:"A",transclude:"true",replace:!0,scope:{tabs:"=?",target:"@"},templateUrl:"components/tabs/tab-content.html",link:e};return n}function i(t){function e(e,n,r,i,o){e.id=r.id||t.generateUuid(),e.active=!1,e.transcludeFn=o,i.addTab(e),t.subscribe(e.id,function(t){("show"===t||"open"===t||"activate"===t)&&e.makeActive()}),e.makeActive=function(){i.select(e)}}var n={restrict:"EA",templateUrl:"components/tabs/tab.html",transclude:!0,scope:{title:"@"},require:"^zfTabs",replace:!0,link:e};return n}function o(t){function e(e,n,r,i,o){var a=e.$eval(r.tab);a.scope.id;a.scope.transcludeFn(a.scope,function(t){n.append(t)}),t.subscribe(a.scope.id,function(n){t.publish(a.parentContent,["activate",a.scope.id]),e.$apply()})}var n={restrict:"EA",transclude:"true",link:e};return n}function a(t){function e(e,n,r,i){function o(){n.parent().children().removeClass("is-active"),n.addClass("is-active")}var a=r.zfTabHref;t.subscribe(a,function(t){("activate"===t||"show"===t||"open"===t)&&o()}),n.on("click",function(e){t.publish(a,"activate"),o(),e.preventDefault()})}var n={restrict:"A",replace:!1,link:e};return n}function s(t){function e(t,e,n,r,i){var o=e.children();angular.element(o[0]).addClass("is-active")}var n={restrict:"A",replace:!1,link:e};return n}function u(t){function e(e,n,r){function i(t){var e=n.children();angular.forEach(e,function(e){var n=angular.element(e);n.removeClass("is-active"),n.attr("id")===t&&n.addClass("is-active")})}var o=[],a=n.children();angular.forEach(a,function(e){if(e.id){var n=e.id;if(o.push(n),t.subscribe(n,function(t){("activate"===t||"show"===t||"open"===t)&&i(n)}),1===o.length){var r=angular.element(e);r.addClass("is-active")}}})}return{restrict:"A",link:e}}angular.module("foundation.tabs",["foundation.core"]).controller("ZfTabsController",e).directive("zfTabs",n).directive("zfTabContent",r).directive("zfTab",i).directive("zfTabIndividual",o).directive("zfTabHref",a).directive("zfTabCustom",s).directive("zfTabContentCustom",u).service("FoundationTabs",t),t.$inject=["FoundationApi"],e.$inject=["$scope","FoundationApi"],n.$inject=["FoundationApi"],r.$inject=["FoundationApi"],i.$inject=["FoundationApi"],o.$inject=["FoundationApi"],a.$inject=["FoundationApi"],s.$inject=["FoundationApi"],u.$inject=["FoundationApi"]}(),function(){"use strict";angular.module("foundation",["foundation.core","foundation.mediaquery","foundation.accordion","foundation.actionsheet","foundation.common","foundation.iconic","foundation.interchange","foundation.modal","foundation.notification","foundation.offcanvas","foundation.panel","foundation.popup","foundation.tabs"])}(),function(t,e,n,r){"use strict";function i(t,e,n){return setTimeout(c(t,n),e)}function o(t,e,n){return Array.isArray(t)?(a(t,n[e],n),!0):!1}function a(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==r)for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}function u(t,e,n){var r,i=e.prototype;r=t.prototype=Object.create(i),r.constructor=t,r._super=i,n&&st(r,n)}function c(t,e){return function(){return t.apply(e,arguments)}}function l(t,e){return typeof t==lt?t.apply(e?e[0]||r:r,e):t}function f(t,e){return t===r?e:t}function h(t,e,n){a(v(e),function(e){t.addEventListener(e,n,!1)})}function d(t,e,n){a(v(e),function(e){t.removeEventListener(e,n,!1)})}function p(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function m(t,e){return t.indexOf(e)>-1}function v(t){return t.trim().split(/\s+/g)}function g(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;rn[e]}):r.sort()),r}function b(t,e){for(var n,i,o=e[0].toUpperCase()+e.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=T(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,u=e.center=O(r);e.timeStamp=dt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=D(s,u),e.distance=M(s,u),A(n,e),e.offsetDirection=z(e.deltaX,e.deltaY);var c=I(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=ht(c.x)>ht(c.y)?c.x:c.y,e.scale=a?N(a.pointers,r):1,e.rotation=a?j(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,S(n,e);var l=t.element;p(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function A(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};(e.eventType===kt||o.eventType===St)&&(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}function S(t,e){var n,i,o,a,s=t.lastInterval||e,u=e.timeStamp-s.timeStamp;if(e.eventType!=Tt&&(u>Et||s.velocity===r)){var c=e.deltaX-s.deltaX,l=e.deltaY-s.deltaY,f=I(u,c,l);i=f.x,o=f.y,n=ht(f.x)>ht(f.y)?f.x:f.y,a=z(c,l),t.lastInterval=e}else n=s.velocity,i=s.velocityX,o=s.velocityY,a=s.direction;e.velocity=n,e.velocityX=i,e.velocityY=o,e.direction=a}function T(t){for(var e=[],n=0;ni;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:ft(n/e),y:ft(r/e)}}function I(t,e,n){return{x:e/t||0,y:n/t||0}}function z(t,e){return t===e?Ot:ht(t)>=ht(e)?0>t?It:zt:0>e?Mt:Dt}function M(t,e,n){n||(n=Pt);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function D(t,e,n){n||(n=Pt);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}function j(t,e){return D(e[1],e[0],Ft)+D(t[1],t[0],Ft)}function N(t,e){return M(e[0],e[1],Ft)/M(t[0],t[1],Ft)}function R(){this.evEl=Lt,this.evWin=Ut,this.allow=!0,this.pressed=!1,x.apply(this,arguments)}function P(){this.evEl=Ht,this.evWin=Wt,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function F(){this.evTarget=Yt,this.evWin=Zt,this.started=!1,x.apply(this,arguments)}function B(t,e){var n=$(t.touches),r=$(t.changedTouches);return e&(St|Tt)&&(n=y(n.concat(r),"identifier",!0)),[n,r]}function L(){this.evTarget=Kt,this.targetIds={},x.apply(this,arguments)}function U(t,e){var n=$(t.touches),r=this.targetIds;if(e&(kt|At)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=$(t.changedTouches),s=[],u=this.target;if(o=n.filter(function(t){return p(t.target,u)}),e===kt)for(i=0;is&&(e.push(t),s=e.length-1):i&(St|Tt)&&(n=!0),0>s||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var Xt={touchstart:kt,touchmove:At,touchend:St,touchcancel:Tt},Yt="touchstart",Zt="touchstart touchmove touchend touchcancel";u(F,x,{handler:function(t){var e=Xt[t.type];if(e===kt&&(this.started=!0),this.started){var n=B.call(this,t,e);e&(St|Tt)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:wt,srcEvent:t})}}});var Gt={touchstart:kt,touchmove:At,touchend:St,touchcancel:Tt},Kt="touchstart touchmove touchend touchcancel";u(L,x,{handler:function(t){var e=Gt[t.type],n=U.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:wt,srcEvent:t})}}),u(V,x,{handler:function(t,e,n){var r=n.pointerType==wt,i=n.pointerType==xt;if(r)this.mouse.allow=!1;else if(i&&!this.mouse.allow)return;e&(St|Tt)&&(this.mouse.allow=!0),this.callback(t,e,n)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Jt=b(ct.style,"touchAction"),Qt=Jt!==r,te="compute",ee="auto",ne="manipulation",re="none",ie="pan-x",oe="pan-y";q.prototype={set:function(t){t==te&&(t=this.compute()),Qt&&this.manager.element.style&&(this.manager.element.style[Jt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return a(this.manager.recognizers,function(e){l(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),H(t.join(" "))},preventDefaults:function(t){if(!Qt){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var r=this.actions,i=m(r,re),o=m(r,oe),a=m(r,ie);if(i){var s=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(s&&u&&c)return}if(!a||!o)return i||o&&n&jt||a&&n&Nt?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var ae=1,se=2,ue=4,ce=8,le=ce,fe=16,he=32;W.prototype={defaults:{},set:function(t){return st(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(o(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=Z(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return o(t,"dropRecognizeWith",this)?this:(t=Z(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(o(t,"requireFailure",this))return this;var e=this.requireFail;return t=Z(t,this),-1===g(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(o(t,"dropRequireFailure",this))return this;t=Z(t,this);var e=g(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,r=this.state;ce>r&&e(n.options.event+X(r)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),r>=ce&&e(n.options.event+X(r))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=he)},canEmit:function(){for(var t=0;to?It:zt,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?Ot:0>a?Mt:Dt,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return G.prototype.attrTest.call(this,t)&&(this.state&se||!(this.state&se)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Y(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),u(J,G,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[re]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&se)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),u(Q,W,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ee]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distancee.time;if(this._input=t,!r||!n||t.eventType&(St|Tt)&&!o)this.reset();else if(t.eventType&kt)this.reset(),this._timer=i(function(){this.state=le,this.tryEmit()},e.time,this);else if(t.eventType&St)return le;return he},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===le&&(t&&t.eventType&St?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=dt(),this.manager.emit(this.options.event,this._input)))}}),u(tt,G,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[re]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&se)}}),u(et,G,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:jt|Nt,pointers:1},getTouchAction:function(){return K.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(jt|Nt)?e=t.overallVelocity:n&jt?e=t.overallVelocityX:n&Nt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&ht(e)>this.options.velocity&&t.eventType&St},emit:function(t){var e=Y(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),u(nt,W,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ne]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance>2,s=(3&n)<<4|i>>4,u=(15&i)<<2|o>>6,c=63&o,isNaN(i)?u=c=64:isNaN(o)&&(c=64),l=l+r.charAt(a)+r.charAt(s)+r.charAt(u)+r.charAt(c);return l},n.decode=function(t,e){var n,i,o,a,s,u,c,l="",f=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");f>4,i=(15&s)<<4|u>>2,o=(3&u)<<6|c,l+=String.fromCharCode(n),64!=u&&(l+=String.fromCharCode(i)),64!=c&&(l+=String.fromCharCode(o));return l}},{}],2:[function(t,e,n){"use strict";function r(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}r.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},e.exports=r},{}],3:[function(t,e,n){"use strict";n.STORE={magic:"\x00\x00",compress:function(t,e){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null},n.DEFLATE=t("./flate")},{"./flate":8}],4:[function(t,e,n){"use strict";var r=t("./utils"),i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]; +e.exports=function(t,e){if("undefined"==typeof t||!t.length)return 0;var n="string"!==r.getTypeOf(t);"undefined"==typeof e&&(e=0);var o=0,a=0,s=0;e=-1^e;for(var u=0,c=t.length;c>u;u++)s=n?t[u]:t.charCodeAt(u),a=255&(e^s),o=i[a],e=e>>>8^o;return-1^e}},{"./utils":21}],5:[function(t,e,n){"use strict";function r(t){this.data=null,this.length=0,this.index=0}var i=t("./utils");r.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.lengtht)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1)}},e.exports=r},{"./utils":21}],6:[function(t,e,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!1,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],7:[function(t,e,n){"use strict";var r=t("./utils");n.string2binary=function(t){return r.string2binary(t)},n.string2Uint8Array=function(t){return r.transformTo("uint8array",t)},n.uint8Array2String=function(t){return r.transformTo("string",t)},n.string2Blob=function(t){var e=r.transformTo("arraybuffer",t);return r.arrayBuffer2Blob(e)},n.arrayBuffer2Blob=function(t){return r.arrayBuffer2Blob(t)},n.transformTo=function(t,e){return r.transformTo(t,e)},n.getTypeOf=function(t){return r.getTypeOf(t)},n.checkSupport=function(t){return r.checkSupport(t)},n.MAX_VALUE_16BITS=r.MAX_VALUE_16BITS,n.MAX_VALUE_32BITS=r.MAX_VALUE_32BITS,n.pretty=function(t){return r.pretty(t)},n.findCompression=function(t){return r.findCompression(t)},n.isRegExp=function(t){return r.isRegExp(t)}},{"./utils":21}],8:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako");n.uncompressInputType=r?"uint8array":"array",n.compressInputType=r?"uint8array":"array",n.magic="\b\x00",n.compress=function(t,e){return i.deflateRaw(t,{level:e.level||-1})},n.uncompress=function(t){return i.inflateRaw(t)}},{pako:24}],9:[function(t,e,n){"use strict";function r(t,e){return this instanceof r?(this.files={},this.comment=null,this.root="",t&&this.load(t,e),void(this.clone=function(){var t=new r;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t})):new r(t,e)}var i=t("./base64");r.prototype=t("./object"),r.prototype.load=t("./load"),r.support=t("./support"),r.defaults=t("./defaults"),r.utils=t("./deprecatedPublicUtils"),r.base64={encode:function(t){return i.encode(t)},decode:function(t){return i.decode(t)}},r.compressions=t("./compressions"),e.exports=r},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(t,e,n){"use strict";var r=t("./base64"),i=t("./zipEntries");e.exports=function(t,e){var n,o,a,s;for(e=e||{},e.base64&&(t=r.decode(t)),o=new i(t,e),n=o.files,a=0;an;n++)r+=String.fromCharCode(255&t),t>>>=8;return r},b=function(){var t,e,n={};for(t=0;t0?t.substring(0,e):""},C=function(t){return"/"!=t.slice(-1)&&(t+="/"),t},E=function(t,e){return e="undefined"!=typeof e?e:!1,t=C(t),this.files[t]||_.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]},k=function(t,e,n){var r,a=new l;return t._data instanceof l?(a.uncompressedSize=t._data.uncompressedSize,a.crc32=t._data.crc32,0===a.uncompressedSize||t.dir?(e=c.STORE,a.compressedContent="",a.crc32=0):t._data.compressionMethod===e.magic?a.compressedContent=t._data.getCompressedContent():(r=t._data.getContent(),a.compressedContent=e.compress(i.transformTo(e.compressInputType,r),n))):(r=v(t),(!r||0===r.length||t.dir)&&(e=c.STORE,r=""),a.uncompressedSize=r.length,a.crc32=o(r),a.compressedContent=e.compress(i.transformTo(e.compressInputType,r),n)),a.compressedSize=a.compressedContent.length,a.compressionMethod=e.magic,a},A=function(t,e){var n=t;return t||(n=e?16893:33204),(65535&n)<<16},S=function(t,e){return 63&(t||0)},T=function(t,e,n,r,s){var u,c,l,f,d=(n.compressedContent,i.transformTo("string",h.utf8encode(e.name))),p=e.comment||"",m=i.transformTo("string",h.utf8encode(p)),v=d.length!==e.name.length,g=m.length!==p.length,$=e.options,b="",w="",_="";l=e._initialMetadata.dir!==e.dir?e.dir:$.dir,f=e._initialMetadata.date!==e.date?e.date:$.date;var x=0,C=0;l&&(x|=16),"UNIX"===s?(C=798,x|=A(e.unixPermissions,l)):(C=20,x|=S(e.dosPermissions,l)),u=f.getHours(),u<<=6,u|=f.getMinutes(),u<<=5,u|=f.getSeconds()/2,c=f.getFullYear()-1980,c<<=4,c|=f.getMonth()+1,c<<=5,c|=f.getDate(),v&&(w=y(1,1)+y(o(d),4)+d,b+="up"+y(w.length,2)+w),g&&(_=y(1,1)+y(this.crc32(m),4)+m,b+="uc"+y(_.length,2)+_);var E="";E+="\n\x00",E+=v||g?"\x00\b":"\x00\x00",E+=n.compressionMethod,E+=y(u,2),E+=y(c,2),E+=y(n.crc32,4),E+=y(n.compressedSize,4),E+=y(n.uncompressedSize,4),E+=y(d.length,2),E+=y(b.length,2);var k=a.LOCAL_FILE_HEADER+E+d+b,T=a.CENTRAL_FILE_HEADER+y(C,2)+E+y(m.length,2)+"\x00\x00\x00\x00"+y(x,4)+y(r,4)+d+b+m;return{fileRecord:k,dirRecord:T,compressedObject:n}},O={load:function(t,e){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(t){var e,n,r,i,o=[];for(e in this.files)this.files.hasOwnProperty(e)&&(r=this.files[e],i=new $(r.name,r._data,b(r.options)),n=e.slice(this.root.length,e.length),e.slice(0,this.root.length)===this.root&&t(n,i)&&o.push(i));return o},file:function(t,e,n){if(1===arguments.length){if(i.isRegExp(t)){var r=t;return this.filter(function(t,e){return!e.dir&&r.test(t)})}return this.filter(function(e,n){return!n.dir&&e===t})[0]||null}return t=this.root+t,_.call(this,t,e,n),this},folder:function(t){if(!t)return this;if(i.isRegExp(t))return this.filter(function(e,n){return n.dir&&t.test(e)});var e=this.root+t,n=E.call(this,e),r=this.clone();return r.root=n.name,r},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!=t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var n=this.filter(function(e,n){return n.name.slice(0,t.length)===t}),r=0;r=0;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===r&&this.data[o+3]===i)return o;return-1},r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.index,this.index+t);return this.index+=t,e},e.exports=r},{"./dataReader":5}],19:[function(t,e,n){"use strict";var r=t("./utils"),i=function(t){this.data=new Uint8Array(t),this.index=0};i.prototype={append:function(t){0!==t.length&&(t=r.transformTo("uint8array",t),this.data.set(t,this.index),this.index+=t.length)},finalize:function(){return this.data}},e.exports=i},{"./utils":21}],20:[function(t,e,n){"use strict";for(var r=t("./utils"),i=t("./support"),o=t("./nodeBuffer"),a=new Array(256),s=0;256>s;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;a[254]=a[254]=1;var u=function(t){var e,n,r,o,a,s=t.length,u=0;for(o=0;s>o;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),u+=128>n?1:2048>n?2:65536>n?3:4;for(e=i.uint8array?new Uint8Array(u):new Array(u),a=0,o=0;u>a;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),128>n?e[a++]=n:2048>n?(e[a++]=192|n>>>6,e[a++]=128|63&n):65536>n?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|63&n):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|63&n);return e},c=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return 0>n?e:0===n?e:n+a[t[n]]>e?n:e},l=function(t){var e,n,i,o,s=t.length,u=new Array(2*s);for(n=0,e=0;s>e;)if(i=t[e++],128>i)u[n++]=i;else if(o=a[i],o>4)u[n++]=65533,e+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&s>e;)i=i<<6|63&t[e++],o--;o>1?u[n++]=65533:65536>i?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return u.length!==n&&(u.subarray?u=u.subarray(0,n):u.length=n),r.applyFromCharCode(u)};n.utf8encode=function(t){return i.nodebuffer?o(t,"utf-8"):u(t)},n.utf8decode=function(t){if(i.nodebuffer)return r.transformTo("nodebuffer",t).toString("utf-8");t=r.transformTo(i.uint8array?"uint8array":"array",t);for(var e=[],n=0,o=t.length,a=65536;o>n;){var s=c(t,Math.min(n+a,o));i.uint8array?e.push(l(t.subarray(n,s))):e.push(l(t.slice(n,s))),n=s}return e.join("")}},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(t,e,n){"use strict";function r(t){return t}function i(t,e){for(var n=0;na&&e>1;)try{"array"===o||"nodebuffer"===o?r.push(String.fromCharCode.apply(null,t.slice(a,Math.min(a+e,i)))):r.push(String.fromCharCode.apply(null,t.subarray(a,Math.min(a+e,i)))),a+=e}catch(u){e=Math.floor(e/2)}return r.join("")}function a(t,e){for(var n=0;ne?"0":"")+e.toString(16).toUpperCase();return r},n.findCompression=function(t){for(var e in u)if(u.hasOwnProperty(e)&&u[e].magic===t)return u[e];return null},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(t,e,n){"use strict";function r(t,e){this.files=[],this.loadOptions=e,t&&this.load(t)}var i=t("./stringReader"),o=t("./nodeBufferReader"),a=t("./uint8ArrayReader"),s=t("./utils"),u=t("./signature"),c=t("./zipEntry"),l=t("./support"),f=t("./object");r.prototype={checkSignature:function(t){var e=this.reader.readString(4);if(e!==t)throw new Error("Corrupted zip or bug : unexpected signature ("+s.pretty(e)+", expected "+s.pretty(t)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=f.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,n,r=this.zip64EndOfCentralSize-44,i=0;r>i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readString(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t>8;this.dir=16&this.externalFileAttributes?!0:!1,t===u&&(this.dosPermissions=63&this.externalFileAttributes),t===c&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileName.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=new i(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,n,r,i=t.index;for(this.extraFields=this.extraFields||{};t.index0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=a.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==d)throw new Error(c[n]);e.header&&a.deflateSetHeader(this.strm,e.header)};$.prototype.push=function(t,e){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:e===!0?h:f,"string"==typeof t?i.input=u.string2buf(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new s.Buf8(o),i.next_out=0,i.avail_out=o),n=a.deflate(i,r),n!==p&&n!==d)return this.onEnd(n),this.ended=!0,!1;(0===i.avail_out||0===i.avail_in&&r===h)&&("string"===this.options.to?this.onData(u.buf2binstring(s.shrinkBuf(i.output,i.next_out))):this.onData(s.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&n!==p);return r===h?(n=a.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===d):!0},$.prototype.onData=function(t){this.chunks.push(t)},$.prototype.onEnd=function(t){t===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=$,n.deflate=r,n.deflateRaw=i,n.gzip=o},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(t,e,n){"use strict";function r(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg;return n.result}function i(t,e){return e=e||{},e.raw=!0,r(t,e)}var o=t("./zlib/inflate.js"),a=t("./utils/common"),s=t("./utils/strings"),u=t("./zlib/constants"),c=t("./zlib/messages"),l=t("./zlib/zstream"),f=t("./zlib/gzheader"),h=function(t){this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=o.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw new Error(c[n]);this.header=new f,o.inflateGetHeader(this.strm,this.header)};h.prototype.push=function(t,e){var n,r,i,c,l,f=this.strm,h=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:e===!0?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof t?f.input=s.binstring2buf(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new a.Buf8(h),f.next_out=0,f.avail_out=h),n=o.inflate(f,u.Z_NO_FLUSH),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0===f.avail_out||n===u.Z_STREAM_END||0===f.avail_in&&r===u.Z_FINISH)&&("string"===this.options.to?(i=s.utf8border(f.output,f.next_out),c=f.next_out-i,l=s.buf2string(f.output,i),f.next_out=c,f.avail_out=h-c,c&&a.arraySet(f.output,f.output,i,c,0),this.onData(l)):this.onData(a.shrinkBuf(f.output,f.next_out)))}while(f.avail_in>0&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(r=u.Z_FINISH),r===u.Z_FINISH?(n=o.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):!0},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg; +},n.Inflate=h,n.inflate=r,n.inflateRaw=i,n.ungzip=r},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)return void t.set(e.subarray(n,n+r),i);for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,a;for(r=0,e=0,n=t.length;n>e;e++)r+=t[e].length;for(a=new Uint8Array(r),i=0,e=0,n=t.length;n>e;e++)o=t[e],a.set(o,i),i+=o.length;return a}},o={arraySet:function(t,e,n,r,i){for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],28:[function(t,e,n){"use strict";function r(t,e){if(65537>e&&(t.subarray&&a||!t.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",r=0;e>r;r++)n+=String.fromCharCode(t[r]);return n}var i=t("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(s){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(s){a=!1}for(var u=new i.Buf8(256),c=0;256>c;c++)u[c]=c>=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;u[254]=u[254]=1,n.string2buf=function(t){var e,n,r,o,a,s=t.length,u=0;for(o=0;s>o;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),u+=128>n?1:2048>n?2:65536>n?3:4;for(e=new i.Buf8(u),a=0,o=0;u>a;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),128>n?e[a++]=n:2048>n?(e[a++]=192|n>>>6,e[a++]=128|63&n):65536>n?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|63&n):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|63&n);return e},n.buf2binstring=function(t){return r(t,t.length)},n.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;r>n;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,i,o,a,s=e||t.length,c=new Array(2*s);for(i=0,n=0;s>n;)if(o=t[n++],128>o)c[i++]=o;else if(a=u[o],a>4)c[i++]=65533,n+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&s>n;)o=o<<6|63&t[n++],a--;a>1?c[i++]=65533:65536>o?c[i++]=o:(o-=65536,c[i++]=55296|o>>10&1023,c[i++]=56320|1023&o)}return r(c,i)},n.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return 0>n?e:0===n?e:n+u[t[n]]>e?n:e}},{"./common":27}],29:[function(t,e,n){"use strict";function r(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,a=0;0!==n;){a=n>2e3?2e3:n,n-=a;do i=i+e[r++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0}e.exports=r},{}],30:[function(t,e,n){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],31:[function(t,e,n){"use strict";function r(){for(var t,e=[],n=0;256>n;n++){t=n;for(var r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function i(t,e,n,r){var i=o,a=r+n;t=-1^t;for(var s=r;a>s;s++)t=t>>>8^i[255&(t^e[s])];return-1^t}var o=r();e.exports=i},{}],32:[function(t,e,n){"use strict";function r(t,e){return t.msg=z[e],e}function i(t){return(t<<1)-(t>4?9:0)}function o(t){for(var e=t.length;--e>=0;)t[e]=0}function a(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(S.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function s(t,e){T._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,a(t.strm)}function u(t,e){t.pending_buf[t.pending++]=e}function c(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function l(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,S.arraySet(e,t.input,t.next_in,i,n),1===t.state.wrap?t.adler=O(t.adler,e,i,n):2===t.state.wrap&&(t.adler=I(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)}function f(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,c=t.window,l=t.w_mask,f=t.prev,h=t.strstart+ut,d=c[o+a-1],p=c[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,c[n+a]===p&&c[n+a-1]===d&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do;while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&h>o);if(r=ut-(h-o),o=h-ut,r>a){if(t.match_start=e,a=r,r>=s)break;d=c[o+a-1],p=c[o+a]}}while((e=f[e&l])>u&&0!==--i);return a<=t.lookahead?a:t.lookahead}function h(t){var e,n,r,i,o,a=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-ct)){S.arraySet(t.window,t.window,a,a,0),t.match_start-=a,t.strstart-=a,t.block_start-=a,n=t.hash_size,e=n;do r=t.head[--e],t.head[e]=r>=a?r-a:0;while(--n);n=a,e=n;do r=t.prev[--e],t.prev[e]=r>=a?r-a:0;while(--n);i+=a}if(0===t.strm.avail_in)break;if(n=l(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=st)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(h(t),0===t.lookahead&&e===M)return $t;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,s(t,!1),0===t.strm.avail_out))return $t;if(t.strstart-t.block_start>=t.w_size-ct&&(s(t,!1),0===t.strm.avail_out))return $t}return t.insert=0,e===N?(s(t,!0),0===t.strm.avail_out?bt:wt):t.strstart>t.block_start&&(s(t,!1),0===t.strm.avail_out)?$t:$t}function p(t,e){for(var n,r;;){if(t.lookahead=st&&(t.ins_h=(t.ins_h<=st)if(r=T._tr_tally(t,t.strstart-t.match_start,t.match_length-st),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=st){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=st&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=st-1)),t.prev_length>=st&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-st,r=T._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-st),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<=st&&t.strstart>0&&(i=t.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=t.strstart+ut;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&o>i);t.match_length=ut-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=st?(n=T._tr_tally(t,1,t.match_length-st),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(s(t,!1),0===t.strm.avail_out))return $t}return t.insert=0,e===N?(s(t,!0),0===t.strm.avail_out?bt:wt):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?$t:yt}function g(t,e){for(var n;;){if(0===t.lookahead&&(h(t),0===t.lookahead)){if(e===M)return $t;break}if(t.match_length=0,n=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(s(t,!1),0===t.strm.avail_out))return $t}return t.insert=0,e===N?(s(t,!0),0===t.strm.avail_out?bt:wt):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?$t:yt}function $(t){t.window_size=2*t.w_size,o(t.head),t.max_lazy_match=A[t.level].max_lazy,t.good_match=A[t.level].good_length,t.nice_match=A[t.level].nice_length,t.max_chain_length=A[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=st-1,t.match_available=0,t.ins_h=0}function y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=G,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new S.Buf16(2*ot),this.dyn_dtree=new S.Buf16(2*(2*rt+1)),this.bl_tree=new S.Buf16(2*(2*it+1)),o(this.dyn_ltree),o(this.dyn_dtree),o(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new S.Buf16(at+1),this.heap=new S.Buf16(2*nt+1),o(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new S.Buf16(2*nt+1),o(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function b(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Z,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ft:vt,t.adler=2===e.wrap?0:1,e.last_flush=M,T._tr_init(e),P):r(t,B)}function w(t){var e=b(t);return e===P&&$(t.state),e}function _(t,e){return t&&t.state?2!==t.state.wrap?B:(t.state.gzhead=e,P):B}function x(t,e,n,i,o,a){if(!t)return B;var s=1;if(e===V&&(e=6),0>i?(s=0,i=-i):i>15&&(s=2,i-=16),1>o||o>K||n!==G||8>i||i>15||0>e||e>9||0>a||a>X)return r(t,B);8===i&&(i=9);var u=new y;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=i,u.w_size=1<>1,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=a,u.method=n,w(t)}function C(t,e){return x(t,e,G,J,Q,Y)}function E(t,e){var n,s,l,f;if(!t||!t.state||e>R||0>e)return t?r(t,B):B;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||s.status===gt&&e!==N)return r(t,0===t.avail_out?U:B);if(s.strm=t,n=s.last_flush,s.last_flush=e,s.status===ft)if(2===s.wrap)t.adler=0,u(s,31),u(s,139),u(s,8),s.gzhead?(u(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),u(s,255&s.gzhead.time),u(s,s.gzhead.time>>8&255),u(s,s.gzhead.time>>16&255),u(s,s.gzhead.time>>24&255),u(s,9===s.level?2:s.strategy>=H||s.level<2?4:0),u(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(u(s,255&s.gzhead.extra.length),u(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=I(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=ht):(u(s,0),u(s,0),u(s,0),u(s,0),u(s,0),u(s,9===s.level?2:s.strategy>=H||s.level<2?4:0),u(s,_t),s.status=vt);else{var h=G+(s.w_bits-8<<4)<<8,d=-1;d=s.strategy>=H||s.level<2?0:s.level<6?1:6===s.level?2:3,h|=d<<6,0!==s.strstart&&(h|=lt),h+=31-h%31,s.status=vt,c(s,h),0!==s.strstart&&(c(s,t.adler>>>16),c(s,65535&t.adler)),t.adler=1}if(s.status===ht)if(s.gzhead.extra){for(l=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>l&&(t.adler=I(t.adler,s.pending_buf,s.pending-l,l)),a(t),l=s.pending,s.pending!==s.pending_buf_size));)u(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>l&&(t.adler=I(t.adler,s.pending_buf,s.pending-l,l)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=dt)}else s.status=dt;if(s.status===dt)if(s.gzhead.name){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(t.adler=I(t.adler,s.pending_buf,s.pending-l,l)),a(t),l=s.pending,s.pending===s.pending_buf_size)){f=1;break}f=s.gzindexl&&(t.adler=I(t.adler,s.pending_buf,s.pending-l,l)),0===f&&(s.gzindex=0,s.status=pt)}else s.status=pt;if(s.status===pt)if(s.gzhead.comment){l=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>l&&(t.adler=I(t.adler,s.pending_buf,s.pending-l,l)),a(t),l=s.pending,s.pending===s.pending_buf_size)){f=1;break}f=s.gzindexl&&(t.adler=I(t.adler,s.pending_buf,s.pending-l,l)),0===f&&(s.status=mt)}else s.status=mt;if(s.status===mt&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&a(t),s.pending+2<=s.pending_buf_size&&(u(s,255&t.adler),u(s,t.adler>>8&255),t.adler=0,s.status=vt)):s.status=vt),0!==s.pending){if(a(t),0===t.avail_out)return s.last_flush=-1,P}else if(0===t.avail_in&&i(e)<=i(n)&&e!==N)return r(t,U);if(s.status===gt&&0!==t.avail_in)return r(t,U);if(0!==t.avail_in||0!==s.lookahead||e!==M&&s.status!==gt){var p=s.strategy===H?g(s,e):s.strategy===W?v(s,e):A[s.level].func(s,e);if((p===bt||p===wt)&&(s.status=gt),p===$t||p===bt)return 0===t.avail_out&&(s.last_flush=-1),P;if(p===yt&&(e===D?T._tr_align(s):e!==R&&(T._tr_stored_block(s,0,0,!1),e===j&&(o(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),a(t),0===t.avail_out))return s.last_flush=-1,P}return e!==N?P:s.wrap<=0?F:(2===s.wrap?(u(s,255&t.adler),u(s,t.adler>>8&255),u(s,t.adler>>16&255),u(s,t.adler>>24&255),u(s,255&t.total_in),u(s,t.total_in>>8&255),u(s,t.total_in>>16&255),u(s,t.total_in>>24&255)):(c(s,t.adler>>>16),c(s,65535&t.adler)),a(t),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?P:F)}function k(t){var e;return t&&t.state?(e=t.state.status,e!==ft&&e!==ht&&e!==dt&&e!==pt&&e!==mt&&e!==vt&&e!==gt?r(t,B):(t.state=null,e===vt?r(t,L):P)):B}var A,S=t("../utils/common"),T=t("./trees"),O=t("./adler32"),I=t("./crc32"),z=t("./messages"),M=0,D=1,j=3,N=4,R=5,P=0,F=1,B=-2,L=-3,U=-5,V=-1,q=1,H=2,W=3,X=4,Y=0,Z=2,G=8,K=9,J=15,Q=8,tt=29,et=256,nt=et+1+tt,rt=30,it=19,ot=2*nt+1,at=15,st=3,ut=258,ct=ut+st+1,lt=32,ft=42,ht=69,dt=73,pt=91,mt=103,vt=113,gt=666,$t=1,yt=2,bt=3,wt=4,_t=3,xt=function(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i};A=[new xt(0,0,0,0,d),new xt(4,4,8,4,p),new xt(4,5,16,8,p),new xt(4,6,32,32,p),new xt(4,4,16,16,m),new xt(8,16,32,32,m),new xt(8,16,128,128,m),new xt(8,32,128,256,m),new xt(32,128,258,1024,m),new xt(32,258,258,4096,m)],n.deflateInit=C,n.deflateInit2=x,n.deflateReset=w,n.deflateResetKeep=b,n.deflateSetHeader=_,n.deflate=E,n.deflateEnd=k,n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(t,e,n){"use strict";function r(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=r},{}],34:[function(t,e,n){"use strict";var r=30,i=12;e.exports=function(t,e){var n,o,a,s,u,c,l,f,h,d,p,m,v,g,$,y,b,w,_,x,C,E,k,A,S;n=t.state,o=t.next_in,A=t.input,a=o+(t.avail_in-5),s=t.next_out,S=t.output,u=s-(e-t.avail_out),c=s+(t.avail_out-257),l=n.dmax,f=n.wsize,h=n.whave,d=n.wnext,p=n.window,m=n.hold,v=n.bits,g=n.lencode,$=n.distcode,y=(1<v&&(m+=A[o++]<>>24,m>>>=_,v-=_,_=w>>>16&255,0===_)S[s++]=65535&w;else{if(!(16&_)){if(0===(64&_)){w=g[(65535&w)+(m&(1<<_)-1)];continue e}if(32&_){n.mode=i;break t}t.msg="invalid literal/length code",n.mode=r;break t}x=65535&w,_&=15,_&&(_>v&&(m+=A[o++]<>>=_,v-=_),15>v&&(m+=A[o++]<>>24,m>>>=_,v-=_,_=w>>>16&255,!(16&_)){if(0===(64&_)){w=$[(65535&w)+(m&(1<<_)-1)];continue n}t.msg="invalid distance code",n.mode=r;break t}if(C=65535&w,_&=15,_>v&&(m+=A[o++]<v&&(m+=A[o++]<l){t.msg="invalid distance too far back",n.mode=r;break t}if(m>>>=_,v-=_,_=s-u,C>_){if(_=C-_,_>h&&n.sane){t.msg="invalid distance too far back",n.mode=r;break t}if(E=0,k=p,0===d){if(E+=f-_,x>_){x-=_;do S[s++]=p[E++];while(--_);E=s-C,k=S}}else if(_>d){if(E+=f+d-_,_-=d,x>_){x-=_;do S[s++]=p[E++];while(--_);if(E=0,x>d){_=d,x-=_;do S[s++]=p[E++];while(--_);E=s-C,k=S}}}else if(E+=d-_,x>_){x-=_;do S[s++]=p[E++];while(--_);E=s-C,k=S}for(;x>2;)S[s++]=k[E++],S[s++]=k[E++],S[s++]=k[E++],x-=3;x&&(S[s++]=k[E++],x>1&&(S[s++]=k[E++]))}else{E=s-C;do S[s++]=S[E++],S[s++]=S[E++],S[s++]=S[E++],x-=3;while(x>2);x&&(S[s++]=S[E++],x>1&&(S[s++]=S[E++]))}break}}break}}while(a>o&&c>s);x=v>>3,o-=x,v-=x<<3,m&=(1<o?5+(a-o):5-(o-a),t.avail_out=c>s?257+(c-s):257-(s-c),n.hold=m,n.bits=v}},{}],35:[function(t,e,n){"use strict";function r(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new g.Buf16(320),this.work=new g.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=N,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new g.Buf32(pt),e.distcode=e.distdyn=new g.Buf32(mt),e.sane=1,e.back=-1,S):I}function a(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):I}function s(t,e){var n,r;return t&&t.state?(r=t.state,0>e?(n=0,e=-e):(n=(e>>4)+1,48>e&&(e&=15)),e&&(8>e||e>15)?I:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,a(t))):I}function u(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=s(t,e),n!==S&&(t.state=null),n):I}function c(t){return u(t,gt)}function l(t){if($t){var e;for(m=new g.Buf32(512),v=new g.Buf32(32),e=0;144>e;)t.lens[e++]=8;for(;256>e;)t.lens[e++]=9;for(;280>e;)t.lens[e++]=7;for(;288>e;)t.lens[e++]=8;for(w(x,t.lens,0,288,m,0,t.work,{bits:9}),e=0;32>e;)t.lens[e++]=5;w(C,t.lens,0,32,v,0,t.work,{bits:5}),$t=!1}t.lencode=m,t.lenbits=9,t.distcode=v,t.distbits=5}function f(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(g.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),g.arraySet(o.window,e,n-r,i,o.wnext),r-=i,r?(g.arraySet(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaved;){if(0===u)break t;u--,h+=i[a++]<>>8&255,n.check=y(n.check,At,2,0),h=0,d=0,n.mode=R;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=ft;break}if((15&h)!==j){t.msg="unknown compression method",n.mode=ft;break}if(h>>>=4,d-=4,_t=(15&h)+8,0===n.wbits)n.wbits=_t;else if(_t>n.wbits){t.msg="invalid window size",n.mode=ft;break}n.dmax=1<<_t,t.adler=n.check=1,n.mode=512&h?H:X,h=0,d=0;break;case R:for(;16>d;){if(0===u)break t;u--,h+=i[a++]<>8&1),512&n.flags&&(At[0]=255&h,At[1]=h>>>8&255,n.check=y(n.check,At,2,0)),h=0,d=0,n.mode=P;case P:for(;32>d;){if(0===u)break t;u--,h+=i[a++]<>>8&255,At[2]=h>>>16&255,At[3]=h>>>24&255,n.check=y(n.check,At,4,0)),h=0,d=0,n.mode=F;case F:for(;16>d;){if(0===u)break t;u--,h+=i[a++]<>8),512&n.flags&&(At[0]=255&h,At[1]=h>>>8&255,n.check=y(n.check,At,2,0)),h=0,d=0,n.mode=B;case B:if(1024&n.flags){for(;16>d;){if(0===u)break t;u--,h+=i[a++]<>>8&255,n.check=y(n.check,At,2,0)),h=0,d=0}else n.head&&(n.head.extra=null);n.mode=L;case L:if(1024&n.flags&&(v=n.length,v>u&&(v=u),v&&(n.head&&(_t=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),g.arraySet(n.head.extra,i,a,v,_t)),512&n.flags&&(n.check=y(n.check,i,v,a)),u-=v,a+=v,n.length-=v),n.length))break t;n.length=0,n.mode=U;case U:if(2048&n.flags){if(0===u)break t;v=0;do _t=i[a+v++],n.head&&_t&&n.length<65536&&(n.head.name+=String.fromCharCode(_t));while(_t&&u>v);if(512&n.flags&&(n.check=y(n.check,i,v,a)),u-=v,a+=v,_t)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=V;case V:if(4096&n.flags){if(0===u)break t;v=0;do _t=i[a+v++],n.head&&_t&&n.length<65536&&(n.head.comment+=String.fromCharCode(_t));while(_t&&u>v);if(512&n.flags&&(n.check=y(n.check,i,v,a)),u-=v,a+=v,_t)break t}else n.head&&(n.head.comment=null);n.mode=q;case q:if(512&n.flags){for(;16>d;){if(0===u)break t;u--,h+=i[a++]<>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=X;break;case H:for(;32>d;){if(0===u)break t;u--,h+=i[a++]<>>=7&d,d-=7&d,n.mode=ut;break}for(;3>d;){if(0===u)break t;u--,h+=i[a++]<>>=1,d-=1,3&h){case 0:n.mode=Z;break;case 1:if(l(n),n.mode=et,e===A){h>>>=2,d-=2;break t}break;case 2:n.mode=J;break;case 3:t.msg="invalid block type",n.mode=ft}h>>>=2,d-=2;break;case Z:for(h>>>=7&d,d-=7&d;32>d;){if(0===u)break t;u--,h+=i[a++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=ft;break}if(n.length=65535&h,h=0,d=0,n.mode=G,e===A)break t;case G:n.mode=K;case K:if(v=n.length){if(v>u&&(v=u),v>c&&(v=c),0===v)break t;g.arraySet(o,i,a,v,s),u-=v,a+=v,c-=v,s+=v,n.length-=v;break}n.mode=X;break;case J:for(;14>d;){if(0===u)break t;u--,h+=i[a++]<>>=5,d-=5,n.ndist=(31&h)+1,h>>>=5,d-=5,n.ncode=(15&h)+4,h>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=ft;break}n.have=0,n.mode=Q;case Q:for(;n.haved;){if(0===u)break t;u--,h+=i[a++]<>>=3,d-=3}for(;n.have<19;)n.lens[St[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ct={bits:n.lenbits},xt=w(_,n.lens,0,19,n.lencode,0,n.work,Ct),n.lenbits=Ct.bits,xt){t.msg="invalid code lengths set",n.mode=ft;break}n.have=0,n.mode=tt;case tt:for(;n.have>>24,gt=kt>>>16&255,$t=65535&kt,!(d>=vt);){if(0===u)break t;u--,h+=i[a++]<$t)h>>>=vt,d-=vt,n.lens[n.have++]=$t;else{if(16===$t){for(Et=vt+2;Et>d;){if(0===u)break t;u--,h+=i[a++]<>>=vt,d-=vt,0===n.have){t.msg="invalid bit length repeat",n.mode=ft;break}_t=n.lens[n.have-1],v=3+(3&h),h>>>=2,d-=2}else if(17===$t){for(Et=vt+3;Et>d;){if(0===u)break t;u--,h+=i[a++]<>>=vt,d-=vt,_t=0,v=3+(7&h),h>>>=3,d-=3}else{for(Et=vt+7;Et>d;){if(0===u)break t;u--,h+=i[a++]<>>=vt,d-=vt,_t=0,v=11+(127&h),h>>>=7,d-=7}if(n.have+v>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=ft;break}for(;v--;)n.lens[n.have++]=_t}}if(n.mode===ft)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=ft;break}if(n.lenbits=9,Ct={bits:n.lenbits},xt=w(x,n.lens,0,n.nlen,n.lencode,0,n.work,Ct),n.lenbits=Ct.bits,xt){t.msg="invalid literal/lengths set",n.mode=ft;break}if(n.distbits=6,n.distcode=n.distdyn,Ct={bits:n.distbits},xt=w(C,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ct),n.distbits=Ct.bits,xt){t.msg="invalid distances set",n.mode=ft;break}if(n.mode=et,e===A)break t;case et:n.mode=nt;case nt:if(u>=6&&c>=258){t.next_out=s,t.avail_out=c,t.next_in=a,t.avail_in=u,n.hold=h,n.bits=d,b(t,m),s=t.next_out,o=t.output,c=t.avail_out,a=t.next_in,i=t.input,u=t.avail_in,h=n.hold,d=n.bits,n.mode===X&&(n.back=-1);break}for(n.back=0;kt=n.lencode[h&(1<>>24,gt=kt>>>16&255,$t=65535&kt,!(d>=vt);){if(0===u)break t;u--,h+=i[a++]<>yt)],vt=kt>>>24,gt=kt>>>16&255,$t=65535&kt,!(d>=yt+vt);){if(0===u)break t;u--,h+=i[a++]<>>=yt,d-=yt,n.back+=yt}if(h>>>=vt,d-=vt,n.back+=vt,n.length=$t,0===gt){n.mode=st;break}if(32>){n.back=-1,n.mode=X;break}if(64>){t.msg="invalid literal/length code",n.mode=ft;break}n.extra=15>,n.mode=rt;case rt:if(n.extra){for(Et=n.extra;Et>d;){if(0===u)break t;u--,h+=i[a++]<>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=it;case it:for(;kt=n.distcode[h&(1<>>24,gt=kt>>>16&255,$t=65535&kt,!(d>=vt);){if(0===u)break t;u--,h+=i[a++]<>yt)],vt=kt>>>24,gt=kt>>>16&255,$t=65535&kt,!(d>=yt+vt);){if(0===u)break t;u--,h+=i[a++]<>>=yt,d-=yt,n.back+=yt}if(h>>>=vt,d-=vt,n.back+=vt,64>){t.msg="invalid distance code",n.mode=ft;break}n.offset=$t,n.extra=15>,n.mode=ot;case ot:if(n.extra){for(Et=n.extra;Et>d;){if(0===u)break t;u--,h+=i[a++]<>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=ft;break}n.mode=at;case at:if(0===c)break t;if(v=m-c,n.offset>v){if(v=n.offset-v,v>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=ft;break}v>n.wnext?(v-=n.wnext,pt=n.wsize-v):pt=n.wnext-v,v>n.length&&(v=n.length),mt=n.window}else mt=o,pt=s-n.offset,v=n.length;v>c&&(v=c),c-=v,n.length-=v;do o[s++]=mt[pt++];while(--v);0===n.length&&(n.mode=nt);break;case st:if(0===c)break t;o[s++]=n.length,c--,n.mode=nt;break;case ut:if(n.wrap){for(;32>d;){if(0===u)break t;u--,h|=i[a++]<d;){if(0===u)break t;u--,h+=i[a++]<=T;T++)L[T]=0;for(O=0;p>O;O++)L[e[n+O]]++;for(M=S,z=i;z>=1&&0===L[z];z--);if(M>z&&(M=z),0===z)return m[v++]=20971520,m[v++]=20971520,$.bits=1,0;for(I=1;z>I&&0===L[I];I++);for(I>M&&(M=I), +N=1,T=1;i>=T;T++)if(N<<=1,N-=L[T],0>N)return-1;if(N>0&&(t===s||1!==z))return-1;for(U[1]=0,T=1;i>T;T++)U[T+1]=U[T]+L[T];for(O=0;p>O;O++)0!==e[n+O]&&(g[U[e[n+O]]++]=O);if(t===s?(F=V=g,C=19):t===u?(F=l,B-=257,V=f,q-=257,C=256):(F=h,V=d,C=-1),P=0,O=0,T=I,x=v,D=M,j=0,w=-1,R=1<o||t===c&&R>a)return 1;for(var H=0;;){H++,E=T-j,g[O]C?(k=V[q+g[O]],A=F[B+g[O]]):(k=96,A=0),y=1<>j)+b]=E<<24|k<<16|A|0;while(0!==b);for(y=1<>=1;if(0!==y?(P&=y-1,P+=y):P=0,O++,0===--L[T]){if(T===z)break;T=e[n+g[O]]}if(T>M&&(P&_)!==w){for(0===j&&(j=M),x+=I,D=T-j,N=1<D+j&&(N-=L[D+j],!(0>=N));)D++,N<<=1;if(R+=1<o||t===c&&R>a)return 1;w=P&_,m[w]=M<<24|D<<16|x-v|0}}return 0!==P&&(m[x+P]=T-j<<24|64<<16|0),$.bits=M,0}},{"../utils/common":27}],37:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],38:[function(t,e,n){"use strict";function r(t){for(var e=t.length;--e>=0;)t[e]=0}function i(t){return 256>t?at[t]:at[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function a(t,e,n){t.bi_valid>X-n?(t.bi_buf|=e<>X-t.bi_valid,t.bi_valid+=n-X):(t.bi_buf|=e<>>=1,n<<=1;while(--e>0);return n>>>1}function c(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function l(t,e){var n,r,i,o,a,s,u=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,h=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(o=0;W>=o;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;H>n;n++)r=t.heap[n],o=u[2*u[2*r+1]+1]+1,o>p&&(o=p,m++),u[2*r+1]=o,r>c||(t.bl_count[o]++,a=0,r>=d&&(a=h[r-d]),s=u[2*r],t.opt_len+=s*(o+a),f&&(t.static_len+=s*(l[2*r+1]+a)));if(0!==m){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)i=t.heap[--n],i>c||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}function f(t,e,n){var r,i,o=new Array(W+1),a=0;for(r=1;W>=r;r++)o[r]=a=a+n[r-1]<<1;for(i=0;e>=i;i++){var s=t[2*i+1];0!==s&&(t[2*i]=u(o[s]++,s))}}function h(){var t,e,n,r,i,o=new Array(W+1);for(n=0,r=0;B-1>r;r++)for(ut[r]=n,t=0;t<1<r;r++)for(ct[r]=i,t=0;t<1<>=7;V>r;r++)for(ct[r]=i<<7,t=0;t<1<=e;e++)o[e]=0;for(t=0;143>=t;)it[2*t+1]=8,t++,o[8]++;for(;255>=t;)it[2*t+1]=9,t++,o[9]++;for(;279>=t;)it[2*t+1]=7,t++,o[7]++;for(;287>=t;)it[2*t+1]=8,t++,o[8]++;for(f(it,U+1,o),t=0;V>t;t++)ot[2*t+1]=5,ot[2*t]=u(t,5);lt=new dt(it,Q,L+1,U,W),ft=new dt(ot,tt,0,V,W),ht=new dt(new Array(0),et,0,q,Y)}function d(t){var e;for(e=0;U>e;e++)t.dyn_ltree[2*e]=0;for(e=0;V>e;e++)t.dyn_dtree[2*e]=0;for(e=0;q>e;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*Z]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function p(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,n,r){p(t),r&&(o(t,n),o(t,~n)),O.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function v(t,e,n,r){var i=2*e,o=2*n;return t[i]n;n++)0!==o[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)i=t.heap[++t.heap_len]=2>c?++c:0,o[2*i]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=c,n=t.heap_len>>1;n>=1;n--)g(t,o,n);i=u;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],g(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,g(t,o,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],l(t,e),f(o,c,t.bl_count)}function b(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),e[2*(n+1)+1]=65535,r=0;n>=r;r++)i=a,a=e[2*(r+1)+1],++ss?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[2*G]++):10>=s?t.bl_tree[2*K]++:t.bl_tree[2*J]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function w(t,e,n){var r,i,o=-1,u=e[1],c=0,l=7,f=4;for(0===u&&(l=138,f=3),r=0;n>=r;r++)if(i=u,u=e[2*(r+1)+1],!(++cc){do s(t,i,t.bl_tree);while(0!==--c)}else 0!==i?(i!==o&&(s(t,i,t.bl_tree),c--),s(t,G,t.bl_tree),a(t,c-3,2)):10>=c?(s(t,K,t.bl_tree),a(t,c-3,3)):(s(t,J,t.bl_tree),a(t,c-11,7));c=0,o=i,0===u?(l=138,f=3):i===u?(l=6,f=3):(l=7,f=4)}}function _(t){var e;for(b(t,t.dyn_ltree,t.l_desc.max_code),b(t,t.dyn_dtree,t.d_desc.max_code),y(t,t.bl_desc),e=q-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function x(t,e,n,r){var i;for(a(t,e-257,5),a(t,n-1,5),a(t,r-4,4),i=0;r>i;i++)a(t,t.bl_tree[2*nt[i]+1],3);w(t,t.dyn_ltree,e-1),w(t,t.dyn_dtree,n-1)}function C(t){var e,n=4093624447;for(e=0;31>=e;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return z;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return M;for(e=32;L>e;e++)if(0!==t.dyn_ltree[2*e])return M;return z}function E(t){mt||(h(),mt=!0),t.l_desc=new pt(t.dyn_ltree,lt),t.d_desc=new pt(t.dyn_dtree,ft),t.bl_desc=new pt(t.bl_tree,ht),t.bi_buf=0,t.bi_valid=0,d(t)}function k(t,e,n,r){a(t,(j<<1)+(r?1:0),3),m(t,e,n,!0)}function A(t){a(t,N<<1,3),s(t,Z,it),c(t)}function S(t,e,n,r){var i,o,s=0;t.level>0?(t.strm.data_type===D&&(t.strm.data_type=C(t)),y(t,t.l_desc),y(t,t.d_desc),s=_(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,i>=o&&(i=o)):i=o=n+5,i>=n+4&&-1!==e?k(t,e,n,r):t.strategy===I||o===i?(a(t,(N<<1)+(r?1:0),3),$(t,it,ot)):(a(t,(R<<1)+(r?1:0),3),x(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),$(t,t.dyn_ltree,t.dyn_dtree)),d(t),r&&p(t)}function T(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(st[n]+L+1)]++,t.dyn_dtree[2*i(e)]++),t.last_lit===t.lit_bufsize-1}var O=t("../utils/common"),I=4,z=0,M=1,D=2,j=0,N=1,R=2,P=3,F=258,B=29,L=256,U=L+1+B,V=30,q=19,H=2*U+1,W=15,X=16,Y=7,Z=256,G=16,K=17,J=18,Q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],tt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],et=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,it=new Array(2*(U+2));r(it);var ot=new Array(2*V);r(ot);var at=new Array(rt);r(at);var st=new Array(F-P+1);r(st);var ut=new Array(B);r(ut);var ct=new Array(V);r(ct);var lt,ft,ht,dt=function(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length},pt=function(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e},mt=!1;n._tr_init=E,n._tr_stored_block=k,n._tr_flush_block=S,n._tr_tally=T,n._tr_align=A},{"../utils/common":27}],39:[function(t,e,n){"use strict";function r(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=r},{}]},{},[9])(9)}),function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e(require,exports,module):t.Tether=e()}(this,function(t,e,n){return function(){var t,e,n,r,i,o,a,s,u,c,l,f,h,d,p,m,v,g={}.hasOwnProperty,$=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},y=[].slice;null==this.Tether&&(this.Tether={modules:[]}),l=function(t){var e,n,r,i,o;if(n=getComputedStyle(t).position,"fixed"===n)return t;for(r=void 0,e=t;e=e.parentNode;){try{i=getComputedStyle(e)}catch(a){}if(null==i)return e;if(/(auto|scroll)/.test(i.overflow+i["overflow-y"]+i["overflow-x"])&&("absolute"!==n||"relative"===(o=i.position)||"absolute"===o||"fixed"===o))return e}return document.body},p=function(){var t;return t=0,function(){return t++}}(),v={},u=function(t){var e,r,o,a,s;if(o=t._tetherZeroElement,null==o&&(o=t.createElement("div"),o.setAttribute("data-tether-id",p()),i(o.style,{top:0,left:0,position:"absolute"}),t.body.appendChild(o),t._tetherZeroElement=o),e=o.getAttribute("data-tether-id"),null==v[e]){v[e]={},s=o.getBoundingClientRect();for(r in s)a=s[r],v[e][r]=a;n(function(){return v[e]=void 0})}return v[e]},h=null,a=function(t){var e,n,r,i,o,a,s;t===document?(n=document,t=document.documentElement):n=t.ownerDocument,r=n.documentElement,e={},s=t.getBoundingClientRect();for(i in s)a=s[i],e[i]=a;return o=u(n),e.top-=o.top,e.left-=o.left,null==e.width&&(e.width=document.body.scrollWidth-e.left-e.right),null==e.height&&(e.height=document.body.scrollHeight-e.top-e.bottom),e.top=e.top-r.clientTop,e.left=e.left-r.clientLeft,e.right=n.body.clientWidth-e.width-e.left,e.bottom=n.body.clientHeight-e.height-e.top,e},s=function(t){return t.offsetParent||document.documentElement},c=function(){var t,e,n,r,o;return t=document.createElement("div"),t.style.width="100%",t.style.height="200px",e=document.createElement("div"),i(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e),r=t.offsetWidth,e.style.overflow="scroll",o=t.offsetWidth,r===o&&(o=e.clientWidth),document.body.removeChild(e),n=r-o,{width:n,height:n}},i=function(t){var e,n,r,i,o,a,s;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),s=e.slice(1),o=0,a=s.length;a>o;o++)if(r=s[o])for(n in r)g.call(r,n)&&(i=r[n],t[n]=i);return t},d=function(t,e){var n,r,i,o,a;if(null!=t.classList){for(o=e.split(" "),a=[],r=0,i=o.length;i>r;r++)n=o[r],n.trim()&&a.push(t.classList.remove(n));return a}return t.className=t.className.replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," ")},e=function(t,e){var n,r,i,o,a;if(null!=t.classList){for(o=e.split(" "),a=[],r=0,i=o.length;i>r;r++)n=o[r],n.trim()&&a.push(t.classList.add(n));return a}return d(t,e),t.className+=" "+e},f=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},m=function(t,n,r){var i,o,a,s,u,c;for(o=0,s=r.length;s>o;o++)i=r[o],$.call(n,i)<0&&f(t,i)&&d(t,i);for(c=[],a=0,u=n.length;u>a;a++)i=n[a],f(t,i)?c.push(void 0):c.push(e(t,i));return c},r=[],n=function(t){return r.push(t)},o=function(){var t,e;for(e=[];t=r.pop();)e.push(t());return e},t=function(){function t(){}return t.prototype.on=function(t,e,n,r){var i;return null==r&&(r=!1),null==this.bindings&&(this.bindings={}),null==(i=this.bindings)[t]&&(i[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:r})},t.prototype.once=function(t,e,n){return this.on(t,e,n,!0)},t.prototype.off=function(t,e){var n,r,i;if(null!=(null!=(r=this.bindings)?r[t]:void 0)){if(null==e)return delete this.bindings[t];for(n=0,i=[];n=e&&e>=t-n},C=function(){var t,e,n,r,i;for(t=document.createElement("div"),i=["transform","webkitTransform","OTransform","MozTransform","msTransform"],n=0,r=i.length;r>n;n++)if(e=i[n],void 0!==t.style[e])return e}(),x=[],w=function(){var t,e,n;for(e=0,n=x.length;n>e;e++)t=x[e],t.position(!1);return l()},g=function(){var t;return null!=(t="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?t:+new Date},function(){var t,e,n,r,i,o,a,s,u;for(e=null,n=null,r=null,i=function(){if(null!=n&&n>16)return n=Math.min(n-16,250),void(r=setTimeout(i,250));if(!(null!=e&&g()-e<10))return null!=r&&(clearTimeout(r),r=null),e=g(),w(),n=g()-e},s=["resize","scroll","touchmove"],u=[],o=0,a=s.length;a>o;o++)t=s[o],u.push(window.addEventListener(t,i));return u}(),t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},n={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},s=function(n,r){var i,o;return i=n.left,o=n.top,"auto"===i&&(i=t[r.left]),"auto"===o&&(o=e[r.top]),{left:i,top:o}},a=function(t){var e,r;return{left:null!=(e=n[t.left])?e:t.left,top:null!=(r=n[t.top])?r:t.top}},o=function(){var t,e,n,r,i,o,a;for(e=1<=arguments.length?T.call(arguments,0):[],n={top:0,left:0},i=0,o=e.length;o>i;i++)a=e[i],r=a.top,t=a.left,"string"==typeof r&&(r=parseFloat(r,10)),"string"==typeof t&&(t=parseFloat(t,10)),n.top+=r,n.left+=t;return n},$=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},y=b=function(t){var e,n,r;return r=t.split(" "),n=r[0],e=r[1],{top:n,left:e}},A=function(){function t(t){this.position=O(this.position,this);var e,n,i,o,a;for(x.push(this),this.history=[],this.setOptions(t,!1),o=r.modules,n=0,i=o.length;i>n;n++)e=o[n],null!=(a=e.initialize)&&a.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,n;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(n=this.options.classes)?n[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var n,r,o,a,s,u;for(this.options=t,null==e&&(e=!0),n={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=c(n,this.options),s=this.options,this.element=s.element,this.target=s.target,this.targetModifier=s.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),u=["element","target"],o=0,a=u.length;a>o;o++){if(r=u[o],null==this[r])throw new Error("Tether Error: Both element and target must be defined");null!=this[r].jquery?this[r]=this[r][0]:"string"==typeof this[r]&&(this[r]=document.querySelector(this[r]))}if(i(this.element,this.getClass("element")),i(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=y(this.options.targetAttachment),this.attachment=y(this.options.attachment),this.offset=b(this.options.offset),this.targetOffset=b(this.options.targetOffset),null!=this.scrollParent&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParent=this.target:this.scrollParent=m(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){var t,e,n,r,i,o,a,s,u;if(null==this.targetModifier)return f(this.target);switch(this.targetModifier){case"visible":return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=f(this.target),i={height:t.height,width:t.width,top:t.top,left:t.left},i.height=Math.min(i.height,t.height-(pageYOffset-t.top)),i.height=Math.min(i.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),i.height=Math.min(innerHeight,i.height),i.height-=2,i.width=Math.min(i.width,t.width-(pageXOffset-t.left)),i.width=Math.min(i.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),i.width=Math.min(innerWidth,i.width),i.width-=2,i.topu.clientWidth||"scroll"===[s.overflow,s.overflowX]||this.target!==document.body,o=0,n&&(o=15),r=t.height-parseFloat(s.borderTopWidth)-parseFloat(s.borderBottomWidth)-o,i={width:15,height:.975*r*(r/u.scrollHeight),left:t.left+t.width-parseFloat(s.borderLeftWidth)-15},e=0,408>r&&this.target===document.body&&(e=-11e-5*Math.pow(r,2)-.00727*r+22.58),this.target!==document.body&&(i.height=Math.max(i.height,24)),a=this.target.scrollTop/(u.scrollHeight-r),i.top=a*(r-i.height-e)+t.top+parseFloat(s.borderTopWidth),this.target===document.body&&(i.height=Math.max(i.height,24)),i}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),i(this.target,this.getClass("enabled")),i(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return _(this.target,this.getClass("enabled")),_(this.element,this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,n,r,i;for(this.disable(),i=[],t=n=0,r=x.length;r>n;t=++n){if(e=x[t],e===this){x.splice(t,1);break}i.push(void 0)}return i},t.prototype.updateAttachClasses=function(t,e){var n,r,i,o,a,s,c,l,f,h=this;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),o=["left","top","bottom","right","middle","center"],(null!=(f=this._addAttachClasses)?f.length:void 0)&&this._addAttachClasses.splice(0,this._addAttachClasses.length),n=null!=this._addAttachClasses?this._addAttachClasses:this._addAttachClasses=[],t.top&&n.push(""+this.getClass("element-attached")+"-"+t.top),t.left&&n.push(""+this.getClass("element-attached")+"-"+t.left),e.top&&n.push(""+this.getClass("target-attached")+"-"+e.top),e.left&&n.push(""+this.getClass("target-attached")+"-"+e.left),r=[],a=0,c=o.length;c>a;a++)i=o[a],r.push(""+this.getClass("element-attached")+"-"+i);for(s=0,l=o.length;l>s;s++)i=o[s],r.push(""+this.getClass("target-attached")+"-"+i);return u(function(){return null!=h._addAttachClasses?(E(h.element,h._addAttachClasses,r),E(h.target,h._addAttachClasses,r),h._addAttachClasses=void 0):void 0})},t.prototype.position=function(t){var e,n,i,u,c,d,m,v,g,y,b,w,_,x,C,E,k,A,S,T,O,I,z,M,D,j,N,R,P,F,B,L,U,V,q,H=this;if(null==t&&(t=!0),this.enabled){for(this.clearCache(),T=s(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,T),e=this.cache("element-bounds",function(){return f(H.element)}),D=e.width,i=e.height,0===D&&0===i&&null!=this.lastSize?(F=this.lastSize,D=F.width,i=F.height):this.lastSize={width:D,height:i},z=I=this.cache("target-bounds",function(){return H.getTargetBounds()}),g=$(a(this.attachment),{width:D,height:i}),O=$(a(T),z),c=$(this.offset,{width:D,height:i}),d=$(this.targetOffset,z),g=o(g,c),O=o(O,d),u=I.left+O.left-g.left,M=I.top+O.top-g.top,B=r.modules,j=0,R=B.length;R>j;j++)if(m=B[j],C=m.position.call(this,{left:u,top:M,targetAttachment:T,targetPos:I,attachment:this.attachment,elementPos:e,offset:g,targetOffset:O,manualOffset:c,manualTargetOffset:d,scrollbarSize:A}),null!=C&&"object"==typeof C){if(C===!1)return!1;M=C.top,u=C.left}if(v={page:{top:M,left:u},viewport:{top:M-pageYOffset,bottom:pageYOffset-M-i+innerHeight,left:u-pageXOffset,right:pageXOffset-u-D+innerWidth}},document.body.scrollWidth>window.innerWidth&&(A=this.cache("scrollbar-size",p),v.viewport.bottom-=A.height),document.body.scrollHeight>window.innerHeight&&(A=this.cache("scrollbar-size",p),v.viewport.right-=A.width),(""!==(L=document.body.style.position)&&"static"!==L||""!==(U=document.body.parentElement.style.position)&&"static"!==U)&&(v.page.bottom=document.body.scrollHeight-M-i,v.page.right=document.body.scrollWidth-u-D),(null!=(V=this.options.optimizations)?V.moveElement:void 0)!==!1&&null==this.targetModifier){for(b=this.cache("target-offsetparent",function(){return h(H.target)}),x=this.cache("target-offsetparent-bounds",function(){return f(b)}),_=getComputedStyle(b),n=getComputedStyle(this.element),w=x,y={},q=["Top","Left","Bottom","Right"],N=0,P=q.length;P>N;N++)S=q[N],y[S.toLowerCase()]=parseFloat(_["border"+S+"Width"]);x.right=document.body.scrollWidth-x.left-w.width+y.right,x.bottom=document.body.scrollHeight-x.top-w.height+y.bottom,v.page.top>=x.top+y.top&&v.page.bottom>=x.bottom&&v.page.left>=x.left+y.left&&v.page.right>=x.right&&(k=b.scrollTop,E=b.scrollLeft,v.offset={top:v.page.top-x.top+k-y.top,left:v.page.left-x.left+E-y.left})}return this.move(v),this.history.unshift(v),this.history.length>3&&this.history.pop(),t&&l(),!0}},t.prototype.move=function(t){var e,n,r,i,o,a,s,l,f,d,p,m,v,g,$,y,b,w=this;if(null!=this.element.parentNode){l={};for(d in t){l[d]={};for(i in t[d]){for(r=!1,y=this.history,g=0,$=y.length;$>g;g++)if(s=y[g],!k(null!=(b=s[d])?b[i]:void 0,t[d][i])){r=!0;break}r||(l[d][i]=!0)}}e={top:"",left:"",right:"",bottom:""},f=function(t,n){var r,i,o;return(null!=(o=w.options.optimizations)?o.gpu:void 0)===!1?(t.top?e.top=""+n.top+"px":e.bottom=""+n.bottom+"px",t.left?e.left=""+n.left+"px":e.right=""+n.right+"px"):(t.top?(e.top=0,i=n.top):(e.bottom=0,i=-n.bottom),t.left?(e.left=0,r=n.left):(e.right=0,r=-n.right),e[C]="translateX("+Math.round(r)+"px) translateY("+Math.round(i)+"px)","msTransform"!==C?e[C]+=" translateZ(0)":void 0)},o=!1,(l.page.top||l.page.bottom)&&(l.page.left||l.page.right)?(e.position="absolute",f(l.page,t.page)):(l.viewport.top||l.viewport.bottom)&&(l.viewport.left||l.viewport.right)?(e.position="fixed",f(l.viewport,t.viewport)):null!=l.offset&&l.offset.top&&l.offset.left?(e.position="absolute",a=this.cache("target-offsetparent",function(){return h(w.target)}),h(this.element)!==a&&u(function(){return w.element.parentNode.removeChild(w.element),a.appendChild(w.element)}),f(l.offset,t.offset),o=!0):(e.position="absolute",f({top:!0,left:!0},t.page)),o||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),v={},m=!1;for(i in e)p=e[i],n=this.element.style[i],""===n||""===p||"top"!==i&&"left"!==i&&"bottom"!==i&&"right"!==i||(n=parseFloat(n),p=parseFloat(p)),n!==p&&(m=!0,v[i]=e[i]);return m?u(function(){return c(w.element.style,v)}):void 0}},t}(),r.position=w,this.Tether=c(A,r)}.call(this),function(){var t,e,n,r,i,o,a,s,u,c,l=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};c=this.Tether.Utils,a=c.getOuterSize,o=c.getBounds,s=c.getSize,r=c.extend,u=c.updateClasses,n=c.defer,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],i=function(e,n){var r,i,a,s,u,c,l;if("scrollParent"===n?n=e.scrollParent:"window"===n&&(n=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),n===document&&(n=n.documentElement),null!=n.nodeType)for(i=s=o(n),u=getComputedStyle(n),n=[i.left,i.top,s.width+i.left,s.height+i.top],r=c=0,l=t.length;l>c;r=++c)a=t[r],a=a[0].toUpperCase()+a.substr(1),"Top"===a||"Left"===a?n[r]+=parseFloat(u["border"+a+"Width"]):n[r]-=parseFloat(u["border"+a+"Width"]);return n},this.Tether.modules.push({position:function(e){var a,s,c,f,h,d,p,m,v,g,$,y,b,w,_,x,C,E,k,A,S,T,O,I,z,M,D,j,N,R,P,F,B,L,U,V,q,H,W,X,Y,Z,G,K,J,Q,tt,et=this;if(M=e.top,$=e.left,S=e.targetAttachment,!this.options.constraints)return!0;for(E=function(e){var n,r,i,o;for(et.removeClass(e),o=[],r=0,i=t.length;i>r;r++)n=t[r],o.push(et.removeClass(""+e+"-"+n));return o},X=this.cache("element-bounds",function(){return o(et.element)}),g=X.height,D=X.width,0===D&&0===g&&null!=this.lastSize&&(Y=this.lastSize,D=Y.width,g=Y.height),O=this.cache("target-bounds",function(){return et.getTargetBounds()}),T=O.height,I=O.width,A={},v={},s=[this.getClass("pinned"),this.getClass("out-of-bounds")],Z=this.options.constraints,j=0,F=Z.length;F>j;j++)m=Z[j],m.outOfBoundsClass&&s.push(m.outOfBoundsClass),m.pinnedClass&&s.push(m.pinnedClass);for(N=0,B=s.length;B>N;N++)for(p=s[N],G=["left","top","right","bottom"],R=0,L=G.length;L>R;R++)k=G[R],s.push(""+p+"-"+k);for(a=[],A=r({},S),v=r({},this.attachment),K=this.options.constraints,P=0,U=K.length;U>P;P++){if(m=K[P],z=m.to,c=m.attachment,_=m.pin,null==c&&(c=""),l.call(c," ")>=0?(J=c.split(" "),d=J[0],h=J[1]):h=d=c,f=i(this,z),("target"===d||"both"===d)&&(Mf[3]&&"bottom"===A.top&&(M-=T,A.top="top")),"together"===d&&(Mf[3]&&"bottom"===A.top&&("top"===v.top?(M-=T,A.top="top",M-=g,v.top="bottom"):"bottom"===v.top&&(M-=T,A.top="top",M+=g,v.top="top")),"middle"===A.top&&(M+g>f[3]&&"top"===v.top?(M-=g,v.top="bottom"):Mf[2]&&"right"===A.left&&($-=I,A.left="left")),"together"===h&&($f[2]&&"right"===A.left?"left"===v.left?($-=I,A.left="left",$-=D,v.left="right"):"right"===v.left&&($-=I,A.left="left",$+=D,v.left="left"):"center"===A.left&&($+D>f[2]&&"left"===v.left?($-=D,v.left="right"):$f[3]&&"top"===v.top&&(M-=g,v.top="bottom")),("element"===h||"both"===h)&&($f[2]&&"left"===v.left&&($-=D,v.left="right")),"string"==typeof _?_=function(){var t,e,n,r;for(n=_.split(","),r=[],e=0,t=n.length;t>e;e++)w=n[e],r.push(w.trim());return r}():_===!0&&(_=["top","left","right","bottom"]),_||(_=[]),x=[],y=[],M=0?(M=f[1],x.push("top")):y.push("top")),M+g>f[3]&&(l.call(_,"bottom")>=0?(M=f[3]-g,x.push("bottom")):y.push("bottom")),$=0?($=f[0],x.push("left")):y.push("left")),$+D>f[2]&&(l.call(_,"right")>=0?($=f[2]-D,x.push("right")):y.push("right")),x.length)for(C=null!=(Q=this.options.pinnedClass)?Q:this.getClass("pinned"),a.push(C),H=0,V=x.length;V>H;H++)k=x[H],a.push(""+C+"-"+k);if(y.length)for(b=null!=(tt=this.options.outOfBoundsClass)?tt:this.getClass("out-of-bounds"),a.push(b),W=0,q=y.length;q>W;W++)k=y[W],a.push(""+b+"-"+k);(l.call(x,"left")>=0||l.call(x,"right")>=0)&&(v.left=A.left=!1),(l.call(x,"top")>=0||l.call(x,"bottom")>=0)&&(v.top=A.top=!1),(A.top!==S.top||A.left!==S.left||v.top!==this.attachment.top||v.left!==this.attachment.left)&&this.updateAttachClasses(v,A)}return n(function(){return u(et.target,a,s),u(et.element,a,s)}),{top:M,left:$}}})}.call(this),function(){var t,e,n,r;r=this.Tether.Utils,e=r.getBounds,n=r.updateClasses,t=r.defer,this.Tether.modules.push({position:function(r){var i,o,a,s,u,c,l,f,h,d,p,m,v,g,$,y,b,w,_,x,C,E,k,A,S,T=this;if(p=r.top,c=r.left,C=this.cache("element-bounds",function(){return e(T.element)}),u=C.height,m=C.width,d=this.getTargetBounds(),s=p+u,l=c+m,i=[],p<=d.bottom&&s>=d.top)for(E=["left","right"],v=0,b=E.length;b>v;v++)f=E[v],((k=d[f])===c||k===l)&&i.push(f);if(c<=d.right&&l>=d.left)for(A=["top","bottom"],g=0,w=A.length;w>g;g++)f=A[g],((S=d[f])===p||S===s)&&i.push(f);for(a=[],o=[],h=["left","top","right","bottom"],a.push(this.getClass("abutted")),$=0,_=h.length;_>$;$++)f=h[$],a.push(""+this.getClass("abutted")+"-"+f);for(i.length&&o.push(this.getClass("abutted")),y=0,x=i.length;x>y;y++)f=i[y],o.push(""+this.getClass("abutted")+"-"+f);return t(function(){return n(T.target,o,a),n(T.element,o,a)}),!0}})}.call(this),function(){this.Tether.modules.push({position:function(t){var e,n,r,i,o,a,s;return a=t.top,e=t.left,this.options.shift?(n=function(t){return"function"==typeof t?t.call(this,{top:a,left:e}):t},r=n(this.options.shift),"string"==typeof r?(r=r.split(" "),r[1]||(r[1]=r[0]),o=r[0],i=r[1],o=parseFloat(o,10),i=parseFloat(i,10)):(s=[r.top,r.left],o=s[0],i=s[1]),a+=o,e+=i,{top:a,left:e}):void 0}})}.call(this),this.Tether}),function(t,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.viewportUnitsBuggyfillHacks=e()}(this,function(){"use strict";function t(t,o,u,c){if((e.contentHack||e.behaviorHack)&&("content"===u||"behavior"===u)){var l=e.contentHack&&!s&&"content"===u&&c.indexOf("use_css_content_hack")>-1,f=e.behaviorHack&&!a&&"behavior"===u&&c.indexOf("use_css_behavior_hack")>-1;if(l||f){var h=c.replace(r,"");f&&(h=h.replace(i,"")),h.split(";").forEach(function(e){var r=e.split(":");if(2===r.length){var i=r[0].trim(),a=r[1].trim();if("use_css_content_hack"!==i&&"use_css_behavior_hack"!==i&&(t.push([o,i,a]),n.test(a))){var s=a.replace(n,"-webkit-calc(");t.push([o,i,s])}}})}}}var e,n=/calc\(/g,r=/[\"\']/g,i=/url\([^\)]*\)/g,o=!1,a=!0,s=!0;return{required:function(t){return t.isMobileSafari||o},initialize:function(t){e=t;var n=document.createElement("div");n.style.width="1vmax",a=""!==n.style.width,e.isMobileSafari&&(s=!1)},initializeEvents:function(t,e,n){t.force||o&&!t._listeningToResize&&(window.addEventListener("resize",n,!0),t._listeningToResize=!0)},findDeclarations:function(e,n,r,i){null!==r&&t(e,n,r,i)},overwriteDeclaration:function(t,e,n){return o&&"filter"===e&&(n=n.replace(/px/g,"")),n}}}),function(t,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.viewportUnitsBuggyfill=e()}(this,function(){"use strict";function t(t,e){var n;return function(){var r=this,i=arguments,o=function(){t.apply(r,i)};clearTimeout(n),n=setTimeout(o,e)}}function e(){try{return window.self!==window.top}catch(t){return!0}}function n(n){y||(n===!0&&(n={force:!0}),m=n||{},m.isMobileSafari=b,(m.force||b||x||m.hacks&&m.hacks.required(m))&&(m.hacks&&m.hacks.initialize(m),y=!0,$=document.createElement("style"),$.id="patched-viewport",document.head.appendChild($),f(function(){var n=t(i,m.refreshDebounceWait||100);window.addEventListener("orientationchange",n,!0),window.addEventListener("pageshow",n,!0),(m.force||x||e())&&(window.addEventListener("resize",n,!0),m._listeningToResize=!0),m.hacks&&m.hacks.initializeEvents(m,i,n),i()})))}function r(){$.textContent=s()}function i(){y&&(o(),setTimeout(function(){r()},1))}function o(){return g=[],_.call(document.styleSheets,function(t){"patched-viewport"!==t.ownerNode.id&&t.cssRules&&(t.media&&t.media.mediaText&&window.matchMedia&&!window.matchMedia(t.media.mediaText).matches||_.call(t.cssRules,a)); +}),g}function a(t){if(7===t.type){var e=t.cssText;return w.lastIndex=0,void(w.test(e)&&(g.push([t,null,e]),m.hacks&&m.hacks.findDeclarations(g,t,null,e)))}if(!t.style){if(!t.cssRules)return;return void _.call(t.cssRules,function(t){a(t)})}_.call(t.style,function(e){var n=t.style.getPropertyValue(e);w.lastIndex=0,w.test(n)&&(g.push([t,e,n]),m.hacks&&m.hacks.findDeclarations(g,t,e,n))})}function s(){v=l();var t,e,n=[],r=[];return g.forEach(function(i){var o=u.apply(null,i),a=o.selector.length?o.selector.join(" {\n")+" {\n":"",s=new Array(o.selector.length+1).join("\n}");return a&&a===t?(a&&!t&&(t=a,e=s),void r.push(o.content)):(r.length&&(n.push(t+r.join("\n")+e),r.length=0),void(a?(t=a,e=s,r.push(o.content)):(n.push(o.content),t=null,e=null)))}),r.length&&n.push(t+r.join("\n")+e),n.join("\n\n")}function u(t,e,n){var r=n.replace(w,c),i=[];m.hacks&&(r=m.hacks.overwriteDeclaration(t,e,r)),e&&(i.push(t.selectorText),r=e+": "+r+";");for(var o=t.parentRule;o;)i.unshift("@media "+o.media.mediaText),o=o.parentRule;return{selector:i,content:r}}function c(t,e,n){var r=v[n],i=parseFloat(e)/100;return i*r+"px"}function l(){var t=window.innerHeight,e=window.innerWidth;return{vh:t,vw:e,vmax:Math.max(e,t),vmin:Math.min(e,t)}}function f(t){var e=0,n=function(){e--,e||t()};_.call(document.styleSheets,function(t){t.href&&h(t.href)!==h(location.href)&&(e++,d(t.ownerNode,n))}),e||t()}function h(t){return t.slice(0,t.indexOf("/",t.indexOf("://")+3))}function d(t,e){p(t.href,function(){var n=document.createElement("style");n.media=t.media,n.setAttribute("data-href",t.href),n.textContent=this.responseText,t.parentNode.replaceChild(n,t),e()},e)}function p(t,e,n){var r=new XMLHttpRequest;if("withCredentials"in r)r.open("GET",t,!0);else{if("undefined"==typeof XDomainRequest)throw new Error("cross-domain XHR not supported");r=new XDomainRequest,r.open("GET",t)}return r.onload=e,r.onerror=n,r.send(),r}var m,v,g,$,y=!1,b=/(iPhone|iPod|iPad).+AppleWebKit/i.test(window.navigator.userAgent),w=/([+-]?[0-9.]+)(vh|vw|vmin|vmax)/g,_=[].forEach,x=!1;return{version:"0.4.1",findProperties:o,getCss:s,init:n,refresh:i}}); \ No newline at end of file diff --git a/afb-client/dist.prod/favicon.ico b/afb-client/dist.prod/favicon.ico new file mode 100644 index 0000000..eeb7ab7 Binary files /dev/null and b/afb-client/dist.prod/favicon.ico differ diff --git a/afb-client/dist.prod/global_styles/foundation-conf.min.css b/afb-client/dist.prod/global_styles/foundation-conf.min.css new file mode 100644 index 0000000..076aa73 --- /dev/null +++ b/afb-client/dist.prod/global_styles/foundation-conf.min.css @@ -0,0 +1,2 @@ +.block-list li>span,button[disabled],html input[disabled]{cursor:default}body,sub,sup{position:relative}.block-list .with-dropdown select,select{-webkit-appearance:none;-moz-appearance:none}h1,h2,h3,h4,h5,h6,p{text-rendering:optimizeLegibility}.action-sheet ul,.action-sheet.dark ul,.action-sheet.primary ul,.block-list,.block-list ul,.button-group,.inline-list,.menu-bar,.small-up-1,.small-up-10,.small-up-11,.small-up-12,.small-up-2,.small-up-3,.small-up-4,.small-up-6,.small-up-7,.small-up-8,.small-up-9,ul.no-bullet,ul.no-bullet li ol,ul.no-bullet li ul{list-style-type:none}.notification-icon,.v-align .align-top{align-self:flex-start}.clearfix:after,hr{clear:both}@font-face{font-family:foundation-icons;src:url(/bower_components/foundation-icons.woff) format("woff");font-weight:400;font-style:normal}.fi-address-book:before,.fi-alert:before,.fi-align-center:before,.fi-align-justify:before,.fi-align-left:before,.fi-align-right:before,.fi-anchor:before,.fi-annotate:before,.fi-archive:before,.fi-arrow-down:before,.fi-arrow-left:before,.fi-arrow-right:before,.fi-arrow-up:before,.fi-arrows-compress:before,.fi-arrows-expand:before,.fi-arrows-in:before,.fi-arrows-out:before,.fi-asl:before,.fi-asterisk:before,.fi-at-sign:before,.fi-background-color:before,.fi-battery-empty:before,.fi-battery-full:before,.fi-battery-half:before,.fi-bitcoin-circle:before,.fi-bitcoin:before,.fi-blind:before,.fi-bluetooth:before,.fi-bold:before,.fi-book-bookmark:before,.fi-book:before,.fi-bookmark:before,.fi-braille:before,.fi-burst-new:before,.fi-burst-sale:before,.fi-burst:before,.fi-calendar:before,.fi-camera:before,.fi-check:before,.fi-checkbox:before,.fi-clipboard-notes:before,.fi-clipboard-pencil:before,.fi-clipboard:before,.fi-clock:before,.fi-closed-caption:before,.fi-cloud:before,.fi-comment-minus:before,.fi-comment-quotes:before,.fi-comment-video:before,.fi-comment:before,.fi-comments:before,.fi-compass:before,.fi-contrast:before,.fi-credit-card:before,.fi-crop:before,.fi-crown:before,.fi-css3:before,.fi-database:before,.fi-die-five:before,.fi-die-four:before,.fi-die-one:before,.fi-die-six:before,.fi-die-three:before,.fi-die-two:before,.fi-dislike:before,.fi-dollar-bill:before,.fi-dollar:before,.fi-download:before,.fi-eject:before,.fi-elevator:before,.fi-euro:before,.fi-eye:before,.fi-fast-forward:before,.fi-female-symbol:before,.fi-female:before,.fi-filter:before,.fi-first-aid:before,.fi-flag:before,.fi-folder-add:before,.fi-folder-lock:before,.fi-folder:before,.fi-foot:before,.fi-foundation:before,.fi-graph-bar:before,.fi-graph-horizontal:before,.fi-graph-pie:before,.fi-graph-trend:before,.fi-guide-dog:before,.fi-hearing-aid:before,.fi-heart:before,.fi-home:before,.fi-html5:before,.fi-indent-less:before,.fi-indent-more:before,.fi-info:before,.fi-italic:before,.fi-key:before,.fi-laptop:before,.fi-layout:before,.fi-lightbulb:before,.fi-like:before,.fi-link:before,.fi-list-bullet:before,.fi-list-number:before,.fi-list-thumbnails:before,.fi-list:before,.fi-lock:before,.fi-loop:before,.fi-magnifying-glass:before,.fi-mail:before,.fi-male-female:before,.fi-male-symbol:before,.fi-male:before,.fi-map:before,.fi-marker:before,.fi-megaphone:before,.fi-microphone:before,.fi-minus-circle:before,.fi-minus:before,.fi-mobile-signal:before,.fi-mobile:before,.fi-monitor:before,.fi-mountains:before,.fi-music:before,.fi-next:before,.fi-no-dogs:before,.fi-no-smoking:before,.fi-page-add:before,.fi-page-copy:before,.fi-page-csv:before,.fi-page-delete:before,.fi-page-doc:before,.fi-page-edit:before,.fi-page-export-csv:before,.fi-page-export-doc:before,.fi-page-export-pdf:before,.fi-page-export:before,.fi-page-filled:before,.fi-page-multiple:before,.fi-page-pdf:before,.fi-page-remove:before,.fi-page-search:before,.fi-page:before,.fi-paint-bucket:before,.fi-paperclip:before,.fi-pause:before,.fi-paw:before,.fi-paypal:before,.fi-pencil:before,.fi-photo:before,.fi-play-circle:before,.fi-play-video:before,.fi-play:before,.fi-plus:before,.fi-pound:before,.fi-power:before,.fi-previous:before,.fi-price-tag:before,.fi-pricetag-multiple:before,.fi-print:before,.fi-prohibited:before,.fi-projection-screen:before,.fi-puzzle:before,.fi-quote:before,.fi-record:before,.fi-refresh:before,.fi-results-demographics:before,.fi-results:before,.fi-rewind-ten:before,.fi-rewind:before,.fi-rss:before,.fi-safety-cone:before,.fi-save:before,.fi-share:before,.fi-sheriff-badge:before,.fi-shield:before,.fi-shopping-bag:before,.fi-shopping-cart:before,.fi-shuffle:before,.fi-skull:before,.fi-social-500px:before,.fi-social-adobe:before,.fi-social-amazon:before,.fi-social-android:before,.fi-social-apple:before,.fi-social-behance:before,.fi-social-bing:before,.fi-social-blogger:before,.fi-social-delicious:before,.fi-social-designer-news:before,.fi-social-deviant-art:before,.fi-social-digg:before,.fi-social-dribbble:before,.fi-social-drive:before,.fi-social-dropbox:before,.fi-social-evernote:before,.fi-social-facebook:before,.fi-social-flickr:before,.fi-social-forrst:before,.fi-social-foursquare:before,.fi-social-game-center:before,.fi-social-github:before,.fi-social-google-plus:before,.fi-social-hacker-news:before,.fi-social-hi5:before,.fi-social-instagram:before,.fi-social-joomla:before,.fi-social-lastfm:before,.fi-social-linkedin:before,.fi-social-medium:before,.fi-social-myspace:before,.fi-social-orkut:before,.fi-social-path:before,.fi-social-picasa:before,.fi-social-pinterest:before,.fi-social-rdio:before,.fi-social-reddit:before,.fi-social-skillshare:before,.fi-social-skype:before,.fi-social-smashing-mag:before,.fi-social-snapchat:before,.fi-social-spotify:before,.fi-social-squidoo:before,.fi-social-stack-overflow:before,.fi-social-steam:before,.fi-social-stumbleupon:before,.fi-social-treehouse:before,.fi-social-tumblr:before,.fi-social-twitter:before,.fi-social-vimeo:before,.fi-social-windows:before,.fi-social-xbox:before,.fi-social-yahoo:before,.fi-social-yelp:before,.fi-social-youtube:before,.fi-social-zerply:before,.fi-social-zurb:before,.fi-sound:before,.fi-star:before,.fi-stop:before,.fi-strikethrough:before,.fi-subscript:before,.fi-superscript:before,.fi-tablet-landscape:before,.fi-tablet-portrait:before,.fi-target-two:before,.fi-target:before,.fi-telephone-accessible:before,.fi-telephone:before,.fi-text-color:before,.fi-thumbnails:before,.fi-ticket:before,.fi-torso-business:before,.fi-torso-female:before,.fi-torso:before,.fi-torsos-all-female:before,.fi-torsos-all:before,.fi-torsos-female-male:before,.fi-torsos-male-female:before,.fi-torsos:before,.fi-trash:before,.fi-trees:before,.fi-trophy:before,.fi-underline:before,.fi-universal-access:before,.fi-unlink:before,.fi-unlock:before,.fi-upload-cloud:before,.fi-upload:before,.fi-usb:before,.fi-video:before,.fi-volume-none:before,.fi-volume-strike:before,.fi-volume:before,.fi-web:before,.fi-wheelchair:before,.fi-widget:before,.fi-wrench:before,.fi-x-circle:before,.fi-x:before,.fi-yen:before,.fi-zoom-in:before,.fi-zoom-out:before{font-family:foundation-icons;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;display:inline-block;text-decoration:inherit}.block-list header,.menu-bar>li.title,.title-bar .title,b,optgroup,strong{font-weight:700}.fi-address-book:before{content:"\f100"}.fi-alert:before{content:"\f101"}.fi-align-center:before{content:"\f102"}.fi-align-justify:before{content:"\f103"}.fi-align-left:before{content:"\f104"}.fi-align-right:before{content:"\f105"}.fi-anchor:before{content:"\f106"}.fi-annotate:before{content:"\f107"}.fi-archive:before{content:"\f108"}.fi-arrow-down:before{content:"\f109"}.fi-arrow-left:before{content:"\f10a"}.fi-arrow-right:before{content:"\f10b"}.fi-arrow-up:before{content:"\f10c"}.fi-arrows-compress:before{content:"\f10d"}.fi-arrows-expand:before{content:"\f10e"}.fi-arrows-in:before{content:"\f10f"}.fi-arrows-out:before{content:"\f110"}.fi-asl:before{content:"\f111"}.fi-asterisk:before{content:"\f112"}.fi-at-sign:before{content:"\f113"}.fi-background-color:before{content:"\f114"}.fi-battery-empty:before{content:"\f115"}.fi-battery-full:before{content:"\f116"}.fi-battery-half:before{content:"\f117"}.fi-bitcoin-circle:before{content:"\f118"}.fi-bitcoin:before{content:"\f119"}.fi-blind:before{content:"\f11a"}.fi-bluetooth:before{content:"\f11b"}.fi-bold:before{content:"\f11c"}.fi-book-bookmark:before{content:"\f11d"}.fi-book:before{content:"\f11e"}.fi-bookmark:before{content:"\f11f"}.fi-braille:before{content:"\f120"}.fi-burst-new:before{content:"\f121"}.fi-burst-sale:before{content:"\f122"}.fi-burst:before{content:"\f123"}.fi-calendar:before{content:"\f124"}.fi-camera:before{content:"\f125"}.fi-check:before{content:"\f126"}.fi-checkbox:before{content:"\f127"}.fi-clipboard-notes:before{content:"\f128"}.fi-clipboard-pencil:before{content:"\f129"}.fi-clipboard:before{content:"\f12a"}.fi-clock:before{content:"\f12b"}.fi-closed-caption:before{content:"\f12c"}.fi-cloud:before{content:"\f12d"}.fi-comment-minus:before{content:"\f12e"}.fi-comment-quotes:before{content:"\f12f"}.fi-comment-video:before{content:"\f130"}.fi-comment:before{content:"\f131"}.fi-comments:before{content:"\f132"}.fi-compass:before{content:"\f133"}.fi-contrast:before{content:"\f134"}.fi-credit-card:before{content:"\f135"}.fi-crop:before{content:"\f136"}.fi-crown:before{content:"\f137"}.fi-css3:before{content:"\f138"}.fi-database:before{content:"\f139"}.fi-die-five:before{content:"\f13a"}.fi-die-four:before{content:"\f13b"}.fi-die-one:before{content:"\f13c"}.fi-die-six:before{content:"\f13d"}.fi-die-three:before{content:"\f13e"}.fi-die-two:before{content:"\f13f"}.fi-dislike:before{content:"\f140"}.fi-dollar-bill:before{content:"\f141"}.fi-dollar:before{content:"\f142"}.fi-download:before{content:"\f143"}.fi-eject:before{content:"\f144"}.fi-elevator:before{content:"\f145"}.fi-euro:before{content:"\f146"}.fi-eye:before{content:"\f147"}.fi-fast-forward:before{content:"\f148"}.fi-female-symbol:before{content:"\f149"}.fi-female:before{content:"\f14a"}.fi-filter:before{content:"\f14b"}.fi-first-aid:before{content:"\f14c"}.fi-flag:before{content:"\f14d"}.fi-folder-add:before{content:"\f14e"}.fi-folder-lock:before{content:"\f14f"}.fi-folder:before{content:"\f150"}.fi-foot:before{content:"\f151"}.fi-foundation:before{content:"\f152"}.fi-graph-bar:before{content:"\f153"}.fi-graph-horizontal:before{content:"\f154"}.fi-graph-pie:before{content:"\f155"}.fi-graph-trend:before{content:"\f156"}.fi-guide-dog:before{content:"\f157"}.fi-hearing-aid:before{content:"\f158"}.fi-heart:before{content:"\f159"}.fi-home:before{content:"\f15a"}.fi-html5:before{content:"\f15b"}.fi-indent-less:before{content:"\f15c"}.fi-indent-more:before{content:"\f15d"}.fi-info:before{content:"\f15e"}.fi-italic:before{content:"\f15f"}.fi-key:before{content:"\f160"}.fi-laptop:before{content:"\f161"}.fi-layout:before{content:"\f162"}.fi-lightbulb:before{content:"\f163"}.fi-like:before{content:"\f164"}.fi-link:before{content:"\f165"}.fi-list-bullet:before{content:"\f166"}.fi-list-number:before{content:"\f167"}.fi-list-thumbnails:before{content:"\f168"}.fi-list:before{content:"\f169"}.fi-lock:before{content:"\f16a"}.fi-loop:before{content:"\f16b"}.fi-magnifying-glass:before{content:"\f16c"}.fi-mail:before{content:"\f16d"}.fi-male-female:before{content:"\f16e"}.fi-male-symbol:before{content:"\f16f"}.fi-male:before{content:"\f170"}.fi-map:before{content:"\f171"}.fi-marker:before{content:"\f172"}.fi-megaphone:before{content:"\f173"}.fi-microphone:before{content:"\f174"}.fi-minus-circle:before{content:"\f175"}.fi-minus:before{content:"\f176"}.fi-mobile-signal:before{content:"\f177"}.fi-mobile:before{content:"\f178"}.fi-monitor:before{content:"\f179"}.fi-mountains:before{content:"\f17a"}.fi-music:before{content:"\f17b"}.fi-next:before{content:"\f17c"}.fi-no-dogs:before{content:"\f17d"}.fi-no-smoking:before{content:"\f17e"}.fi-page-add:before{content:"\f17f"}.fi-page-copy:before{content:"\f180"}.fi-page-csv:before{content:"\f181"}.fi-page-delete:before{content:"\f182"}.fi-page-doc:before{content:"\f183"}.fi-page-edit:before{content:"\f184"}.fi-page-export-csv:before{content:"\f185"}.fi-page-export-doc:before{content:"\f186"}.fi-page-export-pdf:before{content:"\f187"}.fi-page-export:before{content:"\f188"}.fi-page-filled:before{content:"\f189"}.fi-page-multiple:before{content:"\f18a"}.fi-page-pdf:before{content:"\f18b"}.fi-page-remove:before{content:"\f18c"}.fi-page-search:before{content:"\f18d"}.fi-page:before{content:"\f18e"}.fi-paint-bucket:before{content:"\f18f"}.fi-paperclip:before{content:"\f190"}.fi-pause:before{content:"\f191"}.fi-paw:before{content:"\f192"}.fi-paypal:before{content:"\f193"}.fi-pencil:before{content:"\f194"}.fi-photo:before{content:"\f195"}.fi-play-circle:before{content:"\f196"}.fi-play-video:before{content:"\f197"}.fi-play:before{content:"\f198"}.fi-plus:before{content:"\f199"}.fi-pound:before{content:"\f19a"}.fi-power:before{content:"\f19b"}.fi-previous:before{content:"\f19c"}.fi-price-tag:before{content:"\f19d"}.fi-pricetag-multiple:before{content:"\f19e"}.fi-print:before{content:"\f19f"}.fi-prohibited:before{content:"\f1a0"}.fi-projection-screen:before{content:"\f1a1"}.fi-puzzle:before{content:"\f1a2"}.fi-quote:before{content:"\f1a3"}.fi-record:before{content:"\f1a4"}.fi-refresh:before{content:"\f1a5"}.fi-results-demographics:before{content:"\f1a6"}.fi-results:before{content:"\f1a7"}.fi-rewind-ten:before{content:"\f1a8"}.fi-rewind:before{content:"\f1a9"}.fi-rss:before{content:"\f1aa"}.fi-safety-cone:before{content:"\f1ab"}.fi-save:before{content:"\f1ac"}.fi-share:before{content:"\f1ad"}.fi-sheriff-badge:before{content:"\f1ae"}.fi-shield:before{content:"\f1af"}.fi-shopping-bag:before{content:"\f1b0"}.fi-shopping-cart:before{content:"\f1b1"}.fi-shuffle:before{content:"\f1b2"}.fi-skull:before{content:"\f1b3"}.fi-social-500px:before{content:"\f1b4"}.fi-social-adobe:before{content:"\f1b5"}.fi-social-amazon:before{content:"\f1b6"}.fi-social-android:before{content:"\f1b7"}.fi-social-apple:before{content:"\f1b8"}.fi-social-behance:before{content:"\f1b9"}.fi-social-bing:before{content:"\f1ba"}.fi-social-blogger:before{content:"\f1bb"}.fi-social-delicious:before{content:"\f1bc"}.fi-social-designer-news:before{content:"\f1bd"}.fi-social-deviant-art:before{content:"\f1be"}.fi-social-digg:before{content:"\f1bf"}.fi-social-dribbble:before{content:"\f1c0"}.fi-social-drive:before{content:"\f1c1"}.fi-social-dropbox:before{content:"\f1c2"}.fi-social-evernote:before{content:"\f1c3"}.fi-social-facebook:before{content:"\f1c4"}.fi-social-flickr:before{content:"\f1c5"}.fi-social-forrst:before{content:"\f1c6"}.fi-social-foursquare:before{content:"\f1c7"}.fi-social-game-center:before{content:"\f1c8"}.fi-social-github:before{content:"\f1c9"}.fi-social-google-plus:before{content:"\f1ca"}.fi-social-hacker-news:before{content:"\f1cb"}.fi-social-hi5:before{content:"\f1cc"}.fi-social-instagram:before{content:"\f1cd"}.fi-social-joomla:before{content:"\f1ce"}.fi-social-lastfm:before{content:"\f1cf"}.fi-social-linkedin:before{content:"\f1d0"}.fi-social-medium:before{content:"\f1d1"}.fi-social-myspace:before{content:"\f1d2"}.fi-social-orkut:before{content:"\f1d3"}.fi-social-path:before{content:"\f1d4"}.fi-social-picasa:before{content:"\f1d5"}.fi-social-pinterest:before{content:"\f1d6"}.fi-social-rdio:before{content:"\f1d7"}.fi-social-reddit:before{content:"\f1d8"}.fi-social-skillshare:before{content:"\f1d9"}.fi-social-skype:before{content:"\f1da"}.fi-social-smashing-mag:before{content:"\f1db"}.fi-social-snapchat:before{content:"\f1dc"}.fi-social-spotify:before{content:"\f1dd"}.fi-social-squidoo:before{content:"\f1de"}.fi-social-stack-overflow:before{content:"\f1df"}.fi-social-steam:before{content:"\f1e0"}.fi-social-stumbleupon:before{content:"\f1e1"}.fi-social-treehouse:before{content:"\f1e2"}.fi-social-tumblr:before{content:"\f1e3"}.fi-social-twitter:before{content:"\f1e4"}.fi-social-vimeo:before{content:"\f1e5"}.fi-social-windows:before{content:"\f1e6"}.fi-social-xbox:before{content:"\f1e7"}.fi-social-yahoo:before{content:"\f1e8"}.fi-social-yelp:before{content:"\f1e9"}.fi-social-youtube:before{content:"\f1ea"}.fi-social-zerply:before{content:"\f1eb"}.fi-social-zurb:before{content:"\f1ec"}.fi-sound:before{content:"\f1ed"}.fi-star:before{content:"\f1ee"}.fi-stop:before{content:"\f1ef"}.fi-strikethrough:before{content:"\f1f0"}.fi-subscript:before{content:"\f1f1"}.fi-superscript:before{content:"\f1f2"}.fi-tablet-landscape:before{content:"\f1f3"}.fi-tablet-portrait:before{content:"\f1f4"}.fi-target-two:before{content:"\f1f5"}.fi-target:before{content:"\f1f6"}.fi-telephone-accessible:before{content:"\f1f7"}.fi-telephone:before{content:"\f1f8"}.fi-text-color:before{content:"\f1f9"}.fi-thumbnails:before{content:"\f1fa"}.fi-ticket:before{content:"\f1fb"}.fi-torso-business:before{content:"\f1fc"}.fi-torso-female:before{content:"\f1fd"}.fi-torso:before{content:"\f1fe"}.fi-torsos-all-female:before{content:"\f1ff"}.fi-torsos-all:before{content:"\f200"}.fi-torsos-female-male:before{content:"\f201"}.fi-torsos-male-female:before{content:"\f202"}.fi-torsos:before{content:"\f203"}.fi-trash:before{content:"\f204"}.fi-trees:before{content:"\f205"}.fi-trophy:before{content:"\f206"}.fi-underline:before{content:"\f207"}.fi-universal-access:before{content:"\f208"}.fi-unlink:before{content:"\f209"}.fi-unlock:before{content:"\f20a"}.fi-upload-cloud:before{content:"\f20b"}.fi-upload:before{content:"\f20c"}.fi-usb:before{content:"\f20d"}.fi-video:before{content:"\f20e"}.fi-volume-none:before{content:"\f20f"}.fi-volume-strike:before{content:"\f210"}.fi-volume:before{content:"\f211"}.fi-web:before{content:"\f212"}.fi-wheelchair:before{content:"\f213"}.fi-widget:before{content:"\f214"}.fi-wrench:before{content:"\f215"}.fi-x-circle:before{content:"\f216"}.fi-x:before{content:"\f217"}.fi-yen:before{content:"\f218"}.fi-zoom-in:before{content:"\f219"}.fi-zoom-out:before{content:"\f21a"}/*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,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:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}dfn{font-style:italic}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}.iconic,img{vertical-align:middle}sup{top:-.5em}sub{bottom:-.25em}img{border:0;max-width:100%;height:auto;-ms-interpolation-mode:bicubic;display:inline-block}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}body,p{font-weight:400}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::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}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]{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}table{border-collapse:collapse;border-spacing:0}meta.foundation-version{font-family:"1.1.0"}meta.foundation-mq{font-family:"small=0&medium=40rem&large=75rem&xlarge=90rem&xxlarge=120rem"}body,html{height:100%;font-size:100%}html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}body{background:#fff;color:#222;padding:0;margin:0;font-family:"Helvetica Neue",Helvetica,Helvetica,Arial,sans-serif;font-style:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}[ui-sref],[zf-close],[zf-open],[zf-toggle],a{cursor:pointer}#map_canvas embed,#map_canvas img,#map_canvas object,.map_canvas embed,.map_canvas img,.map_canvas object{max-width:none!important}.padding{padding:1rem}.iconic{width:1rem;height:1rem}a>.iconic{margin-top:-2px;margin-right:.25rem}.iconic *,.iconic .iconic-property-accent,.iconic-color-primary *,.iconic-color-primary .iconic-property-accent,a>.iconic *,a>.iconic .iconic-property-accent{fill:#00558b;stroke:#00558b}.iconic-color-success *,.iconic-color-success .iconic-property-accent{fill:#43AC6A;stroke:#43AC6A}.iconic-color-warning *,.iconic-color-warning .iconic-property-accent{fill:#F08A24;stroke:#F08A24}.iconic-color-alert *,.iconic-color-alert .iconic-property-accent{fill:#F04124;stroke:#F04124}.iconic-color-dark *,.iconic-color-dark .iconic-property-accent{fill:#232323;stroke:#232323}.iconic-color-secondary *,.iconic-color-secondary .iconic-property-accent{fill:#f1f1f1;stroke:#f1f1f1}.action-sheet-container{position:relative;display:inline-block}.action-sheet-container .button{margin-left:0;margin-right:0}.action-sheet{position:fixed;left:0;z-index:1000;width:100%;padding:1rem;background:#fff;text-align:center;transition-property:transform opacity;transition-duration:.25s;transition-timing-function:ease-out;box-shadow:0 -3px 10px rgba(0,0,0,.25);bottom:0;transform:translateY(100%)}.action-sheet.is-active{transform:translateY(0)}.action-sheet ul{margin:0 -1rem -1rem;user-select:none}.action-sheet ul:first-child{margin-top:-1rem}.action-sheet ul:first-child li:first-child{border-top:0}.action-sheet ul a{display:block;padding:.8rem;line-height:1;color:#000;border-top:1px solid #ccc}.action-sheet ul a:hover{color:#000;background:#f2f2f2}.action-sheet ul .alert>a{color:#F04124}.action-sheet ul .disabled>a{pointer-events:none;color:#999}@media only screen and (min-width:40em){.action-sheet,.action-sheet.top{border-radius:4px;box-shadow:0 0 10px rgba(0,0,0,.25)}.action-sheet.top::after,.action-sheet.top::before,.action-sheet::after,.action-sheet::before{content:'';position:absolute;left:50%;display:block;height:0;border-left:10px solid transparent;border-right:10px solid transparent;margin-left:-10px}.action-sheet{position:absolute;left:50%;width:300px;opacity:0;pointer-events:none;top:auto;bottom:0;transform:translateX(-50%) translateY(110%)}.action-sheet.is-active{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(100%)}.action-sheet::after,.action-sheet::before{width:0;top:-10px;bottom:auto;border-top:0;border-bottom:10px solid #fff}.action-sheet::before{top:-12px;border-bottom-color:rgba(0,0,0,.15)}.action-sheet.top{position:absolute;left:50%;width:300px;opacity:0;pointer-events:none;top:0;bottom:auto;transform:translateX(-50%) translateY(-120%)}.action-sheet.top.is-active{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(-110%)}.action-sheet.top::after,.action-sheet.top::before{width:0;top:auto;bottom:-10px;border-top:10px solid #fff;border-bottom:0}.action-sheet.top::before{bottom:-12px;border-top-color:rgba(0,0,0,.15)}}.card,.card.primary{box-shadow:0 1px 2px rgba(0,0,0,.2);overflow:hidden}.action-sheet.primary{background:#00558b;color:#fff;border:0}.action-sheet.primary::before{display:none}.action-sheet.primary::after,.action-sheet.primary::before{border-top-color:#00558b}.action-sheet.primary.top::after,.action-sheet.primary.top::before{border-bottom-color:#00558b}.action-sheet.primary ul{margin:0 -1rem -1rem;user-select:none}.action-sheet.primary ul:first-child{margin-top:-1rem}.action-sheet.primary ul:first-child li:first-child{border-top:0}.action-sheet.primary ul a{display:block;padding:.8rem;line-height:1;color:#fff;border-top:1px solid #006cb0}.action-sheet.primary ul a:hover{color:#fff;background:#00609e}.action-sheet.primary ul .alert>a{color:#F04124}.action-sheet.primary ul .disabled>a{pointer-events:none;color:#999}.action-sheet.dark{background:#232323;color:#fff;border:0}.action-sheet.dark::before{display:none}.action-sheet.dark::after,.action-sheet.dark::before{border-top-color:#232323}.action-sheet.dark.top::after,.action-sheet.dark.top::before{border-bottom-color:#232323}.action-sheet.dark ul{margin:0 -1rem -1rem;user-select:none}.action-sheet.dark ul:first-child{margin-top:-1rem}.action-sheet.dark ul:first-child li:first-child{border-top:0}.action-sheet.dark ul a{display:block;padding:.8rem;line-height:1;color:#fff;border-top:1px solid #393939}.action-sheet.dark ul a:hover{color:#fff;background:#2e2e2e}.action-sheet.dark ul .alert>a{color:#F04124}.action-sheet.dark ul .disabled>a{pointer-events:none;color:#999}.block-list ul{margin-left:0}.block-list{margin-bottom:1rem;line-height:1;user-select:none;font-size:1rem;margin-left:-1rem;margin-right:-1rem}.block-list input[type=number],.block-list input[type=search],.block-list input[type=text],.block-list input[type=password],.block-list input[type=date],.block-list input[type=datetime],.block-list input[type=datetime-local],.block-list input[type=month],.block-list input[type=week],.block-list input[type=email],.block-list input[type=tel],.block-list input[type=time],.block-list input[type=url],.block-list input[type=color],.block-list textarea{margin:0;border:0;line-height:1;height:auto;padding:.8rem 1rem;color:inherit}.block-list input[type=number]:focus,.block-list input[type=number]:hover,.block-list input[type=search]:focus,.block-list input[type=search]:hover,.block-list input[type=text]:focus,.block-list input[type=text]:hover,.block-list input[type=password]:focus,.block-list input[type=password]:hover,.block-list input[type=date]:focus,.block-list input[type=date]:hover,.block-list input[type=datetime]:focus,.block-list input[type=datetime]:hover,.block-list input[type=datetime-local]:focus,.block-list input[type=datetime-local]:hover,.block-list input[type=month]:focus,.block-list input[type=month]:hover,.block-list input[type=week]:focus,.block-list input[type=week]:hover,.block-list input[type=email]:focus,.block-list input[type=email]:hover,.block-list input[type=tel]:focus,.block-list input[type=tel]:hover,.block-list input[type=time]:focus,.block-list input[type=time]:hover,.block-list input[type=url]:focus,.block-list input[type=url]:hover,.block-list input[type=color]:focus,.block-list input[type=color]:hover,.block-list textarea:focus,.block-list textarea:hover{border:0}.block-list li>input[type=checkbox],.block-list li>input[type=radio]{position:absolute;left:-9999px}.block-list li>input[type=checkbox]+label,.block-list li>input[type=radio]+label{display:block;font-size:1rem;margin:0}.block-list li>input[type=checkbox]:checked+label::before,.block-list li>input[type=radio]:checked+label::before{background-image:url('data:image/svg+xml;utf8,');content:'';background-size:100% 100%;width:1.5em;height:1.5em;color:#00558b;float:right;pointer-events:none;margin-top:-.25em}@media screen and (min-width:0\0){.block-list li>input[type=checkbox]:checked+label::before,.block-list li>input[type=radio]:checked+label::before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdlJREFUeNrMl0FugzAQRY3TRZeoFyhVL0BOkGTXJezaHZwguUnECaCrdFd6gqQnCN11Uyk5QekNOlONJWMVGMCgfGlkEIY3HnsG2xFM3d96PjQB2AJsWdPtAPYOln+dTwXnuw4DHEGzBvNFN6EDCTiS9XIAwB40acNoucKoxODIie0AwAOCu8KOSnIiNx/MakK+A7sW9oTferxx3fP3T1nURoBG/irGVahHwjHm/Ggx7E3TMVdrQmoP0gngghhpZQ3QvG/EdPLUelARWI8Aycjq9Md0qMIdbcNhjmOKLoY7quk3l1Rebeqg4AwFkmq7LWGOh1pmNY0etZAWSq0OX8HoS4JvWuCopbSY26EGR/CW86K0BF+pwkLwlPuyHJhOCl5oe4ZtF++vOqST+GdOYwO+71pN2VNAjmQGPCe42weuHDg0PI8olUwnYrXTGQJH9gxq8l1LKvrQx4O6/YY32Kp/ugb3ey7gZ4xAzuhYiYTxB/UHZFAuaREVXZ2g6yFlvEC2yoKEmbsRZYNgVLk2JeaOaG+xLHN+WCszDWMqLGOrJFa1DlApjSdwoHJGqGzLIb0+cas0wh5Bh780ngswx8GJD7h8sHg2wLA/mfDLPZpdxOF0quP5rwADAAFIzSRvu1m5AAAAAElFTkSuQmCC)}}.block-list .with-dropdown{color:inherit}.block-list .with-dropdown select{outline:0;background:0;border:0;height:auto;padding:.8rem 1rem;margin:0;font-size:1em;line-height:1;color:inherit}.block-list .switch{position:absolute;top:50%;right:1rem;transform:translateY(-50%)}.block-list.with-icons li>a,.block-list.with-icons li>label,.block-list.with-icons li>span{padding-left:2.8rem}.block-list.with-icons li .iconic,.block-list.with-icons li img{position:absolute;top:.26rem;left:.26rem;width:2.08rem;height:2.08rem;border-radius:8px;pointer-events:none}.block-list header{margin-top:1em;color:#666;margin-bottom:.5em;margin-left:1rem;font-size:.8em;cursor:default;text-transform:uppercase}.block-list li{position:relative;border-bottom:1px solid #d0d0d0}.block-list li:first-child{border-top:1px solid #d0d0d0}.block-list li>a,.block-list li>label,.block-list li>span{display:block;padding:.8rem 1rem;color:#000;line-height:1}.block-list li>a,.block-list li>label{cursor:pointer}.block-list li>a:hover,.block-list li>label:hover{color:#000}.block-list li select:hover,.block-list li>a:hover,.block-list li>label:hover{background:#f4f4f4}.block-list li.caution>a,.block-list li.caution>a:hover{color:#F04124}.block-list li.disabled>a{cursor:default}.block-list li.disabled>a,.block-list li.disabled>a:hover{color:#999}.block-list li.disabled>a:hover{background:0 0}.block-list li.with-chevron::after{content:'\203A';display:block;position:absolute;right:1rem;top:50%;transform:translateY(-50%);font-weight:700;color:#666;font-size:2em}.block-list li.with-chevron .block-list-label{padding-right:1.5rem}.block-list li .block-list-label{display:inline-block;float:right;padding:0;color:#999;pointer-events:none}.block-list li .block-list-label.left{margin-left:.8rem;float:none}.button,.button-group>li>a,.button-group>li>button,.button-group>li>label{border:0;text-align:center;line-height:1;cursor:pointer;-webkit-appearance:none;-webkit-font-smoothing:antialiased;transition:background .25s ease-out;vertical-align:middle;padding:.85em 1em;border-radius:0}.button-group li.disabled>a,.button-group li.disabled>button,.button-group li.disabled>label,.button.disabled{opacity:.5;cursor:default;pointer-events:none}.button{font-size:.9rem;display:inline-block;width:auto;margin:0 1rem 1rem 0;background:#00558b;color:#fff}.button .iconic,.button.large .iconic,.button.small .iconic,.button.tiny .iconic{width:1em;margin-right:.25em;margin-top:-2px;height:1em;vertical-align:middle}.button:focus,.button:hover{background:#004876;color:#fff}.button .iconic *,.button .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button.tiny{font-size:.63rem}.button.small{font-size:.72rem}.button.large{font-size:1.17rem}.button.expand{display:block;width:100%;margin-left:0;margin-right:0}.button.secondary{background:#f1f1f1;color:#000}.button.secondary:focus,.button.secondary:hover{background:#cdcdcd;color:#000}.button.secondary .iconic *,.button.secondary .iconic .iconic-property-accent{fill:#000;stroke:#000}.button.alert .iconic *,.button.alert .iconic .iconic-property-accent,.button.success .iconic *,.button.success .iconic .iconic-property-accent,.button.warning .iconic *,.button.warning .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button.success{background:#43AC6A;color:#fff}.button.success:focus,.button.success:hover{background:#39925a;color:#fff}.button.warning{background:#F08A24;color:#fff}.button.warning:focus,.button.warning:hover{background:#dc750f;color:#fff}.button.alert{background:#F04124;color:#fff}.button.alert:focus,.button.alert:hover{background:#dc2c0f;color:#fff}.button.info{background:#A0D3E8;color:#000}.button.info:focus,.button.info:hover{background:#71bddd;color:#000}.button.info .iconic *,.button.info .iconic .iconic-property-accent{fill:#000;stroke:#000}.button.dark{background:#232323;color:#fff}.button.dark:focus,.button.dark:hover{background:#1e1e1e;color:#fff}.button.dark .iconic *,.button.dark .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button.hollow{border:1px solid #00558b;background:0 0;color:#00558b}.button.hollow:focus,.button.hollow:hover{border-color:#008ee8;background:0 0;color:#008ee8}.button.hollow .iconic *,.button.hollow .iconic .iconic-property-accent{fill:#00558b;stroke:#00558b}.button.hollow:hover .iconic *,.button.hollow:hover .iconic .iconic-property-accent{fill:#008ee8;stroke:#008ee8}.button.hollow.secondary{border:1px solid #f1f1f1;background:0 0;color:#f1f1f1}.button.hollow.secondary:focus,.button.hollow.secondary:hover{border-color:#f5f5f5;background:0 0;color:#f5f5f5}.button.hollow.secondary .iconic *,.button.hollow.secondary .iconic .iconic-property-accent{fill:#f1f1f1;stroke:#f1f1f1}.button.hollow.secondary:hover .iconic *,.button.hollow.secondary:hover .iconic .iconic-property-accent{fill:#f5f5f5;stroke:#f5f5f5}.button.hollow.success{border:1px solid #43AC6A;background:0 0;color:#43AC6A}.button.hollow.success:focus,.button.hollow.success:hover{border-color:#6dc68e;background:0 0;color:#6dc68e}.button.hollow.success .iconic *,.button.hollow.success .iconic .iconic-property-accent{fill:#43AC6A;stroke:#43AC6A}.button.hollow.success:hover .iconic *,.button.hollow.success:hover .iconic .iconic-property-accent{fill:#6dc68e;stroke:#6dc68e}.button.hollow.warning{border:1px solid #F08A24;background:0 0;color:#F08A24}.button.hollow.warning:focus,.button.hollow.warning:hover{border-color:#f4a75b;background:0 0;color:#f4a75b}.button.hollow.warning .iconic *,.button.hollow.warning .iconic .iconic-property-accent{fill:#F08A24;stroke:#F08A24}.button.hollow.warning:hover .iconic *,.button.hollow.warning:hover .iconic .iconic-property-accent{fill:#f4a75b;stroke:#f4a75b}.button.hollow.alert{border:1px solid #F04124;background:0 0;color:#F04124}.button.hollow.alert:focus,.button.hollow.alert:hover{border-color:#f4715b;background:0 0;color:#f4715b}.button.hollow.alert .iconic *,.button.hollow.alert .iconic .iconic-property-accent{fill:#F04124;stroke:#F04124}.button.hollow.alert:hover .iconic *,.button.hollow.alert:hover .iconic .iconic-property-accent{fill:#f4715b;stroke:#f4715b}.button.hollow.info{border:1px solid #A0D3E8;background:0 0;color:#A0D3E8}.button.hollow.info:focus,.button.hollow.info:hover{border-color:#b8deee;background:0 0;color:#b8deee}.button.hollow.info .iconic *,.button.hollow.info .iconic .iconic-property-accent{fill:#A0D3E8;stroke:#A0D3E8}.button.hollow.info:hover .iconic *,.button.hollow.info:hover .iconic .iconic-property-accent{fill:#b8deee;stroke:#b8deee}.button.hollow.dark{border:1px solid #232323;background:0 0;color:#232323}.button.hollow.dark:focus,.button.hollow.dark:hover{border-color:#5a5a5a;background:0 0;color:#5a5a5a}.button.hollow.dark .iconic *,.button.hollow.dark .iconic .iconic-property-accent{fill:#232323;stroke:#232323}.button.hollow.dark:hover .iconic *,.button.hollow.dark:hover .iconic .iconic-property-accent{fill:#5a5a5a;stroke:#5a5a5a}.button-group{margin:0 0 1rem;overflow:hidden;font-size:.9rem}.button-group>li>a,.button-group>li>button,.button-group>li>label{border-radius:0;font-size:inherit;display:block;margin:0}.button-group>li>input+label{margin-left:0}.button-group>li:not(:last-child)>a,.button-group>li:not(:last-child)>button,.button-group>li:not(:last-child)>label{border-right:1px solid #004068}.button-group .iconic{width:1em;height:1em;vertical-align:middle;margin-right:.25em;margin-top:-2px}.button-group.segmented,.button-group.segmented.alert,.button-group.segmented.secondary,.button-group.segmented.success,.button-group.segmented.warning{border:1px solid #00558b;transition-property:background color}.slideInDown.ng-enter,.slideInDown.ng-hide-remove,.slideInLeft.ng-enter,.slideInLeft.ng-hide-remove,.slideInRight.ng-enter,.slideInRight.ng-hide-remove,.slideInUp.ng-enter,.slideInUp.ng-hide-remove,.slideOutBottom.ng-hide-add,.slideOutBottom.ng-leave,.slideOutLeft.ng-hide-add,.slideOutLeft.ng-leave,.slideOutRight.ng-hide-add,.slideOutRight.ng-leave,.slideOutUp.ng-hide-add,.slideOutUp.ng-leave{transition-duration:.5s;transition-timing-function:ease;transition-delay:0;transition-property:transform,opacity}.button-group.segmented>li>input[type=radio]{position:absolute;left:-9999px}.button-group.segmented.alert>li>a,.button-group.segmented.alert>li>button,.button-group.segmented.alert>li>label,.button-group.segmented.secondary>li>a,.button-group.segmented.secondary>li>button,.button-group.segmented.secondary>li>label,.button-group.segmented.success>li>a,.button-group.segmented.success>li>button,.button-group.segmented.success>li>label,.button-group.segmented.warning>li>a,.button-group.segmented.warning>li>button,.button-group.segmented.warning>li>label,.button-group.segmented>li>a,.button-group.segmented>li>button,.button-group.segmented>li>label{margin-right:0;background:0 0}.button-group{display:inline-flex;border-radius:0}.button-group>li{flex:0 0 auto}.button-group>li>a,.button-group>li>button,.button-group>li>label{background:#00558b;color:#fff;border-color:#004876}.button-group>li>a:focus,.button-group>li>a:hover,.button-group>li>button:focus,.button-group>li>button:hover,.button-group>li>label:focus,.button-group>li>label:hover{background:#004876;color:#fff}.button-group>li>a .iconic *,.button-group>li>a .iconic .iconic-property-accent,.button-group>li>button .iconic *,.button-group>li>button .iconic .iconic-property-accent,.button-group>li>label .iconic *,.button-group>li>label .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button-group>li.is-active>a,.button-group>li.is-active>button,.button-group>li.is-active>label{background:#004876}.button-group.secondary>li>a,.button-group.secondary>li>button,.button-group.secondary>li>label{background:#f1f1f1;color:#000;border-color:#cdcdcd}.button-group.secondary>li>a:focus,.button-group.secondary>li>a:hover,.button-group.secondary>li>button:focus,.button-group.secondary>li>button:hover,.button-group.secondary>li>label:focus,.button-group.secondary>li>label:hover{background:#cdcdcd;color:#000}.button-group.secondary>li>a .iconic *,.button-group.secondary>li>a .iconic .iconic-property-accent,.button-group.secondary>li>button .iconic *,.button-group.secondary>li>button .iconic .iconic-property-accent,.button-group.secondary>li>label .iconic *,.button-group.secondary>li>label .iconic .iconic-property-accent{fill:#000;stroke:#000}.button-group.alert>li>a .iconic *,.button-group.alert>li>a .iconic .iconic-property-accent,.button-group.alert>li>button .iconic *,.button-group.alert>li>button .iconic .iconic-property-accent,.button-group.alert>li>label .iconic *,.button-group.alert>li>label .iconic .iconic-property-accent,.button-group.success>li>a .iconic *,.button-group.success>li>a .iconic .iconic-property-accent,.button-group.success>li>button .iconic *,.button-group.success>li>button .iconic .iconic-property-accent,.button-group.success>li>label .iconic *,.button-group.success>li>label .iconic .iconic-property-accent,.button-group.warning>li>a .iconic *,.button-group.warning>li>a .iconic .iconic-property-accent,.button-group.warning>li>button .iconic *,.button-group.warning>li>button .iconic .iconic-property-accent,.button-group.warning>li>label .iconic *,.button-group.warning>li>label .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button-group.secondary>li.is-active>a,.button-group.secondary>li.is-active>button,.button-group.secondary>li.is-active>label{background:#cdcdcd}.button-group.success>li>a,.button-group.success>li>button,.button-group.success>li>label{background:#43AC6A;color:#fff;border-color:#39925a}.button-group.success>li>a:focus,.button-group.success>li>a:hover,.button-group.success>li>button:focus,.button-group.success>li>button:hover,.button-group.success>li>label:focus,.button-group.success>li>label:hover{background:#39925a;color:#fff}.button-group.success>li.is-active>a,.button-group.success>li.is-active>button,.button-group.success>li.is-active>label{background:#39925a}.button-group.warning>li>a,.button-group.warning>li>button,.button-group.warning>li>label{background:#F08A24;color:#fff;border-color:#dc750f}.button-group.warning>li>a:focus,.button-group.warning>li>a:hover,.button-group.warning>li>button:focus,.button-group.warning>li>button:hover,.button-group.warning>li>label:focus,.button-group.warning>li>label:hover{background:#dc750f;color:#fff}.button-group.warning>li.is-active>a,.button-group.warning>li.is-active>button,.button-group.warning>li.is-active>label{background:#dc750f}.button-group.alert>li>a,.button-group.alert>li>button,.button-group.alert>li>label{background:#F04124;color:#fff;border-color:#dc2c0f}.button-group.alert>li>a:focus,.button-group.alert>li>a:hover,.button-group.alert>li>button:focus,.button-group.alert>li>button:hover,.button-group.alert>li>label:focus,.button-group.alert>li>label:hover{background:#dc2c0f;color:#fff}.button-group.alert>li.is-active>a,.button-group.alert>li.is-active>button,.button-group.alert>li.is-active>label{background:#dc2c0f}.button-group>li.secondary>a,.button-group>li.secondary>button,.button-group>li.secondary>label{background:#f1f1f1;color:#000;border-color:#f1f1f1}.button-group>li.secondary>a:focus,.button-group>li.secondary>a:hover,.button-group>li.secondary>button:focus,.button-group>li.secondary>button:hover,.button-group>li.secondary>label:focus,.button-group>li.secondary>label:hover{background:#cdcdcd;color:#000;border-color:#b5b5b5}.button-group>li.secondary>a .iconic *,.button-group>li.secondary>a .iconic .iconic-property-accent,.button-group>li.secondary>button .iconic *,.button-group>li.secondary>button .iconic .iconic-property-accent,.button-group>li.secondary>label .iconic *,.button-group>li.secondary>label .iconic .iconic-property-accent{fill:#000;stroke:#000}.button-group>li.alert>a .iconic *,.button-group>li.alert>a .iconic .iconic-property-accent,.button-group>li.alert>button .iconic *,.button-group>li.alert>button .iconic .iconic-property-accent,.button-group>li.alert>label .iconic *,.button-group>li.alert>label .iconic .iconic-property-accent,.button-group>li.success>a .iconic *,.button-group>li.success>a .iconic .iconic-property-accent,.button-group>li.success>button .iconic *,.button-group>li.success>button .iconic .iconic-property-accent,.button-group>li.success>label .iconic *,.button-group>li.success>label .iconic .iconic-property-accent,.button-group>li.warning>a .iconic *,.button-group>li.warning>a .iconic .iconic-property-accent,.button-group>li.warning>button .iconic *,.button-group>li.warning>button .iconic .iconic-property-accent,.button-group>li.warning>label .iconic *,.button-group>li.warning>label .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button-group>li.success>a,.button-group>li.success>button,.button-group>li.success>label{background:#43AC6A;color:#fff;border-color:#43AC6A}.button-group>li.success>a:focus,.button-group>li.success>a:hover,.button-group>li.success>button:focus,.button-group>li.success>button:hover,.button-group>li.success>label:focus,.button-group>li.success>label:hover{background:#39925a;color:#fff;border-color:#328150}.button-group>li.warning>a,.button-group>li.warning>button,.button-group>li.warning>label{background:#F08A24;color:#fff;border-color:#F08A24}.button-group>li.warning>a:focus,.button-group>li.warning>a:hover,.button-group>li.warning>button:focus,.button-group>li.warning>button:hover,.button-group>li.warning>label:focus,.button-group>li.warning>label:hover{background:#dc750f;color:#fff;border-color:#c2680d}.button-group>li.alert>a,.button-group>li.alert>button,.button-group>li.alert>label{background:#F04124;color:#fff;border-color:#F04124}.button-group>li.alert>a:focus,.button-group>li.alert>a:hover,.button-group>li.alert>button:focus,.button-group>li.alert>button:hover,.button-group>li.alert>label:focus,.button-group>li.alert>label:hover{background:#dc2c0f;color:#fff;border-color:#c2270d}.button-group.segmented{border-color:#00558b}.button-group.segmented>li>a,.button-group.segmented>li>button,.button-group.segmented>li>label{border-color:#00558b;color:#00558b}.button-group.segmented>li>a:hover,.button-group.segmented>li>button:hover,.button-group.segmented>li>label:hover{background:rgba(0,85,139,.25);color:#00558b}.button-group.segmented>li>a .iconic *,.button-group.segmented>li>a .iconic .iconic-property-accent,.button-group.segmented>li>button .iconic *,.button-group.segmented>li>button .iconic .iconic-property-accent,.button-group.segmented>li>label .iconic *,.button-group.segmented>li>label .iconic .iconic-property-accent{fill:#00558b;stroke:#00558b}.button-group.segmented>li.is-active>a,.button-group.segmented>li.is-active>a:hover,.button-group.segmented>li>input:checked+label,.button-group.segmented>li>input:checked+label:hover{background:#00558b;color:#fff}.button-group.segmented>li.is-active>a .iconic *,.button-group.segmented>li.is-active>a .iconic .iconic-property-accent,.button-group.segmented>li>input:checked+label .iconic *,.button-group.segmented>li>input:checked+label .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button-group.segmented.secondary{border-color:#f1f1f1}.button-group.segmented.secondary>li>a,.button-group.segmented.secondary>li>button,.button-group.segmented.secondary>li>label{border-color:#f1f1f1;color:#f1f1f1}.button-group.segmented.secondary>li>a:hover,.button-group.segmented.secondary>li>button:hover,.button-group.segmented.secondary>li>label:hover{background:rgba(241,241,241,.25);color:#f1f1f1}.button-group.segmented.secondary>li>a .iconic *,.button-group.segmented.secondary>li>a .iconic .iconic-property-accent,.button-group.segmented.secondary>li>button .iconic *,.button-group.segmented.secondary>li>button .iconic .iconic-property-accent,.button-group.segmented.secondary>li>label .iconic *,.button-group.segmented.secondary>li>label .iconic .iconic-property-accent{fill:#f1f1f1;stroke:#f1f1f1}.button-group.segmented.secondary>li.is-active>a,.button-group.segmented.secondary>li.is-active>a:hover,.button-group.segmented.secondary>li>input:checked+label,.button-group.segmented.secondary>li>input:checked+label:hover{background:#f1f1f1;color:#000}.button-group.segmented.secondary>li.is-active>a .iconic *,.button-group.segmented.secondary>li.is-active>a .iconic .iconic-property-accent,.button-group.segmented.secondary>li>input:checked+label .iconic *,.button-group.segmented.secondary>li>input:checked+label .iconic .iconic-property-accent{fill:#000;stroke:#000}.button-group.segmented.success{border-color:#43AC6A}.button-group.segmented.success>li>a,.button-group.segmented.success>li>button,.button-group.segmented.success>li>label{border-color:#43AC6A;color:#43AC6A}.button-group.segmented.success>li>a:hover,.button-group.segmented.success>li>button:hover,.button-group.segmented.success>li>label:hover{background:rgba(67,172,106,.25);color:#43AC6A}.button-group.segmented.success>li>a .iconic *,.button-group.segmented.success>li>a .iconic .iconic-property-accent,.button-group.segmented.success>li>button .iconic *,.button-group.segmented.success>li>button .iconic .iconic-property-accent,.button-group.segmented.success>li>label .iconic *,.button-group.segmented.success>li>label .iconic .iconic-property-accent{fill:#43AC6A;stroke:#43AC6A}.button-group.segmented.success>li.is-active>a,.button-group.segmented.success>li.is-active>a:hover,.button-group.segmented.success>li>input:checked+label,.button-group.segmented.success>li>input:checked+label:hover{background:#43AC6A;color:#fff}.button-group.segmented.success>li.is-active>a .iconic *,.button-group.segmented.success>li.is-active>a .iconic .iconic-property-accent,.button-group.segmented.success>li>input:checked+label .iconic *,.button-group.segmented.success>li>input:checked+label .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button-group.segmented.warning{border-color:#F08A24}.button-group.segmented.warning>li>a,.button-group.segmented.warning>li>button,.button-group.segmented.warning>li>label{border-color:#F08A24;color:#F08A24}.button-group.segmented.warning>li>a:hover,.button-group.segmented.warning>li>button:hover,.button-group.segmented.warning>li>label:hover{background:rgba(240,138,36,.25);color:#F08A24}.button-group.segmented.warning>li>a .iconic *,.button-group.segmented.warning>li>a .iconic .iconic-property-accent,.button-group.segmented.warning>li>button .iconic *,.button-group.segmented.warning>li>button .iconic .iconic-property-accent,.button-group.segmented.warning>li>label .iconic *,.button-group.segmented.warning>li>label .iconic .iconic-property-accent{fill:#F08A24;stroke:#F08A24}.button-group.segmented.warning>li.is-active>a,.button-group.segmented.warning>li.is-active>a:hover,.button-group.segmented.warning>li>input:checked+label,.button-group.segmented.warning>li>input:checked+label:hover{background:#F08A24;color:#fff}.button-group.segmented.warning>li.is-active>a .iconic *,.button-group.segmented.warning>li.is-active>a .iconic .iconic-property-accent,.button-group.segmented.warning>li>input:checked+label .iconic *,.button-group.segmented.warning>li>input:checked+label .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.button-group.segmented.alert{border-color:#F04124}.button-group.segmented.alert>li>a,.button-group.segmented.alert>li>button,.button-group.segmented.alert>li>label{border-color:#F04124;color:#F04124}.button-group.segmented.alert>li>a:hover,.button-group.segmented.alert>li>button:hover,.button-group.segmented.alert>li>label:hover{background:rgba(240,65,36,.25);color:#F04124}.button-group.segmented.alert>li>a .iconic *,.button-group.segmented.alert>li>a .iconic .iconic-property-accent,.button-group.segmented.alert>li>button .iconic *,.button-group.segmented.alert>li>button .iconic .iconic-property-accent,.button-group.segmented.alert>li>label .iconic *,.button-group.segmented.alert>li>label .iconic .iconic-property-accent{fill:#F04124;stroke:#F04124}.button-group.segmented.alert>li.is-active>a .iconic *,.button-group.segmented.alert>li.is-active>a .iconic .iconic-property-accent,.button-group.segmented.alert>li>input:checked+label .iconic *,.button-group.segmented.alert>li>input:checked+label .iconic .iconic-property-accent,.title-bar.dark .iconic *,.title-bar.dark .iconic .iconic-property-accent,.title-bar.primary .iconic *,.title-bar.primary .iconic .iconic-property-accent{stroke:#fff;fill:#fff}.button-group.segmented.alert>li.is-active>a,.button-group.segmented.alert>li.is-active>a:hover,.button-group.segmented.alert>li>input:checked+label,.button-group.segmented.alert>li>input:checked+label:hover{background:#F04124;color:#fff}.button-group.tiny{font-size:.63rem}.button-group.small{font-size:.72rem}.button-group.large{font-size:1.17rem}.button-group.expand{display:flex}.button-group.expand>li{flex:1}.button-group.expand>li>a,.button-group.expand>li>button,.button-group.expand>li>label{display:block;width:100%;margin-left:0;margin-right:0}.card{border:1px solid #ededed;margin-bottom:.5rem;background:#fff;color:#000;border-radius:4px}.card h1,.card h2,.card h3,.card h4,.card h5,.card h6{color:inherit}.card ul{margin-bottom:0}.card img{width:100%}.card.primary{border:0;margin-bottom:.5rem;background:#00558b;color:#fff;border-radius:4px}.card.primary h1,.card.primary h2,.card.primary h3,.card.primary h4,.card.primary h5,.card.primary h6{color:inherit}.card.primary ul{margin-bottom:0}.card.primary img{width:100%}.card.primary .card-divider{background:#0065a5;padding:1rem}.card.success{border:0;margin-bottom:.5rem;background:#43AC6A;color:#fff;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.2);overflow:hidden}.card.alert,.card.warning{border:0;box-shadow:0 1px 2px rgba(0,0,0,.2);overflow:hidden}.card.success h1,.card.success h2,.card.success h3,.card.success h4,.card.success h5,.card.success h6{color:inherit}.card.success ul{margin-bottom:0}.card.success img{width:100%}.card.success .card-divider{background:#4ab873;padding:1rem}.card.warning{margin-bottom:.5rem;background:#F08A24;color:#fff;border-radius:4px}.card.warning h1,.card.warning h2,.card.warning h3,.card.warning h4,.card.warning h5,.card.warning h6{color:inherit}.card.warning ul{margin-bottom:0}.card.warning img{width:100%}.card.warning .card-divider{background:#f19233;padding:1rem}.card.alert{margin-bottom:.5rem;background:#F04124;color:#fff;border-radius:4px}.card.alert h1,.card.alert h2,.card.alert h3,.card.alert h4,.card.alert h5,.card.alert h6{color:inherit}.card.alert ul{margin-bottom:0}.card.alert img{width:100%}.card.alert .card-divider{background:#f14e33;padding:1rem}.card.dark{border:0;margin-bottom:.5rem;background:#232323;color:#fff;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.2);overflow:hidden}.card.dark h1,.card.dark h2,.card.dark h3,.card.dark h4,.card.dark h5,.card.dark h6{color:inherit}.card.dark ul{margin-bottom:0}.card.dark img{width:100%}.card.dark .card-divider{background:#323232;padding:1rem}.card-divider{background:#ededed;padding:1rem}.card-section{padding:1rem}.close-button{position:absolute;color:#999;top:1rem;right:1rem;font-size:2em;line-height:.5;cursor:pointer}.close-button:hover{color:#333}.thumbnail,ul.thumbnails>li img{padding:.5rem;box-shadow:0 3px 15px rgba(0,0,0,.25)}ul.thumbnails>li{margin-bottom:1rem}ul.thumbnails>li a{display:block}input[type=number],input[type=search],input[type=text],input[type=password],input[type=date],input[type=datetime],input[type=datetime-local],input[type=month],input[type=week],input[type=email],input[type=tel],input[type=time],input[type=url],input[type=color],textarea{-webkit-appearance:none;-moz-appearance:none;display:block;width:100%;height:2.4rem;padding:.5rem;margin:0 0 1rem;border:1px solid #ccc;border-radius:0;background:#fff;color:#000;font-size:1rem;-webkit-font-smoothing:antialiased;vertical-align:middle}label>.inline-label,label>input,label>input[type=number],label>input[type=search],label>input[type=text],label>input[type=password],label>input[type=date],label>input[type=datetime],label>input[type=datetime-local],label>input[type=month],label>input[type=week],label>input[type=email],label>input[type=tel],label>input[type=time],label>input[type=url],label>input[type=color],label>textarea{margin-top:.5rem}input[type=number]:hover,input[type=search]:hover,input[type=text]:hover,input[type=password]:hover,input[type=date]:hover,input[type=datetime]:hover,input[type=datetime-local]:hover,input[type=month]:hover,input[type=week]:hover,input[type=email]:hover,input[type=tel]:hover,input[type=time]:hover,input[type=url]:hover,input[type=color]:hover,textarea:hover{border:1px solid #bbb;background:#fff;color:#000}input[type=number]:focus,input[type=search]:focus,input[type=text]:focus,input[type=password]:focus,input[type=date]:focus,input[type=datetime]:focus,input[type=datetime-local]:focus,input[type=month]:focus,input[type=week]:focus,input[type=email]:focus,input[type=tel]:focus,input[type=time]:focus,input[type=url]:focus,input[type=color]:focus,textarea:focus{outline:0;border:1px solid #999;background:#fff;color:#000}fieldset[disabled] input,input.disabled,input[disabled],input[readonly]{cursor:not-allowed}fieldset[disabled] input,fieldset[disabled] input:hover,input.disabled,input.disabled:hover,input[disabled],input[disabled]:hover,input[readonly],input[readonly]:hover{background-color:#f2f2f2}label{display:block;font-size:.9rem;margin-bottom:.5rem;color:#333}input[type=checkbox],input[type=radio]{width:1rem;height:1rem}label>input[type=checkbox],label>input[type=radio]{margin-right:.25rem}input[type=checkbox]+label,input[type=radio]+label{display:inline-block;margin-left:.5rem;margin-right:1rem;margin-bottom:0;vertical-align:baseline}.inline-label{display:flex;flex-flow:row nowrap;align-items:stretch;margin-bottom:1rem}.inline-label>input,.inline-label>select{flex:1;margin:0}.inline-label>.form-label{flex:0 0 auto;background:#eee;color:#333;border:1px solid #ccc;padding:0 .5rem;display:flex;align-items:center}.inline-label>.form-label:first-child{border-right:0}.inline-label>.form-label:last-child{border-left:0}.inline-label>a,.inline-label>button,.inline-label>input[type=button],.inline-label>input[type=submit]{flex:0 0 auto;display:flex;align-items:center;padding-top:0;padding-bottom:0;margin:0;border-radius:0}textarea{height:auto;width:100%;min-height:50px}select{display:block;width:100%;height:2.4rem;padding:.5rem 1.625rem .5rem .5rem;margin:0 0 1rem;font-size:1rem;color:#000;border-radius:0;border:1px solid #ccc;background:url('data:image/svg+xml;utf8,') right 10px center no-repeat #fafafa;background-size:8px 8px}input[type=range],meter,progress{-webkit-appearance:none;-moz-appearance:none;display:block;border:0}select:hover{background-color:#f0f0f0}input[type=range]:focus,select:focus{outline:0}select::-ms-expand{display:none}input[type=range]{width:100%;height:auto;cursor:pointer;margin-top:.25rem;margin-bottom:.25rem;line-height:1}input[type=range]::-webkit-slider-runnable-track{height:1rem;background:#ddd}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:#00558b;width:1.5rem;height:1.5rem;margin-top:-.25rem}input[type=range]::-moz-range-track{-moz-appearance:none;height:1rem;background:#ccc}input[type=range]::-moz-range-thumb{-moz-appearance:none;background:#00558b;width:1.5rem;height:1.5rem;margin-top:-.25rem}input[type=range]::-ms-track{height:1rem;background:#ddd;color:transparent;border:0;overflow:visible;border-top:.25rem solid #fff;border-bottom:.25rem solid #fff}input[type=range]::-ms-thumb{background:#00558b;width:1.5rem;height:1.5rem;border:0}input[type=range]::-ms-fill-lower,input[type=range]::-ms-fill-upper{background:#ddd}output{line-height:1.5rem;vertical-align:middle;margin-left:.5em}input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;background:#00558b}meter,progress{width:100%;height:1.5rem;margin-bottom:1rem;background:#ccc}progress::-webkit-progress-bar{background:#ccc}progress::-webkit-progress-value{background:#00558b}progress::-moz-progress-bar{background:#00558b}progress.high::-webkit-progress-value{background:#43AC6A}progress.high::-moz-progress-bar{background:#43AC6A}progress.medium::-webkit-progress-value{background:#e7cf00}progress.medium::-moz-progress-bar{background:#e7cf00}progress.low::-webkit-progress-value{background:#F04124}progress.low::-moz-progress-bar{background:#F04124}meter{background:#ccc}meter::-webkit-meter-bar{background:#ccc}meter::-webkit-meter-optimum-value{background:#43AC6A}meter::-webkit-meter-suboptimum-value{background:#e7cf00}meter::-webkit-meter-even-less-good-value{background:#F04124}meter::-moz-meter-bar{background:#00558b}meter:-moz-meter-optimum::-moz-meter-bar{background:#43AC6A}meter:-moz-meter-sub-optimum::-moz-meter-bar{background:#e7cf00}meter:-moz-meter-sub-sub-optimum::-moz-meter-bar{background:#F04124}.panel{position:absolute;z-index:100;overflow-y:auto;display:none;padding:0;background:#fff}.is-active.panel{display:block}.panel-top{top:0;left:0;width:100%;height:300px}.panel-top.is-active{box-shadow:0 3px 10px rgba(0,0,0,.25)}.panel-right{top:0;right:0;height:100%;width:100%}@media only screen and (min-width:18.75em){.panel-right{width:300px}}.panel-right.is-active{box-shadow:-3px 0 10px rgba(0,0,0,.25)}.panel-bottom{bottom:0;left:0;width:100%;height:300px}.panel-bottom.is-active{box-shadow:2px -3px 10px rgba(0,0,0,.25)}.panel-left{top:0;left:0;height:100%;width:100%}@media only screen and (min-width:18.75em){.panel-left{width:300px}}.panel-left.is-active{box-shadow:3px 0 10px rgba(0,0,0,.25)}.small-grid-block.panel,.small-grid-content.panel{transform:none;width:auto;z-index:auto;box-shadow:none;background:0 0;top:auto;right:auto;bottom:auto;left:auto}.panel-fixed{position:fixed}.small-vertical.grid-block,.small-vertical.grid-frame,.small-vertical.large-grid-block,.small-vertical.medium-grid-block,.small-vertical.small-grid-block,.vertical.grid-block,.vertical.grid-frame,.vertical.large-grid-block,.vertical.medium-grid-block,.vertical.small-grid-block{flex-flow:column nowrap;align-items:stretch}.small-horizontal.grid-block,.small-horizontal.grid-frame,.small-horizontal.large-grid-block,.small-horizontal.medium-grid-block,.small-horizontal.small-grid-block{flex-flow:row wrap}@media only screen and (min-width:40em){.medium-vertical.grid-block,.medium-vertical.grid-frame,.medium-vertical.large-grid-block,.medium-vertical.medium-grid-block,.medium-vertical.small-grid-block{flex-flow:column nowrap;align-items:stretch}.medium-horizontal.grid-block,.medium-horizontal.grid-frame,.medium-horizontal.large-grid-block,.medium-horizontal.medium-grid-block,.medium-horizontal.small-grid-block{flex-flow:row wrap}}@media only screen and (min-width:75em){.large-vertical.grid-block,.large-vertical.grid-frame,.large-vertical.large-grid-block,.large-vertical.medium-grid-block,.large-vertical.small-grid-block{flex-flow:column nowrap;align-items:stretch}.large-horizontal.grid-block,.large-horizontal.grid-frame,.large-horizontal.large-grid-block,.large-horizontal.medium-grid-block,.large-horizontal.small-grid-block{flex-flow:row wrap}}.align-right.grid-block,.align-right.grid-frame,.align-right.large-grid-block,.align-right.medium-grid-block,.align-right.small-grid-block{justify-content:flex-end}.align-center.grid-block,.align-center.grid-frame,.align-center.large-grid-block,.align-center.medium-grid-block,.align-center.small-grid-block{justify-content:center}.align-justify.grid-block,.align-justify.grid-frame,.align-justify.large-grid-block,.align-justify.medium-grid-block,.align-justify.small-grid-block{justify-content:space-between}.align-spaced.grid-block,.align-spaced.grid-frame,.align-spaced.large-grid-block,.align-spaced.medium-grid-block,.align-spaced.small-grid-block{justify-content:space-around}.wrap.grid-block,.wrap.grid-frame,.wrap.large-grid-block,.wrap.medium-grid-block,.wrap.small-grid-block{flex-wrap:wrap;align-items:flex-start}.shrink.grid-block,.shrink.grid-content,.shrink.large-grid-block,.shrink.large-grid-content,.shrink.medium-grid-block,.shrink.medium-grid-content,.shrink.small-grid-block,.shrink.small-grid-content{flex:0 0 auto}.grid-block,.grid-frame{display:flex;overflow:hidden;flex:1 1 auto;order:0;backface-visibility:hidden}.noscroll.grid-block,.noscroll.grid-content,.noscroll.large-grid-block,.noscroll.large-grid-content,.noscroll.medium-grid-block,.noscroll.medium-grid-content,.noscroll.small-grid-block,.noscroll.small-grid-content{overflow:hidden}.grid-frame{height:100vh;position:relative;flex-flow:row wrap;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start}.grid-block,.small-grid-block,.small-grid-block.panel,.small-grid-content.panel{height:auto;position:relative}.grid-block{flex-flow:row wrap;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.grid-content{display:block;padding:0 1rem;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;flex:1 1 auto}.grid-content.collapse{padding:0}.grid-content .grid-block{margin-left:-1rem;margin-right:-1rem;flex-wrap:wrap;overflow:visible}.grid-content .grid-block.nowrap{flex-wrap:nowrap;align-items:stretch}.grid-content .grid-block .grid-content{overflow:visible}.grid-container{max-width:56.25rem;margin:0 auto}.grid-container.contain-left{max-width:56.25rem;margin:0 auto 0 0}.grid-container.contain-right{max-width:56.25rem;margin:0 0 0 auto}.small-grid-block{display:flex;overflow:hidden;backface-visibility:hidden;flex:1 1 auto;flex-flow:row wrap;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;order:0;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.small-grid-content{display:block;padding:0 1rem;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;flex:1 1 auto}@media only screen and (min-width:40em){.medium-grid-block{display:flex;position:relative;overflow:hidden;backface-visibility:hidden;flex:1 1 auto;flex-flow:row wrap;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;order:0;height:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.medium-grid-block.panel{transform:none;position:relative;width:auto;height:auto;z-index:auto;box-shadow:none;background:0 0;top:auto;right:auto;bottom:auto;left:auto}.medium-grid-content{display:block;padding:0 1rem;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;flex:1 1 auto}.medium-grid-content.panel{transform:none;position:relative;width:auto;height:auto;z-index:auto;box-shadow:none;background:0 0;top:auto;right:auto;bottom:auto;left:auto}}@media only screen and (min-width:75em){.large-grid-block{display:flex;position:relative;overflow:hidden;backface-visibility:hidden;flex:1 1 auto;flex-flow:row wrap;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;order:0;height:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.large-grid-block.panel{transform:none;position:relative;width:auto;height:auto;z-index:auto;box-shadow:none;background:0 0;top:auto;right:auto;bottom:auto;left:auto}.large-grid-content{display:block;padding:0 1rem;overflow-y:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;flex:1 1 auto}.large-grid-content.panel{transform:none;position:relative;width:auto;height:auto;z-index:auto;box-shadow:none;background:0 0;top:auto;right:auto;bottom:auto;left:auto}}.small-up-1,.small-up-10,.small-up-11,.small-up-12,.small-up-2,.small-up-3,.small-up-4,.small-up-5,.small-up-6,.small-up-8,.small-up-9,.title-bar,.title-bar .center,.title-bar .left,.title-bar .right{overflow:visible}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-8{order:8}.order-9{order:9}.order-10{order:10}.order-11{order:11}.order-12{order:12}.small-1{flex:0 0 8.33333%;max-width:8.33333%}.small-order-1{order:1}.small-offset-1{margin-left:8.33333%}.small-up-1{flex-flow:row wrap}.small-up-1>div,.small-up-1>li,.small-up-1>section{padding:0 1rem 1rem;flex:0 0 100%}.small-2{flex:0 0 16.66667%;max-width:16.66667%}.small-order-2{order:2}.small-offset-2{margin-left:16.66667%}.small-up-2{flex-flow:row wrap}.small-up-2>div,.small-up-2>li,.small-up-2>section{padding:0 1rem 1rem;flex:0 0 50%}.small-3{flex:0 0 25%;max-width:25%}.small-order-3{order:3}.small-offset-3{margin-left:25%}.small-up-3{flex-flow:row wrap}.small-up-3>div,.small-up-3>li,.small-up-3>section{padding:0 1rem 1rem;flex:0 0 33.33333%}.small-4{flex:0 0 33.33333%;max-width:33.33333%}.small-order-4{order:4}.small-offset-4{margin-left:33.33333%}.small-up-4{flex-flow:row wrap}.small-up-4>div,.small-up-4>li,.small-up-4>section{padding:0 1rem 1rem;flex:0 0 25%}.small-5{flex:0 0 41.66667%;max-width:41.66667%}.small-order-5{order:5}.small-offset-5{margin-left:41.66667%}.small-up-5{flex-flow:row wrap;list-style-type:none}.small-up-5>div,.small-up-5>li,.small-up-5>section{padding:0 1rem 1rem;flex:0 0 20%}.small-6{flex:0 0 50%;max-width:50%}.small-order-6{order:6}.small-offset-6{margin-left:50%}.small-up-6{flex-flow:row wrap}.small-up-6>div,.small-up-6>li,.small-up-6>section{padding:0 1rem 1rem;flex:0 0 16.66667%}.small-7{flex:0 0 58.33333%;max-width:58.33333%}.small-order-7{order:7}.small-offset-7{margin-left:58.33333%}.small-up-7{flex-flow:row wrap;overflow:visible}.small-up-7>div,.small-up-7>li,.small-up-7>section{padding:0 1rem 1rem;flex:0 0 14.28571%}.small-8{flex:0 0 66.66667%;max-width:66.66667%}.small-order-8{order:8}.small-offset-8{margin-left:66.66667%}.small-up-8{flex-flow:row wrap}.small-up-8>div,.small-up-8>li,.small-up-8>section{padding:0 1rem 1rem;flex:0 0 12.5%}.small-9{flex:0 0 75%;max-width:75%}.small-order-9{order:9}.small-offset-9{margin-left:75%}.small-up-9{flex-flow:row wrap}.small-up-9>div,.small-up-9>li,.small-up-9>section{padding:0 1rem 1rem;flex:0 0 11.11111%}.small-10{flex:0 0 83.33333%;max-width:83.33333%}.small-order-10{order:10}.small-offset-10{margin-left:83.33333%}.small-up-10{flex-flow:row wrap}.small-up-10>div,.small-up-10>li,.small-up-10>section{padding:0 1rem 1rem;flex:0 0 10%}.small-11{flex:0 0 91.66667%;max-width:91.66667%}.small-order-11{order:11}.small-offset-11{margin-left:91.66667%}.small-up-11{flex-flow:row wrap}.small-up-11>div,.small-up-11>li,.small-up-11>section{padding:0 1rem 1rem;flex:0 0 9.09091%}.small-12{flex:0 0 100%;max-width:100%}.small-order-12{order:12}.small-offset-12{margin-left:100%}.small-up-12{flex-flow:row wrap}.small-up-12>div,.small-up-12>li,.small-up-12>section{padding:0 1rem 1rem;flex:0 0 8.33333%}@media only screen and (min-width:40em){.medium-1{flex:0 0 8.33333%;max-width:8.33333%}.medium-order-1{order:1}.medium-offset-1{margin-left:8.33333%}.medium-up-1{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-1>div,.medium-up-1>li,.medium-up-1>section{padding:0 1rem 1rem;flex:0 0 100%}.medium-2{flex:0 0 16.66667%;max-width:16.66667%}.medium-order-2{order:2}.medium-offset-2{margin-left:16.66667%}.medium-up-2{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-2>div,.medium-up-2>li,.medium-up-2>section{padding:0 1rem 1rem;flex:0 0 50%}.medium-3{flex:0 0 25%;max-width:25%}.medium-order-3{order:3}.medium-offset-3{margin-left:25%}.medium-up-3{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-3>div,.medium-up-3>li,.medium-up-3>section{padding:0 1rem 1rem;flex:0 0 33.33333%}.medium-4{flex:0 0 33.33333%;max-width:33.33333%}.medium-order-4{order:4}.medium-offset-4{margin-left:33.33333%}.medium-up-4{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-4>div,.medium-up-4>li,.medium-up-4>section{padding:0 1rem 1rem;flex:0 0 25%}.medium-5{flex:0 0 41.66667%;max-width:41.66667%}.medium-order-5{order:5}.medium-offset-5{margin-left:41.66667%}.medium-up-5{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-5>div,.medium-up-5>li,.medium-up-5>section{padding:0 1rem 1rem;flex:0 0 20%}.medium-6{flex:0 0 50%;max-width:50%}.medium-order-6{order:6}.medium-offset-6{margin-left:50%}.medium-up-6{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-6>div,.medium-up-6>li,.medium-up-6>section{padding:0 1rem 1rem;flex:0 0 16.66667%}.medium-7{flex:0 0 58.33333%;max-width:58.33333%}.medium-order-7{order:7}.medium-offset-7{margin-left:58.33333%}.medium-up-7{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-7>div,.medium-up-7>li,.medium-up-7>section{padding:0 1rem 1rem;flex:0 0 14.28571%}.medium-8{flex:0 0 66.66667%;max-width:66.66667%}.medium-order-8{order:8}.medium-offset-8{margin-left:66.66667%}.medium-up-8{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-8>div,.medium-up-8>li,.medium-up-8>section{padding:0 1rem 1rem;flex:0 0 12.5%}.medium-9{flex:0 0 75%;max-width:75%}.medium-order-9{order:9}.medium-offset-9{margin-left:75%}.medium-up-9{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-9>div,.medium-up-9>li,.medium-up-9>section{padding:0 1rem 1rem;flex:0 0 11.11111%}.medium-10{flex:0 0 83.33333%;max-width:83.33333%}.medium-order-10{order:10}.medium-offset-10{margin-left:83.33333%}.medium-up-10{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-10>div,.medium-up-10>li,.medium-up-10>section{padding:0 1rem 1rem;flex:0 0 10%}.medium-11{flex:0 0 91.66667%;max-width:91.66667%}.medium-order-11{order:11}.medium-offset-11{margin-left:91.66667%}.medium-up-11{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-11>div,.medium-up-11>li,.medium-up-11>section{padding:0 1rem 1rem;flex:0 0 9.09091%}.medium-12{flex:0 0 100%;max-width:100%}.medium-order-12{order:12}.medium-offset-12{margin-left:100%}.medium-up-12{flex-flow:row wrap;overflow:visible;list-style-type:none}.medium-up-12>div,.medium-up-12>li,.medium-up-12>section{padding:0 1rem 1rem;flex:0 0 8.33333%}}@media only screen and (min-width:75em){.large-1{flex:0 0 8.33333%;max-width:8.33333%}.large-order-1{order:1}.large-offset-1{margin-left:8.33333%}.large-up-1{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-1>div,.large-up-1>li,.large-up-1>section{padding:0 1rem 1rem;flex:0 0 100%}.large-2{flex:0 0 16.66667%;max-width:16.66667%}.large-order-2{order:2}.large-offset-2{margin-left:16.66667%}.large-up-2{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-2>div,.large-up-2>li,.large-up-2>section{padding:0 1rem 1rem;flex:0 0 50%}.large-3{flex:0 0 25%;max-width:25%}.large-order-3{order:3}.large-offset-3{margin-left:25%}.large-up-3{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-3>div,.large-up-3>li,.large-up-3>section{padding:0 1rem 1rem;flex:0 0 33.33333%}.large-4{flex:0 0 33.33333%;max-width:33.33333%}.large-order-4{order:4}.large-offset-4{margin-left:33.33333%}.large-up-4{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-4>div,.large-up-4>li,.large-up-4>section{padding:0 1rem 1rem;flex:0 0 25%}.large-5{flex:0 0 41.66667%;max-width:41.66667%}.large-order-5{order:5}.large-offset-5{margin-left:41.66667%}.large-up-5{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-5>div,.large-up-5>li,.large-up-5>section{padding:0 1rem 1rem;flex:0 0 20%}.large-6{flex:0 0 50%;max-width:50%}.large-order-6{order:6}.large-offset-6{margin-left:50%}.large-up-6{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-6>div,.large-up-6>li,.large-up-6>section{padding:0 1rem 1rem;flex:0 0 16.66667%}.large-7{flex:0 0 58.33333%;max-width:58.33333%}.large-order-7{order:7}.large-offset-7{margin-left:58.33333%}.large-up-7{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-7>div,.large-up-7>li,.large-up-7>section{padding:0 1rem 1rem;flex:0 0 14.28571%}.large-8{flex:0 0 66.66667%;max-width:66.66667%}.large-order-8{order:8}.large-offset-8{margin-left:66.66667%}.large-up-8{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-8>div,.large-up-8>li,.large-up-8>section{padding:0 1rem 1rem;flex:0 0 12.5%}.large-9{flex:0 0 75%;max-width:75%}.large-order-9{order:9}.large-offset-9{margin-left:75%}.large-up-9{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-9>div,.large-up-9>li,.large-up-9>section{padding:0 1rem 1rem;flex:0 0 11.11111%}.large-10{flex:0 0 83.33333%;max-width:83.33333%}.large-order-10{order:10}.large-offset-10{margin-left:83.33333%}.large-up-10{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-10>div,.large-up-10>li,.large-up-10>section{padding:0 1rem 1rem;flex:0 0 10%}.large-11{flex:0 0 91.66667%;max-width:91.66667%}.large-order-11{order:11}.large-offset-11{margin-left:91.66667%}.large-up-11{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-11>div,.large-up-11>li,.large-up-11>section{padding:0 1rem 1rem;flex:0 0 9.09091%}.large-12{flex:0 0 100%;max-width:100%}.large-order-12{order:12}.large-offset-12{margin-left:100%}.large-up-12{flex-flow:row wrap;overflow:visible;list-style-type:none}.large-up-12>div,.large-up-12>li,.large-up-12>section{padding:0 1rem 1rem;flex:0 0 8.33333%}}.title-bar,.title-bar.dark,.title-bar.primary{padding:1rem;border-bottom:1px solid #ccc}.grid-content .modal .grid-block{flex-wrap:nowrap}.title-bar{display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;background:#eee;color:#000}.title-bar .center,.title-bar .left,.title-bar .right{display:block;white-space:nowrap}.title-bar .center:first-child:last-child,.title-bar .left:first-child:last-child,.title-bar .right:first-child:last-child{flex:1;margin:0}.title-bar .left{order:1;flex:0 0 25%}.title-bar .center{order:2;flex:0 0 50%;text-align:center}.title-bar .right{order:3;flex:0 0 25%;text-align:right}.title-bar .left:first-child,.title-bar .left:first-child+.right:last-child{flex:1 1 auto}.title-bar .center:first-child:not(:last-child){margin-left:25%}.title-bar .center+.left{margin-right:-25%}.title-bar.primary{background:#00558b;color:#fff}.title-bar.primary a,.title-bar.primary a:hover{color:#fff}.title-bar.dark{background:#232323;color:#fff}.label,.label.primary{background:#00558b;border-radius:0;color:#fff}.title-bar.dark a,.title-bar.dark a:hover{color:#fff}.title-bar-bottom{border-bottom:0;border-top:1px solid #ccc}.label{line-height:1;white-space:nowrap;display:inline-block;cursor:default;font-size:.8rem;padding:.33333rem .5rem}.label.success{background:#43AC6A;border-radius:0;color:#fff}.label.warning{background:#F08A24;border-radius:0;color:#fff}.label.alert{background:#F04124;border-radius:0;color:#fff}.label.dark{background:#232323;border-radius:0;color:#fff}.badge{align-items:center;justify-content:center;display:inline-flex;border-radius:1000px;font-size:.8em;width:1.5rem;height:1.5rem;background:#00558b;color:#fff}.badge.secondary{background:#f1f1f1;color:#000}.badge.primary{background:#00558b;color:#fff}.badge.success{background:#43AC6A;color:#fff}.badge.warning{background:#F08A24;color:#fff}.badge.alert{background:#F04124;color:#fff}.badge.dark{background:#232323;color:#fff}.inline-list{text-align:left}.inline-list dd,.inline-list dt,.inline-list li{display:inline-block;margin-left:-2px;margin-right:-2px}.inline-list li{margin-right:1rem;margin-left:0}.menu-bar{display:flex;align-items:stretch;margin:0;background:#fff}.menu-bar>li{flex:1 0 auto;align-items:center}.menu-bar>li>a{display:flex;align-items:center;padding:1rem;font-size:1rem;line-height:1;color:#000}.menu-bar.label-corner>li>a,.menu-bar.label-side>li>a{padding-right:3.2rem}.menu-bar .is-active>a,.menu-bar>li>a:hover{background:#ededed;color:#000}.menu-bar .iconic *,.menu-bar .iconic .iconic-property-accent{fill:#000;stroke:#000}.menu-bar,.menu-bar.horizontal{overflow-x:hidden;flex-flow:row nowrap}.menu-bar.horizontal>li>a,.menu-bar.small-horizontal>li>a,.menu-bar.vertical,.menu-bar>li>a{flex-flow:column nowrap}.menu-bar.vertical{}.menu-bar.vertical>li>a{flex-flow:row nowrap}.menu-bar.condense>li{flex:0 0 auto}.menu-bar.align-right{justify-content:flex-end}.menu-bar.align-center{justify-content:center}.menu-bar.align-justify{justify-content:space-between}.menu-bar.align-spaced{justify-content:space-around}.menu-bar.small-condense li,.menu-group .menu-bar>li{flex:0 0 auto}.menu-bar.small-expand li{flex:1 0 auto}.menu-bar.small-align-left{justify-content:flex-start}.menu-bar.small-align-right{justify-content:flex-end}.menu-bar.small-align-center{justify-content:center}.menu-bar.small-align-justify{justify-content:space-between}.menu-bar.small-align-spaced{justify-content:space-around}@media only screen and (min-width:40em){.menu-bar.medium-condense li{flex:0 0 auto}.menu-bar.medium-expand li{flex:1 0 auto}.menu-bar.medium-align-left{justify-content:flex-start}.menu-bar.medium-align-right{justify-content:flex-end}.menu-bar.medium-align-center{justify-content:center}.menu-bar.medium-align-justify{justify-content:space-between}.menu-bar.medium-align-spaced{justify-content:space-around}}@media only screen and (min-width:75em){.menu-bar.large-condense li{flex:0 0 auto}.menu-bar.large-expand li{flex:1 0 auto}.menu-bar.large-align-left{justify-content:flex-start}.menu-bar.large-align-right{justify-content:flex-end}.menu-bar.large-align-center{justify-content:center}.menu-bar.large-align-justify{justify-content:space-between}.menu-bar.large-align-spaced{justify-content:space-around}}.menu-bar.small-horizontal{overflow-x:hidden;flex-flow:row nowrap}.menu-bar.small-vertical{flex-flow:column nowrap}.menu-bar.small-vertical>li>a{flex-flow:row nowrap}@media only screen and (min-width:40em){.menu-bar.medium-horizontal{overflow-x:hidden;flex-flow:row nowrap}.menu-bar.medium-horizontal>li>a{flex-flow:column nowrap}.menu-bar.medium-vertical{flex-flow:column nowrap}.menu-bar.medium-vertical>li>a{flex-flow:row nowrap}}@media only screen and (min-width:75em){.menu-bar.large-horizontal{overflow-x:hidden;flex-flow:row nowrap}.menu-bar.large-horizontal>li>a{flex-flow:column nowrap}.menu-bar.large-vertical{flex-flow:column nowrap}.menu-bar.large-vertical>li>a{flex-flow:row nowrap}}.menu-bar.icon-top>li>.iconic,.menu-bar.icon-top>li>img,.menu-bar>li>.iconic,.menu-bar>li>img{margin:0;width:25px;height:25px}.menu-bar.icon-top>li>a,.menu-bar>li>a{flex-flow:column nowrap}.menu-bar.icon-top>li>a>.iconic,.menu-bar.icon-top>li>a>img,.menu-bar>li>a>.iconic,.menu-bar>li>a>img{margin:0 0 1rem}.menu-bar.icon-right>li>.iconic,.menu-bar.icon-right>li>img{margin:0;width:25px;height:25px}.menu-bar.icon-right>li>a{flex-flow:row-reverse nowrap}.menu-bar.icon-right>li>a>.iconic,.menu-bar.icon-right>li>a>img{margin:0 0 0 1rem}.menu-bar.icon-bottom>li>.iconic,.menu-bar.icon-bottom>li>img{margin:0;width:25px;height:25px}.menu-bar.icon-bottom>li>a{flex-flow:column-reverse nowrap}.menu-bar.icon-bottom>li>a>.iconic,.menu-bar.icon-bottom>li>a>img{margin:1rem 0 0}.menu-bar.icon-left>li>.iconic,.menu-bar.icon-left>li>img{margin:0;width:25px;height:25px}.menu-bar.icon-left>li>a{flex-flow:row nowrap;align-items:center}.menu-bar.icon-left>li>a>.iconic,.menu-bar.icon-left>li>a>img{margin:0 1rem 0 0}.menu-bar.small-icon-top>li>.iconic,.menu-bar.small-icon-top>li>img{margin:0;width:25px;height:25px}.menu-bar.small-icon-top>li>a{flex-flow:column nowrap}.menu-bar.small-icon-top>li>a>.iconic,.menu-bar.small-icon-top>li>a>img{margin:0 0 1rem}.menu-bar.small-icon-right>li>.iconic,.menu-bar.small-icon-right>li>img{margin:0;width:25px;height:25px}.menu-bar.small-icon-right>li>a{flex-flow:row-reverse nowrap}.menu-bar.small-icon-right>li>a>.iconic,.menu-bar.small-icon-right>li>a>img{margin:0 0 0 1rem}.menu-bar.small-icon-bottom>li>.iconic,.menu-bar.small-icon-bottom>li>img{margin:0;width:25px;height:25px}.menu-bar.small-icon-bottom>li>a{flex-flow:column-reverse nowrap}.menu-bar.small-icon-bottom>li>a>.iconic,.menu-bar.small-icon-bottom>li>a>img{margin:1rem 0 0}.menu-bar.small-icon-left>li>.iconic,.menu-bar.small-icon-left>li>img{margin:0;width:25px;height:25px}.menu-bar.small-icon-left>li>a{flex-flow:row nowrap;align-items:center}.menu-bar.small-icon-left>li>a>.iconic,.menu-bar.small-icon-left>li>a>img{margin:0 1rem 0 0}@media only screen and (min-width:40em){.menu-bar.medium-icon-top>li>.iconic,.menu-bar.medium-icon-top>li>img{margin:0;width:25px;height:25px}.menu-bar.medium-icon-top>li>a{flex-flow:column nowrap}.menu-bar.medium-icon-top>li>a>.iconic,.menu-bar.medium-icon-top>li>a>img{margin:0 0 1rem}.menu-bar.medium-icon-right>li>.iconic,.menu-bar.medium-icon-right>li>img{margin:0;width:25px;height:25px}.menu-bar.medium-icon-right>li>a{flex-flow:row-reverse nowrap}.menu-bar.medium-icon-right>li>a>.iconic,.menu-bar.medium-icon-right>li>a>img{margin:0 0 0 1rem}.menu-bar.medium-icon-bottom>li>.iconic,.menu-bar.medium-icon-bottom>li>img{margin:0;width:25px;height:25px}.menu-bar.medium-icon-bottom>li>a{flex-flow:column-reverse nowrap}.menu-bar.medium-icon-bottom>li>a>.iconic,.menu-bar.medium-icon-bottom>li>a>img{margin:1rem 0 0}.menu-bar.medium-icon-left>li>.iconic,.menu-bar.medium-icon-left>li>img{margin:0;width:25px;height:25px}.menu-bar.medium-icon-left>li>a{flex-flow:row nowrap;align-items:center}.menu-bar.medium-icon-left>li>a>.iconic,.menu-bar.medium-icon-left>li>a>img{margin:0 1rem 0 0}}@media only screen and (min-width:75em){.menu-bar.large-icon-top>li>.iconic,.menu-bar.large-icon-top>li>img{margin:0;width:25px;height:25px}.menu-bar.large-icon-top>li>a{flex-flow:column nowrap}.menu-bar.large-icon-top>li>a>.iconic,.menu-bar.large-icon-top>li>a>img{margin:0 0 1rem}.menu-bar.large-icon-right>li>.iconic,.menu-bar.large-icon-right>li>img{margin:0;width:25px;height:25px}.menu-bar.large-icon-right>li>a{flex-flow:row-reverse nowrap}.menu-bar.large-icon-right>li>a>.iconic,.menu-bar.large-icon-right>li>a>img{margin:0 0 0 1rem}.menu-bar.large-icon-bottom>li>.iconic,.menu-bar.large-icon-bottom>li>img{margin:0;width:25px;height:25px}.menu-bar.large-icon-bottom>li>a{flex-flow:column-reverse nowrap}.menu-bar.large-icon-bottom>li>a>.iconic,.menu-bar.large-icon-bottom>li>a>img{margin:1rem 0 0}.menu-bar.large-icon-left>li>.iconic,.menu-bar.large-icon-left>li>img{margin:0;width:25px;height:25px}.menu-bar.large-icon-left>li>a{flex-flow:row nowrap;align-items:center}.menu-bar.large-icon-left>li>a>.iconic,.menu-bar.large-icon-left>li>a>img{margin:0 1rem 0 0}}.menu-bar.label-corner .menu-bar-label,.menu-bar.label-side .menu-bar-label{display:block;font-size:.9rem;width:1.2rem;height:1.2rem;line-height:1.2rem;text-align:center;border-radius:1000px;background:red;right:1rem;color:#fff;pointer-events:none}.menu-group .menu-bar,.modal .grid-block,.modal .grid-content{margin:0}.menu-bar.label-side>li{position:relative}.menu-bar.label-side .menu-bar-label{position:absolute;top:50%;transform:translateY(-50%)}.menu-bar.label-corner>li{position:relative}.menu-bar.label-corner .menu-bar-label{position:absolute;top:1rem}.menu-bar.primary{background:#00558b}.menu-bar.primary>li>a{color:#fff}.menu-bar.primary .is-active>a,.menu-bar.primary>li>a:hover{background:#0065a5;color:#fff}.menu-bar.primary .iconic *,.menu-bar.primary .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.menu-bar.dark{background:#232323}.menu-bar.dark>li>a{color:#fff}.menu-bar.dark .is-active>a,.menu-bar.dark>li>a:hover{background:#323232;color:#fff}.menu-bar.dark .iconic *,.menu-bar.dark .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.menu-bar>li.title{padding:1rem;cursor:default}.switch>label,.tabs .tab-item,a[ui-sref]{cursor:pointer}.menu-group{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap}@media only screen and (min-width:40em){.menu-group{flex-wrap:nowrap}}.menu-group>.menu-group-left,.menu-group>.menu-group-right{flex:1 1 100%}@media only screen and (min-width:40em){.menu-group>.menu-group-left,.menu-group>.menu-group-right{flex:0 0 auto}}.menu-group.primary{background-color:#00558b}.menu-group.primary .menu-bar{background:#00558b}.menu-group.primary .menu-bar>li>a{color:#fff}.menu-group.primary .menu-bar .is-active>a,.menu-group.primary .menu-bar>li>a:hover{background:#0065a5;color:#fff}.menu-group.primary .menu-bar .iconic *,.menu-group.primary .menu-bar .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.menu-group.dark{background-color:#232323}.menu-group.dark .menu-bar{background:#232323}.menu-group.dark .menu-bar>li>a{color:#fff}.menu-group.dark .menu-bar .is-active>a,.menu-group.dark .menu-bar>li>a:hover{background:#323232;color:#fff}.menu-group.dark .menu-bar .iconic *,.menu-group.dark .menu-bar .iconic .iconic-property-accent{fill:#fff;stroke:#fff}.modal{position:relative;z-index:1001;background:#fff;flex:0 0 auto;width:100%;height:100vh;max-height:100%;overflow:hidden;padding:1rem;max-width:600px;border-radius:0}@media only screen and (min-width:40em){.modal{height:auto;max-width:600px}}.modal .close-button,.modal [fa-close]{z-index:1001}.tiny>.modal{max-width:300px}.small>.modal{max-width:500px}.large>.modal{max-width:800px}.dialog>.modal{height:auto}.collapse>.modal{padding:0}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:none;background-color:rgba(51,51,51,.7);align-items:center;justify-content:center}.modal-overlay.is-active{display:flex}@keyframes shake{0%,10%,20%,30%,40%,50%,60%,70%,80%,90%{transform:translateX(7%)}15%,25%,35%,45%,5%,55%,65%,75%,85%,95%{transform:translateX(-7%)}100%{transform:translateX(0)}}@keyframes spin-cw{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin-ccw{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}@keyframes wiggle{40%,50%,60%{transform:rotate(7deg)}35%,45%,55%,65%{transform:rotate(-7deg)}0%,100%,30%,70%{transform:rotate(0)}}.slideInDown.ng-enter,.slideInDown.ng-hide-remove{backface-visibility:hidden;transform:translateY(-100%)}.slideInDown.ng-enter.ng-enter-active,.slideInDown.ng-hide-remove.ng-hide-remove-active{transform:translateX(0) translateY(0)}.slideInLeft.ng-enter,.slideInLeft.ng-hide-remove{backface-visibility:hidden;transform:translateX(100%)}.slideInLeft.ng-enter.ng-enter-active,.slideInLeft.ng-hide-remove.ng-hide-remove-active{transform:translateX(0) translateY(0)}.slideInUp.ng-enter,.slideInUp.ng-hide-remove{backface-visibility:hidden;transform:translateY(100%)}.slideInUp.ng-enter.ng-enter-active,.slideInUp.ng-hide-remove.ng-hide-remove-active{transform:translateX(0) translateY(0)}.slideInRight.ng-enter,.slideInRight.ng-hide-remove{backface-visibility:hidden;transform:translateX(-100%)}.slideInRight.ng-enter.ng-enter-active,.slideInRight.ng-hide-remove.ng-hide-remove-active{transform:translateX(0) translateY(0)}.slideOutBottom.ng-hide-add,.slideOutBottom.ng-leave{backface-visibility:hidden;transform:translateX(0) translateY(0)}.slideOutBottom.ng-hide-add.ng-hide-add-active,.slideOutBottom.ng-leave.ng-leave-active{transform:translateY(100%)}.slideOutRight.ng-hide-add,.slideOutRight.ng-leave{backface-visibility:hidden;transform:translateX(0) translateY(0)}.slideOutRight.ng-hide-add.ng-hide-add-active,.slideOutRight.ng-leave.ng-leave-active{transform:translateX(100%)}.slideOutUp.ng-hide-add,.slideOutUp.ng-leave{backface-visibility:hidden;transform:translateX(0) translateY(0)}.slideOutUp.ng-hide-add.ng-hide-add-active,.slideOutUp.ng-leave.ng-leave-active{transform:translateY(-100%)}.slideOutLeft.ng-hide-add,.slideOutLeft.ng-leave{backface-visibility:hidden;transform:translateX(0) translateY(0)}.fadeIn.ng-enter,.fadeIn.ng-hide-remove,.fadeOut.ng-hide-add,.fadeOut.ng-leave{transition-duration:.5s;transition-timing-function:ease;transition-delay:0;transition-property:opacity}.slideOutLeft.ng-hide-add.ng-hide-add-active,.slideOutLeft.ng-leave.ng-leave-active{transform:translateX(-100%)}.fadeIn.ng-enter,.fadeIn.ng-hide-remove{opacity:0}.fadeIn.ng-enter.ng-enter-active,.fadeIn.ng-hide-remove.ng-hide-remove-active,.fadeOut.ng-hide-add,.fadeOut.ng-leave{opacity:1}.hingeInFromBottom.ng-enter,.hingeInFromBottom.ng-hide-remove,.hingeInFromLeft.ng-enter,.hingeInFromLeft.ng-hide-remove,.hingeInFromMiddleX.ng-enter,.hingeInFromMiddleX.ng-hide-remove,.hingeInFromRight.ng-enter,.hingeInFromRight.ng-hide-remove,.hingeInFromTop.ng-enter,.hingeInFromTop.ng-hide-remove,.hingeOutFromBottom.ng-hide-add,.hingeOutFromBottom.ng-leave,.hingeOutFromLeft.ng-hide-add,.hingeOutFromLeft.ng-leave,.hingeOutFromMiddleX.ng-hide-add,.hingeOutFromMiddleX.ng-leave,.hingeOutFromMiddleY.ng-hide-add,.hingeOutFromMiddleY.ng-leave,.hingeOutFromRight.ng-hide-add,.hingeOutFromRight.ng-leave,.hingeOutFromTop.ng-hide-add,.hingeOutFromTop.ng-leave{transition-duration:.5s;transition-timing-function:ease;transition-delay:0;transition-property:transform,opacity}.fadeOut.ng-hide-add.ng-hide-add-active,.fadeOut.ng-leave.ng-leave-active{opacity:0}.hingeInFromTop.ng-enter,.hingeInFromTop.ng-hide-remove{transform:perspective(2000px) rotateX(-90deg);transform-origin:top;opacity:0}.hingeInFromTop.ng-enter.ng-enter-active,.hingeInFromTop.ng-hide-remove.ng-hide-remove-active{transform:rotate(0);opacity:1}.hingeInFromRight.ng-enter,.hingeInFromRight.ng-hide-remove{transform:perspective(2000px) rotateY(-90deg);transform-origin:right;opacity:0}.hingeInFromRight.ng-enter.ng-enter-active,.hingeInFromRight.ng-hide-remove.ng-hide-remove-active{transform:rotate(0);opacity:1}.hingeInFromBottom.ng-enter,.hingeInFromBottom.ng-hide-remove{transform:perspective(2000px) rotateX(90deg);transform-origin:bottom;opacity:0}.hingeInFromBottom.ng-enter.ng-enter-active,.hingeInFromBottom.ng-hide-remove.ng-hide-remove-active{transform:rotate(0);opacity:1}.hingeInFromLeft.ng-enter,.hingeInFromLeft.ng-hide-remove{transform:perspective(2000px) rotateY(90deg);transform-origin:left;opacity:0}.hingeInFromLeft.ng-enter.ng-enter-active,.hingeInFromLeft.ng-hide-remove.ng-hide-remove-active{transform:rotate(0);opacity:1}.hingeInFromMiddleX.ng-enter,.hingeInFromMiddleX.ng-hide-remove{transform:perspective(2000px) rotateX(-90deg);transform-origin:center;opacity:0}.hingeInFromMiddleX.ng-enter.ng-enter-active,.hingeInFromMiddleX.ng-hide-remove.ng-hide-remove-active{transform:rotate(0);opacity:1}.hingeInFromMiddleY.ng-enter,.hingeInFromMiddleY.ng-hide-remove{transition-duration:.5s;transition-timing-function:ease;transition-delay:0;transition-property:transform,opacity;transform:perspective(2000px) rotateY(-90deg);transform-origin:center;opacity:0}.hingeInFromMiddleY.ng-enter.ng-enter-active,.hingeInFromMiddleY.ng-hide-remove.ng-hide-remove-active{transform:rotate(0);opacity:1}.hingeOutFromTop.ng-hide-add,.hingeOutFromTop.ng-leave{transform:rotate(0);transform-origin:top;opacity:1}.hingeOutFromTop.ng-hide-add.ng-hide-add-active,.hingeOutFromTop.ng-leave.ng-leave-active{transform:perspective(2000px) rotateX(-90deg);opacity:0}.hingeOutFromRight.ng-hide-add,.hingeOutFromRight.ng-leave{transform:rotate(0);transform-origin:right;opacity:1}.hingeOutFromRight.ng-hide-add.ng-hide-add-active,.hingeOutFromRight.ng-leave.ng-leave-active{transform:perspective(2000px) rotateY(-90deg);opacity:0}.hingeOutFromBottom.ng-hide-add,.hingeOutFromBottom.ng-leave{transform:rotate(0);transform-origin:bottom;opacity:1}.hingeOutFromBottom.ng-hide-add.ng-hide-add-active,.hingeOutFromBottom.ng-leave.ng-leave-active{transform:perspective(2000px) rotateX(90deg);opacity:0}.hingeOutFromLeft.ng-hide-add,.hingeOutFromLeft.ng-leave{transform:rotate(0);transform-origin:left;opacity:1}.hingeOutFromLeft.ng-hide-add.ng-hide-add-active,.hingeOutFromLeft.ng-leave.ng-leave-active{transform:perspective(2000px) rotateY(90deg);opacity:0}.hingeOutFromMiddleX.ng-hide-add,.hingeOutFromMiddleX.ng-leave{transform:rotate(0);transform-origin:center;opacity:1}.hingeOutFromMiddleX.ng-hide-add.ng-hide-add-active,.hingeOutFromMiddleX.ng-leave.ng-leave-active{transform:perspective(2000px) rotateX(-90deg);opacity:0}.hingeOutFromMiddleY.ng-hide-add,.hingeOutFromMiddleY.ng-leave{transform:rotate(0);transform-origin:center;opacity:1}.zoomIn.ng-enter,.zoomIn.ng-hide-remove,.zoomOut.ng-hide-add,.zoomOut.ng-leave{transition-duration:.5s;transition-timing-function:ease;transition-delay:0;transition-property:transform,property}.hingeOutFromMiddleY.ng-hide-add.ng-hide-add-active,.hingeOutFromMiddleY.ng-leave.ng-leave-active{transform:perspective(2000px) rotateY(-90deg);opacity:0}.zoomIn.ng-enter,.zoomIn.ng-hide-remove{transform:scale(1.5);opacity:0}.zoomIn.ng-enter.ng-enter-active,.zoomIn.ng-hide-remove.ng-hide-remove-active{transform:scale(1);opacity:1}.zoomOut.ng-hide-add,.zoomOut.ng-leave{transform:scale(.5);opacity:1}.zoomOut.ng-hide-add.ng-hide-add-active,.zoomOut.ng-leave.ng-leave-active{transform:scale(1);opacity:0}.spinIn.ng-enter,.spinIn.ng-hide-remove{transition-property:transform,opacity;transform:rotate(-270deg);opacity:0}.spinIn.ng-enter.ng-enter-active,.spinIn.ng-hide-remove.ng-hide-remove-active{transform:rotate(0);opacity:1}.spinOut.ng-hide-add,.spinOut.ng-leave{transition-property:transform,opacity;transform:rotate(0);opacity:1}.spinOut.ng-hide-add.ng-hide-add-active,.spinOut.ng-leave.ng-leave-active{transform:rotate(270deg);opacity:0}.spinInCCW.ng-enter,.spinInCCW.ng-hide-remove{transition-property:transform,opacity;transform:rotate(270deg);opacity:0}.spinInCCW.ng-enter.ng-enter-active,.spinInCCW.ng-hide-remove.ng-hide-remove-active{transform:rotate(0);opacity:1}.spinOutCCW.ng-hide-add,.spinOutCCW.ng-leave{transition-property:transform,opacity;transform:rotate(0);opacity:1}.spinOutCCW.ng-hide-add.ng-hide-add-active,.spinOutCCW.ng-leave.ng-leave-active{transform:rotate(-270deg);opacity:0}.shake,.spin-ccw,.spin-cw,.wiggle{animation-duration:.5s;animation-timing-function:ease;transform:translate3d(0,0,0);animation-delay:0;backface-visibility:hidden}.slow{transition-duration:750ms!important}.fast{transition-duration:250ms!important}.linear{transition-timing-function:linear!important}.ease{transition-timing-function:ease!important}.easeIn{transition-timing-function:ease-in!important}.easeOut{transition-timing-function:ease-out!important}.easeInOut{transition-timing-function:ease-in-out!important}.bounceIn{transition-timing-function:cubic-bezier(.485,.155,.24,1.245)!important}.bounceOut{transition-timing-function:cubic-bezier(.485,.155,.515,.845)!important}.bounceInOut{transition-timing-function:cubic-bezier(.76,-.245,.24,1.245)!important}.delay{transition-delay:.3s!important}.long-delay{transition-delay:.7s!important}.shake{animation-name:shake}.spin-cw{animation-name:spin-cw}.spin-ccw{animation-name:spin-ccw}.wiggle{animation-name:wiggle}.shake.infinite,.spin-ccw.infinite,.spin-cw.infinite,.wiggle.infinite{animation-iteration-count:infinite}.shake.linear,.spin-ccw.linear,.spin-cw.linear,.wiggle.linear{animation-timing-function:linear!important}.shake.ease,.spin-ccw.ease,.spin-cw.ease,.wiggle.ease{animation-timing-function:ease!important}.shake.easeIn,.spin-ccw.easeIn,.spin-cw.easeIn,.wiggle.easeIn{animation-timing-function:ease-in!important}.shake.easeOut,.spin-ccw.easeOut,.spin-cw.easeOut,.wiggle.easeOut{animation-timing-function:ease-out!important}.shake.easeInOut,.spin-ccw.easeInOut,.spin-cw.easeInOut,.wiggle.easeInOut{animation-timing-function:ease-in-out!important}.shake.bounceIn,.spin-ccw.bounceIn,.spin-cw.bounceIn,.wiggle.bounceIn{animation-timing-function:cubic-bezier(.485,.155,.24,1.245)!important}.shake.bounceOut,.spin-ccw.bounceOut,.spin-cw.bounceOut,.wiggle.bounceOut{animation-timing-function:cubic-bezier(.485,.155,.515,.845)!important}.shake.bounceInOut,.spin-ccw.bounceInOut,.spin-cw.bounceInOut,.wiggle.bounceInOut{animation-timing-function:cubic-bezier(.76,-.245,.24,1.245)!important}.shake.slow,.spin-ccw.slow,.spin-cw.slow,.wiggle.slow{animation-duration:750ms!important}.shake.fast,.spin-ccw.fast,.spin-cw.fast,.wiggle.fast{animation-duration:250ms!important}.shake.delay,.spin-ccw.delay,.spin-cw.delay,.wiggle.delay{animation-delay:.3s!important}.shake.long-delay,.spin-ccw.long-delay,.spin-cw.long-delay,.wiggle.long-delay{animation-delay:.7s!important}.long-stagger,.stagger,.stort-stagger{transition-delay:150ms;transition-duration:0}.position-absolute{overflow:hidden;position:relative}.ui-animation.ng-enter-active,.ui-animation.ng-leave-active{position:absolute!important;backface-visibility:hidden;-webkit-transform-style:preserve-3d;top:0;right:0;bottom:0;left:0}.notification,.static-notification{z-index:1000;position:relative;margin-top:.5rem;margin-bottom:.5rem;display:none}.notification h1,.static-notification h1{font-size:1.25em;margin:0}.notification p,.static-notification p{margin:0}.is-active.notification,.is-active.static-notification{display:flex}.notification .close-button,.static-notification .close-button{color:#fff}.notification-container{z-index:3000;position:fixed;display:flex;flex-direction:column}.notification{background:#00558b;padding:1rem;border-radius:4px}.notification,.notification h1,.notification h2,.notification h3,.notification h4,.notification h5,.notification h6{color:#fff}.notification.success{background:#43AC6A;padding:1rem;border-radius:4px}.notification.success,.notification.success h1,.notification.success h2,.notification.success h3,.notification.success h4,.notification.success h5,.notification.success h6{color:#fff}.notification.warning{background:#F08A24;padding:1rem;border-radius:4px}.notification.warning,.notification.warning h1,.notification.warning h2,.notification.warning h3,.notification.warning h4,.notification.warning h5,.notification.warning h6{color:#fff}.notification.alert{background:#F04124;padding:1rem;border-radius:4px}.notification.alert,.notification.alert h1,.notification.alert h2,.notification.alert h3,.notification.alert h4,.notification.alert h5,.notification.alert h6{color:#fff}.notification.dark{background:#232323;padding:1rem;border-radius:4px}.notification.dark,.notification.dark h1,.notification.dark h2,.notification.dark h3,.notification.dark h4,.notification.dark h5,.notification.dark h6{color:#fff}.static-notification{background:#00558b;padding:1rem;border-radius:4px;position:fixed!important}.static-notification,.static-notification h1,.static-notification h2,.static-notification h3,.static-notification h4,.static-notification h5,.static-notification h6{color:#fff}.static-notification.top-right{width:25rem;right:1rem;top:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.static-notification.top-right{width:auto;left:1rem;right:1rem;margin-left:0}}.static-notification.top-left{width:25rem;left:1rem;top:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.static-notification.top-left{width:auto;left:1rem;right:1rem;margin-left:0}}.static-notification.top-middle{width:25rem;left:50%;margin-left:-12.5rem;top:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.static-notification.top-middle{width:auto;left:1rem;right:1rem;margin-left:0}}.static-notification.bottom-right{width:25rem;right:1rem;top:auto;bottom:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.static-notification.bottom-right{width:auto;left:1rem;right:1rem;margin-left:0}}.static-notification.bottom-left{width:25rem;left:1rem;top:auto;bottom:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.static-notification.bottom-left{width:auto;left:1rem;right:1rem;margin-left:0}}.static-notification.bottom-middle{width:25rem;left:50%;margin-left:-12.5rem;top:auto;bottom:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.static-notification.bottom-middle{width:auto;left:1rem;right:1rem;margin-left:0}}.static-notification.success{background:#43AC6A;padding:1rem;border-radius:4px}.static-notification.success,.static-notification.success h1,.static-notification.success h2,.static-notification.success h3,.static-notification.success h4,.static-notification.success h5,.static-notification.success h6{color:#fff}.static-notification.warning{background:#F08A24;padding:1rem;border-radius:4px}.static-notification.warning,.static-notification.warning h1,.static-notification.warning h2,.static-notification.warning h3,.static-notification.warning h4,.static-notification.warning h5,.static-notification.warning h6{color:#fff}.static-notification.alert{background:#F04124;padding:1rem;border-radius:4px}.static-notification.alert,.static-notification.alert h1,.static-notification.alert h2,.static-notification.alert h3,.static-notification.alert h4,.static-notification.alert h5,.static-notification.alert h6{color:#fff}.static-notification.dark{background:#232323;padding:1rem;border-radius:4px}.off-canvas,.off-canvas~.grid-frame{transition:transform .25s ease-out;background:#fff}.static-notification.dark,.static-notification.dark h1,.static-notification.dark h2,.static-notification.dark h3,.static-notification.dark h4,.static-notification.dark h5,.static-notification.dark h6{color:#fff}.notification-container{width:25rem;right:1rem;top:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.notification-container{width:auto;left:1rem;right:1rem;margin-left:0}}.notification-container.top-right{width:25rem;right:1rem;top:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.notification-container.top-right{width:auto;left:1rem;right:1rem;margin-left:0}}.notification-container.top-left{width:25rem;left:1rem;top:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.notification-container.top-left{width:auto;left:1rem;right:1rem;margin-left:0}}.notification-container.top-middle{width:25rem;left:50%;margin-left:-12.5rem;top:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.notification-container.top-middle{width:auto;left:1rem;right:1rem;margin-left:0}}.notification-container.bottom-right{width:25rem;right:1rem;top:auto;bottom:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.notification-container.bottom-right{width:auto;left:1rem;right:1rem;margin-left:0}}.notification-container.bottom-left{width:25rem;left:1rem;top:auto;bottom:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.notification-container.bottom-left{width:auto;left:1rem;right:1rem;margin-left:0}}.notification-container.bottom-middle{width:25rem;left:50%;margin-left:-12.5rem;top:auto;bottom:1rem}@media only screen and (min-width:0em) and (max-width:39.9375rem){.notification-container.bottom-middle{width:auto;left:1rem;right:1rem;margin-left:0}}.notification-icon{flex:0 0 60px;margin-right:1rem}.notification-icon img{width:100%;height:auto}.notification-content{flex:1}.is-active.off-canvas{transform:translate(0,0)!important}.off-canvas~.grid-frame{transform:translate(0,0,0);backface-visibility:hidden}.off-canvas{position:fixed;overflow:auto;-webkit-overflow-scrolling:touch;z-index:2;width:250px;height:100%;top:0;left:0;box-shadow:inset -3px 0 10px rgba(0,0,0,.25);transform:translateX(-100%);color:#000}.popup,.switch{overflow:hidden}.off-canvas.is-active~.grid-frame{transform:translateX(250px)!important}.off-canvas.top{height:250px;width:100%;top:0;left:0;transform:translateY(-100%);box-shadow:inset 0 -3px 10px rgba(0,0,0,.25)}.off-canvas.top.is-active~.grid-frame{transform:translateY(250px)!important}.off-canvas.right{width:250px;height:100%;left:auto;top:0;right:0;box-shadow:inset 3px 0 10px rgba(0,0,0,.25);transform:translateX(100%)}.off-canvas.right.is-active~.grid-frame{transform:translateX(-250px)!important}.off-canvas.bottom{height:250px;width:100%;top:auto;bottom:0;left:0;transform:translateY(100%);box-shadow:inset 0 3px 10px rgba(0,0,0,.25)}.off-canvas.bottom.is-active~.grid-frame{transform:translateY(-250px)!important}.off-canvas.left{width:250px;height:100%;top:0;left:0;box-shadow:inset -3px 0 10px rgba(0,0,0,.25);transform:translateX(-100%)}.off-canvas.left.is-active~.grid-frame{transform:translateX(250px)!important}.off-canvas.detached{z-index:0;box-shadow:none}.off-canvas.detached,.off-canvas.detached.is-active{transform:none}.off-canvas.detached~.grid-frame{z-index:1;box-shadow:0 0 15px rgba(0,0,0,.5)}.popup,.popup.dark,.popup.primary{box-shadow:0 0 10px rgba(0,0,0,.25)}.off-canvas.primary{background:#00558b;color:#fff}.off-canvas.dark{background:#232323;color:#fff}.popup{position:absolute;z-index:1000;opacity:0;transition:opacity .25s ease-out;pointer-events:none;width:18.75rem;background:#fff;border-radius:0;border:0}.tether-enabled.popup{opacity:1;pointer-events:auto}.popup.dark{background:#232323;border-radius:0;border:0}.popup.primary{background:#00558b;border-radius:0;border:0}.switch{position:relative;display:inline-block}.switch>input{position:absolute;left:-9999px;outline:0}.switch>label{-ms-touch-action:manipulation;touch-action:manipulation;display:block;width:100%;height:100%;margin:0;background:#ccc}.switch,.switch>label::after{height:2rem;border-radius:9999px}.switch{width:3.125rem}.switch>label::after{content:'';display:block;position:absolute;top:0;left:0;width:2rem;background:#fff;transition:left .15s ease-out;border:4px solid #ccc}.switch input:checked+label::after{left:1.125rem;border-color:#00558b}.switch input:checked+label{background:#00558b;margin:0}.tabs,.tabs.vertical{display:flex;background:0 0}.switch.small{width:2.5rem;height:1.625rem}.switch.small>label::after{width:1.625rem;height:1.625rem}.switch.small input:checked+label::after{left:.875rem}.switch.large{width:3.75rem;height:2.375rem}.switch.large>label::after{width:2.375rem;height:2.375rem}.switch.large input:checked+label::after{left:1.375rem}.tabs{flex-flow:row wrap}.tabs.vertical{flex-flow:column nowrap}.tabs .tab-item{background:#f3f3f3;padding:1rem;line-height:1;margin:0;flex:0 1 auto;color:#000}.tabs .tab-item.is-active{background:#ececec;color:#000}.tabs .tab-item.is-active:hover,.tabs .tab-item:hover{background:#e7e7e7}.tab-contents{padding:1rem}.tab-contents .tab-content{display:none}.tab-contents .tab-content.is-active{display:block}.accordion{border:1px solid #cbcbcb}.accordion-title{padding:1rem;background:#f3f3f3;color:#000;line-height:1;cursor:pointer}.accordion-title:hover{background:#e7e7e7}.is-active>.accordion-title{background:#ececec;color:#000}.accordion-content{padding:1rem;display:none}.is-active>.accordion-content{display:block}blockquote,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,li,ol,p,pre,td,th,ul{margin:0;padding:0}a{color:#00558b;text-decoration:none;line-height:inherit}p,p.lead{line-height:1.6}a:focus,a:hover{color:#004978}a img{border:none}p{font-family:inherit;font-size:1rem;margin-bottom:1.25rem}.subheader,h1,h2,h3,h4,h5,h6{margin-top:.2rem;margin-bottom:.5rem;font-weight:400}p.lead{font-size:1.21875rem}p aside{font-size:.875rem;line-height:1.35;font-style:italic}h1,h2,h3,h4,h5,h6{font-family:"Helvetica Neue",Helvetica,Helvetica,Arial,sans-serif;font-style:normal;color:#222;line-height:1.4}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-size:60%;color:#6f6f6f;line-height:0}h1{font-size:2.125rem}h2{font-size:1.6875rem}h3{font-size:1.375rem}h4,h5{font-size:1.125rem}h6{font-size:1rem}.subheader{line-height:1.4;color:#6f6f6f}b,em,i,small,strong{line-height:inherit}hr{border:solid #ddd;border-width:1px 0 0;margin:1.25rem 0 1.1875rem;height:0}em,i{font-style:italic}small{font-size:60%;color:#6f6f6f}code{font-family:Consolas,"Liberation Mono",Courier,monospace;font-weight:400;color:#464646;background-color:#fbfbfb;border-width:1px;border-style:solid;border-color:#e2e2e2;padding:.125rem .3125rem .0625rem}dl,ol,ul{font-size:1rem;line-height:1.6;margin-bottom:1.25rem;list-style-position:outside;font-family:inherit}ol,ul{margin-left:1.1rem}ol li ol,ol li ul,ul li ol,ul li ul{margin-left:1.25rem;margin-bottom:0}ul.no-bullet{margin-left:0}dl dt{margin-bottom:.3rem;font-weight:700}dl dd{margin-bottom:.75rem}abbr,acronym{text-transform:uppercase;font-size:90%;color:#222;border-bottom:1px dotted #ddd;cursor:help}abbr{text-transform:none}blockquote{margin:0 0 1.25rem;padding:.5625rem 1.25rem 0 1.1875rem;border-left:1px solid #ddd}blockquote cite{display:block;font-size:.8125rem;color:#555}blockquote cite:before{content:"\2014 \0020"}blockquote cite a,blockquote cite a:visited{color:#555}blockquote,blockquote p{line-height:1.6;color:#6f6f6f}.v-align{display:flex;align-items:center;justify-content:space-between}.v-align .align-center{align-self:center}.v-align .align-bottom{align-self:flex-end}.v-align .small-align-top{align-self:flex-start}.v-align .small-align-center{align-self:center}.v-align .small-align-bottom{align-self:flex-end}.hide{display:none!important}.invisible{visibility:hidden}.hide-for-small:not(.ng-hide){display:block!important;display:none!important}.hide-for-small[class*=grid-block]:not(.ng-hide){display:flex!important;display:none!important}.show-for-small:not(.ng-hide){display:none!important;display:block!important}.show-for-small[class*=grid-block]:not(.ng-hide){display:none!important;display:flex!important}.hide-for-small-only:not(.ng-hide){display:block!important}@media only screen and (min-width:0em) and (max-width:39.9375rem){.hide-for-small-only:not(.ng-hide){display:none!important}}.hide-for-small-only[class*=grid-block]:not(.ng-hide){display:flex!important}.show-for-small-only:not(.ng-hide){display:none!important}@media only screen and (min-width:0em) and (max-width:39.9375rem){.hide-for-small-only[class*=grid-block]:not(.ng-hide){display:none!important}.show-for-small-only:not(.ng-hide){display:block!important}}.show-for-small-only[class*=grid-block]:not(.ng-hide){display:none!important}@media only screen and (min-width:0em) and (max-width:39.9375rem){.show-for-small-only[class*=grid-block]:not(.ng-hide){display:flex!important}.small-only-text-left{text-align:left}}.hide-for-medium:not(.ng-hide){display:block!important}@media only screen and (min-width:40em){h1,h2,h3,h4,h5,h6{line-height:1.4}h1{font-size:2.75rem}h2{font-size:2.3125rem}h3{font-size:1.6875rem}h4{font-size:1.4375rem}h5{font-size:1.125rem}h6{font-size:1rem}.v-align .medium-align-top{align-self:flex-start}.v-align .medium-align-center{align-self:center}.v-align .medium-align-bottom{align-self:flex-end}.hide-for-medium:not(.ng-hide){display:none!important}}.hide-for-medium[class*=grid-block]:not(.ng-hide){display:flex!important}.show-for-medium:not(.ng-hide){display:none!important}@media only screen and (min-width:40em){.hide-for-medium[class*=grid-block]:not(.ng-hide){display:none!important}.show-for-medium:not(.ng-hide){display:block!important}}.show-for-medium[class*=grid-block]:not(.ng-hide){display:none!important}@media only screen and (min-width:40em){.show-for-medium[class*=grid-block]:not(.ng-hide){display:flex!important}.medium-text-left{text-align:left}}.hide-for-medium-only:not(.ng-hide){display:block!important}@media only screen and (min-width:40em) and (max-width:74.9375rem){.hide-for-medium-only:not(.ng-hide){display:none!important}}.hide-for-medium-only[class*=grid-block]:not(.ng-hide){display:flex!important}.show-for-medium-only:not(.ng-hide){display:none!important}@media only screen and (min-width:40em) and (max-width:74.9375rem){.hide-for-medium-only[class*=grid-block]:not(.ng-hide){display:none!important}.show-for-medium-only:not(.ng-hide){display:block!important}}.show-for-medium-only[class*=grid-block]:not(.ng-hide){display:none!important}@media only screen and (min-width:40em) and (max-width:74.9375rem){.show-for-medium-only[class*=grid-block]:not(.ng-hide){display:flex!important}.medium-only-text-left{text-align:left}}.hide-for-large:not(.ng-hide){display:block!important}@media only screen and (min-width:75em){.v-align .large-align-top{align-self:flex-start}.v-align .large-align-center{align-self:center}.v-align .large-align-bottom{align-self:flex-end}.hide-for-large:not(.ng-hide){display:none!important}}.hide-for-large[class*=grid-block]:not(.ng-hide){display:flex!important}.show-for-large:not(.ng-hide){display:none!important}@media only screen and (min-width:75em){.hide-for-large[class*=grid-block]:not(.ng-hide){display:none!important}.show-for-large:not(.ng-hide){display:block!important}}.show-for-large[class*=grid-block]:not(.ng-hide){display:none!important}@media only screen and (min-width:75em){.show-for-large[class*=grid-block]:not(.ng-hide){display:flex!important}.large-text-left{text-align:left}}.hide-for-large-only:not(.ng-hide){display:block!important}@media only screen and (min-width:75em) and (max-width:89.9375rem){.hide-for-large-only:not(.ng-hide){display:none!important}}.hide-for-large-only[class*=grid-block]:not(.ng-hide){display:flex!important}.show-for-large-only:not(.ng-hide){display:none!important}@media only screen and (min-width:75em) and (max-width:89.9375rem){.hide-for-large-only[class*=grid-block]:not(.ng-hide){display:none!important}.show-for-large-only:not(.ng-hide){display:block!important}}.show-for-large-only[class*=grid-block]:not(.ng-hide){display:none!important}@media only screen and (min-width:75em) and (max-width:89.9375rem){.show-for-large-only[class*=grid-block]:not(.ng-hide){display:flex!important}.large-only-text-left{text-align:left}}@media only screen and (orientation:portrait){.hide-for-portrait{display:none!important}.hide-for-portrait[class*=grid-block]{display:flex!important}}.show-for-portrait{display:none!important}@media only screen and (orientation:portrait){.show-for-portrait{display:block!important}.show-for-portrait[class*=grid-block]{display:flex!important}}@media only screen and (orientation:landscape){.hide-for-landscape{display:none!important}.hide-for-landscape[class*=grid-block]{display:flex!important}}.show-for-landscape{display:none!important}@media only screen and (orientation:landscape){.show-for-landscape{display:block!important}.show-for-landscape[class*=grid-block]{display:flex!important}}.small-text-left,.text-left{text-align:left}.small-text-right,.text-right{text-align:right}@media only screen and (min-width:0em) and (max-width:39.9375rem){.small-only-text-right{text-align:right}}@media only screen and (min-width:40em){.medium-text-right{text-align:right}}@media only screen and (min-width:40em) and (max-width:74.9375rem){.medium-only-text-right{text-align:right}}@media only screen and (min-width:75em){.large-text-right{text-align:right}}@media only screen and (min-width:75em) and (max-width:89.9375rem){.large-only-text-right{text-align:right}.large-only-text-center{text-align:center}}.small-text-center,.text-center{text-align:center}@media only screen and (min-width:0em) and (max-width:39.9375rem){.small-only-text-center{text-align:center}}@media only screen and (min-width:40em){.medium-text-center{text-align:center}}@media only screen and (min-width:40em) and (max-width:74.9375rem){.medium-only-text-center{text-align:center}}@media only screen and (min-width:75em){.large-text-center{text-align:center}.large-text-justify{text-align:justify}}.small-text-justify,.text-justify{text-align:justify}@media only screen and (min-width:0em) and (max-width:39.9375rem){.small-only-text-justify{text-align:justify}}@media only screen and (min-width:40em){.medium-text-justify{text-align:justify}}@media only screen and (min-width:40em) and (max-width:74.9375rem){.medium-only-text-justify{text-align:justify}}@media only screen and (min-width:75em) and (max-width:89.9375rem){.large-only-text-justify{text-align:justify}}.clearfix:after,.clearfix:before{content:" ";display:table}.float-left{float:left}.float-right{float:right}.float-none{float:none} +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2Jvd2VyX2NvbXBvbmVudHMvZm91bmRhdGlvbi1hcHBzL3Njc3MvY29tcG9uZW50cy9fYmxvY2stbGlzdC5zY3NzIiwiLi4vLi4vLi4vYm93ZXJfY29tcG9uZW50cy9mb3VuZGF0aW9uLWFwcHMvc2Nzcy92ZW5kb3IvX25vcm1hbGl6ZS5zY3NzIiwiLi4vLi4vLi4vYm93ZXJfY29tcG9uZW50cy9mb3VuZGF0aW9uLWFwcHMvc2Nzcy9fZ2xv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tc2l6ZSAhPSBmYWxzZSB7XG4gICAgICAgIHdpZHRoOiAkbWVudWJhci1pY29uLXNpemU7XG4gICAgICAgIGhlaWdodDogJG1lbnViYXItaWNvbi1zaXplO1xuICAgICAgfVxuICAgIH1cblxuICAgIC8vIFBvc2l0aW9uXG4gICAgQGlmICRwb3NpdGlvbiA9PSBsZWZ0IHtcbiAgICAgID4gYSB7XG4gICAgICAgIGZsZXgtZmxvdzogcm93IG5vd3JhcDtcbiAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgICAgPiBpbWcsID4gLmljb25pYyB7IG1hcmdpbjogMCAkbWVudWJhci1pY29uLXNwYWNpbmcgMCAwOyB9XG4gICAgICB9XG4gICAgfVxuICAgIEBpZiAkcG9zaXRpb24gPT0gdG9wIHtcbiAgICAgID4gYSB7XG4gICAgICAgIGZsZXgtZmxvdzogY29sdW1uIG5vd3JhcDtcbiAgICAgICAgPiBpbWcsID4gLmljb25pYyB7IG1hcmdpbjogMCAwICRtZW51YmFyLWljb24tc3BhY2luZyAwOyB9XG4gICAgICB9XG4gICAgfVxuICAgIEBpZiAkcG9zaXRpb24gPT0gcmlnaHQge1xuICAgICAgPiBhIHtcbiAgICAgICAgZmxleC1mbG93OiByb3ctcmV2ZXJzZSBub3dyYXA7XG4gICAgICAgID4gaW1nLCA+IC5pY29uaWMgeyBtYXJnaW46IDAgMCAwICRtZW51YmFyLWljb24tc3BhY2luZzsgfVxuICAgICAgfVxuICAgIH1cbiAgICBAaWYgJHBvc2l0aW9uID09IGJvdHRvbSB7XG4gICAgICA+IGEge1xuICAgICAgICBmbGV4LWZsb3c6IGNvbHVtbi1yZXZlcnNlIG5vd3JhcDtcbiAgICAgICAgPiBpbWcsID4gLmljb25pYyB7IG1hcmdpbjogJG1lbnViYXItaWNvbi1zcGFjaW5nIDAgMCAwOyB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG5cbkBtaXhpbiBtZW51LWJhci1sYWJlbHMoXG4gICR4OiBya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NvbnMobGVmdCk7IH1cbiAgICBAZWFjaCAkc2l6ZSBpbiAkYnJlYWtwb2ludC1jbGFzc2VzIHtcbiAgICAgIEBlYWNoICRwb3MgaW4gKHRvcCwgcmlnaHQsIGJvdHRvbSwgbGVmdCkge1xuICAgICAgICBAaW5jbHVkZSBicmVha3BvaW50KCRzaXplKSB7XG4gICAgICAgICAgJi4jeyRzaXplfS1pY29uLSN7JHBvc30geyBAaW5jbHVkZSBtZW51LWJhci1pY29ucygkcG9zKTsgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gTGFiZWxzXG4gICAgJi5sYWJlbC1zaWRlICAgeyBAaW5jbHVkZSBtZW51LWJhci1sYWJlbHMocmlnaHQsIGNlbnRlcik7IH1cbiAgICAmLmxhYmVsLWNvcm5lciB7IEBpbmNsdWRlIG1lbnUtYmFyLWxhYmVscyhyaWdodCwgdG9wKTsgfVxuXG4gICAgLy8gQ29sb3JpbmdcbiAgICAmLnByaW1hcnkge1xuICAgICAgQGluY2x1ZGUgbWVudS1iYXItc3R5bGUoJHByaW1hcnktY29sb3IsICRhdXRvY29sb3I6IHRydWUpO1xuICAgIH1cbiAgICAmLmRhcmsge1xuICAgICAgQGluY2x1ZGUgbWVudS1iYXItc3R5bGUoJGRhcmstY29sb3IsICRhdXRvY29sb3I6IHRydWUpO1xuICAgIH1cblxuICAgIC8vIFRpdGxlXG4gICAgPiBsaS50aXRsZSB7XG4gICAgICBwYWRkaW5nOiAkbWVudWJhci1pdGVtLXBhZGRpbmc7XG4gICAgICBjdXJzb3I6IGRlZmF1bHQ7XG4gICAgICBmb250LXdlaWdodDogYm9sZDtcbiAgICB9XG4gIH1cblxuICAvLyBNZW51IGdyb3Vwc1xuICAubWVudS1ncm91cCB7XG4gICAgZGlzcGxheTogZmxleDtcbiAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICBmbGV4LXdyYX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JHNpemUsICRwcm9wOiBibG9jaykge1xyXG4gICY6bm90KC5uZy1oaWRlKSB7XHJcbiAgICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7XHJcbiAgICBAaW5jbHVkZSBicmVha3BvaW50KCRzaXplIG9ubHkpIHtcclxuICAgICAgZGlzcGxheTogJHByb3AgIWltcG9ydGFudDtcclxuICAgIH1cclxuICB9XHJcbn1cclxuXHJcbkBtaXhpbiBoaWRlLWZvcigkc2l6ZSwgJHByb3A6IGJsb2NrKSB7XHJcbiAgJjpub3QoLm5nLWhpZGUpIHtcclxuICAgIGRpc3BsYXk6ICRwcm9wICFpbXBvcnRhbnQ7XHJcbiAgICBAaW5jbHVkZSBicmVha3BvaW50KCRzaXplKSB7XHJcbiAgICAgIGRpc3BsYXk6IG5vbmUgIWltcG9ydGFudDtcclxuICAgIH1cclxuICB9XHJcbn1cclxuXHJcbkBtaXhpbiBoaWRlLWZvci1vbmx5KCRzaXplLCAkcHJvcDogYmxvY2spIHtcclxuICAmOm5vdCgubmctaGlkZSkge1xyXG4gICAgZGlzcGxheTogJHByb3AgIWltcG9ydGFudDtcclxuICAgIEBpbmNsdWRlIGJyZWFrcG9pbnQoJHNpemUgb25seSkge1xyXG4gICAgICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7XHJcbiAgICB9XHJcbiAgfVxyXG59XHJcblxyXG5AaW5jbHVkZSBleHBvcnRzKHV0aWxpdGllcykge1xyXG4gIC8vIFZlcnRpY2FsIGFsaWdubWVudFxyXG4gIC52LWFsaWduIHtcclxuICAgIGRpc3BsYXk6IGZsZXg7XHJcbiAgICBhbGlnbi1pdGVtczogY2VudGVyO1xyXG4gICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xyXG5cclxuICAgICRhbGlnbi12YWx1ZXM6IChcclxuICAgICAgJ3RvcCc6IGZsZXgtc3RhcnQsXHJcbiAgICAgICdjZW50ZXInOiBjZW50ZXIsXHJcbiAgICAgICdib3R0b20n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MsICRicCkge1xuICAgICAgICBAaWYgJGRpciA9PSAnb25seScge1xuICAgICAgICAgICRuZXh0LWJwOiBtYXAtbmV4dCgkYnJlYWtwb2ludHMsICRicCk7XG4gICAgICAgICAgQGlmICRuZXh0LWJwID09IG51bGwge1xuICAgICAgICAgICAgJGJwTWF4OiBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgICBAZWxzZSB7XG4gICAgICAgICAgICAkYnBNYXg6ICRuZXh0LWJwIC0gKDEvMTYpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAkYnA6IG1hcC1nZXQoJGJyZWFrcG9pbnRzLCAkYnApO1xuICAgICAgICAkbmFtZWQ6IHRydWU7XG4gICAgICB9XG4gICAgICBAZWxzZSB7XG4gICAgICAgICRicDogMDtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBQaXhlbCBhbmQgdW5pdGxlc3MgdmFsdWVzIGFyZSBjb252ZXJ0ZWQgdG8gcmVtc1xuICAgIEBpZiB1bml0KCRicCkgPT0gJ3B4JyBvciB1bml0KCRicCkgPT0gJycge1xuICAgICAgJGJwOiByZW0tY2FsYygkYnApO1xuICAgIH1cbiAgICAvLyBGaW5hbGx5LCB0aGUgcmVtIHZhbHVlIGlzIHR1cm5lZCBpbnRvIGFuIGVtIHZhbHVlXG4gICAgJGJwOiBzdHJpcC11bml0KCRicCkgKiAxZW07XG5cbiAgICAvLyBTa2lwIG1lZGlhIHF1ZXJ5IGNyZWF0aW9uIGlmIHRoZSBpbnB1dCBpcyBcIjAgdXBcIiBvciBcIjAgZG93blwiXG4gICAgQGlmICRicCA+IDAgb3IgJGRpciA9PSAnb25seScge1xuICAgICAgLy8gQW5kIGxvLCBhIG1lZGlhIHF1ZXJ5IHdhcyBib3JuXG4gICAgICBAaWYgJGRpciA9PSAnb25seScge1xuICAgICAgICBAaWYgJG5hbWVkID09IHRydWUge1xuICAgICAgICAgICRzdHI6ICRzdHIgKyAnIGFuZCAobWluLXdpZHRoOiAj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AgIGNvbG9yOiAkY29sb3ItYWN0aXZlO1xyXG4gIH1cclxufVxyXG5cclxuQG1peGluIGFjY29yZGlvbi1jb250ZW50KFxyXG4gICRwYWRkaW5nOiAkYWNjb3JkaW9uLWNvbnRlbnQtcGFkZGluZ1xyXG4pIHtcclxuICBwYWRkaW5nOiAkcGFkZGluZztcclxuXHJcbiAgZGlzcGxheTogbm9uZTtcclxuICAuaXMtYWN0aXZlID4gJiB7XHJcbiAgICBkaXNwbGF5OiBibG9jaztcclxuICB9XHJcbn1cclxuXHJcbkBpbmNsdWRlIGV4cG9ydHMoYWNjb3JkaW9uKSB7XHJcbiAgLmFjY29yZGlvbiB7XHJcbiAgICBAaWYgaGFzdmFsdWUoJGFjY29yZGlvbi1ib3JkZXIpIHtcclxuICAgICAgYm9yZGVyOiAkYWNjb3JkaW9uLWJvcmRlcjtcclxuICAgIH1cclxuICB9XHJcbiAgICAuYWNjb3JkaW9uLWl0ZW0ge1xyXG5cclxuICAgIH1cclxuICAgIC5hY2NvcmRpb24tdGl0bGUge1xyXG4gICAgICBAaW5jbHVkZSBhY2NvcmRpb24tdGl0bGU7XHJcbiAgICB9XHJcbiAgICAuYWNjb3JkaW9uLWNvbnRlbnQge1xyXG4gICAgICBAaW5jbHVkZSBhY2NvcmRpb24tY29udGVudDtcclxuICAgIH1cclxufVxyXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= */ diff --git a/afb-client/dist.prod/global_styles/ibz-global.min.css b/afb-client/dist.prod/global_styles/ibz-global.min.css new file mode 100644 index 0000000..74b2072 --- /dev/null +++ b/afb-client/dist.prod/global_styles/ibz-global.min.css @@ -0,0 +1,2 @@ +submit-button{float:right;display:inline-block;border:1px solid #676767;box-shadow:2px 2px 1px gray;color:grey;border-radius:5px;font-style:italic;padding:0 .5rem;margin:.5rem;background:#d1d1e0}submit-button i{padding-right:.3rem;font-size:2rem}submit-button span{font-size:1rem}submit-button:hover{background:#f3f3f3;border:2px solid #4d4d4d}zf-modal{background-color:rgba(180,180,180,.5)}.box-content{border:2px solid #dcdcdc!important;border-radius:5px;min-width:98%!important;margin:.5rem;background:rgba(200,205,200,.3)}.box-content .box-title{display:block;font-size:1.3rem}.ui-notification{width:auto;border-radius:5px} +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9pYnotZ2xvYmFsLnNjc3MiLCJhcHAvX2liei1taXhpbnMuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQmEsY0FDVCxNQUFPLE1DRFAsUUFBUyxhQUNULE9BQVcsSUFBTSxNQUFDLFFBQ2xCLFdBQWUsSUFBSSxJQUFJLElBQUMsS0FDeEIsTUREb0IsS0NFcEIsY0FBZSxJQUNmLFdBQVksT0FDWixRQUFTLEVBQUEsTUFDVCxPQUFPLE1BQ1AsV0FBWSxRQUNYLGdCQUNHLGNBQWUsTUFDZixVQVp5QixLQWN6QixtQkFBRSxVQUFXLEtBRVYsb0JBQ0wsV0FBWSxRQUNaLE9BQVcsSUFBTSxNQUFDLFFEWmhCLFNBQ04saUJBQWtCLHFCQUdSLGFDcEJSLE9BQVEsSUFBQSxNQUFBLGtCQUNSLGNBQWUsSUFJZixVQUFXLGNBQ1gsT0FBUSxNQUNSLFdBQVkscUJEZ0JGLHdCQUNOLFFBQVMsTUFDVCxVQUFXLE9BS0gsaUJBQ1osTUFBTyxLQUNQLGNBQWUiLCJmaWxlIjoiYXBwL2liei1nbG9iYWwuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbkNvcHlyaWdodCAoQykgMjAxNSBcIklvVC5iemhcIlxuQXV0aG9yIFwiRnVsdXAgQXIgRm9sbFwiXG5cblRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5XG5pdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsI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tIC41cmVtIDByZW0gLjVyZW07XG4gICAgbWFyZ2luOi41cmVtO1xuICAgIGJhY2tncm91bmQ6IGxpZ2h0ZW4oIzk0OTRiNywgMjAlKTtcbiAgICBpIHtcbiAgICAgICAgcGFkZGluZy1yaWdodDogMC4zcmVtO1xuICAgICAgICBmb250LXNpemU6ICRzaXplO1xuICAgIH1cbiAgICBzcGFuIHtmb250LXNpemU6IDFyZW19XG4gICAgXG4gICAgJjpob3ZlciB7XG4gICAgICBiYWNrZ3JvdW5kOiBsaWdodGVuKCRjb2xvciwgNDUlKTtcbiAgICAgIGJvcmRlcjogMnB4IHNvbGlkIGRhcmtlbigkY29sb3IsMjAlKTtcbiAgICAgIFxuICAgIH1cbn1cblxuQG1peGluIGliei1pbnB1dC1hbGVydCAoJGNvbG9yLCAkYmFja2dyb3VuZCkge1xuICAgIHBvc2l0aW9uICA6Zml4ZWQ7XG4gICAgbWFyZ2luOiAtMi4ycmVtIDAgMCAxNXJlbTtcbiAgICBib3JkZXItcmFkaXVzOiA1cHg7XG4gICAgZm9udC1zdHlsZTogaXRhbGljO1xuICAgIGJvcmRlci1jb2xvcjogZGFya2VuKCRiYWNrZ3JvdW5kLDEwJSk7XG4gICAgY29sb3I6ICRjb2xvcjtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkYmFja2dyb3VuZCAhaW1wb3J0YW50O1xuICAgIHBhZGRpbmc6IDAuMnJlbSAhaW1wb3J0YW50O1xufVxuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 */ diff --git a/afb-client/dist.prod/opa/AFBclient.min.css b/afb-client/dist.prod/opa/AFBclient.min.css new file mode 100644 index 0000000..c3fcafe --- /dev/null +++ b/afb-client/dist.prod/opa/AFBclient.min.css @@ -0,0 +1,9 @@ +submit-button{float:right;display:inline-block;border:1px solid #676767;box-shadow:2px 2px 1px gray;color:grey;border-radius:5px;font-style:italic;padding:0 .5rem;margin:.5rem;background:#d1d1e0}submit-button i{padding-right:.3rem;font-size:2rem}submit-button span{font-size:1rem}submit-button:hover{background:#f3f3f3;border:2px solid #4d4d4d}zf-modal{background-color:rgba(180,180,180,.5)}.box-content{border:2px solid #dcdcdc!important;border-radius:5px;min-width:98%!important;margin:.5rem;background:rgba(200,205,200,.3)}.box-content .box-title{display:block;font-size:1.3rem}.ui-notification{width:auto;border-radius:5px} +token-refresh{display:block;float:right;margin:.5rem 1rem 0 0}.button-box{height:4.5rem}.button-box .session-button{float:left;width:5rem}.button-box .response>span{display:block;margin:.3rem .5rem}.button-box .fail{color:red;border:1px solid #c00}.button-box .success{color:green;border:1px solid #004d00}.message-box{height:auto;width:100%;font-size:.75rem}.message-box .response .err-no{color:grey}.message-box .response .res.err-ok{color:#00f}.message-box .response .req.err-ok{color:#8a2be2}.message-box .response .status.err-ok{color:green}.message-box .response .status.err-fx{color:red} +.sample-box{display:block;height:4.5rem}.sample-box .sample-button{float:right;width:5rem}.sample-box .muted-off-off,.sample-box .muted-on-on{background:#8a2be2}.sample-box .muted-error{background:red} +.upload-file{display:inline-block;float:right;height:5rem;width:5rem;margin:.5rem}.upload-file img{height:inherit}.upload-file .ibz-range-slider{height:10%!important;border-radius:5px;background-color:#d3d3d3!important}.upload-file .ibz-range-slider .range-slider-handle{width:10%!important;height:100%!important;margin-top:.2rem;background-color:purple!important}.upload-file .ibz-range-slider .range-slider-active-segment{height:80%!important;background-color:#90ee90}input-text alert{position:fixed;margin:-2.2rem 0 0 15rem;border-radius:5px;font-style:italic;border-color:rgba(175,175,175,.6);color:#00008b;background-color:rgba(200,200,200,.6)!important;padding:.2rem!important}input-text input{margin-bottom:.5rem!important}input-text label{margin-top:1rem!important}input-text .required{float:right;color:#87cefa}input-text .required.valid{color:green}input-text .required.invalid{color:plum}input-text .status-untouch{border-color:rgba(200,200,200,.6)!important;box-shadow:0 1px 1px rgba(0,0,0,.075) inset,0 0 8px rgba(200,200,200,.6)!important;color:#696969!important}input-text input:focus{border-color:rgba(82,168,236,.8);box-shadow:0 1px 1px rgba(0,0,0,.075) inset,0 0 8px rgba(82,168,236,.8)!important;transition:border .2s linear 0s,box-shadow .2s linear 0s;color:#483d8b!important}input-text .status-valid{border-color:rgba(154,205,50,.6)!important;box-shadow:0 1px 1px rgba(0,0,0,.075) inset,0 0 8px rgba(154,205,50,.6)!important}input-text .status-invalid{border-color:rgba(154,17,69,.6);box-shadow:0 1px 1px rgba(0,0,0,.075) inset,0 0 8px rgba(154,17,69,.6)!important;color:#9a1145} +link-button,link-button.secondary{display:inline-block;font-style:italic;margin:.5rem}link-button i,link-button span,link-button.secondary span{font-size:1rem}link-button{border:1px solid #0040ff;box-shadow:2px 2px 1px #43f;color:#36f;border-radius:5px;padding:0 .5rem;background:#d1d1e0}link-button i{padding-right:.3rem}link-button:hover{background:#fff;border:2px solid #03c}link-button.secondary{border:1px solid #668dff;box-shadow:2px 2px 1px #a199ff;color:#99b3ff;border-radius:5px;padding:0 .5rem;background:#d1d1e0}link-button.secondary i{padding-right:.3rem;font-size:1rem}link-button.secondary:hover{background:#fff;border:2px solid #3367ff} +link-button i,link-button span,token-refresh span{font-size:1rem}link-button{display:inline-block;border:1px solid #0040ff;box-shadow:2px 2px 1px #43f;color:#36f;border-radius:5px;font-style:italic;padding:0 .5rem;margin:.5rem;background:#d1d1e0}link-button i{padding-right:.3rem}link-button:hover{background:#fff;border:2px solid #03c}tip-modal{position:relative}.tip-modal-popup{width:20rem;position:absolute;top:1em;padding:.2em .6em;border:1px solid #963;background-color:#e5ffff;color:#000;opacity:0;transition:visibility .5s linear 1s,opacity 1s linear;border-radius:5px}.tip-modal-popup i{margin:0 .3rem 0 0;display:inline}token-refresh{display:inline-block;border:1px solid #676767;box-shadow:2px 2px 1px gray;color:grey;border-radius:5px;font-style:italic;padding:0 .5rem;margin:.5rem 1rem .5rem .5rem;background:#d1d1e0}token-refresh i{padding-right:.3rem;font-size:1rem;margin-left:.5rem}token-refresh:hover{background:#f3f3f3;border:2px solid #4d4d4d}token-refresh.online{color:#06c}token-refresh.online i{color:#0f0}token-refresh.offline{color:#f0f}token-refresh.offline i{color:red} +.range-slider-handle{display:inline-block;position:absolute;z-index:1;top:-.2rem;width:2rem;height:1.375rem;border:1px solid;cursor:pointer;background:#008cba}.range-slider-handle,.range-slider.radius{background:#008cba;-webkit-border-radius:3px;border-radius:3px}.range-slider-active-segment{display:inline-block;top:.07rem;position:absolute;height:.8rem;background:#e5e5e5}.ibz-range-slider{background-color:rgba(154,205,50,.6)!important;height:1rem;position:relative}.ibz-range-slider .range-slider-active-segment{background-color:rgba(82,168,200,.6)}.ibz-range-slider-display{background-color:rgba(82,168,200,.6)!important;width:4rem!important;padding:.25rem;text-align:center}.ibz-range-slider-start,.ibz-range-slider-stop{display:inline-block;position:absolute;padding-top:2px;height:95%;background:repeating-linear-gradient(45deg,#606dbc,#606dbc 10px,#465298 10px,#465298 20px)} + +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy9hcHAvaWJ6LWdsb2JhbC5zY3NzIiwic3R5bGVzL2FwcC9faWJ6LW1peGlucy5zY3NzIiwicGFnZXMvSG9tZS9Ib21lTW9kdWxlLnNjc3MiLCJwYWdlcy9TYW1wbGUvU2FtcGxlTW9kdWxlLnNjc3MiLCJ3aWRnZXRzL0Zvcm1JbnB1dC9Gb3JtSW5wdXQuc2NzcyIsIndpZGdldHMvTmF2aWdhdGlvbi9OYXZpZ2F0aW9uLnNjc3MiLCJ3aWRnZXRzL05vdGlmaWNhdGlvbnMvTm90aWZpY2F0aW9ucy5zY3NzIiwid2lkZ2V0cy9SYW5nZVNsaWRlcnMvUmFuZ2VzbGlkZXIuc2NzcyIsIndpZGdldHMvQnV0dG9ucy9TdWJtaXRCdXR0b25zL1N1Ym1pdEJ1dHRvbnMuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9CYSxjQUNULE1BQU8sTUNEUCxRQUFTLGFBQ1QsT0FBVyxJQUFNLE1BQUMsUUFDbEIsV0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iAwLjA3cmVtO1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIGhlaWdodDogMC44MHJlbTtcbiAgYmFja2dyb3VuZDogI2U1ZTVlNTtcbn1cblxuLmliei1yYW5nZS1zbGlkZXIge1xuICAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgxNTQsIDIwNSwgNTAsIDAuNikgIWltcG9ydGFudDtcbiAgIGhlaWdodDogMXJlbTtcbiAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgIFxuICAucmFuZ2Utc2xpZGVyLWFjdGl2ZS1zZWdtZW50IHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDgyLCAxNjgsIDIwMCwgMC42KTtcbiAgfVxuICBcbiAgJi1kaXNwbGF5IHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDgyLCAxNjgsIDIwMCwgMC42KSAhaW1wb3J0YW50O1xuICAgIHdpZHRoIDogNHJlbSAhaW1wb3J0YW50O1xuICAgIHBhZGRpbmc6IC4yNXJlbTtcbiAgICB0ZXh0LWFsaWduOmNlbnRlclxuICAgfVxuXG4gICAmLXN0YXJ0LCYtc3RvcCB7XG4gICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICBwYWRkaW5nLXRvcDogMnB4O1xuICAgaGVpZ2h0OiA5NSU7XG4gICBiYWNrZ3JvdW5kOiByZXBlYXRpbmctbGluZWFyLWdyYWRpZW50KFxuICAgIDQ1ZGVnLFxuICAgICM2MDZkYmMsXG4gICAgIzYwNmRiYyAxMHB4LFxuICAgICM0NjUyOTggMTBweCxcbiAgICAjNDY1Mjk4IDIwcHhcbiAgKTt9XG5cbn1cbiIsbnVsbF0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 */ diff --git a/afb-client/dist.prod/opa/AFBclient.min.js b/afb-client/dist.prod/opa/AFBclient.min.js new file mode 100644 index 0000000..1d9a736 --- /dev/null +++ b/afb-client/dist.prod/opa/AFBclient.min.js @@ -0,0 +1,2 @@ +!function(){"use strict";var e='
{{label}}
';angular.module("SubmitButton",[]).directive("submitButton",function(){function t(e,t,n){e.icon=n.icon||"fi-foot",e.label=n.label||"Next",t.addClass(e.label.toLowerCase())}return{restrict:"E",template:e,link:t,scope:{clicked:"="}}})}(),function(){"use strict";function e(e){var t=[],n=[];this.getId=function(){return e.sliderid},this.getCbHandle=function(){return e.cbhandle},this.getView=function(a){return a||(a=0),e.value[a]===t[a]?n[a]:(t[a]=e.value[a],e.formatter?n[a]=e.formatter(e.value[a],e.ctrlhandle):n[a]=e.value[a],n[a])},this.updateClass=function(t,n){e.updateClass(t,n)},this.forceRefresh=function(t){e.forceRefresh(t)},this.getValue=function(t){return t||(t=0),e.value[t]},this.getRelative=function(t){return t||(t=0),e.relative[t]},this.setValue=function(t,n){n||(n=0),e.setValue(t,n)},this.setDisable=function(t){e.setDisable(t)}}var t=angular.module("RangeSlider",[]);t.directive("rangeSlider",["$log","$document","$timeout",function(t,n,a){function i(t,i,s,o){t.initWidget=function(e){e.byStep&&(t.byStep=parseInt(e.byStep)),e.notMore&&(t.notMore=parseInt(e.notMore)),e.notLess&&(t.notLess=parseInt(e.notLess)),e.id&&(t.sliderid=e.id),void 0!==e.value&&(t.value=e.value,t.forceRefresh(50))},t.forceRefresh=function(e){var n=t.value;t.value=[void 0,void 0],a(function(){t.setValue(n[0],0),t.dual&&t.setValue(n[1],1)},e)},t.updateClass=function(e,t){t?i.addClass(e):i.removeClass(e)},t.setDisable=function(e){e?(i.addClass("disable"),t.handles[0].css("visibility","hidden"),t.dual&&t.handles[1].css("visibility","hidden")):(i.removeClass("disable"),t.handles[0].css("visibility","visible"),t.dual&&t.handles[1].css("visibility","visible"))},t.normalize=function(e){var n,a=t.notMore-t.notLess,i=e*a;if(t.byStep>0){var s=(i-i%t.byStep)/t.byStep,o=i%t.byStep,l=o>=.5*t.byStep?t.byStep:0;return n=s*t.byStep+l+t.notLess}if(t.byStep<0){var r=Math.pow(10,-1*t.byStep);return n=t.notLess+parseInt(i*r)/r}return i},t.getValue=function(e,n){t.vertical?t.relative[n]=(e-t.bounds.handles[n].getBoundingClientRect().height)/(t.bounds.bar.getBoundingClientRect().height-t.bounds.handles[n].getBoundingClientRect().height):t.relative[n]=e/(t.bounds.bar.getBoundingClientRect().width-t.bounds.handles[n].getBoundingClientRect().width);var a=t.normalize(t.relative[n]);a!==t.value[n]&&(at.stopValue&&(a=t.stopValue),t.formatter?t.viewValue=t.formatter(a,t.ctrlhandle):t.viewValue=a,t.displays[n]&&t.displays[n].html(t.viewValue),t.value[n]=a,o&&o.$setViewValue(t.viewValue),t.$apply(),a>t.startValue&&at.value[0]&&(t.dual?t.setValue(e,1):t.setValue(e,0)),t.vertical?(n=t.bounds.bar.getBoundingClientRect().height*(e-t.notLess)/(t.notMore-t.notLess),t.start.css("height",n+"px")):(n=t.bounds.bar.getBoundingClientRect().width*(e-t.notLess)/(t.notMore-t.notLess),t.start.css("width",n+"px")),t.startValue=e},t.setStop=function(e){var n;et.notMore&&(e=t.notMore),e0&&t.$apply(t.setValue(t.value[t.actif]+t.byStep,t.actif)),t.byStep<0&&t.$apply(t.setValue(t.value[t.actif]+1/Math.pow(10,-1*t.byStep),t.actif)),t.callback&&t.callback(t.value[t.actif],t.ctrlhandle);break;case 37:case 40:t.byStep>0&&t.$apply(t.setValue(t.value[t.actif]-t.byStep,t.actif)),t.byStep<0&&t.$apply(t.setValue(t.value[t.actif]-1/Math.pow(10,-1*t.byStep),t.actif)),t.callback&&t.callback(t.value[t.actif],t.ctrlhandle);break;case 27:t.handles[t.actif][0].blur()}},t.moveHandle=function(e,n,a){var i;t.vertical?(i=t.bounds.bar.getBoundingClientRect().bottom-a,i>t.bounds.bar.getBoundingClientRect().height&&(i=t.bounds.bar.getBoundingClientRect().height),ii&&(i=0),n+t.bounds.handles[e].getBoundingClientRect().width>t.bounds.bar.getBoundingClientRect().right&&(i=t.bounds.bar.getBoundingClientRect().width-t.bounds.handles[e].getBoundingClientRect().width)),t.getValue(i,e),t.dual&&t.value[0]>t.value[1]&&(0===e?t.setValue(t.value[0],1):t.setValue(t.value[1],0))},t.focusCB=function(e){e?n.on("keydown",t.keydown):n.unbind("keydown",t.keydown)},t.touchBarCB=function(e){var n,a=0,i=e.changedTouches,s=t.value[a];if(e.preventDefault(),t.dual){n=t.vertical?(i[0].pageY-t.bounds.bar.getBoundingClientRect().bottom)/t.bounds.bar.getBoundingClientRect().height:(i[0].pageX-t.bounds.bar.getBoundingClientRect().left)/t.bounds.bar.getBoundingClientRect().width;var o=Math.abs(n-t.relative[0]),l=Math.abs(n-t.relative[1]);o>l&&(a=1)}t.moveHandle(a,i[0].pageX,i[0].pageY),t.callback&&s!==t.value[a]&&t.callback(t.value[a],t.ctrlhandle)},t.touchHandleCB=function(e,a){function s(e){e.preventDefault();for(var n=e.changedTouches,i=0;it.stopAt,t.stopAt&&t.setStop(t.stopAt)}),t.initialSettings(t.initial)},t.init(),t.$watch("inithook",function(){t.inithook&&t.inithook(t.ctrlhandle)}),t.$watch("initvalues",function(){t.initvalues&&t.initWidget(t.initvalues)}),t.$watch("ngModel",function(e){t.setValue(e,0)})}var s='
';return{restrict:"E",scope:{startAt:"=",stopAt:"=",callback:"=",formatter:"=",inithook:"=",cbhandle:"=",initvalues:"=",ngModel:"="},require:"?ngModel",template:s,replace:!0,link:i}}])}(),function(){"use strict";var e='
afb://{{hostname}}:{{httpdport}}
';angular.module("TokenRefresh",["ConfigApp","ModalNotification"]).directive("tokenRefresh",["$timeout","$http","$location","Notification","ConfigApp",function(t,n,a,i,s){function o(e,o,l){e.status=void 0,e.online=function(){o.addClass("online"),o.removeClass("offline")},e.offline=function(){o.addClass("offline"),o.removeClass("online")},e.onerror=function(t,n,a){e.status!==!1&&(i.warning({message:"AppFramework Binder Lost",delay:5e3}),e.offline()),e.status=0},e.onsuccess=function(t,n,a,o){e.status!==!0&&(t.request.token&&(s.session.token=t.request.token),t.request.uuid&&(s.session.uuid=t.request.uuid),t.request.timeout&&(s.session.timeout=t.request.timeout),i.success({message:"AppFramework Binder Back to Live",delay:3e3}),e.online()),e.status=1},e.getping=function(){var a=n.get(s.session.ping+"?token="+s.session.token);a.success(e.onsuccess),a.error(e.onerror),t(e.getping,1e3*s.session.pingrate)},e.refresh=function(){var a=n.get(s.session.refresh+"?token="+s.session.token);a.success(e.onsuccess),a.error(e.onerror),t(e.refresh,250*s.session.timeout)},e.tkcreate=function(){var t=n.get(s.session.create+"?token="+s.session.initial);t.success(e.onsuccess),t.error(e.onerror)},e.icon=l.icon||"fi-lightbulb",e.hostname=a.host(),e.httpdport=a.port(),e.autolog=JSON.parse(l.autolog||!1),e.autolog&&e.tkcreate(),t(e.getping,1e3*s.session.pingrate),t(e.refresh,250*s.session.timeout)}return{template:e,scope:{callback:"="},restrict:"E",link:o}}])}(),function(){"use strict";var e='
{{tip}}
';angular.module("ModalNotification",[]).directive("tipModal",["$timeout",function(t){function n(e,n,a){function i(){function n(){e.show&&e.modal.css({opacity:1,visibility:"visible"})}e.show=!0,e.timeout=t(n,e.delay)}function s(){e.show=!1,e.modal.css({opacity:0,visibility:"hidden"})}e.parent=n.parent(),e.modal=n.find("div"),e.icon=a.icon||"fi-lightbulb",e.parent.addClass("as-modal-tip"),e.parent.bind("click",s),e.parent.bind("focus",i),e.parent.bind("mouseover",i),e.parent.bind("mouseleave",s),e.parent.bind("blur",s),e.delay=a.delay||1e3}return{restrict:"E",template:e,link:n,scope:{tip:"="}}}])}(),function(){"use strict";var e='{{label}}';angular.module("LinkButton",[]).directive("linkButton",["$location",function(t){function n(e,n,a){e.clicked=function(){a.query?t.path(a.href).search(a.query):t.path(a.href)},e.icon=a.icon||"fi-link",e.label=a.label||"Jump",e.href=a.href||"/home",n.addClass(e.label.toLowerCase())}return{restrict:"E",template:e,link:n,scope:{}}}])}(),function(){"use strict";function e(e,t,n,a,i){var s=new XMLHttpRequest,o=new FormData,l=function(e){i(e)};s.upload.onprogress=function(t){var n=Math.round(t.lengthComputable?100*t.loaded/t.total:0);e.slider&&e.slider.setValue(n)},s.onload=function(){t.addClass("success"),t.removeClass("error");var n={status:s.status,headers:s.getAllResponseHeaders()};e.callback(n)},s.onerror=function(){t.addClass("error"),t.removeClass("success");var n={status:s.status,headers:s.getAllResponseHeaders()};e.callback(n)},s.onabort=function(){t.addClass("error"),t.removeClass("success");var n={status:s.status,headers:s.getAllResponseHeaders()};e.callback(n)};for(var r=0;r1024*e.maxsize)return e.thumbnail=e.istoobig,void e.$apply("thumbnail");if(isNaN(u.size))return e.thumbnail=e.isnotvalid,void e.$apply("thumbnail");if(e.Basename=u.name.split("/").reverse()[0],e.imgElem[0].file=u,i){var c=new FileReader;c.readAsArrayBuffer(u),c.onload=l}o.append(e.name,u,u.name)}}s.open("POST",n,!0),s.send(o)}var t='
';angular.module("UploadFiles",["ConfigApp","ModalNotification","RangeSlider"]).directive("uploadImage",["ConfigApp","JQemu","Notification",function(n,a,i){function s(t,a,i){if(t.imgElem=a.find("img"),t.inputElem=a.find("input"),t.imgClicked=function(){t.inputElem[0].click()},t.SliderInitCB=function(e){t.slider=e},t.UpLoadFile=function(s){var o=function(e){return t.imgElem[0].src=window.URL.createObjectURL(new Blob([e.target.result],{type:"image"})),!0},l=i.posturl+"?token="+n.session.token;new e(t,a,l,s,o)},t.name=i.name||"avatar",t.category=i.category||"image",t.mimetype=(i.accept||"image")+"/*",t.maxsize=i.maxsize||100,t.regexp=new RegExp(i.accept+".*","i"),i.thumbnail?t.thumbnail=n.paths[t.category]+i.thumbnail:t.thumbnail=n.paths[t.category]+"tux-bzh.png",i.thumbnail?t.isnotvalid=n.paths[t.category]+i.isnotvalid:t.isnotvalid=n.paths[t.category]+"isnotvalid.png",i.istoobig?t.istoobig=n.paths[t.category]+i.istoobig:t.istoobig=n.paths[t.category]+"istoobig.png",t.noslider=i.noslider||!1,!i.posturl)throw new TypeError("file-upload %s posturl=/api/xxxx/xxxx required",t.attrs)}return{restrict:"E",template:t,link:s,scope:{callback:"="}}}]).directive("uploadAudio",["ConfigApp","JQemu","Notification",function(n,a,i){function s(t,a,i){if(t.imgElem=a.find("img"),t.inputElem=a.find("input"),t.imgClicked=function(){t.inputElem[0].click()},t.SliderInitCB=function(e){t.slider=e},t.UpLoadFile=function(s){var o=i.posturl+"?token="+n.session.token;new e(t,a,o,s,!1)},t.name=i.name||"audio",t.category=i.category||"audio",t.mimetype=(i.accept||"audio")+"/*",t.maxsize=i.maxsize||1e4,t.regexp=new RegExp(i.accept+".*","i"),i.thumbnail?t.thumbnail=n.paths[t.category]+i.thumbnail:t.thumbnail=n.paths[t.category]+"upload-music.png",i.thumbnail?t.isnotvalid=n.paths[t.category]+i.isnotvalid:t.isnotvalid=n.paths[t.category]+"isnotvalid.png",i.istoobig?t.istoobig=n.paths[t.category]+i.istoobig:t.istoobig=n.paths[t.category]+"istoobig.png",t.noslider=i.noslider||!1,!i.posturl)throw new TypeError("file-upload %s posturl=/api/xxxx/xxxx required",t.attrs)}return{restrict:"E",template:t,link:s,scope:{callback:"="}}}]).directive("uploadAppli",["ConfigApp","JQemu","Notification",function(n,a,i){function s(t,a,i){if(t.imgElem=a.find("img"),t.inputElem=a.find("input"),t.imgClicked=function(){t.inputElem[0].click()},t.SliderInitCB=function(e){t.slider=e},t.UpLoadFile=function(s){var o=function(e){var a=new JSZip(e.target.result),i=a.file("afa-pkg/thumbnail.jpg");return i?(t.imgElem[0].src=window.URL.createObjectURL(new Blob([i.asArrayBuffer()],{type:"image"})),!0):(t.thumbnail=n.paths[t.category]+"isnotvalid.png",t.$apply("thumbnail"),!1)},l=i.posturl+"?token="+n.session.token;new e(t,a,l,s,o)},t.name=i.name||"appli",t.category=i.category||"appli",t.mimetype=i.accept||".zip",t.maxsize=i.maxsize||1e5,t.regexp=new RegExp(i.accept+".*","i"),i.thumbnail?t.thumbnail=n.paths[t.category]+i.thumbnail:t.thumbnail=n.paths[t.category]+"upload-appli.png",i.thumbnail?t.isnotvalid=n.paths[t.category]+i.isnotvalid:t.isnotvalid=n.paths[t.category]+"isnotvalid.png",i.istoobig?t.istoobig=n.paths[t.category]+i.istoobig:t.istoobig=n.paths[t.category]+"istoobig.png",t.noslider=i.noslider||!1,!i.posturl)throw new TypeError("file-upload %s posturl=/api/xxxx/xxxx required",t.attrs)}return{restrict:"E",template:t,link:s,scope:{callback:"="}}}])}(),function(){"use strict";var e='{{errmsg}}',t=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;angular.module("InputText",["JQueryEmu"]).directive("inputText",["JQemu",function(n){function a(e,a,i){e.error=!1,e.valid=!1,e.status="untouch",e.input=a.find("input"),e.required=0,"required"in i&&(e.required=1,a.addClass("required")),e.selected=function(){e.error=!1,e.errmsg=!1,e.status="touch"},e.validate=function(){e.parent.removeClass("ng-pristine"),e.value?(e.error=!1,e.value=e.value.trim(),"nospace"in i&&(e.value=e.value.replace(/\s/g,"")),"lowercase"in i&&(e.value=e.value.toLowerCase()),"minlen"in i&&e.value.length0&&e.l4acounter.validated--),e.callback(i.name,null,e.done)):(e.required&&!e.valid&&e.l4acounter.validated++,e.status="valid",e.valid=!0,e.callback(i.name,e.value,e.done))},e.done=function(t){for(var n in t)e[n]=t[n]},e.label=i.label,e.name=i.name,e.placeholder=i.placeholder,e.type=i.type||"text",e.tip=i.tip,e.parent=n.parent(a,"FORM"),"email"in i&&(i.lowercase=!0,i.nospace=!0,i.minlen=6),e.required&&(e.l4acounter=e.parent.data("l4acounter"),e.l4acounter?e.l4acounter.required++:(e.l4acounter={required:1,validated:0},e.parent.data("l4acounter",e.l4acounter))),e.$watch("value",function(){e.value&&e.validate()})}return{restrict:"E",template:e,link:a,scope:{callback:"=",value:"="}}}])}(),function(){"use strict";var e=' ';angular.module("InputPassword",[]).directive("inputPassword",function(){function t(e,t,n){e.valid1=function(t,n){e.firstpwd=n},e.valid2=function(t,a,i){e.firstpwd!==a?i({valid:!1,status:"invalid",errmsg:"both password should match"}):e.callback(n.name,a)},e.done=function(t){for(var n in t)e[n]=t[n]},e.name=n.name,e.label1=n.label||"Password",e.label2=n.label||"Password Verification",e.place1=n.placeholder1||"User Password",e.tip1=n.tip||"Choose a Password",e.place2=n.placeholder1||"Password Verification",e.tip2=n.tip||"Confirme your Password",e.minlen=n.minlen||10,"required"in n&&(e.required="required")}return{restrict:"E",template:e,link:t,scope:{callback:"="}}})}(),function(){"use strict";angular.module("SampleModule",["SubmitButton","UploadFiles"]).controller("SampleController",["$http",function(e){var t=this;t.FileUploaded=function(e){}}])}(),function(){"use strict";angular.module("HomeModule",["SubmitButton","TokenRefresh"]).controller("HomeController",["$http","ConfigApp",function(e,t){var n=this;n.uuid="none",n.token="none",n.session="none",n.status="err-no",n.ProcessResponse=function(e,a,i,s){var o="API"+e.request.api.replace("-","_");n.status="err-ok",n.errcode=a,n.request=e.request,n.response=e.response,e.request.token&&(t.session.token=e.request.token),e.request.uuid&&(t.session.uuid=e.request.uuid),e.request.timeout&&(t.session.timeout=e.request.timeout),("APIcreate"===o||"APIreset"===o)&&(n.APIreset="",n.APIcreate="",n.APIrefresh="",n.APIcheck=""),n[o]="success",e.request.token&&(n.token=e.request.token)},n.ProcessError=function(e,t,a,i){var s="API"+e.request.api.replace("-","_");n.status="err-fx",n.errcode=t,n.request=e.request,n.response="",n[s]="fail"},n.OpenSession=function(){var a={},i=e.post(t.session.create+"?token="+t.session.initial,a);i.success(n.ProcessResponse),i.error(n.ProcessError)},n.CheckSession=function(){var a={},i=e.post(t.session.check+"?token="+t.session.token,a);i.success(n.ProcessResponse),i.error(n.ProcessError)},n.RefreshSession=function(){var a={},i=e.post(t.session.refresh+"?token="+t.session.token,a);i.success(n.ProcessResponse),i.error(n.ProcessError)},n.ResetSession=function(){var a={},i=e.post(t.session.reset+"?token="+t.session.token,a);i.success(n.ProcessResponse),i.error(n.ProcessError)}}])}(),function(){"use strict";angular.module("JQueryEmu",[]).factory("JQemu",function(){var e=function(e,t){for(var n=e,a=t.toUpperCase();n[0];){if(a===n[0].tagName)return n;n=n.parent()}},t=function(e,t,n){for(var a=n.toLowerCase(),i=t.toLowerCase()+"Name",s=e.children();s[0];){if(a===s[0][i])return s;s=s.next()}},n=function(e,t){for(var n=t.toLowerCase(),a=e.children();a[0];){if(a.hasClass(n))return a;a=a.next()}},a={FindInParent:e,FindByTag:t,FindByClass:n};return a})}();var foundationRoutes=[{name:"mysample",url:"/sample",controller:"SampleController as ctrl",animationIn:"slideInRight",path:"pages/Sample/Sample.html"},{name:"myhome",url:"/home",controller:"HomeController as ctrl",animationIn:"slideInRight",path:"pages/Home/Home.html"}];!function(){"use strict";angular.module("ConfigApp",[]).factory("ConfigApp",["$location","$window",function(e,t){var n={paths:{image:"images/",avatar:"images/avatars/",audio:"images/audio/",appli:"images/appli/"},myapi:{token:"/api/myplugin/xxxx"},session:{create:"/api/token/create",refresh:"/api/token/refresh",check:"/api/token/check",reset:"/api/token/reset",ping:"/api/token/check",initial:"123456789",timeout:3600,pingrate:60,uuid:"",token:""}};return n}])}(),function(){"use strict";function e(e,t,n){e.otherwise("/home"),t.html5Mode(!0).hashPrefix("!")}function t(){FastClick.attach(document.body)}angular.module("AFBclient",["ui.router","ngAnimate","foundation","foundation.dynamicRouting","foundation.dynamicRouting.animations","ui-notification","ConfigApp","JQueryEmu","HomeModule","SampleModule","UploadFiles","LinkButton","TokenRefresh","RangeSlider","ModalNotification"]).config(e).run(t),e.$inject=["$urlRouterProvider","$locationProvider"]}(),function(){angular.module("AFBclient").run(["$templateCache",function(e){e.put("pages/Sample/Sample.html",'

Post File Upload

')}])}(),function(){angular.module("AFBclient").run(["$templateCache",function(e){e.put("pages/Home/Home.html",'

App Framework Binder Simple Client

req= {{ctrl.request}} res= {{ctrl.response}} status= {{ctrl.errcode}}
')}])}(); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbI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gICAgICAgICAgICAgICAgICBlbGVtLmFkZENsYXNzIChzY29wZS5sYWJlbC50b0xvd2VyQ2FzZSgpKTtcbiAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgIC8vIG5vdGU6IGNsaWNrZWQgaW4gaW1wb3J0ZWQgYW5kIHdoZW4gdGVtcGxhdGUgaXMgY2xpY2tlZFxuICAgICAgICAgICAgICAgICAgICAvLyBpdCB3aWxsIGNhbGwgY2xpY2tlZCBtZXRob2QgcGFzc2VkIGluIHBhcmFtLlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0UnLFxuICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZTogdG1wbCxcbiAgICAgICAgICAgICAgICAgICAgbGluazogbXltZXRob2RzLFxuICAgICAgICAgICAgICAgICAgICBzY29wZToge2NsaWNrZWQgOiAnPSd9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xufSkoKTtcbiIsIi8qIFxuICogQ29weXJpZ2h0IChDKSAyMDE1IFwiSW9ULmJ6aFwiXG4gKiBBdXRob3IgXCJGdWx1cCBBciBGb2xsXCJcbiAqXG4gKiBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTogeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeVxuICogaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnlcbiAqIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIGVpdGhlciB2ZXJzaW9uIDMgb2YgdGhlIExpY2Vuc2UsIG9yXG4gKiAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLlxuICpcbiAqIFRoaXMgcHJvZ3JhbSB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Gxlc1swXS5jc3MgKCd2aXNpYmlsaXR5JywnaGlkZGVuJyk7XG4gICAgICAgICAgICAgICAgaWYgKHNjb3BlLmR1YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgc2NvcGUuaGFuZGxlc1sxXS5jc3MgKCd2aXNpYmlsaXR5JywnaGlkZGVuJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzIChcImRpc2FibGVcIik7XG4gICAgICAgICAgICAgICAgc2NvcGUuaGFuZGxlc1swXS5jc3MgKCd2aXNpYmlsaXR5JywndmlzaWJsZScpO1xuICAgICAgICAgICAgICAgIGlmIChzY29wZS5kdWFsKSBzY29wZS5oYW5kbGVzWzFdLmNzcyAoJ3Zpc2liaWxpdHknLCd2aXNpYmxlJyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5ub3JtYWxpemUgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHZhciByZXN1bHQ7XG4gICAgICAgICAgICB2YXIgcmFuZ2UgPSBzY29wZS5ub3RNb3JlIC0gc2NvcGUubm90TGVzcztcbiAgICAgICAgICAgIHZhciBwb2ludCA9IHZhbHVlICogcmFuZ2U7XG5cbiAgICAgICAgICAgIC8vIGlmIHN0ZXAgaXMgcG9zaXRpdmUgbGV0J3Mgcm91bmQgc3RlcCBieSBzdGVwXG4gICAgICAgICAgICBpZiAoc2NvcGUuYnlTdGVwID4gIDApIHtcbiAgICAgICAgICAgICAgICB2YXIgbW9kID0gKHBvaW50IC0gKHBvaW50ICUgc2NvcGUuYnlTdGVwKSkgLyBzY29wZS5ieVN0ZXA7XG4gICAgICAgICAgICAgICAgdmFyIHJlbSA9IHBvaW50ICUgc2NvcGUuYnlTdGVwO1xuXG4gICAgICAgICAgICAgICAgdmFyIHJvdW5kID0gKHJlbSA+PSBzY29wZS5ieVN0ZX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ZXIgKG5ld3ZhbHVlLCBzY29wZS5jdHJsaGFuZGxlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzY29wZS52aWV3VmFsdWUgPSBuZXd2YWx1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNjb3BlLmRpc3BsYXlzW2hhbmRsZV0pIHtcbiAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlzcGxheXNbaGFuZGxlXS5odG1sIChzY29wZS52aWV3VmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSBleHRlcm5hbCByZXByZXNlbnRhdGlvbiBvZiB0aGUgbW9kZWxcbiAgICAgICAgICAgICAgICBzY29wZS52YWx1ZVtoYW5kbGVdID0gbmV3dmFsdWU7XG4gICAgICAgICAgICAgICAgaWYgKG1vZGVsKSBtb2RlbC4kc2V0Vmlld1ZhbHVlIChzY29wZS52aWV3VmFsdWUpO1xuICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpO1xuICAgICAgICAgICAgICAgIGlmIChuZXd2YWx1ZSA+IHNjb3BlLnN0YXJ0VmFsdWUgJiYgbmV3dmFsdWUgPCBzY29wZS5zdG9wVmFsdWUpIHNjb3BlLnRyYW5zbGF0ZShvZmZzZXQsIGhhbmRsZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG5cblxuICAgICAgICBzY29wZS5zZXRTdGFydCA9IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdmFyIG9mZnNldDtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgaWYgKHZhbHVlID4gc2NvcGUudmFsdWVbMF0pIHtcbiAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLmR1YWwpIHNjb3BlLnNldFZhbHVlICh2YWx1ZSwwKTtcbiAgICAgICAgICAgICAgICBlbHNlIHNjb3BlLnNldFZhbHVlICh2YWx1ZSwxKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHNjb3BlLnZlcnRpY2FsKSB7XG4gICAgICAgICAgICAgICAgb2Zmc2V0ID0gc2NvcGUuYm91bmRzLmJhci5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5oZWlnaHQgKiAodmFsdWUgLSBzY29wZS5ub3RMZXNzKSAvIChzY29wZS5ub3RNb3JlIC0gc2NvcGUubm90TGVzcyk7XG4gICAgICAgICAgICAgICAgc2NvcGUuc3RhcnQuY3NzKCdoZWlnaHQnLG9mZnNldCArICdweCcpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBvZmZzZXQgPSBzY29wZS5ib3VuZHMuYmFyLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLndpZHRoICogKHZhbHVlIC0gc2NvcGUubm90TGVzcykgLyAoc2NvcGUubm90TW9yZSAtIHNjb3BlLm5vdExlc3MpO1xuICAgICAgICAgICAgICAgIHNjb3BlLnN0YXJ0LmNzcygnd2lkdGgnLG9mZnNldCArICdweCcpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzY29wZS5zdGFydFZhbHVlPSB2YWx1ZTtcbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5zZXRTdG9wID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB2YXIgb2Zmc2V0O1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBpZiAodmFsdWUgPCBzY29wZS52YWx1ZVswXSkge1xuICAgICAgICAgICAgICAgIGlmICghc2NvcGUuZHVhbCkgc2NvcGUuc2V0VmFsdWUgKHZhbHVlLDApO1xuICAgICAgICAgICAgICAgIGVsc2Ugc2NvcGUuc2V0VmFsdWUgKHZhbHVlLDEpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoc2NvcGUudmVydGljYWwpIHtcbiAgICAgICAgICAgICAgICBvZmZzZXQgPSBzY29wZS5ib3VuZHMuYmF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zBdWzBdLCBzY29wZS5oYW5kbGVzWzFdWzBdXVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgaWYgKGF0dHJzLmRpc2FibGUgPT09ICd0cnVlJykgc2NvcGUuc2V0RGlzYWJsZSh0cnVlKTtcblxuICAgICAgICAgICAgaWYgKGF0dHJzLmRpc3BsYXlUYXJnZXQpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGF0dHJzLmRpc3BsYXlUYXJnZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSB0cnVlIDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnaGFuZGxlJyA6XG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kaXNwbGF5cyA9IHNjb3BlLmhhbmRsZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5oYW5kbGVzWzBdLmFkZENsYXNzKCdpYnotcmFuZ2Utc2xpZGVyLWRpc3BsYXknKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5kdWFsKSBzY29wZS5oYW5kbGVzWzFdLmFkZENsYXNzKCdpYnotcmFuZ2Utc2xpZGVyLWRpc3BsYXknKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlzcGxheXMgPSAgWyRkb2N1bWVudC5nZXRFbGVtZW50QnlJZCAoYXR0cnMuZGlzcGxheVRhcmdldCldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBzY29wZS5kaXNwbGF5cz1bXTtcblxuICAgICAgICAgICAgLy8gZXh0cmFjdCBpbml0aWFsIHZhbHVlcyBmcm9tIGF0dHJzIGFuZCBwYXJzZSBpbnRvIGludFxuICAgICAgICAgICAgaWYgKCFhdHRycy5pbml0aWFsKSB7XG4gICAgICAgICAgICAgICAgc2NvcGUuaW5pdGlhbCAgPSBbc2NvcGUubmdNb2RlbCwgc2NvcGUubmdNb2RlbF07IC8vIGluaXRpYWxpemUgdG8gbW9kZWwgdmFsdWVzXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBpbml0aWFsICA9IGF0dHJzLmluaXRpYWwuc3BsaXQoJywnKTtcbiAgICAgICAgICAgICAgICBzY29wZS5pbml0aWFsID0gW1xuICAgICAgICAgICAgICAgICAgICBpbml0aWFsWzBdICE9PSB1bmRlZmluZWQgPyBwYXJzZUludCAoaW5pdGlhbFswXSkgOiBzY29wZS5ub3RMZXNzLFxuICAgICAgICAgICAgICAgICAgICBpbml0aWFsWzFdICE9PSB1bmRlZmluZWQgPyBwYXJzZUludCAoaW5pdGlhbFsxXSkgOiBzY29wZS5ub3RNb3JlXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gTW9uaXRvciBhbnkgY2hhbmdlcyBvbiBzdGFydC9zdG9wIGRhdGVzLlxuICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdzdGFydEF0JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNjb3BlLnZhbHVlIDwgc2NvcGUuc3RhcnRBdCApIHtcbiAgICAgICAgICAgICAgICAgICAgLy9zY29wZS5zZXRWYWx1ZSAoc2NvcGUuc3RhcnRBdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzY29wZS5zdGFydEF0KSBzY29wZS5zZXRTdGFydCAoc2NvcGUuc3RhcnRBdCk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdzdG9wQXQnICwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNjb3BlLnZhbHVlID4gc2NvcGUuc3RvcEF0KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vc2NvcGUuc2V0VmFsdWUgKHNjb3BlLnN0b3BBdCk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2VcbiAgICAgICAgXG4gICAgXG4gICAgICAgIHNjb3BlLm9ubGluZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MgICAgKFwib25saW5lXCIpO1xuICAgICAgICAgICAgZWxlbS5yZW1vdmVDbGFzcyAoXCJvZmZsaW5lXCIpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHNjb3BlLm9mZmxpbmUgPSBmdW5jdGlvbigpe1xuICAgICAgICAgICAgZWxlbS5hZGRDbGFzcyAgICAoXCJvZmZsaW5lXCIpO1xuICAgICAgICAgICAgZWxlbS5yZW1vdmVDbGFzcyAoXCJvbmxpbmVcIik7XG4gICAgICAgIH07XG4gICAgICAgIFxuICAgICAgICBzY29wZS5vbmVycm9yID0gZnVuY3Rpb24oZGF0YSwgZXJyY29kZSwgaGVhZGVycykge1xuICAgICAgICAgICAgaWYgKHNjb3BlLnN0YXR1cyAhPT0gZmFsc2UpICB7XG4gICAgICAgICAgICAgICAgTm90aWZpY2F0aW9uLndhcm5pbmcgKHttZXNzYWdlOiBcIkFwcEZyYW1ld29yayBCaW5kZXIgTG9zdFwiLCBkZWxheTogNTAwMH0pO1xuICAgICAgICAgICAgICAgIHNjb3BlLm9mZmxpbmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNjb3BlLnN0YXR1cyA9IDA7XG4gICAgICAgIH07XG4gICAgICAgIFxuICAgICAgICBzY29wZS5vbnN1Y2Nlc3MgPSBmdW5jdGlvbihkYXRhLCBlcnJjb2RlLCBoZWFkZXJzLCBjb25maWcpIHtcbiAgICAgICAgICAgIGlmIChzY29wZS5zdGF0dXMgIT09IHRydWUpICB7XG4gICAgICAgICAgICAgICAgaWYgKGRhdGEucmVxdWVzdC50b2tlbikgQ29uZmlnQXBwLnNlc3Npb24udG9rZW4gPSBkYXRhLnJlcXVlc3QudG9rZW47XG4gICAgICAgICAgICAgICAgaWYgKGRhdGEucmVxdWVzdC51dWlkKSAgQ29uZ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IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFjdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnNob3cpIHNjb3BlLm1vZGFsLmNzcyh7b3BhY2l0eTogMSwgdmlzaWJpbGl0eTondmlzaWJsZSd9KTsgIFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvdyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aW1lb3V0ID0gJHRpbWVvdXQoYWN0aW9uLCBzY29wZS5kZWxheSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNsb3NlICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93ID0gZmFsc2U7ICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW9kYWwuY3NzKHtvcGFjaXR5OiAwLCB2aXNpYmlsaXR5OidoaWRkZW4nfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgXG5cbiAgICAgICAgICAgICAgICAgICAgLy8gYWp1c3QgaWNvbiBvciB1c2UgZGVmYXVsdFxuICAgICAgICAgICAgICAgICAgICBzY29wZS5pY29uICA9IGF0dHJzLmljb24gfHwgJ2ZpLWxpZ2h0YnVsYic7XG4gICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAvLyBVcGRhdGUgUGFyZW50IGVsZW1lbnQgdG8gZ2V0IG1vdXNlIGV2ZW50XG4gICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhcmVudC5hZGRDbGFzcyAoJ2FzLW1vZGFsLXRpcCcpO1xuICAgICAgICAgICAgICAgICAgICBzY29wZS5wYXJlbnQuYmluZCgnY2xpY2snLCBjbG9zZSk7XG4gICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhcmVudC5iaW5kKCdmb2N1cycsIGRpc3BsYXkpO1xuICAgICAgICAgICAgICAgICAgICBzY29wZS5wYXJlbnQuYmluZCgnbW91c2VvdmVyJywgZGlzcGxheSk7XG4gICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhcmVudC5iaW5kKCdtb3VzZWxlYXZlJywgY2xvc2UpO1xuICAgICAgICAgICAgICAgICAgICBzY29wZS5wYXJlbnQuYmluZCgnYmx1cicsIGNsb3NlKTtcbiAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgIHNjb3BlLmRlbGF5ID0gYXR0cnMuZGVsYXkgfHwgMTAwMDsgLy8gd2FpdCAxcyBiZWZvcmUgZGlzcGxheWluZyB0aXBcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0UnLFxuICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZTogdG1wbCxcbiAgICAgICAgICAgICAgICAgICAgbGluazogbXltZXRob2RzLFxuICAgICAgICAgICAgICAgICAgICBzY29wZToge3RpcDogXCI9XCJ9IC8vIHRpcCBtYXkgbm90IGJlIGRlZmluZWQgd2hlbiB3aWRnZXQgaXMgZGlzcGxheVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XSk7XG59KSgpO1xuIiwiLyogXG4gKiBDb3B5cmlnaHQgKEMpIDIwMTUgXCJJb1QuYnpoXCJcbiAqIEF1dGhvciBcIkZ1bHVwIEFyIEZvbGxcIlxuICpcbiAqIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5XG4gKiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB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W4+JztcblxuXG4gICAgYW5ndWxhci5tb2R1bGUoJ0xpbmtCdXR0b24nLCBbXSlcbiAgICAgICAgICAgIC5kaXJlY3RpdmUoJ2xpbmtCdXR0b24nLCBbXCIkbG9jYXRpb25cIiwgZnVuY3Rpb24gKCRsb2NhdGlvbikge1xuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG15bWV0aG9kcyhzY29wZSwgZWxlbSwgYXR0cnMpIHtcblxuICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja2VkID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWF0dHJzLnF1ZXJ5KSAkbG9jYXRpb24ucGF0aChhdHRycy5ocmVmKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgJGxvY2F0aW9uLnBhdGgoYXR0cnMuaHJlZikuc2VhcmNoKGF0dHJzLnF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBhanVzdCBpY29uIG9yIHVzZSBkZWZhdWx0XG4gICAgICAgICAgICAgICAgICAgIHNjb3BlLmljb24gPSBhdHRycy5pY29uICAgfHwgJ2ZpLWxpbmsnO1xuICAgICAgICAgICAgICAgICAgICBzY29wZS5sYWJlbCA9IGF0dHJzLmxhYmVsIHx8ICdKdW1wJztcbiAgICAgICAgICAgICAgICAgICAgc2NvcGUuaHJlZiAgPSBhdHRycy5ocmVmICB8fCAnL2hvbWUnO1xuICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgLy8gYWRkIGxhYmVsIGFzIGNsYXNzXG4gICAgICAgICAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MgKHNjb3BlLmxhYmVsLnRvTG93ZXJDYXNlKCkpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAg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udC5yZW1vdmVDbGFzcyAoXCJuZy1wcmlzdGluZVwiKTtcblxuICAgICAgICAgLy8gaWYgdmFsdWUgbm90IG51bGwgY2xlYW4gdXAgc3RyaW5nXG4gICAgICAgICBpZiAoc2NvcGUudmFsdWUpIHtcbiAgICAgICAgICAgICBzY29wZS5lcnJvcj1mYWxzZTsgXG4gICAgICAgICAgICAvLyByZW1vdmUgbGVhZGluZyBhbmQgdHJhaWxsaW5nIHNwYWNlXG4gICAgICAgICAgICBzY29wZS52YWx1ZSA9IHNjb3BlLnZhbHVlLnRyaW0oKTtcbiAgICAgICAgIFxuICAgICAgICAgICAgLy8gcmVtb3ZlIGFueSBzcGFjZSBpcyBub3QgYWxsb3dlZFxuICAgICAgICAgICAgaWYgKCdub3NwYWNlJyBpbiBhdHRycykge1xuICAgICAgICAgICAgICAgc2NvcGUudmFsdWU9c2NvcGUudmFsdWUucmVwbGFjZSgvXFxzL2csICcnKTsgICAgXG4gICAgICAgICAgICB9XG4gICAgICAgICBcbiAgICAgICAgICAgIGlmICgnbG93ZXJjYXNlJyBpbiBhdHRycykge1xuICAgICAgICAgICAgICAgc2NvcGUudmFsdWUgPSBzY29wZS52YWx1ZS50b0xvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgXG4gICAgICAgICAgICAvLyBjaGVjayBtaW5pbXVtIGxlbmdodFxuICAgICAgICAgICAgaWYgKFwibWlubGVuXCIgaW4gYXR0cnMpIHtcbiAgICAgICAgICAgICAgaWYgKHNjb3BlLnZhbHVlLmxlbmd0aCA8IGF0dHJzLm1pbmxlbikge1xuICAgICAgICAgICAgICAgICBzY29wZS5zdGF0dXM9J2ludmFsaWQnO1xuICAgICAgICAgICAgICAgICBzY29wZS5lcnJtc2c9c2NvcGUubmFtZSArICc6IE1pbmludW0gTGVuZ2g9ICcgKyBhdHRycy5taW5sZW4gKyAnIENoYXJhY3RlcnMnO1xuICAgICAgICAgICAgICAgICBzY29wZS5lcnJvcj10cnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGlmICgnZW1haWwnIGluIGF0dHJzKSB7XG4gICAgICAgICAgICBpZiAoIWVtYWlscGF0ZXJuLnRlc3QgKHNjb3BlLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHNjb3BlLnN0YXR1cz0naW52YWxpZCc7XG4gICAgICAgICAgICAgICAgc2NvcGUuZXJybXNnPSdpbnZhbGlkIGVtYWlsIGFkZHJlc3MnO1xuICAgICAgICAgICAgICAgIHNjb3BlLmVycm9yPXRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICB9XG4gICAgICAgICBcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChzY29wZS5yZXF1aXJlZCkge1xuICAgICAgICAgICAgICAgICBzY29wZS5zdGF0dXM9J2ludmFsaWQnO1xuICAgICAgICAgICAgICAgICBzY29wZS5lcnJtc2c9c2NvcGUubmFtZSArICc6IFJlcXVpcmVkIEF0dHJpYnV0ZSc7XG4gICAgICAgICAgICAgICAgIHNjb3BlLmVycm9yPXRydWU7IFxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgIC8vIElmIGxvY2FsIGNvbnRyb2wgZmFpbCBsZXQncyByZWZ1c2UgaW5wdXRcbiAgICAgICAgIGlmIChzY29wZS5lcnJvcikge1xuICAgICAgICAgICAgIGlmIChzY29wZS5yZXF1aXJlZCAmJiBzY29wZS52YWxpZCkge1xuICAgICAgICAgICAgICAgICBzY29wZS52YWxpZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICBpZiAoc2NvcGUubDRhY291bnRlci52YWxpZGF0ZWQgPiAwKSBzY29wZS5sNGFjb3VudGVyLnZhbGlkYXRlZCAtLTtcbiAgICAgICAgICAgICB9IFxuICAgICAgICAgICAgIC8vIHVzZSBjYWxsIHRvIHVwZGF0ZSBmb3JtIHNjb3BlI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gICAgICAgICAgICBjb25zb2xlLmxvZyAoXCJPSzogXCIrIEpTT04uc3RyaW5naWZ5KGRhdGEpKTtcbiAgICAgICAgfTtcbiAgICAgICAgXG4gICAgICAgIHNjb3BlLlByb2Nlc3NFcnJvcj0gZnVuY3Rpb24oZGF0YSwgZXJyY29kZSwgaGVhZGVycywgY29uZmlnKSB7XG4gICAgICAgICAgICB2YXIgYXBpbmFtZT0gJ0FQSScrZGF0YS5yZXF1ZXN0LmFwaS5yZXBsYWNlKCctJywnXycpO1xuICAgICAgICAgICAgc2NvcGUuc3RhdHVzICAgPSBcImVyci1meFwiO1xuICAgICAgICAgICAgc2NvcGUuZXJyY29kZSAgPSBlcnJjb2RlO1xuICAgICAgICAgICAgc2NvcGUucmVxdWVzdCAgPSBkYXRhLnJlcXVlc3Q7XG4gICAgICAgICAgICBzY29wZS5yZXNwb25zZSA9IFwiXCI7XG4gICAgICAgICAgICBzY29wZVthcGluYW1lXT1cImZhaWxcIjtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgY29uc29sZS5sb2cgKFwiRlg6IFwiKyBKU09OLnN0cmluZ2lmeShkYXRhKSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgc2NvcGUuT3BlblNlc3Npb24gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nIChcIk9wZW5TZXNzaW9uXCIpOyBcbiAgICAgICAgICAgIHZhciBwb3N0ZGF0YT0gey8qIGFueSBqc29uIHlvdXIgYXBwbGljYXRpb24gbWF5IG5lZWQgKi99O1xuICAgICAgICAgICAgdmFyIGhhbmRsZXIgPSAkaHR0cC5wb3N0KENvbmZpZ0FwcC5zZXNzaW9uLmNyZWF0ZSArICc/dG9rZW49JytDb25maWdBcHAuc2Vzc2lvbi5pbml0aWFsLCBwb3N0ZGF0YSk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGhhbmRsZXIuc3VjY2VzcyhzY29wZS5Qcm9jZXNzUmVzcG9uc2UpO1xuIC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AgICAgICAgICAgICB2YXIgRmluZEluUGFyZW50ID0gZnVuY3Rpb24gKGVsZW1lbnQsIHNlbGVjdG9yKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXJlbnQgPSBlbGVtZW50O1xuICAgICAgICAgICAgICAgICAgICB2YXIgc2VhcmNoID0gc2VsZWN0b3IudG9VcHBlckNhc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHBhcmVudFswXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlYXJjaCA9PT0gcGFyZW50WzBdLnRhZ05hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGFyZW50O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSAgLy8gSFRNTERpdkVsZW1lbnQgcHJvcGVydGllc1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50ID0gcGFyZW50LnBhcmVudCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICB2YXIgIEZpbmRCeVRhZz0gZnVuY3Rpb24gKGVsZW1lbnQsIHRhZywgc2VsZWN0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNlYXJjaCA9IHNlbGVjdG9yLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0eXBlICAgPSB0YWcudG9Mb3dlckNhc2UoKSsgXCJOYW1lXCI7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjaGlsZHJlbiA9IGVsZW1lbnQuY2hpbGRyZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGNoaWxkcmVuWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VhcmNoID09PSBjaGlsZHJlblswXVt0eXBlXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjaGlsZHJlbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gIC8vIEhUTUxEaXZFbGVtZW50IHByb3BlcnRpZXNcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuID0gY2hpbGRyZW4ubmV4dCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICB2YXIgIEZpbmRCeUNsYXNzPSBmdW5jdGlvbiAoZWxlbWVudCwgc2VsZWN0b3IpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNlYXJjaCA9IHNlbGVjdG9yLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjaGlsZHJlbiA9IGVsZW1lbnQuY2hpbGRyZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGNoaWxkcmVuWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGRyZW4uaGFzQ2xhc3Moc2VhcmNoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjaGlsZHJlbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gIC8vIEhUTUxEaXZFbGVtZW50IHByb3BlcnRpZXNcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuID0gY2hpbGRyZW4ubmV4dCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHZhciBteU1ldGhvZHMgPSB7XG4gICAgICAgICAgICAgICAgICAgIEZpbmRJblBhcmVudDogRmluZEluUGFyZW50LFxuICAgICAgICAgICAgICAgICAgICBGaW5kQnlUYWc6IEZpbmRCeVRhZyxcbiAgICAgICAgICAgICAgICAgICAgRmluZEJ5Q2xhc3M6IEZpbmRCeUNsYXNzXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHJldHVybiBteU1ldGhvZHM7XG4gICAgICAg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9IHtcbiAgICAgICAgICAgICAgICAgICAgcGF0aHM6IHsgLy8gV2FybmluZyBwYXRocyBzaG91bGQgZW5kIHdpdGggL1xuICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2UgOiAnaW1hZ2VzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICBhdmF0YXI6ICdpbWFnZXMvYXZhdGFycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW8gOiAnaW1hZ2VzL2F1ZGlvLycsXG4gICAgICAgICAgICAgICAgICAgICAgICBhcHBsaSA6ICdpbWFnZXMvYXBwbGkvJ1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgbXlhcGk6IHsgLy8gV2FybmluZyBwYXRocyBzaG91bGQgZW5kIHdpdGggL1xuICAgICAgICAgICAgICAgICAgICAgICB0b2tlbiA6ICcvYXBpL215cGx1Z2luL3h4eHgnXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICBzZXNzaW9uOiB7IC8vIFRob3NlIGRhdGEgYXJlIHVwZGF0ZWQgYnkgc2Vzc2lvbiBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgICAgICAgIGNyZWF0ZSAgOiAnL2FwaS90b2tlbi9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoIDogJy9hcGkvdG9rZW4vcmVmcmVzaCcsXG4gICAgICAgICAgICAgICAgICAgICAgIGNoZWNrICAgOiAnL2FwaS90b2tlbi9jaGVjaycsXG4gICAgICAgICAgICAgICAgICAgICAgIHJlc2V0ICAgOiAnL2FwaS90b2tlbi9yZXNldCcsXG4gICAgICAgICAgICAgICAgICAgICAgIHBpbmcgICAgOiAnL2FwaS90b2tlbi9jaGVjaycsXG4gICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWwgOiAnMTIzNDU2Nzg5JywgIC8vIHR5cGljYWwgZGV2IGluaXRpYWwgdG9rZW5cbiAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dCA6IDM2MDAsICAgICAgICAgLy8gdGltZW91dCBpcyB1cGRhdGVkIGNsaWVudCBzZXNzaW4gY29udGV4dCBjcmVhdGlvblxuICAgICAgICAgICAgICAgICAgICAgICBwaW5ncmF0ZTogNjAsICAgICAgICAgICAvLyBQaW5nIHJhdGUgdG8gY2hlY2sgaWYgc2VydmVyIGlzIHN0aWxsIGFsaXZlXG4gICAgICAgICAgICAgICAgICAgICAgIHV1aWQgICAgOiAnJywgICAgICAgICAgIC8vIHV1aWQgbWFwIHdpdGggY29va2llIG9yIGxvbmcgdGVybSBzZXNzaW9uIGFjY2VzcyBrZXlcbiAgICAgICAgICAgICAgICAgICAgICAgdG9rZW4gICA6ICcnICAgICAgICAgICAgLy8gd2lsbCBiZSByZXR1cm5lZCBmcm9tIGF1dGhlbnRpY2F0aW9uICAgIFxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHJldHVybiBteUNvbmZpZztcbiAgICAgICAgICAgIH1dKTtcblxufSkoKTsiLCIoZnVuY3Rpb24oKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICBhbmd1bGFyLm1vZHVsZSgnQUZCY2xpZW50JywgWyAvLyBXYXJuaW5nOiBBcHBuYW1lIHNob3VsZCBmaXQgd2l0aCBndWxwZmlsZS5qcyAmIGluZGV4Lmh0bWxcbiAgICAndWkucm91dGVyJyxcbiAgICAnbmdBbmltYXRlJyxcblxuICAgIC8vZm91bmRhdGlvblxuICAgICdmb3VuZGF0aW9uJyxcbiAgICAnZm91bmRhdGlvbi5keW5hbWljUm91dGluZycsXG4gICAgJ2ZvdW5kYXRpb24uZHluYW1pY1JvdXRpbmcuYW5pbWF0aW9ucycsXG4gICAgXG4gICAgLy8gZXh0ZXJuYWwgY29tcG9uZW50c1xuICAgICd1aS1ub3RpZmljYXRpb24nLFxu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m93cy1jb21wcmVzc1wiIGxhYmVsPVwiUmVmcmVzaFwiIGNsaWNrZWQ9XCJjdHJsLlJlZnJlc2hTZXNzaW9uXCI+PC9zdWJtaXQtYnV0dG9uPjxzdWJtaXQtYnV0dG9uIGNsYXNzPVwic2Vzc2lvbi1idXR0b24ge3tjdHJsLkFQSXJlc2V0fX1cIiBpY29uPVwiZmktbG9ja1wiIGxhYmVsPVwiQ2xvc2VcIiBjbGlja2VkPVwiY3RybC5SZXNldFNlc3Npb25cIj48L3N1Ym1pdC1idXR0b24+PC9kaXY+PGRpdiBjbGFzcz1cIm1lc3NhZ2UtYm94IGJveC1jb250ZW50IHZlcnRpY2FsIGdyaWQtZnJhbWVcIj48ZGl2IGNsYXNzPVwicmVzcG9uc2VcIj48c3BhbiBjbGFzcz1cImdyaWQtY29udGVudCBub3Njcm9sbCByZXEge3tjdHJsLnN0YXR1c319XCI+cmVxPSB7e2N0cmwucmVxdWVzdH19PC9zcGFuPiA8c3BhbiBjbGFzcz1cImdyaWQtY29udGVudCBub3Njcm9sbCByZXMge3tjdHJsLnN0YXR1c319XCI+cmVzPSB7e2N0cmwucmVzcG9uc2V9fTwvc3Bhbj4gPHNwYW4gY2xhc3M9XCJncmlkLWNvbnRlbnQgbm9zY3JvbGwgc3RhdHVzIHt7Y3RybC5zdGF0dXN9fVwiPnN0YXR1cz0ge3tjdHJsLmVycmNvZGV9fTwvc3Bhbj48L2Rpdj48L2Rpdj48bGluay1idXR0b24gaHJlZj1cInNhbXBsZVwiIGljb249XCJmaS1ob21lXCIgbGFiZWw9XCJzYW1wbGVcIj48L2xpbmstYnV0dG9uPicpO31dKTtcbn0pKCk7XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= diff --git a/afb-client/dist.prod/opa/images/appli/isnotvalid.png b/afb-client/dist.prod/opa/images/appli/isnotvalid.png new file mode 100644 index 0000000..057c215 Binary files /dev/null and b/afb-client/dist.prod/opa/images/appli/isnotvalid.png differ diff --git a/afb-client/dist.prod/opa/images/appli/istoobig.png b/afb-client/dist.prod/opa/images/appli/istoobig.png new file mode 100644 index 0000000..c3b794b Binary files /dev/null and b/afb-client/dist.prod/opa/images/appli/istoobig.png differ diff --git a/afb-client/dist.prod/opa/images/appli/upload-appli.png b/afb-client/dist.prod/opa/images/appli/upload-appli.png new file mode 100644 index 0000000..3dbd9dd Binary files /dev/null and b/afb-client/dist.prod/opa/images/appli/upload-appli.png differ diff --git a/afb-client/dist.prod/opa/images/audio/istoobig.png b/afb-client/dist.prod/opa/images/audio/istoobig.png new file mode 100644 index 0000000..c3b794b Binary files /dev/null and b/afb-client/dist.prod/opa/images/audio/istoobig.png differ diff --git a/afb-client/dist.prod/opa/images/audio/upload-music.png b/afb-client/dist.prod/opa/images/audio/upload-music.png new file mode 100644 index 0000000..5e0b309 Binary files /dev/null and b/afb-client/dist.prod/opa/images/audio/upload-music.png differ diff --git a/afb-client/dist.prod/opa/images/avatars/istoobig.jpg b/afb-client/dist.prod/opa/images/avatars/istoobig.jpg new file mode 100644 index 0000000..da0f255 Binary files /dev/null and b/afb-client/dist.prod/opa/images/avatars/istoobig.jpg differ diff --git a/afb-client/dist.prod/opa/images/avatars/istoobig.png b/afb-client/dist.prod/opa/images/avatars/istoobig.png new file mode 100644 index 0000000..c3b794b Binary files /dev/null and b/afb-client/dist.prod/opa/images/avatars/istoobig.png differ diff --git a/afb-client/dist.prod/opa/images/avatars/tux-admin.png b/afb-client/dist.prod/opa/images/avatars/tux-admin.png new file mode 100644 index 0000000..6ad950f Binary files /dev/null and b/afb-client/dist.prod/opa/images/avatars/tux-admin.png differ diff --git a/afb-client/dist.prod/opa/images/avatars/tux-bzh.png b/afb-client/dist.prod/opa/images/avatars/tux-bzh.png new file mode 100644 index 0000000..e2cd262 Binary files /dev/null and b/afb-client/dist.prod/opa/images/avatars/tux-bzh.png differ diff --git a/afb-client/dist.prod/opa/images/avatars/tux-visitor.png b/afb-client/dist.prod/opa/images/avatars/tux-visitor.png new file mode 100644 index 0000000..0569822 Binary files /dev/null and b/afb-client/dist.prod/opa/images/avatars/tux-visitor.png differ diff --git a/afb-client/dist.prod/opa/images/login/fb-logo.png b/afb-client/dist.prod/opa/images/login/fb-logo.png new file mode 100644 index 0000000..acae14d Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/fb-logo.png differ diff --git a/afb-client/dist.prod/opa/images/login/gg-logo.png b/afb-client/dist.prod/opa/images/login/gg-logo.png new file mode 100644 index 0000000..a2a84ee Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/gg-logo.png differ diff --git a/afb-client/dist.prod/opa/images/login/gh-logo.png b/afb-client/dist.prod/opa/images/login/gh-logo.png new file mode 100644 index 0000000..0ecb071 Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/gh-logo.png differ diff --git a/afb-client/dist.prod/opa/images/login/iot-logo.png b/afb-client/dist.prod/opa/images/login/iot-logo.png new file mode 100644 index 0000000..3fea4f8 Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/iot-logo.png differ diff --git a/afb-client/dist.prod/opa/images/login/lk-logo.png b/afb-client/dist.prod/opa/images/login/lk-logo.png new file mode 100644 index 0000000..11ae020 Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/lk-logo.png differ diff --git a/afb-client/dist.prod/opa/images/login/ms-logo.png b/afb-client/dist.prod/opa/images/login/ms-logo.png new file mode 100644 index 0000000..64cd877 Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/ms-logo.png differ diff --git a/afb-client/dist.prod/opa/images/login/og-logo.png b/afb-client/dist.prod/opa/images/login/og-logo.png new file mode 100644 index 0000000..8827fb5 Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/og-logo.png differ diff --git a/afb-client/dist.prod/opa/images/login/pp-logo.png b/afb-client/dist.prod/opa/images/login/pp-logo.png new file mode 100644 index 0000000..3300618 Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/pp-logo.png differ diff --git a/afb-client/dist.prod/opa/images/login/yh-logo.png b/afb-client/dist.prod/opa/images/login/yh-logo.png new file mode 100644 index 0000000..40c3148 Binary files /dev/null and b/afb-client/dist.prod/opa/images/login/yh-logo.png differ diff --git a/afb-client/dist.prod/opa/images/logo/logo_iot_bzh.svg b/afb-client/dist.prod/opa/images/logo/logo_iot_bzh.svg new file mode 100644 index 0000000..e37a9f3 --- /dev/null +++ b/afb-client/dist.prod/opa/images/logo/logo_iot_bzh.svg @@ -0,0 +1 @@ +IOTBZH \ No newline at end of file diff --git a/afb-client/dist.prod/opa/images/logo/logo_iot_bzhx350.png b/afb-client/dist.prod/opa/images/logo/logo_iot_bzhx350.png new file mode 100644 index 0000000..2bee568 Binary files /dev/null and b/afb-client/dist.prod/opa/images/logo/logo_iot_bzhx350.png differ diff --git a/afb-client/dist.prod/opa/images/logo/tampon-iot-bzhx450.png b/afb-client/dist.prod/opa/images/logo/tampon-iot-bzhx450.png new file mode 100644 index 0000000..44e04e5 Binary files /dev/null and b/afb-client/dist.prod/opa/images/logo/tampon-iot-bzhx450.png differ diff --git a/afb-client/dist.prod/opa/images/logo/triskel_iot_bzh.png b/afb-client/dist.prod/opa/images/logo/triskel_iot_bzh.png new file mode 100644 index 0000000..a921f1b Binary files /dev/null and b/afb-client/dist.prod/opa/images/logo/triskel_iot_bzh.png differ diff --git a/afb-client/dist.prod/opa/images/logo/triskel_iot_bzh.svg b/afb-client/dist.prod/opa/images/logo/triskel_iot_bzh.svg new file mode 100644 index 0000000..9ec086c --- /dev/null +++ b/afb-client/dist.prod/opa/images/logo/triskel_iot_bzh.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/afb-client/dist.prod/opa/images/logo/triskel_iot_bzhx250.png b/afb-client/dist.prod/opa/images/logo/triskel_iot_bzhx250.png new file mode 100644 index 0000000..b7c7db1 Binary files /dev/null and b/afb-client/dist.prod/opa/images/logo/triskel_iot_bzhx250.png differ diff --git a/afb-client/dist.prod/opa/index.html b/afb-client/dist.prod/opa/index.html new file mode 100644 index 0000000..6727a95 --- /dev/null +++ b/afb-client/dist.prod/opa/index.html @@ -0,0 +1,3 @@ +Simple Sample Application
\ No newline at end of file -- cgit 1.2.3-korg From 12a3520ba440316c76b95d92a684666f03f7b47d Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Thu, 7 Jan 2016 13:48:18 +0100 Subject: Update README.md (screenshot, target instructions) Added: - screenshot ; - instructions to run afb-daemon on target. Signed-off-by: Manuel Bachmann --- afb-client/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/afb-client/README.md b/afb-client/README.md index e506468..4e0796f 100644 --- a/afb-client/README.md +++ b/afb-client/README.md @@ -1,3 +1,8 @@ +### Sample client application for Application Framework Binder + +![AFB-Client screenshot](http://iot.bzh/images/afb-client.jpg) + +_(Application Framework Binder can be found on https://github.com/iotbzh/afb-daemon)_ ## Installation @@ -57,8 +62,11 @@ Install HTML5 development toolchain on your host ### Move to Target cd $MYWORKSPACE/afb-client gulp build-app-prod - scp -r ./dist.pro/* user@mytarget:/rootdir/apfDaemon + scp -r ./dist.prod/* user@mytarget:/rootdir/afb-client + ssh user@mytarget "afb-daemon --port=3001 --token='' --rootdir=/rootdir/afb-client" + http://mytarget:3001/opa +### Directory structure /AppClient | |---- package.json @@ -95,4 +103,3 @@ Install HTML5 development toolchain on your host |---- (/dist.dev) |---- (/dist.prod) - \ No newline at end of file -- cgit 1.2.3-korg From 3d2fda7dd39e2363682f1fa353c951ab0d44ddfa Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Tue, 9 Feb 2016 18:40:49 +0100 Subject: Implemented URL query parsing for initial token /opa/?token=abcde --- afb-client/app/Frontend/app.js | 11 +- afb-client/app/Frontend/etc/ConfigApp.js | 6 +- .../widgets/Buttons/SubmitButtons/SubmitButtons.js | 2 +- .../bower_components/angular-animate/.bower.json | 19 + .../bower_components/angular-animate/README.md | 68 + .../angular-animate/angular-animate.js | 2142 ++ .../angular-animate/angular-animate.min.js | 33 + .../angular-animate/angular-animate.min.js.map | 8 + .../bower_components/angular-animate/bower.json | 9 + .../bower_components/angular-animate/index.js | 2 + .../bower_components/angular-animate/package.json | 26 + .../bower_components/angular-cookies/.bower.json | 19 + .../bower_components/angular-cookies/README.md | 68 + .../angular-cookies/angular-cookies.js | 207 + .../angular-cookies/angular-cookies.min.js | 8 + .../angular-cookies/angular-cookies.min.js.map | 8 + .../bower_components/angular-cookies/bower.json | 9 + .../bower_components/angular-cookies/index.js | 2 + .../bower_components/angular-cookies/package.json | 26 + .../angular-ui-notification/.bower.json | 45 + .../angular-ui-notification/LICENSE | 21 + .../angular-ui-notification/README.md | 174 + .../angular-ui-notification/bower.json | 36 + .../dist/angular-ui-notification.min.css | 8 + .../dist/angular-ui-notification.min.js | 8 + .../angular-ui-notification/gulpfile.js | 92 + .../angular-ui-notification/package.json | 45 + .../angular-ui-notification/protractor_conf.js | 24 + .../src/angular-ui-notification.html | 4 + .../src/angular-ui-notification.js | 172 + .../src/angular-ui-notification.less | 55 + .../bower_components/angular-ui-router/.bower.json | 34 + .../angular-ui-router/CHANGELOG.md | 316 + .../angular-ui-router/CONTRIBUTING.md | 65 + .../bower_components/angular-ui-router/LICENSE | 21 + .../bower_components/angular-ui-router/README.md | 252 + .../bower_components/angular-ui-router/bower.json | 24 + .../angular-ui-router/release/angular-ui-router.js | 4539 ++++ .../release/angular-ui-router.min.js | 8 + .../angular-ui-router/src/common.js | 293 + .../angular-ui-router/src/resolve.js | 252 + .../angular-ui-router/src/state.js | 1470 ++ .../angular-ui-router/src/stateDirectives.js | 391 + .../angular-ui-router/src/stateFilters.js | 39 + .../angular-ui-router/src/templateFactory.js | 110 + .../angular-ui-router/src/urlMatcherFactory.js | 1081 + .../angular-ui-router/src/urlRouter.js | 431 + .../bower_components/angular-ui-router/src/view.js | 45 + .../angular-ui-router/src/viewDirective.js | 351 + .../angular-ui-router/src/viewScroll.js | 52 + afb-client/bower_components/angular/.bower.json | 17 + afb-client/bower_components/angular/README.md | 64 + .../bower_components/angular/angular-csp.css | 13 + afb-client/bower_components/angular/angular.js | 26451 +++++++++++++++++++ afb-client/bower_components/angular/angular.min.js | 253 + .../bower_components/angular/angular.min.js.gzip | Bin 0 -> 46451 bytes .../bower_components/angular/angular.min.js.map | 8 + afb-client/bower_components/angular/bower.json | 8 + afb-client/bower_components/angular/index.js | 2 + afb-client/bower_components/angular/package.json | 25 + afb-client/bower_components/fastclick/.bower.json | 23 + afb-client/bower_components/fastclick/LICENSE | 22 + afb-client/bower_components/fastclick/README.md | 140 + afb-client/bower_components/fastclick/bower.json | 12 + .../bower_components/fastclick/lib/fastclick.js | 841 + .../bower_components/foundation-apps/.bower.json | 57 + .../bower_components/foundation-apps/CHANGELOG.md | 301 + .../bower_components/foundation-apps/LICENSE | 22 + .../bower_components/foundation-apps/README.md | 83 + .../foundation-apps/bin/gulp-dynamic-routing.js | 56 + .../bower_components/foundation-apps/bower.json | 48 + .../foundation-apps/dist/css/foundation-apps.css | 6146 +++++ .../dist/css/foundation-apps.min.css | 1 + .../dist/js/foundation-apps-templates.js | 170 + .../dist/js/foundation-apps-templates.min.js | 1 + .../foundation-apps/dist/js/foundation-apps.js | 3136 +++ .../foundation-apps/dist/js/foundation-apps.min.js | 2 + .../foundation-apps/iconic/account.svg | 44 + .../foundation-apps/iconic/action.svg | 38 + .../foundation-apps/iconic/ban.svg | 17 + .../foundation-apps/iconic/bell.svg | 22 + .../foundation-apps/iconic/bookmark.svg | 14 + .../foundation-apps/iconic/cart.svg | 35 + .../foundation-apps/iconic/chevron.svg | 28 + .../foundation-apps/iconic/circle-check.svg | 25 + .../foundation-apps/iconic/circle-x.svg | 25 + .../foundation-apps/iconic/cog.svg | 17 + .../foundation-apps/iconic/comment-square.svg | 14 + .../foundation-apps/iconic/dashboard.svg | 38 + .../foundation-apps/iconic/document.svg | 28 + .../foundation-apps/iconic/envelope.svg | 44 + .../foundation-apps/iconic/flag.svg | 24 + .../foundation-apps/iconic/home.svg | 28 + .../foundation-apps/iconic/lock.svg | 55 + .../foundation-apps/iconic/magnifying-glass.svg | 26 + .../foundation-apps/iconic/person.svg | 62 + .../foundation-apps/iconic/reload.svg | 19 + .../foundation-apps/iconic/share-boxed.svg | 17 + .../foundation-apps/iconic/star.svg | 14 + .../foundation-apps/iconic/thumb.svg | 38 + .../foundation-apps/iconic/zoom.svg | 56 + .../foundation-apps/js/angular/app.js | 35 + .../components/accordion/accordion-item.html | 4 + .../js/angular/components/accordion/accordion.html | 2 + .../js/angular/components/accordion/accordion.js | 107 + .../components/actionsheet/actionsheet-button.html | 6 + .../actionsheet/actionsheet-content.html | 8 + .../components/actionsheet/actionsheet.html | 3 + .../angular/components/actionsheet/actionsheet.js | 226 + .../js/angular/components/common/common.js | 171 + .../js/angular/components/iconic/iconic.js | 186 + .../angular/components/interchange/interchange.js | 94 + .../js/angular/components/modal/modal.html | 9 + .../js/angular/components/modal/modal.js | 291 + .../components/notification/notification-set.html | 9 + .../notification/notification-static.html | 12 + .../components/notification/notification.html | 12 + .../components/notification/notification.js | 417 + .../js/angular/components/offcanvas/offcanvas.html | 5 + .../js/angular/components/offcanvas/offcanvas.js | 102 + .../js/angular/components/panel/panel.html | 6 + .../js/angular/components/panel/panel.js | 144 + .../js/angular/components/popup/popup.html | 2 + .../js/angular/components/popup/popup.js | 160 + .../js/angular/components/tabs/tab-content.html | 8 + .../js/angular/components/tabs/tab.html | 3 + .../js/angular/components/tabs/tabs.html | 8 + .../js/angular/components/tabs/tabs.js | 311 + .../foundation-apps/js/angular/foundation.js | 22 + .../angular/services/foundation.core.animation.js | 129 + .../js/angular/services/foundation.core.js | 163 + .../foundation.dynamicRouting.animations.js | 125 + .../angular/services/foundation.dynamicRouting.js | 156 + .../js/angular/services/foundation.mediaquery.js | 198 + .../foundation-apps/js/angular/vendor/markdown.js | 10 + .../foundation-apps/js/angular/vendor/svgDirs.js | 101 + .../foundation-apps/js/vendor/iconic.min.js | 6 + .../foundation-apps/scss/_global.scss | 131 + .../foundation-apps/scss/_settings.scss | 614 + .../scss/components/_accordion.scss | 72 + .../scss/components/_action-sheet.scss | 265 + .../scss/components/_block-list.scss | 350 + .../scss/components/_button-group.scss | 197 + .../foundation-apps/scss/components/_button.scss | 205 + .../foundation-apps/scss/components/_card.scss | 93 + .../foundation-apps/scss/components/_extras.scss | 54 + .../foundation-apps/scss/components/_forms.scss | 458 + .../foundation-apps/scss/components/_grid.scss | 420 + .../foundation-apps/scss/components/_iconic.scss | 95 + .../foundation-apps/scss/components/_label.scss | 134 + .../foundation-apps/scss/components/_list.scss | 19 + .../foundation-apps/scss/components/_menu-bar.scss | 363 + .../foundation-apps/scss/components/_modal.scss | 126 + .../foundation-apps/scss/components/_motion.scss | 524 + .../scss/components/_notification.scss | 207 + .../scss/components/_off-canvas.scss | 169 + .../foundation-apps/scss/components/_panel.scss | 134 + .../foundation-apps/scss/components/_popup.scss | 68 + .../foundation-apps/scss/components/_switch.scss | 130 + .../foundation-apps/scss/components/_tabs.scss | 100 + .../scss/components/_title-bar.scss | 135 + .../scss/components/_typography.scss | 345 + .../scss/components/_utilities.scss | 160 + .../foundation-apps/scss/foundation.scss | 50 + .../foundation-apps/scss/helpers/_breakpoints.scss | 154 + .../foundation-apps/scss/helpers/_functions.scss | 343 + .../foundation-apps/scss/helpers/_images.scss | 19 + .../foundation-apps/scss/helpers/_mixins.scss | 123 + .../foundation-apps/scss/vendor/_normalize.scss | 425 + .../foundation-icon-fonts/.bower.json | 17 + .../foundation-icon-fonts/.fontcustom-data | 298 + .../foundation-icon-fonts/.gitignore | 1 + .../foundation-icon-fonts/README.md | 5 + .../foundation-icon-fonts/_foundation-icons.scss | 596 + .../foundation-icon-fonts/bower.json | 6 + .../foundation-icon-fonts/foundation-icons.css | 594 + .../foundation-icon-fonts/foundation-icons.eot | Bin 0 -> 54568 bytes .../foundation-icon-fonts/foundation-icons.svg | 970 + .../foundation-icon-fonts/foundation-icons.ttf | Bin 0 -> 56976 bytes .../foundation-icon-fonts/foundation-icons.woff | Bin 0 -> 32020 bytes .../foundation-icon-fonts/index.html | 3797 +++ .../foundation-icon-fonts/svgs/fi-address-book.svg | 14 + .../foundation-icon-fonts/svgs/fi-alert.svg | 17 + .../foundation-icon-fonts/svgs/fi-align-center.svg | 16 + .../svgs/fi-align-justify.svg | 16 + .../foundation-icon-fonts/svgs/fi-align-left.svg | 17 + .../foundation-icon-fonts/svgs/fi-align-right.svg | 17 + .../foundation-icon-fonts/svgs/fi-anchor.svg | 20 + .../foundation-icon-fonts/svgs/fi-annotate.svg | 15 + .../foundation-icon-fonts/svgs/fi-archive.svg | 18 + .../foundation-icon-fonts/svgs/fi-arrow-down.svg | 12 + .../foundation-icon-fonts/svgs/fi-arrow-left.svg | 12 + .../foundation-icon-fonts/svgs/fi-arrow-right.svg | 12 + .../foundation-icon-fonts/svgs/fi-arrow-up.svg | 12 + .../svgs/fi-arrows-compress.svg | 20 + .../svgs/fi-arrows-expand.svg | 20 + .../foundation-icon-fonts/svgs/fi-arrows-in.svg | 32 + .../foundation-icon-fonts/svgs/fi-arrows-out.svg | 32 + .../foundation-icon-fonts/svgs/fi-asl.svg | 52 + .../foundation-icon-fonts/svgs/fi-asterisk.svg | 20 + .../foundation-icon-fonts/svgs/fi-at-sign.svg | 19 + .../svgs/fi-background-color.svg | 13 + .../svgs/fi-battery-empty.svg | 12 + .../foundation-icon-fonts/svgs/fi-battery-full.svg | 13 + .../foundation-icon-fonts/svgs/fi-battery-half.svg | 13 + .../svgs/fi-bitcoin-circle.svg | 21 + .../foundation-icon-fonts/svgs/fi-bitcoin.svg | 23 + .../foundation-icon-fonts/svgs/fi-blind.svg | 20 + .../foundation-icon-fonts/svgs/fi-bluetooth.svg | 18 + .../foundation-icon-fonts/svgs/fi-bold.svg | 13 + .../svgs/fi-book-bookmark.svg | 18 + .../foundation-icon-fonts/svgs/fi-book.svg | 17 + .../foundation-icon-fonts/svgs/fi-bookmark.svg | 12 + .../foundation-icon-fonts/svgs/fi-braille.svg | 14 + .../foundation-icon-fonts/svgs/fi-burst-new.svg | 25 + .../foundation-icon-fonts/svgs/fi-burst-sale.svg | 29 + .../foundation-icon-fonts/svgs/fi-burst.svg | 21 + .../foundation-icon-fonts/svgs/fi-calendar.svg | 29 + .../foundation-icon-fonts/svgs/fi-camera.svg | 14 + .../foundation-icon-fonts/svgs/fi-check.svg | 10 + .../foundation-icon-fonts/svgs/fi-checkbox.svg | 19 + .../svgs/fi-clipboard-notes.svg | 32 + .../svgs/fi-clipboard-pencil.svg | 21 + .../foundation-icon-fonts/svgs/fi-clipboard.svg | 17 + .../foundation-icon-fonts/svgs/fi-clock.svg | 17 + .../svgs/fi-closed-caption.svg | 21 + .../foundation-icon-fonts/svgs/fi-cloud.svg | 12 + .../svgs/fi-comment-minus.svg | 18 + .../svgs/fi-comment-quotes.svg | 29 + .../svgs/fi-comment-video.svg | 13 + .../foundation-icon-fonts/svgs/fi-comment.svg | 11 + .../foundation-icon-fonts/svgs/fi-comments.svg | 14 + .../foundation-icon-fonts/svgs/fi-compass.svg | 15 + .../foundation-icon-fonts/svgs/fi-contrast.svg | 11 + .../foundation-icon-fonts/svgs/fi-credit-card.svg | 13 + .../foundation-icon-fonts/svgs/fi-crop.svg | 14 + .../foundation-icon-fonts/svgs/fi-crown.svg | 21 + .../foundation-icon-fonts/svgs/fi-css3.svg | 12 + .../foundation-icon-fonts/svgs/fi-database.svg | 26 + .../foundation-icon-fonts/svgs/fi-die-five.svg | 17 + .../foundation-icon-fonts/svgs/fi-die-four.svg | 16 + .../foundation-icon-fonts/svgs/fi-die-one.svg | 11 + .../foundation-icon-fonts/svgs/fi-die-six.svg | 18 + .../foundation-icon-fonts/svgs/fi-die-three.svg | 14 + .../foundation-icon-fonts/svgs/fi-die-two.svg | 13 + .../foundation-icon-fonts/svgs/fi-dislike.svg | 18 + .../foundation-icon-fonts/svgs/fi-dollar-bill.svg | 31 + .../foundation-icon-fonts/svgs/fi-dollar.svg | 18 + .../foundation-icon-fonts/svgs/fi-download.svg | 15 + .../foundation-icon-fonts/svgs/fi-eject.svg | 16 + .../foundation-icon-fonts/svgs/fi-elevator.svg | 35 + .../foundation-icon-fonts/svgs/fi-euro.svg | 23 + .../foundation-icon-fonts/svgs/fi-eye.svg | 15 + .../foundation-icon-fonts/svgs/fi-fast-forward.svg | 13 + .../svgs/fi-female-symbol.svg | 18 + .../foundation-icon-fonts/svgs/fi-female.svg | 21 + .../foundation-icon-fonts/svgs/fi-filter.svg | 13 + .../foundation-icon-fonts/svgs/fi-first-aid.svg | 19 + .../foundation-icon-fonts/svgs/fi-flag.svg | 14 + .../foundation-icon-fonts/svgs/fi-folder-add.svg | 16 + .../foundation-icon-fonts/svgs/fi-folder-lock.svg | 16 + .../foundation-icon-fonts/svgs/fi-folder.svg | 11 + .../foundation-icon-fonts/svgs/fi-foot.svg | 16 + .../foundation-icon-fonts/svgs/fi-foundation.svg | 42 + .../foundation-icon-fonts/svgs/fi-graph-bar.svg | 24 + .../svgs/fi-graph-horizontal.svg | 20 + .../foundation-icon-fonts/svgs/fi-graph-pie.svg | 19 + .../foundation-icon-fonts/svgs/fi-graph-trend.svg | 22 + .../foundation-icon-fonts/svgs/fi-guide-dog.svg | 25 + .../foundation-icon-fonts/svgs/fi-hearing-aid.svg | 30 + .../foundation-icon-fonts/svgs/fi-heart.svg | 11 + .../foundation-icon-fonts/svgs/fi-home.svg | 9 + .../foundation-icon-fonts/svgs/fi-html5.svg | 12 + .../foundation-icon-fonts/svgs/fi-indent-less.svg | 19 + .../foundation-icon-fonts/svgs/fi-indent-more.svg | 19 + .../foundation-icon-fonts/svgs/fi-info.svg | 13 + .../foundation-icon-fonts/svgs/fi-italic.svg | 12 + .../foundation-icon-fonts/svgs/fi-key.svg | 16 + .../foundation-icon-fonts/svgs/fi-laptop.svg | 15 + .../foundation-icon-fonts/svgs/fi-layout.svg | 15 + .../foundation-icon-fonts/svgs/fi-lightbulb.svg | 31 + .../foundation-icon-fonts/svgs/fi-like.svg | 17 + .../foundation-icon-fonts/svgs/fi-link.svg | 18 + .../foundation-icon-fonts/svgs/fi-list-bullet.svg | 17 + .../foundation-icon-fonts/svgs/fi-list-number.svg | 23 + .../svgs/fi-list-thumbnails.svg | 26 + .../foundation-icon-fonts/svgs/fi-list.svg | 17 + .../foundation-icon-fonts/svgs/fi-lock.svg | 11 + .../foundation-icon-fonts/svgs/fi-loop.svg | 20 + .../svgs/fi-magnifying-glass.svg | 13 + .../foundation-icon-fonts/svgs/fi-mail.svg | 21 + .../foundation-icon-fonts/svgs/fi-male-female.svg | 34 + .../foundation-icon-fonts/svgs/fi-male-symbol.svg | 17 + .../foundation-icon-fonts/svgs/fi-male.svg | 17 + .../foundation-icon-fonts/svgs/fi-map.svg | 19 + .../foundation-icon-fonts/svgs/fi-marker.svg | 13 + .../foundation-icon-fonts/svgs/fi-megaphone.svg | 20 + .../foundation-icon-fonts/svgs/fi-microphone.svg | 16 + .../foundation-icon-fonts/svgs/fi-minus-circle.svg | 15 + .../foundation-icon-fonts/svgs/fi-minus.svg | 8 + .../svgs/fi-mobile-signal.svg | 29 + .../foundation-icon-fonts/svgs/fi-mobile.svg | 12 + .../foundation-icon-fonts/svgs/fi-monitor.svg | 12 + .../foundation-icon-fonts/svgs/fi-mountains.svg | 13 + .../foundation-icon-fonts/svgs/fi-music.svg | 12 + .../foundation-icon-fonts/svgs/fi-next.svg | 15 + .../foundation-icon-fonts/svgs/fi-no-dogs.svg | 23 + .../foundation-icon-fonts/svgs/fi-no-smoking.svg | 22 + .../foundation-icon-fonts/svgs/fi-page-add.svg | 20 + .../foundation-icon-fonts/svgs/fi-page-copy.svg | 15 + .../foundation-icon-fonts/svgs/fi-page-csv.svg | 19 + .../foundation-icon-fonts/svgs/fi-page-delete.svg | 21 + .../foundation-icon-fonts/svgs/fi-page-doc.svg | 19 + .../foundation-icon-fonts/svgs/fi-page-edit.svg | 20 + .../svgs/fi-page-export-csv.svg | 25 + .../svgs/fi-page-export-doc.svg | 25 + .../svgs/fi-page-export-pdf.svg | 23 + .../foundation-icon-fonts/svgs/fi-page-export.svg | 17 + .../foundation-icon-fonts/svgs/fi-page-filled.svg | 13 + .../svgs/fi-page-multiple.svg | 14 + .../foundation-icon-fonts/svgs/fi-page-pdf.svg | 17 + .../foundation-icon-fonts/svgs/fi-page-remove.svg | 19 + .../foundation-icon-fonts/svgs/fi-page-search.svg | 17 + .../foundation-icon-fonts/svgs/fi-page.svg | 11 + .../foundation-icon-fonts/svgs/fi-paint-bucket.svg | 17 + .../foundation-icon-fonts/svgs/fi-paperclip.svg | 17 + .../foundation-icon-fonts/svgs/fi-pause.svg | 16 + .../foundation-icon-fonts/svgs/fi-paw.svg | 17 + .../foundation-icon-fonts/svgs/fi-paypal.svg | 20 + .../foundation-icon-fonts/svgs/fi-pencil.svg | 12 + .../foundation-icon-fonts/svgs/fi-photo.svg | 15 + .../foundation-icon-fonts/svgs/fi-play-circle.svg | 15 + .../foundation-icon-fonts/svgs/fi-play-video.svg | 18 + .../foundation-icon-fonts/svgs/fi-play.svg | 11 + .../foundation-icon-fonts/svgs/fi-plus.svg | 11 + .../foundation-icon-fonts/svgs/fi-pound.svg | 23 + .../foundation-icon-fonts/svgs/fi-power.svg | 20 + .../foundation-icon-fonts/svgs/fi-previous.svg | 15 + .../foundation-icon-fonts/svgs/fi-price-tag.svg | 16 + .../svgs/fi-pricetag-multiple.svg | 20 + .../foundation-icon-fonts/svgs/fi-print.svg | 13 + .../foundation-icon-fonts/svgs/fi-prohibited.svg | 12 + .../svgs/fi-projection-screen.svg | 15 + .../foundation-icon-fonts/svgs/fi-puzzle.svg | 24 + .../foundation-icon-fonts/svgs/fi-quote.svg | 28 + .../foundation-icon-fonts/svgs/fi-record.svg | 11 + .../foundation-icon-fonts/svgs/fi-refresh.svg | 13 + .../svgs/fi-results-demographics.svg | 27 + .../foundation-icon-fonts/svgs/fi-results.svg | 42 + .../foundation-icon-fonts/svgs/fi-rewind-ten.svg | 23 + .../foundation-icon-fonts/svgs/fi-rewind.svg | 12 + .../foundation-icon-fonts/svgs/fi-rss.svg | 18 + .../foundation-icon-fonts/svgs/fi-safety-cone.svg | 14 + .../foundation-icon-fonts/svgs/fi-save.svg | 18 + .../foundation-icon-fonts/svgs/fi-share.svg | 14 + .../svgs/fi-sheriff-badge.svg | 17 + .../foundation-icon-fonts/svgs/fi-shield.svg | 11 + .../foundation-icon-fonts/svgs/fi-shopping-bag.svg | 12 + .../svgs/fi-shopping-cart.svg | 16 + .../foundation-icon-fonts/svgs/fi-shuffle.svg | 21 + .../foundation-icon-fonts/svgs/fi-skull.svg | 22 + .../foundation-icon-fonts/svgs/fi-social-500px.svg | 30 + .../foundation-icon-fonts/svgs/fi-social-adobe.svg | 11 + .../svgs/fi-social-amazon.svg | 28 + .../svgs/fi-social-android.svg | 25 + .../foundation-icon-fonts/svgs/fi-social-apple.svg | 15 + .../svgs/fi-social-behance.svg | 26 + .../foundation-icon-fonts/svgs/fi-social-bing.svg | 14 + .../svgs/fi-social-blogger.svg | 17 + .../svgs/fi-social-delicious.svg | 9 + .../svgs/fi-social-designer-news.svg | 22 + .../svgs/fi-social-deviant-art.svg | 20 + .../foundation-icon-fonts/svgs/fi-social-digg.svg | 39 + .../svgs/fi-social-dribbble.svg | 20 + .../foundation-icon-fonts/svgs/fi-social-drive.svg | 11 + .../svgs/fi-social-dropbox.svg | 14 + .../svgs/fi-social-evernote.svg | 24 + .../svgs/fi-social-facebook.svg | 11 + .../svgs/fi-social-flickr.svg | 12 + .../svgs/fi-social-forrst.svg | 11 + .../svgs/fi-social-foursquare.svg | 17 + .../svgs/fi-social-game-center.svg | 18 + .../svgs/fi-social-github.svg | 17 + .../svgs/fi-social-google-plus.svg | 28 + .../svgs/fi-social-hacker-news.svg | 11 + .../foundation-icon-fonts/svgs/fi-social-hi5.svg | 20 + .../svgs/fi-social-instagram.svg | 19 + .../svgs/fi-social-joomla.svg | 30 + .../svgs/fi-social-lastfm.svg | 16 + .../svgs/fi-social-linkedin.svg | 14 + .../svgs/fi-social-medium.svg | 13 + .../svgs/fi-social-myspace.svg | 19 + .../foundation-icon-fonts/svgs/fi-social-orkut.svg | 13 + .../foundation-icon-fonts/svgs/fi-social-path.svg | 11 + .../svgs/fi-social-picasa.svg | 18 + .../svgs/fi-social-pinterest.svg | 17 + .../foundation-icon-fonts/svgs/fi-social-rdio.svg | 12 + .../svgs/fi-social-reddit.svg | 20 + .../svgs/fi-social-skillshare.svg | 33 + .../foundation-icon-fonts/svgs/fi-social-skype.svg | 26 + .../svgs/fi-social-smashing-mag.svg | 35 + .../svgs/fi-social-snapchat.svg | 24 + .../svgs/fi-social-spotify.svg | 23 + .../svgs/fi-social-squidoo.svg | 32 + .../svgs/fi-social-stack-overflow.svg | 21 + .../foundation-icon-fonts/svgs/fi-social-steam.svg | 18 + .../svgs/fi-social-stumbleupon.svg | 17 + .../svgs/fi-social-treehouse.svg | 24 + .../svgs/fi-social-tumblr.svg | 16 + .../svgs/fi-social-twitter.svg | 14 + .../foundation-icon-fonts/svgs/fi-social-vimeo.svg | 23 + .../svgs/fi-social-windows.svg | 12 + .../foundation-icon-fonts/svgs/fi-social-xbox.svg | 16 + .../foundation-icon-fonts/svgs/fi-social-yahoo.svg | 26 + .../foundation-icon-fonts/svgs/fi-social-yelp.svg | 23 + .../svgs/fi-social-youtube.svg | 41 + .../svgs/fi-social-zerply.svg | 15 + .../foundation-icon-fonts/svgs/fi-social-zurb.svg | 16 + .../foundation-icon-fonts/svgs/fi-sound.svg | 49 + .../foundation-icon-fonts/svgs/fi-star.svg | 11 + .../foundation-icon-fonts/svgs/fi-stop.svg | 12 + .../svgs/fi-strikethrough.svg | 23 + .../foundation-icon-fonts/svgs/fi-subscript.svg | 21 + .../foundation-icon-fonts/svgs/fi-superscript.svg | 21 + .../svgs/fi-tablet-landscape.svg | 13 + .../svgs/fi-tablet-portrait.svg | 13 + .../foundation-icon-fonts/svgs/fi-target-two.svg | 17 + .../foundation-icon-fonts/svgs/fi-target.svg | 15 + .../svgs/fi-telephone-accessible.svg | 44 + .../foundation-icon-fonts/svgs/fi-telephone.svg | 15 + .../foundation-icon-fonts/svgs/fi-text-color.svg | 16 + .../foundation-icon-fonts/svgs/fi-thumbnails.svg | 35 + .../foundation-icon-fonts/svgs/fi-ticket.svg | 20 + .../svgs/fi-torso-business.svg | 19 + .../foundation-icon-fonts/svgs/fi-torso-female.svg | 16 + .../foundation-icon-fonts/svgs/fi-torso.svg | 13 + .../svgs/fi-torsos-all-female.svg | 21 + .../foundation-icon-fonts/svgs/fi-torsos-all.svg | 21 + .../svgs/fi-torsos-female-male.svg | 19 + .../svgs/fi-torsos-male-female.svg | 23 + .../foundation-icon-fonts/svgs/fi-torsos.svg | 17 + .../foundation-icon-fonts/svgs/fi-trash.svg | 17 + .../foundation-icon-fonts/svgs/fi-trees.svg | 22 + .../foundation-icon-fonts/svgs/fi-trophy.svg | 17 + .../foundation-icon-fonts/svgs/fi-underline.svg | 14 + .../svgs/fi-universal-access.svg | 22 + .../foundation-icon-fonts/svgs/fi-unlink.svg | 37 + .../foundation-icon-fonts/svgs/fi-unlock.svg | 11 + .../foundation-icon-fonts/svgs/fi-upload-cloud.svg | 19 + .../foundation-icon-fonts/svgs/fi-upload.svg | 15 + .../foundation-icon-fonts/svgs/fi-usb.svg | 14 + .../foundation-icon-fonts/svgs/fi-video.svg | 8 + .../foundation-icon-fonts/svgs/fi-volume-none.svg | 12 + .../svgs/fi-volume-strike.svg | 27 + .../foundation-icon-fonts/svgs/fi-volume.svg | 26 + .../foundation-icon-fonts/svgs/fi-web.svg | 16 + .../foundation-icon-fonts/svgs/fi-wheelchair.svg | 21 + .../foundation-icon-fonts/svgs/fi-widget.svg | 21 + .../foundation-icon-fonts/svgs/fi-wrench.svg | 17 + .../foundation-icon-fonts/svgs/fi-x-circle.svg | 19 + .../foundation-icon-fonts/svgs/fi-x.svg | 12 + .../foundation-icon-fonts/svgs/fi-yen.svg | 20 + .../foundation-icon-fonts/svgs/fi-zoom-in.svg | 23 + .../foundation-icon-fonts/svgs/fi-zoom-out.svg | 19 + afb-client/bower_components/hammerjs/.bower.json | 27 + afb-client/bower_components/hammerjs/CHANGELOG.md | 54 + .../bower_components/hammerjs/CONTRIBUTING.md | 41 + afb-client/bower_components/hammerjs/LICENSE.md | 21 + afb-client/bower_components/hammerjs/README.md | 49 + afb-client/bower_components/hammerjs/bower.json | 16 + afb-client/bower_components/hammerjs/changelog.js | 71 + afb-client/bower_components/hammerjs/hammer.js | 2568 ++ afb-client/bower_components/hammerjs/hammer.min.js | 7 + .../bower_components/hammerjs/hammer.min.map | 1 + afb-client/bower_components/jszip/.bower.json | 32 + afb-client/bower_components/jszip/CHANGES.md | 69 + afb-client/bower_components/jszip/Gruntfile.js | 130 + afb-client/bower_components/jszip/LICENSE.markdown | 651 + afb-client/bower_components/jszip/README.markdown | 41 + afb-client/bower_components/jszip/_config.yml | 25 + afb-client/bower_components/jszip/bower.json | 23 + afb-client/bower_components/jszip/component.json | 16 + afb-client/bower_components/jszip/dist/jszip.js | 9155 +++++++ .../bower_components/jszip/dist/jszip.min.js | 14 + afb-client/bower_components/jszip/docs/APPNOTE.TXT | 3217 +++ .../bower_components/jszip/docs/ZIP spec.txt | 66 + .../bower_components/jszip/docs/references.txt | 18 + .../jszip/documentation/_layouts/default.html | 158 + .../jszip/documentation/api_jszip.md | 15 + .../jszip/documentation/api_jszip/constructor.md | 23 + .../documentation/api_jszip/constructor_load.md | 22 + .../jszip/documentation/api_jszip/file_data.md | 90 + .../jszip/documentation/api_jszip/file_name.md | 46 + .../jszip/documentation/api_jszip/file_regex.md | 49 + .../jszip/documentation/api_jszip/filter.md | 43 + .../jszip/documentation/api_jszip/folder_data.md | 34 + .../jszip/documentation/api_jszip/folder_regex.md | 40 + .../jszip/documentation/api_jszip/generate.md | 139 + .../jszip/documentation/api_jszip/load.md | 81 + .../jszip/documentation/api_jszip/remove.md | 37 + .../jszip/documentation/api_jszip/support.md | 16 + .../jszip/documentation/api_zipobject.md | 37 + .../jszip/documentation/contributing.md | 62 + .../jszip/documentation/css/main.css | 24 + .../jszip/documentation/css/pygments.css | 64 + .../jszip/documentation/examples.md | 115 + .../documentation/examples/download-zip-file.html | 59 + .../jszip/documentation/examples/downloader.html | 58 + .../jszip/documentation/examples/downloader.js | 89 + .../examples/get-binary-files-ajax.html | 43 + .../examples/read-local-file-api.html | 87 + .../bower_components/jszip/documentation/faq.md | 19 + .../jszip/documentation/howto/read_zip.md | 152 + .../jszip/documentation/howto/write_zip.md | 106 + .../jszip/documentation/limitations.md | 73 + .../jszip/documentation/upgrade_guide.md | 57 + afb-client/bower_components/jszip/index.html | 169 + afb-client/bower_components/jszip/lib/base64.js | 70 + .../bower_components/jszip/lib/compressedObject.js | 28 + .../bower_components/jszip/lib/compressions.js | 13 + afb-client/bower_components/jszip/lib/crc32.js | 102 + .../bower_components/jszip/lib/dataReader.js | 107 + afb-client/bower_components/jszip/lib/defaults.js | 11 + .../jszip/lib/deprecatedPublicUtils.js | 105 + afb-client/bower_components/jszip/lib/flate.js | 16 + afb-client/bower_components/jszip/lib/index.js | 79 + .../bower_components/jszip/lib/license_header.js | 11 + afb-client/bower_components/jszip/lib/load.js | 31 + .../bower_components/jszip/lib/nodeBuffer.js | 7 + .../bower_components/jszip/lib/nodeBufferReader.js | 20 + afb-client/bower_components/jszip/lib/object.js | 883 + afb-client/bower_components/jszip/lib/signature.js | 7 + .../bower_components/jszip/lib/stringReader.js | 36 + .../bower_components/jszip/lib/stringWriter.js | 30 + afb-client/bower_components/jszip/lib/support.js | 34 + .../bower_components/jszip/lib/uint8ArrayReader.js | 47 + .../bower_components/jszip/lib/uint8ArrayWriter.js | 36 + afb-client/bower_components/jszip/lib/utf8.js | 207 + afb-client/bower_components/jszip/lib/utils.js | 326 + .../bower_components/jszip/lib/zipEntries.js | 221 + afb-client/bower_components/jszip/lib/zipEntry.js | 310 + afb-client/bower_components/jszip/package.json | 53 + .../bower_components/jszip/vendor/FileSaver.js | 247 + afb-client/bower_components/tether/.bower.json | 31 + afb-client/bower_components/tether/LICENSE | 8 + afb-client/bower_components/tether/README.md | 11 + afb-client/bower_components/tether/bower.json | 22 + .../bower_components/tether/coffee/abutment.coffee | 40 + .../tether/coffee/constraint.coffee | 260 + .../tether/coffee/markAttachment.coffee | 30 + .../bower_components/tether/coffee/shift.coffee | 27 + .../bower_components/tether/coffee/tether.coffee | 573 + .../bower_components/tether/coffee/utils.coffee | 211 + afb-client/bower_components/tether/component.json | 19 + .../tether/css/tether-theme-arrows-dark.css | 112 + .../tether/css/tether-theme-arrows.css | 120 + .../tether/css/tether-theme-basic.css | 29 + afb-client/bower_components/tether/css/tether.css | 10 + .../docs/1-Overview/1-why_you_should_use_tether.md | 43 + .../tether/docs/1-Overview/2-repositioning.md | 46 + .../docs/1-Overview/3-why_we_dont_support_IE_8.md | 47 + .../tether/docs/2-Examples/1-list_of_examples.md | 27 + .../docs/2-Examples/2-projects_using_tether.md | 29 + .../tether/docs/3-Advanced/1-embedding_tether.md | 9 + .../tether/docs/3-Advanced/2-extending_tether.md | 54 + .../tether/docs/coffee/intro.coffee | 113 + .../bower_components/tether/docs/css/intro.css | 219 + afb-client/bower_components/tether/docs/intro.md | 600 + .../bower_components/tether/docs/js/intro.js | 117 + .../bower_components/tether/docs/sass/intro.sass | 228 + .../tether/docs/welcome/browser-demo.html | 76 + .../tether/docs/welcome/coffee/welcome.coffee | 212 + .../tether/docs/welcome/css/browser-demo.css | 91 + .../tether/docs/welcome/css/prism.css | 2 + .../tether/docs/welcome/css/welcome.css | 272 + .../tether/docs/welcome/index.html | 227 + .../tether/docs/welcome/js/drop.js | 239 + .../tether/docs/welcome/js/jquery.js | 9597 +++++++ .../bower_components/tether/docs/welcome/js/log.js | 134 + .../tether/docs/welcome/js/tether-v0.1.3.js | 2 + .../tether/docs/welcome/js/welcome.js | 193 + .../tether/docs/welcome/sass/browser-demo.sass | 93 + .../tether/docs/welcome/sass/welcome.sass | 282 + .../tether/examples/chosen/chosen-sprite.png | Bin 0 -> 646 bytes .../tether/examples/chosen/chosen.css | 430 + .../tether/examples/chosen/chosen.js | 1166 + .../tether/examples/chosen/index.html | 110 + .../tether/examples/common/css/style.css | 48 + .../tether/examples/content-visible/index.html | 64 + .../tether/examples/dolls/dolls.css | 18 + .../tether/examples/dolls/dolls.js | 83 + .../tether/examples/dolls/index.html | 7 + .../tether/examples/element-scroll/index.html | 499 + .../tether/examples/enable-disable/index.html | 37 + .../tether/examples/facebook/facebook.css | 86 + .../tether/examples/facebook/index.html | 209 + .../tether/examples/out-of-bounds/index.html | 35 + .../tether/examples/pin/index.html | 30 + .../tether/examples/resources/css/base.css | 10 + .../tether/examples/resources/js/jquery.js | 9597 +++++++ .../tether/examples/resources/js/log.js | 134 + .../tether/examples/scroll/index.html | 922 + .../tether/examples/simple/index.html | 30 + .../tether/examples/testbed/index.html | 36 + .../tether/examples/tooltip/index.html | 86 + .../tether/examples/viewport/colors.css | 145 + .../tether/examples/viewport/index.html | 70 + afb-client/bower_components/tether/gulpfile.coffee | 65 + afb-client/bower_components/tether/gulpfile.js | 2 + afb-client/bower_components/tether/js/abutment.js | 59 + .../bower_components/tether/js/constraint.js | 308 + .../bower_components/tether/js/markAttachment.js | 46 + afb-client/bower_components/tether/js/shift.js | 38 + afb-client/bower_components/tether/js/tether.js | 686 + .../bower_components/tether/js/tether.min.js | 2 + afb-client/bower_components/tether/js/utils.js | 331 + afb-client/bower_components/tether/package.json | 21 + .../tether/sass/helpers/_tether-theme-arrows.sass | 136 + .../tether/sass/helpers/_tether-theme-basic.sass | 16 + .../tether/sass/helpers/_tether.sass | 14 + .../tether/sass/mixins/_pointer-events.scss | 6 + .../tether/sass/tether-theme-arrows-dark.sass | 12 + .../tether/sass/tether-theme-arrows.sass | 12 + .../tether/sass/tether-theme-basic.sass | 10 + .../bower_components/tether/sass/tether.sass | 5 + afb-client/bower_components/tether/tether.js | 1443 + afb-client/bower_components/tether/tether.min.js | 2 + .../viewport-units-buggyfill/.bower.json | 30 + .../viewport-units-buggyfill/Gruntfile.js | 19 + .../viewport-units-buggyfill/bower.json | 20 + .../viewport-units-buggyfill/package.json | 43 + .../viewport-units-buggyfill.hacks.js | 138 + .../viewport-units-buggyfill.js | 347 + 633 files changed, 126731 insertions(+), 7 deletions(-) create mode 100644 afb-client/bower_components/angular-animate/.bower.json create mode 100644 afb-client/bower_components/angular-animate/README.md create mode 100644 afb-client/bower_components/angular-animate/angular-animate.js create mode 100644 afb-client/bower_components/angular-animate/angular-animate.min.js create mode 100644 afb-client/bower_components/angular-animate/angular-animate.min.js.map create mode 100644 afb-client/bower_components/angular-animate/bower.json create mode 100644 afb-client/bower_components/angular-animate/index.js create mode 100644 afb-client/bower_components/angular-animate/package.json create mode 100644 afb-client/bower_components/angular-cookies/.bower.json create mode 100644 afb-client/bower_components/angular-cookies/README.md create mode 100644 afb-client/bower_components/angular-cookies/angular-cookies.js create mode 100644 afb-client/bower_components/angular-cookies/angular-cookies.min.js create mode 100644 afb-client/bower_components/angular-cookies/angular-cookies.min.js.map create mode 100644 afb-client/bower_components/angular-cookies/bower.json create mode 100644 afb-client/bower_components/angular-cookies/index.js create mode 100644 afb-client/bower_components/angular-cookies/package.json create mode 100644 afb-client/bower_components/angular-ui-notification/.bower.json create mode 100644 afb-client/bower_components/angular-ui-notification/LICENSE create mode 100644 afb-client/bower_components/angular-ui-notification/README.md create mode 100644 afb-client/bower_components/angular-ui-notification/bower.json create mode 100644 afb-client/bower_components/angular-ui-notification/dist/angular-ui-notification.min.css create mode 100644 afb-client/bower_components/angular-ui-notification/dist/angular-ui-notification.min.js create mode 100644 afb-client/bower_components/angular-ui-notification/gulpfile.js create mode 100644 afb-client/bower_components/angular-ui-notification/package.json create mode 100644 afb-client/bower_components/angular-ui-notification/protractor_conf.js create mode 100644 afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.html create mode 100644 afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.js create mode 100644 afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.less create mode 100644 afb-client/bower_components/angular-ui-router/.bower.json create mode 100644 afb-client/bower_components/angular-ui-router/CHANGELOG.md create mode 100644 afb-client/bower_components/angular-ui-router/CONTRIBUTING.md create mode 100644 afb-client/bower_components/angular-ui-router/LICENSE create mode 100644 afb-client/bower_components/angular-ui-router/README.md create mode 100644 afb-client/bower_components/angular-ui-router/bower.json create mode 100644 afb-client/bower_components/angular-ui-router/release/angular-ui-router.js create mode 100644 afb-client/bower_components/angular-ui-router/release/angular-ui-router.min.js create mode 100644 afb-client/bower_components/angular-ui-router/src/common.js create mode 100644 afb-client/bower_components/angular-ui-router/src/resolve.js create mode 100644 afb-client/bower_components/angular-ui-router/src/state.js create mode 100644 afb-client/bower_components/angular-ui-router/src/stateDirectives.js create mode 100644 afb-client/bower_components/angular-ui-router/src/stateFilters.js create mode 100644 afb-client/bower_components/angular-ui-router/src/templateFactory.js create mode 100644 afb-client/bower_components/angular-ui-router/src/urlMatcherFactory.js create mode 100644 afb-client/bower_components/angular-ui-router/src/urlRouter.js create mode 100644 afb-client/bower_components/angular-ui-router/src/view.js create mode 100644 afb-client/bower_components/angular-ui-router/src/viewDirective.js create mode 100644 afb-client/bower_components/angular-ui-router/src/viewScroll.js create mode 100644 afb-client/bower_components/angular/.bower.json create mode 100644 afb-client/bower_components/angular/README.md create mode 100644 afb-client/bower_components/angular/angular-csp.css create mode 100644 afb-client/bower_components/angular/angular.js create mode 100644 afb-client/bower_components/angular/angular.min.js create mode 100644 afb-client/bower_components/angular/angular.min.js.gzip create mode 100644 afb-client/bower_components/angular/angular.min.js.map create mode 100644 afb-client/bower_components/angular/bower.json create mode 100644 afb-client/bower_components/angular/index.js create mode 100644 afb-client/bower_components/angular/package.json create mode 100644 afb-client/bower_components/fastclick/.bower.json create mode 100644 afb-client/bower_components/fastclick/LICENSE create mode 100644 afb-client/bower_components/fastclick/README.md create mode 100644 afb-client/bower_components/fastclick/bower.json create mode 100644 afb-client/bower_components/fastclick/lib/fastclick.js create mode 100644 afb-client/bower_components/foundation-apps/.bower.json create mode 100644 afb-client/bower_components/foundation-apps/CHANGELOG.md create mode 100644 afb-client/bower_components/foundation-apps/LICENSE create mode 100755 afb-client/bower_components/foundation-apps/README.md create mode 100644 afb-client/bower_components/foundation-apps/bin/gulp-dynamic-routing.js create mode 100755 afb-client/bower_components/foundation-apps/bower.json create mode 100755 afb-client/bower_components/foundation-apps/dist/css/foundation-apps.css create mode 100755 afb-client/bower_components/foundation-apps/dist/css/foundation-apps.min.css create mode 100644 afb-client/bower_components/foundation-apps/dist/js/foundation-apps-templates.js create mode 100644 afb-client/bower_components/foundation-apps/dist/js/foundation-apps-templates.min.js create mode 100755 afb-client/bower_components/foundation-apps/dist/js/foundation-apps.js create mode 100755 afb-client/bower_components/foundation-apps/dist/js/foundation-apps.min.js create mode 100755 afb-client/bower_components/foundation-apps/iconic/account.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/action.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/ban.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/bell.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/bookmark.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/cart.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/chevron.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/circle-check.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/circle-x.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/cog.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/comment-square.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/dashboard.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/document.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/envelope.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/flag.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/home.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/lock.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/magnifying-glass.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/person.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/reload.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/share-boxed.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/star.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/thumb.svg create mode 100755 afb-client/bower_components/foundation-apps/iconic/zoom.svg create mode 100644 afb-client/bower_components/foundation-apps/js/angular/app.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/accordion/accordion-item.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/accordion/accordion.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/accordion/accordion.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/actionsheet/actionsheet-button.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/actionsheet/actionsheet-content.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/actionsheet/actionsheet.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/actionsheet/actionsheet.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/common/common.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/iconic/iconic.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/interchange/interchange.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/modal/modal.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/modal/modal.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/notification/notification-set.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/notification/notification-static.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/notification/notification.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/notification/notification.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/offcanvas/offcanvas.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/offcanvas/offcanvas.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/panel/panel.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/panel/panel.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/popup/popup.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/popup/popup.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/tabs/tab-content.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/tabs/tab.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/tabs/tabs.html create mode 100644 afb-client/bower_components/foundation-apps/js/angular/components/tabs/tabs.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/foundation.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/services/foundation.core.animation.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/services/foundation.core.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/services/foundation.dynamicRouting.animations.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/services/foundation.dynamicRouting.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/services/foundation.mediaquery.js create mode 100644 afb-client/bower_components/foundation-apps/js/angular/vendor/markdown.js create mode 100755 afb-client/bower_components/foundation-apps/js/angular/vendor/svgDirs.js create mode 100755 afb-client/bower_components/foundation-apps/js/vendor/iconic.min.js create mode 100755 afb-client/bower_components/foundation-apps/scss/_global.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/_settings.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_accordion.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_action-sheet.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_block-list.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_button-group.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_button.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_card.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_extras.scss create mode 100755 afb-client/bower_components/foundation-apps/scss/components/_forms.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_grid.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_iconic.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_label.scss create mode 100755 afb-client/bower_components/foundation-apps/scss/components/_list.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_menu-bar.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_modal.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_motion.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_notification.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_off-canvas.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_panel.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_popup.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_switch.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_tabs.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/components/_title-bar.scss create mode 100755 afb-client/bower_components/foundation-apps/scss/components/_typography.scss create mode 100755 afb-client/bower_components/foundation-apps/scss/components/_utilities.scss create mode 100755 afb-client/bower_components/foundation-apps/scss/foundation.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/helpers/_breakpoints.scss create mode 100755 afb-client/bower_components/foundation-apps/scss/helpers/_functions.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/helpers/_images.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/helpers/_mixins.scss create mode 100644 afb-client/bower_components/foundation-apps/scss/vendor/_normalize.scss create mode 100644 afb-client/bower_components/foundation-icon-fonts/.bower.json create mode 100644 afb-client/bower_components/foundation-icon-fonts/.fontcustom-data create mode 100644 afb-client/bower_components/foundation-icon-fonts/.gitignore create mode 100644 afb-client/bower_components/foundation-icon-fonts/README.md create mode 100644 afb-client/bower_components/foundation-icon-fonts/_foundation-icons.scss create mode 100644 afb-client/bower_components/foundation-icon-fonts/bower.json create mode 100644 afb-client/bower_components/foundation-icon-fonts/foundation-icons.css create mode 100644 afb-client/bower_components/foundation-icon-fonts/foundation-icons.eot create mode 100644 afb-client/bower_components/foundation-icon-fonts/foundation-icons.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/foundation-icons.ttf create mode 100644 afb-client/bower_components/foundation-icon-fonts/foundation-icons.woff create mode 100644 afb-client/bower_components/foundation-icon-fonts/index.html create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-address-book.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-alert.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-align-center.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-align-justify.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-align-left.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-align-right.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-anchor.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-annotate.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-archive.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-arrow-down.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-arrow-left.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-arrow-right.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-arrow-up.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-arrows-compress.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-arrows-expand.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-arrows-in.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-arrows-out.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-asl.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-asterisk.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-at-sign.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-background-color.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-battery-empty.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-battery-full.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-battery-half.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-bitcoin-circle.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-bitcoin.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-blind.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-bluetooth.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-bold.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-book-bookmark.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-book.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-bookmark.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-braille.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-burst-new.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-burst-sale.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-burst.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-calendar.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-camera.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-check.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-checkbox.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-clipboard-notes.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-clipboard-pencil.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-clipboard.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-clock.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-closed-caption.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-cloud.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-comment-minus.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-comment-quotes.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-comment-video.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-comment.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-comments.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-compass.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-contrast.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-credit-card.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-crop.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-crown.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-css3.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-database.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-die-five.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-die-four.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-die-one.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-die-six.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-die-three.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-die-two.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-dislike.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-dollar-bill.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-dollar.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-download.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-eject.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-elevator.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-euro.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-eye.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-fast-forward.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-female-symbol.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-female.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-filter.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-first-aid.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-flag.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-folder-add.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-folder-lock.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-folder.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-foot.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-foundation.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-graph-bar.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-graph-horizontal.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-graph-pie.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-graph-trend.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-guide-dog.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-hearing-aid.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-heart.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-home.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-html5.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-indent-less.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-indent-more.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-info.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-italic.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-key.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-laptop.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-layout.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-lightbulb.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-like.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-link.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-list-bullet.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-list-number.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-list-thumbnails.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-list.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-lock.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-loop.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-magnifying-glass.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-mail.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-male-female.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-male-symbol.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-male.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-map.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-marker.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-megaphone.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-microphone.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-minus-circle.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-minus.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-mobile-signal.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-mobile.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-monitor.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-mountains.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-music.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-next.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-no-dogs.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-no-smoking.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-add.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-copy.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-csv.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-delete.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-doc.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-edit.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-export-csv.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-export-doc.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-export-pdf.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-export.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-filled.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-multiple.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-pdf.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-remove.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page-search.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-page.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-paint-bucket.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-paperclip.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-pause.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-paw.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-paypal.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-pencil.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-photo.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-play-circle.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-play-video.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-play.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-plus.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-pound.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-power.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-previous.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-price-tag.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-pricetag-multiple.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-print.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-prohibited.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-projection-screen.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-puzzle.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-quote.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-record.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-refresh.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-results-demographics.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-results.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-rewind-ten.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-rewind.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-rss.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-safety-cone.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-save.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-share.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-sheriff-badge.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-shield.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-shopping-bag.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-shopping-cart.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-shuffle.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-skull.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-500px.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-adobe.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-amazon.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-android.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-apple.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-behance.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-bing.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-blogger.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-delicious.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-designer-news.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-deviant-art.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-digg.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-dribbble.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-drive.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-dropbox.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-evernote.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-facebook.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-flickr.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-forrst.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-foursquare.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-game-center.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-github.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-google-plus.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-hacker-news.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-hi5.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-instagram.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-joomla.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-lastfm.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-linkedin.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-medium.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-myspace.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-orkut.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-path.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-picasa.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-pinterest.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-rdio.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-reddit.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-skillshare.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-skype.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-smashing-mag.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-snapchat.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-spotify.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-squidoo.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-stack-overflow.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-steam.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-stumbleupon.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-treehouse.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-tumblr.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-twitter.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-vimeo.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-windows.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-xbox.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-yahoo.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-yelp.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-youtube.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-zerply.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-social-zurb.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-sound.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-star.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-stop.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-strikethrough.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-subscript.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-superscript.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-tablet-landscape.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-tablet-portrait.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-target-two.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-target.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-telephone-accessible.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-telephone.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-text-color.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-thumbnails.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-ticket.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-torso-business.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-torso-female.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-torso.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-torsos-all-female.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-torsos-all.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-torsos-female-male.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-torsos-male-female.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-torsos.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-trash.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-trees.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-trophy.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-underline.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-universal-access.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-unlink.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-unlock.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-upload-cloud.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-upload.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-usb.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-video.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-volume-none.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-volume-strike.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-volume.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-web.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-wheelchair.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-widget.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-wrench.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-x-circle.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-x.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-yen.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-zoom-in.svg create mode 100644 afb-client/bower_components/foundation-icon-fonts/svgs/fi-zoom-out.svg create mode 100644 afb-client/bower_components/hammerjs/.bower.json create mode 100644 afb-client/bower_components/hammerjs/CHANGELOG.md create mode 100644 afb-client/bower_components/hammerjs/CONTRIBUTING.md create mode 100644 afb-client/bower_components/hammerjs/LICENSE.md create mode 100644 afb-client/bower_components/hammerjs/README.md create mode 100644 afb-client/bower_components/hammerjs/bower.json create mode 100644 afb-client/bower_components/hammerjs/changelog.js create mode 100644 afb-client/bower_components/hammerjs/hammer.js create mode 100644 afb-client/bower_components/hammerjs/hammer.min.js create mode 100644 afb-client/bower_components/hammerjs/hammer.min.map create mode 100644 afb-client/bower_components/jszip/.bower.json create mode 100644 afb-client/bower_components/jszip/CHANGES.md create mode 100644 afb-client/bower_components/jszip/Gruntfile.js create mode 100644 afb-client/bower_components/jszip/LICENSE.markdown create mode 100644 afb-client/bower_components/jszip/README.markdown create mode 100644 afb-client/bower_components/jszip/_config.yml create mode 100644 afb-client/bower_components/jszip/bower.json create mode 100644 afb-client/bower_components/jszip/component.json create mode 100644 afb-client/bower_components/jszip/dist/jszip.js create mode 100644 afb-client/bower_components/jszip/dist/jszip.min.js create mode 100644 afb-client/bower_components/jszip/docs/APPNOTE.TXT create mode 100644 afb-client/bower_components/jszip/docs/ZIP spec.txt create mode 100644 afb-client/bower_components/jszip/docs/references.txt create mode 100644 afb-client/bower_components/jszip/documentation/_layouts/default.html create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/constructor.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/constructor_load.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/file_data.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/file_name.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/file_regex.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/filter.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/folder_data.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/folder_regex.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/generate.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/load.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/remove.md create mode 100644 afb-client/bower_components/jszip/documentation/api_jszip/support.md create mode 100644 afb-client/bower_components/jszip/documentation/api_zipobject.md create mode 100644 afb-client/bower_components/jszip/documentation/contributing.md create mode 100644 afb-client/bower_components/jszip/documentation/css/main.css create mode 100644 afb-client/bower_components/jszip/documentation/css/pygments.css create mode 100644 afb-client/bower_components/jszip/documentation/examples.md create mode 100644 afb-client/bower_components/jszip/documentation/examples/download-zip-file.html create mode 100644 afb-client/bower_components/jszip/documentation/examples/downloader.html create mode 100644 afb-client/bower_components/jszip/documentation/examples/downloader.js create mode 100644 afb-client/bower_components/jszip/documentation/examples/get-binary-files-ajax.html create mode 100644 afb-client/bower_components/jszip/documentation/examples/read-local-file-api.html create mode 100644 afb-client/bower_components/jszip/documentation/faq.md create mode 100644 afb-client/bower_components/jszip/documentation/howto/read_zip.md create mode 100644 afb-client/bower_components/jszip/documentation/howto/write_zip.md create mode 100644 afb-client/bower_components/jszip/documentation/limitations.md create mode 100644 afb-client/bower_components/jszip/documentation/upgrade_guide.md create mode 100644 afb-client/bower_components/jszip/index.html create mode 100644 afb-client/bower_components/jszip/lib/base64.js create mode 100644 afb-client/bower_components/jszip/lib/compressedObject.js create mode 100644 afb-client/bower_components/jszip/lib/compressions.js create mode 100644 afb-client/bower_components/jszip/lib/crc32.js create mode 100644 afb-client/bower_components/jszip/lib/dataReader.js create mode 100644 afb-client/bower_components/jszip/lib/defaults.js create mode 100644 afb-client/bower_components/jszip/lib/deprecatedPublicUtils.js create mode 100644 afb-client/bower_components/jszip/lib/flate.js create mode 100644 afb-client/bower_components/jszip/lib/index.js create mode 100644 afb-client/bower_components/jszip/lib/license_header.js create mode 100644 afb-client/bower_components/jszip/lib/load.js create mode 100644 afb-client/bower_components/jszip/lib/nodeBuffer.js create mode 100644 afb-client/bower_components/jszip/lib/nodeBufferReader.js create mode 100644 afb-client/bower_components/jszip/lib/object.js create mode 100644 afb-client/bower_components/jszip/lib/signature.js create mode 100644 afb-client/bower_components/jszip/lib/stringReader.js create mode 100644 afb-client/bower_components/jszip/lib/stringWriter.js create mode 100644 afb-client/bower_components/jszip/lib/support.js create mode 100644 afb-client/bower_components/jszip/lib/uint8ArrayReader.js create mode 100644 afb-client/bower_components/jszip/lib/uint8ArrayWriter.js create mode 100644 afb-client/bower_components/jszip/lib/utf8.js create mode 100644 afb-client/bower_components/jszip/lib/utils.js create mode 100644 afb-client/bower_components/jszip/lib/zipEntries.js create mode 100644 afb-client/bower_components/jszip/lib/zipEntry.js create mode 100644 afb-client/bower_components/jszip/package.json create mode 100644 afb-client/bower_components/jszip/vendor/FileSaver.js create mode 100644 afb-client/bower_components/tether/.bower.json create mode 100644 afb-client/bower_components/tether/LICENSE create mode 100644 afb-client/bower_components/tether/README.md create mode 100644 afb-client/bower_components/tether/bower.json create mode 100644 afb-client/bower_components/tether/coffee/abutment.coffee create mode 100644 afb-client/bower_components/tether/coffee/constraint.coffee create mode 100644 afb-client/bower_components/tether/coffee/markAttachment.coffee create mode 100644 afb-client/bower_components/tether/coffee/shift.coffee create mode 100644 afb-client/bower_components/tether/coffee/tether.coffee create mode 100644 afb-client/bower_components/tether/coffee/utils.coffee create mode 100644 afb-client/bower_components/tether/component.json create mode 100644 afb-client/bower_components/tether/css/tether-theme-arrows-dark.css create mode 100644 afb-client/bower_components/tether/css/tether-theme-arrows.css create mode 100644 afb-client/bower_components/tether/css/tether-theme-basic.css create mode 100644 afb-client/bower_components/tether/css/tether.css create mode 100644 afb-client/bower_components/tether/docs/1-Overview/1-why_you_should_use_tether.md create mode 100644 afb-client/bower_components/tether/docs/1-Overview/2-repositioning.md create mode 100644 afb-client/bower_components/tether/docs/1-Overview/3-why_we_dont_support_IE_8.md create mode 100644 afb-client/bower_components/tether/docs/2-Examples/1-list_of_examples.md create mode 100644 afb-client/bower_components/tether/docs/2-Examples/2-projects_using_tether.md create mode 100644 afb-client/bower_components/tether/docs/3-Advanced/1-embedding_tether.md create mode 100644 afb-client/bower_components/tether/docs/3-Advanced/2-extending_tether.md create mode 100644 afb-client/bower_components/tether/docs/coffee/intro.coffee create mode 100644 afb-client/bower_components/tether/docs/css/intro.css create mode 100644 afb-client/bower_components/tether/docs/intro.md create mode 100644 afb-client/bower_components/tether/docs/js/intro.js create mode 100644 afb-client/bower_components/tether/docs/sass/intro.sass create mode 100644 afb-client/bower_components/tether/docs/welcome/browser-demo.html create mode 100644 afb-client/bower_components/tether/docs/welcome/coffee/welcome.coffee create mode 100644 afb-client/bower_components/tether/docs/welcome/css/browser-demo.css create mode 100644 afb-client/bower_components/tether/docs/welcome/css/prism.css create mode 100644 afb-client/bower_components/tether/docs/welcome/css/welcome.css create mode 100644 afb-client/bower_components/tether/docs/welcome/index.html create mode 100644 afb-client/bower_components/tether/docs/welcome/js/drop.js create mode 100644 afb-client/bower_components/tether/docs/welcome/js/jquery.js create mode 100644 afb-client/bower_components/tether/docs/welcome/js/log.js create mode 100644 afb-client/bower_components/tether/docs/welcome/js/tether-v0.1.3.js create mode 100644 afb-client/bower_components/tether/docs/welcome/js/welcome.js create mode 100644 afb-client/bower_components/tether/docs/welcome/sass/browser-demo.sass create mode 100644 afb-client/bower_components/tether/docs/welcome/sass/welcome.sass create mode 100644 afb-client/bower_components/tether/examples/chosen/chosen-sprite.png create mode 100644 afb-client/bower_components/tether/examples/chosen/chosen.css create mode 100644 afb-client/bower_components/tether/examples/chosen/chosen.js create mode 100644 afb-client/bower_components/tether/examples/chosen/index.html create mode 100644 afb-client/bower_components/tether/examples/common/css/style.css create mode 100644 afb-client/bower_components/tether/examples/content-visible/index.html create mode 100644 afb-client/bower_components/tether/examples/dolls/dolls.css create mode 100644 afb-client/bower_components/tether/examples/dolls/dolls.js create mode 100644 afb-client/bower_components/tether/examples/dolls/index.html create mode 100644 afb-client/bower_components/tether/examples/element-scroll/index.html create mode 100644 afb-client/bower_components/tether/examples/enable-disable/index.html create mode 100644 afb-client/bower_components/tether/examples/facebook/facebook.css create mode 100644 afb-client/bower_components/tether/examples/facebook/index.html create mode 100644 afb-client/bower_components/tether/examples/out-of-bounds/index.html create mode 100644 afb-client/bower_components/tether/examples/pin/index.html create mode 100644 afb-client/bower_components/tether/examples/resources/css/base.css create mode 100644 afb-client/bower_components/tether/examples/resources/js/jquery.js create mode 100644 afb-client/bower_components/tether/examples/resources/js/log.js create mode 100644 afb-client/bower_components/tether/examples/scroll/index.html create mode 100644 afb-client/bower_components/tether/examples/simple/index.html create mode 100644 afb-client/bower_components/tether/examples/testbed/index.html create mode 100644 afb-client/bower_components/tether/examples/tooltip/index.html create mode 100644 afb-client/bower_components/tether/examples/viewport/colors.css create mode 100644 afb-client/bower_components/tether/examples/viewport/index.html create mode 100644 afb-client/bower_components/tether/gulpfile.coffee create mode 100644 afb-client/bower_components/tether/gulpfile.js create mode 100644 afb-client/bower_components/tether/js/abutment.js create mode 100644 afb-client/bower_components/tether/js/constraint.js create mode 100644 afb-client/bower_components/tether/js/markAttachment.js create mode 100644 afb-client/bower_components/tether/js/shift.js create mode 100644 afb-client/bower_components/tether/js/tether.js create mode 100644 afb-client/bower_components/tether/js/tether.min.js create mode 100644 afb-client/bower_components/tether/js/utils.js create mode 100644 afb-client/bower_components/tether/package.json create mode 100644 afb-client/bower_components/tether/sass/helpers/_tether-theme-arrows.sass create mode 100644 afb-client/bower_components/tether/sass/helpers/_tether-theme-basic.sass create mode 100644 afb-client/bower_components/tether/sass/helpers/_tether.sass create mode 100644 afb-client/bower_components/tether/sass/mixins/_pointer-events.scss create mode 100644 afb-client/bower_components/tether/sass/tether-theme-arrows-dark.sass create mode 100644 afb-client/bower_components/tether/sass/tether-theme-arrows.sass create mode 100644 afb-client/bower_components/tether/sass/tether-theme-basic.sass create mode 100644 afb-client/bower_components/tether/sass/tether.sass create mode 100644 afb-client/bower_components/tether/tether.js create mode 100644 afb-client/bower_components/tether/tether.min.js create mode 100644 afb-client/bower_components/viewport-units-buggyfill/.bower.json create mode 100755 afb-client/bower_components/viewport-units-buggyfill/Gruntfile.js create mode 100755 afb-client/bower_components/viewport-units-buggyfill/bower.json create mode 100755 afb-client/bower_components/viewport-units-buggyfill/package.json create mode 100644 afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.hacks.js create mode 100755 afb-client/bower_components/viewport-units-buggyfill/viewport-units-buggyfill.js diff --git a/afb-client/app/Frontend/app.js b/afb-client/app/Frontend/app.js index 72e8123..ed4d2ea 100644 --- a/afb-client/app/Frontend/app.js +++ b/afb-client/app/Frontend/app.js @@ -1,5 +1,13 @@ (function() { 'use strict'; + + function ParseQueryString () { + var qd = {}; + location.search.substr(1).split("&").forEach(function(item) { + var k = item.split("=")[0], v = decodeURIComponent(item.split("=")[1]); (k in qd) ? qd[k].push(v) : qd[k] = [v]; + }); + return qd; + } angular.module('@@APPNAME@@', [ // Warning: Appname should fit with gulpfile.js & index.html 'ui.router', @@ -24,14 +32,13 @@ 'RangeSlider', 'ModalNotification' ]) + .value ('urlquery', ParseQueryString()) .config(config) .run(run) ; config.$inject = ['$urlRouterProvider', '$locationProvider']; - console.log ("***location=" + window.location + " search" + window.search); - function config($urlProvider, $locationProvider, ConfigApp) { $urlProvider.otherwise('/home'); diff --git a/afb-client/app/Frontend/etc/ConfigApp.js b/afb-client/app/Frontend/etc/ConfigApp.js index 27e2e3e..a6a0cad 100644 --- a/afb-client/app/Frontend/etc/ConfigApp.js +++ b/afb-client/app/Frontend/etc/ConfigApp.js @@ -5,9 +5,7 @@ angular.module('ConfigApp', []) // Factory is a singleton and share its context within all instances. - .factory('ConfigApp', function ($location, $window) { - - // console.log ("URL="+ $location.url() + " Query=" + location.href+ " window=" + document.referrer); + .factory('ConfigApp', function (urlquery) { var myConfig = { paths: { // Warning paths should end with / @@ -27,7 +25,7 @@ check : '/api/token/check', reset : '/api/token/reset', ping : '/api/token/check', - initial : '123456789', // typical dev initial token + initial : urlquery.token || '123456789', // typical dev initial token timeout : 3600, // timeout is updated client sessin context creation pingrate: 60, // Ping rate to check if server is still alive uuid : '', // uuid map with cookie or long term session access key diff --git a/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.js b/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.js index 1b94e25..cba2aeb 100644 --- a/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.js +++ b/afb-client/app/Frontend/widgets/Buttons/SubmitButtons/SubmitButtons.js @@ -24,7 +24,7 @@ var tmpl = '
' + '' + '{{label}}' + - '
'; + '
'; angular.module('SubmitButton', []) .directive('submitButton', function () { diff --git a/afb-client/bower_components/angular-animate/.bower.json b/afb-client/bower_components/angular-animate/.bower.json new file mode 100644 index 0000000..f34908f --- /dev/null +++ b/afb-client/bower_components/angular-animate/.bower.json @@ -0,0 +1,19 @@ +{ + "name": "angular-animate", + "version": "1.3.20", + "main": "./angular-animate.js", + "ignore": [], + "dependencies": { + "angular": "1.3.20" + }, + "homepage": "https://github.com/angular/bower-angular-animate", + "_release": "1.3.20", + "_resolution": { + "type": "version", + "tag": "v1.3.20", + "commit": "a0d4208f770315df80866fcb449eff913efbbbdc" + }, + "_source": "git://github.com/angular/bower-angular-animate.git", + "_target": "~1.3.4", + "_originalSource": "angular-animate" +} \ No newline at end of file diff --git a/afb-client/bower_components/angular-animate/README.md b/afb-client/bower_components/angular-animate/README.md new file mode 100644 index 0000000..8313da6 --- /dev/null +++ b/afb-client/bower_components/angular-animate/README.md @@ -0,0 +1,68 @@ +# packaged angular-animate + +This repo is for distribution on `npm` and `bower`. The source for this module is in the +[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngAnimate). +Please file issues and pull requests against that repo. + +## Install + +You can install this package either with `npm` or with `bower`. + +### npm + +```shell +npm install angular-animate +``` + +Then add `ngAnimate` as a dependency for your app: + +```javascript +angular.module('myApp', [require('angular-animate')]); +``` + +### bower + +```shell +bower install angular-animate +``` + +Then add a ` +``` + +Then add `ngAnimate` as a dependency for your app: + +```javascript +angular.module('myApp', ['ngAnimate']); +``` + +## Documentation + +Documentation is available on the +[AngularJS docs site](http://docs.angularjs.org/api/ngAnimate). + +## License + +The MIT License + +Copyright (c) 2010-2015 Google, Inc. http://angularjs.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/afb-client/bower_components/angular-animate/angular-animate.js b/afb-client/bower_components/angular-animate/angular-animate.js new file mode 100644 index 0000000..d0a3f54 --- /dev/null +++ b/afb-client/bower_components/angular-animate/angular-animate.js @@ -0,0 +1,2142 @@ +/** + * @license AngularJS v1.3.20 + * (c) 2010-2014 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, angular, undefined) {'use strict'; + +/* jshint maxlen: false */ + +/** + * @ngdoc module + * @name ngAnimate + * @description + * + * The `ngAnimate` module provides support for JavaScript, CSS3 transition and CSS3 keyframe animation hooks within existing core and custom directives. + * + *
+ * + * # Usage + * + * To see animations in action, all that is required is to define the appropriate CSS classes + * or to register a JavaScript animation via the `myModule.animation()` function. The directives that support animation automatically are: + * `ngRepeat`, `ngInclude`, `ngIf`, `ngSwitch`, `ngShow`, `ngHide`, `ngView` and `ngClass`. Custom directives can take advantage of animation + * by using the `$animate` service. + * + * Below is a more detailed breakdown of the supported animation events provided by pre-existing ng directives: + * + * | Directive | Supported Animations | + * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------| + * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move | + * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave | + * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave | + * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave | + * | {@link ng.directive:ngIf#animations ngIf} | enter and leave | + * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) | + * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) | + * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) | + * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) | + * | {@link module:ngMessages#animations ngMessage} | enter and leave | + * + * You can find out more information about animations upon visiting each directive page. + * + * Below is an example of how to apply animations to a directive that supports animation hooks: + * + * ```html + * + * + * + * + * ``` + * + * Keep in mind that, by default, if an animation is running, any child elements cannot be animated + * until the parent element's animation has completed. This blocking feature can be overridden by + * placing the `ng-animate-children` attribute on a parent container tag. + * + * ```html + *
+ *
+ *
+ * ... + *
+ *
+ *
+ * ``` + * + * When the `on` expression value changes and an animation is triggered then each of the elements within + * will all animate without the block being applied to child elements. + * + * ## Are animations run when the application starts? + * No they are not. When an application is bootstrapped Angular will disable animations from running to avoid + * a frenzy of animations from being triggered as soon as the browser has rendered the screen. For this to work, + * Angular will wait for two digest cycles until enabling animations. From there on, any animation-triggering + * layout changes in the application will trigger animations as normal. + * + * In addition, upon bootstrap, if the routing system or any directives or load remote data (via $http) then Angular + * will automatically extend the wait time to enable animations once **all** of the outbound HTTP requests + * are complete. + * + * ## CSS-defined Animations + * The animate service will automatically apply two CSS classes to the animated element and these two CSS classes + * are designed to contain the start and end CSS styling. Both CSS transitions and keyframe animations are supported + * and can be used to play along with this naming structure. + * + * The following code below demonstrates how to perform animations using **CSS transitions** with Angular: + * + * ```html + * + * + *
+ *
+ *
+ * ``` + * + * The following code below demonstrates how to perform animations using **CSS animations** with Angular: + * + * ```html + * + * + *
+ *
+ *
+ * ``` + * + * Both CSS3 animations and transitions can be used together and the animate service will figure out the correct duration and delay timing. + * + * Upon DOM mutation, the event class is added first (something like `ng-enter`), then the browser prepares itself to add + * the active class (in this case `ng-enter-active`) which then triggers the animation. The animation module will automatically + * detect the CSS code to determine when the animation ends. Once the animation is over then both CSS classes will be + * removed from the DOM. If a browser does not support CSS transitions or CSS animations then the animation will start and end + * immediately resulting in a DOM element that is at its final state. This final state is when the DOM element + * has no CSS transition/animation classes applied to it. + * + * ### Structural transition animations + * + * Structural transitions (such as enter, leave and move) will always apply a `0s none` transition + * value to force the browser into rendering the styles defined in the setup (`.ng-enter`, `.ng-leave` + * or `.ng-move`) class. This means that any active transition animations operating on the element + * will be cut off to make way for the enter, leave or move animation. + * + * ### Class-based transition animations + * + * Class-based transitions refer to transition animations that are triggered when a CSS class is + * added to or removed from the element (via `$animate.addClass`, `$animate.removeClass`, + * `$animate.setClass`, or by directives such as `ngClass`, `ngModel` and `form`). + * They are different when compared to structural animations since they **do not cancel existing + * animations** nor do they **block successive transitions** from rendering on the same element. + * This distinction allows for **multiple class-based transitions** to be performed on the same element. + * + * In addition to ngAnimate supporting the default (natural) functionality of class-based transition + * animations, ngAnimate also decorates the element with starting and ending CSS classes to aid the + * developer in further styling the element throughout the transition animation. Earlier versions + * of ngAnimate may have caused natural CSS transitions to break and not render properly due to + * $animate temporarily blocking transitions using `0s none` in order to allow the setup CSS class + * (the `-add` or `-remove` class) to be applied without triggering an animation. However, as of + * **version 1.3**, this workaround has been removed with ngAnimate and all non-ngAnimate CSS + * class transitions are compatible with ngAnimate. + * + * There is, however, one special case when dealing with class-based transitions in ngAnimate. + * When rendering class-based transitions that make use of the setup and active CSS classes + * (e.g. `.fade-add` and `.fade-add-active` for when `.fade` is added) be sure to define + * the transition value **on the active CSS class** and not the setup class. + * + * ```css + * .fade-add { + * /* remember to place a 0s transition here + * to ensure that the styles are applied instantly + * even if the element already has a transition style */ + * transition:0s linear all; + * + * /* starting CSS styles */ + * opacity:1; + * } + * .fade-add.fade-add-active { + * /* this will be the length of the animation */ + * transition:1s linear all; + * opacity:0; + * } + * ``` + * + * The setup CSS class (in this case `.fade-add`) also has a transition style property, however, it + * has a duration of zero. This may not be required, however, incase the browser is unable to render + * the styling present in this CSS class instantly then it could be that the browser is attempting + * to perform an unnecessary transition. + * + * This workaround, however, does not apply to standard class-based transitions that are rendered + * when a CSS class containing a transition is applied to an element: + * + * ```css + * /* this works as expected */ + * .fade { + * transition:1s linear all; + * opacity:0; + * } + * ``` + * + * Please keep this in mind when coding the CSS markup that will be used within class-based transitions. + * Also, try not to mix the two class-based animation flavors together since the CSS code may become + * overly complex. + * + * + * ### Preventing Collisions With Third Party Libraries + * + * Some third-party frameworks place animation duration defaults across many element or className + * selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which + * is expecting actual animations on these elements and has to wait for their completion. + * + * You can prevent this unwanted behavior by using a prefix on all your animation classes: + * + * ```css + * /* prefixed with animate- */ + * .animate-fade-add.animate-fade-add-active { + * transition:1s linear all; + * opacity:0; + * } + * ``` + * + * You then configure `$animate` to enforce this prefix: + * + * ```js + * $animateProvider.classNameFilter(/animate-/); + * ``` + *
+ * + * ### CSS Staggering Animations + * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a + * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be + * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for + * the animation. The style property expected within the stagger class can either be a **transition-delay** or an + * **animation-delay** property (or both if your animation contains both transitions and keyframe animations). + * + * ```css + * .my-animation.ng-enter { + * /* standard transition code */ + * -webkit-transition: 1s linear all; + * transition: 1s linear all; + * opacity:0; + * } + * .my-animation.ng-enter-stagger { + * /* this will have a 100ms delay between each successive leave animation */ + * -webkit-transition-delay: 0.1s; + * transition-delay: 0.1s; + * + * /* in case the stagger doesn't work then these two values + * must be set to 0 to avoid an accidental CSS inheritance */ + * -webkit-transition-duration: 0s; + * transition-duration: 0s; + * } + * .my-animation.ng-enter.ng-enter-active { + * /* standard transition styles */ + * opacity:1; + * } + * ``` + * + * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations + * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this + * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation + * will also be reset if more than 10ms has passed after the last animation has been fired. + * + * The following code will issue the **ng-leave-stagger** event on the element provided: + * + * ```js + * var kids = parent.children(); + * + * $animate.leave(kids[0]); //stagger index=0 + * $animate.leave(kids[1]); //stagger index=1 + * $animate.leave(kids[2]); //stagger index=2 + * $animate.leave(kids[3]); //stagger index=3 + * $animate.leave(kids[4]); //stagger index=4 + * + * $timeout(function() { + * //stagger has reset itself + * $animate.leave(kids[5]); //stagger index=0 + * $animate.leave(kids[6]); //stagger index=1 + * }, 100, false); + * ``` + * + * Stagger animations are currently only supported within CSS-defined animations. + * + * ## JavaScript-defined Animations + * In the event that you do not want to use CSS3 transitions or CSS3 animations or if you wish to offer animations on browsers that do not + * yet support CSS transitions/animations, then you can make use of JavaScript animations defined inside of your AngularJS module. + * + * ```js + * //!annotate="YourApp" Your AngularJS Module|Replace this or ngModule with the module that you used to define your application. + * var ngModule = angular.module('YourApp', ['ngAnimate']); + * ngModule.animation('.my-crazy-animation', function() { + * return { + * enter: function(element, done) { + * //run the animation here and call done when the animation is complete + * return function(cancelled) { + * //this (optional) function will be called when the animation + * //completes or when the animation is cancelled (the cancelled + * //flag will be set to true if cancelled). + * }; + * }, + * leave: function(element, done) { }, + * move: function(element, done) { }, + * + * //animation that can be triggered before the class is added + * beforeAddClass: function(element, className, done) { }, + * + * //animation that can be triggered after the class is added + * addClass: function(element, className, done) { }, + * + * //animation that can be triggered before the class is removed + * beforeRemoveClass: function(element, className, done) { }, + * + * //animation that can be triggered after the class is removed + * removeClass: function(element, className, done) { } + * }; + * }); + * ``` + * + * JavaScript-defined animations are created with a CSS-like class selector and a collection of events which are set to run + * a javascript callback function. When an animation is triggered, $animate will look for a matching animation which fits + * the element's CSS class attribute value and then run the matching animation event function (if found). + * In other words, if the CSS classes present on the animated element match any of the JavaScript animations then the callback function will + * be executed. It should be also noted that only simple, single class selectors are allowed (compound class selectors are not supported). + * + * Within a JavaScript animation, an object containing various event callback animation functions is expected to be returned. + * As explained above, these callbacks are triggered based on the animation event. Therefore if an enter animation is run, + * and the JavaScript animation is found, then the enter callback will handle that animation (in addition to the CSS keyframe animation + * or transition code that is defined via a stylesheet). + * + * + * ### Applying Directive-specific Styles to an Animation + * In some cases a directive or service may want to provide `$animate` with extra details that the animation will + * include into its animation. Let's say for example we wanted to render an animation that animates an element + * towards the mouse coordinates as to where the user clicked last. By collecting the X/Y coordinates of the click + * (via the event parameter) we can set the `top` and `left` styles into an object and pass that into our function + * call to `$animate.addClass`. + * + * ```js + * canvas.on('click', function(e) { + * $animate.addClass(element, 'on', { + * to: { + * left : e.client.x + 'px', + * top : e.client.y + 'px' + * } + * }): + * }); + * ``` + * + * Now when the animation runs, and a transition or keyframe animation is picked up, then the animation itself will + * also include and transition the styling of the `left` and `top` properties into its running animation. If we want + * to provide some starting animation values then we can do so by placing the starting animations styles into an object + * called `from` in the same object as the `to` animations. + * + * ```js + * canvas.on('click', function(e) { + * $animate.addClass(element, 'on', { + * from: { + * position: 'absolute', + * left: '0px', + * top: '0px' + * }, + * to: { + * left : e.client.x + 'px', + * top : e.client.y + 'px' + * } + * }): + * }); + * ``` + * + * Once the animation is complete or cancelled then the union of both the before and after styles are applied to the + * element. If `ngAnimate` is not present then the styles will be applied immediately. + * + */ + +angular.module('ngAnimate', ['ng']) + + /** + * @ngdoc provider + * @name $animateProvider + * @description + * + * The `$animateProvider` allows developers to register JavaScript animation event handlers directly inside of a module. + * When an animation is triggered, the $animate service will query the $animate service to find any animations that match + * the provided name value. + * + * Requires the {@link ngAnimate `ngAnimate`} module to be installed. + * + * Please visit the {@link ngAnimate `ngAnimate`} module overview page learn more about how to use animations in your application. + * + */ + .directive('ngAnimateChildren', function() { + var NG_ANIMATE_CHILDREN = '$$ngAnimateChildren'; + return function(scope, element, attrs) { + var val = attrs.ngAnimateChildren; + if (angular.isString(val) && val.length === 0) { //empty attribute + element.data(NG_ANIMATE_CHILDREN, true); + } else { + scope.$watch(val, function(value) { + element.data(NG_ANIMATE_CHILDREN, !!value); + }); + } + }; + }) + + //this private service is only used within CSS-enabled animations + //IE8 + IE9 do not support rAF natively, but that is fine since they + //also don't support transitions and keyframes which means that the code + //below will never be used by the two browsers. + .factory('$$animateReflow', ['$$rAF', '$document', function($$rAF, $document) { + var bod = $document[0].body; + return function(fn) { + //the returned function acts as the cancellation function + return $$rAF(function() { + //the line below will force the browser to perform a repaint + //so that all the animated elements within the animation frame + //will be properly updated and drawn on screen. This is + //required to perform multi-class CSS based animations with + //Firefox. DO NOT REMOVE THIS LINE. DO NOT OPTIMIZE THIS LINE. + //THE MINIFIER WILL REMOVE IT OTHERWISE WHICH WILL RESULT IN AN + //UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND WILL + //TAKE YEARS AWAY FROM YOUR LIFE! + fn(bod.offsetWidth); + }); + }; + }]) + + .config(['$provide', '$animateProvider', function($provide, $animateProvider) { + var noop = angular.noop; + var forEach = angular.forEach; + var selectors = $animateProvider.$$selectors; + var isArray = angular.isArray; + var isString = angular.isString; + var isObject = angular.isObject; + + var ELEMENT_NODE = 1; + var NG_ANIMATE_STATE = '$$ngAnimateState'; + var NG_ANIMATE_CHILDREN = '$$ngAnimateChildren'; + var NG_ANIMATE_CLASS_NAME = 'ng-animate'; + var rootAnimateState = {running: true}; + + function extractElementNode(element) { + for (var i = 0; i < element.length; i++) { + var elm = element[i]; + if (elm.nodeType == ELEMENT_NODE) { + return elm; + } + } + } + + function prepareElement(element) { + return element && angular.element(element); + } + + function stripCommentsFromElement(element) { + return angular.element(extractElementNode(element)); + } + + function isMatchingElement(elm1, elm2) { + return extractElementNode(elm1) == extractElementNode(elm2); + } + var $$jqLite; + $provide.decorator('$animate', + ['$delegate', '$$q', '$injector', '$sniffer', '$rootElement', '$$asyncCallback', '$rootScope', '$document', '$templateRequest', '$$jqLite', + function($delegate, $$q, $injector, $sniffer, $rootElement, $$asyncCallback, $rootScope, $document, $templateRequest, $$$jqLite) { + + $$jqLite = $$$jqLite; + $rootElement.data(NG_ANIMATE_STATE, rootAnimateState); + + // Wait until all directive and route-related templates are downloaded and + // compiled. The $templateRequest.totalPendingRequests variable keeps track of + // all of the remote templates being currently downloaded. If there are no + // templates currently downloading then the watcher will still fire anyway. + var deregisterWatch = $rootScope.$watch( + function() { return $templateRequest.totalPendingRequests; }, + function(val, oldVal) { + if (val !== 0) return; + deregisterWatch(); + + // Now that all templates have been downloaded, $animate will wait until + // the post digest queue is empty before enabling animations. By having two + // calls to $postDigest calls we can ensure that the flag is enabled at the + // very end of the post digest queue. Since all of the animations in $animate + // use $postDigest, it's important that the code below executes at the end. + // This basically means that the page is fully downloaded and compiled before + // any animations are triggered. + $rootScope.$$postDigest(function() { + $rootScope.$$postDigest(function() { + rootAnimateState.running = false; + }); + }); + } + ); + + var globalAnimationCounter = 0; + var classNameFilter = $animateProvider.classNameFilter(); + var isAnimatableClassName = !classNameFilter + ? function() { return true; } + : function(className) { + return classNameFilter.test(className); + }; + + function classBasedAnimationsBlocked(element, setter) { + var data = element.data(NG_ANIMATE_STATE) || {}; + if (setter) { + data.running = true; + data.structural = true; + element.data(NG_ANIMATE_STATE, data); + } + return data.disabled || (data.running && data.structural); + } + + function runAnimationPostDigest(fn) { + var cancelFn, defer = $$q.defer(); + defer.promise.$$cancelFn = function() { + cancelFn && cancelFn(); + }; + $rootScope.$$postDigest(function() { + cancelFn = fn(function() { + defer.resolve(); + }); + }); + return defer.promise; + } + + function parseAnimateOptions(options) { + // some plugin code may still be passing in the callback + // function as the last param for the $animate methods so + // it's best to only allow string or array values for now + if (isObject(options)) { + if (options.tempClasses && isString(options.tempClasses)) { + options.tempClasses = options.tempClasses.split(/\s+/); + } + return options; + } + } + + function resolveElementClasses(element, cache, runningAnimations) { + runningAnimations = runningAnimations || {}; + + var lookup = {}; + forEach(runningAnimations, function(data, selector) { + forEach(selector.split(' '), function(s) { + lookup[s]=data; + }); + }); + + var hasClasses = Object.create(null); + forEach((element.attr('class') || '').split(/\s+/), function(className) { + hasClasses[className] = true; + }); + + var toAdd = [], toRemove = []; + forEach((cache && cache.classes) || [], function(status, className) { + var hasClass = hasClasses[className]; + var matchingAnimation = lookup[className] || {}; + + // When addClass and removeClass is called then $animate will check to + // see if addClass and removeClass cancel each other out. When there are + // more calls to removeClass than addClass then the count falls below 0 + // and then the removeClass animation will be allowed. Otherwise if the + // count is above 0 then that means an addClass animation will commence. + // Once an animation is allowed then the code will also check to see if + // there exists any on-going animation that is already adding or remvoing + // the matching CSS class. + if (status === false) { + //does it have the class or will it have the class + if (hasClass || matchingAnimation.event == 'addClass') { + toRemove.push(className); + } + } else if (status === true) { + //is the class missing or will it be removed? + if (!hasClass || matchingAnimation.event == 'removeClass') { + toAdd.push(className); + } + } + }); + + return (toAdd.length + toRemove.length) > 0 && [toAdd.join(' '), toRemove.join(' ')]; + } + + function lookup(name) { + if (name) { + var matches = [], + flagMap = {}, + classes = name.substr(1).split('.'); + + //the empty string value is the default animation + //operation which performs CSS transition and keyframe + //animations sniffing. This is always included for each + //element animation procedure if the browser supports + //transitions and/or keyframe animations. The default + //animation is added to the top of the list to prevent + //any previous animations from affecting the element styling + //prior to the element being animated. + if ($sniffer.transitions || $sniffer.animations) { + matches.push($injector.get(selectors[''])); + } + + for (var i=0; i < classes.length; i++) { + var klass = classes[i], + selectorFactoryName = selectors[klass]; + if (selectorFactoryName && !flagMap[klass]) { + matches.push($injector.get(selectorFactoryName)); + flagMap[klass] = true; + } + } + return matches; + } + } + + function animationRunner(element, animationEvent, className, options) { + //transcluded directives may sometimes fire an animation using only comment nodes + //best to catch this early on to prevent any animation operations from occurring + var node = element[0]; + if (!node) { + return; + } + + if (options) { + options.to = options.to || {}; + options.from = options.from || {}; + } + + var classNameAdd; + var classNameRemove; + if (isArray(className)) { + classNameAdd = className[0]; + classNameRemove = className[1]; + if (!classNameAdd) { + className = classNameRemove; + animationEvent = 'removeClass'; + } else if (!classNameRemove) { + className = classNameAdd; + animationEvent = 'addClass'; + } else { + className = classNameAdd + ' ' + classNameRemove; + } + } + + var isSetClassOperation = animationEvent == 'setClass'; + var isClassBased = isSetClassOperation + || animationEvent == 'addClass' + || animationEvent == 'removeClass' + || animationEvent == 'animate'; + + var currentClassName = element.attr('class'); + var classes = currentClassName + ' ' + className; + if (!isAnimatableClassName(classes)) { + return; + } + + var beforeComplete = noop, + beforeCancel = [], + before = [], + afterComplete = noop, + afterCancel = [], + after = []; + + var animationLookup = (' ' + classes).replace(/\s+/g,'.'); + forEach(lookup(animationLookup), function(animationFactory) { + var created = registerAnimation(animationFactory, animationEvent); + if (!created && isSetClassOperation) { + registerAnimation(animationFactory, 'addClass'); + registerAnimation(animationFactory, 'removeClass'); + } + }); + + function registerAnimation(animationFactory, event) { + var afterFn = animationFactory[event]; + var beforeFn = animationFactory['before' + event.charAt(0).toUpperCase() + event.substr(1)]; + if (afterFn || beforeFn) { + if (event == 'leave') { + beforeFn = afterFn; + //when set as null then animation knows to skip this phase + afterFn = null; + } + after.push({ + event: event, fn: afterFn + }); + before.push({ + event: event, fn: beforeFn + }); + return true; + } + } + + function run(fns, cancellations, allCompleteFn) { + var animations = []; + forEach(fns, function(animation) { + animation.fn && animations.push(animation); + }); + + var count = 0; + function afterAnimationComplete(index) { + if (cancellations) { + (cancellations[index] || noop)(); + if (++count < animations.length) return; + cancellations = null; + } + allCompleteFn(); + } + + //The code below adds directly to the array in order to work with + //both sync and async animations. Sync animations are when the done() + //operation is called right away. DO NOT REFACTOR! + forEach(animations, function(animation, index) { + var progress = function() { + afterAnimationComplete(index); + }; + switch (animation.event) { + case 'setClass': + cancellations.push(animation.fn(element, classNameAdd, classNameRemove, progress, options)); + break; + case 'animate': + cancellations.push(animation.fn(element, className, options.from, options.to, progress)); + break; + case 'addClass': + cancellations.push(animation.fn(element, classNameAdd || className, progress, options)); + break; + case 'removeClass': + cancellations.push(animation.fn(element, classNameRemove || className, progress, options)); + break; + default: + cancellations.push(animation.fn(element, progress, options)); + break; + } + }); + + if (cancellations && cancellations.length === 0) { + allCompleteFn(); + } + } + + return { + node: node, + event: animationEvent, + className: className, + isClassBased: isClassBased, + isSetClassOperation: isSetClassOperation, + applyStyles: function() { + if (options) { + element.css(angular.extend(options.from || {}, options.to || {})); + } + }, + before: function(allCompleteFn) { + beforeComplete = allCompleteFn; + run(before, beforeCancel, function() { + beforeComplete = noop; + allCompleteFn(); + }); + }, + after: function(allCompleteFn) { + afterComplete = allCompleteFn; + run(after, afterCancel, function() { + afterComplete = noop; + allCompleteFn(); + }); + }, + cancel: function() { + if (beforeCancel) { + forEach(beforeCancel, function(cancelFn) { + (cancelFn || noop)(true); + }); + beforeComplete(true); + } + if (afterCancel) { + forEach(afterCancel, function(cancelFn) { + (cancelFn || noop)(true); + }); + afterComplete(true); + } + } + }; + } + + /** + * @ngdoc service + * @name $animate + * @kind object + * + * @description + * The `$animate` service provides animation detection support while performing DOM operations (enter, leave and move) as well as during addClass and removeClass operations. + * When any of these operations are run, the $animate service + * will examine any JavaScript-defined animations (which are defined by using the $animateProvider provider object) + * as well as any CSS-defined animations against the CSS classes present on the element once the DOM operation is run. + * + * The `$animate` service is used behind the scenes with pre-existing directives and animation with these directives + * will work out of the box without any extra configuration. + * + * Requires the {@link ngAnimate `ngAnimate`} module to be installed. + * + * Please visit the {@link ngAnimate `ngAnimate`} module overview page learn more about how to use animations in your application. + * ## Callback Promises + * With AngularJS 1.3, each of the animation methods, on the `$animate` service, return a promise when called. The + * promise itself is then resolved once the animation has completed itself, has been cancelled or has been + * skipped due to animations being disabled. (Note that even if the animation is cancelled it will still + * call the resolve function of the animation.) + * + * ```js + * $animate.enter(element, container).then(function() { + * //...this is called once the animation is complete... + * }); + * ``` + * + * Also note that, due to the nature of the callback promise, if any Angular-specific code (like changing the scope, + * location of the page, etc...) is executed within the callback promise then be sure to wrap the code using + * `$scope.$apply(...)`; + * + * ```js + * $animate.leave(element).then(function() { + * $scope.$apply(function() { + * $location.path('/new-page'); + * }); + * }); + * ``` + * + * An animation can also be cancelled by calling the `$animate.cancel(promise)` method with the provided + * promise that was returned when the animation was started. + * + * ```js + * var promise = $animate.addClass(element, 'super-long-animation'); + * promise.then(function() { + * //this will still be called even if cancelled + * }); + * + * element.on('click', function() { + * //tooo lazy to wait for the animation to end + * $animate.cancel(promise); + * }); + * ``` + * + * (Keep in mind that the promise cancellation is unique to `$animate` since promises in + * general cannot be cancelled.) + * + */ + return { + /** + * @ngdoc method + * @name $animate#animate + * @kind function + * + * @description + * Performs an inline animation on the element which applies the provided `to` and `from` CSS styles to the element. + * If any detected CSS transition, keyframe or JavaScript matches the provided `className` value then the animation + * will take on the provided styles. For example, if a transition animation is set for the given className then the + * provided `from` and `to` styles will be applied alongside the given transition. If a JavaScript animation is + * detected then the provided styles will be given in as function paramters. + * + * ```js + * ngModule.animation('.my-inline-animation', function() { + * return { + * animate : function(element, className, from, to, done) { + * //styles + * } + * } + * }); + * ``` + * + * Below is a breakdown of each step that occurs during the `animate` animation: + * + * | Animation Step | What the element class attribute looks like | + * |-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------| + * | 1. `$animate.animate(...)` is called | `class="my-animation"` | + * | 2. `$animate` waits for the next digest to start the animation | `class="my-animation ng-animate"` | + * | 3. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` | + * | 4. the `className` class value is added to the element | `class="my-animation ng-animate className"` | + * | 5. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate className"` | + * | 6. `$animate` blocks all CSS transitions on the element to ensure the `.className` class styling is applied right away| `class="my-animation ng-animate className"` | + * | 7. `$animate` applies the provided collection of `from` CSS styles to the element | `class="my-animation ng-animate className"` | + * | 8. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate className"` | + * | 9. `$animate` removes the CSS transition block placed on the element | `class="my-animation ng-animate className"` | + * | 10. the `className-active` class is added (this triggers the CSS transition/animation) | `class="my-animation ng-animate className className-active"` | + * | 11. `$animate` applies the collection of `to` CSS styles to the element which are then handled by the transition | `class="my-animation ng-animate className className-active"` | + * | 12. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate className className-active"` | + * | 13. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` | + * | 14. The returned promise is resolved. | `class="my-animation"` | + * + * @param {DOMElement} element the element that will be the focus of the enter animation + * @param {object} from a collection of CSS styles that will be applied to the element at the start of the animation + * @param {object} to a collection of CSS styles that the element will animate towards + * @param {string=} className an optional CSS class that will be added to the element for the duration of the animation (the default class is `ng-inline-animate`) + * @param {object=} options an optional collection of options that will be picked up by the CSS transition/animation + * @return {Promise} the animation callback promise + */ + animate: function(element, from, to, className, options) { + className = className || 'ng-inline-animate'; + options = parseAnimateOptions(options) || {}; + options.from = to ? from : null; + options.to = to ? to : from; + + return runAnimationPostDigest(function(done) { + return performAnimation('animate', className, stripCommentsFromElement(element), null, null, noop, options, done); + }); + }, + + /** + * @ngdoc method + * @name $animate#enter + * @kind function + * + * @description + * Appends the element to the parentElement element that resides in the document and then runs the enter animation. Once + * the animation is started, the following CSS classes will be present on the element for the duration of the animation: + * + * Below is a breakdown of each step that occurs during enter animation: + * + * | Animation Step | What the element class attribute looks like | + * |-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------| + * | 1. `$animate.enter(...)` is called | `class="my-animation"` | + * | 2. element is inserted into the `parentElement` element or beside the `afterElement` element | `class="my-animation"` | + * | 3. `$animate` waits for the next digest to start the animation | `class="my-animation ng-animate"` | + * | 4. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` | + * | 5. the `.ng-enter` class is added to the element | `class="my-animation ng-animate ng-enter"` | + * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate ng-enter"` | + * | 7. `$animate` blocks all CSS transitions on the element to ensure the `.ng-enter` class styling is applied right away | `class="my-animation ng-animate ng-enter"` | + * | 8. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate ng-enter"` | + * | 9. `$animate` removes the CSS transition block placed on the element | `class="my-animation ng-animate ng-enter"` | + * | 10. the `.ng-enter-active` class is added (this triggers the CSS transition/animation) | `class="my-animation ng-animate ng-enter ng-enter-active"` | + * | 11. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate ng-enter ng-enter-active"` | + * | 12. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` | + * | 13. The returned promise is resolved. | `class="my-animation"` | + * + * @param {DOMElement} element the element that will be the focus of the enter animation + * @param {DOMElement} parentElement the parent element of the element that will be the focus of the enter animation + * @param {DOMElement} afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation + * @param {object=} options an optional collection of options that will be picked up by the CSS transition/animation + * @return {Promise} the animation callback promise + */ + enter: function(element, parentElement, afterElement, options) { + options = parseAnimateOptions(options); + element = angular.element(element); + parentElement = prepareElement(parentElement); + afterElement = prepareElement(afterElement); + + classBasedAnimationsBlocked(element, true); + $delegate.enter(element, parentElement, afterElement); + return runAnimationPostDigest(function(done) { + return performAnimation('enter', 'ng-enter', stripCommentsFromElement(element), parentElement, afterElement, noop, options, done); + }); + }, + + /** + * @ngdoc method + * @name $animate#leave + * @kind function + * + * @description + * Runs the leave animation operation and, upon completion, removes the element from the DOM. Once + * the animation is started, the following CSS classes will be added for the duration of the animation: + * + * Below is a breakdown of each step that occurs during leave animation: + * + * | Animation Step | What the element class attribute looks like | + * |-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------| + * | 1. `$animate.leave(...)` is called | `class="my-animation"` | + * | 2. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` | + * | 3. `$animate` waits for the next digest to start the animation | `class="my-animation ng-animate"` | + * | 4. the `.ng-leave` class is added to the element | `class="my-animation ng-animate ng-leave"` | + * | 5. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate ng-leave"` | + * | 6. `$animate` blocks all CSS transitions on the element to ensure the `.ng-leave` class styling is applied right away | `class="my-animation ng-animate ng-leave"` | + * | 7. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate ng-leave"` | + * | 8. `$animate` removes the CSS transition block placed on the element | `class="my-animation ng-animate ng-leave"` | + * | 9. the `.ng-leave-active` class is added (this triggers the CSS transition/animation) | `class="my-animation ng-animate ng-leave ng-leave-active"` | + * | 10. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate ng-leave ng-leave-active"` | + * | 11. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` | + * | 12. The element is removed from the DOM | ... | + * | 13. The returned promise is resolved. | ... | + * + * @param {DOMElement} element the element that will be the focus of the leave animation + * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation + * @return {Promise} the animation callback promise + */ + leave: function(element, options) { + options = parseAnimateOptions(options); + element = angular.element(element); + + cancelChildAnimations(element); + classBasedAnimationsBlocked(element, true); + return runAnimationPostDigest(function(done) { + return performAnimation('leave', 'ng-leave', stripCommentsFromElement(element), null, null, function() { + $delegate.leave(element); + }, options, done); + }); + }, + + /** + * @ngdoc method + * @name $animate#move + * @kind function + * + * @description + * Fires the move DOM operation. Just before the animation starts, the animate service will either append it into the parentElement container or + * add the element directly after the afterElement element if present. Then the move animation will be run. Once + * the animation is started, the following CSS classes will be added for the duration of the animation: + * + * Below is a breakdown of each step that occurs during move animation: + * + * | Animation Step | What the element class attribute looks like | + * |----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------| + * | 1. `$animate.move(...)` is called | `class="my-animation"` | + * | 2. element is moved into the parentElement element or beside the afterElement element | `class="my-animation"` | + * | 3. `$animate` waits for the next digest to start the animation | `class="my-animation ng-animate"` | + * | 4. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` | + * | 5. the `.ng-move` class is added to the element | `class="my-animation ng-animate ng-move"` | + * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate ng-move"` | + * | 7. `$animate` blocks all CSS transitions on the element to ensure the `.ng-move` class styling is applied right away | `class="my-animation ng-animate ng-move"` | + * | 8. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate ng-move"` | + * | 9. `$animate` removes the CSS transition block placed on the element | `class="my-animation ng-animate ng-move"` | + * | 10. the `.ng-move-active` class is added (this triggers the CSS transition/animation) | `class="my-animation ng-animate ng-move ng-move-active"` | + * | 11. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate ng-move ng-move-active"` | + * | 12. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` | + * | 13. The returned promise is resolved. | `class="my-animation"` | + * + * @param {DOMElement} element the element that will be the focus of the move animation + * @param {DOMElement} parentElement the parentElement element of the element that will be the focus of the move animation + * @param {DOMElement} afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation + * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation + * @return {Promise} the animation callback promise + */ + move: function(element, parentElement, afterElement, options) { + options = parseAnimateOptions(options); + element = angular.element(element); + parentElement = prepareElement(parentElement); + afterElement = prepareElement(afterElement); + + cancelChildAnimations(element); + classBasedAnimationsBlocked(element, true); + $delegate.move(element, parentElement, afterElement); + return runAnimationPostDigest(function(done) { + return performAnimation('move', 'ng-move', stripCommentsFromElement(element), parentElement, afterElement, noop, options, done); + }); + }, + + /** + * @ngdoc method + * @name $animate#addClass + * + * @description + * Triggers a custom animation event based off the className variable and then attaches the className value to the element as a CSS class. + * Unlike the other animation methods, the animate service will suffix the className value with {@type -add} in order to provide + * the animate service the setup and active CSS classes in order to trigger the animation (this will be skipped if no CSS transitions + * or keyframes are defined on the -add-active or base CSS class). + * + * Below is a breakdown of each step that occurs during addClass animation: + * + * | Animation Step | What the element class attribute looks like | + * |--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------| + * | 1. `$animate.addClass(element, 'super')` is called | `class="my-animation"` | + * | 2. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` | + * | 3. the `.super-add` class is added to the element | `class="my-animation ng-animate super-add"` | + * | 4. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate super-add"` | + * | 5. the `.super` and `.super-add-active` classes are added (this triggers the CSS transition/animation) | `class="my-animation ng-animate super super-add super-add-active"` | + * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate super super-add super-add-active"` | + * | 7. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate super super-add super-add-active"` | + * | 8. The animation ends and all generated CSS classes are removed from the element | `class="my-animation super"` | + * | 9. The super class is kept on the element | `class="my-animation super"` | + * | 10. The returned promise is resolved. | `class="my-animation super"` | + * + * @param {DOMElement} element the element that will be animated + * @param {string} className the CSS class that will be added to the element and then animated + * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation + * @return {Promise} the animation callback promise + */ + addClass: function(element, className, options) { + return this.setClass(element, className, [], options); + }, + + /** + * @ngdoc method + * @name $animate#removeClass + * + * @description + * Triggers a custom animation event based off the className variable and then removes the CSS class provided by the className value + * from the element. Unlike the other animation methods, the animate service will suffix the className value with {@type -remove} in + * order to provide the animate service the setup and active CSS classes in order to trigger the animation (this will be skipped if + * no CSS transitions or keyframes are defined on the -remove or base CSS classes). + * + * Below is a breakdown of each step that occurs during removeClass animation: + * + * | Animation Step | What the element class attribute looks like | + * |----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------| + * | 1. `$animate.removeClass(element, 'super')` is called | `class="my-animation super"` | + * | 2. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation super ng-animate"` | + * | 3. the `.super-remove` class is added to the element | `class="my-animation super ng-animate super-remove"` | + * | 4. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation super ng-animate super-remove"` | + * | 5. the `.super-remove-active` classes are added and `.super` is removed (this triggers the CSS transition/animation) | `class="my-animation ng-animate super-remove super-remove-active"` | + * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate super-remove super-remove-active"` | + * | 7. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate super-remove super-remove-active"` | + * | 8. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` | + * | 9. The returned promise is resolved. | `class="my-animation"` | + * + * + * @param {DOMElement} element the element that will be animated + * @param {string} className the CSS class that will be animated and then removed from the element + * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation + * @return {Promise} the animation callback promise + */ + removeClass: function(element, className, options) { + return this.setClass(element, [], className, options); + }, + + /** + * + * @ngdoc method + * @name $animate#setClass + * + * @description Adds and/or removes the given CSS classes to and from the element. + * Once complete, the `done()` callback will be fired (if provided). + * + * | Animation Step | What the element class attribute looks like | + * |----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------| + * | 1. `$animate.setClass(element, 'on', 'off')` is called | `class="my-animation off"` | + * | 2. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate off"` | + * | 3. the `.on-add` and `.off-remove` classes are added to the element | `class="my-animation ng-animate on-add off-remove off"` | + * | 4. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate on-add off-remove off"` | + * | 5. the `.on`, `.on-add-active` and `.off-remove-active` classes are added and `.off` is removed (this triggers the CSS transition/animation) | `class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active"` | + * | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active"` | + * | 7. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active"` | + * | 8. The animation ends and all generated CSS classes are removed from the element | `class="my-animation on"` | + * | 9. The returned promise is resolved. | `class="my-animation on"` | + * + * @param {DOMElement} element the element which will have its CSS classes changed + * removed from it + * @param {string} add the CSS classes which will be added to the element + * @param {string} remove the CSS class which will be removed from the element + * CSS classes have been set on the element + * @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation + * @return {Promise} the animation callback promise + */ + setClass: function(element, add, remove, options) { + options = parseAnimateOptions(options); + + var STORAGE_KEY = '$$animateClasses'; + element = angular.element(element); + element = stripCommentsFromElement(element); + + if (classBasedAnimationsBlocked(element)) { + return $delegate.$$setClassImmediately(element, add, remove, options); + } + + // we're using a combined array for both the add and remove + // operations since the ORDER OF addClass and removeClass matters + var classes, cache = element.data(STORAGE_KEY); + var hasCache = !!cache; + if (!cache) { + cache = {}; + cache.classes = {}; + } + classes = cache.classes; + + add = isArray(add) ? add : add.split(' '); + forEach(add, function(c) { + if (c && c.length) { + classes[c] = true; + } + }); + + remove = isArray(remove) ? remove : remove.split(' '); + forEach(remove, function(c) { + if (c && c.length) { + classes[c] = false; + } + }); + + if (hasCache) { + if (options && cache.options) { + cache.options = angular.extend(cache.options || {}, options); + } + + //the digest cycle will combine all the animations into one function + return cache.promise; + } else { + element.data(STORAGE_KEY, cache = { + classes: classes, + options: options + }); + } + + return cache.promise = runAnimationPostDigest(function(done) { + var cache, parentNode, parentElement, elementNode = extractElementNode(element); + if (elementNode) { + cache = element.data(STORAGE_KEY); + element.removeData(STORAGE_KEY); + + parentElement = element.parent(); + parentNode = elementNode.parentNode; + } + + // TODO(matsko): move this code into the animationsDisabled() function once #8092 is fixed + if (!parentNode || parentNode['$$NG_REMOVED'] || elementNode['$$NG_REMOVED']) { + done(); + return; + } + + var state = element.data(NG_ANIMATE_STATE) || {}; + var classes = resolveElementClasses(element, cache, state.active); + return !classes + ? done() + : performAnimation('setClass', classes, element, parentElement, null, function() { + if (classes[0]) $delegate.$$addClassImmediately(element, classes[0]); + if (classes[1]) $delegate.$$removeClassImmediately(element, classes[1]); + }, cache.options, done); + }); + }, + + /** + * @ngdoc method + * @name $animate#cancel + * @kind function + * + * @param {Promise} animationPromise The animation promise that is returned when an animation is started. + * + * @description + * Cancels the provided animation. + */ + cancel: function(promise) { + promise.$$cancelFn(); + }, + + /** + * @ngdoc method + * @name $animate#enabled + * @kind function + * + * @param {boolean=} value If provided then set the animation on or off. + * @param {DOMElement=} element If provided then the element will be used to represent the enable/disable operation + * @return {boolean} Current animation state. + * + * @description + * Globally enables/disables animations. + * + */ + enabled: function(value, element) { + switch (arguments.length) { + case 2: + if (value) { + cleanup(element); + } else { + var data = element.data(NG_ANIMATE_STATE) || {}; + data.disabled = true; + element.data(NG_ANIMATE_STATE, data); + } + break; + + case 1: + rootAnimateState.disabled = !value; + break; + + default: + value = !rootAnimateState.disabled; + break; + } + return !!value; + } + }; + + /* + all animations call this shared animation triggering function internally. + The animationEvent variable refers to the JavaScript animation event that will be triggered + and the className value is the name of the animation that will be applied within the + CSS code. Element, `parentElement` and `afterElement` are provided DOM elements for the animation + and the onComplete callback will be fired once the animation is fully complete. + */ + function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) { + var noopCancel = noop; + var runner = animationRunner(element, animationEvent, className, options); + if (!runner) { + fireDOMOperation(); + fireBeforeCallbackAsync(); + fireAfterCallbackAsync(); + closeAnimation(); + return noopCancel; + } + + animationEvent = runner.event; + className = runner.className; + var elementEvents = angular.element._data(runner.node); + elementEvents = elementEvents && elementEvents.events; + + if (!parentElement) { + parentElement = afterElement ? afterElement.parent() : element.parent(); + } + + //skip the animation if animations are disabled, a parent is already being animated, + //the element is not currently attached to the document body or then completely close + //the animation if any matching animations are not found at all. + //NOTE: IE8 + IE9 should close properly (run closeAnimation()) in case an animation was found. + if (animationsDisabled(element, parentElement)) { + fireDOMOperation(); + fireBeforeCallbackAsync(); + fireAfterCallbackAsync(); + closeAnimation(); + return noopCancel; + } + + var ngAnimateState = element.data(NG_ANIMATE_STATE) || {}; + var runningAnimations = ngAnimateState.active || {}; + var totalActiveAnimations = ngAnimateState.totalActive || 0; + var lastAnimation = ngAnimateState.last; + var skipAnimation = false; + + if (totalActiveAnimations > 0) { + var animationsToCancel = []; + if (!runner.isClassBased) { + if (animationEvent == 'leave' && runningAnimations['ng-leave']) { + skipAnimation = true; + } else { + //cancel all animations when a structural animation takes place + for (var klass in runningAnimations) { + animationsToCancel.push(runningAnimations[klass]); + } + ngAnimateState = {}; + cleanup(element, true); + } + } else if (lastAnimation.event == 'setClass') { + animationsToCancel.push(lastAnimation); + cleanup(element, className); + } else if (runningAnimations[className]) { + var current = runningAnimations[className]; + if (current.event == animationEvent) { + skipAnimation = true; + } else { + animationsToCancel.push(current); + cleanup(element, className); + } + } + + if (animationsToCancel.length > 0) { + forEach(animationsToCancel, function(operation) { + operation.cancel(); + }); + } + } + + if (runner.isClassBased + && !runner.isSetClassOperation + && animationEvent != 'animate' + && !skipAnimation) { + skipAnimation = (animationEvent == 'addClass') == element.hasClass(className); //opposite of XOR + } + + if (skipAnimation) { + fireDOMOperation(); + fireBeforeCallbackAsync(); + fireAfterCallbackAsync(); + fireDoneCallbackAsync(); + return noopCancel; + } + + runningAnimations = ngAnimateState.active || {}; + totalActiveAnimations = ngAnimateState.totalActive || 0; + + if (animationEvent == 'leave') { + //there's no need to ever remove the listener since the element + //will be removed (destroyed) after the leave animation ends or + //is cancelled midway + element.one('$destroy', function(e) { + var element = angular.element(this); + var state = element.data(NG_ANIMATE_STATE); + if (state) { + var activeLeaveAnimation = state.active['ng-leave']; + if (activeLeaveAnimation) { + activeLeaveAnimation.cancel(); + cleanup(element, 'ng-leave'); + } + } + }); + } + + //the ng-animate class does nothing, but it's here to allow for + //parent animations to find and cancel child animations when needed + $$jqLite.addClass(element, NG_ANIMATE_CLASS_NAME); + if (options && options.tempClasses) { + forEach(options.tempClasses, function(className) { + $$jqLite.addClass(element, className); + }); + } + + var localAnimationCount = globalAnimationCounter++; + totalActiveAnimations++; + runningAnimations[className] = runner; + + element.data(NG_ANIMATE_STATE, { + last: runner, + active: runningAnimations, + index: localAnimationCount, + totalActive: totalActiveAnimations + }); + + //first we run the before animations and when all of those are complete + //then we perform the DOM operation and run the next set of animations + fireBeforeCallbackAsync(); + runner.before(function(cancelled) { + var data = element.data(NG_ANIMATE_STATE); + cancelled = cancelled || + !data || !data.active[className] || + (runner.isClassBased && data.active[className].event != animationEvent); + + fireDOMOperation(); + if (cancelled === true) { + closeAnimation(); + } else { + fireAfterCallbackAsync(); + runner.after(closeAnimation); + } + }); + + return runner.cancel; + + function fireDOMCallback(animationPhase) { + var eventName = '$animate:' + animationPhase; + if (elementEvents && elementEvents[eventName] && elementEvents[eventName].length > 0) { + $$asyncCallback(function() { + element.triggerHandler(eventName, { + event: animationEvent, + className: className + }); + }); + } + } + + function fireBeforeCallbackAsync() { + fireDOMCallback('before'); + } + + function fireAfterCallbackAsync() { + fireDOMCallback('after'); + } + + function fireDoneCallbackAsync() { + fireDOMCallback('close'); + doneCallback(); + } + + //it is less complicated to use a flag than managing and canceling + //timeouts containing multiple callbacks. + function fireDOMOperation() { + if (!fireDOMOperation.hasBeenRun) { + fireDOMOperation.hasBeenRun = true; + domOperation(); + } + } + + function closeAnimation() { + if (!closeAnimation.hasBeenRun) { + if (runner) { //the runner doesn't exist if it fails to instantiate + runner.applyStyles(); + } + + closeAnimation.hasBeenRun = true; + if (options && options.tempClasses) { + forEach(options.tempClasses, function(className) { + $$jqLite.removeClass(element, className); + }); + } + + var data = element.data(NG_ANIMATE_STATE); + if (data) { + + /* only structural animations wait for reflow before removing an + animation, but class-based animations don't. An example of this + failing would be when a parent HTML tag has a ng-class attribute + causing ALL directives below to skip animations during the digest */ + if (runner && runner.isClassBased) { + cleanup(element, className); + } else { + $$asyncCallback(function() { + var data = element.data(NG_ANIMATE_STATE) || {}; + if (localAnimationCount == data.index) { + cleanup(element, className, animationEvent); + } + }); + element.data(NG_ANIMATE_STATE, data); + } + } + fireDoneCallbackAsync(); + } + } + } + + function cancelChildAnimations(element) { + var node = extractElementNode(element); + if (node) { + var nodes = angular.isFunction(node.getElementsByClassName) ? + node.getElementsByClassName(NG_ANIMATE_CLASS_NAME) : + node.querySelectorAll('.' + NG_ANIMATE_CLASS_NAME); + forEach(nodes, function(element) { + element = angular.element(element); + var data = element.data(NG_ANIMATE_STATE); + if (data && data.active) { + forEach(data.active, function(runner) { + runner.cancel(); + }); + } + }); + } + } + + function cleanup(element, className) { + if (isMatchingElement(element, $rootElement)) { + if (!rootAnimateState.disabled) { + rootAnimateState.running = false; + rootAnimateState.structural = false; + } + } else if (className) { + var data = element.data(NG_ANIMATE_STATE) || {}; + + var removeAnimations = className === true; + if (!removeAnimations && data.active && data.active[className]) { + data.totalActive--; + delete data.active[className]; + } + + if (removeAnimations || !data.totalActive) { + $$jqLite.removeClass(element, NG_ANIMATE_CLASS_NAME); + element.removeData(NG_ANIMATE_STATE); + } + } + } + + function animationsDisabled(element, parentElement) { + if (rootAnimateState.disabled) { + return true; + } + + if (isMatchingElement(element, $rootElement)) { + return rootAnimateState.running; + } + + var allowChildAnimations, parentRunningAnimation, hasParent; + do { + //the element did not reach the root element which means that it + //is not apart of the DOM. Therefore there is no reason to do + //any animations on it + if (parentElement.length === 0) break; + + var isRoot = isMatchingElement(parentElement, $rootElement); + var state = isRoot ? rootAnimateState : (parentElement.data(NG_ANIMATE_STATE) || {}); + if (state.disabled) { + return true; + } + + //no matter what, for an animation to work it must reach the root element + //this implies that the element is attached to the DOM when the animation is run + if (isRoot) { + hasParent = true; + } + + //once a flag is found that is strictly false then everything before + //it will be discarded and all child animations will be restricted + if (allowChildAnimations !== false) { + var animateChildrenFlag = parentElement.data(NG_ANIMATE_CHILDREN); + if (angular.isDefined(animateChildrenFlag)) { + allowChildAnimations = animateChildrenFlag; + } + } + + parentRunningAnimation = parentRunningAnimation || + state.running || + (state.last && !state.last.isClassBased); + } + while (parentElement = parentElement.parent()); + + return !hasParent || (!allowChildAnimations && parentRunningAnimation); + } + }]); + + $animateProvider.register('', ['$window', '$sniffer', '$timeout', '$$animateReflow', + function($window, $sniffer, $timeout, $$animateReflow) { + // Detect proper transitionend/animationend event names. + var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT; + + // If unprefixed events are not supported but webkit-prefixed are, use the latter. + // Otherwise, just use W3C names, browsers not supporting them at all will just ignore them. + // Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend` + // but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`. + // Register both events in case `window.onanimationend` is not supported because of that, + // do the same for `transitionend` as Safari is likely to exhibit similar behavior. + // Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit + // therefore there is no reason to test anymore for other vendor prefixes: http://caniuse.com/#search=transition + if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) { + CSS_PREFIX = '-webkit-'; + TRANSITION_PROP = 'WebkitTransition'; + TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend'; + } else { + TRANSITION_PROP = 'transition'; + TRANSITIONEND_EVENT = 'transitionend'; + } + + if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) { + CSS_PREFIX = '-webkit-'; + ANIMATION_PROP = 'WebkitAnimation'; + ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend'; + } else { + ANIMATION_PROP = 'animation'; + ANIMATIONEND_EVENT = 'animationend'; + } + + var DURATION_KEY = 'Duration'; + var PROPERTY_KEY = 'Property'; + var DELAY_KEY = 'Delay'; + var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount'; + var ANIMATION_PLAYSTATE_KEY = 'PlayState'; + var NG_ANIMATE_PARENT_KEY = '$$ngAnimateKey'; + var NG_ANIMATE_CSS_DATA_KEY = '$$ngAnimateCSS3Data'; + var ELAPSED_TIME_MAX_DECIMAL_PLACES = 3; + var CLOSING_TIME_BUFFER = 1.5; + var ONE_SECOND = 1000; + + var lookupCache = {}; + var parentCounter = 0; + var animationReflowQueue = []; + var cancelAnimationReflow; + function clearCacheAfterReflow() { + if (!cancelAnimationReflow) { + cancelAnimationReflow = $$animateReflow(function() { + animationReflowQueue = []; + cancelAnimationReflow = null; + lookupCache = {}; + }); + } + } + + function afterReflow(element, callback) { + if (cancelAnimationReflow) { + cancelAnimationReflow(); + } + animationReflowQueue.push(callback); + cancelAnimationReflow = $$animateReflow(function() { + forEach(animationReflowQueue, function(fn) { + fn(); + }); + + animationReflowQueue = []; + cancelAnimationReflow = null; + lookupCache = {}; + }); + } + + var closingTimer = null; + var closingTimestamp = 0; + var animationElementQueue = []; + function animationCloseHandler(element, totalTime) { + var node = extractElementNode(element); + element = angular.element(node); + + //this item will be garbage collected by the closing + //animation timeout + animationElementQueue.push(element); + + //but it may not need to cancel out the existing timeout + //if the timestamp is less than the previous one + var futureTimestamp = Date.now() + totalTime; + if (futureTimestamp <= closingTimestamp) { + return; + } + + $timeout.cancel(closingTimer); + + closingTimestamp = futureTimestamp; + closingTimer = $timeout(function() { + closeAllAnimations(animationElementQueue); + animationElementQueue = []; + }, totalTime, false); + } + + function closeAllAnimations(elements) { + forEach(elements, function(element) { + var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY); + if (elementData) { + forEach(elementData.closeAnimationFns, function(fn) { + fn(); + }); + } + }); + } + + function getElementAnimationDetails(element, cacheKey) { + var data = cacheKey ? lookupCache[cacheKey] : null; + if (!data) { + var transitionDuration = 0; + var transitionDelay = 0; + var animationDuration = 0; + var animationDelay = 0; + + //we want all the styles defined before and after + forEach(element, function(element) { + if (element.nodeType == ELEMENT_NODE) { + var elementStyles = $window.getComputedStyle(element) || {}; + + var transitionDurationStyle = elementStyles[TRANSITION_PROP + DURATION_KEY]; + transitionDuration = Math.max(parseMaxTime(transitionDurationStyle), transitionDuration); + + var transitionDelayStyle = elementStyles[TRANSITION_PROP + DELAY_KEY]; + transitionDelay = Math.max(parseMaxTime(transitionDelayStyle), transitionDelay); + + var animationDelayStyle = elementStyles[ANIMATION_PROP + DELAY_KEY]; + animationDelay = Math.max(parseMaxTime(elementStyles[ANIMATION_PROP + DELAY_KEY]), animationDelay); + + var aDuration = parseMaxTime(elementStyles[ANIMATION_PROP + DURATION_KEY]); + + if (aDuration > 0) { + aDuration *= parseInt(elementStyles[ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY], 10) || 1; + } + animationDuration = Math.max(aDuration, animationDuration); + } + }); + data = { + total: 0, + transitionDelay: transitionDelay, + transitionDuration: transitionDuration, + animationDelay: animationDelay, + animationDuration: animationDuration + }; + if (cacheKey) { + lookupCache[cacheKey] = data; + } + } + return data; + } + + function parseMaxTime(str) { + var maxValue = 0; + var values = isString(str) ? + str.split(/\s*,\s*/) : + []; + forEach(values, function(value) { + maxValue = Math.max(parseFloat(value) || 0, maxValue); + }); + return maxValue; + } + + function getCacheKey(element) { + var parentElement = element.parent(); + var parentID = parentElement.data(NG_ANIMATE_PARENT_KEY); + if (!parentID) { + parentElement.data(NG_ANIMATE_PARENT_KEY, ++parentCounter); + parentID = parentCounter; + } + return parentID + '-' + extractElementNode(element).getAttribute('class'); + } + + function animateSetup(animationEvent, element, className, styles) { + var structural = ['ng-enter','ng-leave','ng-move'].indexOf(className) >= 0; + + var cacheKey = getCacheKey(element); + var eventCacheKey = cacheKey + ' ' + className; + var itemIndex = lookupCache[eventCacheKey] ? ++lookupCache[eventCacheKey].total : 0; + + var stagger = {}; + if (itemIndex > 0) { + var staggerClassName = className + '-stagger'; + var staggerCacheKey = cacheKey + ' ' + staggerClassName; + var applyClasses = !lookupCache[staggerCacheKey]; + + applyClasses && $$jqLite.addClass(element, staggerClassName); + + stagger = getElementAnimationDetails(element, staggerCacheKey); + + applyClasses && $$jqLite.removeClass(element, staggerClassName); + } + + $$jqLite.addClass(element, className); + + var formerData = element.data(NG_ANIMATE_CSS_DATA_KEY) || {}; + var timings = getElementAnimationDetails(element, eventCacheKey); + var transitionDuration = timings.transitionDuration; + var animationDuration = timings.animationDuration; + + if (structural && transitionDuration === 0 && animationDuration === 0) { + $$jqLite.removeClass(element, className); + return false; + } + + var blockTransition = styles || (structural && transitionDuration > 0); + var blockAnimation = animationDuration > 0 && + stagger.animationDelay > 0 && + stagger.animationDuration === 0; + + var closeAnimationFns = formerData.closeAnimationFns || []; + element.data(NG_ANIMATE_CSS_DATA_KEY, { + stagger: stagger, + cacheKey: eventCacheKey, + running: formerData.running || 0, + itemIndex: itemIndex, + blockTransition: blockTransition, + closeAnimationFns: closeAnimationFns + }); + + var node = extractElementNode(element); + + if (blockTransition) { + blockTransitions(node, true); + if (styles) { + element.css(styles); + } + } + + if (blockAnimation) { + blockAnimations(node, true); + } + + return true; + } + + function animateRun(animationEvent, element, className, activeAnimationComplete, styles) { + var node = extractElementNode(element); + var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY); + if (node.getAttribute('class').indexOf(className) == -1 || !elementData) { + activeAnimationComplete(); + return; + } + + var activeClassName = ''; + var pendingClassName = ''; + forEach(className.split(' '), function(klass, i) { + var prefix = (i > 0 ? ' ' : '') + klass; + activeClassName += prefix + '-active'; + pendingClassName += prefix + '-pending'; + }); + + var style = ''; + var appliedStyles = []; + var itemIndex = elementData.itemIndex; + var stagger = elementData.stagger; + var staggerTime = 0; + if (itemIndex > 0) { + var transitionStaggerDelay = 0; + if (stagger.transitionDelay > 0 && stagger.transitionDuration === 0) { + transitionStaggerDelay = stagger.transitionDelay * itemIndex; + } + + var animationStaggerDelay = 0; + if (stagger.animationDelay > 0 && stagger.animationDuration === 0) { + animationStaggerDelay = stagger.animationDelay * itemIndex; + appliedStyles.push(CSS_PREFIX + 'animation-play-state'); + } + + staggerTime = Math.round(Math.max(transitionStaggerDelay, animationStaggerDelay) * 100) / 100; + } + + if (!staggerTime) { + $$jqLite.addClass(element, activeClassName); + if (elementData.blockTransition) { + blockTransitions(node, false); + } + } + + var eventCacheKey = elementData.cacheKey + ' ' + activeClassName; + var timings = getElementAnimationDetails(element, eventCacheKey); + var maxDuration = Math.max(timings.transitionDuration, timings.animationDuration); + if (maxDuration === 0) { + $$jqLite.removeClass(element, activeClassName); + animateClose(element, className); + activeAnimationComplete(); + return; + } + + if (!staggerTime && styles && Object.keys(styles).length > 0) { + if (!timings.transitionDuration) { + element.css('transition', timings.animationDuration + 's linear all'); + appliedStyles.push('transition'); + } + element.css(styles); + } + + var maxDelay = Math.max(timings.transitionDelay, timings.animationDelay); + var maxDelayTime = maxDelay * ONE_SECOND; + + if (appliedStyles.length > 0) { + //the element being animated may sometimes contain comment nodes in + //the jqLite object, so we're safe to use a single variable to house + //the styles since there is always only one element being animated + var oldStyle = node.getAttribute('style') || ''; + if (oldStyle.charAt(oldStyle.length - 1) !== ';') { + oldStyle += ';'; + } + node.setAttribute('style', oldStyle + ' ' + style); + } + + var startTime = Date.now(); + var css3AnimationEvents = ANIMATIONEND_EVENT + ' ' + TRANSITIONEND_EVENT; + var animationTime = (maxDelay + maxDuration) * CLOSING_TIME_BUFFER; + var totalTime = (staggerTime + animationTime) * ONE_SECOND; + + var staggerTimeout; + if (staggerTime > 0) { + $$jqLite.addClass(element, pendingClassName); + staggerTimeout = $timeout(function() { + staggerTimeout = null; + + if (timings.transitionDuration > 0) { + blockTransitions(node, false); + } + if (timings.animationDuration > 0) { + blockAnimations(node, false); + } + + $$jqLite.addClass(element, activeClassName); + $$jqLite.removeClass(element, pendingClassName); + + if (styles) { + if (timings.transitionDuration === 0) { + element.css('transition', timings.animationDuration + 's linear all'); + } + element.css(styles); + appliedStyles.push('transition'); + } + }, staggerTime * ONE_SECOND, false); + } + + element.on(css3AnimationEvents, onAnimationProgress); + elementData.closeAnimationFns.push(function() { + onEnd(); + activeAnimationComplete(); + }); + + elementData.running++; + animationCloseHandler(element, totalTime); + return onEnd; + + // This will automatically be called by $animate so + // there is no need to attach this internally to the + // timeout done method. + function onEnd() { + element.off(css3AnimationEvents, onAnimationProgress); + $$jqLite.removeClass(element, activeClassName); + $$jqLite.removeClass(element, pendingClassName); + if (staggerTimeout) { + $timeout.cancel(staggerTimeout); + } + animateClose(element, className); + var node = extractElementNode(element); + for (var i in appliedStyles) { + node.style.removeProperty(appliedStyles[i]); + } + } + + function onAnimationProgress(event) { + event.stopPropagation(); + var ev = event.originalEvent || event; + var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now(); + + /* Firefox (or possibly just Gecko) likes to not round values up + * when a ms measurement is used for the animation */ + var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES)); + + /* $manualTimeStamp is a mocked timeStamp value which is set + * within browserTrigger(). This is only here so that tests can + * mock animations properly. Real events fallback to event.timeStamp, + * or, if they don't, then a timeStamp is automatically created for them. + * We're checking to see if the timeStamp surpasses the expected delay, + * but we're using elapsedTime instead of the timeStamp on the 2nd + * pre-condition since animations sometimes close off early */ + if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) { + activeAnimationComplete(); + } + } + } + + function blockTransitions(node, bool) { + node.style[TRANSITION_PROP + PROPERTY_KEY] = bool ? 'none' : ''; + } + + function blockAnimations(node, bool) { + node.style[ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY] = bool ? 'paused' : ''; + } + + function animateBefore(animationEvent, element, className, styles) { + if (animateSetup(animationEvent, element, className, styles)) { + return function(cancelled) { + cancelled && animateClose(element, className); + }; + } + } + + function animateAfter(animationEvent, element, className, afterAnimationComplete, styles) { + if (element.data(NG_ANIMATE_CSS_DATA_KEY)) { + return animateRun(animationEvent, element, className, afterAnimationComplete, styles); + } else { + animateClose(element, className); + afterAnimationComplete(); + } + } + + function animate(animationEvent, element, className, animationComplete, options) { + //If the animateSetup function doesn't bother returning a + //cancellation function then it means that there is no animation + //to perform at all + var preReflowCancellation = animateBefore(animationEvent, element, className, options.from); + if (!preReflowCancellation) { + clearCacheAfterReflow(); + animationComplete(); + return; + } + + //There are two cancellation functions: one is before the first + //reflow animation and the second is during the active state + //animation. The first function will take care of removing the + //data from the element which will not make the 2nd animation + //happen in the first place + var cancel = preReflowCancellation; + afterReflow(element, function() { + //once the reflow is complete then we point cancel to + //the new cancellation function which will remove all of the + //animation properties from the active animation + cancel = animateAfter(animationEvent, element, className, animationComplete, options.to); + }); + + return function(cancelled) { + (cancel || noop)(cancelled); + }; + } + + function animateClose(element, className) { + $$jqLite.removeClass(element, className); + var data = element.data(NG_ANIMATE_CSS_DATA_KEY); + if (data) { + if (data.running) { + data.running--; + } + if (!data.running || data.running === 0) { + element.removeData(NG_ANIMATE_CSS_DATA_KEY); + } + } + } + + return { + animate: function(element, className, from, to, animationCompleted, options) { + options = options || {}; + options.from = from; + options.to = to; + return animate('animate', element, className, animationCompleted, options); + }, + + enter: function(element, animationCompleted, options) { + options = options || {}; + return animate('enter', element, 'ng-enter', animationCompleted, options); + }, + + leave: function(element, animationCompleted, options) { + options = options || {}; + return animate('leave', element, 'ng-leave', animationCompleted, options); + }, + + move: function(element, animationCompleted, options) { + options = options || {}; + return animate('move', element, 'ng-move', animationCompleted, options); + }, + + beforeSetClass: function(element, add, remove, animationCompleted, options) { + options = options || {}; + var className = suffixClasses(remove, '-remove') + ' ' + + suffixClasses(add, '-add'); + var cancellationMethod = animateBefore('setClass', element, className, options.from); + if (cancellationMethod) { + afterReflow(element, animationCompleted); + return cancellationMethod; + } + clearCacheAfterReflow(); + animationCompleted(); + }, + + beforeAddClass: function(element, className, animationCompleted, options) { + options = options || {}; + var cancellationMethod = animateBefore('addClass', element, suffixClasses(className, '-add'), options.from); + if (cancellationMethod) { + afterReflow(element, animationCompleted); + return cancellationMethod; + } + clearCacheAfterReflow(); + animationCompleted(); + }, + + beforeRemoveClass: function(element, className, animationCompleted, options) { + options = options || {}; + var cancellationMethod = animateBefore('removeClass', element, suffixClasses(className, '-remove'), options.from); + if (cancellationMethod) { + afterReflow(element, animationCompleted); + return cancellationMethod; + } + clearCacheAfterReflow(); + animationCompleted(); + }, + + setClass: function(element, add, remove, animationCompleted, options) { + options = options || {}; + remove = suffixClasses(remove, '-remove'); + add = suffixClasses(add, '-add'); + var className = remove + ' ' + add; + return animateAfter('setClass', element, className, animationCompleted, options.to); + }, + + addClass: function(element, className, animationCompleted, options) { + options = options || {}; + return animateAfter('addClass', element, suffixClasses(className, '-add'), animationCompleted, options.to); + }, + + removeClass: function(element, className, animationCompleted, options) { + options = options || {}; + return animateAfter('removeClass', element, suffixClasses(className, '-remove'), animationCompleted, options.to); + } + }; + + function suffixClasses(classes, suffix) { + var className = ''; + classes = isArray(classes) ? classes : classes.split(/\s+/); + forEach(classes, function(klass, i) { + if (klass && klass.length > 0) { + className += (i > 0 ? ' ' : '') + klass + suffix; + } + }); + return className; + } + }]); + }]); + + +})(window, window.angular); diff --git a/afb-client/bower_components/angular-animate/angular-animate.min.js b/afb-client/bower_components/angular-animate/angular-animate.min.js new file mode 100644 index 0000000..70c25a3 --- /dev/null +++ b/afb-client/bower_components/angular-animate/angular-animate.min.js @@ -0,0 +1,33 @@ +/* + AngularJS v1.3.20 + (c) 2010-2014 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(N,f,W){'use strict';f.module("ngAnimate",["ng"]).directive("ngAnimateChildren",function(){return function(X,r,g){g=g.ngAnimateChildren;f.isString(g)&&0===g.length?r.data("$$ngAnimateChildren",!0):X.$watch(g,function(f){r.data("$$ngAnimateChildren",!!f)})}}).factory("$$animateReflow",["$$rAF","$document",function(f,r){var g=r[0].body;return function(r){return f(function(){r(g.offsetWidth)})}}]).config(["$provide","$animateProvider",function(X,r){function g(f){for(var n=0;n=B&&b>=y&&c()}var m=g(e);a=e.data("$$ngAnimateCSS3Data");if(-1!=m.getAttribute("class").indexOf(b)&& +a){var l="",t="";n(b.split(" "),function(a,b){var e=(0", + "license": "MIT", + "bugs": { + "url": "https://github.com/angular/angular.js/issues" + }, + "homepage": "http://angularjs.org" +} diff --git a/afb-client/bower_components/angular-cookies/.bower.json b/afb-client/bower_components/angular-cookies/.bower.json new file mode 100644 index 0000000..5138a2a --- /dev/null +++ b/afb-client/bower_components/angular-cookies/.bower.json @@ -0,0 +1,19 @@ +{ + "name": "angular-cookies", + "version": "1.3.20", + "main": "./angular-cookies.js", + "ignore": [], + "dependencies": { + "angular": "1.3.20" + }, + "homepage": "https://github.com/angular/bower-angular-cookies", + "_release": "1.3.20", + "_resolution": { + "type": "version", + "tag": "v1.3.20", + "commit": "fe6acf196d30f65b2d75438c9f7d9eb283da0d6f" + }, + "_source": "git://github.com/angular/bower-angular-cookies.git", + "_target": "~1.3.4", + "_originalSource": "angular-cookies" +} \ No newline at end of file diff --git a/afb-client/bower_components/angular-cookies/README.md b/afb-client/bower_components/angular-cookies/README.md new file mode 100644 index 0000000..7b190d3 --- /dev/null +++ b/afb-client/bower_components/angular-cookies/README.md @@ -0,0 +1,68 @@ +# packaged angular-cookies + +This repo is for distribution on `npm` and `bower`. The source for this module is in the +[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies). +Please file issues and pull requests against that repo. + +## Install + +You can install this package either with `npm` or with `bower`. + +### npm + +```shell +npm install angular-cookies +``` + +Then add `ngCookies` as a dependency for your app: + +```javascript +angular.module('myApp', [require('angular-cookies')]); +``` + +### bower + +```shell +bower install angular-cookies +``` + +Add a ` +``` + +Then add `ngCookies` as a dependency for your app: + +```javascript +angular.module('myApp', ['ngCookies']); +``` + +## Documentation + +Documentation is available on the +[AngularJS docs site](http://docs.angularjs.org/api/ngCookies). + +## License + +The MIT License + +Copyright (c) 2010-2015 Google, Inc. http://angularjs.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/afb-client/bower_components/angular-cookies/angular-cookies.js b/afb-client/bower_components/angular-cookies/angular-cookies.js new file mode 100644 index 0000000..d564aa2 --- /dev/null +++ b/afb-client/bower_components/angular-cookies/angular-cookies.js @@ -0,0 +1,207 @@ +/** + * @license AngularJS v1.3.20 + * (c) 2010-2014 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, angular, undefined) {'use strict'; + +/** + * @ngdoc module + * @name ngCookies + * @description + * + * # ngCookies + * + * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. + * + * + *
+ * + * See {@link ngCookies.$cookies `$cookies`} and + * {@link ngCookies.$cookieStore `$cookieStore`} for usage. + */ + + +angular.module('ngCookies', ['ng']). + /** + * @ngdoc service + * @name $cookies + * + * @description + * Provides read/write access to browser's cookies. + * + * Only a simple Object is exposed and by adding or removing properties to/from this object, new + * cookies are created/deleted at the end of current $eval. + * The object's properties can only be strings. + * + * Requires the {@link ngCookies `ngCookies`} module to be installed. + * + * @example + * + * ```js + * angular.module('cookiesExample', ['ngCookies']) + * .controller('ExampleController', ['$cookies', function($cookies) { + * // Retrieving a cookie + * var favoriteCookie = $cookies.myFavorite; + * // Setting a cookie + * $cookies.myFavorite = 'oatmeal'; + * }]); + * ``` + */ + factory('$cookies', ['$rootScope', '$browser', function($rootScope, $browser) { + var cookies = {}, + lastCookies = {}, + lastBrowserCookies, + runEval = false, + copy = angular.copy, + isUndefined = angular.isUndefined; + + //creates a poller fn that copies all cookies from the $browser to service & inits the service + $browser.addPollFn(function() { + var currentCookies = $browser.cookies(); + if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl + lastBrowserCookies = currentCookies; + copy(currentCookies, lastCookies); + copy(currentCookies, cookies); + if (runEval) $rootScope.$apply(); + } + })(); + + runEval = true; + + //at the end of each eval, push cookies + //TODO: this should happen before the "delayed" watches fire, because if some cookies are not + // strings or browser refuses to store some cookies, we update the model in the push fn. + $rootScope.$watch(push); + + return cookies; + + + /** + * Pushes all the cookies from the service to the browser and verifies if all cookies were + * stored. + */ + function push() { + var name, + value, + browserCookies, + updated; + + //delete any cookies deleted in $cookies + for (name in lastCookies) { + if (isUndefined(cookies[name])) { + $browser.cookies(name, undefined); + delete lastCookies[name]; + } + } + + //update all cookies updated in $cookies + for (name in cookies) { + value = cookies[name]; + if (!angular.isString(value)) { + value = '' + value; + cookies[name] = value; + } + if (value !== lastCookies[name]) { + $browser.cookies(name, value); + lastCookies[name] = value; + updated = true; + } + } + + //verify what was actually stored + if (updated) { + browserCookies = $browser.cookies(); + + for (name in cookies) { + if (cookies[name] !== browserCookies[name]) { + //delete or reset all cookies that the browser dropped from $cookies + if (isUndefined(browserCookies[name])) { + delete cookies[name]; + delete lastCookies[name]; + } else { + cookies[name] = lastCookies[name] = browserCookies[name]; + } + } + } + } + } + }]). + + + /** + * @ngdoc service + * @name $cookieStore + * @requires $cookies + * + * @description + * Provides a key-value (string-object) storage, that is backed by session cookies. + * Objects put or retrieved from this storage are automatically serialized or + * deserialized by angular's toJson/fromJson. + * + * Requires the {@link ngCookies `ngCookies`} module to be installed. + * + * @example + * + * ```js + * angular.module('cookieStoreExample', ['ngCookies']) + * .controller('ExampleController', ['$cookieStore', function($cookieStore) { + * // Put cookie + * $cookieStore.put('myFavorite','oatmeal'); + * // Get cookie + * var favoriteCookie = $cookieStore.get('myFavorite'); + * // Removing a cookie + * $cookieStore.remove('myFavorite'); + * }]); + * ``` + */ + factory('$cookieStore', ['$cookies', function($cookies) { + + return { + /** + * @ngdoc method + * @name $cookieStore#get + * + * @description + * Returns the value of given cookie key + * + * @param {string} key Id to use for lookup. + * @returns {Object} Deserialized cookie value. + */ + get: function(key) { + var value = $cookies[key]; + return value ? angular.fromJson(value) : value; + }, + + /** + * @ngdoc method + * @name $cookieStore#put + * + * @description + * Sets a value for given cookie key + * + * @param {string} key Id for the `value`. + * @param {Object} value Value to be stored. + */ + put: function(key, value) { + $cookies[key] = angular.toJson(value); + }, + + /** + * @ngdoc method + * @name $cookieStore#remove + * + * @description + * Remove given cookie + * + * @param {string} key Id of the key-value pair to delete. + */ + remove: function(key) { + delete $cookies[key]; + } + }; + + }]); + + +})(window, window.angular); diff --git a/afb-client/bower_components/angular-cookies/angular-cookies.min.js b/afb-client/bower_components/angular-cookies/angular-cookies.min.js new file mode 100644 index 0000000..f73736b --- /dev/null +++ b/afb-client/bower_components/angular-cookies/angular-cookies.min.js @@ -0,0 +1,8 @@ +/* + AngularJS v1.3.20 + (c) 2010-2014 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(p,g,n){'use strict';g.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,b){var c={},f={},h,k=!1,l=g.copy,m=g.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,f),l(a,c),k&&e.$apply())})();k=!0;e.$watch(function(){var a,d,e;for(a in f)m(c[a])&&(b.cookies(a,n),delete f[a]);for(a in c)d=c[a],g.isString(d)||(d=""+d,c[a]=d),d!==f[a]&&(b.cookies(a,d),f[a]=d,e=!0);if(e)for(a in d=b.cookies(),c)c[a]!==d[a]&&(m(d[a])?(delete c[a],delete f[a]):c[a]= +f[a]=d[a])});return c}]).factory("$cookieStore",["$cookies",function(e){return{get:function(b){return(b=e[b])?g.fromJson(b):b},put:function(b,c){e[b]=g.toJson(c)},remove:function(b){delete e[b]}}}])})(window,window.angular); +//# sourceMappingURL=angular-cookies.min.js.map diff --git a/afb-client/bower_components/angular-cookies/angular-cookies.min.js.map b/afb-client/bower_components/angular-cookies/angular-cookies.min.js.map new file mode 100644 index 0000000..87491ad --- /dev/null +++ b/afb-client/bower_components/angular-cookies/angular-cookies.min.js.map @@ -0,0 +1,8 @@ +{ +"version":3, +"file":"angular-cookies.min.js", +"lineCount":7, +"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CAmBtCD,CAAAE,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,QAAA,CA0BW,UA1BX,CA0BuB,CAAC,YAAD,CAAe,UAAf,CAA2B,QAAQ,CAACC,CAAD,CAAaC,CAAb,CAAuB,CAAA,IACvEC,EAAU,EAD6D,CAEvEC,EAAc,E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CAAA,CAAYU,CAAA,CAAeJ,CAAf,CAAZ,CAAJ,EACE,OAAOX,CAAA,CAAQW,CAAR,CACP,CAAA,OAAOV,CAAA,CAAYU,CAAZ,CAFT,EAIEX,CAAA,CAAQW,CAAR,CAJF;AAIkBV,CAAA,CAAYU,CAAZ,CAJlB,CAIsCI,CAAA,CAAeJ,CAAf,CANxC,CAjCU,CAThB,CAEA,OAAOX,EA1BoE,CAA1D,CA1BvB,CAAAH,QAAA,CAqIW,cArIX,CAqI2B,CAAC,UAAD,CAAa,QAAQ,CAACmB,CAAD,CAAW,CAErD,MAAO,CAWLC,IAAKA,QAAQ,CAACC,CAAD,CAAM,CAEjB,MAAO,CADHN,CACG,CADKI,CAAA,CAASE,CAAT,CACL,EAAQxB,CAAAyB,SAAA,CAAiBP,CAAjB,CAAR,CAAkCA,CAFxB,CAXd,CA0BLQ,IAAKA,QAAQ,CAACF,CAAD,CAAMN,CAAN,CAAa,CACxBI,CAAA,CAASE,CAAT,CAAA,CAAgBxB,CAAA2B,OAAA,CAAeT,CAAf,CADQ,CA1BrB,CAuCLU,OAAQA,QAAQ,CAACJ,CAAD,CAAM,CACpB,OAAOF,CAAA,CAASE,CAAT,CADa,CAvCjB,CAF8C,CAAhC,CArI3B,CAnBsC,CAArC,CAAD,CAyMGzB,MAzMH,CAyMWA,MAAAC,QAzMX;", +"sources":["angular-cookies.js"], +"names":["window","angular","undefined","module","factory","$rootScope","$browser","cookies","lastCookies","lastBrowserCookies","runEval","copy","isUndefined","addPollFn","currentCookies","$apply","$watch","push","name","value","updated","isString","browserCookies","$cookies","get","key","fromJson","put","toJson","remove"] +} diff --git a/afb-client/bower_components/angular-cookies/bower.json b/afb-client/bower_components/angular-cookies/bower.json new file mode 100644 index 0000000..d4075a2 --- /dev/null +++ b/afb-client/bower_components/angular-cookies/bower.json @@ -0,0 +1,9 @@ +{ + "name": "angular-cookies", + "version": "1.3.20", + "main": "./angular-cookies.js", + "ignore": [], + "dependencies": { + "angular": "1.3.20" + } +} diff --git a/afb-client/bower_components/angular-cookies/index.js b/afb-client/bower_components/angular-cookies/index.js new file mode 100644 index 0000000..6576675 --- /dev/null +++ b/afb-client/bower_components/angular-cookies/index.js @@ -0,0 +1,2 @@ +require('./angular-cookies'); +module.exports = 'ngCookies'; diff --git a/afb-client/bower_components/angular-cookies/package.json b/afb-client/bower_components/angular-cookies/package.json new file mode 100644 index 0000000..97e7420 --- /dev/null +++ b/afb-client/bower_components/angular-cookies/package.json @@ -0,0 +1,26 @@ +{ + "name": "angular-cookies", + "version": "1.3.20", + "description": "AngularJS module for cookies", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/angular/angular.js.git" + }, + "keywords": [ + "angular", + "framework", + "browser", + "cookies", + "client-side" + ], + "author": "Angular Core Team ", + "license": "MIT", + "bugs": { + "url": "https://github.com/angular/angular.js/issues" + }, + "homepage": "http://angularjs.org" +} diff --git a/afb-client/bower_components/angular-ui-notification/.bower.json b/afb-client/bower_components/angular-ui-notification/.bower.json new file mode 100644 index 0000000..5134bb2 --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/.bower.json @@ -0,0 +1,45 @@ +{ + "name": "angular-ui-notification", + "version": "0.0.14", + "homepage": "https://github.com/alexcrack/angular-ui-notification", + "repository": { + "type": "git", + "url": "git://github.com/alexcrack/angular-ui-notification" + }, + "authors": [ + "Alexey Avramchik" + ], + "description": "Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating", + "main": [ + "dist/angular-ui-notification.min.css", + "dist/angular-ui-notification.min.js" + ], + "keywords": [ + "angular", + "notification", + "notify", + "bootstrap" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests", + "demo", + "build" + ], + "devDependencies": { + "bootstrap": "~3.3.2" + }, + "_release": "0.0.14", + "_resolution": { + "type": "version", + "tag": "v0.0.14", + "commit": "bef09d9274cfc37030f065e452f259ddd2fd9c57" + }, + "_source": "git://github.com/alexcrack/angular-ui-notification.git", + "_target": "~0.0.14", + "_originalSource": "angular-ui-notification" +} \ No newline at end of file diff --git a/afb-client/bower_components/angular-ui-notification/LICENSE b/afb-client/bower_components/angular-ui-notification/LICENSE new file mode 100644 index 0000000..678fd37 --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Alexey Avramchik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/afb-client/bower_components/angular-ui-notification/README.md b/afb-client/bower_components/angular-ui-notification/README.md new file mode 100644 index 0000000..544b3a0 --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/README.md @@ -0,0 +1,174 @@ +angular-ui-notification +======================= + +[![Dependency Status](https://david-dm.org/alexcrack/angular-ui-notification.png)](https://david-dm.org/alexcrack/angular-ui-notification) +[![devDependency Status](https://david-dm.org/alexcrack/angular-ui-notification/dev-status.png)](https://david-dm.org/alexcrack/angular-ui-notification#info=devDependencies) +[![Build Status](https://travis-ci.org/alexcrack/angular-ui-notification.svg?branch=master)](https://travis-ci.org/alexcrack/angular-ui-notification) +[![Dependency Status](https://www.versioneye.com/user/projects/54f96af44f3108e7800000e4/badge.svg?style=flat)](https://www.versioneye.com/user/projects/54f96af44f3108e7800000e4) +[![Code Climate](https://codeclimate.com/github/alexcrack/angular-ui-notification/badges/gpa.svg)](https://codeclimate.com/github/alexcrack/angular-ui-notification) + +Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animations + +## Features +* No dependencies except of angular.js. +* CSS3 Animations. +* Small size. +* 5 message types. +* Use HTML in your messages. +* Configure options globally py the provider +* Use custom options by the message +* Use custom template + +## Install + +To install the package using bower and save as a dependency use... +```bash +bower install angular-ui-notification --save +``` + +## Usage + [Heres a plunker demo](http://plnkr.co/edit/5Gk8UVvzUsjyof7Gxsua?p=preview) + + +In your html/template add +```html +... + +... + +... + +``` + +In your application, declare dependency injection like so.. + +```javascript + angular.module('notificationTest', ['ui-notification']); +... +``` + +You can configure module by the provider +```javascript +angular.module('notificationTest', ['ui-notification']) + .config(function(NotificationProvider) { + NotificationProvider.setOptions({ + delay: 10000, + startTop: 20, + startRight: 10, + verticalSpacing: 20, + horizontalSpacing: 20, + positionX: 'left', + positionY: 'bottom' + }); + }); +... +``` + + +And when you need to show notifications, inject service and call it! + +```javascript +angular.module('notificationTest').controller('notificationController', function($scope, Notification) { + + Notification.primary('Primary notification'); + // or simply.. + Notification('Primary notification'); + + // Other Options + // Success + Notification.success('Success notification'); + + // With Title + Notification({message: 'Primary notification', title: 'Primary notification'}); + + // Message with custom delay + Notification.error({message: 'Error notification 1s', delay: 1000}); + + // Embed HTML within your message..... + Notification.success({message: 'Success notification
Some other content
This is a link
', title: 'Html content'}); + + // Change position notification + Notification.error({message: 'Error Bottom Right', positionY: 'bottom', positionX: 'right'}); + + // Replace message + Notification.error({message: 'Error notification 1s', replaceMessage: true}); +} +``` + +## Service + +Module name: "ui-notification" + +Service: "Notification" + +Configuration provider: "NotificationProvider" + + +## Options + +Options can be passed to configuration provider globally or used in the current message. + +The options list: + +| Option | Possible values | Default value | Description | +| ----------------- | ------------------------- | ------------------------------ | ------------------------------------------------------------------------ | +| delay | Any integer value | 5000 | The time in ms the message is showing before start fading out | +| startTop | Any integer value | 10 | Vertical padding between messages and vertical border of the browser | +| startRight | Any integer value | 10 | Horizontal padding between messages and horizontal border of the browser | +| verticalSpacing | Any integer value | 10 | Vertical spacing between messages | +| horizontalSpacing | Any integer value | 10 | Horizontal spacing between messages | +| positionX | "right", "left", "center" | "right" | Horizontal position of the message | +| positionY | "top", "bottom" | "top" | Vertical position of the message | +| replaceMessage | true, false | false | If true every next appearing message replace old messages | +| templateUrl | Any string | "angular-ui-notification.html" | Custom template filename (URL) | + +Also you can pass the "scope" option. This is an angular scope option Notification scope will be inherited from. This option can be passed only in the methods. The default value is $rootScope + +## Methods + +#### Notification service methods + +| Method name | Description | +|----------------------------------------|-------------------------------------------------| +| Notification(), Notification.primary() | Show the message with bootstrap's primary class | +| Notification.info() | Show the message with bootstrap's info class | +| Notification.success() | Show the message with bootstrap's success class | +| Notification.warning() | Show the message with bootstrap's warn class | +| Notification.error() | Show the message with bootstrap's danger class | +| Notification.clearAll() | Remove all shown messages | + +#### Notification service options + +| Option | Possible values | Default value | Description | +| -------------- | ------------------------------------------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------ | +| title | *String* | `""` | Title to appear at the top of the notification | +| message | *String* | `""` | Message to appear in the notification | +| templateUrl | *String* | `"angular-ui-notification.html"` | URL of template to be used for notification | +| delay | *Int* (?) | `5000` or configured global delay | Number of ms before notification fades out. If not an integer, notification will persist until killed. | +| type | "primary", "info", "success", "warning", "error" | `"primary"` | Bootstrap flavoring | +| positionY | "top", "bottom" | `"top"` | | +| positionX | "right", "left", "center" | `"right" | | +| replaceMessage | *Boolean* | `false` | If true this message will replace old(er) message(s) | + +#### Returning value + +Every "show" method returns a promise resolves a notification scope with methods: + +| Method name | Description | +|--------------------------------|------------------------------------------------------------------------------------------------------------------| +| notificationScope.kill(isHard) | Remove the specific message
isHard - if false or omitted kill message with fadeout effect (default). If true - immediately remove the message| + + + +## Custom Templates + +Custom template can be provided. + +```html +
+

+
+
+``` +Default existing scope values is "title" - the title of the message and "message". +Also any custom scope's properties can be used. diff --git a/afb-client/bower_components/angular-ui-notification/bower.json b/afb-client/bower_components/angular-ui-notification/bower.json new file mode 100644 index 0000000..8daf8fd --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/bower.json @@ -0,0 +1,36 @@ +{ + "name": "angular-ui-notification", + "version": "0.0.12", + "homepage": "https://github.com/alexcrack/angular-ui-notification", + "repository": { + "type": "git", + "url": "git://github.com/alexcrack/angular-ui-notification" + }, + "authors": [ + "Alexey Avramchik" + ], + "description": "Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating", + "main": [ + "dist/angular-ui-notification.min.css", + "dist/angular-ui-notification.min.js" + ], + "keywords": [ + "angular", + "notification", + "notify", + "bootstrap" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests", + "demo", + "build" + ], + "devDependencies": { + "bootstrap": "~3.3.2" + } +} diff --git a/afb-client/bower_components/angular-ui-notification/dist/angular-ui-notification.min.css b/afb-client/bower_components/angular-ui-notification/dist/angular-ui-notification.min.css new file mode 100644 index 0000000..491ef93 --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/dist/angular-ui-notification.min.css @@ -0,0 +1,8 @@ +/** + * angular-ui-notification - Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating + * @author Alex_Crack + * @version v0.0.14 + * @link https://github.com/alexcrack/angular-ui-notification + * @license MIT + */ +.ui-notification{position:fixed;z-index:9999;width:300px;cursor:pointer;-webkit-transition:all ease .5s;-o-transition:all ease .5s;transition:all ease .5s;color:#fff;background:#337ab7;box-shadow:5px 5px 10px rgba(0,0,0,.3)}.ui-notification.killed{-webkit-transition:opacity ease 1s;-o-transition:opacity ease 1s;transition:opacity ease 1s;opacity:0}.ui-notification>h3{font-size:14px;font-weight:700;display:block;margin:10px 10px 0;padding:0 0 5px;text-align:left;border-bottom:1px solid rgba(255,255,255,.3)}.ui-notification a{color:#fff}.ui-notification a:hover{text-decoration:underline}.ui-notification>.message{margin:10px}.ui-notification.warning{color:#fff;background:#f0ad4e}.ui-notification.error{color:#fff;background:#d9534f}.ui-notification.success{color:#fff;background:#5cb85c}.ui-notification.info{color:#fff;background:#5bc0de}.ui-notification:hover{opacity:.7} \ No newline at end of file diff --git a/afb-client/bower_components/angular-ui-notification/dist/angular-ui-notification.min.js b/afb-client/bower_components/angular-ui-notification/dist/angular-ui-notification.min.js new file mode 100644 index 0000000..e69118a --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/dist/angular-ui-notification.min.js @@ -0,0 +1,8 @@ +/** + * angular-ui-notification - Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating + * @author Alex_Crack + * @version v0.0.14 + * @link https://github.com/alexcrack/angular-ui-notification + * @license MIT + */ +angular.module("ui-notification",[]),angular.module("ui-notification").provider("Notification",function(){this.options={delay:5e3,startTop:10,startRight:10,verticalSpacing:10,horizontalSpacing:10,positionX:"right",positionY:"top",replaceMessage:!1,templateUrl:"angular-ui-notification.html"},this.setOptions=function(t){if(!angular.isObject(t))throw new Error("Options should be an object!");this.options=angular.extend({},this.options,t)},this.$get=["$timeout","$http","$compile","$templateCache","$rootScope","$injector","$sce","$q","$window",function(t,e,i,n,o,s,a,r,l){var p=this.options,c=p.startTop,u=p.startRight,d=p.verticalSpacing,m=p.horizontalSpacing,g=p.delay,f=[],h=!1,v=function(s,v){var y=r.defer();return"object"!=typeof s&&(s={message:s}),s.scope=s.scope?s.scope:o,s.template=s.templateUrl?s.templateUrl:p.templateUrl,s.delay=angular.isUndefined(s.delay)?g:s.delay,s.type=v?v:"",s.positionY=s.positionY?s.positionY:p.positionY,s.positionX=s.positionX?s.positionX:p.positionX,s.replaceMessage=s.replaceMessage?s.replaceMessage:p.replaceMessage,e.get(s.template,{cache:n}).success(function(e){var n=s.scope.$new();n.message=a.trustAsHtml(s.message),n.title=a.trustAsHtml(s.title),n.t=s.type.substr(0,1),n.delay=s.delay;var o=function(){for(var t=0,e=0,i=c,n=u,o=[],a=f.length-1;a>=0;a--){var r=f[a];if(s.replaceMessage&&awindow.innerHeight&&(g=c,e++,t=0);var h=i=g?0===t?g:g+d:c,v=n+e*(m+p);r.css(r._positionY,h+"px"),"center"==r._positionX?r.css("left",parseInt(window.innerWidth/2-p/2)+"px"):r.css(r._positionX,v+"px"),o[r._positionY+r._positionX]=h+l,t++}}},r=i(e)(n);r._positionY=s.positionY,r._positionX=s.positionX,r.addClass(s.type),r.bind("webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd click",function(t){t=t.originalEvent||t,("click"===t.type||"opacity"===t.propertyName&&t.elapsedTime>=1)&&(r.remove(),f.splice(f.indexOf(r),1),o())}),angular.isNumber(s.delay)&&t(function(){r.addClass("killed")},s.delay),angular.element(document.getElementsByTagName("body")).append(r);var p=-(parseInt(r[0].offsetHeight)+50);r.css(r._positionY,p+"px"),f.push(r),n._templateElement=r,n.kill=function(e){e?(f.splice(f.indexOf(n._templateElement),1),n._templateElement.remove(),t(o)):n._templateElement.addClass("killed")},t(o),h||(angular.element(l).bind("resize",function(){t(o)}),h=!0),y.resolve(n)}).error(function(t){throw new Error("Template ("+s.template+") could not be loaded. "+t)}),y.promise};return v.primary=function(t){return this(t,"primary")},v.error=function(t){return this(t,"error")},v.success=function(t){return this(t,"success")},v.info=function(t){return this(t,"info")},v.warning=function(t){return this(t,"warning")},v.clearAll=function(){angular.forEach(f,function(t){t.addClass("killed")})},v}]}),angular.module("ui-notification").run(["$templateCache",function(t){t.put("angular-ui-notification.html",'

')}]); \ No newline at end of file diff --git a/afb-client/bower_components/angular-ui-notification/gulpfile.js b/afb-client/bower_components/angular-ui-notification/gulpfile.js new file mode 100644 index 0000000..f7c7d59 --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/gulpfile.js @@ -0,0 +1,92 @@ +var gulp = require('gulp'); +var less = require('gulp-less'); +var minifyCSS = require('gulp-minify-css'); +var csscomb = require('gulp-csscomb'); +var ngAnnotate = require('gulp-ng-annotate'); +var uglify = require('gulp-uglify'); +var jshint = require('gulp-jshint'); +var rename = require('gulp-rename'); +var header = require('gulp-header'); +var templateCache = require('gulp-angular-templatecache'); +var minifyHtml = require("gulp-minify-html"); +var concat = require('gulp-concat'); +var addsrc = require('gulp-add-src'); +var order = require("gulp-order"); +var protractor = require("gulp-protractor").protractor; + +var pkg = require('./package.json'); +var banner = ['/**', + ' * <%= pkg.name %> - <%= pkg.description %>', + ' * @author <%= pkg.author %>', + ' * @version v<%= pkg.version %>', + ' * @link <%= pkg.homepage %>', + ' * @license <%= pkg.license %>', + ' */', + ''].join('\n'); + + // ==== Styles +gulp.task('styles', function() { + gulp.src('src/angular-ui-notification.less') + .pipe(less({ + strictMath: true + })) + .pipe(csscomb()) + .pipe(minifyCSS()) + .pipe(rename({ + suffix: '.min' + })) + .pipe(header(banner, { pkg : pkg })) + .pipe(gulp.dest('dist')) + .pipe(gulp.dest('demo')); +}); + +// ====== Templates +gulp.task('templates', function() { + gulp.src(['*.html'], {cwd: 'src'}) + .pipe(minifyHtml({ + empty: true, + spare: true, + quotes: true + })) + .pipe(templateCache({ + module: 'ui-notification', + })) + .pipe(rename('angular-ui-notification.templates.js')) + .pipe(gulp.dest("build")); +}); + +gulp.task('service', function() { + gulp.src(['src/*.js']) + .pipe(jshint()) + .pipe(jshint.reporter('default')) + .pipe(jshint.reporter('fail')) + .pipe(ngAnnotate()) + .pipe(addsrc('build/*.js')) + .pipe(order([ + 'src/*.js', + 'build/angular-ui-notification.templates.js' + ])) + .pipe(concat('angular-ui-notification.js')) + .pipe(uglify()) + .pipe(rename({ + suffix: '.min' + })) + .pipe(header(banner, { pkg : pkg })) + .pipe(gulp.dest('dist')) + .pipe(gulp.dest('demo')); +}); + +// ====== +gulp.task('e2eTest', function() { + gulp.src(['./test/**/*_spec.js']) + .pipe(protractor({ + configFile: "protractor_conf.js", + })) + .on('error', function(e) {throw e}); +}); + +gulp.task('tests', ['e2eTest']); +gulp.task('build', ['templates', 'service', 'styles']); +gulp.task('deploy', ['build', 'tests']); + +gulp.task('default', ['deploy'], function() {}); \ No newline at end of file diff --git a/afb-client/bower_components/angular-ui-notification/package.json b/afb-client/bower_components/angular-ui-notification/package.json new file mode 100644 index 0000000..68f5905 --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/package.json @@ -0,0 +1,45 @@ +{ + "name": "angular-ui-notification", + "version": "0.0.14", + "description": "Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating", + "main": "dist/angular-ui-notification.min", + "scripts": { + "update-chromedriver": "./node_modules/protractor/bin/webdriver-manager update", + "test": "gulp tests" + }, + "repository": { + "type": "git", + "url": "https://github.com/alexcrack/angular-ui-notification.git" + }, + "keywords": [ + "angular", + "notification", + "notify", + "bootstrap" + ], + "author": "Alex_Crack", + "license": "MIT", + "bugs": { + "url": "https://github.com/alexcrack/angular-ui-notification/issues" + }, + "homepage": "https://github.com/alexcrack/angular-ui-notification", + "devDependencies": { + "chromedriver": "^2.14.1", + "gulp": "^3.8.11", + "gulp-add-src": "^0.2.0", + "gulp-angular-templatecache": "^1.5.0", + "gulp-concat": "^2.5.2", + "gulp-csscomb": "^3.0.3", + "gulp-header": "^1.2.2", + "gulp-jshint": "^1.9.2", + "gulp-less": "^3.0.1", + "gulp-minify-css": "^0.5.1", + "gulp-minify-html": "^1.0.0", + "gulp-ng-annotate": "^0.5.2", + "gulp-order": "^1.1.1", + "gulp-protractor": "0.0.12", + "gulp-rename": "^1.2.0", + "gulp-uglify": "^1.1.0", + "protractor": "^1.8.0" + } +} diff --git a/afb-client/bower_components/angular-ui-notification/protractor_conf.js b/afb-client/bower_components/angular-ui-notification/protractor_conf.js new file mode 100644 index 0000000..5ceda91 --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/protractor_conf.js @@ -0,0 +1,24 @@ +// An example configuration file. +exports.config = { + allScriptsTimeout: 99999, + // Do not start a Selenium Standalone sever - only run this using chrome. + directConnect: true, + //chromeDriver: './node_modules/protractor/selenium/chromedriver', + + seleniumArgs: ['-browserTimeout=60'], + + // Capabilities to be passed to the webdriver instance. + capabilities: { + 'browserName': 'firefox' + }, + + // Spec patterns are relative to the current working directly when + // protractor is called. + specs: ['test/e2e/**/*.spec.js'], + + // Options to be passed to Jasmine-node. + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + } +}; diff --git a/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.html b/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.html new file mode 100644 index 0000000..5f628fc --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.html @@ -0,0 +1,4 @@ +
+

+
+
\ No newline at end of file diff --git a/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.js b/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.js new file mode 100644 index 0000000..e94fa2c --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.js @@ -0,0 +1,172 @@ +angular.module('ui-notification',[]); + +angular.module('ui-notification').provider('Notification', function() { + + this.options = { + delay: 5000, + startTop: 10, + startRight: 10, + verticalSpacing: 10, + horizontalSpacing: 10, + positionX: 'right', + positionY: 'top', + replaceMessage: false, + templateUrl: 'angular-ui-notification.html' + }; + + this.setOptions = function(options) { + if (!angular.isObject(options)) throw new Error("Options should be an object!"); + this.options = angular.extend({}, this.options, options); + }; + + this.$get = function($timeout, $http, $compile, $templateCache, $rootScope, $injector, $sce, $q, $window) { + var options = this.options; + + var startTop = options.startTop; + var startRight = options.startRight; + var verticalSpacing = options.verticalSpacing; + var horizontalSpacing = options.horizontalSpacing; + var delay = options.delay; + + var messageElements = []; + var isResizeBound = false; + + var notify = function(args, t){ + var deferred = $q.defer(); + + if (typeof args !== 'object') { + args = {message:args}; + } + + args.scope = args.scope ? args.scope : $rootScope; + args.template = args.templateUrl ? args.templateUrl : options.templateUrl; + args.delay = !angular.isUndefined(args.delay) ? args.delay : delay; + args.type = t ? t : ''; + args.positionY = args.positionY ? args.positionY : options.positionY; + args.positionX = args.positionX ? args.positionX : options.positionX; + args.replaceMessage = args.replaceMessage ? args.replaceMessage : options.replaceMessage; + + $http.get(args.template,{cache: $templateCache}).success(function(template) { + + var scope = args.scope.$new(); + scope.message = $sce.trustAsHtml(args.message); + scope.title = $sce.trustAsHtml(args.title); + scope.t = args.type.substr(0,1); + scope.delay = args.delay; + + var reposite = function() { + var j = 0; + var k = 0; + var lastTop = startTop; + var lastRight = startRight; + var lastPosition = []; + for(var i = messageElements.length - 1; i >= 0; i --) { + var element = messageElements[i]; + if (args.replaceMessage && i < messageElements.length - 1) { + element.addClass('killed'); + continue; + } + var elHeight = parseInt(element[0].offsetHeight); + var elWidth = parseInt(element[0].offsetWidth); + var position = lastPosition[element._positionY+element._positionX]; + + if ((top + elHeight) > window.innerHeight) { + position = startTop; + k ++; + j = 0; + } + + var top = (lastTop = position ? (j === 0 ? position : position + verticalSpacing) : startTop); + var right = lastRight + (k * (horizontalSpacing + elWidth)); + + element.css(element._positionY, top + 'px'); + if (element._positionX == 'center') { + element.css('left', parseInt(window.innerWidth / 2 - elWidth / 2) + 'px'); + } else { + element.css(element._positionX, right + 'px'); + } + + lastPosition[element._positionY+element._positionX] = top + elHeight; + + j ++; + } + }; + + var templateElement = $compile(template)(scope); + templateElement._positionY = args.positionY; + templateElement._positionX = args.positionX; + templateElement.addClass(args.type); + templateElement.bind('webkitTransitionEnd oTransitionEnd otransitionend transitionend msTransitionEnd click', function(e){ + e = e.originalEvent || e; + if (e.type === 'click' || (e.propertyName === 'opacity' && e.elapsedTime >= 1)){ + templateElement.remove(); + messageElements.splice(messageElements.indexOf(templateElement), 1); + reposite(); + } + }); + if (angular.isNumber(args.delay)) { + $timeout(function() { + templateElement.addClass('killed'); + }, args.delay); + } + + angular.element(document.getElementsByTagName('body')).append(templateElement); + var offset = -(parseInt(templateElement[0].offsetHeight) + 50); + templateElement.css(templateElement._positionY, offset + "px"); + messageElements.push(templateElement); + + scope._templateElement = templateElement; + + scope.kill = function(isHard) { + if (isHard) { + messageElements.splice(messageElements.indexOf(scope._templateElement), 1); + scope._templateElement.remove(); + $timeout(reposite); + } else { + scope._templateElement.addClass('killed'); + } + }; + + $timeout(reposite); + + if (!isResizeBound) { + angular.element($window).bind('resize', function(e) { + $timeout(reposite); + }); + isResizeBound = true; + } + + deferred.resolve(scope); + + }).error(function(data){ + throw new Error('Template ('+args.template+') could not be loaded. ' + data); + }); + + return deferred.promise; + }; + + notify.primary = function(args) { + return this(args, 'primary'); + }; + notify.error = function(args) { + return this(args, 'error'); + }; + notify.success = function(args) { + return this(args, 'success'); + }; + notify.info = function(args) { + return this(args, 'info'); + }; + notify.warning = function(args) { + return this(args, 'warning'); + }; + + notify.clearAll = function() { + angular.forEach(messageElements, function(element) { + element.addClass('killed'); + }); + }; + + return notify; + }; +}); diff --git a/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.less b/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.less new file mode 100644 index 0000000..5b66b01 --- /dev/null +++ b/afb-client/bower_components/angular-ui-notification/src/angular-ui-notification.less @@ -0,0 +1,55 @@ +@import "../bower_components/bootstrap/less/variables.less"; +@import "../bower_components/bootstrap/less/mixins.less"; + + +.ui-notification { + position: fixed; + z-index: 9999; + box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3); + cursor: pointer; + width: 300px; + color: @btn-primary-color; + background: @brand-primary; + .transition(all ease 0.5s); + &.killed { + opacity: 0; + .transition(opacity ease 1s); + } + & > h3 { + display: block; + margin: 10px 10px 0 10px; + padding: 0 0 5px 0; + text-align: left; + font-size: @font-size-base; + font-weight: bold; + border-bottom: 1px solid fadeout(@btn-primary-color, 70%); + } + & a { + color: @btn-primary-color; + &:hover { + text-decoration: underline; + } + } + & > .message { + margin: 10px 10px 10px 10px; + } + &.warning { + color: @btn-warning-color; + background: @brand-warning; + } + &.error { + color: @btn-danger-color; + background: @brand-danger; + } + &.success { + color: @btn-success-color; + background: @brand-success; + } + &.info { + color: @btn-info-color; + background: @brand-info; + } + &:hover { + opacity: 0.7; + } +} \ No newline at end of file diff --git a/afb-client/bower_components/angular-ui-router/.bower.json b/afb-client/bower_components/angular-ui-router/.bower.json new file mode 100644 index 0000000..7b4d748 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/.bower.json @@ -0,0 +1,34 @@ +{ + "name": "angular-ui-router", + "version": "0.2.18", + "license": "MIT", + "main": "./release/angular-ui-router.js", + "dependencies": { + "angular": "^1.0.8" + }, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "component.json", + "package.json", + "lib", + "config", + "sample", + "test", + "tests", + "ngdoc_assets", + "Gruntfile.js", + "files.js" + ], + "homepage": "https://github.com/angular-ui/ui-router", + "_release": "0.2.18", + "_resolution": { + "type": "version", + "tag": "0.2.18", + "commit": "ec6ca36b625e578e59e631b3c9e786a6ac70678c" + }, + "_source": "git://github.com/angular-ui/ui-router.git", + "_target": "~0.2.12", + "_originalSource": "angular-ui-router" +} \ No newline at end of file diff --git a/afb-client/bower_components/angular-ui-router/CHANGELOG.md b/afb-client/bower_components/angular-ui-router/CHANGELOG.md new file mode 100644 index 0000000..060b4bf --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/CHANGELOG.md @@ -0,0 +1,316 @@ + +### 0.2.18 (2016-02-07) + +This is a maintenance release which fixes a few known bugs introduced in 0.2.16. + +#### Bug Fixes + +* **$urlRouter:** revert BC: resolve clashing of routes This reverts commit b5c57c8ec2e14e17e75104 ([2f1ebefc](https://github.com/angular-ui/ui-router/commit/2f1ebefc242ff48960e0bf63da359296a38f6852), closes [#2501](https://github.com/angular-ui/ui-router/issues/2501)) +* **uiState:** Corrected typo for 'ref' variable (#2488, #2508) ([b8f3c144](https://github.com/angular-ui/ui-router/commit/b8f3c144b913e620f177b78f3b4f52afa61d41a6)) +* **$urlMatcherFactory:** Fix to make the YUI Javascript compressor work ([ad9c41d2](https://github.com/angular-ui/ui-router/commit/ad9c41d2e723d50e30dd3452fbd274b7057dc3d9)) +* **stateBuilder:** fix non-url params on a state without a url. The parameters are now applied when ([d6d8c332](https://github.com/angular-ui/ui-router/commit/d6d8c3322c4dde8bb5b8dde25f9fcda49e9c4c81), closes [#2025](https://github.com/angular-ui/ui-router/issues/2025)) +* **ui-view:** (ui-view) use static renderer when no animation is present for a ui-view ([2523bbdb](https://github.com/angular-ui/ui-router/commit/2523bbdb5542483a489c22804f1751b8b9f71703), closes [#2485](https://github.com/angular-ui/ui-router/issues/2485)). This allows a ui-view scope to be destroyed when switching states, before the next view is initialized. + + +#### Features + +* **ui-view:** Add noanimation attribute to specify static renderer. ([2523bbdb](https://github.com/angular-ui/ui-router/commit/2523bbdb5542483a489c22804f1751b8b9f71703), closes [#2485](https://github.com/angular-ui/ui-router/issues/2485)). This allows a ui-view scope to be destroyed before the next ui-view is initialized, when ui-view animation is not present. + + + +### 0.2.17 (2016-01-25) + + +#### Bug Fixes + +* **uiSrefActive:** allow multiple classes ([a89114a0](https://github.com/angular-ui/ui-router/commit/a89114a083813c1a7280c48fc18e626caa5a31f4), closes [#2481](https://github.com/angular-ui/ui-router/issues/2481), [#2482](https://github.com/angular-ui/ui-router/issues/2482)) + + + +### 0.2.16 (2016-01-24) + + +#### Bug Fixes + +* **$state:** + * statechangeCancel: Avoid infinite digest in .otherwise/redirect case. Don't clobber url if a new transition has started. Closes #222 ([e00aa695](https://github.com/angular-ui/ui-router/commit/e00aa695e41ddc5ebd5d2b226aa0917a751b11aa), closes [#2238](https://github.com/angular-ui/ui-router/issues/2238)) + * transitionTo: Allow hash (#) value to be read as toParams['#'] in events. Re-add the saved hash before broadcasting $stateChangeStart event. ([8c1bf30d](https://github.com/angular-ui/ui-router/commit/8c1bf30d2a3b78ba40b330f12d854c885d6cc117)) +* **$stateParams:** Fix for testing: reset service instance between tests ([2aeb0c4b](https://github.com/angular-ui/ui-router/commit/2aeb0c4b205baf6cfa2ef25bb986bb160dc13bf9)) +* **$urlRouter:** + * Sort URL rules by specificity. Potential minor BC if apps were relying on rule registration order. ([b5c57c8e](https://github.com/angular-ui/ui-router/commit/b5c57c8ec2e14e17e75104c1424654f126ea4011)) + * Use $sniffer for pushstate compat check ([c219e801](https://github.com/angular-ui/ui-router/commit/c219e801797f340ef9c5c919ab890ef003a7a042)) +* **UrlMatcher:** + * Properly encode/decode slashes in parameters Closes #2172 Closes #2250 Closes #1 ([02e98660](https://github.com/angular-ui/ui-router/commit/02e98660a80dfd1ca4b113dd24ee304af91e9f8c), closes [#2339](https://github.com/angular-ui/ui-router/issues/2339)) + * Array types: Fix default value for array query parameters. Pass empty arrays through in handler. ([20d6e243](https://github.com/angular-ui/ui-router/commit/20d6e243f1745ddbf257217245a1dc22eabe13da), closes [#2222](https://github.com/angular-ui/ui-router/issues/2222)) + * Remove trailing slash, if parameter is optional and was squashed from URL ([77fa11bf](https://github.com/angular-ui/ui-router/commit/77fa11bf0787d0f6da97ab0003ab29afb7411391), closes [#1902](https://github.com/angular-ui/ui-router/issues/1902)) + * Allow a parameter declaration to configure the parameter type by name. closes #2294 ([e4010249](https://github.com/angular-ui/ui-router/commit/e40102492d40fe1cf6ba14d955fcc9f345c16458)) + * include the slash when recognizing squashed params in url ([b5130bb1](https://github.com/angular-ui/ui-router/commit/b5130bb1215e15f832ea6daa670410b9a950c0d4), closes [#2064](https://github.com/angular-ui/ui-router/issues/2064)) + * Allow url query param names to contain periods ([d31b3337](https://github.com/angular-ui/ui-router/commit/d31b3337cc2ce71d87c92fdded629e46558d0b49)) +* **reloadOnSearch:** Update `locals.globals.$stateParams` when reloadOnSearch=false ([350d3e87](https://github.com/angular-ui/ui-router/commit/350d3e87783a2263fd7d23913da34f1268c3300b), closes [#2356](https://github.com/angular-ui/ui-router/issues/2356)) +* **ui-view:** + * fix $animate usage for ng 1.4+ ([9b6d9a2d](https://github.com/angular-ui/ui-router/commit/9b6d9a2d0ce4ae08384165cb517bddea59b67892)) + * change $viewContentLoading to pair with $viewContentLoaded ([f9b43d66](https://github.com/angular-ui/ui-router/commit/f9b43d66833f0e17de41fd8d1cc3b491e3ba4a0e), closes [#685](https://github.com/angular-ui/ui-router/issues/685)) + * $destroy event is triggered before animation ends ([1be13795](https://github.com/angular-ui/ui-router/commit/1be13795686ab78abb2d5094bc8addcacb928975)) +* **uiSref:** + * Ensure URL once param checks pass ([9dc31c54](https://github.com/angular-ui/ui-router/commit/9dc31c5465328e5666468b0c2319ce205f4b72f8), closes [#2091](https://github.com/angular-ui/ui-router/issues/2091)) + * uiSrefActive: update the active classes after linking directive ([7c914030](https://github.com/angular-ui/ui-router/commit/7c914030f13e05e45a941c1b723cb785db729890)) + + +#### Features + +* **$IncludedByStateFilter:** add parameters to $IncludedByStateFilter ([963f6e71](https://github.com/angular-ui/ui-router/commit/963f6e71633b9c3a266f3991d79089b7d14786b4), closes [#1735](https://github.com/angular-ui/ui-router/issues/1735)) +* **isStateFilter:** Include optional state params. ([71d74699](https://github.com/angular-ui/ui-router/commit/71d7469987ee9ca86a41c8c6393ccd5d8913c3d6)) +* **$state:** make state data inheritance prototypical ([c4fec8c7](https://github.com/angular-ui/ui-router/commit/c4fec8c7998113902af4152d716c42dada6eb465)) +* **$stateChangeStart:** Add options to event ([a1f07559](https://github.com/angular-ui/ui-router/commit/a1f07559ec74e10ff80bc4be81f287e3772b8fcb)) +* **UrlMatcher:** Add param only type names ([6a371f9b](https://github.com/angular-ui/ui-router/commit/6a371f9b70e37a82eb324122879e4473c3f6d526)) +* **uiSrefActive:** + * provide a ng-{class,style} like interface ([a9ff6feb](https://github.com/angular-ui/ui-router/commit/a9ff6febb469e0d5cd49054216c4472df7a6259d)) + * allow active & active-eq on same element ([d9a676ba](https://github.com/angular-ui/ui-router/commit/d9a676ba2c4d9e954be224c60496bcb38f6074e3)) +* **uiState:** add ui-state directive ([3831af1d](https://github.com/angular-ui/ui-router/commit/3831af1dc71b601351e6694af0665a77297f8f7f), closes [#395](https://github.com/angular-ui/ui-router/issues/395), [#900](https://github.com/angular-ui/ui-router/issues/900), [#1932](https://github.com/angular-ui/ui-router/issues/1932)) +* **urlMatcher:** add support for optional spaces in params ([4b7f3046](https://github.com/angular-ui/ui-router/commit/4b7f304617f0b3590b532103b5c2fb526c98a9e4)) + + + +### 0.2.15 (2015-05-19) + + +#### Bug Fixes + +* **$state:** reloadOnSearch should not affect non-search param changes. ([6ca0d770](https://github.com/angular-ui/ui-router/commit/6ca0d7704cf7de9c6e6b7bb64df2f9c68fe081cc), closes [#1079](https://github.com/angular-ui/ui-router/issues/1079)) +* **urlMatcherFactory:** Revert to 0.2.13 behavior where all string parameters are considered optional fi ([495a02c3](https://github.com/angular-ui/ui-router/commit/495a02c3cbde501c1c149bce137806669209bc29), closes [#1963](https://github.com/angular-ui/ui-router/issues/1963)) +* **urlRouter:** allow .when() to redirect, even after a successful $state.go() - This partially ([48aeaff6](https://github.com/angular-ui/ui-router/commit/48aeaff645baf3f42f5a8940ebd97563791ad9f8), closes [#1584](https://github.com/angular-ui/ui-router/issues/1584)) + + +#### Features + +* **$state:** Inject templateProvider with resolved values ([afa20f22](https://github.com/angular-ui/ui-router/commit/afa20f22373b7176b26daa7e1099750c4254a354)) + + + +### 0.2.14 (2015-04-23) + + +#### Bug Fixes + +* **$StateRefDirective:** resolve missing support for svg anchor elements #1667 ([0149a7bb](https://github.com/angular-ui/ui-router/commit/0149a7bb38b7af99388a1ad7cc9909a7b7c4439d)) +* **$urlMatcherFactory:** + * regex params should respect case-sensitivity ([1e10519f](https://github.com/angular-ui/ui-router/commit/1e10519f3be6bbf0cefdcce623cd2ade06e649e5), closes [#1671](https://github.com/angular-ui/ui-router/issues/1671)) + * unquote all dashes from array params ([06664d33](https://github.com/angular-ui/ui-router/commit/06664d330f882390655dcfa83e10276110d0d0fa)) + * add Type.$normalize function ([b0c6aa23](https://github.com/angular-ui/ui-router/commit/b0c6aa2350fdd3ce8483144774adc12f5a72b7e9)) + * make optional params regex grouping optional ([06f73794](https://github.com/angular-ui/ui-router/commit/06f737945e83e668d09cfc3bcffd04a500ff1963), closes [#1576](https://github.com/angular-ui/ui-router/issues/1576)) +* **$state:** allow about.*.** glob patterns ([e39b27a2](https://github.com/angular-ui/ui-router/commit/e39b27a2cb7d88525c446a041f9fbf1553202010)) +* **uiSref:** + * use Object's toString instead of Window's toString ([2aa7f4d1](https://github.com/angular-ui/ui-router/commit/2aa7f4d139dbd5b9fcc4afdcf2ab6642c87f5671)) + * add absolute to allowed transition options ([ae1b3c4e](https://github.com/angular-ui/ui-router/commit/ae1b3c4eedc37983400d830895afb50457c63af4)) +* **uiSrefActive:** Apply active classes on lazy loaded states ([f0ddbe7b](https://github.com/angular-ui/ui-router/commit/f0ddbe7b4a91daf279c3b7d0cee732bb1f3be5b4)) +* **uiView:** add `$element` to locals for view controller ([db68914c](https://github.com/angular-ui/ui-router/commit/db68914cd6c821e7dec8155bd33142a3a97f5453)) + + +#### Features + +* **$state:** + * support URLs with #fragments ([3da0a170](https://github.com/angular-ui/ui-router/commit/3da0a17069e27598c0f9d9164e104dd5ce05cdc6)) + * inject resolve params into controllerProvider ([b380c223](https://github.com/angular-ui/ui-router/commit/b380c223fe12e2fde7582c0d6b1ed7b15a23579b), closes [#1131](https://github.com/angular-ui/ui-router/issues/1131)) + * added 'state' to state reload method (feat no.1612) - modiefied options.reload ([b8f04575](https://github.com/angular-ui/ui-router/commit/b8f04575a8557035c1858c4d5c8dbde3e1855aaa)) + * broadcast $stateChangeCancel event when event.preventDefault() is called in $sta ([ecefb758](https://github.com/angular-ui/ui-router/commit/ecefb758cb445e41620b62a272aafa3638613d7a)) +* **$uiViewScroll:** change function to return promise ([c2a9a311](https://github.com/angular-ui/ui-router/commit/c2a9a311388bb212e5a2e820536d1d739f829ccd), closes [#1702](https://github.com/angular-ui/ui-router/issues/1702)) +* **uiSrefActive:** Added support for multiple nested uiSref directives ([b1844948](https://github.com/angular-ui/ui-router/commit/b18449481d152b50705abfce2493a444eb059fa5)) + + + +### 0.2.13 (2014-11-20) + +This release primarily fixes issues reported against 0.2.12 + +#### Bug Fixes + +* **$state:** fix $state.includes/.is to apply param types before comparisions fix(uiSref): ma ([19715d15](https://github.com/angular-ui/ui-router/commit/19715d15e3cbfff724519e9febedd05b49c75baa), closes [#1513](https://github.com/angular-ui/ui-router/issues/1513)) + * Avoid re-synchronizing from url after .transitionTo ([b267ecd3](https://github.com/angular-ui/ui-router/commit/b267ecd348e5c415233573ef95ebdbd051875f52), closes [#1573](https://github.com/angular-ui/ui-router/issues/1573)) +* **$urlMatcherFactory:** + * Built-in date type uses local time zone ([d726bedc](https://github.com/angular-ui/ui-router/commit/d726bedcbb5f70a5660addf43fd52ec730790293)) + * make date type fn check .is before running ([aa94ce3b](https://github.com/angular-ui/ui-router/commit/aa94ce3b86632ad05301530a2213099da73a3dc0), closes [#1564](https://github.com/angular-ui/ui-router/issues/1564)) + * early binding of array handler bypasses type resolution ([ada4bc27](https://github.com/angular-ui/ui-router/commit/ada4bc27df5eff3ba3ab0de94a09bd91b0f7a28c)) + * add 'any' Type for non-encoding non-url params ([3bfd75ab](https://github.com/angular-ui/ui-router/commit/3bfd75ab445ee2f1dd55275465059ed116b10b27), closes [#1562](https://github.com/angular-ui/ui-router/issues/1562)) + * fix encoding slashes in params ([0c983a08](https://github.com/angular-ui/ui-router/commit/0c983a08e2947f999683571477debd73038e95cf), closes [#1119](https://github.com/angular-ui/ui-router/issues/1119)) + * fix mixed path/query params ordering problem ([a479fbd0](https://github.com/angular-ui/ui-router/commit/a479fbd0b8eb393a94320973e5b9a62d83912ee2), closes [#1543](https://github.com/angular-ui/ui-router/issues/1543)) +* **ArrayType:** + * specify empty array mapping corner case ([74aa6091](https://github.com/angular-ui/ui-router/commit/74aa60917e996b0b4e27bbb4eb88c3c03832021d), closes [#1511](https://github.com/angular-ui/ui-router/issues/1511)) + * fix .equals for array types ([5e6783b7](https://github.com/angular-ui/ui-router/commit/5e6783b77af9a90ddff154f990b43dbb17eeda6e), closes [#1538](https://github.com/angular-ui/ui-router/issues/1538)) +* **Param:** fix default value shorthand declaration ([831d812a](https://github.com/angular-ui/ui-router/commit/831d812a524524c71f0ee1c9afaf0487a5a66230), closes [#1554](https://github.com/angular-ui/ui-router/issues/1554)) +* **common:** fixed the _.filter clone to not create sparse arrays ([750f5cf5](https://github.com/angular-ui/ui-router/commit/750f5cf5fd91f9ada96f39e50d39aceb2caf22b6), closes [#1563](https://github.com/angular-ui/ui-router/issues/1563)) +* **ie8:** fix calls to indexOf and filter ([dcb31b84](https://github.com/angular-ui/ui-router/commit/dcb31b843391b3e61dee4de13f368c109541813e), closes [#1556](https://github.com/angular-ui/ui-router/issues/1556)) + + +#### Features + +* add json parameter Type ([027f1fcf](https://github.com/angular-ui/ui-router/commit/027f1fcf9c0916cea651e88981345da6f9ff214a)) + + + +### 0.2.12 (2014-11-13) + +#### Bug Fixes + +* **$resolve:** use resolve fn result, not parent resolved value of same name ([67f5e00c](https://github.com/angular-ui/ui-router/commit/67f5e00cc9aa006ce3fe6cde9dff261c28eab70a), closes [#1317], [#1353]) +* **$state:** + * populate default params in .transitionTo. ([3f60fbe6](https://github.com/angular-ui/ui-router/commit/3f60fbe6d65ebeca8d97952c05aa1d269f1b7ba1), closes [#1396]) + * reload() now reinvokes controllers ([73443420](https://github.com/angular-ui/ui-router/commit/7344342018847902594dc1fc62d30a5c30f01763), closes [#582]) + * do not emit $viewContentLoading if notify: false ([74255feb](https://github.com/angular-ui/ui-router/commit/74255febdf48ae082a02ca1e735165f2c369a463), closes [#1387](https://github.com/angular-ui/ui-router/issues/1387)) + * register states at config-time ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a)) + * handle parent.name when parent is obj ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a)) +* **$urlMatcherFactory:** + * register types at config ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a), closes [#1476]) + * made path params default value "" for backwards compat ([8f998e71](https://github.com/angular-ui/ui-router/commit/8f998e71e43a0b31293331c981f5db0f0097b8ba)) + * Pre-replace certain param values for better mapping ([6374a3e2](https://github.com/angular-ui/ui-router/commit/6374a3e29ab932014a7c77d2e1ab884cc841a2e3)) + * fixed ParamSet.$$keys() ordering ([9136fecb](https://github.com/angular-ui/ui-router/commit/9136fecbc2bfd4fda748a9914f0225a46c933860)) + * empty string policy now respected in Param.value() ([db12c85c](https://github.com/angular-ui/ui-router/commit/db12c85c16f2d105415f9bbbdeb11863f64728e0)) + * "string" type now encodes/decodes slashes ([3045e415](https://github.com/angular-ui/ui-router/commit/3045e41577a8b8b8afc6039f42adddf5f3c061ec), closes [#1119]) + * allow arrays in both path and query params ([fdd2f2c1](https://github.com/angular-ui/ui-router/commit/fdd2f2c191c4a67c874fdb9ec9a34f8dde9ad180), closes [#1073], [#1045], [#1486], [#1394]) + * typed params in search ([8d4cab69](https://github.com/angular-ui/ui-router/commit/8d4cab69dd67058e1a716892cc37b7d80a57037f), closes [#1488](https://github.com/angular-ui/ui-router/issues/1488)) + * no longer generate unroutable urls ([cb9fd9d8](https://github.com/angular-ui/ui-router/commit/cb9fd9d8943cb26c7223f6990db29c82ae8740f8), closes [#1487](https://github.com/angular-ui/ui-router/issues/1487)) + * handle optional parameter followed by required parameter in url format. ([efc72106](https://github.com/angular-ui/ui-router/commit/efc72106ddcc4774b48ea176a505ef9e95193b41)) + * default to parameter string coersion. ([13a468a7](https://github.com/angular-ui/ui-router/commit/13a468a7d54c2fb0751b94c0c1841d580b71e6dc), closes [#1414](https://github.com/angular-ui/ui-router/issues/1414)) + * concat respects strictMode/caseInsensitive ([dd72e103](https://github.com/angular-ui/ui-router/commit/dd72e103edb342d9cf802816fe127e1bbd68fd5f), closes [#1395]) +* **ui-sref:** + * Allow sref state options to take a scope object ([b5f7b596](https://github.com/angular-ui/ui-router/commit/b5f7b59692ce4933e2d63eb5df3f50a4ba68ccc0)) + * replace raw href modification with attrs. ([08c96782](https://github.com/angular-ui/ui-router/commit/08c96782faf881b0c7ab00afc233ee6729548fa0)) + * nagivate to state when url is "" fix($state.href): generate href for state with ([656b5aab](https://github.com/angular-ui/ui-router/commit/656b5aab906e5749db9b5a080c6a83b95f50fd91), closes [#1363](https://github.com/angular-ui/ui-router/issues/1363)) + * Check that state is defined in isMatch() ([92aebc75](https://github.com/angular-ui/ui-router/commit/92aebc7520f88babdc6e266536086e07263514c3), closes [#1314](https://github.com/angular-ui/ui-router/issues/1314), [#1332](https://github.com/angular-ui/ui-router/issues/1332)) +* **uiView:** + * allow inteprolated ui-view names ([81f6a19a](https://github.com/angular-ui/ui-router/commit/81f6a19a432dac9198fd33243855bfd3b4fea8c0), closes [#1324](https://github.com/angular-ui/ui-router/issues/1324)) + * Made anim work with angular 1.3 ([c3bb7ad9](https://github.com/angular-ui/ui-router/commit/c3bb7ad903da1e1f3c91019cfd255be8489ff4ef), closes [#1367](https://github.com/angular-ui/ui-router/issues/1367), [#1345](https://github.com/angular-ui/ui-router/issues/1345)) +* **urlRouter:** html5Mode accepts an object from angular v1.3.0-rc.3 ([7fea1e9d](https://github.com/angular-ui/ui-router/commit/7fea1e9d0d8c6e09cc6c895ecb93d4221e9adf48)) +* **stateFilters:** mark state filters as stateful. ([a00b353e](https://github.com/angular-ui/ui-router/commit/a00b353e3036f64a81245c4e7898646ba218f833), closes [#1479]) +* **ui-router:** re-add IE8 compatibility for map/filter/keys ([8ce69d9f](https://github.com/angular-ui/ui-router/commit/8ce69d9f7c886888ab53eca7e53536f36b428aae), closes [#1518], [#1383]) +* **package:** point 'main' to a valid filename ([ac903350](https://github.com/angular-ui/ui-router/commit/ac9033501debb63364539d91fbf3a0cba4579f8e)) +* **travis:** make CI build faster ([0531de05](https://github.com/angular-ui/ui-router/commit/0531de052e414a8d839fbb4e7635e923e94865b3)) + + +#### Features + +##### Default and Typed params + +This release includes a lot of bug fixes around default/optional and typed parameters. As such, 0.2.12 is the first release where we recommend those features be used. + +* **$state:** + * add state params validation ([b1379e6a](https://github.com/angular-ui/ui-router/commit/b1379e6a4d38f7ed7436e05873932d7c279af578), closes [#1433](https://github.com/angular-ui/ui-router/issues/1433)) + * is/includes/get work on relative stateOrName ([232e94b3](https://github.com/angular-ui/ui-router/commit/232e94b3c2ca2c764bb9510046e4b61690c87852)) + * .reload() returns state transition promise ([639e0565](https://github.com/angular-ui/ui-router/commit/639e0565dece9d5544cc93b3eee6e11c99bd7373)) +* **$templateFactory:** request templateURL as text/html ([ccd60769](https://github.com/angular-ui/ui-router/commit/ccd6076904a4b801d77b47f6e2de4c06ce9962f8), closes [#1287]) +* **$urlMatcherFactory:** Made a Params and ParamSet class ([0cc1e6cc](https://github.com/angular-ui/ui-router/commit/0cc1e6cc461a4640618e2bb594566551c54834e2)) + + + + +### 0.2.11 (2014-08-26) + + +#### Bug Fixes + +* **$resolve:** Resolves only inherit from immediate parent fixes #702 ([df34e20c](https://github.com/angular-ui/ui-router/commit/df34e20c576299e7a3c8bd4ebc68d42341c0ace9)) +* **$state:** + * change $state.href default options.inherit to true ([deea695f](https://github.com/angular-ui/ui-router/commit/deea695f5cacc55de351ab985144fd233c02a769)) + * sanity-check state lookups ([456fd5ae](https://github.com/angular-ui/ui-router/commit/456fd5aec9ea507518927bfabd62b4afad4cf714), closes [#980](https://github.com/angular-ui/ui-router/issues/980)) + * didn't comply to inherit parameter ([09836781](https://github.com/angular-ui/ui-router/commit/09836781f126c1c485b06551eb9cfd4fa0f45c35)) + * allow view content loading broadcast ([7b78edee](https://github.com/angular-ui/ui-router/commit/7b78edeeb52a74abf4d3f00f79534033d5a08d1a)) +* **$urlMatcherFactory:** + * detect injected functions ([91f75ae6](https://github.com/angular-ui/ui-router/commit/91f75ae66c4d129f6f69e53bd547594e9661f5d5)) + * syntax ([1ebed370](https://github.com/angular-ui/ui-router/commit/1ebed37069bae8614d41541d56521f5c45f703f3)) +* **UrlMatcher:** + * query param function defaults ([f9c20530](https://github.com/angular-ui/ui-router/commit/f9c205304f10d8a4ebe7efe9025e642016479a51)) + * don't decode default values ([63607bdb](https://github.com/angular-ui/ui-router/commit/63607bdbbcb432d3fb37856a1cb3da0cd496804e)) +* **travis:** update Node version to fix build ([d6b95ef2](https://github.com/angular-ui/ui-router/commit/d6b95ef23d9dacb4eba08897f5190a0bcddb3a48)) +* **uiSref:** + * Generate an href for states with a blank url. closes #1293 ([691745b1](https://github.com/angular-ui/ui-router/commit/691745b12fa05d3700dd28f0c8d25f8a105074ad)) + * should inherit params by default ([b973dad1](https://github.com/angular-ui/ui-router/commit/b973dad155ad09a7975e1476bd096f7b2c758eeb)) + * cancel transition if preventDefault() has been called ([2e6d9167](https://github.com/angular-ui/ui-router/commit/2e6d9167d3afbfbca6427e53e012f94fb5fb8022)) +* **uiView:** Fixed infinite loop when is called .go() from a controller. ([e13988b8](https://github.com/angular-ui/ui-router/commit/e13988b8cd6231d75c78876ee9d012cc87f4a8d9), closes [#1194](https://github.com/angular-ui/ui-router/issues/1194)) +* **docs:** + * Fixed link to milestones ([6c0ae500](https://github.com/angular-ui/ui-router/commit/6c0ae500cc238ea9fc95adcc15415c55fc9e1f33)) + * fix bug in decorator example ([4bd00af5](https://github.com/angular-ui/ui-router/commit/4bd00af50b8b88a49d1545a76290731cb8e0feb1)) + * Removed an incorrect semi-colon ([af97cef8](https://github.com/angular-ui/ui-router/commit/af97cef8b967f2e32177e539ef41450dca131a7d)) + * Explain return value of rule as function ([5e887890](https://github.com/angular-ui/ui-router/commit/5e8878900a6ffe59a81aed531a3925e34a297377)) + + +#### Features + +* **$state:** + * allow parameters to pass unharmed ([8939d057](https://github.com/angular-ui/ui-router/commit/8939d0572ab1316e458ef016317ecff53131a822)) + * **BREAKING CHANGE**: state parameters are no longer automatically coerced to strings, and unspecified parameter values are now set to undefined rather than null. + * allow prevent syncUrl on failure ([753060b9](https://github.com/angular-ui/ui-router/commit/753060b910d5d2da600a6fa0757976e401c33172)) +* **typescript:** Add typescript definitions for component builds ([521ceb3f](https://github.com/angular-ui/ui-router/commit/521ceb3fd7850646422f411921e21ce5e7d82e0f)) +* **uiSref:** extend syntax for ui-sref ([71cad3d6](https://github.com/angular-ui/ui-router/commit/71cad3d636508b5a9fe004775ad1f1adc0c80c3e)) +* **uiSrefActive:** + * Also activate for child states. ([bf163ad6](https://github.com/angular-ui/ui-router/commit/bf163ad6ce176ce28792696c8302d7cdf5c05a01), closes [#818](https://github.com/angular-ui/ui-router/issues/818)) + * **BREAKING CHANGE** Since ui-sref-active now activates even when child states are active you may need to swap out your ui-sref-active with ui-sref-active-eq, thought typically we think devs want the auto inheritance. + + * uiSrefActiveEq: new directive with old ui-sref-active behavior +* **$urlRouter:** + * defer URL change interception ([c72d8ce1](https://github.com/angular-ui/ui-router/commit/c72d8ce11916d0ac22c81b409c9e61d7048554d7)) + * force URLs to have valid params ([d48505cd](https://github.com/angular-ui/ui-router/commit/d48505cd328d83e39d5706e085ba319715f999a6)) + * abstract $location handling ([08b4636b](https://github.com/angular-ui/ui-router/commit/08b4636b294611f08db35f00641eb5211686fb50)) +* **$urlMatcherFactory:** + * fail on bad parameters ([d8f124c1](https://github.com/angular-ui/ui-router/commit/d8f124c10d00c7e5dde88c602d966db261aea221)) + * date type support ([b7f074ff](https://github.com/angular-ui/ui-router/commit/b7f074ff65ca150a3cdbda4d5ad6cb17107300eb)) + * implement type support ([450b1f0e](https://github.com/angular-ui/ui-router/commit/450b1f0e8e03c738174ff967f688b9a6373290f4)) +* **UrlMatcher:** + * handle query string arrays ([9cf764ef](https://github.com/angular-ui/ui-router/commit/9cf764efab45fa9309368688d535ddf6e96d6449), closes [#373](https://github.com/angular-ui/ui-router/issues/373)) + * injectable functions as defaults ([00966ecd](https://github.com/angular-ui/ui-router/commit/00966ecd91fb745846039160cab707bfca8b3bec)) + * default values & type decoding for query params ([a472b301](https://github.com/angular-ui/ui-router/commit/a472b301389fbe84d1c1fa9f24852b492a569d11)) + * allow shorthand definitions ([5b724304](https://github.com/angular-ui/ui-router/commit/5b7243049793505e44b6608ea09878c37c95b1f5)) + * validates whole interface ([32b27db1](https://github.com/angular-ui/ui-router/commit/32b27db173722e9194ef1d5c0ea7d93f25a98d11)) + * implement non-strict matching ([a3e21366](https://github.com/angular-ui/ui-router/commit/a3e21366bee0475c9795a1ec76f70eec41c5b4e3)) + * add per-param config support ([07b3029f](https://github.com/angular-ui/ui-router/commit/07b3029f4d409cf955780113df92e36401b47580)) + * **BREAKING CHANGE**: the `params` option in state configurations must now be an object keyed by parameter name. + +### 0.2.10 (2014-03-12) + + +#### Bug Fixes + +* **$state:** use $browser.baseHref() when generating urls with .href() ([cbcc8488](https://github.com/angular-ui/ui-router/commit/cbcc84887d6b6d35258adabb97c714cd9c1e272d)) +* **bower.json:** JS files should not be ignored ([ccdab193](https://github.com/angular-ui/ui-router/commit/ccdab193315f304eb3be5f5b97c47a926c79263e)) +* **dev:** karma:background task is missing, can't run grunt:dev. ([d9f7b898](https://github.com/angular-ui/ui-router/commit/d9f7b898e8e3abb8c846b0faa16a382913d7b22b)) +* **sample:** Contacts menu button not staying active when navigating to detail states. Need t ([2fcb8443](https://github.com/angular-ui/ui-router/commit/2fcb84437cb43ade12682a92b764f13cac77dfe7)) +* **uiSref:** support mock-clicks/events with no data ([717d3ff7](https://github.com/angular-ui/ui-router/commit/717d3ff7d0ba72d239892dee562b401cdf90e418)) +* **uiView:** + * Do NOT autoscroll when autoscroll attr is missing ([affe5bd7](https://github.com/angular-ui/ui-router/commit/affe5bd785cdc3f02b7a9f64a52e3900386ec3a0), closes [#807](https://github.com/angular-ui/ui-router/issues/807)) + * Refactoring uiView directive to copy ngView logic ([548fab6a](https://github.com/angular-ui/ui-router/commit/548fab6ab9debc9904c5865c8bc68b4fc3271dd0), closes [#857](https://github.com/angular-ui/ui-router/issues/857), [#552](https://github.com/angular-ui/ui-router/issues/552)) + + +#### Features + +* **$state:** includes() allows glob patterns for state matching. ([2d5f6b37](https://github.com/angular-ui/ui-router/commit/2d5f6b37191a3135f4a6d9e8f344c54edcdc065b)) +* **UrlMatcher:** Add support for case insensitive url matching ([642d5247](https://github.com/angular-ui/ui-router/commit/642d524799f604811e680331002feec7199a1fb5)) +* **uiSref:** add support for transition options ([2ed7a728](https://github.com/angular-ui/ui-router/commit/2ed7a728cee6854b38501fbc1df6139d3de5b28a)) +* **uiView:** add controllerAs config with function ([1ee7334a](https://github.com/angular-ui/ui-router/commit/1ee7334a73efeccc9b95340e315cdfd59944762d)) + + +### 0.2.9 (2014-01-17) + + +This release is identical to 0.2.8. 0.2.8 was re-tagged in git to fix a problem with bower. + + +### 0.2.8 (2014-01-16) + + +#### Bug Fixes + +* **$state:** allow null to be passed as 'params' param ([094dc30e](https://github.com/angular-ui/ui-router/commit/094dc30e883e1bd14e50a475553bafeaade3b178)) +* **$state.go:** param inheritance shouldn't inherit from siblings ([aea872e0](https://github.com/angular-ui/ui-router/commit/aea872e0b983cb433436ce5875df10c838fccedb)) +* **bower.json:** fixes bower.json ([eed3cc4d](https://github.com/angular-ui/ui-router/commit/eed3cc4d4dfef1d3ef84b9fd063127538ebf59d3)) +* **uiSrefActive:** annotate controller injection ([85921422](https://github.com/angular-ui/ui-router/commit/85921422ff7fb0effed358136426d616cce3d583), closes [#671](https://github.com/angular-ui/ui-router/issues/671)) +* **uiView:** + * autoscroll tests pass on 1.2.4 & 1.1.5 ([86eacac0](https://github.com/angular-ui/ui-router/commit/86eacac09ca5e9000bd3b9c7ba6e2cc95d883a3a)) + * don't animate initial load ([83b6634d](https://github.com/angular-ui/ui-router/commit/83b6634d27942ca74766b2b1244a7fc52c5643d9)) + * test pass against 1.0.8 and 1.2.4 ([a402415a](https://github.com/angular-ui/ui-router/commit/a402415a2a28b360c43b9fe8f4f54c540f6c33de)) + * it should autoscroll when expr is missing. ([8bb9e27a](https://github.com/angular-ui/ui-router/commit/8bb9e27a2986725f45daf44c4c9f846385095aff)) + + +#### Features + +* **uiSref:** add target attribute behaviour ([c12bf9a5](https://github.com/angular-ui/ui-router/commit/c12bf9a520d30d70294e3d82de7661900f8e394e)) +* **uiView:** + * merge autoscroll expression test. ([b89e0f87](https://github.com/angular-ui/ui-router/commit/b89e0f871d5cc35c10925ede986c10684d5c9252)) + * cache and test autoscroll expression ([ee262282](https://github.com/angular-ui/ui-router/commit/ee2622828c2ce83807f006a459ac4e11406d9258)) diff --git a/afb-client/bower_components/angular-ui-router/CONTRIBUTING.md b/afb-client/bower_components/angular-ui-router/CONTRIBUTING.md new file mode 100644 index 0000000..7e4fcb8 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/CONTRIBUTING.md @@ -0,0 +1,65 @@ + +# Report an Issue + +Help us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure +it hasn't already been reported. You can [search through existing issues](https://github.com/angular-ui/ui-router/search?q=wat%3F&type=Issues) +to see if someone's reported one similar to yours. + +If not, then [create a plunkr](http://bit.ly/UIR-Plunk) that demonstrates the problem (try to use as little code +as possible: the more minimalist, the faster we can debug it). + +Next, [create a new issue](https://github.com/angular-ui/ui-router/issues/new) that briefly explains the problem, +and provides a bit of background as to the circumstances that triggered it. Don't forget to include the link to +that plunkr you created! + +**Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure +is a bug, it's best to talk it out on +[StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) before reporting it. This +keeps development streamlined, and helps us focus on building great software. + + +Issues only! | +-------------| +Please keep in mind that the issue tracker is for *issues*. Please do *not* post an issue if you need help or support. Instead, see one of the above-mentioned forums or [IRC](irc://irc.freenode.net/#angularjs). | + +####Purple Labels +A purple label means that **you** need to take some further action. + - ![Not Actionable - Need Info](ngdoc_assets/incomplete.png): Your issue is not specific enough, or there is no clear action that we can take. Please clarify and refine your issue. + - ![Plunkr Please](ngdoc_assets/example.png): Please [create a plunkr](http://bit.ly/UIR-Plunk) + - ![StackOverflow](ngdoc_assets/so.png): We suspect your issue is really a help request, or could be answered by the community. Please ask your question on [StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router). If you determine that is an actual issue, please explain why. + +If your issue gets labeled with purple label, no further action will be taken until you respond to the label appropriately. + +# Contribute + +**(1)** See the **[Developing](#developing)** section below, to get the development version of UI-Router up and running on your local machine. + +**(2)** Check out the [roadmap](https://github.com/angular-ui/ui-router/milestones) to see where the project is headed, and if your feature idea fits with where we're headed. + +**(3)** If you're not sure, [open an RFC](https://github.com/angular-ui/ui-router/issues/new?title=RFC:%20My%20idea) to get some feedback on your idea. + +**(4)** Finally, commit some code and open a pull request. Code & commits should abide by the following rules: + +- *Always* have test coverage for new features (or regression tests for bug fixes), and *never* break existing tests +- Commits should represent one logical change each; if a feature goes through multiple iterations, squash your commits down to one +- Make sure to follow the [Angular commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) so your change will appear in the changelog of the next release. +- Changes should always respect the coding style of the project + + + +# Developing + +UI-Router uses grunt >= 0.4.x. Make sure to upgrade your environment and read the +[Migration Guide](http://gruntjs.com/upgrading-from-0.3-to-0.4). + +Dependencies for building from source and running tests: + +* [grunt-cli](https://github.com/gruntjs/grunt-cli) - run: `$ npm install -g grunt-cli` +* Then, install the development dependencies by running `$ npm install` from the project directory + +There are a number of targets in the gruntfile that are used to generating different builds: + +* `grunt`: Perform a normal build, runs jshint and karma tests +* `grunt build`: Perform a normal build +* `grunt dist`: Perform a clean build and generate documentation +* `grunt dev`: Run dev server (sample app) and watch for changes, builds and runs karma tests on changes. diff --git a/afb-client/bower_components/angular-ui-router/LICENSE b/afb-client/bower_components/angular-ui-router/LICENSE new file mode 100644 index 0000000..6413b09 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2013-2015 The AngularUI Team, Karsten Sperling + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/afb-client/bower_components/angular-ui-router/README.md b/afb-client/bower_components/angular-ui-router/README.md new file mode 100644 index 0000000..ba6c45a --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/README.md @@ -0,0 +1,252 @@ +# AngularUI Router  [![Build Status](https://travis-ci.org/angular-ui/ui-router.svg?branch=master)](https://travis-ci.org/angular-ui/ui-router) + +#### The de-facto solution to flexible routing with nested views +--- +**[Download 0.2.17](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|** +**[Guide](https://github.com/angular-ui/ui-router/wiki) |** +**[API](http://angular-ui.github.io/ui-router/site) |** +**[Sample](http://angular-ui.github.com/ui-router/sample/) ([Src](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) |** +**[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |** +**[Resources](#resources) |** +**[Report an Issue](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#report-an-issue) |** +**[Contribute](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#contribute) |** +**[Help!](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |** +**[Discuss](https://groups.google.com/forum/#!categories/angular-ui/router)** + +--- + +*_Please help us out by testing the 1.0 alpha release!_* + +[1.0.0alpha0 Announcement](https://github.com/angular-ui/ui-router/releases/tag/1.0.0alpha0) ([Source Code](https://github.com/angular-ui/ui-router/tree/feature-1.0)) | [Sample App](http://ui-router.github.io/sample-app/) ([Source Code](https://github.com/ui-router/sample-app)) | [Known Issues](https://github.com/angular-ui/ui-router/issues?q=is%3Aissue+is%3Aopen+label%3A1.0) + + +--- + +AngularUI Router is a routing framework for [AngularJS](http://angularjs.org), which allows you to organize the +parts of your interface into a [*state machine*](https://en.wikipedia.org/wiki/Finite-state_machine). Unlike the +[`$route` service](http://docs.angularjs.org/api/ngRoute.$route) in the Angular ngRoute module, which is organized around URL +routes, UI-Router is organized around [*states*](https://github.com/angular-ui/ui-router/wiki), +which may optionally have routes, as well as other behavior, attached. + +States are bound to *named*, *nested* and *parallel views*, allowing you to powerfully manage your application's interface. + +Check out the sample app: http://angular-ui.github.io/ui-router/sample/ + +- +**Note:** *UI-Router is under active development. As such, while this library is well-tested, the API may change. Consider using it in production applications only if you're comfortable following a changelog and updating your usage accordingly.* + + +## Get Started + +**(1)** Get UI-Router in one of the following ways: + - clone & [build](CONTRIBUTING.md#developing) this repository + - [download the release](http://angular-ui.github.io/ui-router/release/angular-ui-router.js) (or [minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)) + - [link to cdn](http://cdnjs.com/libraries/angular-ui-router) + - via **[jspm](http://jspm.io/)**: by running `$ jspm install angular-ui-router` from your console + - or via **[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console + - or via **[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console + - or via **[Component](https://github.com/component/component)**: by running `$ component install angular-ui/ui-router` from your console + +**(2)** Include `angular-ui-router.js` (or `angular-ui-router.min.js`) in your `index.html`, after including Angular itself (For Component users: ignore this step) + +**(3)** Add `'ui.router'` to your main module's list of dependencies (For Component users: replace `'ui.router'` with `require('angular-ui-router')`) + +When you're done, your setup should look similar to the following: + +> +```html + + + + + + + ... + + + ... + + +``` + +### [Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview) + +The majority of UI-Router's power is in its ability to nest states & views. + +**(1)** First, follow the [setup](#get-started) instructions detailed above. + +**(2)** Then, add a [`ui-view` directive](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view) to the `` of your app. + +> +```html + + +
+ + State 1 + State 2 + +``` + +**(3)** You'll notice we also added some links with [`ui-sref` directives](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref). In addition to managing state transitions, this directive auto-generates the `href` attribute of the `` element it's attached to, if the corresponding state has a URL. Next we'll add some templates. These will plug into the `ui-view` within `index.html`. Notice that they have their own `ui-view` as well! That is the key to nesting states and views. + +> +```html + +

State 1

+
+
Show List +
+``` +```html + +

State 2

+
+Show List +
+``` + +**(4)** Next, we'll add some child templates. *These* will get plugged into the `ui-view` of their parent state templates. + +> +```html + +

List of State 1 Items

+
    +
  • {{ item }}
  • +
+``` + +> +```html + +

List of State 2 Things

+
    +
  • {{ thing }}
  • +
+``` + +**(5)** Finally, we'll wire it all up with `$stateProvider`. Set up your states in the module config, as in the following: + + +> +```javascript +myApp.config(function($stateProvider, $urlRouterProvider) { + // + // For any unmatched url, redirect to /state1 + $urlRouterProvider.otherwise("/state1"); + // + // Now set up the states + $stateProvider + .state('state1', { + url: "/state1", + templateUrl: "partials/state1.html" + }) + .state('state1.list', { + url: "/list", + templateUrl: "partials/state1.list.html", + controller: function($scope) { + $scope.items = ["A", "List", "Of", "Items"]; + } + }) + .state('state2', { + url: "/state2", + templateUrl: "partials/state2.html" + }) + .state('state2.list', { + url: "/list", + templateUrl: "partials/state2.list.html", + controller: function($scope) { + $scope.things = ["A", "Set", "Of", "Things"]; + } + }); +}); +``` + +**(6)** See this quick start example in action. +>**[Go to Quick Start Plunker for Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)** + +**(7)** This only scratches the surface +>**[Dive Deeper!](https://github.com/angular-ui/ui-router/wiki)** + + +### [Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview) + +Another great feature is the ability to have multiple `ui-view`s view per template. + +**Pro Tip:** *While multiple parallel views are a powerful feature, you'll often be able to manage your +interfaces more effectively by nesting your views, and pairing those views with nested states.* + +**(1)** Follow the [setup](#get-started) instructions detailed above. + +**(2)** Add one or more `ui-view` to your app, give them names. +> +```html + + +
+
+ + Route 1 + Route 2 + +``` + +**(3)** Set up your states in the module config: +> +```javascript +myApp.config(function($stateProvider) { + $stateProvider + .state('index', { + url: "", + views: { + "viewA": { template: "index.viewA" }, + "viewB": { template: "index.viewB" } + } + }) + .state('route1', { + url: "/route1", + views: { + "viewA": { template: "route1.viewA" }, + "viewB": { template: "route1.viewB" } + } + }) + .state('route2', { + url: "/route2", + views: { + "viewA": { template: "route2.viewA" }, + "viewB": { template: "route2.viewB" } + } + }) +}); +``` + +**(4)** See this quick start example in action. +>**[Go to Quick Start Plunker for Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)** + + +## Resources + +* [In-Depth Guide](https://github.com/angular-ui/ui-router/wiki) +* [API Reference](http://angular-ui.github.io/ui-router/site) +* [Sample App](http://angular-ui.github.com/ui-router/sample/) ([Source](https://github.com/angular-ui/ui-router/tree/gh-pages/sample)) +* [FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) +* [Slides comparing ngRoute to ui-router](http://slid.es/timkindberg/ui-router#/) +* [UI-Router Extras / Addons](http://christopherthielen.github.io/ui-router-extras/#/home) (@christopherthielen) + +### Videos + +* [Introduction Video](https://egghead.io/lessons/angularjs-introduction-ui-router) (egghead.io) +* [Tim Kindberg on Angular UI-Router](https://www.youtube.com/watch?v=lBqiZSemrqg) +* [Activating States](https://egghead.io/lessons/angularjs-ui-router-activating-states) (egghead.io) +* [Learn Angular.js using UI-Router](http://youtu.be/QETUuZ27N0w) (LearnCode.academy) + + + +## Reporting issues and Contributing + +Please read our [Contributor guidelines](CONTRIBUTING.md) before reporting an issue or creating a pull request. diff --git a/afb-client/bower_components/angular-ui-router/bower.json b/afb-client/bower_components/angular-ui-router/bower.json new file mode 100644 index 0000000..892936f --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/bower.json @@ -0,0 +1,24 @@ +{ + "name": "angular-ui-router", + "version": "0.2.18", + "license" : "MIT", + "main": "./release/angular-ui-router.js", + "dependencies": { + "angular": "^1.0.8" + }, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "component.json", + "package.json", + "lib", + "config", + "sample", + "test", + "tests", + "ngdoc_assets", + "Gruntfile.js", + "files.js" + ] +} diff --git a/afb-client/bower_components/angular-ui-router/release/angular-ui-router.js b/afb-client/bower_components/angular-ui-router/release/angular-ui-router.js new file mode 100644 index 0000000..26f7657 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/release/angular-ui-router.js @@ -0,0 +1,4539 @@ +/** + * State-based routing for AngularJS + * @version v0.2.18 + * @link http://angular-ui.github.com/ + * @license MIT License, http://www.opensource.org/licenses/MIT + */ + +/* commonjs package manager support (eg componentjs) */ +if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){ + module.exports = 'ui.router'; +} + +(function (window, angular, undefined) { +/*jshint globalstrict:true*/ +/*global angular:false*/ +'use strict'; + +var isDefined = angular.isDefined, + isFunction = angular.isFunction, + isString = angular.isString, + isObject = angular.isObject, + isArray = angular.isArray, + forEach = angular.forEach, + extend = angular.extend, + copy = angular.copy, + toJson = angular.toJson; + +function inherit(parent, extra) { + return extend(new (extend(function() {}, { prototype: parent }))(), extra); +} + +function merge(dst) { + forEach(arguments, function(obj) { + if (obj !== dst) { + forEach(obj, function(value, key) { + if (!dst.hasOwnProperty(key)) dst[key] = value; + }); + } + }); + return dst; +} + +/** + * Finds the common ancestor path between two states. + * + * @param {Object} first The first state. + * @param {Object} second The second state. + * @return {Array} Returns an array of state names in descending order, not including the root. + */ +function ancestors(first, second) { + var path = []; + + for (var n in first.path) { + if (first.path[n] !== second.path[n]) break; + path.push(first.path[n]); + } + return path; +} + +/** + * IE8-safe wrapper for `Object.keys()`. + * + * @param {Object} object A JavaScript object. + * @return {Array} Returns the keys of the object as an array. + */ +function objectKeys(object) { + if (Object.keys) { + return Object.keys(object); + } + var result = []; + + forEach(object, function(val, key) { + result.push(key); + }); + return result; +} + +/** + * IE8-safe wrapper for `Array.prototype.indexOf()`. + * + * @param {Array} array A JavaScript array. + * @param {*} value A value to search the array for. + * @return {Number} Returns the array index value of `value`, or `-1` if not present. + */ +function indexOf(array, value) { + if (Array.prototype.indexOf) { + return array.indexOf(value, Number(arguments[2]) || 0); + } + var len = array.length >>> 0, from = Number(arguments[2]) || 0; + from = (from < 0) ? Math.ceil(from) : Math.floor(from); + + if (from < 0) from += len; + + for (; from < len; from++) { + if (from in array && array[from] === value) return from; + } + return -1; +} + +/** + * Merges a set of parameters with all parameters inherited between the common parents of the + * current state and a given destination state. + * + * @param {Object} currentParams The value of the current state parameters ($stateParams). + * @param {Object} newParams The set of parameters which will be composited with inherited params. + * @param {Object} $current Internal definition of object representing the current state. + * @param {Object} $to Internal definition of object representing state to transition to. + */ +function inheritParams(currentParams, newParams, $current, $to) { + var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = []; + + for (var i in parents) { + if (!parents[i] || !parents[i].params) continue; + parentParams = objectKeys(parents[i].params); + if (!parentParams.length) continue; + + for (var j in parentParams) { + if (indexOf(inheritList, parentParams[j]) >= 0) continue; + inheritList.push(parentParams[j]); + inherited[parentParams[j]] = currentParams[parentParams[j]]; + } + } + return extend({}, inherited, newParams); +} + +/** + * Performs a non-strict comparison of the subset of two objects, defined by a list of keys. + * + * @param {Object} a The first object. + * @param {Object} b The second object. + * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified, + * it defaults to the list of keys in `a`. + * @return {Boolean} Returns `true` if the keys match, otherwise `false`. + */ +function equalForKeys(a, b, keys) { + if (!keys) { + keys = []; + for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility + } + + for (var i=0; i + * + * + * + * + * + * + * + * + * + * + * + * + */ +angular.module('ui.router', ['ui.router.state']); + +angular.module('ui.router.compat', ['ui.router']); + +/** + * @ngdoc object + * @name ui.router.util.$resolve + * + * @requires $q + * @requires $injector + * + * @description + * Manages resolution of (acyclic) graphs of promises. + */ +$Resolve.$inject = ['$q', '$injector']; +function $Resolve( $q, $injector) { + + var VISIT_IN_PROGRESS = 1, + VISIT_DONE = 2, + NOTHING = {}, + NO_DEPENDENCIES = [], + NO_LOCALS = NOTHING, + NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING }); + + + /** + * @ngdoc function + * @name ui.router.util.$resolve#study + * @methodOf ui.router.util.$resolve + * + * @description + * Studies a set of invocables that are likely to be used multiple times. + *
+   * $resolve.study(invocables)(locals, parent, self)
+   * 
+ * is equivalent to + *
+   * $resolve.resolve(invocables, locals, parent, self)
+   * 
+ * but the former is more efficient (in fact `resolve` just calls `study` + * internally). + * + * @param {object} invocables Invocable objects + * @return {function} a function to pass in locals, parent and self + */ + this.study = function (invocables) { + if (!isObject(invocables)) throw new Error("'invocables' must be an object"); + var invocableKeys = objectKeys(invocables || {}); + + // Perform a topological sort of invocables to build an ordered plan + var plan = [], cycle = [], visited = {}; + function visit(value, key) { + if (visited[key] === VISIT_DONE) return; + + cycle.push(key); + if (visited[key] === VISIT_IN_PROGRESS) { + cycle.splice(0, indexOf(cycle, key)); + throw new Error("Cyclic dependency: " + cycle.join(" -> ")); + } + visited[key] = VISIT_IN_PROGRESS; + + if (isString(value)) { + plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES); + } else { + var params = $injector.annotate(value); + forEach(params, function (param) { + if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param); + }); + plan.push(key, value, params); + } + + cycle.pop(); + visited[key] = VISIT_DONE; + } + forEach(invocables, visit); + invocables = cycle = visited = null; // plan is all that's required + + function isResolve(value) { + return isObject(value) && value.then && value.$$promises; + } + + return function (locals, parent, self) { + if (isResolve(locals) && self === undefined) { + self = parent; parent = locals; locals = null; + } + if (!locals) locals = NO_LOCALS; + else if (!isObject(locals)) { + throw new Error("'locals' must be an object"); + } + if (!parent) parent = NO_PARENT; + else if (!isResolve(parent)) { + throw new Error("'parent' must be a promise returned by $resolve.resolve()"); + } + + // To complete the overall resolution, we have to wait for the parent + // promise and for the promise for each invokable in our plan. + var resolution = $q.defer(), + result = resolution.promise, + promises = result.$$promises = {}, + values = extend({}, locals), + wait = 1 + plan.length/3, + merged = false; + + function done() { + // Merge parent values we haven't got yet and publish our own $$values + if (!--wait) { + if (!merged) merge(values, parent.$$values); + result.$$values = values; + result.$$promises = result.$$promises || true; // keep for isResolve() + delete result.$$inheritedValues; + resolution.resolve(values); + } + } + + function fail(reason) { + result.$$failure = reason; + resolution.reject(reason); + } + + // Short-circuit if parent has already failed + if (isDefined(parent.$$failure)) { + fail(parent.$$failure); + return result; + } + + if (parent.$$inheritedValues) { + merge(values, omit(parent.$$inheritedValues, invocableKeys)); + } + + // Merge parent values if the parent has already resolved, or merge + // parent promises and wait if the parent resolve is still in progress. + extend(promises, parent.$$promises); + if (parent.$$values) { + merged = merge(values, omit(parent.$$values, invocableKeys)); + result.$$inheritedValues = omit(parent.$$values, invocableKeys); + done(); + } else { + if (parent.$$inheritedValues) { + result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys); + } + parent.then(done, fail); + } + + // Process each invocable in the plan, but ignore any where a local of the same name exists. + for (var i=0, ii=plan.length; i} The template html as a string, or a promise + * for that string. + */ + this.fromUrl = function (url, params) { + if (isFunction(url)) url = url(params); + if (url == null) return null; + else return $http + .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }}) + .then(function(response) { return response.data; }); + }; + + /** + * @ngdoc function + * @name ui.router.util.$templateFactory#fromProvider + * @methodOf ui.router.util.$templateFactory + * + * @description + * Creates a template by invoking an injectable provider function. + * + * @param {Function} provider Function to invoke via `$injector.invoke` + * @param {Object} params Parameters for the template. + * @param {Object} locals Locals to pass to `invoke`. Defaults to + * `{ params: params }`. + * @return {string|Promise.} The template html as a string, or a promise + * for that string. + */ + this.fromProvider = function (provider, params, locals) { + return $injector.invoke(provider, null, locals || { params: params }); + }; +} + +angular.module('ui.router.util').service('$templateFactory', $TemplateFactory); + +var $$UMFP; // reference to $UrlMatcherFactoryProvider + +/** + * @ngdoc object + * @name ui.router.util.type:UrlMatcher + * + * @description + * Matches URLs against patterns and extracts named parameters from the path or the search + * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list + * of search parameters. Multiple search parameter names are separated by '&'. Search parameters + * do not influence whether or not a URL is matched, but their values are passed through into + * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}. + * + * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace + * syntax, which optionally allows a regular expression for the parameter to be specified: + * + * * `':'` name - colon placeholder + * * `'*'` name - catch-all placeholder + * * `'{' name '}'` - curly placeholder + * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the + * regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash. + * + * Parameter names may contain only word characters (latin letters, digits, and underscore) and + * must be unique within the pattern (across both path and search parameters). For colon + * placeholders or curly placeholders without an explicit regexp, a path parameter matches any + * number of characters other than '/'. For catch-all placeholders the path parameter matches + * any number of characters. + * + * Examples: + * + * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for + * trailing slashes, and patterns have to match the entire path, not just a prefix. + * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or + * '/user/bob/details'. The second path segment will be captured as the parameter 'id'. + * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax. + * * `'/user/{id:[^/]*}'` - Same as the previous example. + * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id + * parameter consists of 1 to 8 hex digits. + * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the + * path into the parameter 'path'. + * * `'/files/*path'` - ditto. + * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined + * in the built-in `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start + * + * @param {string} pattern The pattern to compile into a matcher. + * @param {Object} config A configuration object hash: + * @param {Object=} parentMatcher Used to concatenate the pattern/config onto + * an existing UrlMatcher + * + * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`. + * * `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`. + * + * @property {string} prefix A static prefix of this pattern. The matcher guarantees that any + * URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns + * non-null) will start with this prefix. + * + * @property {string} source The pattern that was passed into the constructor + * + * @property {string} sourcePath The path portion of the source property + * + * @property {string} sourceSearch The search portion of the source property + * + * @property {string} regex The constructed regex that will be used to match against the url when + * it is time to determine which url will match. + * + * @returns {Object} New `UrlMatcher` object + */ +function UrlMatcher(pattern, config, parentMatcher) { + config = extend({ params: {} }, isObject(config) ? config : {}); + + // Find all placeholders and create a compiled pattern, using either classic or curly syntax: + // '*' name + // ':' name + // '{' name '}' + // '{' name ':' regexp '}' + // The regular expression is somewhat complicated due to the need to allow curly braces + // inside the regular expression. The placeholder regexp breaks down as follows: + // ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case) + // \{([\w\[\]]+)(?:\:\s*( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case + // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either + // [^{}\\]+ - anything other than curly braces or backslash + // \\. - a backslash escape + // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms + var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, + searchPlaceholder = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, + compiled = '^', last = 0, m, + segments = this.segments = [], + parentParams = parentMatcher ? parentMatcher.params : {}, + params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(), + paramNames = []; + + function addParameter(id, type, config, location) { + paramNames.push(id); + if (parentParams[id]) return parentParams[id]; + if (!/^\w+([-.]+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'"); + if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'"); + params[id] = new $$UMFP.Param(id, type, config, location); + return params[id]; + } + + function quoteRegExp(string, pattern, squash, optional) { + var surroundPattern = ['',''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&"); + if (!pattern) return result; + switch(squash) { + case false: surroundPattern = ['(', ')' + (optional ? "?" : "")]; break; + case true: + result = result.replace(/\/$/, ''); + surroundPattern = ['(?:\/(', ')|\/)?']; + break; + default: surroundPattern = ['(' + squash + "|", ')?']; break; + } + return result + surroundPattern[0] + pattern + surroundPattern[1]; + } + + this.source = pattern; + + // Split into static segments separated by path parameter placeholders. + // The number of segments is always 1 more than the number of parameters. + function matchDetails(m, isSearch) { + var id, regexp, segment, type, cfg, arrayMode; + id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null + cfg = config.params[id]; + segment = pattern.substring(last, m.index); + regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null); + + if (regexp) { + type = $$UMFP.type(regexp) || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) }); + } + + return { + id: id, regexp: regexp, segment: segment, type: type, cfg: cfg + }; + } + + var p, param, segment; + while ((m = placeholder.exec(pattern))) { + p = matchDetails(m, false); + if (p.segment.indexOf('?') >= 0) break; // we're into the search part + + param = addParameter(p.id, p.type, p.cfg, "path"); + compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional); + segments.push(p.segment); + last = placeholder.lastIndex; + } + segment = pattern.substring(last); + + // Find any search parameter names and remove them from the last segment + var i = segment.indexOf('?'); + + if (i >= 0) { + var search = this.sourceSearch = segment.substring(i); + segment = segment.substring(0, i); + this.sourcePath = pattern.substring(0, last + i); + + if (search.length > 0) { + last = 0; + while ((m = searchPlaceholder.exec(search))) { + p = matchDetails(m, true); + param = addParameter(p.id, p.type, p.cfg, "search"); + last = placeholder.lastIndex; + // check if ?& + } + } + } else { + this.sourcePath = pattern; + this.sourceSearch = ''; + } + + compiled += quoteRegExp(segment) + (config.strict === false ? '\/?' : '') + '$'; + segments.push(segment); + + this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined); + this.prefix = segments[0]; + this.$$paramNames = paramNames; +} + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#concat + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Returns a new matcher for a pattern constructed by appending the path part and adding the + * search parameters of the specified pattern to this pattern. The current pattern is not + * modified. This can be understood as creating a pattern for URLs that are relative to (or + * suffixes of) the current pattern. + * + * @example + * The following two matchers are equivalent: + *
+ * new UrlMatcher('/user/{id}?q').concat('/details?date');
+ * new UrlMatcher('/user/{id}/details?q&date');
+ * 
+ * + * @param {string} pattern The pattern to append. + * @param {Object} config An object hash of the configuration for the matcher. + * @returns {UrlMatcher} A matcher for the concatenated pattern. + */ +UrlMatcher.prototype.concat = function (pattern, config) { + // Because order of search parameters is irrelevant, we can add our own search + // parameters to the end of the new pattern. Parse the new pattern by itself + // and then join the bits together, but it's much easier to do this on a string level. + var defaultConfig = { + caseInsensitive: $$UMFP.caseInsensitive(), + strict: $$UMFP.strictMode(), + squash: $$UMFP.defaultSquashPolicy() + }; + return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this); +}; + +UrlMatcher.prototype.toString = function () { + return this.source; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#exec + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Tests the specified path against this matcher, and returns an object containing the captured + * parameter values, or null if the path does not match. The returned object contains the values + * of any search parameters that are mentioned in the pattern, but their value may be null if + * they are not present in `searchParams`. This means that search parameters are always treated + * as optional. + * + * @example + *
+ * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
+ *   x: '1', q: 'hello'
+ * });
+ * // returns { id: 'bob', q: 'hello', r: null }
+ * 
+ * + * @param {string} path The URL path to match, e.g. `$location.path()`. + * @param {Object} searchParams URL search parameters, e.g. `$location.search()`. + * @returns {Object} The captured parameter values. + */ +UrlMatcher.prototype.exec = function (path, searchParams) { + var m = this.regexp.exec(path); + if (!m) return null; + searchParams = searchParams || {}; + + var paramNames = this.parameters(), nTotal = paramNames.length, + nPath = this.segments.length - 1, + values = {}, i, j, cfg, paramName; + + if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'"); + + function decodePathArray(string) { + function reverseString(str) { return str.split("").reverse().join(""); } + function unquoteDashes(str) { return str.replace(/\\-/g, "-"); } + + var split = reverseString(string).split(/-(?!\\)/); + var allReversed = map(split, reverseString); + return map(allReversed, unquoteDashes).reverse(); + } + + var param, paramVal; + for (i = 0; i < nPath; i++) { + paramName = paramNames[i]; + param = this.params[paramName]; + paramVal = m[i+1]; + // if the param value matches a pre-replace pair, replace the value before decoding. + for (j = 0; j < param.replace.length; j++) { + if (param.replace[j].from === paramVal) paramVal = param.replace[j].to; + } + if (paramVal && param.array === true) paramVal = decodePathArray(paramVal); + if (isDefined(paramVal)) paramVal = param.type.decode(paramVal); + values[paramName] = param.value(paramVal); + } + for (/**/; i < nTotal; i++) { + paramName = paramNames[i]; + values[paramName] = this.params[paramName].value(searchParams[paramName]); + param = this.params[paramName]; + paramVal = searchParams[paramName]; + for (j = 0; j < param.replace.length; j++) { + if (param.replace[j].from === paramVal) paramVal = param.replace[j].to; + } + if (isDefined(paramVal)) paramVal = param.type.decode(paramVal); + values[paramName] = param.value(paramVal); + } + + return values; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#parameters + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Returns the names of all path and search parameters of this pattern in an unspecified order. + * + * @returns {Array.} An array of parameter names. Must be treated as read-only. If the + * pattern has no parameters, an empty array is returned. + */ +UrlMatcher.prototype.parameters = function (param) { + if (!isDefined(param)) return this.$$paramNames; + return this.params[param] || null; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#validates + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Checks an object hash of parameters to validate their correctness according to the parameter + * types of this `UrlMatcher`. + * + * @param {Object} params The object hash of parameters to validate. + * @returns {boolean} Returns `true` if `params` validates, otherwise `false`. + */ +UrlMatcher.prototype.validates = function (params) { + return this.params.$$validates(params); +}; + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#format + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Creates a URL that matches this pattern by substituting the specified values + * for the path and search parameters. Null values for path parameters are + * treated as empty strings. + * + * @example + *
+ * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
+ * // returns '/user/bob?q=yes'
+ * 
+ * + * @param {Object} values the values to substitute for the parameters in this pattern. + * @returns {string} the formatted URL (path and optionally search part). + */ +UrlMatcher.prototype.format = function (values) { + values = values || {}; + var segments = this.segments, params = this.parameters(), paramset = this.params; + if (!this.validates(values)) return null; + + var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0]; + + function encodeDashes(str) { // Replace dashes with encoded "\-" + return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); }); + } + + for (i = 0; i < nTotal; i++) { + var isPathParam = i < nPath; + var name = params[i], param = paramset[name], value = param.value(values[name]); + var isDefaultValue = param.isOptional && param.type.equals(param.value(), value); + var squash = isDefaultValue ? param.squash : false; + var encoded = param.type.encode(value); + + if (isPathParam) { + var nextSegment = segments[i + 1]; + var isFinalPathParam = i + 1 === nPath; + + if (squash === false) { + if (encoded != null) { + if (isArray(encoded)) { + result += map(encoded, encodeDashes).join("-"); + } else { + result += encodeURIComponent(encoded); + } + } + result += nextSegment; + } else if (squash === true) { + var capture = result.match(/\/$/) ? /\/?(.*)/ : /(.*)/; + result += nextSegment.match(capture)[1]; + } else if (isString(squash)) { + result += squash + nextSegment; + } + + if (isFinalPathParam && param.squash === true && result.slice(-1) === '/') result = result.slice(0, -1); + } else { + if (encoded == null || (isDefaultValue && squash !== false)) continue; + if (!isArray(encoded)) encoded = [ encoded ]; + if (encoded.length === 0) continue; + encoded = map(encoded, encodeURIComponent).join('&' + name + '='); + result += (search ? '&' : '?') + (name + '=' + encoded); + search = true; + } + } + + return result; +}; + +/** + * @ngdoc object + * @name ui.router.util.type:Type + * + * @description + * Implements an interface to define custom parameter types that can be decoded from and encoded to + * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`} + * objects when matching or formatting URLs, or comparing or validating parameter values. + * + * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more + * information on registering custom types. + * + * @param {Object} config A configuration object which contains the custom type definition. The object's + * properties will override the default methods and/or pattern in `Type`'s public interface. + * @example + *
+ * {
+ *   decode: function(val) { return parseInt(val, 10); },
+ *   encode: function(val) { return val && val.toString(); },
+ *   equals: function(a, b) { return this.is(a) && a === b; },
+ *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },
+ *   pattern: /\d+/
+ * }
+ * 
+ * + * @property {RegExp} pattern The regular expression pattern used to match values of this type when + * coming from a substring of a URL. + * + * @returns {Object} Returns a new `Type` object. + */ +function Type(config) { + extend(this, config); +} + +/** + * @ngdoc function + * @name ui.router.util.type:Type#is + * @methodOf ui.router.util.type:Type + * + * @description + * Detects whether a value is of a particular type. Accepts a native (decoded) value + * and determines whether it matches the current `Type` object. + * + * @param {*} val The value to check. + * @param {string} key Optional. If the type check is happening in the context of a specific + * {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the + * parameter in which `val` is stored. Can be used for meta-programming of `Type` objects. + * @returns {Boolean} Returns `true` if the value matches the type, otherwise `false`. + */ +Type.prototype.is = function(val, key) { + return true; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:Type#encode + * @methodOf ui.router.util.type:Type + * + * @description + * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the + * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it + * only needs to be a representation of `val` that has been coerced to a string. + * + * @param {*} val The value to encode. + * @param {string} key The name of the parameter in which `val` is stored. Can be used for + * meta-programming of `Type` objects. + * @returns {string} Returns a string representation of `val` that can be encoded in a URL. + */ +Type.prototype.encode = function(val, key) { + return val; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:Type#decode + * @methodOf ui.router.util.type:Type + * + * @description + * Converts a parameter value (from URL string or transition param) to a custom/native value. + * + * @param {string} val The URL parameter value to decode. + * @param {string} key The name of the parameter in which `val` is stored. Can be used for + * meta-programming of `Type` objects. + * @returns {*} Returns a custom representation of the URL parameter value. + */ +Type.prototype.decode = function(val, key) { + return val; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:Type#equals + * @methodOf ui.router.util.type:Type + * + * @description + * Determines whether two decoded values are equivalent. + * + * @param {*} a A value to compare against. + * @param {*} b A value to compare against. + * @returns {Boolean} Returns `true` if the values are equivalent/equal, otherwise `false`. + */ +Type.prototype.equals = function(a, b) { + return a == b; +}; + +Type.prototype.$subPattern = function() { + var sub = this.pattern.toString(); + return sub.substr(1, sub.length - 2); +}; + +Type.prototype.pattern = /.*/; + +Type.prototype.toString = function() { return "{Type:" + this.name + "}"; }; + +/** Given an encoded string, or a decoded object, returns a decoded object */ +Type.prototype.$normalize = function(val) { + return this.is(val) ? val : this.decode(val); +}; + +/* + * Wraps an existing custom Type as an array of Type, depending on 'mode'. + * e.g.: + * - urlmatcher pattern "/path?{queryParam[]:int}" + * - url: "/path?queryParam=1&queryParam=2 + * - $stateParams.queryParam will be [1, 2] + * if `mode` is "auto", then + * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1 + * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2] + */ +Type.prototype.$asArray = function(mode, isSearch) { + if (!mode) return this; + if (mode === "auto" && !isSearch) throw new Error("'auto' array mode is for query parameters only"); + + function ArrayType(type, mode) { + function bindTo(type, callbackName) { + return function() { + return type[callbackName].apply(type, arguments); + }; + } + + // Wrap non-array value as array + function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); } + // Unwrap array value for "auto" mode. Return undefined for empty array. + function arrayUnwrap(val) { + switch(val.length) { + case 0: return undefined; + case 1: return mode === "auto" ? val[0] : val; + default: return val; + } + } + function falsey(val) { return !val; } + + // Wraps type (.is/.encode/.decode) functions to operate on each value of an array + function arrayHandler(callback, allTruthyMode) { + return function handleArray(val) { + if (isArray(val) && val.length === 0) return val; + val = arrayWrap(val); + var result = map(val, callback); + if (allTruthyMode === true) + return filter(result, falsey).length === 0; + return arrayUnwrap(result); + }; + } + + // Wraps type (.equals) functions to operate on each value of an array + function arrayEqualsHandler(callback) { + return function handleArray(val1, val2) { + var left = arrayWrap(val1), right = arrayWrap(val2); + if (left.length !== right.length) return false; + for (var i = 0; i < left.length; i++) { + if (!callback(left[i], right[i])) return false; + } + return true; + }; + } + + this.encode = arrayHandler(bindTo(type, 'encode')); + this.decode = arrayHandler(bindTo(type, 'decode')); + this.is = arrayHandler(bindTo(type, 'is'), true); + this.equals = arrayEqualsHandler(bindTo(type, 'equals')); + this.pattern = type.pattern; + this.$normalize = arrayHandler(bindTo(type, '$normalize')); + this.name = type.name; + this.$arrayMode = mode; + } + + return new ArrayType(this, mode); +}; + + + +/** + * @ngdoc object + * @name ui.router.util.$urlMatcherFactory + * + * @description + * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory + * is also available to providers under the name `$urlMatcherFactoryProvider`. + */ +function $UrlMatcherFactory() { + $$UMFP = this; + + var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false; + + // Use tildes to pre-encode slashes. + // If the slashes are simply URLEncoded, the browser can choose to pre-decode them, + // and bidirectional encoding/decoding fails. + // Tilde was chosen because it's not a RFC 3986 section 2.2 Reserved Character + function valToString(val) { return val != null ? val.toString().replace(/~/g, "~~").replace(/\//g, "~2F") : val; } + function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, "/").replace(/~~/g, "~") : val; } + + var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = { + "string": { + encode: valToString, + decode: valFromString, + // TODO: in 1.0, make string .is() return false if value is undefined/null by default. + // In 0.2.x, string params are optional by default for backwards compat + is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; }, + pattern: /[^/]*/ + }, + "int": { + encode: valToString, + decode: function(val) { return parseInt(val, 10); }, + is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; }, + pattern: /\d+/ + }, + "bool": { + encode: function(val) { return val ? 1 : 0; }, + decode: function(val) { return parseInt(val, 10) !== 0; }, + is: function(val) { return val === true || val === false; }, + pattern: /0|1/ + }, + "date": { + encode: function (val) { + if (!this.is(val)) + return undefined; + return [ val.getFullYear(), + ('0' + (val.getMonth() + 1)).slice(-2), + ('0' + val.getDate()).slice(-2) + ].join("-"); + }, + decode: function (val) { + if (this.is(val)) return val; + var match = this.capture.exec(val); + return match ? new Date(match[1], match[2] - 1, match[3]) : undefined; + }, + is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); }, + equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); }, + pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/, + capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/ + }, + "json": { + encode: angular.toJson, + decode: angular.fromJson, + is: angular.isObject, + equals: angular.equals, + pattern: /[^/]*/ + }, + "any": { // does not encode/decode + encode: angular.identity, + decode: angular.identity, + equals: angular.equals, + pattern: /.*/ + } + }; + + function getDefaultConfig() { + return { + strict: isStrictMode, + caseInsensitive: isCaseInsensitive + }; + } + + function isInjectable(value) { + return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1]))); + } + + /** + * [Internal] Get the default value of a parameter, which may be an injectable function. + */ + $UrlMatcherFactory.$$getDefaultValue = function(config) { + if (!isInjectable(config.value)) return config.value; + if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); + return injector.invoke(config.value); + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#caseInsensitive + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Defines whether URL matching should be case sensitive (the default behavior), or not. + * + * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`; + * @returns {boolean} the current value of caseInsensitive + */ + this.caseInsensitive = function(value) { + if (isDefined(value)) + isCaseInsensitive = value; + return isCaseInsensitive; + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#strictMode + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Defines whether URLs should match trailing slashes, or not (the default behavior). + * + * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`. + * @returns {boolean} the current value of strictMode + */ + this.strictMode = function(value) { + if (isDefined(value)) + isStrictMode = value; + return isStrictMode; + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Sets the default behavior when generating or matching URLs with default parameter values. + * + * @param {string} value A string that defines the default parameter URL squashing behavior. + * `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL + * `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the + * parameter is surrounded by slashes, squash (remove) one slash from the URL + * any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) + * the parameter value from the URL and replace it with this string. + */ + this.defaultSquashPolicy = function(value) { + if (!isDefined(value)) return defaultSquashPolicy; + if (value !== true && value !== false && !isString(value)) + throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string"); + defaultSquashPolicy = value; + return value; + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#compile + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern. + * + * @param {string} pattern The URL pattern. + * @param {Object} config The config object hash. + * @returns {UrlMatcher} The UrlMatcher. + */ + this.compile = function (pattern, config) { + return new UrlMatcher(pattern, extend(getDefaultConfig(), config)); + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#isMatcher + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Returns true if the specified object is a `UrlMatcher`, or false otherwise. + * + * @param {Object} object The object to perform the type check against. + * @returns {Boolean} Returns `true` if the object matches the `UrlMatcher` interface, by + * implementing all the same methods. + */ + this.isMatcher = function (o) { + if (!isObject(o)) return false; + var result = true; + + forEach(UrlMatcher.prototype, function(val, name) { + if (isFunction(val)) { + result = result && (isDefined(o[name]) && isFunction(o[name])); + } + }); + return result; + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#type + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to + * generate URLs with typed parameters. + * + * @param {string} name The type name. + * @param {Object|Function} definition The type definition. See + * {@link ui.router.util.type:Type `Type`} for information on the values accepted. + * @param {Object|Function} definitionFn (optional) A function that is injected before the app + * runtime starts. The result of this function is merged into the existing `definition`. + * See {@link ui.router.util.type:Type `Type`} for information on the values accepted. + * + * @returns {Object} Returns `$urlMatcherFactoryProvider`. + * + * @example + * This is a simple example of a custom type that encodes and decodes items from an + * array, using the array index as the URL-encoded value: + * + *
+   * var list = ['John', 'Paul', 'George', 'Ringo'];
+   *
+   * $urlMatcherFactoryProvider.type('listItem', {
+   *   encode: function(item) {
+   *     // Represent the list item in the URL using its corresponding index
+   *     return list.indexOf(item);
+   *   },
+   *   decode: function(item) {
+   *     // Look up the list item by index
+   *     return list[parseInt(item, 10)];
+   *   },
+   *   is: function(item) {
+   *     // Ensure the item is valid by checking to see that it appears
+   *     // in the list
+   *     return list.indexOf(item) > -1;
+   *   }
+   * });
+   *
+   * $stateProvider.state('list', {
+   *   url: "/list/{item:listItem}",
+   *   controller: function($scope, $stateParams) {
+   *     console.log($stateParams.item);
+   *   }
+   * });
+   *
+   * // ...
+   *
+   * // Changes URL to '/list/3', logs "Ringo" to the console
+   * $state.go('list', { item: "Ringo" });
+   * 
+ * + * This is a more complex example of a type that relies on dependency injection to + * interact with services, and uses the parameter name from the URL to infer how to + * handle encoding and decoding parameter values: + * + *
+   * // Defines a custom type that gets a value from a service,
+   * // where each service gets different types of values from
+   * // a backend API:
+   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {
+   *
+   *   // Matches up services to URL parameter names
+   *   var services = {
+   *     user: Users,
+   *     post: Posts
+   *   };
+   *
+   *   return {
+   *     encode: function(object) {
+   *       // Represent the object in the URL using its unique ID
+   *       return object.id;
+   *     },
+   *     decode: function(value, key) {
+   *       // Look up the object by ID, using the parameter
+   *       // name (key) to call the correct service
+   *       return services[key].findById(value);
+   *     },
+   *     is: function(object, key) {
+   *       // Check that object is a valid dbObject
+   *       return angular.isObject(object) && object.id && services[key];
+   *     }
+   *     equals: function(a, b) {
+   *       // Check the equality of decoded objects by comparing
+   *       // their unique IDs
+   *       return a.id === b.id;
+   *     }
+   *   };
+   * });
+   *
+   * // In a config() block, you can then attach URLs with
+   * // type-annotated parameters:
+   * $stateProvider.state('users', {
+   *   url: "/users",
+   *   // ...
+   * }).state('users.item', {
+   *   url: "/{user:dbObject}",
+   *   controller: function($scope, $stateParams) {
+   *     // $stateParams.user will now be an object returned from
+   *     // the Users service
+   *   },
+   *   // ...
+   * });
+   * 
+ */ + this.type = function (name, definition, definitionFn) { + if (!isDefined(definition)) return $types[name]; + if ($types.hasOwnProperty(name)) throw new Error("A type named '" + name + "' has already been defined."); + + $types[name] = new Type(extend({ name: name }, definition)); + if (definitionFn) { + typeQueue.push({ name: name, def: definitionFn }); + if (!enqueue) flushTypeQueue(); + } + return this; + }; + + // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s + function flushTypeQueue() { + while(typeQueue.length) { + var type = typeQueue.shift(); + if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime."); + angular.extend($types[type.name], injector.invoke(type.def)); + } + } + + // Register default types. Store them in the prototype of $types. + forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); }); + $types = inherit($types, {}); + + /* No need to document $get, since it returns this */ + this.$get = ['$injector', function ($injector) { + injector = $injector; + enqueue = false; + flushTypeQueue(); + + forEach(defaultTypes, function(type, name) { + if (!$types[name]) $types[name] = new Type(type); + }); + return this; + }]; + + this.Param = function Param(id, type, config, location) { + var self = this; + config = unwrapShorthand(config); + type = getType(config, type, location); + var arrayMode = getArrayMode(); + type = arrayMode ? type.$asArray(arrayMode, location === "search") : type; + if (type.name === "string" && !arrayMode && location === "path" && config.value === undefined) + config.value = ""; // for 0.2.x; in 0.3.0+ do not automatically default to "" + var isOptional = config.value !== undefined; + var squash = getSquashPolicy(config, isOptional); + var replace = getReplace(config, arrayMode, isOptional, squash); + + function unwrapShorthand(config) { + var keys = isObject(config) ? objectKeys(config) : []; + var isShorthand = indexOf(keys, "value") === -1 && indexOf(keys, "type") === -1 && + indexOf(keys, "squash") === -1 && indexOf(keys, "array") === -1; + if (isShorthand) config = { value: config }; + config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; }; + return config; + } + + function getType(config, urlType, location) { + if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations."); + if (urlType) return urlType; + if (!config.type) return (location === "config" ? $types.any : $types.string); + + if (angular.isString(config.type)) + return $types[config.type]; + if (config.type instanceof Type) + return config.type; + return new Type(config.type); + } + + // array config: param name (param[]) overrides default settings. explicit config overrides param name. + function getArrayMode() { + var arrayDefaults = { array: (location === "search" ? "auto" : false) }; + var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {}; + return extend(arrayDefaults, arrayParamNomenclature, config).array; + } + + /** + * returns false, true, or the squash value to indicate the "default parameter url squash policy". + */ + function getSquashPolicy(config, isOptional) { + var squash = config.squash; + if (!isOptional || squash === false) return false; + if (!isDefined(squash) || squash == null) return defaultSquashPolicy; + if (squash === true || isString(squash)) return squash; + throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); + } + + function getReplace(config, arrayMode, isOptional, squash) { + var replace, configuredKeys, defaultPolicy = [ + { from: "", to: (isOptional || arrayMode ? undefined : "") }, + { from: null, to: (isOptional || arrayMode ? undefined : "") } + ]; + replace = isArray(config.replace) ? config.replace : []; + if (isString(squash)) + replace.push({ from: squash, to: undefined }); + configuredKeys = map(replace, function(item) { return item.from; } ); + return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace); + } + + /** + * [Internal] Get the default value of a parameter, which may be an injectable function. + */ + function $$getDefaultValue() { + if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); + var defaultValue = injector.invoke(config.$$fn); + if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue)) + throw new Error("Default value (" + defaultValue + ") for parameter '" + self.id + "' is not an instance of Type (" + self.type.name + ")"); + return defaultValue; + } + + /** + * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the + * default value, which may be the result of an injectable function. + */ + function $value(value) { + function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; } + function $replace(value) { + var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; }); + return replacement.length ? replacement[0] : value; + } + value = $replace(value); + return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value); + } + + function toString() { return "{Param:" + id + " " + type + " squash: '" + squash + "' optional: " + isOptional + "}"; } + + extend(this, { + id: id, + type: type, + location: location, + array: arrayMode, + squash: squash, + replace: replace, + isOptional: isOptional, + value: $value, + dynamic: undefined, + config: config, + toString: toString + }); + }; + + function ParamSet(params) { + extend(this, params || {}); + } + + ParamSet.prototype = { + $$new: function() { + return inherit(this, extend(new ParamSet(), { $$parent: this})); + }, + $$keys: function () { + var keys = [], chain = [], parent = this, + ignore = objectKeys(ParamSet.prototype); + while (parent) { chain.push(parent); parent = parent.$$parent; } + chain.reverse(); + forEach(chain, function(paramset) { + forEach(objectKeys(paramset), function(key) { + if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key); + }); + }); + return keys; + }, + $$values: function(paramValues) { + var values = {}, self = this; + forEach(self.$$keys(), function(key) { + values[key] = self[key].value(paramValues && paramValues[key]); + }); + return values; + }, + $$equals: function(paramValues1, paramValues2) { + var equal = true, self = this; + forEach(self.$$keys(), function(key) { + var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key]; + if (!self[key].type.equals(left, right)) equal = false; + }); + return equal; + }, + $$validates: function $$validate(paramValues) { + var keys = this.$$keys(), i, param, rawVal, normalized, encoded; + for (i = 0; i < keys.length; i++) { + param = this[keys[i]]; + rawVal = paramValues[keys[i]]; + if ((rawVal === undefined || rawVal === null) && param.isOptional) + break; // There was no parameter value, but the param is optional + normalized = param.type.$normalize(rawVal); + if (!param.type.is(normalized)) + return false; // The value was not of the correct Type, and could not be decoded to the correct Type + encoded = param.type.encode(normalized); + if (angular.isString(encoded) && !param.type.pattern.exec(encoded)) + return false; // The value was of the correct type, but when encoded, did not match the Type's regexp + } + return true; + }, + $$parent: undefined + }; + + this.ParamSet = ParamSet; +} + +// Register as a provider so it's available to other providers +angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory); +angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]); + +/** + * @ngdoc object + * @name ui.router.router.$urlRouterProvider + * + * @requires ui.router.util.$urlMatcherFactoryProvider + * @requires $locationProvider + * + * @description + * `$urlRouterProvider` has the responsibility of watching `$location`. + * When `$location` changes it runs through a list of rules one by one until a + * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify + * a url in a state configuration. All urls are compiled into a UrlMatcher object. + * + * There are several methods on `$urlRouterProvider` that make it useful to use directly + * in your module config. + */ +$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider']; +function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { + var rules = [], otherwise = null, interceptDeferred = false, listener; + + // Returns a string that is a prefix of all strings matching the RegExp + function regExpPrefix(re) { + var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source); + return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : ''; + } + + // Interpolates matched values into a String.replace()-style pattern + function interpolate(pattern, match) { + return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) { + return match[what === '$' ? 0 : Number(what)]; + }); + } + + /** + * @ngdoc function + * @name ui.router.router.$urlRouterProvider#rule + * @methodOf ui.router.router.$urlRouterProvider + * + * @description + * Defines rules that are used by `$urlRouterProvider` to find matches for + * specific URLs. + * + * @example + *
+   * var app = angular.module('app', ['ui.router.router']);
+   *
+   * app.config(function ($urlRouterProvider) {
+   *   // Here's an example of how you might allow case insensitive urls
+   *   $urlRouterProvider.rule(function ($injector, $location) {
+   *     var path = $location.path(),
+   *         normalized = path.toLowerCase();
+   *
+   *     if (path !== normalized) {
+   *       return normalized;
+   *     }
+   *   });
+   * });
+   * 
+ * + * @param {function} rule Handler function that takes `$injector` and `$location` + * services as arguments. You can use them to return a valid path as a string. + * + * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance + */ + this.rule = function (rule) { + if (!isFunction(rule)) throw new Error("'rule' must be a function"); + rules.push(rule); + return this; + }; + + /** + * @ngdoc object + * @name ui.router.router.$urlRouterProvider#otherwise + * @methodOf ui.router.router.$urlRouterProvider + * + * @description + * Defines a path that is used when an invalid route is requested. + * + * @example + *
+   * var app = angular.module('app', ['ui.router.router']);
+   *
+   * app.config(function ($urlRouterProvider) {
+   *   // if the path doesn't match any of the urls you configured
+   *   // otherwise will take care of routing the user to the
+   *   // specified url
+   *   $urlRouterProvider.otherwise('/index');
+   *
+   *   // Example of using function rule as param
+   *   $urlRouterProvider.otherwise(function ($injector, $location) {
+   *     return '/a/valid/url';
+   *   });
+   * });
+   * 
+ * + * @param {string|function} rule The url path you want to redirect to or a function + * rule that returns the url path. The function version is passed two params: + * `$injector` and `$location` services, and must return a url string. + * + * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance + */ + this.otherwise = function (rule) { + if (isString(rule)) { + var redirect = rule; + rule = function () { return redirect; }; + } + else if (!isFunction(rule)) throw new Error("'rule' must be a function"); + otherwise = rule; + return this; + }; + + + function handleIfMatch($injector, handler, match) { + if (!match) return false; + var result = $injector.invoke(handler, handler, { $match: match }); + return isDefined(result) ? result : true; + } + + /** + * @ngdoc function + * @name ui.router.router.$urlRouterProvider#when + * @methodOf ui.router.router.$urlRouterProvider + * + * @description + * Registers a handler for a given url matching. + * + * If the handler is a string, it is + * treated as a redirect, and is interpolated according to the syntax of match + * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). + * + * If the handler is a function, it is injectable. It gets invoked if `$location` + * matches. You have the option of inject the match object as `$match`. + * + * The handler can return + * + * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` + * will continue trying to find another one that matches. + * - **string** which is treated as a redirect and passed to `$location.url()` + * - **void** or any **truthy** value tells `$urlRouter` that the url was handled. + * + * @example + *
+   * var app = angular.module('app', ['ui.router.router']);
+   *
+   * app.config(function ($urlRouterProvider) {
+   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {
+   *     if ($state.$current.navigable !== state ||
+   *         !equalForKeys($match, $stateParams) {
+   *      $state.transitionTo(state, $match, false);
+   *     }
+   *   });
+   * });
+   * 
+ * + * @param {string|object} what The incoming path that you want to redirect. + * @param {string|function} handler The path you want to redirect your user to. + */ + this.when = function (what, handler) { + var redirect, handlerIsString = isString(handler); + if (isString(what)) what = $urlMatcherFactory.compile(what); + + if (!handlerIsString && !isFunction(handler) && !isArray(handler)) + throw new Error("invalid 'handler' in when()"); + + var strategies = { + matcher: function (what, handler) { + if (handlerIsString) { + redirect = $urlMatcherFactory.compile(handler); + handler = ['$match', function ($match) { return redirect.format($match); }]; + } + return extend(function ($injector, $location) { + return handleIfMatch($injector, handler, what.exec($location.path(), $location.search())); + }, { + prefix: isString(what.prefix) ? what.prefix : '' + }); + }, + regex: function (what, handler) { + if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky"); + + if (handlerIsString) { + redirect = handler; + handler = ['$match', function ($match) { return interpolate(redirect, $match); }]; + } + return extend(function ($injector, $location) { + return handleIfMatch($injector, handler, what.exec($location.path())); + }, { + prefix: regExpPrefix(what) + }); + } + }; + + var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp }; + + for (var n in check) { + if (check[n]) return this.rule(strategies[n](what, handler)); + } + + throw new Error("invalid 'what' in when()"); + }; + + /** + * @ngdoc function + * @name ui.router.router.$urlRouterProvider#deferIntercept + * @methodOf ui.router.router.$urlRouterProvider + * + * @description + * Disables (or enables) deferring location change interception. + * + * If you wish to customize the behavior of syncing the URL (for example, if you wish to + * defer a transition but maintain the current URL), call this method at configuration time. + * Then, at run time, call `$urlRouter.listen()` after you have configured your own + * `$locationChangeSuccess` event handler. + * + * @example + *
+   * var app = angular.module('app', ['ui.router.router']);
+   *
+   * app.config(function ($urlRouterProvider) {
+   *
+   *   // Prevent $urlRouter from automatically intercepting URL changes;
+   *   // this allows you to configure custom behavior in between
+   *   // location changes and route synchronization:
+   *   $urlRouterProvider.deferIntercept();
+   *
+   * }).run(function ($rootScope, $urlRouter, UserService) {
+   *
+   *   $rootScope.$on('$locationChangeSuccess', function(e) {
+   *     // UserService is an example service for managing user state
+   *     if (UserService.isLoggedIn()) return;
+   *
+   *     // Prevent $urlRouter's default handler from firing
+   *     e.preventDefault();
+   *
+   *     UserService.handleLogin().then(function() {
+   *       // Once the user has logged in, sync the current URL
+   *       // to the router:
+   *       $urlRouter.sync();
+   *     });
+   *   });
+   *
+   *   // Configures $urlRouter's listener *after* your custom listener
+   *   $urlRouter.listen();
+   * });
+   * 
+ * + * @param {boolean} defer Indicates whether to defer location change interception. Passing + no parameter is equivalent to `true`. + */ + this.deferIntercept = function (defer) { + if (defer === undefined) defer = true; + interceptDeferred = defer; + }; + + /** + * @ngdoc object + * @name ui.router.router.$urlRouter + * + * @requires $location + * @requires $rootScope + * @requires $injector + * @requires $browser + * + * @description + * + */ + this.$get = $get; + $get.$inject = ['$location', '$rootScope', '$injector', '$browser', '$sniffer']; + function $get( $location, $rootScope, $injector, $browser, $sniffer) { + + var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl; + + function appendBasePath(url, isHtml5, absolute) { + if (baseHref === '/') return url; + if (isHtml5) return baseHref.slice(0, -1) + url; + if (absolute) return baseHref.slice(1) + url; + return url; + } + + // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree + function update(evt) { + if (evt && evt.defaultPrevented) return; + var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl; + lastPushedUrl = undefined; + // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573 + //if (ignoreUpdate) return true; + + function check(rule) { + var handled = rule($injector, $location); + + if (!handled) return false; + if (isString(handled)) $location.replace().url(handled); + return true; + } + var n = rules.length, i; + + for (i = 0; i < n; i++) { + if (check(rules[i])) return; + } + // always check otherwise last to allow dynamic updates to the set of rules + if (otherwise) check(otherwise); + } + + function listen() { + listener = listener || $rootScope.$on('$locationChangeSuccess', update); + return listener; + } + + if (!interceptDeferred) listen(); + + return { + /** + * @ngdoc function + * @name ui.router.router.$urlRouter#sync + * @methodOf ui.router.router.$urlRouter + * + * @description + * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`. + * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event, + * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed + * with the transition by calling `$urlRouter.sync()`. + * + * @example + *
+       * angular.module('app', ['ui.router'])
+       *   .run(function($rootScope, $urlRouter) {
+       *     $rootScope.$on('$locationChangeSuccess', function(evt) {
+       *       // Halt state change from even starting
+       *       evt.preventDefault();
+       *       // Perform custom logic
+       *       var meetsRequirement = ...
+       *       // Continue with the update and state transition if logic allows
+       *       if (meetsRequirement) $urlRouter.sync();
+       *     });
+       * });
+       * 
+ */ + sync: function() { + update(); + }, + + listen: function() { + return listen(); + }, + + update: function(read) { + if (read) { + location = $location.url(); + return; + } + if ($location.url() === location) return; + + $location.url(location); + $location.replace(); + }, + + push: function(urlMatcher, params, options) { + var url = urlMatcher.format(params || {}); + + // Handle the special hash param, if needed + if (url !== null && params && params['#']) { + url += '#' + params['#']; + } + + $location.url(url); + lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined; + if (options && options.replace) $location.replace(); + }, + + /** + * @ngdoc function + * @name ui.router.router.$urlRouter#href + * @methodOf ui.router.router.$urlRouter + * + * @description + * A URL generation method that returns the compiled URL for a given + * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters. + * + * @example + *
+       * $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
+       *   person: "bob"
+       * });
+       * // $bob == "/about/bob";
+       * 
+ * + * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate. + * @param {object=} params An object of parameter values to fill the matcher's required parameters. + * @param {object=} options Options object. The options are: + * + * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". + * + * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher` + */ + href: function(urlMatcher, params, options) { + if (!urlMatcher.validates(params)) return null; + + var isHtml5 = $locationProvider.html5Mode(); + if (angular.isObject(isHtml5)) { + isHtml5 = isHtml5.enabled; + } + + isHtml5 = isHtml5 && $sniffer.history; + + var url = urlMatcher.format(params); + options = options || {}; + + if (!isHtml5 && url !== null) { + url = "#" + $locationProvider.hashPrefix() + url; + } + + // Handle special hash param, if needed + if (url !== null && params && params['#']) { + url += '#' + params['#']; + } + + url = appendBasePath(url, isHtml5, options.absolute); + + if (!options.absolute || !url) { + return url; + } + + var slash = (!isHtml5 && url ? '/' : ''), port = $location.port(); + port = (port === 80 || port === 443 ? '' : ':' + port); + + return [$location.protocol(), '://', $location.host(), port, slash, url].join(''); + } + }; + } +} + +angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider); + +/** + * @ngdoc object + * @name ui.router.state.$stateProvider + * + * @requires ui.router.router.$urlRouterProvider + * @requires ui.router.util.$urlMatcherFactoryProvider + * + * @description + * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely + * on state. + * + * A state corresponds to a "place" in the application in terms of the overall UI and + * navigation. A state describes (via the controller / template / view properties) what + * the UI looks like and does at that place. + * + * States often have things in common, and the primary way of factoring out these + * commonalities in this model is via the state hierarchy, i.e. parent/child states aka + * nested states. + * + * The `$stateProvider` provides interfaces to declare these states for your app. + */ +$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider']; +function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { + + var root, states = {}, $state, queue = {}, abstractKey = 'abstract'; + + // Builds state properties from definition passed to registerState() + var stateBuilder = { + + // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined. + // state.children = []; + // if (parent) parent.children.push(state); + parent: function(state) { + if (isDefined(state.parent) && state.parent) return findState(state.parent); + // regex matches any valid composite state name + // would match "contact.list" but not "contacts" + var compositeName = /^(.+)\.[^.]+$/.exec(state.name); + return compositeName ? findState(compositeName[1]) : root; + }, + + // inherit 'data' from parent and override by own values (if any) + data: function(state) { + if (state.parent && state.parent.data) { + state.data = state.self.data = inherit(state.parent.data, state.data); + } + return state.data; + }, + + // Build a URLMatcher if necessary, either via a relative or absolute URL + url: function(state) { + var url = state.url, config = { params: state.params || {} }; + + if (isString(url)) { + if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config); + return (state.parent.navigable || root).url.concat(url, config); + } + + if (!url || $urlMatcherFactory.isMatcher(url)) return url; + throw new Error("Invalid url '" + url + "' in state '" + state + "'"); + }, + + // Keep track of the closest ancestor state that has a URL (i.e. is navigable) + navigable: function(state) { + return state.url ? state : (state.parent ? state.parent.navigable : null); + }, + + // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params + ownParams: function(state) { + var params = state.url && state.url.params || new $$UMFP.ParamSet(); + forEach(state.params || {}, function(config, id) { + if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, "config"); + }); + return params; + }, + + // Derive parameters for this state and ensure they're a super-set of parent's parameters + params: function(state) { + var ownParams = pick(state.ownParams, state.ownParams.$$keys()); + return state.parent && state.parent.params ? extend(state.parent.params.$$new(), ownParams) : new $$UMFP.ParamSet(); + }, + + // If there is no explicit multi-view configuration, make one up so we don't have + // to handle both cases in the view directive later. Note that having an explicit + // 'views' property will mean the default unnamed view properties are ignored. This + // is also a good time to resolve view names to absolute names, so everything is a + // straight lookup at link time. + views: function(state) { + var views = {}; + + forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) { + if (name.indexOf('@') < 0) name += '@' + state.parent.name; + views[name] = view; + }); + return views; + }, + + // Keep a full path from the root down to this state as this is needed for state activation. + path: function(state) { + return state.parent ? state.parent.path.concat(state) : []; // exclude root from path + }, + + // Speed up $state.contains() as it's used a lot + includes: function(state) { + var includes = state.parent ? extend({}, state.parent.includes) : {}; + includes[state.name] = true; + return includes; + }, + + $delegates: {} + }; + + function isRelative(stateName) { + return stateName.indexOf(".") === 0 || stateName.indexOf("^") === 0; + } + + function findState(stateOrName, base) { + if (!stateOrName) return undefined; + + var isStr = isString(stateOrName), + name = isStr ? stateOrName : stateOrName.name, + path = isRelative(name); + + if (path) { + if (!base) throw new Error("No reference point given for path '" + name + "'"); + base = findState(base); + + var rel = name.split("."), i = 0, pathLength = rel.length, current = base; + + for (; i < pathLength; i++) { + if (rel[i] === "" && i === 0) { + current = base; + continue; + } + if (rel[i] === "^") { + if (!current.parent) throw new Error("Path '" + name + "' not valid for state '" + base.name + "'"); + current = current.parent; + continue; + } + break; + } + rel = rel.slice(i).join("."); + name = current.name + (current.name && rel ? "." : "") + rel; + } + var state = states[name]; + + if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) { + return state; + } + return undefined; + } + + function queueState(parentName, state) { + if (!queue[parentName]) { + queue[parentName] = []; + } + queue[parentName].push(state); + } + + function flushQueuedChildren(parentName) { + var queued = queue[parentName] || []; + while(queued.length) { + registerState(queued.shift()); + } + } + + function registerState(state) { + // Wrap a new object around the state so we can store our private details easily. + state = inherit(state, { + self: state, + resolve: state.resolve || {}, + toString: function() { return this.name; } + }); + + var name = state.name; + if (!isString(name) || name.indexOf('@') >= 0) throw new Error("State must have a valid name"); + if (states.hasOwnProperty(name)) throw new Error("State '" + name + "' is already defined"); + + // Get parent name + var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.')) + : (isString(state.parent)) ? state.parent + : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name + : ''; + + // If parent is not registered yet, add state to queue and register later + if (parentName && !states[parentName]) { + return queueState(parentName, state.self); + } + + for (var key in stateBuilder) { + if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]); + } + states[name] = state; + + // Register the state in the global state list and with $urlRouter if necessary. + if (!state[abstractKey] && state.url) { + $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) { + if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) { + $state.transitionTo(state, $match, { inherit: true, location: false }); + } + }]); + } + + // Register any queued children + flushQueuedChildren(name); + + return state; + } + + // Checks text to see if it looks like a glob. + function isGlob (text) { + return text.indexOf('*') > -1; + } + + // Returns true if glob matches current $state name. + function doesStateMatchGlob (glob) { + var globSegments = glob.split('.'), + segments = $state.$current.name.split('.'); + + //match single stars + for (var i = 0, l = globSegments.length; i < l; i++) { + if (globSegments[i] === '*') { + segments[i] = '*'; + } + } + + //match greedy starts + if (globSegments[0] === '**') { + segments = segments.slice(indexOf(segments, globSegments[1])); + segments.unshift('**'); + } + //match greedy ends + if (globSegments[globSegments.length - 1] === '**') { + segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE); + segments.push('**'); + } + + if (globSegments.length != segments.length) { + return false; + } + + return segments.join('') === globSegments.join(''); + } + + + // Implicit root state that is always active + root = registerState({ + name: '', + url: '^', + views: null, + 'abstract': true + }); + root.navigable = null; + + + /** + * @ngdoc function + * @name ui.router.state.$stateProvider#decorator + * @methodOf ui.router.state.$stateProvider + * + * @description + * Allows you to extend (carefully) or override (at your own peril) the + * `stateBuilder` object used internally by `$stateProvider`. This can be used + * to add custom functionality to ui-router, for example inferring templateUrl + * based on the state name. + * + * When passing only a name, it returns the current (original or decorated) builder + * function that matches `name`. + * + * The builder functions that can be decorated are listed below. Though not all + * necessarily have a good use case for decoration, that is up to you to decide. + * + * In addition, users can attach custom decorators, which will generate new + * properties within the state's internal definition. There is currently no clear + * use-case for this beyond accessing internal states (i.e. $state.$current), + * however, expect this to become increasingly relevant as we introduce additional + * meta-programming features. + * + * **Warning**: Decorators should not be interdependent because the order of + * execution of the builder functions in non-deterministic. Builder functions + * should only be dependent on the state definition object and super function. + * + * + * Existing builder functions and current return values: + * + * - **parent** `{object}` - returns the parent state object. + * - **data** `{object}` - returns state data, including any inherited data that is not + * overridden by own values (if any). + * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher} + * or `null`. + * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is + * navigable). + * - **params** `{object}` - returns an array of state params that are ensured to + * be a super-set of parent's params. + * - **views** `{object}` - returns a views object where each key is an absolute view + * name (i.e. "viewName@stateName") and each value is the config object + * (template, controller) for the view. Even when you don't use the views object + * explicitly on a state config, one is still created for you internally. + * So by decorating this builder function you have access to decorating template + * and controller properties. + * - **ownParams** `{object}` - returns an array of params that belong to the state, + * not including any params defined by ancestor states. + * - **path** `{string}` - returns the full path from the root down to this state. + * Needed for state activation. + * - **includes** `{object}` - returns an object that includes every state that + * would pass a `$state.includes()` test. + * + * @example + *
+   * // Override the internal 'views' builder with a function that takes the state
+   * // definition, and a reference to the internal function being overridden:
+   * $stateProvider.decorator('views', function (state, parent) {
+   *   var result = {},
+   *       views = parent(state);
+   *
+   *   angular.forEach(views, function (config, name) {
+   *     var autoName = (state.name + '.' + name).replace('.', '/');
+   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
+   *     result[name] = config;
+   *   });
+   *   return result;
+   * });
+   *
+   * $stateProvider.state('home', {
+   *   views: {
+   *     'contact.list': { controller: 'ListController' },
+   *     'contact.item': { controller: 'ItemController' }
+   *   }
+   * });
+   *
+   * // ...
+   *
+   * $state.go('home');
+   * // Auto-populates list and item views with /partials/home/contact/list.html,
+   * // and /partials/home/contact/item.html, respectively.
+   * 
+ * + * @param {string} name The name of the builder function to decorate. + * @param {object} func A function that is responsible for decorating the original + * builder function. The function receives two parameters: + * + * - `{object}` - state - The state config object. + * - `{object}` - super - The original builder function. + * + * @return {object} $stateProvider - $stateProvider instance + */ + this.decorator = decorator; + function decorator(name, func) { + /*jshint validthis: true */ + if (isString(name) && !isDefined(func)) { + return stateBuilder[name]; + } + if (!isFunction(func) || !isString(name)) { + return this; + } + if (stateBuilder[name] && !stateBuilder.$delegates[name]) { + stateBuilder.$delegates[name] = stateBuilder[name]; + } + stateBuilder[name] = func; + return this; + } + + /** + * @ngdoc function + * @name ui.router.state.$stateProvider#state + * @methodOf ui.router.state.$stateProvider + * + * @description + * Registers a state configuration under a given state name. The stateConfig object + * has the following acceptable properties. + * + * @param {string} name A unique state name, e.g. "home", "about", "contacts". + * To create a parent/child state use a dot, e.g. "about.sales", "home.newest". + * @param {object} stateConfig State configuration object. + * @param {string|function=} stateConfig.template + * + * html template as a string or a function that returns + * an html template as a string which should be used by the uiView directives. This property + * takes precedence over templateUrl. + * + * If `template` is a function, it will be called with the following parameters: + * + * - {array.<object>} - state parameters extracted from the current $location.path() by + * applying the current state + * + *
template:
+   *   "

inline template definition

" + + * "
"
+ *
template: function(params) {
+   *       return "

generated template

"; }
+ *
+ * + * @param {string|function=} stateConfig.templateUrl + * + * + * path or function that returns a path to an html + * template that should be used by uiView. + * + * If `templateUrl` is a function, it will be called with the following parameters: + * + * - {array.<object>} - state parameters extracted from the current $location.path() by + * applying the current state + * + *
templateUrl: "home.html"
+ *
templateUrl: function(params) {
+   *     return myTemplates[params.pageId]; }
+ * + * @param {function=} stateConfig.templateProvider + * + * Provider function that returns HTML content string. + *
 templateProvider:
+   *       function(MyTemplateService, params) {
+   *         return MyTemplateService.getTemplate(params.pageId);
+   *       }
+ * + * @param {string|function=} stateConfig.controller + * + * + * Controller fn that should be associated with newly + * related scope or the name of a registered controller if passed as a string. + * Optionally, the ControllerAs may be declared here. + *
controller: "MyRegisteredController"
+ *
controller:
+   *     "MyRegisteredController as fooCtrl"}
+ *
controller: function($scope, MyService) {
+   *     $scope.data = MyService.getData(); }
+ * + * @param {function=} stateConfig.controllerProvider + * + * + * Injectable provider function that returns the actual controller or string. + *
controllerProvider:
+   *   function(MyResolveData) {
+   *     if (MyResolveData.foo)
+   *       return "FooCtrl"
+   *     else if (MyResolveData.bar)
+   *       return "BarCtrl";
+   *     else return function($scope) {
+   *       $scope.baz = "Qux";
+   *     }
+   *   }
+ * + * @param {string=} stateConfig.controllerAs + * + * + * A controller alias name. If present the controller will be + * published to scope under the controllerAs name. + *
controllerAs: "myCtrl"
+ * + * @param {string|object=} stateConfig.parent + * + * Optionally specifies the parent state of this state. + * + *
parent: 'parentState'
+ *
parent: parentState // JS variable
+ * + * @param {object=} stateConfig.resolve + * + * + * An optional map<string, function> of dependencies which + * should be injected into the controller. If any of these dependencies are promises, + * the router will wait for them all to be resolved before the controller is instantiated. + * If all the promises are resolved successfully, the $stateChangeSuccess event is fired + * and the values of the resolved promises are injected into any controllers that reference them. + * If any of the promises are rejected the $stateChangeError event is fired. + * + * The map object is: + * + * - key - {string}: name of dependency to be injected into controller + * - factory - {string|function}: If string then it is alias for service. Otherwise if function, + * it is injected and return value it treated as dependency. If result is a promise, it is + * resolved before its value is injected into controller. + * + *
resolve: {
+   *     myResolve1:
+   *       function($http, $stateParams) {
+   *         return $http.get("/api/foos/"+stateParams.fooID);
+   *       }
+   *     }
+ * + * @param {string=} stateConfig.url + * + * + * A url fragment with optional parameters. When a state is navigated or + * transitioned to, the `$stateParams` service will be populated with any + * parameters that were passed. + * + * (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for + * more details on acceptable patterns ) + * + * examples: + *
url: "/home"
+   * url: "/users/:userid"
+   * url: "/books/{bookid:[a-zA-Z_-]}"
+   * url: "/books/{categoryid:int}"
+   * url: "/books/{publishername:string}/{categoryid:int}"
+   * url: "/messages?before&after"
+   * url: "/messages?{before:date}&{after:date}"
+   * url: "/messages/:mailboxid?{before:date}&{after:date}"
+   * 
+ * + * @param {object=} stateConfig.views + * + * an optional map<string, object> which defined multiple views, or targets views + * manually/explicitly. + * + * Examples: + * + * Targets three named `ui-view`s in the parent state's template + *
views: {
+   *     header: {
+   *       controller: "headerCtrl",
+   *       templateUrl: "header.html"
+   *     }, body: {
+   *       controller: "bodyCtrl",
+   *       templateUrl: "body.html"
+   *     }, footer: {
+   *       controller: "footCtrl",
+   *       templateUrl: "footer.html"
+   *     }
+   *   }
+ * + * Targets named `ui-view="header"` from grandparent state 'top''s template, and named `ui-view="body" from parent state's template. + *
views: {
+   *     'header@top': {
+   *       controller: "msgHeaderCtrl",
+   *       templateUrl: "msgHeader.html"
+   *     }, 'body': {
+   *       controller: "messagesCtrl",
+   *       templateUrl: "messages.html"
+   *     }
+   *   }
+ * + * @param {boolean=} [stateConfig.abstract=false] + * + * An abstract state will never be directly activated, + * but can provide inherited properties to its common children states. + *
abstract: true
+ * + * @param {function=} stateConfig.onEnter + * + * + * Callback function for when a state is entered. Good way + * to trigger an action or dispatch an event, such as opening a dialog. + * If minifying your scripts, make sure to explicitly annotate this function, + * because it won't be automatically annotated by your build tools. + * + *
onEnter: function(MyService, $stateParams) {
+   *     MyService.foo($stateParams.myParam);
+   * }
+ * + * @param {function=} stateConfig.onExit + * + * + * Callback function for when a state is exited. Good way to + * trigger an action or dispatch an event, such as opening a dialog. + * If minifying your scripts, make sure to explicitly annotate this function, + * because it won't be automatically annotated by your build tools. + * + *
onExit: function(MyService, $stateParams) {
+   *     MyService.cleanup($stateParams.myParam);
+   * }
+ * + * @param {boolean=} [stateConfig.reloadOnSearch=true] + * + * + * If `false`, will not retrigger the same state + * just because a search/query parameter has changed (via $location.search() or $location.hash()). + * Useful for when you'd like to modify $location.search() without triggering a reload. + *
reloadOnSearch: false
+ * + * @param {object=} stateConfig.data + * + * + * Arbitrary data object, useful for custom configuration. The parent state's `data` is + * prototypally inherited. In other words, adding a data property to a state adds it to + * the entire subtree via prototypal inheritance. + * + *
data: {
+   *     requiredRole: 'foo'
+   * } 
+ * + * @param {object=} stateConfig.params + * + * + * A map which optionally configures parameters declared in the `url`, or + * defines additional non-url parameters. For each parameter being + * configured, add a configuration object keyed to the name of the parameter. + * + * Each parameter configuration object may contain the following properties: + * + * - ** value ** - {object|function=}: specifies the default value for this + * parameter. This implicitly sets this parameter as optional. + * + * When UI-Router routes to a state and no value is + * specified for this parameter in the URL or transition, the + * default value will be used instead. If `value` is a function, + * it will be injected and invoked, and the return value used. + * + * *Note*: `undefined` is treated as "no default value" while `null` + * is treated as "the default value is `null`". + * + * *Shorthand*: If you only need to configure the default value of the + * parameter, you may use a shorthand syntax. In the **`params`** + * map, instead mapping the param name to a full parameter configuration + * object, simply set map it to the default parameter value, e.g.: + * + *
// define a parameter's default value
+   * params: {
+   *     param1: { value: "defaultValue" }
+   * }
+   * // shorthand default values
+   * params: {
+   *     param1: "defaultValue",
+   *     param2: "param2Default"
+   * }
+ * + * - ** array ** - {boolean=}: *(default: false)* If true, the param value will be + * treated as an array of values. If you specified a Type, the value will be + * treated as an array of the specified Type. Note: query parameter values + * default to a special `"auto"` mode. + * + * For query parameters in `"auto"` mode, if multiple values for a single parameter + * are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values + * are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`). However, if + * only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single + * value (e.g.: `{ foo: '1' }`). + * + *
params: {
+   *     param1: { array: true }
+   * }
+ * + * - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when + * the current parameter value is the same as the default value. If `squash` is not set, it uses the + * configured default squash policy. + * (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`}) + * + * There are three squash settings: + * + * - false: The parameter's default value is not squashed. It is encoded and included in the URL + * - true: The parameter's default value is omitted from the URL. If the parameter is preceeded and followed + * by slashes in the state's `url` declaration, then one of those slashes are omitted. + * This can allow for cleaner looking URLs. + * - `""`: The parameter's default value is replaced with an arbitrary placeholder of your choice. + * + *
params: {
+   *     param1: {
+   *       value: "defaultId",
+   *       squash: true
+   * } }
+   * // squash "defaultValue" to "~"
+   * params: {
+   *     param1: {
+   *       value: "defaultValue",
+   *       squash: "~"
+   * } }
+   * 
+ * + * + * @example + *
+   * // Some state name examples
+   *
+   * // stateName can be a single top-level name (must be unique).
+   * $stateProvider.state("home", {});
+   *
+   * // Or it can be a nested state name. This state is a child of the
+   * // above "home" state.
+   * $stateProvider.state("home.newest", {});
+   *
+   * // Nest states as deeply as needed.
+   * $stateProvider.state("home.newest.abc.xyz.inception", {});
+   *
+   * // state() returns $stateProvider, so you can chain state declarations.
+   * $stateProvider
+   *   .state("home", {})
+   *   .state("about", {})
+   *   .state("contacts", {});
+   * 
+ * + */ + this.state = state; + function state(name, definition) { + /*jshint validthis: true */ + if (isObject(name)) definition = name; + else definition.name = name; + registerState(definition); + return this; + } + + /** + * @ngdoc object + * @name ui.router.state.$state + * + * @requires $rootScope + * @requires $q + * @requires ui.router.state.$view + * @requires $injector + * @requires ui.router.util.$resolve + * @requires ui.router.state.$stateParams + * @requires ui.router.router.$urlRouter + * + * @property {object} params A param object, e.g. {sectionId: section.id)}, that + * you'd like to test against the current active state. + * @property {object} current A reference to the state's config object. However + * you passed it in. Useful for accessing custom data. + * @property {object} transition Currently pending transition. A promise that'll + * resolve or reject. + * + * @description + * `$state` service is responsible for representing states as well as transitioning + * between them. It also provides interfaces to ask for current state or even states + * you're coming from. + */ + this.$get = $get; + $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory']; + function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) { + + var TransitionSuperseded = $q.reject(new Error('transition superseded')); + var TransitionPrevented = $q.reject(new Error('transition prevented')); + var TransitionAborted = $q.reject(new Error('transition aborted')); + var TransitionFailed = $q.reject(new Error('transition failed')); + + // Handles the case where a state which is the target of a transition is not found, and the user + // can optionally retry or defer the transition + function handleRedirect(redirect, state, params, options) { + /** + * @ngdoc event + * @name ui.router.state.$state#$stateNotFound + * @eventOf ui.router.state.$state + * @eventType broadcast on root scope + * @description + * Fired when a requested state **cannot be found** using the provided state name during transition. + * The event is broadcast allowing any handlers a single chance to deal with the error (usually by + * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler, + * you can see its three properties in the example. You can use `event.preventDefault()` to abort the + * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value. + * + * @param {Object} event Event object. + * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties. + * @param {State} fromState Current state object. + * @param {Object} fromParams Current state params. + * + * @example + * + *
+       * // somewhere, assume lazy.state has not been defined
+       * $state.go("lazy.state", {a:1, b:2}, {inherit:false});
+       *
+       * // somewhere else
+       * $scope.$on('$stateNotFound',
+       * function(event, unfoundState, fromState, fromParams){
+       *     console.log(unfoundState.to); // "lazy.state"
+       *     console.log(unfoundState.toParams); // {a:1, b:2}
+       *     console.log(unfoundState.options); // {inherit:false} + default options
+       * })
+       * 
+ */ + var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params); + + if (evt.defaultPrevented) { + $urlRouter.update(); + return TransitionAborted; + } + + if (!evt.retry) { + return null; + } + + // Allow the handler to return a promise to defer state lookup retry + if (options.$retry) { + $urlRouter.update(); + return TransitionFailed; + } + var retryTransition = $state.transition = $q.when(evt.retry); + + retryTransition.then(function() { + if (retryTransition !== $state.transition) return TransitionSuperseded; + redirect.options.$retry = true; + return $state.transitionTo(redirect.to, redirect.toParams, redirect.options); + }, function() { + return TransitionAborted; + }); + $urlRouter.update(); + + return retryTransition; + } + + root.locals = { resolve: null, globals: { $stateParams: {} } }; + + $state = { + params: {}, + current: root.self, + $current: root, + transition: null + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#reload + * @methodOf ui.router.state.$state + * + * @description + * A method that force reloads the current state. All resolves are re-resolved, + * controllers reinstantiated, and events re-fired. + * + * @example + *
+     * var app angular.module('app', ['ui.router']);
+     *
+     * app.controller('ctrl', function ($scope, $state) {
+     *   $scope.reload = function(){
+     *     $state.reload();
+     *   }
+     * });
+     * 
+ * + * `reload()` is just an alias for: + *
+     * $state.transitionTo($state.current, $stateParams, { 
+     *   reload: true, inherit: false, notify: true
+     * });
+     * 
+ * + * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved. + * @example + *
+     * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' 
+     * //and current state is 'contacts.detail.item'
+     * var app angular.module('app', ['ui.router']);
+     *
+     * app.controller('ctrl', function ($scope, $state) {
+     *   $scope.reload = function(){
+     *     //will reload 'contact.detail' and 'contact.detail.item' states
+     *     $state.reload('contact.detail');
+     *   }
+     * });
+     * 
+ * + * `reload()` is just an alias for: + *
+     * $state.transitionTo($state.current, $stateParams, { 
+     *   reload: true, inherit: false, notify: true
+     * });
+     * 
+ + * @returns {promise} A promise representing the state of the new transition. See + * {@link ui.router.state.$state#methods_go $state.go}. + */ + $state.reload = function reload(state) { + return $state.transitionTo($state.current, $stateParams, { reload: state || true, inherit: false, notify: true}); + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#go + * @methodOf ui.router.state.$state + * + * @description + * Convenience method for transitioning to a new state. `$state.go` calls + * `$state.transitionTo` internally but automatically sets options to + * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. + * This allows you to easily use an absolute or relative to path and specify + * only the parameters you'd like to update (while letting unspecified parameters + * inherit from the currently active ancestor states). + * + * @example + *
+     * var app = angular.module('app', ['ui.router']);
+     *
+     * app.controller('ctrl', function ($scope, $state) {
+     *   $scope.changeState = function () {
+     *     $state.go('contact.detail');
+     *   };
+     * });
+     * 
+ * + * + * @param {string} to Absolute state name or relative state path. Some examples: + * + * - `$state.go('contact.detail')` - will go to the `contact.detail` state + * - `$state.go('^')` - will go to a parent state + * - `$state.go('^.sibling')` - will go to a sibling state + * - `$state.go('.child.grandchild')` - will go to grandchild state + * + * @param {object=} params A map of the parameters that will be sent to the state, + * will populate $stateParams. Any parameters that are not specified will be inherited from currently + * defined parameters. Only parameters specified in the state definition can be overridden, new + * parameters will be ignored. This allows, for example, going to a sibling state that shares parameters + * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e. + * transitioning to a sibling will get you the parameters for all parents, transitioning to a child + * will get you all current parameters, etc. + * @param {object=} options Options object. The options are: + * + * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false` + * will not. If string, must be `"replace"`, which will update url and also replace last history record. + * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url. + * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), + * defines which state to be relative from. + * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events. + * - **`reload`** (v0.2.5) - {boolean=false|string|object}, If `true` will force transition even if no state or params + * have changed. It will reload the resolves and views of the current state and parent states. + * If `reload` is a string (or state object), the state object is fetched (by name, or object reference); and \ + * the transition reloads the resolves and views for that matched state, and all its children states. + * + * @returns {promise} A promise representing the state of the new transition. + * + * Possible success values: + * + * - $state.current + * + *
Possible rejection values: + * + * - 'transition superseded' - when a newer transition has been started after this one + * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener + * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or + * when a `$stateNotFound` `event.retry` promise errors. + * - 'transition failed' - when a state has been unsuccessfully found after 2 tries. + * - *resolve error* - when an error has occurred with a `resolve` + * + */ + $state.go = function go(to, params, options) { + return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options)); + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#transitionTo + * @methodOf ui.router.state.$state + * + * @description + * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go} + * uses `transitionTo` internally. `$state.go` is recommended in most situations. + * + * @example + *
+     * var app = angular.module('app', ['ui.router']);
+     *
+     * app.controller('ctrl', function ($scope, $state) {
+     *   $scope.changeState = function () {
+     *     $state.transitionTo('contact.detail');
+     *   };
+     * });
+     * 
+ * + * @param {string} to State name. + * @param {object=} toParams A map of the parameters that will be sent to the state, + * will populate $stateParams. + * @param {object=} options Options object. The options are: + * + * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false` + * will not. If string, must be `"replace"`, which will update url and also replace last history record. + * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url. + * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), + * defines which state to be relative from. + * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events. + * - **`reload`** (v0.2.5) - {boolean=false|string=|object=}, If `true` will force transition even if the state or params + * have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd + * use this when you want to force a reload when *everything* is the same, including search params. + * if String, then will reload the state with the name given in reload, and any children. + * if Object, then a stateObj is expected, will reload the state found in stateObj, and any children. + * + * @returns {promise} A promise representing the state of the new transition. See + * {@link ui.router.state.$state#methods_go $state.go}. + */ + $state.transitionTo = function transitionTo(to, toParams, options) { + toParams = toParams || {}; + options = extend({ + location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false + }, options || {}); + + var from = $state.$current, fromParams = $state.params, fromPath = from.path; + var evt, toState = findState(to, options.relative); + + // Store the hash param for later (since it will be stripped out by various methods) + var hash = toParams['#']; + + if (!isDefined(toState)) { + var redirect = { to: to, toParams: toParams, options: options }; + var redirectResult = handleRedirect(redirect, from.self, fromParams, options); + + if (redirectResult) { + return redirectResult; + } + + // Always retry once if the $stateNotFound was not prevented + // (handles either redirect changed or state lazy-definition) + to = redirect.to; + toParams = redirect.toParams; + options = redirect.options; + toState = findState(to, options.relative); + + if (!isDefined(toState)) { + if (!options.relative) throw new Error("No such state '" + to + "'"); + throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'"); + } + } + if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'"); + if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState); + if (!toState.params.$$validates(toParams)) return TransitionFailed; + + toParams = toState.params.$$values(toParams); + to = toState; + + var toPath = to.path; + + // Starting from the root of the path, keep all levels that haven't changed + var keep = 0, state = toPath[keep], locals = root.locals, toLocals = []; + + if (!options.reload) { + while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) { + locals = toLocals[keep] = state.locals; + keep++; + state = toPath[keep]; + } + } else if (isString(options.reload) || isObject(options.reload)) { + if (isObject(options.reload) && !options.reload.name) { + throw new Error('Invalid reload state object'); + } + + var reloadState = options.reload === true ? fromPath[0] : findState(options.reload); + if (options.reload && !reloadState) { + throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'"); + } + + while (state && state === fromPath[keep] && state !== reloadState) { + locals = toLocals[keep] = state.locals; + keep++; + state = toPath[keep]; + } + } + + // If we're going to the same state and all locals are kept, we've got nothing to do. + // But clear 'transition', as we still want to cancel any other pending transitions. + // TODO: We may not want to bump 'transition' if we're called from a location change + // that we've initiated ourselves, because we might accidentally abort a legitimate + // transition initiated from code? + if (shouldSkipReload(to, toParams, from, fromParams, locals, options)) { + if (hash) toParams['#'] = hash; + $state.params = toParams; + copy($state.params, $stateParams); + copy(filterByKeys(to.params.$$keys(), $stateParams), to.locals.globals.$stateParams); + if (options.location && to.navigable && to.navigable.url) { + $urlRouter.push(to.navigable.url, toParams, { + $$avoidResync: true, replace: options.location === 'replace' + }); + $urlRouter.update(true); + } + $state.transition = null; + return $q.when($state.current); + } + + // Filter parameters before we pass them to event handlers etc. + toParams = filterByKeys(to.params.$$keys(), toParams || {}); + + // Re-add the saved hash before we start returning things or broadcasting $stateChangeStart + if (hash) toParams['#'] = hash; + + // Broadcast start event and cancel the transition if requested + if (options.notify) { + /** + * @ngdoc event + * @name ui.router.state.$state#$stateChangeStart + * @eventOf ui.router.state.$state + * @eventType broadcast on root scope + * @description + * Fired when the state transition **begins**. You can use `event.preventDefault()` + * to prevent the transition from happening and then the transition promise will be + * rejected with a `'transition prevented'` value. + * + * @param {Object} event Event object. + * @param {State} toState The state being transitioned to. + * @param {Object} toParams The params supplied to the `toState`. + * @param {State} fromState The current state, pre-transition. + * @param {Object} fromParams The params supplied to the `fromState`. + * + * @example + * + *
+         * $rootScope.$on('$stateChangeStart',
+         * function(event, toState, toParams, fromState, fromParams){
+         *     event.preventDefault();
+         *     // transitionTo() promise will be rejected with
+         *     // a 'transition prevented' error
+         * })
+         * 
+ */ + if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams, options).defaultPrevented) { + $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams); + //Don't update and resync url if there's been a new transition started. see issue #2238, #600 + if ($state.transition == null) $urlRouter.update(); + return TransitionPrevented; + } + } + + // Resolve locals for the remaining states, but don't update any global state just + // yet -- if anything fails to resolve the current state needs to remain untouched. + // We also set up an inheritance chain for the locals here. This allows the view directive + // to quickly look up the correct definition for each view in the current state. Even + // though we create the locals object itself outside resolveState(), it is initially + // empty and gets filled asynchronously. We need to keep track of the promise for the + // (fully resolved) current locals, and pass this down the chain. + var resolved = $q.when(locals); + + for (var l = keep; l < toPath.length; l++, state = toPath[l]) { + locals = toLocals[l] = inherit(locals); + resolved = resolveState(state, toParams, state === to, resolved, locals, options); + } + + // Once everything is resolved, we are ready to perform the actual transition + // and return a promise for the new state. We also keep track of what the + // current promise is, so that we can detect overlapping transitions and + // keep only the outcome of the last transition. + var transition = $state.transition = resolved.then(function () { + var l, entering, exiting; + + if ($state.transition !== transition) return TransitionSuperseded; + + // Exit 'from' states not kept + for (l = fromPath.length - 1; l >= keep; l--) { + exiting = fromPath[l]; + if (exiting.self.onExit) { + $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals); + } + exiting.locals = null; + } + + // Enter 'to' states not kept + for (l = keep; l < toPath.length; l++) { + entering = toPath[l]; + entering.locals = toLocals[l]; + if (entering.self.onEnter) { + $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals); + } + } + + // Run it again, to catch any transitions in callbacks + if ($state.transition !== transition) return TransitionSuperseded; + + // Update globals in $state + $state.$current = to; + $state.current = to.self; + $state.params = toParams; + copy($state.params, $stateParams); + $state.transition = null; + + if (options.location && to.navigable) { + $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, { + $$avoidResync: true, replace: options.location === 'replace' + }); + } + + if (options.notify) { + /** + * @ngdoc event + * @name ui.router.state.$state#$stateChangeSuccess + * @eventOf ui.router.state.$state + * @eventType broadcast on root scope + * @description + * Fired once the state transition is **complete**. + * + * @param {Object} event Event object. + * @param {State} toState The state being transitioned to. + * @param {Object} toParams The params supplied to the `toState`. + * @param {State} fromState The current state, pre-transition. + * @param {Object} fromParams The params supplied to the `fromState`. + */ + $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams); + } + $urlRouter.update(true); + + return $state.current; + }, function (error) { + if ($state.transition !== transition) return TransitionSuperseded; + + $state.transition = null; + /** + * @ngdoc event + * @name ui.router.state.$state#$stateChangeError + * @eventOf ui.router.state.$state + * @eventType broadcast on root scope + * @description + * Fired when an **error occurs** during transition. It's important to note that if you + * have any errors in your resolve functions (javascript errors, non-existent services, etc) + * they will not throw traditionally. You must listen for this $stateChangeError event to + * catch **ALL** errors. + * + * @param {Object} event Event object. + * @param {State} toState The state being transitioned to. + * @param {Object} toParams The params supplied to the `toState`. + * @param {State} fromState The current state, pre-transition. + * @param {Object} fromParams The params supplied to the `fromState`. + * @param {Error} error The resolve error object. + */ + evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error); + + if (!evt.defaultPrevented) { + $urlRouter.update(); + } + + return $q.reject(error); + }); + + return transition; + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#is + * @methodOf ui.router.state.$state + * + * @description + * Similar to {@link ui.router.state.$state#methods_includes $state.includes}, + * but only checks for the full state name. If params is supplied then it will be + * tested for strict equality against the current active params object, so all params + * must match with none missing and no extras. + * + * @example + *
+     * $state.$current.name = 'contacts.details.item';
+     *
+     * // absolute name
+     * $state.is('contact.details.item'); // returns true
+     * $state.is(contactDetailItemStateObject); // returns true
+     *
+     * // relative name (. and ^), typically from a template
+     * // E.g. from the 'contacts.details' template
+     * 
Item
+ *
+ * + * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check. + * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like + * to test against the current active state. + * @param {object=} options An options object. The options are: + * + * - **`relative`** - {string|object} - If `stateOrName` is a relative state name and `options.relative` is set, .is will + * test relative to `options.relative` state (or name). + * + * @returns {boolean} Returns true if it is the state. + */ + $state.is = function is(stateOrName, params, options) { + options = extend({ relative: $state.$current }, options || {}); + var state = findState(stateOrName, options.relative); + + if (!isDefined(state)) { return undefined; } + if ($state.$current !== state) { return false; } + return params ? equalForKeys(state.params.$$values(params), $stateParams) : true; + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#includes + * @methodOf ui.router.state.$state + * + * @description + * A method to determine if the current active state is equal to or is the child of the + * state stateName. If any params are passed then they will be tested for a match as well. + * Not all the parameters need to be passed, just the ones you'd like to test for equality. + * + * @example + * Partial and relative names + *
+     * $state.$current.name = 'contacts.details.item';
+     *
+     * // Using partial names
+     * $state.includes("contacts"); // returns true
+     * $state.includes("contacts.details"); // returns true
+     * $state.includes("contacts.details.item"); // returns true
+     * $state.includes("contacts.list"); // returns false
+     * $state.includes("about"); // returns false
+     *
+     * // Using relative names (. and ^), typically from a template
+     * // E.g. from the 'contacts.details' template
+     * 
Item
+ *
+ * + * Basic globbing patterns + *
+     * $state.$current.name = 'contacts.details.item.url';
+     *
+     * $state.includes("*.details.*.*"); // returns true
+     * $state.includes("*.details.**"); // returns true
+     * $state.includes("**.item.**"); // returns true
+     * $state.includes("*.details.item.url"); // returns true
+     * $state.includes("*.details.*.url"); // returns true
+     * $state.includes("*.details.*"); // returns false
+     * $state.includes("item.**"); // returns false
+     * 
+ * + * @param {string} stateOrName A partial name, relative name, or glob pattern + * to be searched for within the current state name. + * @param {object=} params A param object, e.g. `{sectionId: section.id}`, + * that you'd like to test against the current active state. + * @param {object=} options An options object. The options are: + * + * - **`relative`** - {string|object=} - If `stateOrName` is a relative state reference and `options.relative` is set, + * .includes will test relative to `options.relative` state (or name). + * + * @returns {boolean} Returns true if it does include the state + */ + $state.includes = function includes(stateOrName, params, options) { + options = extend({ relative: $state.$current }, options || {}); + if (isString(stateOrName) && isGlob(stateOrName)) { + if (!doesStateMatchGlob(stateOrName)) { + return false; + } + stateOrName = $state.$current.name; + } + + var state = findState(stateOrName, options.relative); + if (!isDefined(state)) { return undefined; } + if (!isDefined($state.$current.includes[state.name])) { return false; } + return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true; + }; + + + /** + * @ngdoc function + * @name ui.router.state.$state#href + * @methodOf ui.router.state.$state + * + * @description + * A url generation method that returns the compiled url for the given state populated with the given params. + * + * @example + *
+     * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
+     * 
+ * + * @param {string|object} stateOrName The state name or state object you'd like to generate a url from. + * @param {object=} params An object of parameter values to fill the state's required parameters. + * @param {object=} options Options object. The options are: + * + * - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the + * first parameter, then the constructed href url will be built from the first navigable ancestor (aka + * ancestor with a valid url). + * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url. + * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), + * defines which state to be relative from. + * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". + * + * @returns {string} compiled state url + */ + $state.href = function href(stateOrName, params, options) { + options = extend({ + lossy: true, + inherit: true, + absolute: false, + relative: $state.$current + }, options || {}); + + var state = findState(stateOrName, options.relative); + + if (!isDefined(state)) return null; + if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state); + + var nav = (state && options.lossy) ? state.navigable : state; + + if (!nav || nav.url === undefined || nav.url === null) { + return null; + } + return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys().concat('#'), params || {}), { + absolute: options.absolute + }); + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#get + * @methodOf ui.router.state.$state + * + * @description + * Returns the state configuration object for any specific state or all states. + * + * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for + * the requested state. If not provided, returns an array of ALL state configs. + * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context. + * @returns {Object|Array} State configuration object or array of all objects. + */ + $state.get = function (stateOrName, context) { + if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; }); + var state = findState(stateOrName, context || $state.$current); + return (state && state.self) ? state.self : null; + }; + + function resolveState(state, params, paramsAreFiltered, inherited, dst, options) { + // Make a restricted $stateParams with only the parameters that apply to this state if + // necessary. In addition to being available to the controller and onEnter/onExit callbacks, + // we also need $stateParams to be available for any $injector calls we make during the + // dependency resolution process. + var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params); + var locals = { $stateParams: $stateParams }; + + // Resolve 'global' dependencies for the state, i.e. those not specific to a view. + // We're also including $stateParams in this; that way the parameters are restricted + // to the set that should be visible to the state, and are independent of when we update + // the global $state and $stateParams values. + dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state); + var promises = [dst.resolve.then(function (globals) { + dst.globals = globals; + })]; + if (inherited) promises.push(inherited); + + function resolveViews() { + var viewsPromises = []; + + // Resolve template and dependencies for all views. + forEach(state.views, function (view, name) { + var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {}); + injectables.$template = [ function () { + return $view.load(name, { view: view, locals: dst.globals, params: $stateParams, notify: options.notify }) || ''; + }]; + + viewsPromises.push($resolve.resolve(injectables, dst.globals, dst.resolve, state).then(function (result) { + // References to the controller (only instantiated at link time) + if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) { + var injectLocals = angular.extend({}, injectables, dst.globals); + result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals); + } else { + result.$$controller = view.controller; + } + // Provide access to the state itself for internal use + result.$$state = state; + result.$$controllerAs = view.controllerAs; + dst[name] = result; + })); + }); + + return $q.all(viewsPromises).then(function(){ + return dst.globals; + }); + } + + // Wait for all the promises and then return the activation object + return $q.all(promises).then(resolveViews).then(function (values) { + return dst; + }); + } + + return $state; + } + + function shouldSkipReload(to, toParams, from, fromParams, locals, options) { + // Return true if there are no differences in non-search (path/object) params, false if there are differences + function nonSearchParamsEqual(fromAndToState, fromParams, toParams) { + // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params. + function notSearchParam(key) { + return fromAndToState.params[key].location != "search"; + } + var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam); + var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys)); + var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams); + return nonQueryParamSet.$$equals(fromParams, toParams); + } + + // If reload was not explicitly requested + // and we're transitioning to the same state we're already in + // and the locals didn't change + // or they changed in a way that doesn't merit reloading + // (reloadOnParams:false, or reloadOnSearch.false and only search params changed) + // Then return true. + if (!options.reload && to === from && + (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) { + return true; + } + } +} + +angular.module('ui.router.state') + .factory('$stateParams', function () { return {}; }) + .provider('$state', $StateProvider); + + +$ViewProvider.$inject = []; +function $ViewProvider() { + + this.$get = $get; + /** + * @ngdoc object + * @name ui.router.state.$view + * + * @requires ui.router.util.$templateFactory + * @requires $rootScope + * + * @description + * + */ + $get.$inject = ['$rootScope', '$templateFactory']; + function $get( $rootScope, $templateFactory) { + return { + // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... }) + /** + * @ngdoc function + * @name ui.router.state.$view#load + * @methodOf ui.router.state.$view + * + * @description + * + * @param {string} name name + * @param {object} options option object. + */ + load: function load(name, options) { + var result, defaults = { + template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {} + }; + options = extend(defaults, options); + + if (options.view) { + result = $templateFactory.fromConfig(options.view, options.params, options.locals); + } + return result; + } + }; + } +} + +angular.module('ui.router.state').provider('$view', $ViewProvider); + +/** + * @ngdoc object + * @name ui.router.state.$uiViewScrollProvider + * + * @description + * Provider that returns the {@link ui.router.state.$uiViewScroll} service function. + */ +function $ViewScrollProvider() { + + var useAnchorScroll = false; + + /** + * @ngdoc function + * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll + * @methodOf ui.router.state.$uiViewScrollProvider + * + * @description + * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for + * scrolling based on the url anchor. + */ + this.useAnchorScroll = function () { + useAnchorScroll = true; + }; + + /** + * @ngdoc object + * @name ui.router.state.$uiViewScroll + * + * @requires $anchorScroll + * @requires $timeout + * + * @description + * When called with a jqLite element, it scrolls the element into view (after a + * `$timeout` so the DOM has time to refresh). + * + * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor, + * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}. + */ + this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) { + if (useAnchorScroll) { + return $anchorScroll; + } + + return function ($element) { + return $timeout(function () { + $element[0].scrollIntoView(); + }, 0, false); + }; + }]; +} + +angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider); + +var ngMajorVer = angular.version.major; +var ngMinorVer = angular.version.minor; +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-view + * + * @requires ui.router.state.$state + * @requires $compile + * @requires $controller + * @requires $injector + * @requires ui.router.state.$uiViewScroll + * @requires $document + * + * @restrict ECA + * + * @description + * The ui-view directive tells $state where to place your templates. + * + * @param {string=} name A view name. The name should be unique amongst the other views in the + * same state. You can have views of the same name that live in different states. + * + * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window + * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll + * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you + * scroll ui-view elements into view when they are populated during a state activation. + * + * @param {string=} noanimation If truthy, the non-animated renderer will be selected (no animations + * will be applied to the ui-view) + * + * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) + * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.* + * + * @param {string=} onload Expression to evaluate whenever the view updates. + * + * @example + * A view can be unnamed or named. + *
+ * 
+ * 
+ * + * + *
+ *
+ * + * You can only have one unnamed view within any template (or root html). If you are only using a + * single view and it is unnamed then you can populate it like so: + *
+ * 
+ * $stateProvider.state("home", { + * template: "

HELLO!

" + * }) + *
+ * + * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`} + * config property, by name, in this case an empty name: + *
+ * $stateProvider.state("home", {
+ *   views: {
+ *     "": {
+ *       template: "

HELLO!

" + * } + * } + * }) + *
+ * + * But typically you'll only use the views property if you name your view or have more than one view + * in the same template. There's not really a compelling reason to name a view if its the only one, + * but you could if you wanted, like so: + *
+ * 
+ *
+ *
+ * $stateProvider.state("home", {
+ *   views: {
+ *     "main": {
+ *       template: "

HELLO!

" + * } + * } + * }) + *
+ * + * Really though, you'll use views to set up multiple views: + *
+ * 
+ *
+ *
+ *
+ * + *
+ * $stateProvider.state("home", {
+ *   views: {
+ *     "": {
+ *       template: "

HELLO!

" + * }, + * "chart": { + * template: "" + * }, + * "data": { + * template: "" + * } + * } + * }) + *
+ * + * Examples for `autoscroll`: + * + *
+ * 
+ * 
+ *
+ * 
+ * 
+ * 
+ * 
+ * 
+ */ +$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate']; +function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate) { + + function getService() { + return ($injector.has) ? function(service) { + return $injector.has(service) ? $injector.get(service) : null; + } : function(service) { + try { + return $injector.get(service); + } catch (e) { + return null; + } + }; + } + + var service = getService(), + $animator = service('$animator'), + $animate = service('$animate'); + + // Returns a set of DOM manipulation functions based on which Angular version + // it should use + function getRenderer(attrs, scope) { + var statics = { + enter: function (element, target, cb) { target.after(element); cb(); }, + leave: function (element, cb) { element.remove(); cb(); } + }; + + if (!!attrs.noanimation) return statics; + + function animEnabled(element) { + if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element); + if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled(); + return (!!$animator); + } + + // ng 1.2+ + if ($animate) { + return { + enter: function(element, target, cb) { + if (!animEnabled(element)) { + statics.enter(element, target, cb); + } else if (angular.version.minor > 2) { + $animate.enter(element, null, target).then(cb); + } else { + $animate.enter(element, null, target, cb); + } + }, + leave: function(element, cb) { + if (!animEnabled(element)) { + statics.leave(element, cb); + } else if (angular.version.minor > 2) { + $animate.leave(element).then(cb); + } else { + $animate.leave(element, cb); + } + } + }; + } + + // ng 1.1.5 + if ($animator) { + var animate = $animator && $animator(scope, attrs); + + return { + enter: function(element, target, cb) {animate.enter(element, null, target); cb(); }, + leave: function(element, cb) { animate.leave(element); cb(); } + }; + } + + return statics; + } + + var directive = { + restrict: 'ECA', + terminal: true, + priority: 400, + transclude: 'element', + compile: function (tElement, tAttrs, $transclude) { + return function (scope, $element, attrs) { + var previousEl, currentEl, currentScope, latestLocals, + onloadExp = attrs.onload || '', + autoScrollExp = attrs.autoscroll, + renderer = getRenderer(attrs, scope); + + scope.$on('$stateChangeSuccess', function() { + updateView(false); + }); + + updateView(true); + + function cleanupLastView() { + var _previousEl = previousEl; + var _currentScope = currentScope; + + if (_currentScope) { + _currentScope._willBeDestroyed = true; + } + + function cleanOld() { + if (_previousEl) { + _previousEl.remove(); + } + + if (_currentScope) { + _currentScope.$destroy(); + } + } + + if (currentEl) { + renderer.leave(currentEl, function() { + cleanOld(); + previousEl = null; + }); + + previousEl = currentEl; + } else { + cleanOld(); + previousEl = null; + } + + currentEl = null; + currentScope = null; + } + + function updateView(firstTime) { + var newScope, + name = getUiViewName(scope, attrs, $element, $interpolate), + previousLocals = name && $state.$current && $state.$current.locals[name]; + + if (!firstTime && previousLocals === latestLocals || scope._willBeDestroyed) return; // nothing to do + newScope = scope.$new(); + latestLocals = $state.$current.locals[name]; + + /** + * @ngdoc event + * @name ui.router.state.directive:ui-view#$viewContentLoading + * @eventOf ui.router.state.directive:ui-view + * @eventType emits on ui-view directive scope + * @description + * + * Fired once the view **begins loading**, *before* the DOM is rendered. + * + * @param {Object} event Event object. + * @param {string} viewName Name of the view. + */ + newScope.$emit('$viewContentLoading', name); + + var clone = $transclude(newScope, function(clone) { + renderer.enter(clone, $element, function onUiViewEnter() { + if(currentScope) { + currentScope.$emit('$viewContentAnimationEnded'); + } + + if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) { + $uiViewScroll(clone); + } + }); + cleanupLastView(); + }); + + currentEl = clone; + currentScope = newScope; + /** + * @ngdoc event + * @name ui.router.state.directive:ui-view#$viewContentLoaded + * @eventOf ui.router.state.directive:ui-view + * @eventType emits on ui-view directive scope + * @description + * Fired once the view is **loaded**, *after* the DOM is rendered. + * + * @param {Object} event Event object. + * @param {string} viewName Name of the view. + */ + currentScope.$emit('$viewContentLoaded', name); + currentScope.$eval(onloadExp); + } + }; + } + }; + + return directive; +} + +$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate']; +function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) { + return { + restrict: 'ECA', + priority: -400, + compile: function (tElement) { + var initial = tElement.html(); + return function (scope, $element, attrs) { + var current = $state.$current, + name = getUiViewName(scope, attrs, $element, $interpolate), + locals = current && current.locals[name]; + + if (! locals) { + return; + } + + $element.data('$uiView', { name: name, state: locals.$$state }); + $element.html(locals.$template ? locals.$template : initial); + + var link = $compile($element.contents()); + + if (locals.$$controller) { + locals.$scope = scope; + locals.$element = $element; + var controller = $controller(locals.$$controller, locals); + if (locals.$$controllerAs) { + scope[locals.$$controllerAs] = controller; + } + $element.data('$ngControllerController', controller); + $element.children().data('$ngControllerController', controller); + } + + link(scope); + }; + } + }; +} + +/** + * Shared ui-view code for both directives: + * Given scope, element, and its attributes, return the view's name + */ +function getUiViewName(scope, attrs, element, $interpolate) { + var name = $interpolate(attrs.uiView || attrs.name || '')(scope); + var inherited = element.inheritedData('$uiView'); + return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : '')); +} + +angular.module('ui.router.state').directive('uiView', $ViewDirective); +angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill); + +function parseStateRef(ref, current) { + var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed; + if (preparsed) ref = current + '(' + preparsed[1] + ')'; + parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/); + if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'"); + return { state: parsed[1], paramExpr: parsed[3] || null }; +} + +function stateContext(el) { + var stateData = el.parent().inheritedData('$uiView'); + + if (stateData && stateData.state && stateData.state.name) { + return stateData.state; + } +} + +function getTypeInfo(el) { + // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. + var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]'; + var isForm = el[0].nodeName === "FORM"; + + return { + attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'), + isAnchor: el.prop("tagName").toUpperCase() === "A", + clickable: !isForm + }; +} + +function clickHook(el, $state, $timeout, type, current) { + return function(e) { + var button = e.which || e.button, target = current(); + + if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) { + // HACK: This is to allow ng-clicks to be processed before the transition is initiated: + var transition = $timeout(function() { + $state.go(target.state, target.params, target.options); + }); + e.preventDefault(); + + // if the state has no URL, ignore one preventDefault from the directive. + var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1: 0; + + e.preventDefault = function() { + if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition); + }; + } + }; +} + +function defaultOpts(el, $state) { + return { relative: stateContext(el) || $state.$current, inherit: true }; +} + +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-sref + * + * @requires ui.router.state.$state + * @requires $timeout + * + * @restrict A + * + * @description + * A directive that binds a link (`` tag) to a state. If the state has an associated + * URL, the directive will automatically generate & update the `href` attribute via + * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking + * the link will trigger a state transition with optional parameters. + * + * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be + * handled natively by the browser. + * + * You can also use relative state paths within ui-sref, just like the relative + * paths passed to `$state.go()`. You just need to be aware that the path is relative + * to the state that the link lives in, in other words the state that loaded the + * template containing the link. + * + * You can specify options to pass to {@link ui.router.state.$state#go $state.go()} + * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`, + * and `reload`. + * + * @example + * Here's an example of how you'd use ui-sref and how it would compile. If you have the + * following template: + *
+ * Home | About | Next page
+ *
+ * 
+ * 
+ * + * Then the compiled html would be (assuming Html5Mode is off and current state is contacts): + *
+ * Home | About | Next page
+ *
+ * 
    + *
  • + * Joe + *
  • + *
  • + * Alice + *
  • + *
  • + * Bob + *
  • + *
+ * + * Home + *
+ * + * @param {string} ui-sref 'stateName' can be any valid absolute or relative state + * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()} + */ +$StateRefDirective.$inject = ['$state', '$timeout']; +function $StateRefDirective($state, $timeout) { + return { + restrict: 'A', + require: ['?^uiSrefActive', '?^uiSrefActiveEq'], + link: function(scope, element, attrs, uiSrefActive) { + var ref = parseStateRef(attrs.uiSref, $state.current.name); + var def = { state: ref.state, href: null, params: null }; + var type = getTypeInfo(element); + var active = uiSrefActive[1] || uiSrefActive[0]; + + def.options = extend(defaultOpts(element, $state), attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {}); + + var update = function(val) { + if (val) def.params = angular.copy(val); + def.href = $state.href(ref.state, def.params, def.options); + + if (active) active.$$addStateInfo(ref.state, def.params); + if (def.href !== null) attrs.$set(type.attr, def.href); + }; + + if (ref.paramExpr) { + scope.$watch(ref.paramExpr, function(val) { if (val !== def.params) update(val); }, true); + def.params = angular.copy(scope.$eval(ref.paramExpr)); + } + update(); + + if (!type.clickable) return; + element.bind("click", clickHook(element, $state, $timeout, type, function() { return def; })); + } + }; +} + +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-state + * + * @requires ui.router.state.uiSref + * + * @restrict A + * + * @description + * Much like ui-sref, but will accept named $scope properties to evaluate for a state definition, + * params and override options. + * + * @param {string} ui-state 'stateName' can be any valid absolute or relative state + * @param {Object} ui-state-params params to pass to {@link ui.router.state.$state#href $state.href()} + * @param {Object} ui-state-opts options to pass to {@link ui.router.state.$state#go $state.go()} + */ +$StateRefDynamicDirective.$inject = ['$state', '$timeout']; +function $StateRefDynamicDirective($state, $timeout) { + return { + restrict: 'A', + require: ['?^uiSrefActive', '?^uiSrefActiveEq'], + link: function(scope, element, attrs, uiSrefActive) { + var type = getTypeInfo(element); + var active = uiSrefActive[1] || uiSrefActive[0]; + var group = [attrs.uiState, attrs.uiStateParams || null, attrs.uiStateOpts || null]; + var watch = '[' + group.map(function(val) { return val || 'null'; }).join(', ') + ']'; + var def = { state: null, params: null, options: null, href: null }; + + function runStateRefLink (group) { + def.state = group[0]; def.params = group[1]; def.options = group[2]; + def.href = $state.href(def.state, def.params, def.options); + + if (active) active.$$addStateInfo(def.state, def.params); + if (def.href) attrs.$set(type.attr, def.href); + } + + scope.$watch(watch, runStateRefLink, true); + runStateRefLink(scope.$eval(watch)); + + if (!type.clickable) return; + element.bind("click", clickHook(element, $state, $timeout, type, function() { return def; })); + } + }; +} + + +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-sref-active + * + * @requires ui.router.state.$state + * @requires ui.router.state.$stateParams + * @requires $interpolate + * + * @restrict A + * + * @description + * A directive working alongside ui-sref to add classes to an element when the + * related ui-sref directive's state is active, and removing them when it is inactive. + * The primary use-case is to simplify the special appearance of navigation menus + * relying on `ui-sref`, by having the "active" state's menu button appear different, + * distinguishing it from the inactive menu items. + * + * ui-sref-active can live on the same element as ui-sref or on a parent element. The first + * ui-sref-active found at the same level or above the ui-sref will be used. + * + * Will activate when the ui-sref's target state or any child state is active. If you + * need to activate only when the ui-sref target state is active and *not* any of + * it's children, then you will use + * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq} + * + * @example + * Given the following template: + *
+ * 
+ * 
+ * + * + * When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins", + * the resulting HTML will appear as (note the 'active' class): + *
+ * 
+ * 
+ * + * The class name is interpolated **once** during the directives link time (any further changes to the + * interpolated value are ignored). + * + * Multiple classes may be specified in a space-separated format: + *
+ * 
    + *
  • + * link + *
  • + *
+ *
+ * + * It is also possible to pass ui-sref-active an expression that evaluates + * to an object hash, whose keys represent active class names and whose + * values represent the respective state names/globs. + * ui-sref-active will match if the current active state **includes** any of + * the specified state names/globs, even the abstract ones. + * + * @Example + * Given the following template, with "admin" being an abstract state: + *
+ * 
+ * Roles + *
+ *
+ * + * When the current state is "admin.roles" the "active" class will be applied + * to both the
and elements. It is important to note that the state + * names/globs passed to ui-sref-active shadow the state provided by ui-sref. + */ + +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-sref-active-eq + * + * @requires ui.router.state.$state + * @requires ui.router.state.$stateParams + * @requires $interpolate + * + * @restrict A + * + * @description + * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate + * when the exact target state used in the `ui-sref` is active; no child states. + * + */ +$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate']; +function $StateRefActiveDirective($state, $stateParams, $interpolate) { + return { + restrict: "A", + controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) { + var states = [], activeClasses = {}, activeEqClass, uiSrefActive; + + // There probably isn't much point in $observing this + // uiSrefActive and uiSrefActiveEq share the same directive object with some + // slight difference in logic routing + activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope); + + try { + uiSrefActive = $scope.$eval($attrs.uiSrefActive); + } catch (e) { + // Do nothing. uiSrefActive is not a valid expression. + // Fall back to using $interpolate below + } + uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope); + if (isObject(uiSrefActive)) { + forEach(uiSrefActive, function(stateOrName, activeClass) { + if (isString(stateOrName)) { + var ref = parseStateRef(stateOrName, $state.current.name); + addState(ref.state, $scope.$eval(ref.paramExpr), activeClass); + } + }); + } + + // Allow uiSref to communicate with uiSrefActive[Equals] + this.$$addStateInfo = function (newState, newParams) { + // we already got an explicit state provided by ui-sref-active, so we + // shadow the one that comes from ui-sref + if (isObject(uiSrefActive) && states.length > 0) { + return; + } + addState(newState, newParams, uiSrefActive); + update(); + }; + + $scope.$on('$stateChangeSuccess', update); + + function addState(stateName, stateParams, activeClass) { + var state = $state.get(stateName, stateContext($element)); + var stateHash = createStateHash(stateName, stateParams); + + states.push({ + state: state || { name: stateName }, + params: stateParams, + hash: stateHash + }); + + activeClasses[stateHash] = activeClass; + } + + /** + * @param {string} state + * @param {Object|string} [params] + * @return {string} + */ + function createStateHash(state, params) { + if (!isString(state)) { + throw new Error('state should be a string'); + } + if (isObject(params)) { + return state + toJson(params); + } + params = $scope.$eval(params); + if (isObject(params)) { + return state + toJson(params); + } + return state; + } + + // Update route state + function update() { + for (var i = 0; i < states.length; i++) { + if (anyMatch(states[i].state, states[i].params)) { + addClass($element, activeClasses[states[i].hash]); + } else { + removeClass($element, activeClasses[states[i].hash]); + } + + if (exactMatch(states[i].state, states[i].params)) { + addClass($element, activeEqClass); + } else { + removeClass($element, activeEqClass); + } + } + } + + function addClass(el, className) { $timeout(function () { el.addClass(className); }); } + function removeClass(el, className) { el.removeClass(className); } + function anyMatch(state, params) { return $state.includes(state.name, params); } + function exactMatch(state, params) { return $state.is(state.name, params); } + + update(); + }] + }; +} + +angular.module('ui.router.state') + .directive('uiSref', $StateRefDirective) + .directive('uiSrefActive', $StateRefActiveDirective) + .directive('uiSrefActiveEq', $StateRefActiveDirective) + .directive('uiState', $StateRefDynamicDirective); + +/** + * @ngdoc filter + * @name ui.router.state.filter:isState + * + * @requires ui.router.state.$state + * + * @description + * Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}. + */ +$IsStateFilter.$inject = ['$state']; +function $IsStateFilter($state) { + var isFilter = function (state, params) { + return $state.is(state, params); + }; + isFilter.$stateful = true; + return isFilter; +} + +/** + * @ngdoc filter + * @name ui.router.state.filter:includedByState + * + * @requires ui.router.state.$state + * + * @description + * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}. + */ +$IncludedByStateFilter.$inject = ['$state']; +function $IncludedByStateFilter($state) { + var includesFilter = function (state, params, options) { + return $state.includes(state, params, options); + }; + includesFilter.$stateful = true; + return includesFilter; +} + +angular.module('ui.router.state') + .filter('isState', $IsStateFilter) + .filter('includedByState', $IncludedByStateFilter); +})(window, window.angular); \ No newline at end of file diff --git a/afb-client/bower_components/angular-ui-router/release/angular-ui-router.min.js b/afb-client/bower_components/angular-ui-router/release/angular-ui-router.min.js new file mode 100644 index 0000000..f1b0e35 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/release/angular-ui-router.min.js @@ -0,0 +1,8 @@ +/** + * State-based routing for AngularJS + * @version v0.2.18 + * @link http://angular-ui.github.com/ + * @license MIT License, http://www.opensource.org/licenses/MIT + */ +"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return R(new(R(function(){},{prototype:a})),b)}function e(a){return Q(arguments,function(b){b!==a&&Q(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return Q(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l]&&i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return R({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(s[c]=d,N(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);Q(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return O(a)&&a.then&&a.$$promises}if(!O(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return Q(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!L(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;Q(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!O(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=R({},d),u=1+q.length/3,v=!1;if(L(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),R(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;x>w;w+=3)d.hasOwnProperty(q[w])?h():j(q[w],q[w+1],q[w+2]);return r}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function q(a,b,c){this.fromConfig=function(a,b,c){return L(a.template)?this.fromString(a.template,b):L(a.templateUrl)?this.fromUrl(a.templateUrl,b):L(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return M(a)?a(b):a},this.fromUrl=function(c,d){return M(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function r(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new U.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:f=f.replace(/\/$/,""),e=["(?:/(",")|/)?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),h&&(j=U.type(h)||d(U.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)})),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=R({params:{}},O(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new U.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function s(a){R(this,a)}function t(){function a(a){return null!=a?a.toString().replace(/~/g,"~~").replace(/\//g,"~2F"):a}function e(a){return null!=a?a.toString().replace(/~2F/g,"/").replace(/~~/g,"~"):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return M(a)||P(a)&&M(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(u[a.name],l.invoke(a.def))}}function k(a){R(this,a||{})}U=this;var l,m=!1,p=!0,q=!1,u={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!L(a)||"string"==typeof a},pattern:/[^\/]*/},"int":{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return L(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};t.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return L(a)&&(m=a),m},this.strictMode=function(a){return L(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!L(a))return q;if(a!==!0&&a!==!1&&!N(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new r(a,R(f(),b))},this.isMatcher=function(a){if(!O(a))return!1;var b=!0;return Q(r.prototype,function(c,d){M(c)&&(b=b&&L(a[d])&&M(a[d]))}),b},this.type=function(a,b,c){if(!L(b))return u[a];if(u.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return u[a]=new s(R({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},Q(x,function(a,b){u[b]=new s(R({name:b},a))}),u=d(u,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),Q(x,function(a,b){u[b]||(u[b]=new s(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=O(a)?g(a):[],c=-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array");return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?u[c.type]:c.type instanceof s?c.type:new s(c.type):"config"===e?u.any:u.string}function m(){var b={array:"search"===f?"auto":!1},c=a.match(/\[\]$/)?{array:!0}:{};return R(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!L(c)||null==c)return q;if(c===!0||N(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function r(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=P(a.replace)?a.replace:[],N(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function t(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),L(a)?x.type.$normalize(a):t()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=r(e,y,z,A);R(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,R(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),Q(b,function(b){Q(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return Q(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return Q(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;de;e++)if(b(j[e]))return;k&&b(k)}}function o(){return i=i||e.$on("$locationChangeSuccess",n)}var p,q=g.baseHref(),r=d.url();return l||o(),{sync:function(){n()},listen:function(){return o()},update:function(a){return a?void(r=d.url()):void(d.url()!==r&&(d.url(r),d.replace()))},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),p=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled),g=g&&h.history;var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=m(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!M(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(N(a)){var b=a;a=function(){return b}}else if(!M(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=N(b);if(N(a)&&(a=d.compile(a)),!h&&!M(b)&&!P(b))throw new Error("invalid 'handler' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),R(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:N(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),R(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}function v(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=N(a),e=d?a:a.name,g=f(e);if(g){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=z[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function n(a,b){A[a]||(A[a]=[]),A[a].push(b)}function p(a){for(var b=A[a]||[];b.length;)q(b.shift())}function q(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!N(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(z.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):N(b.parent)?b.parent:O(b.parent)&&N(b.parent.name)?b.parent.name:"";if(e&&!z[e])return n(e,b.self);for(var f in C)M(C[f])&&(b[f]=C[f](b,C.$delegates[f]));return z[c]=b,!b[B]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){y.$current.navigable==b&&j(a,c)||y.transitionTo(b,a,{inherit:!0,location:!1})}]),p(c),b}function r(a){return a.indexOf("*")>-1}function s(a){for(var b=a.split("."),c=y.$current.name.split("."),d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length?!1:c.join("")===b.join("")}function t(a,b){return N(a)&&!L(b)?C[a]:M(b)&&N(a)?(C[a]&&!C.$delegates[a]&&(C.$delegates[a]=C[a]),C[a]=b,this):this}function u(a,b){return O(a)?b=a:b.name=a,q(b),this}function v(a,e,f,h,l,n,p,q,t){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return p.update(),D;if(!g.retry)return null;if(f.$retry)return p.update(),E;var h=y.transition=e.when(g.retry);return h.then(function(){return h!==y.transition?A:(b.options.$retry=!0,y.transitionTo(b.to,b.toParams,b.options))},function(){return D}),p.update(),h}function v(a,c,d,g,i,j){function m(){var c=[];return Q(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:j.notify})||""}],c.push(l.resolve(g,i.globals,i.resolve,a).then(function(c){if(M(d.controllerProvider)||P(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=l.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var A=e.reject(new Error("transition superseded")),C=e.reject(new Error("transition prevented")),D=e.reject(new Error("transition aborted")),E=e.reject(new Error("transition failed"));return x.locals={resolve:null,globals:{$stateParams:{}}},y={params:{},current:x.self,$current:x,transition:null},y.reload=function(a){return y.transitionTo(y.current,n,{reload:a||!0,inherit:!1,notify:!0})},y.go=function(a,b,c){return y.transitionTo(a,b,R({inherit:!0,relative:y.$current},c))},y.transitionTo=function(b,c,f){c=c||{},f=R({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=y.$current,l=y.params,o=j.path,q=m(b,f.relative),r=c["#"];if(!L(q)){var s={to:b,toParams:c,options:f},t=u(s,j.self,l,f);if(t)return t;if(b=s.to,c=s.toParams,f=s.options,q=m(b,f.relative),!L(q)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(q[B])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(n,c||{},y.$current,q)),!q.params.$$validates(c))return E;c=q.params.$$values(c),b=q;var z=b.path,D=0,F=z[D],G=x.locals,H=[];if(f.reload){if(N(f.reload)||O(f.reload)){if(O(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var I=f.reload===!0?o[0]:m(f.reload);if(f.reload&&!I)throw new Error("No such reload state '"+(N(f.reload)?f.reload:f.reload.name)+"'");for(;F&&F===o[D]&&F!==I;)G=H[D]=F.locals,D++,F=z[D]}}else for(;F&&F===o[D]&&F.ownParams.$$equals(c,l);)G=H[D]=F.locals,D++,F=z[D];if(w(b,c,j,l,G,f))return r&&(c["#"]=r),y.params=c,S(y.params,n),S(k(b.params.$$keys(),n),b.locals.globals.$stateParams),f.location&&b.navigable&&b.navigable.url&&(p.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),p.update(!0)),y.transition=null,e.when(y.current);if(c=k(b.params.$$keys(),c||{}),r&&(c["#"]=r),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,l,f).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,l),null==y.transition&&p.update(),C;for(var J=e.when(G),K=D;K=D;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=D;d=4?!!j.enabled(a):1===V&&W>=2?!!j.enabled():!!i}var e={enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}};if(a.noanimation)return e;if(j)return{enter:function(a,c,f){d(a)?b.version.minor>2?j.enter(a,null,c).then(f):j.enter(a,null,c,f):e.enter(a,c,f)},leave:function(a,c){d(a)?b.version.minor>2?j.leave(a).then(c):j.leave(a,c):e.leave(a,c)}};if(i){var f=i&&i(c,a);return{enter:function(a,b,c){f.enter(a,null,b),c()},leave:function(a,b){f.leave(a),b()}}}return e}var h=f(),i=h("$animator"),j=h("$animate"),k={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,f,h){return function(c,f,i){function j(){function a(){b&&b.remove(),c&&c.$destroy()}var b=l,c=n;c&&(c._willBeDestroyed=!0),m?(r.leave(m,function(){a(),l=null}),l=m):(a(),l=null),m=null,n=null}function k(g){var k,l=A(c,i,f,e),s=l&&a.$current&&a.$current.locals[l];if((g||s!==o)&&!c._willBeDestroyed){k=c.$new(),o=a.$current.locals[l],k.$emit("$viewContentLoading",l);var t=h(k,function(a){r.enter(a,f,function(){n&&n.$emit("$viewContentAnimationEnded"),(b.isDefined(q)&&!q||c.$eval(q))&&d(a)}),j()});m=t,n=k,n.$emit("$viewContentLoaded",l),n.$eval(p)}}var l,m,n,o,p=i.onload||"",q=i.autoscroll,r=g(i,c);c.$on("$stateChangeSuccess",function(){k(!1)}),k(!0)}}};return k}function z(a,b,c,d){return{restrict:"ECA",priority:-400,compile:function(e){var f=e.html();return function(e,g,h){var i=c.$current,j=A(e,h,g,d),k=i&&i.locals[j];if(k){g.data("$uiView",{name:j,state:k.$$state}),g.html(k.$template?k.$template:f);var l=a(g.contents());if(k.$$controller){k.$scope=e,k.$element=g;var m=b(k.$$controller,k);k.$$controllerAs&&(e[k.$$controllerAs]=m),g.data("$ngControllerController",m),g.children().data("$ngControllerController",m)}l(e)}}}}}function A(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function B(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function C(a){var b=a.parent().inheritedData("$uiView");return b&&b.state&&b.state.name?b.state:void 0}function D(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function E(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function F(a,b){return{relative:C(a)||b.$current,inherit:!0}}function G(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h=B(f.uiSref,a.current.name),i={state:h.state,href:null,params:null},j=D(e),k=g[1]||g[0];i.options=R(F(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var l=function(c){c&&(i.params=b.copy(c)),i.href=a.href(h.state,i.params,i.options),k&&k.$$addStateInfo(h.state,i.params),null!==i.href&&f.$set(j.attr,i.href)};h.paramExpr&&(d.$watch(h.paramExpr,function(a){a!==i.params&&l(a)},!0),i.params=b.copy(d.$eval(h.paramExpr))),l(),j.clickable&&e.bind("click",E(e,a,c,j,function(){return i}))}}}function H(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){l.state=b[0],l.params=b[1],l.options=b[2],l.href=a.href(l.state,l.params,l.options),i&&i.$$addStateInfo(l.state,l.params),l.href&&e.$set(h.attr,l.href)}var h=D(d),i=f[1]||f[0],j=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],k="["+j.map(function(a){return a||"null"}).join(", ")+"]",l={state:null,params:null,options:null,href:null};c.$watch(k,g,!0),g(c.$eval(k)),h.clickable&&d.bind("click",E(d,a,b,h,function(){return l}))}}}function I(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,C(d)),g=h(b,c);p.push({state:f||{name:b},params:c,hash:g}),q[g]=e}function h(a,c){if(!N(a))throw new Error("state should be a string");return O(c)?a+T(c):(c=b.$eval(c),O(c)?a+T(c):a)}function i(){for(var a=0;a0||(g(a,b,o),i())},b.$on("$stateChangeSuccess",i),i()}]}}function J(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function K(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var L=b.isDefined,M=b.isFunction,N=b.isString,O=b.isObject,P=b.isArray,Q=b.forEach,R=b.extend,S=b.copy,T=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),p.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",p),q.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",q);var U;r.prototype.concat=function(a,b){var c={caseInsensitive:U.caseInsensitive(),strict:U.strictMode(),squash:U.defaultSquashPolicy()};return new r(this.sourcePath+a+this.sourceSearch,R(c,b),this)},r.prototype.toString=function(){return this.source},r.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;j>e;e++){for(g=h[e],l=this.params[g],m=d[e+1],f=0;fe;e++){for(g=h[e],k[g]=this.params[g].value(b[g]),l=this.params[g],m=b[g],f=0;ff;f++){var k=h>f,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=p?m.squash:!1,r=m.type.encode(n);if(k){var s=c[f+1],t=f+1===h;if(q===!1)null!=r&&(j+=P(r)?o(r,b).join("-"):encodeURIComponent(r)),j+=s;else if(q===!0){var u=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(u)[1]}else N(q)&&(j+=q+s);t&&m.squash===!0&&"/"===j.slice(-1)&&(j=j.slice(0,-1))}else{if(null==r||p&&q!==!1)continue;if(P(r)||(r=[r]),0===r.length)continue;r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+(l+"="+r),g=!0}}return j},s.prototype.is=function(a,b){return!0},s.prototype.encode=function(a,b){return a},s.prototype.decode=function(a,b){return a},s.prototype.equals=function(a,b){return a==b},s.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},s.prototype.pattern=/.*/,s.prototype.toString=function(){return"{Type:"+this.name+"}"},s.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},s.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return P(a)?a:L(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){if(P(c)&&0===c.length)return c;c=e(c);var d=o(c,a);return b===!0?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;for(var g=0;g>> 0, from = Number(arguments[2]) || 0; + from = (from < 0) ? Math.ceil(from) : Math.floor(from); + + if (from < 0) from += len; + + for (; from < len; from++) { + if (from in array && array[from] === value) return from; + } + return -1; +} + +/** + * Merges a set of parameters with all parameters inherited between the common parents of the + * current state and a given destination state. + * + * @param {Object} currentParams The value of the current state parameters ($stateParams). + * @param {Object} newParams The set of parameters which will be composited with inherited params. + * @param {Object} $current Internal definition of object representing the current state. + * @param {Object} $to Internal definition of object representing state to transition to. + */ +function inheritParams(currentParams, newParams, $current, $to) { + var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = []; + + for (var i in parents) { + if (!parents[i] || !parents[i].params) continue; + parentParams = objectKeys(parents[i].params); + if (!parentParams.length) continue; + + for (var j in parentParams) { + if (indexOf(inheritList, parentParams[j]) >= 0) continue; + inheritList.push(parentParams[j]); + inherited[parentParams[j]] = currentParams[parentParams[j]]; + } + } + return extend({}, inherited, newParams); +} + +/** + * Performs a non-strict comparison of the subset of two objects, defined by a list of keys. + * + * @param {Object} a The first object. + * @param {Object} b The second object. + * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified, + * it defaults to the list of keys in `a`. + * @return {Boolean} Returns `true` if the keys match, otherwise `false`. + */ +function equalForKeys(a, b, keys) { + if (!keys) { + keys = []; + for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility + } + + for (var i=0; i + * + * + * + * + * + * + * + * + * + * + * + * + */ +angular.module('ui.router', ['ui.router.state']); + +angular.module('ui.router.compat', ['ui.router']); diff --git a/afb-client/bower_components/angular-ui-router/src/resolve.js b/afb-client/bower_components/angular-ui-router/src/resolve.js new file mode 100644 index 0000000..019338d --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/resolve.js @@ -0,0 +1,252 @@ +/** + * @ngdoc object + * @name ui.router.util.$resolve + * + * @requires $q + * @requires $injector + * + * @description + * Manages resolution of (acyclic) graphs of promises. + */ +$Resolve.$inject = ['$q', '$injector']; +function $Resolve( $q, $injector) { + + var VISIT_IN_PROGRESS = 1, + VISIT_DONE = 2, + NOTHING = {}, + NO_DEPENDENCIES = [], + NO_LOCALS = NOTHING, + NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING }); + + + /** + * @ngdoc function + * @name ui.router.util.$resolve#study + * @methodOf ui.router.util.$resolve + * + * @description + * Studies a set of invocables that are likely to be used multiple times. + *
+   * $resolve.study(invocables)(locals, parent, self)
+   * 
+ * is equivalent to + *
+   * $resolve.resolve(invocables, locals, parent, self)
+   * 
+ * but the former is more efficient (in fact `resolve` just calls `study` + * internally). + * + * @param {object} invocables Invocable objects + * @return {function} a function to pass in locals, parent and self + */ + this.study = function (invocables) { + if (!isObject(invocables)) throw new Error("'invocables' must be an object"); + var invocableKeys = objectKeys(invocables || {}); + + // Perform a topological sort of invocables to build an ordered plan + var plan = [], cycle = [], visited = {}; + function visit(value, key) { + if (visited[key] === VISIT_DONE) return; + + cycle.push(key); + if (visited[key] === VISIT_IN_PROGRESS) { + cycle.splice(0, indexOf(cycle, key)); + throw new Error("Cyclic dependency: " + cycle.join(" -> ")); + } + visited[key] = VISIT_IN_PROGRESS; + + if (isString(value)) { + plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES); + } else { + var params = $injector.annotate(value); + forEach(params, function (param) { + if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param); + }); + plan.push(key, value, params); + } + + cycle.pop(); + visited[key] = VISIT_DONE; + } + forEach(invocables, visit); + invocables = cycle = visited = null; // plan is all that's required + + function isResolve(value) { + return isObject(value) && value.then && value.$$promises; + } + + return function (locals, parent, self) { + if (isResolve(locals) && self === undefined) { + self = parent; parent = locals; locals = null; + } + if (!locals) locals = NO_LOCALS; + else if (!isObject(locals)) { + throw new Error("'locals' must be an object"); + } + if (!parent) parent = NO_PARENT; + else if (!isResolve(parent)) { + throw new Error("'parent' must be a promise returned by $resolve.resolve()"); + } + + // To complete the overall resolution, we have to wait for the parent + // promise and for the promise for each invokable in our plan. + var resolution = $q.defer(), + result = resolution.promise, + promises = result.$$promises = {}, + values = extend({}, locals), + wait = 1 + plan.length/3, + merged = false; + + function done() { + // Merge parent values we haven't got yet and publish our own $$values + if (!--wait) { + if (!merged) merge(values, parent.$$values); + result.$$values = values; + result.$$promises = result.$$promises || true; // keep for isResolve() + delete result.$$inheritedValues; + resolution.resolve(values); + } + } + + function fail(reason) { + result.$$failure = reason; + resolution.reject(reason); + } + + // Short-circuit if parent has already failed + if (isDefined(parent.$$failure)) { + fail(parent.$$failure); + return result; + } + + if (parent.$$inheritedValues) { + merge(values, omit(parent.$$inheritedValues, invocableKeys)); + } + + // Merge parent values if the parent has already resolved, or merge + // parent promises and wait if the parent resolve is still in progress. + extend(promises, parent.$$promises); + if (parent.$$values) { + merged = merge(values, omit(parent.$$values, invocableKeys)); + result.$$inheritedValues = omit(parent.$$values, invocableKeys); + done(); + } else { + if (parent.$$inheritedValues) { + result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys); + } + parent.then(done, fail); + } + + // Process each invocable in the plan, but ignore any where a local of the same name exists. + for (var i=0, ii=plan.length; i= 0) throw new Error("State must have a valid name"); + if (states.hasOwnProperty(name)) throw new Error("State '" + name + "' is already defined"); + + // Get parent name + var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.')) + : (isString(state.parent)) ? state.parent + : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name + : ''; + + // If parent is not registered yet, add state to queue and register later + if (parentName && !states[parentName]) { + return queueState(parentName, state.self); + } + + for (var key in stateBuilder) { + if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]); + } + states[name] = state; + + // Register the state in the global state list and with $urlRouter if necessary. + if (!state[abstractKey] && state.url) { + $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) { + if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) { + $state.transitionTo(state, $match, { inherit: true, location: false }); + } + }]); + } + + // Register any queued children + flushQueuedChildren(name); + + return state; + } + + // Checks text to see if it looks like a glob. + function isGlob (text) { + return text.indexOf('*') > -1; + } + + // Returns true if glob matches current $state name. + function doesStateMatchGlob (glob) { + var globSegments = glob.split('.'), + segments = $state.$current.name.split('.'); + + //match single stars + for (var i = 0, l = globSegments.length; i < l; i++) { + if (globSegments[i] === '*') { + segments[i] = '*'; + } + } + + //match greedy starts + if (globSegments[0] === '**') { + segments = segments.slice(indexOf(segments, globSegments[1])); + segments.unshift('**'); + } + //match greedy ends + if (globSegments[globSegments.length - 1] === '**') { + segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE); + segments.push('**'); + } + + if (globSegments.length != segments.length) { + return false; + } + + return segments.join('') === globSegments.join(''); + } + + + // Implicit root state that is always active + root = registerState({ + name: '', + url: '^', + views: null, + 'abstract': true + }); + root.navigable = null; + + + /** + * @ngdoc function + * @name ui.router.state.$stateProvider#decorator + * @methodOf ui.router.state.$stateProvider + * + * @description + * Allows you to extend (carefully) or override (at your own peril) the + * `stateBuilder` object used internally by `$stateProvider`. This can be used + * to add custom functionality to ui-router, for example inferring templateUrl + * based on the state name. + * + * When passing only a name, it returns the current (original or decorated) builder + * function that matches `name`. + * + * The builder functions that can be decorated are listed below. Though not all + * necessarily have a good use case for decoration, that is up to you to decide. + * + * In addition, users can attach custom decorators, which will generate new + * properties within the state's internal definition. There is currently no clear + * use-case for this beyond accessing internal states (i.e. $state.$current), + * however, expect this to become increasingly relevant as we introduce additional + * meta-programming features. + * + * **Warning**: Decorators should not be interdependent because the order of + * execution of the builder functions in non-deterministic. Builder functions + * should only be dependent on the state definition object and super function. + * + * + * Existing builder functions and current return values: + * + * - **parent** `{object}` - returns the parent state object. + * - **data** `{object}` - returns state data, including any inherited data that is not + * overridden by own values (if any). + * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher} + * or `null`. + * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is + * navigable). + * - **params** `{object}` - returns an array of state params that are ensured to + * be a super-set of parent's params. + * - **views** `{object}` - returns a views object where each key is an absolute view + * name (i.e. "viewName@stateName") and each value is the config object + * (template, controller) for the view. Even when you don't use the views object + * explicitly on a state config, one is still created for you internally. + * So by decorating this builder function you have access to decorating template + * and controller properties. + * - **ownParams** `{object}` - returns an array of params that belong to the state, + * not including any params defined by ancestor states. + * - **path** `{string}` - returns the full path from the root down to this state. + * Needed for state activation. + * - **includes** `{object}` - returns an object that includes every state that + * would pass a `$state.includes()` test. + * + * @example + *
+   * // Override the internal 'views' builder with a function that takes the state
+   * // definition, and a reference to the internal function being overridden:
+   * $stateProvider.decorator('views', function (state, parent) {
+   *   var result = {},
+   *       views = parent(state);
+   *
+   *   angular.forEach(views, function (config, name) {
+   *     var autoName = (state.name + '.' + name).replace('.', '/');
+   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
+   *     result[name] = config;
+   *   });
+   *   return result;
+   * });
+   *
+   * $stateProvider.state('home', {
+   *   views: {
+   *     'contact.list': { controller: 'ListController' },
+   *     'contact.item': { controller: 'ItemController' }
+   *   }
+   * });
+   *
+   * // ...
+   *
+   * $state.go('home');
+   * // Auto-populates list and item views with /partials/home/contact/list.html,
+   * // and /partials/home/contact/item.html, respectively.
+   * 
+ * + * @param {string} name The name of the builder function to decorate. + * @param {object} func A function that is responsible for decorating the original + * builder function. The function receives two parameters: + * + * - `{object}` - state - The state config object. + * - `{object}` - super - The original builder function. + * + * @return {object} $stateProvider - $stateProvider instance + */ + this.decorator = decorator; + function decorator(name, func) { + /*jshint validthis: true */ + if (isString(name) && !isDefined(func)) { + return stateBuilder[name]; + } + if (!isFunction(func) || !isString(name)) { + return this; + } + if (stateBuilder[name] && !stateBuilder.$delegates[name]) { + stateBuilder.$delegates[name] = stateBuilder[name]; + } + stateBuilder[name] = func; + return this; + } + + /** + * @ngdoc function + * @name ui.router.state.$stateProvider#state + * @methodOf ui.router.state.$stateProvider + * + * @description + * Registers a state configuration under a given state name. The stateConfig object + * has the following acceptable properties. + * + * @param {string} name A unique state name, e.g. "home", "about", "contacts". + * To create a parent/child state use a dot, e.g. "about.sales", "home.newest". + * @param {object} stateConfig State configuration object. + * @param {string|function=} stateConfig.template + *
+ * html template as a string or a function that returns + * an html template as a string which should be used by the uiView directives. This property + * takes precedence over templateUrl. + * + * If `template` is a function, it will be called with the following parameters: + * + * - {array.<object>} - state parameters extracted from the current $location.path() by + * applying the current state + * + *
template:
+   *   "

inline template definition

" + + * "
"
+ *
template: function(params) {
+   *       return "

generated template

"; }
+ *
+ * + * @param {string|function=} stateConfig.templateUrl + * + * + * path or function that returns a path to an html + * template that should be used by uiView. + * + * If `templateUrl` is a function, it will be called with the following parameters: + * + * - {array.<object>} - state parameters extracted from the current $location.path() by + * applying the current state + * + *
templateUrl: "home.html"
+ *
templateUrl: function(params) {
+   *     return myTemplates[params.pageId]; }
+ * + * @param {function=} stateConfig.templateProvider + * + * Provider function that returns HTML content string. + *
 templateProvider:
+   *       function(MyTemplateService, params) {
+   *         return MyTemplateService.getTemplate(params.pageId);
+   *       }
+ * + * @param {string|function=} stateConfig.controller + * + * + * Controller fn that should be associated with newly + * related scope or the name of a registered controller if passed as a string. + * Optionally, the ControllerAs may be declared here. + *
controller: "MyRegisteredController"
+ *
controller:
+   *     "MyRegisteredController as fooCtrl"}
+ *
controller: function($scope, MyService) {
+   *     $scope.data = MyService.getData(); }
+ * + * @param {function=} stateConfig.controllerProvider + * + * + * Injectable provider function that returns the actual controller or string. + *
controllerProvider:
+   *   function(MyResolveData) {
+   *     if (MyResolveData.foo)
+   *       return "FooCtrl"
+   *     else if (MyResolveData.bar)
+   *       return "BarCtrl";
+   *     else return function($scope) {
+   *       $scope.baz = "Qux";
+   *     }
+   *   }
+ * + * @param {string=} stateConfig.controllerAs + * + * + * A controller alias name. If present the controller will be + * published to scope under the controllerAs name. + *
controllerAs: "myCtrl"
+ * + * @param {string|object=} stateConfig.parent + * + * Optionally specifies the parent state of this state. + * + *
parent: 'parentState'
+ *
parent: parentState // JS variable
+ * + * @param {object=} stateConfig.resolve + * + * + * An optional map<string, function> of dependencies which + * should be injected into the controller. If any of these dependencies are promises, + * the router will wait for them all to be resolved before the controller is instantiated. + * If all the promises are resolved successfully, the $stateChangeSuccess event is fired + * and the values of the resolved promises are injected into any controllers that reference them. + * If any of the promises are rejected the $stateChangeError event is fired. + * + * The map object is: + * + * - key - {string}: name of dependency to be injected into controller + * - factory - {string|function}: If string then it is alias for service. Otherwise if function, + * it is injected and return value it treated as dependency. If result is a promise, it is + * resolved before its value is injected into controller. + * + *
resolve: {
+   *     myResolve1:
+   *       function($http, $stateParams) {
+   *         return $http.get("/api/foos/"+stateParams.fooID);
+   *       }
+   *     }
+ * + * @param {string=} stateConfig.url + * + * + * A url fragment with optional parameters. When a state is navigated or + * transitioned to, the `$stateParams` service will be populated with any + * parameters that were passed. + * + * (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for + * more details on acceptable patterns ) + * + * examples: + *
url: "/home"
+   * url: "/users/:userid"
+   * url: "/books/{bookid:[a-zA-Z_-]}"
+   * url: "/books/{categoryid:int}"
+   * url: "/books/{publishername:string}/{categoryid:int}"
+   * url: "/messages?before&after"
+   * url: "/messages?{before:date}&{after:date}"
+   * url: "/messages/:mailboxid?{before:date}&{after:date}"
+   * 
+ * + * @param {object=} stateConfig.views + * + * an optional map<string, object> which defined multiple views, or targets views + * manually/explicitly. + * + * Examples: + * + * Targets three named `ui-view`s in the parent state's template + *
views: {
+   *     header: {
+   *       controller: "headerCtrl",
+   *       templateUrl: "header.html"
+   *     }, body: {
+   *       controller: "bodyCtrl",
+   *       templateUrl: "body.html"
+   *     }, footer: {
+   *       controller: "footCtrl",
+   *       templateUrl: "footer.html"
+   *     }
+   *   }
+ * + * Targets named `ui-view="header"` from grandparent state 'top''s template, and named `ui-view="body" from parent state's template. + *
views: {
+   *     'header@top': {
+   *       controller: "msgHeaderCtrl",
+   *       templateUrl: "msgHeader.html"
+   *     }, 'body': {
+   *       controller: "messagesCtrl",
+   *       templateUrl: "messages.html"
+   *     }
+   *   }
+ * + * @param {boolean=} [stateConfig.abstract=false] + * + * An abstract state will never be directly activated, + * but can provide inherited properties to its common children states. + *
abstract: true
+ * + * @param {function=} stateConfig.onEnter + * + * + * Callback function for when a state is entered. Good way + * to trigger an action or dispatch an event, such as opening a dialog. + * If minifying your scripts, make sure to explicitly annotate this function, + * because it won't be automatically annotated by your build tools. + * + *
onEnter: function(MyService, $stateParams) {
+   *     MyService.foo($stateParams.myParam);
+   * }
+ * + * @param {function=} stateConfig.onExit + * + * + * Callback function for when a state is exited. Good way to + * trigger an action or dispatch an event, such as opening a dialog. + * If minifying your scripts, make sure to explicitly annotate this function, + * because it won't be automatically annotated by your build tools. + * + *
onExit: function(MyService, $stateParams) {
+   *     MyService.cleanup($stateParams.myParam);
+   * }
+ * + * @param {boolean=} [stateConfig.reloadOnSearch=true] + * + * + * If `false`, will not retrigger the same state + * just because a search/query parameter has changed (via $location.search() or $location.hash()). + * Useful for when you'd like to modify $location.search() without triggering a reload. + *
reloadOnSearch: false
+ * + * @param {object=} stateConfig.data + * + * + * Arbitrary data object, useful for custom configuration. The parent state's `data` is + * prototypally inherited. In other words, adding a data property to a state adds it to + * the entire subtree via prototypal inheritance. + * + *
data: {
+   *     requiredRole: 'foo'
+   * } 
+ * + * @param {object=} stateConfig.params + * + * + * A map which optionally configures parameters declared in the `url`, or + * defines additional non-url parameters. For each parameter being + * configured, add a configuration object keyed to the name of the parameter. + * + * Each parameter configuration object may contain the following properties: + * + * - ** value ** - {object|function=}: specifies the default value for this + * parameter. This implicitly sets this parameter as optional. + * + * When UI-Router routes to a state and no value is + * specified for this parameter in the URL or transition, the + * default value will be used instead. If `value` is a function, + * it will be injected and invoked, and the return value used. + * + * *Note*: `undefined` is treated as "no default value" while `null` + * is treated as "the default value is `null`". + * + * *Shorthand*: If you only need to configure the default value of the + * parameter, you may use a shorthand syntax. In the **`params`** + * map, instead mapping the param name to a full parameter configuration + * object, simply set map it to the default parameter value, e.g.: + * + *
// define a parameter's default value
+   * params: {
+   *     param1: { value: "defaultValue" }
+   * }
+   * // shorthand default values
+   * params: {
+   *     param1: "defaultValue",
+   *     param2: "param2Default"
+   * }
+ * + * - ** array ** - {boolean=}: *(default: false)* If true, the param value will be + * treated as an array of values. If you specified a Type, the value will be + * treated as an array of the specified Type. Note: query parameter values + * default to a special `"auto"` mode. + * + * For query parameters in `"auto"` mode, if multiple values for a single parameter + * are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values + * are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`). However, if + * only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single + * value (e.g.: `{ foo: '1' }`). + * + *
params: {
+   *     param1: { array: true }
+   * }
+ * + * - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when + * the current parameter value is the same as the default value. If `squash` is not set, it uses the + * configured default squash policy. + * (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`}) + * + * There are three squash settings: + * + * - false: The parameter's default value is not squashed. It is encoded and included in the URL + * - true: The parameter's default value is omitted from the URL. If the parameter is preceeded and followed + * by slashes in the state's `url` declaration, then one of those slashes are omitted. + * This can allow for cleaner looking URLs. + * - `""`: The parameter's default value is replaced with an arbitrary placeholder of your choice. + * + *
params: {
+   *     param1: {
+   *       value: "defaultId",
+   *       squash: true
+   * } }
+   * // squash "defaultValue" to "~"
+   * params: {
+   *     param1: {
+   *       value: "defaultValue",
+   *       squash: "~"
+   * } }
+   * 
+ * + * + * @example + *
+   * // Some state name examples
+   *
+   * // stateName can be a single top-level name (must be unique).
+   * $stateProvider.state("home", {});
+   *
+   * // Or it can be a nested state name. This state is a child of the
+   * // above "home" state.
+   * $stateProvider.state("home.newest", {});
+   *
+   * // Nest states as deeply as needed.
+   * $stateProvider.state("home.newest.abc.xyz.inception", {});
+   *
+   * // state() returns $stateProvider, so you can chain state declarations.
+   * $stateProvider
+   *   .state("home", {})
+   *   .state("about", {})
+   *   .state("contacts", {});
+   * 
+ * + */ + this.state = state; + function state(name, definition) { + /*jshint validthis: true */ + if (isObject(name)) definition = name; + else definition.name = name; + registerState(definition); + return this; + } + + /** + * @ngdoc object + * @name ui.router.state.$state + * + * @requires $rootScope + * @requires $q + * @requires ui.router.state.$view + * @requires $injector + * @requires ui.router.util.$resolve + * @requires ui.router.state.$stateParams + * @requires ui.router.router.$urlRouter + * + * @property {object} params A param object, e.g. {sectionId: section.id)}, that + * you'd like to test against the current active state. + * @property {object} current A reference to the state's config object. However + * you passed it in. Useful for accessing custom data. + * @property {object} transition Currently pending transition. A promise that'll + * resolve or reject. + * + * @description + * `$state` service is responsible for representing states as well as transitioning + * between them. It also provides interfaces to ask for current state or even states + * you're coming from. + */ + this.$get = $get; + $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory']; + function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) { + + var TransitionSuperseded = $q.reject(new Error('transition superseded')); + var TransitionPrevented = $q.reject(new Error('transition prevented')); + var TransitionAborted = $q.reject(new Error('transition aborted')); + var TransitionFailed = $q.reject(new Error('transition failed')); + + // Handles the case where a state which is the target of a transition is not found, and the user + // can optionally retry or defer the transition + function handleRedirect(redirect, state, params, options) { + /** + * @ngdoc event + * @name ui.router.state.$state#$stateNotFound + * @eventOf ui.router.state.$state + * @eventType broadcast on root scope + * @description + * Fired when a requested state **cannot be found** using the provided state name during transition. + * The event is broadcast allowing any handlers a single chance to deal with the error (usually by + * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler, + * you can see its three properties in the example. You can use `event.preventDefault()` to abort the + * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value. + * + * @param {Object} event Event object. + * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties. + * @param {State} fromState Current state object. + * @param {Object} fromParams Current state params. + * + * @example + * + *
+       * // somewhere, assume lazy.state has not been defined
+       * $state.go("lazy.state", {a:1, b:2}, {inherit:false});
+       *
+       * // somewhere else
+       * $scope.$on('$stateNotFound',
+       * function(event, unfoundState, fromState, fromParams){
+       *     console.log(unfoundState.to); // "lazy.state"
+       *     console.log(unfoundState.toParams); // {a:1, b:2}
+       *     console.log(unfoundState.options); // {inherit:false} + default options
+       * })
+       * 
+ */ + var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params); + + if (evt.defaultPrevented) { + $urlRouter.update(); + return TransitionAborted; + } + + if (!evt.retry) { + return null; + } + + // Allow the handler to return a promise to defer state lookup retry + if (options.$retry) { + $urlRouter.update(); + return TransitionFailed; + } + var retryTransition = $state.transition = $q.when(evt.retry); + + retryTransition.then(function() { + if (retryTransition !== $state.transition) return TransitionSuperseded; + redirect.options.$retry = true; + return $state.transitionTo(redirect.to, redirect.toParams, redirect.options); + }, function() { + return TransitionAborted; + }); + $urlRouter.update(); + + return retryTransition; + } + + root.locals = { resolve: null, globals: { $stateParams: {} } }; + + $state = { + params: {}, + current: root.self, + $current: root, + transition: null + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#reload + * @methodOf ui.router.state.$state + * + * @description + * A method that force reloads the current state. All resolves are re-resolved, + * controllers reinstantiated, and events re-fired. + * + * @example + *
+     * var app angular.module('app', ['ui.router']);
+     *
+     * app.controller('ctrl', function ($scope, $state) {
+     *   $scope.reload = function(){
+     *     $state.reload();
+     *   }
+     * });
+     * 
+ * + * `reload()` is just an alias for: + *
+     * $state.transitionTo($state.current, $stateParams, { 
+     *   reload: true, inherit: false, notify: true
+     * });
+     * 
+ * + * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved. + * @example + *
+     * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' 
+     * //and current state is 'contacts.detail.item'
+     * var app angular.module('app', ['ui.router']);
+     *
+     * app.controller('ctrl', function ($scope, $state) {
+     *   $scope.reload = function(){
+     *     //will reload 'contact.detail' and 'contact.detail.item' states
+     *     $state.reload('contact.detail');
+     *   }
+     * });
+     * 
+ * + * `reload()` is just an alias for: + *
+     * $state.transitionTo($state.current, $stateParams, { 
+     *   reload: true, inherit: false, notify: true
+     * });
+     * 
+ + * @returns {promise} A promise representing the state of the new transition. See + * {@link ui.router.state.$state#methods_go $state.go}. + */ + $state.reload = function reload(state) { + return $state.transitionTo($state.current, $stateParams, { reload: state || true, inherit: false, notify: true}); + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#go + * @methodOf ui.router.state.$state + * + * @description + * Convenience method for transitioning to a new state. `$state.go` calls + * `$state.transitionTo` internally but automatically sets options to + * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. + * This allows you to easily use an absolute or relative to path and specify + * only the parameters you'd like to update (while letting unspecified parameters + * inherit from the currently active ancestor states). + * + * @example + *
+     * var app = angular.module('app', ['ui.router']);
+     *
+     * app.controller('ctrl', function ($scope, $state) {
+     *   $scope.changeState = function () {
+     *     $state.go('contact.detail');
+     *   };
+     * });
+     * 
+ * + * + * @param {string} to Absolute state name or relative state path. Some examples: + * + * - `$state.go('contact.detail')` - will go to the `contact.detail` state + * - `$state.go('^')` - will go to a parent state + * - `$state.go('^.sibling')` - will go to a sibling state + * - `$state.go('.child.grandchild')` - will go to grandchild state + * + * @param {object=} params A map of the parameters that will be sent to the state, + * will populate $stateParams. Any parameters that are not specified will be inherited from currently + * defined parameters. Only parameters specified in the state definition can be overridden, new + * parameters will be ignored. This allows, for example, going to a sibling state that shares parameters + * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e. + * transitioning to a sibling will get you the parameters for all parents, transitioning to a child + * will get you all current parameters, etc. + * @param {object=} options Options object. The options are: + * + * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false` + * will not. If string, must be `"replace"`, which will update url and also replace last history record. + * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url. + * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), + * defines which state to be relative from. + * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events. + * - **`reload`** (v0.2.5) - {boolean=false|string|object}, If `true` will force transition even if no state or params + * have changed. It will reload the resolves and views of the current state and parent states. + * If `reload` is a string (or state object), the state object is fetched (by name, or object reference); and \ + * the transition reloads the resolves and views for that matched state, and all its children states. + * + * @returns {promise} A promise representing the state of the new transition. + * + * Possible success values: + * + * - $state.current + * + *
Possible rejection values: + * + * - 'transition superseded' - when a newer transition has been started after this one + * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener + * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or + * when a `$stateNotFound` `event.retry` promise errors. + * - 'transition failed' - when a state has been unsuccessfully found after 2 tries. + * - *resolve error* - when an error has occurred with a `resolve` + * + */ + $state.go = function go(to, params, options) { + return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options)); + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#transitionTo + * @methodOf ui.router.state.$state + * + * @description + * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go} + * uses `transitionTo` internally. `$state.go` is recommended in most situations. + * + * @example + *
+     * var app = angular.module('app', ['ui.router']);
+     *
+     * app.controller('ctrl', function ($scope, $state) {
+     *   $scope.changeState = function () {
+     *     $state.transitionTo('contact.detail');
+     *   };
+     * });
+     * 
+ * + * @param {string} to State name. + * @param {object=} toParams A map of the parameters that will be sent to the state, + * will populate $stateParams. + * @param {object=} options Options object. The options are: + * + * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false` + * will not. If string, must be `"replace"`, which will update url and also replace last history record. + * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url. + * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), + * defines which state to be relative from. + * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events. + * - **`reload`** (v0.2.5) - {boolean=false|string=|object=}, If `true` will force transition even if the state or params + * have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd + * use this when you want to force a reload when *everything* is the same, including search params. + * if String, then will reload the state with the name given in reload, and any children. + * if Object, then a stateObj is expected, will reload the state found in stateObj, and any children. + * + * @returns {promise} A promise representing the state of the new transition. See + * {@link ui.router.state.$state#methods_go $state.go}. + */ + $state.transitionTo = function transitionTo(to, toParams, options) { + toParams = toParams || {}; + options = extend({ + location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false + }, options || {}); + + var from = $state.$current, fromParams = $state.params, fromPath = from.path; + var evt, toState = findState(to, options.relative); + + // Store the hash param for later (since it will be stripped out by various methods) + var hash = toParams['#']; + + if (!isDefined(toState)) { + var redirect = { to: to, toParams: toParams, options: options }; + var redirectResult = handleRedirect(redirect, from.self, fromParams, options); + + if (redirectResult) { + return redirectResult; + } + + // Always retry once if the $stateNotFound was not prevented + // (handles either redirect changed or state lazy-definition) + to = redirect.to; + toParams = redirect.toParams; + options = redirect.options; + toState = findState(to, options.relative); + + if (!isDefined(toState)) { + if (!options.relative) throw new Error("No such state '" + to + "'"); + throw new Error("Could not resolve '" + to + "' from state '" + options.relative + "'"); + } + } + if (toState[abstractKey]) throw new Error("Cannot transition to abstract state '" + to + "'"); + if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState); + if (!toState.params.$$validates(toParams)) return TransitionFailed; + + toParams = toState.params.$$values(toParams); + to = toState; + + var toPath = to.path; + + // Starting from the root of the path, keep all levels that haven't changed + var keep = 0, state = toPath[keep], locals = root.locals, toLocals = []; + + if (!options.reload) { + while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) { + locals = toLocals[keep] = state.locals; + keep++; + state = toPath[keep]; + } + } else if (isString(options.reload) || isObject(options.reload)) { + if (isObject(options.reload) && !options.reload.name) { + throw new Error('Invalid reload state object'); + } + + var reloadState = options.reload === true ? fromPath[0] : findState(options.reload); + if (options.reload && !reloadState) { + throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'"); + } + + while (state && state === fromPath[keep] && state !== reloadState) { + locals = toLocals[keep] = state.locals; + keep++; + state = toPath[keep]; + } + } + + // If we're going to the same state and all locals are kept, we've got nothing to do. + // But clear 'transition', as we still want to cancel any other pending transitions. + // TODO: We may not want to bump 'transition' if we're called from a location change + // that we've initiated ourselves, because we might accidentally abort a legitimate + // transition initiated from code? + if (shouldSkipReload(to, toParams, from, fromParams, locals, options)) { + if (hash) toParams['#'] = hash; + $state.params = toParams; + copy($state.params, $stateParams); + copy(filterByKeys(to.params.$$keys(), $stateParams), to.locals.globals.$stateParams); + if (options.location && to.navigable && to.navigable.url) { + $urlRouter.push(to.navigable.url, toParams, { + $$avoidResync: true, replace: options.location === 'replace' + }); + $urlRouter.update(true); + } + $state.transition = null; + return $q.when($state.current); + } + + // Filter parameters before we pass them to event handlers etc. + toParams = filterByKeys(to.params.$$keys(), toParams || {}); + + // Re-add the saved hash before we start returning things or broadcasting $stateChangeStart + if (hash) toParams['#'] = hash; + + // Broadcast start event and cancel the transition if requested + if (options.notify) { + /** + * @ngdoc event + * @name ui.router.state.$state#$stateChangeStart + * @eventOf ui.router.state.$state + * @eventType broadcast on root scope + * @description + * Fired when the state transition **begins**. You can use `event.preventDefault()` + * to prevent the transition from happening and then the transition promise will be + * rejected with a `'transition prevented'` value. + * + * @param {Object} event Event object. + * @param {State} toState The state being transitioned to. + * @param {Object} toParams The params supplied to the `toState`. + * @param {State} fromState The current state, pre-transition. + * @param {Object} fromParams The params supplied to the `fromState`. + * + * @example + * + *
+         * $rootScope.$on('$stateChangeStart',
+         * function(event, toState, toParams, fromState, fromParams){
+         *     event.preventDefault();
+         *     // transitionTo() promise will be rejected with
+         *     // a 'transition prevented' error
+         * })
+         * 
+ */ + if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams, options).defaultPrevented) { + $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams); + //Don't update and resync url if there's been a new transition started. see issue #2238, #600 + if ($state.transition == null) $urlRouter.update(); + return TransitionPrevented; + } + } + + // Resolve locals for the remaining states, but don't update any global state just + // yet -- if anything fails to resolve the current state needs to remain untouched. + // We also set up an inheritance chain for the locals here. This allows the view directive + // to quickly look up the correct definition for each view in the current state. Even + // though we create the locals object itself outside resolveState(), it is initially + // empty and gets filled asynchronously. We need to keep track of the promise for the + // (fully resolved) current locals, and pass this down the chain. + var resolved = $q.when(locals); + + for (var l = keep; l < toPath.length; l++, state = toPath[l]) { + locals = toLocals[l] = inherit(locals); + resolved = resolveState(state, toParams, state === to, resolved, locals, options); + } + + // Once everything is resolved, we are ready to perform the actual transition + // and return a promise for the new state. We also keep track of what the + // current promise is, so that we can detect overlapping transitions and + // keep only the outcome of the last transition. + var transition = $state.transition = resolved.then(function () { + var l, entering, exiting; + + if ($state.transition !== transition) return TransitionSuperseded; + + // Exit 'from' states not kept + for (l = fromPath.length - 1; l >= keep; l--) { + exiting = fromPath[l]; + if (exiting.self.onExit) { + $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals); + } + exiting.locals = null; + } + + // Enter 'to' states not kept + for (l = keep; l < toPath.length; l++) { + entering = toPath[l]; + entering.locals = toLocals[l]; + if (entering.self.onEnter) { + $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals); + } + } + + // Run it again, to catch any transitions in callbacks + if ($state.transition !== transition) return TransitionSuperseded; + + // Update globals in $state + $state.$current = to; + $state.current = to.self; + $state.params = toParams; + copy($state.params, $stateParams); + $state.transition = null; + + if (options.location && to.navigable) { + $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, { + $$avoidResync: true, replace: options.location === 'replace' + }); + } + + if (options.notify) { + /** + * @ngdoc event + * @name ui.router.state.$state#$stateChangeSuccess + * @eventOf ui.router.state.$state + * @eventType broadcast on root scope + * @description + * Fired once the state transition is **complete**. + * + * @param {Object} event Event object. + * @param {State} toState The state being transitioned to. + * @param {Object} toParams The params supplied to the `toState`. + * @param {State} fromState The current state, pre-transition. + * @param {Object} fromParams The params supplied to the `fromState`. + */ + $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams); + } + $urlRouter.update(true); + + return $state.current; + }, function (error) { + if ($state.transition !== transition) return TransitionSuperseded; + + $state.transition = null; + /** + * @ngdoc event + * @name ui.router.state.$state#$stateChangeError + * @eventOf ui.router.state.$state + * @eventType broadcast on root scope + * @description + * Fired when an **error occurs** during transition. It's important to note that if you + * have any errors in your resolve functions (javascript errors, non-existent services, etc) + * they will not throw traditionally. You must listen for this $stateChangeError event to + * catch **ALL** errors. + * + * @param {Object} event Event object. + * @param {State} toState The state being transitioned to. + * @param {Object} toParams The params supplied to the `toState`. + * @param {State} fromState The current state, pre-transition. + * @param {Object} fromParams The params supplied to the `fromState`. + * @param {Error} error The resolve error object. + */ + evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error); + + if (!evt.defaultPrevented) { + $urlRouter.update(); + } + + return $q.reject(error); + }); + + return transition; + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#is + * @methodOf ui.router.state.$state + * + * @description + * Similar to {@link ui.router.state.$state#methods_includes $state.includes}, + * but only checks for the full state name. If params is supplied then it will be + * tested for strict equality against the current active params object, so all params + * must match with none missing and no extras. + * + * @example + *
+     * $state.$current.name = 'contacts.details.item';
+     *
+     * // absolute name
+     * $state.is('contact.details.item'); // returns true
+     * $state.is(contactDetailItemStateObject); // returns true
+     *
+     * // relative name (. and ^), typically from a template
+     * // E.g. from the 'contacts.details' template
+     * 
Item
+ *
+ * + * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check. + * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like + * to test against the current active state. + * @param {object=} options An options object. The options are: + * + * - **`relative`** - {string|object} - If `stateOrName` is a relative state name and `options.relative` is set, .is will + * test relative to `options.relative` state (or name). + * + * @returns {boolean} Returns true if it is the state. + */ + $state.is = function is(stateOrName, params, options) { + options = extend({ relative: $state.$current }, options || {}); + var state = findState(stateOrName, options.relative); + + if (!isDefined(state)) { return undefined; } + if ($state.$current !== state) { return false; } + return params ? equalForKeys(state.params.$$values(params), $stateParams) : true; + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#includes + * @methodOf ui.router.state.$state + * + * @description + * A method to determine if the current active state is equal to or is the child of the + * state stateName. If any params are passed then they will be tested for a match as well. + * Not all the parameters need to be passed, just the ones you'd like to test for equality. + * + * @example + * Partial and relative names + *
+     * $state.$current.name = 'contacts.details.item';
+     *
+     * // Using partial names
+     * $state.includes("contacts"); // returns true
+     * $state.includes("contacts.details"); // returns true
+     * $state.includes("contacts.details.item"); // returns true
+     * $state.includes("contacts.list"); // returns false
+     * $state.includes("about"); // returns false
+     *
+     * // Using relative names (. and ^), typically from a template
+     * // E.g. from the 'contacts.details' template
+     * 
Item
+ *
+ * + * Basic globbing patterns + *
+     * $state.$current.name = 'contacts.details.item.url';
+     *
+     * $state.includes("*.details.*.*"); // returns true
+     * $state.includes("*.details.**"); // returns true
+     * $state.includes("**.item.**"); // returns true
+     * $state.includes("*.details.item.url"); // returns true
+     * $state.includes("*.details.*.url"); // returns true
+     * $state.includes("*.details.*"); // returns false
+     * $state.includes("item.**"); // returns false
+     * 
+ * + * @param {string} stateOrName A partial name, relative name, or glob pattern + * to be searched for within the current state name. + * @param {object=} params A param object, e.g. `{sectionId: section.id}`, + * that you'd like to test against the current active state. + * @param {object=} options An options object. The options are: + * + * - **`relative`** - {string|object=} - If `stateOrName` is a relative state reference and `options.relative` is set, + * .includes will test relative to `options.relative` state (or name). + * + * @returns {boolean} Returns true if it does include the state + */ + $state.includes = function includes(stateOrName, params, options) { + options = extend({ relative: $state.$current }, options || {}); + if (isString(stateOrName) && isGlob(stateOrName)) { + if (!doesStateMatchGlob(stateOrName)) { + return false; + } + stateOrName = $state.$current.name; + } + + var state = findState(stateOrName, options.relative); + if (!isDefined(state)) { return undefined; } + if (!isDefined($state.$current.includes[state.name])) { return false; } + return params ? equalForKeys(state.params.$$values(params), $stateParams, objectKeys(params)) : true; + }; + + + /** + * @ngdoc function + * @name ui.router.state.$state#href + * @methodOf ui.router.state.$state + * + * @description + * A url generation method that returns the compiled url for the given state populated with the given params. + * + * @example + *
+     * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
+     * 
+ * + * @param {string|object} stateOrName The state name or state object you'd like to generate a url from. + * @param {object=} params An object of parameter values to fill the state's required parameters. + * @param {object=} options Options object. The options are: + * + * - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the + * first parameter, then the constructed href url will be built from the first navigable ancestor (aka + * ancestor with a valid url). + * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url. + * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), + * defines which state to be relative from. + * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". + * + * @returns {string} compiled state url + */ + $state.href = function href(stateOrName, params, options) { + options = extend({ + lossy: true, + inherit: true, + absolute: false, + relative: $state.$current + }, options || {}); + + var state = findState(stateOrName, options.relative); + + if (!isDefined(state)) return null; + if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state); + + var nav = (state && options.lossy) ? state.navigable : state; + + if (!nav || nav.url === undefined || nav.url === null) { + return null; + } + return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys().concat('#'), params || {}), { + absolute: options.absolute + }); + }; + + /** + * @ngdoc function + * @name ui.router.state.$state#get + * @methodOf ui.router.state.$state + * + * @description + * Returns the state configuration object for any specific state or all states. + * + * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for + * the requested state. If not provided, returns an array of ALL state configs. + * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context. + * @returns {Object|Array} State configuration object or array of all objects. + */ + $state.get = function (stateOrName, context) { + if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; }); + var state = findState(stateOrName, context || $state.$current); + return (state && state.self) ? state.self : null; + }; + + function resolveState(state, params, paramsAreFiltered, inherited, dst, options) { + // Make a restricted $stateParams with only the parameters that apply to this state if + // necessary. In addition to being available to the controller and onEnter/onExit callbacks, + // we also need $stateParams to be available for any $injector calls we make during the + // dependency resolution process. + var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params); + var locals = { $stateParams: $stateParams }; + + // Resolve 'global' dependencies for the state, i.e. those not specific to a view. + // We're also including $stateParams in this; that way the parameters are restricted + // to the set that should be visible to the state, and are independent of when we update + // the global $state and $stateParams values. + dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state); + var promises = [dst.resolve.then(function (globals) { + dst.globals = globals; + })]; + if (inherited) promises.push(inherited); + + function resolveViews() { + var viewsPromises = []; + + // Resolve template and dependencies for all views. + forEach(state.views, function (view, name) { + var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {}); + injectables.$template = [ function () { + return $view.load(name, { view: view, locals: dst.globals, params: $stateParams, notify: options.notify }) || ''; + }]; + + viewsPromises.push($resolve.resolve(injectables, dst.globals, dst.resolve, state).then(function (result) { + // References to the controller (only instantiated at link time) + if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) { + var injectLocals = angular.extend({}, injectables, dst.globals); + result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals); + } else { + result.$$controller = view.controller; + } + // Provide access to the state itself for internal use + result.$$state = state; + result.$$controllerAs = view.controllerAs; + dst[name] = result; + })); + }); + + return $q.all(viewsPromises).then(function(){ + return dst.globals; + }); + } + + // Wait for all the promises and then return the activation object + return $q.all(promises).then(resolveViews).then(function (values) { + return dst; + }); + } + + return $state; + } + + function shouldSkipReload(to, toParams, from, fromParams, locals, options) { + // Return true if there are no differences in non-search (path/object) params, false if there are differences + function nonSearchParamsEqual(fromAndToState, fromParams, toParams) { + // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params. + function notSearchParam(key) { + return fromAndToState.params[key].location != "search"; + } + var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam); + var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys)); + var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams); + return nonQueryParamSet.$$equals(fromParams, toParams); + } + + // If reload was not explicitly requested + // and we're transitioning to the same state we're already in + // and the locals didn't change + // or they changed in a way that doesn't merit reloading + // (reloadOnParams:false, or reloadOnSearch.false and only search params changed) + // Then return true. + if (!options.reload && to === from && + (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) { + return true; + } + } +} + +angular.module('ui.router.state') + .factory('$stateParams', function () { return {}; }) + .provider('$state', $StateProvider); diff --git a/afb-client/bower_components/angular-ui-router/src/stateDirectives.js b/afb-client/bower_components/angular-ui-router/src/stateDirectives.js new file mode 100644 index 0000000..d02add9 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/stateDirectives.js @@ -0,0 +1,391 @@ +function parseStateRef(ref, current) { + var preparsed = ref.match(/^\s*({[^}]*})\s*$/), parsed; + if (preparsed) ref = current + '(' + preparsed[1] + ')'; + parsed = ref.replace(/\n/g, " ").match(/^([^(]+?)\s*(\((.*)\))?$/); + if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'"); + return { state: parsed[1], paramExpr: parsed[3] || null }; +} + +function stateContext(el) { + var stateData = el.parent().inheritedData('$uiView'); + + if (stateData && stateData.state && stateData.state.name) { + return stateData.state; + } +} + +function getTypeInfo(el) { + // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. + var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]'; + var isForm = el[0].nodeName === "FORM"; + + return { + attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'), + isAnchor: el.prop("tagName").toUpperCase() === "A", + clickable: !isForm + }; +} + +function clickHook(el, $state, $timeout, type, current) { + return function(e) { + var button = e.which || e.button, target = current(); + + if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) { + // HACK: This is to allow ng-clicks to be processed before the transition is initiated: + var transition = $timeout(function() { + $state.go(target.state, target.params, target.options); + }); + e.preventDefault(); + + // if the state has no URL, ignore one preventDefault from the directive. + var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1: 0; + + e.preventDefault = function() { + if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition); + }; + } + }; +} + +function defaultOpts(el, $state) { + return { relative: stateContext(el) || $state.$current, inherit: true }; +} + +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-sref + * + * @requires ui.router.state.$state + * @requires $timeout + * + * @restrict A + * + * @description + * A directive that binds a link (`` tag) to a state. If the state has an associated + * URL, the directive will automatically generate & update the `href` attribute via + * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking + * the link will trigger a state transition with optional parameters. + * + * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be + * handled natively by the browser. + * + * You can also use relative state paths within ui-sref, just like the relative + * paths passed to `$state.go()`. You just need to be aware that the path is relative + * to the state that the link lives in, in other words the state that loaded the + * template containing the link. + * + * You can specify options to pass to {@link ui.router.state.$state#go $state.go()} + * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`, + * and `reload`. + * + * @example + * Here's an example of how you'd use ui-sref and how it would compile. If you have the + * following template: + *
+ * Home | About | Next page
+ *
+ * 
+ * 
+ * + * Then the compiled html would be (assuming Html5Mode is off and current state is contacts): + *
+ * Home | About | Next page
+ *
+ * 
    + *
  • + * Joe + *
  • + *
  • + * Alice + *
  • + *
  • + * Bob + *
  • + *
+ * + * Home + *
+ * + * @param {string} ui-sref 'stateName' can be any valid absolute or relative state + * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()} + */ +$StateRefDirective.$inject = ['$state', '$timeout']; +function $StateRefDirective($state, $timeout) { + return { + restrict: 'A', + require: ['?^uiSrefActive', '?^uiSrefActiveEq'], + link: function(scope, element, attrs, uiSrefActive) { + var ref = parseStateRef(attrs.uiSref, $state.current.name); + var def = { state: ref.state, href: null, params: null }; + var type = getTypeInfo(element); + var active = uiSrefActive[1] || uiSrefActive[0]; + + def.options = extend(defaultOpts(element, $state), attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {}); + + var update = function(val) { + if (val) def.params = angular.copy(val); + def.href = $state.href(ref.state, def.params, def.options); + + if (active) active.$$addStateInfo(ref.state, def.params); + if (def.href !== null) attrs.$set(type.attr, def.href); + }; + + if (ref.paramExpr) { + scope.$watch(ref.paramExpr, function(val) { if (val !== def.params) update(val); }, true); + def.params = angular.copy(scope.$eval(ref.paramExpr)); + } + update(); + + if (!type.clickable) return; + element.bind("click", clickHook(element, $state, $timeout, type, function() { return def; })); + } + }; +} + +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-state + * + * @requires ui.router.state.uiSref + * + * @restrict A + * + * @description + * Much like ui-sref, but will accept named $scope properties to evaluate for a state definition, + * params and override options. + * + * @param {string} ui-state 'stateName' can be any valid absolute or relative state + * @param {Object} ui-state-params params to pass to {@link ui.router.state.$state#href $state.href()} + * @param {Object} ui-state-opts options to pass to {@link ui.router.state.$state#go $state.go()} + */ +$StateRefDynamicDirective.$inject = ['$state', '$timeout']; +function $StateRefDynamicDirective($state, $timeout) { + return { + restrict: 'A', + require: ['?^uiSrefActive', '?^uiSrefActiveEq'], + link: function(scope, element, attrs, uiSrefActive) { + var type = getTypeInfo(element); + var active = uiSrefActive[1] || uiSrefActive[0]; + var group = [attrs.uiState, attrs.uiStateParams || null, attrs.uiStateOpts || null]; + var watch = '[' + group.map(function(val) { return val || 'null'; }).join(', ') + ']'; + var def = { state: null, params: null, options: null, href: null }; + + function runStateRefLink (group) { + def.state = group[0]; def.params = group[1]; def.options = group[2]; + def.href = $state.href(def.state, def.params, def.options); + + if (active) active.$$addStateInfo(def.state, def.params); + if (def.href) attrs.$set(type.attr, def.href); + } + + scope.$watch(watch, runStateRefLink, true); + runStateRefLink(scope.$eval(watch)); + + if (!type.clickable) return; + element.bind("click", clickHook(element, $state, $timeout, type, function() { return def; })); + } + }; +} + + +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-sref-active + * + * @requires ui.router.state.$state + * @requires ui.router.state.$stateParams + * @requires $interpolate + * + * @restrict A + * + * @description + * A directive working alongside ui-sref to add classes to an element when the + * related ui-sref directive's state is active, and removing them when it is inactive. + * The primary use-case is to simplify the special appearance of navigation menus + * relying on `ui-sref`, by having the "active" state's menu button appear different, + * distinguishing it from the inactive menu items. + * + * ui-sref-active can live on the same element as ui-sref or on a parent element. The first + * ui-sref-active found at the same level or above the ui-sref will be used. + * + * Will activate when the ui-sref's target state or any child state is active. If you + * need to activate only when the ui-sref target state is active and *not* any of + * it's children, then you will use + * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq} + * + * @example + * Given the following template: + *
+ * 
+ * 
+ * + * + * When the app state is "app.user" (or any children states), and contains the state parameter "user" with value "bilbobaggins", + * the resulting HTML will appear as (note the 'active' class): + *
+ * 
+ * 
+ * + * The class name is interpolated **once** during the directives link time (any further changes to the + * interpolated value are ignored). + * + * Multiple classes may be specified in a space-separated format: + *
+ * 
    + *
  • + * link + *
  • + *
+ *
+ * + * It is also possible to pass ui-sref-active an expression that evaluates + * to an object hash, whose keys represent active class names and whose + * values represent the respective state names/globs. + * ui-sref-active will match if the current active state **includes** any of + * the specified state names/globs, even the abstract ones. + * + * @Example + * Given the following template, with "admin" being an abstract state: + *
+ * 
+ * Roles + *
+ *
+ * + * When the current state is "admin.roles" the "active" class will be applied + * to both the
and elements. It is important to note that the state + * names/globs passed to ui-sref-active shadow the state provided by ui-sref. + */ + +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-sref-active-eq + * + * @requires ui.router.state.$state + * @requires ui.router.state.$stateParams + * @requires $interpolate + * + * @restrict A + * + * @description + * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate + * when the exact target state used in the `ui-sref` is active; no child states. + * + */ +$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate']; +function $StateRefActiveDirective($state, $stateParams, $interpolate) { + return { + restrict: "A", + controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) { + var states = [], activeClasses = {}, activeEqClass, uiSrefActive; + + // There probably isn't much point in $observing this + // uiSrefActive and uiSrefActiveEq share the same directive object with some + // slight difference in logic routing + activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope); + + try { + uiSrefActive = $scope.$eval($attrs.uiSrefActive); + } catch (e) { + // Do nothing. uiSrefActive is not a valid expression. + // Fall back to using $interpolate below + } + uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope); + if (isObject(uiSrefActive)) { + forEach(uiSrefActive, function(stateOrName, activeClass) { + if (isString(stateOrName)) { + var ref = parseStateRef(stateOrName, $state.current.name); + addState(ref.state, $scope.$eval(ref.paramExpr), activeClass); + } + }); + } + + // Allow uiSref to communicate with uiSrefActive[Equals] + this.$$addStateInfo = function (newState, newParams) { + // we already got an explicit state provided by ui-sref-active, so we + // shadow the one that comes from ui-sref + if (isObject(uiSrefActive) && states.length > 0) { + return; + } + addState(newState, newParams, uiSrefActive); + update(); + }; + + $scope.$on('$stateChangeSuccess', update); + + function addState(stateName, stateParams, activeClass) { + var state = $state.get(stateName, stateContext($element)); + var stateHash = createStateHash(stateName, stateParams); + + states.push({ + state: state || { name: stateName }, + params: stateParams, + hash: stateHash + }); + + activeClasses[stateHash] = activeClass; + } + + /** + * @param {string} state + * @param {Object|string} [params] + * @return {string} + */ + function createStateHash(state, params) { + if (!isString(state)) { + throw new Error('state should be a string'); + } + if (isObject(params)) { + return state + toJson(params); + } + params = $scope.$eval(params); + if (isObject(params)) { + return state + toJson(params); + } + return state; + } + + // Update route state + function update() { + for (var i = 0; i < states.length; i++) { + if (anyMatch(states[i].state, states[i].params)) { + addClass($element, activeClasses[states[i].hash]); + } else { + removeClass($element, activeClasses[states[i].hash]); + } + + if (exactMatch(states[i].state, states[i].params)) { + addClass($element, activeEqClass); + } else { + removeClass($element, activeEqClass); + } + } + } + + function addClass(el, className) { $timeout(function () { el.addClass(className); }); } + function removeClass(el, className) { el.removeClass(className); } + function anyMatch(state, params) { return $state.includes(state.name, params); } + function exactMatch(state, params) { return $state.is(state.name, params); } + + update(); + }] + }; +} + +angular.module('ui.router.state') + .directive('uiSref', $StateRefDirective) + .directive('uiSrefActive', $StateRefActiveDirective) + .directive('uiSrefActiveEq', $StateRefActiveDirective) + .directive('uiState', $StateRefDynamicDirective); diff --git a/afb-client/bower_components/angular-ui-router/src/stateFilters.js b/afb-client/bower_components/angular-ui-router/src/stateFilters.js new file mode 100644 index 0000000..4ef014a --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/stateFilters.js @@ -0,0 +1,39 @@ +/** + * @ngdoc filter + * @name ui.router.state.filter:isState + * + * @requires ui.router.state.$state + * + * @description + * Translates to {@link ui.router.state.$state#methods_is $state.is("stateName")}. + */ +$IsStateFilter.$inject = ['$state']; +function $IsStateFilter($state) { + var isFilter = function (state, params) { + return $state.is(state, params); + }; + isFilter.$stateful = true; + return isFilter; +} + +/** + * @ngdoc filter + * @name ui.router.state.filter:includedByState + * + * @requires ui.router.state.$state + * + * @description + * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}. + */ +$IncludedByStateFilter.$inject = ['$state']; +function $IncludedByStateFilter($state) { + var includesFilter = function (state, params, options) { + return $state.includes(state, params, options); + }; + includesFilter.$stateful = true; + return includesFilter; +} + +angular.module('ui.router.state') + .filter('isState', $IsStateFilter) + .filter('includedByState', $IncludedByStateFilter); diff --git a/afb-client/bower_components/angular-ui-router/src/templateFactory.js b/afb-client/bower_components/angular-ui-router/src/templateFactory.js new file mode 100644 index 0000000..ca491a9 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/templateFactory.js @@ -0,0 +1,110 @@ +/** + * @ngdoc object + * @name ui.router.util.$templateFactory + * + * @requires $http + * @requires $templateCache + * @requires $injector + * + * @description + * Service. Manages loading of templates. + */ +$TemplateFactory.$inject = ['$http', '$templateCache', '$injector']; +function $TemplateFactory( $http, $templateCache, $injector) { + + /** + * @ngdoc function + * @name ui.router.util.$templateFactory#fromConfig + * @methodOf ui.router.util.$templateFactory + * + * @description + * Creates a template from a configuration object. + * + * @param {object} config Configuration object for which to load a template. + * The following properties are search in the specified order, and the first one + * that is defined is used to create the template: + * + * @param {string|object} config.template html string template or function to + * load via {@link ui.router.util.$templateFactory#fromString fromString}. + * @param {string|object} config.templateUrl url to load or a function returning + * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}. + * @param {Function} config.templateProvider function to invoke via + * {@link ui.router.util.$templateFactory#fromProvider fromProvider}. + * @param {object} params Parameters to pass to the template function. + * @param {object} locals Locals to pass to `invoke` if the template is loaded + * via a `templateProvider`. Defaults to `{ params: params }`. + * + * @return {string|object} The template html as a string, or a promise for + * that string,or `null` if no template is configured. + */ + this.fromConfig = function (config, params, locals) { + return ( + isDefined(config.template) ? this.fromString(config.template, params) : + isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) : + isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) : + null + ); + }; + + /** + * @ngdoc function + * @name ui.router.util.$templateFactory#fromString + * @methodOf ui.router.util.$templateFactory + * + * @description + * Creates a template from a string or a function returning a string. + * + * @param {string|object} template html template as a string or function that + * returns an html template as a string. + * @param {object} params Parameters to pass to the template function. + * + * @return {string|object} The template html as a string, or a promise for that + * string. + */ + this.fromString = function (template, params) { + return isFunction(template) ? template(params) : template; + }; + + /** + * @ngdoc function + * @name ui.router.util.$templateFactory#fromUrl + * @methodOf ui.router.util.$templateFactory + * + * @description + * Loads a template from the a URL via `$http` and `$templateCache`. + * + * @param {string|Function} url url of the template to load, or a function + * that returns a url. + * @param {Object} params Parameters to pass to the url function. + * @return {string|Promise.} The template html as a string, or a promise + * for that string. + */ + this.fromUrl = function (url, params) { + if (isFunction(url)) url = url(params); + if (url == null) return null; + else return $http + .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }}) + .then(function(response) { return response.data; }); + }; + + /** + * @ngdoc function + * @name ui.router.util.$templateFactory#fromProvider + * @methodOf ui.router.util.$templateFactory + * + * @description + * Creates a template by invoking an injectable provider function. + * + * @param {Function} provider Function to invoke via `$injector.invoke` + * @param {Object} params Parameters for the template. + * @param {Object} locals Locals to pass to `invoke`. Defaults to + * `{ params: params }`. + * @return {string|Promise.} The template html as a string, or a promise + * for that string. + */ + this.fromProvider = function (provider, params, locals) { + return $injector.invoke(provider, null, locals || { params: params }); + }; +} + +angular.module('ui.router.util').service('$templateFactory', $TemplateFactory); diff --git a/afb-client/bower_components/angular-ui-router/src/urlMatcherFactory.js b/afb-client/bower_components/angular-ui-router/src/urlMatcherFactory.js new file mode 100644 index 0000000..bc4e1eb --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/urlMatcherFactory.js @@ -0,0 +1,1081 @@ +var $$UMFP; // reference to $UrlMatcherFactoryProvider + +/** + * @ngdoc object + * @name ui.router.util.type:UrlMatcher + * + * @description + * Matches URLs against patterns and extracts named parameters from the path or the search + * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list + * of search parameters. Multiple search parameter names are separated by '&'. Search parameters + * do not influence whether or not a URL is matched, but their values are passed through into + * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}. + * + * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace + * syntax, which optionally allows a regular expression for the parameter to be specified: + * + * * `':'` name - colon placeholder + * * `'*'` name - catch-all placeholder + * * `'{' name '}'` - curly placeholder + * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the + * regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash. + * + * Parameter names may contain only word characters (latin letters, digits, and underscore) and + * must be unique within the pattern (across both path and search parameters). For colon + * placeholders or curly placeholders without an explicit regexp, a path parameter matches any + * number of characters other than '/'. For catch-all placeholders the path parameter matches + * any number of characters. + * + * Examples: + * + * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for + * trailing slashes, and patterns have to match the entire path, not just a prefix. + * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or + * '/user/bob/details'. The second path segment will be captured as the parameter 'id'. + * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax. + * * `'/user/{id:[^/]*}'` - Same as the previous example. + * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id + * parameter consists of 1 to 8 hex digits. + * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the + * path into the parameter 'path'. + * * `'/files/*path'` - ditto. + * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined + * in the built-in `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start + * + * @param {string} pattern The pattern to compile into a matcher. + * @param {Object} config A configuration object hash: + * @param {Object=} parentMatcher Used to concatenate the pattern/config onto + * an existing UrlMatcher + * + * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`. + * * `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`. + * + * @property {string} prefix A static prefix of this pattern. The matcher guarantees that any + * URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns + * non-null) will start with this prefix. + * + * @property {string} source The pattern that was passed into the constructor + * + * @property {string} sourcePath The path portion of the source property + * + * @property {string} sourceSearch The search portion of the source property + * + * @property {string} regex The constructed regex that will be used to match against the url when + * it is time to determine which url will match. + * + * @returns {Object} New `UrlMatcher` object + */ +function UrlMatcher(pattern, config, parentMatcher) { + config = extend({ params: {} }, isObject(config) ? config : {}); + + // Find all placeholders and create a compiled pattern, using either classic or curly syntax: + // '*' name + // ':' name + // '{' name '}' + // '{' name ':' regexp '}' + // The regular expression is somewhat complicated due to the need to allow curly braces + // inside the regular expression. The placeholder regexp breaks down as follows: + // ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case) + // \{([\w\[\]]+)(?:\:\s*( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case + // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either + // [^{}\\]+ - anything other than curly braces or backslash + // \\. - a backslash escape + // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms + var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, + searchPlaceholder = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, + compiled = '^', last = 0, m, + segments = this.segments = [], + parentParams = parentMatcher ? parentMatcher.params : {}, + params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(), + paramNames = []; + + function addParameter(id, type, config, location) { + paramNames.push(id); + if (parentParams[id]) return parentParams[id]; + if (!/^\w+([-.]+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'"); + if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'"); + params[id] = new $$UMFP.Param(id, type, config, location); + return params[id]; + } + + function quoteRegExp(string, pattern, squash, optional) { + var surroundPattern = ['',''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&"); + if (!pattern) return result; + switch(squash) { + case false: surroundPattern = ['(', ')' + (optional ? "?" : "")]; break; + case true: + result = result.replace(/\/$/, ''); + surroundPattern = ['(?:\/(', ')|\/)?']; + break; + default: surroundPattern = ['(' + squash + "|", ')?']; break; + } + return result + surroundPattern[0] + pattern + surroundPattern[1]; + } + + this.source = pattern; + + // Split into static segments separated by path parameter placeholders. + // The number of segments is always 1 more than the number of parameters. + function matchDetails(m, isSearch) { + var id, regexp, segment, type, cfg, arrayMode; + id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null + cfg = config.params[id]; + segment = pattern.substring(last, m.index); + regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null); + + if (regexp) { + type = $$UMFP.type(regexp) || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) }); + } + + return { + id: id, regexp: regexp, segment: segment, type: type, cfg: cfg + }; + } + + var p, param, segment; + while ((m = placeholder.exec(pattern))) { + p = matchDetails(m, false); + if (p.segment.indexOf('?') >= 0) break; // we're into the search part + + param = addParameter(p.id, p.type, p.cfg, "path"); + compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional); + segments.push(p.segment); + last = placeholder.lastIndex; + } + segment = pattern.substring(last); + + // Find any search parameter names and remove them from the last segment + var i = segment.indexOf('?'); + + if (i >= 0) { + var search = this.sourceSearch = segment.substring(i); + segment = segment.substring(0, i); + this.sourcePath = pattern.substring(0, last + i); + + if (search.length > 0) { + last = 0; + while ((m = searchPlaceholder.exec(search))) { + p = matchDetails(m, true); + param = addParameter(p.id, p.type, p.cfg, "search"); + last = placeholder.lastIndex; + // check if ?& + } + } + } else { + this.sourcePath = pattern; + this.sourceSearch = ''; + } + + compiled += quoteRegExp(segment) + (config.strict === false ? '\/?' : '') + '$'; + segments.push(segment); + + this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined); + this.prefix = segments[0]; + this.$$paramNames = paramNames; +} + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#concat + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Returns a new matcher for a pattern constructed by appending the path part and adding the + * search parameters of the specified pattern to this pattern. The current pattern is not + * modified. This can be understood as creating a pattern for URLs that are relative to (or + * suffixes of) the current pattern. + * + * @example + * The following two matchers are equivalent: + *
+ * new UrlMatcher('/user/{id}?q').concat('/details?date');
+ * new UrlMatcher('/user/{id}/details?q&date');
+ * 
+ * + * @param {string} pattern The pattern to append. + * @param {Object} config An object hash of the configuration for the matcher. + * @returns {UrlMatcher} A matcher for the concatenated pattern. + */ +UrlMatcher.prototype.concat = function (pattern, config) { + // Because order of search parameters is irrelevant, we can add our own search + // parameters to the end of the new pattern. Parse the new pattern by itself + // and then join the bits together, but it's much easier to do this on a string level. + var defaultConfig = { + caseInsensitive: $$UMFP.caseInsensitive(), + strict: $$UMFP.strictMode(), + squash: $$UMFP.defaultSquashPolicy() + }; + return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this); +}; + +UrlMatcher.prototype.toString = function () { + return this.source; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#exec + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Tests the specified path against this matcher, and returns an object containing the captured + * parameter values, or null if the path does not match. The returned object contains the values + * of any search parameters that are mentioned in the pattern, but their value may be null if + * they are not present in `searchParams`. This means that search parameters are always treated + * as optional. + * + * @example + *
+ * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
+ *   x: '1', q: 'hello'
+ * });
+ * // returns { id: 'bob', q: 'hello', r: null }
+ * 
+ * + * @param {string} path The URL path to match, e.g. `$location.path()`. + * @param {Object} searchParams URL search parameters, e.g. `$location.search()`. + * @returns {Object} The captured parameter values. + */ +UrlMatcher.prototype.exec = function (path, searchParams) { + var m = this.regexp.exec(path); + if (!m) return null; + searchParams = searchParams || {}; + + var paramNames = this.parameters(), nTotal = paramNames.length, + nPath = this.segments.length - 1, + values = {}, i, j, cfg, paramName; + + if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'"); + + function decodePathArray(string) { + function reverseString(str) { return str.split("").reverse().join(""); } + function unquoteDashes(str) { return str.replace(/\\-/g, "-"); } + + var split = reverseString(string).split(/-(?!\\)/); + var allReversed = map(split, reverseString); + return map(allReversed, unquoteDashes).reverse(); + } + + var param, paramVal; + for (i = 0; i < nPath; i++) { + paramName = paramNames[i]; + param = this.params[paramName]; + paramVal = m[i+1]; + // if the param value matches a pre-replace pair, replace the value before decoding. + for (j = 0; j < param.replace.length; j++) { + if (param.replace[j].from === paramVal) paramVal = param.replace[j].to; + } + if (paramVal && param.array === true) paramVal = decodePathArray(paramVal); + if (isDefined(paramVal)) paramVal = param.type.decode(paramVal); + values[paramName] = param.value(paramVal); + } + for (/**/; i < nTotal; i++) { + paramName = paramNames[i]; + values[paramName] = this.params[paramName].value(searchParams[paramName]); + param = this.params[paramName]; + paramVal = searchParams[paramName]; + for (j = 0; j < param.replace.length; j++) { + if (param.replace[j].from === paramVal) paramVal = param.replace[j].to; + } + if (isDefined(paramVal)) paramVal = param.type.decode(paramVal); + values[paramName] = param.value(paramVal); + } + + return values; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#parameters + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Returns the names of all path and search parameters of this pattern in an unspecified order. + * + * @returns {Array.} An array of parameter names. Must be treated as read-only. If the + * pattern has no parameters, an empty array is returned. + */ +UrlMatcher.prototype.parameters = function (param) { + if (!isDefined(param)) return this.$$paramNames; + return this.params[param] || null; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#validates + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Checks an object hash of parameters to validate their correctness according to the parameter + * types of this `UrlMatcher`. + * + * @param {Object} params The object hash of parameters to validate. + * @returns {boolean} Returns `true` if `params` validates, otherwise `false`. + */ +UrlMatcher.prototype.validates = function (params) { + return this.params.$$validates(params); +}; + +/** + * @ngdoc function + * @name ui.router.util.type:UrlMatcher#format + * @methodOf ui.router.util.type:UrlMatcher + * + * @description + * Creates a URL that matches this pattern by substituting the specified values + * for the path and search parameters. Null values for path parameters are + * treated as empty strings. + * + * @example + *
+ * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
+ * // returns '/user/bob?q=yes'
+ * 
+ * + * @param {Object} values the values to substitute for the parameters in this pattern. + * @returns {string} the formatted URL (path and optionally search part). + */ +UrlMatcher.prototype.format = function (values) { + values = values || {}; + var segments = this.segments, params = this.parameters(), paramset = this.params; + if (!this.validates(values)) return null; + + var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0]; + + function encodeDashes(str) { // Replace dashes with encoded "\-" + return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); }); + } + + for (i = 0; i < nTotal; i++) { + var isPathParam = i < nPath; + var name = params[i], param = paramset[name], value = param.value(values[name]); + var isDefaultValue = param.isOptional && param.type.equals(param.value(), value); + var squash = isDefaultValue ? param.squash : false; + var encoded = param.type.encode(value); + + if (isPathParam) { + var nextSegment = segments[i + 1]; + var isFinalPathParam = i + 1 === nPath; + + if (squash === false) { + if (encoded != null) { + if (isArray(encoded)) { + result += map(encoded, encodeDashes).join("-"); + } else { + result += encodeURIComponent(encoded); + } + } + result += nextSegment; + } else if (squash === true) { + var capture = result.match(/\/$/) ? /\/?(.*)/ : /(.*)/; + result += nextSegment.match(capture)[1]; + } else if (isString(squash)) { + result += squash + nextSegment; + } + + if (isFinalPathParam && param.squash === true && result.slice(-1) === '/') result = result.slice(0, -1); + } else { + if (encoded == null || (isDefaultValue && squash !== false)) continue; + if (!isArray(encoded)) encoded = [ encoded ]; + if (encoded.length === 0) continue; + encoded = map(encoded, encodeURIComponent).join('&' + name + '='); + result += (search ? '&' : '?') + (name + '=' + encoded); + search = true; + } + } + + return result; +}; + +/** + * @ngdoc object + * @name ui.router.util.type:Type + * + * @description + * Implements an interface to define custom parameter types that can be decoded from and encoded to + * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`} + * objects when matching or formatting URLs, or comparing or validating parameter values. + * + * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more + * information on registering custom types. + * + * @param {Object} config A configuration object which contains the custom type definition. The object's + * properties will override the default methods and/or pattern in `Type`'s public interface. + * @example + *
+ * {
+ *   decode: function(val) { return parseInt(val, 10); },
+ *   encode: function(val) { return val && val.toString(); },
+ *   equals: function(a, b) { return this.is(a) && a === b; },
+ *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },
+ *   pattern: /\d+/
+ * }
+ * 
+ * + * @property {RegExp} pattern The regular expression pattern used to match values of this type when + * coming from a substring of a URL. + * + * @returns {Object} Returns a new `Type` object. + */ +function Type(config) { + extend(this, config); +} + +/** + * @ngdoc function + * @name ui.router.util.type:Type#is + * @methodOf ui.router.util.type:Type + * + * @description + * Detects whether a value is of a particular type. Accepts a native (decoded) value + * and determines whether it matches the current `Type` object. + * + * @param {*} val The value to check. + * @param {string} key Optional. If the type check is happening in the context of a specific + * {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the + * parameter in which `val` is stored. Can be used for meta-programming of `Type` objects. + * @returns {Boolean} Returns `true` if the value matches the type, otherwise `false`. + */ +Type.prototype.is = function(val, key) { + return true; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:Type#encode + * @methodOf ui.router.util.type:Type + * + * @description + * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the + * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it + * only needs to be a representation of `val` that has been coerced to a string. + * + * @param {*} val The value to encode. + * @param {string} key The name of the parameter in which `val` is stored. Can be used for + * meta-programming of `Type` objects. + * @returns {string} Returns a string representation of `val` that can be encoded in a URL. + */ +Type.prototype.encode = function(val, key) { + return val; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:Type#decode + * @methodOf ui.router.util.type:Type + * + * @description + * Converts a parameter value (from URL string or transition param) to a custom/native value. + * + * @param {string} val The URL parameter value to decode. + * @param {string} key The name of the parameter in which `val` is stored. Can be used for + * meta-programming of `Type` objects. + * @returns {*} Returns a custom representation of the URL parameter value. + */ +Type.prototype.decode = function(val, key) { + return val; +}; + +/** + * @ngdoc function + * @name ui.router.util.type:Type#equals + * @methodOf ui.router.util.type:Type + * + * @description + * Determines whether two decoded values are equivalent. + * + * @param {*} a A value to compare against. + * @param {*} b A value to compare against. + * @returns {Boolean} Returns `true` if the values are equivalent/equal, otherwise `false`. + */ +Type.prototype.equals = function(a, b) { + return a == b; +}; + +Type.prototype.$subPattern = function() { + var sub = this.pattern.toString(); + return sub.substr(1, sub.length - 2); +}; + +Type.prototype.pattern = /.*/; + +Type.prototype.toString = function() { return "{Type:" + this.name + "}"; }; + +/** Given an encoded string, or a decoded object, returns a decoded object */ +Type.prototype.$normalize = function(val) { + return this.is(val) ? val : this.decode(val); +}; + +/* + * Wraps an existing custom Type as an array of Type, depending on 'mode'. + * e.g.: + * - urlmatcher pattern "/path?{queryParam[]:int}" + * - url: "/path?queryParam=1&queryParam=2 + * - $stateParams.queryParam will be [1, 2] + * if `mode` is "auto", then + * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1 + * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2] + */ +Type.prototype.$asArray = function(mode, isSearch) { + if (!mode) return this; + if (mode === "auto" && !isSearch) throw new Error("'auto' array mode is for query parameters only"); + + function ArrayType(type, mode) { + function bindTo(type, callbackName) { + return function() { + return type[callbackName].apply(type, arguments); + }; + } + + // Wrap non-array value as array + function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); } + // Unwrap array value for "auto" mode. Return undefined for empty array. + function arrayUnwrap(val) { + switch(val.length) { + case 0: return undefined; + case 1: return mode === "auto" ? val[0] : val; + default: return val; + } + } + function falsey(val) { return !val; } + + // Wraps type (.is/.encode/.decode) functions to operate on each value of an array + function arrayHandler(callback, allTruthyMode) { + return function handleArray(val) { + if (isArray(val) && val.length === 0) return val; + val = arrayWrap(val); + var result = map(val, callback); + if (allTruthyMode === true) + return filter(result, falsey).length === 0; + return arrayUnwrap(result); + }; + } + + // Wraps type (.equals) functions to operate on each value of an array + function arrayEqualsHandler(callback) { + return function handleArray(val1, val2) { + var left = arrayWrap(val1), right = arrayWrap(val2); + if (left.length !== right.length) return false; + for (var i = 0; i < left.length; i++) { + if (!callback(left[i], right[i])) return false; + } + return true; + }; + } + + this.encode = arrayHandler(bindTo(type, 'encode')); + this.decode = arrayHandler(bindTo(type, 'decode')); + this.is = arrayHandler(bindTo(type, 'is'), true); + this.equals = arrayEqualsHandler(bindTo(type, 'equals')); + this.pattern = type.pattern; + this.$normalize = arrayHandler(bindTo(type, '$normalize')); + this.name = type.name; + this.$arrayMode = mode; + } + + return new ArrayType(this, mode); +}; + + + +/** + * @ngdoc object + * @name ui.router.util.$urlMatcherFactory + * + * @description + * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory + * is also available to providers under the name `$urlMatcherFactoryProvider`. + */ +function $UrlMatcherFactory() { + $$UMFP = this; + + var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false; + + // Use tildes to pre-encode slashes. + // If the slashes are simply URLEncoded, the browser can choose to pre-decode them, + // and bidirectional encoding/decoding fails. + // Tilde was chosen because it's not a RFC 3986 section 2.2 Reserved Character + function valToString(val) { return val != null ? val.toString().replace(/~/g, "~~").replace(/\//g, "~2F") : val; } + function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, "/").replace(/~~/g, "~") : val; } + + var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = { + "string": { + encode: valToString, + decode: valFromString, + // TODO: in 1.0, make string .is() return false if value is undefined/null by default. + // In 0.2.x, string params are optional by default for backwards compat + is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; }, + pattern: /[^/]*/ + }, + "int": { + encode: valToString, + decode: function(val) { return parseInt(val, 10); }, + is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; }, + pattern: /\d+/ + }, + "bool": { + encode: function(val) { return val ? 1 : 0; }, + decode: function(val) { return parseInt(val, 10) !== 0; }, + is: function(val) { return val === true || val === false; }, + pattern: /0|1/ + }, + "date": { + encode: function (val) { + if (!this.is(val)) + return undefined; + return [ val.getFullYear(), + ('0' + (val.getMonth() + 1)).slice(-2), + ('0' + val.getDate()).slice(-2) + ].join("-"); + }, + decode: function (val) { + if (this.is(val)) return val; + var match = this.capture.exec(val); + return match ? new Date(match[1], match[2] - 1, match[3]) : undefined; + }, + is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); }, + equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); }, + pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/, + capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/ + }, + "json": { + encode: angular.toJson, + decode: angular.fromJson, + is: angular.isObject, + equals: angular.equals, + pattern: /[^/]*/ + }, + "any": { // does not encode/decode + encode: angular.identity, + decode: angular.identity, + equals: angular.equals, + pattern: /.*/ + } + }; + + function getDefaultConfig() { + return { + strict: isStrictMode, + caseInsensitive: isCaseInsensitive + }; + } + + function isInjectable(value) { + return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1]))); + } + + /** + * [Internal] Get the default value of a parameter, which may be an injectable function. + */ + $UrlMatcherFactory.$$getDefaultValue = function(config) { + if (!isInjectable(config.value)) return config.value; + if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); + return injector.invoke(config.value); + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#caseInsensitive + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Defines whether URL matching should be case sensitive (the default behavior), or not. + * + * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`; + * @returns {boolean} the current value of caseInsensitive + */ + this.caseInsensitive = function(value) { + if (isDefined(value)) + isCaseInsensitive = value; + return isCaseInsensitive; + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#strictMode + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Defines whether URLs should match trailing slashes, or not (the default behavior). + * + * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`. + * @returns {boolean} the current value of strictMode + */ + this.strictMode = function(value) { + if (isDefined(value)) + isStrictMode = value; + return isStrictMode; + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Sets the default behavior when generating or matching URLs with default parameter values. + * + * @param {string} value A string that defines the default parameter URL squashing behavior. + * `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL + * `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the + * parameter is surrounded by slashes, squash (remove) one slash from the URL + * any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) + * the parameter value from the URL and replace it with this string. + */ + this.defaultSquashPolicy = function(value) { + if (!isDefined(value)) return defaultSquashPolicy; + if (value !== true && value !== false && !isString(value)) + throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string"); + defaultSquashPolicy = value; + return value; + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#compile + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern. + * + * @param {string} pattern The URL pattern. + * @param {Object} config The config object hash. + * @returns {UrlMatcher} The UrlMatcher. + */ + this.compile = function (pattern, config) { + return new UrlMatcher(pattern, extend(getDefaultConfig(), config)); + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#isMatcher + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Returns true if the specified object is a `UrlMatcher`, or false otherwise. + * + * @param {Object} object The object to perform the type check against. + * @returns {Boolean} Returns `true` if the object matches the `UrlMatcher` interface, by + * implementing all the same methods. + */ + this.isMatcher = function (o) { + if (!isObject(o)) return false; + var result = true; + + forEach(UrlMatcher.prototype, function(val, name) { + if (isFunction(val)) { + result = result && (isDefined(o[name]) && isFunction(o[name])); + } + }); + return result; + }; + + /** + * @ngdoc function + * @name ui.router.util.$urlMatcherFactory#type + * @methodOf ui.router.util.$urlMatcherFactory + * + * @description + * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to + * generate URLs with typed parameters. + * + * @param {string} name The type name. + * @param {Object|Function} definition The type definition. See + * {@link ui.router.util.type:Type `Type`} for information on the values accepted. + * @param {Object|Function} definitionFn (optional) A function that is injected before the app + * runtime starts. The result of this function is merged into the existing `definition`. + * See {@link ui.router.util.type:Type `Type`} for information on the values accepted. + * + * @returns {Object} Returns `$urlMatcherFactoryProvider`. + * + * @example + * This is a simple example of a custom type that encodes and decodes items from an + * array, using the array index as the URL-encoded value: + * + *
+   * var list = ['John', 'Paul', 'George', 'Ringo'];
+   *
+   * $urlMatcherFactoryProvider.type('listItem', {
+   *   encode: function(item) {
+   *     // Represent the list item in the URL using its corresponding index
+   *     return list.indexOf(item);
+   *   },
+   *   decode: function(item) {
+   *     // Look up the list item by index
+   *     return list[parseInt(item, 10)];
+   *   },
+   *   is: function(item) {
+   *     // Ensure the item is valid by checking to see that it appears
+   *     // in the list
+   *     return list.indexOf(item) > -1;
+   *   }
+   * });
+   *
+   * $stateProvider.state('list', {
+   *   url: "/list/{item:listItem}",
+   *   controller: function($scope, $stateParams) {
+   *     console.log($stateParams.item);
+   *   }
+   * });
+   *
+   * // ...
+   *
+   * // Changes URL to '/list/3', logs "Ringo" to the console
+   * $state.go('list', { item: "Ringo" });
+   * 
+ * + * This is a more complex example of a type that relies on dependency injection to + * interact with services, and uses the parameter name from the URL to infer how to + * handle encoding and decoding parameter values: + * + *
+   * // Defines a custom type that gets a value from a service,
+   * // where each service gets different types of values from
+   * // a backend API:
+   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {
+   *
+   *   // Matches up services to URL parameter names
+   *   var services = {
+   *     user: Users,
+   *     post: Posts
+   *   };
+   *
+   *   return {
+   *     encode: function(object) {
+   *       // Represent the object in the URL using its unique ID
+   *       return object.id;
+   *     },
+   *     decode: function(value, key) {
+   *       // Look up the object by ID, using the parameter
+   *       // name (key) to call the correct service
+   *       return services[key].findById(value);
+   *     },
+   *     is: function(object, key) {
+   *       // Check that object is a valid dbObject
+   *       return angular.isObject(object) && object.id && services[key];
+   *     }
+   *     equals: function(a, b) {
+   *       // Check the equality of decoded objects by comparing
+   *       // their unique IDs
+   *       return a.id === b.id;
+   *     }
+   *   };
+   * });
+   *
+   * // In a config() block, you can then attach URLs with
+   * // type-annotated parameters:
+   * $stateProvider.state('users', {
+   *   url: "/users",
+   *   // ...
+   * }).state('users.item', {
+   *   url: "/{user:dbObject}",
+   *   controller: function($scope, $stateParams) {
+   *     // $stateParams.user will now be an object returned from
+   *     // the Users service
+   *   },
+   *   // ...
+   * });
+   * 
+ */ + this.type = function (name, definition, definitionFn) { + if (!isDefined(definition)) return $types[name]; + if ($types.hasOwnProperty(name)) throw new Error("A type named '" + name + "' has already been defined."); + + $types[name] = new Type(extend({ name: name }, definition)); + if (definitionFn) { + typeQueue.push({ name: name, def: definitionFn }); + if (!enqueue) flushTypeQueue(); + } + return this; + }; + + // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s + function flushTypeQueue() { + while(typeQueue.length) { + var type = typeQueue.shift(); + if (type.pattern) throw new Error("You cannot override a type's .pattern at runtime."); + angular.extend($types[type.name], injector.invoke(type.def)); + } + } + + // Register default types. Store them in the prototype of $types. + forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); }); + $types = inherit($types, {}); + + /* No need to document $get, since it returns this */ + this.$get = ['$injector', function ($injector) { + injector = $injector; + enqueue = false; + flushTypeQueue(); + + forEach(defaultTypes, function(type, name) { + if (!$types[name]) $types[name] = new Type(type); + }); + return this; + }]; + + this.Param = function Param(id, type, config, location) { + var self = this; + config = unwrapShorthand(config); + type = getType(config, type, location); + var arrayMode = getArrayMode(); + type = arrayMode ? type.$asArray(arrayMode, location === "search") : type; + if (type.name === "string" && !arrayMode && location === "path" && config.value === undefined) + config.value = ""; // for 0.2.x; in 0.3.0+ do not automatically default to "" + var isOptional = config.value !== undefined; + var squash = getSquashPolicy(config, isOptional); + var replace = getReplace(config, arrayMode, isOptional, squash); + + function unwrapShorthand(config) { + var keys = isObject(config) ? objectKeys(config) : []; + var isShorthand = indexOf(keys, "value") === -1 && indexOf(keys, "type") === -1 && + indexOf(keys, "squash") === -1 && indexOf(keys, "array") === -1; + if (isShorthand) config = { value: config }; + config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; }; + return config; + } + + function getType(config, urlType, location) { + if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations."); + if (urlType) return urlType; + if (!config.type) return (location === "config" ? $types.any : $types.string); + + if (angular.isString(config.type)) + return $types[config.type]; + if (config.type instanceof Type) + return config.type; + return new Type(config.type); + } + + // array config: param name (param[]) overrides default settings. explicit config overrides param name. + function getArrayMode() { + var arrayDefaults = { array: (location === "search" ? "auto" : false) }; + var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {}; + return extend(arrayDefaults, arrayParamNomenclature, config).array; + } + + /** + * returns false, true, or the squash value to indicate the "default parameter url squash policy". + */ + function getSquashPolicy(config, isOptional) { + var squash = config.squash; + if (!isOptional || squash === false) return false; + if (!isDefined(squash) || squash == null) return defaultSquashPolicy; + if (squash === true || isString(squash)) return squash; + throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); + } + + function getReplace(config, arrayMode, isOptional, squash) { + var replace, configuredKeys, defaultPolicy = [ + { from: "", to: (isOptional || arrayMode ? undefined : "") }, + { from: null, to: (isOptional || arrayMode ? undefined : "") } + ]; + replace = isArray(config.replace) ? config.replace : []; + if (isString(squash)) + replace.push({ from: squash, to: undefined }); + configuredKeys = map(replace, function(item) { return item.from; } ); + return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace); + } + + /** + * [Internal] Get the default value of a parameter, which may be an injectable function. + */ + function $$getDefaultValue() { + if (!injector) throw new Error("Injectable functions cannot be called at configuration time"); + var defaultValue = injector.invoke(config.$$fn); + if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue)) + throw new Error("Default value (" + defaultValue + ") for parameter '" + self.id + "' is not an instance of Type (" + self.type.name + ")"); + return defaultValue; + } + + /** + * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the + * default value, which may be the result of an injectable function. + */ + function $value(value) { + function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; } + function $replace(value) { + var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; }); + return replacement.length ? replacement[0] : value; + } + value = $replace(value); + return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value); + } + + function toString() { return "{Param:" + id + " " + type + " squash: '" + squash + "' optional: " + isOptional + "}"; } + + extend(this, { + id: id, + type: type, + location: location, + array: arrayMode, + squash: squash, + replace: replace, + isOptional: isOptional, + value: $value, + dynamic: undefined, + config: config, + toString: toString + }); + }; + + function ParamSet(params) { + extend(this, params || {}); + } + + ParamSet.prototype = { + $$new: function() { + return inherit(this, extend(new ParamSet(), { $$parent: this})); + }, + $$keys: function () { + var keys = [], chain = [], parent = this, + ignore = objectKeys(ParamSet.prototype); + while (parent) { chain.push(parent); parent = parent.$$parent; } + chain.reverse(); + forEach(chain, function(paramset) { + forEach(objectKeys(paramset), function(key) { + if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key); + }); + }); + return keys; + }, + $$values: function(paramValues) { + var values = {}, self = this; + forEach(self.$$keys(), function(key) { + values[key] = self[key].value(paramValues && paramValues[key]); + }); + return values; + }, + $$equals: function(paramValues1, paramValues2) { + var equal = true, self = this; + forEach(self.$$keys(), function(key) { + var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key]; + if (!self[key].type.equals(left, right)) equal = false; + }); + return equal; + }, + $$validates: function $$validate(paramValues) { + var keys = this.$$keys(), i, param, rawVal, normalized, encoded; + for (i = 0; i < keys.length; i++) { + param = this[keys[i]]; + rawVal = paramValues[keys[i]]; + if ((rawVal === undefined || rawVal === null) && param.isOptional) + break; // There was no parameter value, but the param is optional + normalized = param.type.$normalize(rawVal); + if (!param.type.is(normalized)) + return false; // The value was not of the correct Type, and could not be decoded to the correct Type + encoded = param.type.encode(normalized); + if (angular.isString(encoded) && !param.type.pattern.exec(encoded)) + return false; // The value was of the correct type, but when encoded, did not match the Type's regexp + } + return true; + }, + $$parent: undefined + }; + + this.ParamSet = ParamSet; +} + +// Register as a provider so it's available to other providers +angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory); +angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]); diff --git a/afb-client/bower_components/angular-ui-router/src/urlRouter.js b/afb-client/bower_components/angular-ui-router/src/urlRouter.js new file mode 100644 index 0000000..8ec704b --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/urlRouter.js @@ -0,0 +1,431 @@ +/** + * @ngdoc object + * @name ui.router.router.$urlRouterProvider + * + * @requires ui.router.util.$urlMatcherFactoryProvider + * @requires $locationProvider + * + * @description + * `$urlRouterProvider` has the responsibility of watching `$location`. + * When `$location` changes it runs through a list of rules one by one until a + * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify + * a url in a state configuration. All urls are compiled into a UrlMatcher object. + * + * There are several methods on `$urlRouterProvider` that make it useful to use directly + * in your module config. + */ +$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider']; +function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { + var rules = [], otherwise = null, interceptDeferred = false, listener; + + // Returns a string that is a prefix of all strings matching the RegExp + function regExpPrefix(re) { + var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source); + return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : ''; + } + + // Interpolates matched values into a String.replace()-style pattern + function interpolate(pattern, match) { + return pattern.replace(/\$(\$|\d{1,2})/, function (m, what) { + return match[what === '$' ? 0 : Number(what)]; + }); + } + + /** + * @ngdoc function + * @name ui.router.router.$urlRouterProvider#rule + * @methodOf ui.router.router.$urlRouterProvider + * + * @description + * Defines rules that are used by `$urlRouterProvider` to find matches for + * specific URLs. + * + * @example + *
+   * var app = angular.module('app', ['ui.router.router']);
+   *
+   * app.config(function ($urlRouterProvider) {
+   *   // Here's an example of how you might allow case insensitive urls
+   *   $urlRouterProvider.rule(function ($injector, $location) {
+   *     var path = $location.path(),
+   *         normalized = path.toLowerCase();
+   *
+   *     if (path !== normalized) {
+   *       return normalized;
+   *     }
+   *   });
+   * });
+   * 
+ * + * @param {function} rule Handler function that takes `$injector` and `$location` + * services as arguments. You can use them to return a valid path as a string. + * + * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance + */ + this.rule = function (rule) { + if (!isFunction(rule)) throw new Error("'rule' must be a function"); + rules.push(rule); + return this; + }; + + /** + * @ngdoc object + * @name ui.router.router.$urlRouterProvider#otherwise + * @methodOf ui.router.router.$urlRouterProvider + * + * @description + * Defines a path that is used when an invalid route is requested. + * + * @example + *
+   * var app = angular.module('app', ['ui.router.router']);
+   *
+   * app.config(function ($urlRouterProvider) {
+   *   // if the path doesn't match any of the urls you configured
+   *   // otherwise will take care of routing the user to the
+   *   // specified url
+   *   $urlRouterProvider.otherwise('/index');
+   *
+   *   // Example of using function rule as param
+   *   $urlRouterProvider.otherwise(function ($injector, $location) {
+   *     return '/a/valid/url';
+   *   });
+   * });
+   * 
+ * + * @param {string|function} rule The url path you want to redirect to or a function + * rule that returns the url path. The function version is passed two params: + * `$injector` and `$location` services, and must return a url string. + * + * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance + */ + this.otherwise = function (rule) { + if (isString(rule)) { + var redirect = rule; + rule = function () { return redirect; }; + } + else if (!isFunction(rule)) throw new Error("'rule' must be a function"); + otherwise = rule; + return this; + }; + + + function handleIfMatch($injector, handler, match) { + if (!match) return false; + var result = $injector.invoke(handler, handler, { $match: match }); + return isDefined(result) ? result : true; + } + + /** + * @ngdoc function + * @name ui.router.router.$urlRouterProvider#when + * @methodOf ui.router.router.$urlRouterProvider + * + * @description + * Registers a handler for a given url matching. + * + * If the handler is a string, it is + * treated as a redirect, and is interpolated according to the syntax of match + * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). + * + * If the handler is a function, it is injectable. It gets invoked if `$location` + * matches. You have the option of inject the match object as `$match`. + * + * The handler can return + * + * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` + * will continue trying to find another one that matches. + * - **string** which is treated as a redirect and passed to `$location.url()` + * - **void** or any **truthy** value tells `$urlRouter` that the url was handled. + * + * @example + *
+   * var app = angular.module('app', ['ui.router.router']);
+   *
+   * app.config(function ($urlRouterProvider) {
+   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {
+   *     if ($state.$current.navigable !== state ||
+   *         !equalForKeys($match, $stateParams) {
+   *      $state.transitionTo(state, $match, false);
+   *     }
+   *   });
+   * });
+   * 
+ * + * @param {string|object} what The incoming path that you want to redirect. + * @param {string|function} handler The path you want to redirect your user to. + */ + this.when = function (what, handler) { + var redirect, handlerIsString = isString(handler); + if (isString(what)) what = $urlMatcherFactory.compile(what); + + if (!handlerIsString && !isFunction(handler) && !isArray(handler)) + throw new Error("invalid 'handler' in when()"); + + var strategies = { + matcher: function (what, handler) { + if (handlerIsString) { + redirect = $urlMatcherFactory.compile(handler); + handler = ['$match', function ($match) { return redirect.format($match); }]; + } + return extend(function ($injector, $location) { + return handleIfMatch($injector, handler, what.exec($location.path(), $location.search())); + }, { + prefix: isString(what.prefix) ? what.prefix : '' + }); + }, + regex: function (what, handler) { + if (what.global || what.sticky) throw new Error("when() RegExp must not be global or sticky"); + + if (handlerIsString) { + redirect = handler; + handler = ['$match', function ($match) { return interpolate(redirect, $match); }]; + } + return extend(function ($injector, $location) { + return handleIfMatch($injector, handler, what.exec($location.path())); + }, { + prefix: regExpPrefix(what) + }); + } + }; + + var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp }; + + for (var n in check) { + if (check[n]) return this.rule(strategies[n](what, handler)); + } + + throw new Error("invalid 'what' in when()"); + }; + + /** + * @ngdoc function + * @name ui.router.router.$urlRouterProvider#deferIntercept + * @methodOf ui.router.router.$urlRouterProvider + * + * @description + * Disables (or enables) deferring location change interception. + * + * If you wish to customize the behavior of syncing the URL (for example, if you wish to + * defer a transition but maintain the current URL), call this method at configuration time. + * Then, at run time, call `$urlRouter.listen()` after you have configured your own + * `$locationChangeSuccess` event handler. + * + * @example + *
+   * var app = angular.module('app', ['ui.router.router']);
+   *
+   * app.config(function ($urlRouterProvider) {
+   *
+   *   // Prevent $urlRouter from automatically intercepting URL changes;
+   *   // this allows you to configure custom behavior in between
+   *   // location changes and route synchronization:
+   *   $urlRouterProvider.deferIntercept();
+   *
+   * }).run(function ($rootScope, $urlRouter, UserService) {
+   *
+   *   $rootScope.$on('$locationChangeSuccess', function(e) {
+   *     // UserService is an example service for managing user state
+   *     if (UserService.isLoggedIn()) return;
+   *
+   *     // Prevent $urlRouter's default handler from firing
+   *     e.preventDefault();
+   *
+   *     UserService.handleLogin().then(function() {
+   *       // Once the user has logged in, sync the current URL
+   *       // to the router:
+   *       $urlRouter.sync();
+   *     });
+   *   });
+   *
+   *   // Configures $urlRouter's listener *after* your custom listener
+   *   $urlRouter.listen();
+   * });
+   * 
+ * + * @param {boolean} defer Indicates whether to defer location change interception. Passing + no parameter is equivalent to `true`. + */ + this.deferIntercept = function (defer) { + if (defer === undefined) defer = true; + interceptDeferred = defer; + }; + + /** + * @ngdoc object + * @name ui.router.router.$urlRouter + * + * @requires $location + * @requires $rootScope + * @requires $injector + * @requires $browser + * + * @description + * + */ + this.$get = $get; + $get.$inject = ['$location', '$rootScope', '$injector', '$browser', '$sniffer']; + function $get( $location, $rootScope, $injector, $browser, $sniffer) { + + var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl; + + function appendBasePath(url, isHtml5, absolute) { + if (baseHref === '/') return url; + if (isHtml5) return baseHref.slice(0, -1) + url; + if (absolute) return baseHref.slice(1) + url; + return url; + } + + // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree + function update(evt) { + if (evt && evt.defaultPrevented) return; + var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl; + lastPushedUrl = undefined; + // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573 + //if (ignoreUpdate) return true; + + function check(rule) { + var handled = rule($injector, $location); + + if (!handled) return false; + if (isString(handled)) $location.replace().url(handled); + return true; + } + var n = rules.length, i; + + for (i = 0; i < n; i++) { + if (check(rules[i])) return; + } + // always check otherwise last to allow dynamic updates to the set of rules + if (otherwise) check(otherwise); + } + + function listen() { + listener = listener || $rootScope.$on('$locationChangeSuccess', update); + return listener; + } + + if (!interceptDeferred) listen(); + + return { + /** + * @ngdoc function + * @name ui.router.router.$urlRouter#sync + * @methodOf ui.router.router.$urlRouter + * + * @description + * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`. + * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event, + * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed + * with the transition by calling `$urlRouter.sync()`. + * + * @example + *
+       * angular.module('app', ['ui.router'])
+       *   .run(function($rootScope, $urlRouter) {
+       *     $rootScope.$on('$locationChangeSuccess', function(evt) {
+       *       // Halt state change from even starting
+       *       evt.preventDefault();
+       *       // Perform custom logic
+       *       var meetsRequirement = ...
+       *       // Continue with the update and state transition if logic allows
+       *       if (meetsRequirement) $urlRouter.sync();
+       *     });
+       * });
+       * 
+ */ + sync: function() { + update(); + }, + + listen: function() { + return listen(); + }, + + update: function(read) { + if (read) { + location = $location.url(); + return; + } + if ($location.url() === location) return; + + $location.url(location); + $location.replace(); + }, + + push: function(urlMatcher, params, options) { + var url = urlMatcher.format(params || {}); + + // Handle the special hash param, if needed + if (url !== null && params && params['#']) { + url += '#' + params['#']; + } + + $location.url(url); + lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined; + if (options && options.replace) $location.replace(); + }, + + /** + * @ngdoc function + * @name ui.router.router.$urlRouter#href + * @methodOf ui.router.router.$urlRouter + * + * @description + * A URL generation method that returns the compiled URL for a given + * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters. + * + * @example + *
+       * $bob = $urlRouter.href(new UrlMatcher("/about/:person"), {
+       *   person: "bob"
+       * });
+       * // $bob == "/about/bob";
+       * 
+ * + * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate. + * @param {object=} params An object of parameter values to fill the matcher's required parameters. + * @param {object=} options Options object. The options are: + * + * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". + * + * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher` + */ + href: function(urlMatcher, params, options) { + if (!urlMatcher.validates(params)) return null; + + var isHtml5 = $locationProvider.html5Mode(); + if (angular.isObject(isHtml5)) { + isHtml5 = isHtml5.enabled; + } + + isHtml5 = isHtml5 && $sniffer.history; + + var url = urlMatcher.format(params); + options = options || {}; + + if (!isHtml5 && url !== null) { + url = "#" + $locationProvider.hashPrefix() + url; + } + + // Handle special hash param, if needed + if (url !== null && params && params['#']) { + url += '#' + params['#']; + } + + url = appendBasePath(url, isHtml5, options.absolute); + + if (!options.absolute || !url) { + return url; + } + + var slash = (!isHtml5 && url ? '/' : ''), port = $location.port(); + port = (port === 80 || port === 443 ? '' : ':' + port); + + return [$location.protocol(), '://', $location.host(), port, slash, url].join(''); + } + }; + } +} + +angular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider); diff --git a/afb-client/bower_components/angular-ui-router/src/view.js b/afb-client/bower_components/angular-ui-router/src/view.js new file mode 100644 index 0000000..94334d3 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/view.js @@ -0,0 +1,45 @@ + +$ViewProvider.$inject = []; +function $ViewProvider() { + + this.$get = $get; + /** + * @ngdoc object + * @name ui.router.state.$view + * + * @requires ui.router.util.$templateFactory + * @requires $rootScope + * + * @description + * + */ + $get.$inject = ['$rootScope', '$templateFactory']; + function $get( $rootScope, $templateFactory) { + return { + // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... }) + /** + * @ngdoc function + * @name ui.router.state.$view#load + * @methodOf ui.router.state.$view + * + * @description + * + * @param {string} name name + * @param {object} options option object. + */ + load: function load(name, options) { + var result, defaults = { + template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {} + }; + options = extend(defaults, options); + + if (options.view) { + result = $templateFactory.fromConfig(options.view, options.params, options.locals); + } + return result; + } + }; + } +} + +angular.module('ui.router.state').provider('$view', $ViewProvider); diff --git a/afb-client/bower_components/angular-ui-router/src/viewDirective.js b/afb-client/bower_components/angular-ui-router/src/viewDirective.js new file mode 100644 index 0000000..c2eaa3d --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/viewDirective.js @@ -0,0 +1,351 @@ +var ngMajorVer = angular.version.major; +var ngMinorVer = angular.version.minor; +/** + * @ngdoc directive + * @name ui.router.state.directive:ui-view + * + * @requires ui.router.state.$state + * @requires $compile + * @requires $controller + * @requires $injector + * @requires ui.router.state.$uiViewScroll + * @requires $document + * + * @restrict ECA + * + * @description + * The ui-view directive tells $state where to place your templates. + * + * @param {string=} name A view name. The name should be unique amongst the other views in the + * same state. You can have views of the same name that live in different states. + * + * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window + * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll + * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you + * scroll ui-view elements into view when they are populated during a state activation. + * + * @param {string=} noanimation If truthy, the non-animated renderer will be selected (no animations + * will be applied to the ui-view) + * + * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) + * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.* + * + * @param {string=} onload Expression to evaluate whenever the view updates. + * + * @example + * A view can be unnamed or named. + *
+ * 
+ * 
+ * + * + *
+ *
+ * + * You can only have one unnamed view within any template (or root html). If you are only using a + * single view and it is unnamed then you can populate it like so: + *
+ * 
+ * $stateProvider.state("home", { + * template: "

HELLO!

" + * }) + *
+ * + * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`} + * config property, by name, in this case an empty name: + *
+ * $stateProvider.state("home", {
+ *   views: {
+ *     "": {
+ *       template: "

HELLO!

" + * } + * } + * }) + *
+ * + * But typically you'll only use the views property if you name your view or have more than one view + * in the same template. There's not really a compelling reason to name a view if its the only one, + * but you could if you wanted, like so: + *
+ * 
+ *
+ *
+ * $stateProvider.state("home", {
+ *   views: {
+ *     "main": {
+ *       template: "

HELLO!

" + * } + * } + * }) + *
+ * + * Really though, you'll use views to set up multiple views: + *
+ * 
+ *
+ *
+ *
+ * + *
+ * $stateProvider.state("home", {
+ *   views: {
+ *     "": {
+ *       template: "

HELLO!

" + * }, + * "chart": { + * template: "" + * }, + * "data": { + * template: "" + * } + * } + * }) + *
+ * + * Examples for `autoscroll`: + * + *
+ * 
+ * 
+ *
+ * 
+ * 
+ * 
+ * 
+ * 
+ */ +$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate']; +function $ViewDirective( $state, $injector, $uiViewScroll, $interpolate) { + + function getService() { + return ($injector.has) ? function(service) { + return $injector.has(service) ? $injector.get(service) : null; + } : function(service) { + try { + return $injector.get(service); + } catch (e) { + return null; + } + }; + } + + var service = getService(), + $animator = service('$animator'), + $animate = service('$animate'); + + // Returns a set of DOM manipulation functions based on which Angular version + // it should use + function getRenderer(attrs, scope) { + var statics = { + enter: function (element, target, cb) { target.after(element); cb(); }, + leave: function (element, cb) { element.remove(); cb(); } + }; + + if (!!attrs.noanimation) return statics; + + function animEnabled(element) { + if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element); + if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled(); + return (!!$animator); + } + + // ng 1.2+ + if ($animate) { + return { + enter: function(element, target, cb) { + if (!animEnabled(element)) { + statics.enter(element, target, cb); + } else if (angular.version.minor > 2) { + $animate.enter(element, null, target).then(cb); + } else { + $animate.enter(element, null, target, cb); + } + }, + leave: function(element, cb) { + if (!animEnabled(element)) { + statics.leave(element, cb); + } else if (angular.version.minor > 2) { + $animate.leave(element).then(cb); + } else { + $animate.leave(element, cb); + } + } + }; + } + + // ng 1.1.5 + if ($animator) { + var animate = $animator && $animator(scope, attrs); + + return { + enter: function(element, target, cb) {animate.enter(element, null, target); cb(); }, + leave: function(element, cb) { animate.leave(element); cb(); } + }; + } + + return statics; + } + + var directive = { + restrict: 'ECA', + terminal: true, + priority: 400, + transclude: 'element', + compile: function (tElement, tAttrs, $transclude) { + return function (scope, $element, attrs) { + var previousEl, currentEl, currentScope, latestLocals, + onloadExp = attrs.onload || '', + autoScrollExp = attrs.autoscroll, + renderer = getRenderer(attrs, scope); + + scope.$on('$stateChangeSuccess', function() { + updateView(false); + }); + + updateView(true); + + function cleanupLastView() { + var _previousEl = previousEl; + var _currentScope = currentScope; + + if (_currentScope) { + _currentScope._willBeDestroyed = true; + } + + function cleanOld() { + if (_previousEl) { + _previousEl.remove(); + } + + if (_currentScope) { + _currentScope.$destroy(); + } + } + + if (currentEl) { + renderer.leave(currentEl, function() { + cleanOld(); + previousEl = null; + }); + + previousEl = currentEl; + } else { + cleanOld(); + previousEl = null; + } + + currentEl = null; + currentScope = null; + } + + function updateView(firstTime) { + var newScope, + name = getUiViewName(scope, attrs, $element, $interpolate), + previousLocals = name && $state.$current && $state.$current.locals[name]; + + if (!firstTime && previousLocals === latestLocals || scope._willBeDestroyed) return; // nothing to do + newScope = scope.$new(); + latestLocals = $state.$current.locals[name]; + + /** + * @ngdoc event + * @name ui.router.state.directive:ui-view#$viewContentLoading + * @eventOf ui.router.state.directive:ui-view + * @eventType emits on ui-view directive scope + * @description + * + * Fired once the view **begins loading**, *before* the DOM is rendered. + * + * @param {Object} event Event object. + * @param {string} viewName Name of the view. + */ + newScope.$emit('$viewContentLoading', name); + + var clone = $transclude(newScope, function(clone) { + renderer.enter(clone, $element, function onUiViewEnter() { + if(currentScope) { + currentScope.$emit('$viewContentAnimationEnded'); + } + + if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) { + $uiViewScroll(clone); + } + }); + cleanupLastView(); + }); + + currentEl = clone; + currentScope = newScope; + /** + * @ngdoc event + * @name ui.router.state.directive:ui-view#$viewContentLoaded + * @eventOf ui.router.state.directive:ui-view + * @eventType emits on ui-view directive scope + * @description + * Fired once the view is **loaded**, *after* the DOM is rendered. + * + * @param {Object} event Event object. + * @param {string} viewName Name of the view. + */ + currentScope.$emit('$viewContentLoaded', name); + currentScope.$eval(onloadExp); + } + }; + } + }; + + return directive; +} + +$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate']; +function $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) { + return { + restrict: 'ECA', + priority: -400, + compile: function (tElement) { + var initial = tElement.html(); + return function (scope, $element, attrs) { + var current = $state.$current, + name = getUiViewName(scope, attrs, $element, $interpolate), + locals = current && current.locals[name]; + + if (! locals) { + return; + } + + $element.data('$uiView', { name: name, state: locals.$$state }); + $element.html(locals.$template ? locals.$template : initial); + + var link = $compile($element.contents()); + + if (locals.$$controller) { + locals.$scope = scope; + locals.$element = $element; + var controller = $controller(locals.$$controller, locals); + if (locals.$$controllerAs) { + scope[locals.$$controllerAs] = controller; + } + $element.data('$ngControllerController', controller); + $element.children().data('$ngControllerController', controller); + } + + link(scope); + }; + } + }; +} + +/** + * Shared ui-view code for both directives: + * Given scope, element, and its attributes, return the view's name + */ +function getUiViewName(scope, attrs, element, $interpolate) { + var name = $interpolate(attrs.uiView || attrs.name || '')(scope); + var inherited = element.inheritedData('$uiView'); + return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : '')); +} + +angular.module('ui.router.state').directive('uiView', $ViewDirective); +angular.module('ui.router.state').directive('uiView', $ViewDirectiveFill); diff --git a/afb-client/bower_components/angular-ui-router/src/viewScroll.js b/afb-client/bower_components/angular-ui-router/src/viewScroll.js new file mode 100644 index 0000000..81114e2 --- /dev/null +++ b/afb-client/bower_components/angular-ui-router/src/viewScroll.js @@ -0,0 +1,52 @@ +/** + * @ngdoc object + * @name ui.router.state.$uiViewScrollProvider + * + * @description + * Provider that returns the {@link ui.router.state.$uiViewScroll} service function. + */ +function $ViewScrollProvider() { + + var useAnchorScroll = false; + + /** + * @ngdoc function + * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll + * @methodOf ui.router.state.$uiViewScrollProvider + * + * @description + * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for + * scrolling based on the url anchor. + */ + this.useAnchorScroll = function () { + useAnchorScroll = true; + }; + + /** + * @ngdoc object + * @name ui.router.state.$uiViewScroll + * + * @requires $anchorScroll + * @requires $timeout + * + * @description + * When called with a jqLite element, it scrolls the element into view (after a + * `$timeout` so the DOM has time to refresh). + * + * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor, + * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}. + */ + this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) { + if (useAnchorScroll) { + return $anchorScroll; + } + + return function ($element) { + return $timeout(function () { + $element[0].scrollIntoView(); + }, 0, false); + }; + }]; +} + +angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider); diff --git a/afb-client/bower_components/angular/.bower.json b/afb-client/bower_components/angular/.bower.json new file mode 100644 index 0000000..1b094cf --- /dev/null +++ b/afb-client/bower_components/angular/.bower.json @@ -0,0 +1,17 @@ +{ + "name": "angular", + "version": "1.3.20", + "main": "./angular.js", + "ignore": [], + "dependencies": {}, + "homepage": "https://github.com/angular/bower-angular", + "_release": "1.3.20", + "_resolution": { + "type": "version", + "tag": "v1.3.20", + "commit": "0cd10f27471310fe07167b00f8a4242c6bba4df2" + }, + "_source": "git://github.com/angular/bower-angular.git", + "_target": "~1.3.4", + "_originalSource": "angular" +} \ No newline at end of file diff --git a/afb-client/bower_components/angular/README.md b/afb-client/bower_components/angular/README.md new file mode 100644 index 0000000..d1bc0ed --- /dev/null +++ b/afb-client/bower_components/angular/README.md @@ -0,0 +1,64 @@ +# packaged angular + +This repo is for distribution on `npm` and `bower`. The source for this module is in the +[main AngularJS repo](https://github.com/angular/angular.js). +Please file issues and pull requests against that repo. + +## Install + +You can install this package either with `npm` or with `bower`. + +### npm + +```shell +npm install angular +``` + +Then add a ` +``` + +Or `require('angular')` from your code. + +### bower + +```shell +bower install angular +``` + +Then add a ` +``` + +## Documentation + +Documentation is available on the +[AngularJS docs site](http://docs.angularjs.org/). + +## License + +The MIT License + +Copyright (c) 2010-2015 Google, Inc. http://angularjs.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/afb-client/bower_components/angular/angular-csp.css b/afb-client/bower_components/angular/angular-csp.css new file mode 100644 index 0000000..0ce9d86 --- /dev/null +++ b/afb-client/bower_components/angular/angular-csp.css @@ -0,0 +1,13 @@ +/* Include this file in your html if you are using the CSP mode. */ + +@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; +} diff --git a/afb-client/bower_components/angular/angular.js b/afb-client/bower_components/angular/angular.js new file mode 100644 index 0000000..2445ab5 --- /dev/null +++ b/afb-client/bower_components/angular/angular.js @@ -0,0 +1,26451 @@ +/** + * @license AngularJS v1.3.20 + * (c) 2010-2014 Google, Inc. http://angularjs.org + * License: MIT + */ +(function(window, document, undefined) {'use strict'; + +/** + * @description + * + * This object provides a utility for producing rich Error messages within + * Angular. It can be called as follows: + * + * var exampleMinErr = minErr('example'); + * throw exampleMinErr('one', 'This {0} is {1}', foo, bar); + * + * The above creates an instance of minErr in the example namespace. The + * resulting error will have a namespaced error code of example.one. The + * resulting error will replace {0} with the value of foo, and {1} with the + * value of bar. The object is not restricted in the number of arguments it can + * take. + * + * If fewer arguments are specified than necessary for interpolation, the extra + * interpolation markers will be preserved in the final string. + * + * Since data will be parsed statically during a build step, some restrictions + * are applied with respect to how minErr instances are created and called. + * Instances should have names of the form namespaceMinErr for a minErr created + * using minErr('namespace') . Error codes, namespaces and template strings + * should all be static strings, not variables or general expressions. + * + * @param {string} module The namespace to use for the new minErr instance. + * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning + * error from returned function, for cases when a particular type of error is useful. + * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance + */ + +function minErr(module, ErrorConstructor) { + ErrorConstructor = ErrorConstructor || Error; + return function() { + var code = arguments[0], + prefix = '[' + (module ? module + ':' : '') + code + '] ', + template = arguments[1], + templateArgs = arguments, + + message, i; + + message = prefix + template.replace(/\{\d+\}/g, function(match) { + var index = +match.slice(1, -1), arg; + + if (index + 2 < templateArgs.length) { + return toDebugString(templateArgs[index + 2]); + } + return match; + }); + + message = message + '\nhttp://errors.angularjs.org/1.3.20/' + + (module ? module + '/' : '') + code; + for (i = 2; i < arguments.length; i++) { + message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' + + encodeURIComponent(toDebugString(arguments[i])); + } + return new ErrorConstructor(message); + }; +} + +/* We need to tell jshint what variables are being exported */ +/* global angular: true, + msie: true, + jqLite: true, + jQuery: true, + slice: true, + splice: true, + push: true, + toString: true, + ngMinErr: true, + angularModule: true, + uid: true, + REGEX_STRING_REGEXP: true, + VALIDITY_STATE_PROPERTY: true, + + lowercase: true, + uppercase: true, + manualLowercase: true, + manualUppercase: true, + nodeName_: true, + isArrayLike: true, + forEach: true, + sortedKeys: true, + forEachSorted: true, + reverseParams: true, + nextUid: true, + setHashKey: true, + extend: true, + int: true, + inherit: true, + noop: true, + identity: true, + valueFn: true, + isUndefined: true, + isDefined: true, + isObject: true, + isString: true, + isNumber: true, + isDate: true, + isArray: true, + isFunction: true, + isRegExp: true, + isWindow: true, + isScope: true, + isFile: true, + isFormData: true, + isBlob: true, + isBoolean: true, + isPromiseLike: true, + trim: true, + escapeForRegexp: true, + isElement: true, + makeMap: true, + includes: true, + arrayRemove: true, + copy: true, + shallowCopy: true, + equals: true, + csp: true, + concat: true, + sliceArgs: true, + bind: true, + toJsonReplacer: true, + toJson: true, + fromJson: true, + startingTag: true, + tryDecodeURIComponent: true, + parseKeyValue: true, + toKeyValue: true, + encodeUriSegment: true, + encodeUriQuery: true, + angularInit: true, + bootstrap: true, + getTestability: true, + snake_case: true, + bindJQuery: true, + assertArg: true, + assertArgFn: true, + assertNotHasOwnProperty: true, + getter: true, + getBlockNodes: true, + hasOwnProperty: true, + createMap: true, + + NODE_TYPE_ELEMENT: true, + NODE_TYPE_ATTRIBUTE: true, + NODE_TYPE_TEXT: true, + NODE_TYPE_COMMENT: true, + NODE_TYPE_DOCUMENT: true, + NODE_TYPE_DOCUMENT_FRAGMENT: true, +*/ + +//////////////////////////////////// + +/** + * @ngdoc module + * @name ng + * @module ng + * @description + * + * # ng (core module) + * The ng module is loaded by default when an AngularJS application is started. The module itself + * contains the essential components for an AngularJS application to function. The table below + * lists a high level breakdown of each of the services/factories, filters, directives and testing + * components available within this core module. + * + *
+ */ + +var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/; + +// The name of a form control's ValidityState property. +// This is used so that it's possible for internal tests to create mock ValidityStates. +var VALIDITY_STATE_PROPERTY = 'validity'; + +/** + * @ngdoc function + * @name angular.lowercase + * @module ng + * @kind function + * + * @description Converts the specified string to lowercase. + * @param {string} string String to be converted to lowercase. + * @returns {string} Lowercased string. + */ +var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;}; +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** + * @ngdoc function + * @name angular.uppercase + * @module ng + * @kind function + * + * @description Converts the specified string to uppercase. + * @param {string} string String to be converted to uppercase. + * @returns {string} Uppercased string. + */ +var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;}; + + +var manualLowercase = function(s) { + /* jshint bitwise: false */ + return isString(s) + ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);}) + : s; +}; +var manualUppercase = function(s) { + /* jshint bitwise: false */ + return isString(s) + ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);}) + : s; +}; + + +// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish +// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods +// with correct but slower alternatives. +if ('i' !== 'I'.toLowerCase()) { + lowercase = manualLowercase; + uppercase = manualUppercase; +} + + +var + msie, // holds major version number for IE, or NaN if UA is not IE. + jqLite, // delay binding since jQuery could be loaded after us. + jQuery, // delay binding + slice = [].slice, + splice = [].splice, + push = [].push, + toString = Object.prototype.toString, + ngMinErr = minErr('ng'), + + /** @name angular */ + angular = window.angular || (window.angular = {}), + angularModule, + uid = 0; + +/** + * documentMode is an IE-only property + * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx + */ +msie = document.documentMode; + + +/** + * @private + * @param {*} obj + * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, + * String ...) + */ +function isArrayLike(obj) { + if (obj == null || isWindow(obj)) { + return false; + } + + // Support: iOS 8.2 (not reproducible in simulator) + // "length" in obj used to prevent JIT error (gh-11508) + var length = "length" in Object(obj) && obj.length; + + if (obj.nodeType === NODE_TYPE_ELEMENT && length) { + return true; + } + + return isString(obj) || isArray(obj) || length === 0 || + typeof length === 'number' && length > 0 && (length - 1) in obj; +} + +/** + * @ngdoc function + * @name angular.forEach + * @module ng + * @kind function + * + * @description + * Invokes the `iterator` function once for each item in `obj` collection, which can be either an + * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value` + * is the value of an object property or an array element, `key` is the object property key or + * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional. + * + * It is worth noting that `.forEach` does not iterate over inherited properties because it filters + * using the `hasOwnProperty` method. + * + * Unlike ES262's + * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18), + * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just + * return the value provided. + * + ```js + var values = {name: 'misko', gender: 'male'}; + var log = []; + angular.forEach(values, function(value, key) { + this.push(key + ': ' + value); + }, log); + expect(log).toEqual(['name: misko', 'gender: male']); + ``` + * + * @param {Object|Array} obj Object to iterate over. + * @param {Function} iterator Iterator function. + * @param {Object=} context Object to become context (`this`) for the iterator function. + * @returns {Object|Array} Reference to `obj`. + */ + +function forEach(obj, iterator, context) { + var key, length; + if (obj) { + if (isFunction(obj)) { + for (key in obj) { + // Need to check if hasOwnProperty exists, + // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function + if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) { + iterator.call(context, obj[key], key, obj); + } + } + } else if (isArray(obj) || isArrayLike(obj)) { + var isPrimitive = typeof obj !== 'object'; + for (key = 0, length = obj.length; key < length; key++) { + if (isPrimitive || key in obj) { + iterator.call(context, obj[key], key, obj); + } + } + } else if (obj.forEach && obj.forEach !== forEach) { + obj.forEach(iterator, context, obj); + } else { + for (key in obj) { + if (obj.hasOwnProperty(key)) { + iterator.call(context, obj[key], key, obj); + } + } + } + } + return obj; +} + +function sortedKeys(obj) { + return Object.keys(obj).sort(); +} + +function forEachSorted(obj, iterator, context) { + var keys = sortedKeys(obj); + for (var i = 0; i < keys.length; i++) { + iterator.call(context, obj[keys[i]], keys[i]); + } + return keys; +} + + +/** + * when using forEach the params are value, key, but it is often useful to have key, value. + * @param {function(string, *)} iteratorFn + * @returns {function(*, string)} + */ +function reverseParams(iteratorFn) { + return function(value, key) { iteratorFn(key, value); }; +} + +/** + * A consistent way of creating unique IDs in angular. + * + * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before + * we hit number precision issues in JavaScript. + * + * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M + * + * @returns {number} an unique alpha-numeric string + */ +function nextUid() { + return ++uid; +} + + +/** + * Set or clear the hashkey for an object. + * @param obj object + * @param h the hashkey (!truthy to delete the hashkey) + */ +function setHashKey(obj, h) { + if (h) { + obj.$$hashKey = h; + } else { + delete obj.$$hashKey; + } +} + +/** + * @ngdoc function + * @name angular.extend + * @module ng + * @kind function + * + * @description + * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s) + * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so + * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`. + * Note: Keep in mind that `angular.extend` does not support recursive merge (deep copy). + * + * @param {Object} dst Destination object. + * @param {...Object} src Source object(s). + * @returns {Object} Reference to `dst`. + */ +function extend(dst) { + var h = dst.$$hashKey; + + for (var i = 1, ii = arguments.length; i < ii; i++) { + var obj = arguments[i]; + if (obj) { + var keys = Object.keys(obj); + for (var j = 0, jj = keys.length; j < jj; j++) { + var key = keys[j]; + dst[key] = obj[key]; + } + } + } + + setHashKey(dst, h); + return dst; +} + +function int(str) { + return parseInt(str, 10); +} + + +function inherit(parent, extra) { + return extend(Object.create(parent), extra); +} + +/** + * @ngdoc function + * @name angular.noop + * @module ng + * @kind function + * + * @description + * A function that performs no operations. This function can be useful when writing code in the + * functional style. + ```js + function foo(callback) { + var result = calculateResult(); + (callback || angular.noop)(result); + } + ``` + */ +function noop() {} +noop.$inject = []; + + +/** + * @ngdoc function + * @name angular.identity + * @module ng + * @kind function + * + * @description + * A function that returns its first argument. This function is useful when writing code in the + * functional style. + * + ```js + function transformer(transformationFn, value) { + return (transformationFn || angular.identity)(value); + }; + ``` + * @param {*} value to be returned. + * @returns {*} the value passed in. + */ +function identity($) {return $;} +identity.$inject = []; + + +function valueFn(value) {return function() {return value;};} + +/** + * @ngdoc function + * @name angular.isUndefined + * @module ng + * @kind function + * + * @description + * Determines if a reference is undefined. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is undefined. + */ +function isUndefined(value) {return typeof value === 'undefined';} + + +/** + * @ngdoc function + * @name angular.isDefined + * @module ng + * @kind function + * + * @description + * Determines if a reference is defined. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is defined. + */ +function isDefined(value) {return typeof value !== 'undefined';} + + +/** + * @ngdoc function + * @name angular.isObject + * @module ng + * @kind function + * + * @description + * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not + * considered to be objects. Note that JavaScript arrays are objects. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is an `Object` but not `null`. + */ +function isObject(value) { + // http://jsperf.com/isobject4 + return value !== null && typeof value === 'object'; +} + + +/** + * @ngdoc function + * @name angular.isString + * @module ng + * @kind function + * + * @description + * Determines if a reference is a `String`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `String`. + */ +function isString(value) {return typeof value === 'string';} + + +/** + * @ngdoc function + * @name angular.isNumber + * @module ng + * @kind function + * + * @description + * Determines if a reference is a `Number`. + * + * This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`. + * + * If you wish to exclude these then you can use the native + * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite) + * method. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Number`. + */ +function isNumber(value) {return typeof value === 'number';} + + +/** + * @ngdoc function + * @name angular.isDate + * @module ng + * @kind function + * + * @description + * Determines if a value is a date. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Date`. + */ +function isDate(value) { + return toString.call(value) === '[object Date]'; +} + + +/** + * @ngdoc function + * @name angular.isArray + * @module ng + * @kind function + * + * @description + * Determines if a reference is an `Array`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is an `Array`. + */ +var isArray = Array.isArray; + +/** + * @ngdoc function + * @name angular.isFunction + * @module ng + * @kind function + * + * @description + * Determines if a reference is a `Function`. + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `Function`. + */ +function isFunction(value) {return typeof value === 'function';} + + +/** + * Determines if a value is a regular expression object. + * + * @private + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a `RegExp`. + */ +function isRegExp(value) { + return toString.call(value) === '[object RegExp]'; +} + + +/** + * Checks if `obj` is a window object. + * + * @private + * @param {*} obj Object to check + * @returns {boolean} True if `obj` is a window obj. + */ +function isWindow(obj) { + return obj && obj.window === obj; +} + + +function isScope(obj) { + return obj && obj.$evalAsync && obj.$watch; +} + + +function isFile(obj) { + return toString.call(obj) === '[object File]'; +} + + +function isFormData(obj) { + return toString.call(obj) === '[object FormData]'; +} + + +function isBlob(obj) { + return toString.call(obj) === '[object Blob]'; +} + + +function isBoolean(value) { + return typeof value === 'boolean'; +} + + +function isPromiseLike(obj) { + return obj && isFunction(obj.then); +} + + +var trim = function(value) { + return isString(value) ? value.trim() : value; +}; + +// Copied from: +// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021 +// Prereq: s is a string. +var escapeForRegexp = function(s) { + return s.replace(/([-()\[\]{}+?*.$\^|,:#= 0) + array.splice(index, 1); + return value; +} + +/** + * @ngdoc function + * @name angular.copy + * @module ng + * @kind function + * + * @description + * Creates a deep copy of `source`, which should be an object or an array. + * + * * If no destination is supplied, a copy of the object or array is created. + * * If a destination is provided, all of its elements (for arrays) or properties (for objects) + * are deleted and then all elements/properties from the source are copied to it. + * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned. + * * If `source` is identical to 'destination' an exception will be thrown. + * + * @param {*} source The source that will be used to make a copy. + * Can be any type, including primitives, `null`, and `undefined`. + * @param {(Object|Array)=} destination Destination into which the source is copied. If + * provided, must be of the same type as `source`. + * @returns {*} The copy or updated `destination`, if `destination` was specified. + * + * @example + + +
+
+ Name:
+ E-mail:
+ Gender: male + female
+ + +
+
form = {{user | json}}
+
master = {{master | json}}
+
+ + +
+
+ */ +function copy(source, destination, stackSource, stackDest) { + if (isWindow(source) || isScope(source)) { + throw ngMinErr('cpws', + "Can't copy! Making copies of Window or Scope instances is not supported."); + } + + if (!destination) { + destination = source; + if (source) { + if (isArray(source)) { + destination = copy(source, [], stackSource, stackDest); + } else if (isDate(source)) { + destination = new Date(source.getTime()); + } else if (isRegExp(source)) { + destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]); + destination.lastIndex = source.lastIndex; + } else if (isObject(source)) { + var emptyObject = Object.create(Object.getPrototypeOf(source)); + destination = copy(source, emptyObject, stackSource, stackDest); + } + } + } else { + if (source === destination) throw ngMinErr('cpi', + "Can't copy! Source and destination are identical."); + + stackSource = stackSource || []; + stackDest = stackDest || []; + + if (isObject(source)) { + var index = stackSource.indexOf(source); + if (index !== -1) return stackDest[index]; + + stackSource.push(source); + stackDest.push(destination); + } + + var result; + if (isArray(source)) { + destination.length = 0; + for (var i = 0; i < source.length; i++) { + result = copy(source[i], null, stackSource, stackDest); + if (isObject(source[i])) { + stackSource.push(source[i]); + stackDest.push(result); + } + destination.push(result); + } + } else { + var h = destination.$$hashKey; + if (isArray(destination)) { + destination.length = 0; + } else { + forEach(destination, function(value, key) { + delete destination[key]; + }); + } + for (var key in source) { + if (source.hasOwnProperty(key)) { + result = copy(source[key], null, stackSource, stackDest); + if (isObject(source[key])) { + stackSource.push(source[key]); + stackDest.push(result); + } + destination[key] = result; + } + } + setHashKey(destination,h); + } + + } + return destination; +} + +/** + * Creates a shallow copy of an object, an array or a primitive. + * + * Assumes that there are no proto properties for objects. + */ +function shallowCopy(src, dst) { + if (isArray(src)) { + dst = dst || []; + + for (var i = 0, ii = src.length; i < ii; i++) { + dst[i] = src[i]; + } + } else if (isObject(src)) { + dst = dst || {}; + + for (var key in src) { + if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { + dst[key] = src[key]; + } + } + } + + return dst || src; +} + + +/** + * @ngdoc function + * @name angular.equals + * @module ng + * @kind function + * + * @description + * Determines if two objects or two values are equivalent. Supports value types, regular + * expressions, arrays and objects. + * + * Two objects or values are considered equivalent if at least one of the following is true: + * + * * Both objects or values pass `===` comparison. + * * Both objects or values are of the same type and all of their properties are equal by + * comparing them with `angular.equals`. + * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal) + * * Both values represent the same regular expression (In JavaScript, + * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual + * representation matches). + * + * During a property comparison, properties of `function` type and properties with names + * that begin with `$` are ignored. + * + * Scope and DOMWindow objects are being compared only by identify (`===`). + * + * @param {*} o1 Object or value to compare. + * @param {*} o2 Object or value to compare. + * @returns {boolean} True if arguments are equal. + */ +function equals(o1, o2) { + if (o1 === o2) return true; + if (o1 === null || o2 === null) return false; + if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN + var t1 = typeof o1, t2 = typeof o2, length, key, keySet; + if (t1 == t2) { + if (t1 == 'object') { + if (isArray(o1)) { + if (!isArray(o2)) return false; + if ((length = o1.length) == o2.length) { + for (key = 0; key < length; key++) { + if (!equals(o1[key], o2[key])) return false; + } + return true; + } + } else if (isDate(o1)) { + if (!isDate(o2)) return false; + return equals(o1.getTime(), o2.getTime()); + } else if (isRegExp(o1)) { + return isRegExp(o2) ? o1.toString() == o2.toString() : false; + } else { + if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || + isArray(o2) || isDate(o2) || isRegExp(o2)) return false; + keySet = {}; + for (key in o1) { + if (key.charAt(0) === '$' || isFunction(o1[key])) continue; + if (!equals(o1[key], o2[key])) return false; + keySet[key] = true; + } + for (key in o2) { + if (!keySet.hasOwnProperty(key) && + key.charAt(0) !== '$' && + o2[key] !== undefined && + !isFunction(o2[key])) return false; + } + return true; + } + } + } + return false; +} + +var csp = function() { + if (isDefined(csp.isActive_)) return csp.isActive_; + + var active = !!(document.querySelector('[ng-csp]') || + document.querySelector('[data-ng-csp]')); + + if (!active) { + try { + /* jshint -W031, -W054 */ + new Function(''); + /* jshint +W031, +W054 */ + } catch (e) { + active = true; + } + } + + return (csp.isActive_ = active); +}; + + + +function concat(array1, array2, index) { + return array1.concat(slice.call(array2, index)); +} + +function sliceArgs(args, startIndex) { + return slice.call(args, startIndex || 0); +} + + +/* jshint -W101 */ +/** + * @ngdoc function + * @name angular.bind + * @module ng + * @kind function + * + * @description + * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for + * `fn`). You can supply optional `args` that are prebound to the function. This feature is also + * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as + * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application). + * + * @param {Object} self Context which `fn` should be evaluated in. + * @param {function()} fn Function to be bound. + * @param {...*} args Optional arguments to be prebound to the `fn` function call. + * @returns {function()} Function that wraps the `fn` with all the specified bindings. + */ +/* jshint +W101 */ +function bind(self, fn) { + var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; + if (isFunction(fn) && !(fn instanceof RegExp)) { + return curryArgs.length + ? function() { + return arguments.length + ? fn.apply(self, concat(curryArgs, arguments, 0)) + : fn.apply(self, curryArgs); + } + : function() { + return arguments.length + ? fn.apply(self, arguments) + : fn.call(self); + }; + } else { + // in IE, native methods are not functions so they cannot be bound (note: they don't need to be) + return fn; + } +} + + +function toJsonReplacer(key, value) { + var val = value; + + if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') { + val = undefined; + } else if (isWindow(value)) { + val = '$WINDOW'; + } else if (value && document === value) { + val = '$DOCUMENT'; + } else if (isScope(value)) { + val = '$SCOPE'; + } + + return val; +} + + +/** + * @ngdoc function + * @name angular.toJson + * @module ng + * @kind function + * + * @description + * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be + * stripped since angular uses this notation internally. + * + * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON. + * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace. + * If set to an integer, the JSON output will contain that many spaces per indentation. + * @returns {string|undefined} JSON-ified string representing `obj`. + */ +function toJson(obj, pretty) { + if (typeof obj === 'undefined') return undefined; + if (!isNumber(pretty)) { + pretty = pretty ? 2 : null; + } + return JSON.stringify(obj, toJsonReplacer, pretty); +} + + +/** + * @ngdoc function + * @name angular.fromJson + * @module ng + * @kind function + * + * @description + * Deserializes a JSON string. + * + * @param {string} json JSON string to deserialize. + * @returns {Object|Array|string|number} Deserialized JSON string. + */ +function fromJson(json) { + return isString(json) + ? JSON.parse(json) + : json; +} + + +/** + * @returns {string} Returns the string representation of the element. + */ +function startingTag(element) { + element = jqLite(element).clone(); + try { + // turns out IE does not let you set .html() on elements which + // are not allowed to have children. So we just ignore it. + element.empty(); + } catch (e) {} + var elemHtml = jqLite('
').append(element).html(); + try { + return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) : + elemHtml. + match(/^(<[^>]+>)/)[1]. + replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); }); + } catch (e) { + return lowercase(elemHtml); + } + +} + + +///////////////////////////////////////////////// + +/** + * Tries to decode the URI component without throwing an exception. + * + * @private + * @param str value potential URI component to check. + * @returns {boolean} True if `value` can be decoded + * with the decodeURIComponent function. + */ +function tryDecodeURIComponent(value) { + try { + return decodeURIComponent(value); + } catch (e) { + // Ignore any invalid uri component + } +} + + +/** + * Parses an escaped url query string into key-value pairs. + * @returns {Object.} + */ +function parseKeyValue(/**string*/keyValue) { + var obj = {}, key_value, key; + forEach((keyValue || "").split('&'), function(keyValue) { + if (keyValue) { + key_value = keyValue.replace(/\+/g,'%20').split('='); + key = tryDecodeURIComponent(key_value[0]); + if (isDefined(key)) { + var val = isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true; + if (!hasOwnProperty.call(obj, key)) { + obj[key] = val; + } else if (isArray(obj[key])) { + obj[key].push(val); + } else { + obj[key] = [obj[key],val]; + } + } + } + }); + return obj; +} + +function toKeyValue(obj) { + var parts = []; + forEach(obj, function(value, key) { + if (isArray(value)) { + forEach(value, function(arrayValue) { + parts.push(encodeUriQuery(key, true) + + (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true))); + }); + } else { + parts.push(encodeUriQuery(key, true) + + (value === true ? '' : '=' + encodeUriQuery(value, true))); + } + }); + return parts.length ? parts.join('&') : ''; +} + + +/** + * We need our custom method because encodeURIComponent is too aggressive and doesn't follow + * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path + * segments: + * segment = *pchar + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * pct-encoded = "%" HEXDIG HEXDIG + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ +function encodeUriSegment(val) { + return encodeUriQuery(val, true). + replace(/%26/gi, '&'). + replace(/%3D/gi, '='). + replace(/%2B/gi, '+'); +} + + +/** + * This method is intended for encoding *key* or *value* parts of query component. We need a custom + * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be + * encoded per http://tools.ietf.org/html/rfc3986: + * query = *( pchar / "/" / "?" ) + * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" + * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" + * pct-encoded = "%" HEXDIG HEXDIG + * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" + * / "*" / "+" / "," / ";" / "=" + */ +function encodeUriQuery(val, pctEncodeSpaces) { + return encodeURIComponent(val). + replace(/%40/gi, '@'). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%3B/gi, ';'). + replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); +} + +var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-']; + +function getNgAttribute(element, ngAttr) { + var attr, i, ii = ngAttrPrefixes.length; + element = jqLite(element); + for (i = 0; i < ii; ++i) { + attr = ngAttrPrefixes[i] + ngAttr; + if (isString(attr = element.attr(attr))) { + return attr; + } + } + return null; +} + +/** + * @ngdoc directive + * @name ngApp + * @module ng + * + * @element ANY + * @param {angular.Module} ngApp an optional application + * {@link angular.module module} name to load. + * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be + * created in "strict-di" mode. This means that the application will fail to invoke functions which + * do not use explicit function annotation (and are thus unsuitable for minification), as described + * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in + * tracking down the root of these bugs. + * + * @description + * + * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive + * designates the **root element** of the application and is typically placed near the root element + * of the page - e.g. on the `` or `` tags. + * + * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp` + * found in the document will be used to define the root element to auto-bootstrap as an + * application. To run multiple applications in an HTML document you must manually bootstrap them using + * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other. + * + * You can specify an **AngularJS module** to be used as the root module for the application. This + * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It + * should contain the application code needed or have dependencies on other modules that will + * contain the code. See {@link angular.module} for more information. + * + * In the example below if the `ngApp` directive were not placed on the `html` element then the + * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}` + * would not be resolved to `3`. + * + * `ngApp` is the easiest, and most common way to bootstrap an application. + * + + +
+ I can add: {{a}} + {{b}} = {{ a+b }} +
+
+ + angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) { + $scope.a = 1; + $scope.b = 2; + }); + +
+ * + * Using `ngStrictDi`, you would see something like this: + * + + +
+
+ I can add: {{a}} + {{b}} = {{ a+b }} + +

This renders because the controller does not fail to + instantiate, by using explicit annotation style (see + script.js for details) +

+
+ +
+ Name:
+ Hello, {{name}}! + +

This renders because the controller does not fail to + instantiate, by using explicit annotation style + (see script.js for details) +

+
+ +
+ I can add: {{a}} + {{b}} = {{ a+b }} + +

The controller could not be instantiated, due to relying + on automatic function annotations (which are disabled in + strict mode). As such, the content of this section is not + interpolated, and there should be an error in your web console. +

+
+
+
+ + angular.module('ngAppStrictDemo', []) + // BadController will fail to instantiate, due to relying on automatic function annotation, + // rather than an explicit annotation + .controller('BadController', function($scope) { + $scope.a = 1; + $scope.b = 2; + }) + // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated, + // due to using explicit annotations using the array style and $inject property, respectively. + .controller('GoodController1', ['$scope', function($scope) { + $scope.a = 1; + $scope.b = 2; + }]) + .controller('GoodController2', GoodController2); + function GoodController2($scope) { + $scope.name = "World"; + } + GoodController2.$inject = ['$scope']; + + + div[ng-controller] { + margin-bottom: 1em; + -webkit-border-radius: 4px; + border-radius: 4px; + border: 1px solid; + padding: .5em; + } + div[ng-controller^=Good] { + border-color: #d6e9c6; + background-color: #dff0d8; + color: #3c763d; + } + div[ng-controller^=Bad] { + border-color: #ebccd1; + background-color: #f2dede; + color: #a94442; + margin-bottom: 0; + } + +
+ */ +function angularInit(element, bootstrap) { + var appElement, + module, + config = {}; + + // The element `element` has priority over any other element + forEach(ngAttrPrefixes, function(prefix) { + var name = prefix + 'app'; + + if (!appElement && element.hasAttribute && element.hasAttribute(name)) { + appElement = element; + module = element.getAttribute(name); + } + }); + forEach(ngAttrPrefixes, function(prefix) { + var name = prefix + 'app'; + var candidate; + + if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) { + appElement = candidate; + module = candidate.getAttribute(name); + } + }); + if (appElement) { + config.strictDi = getNgAttribute(appElement, "strict-di") !== null; + bootstrap(appElement, module ? [module] : [], config); + } +} + +/** + * @ngdoc function + * @name angular.bootstrap + * @module ng + * @description + * Use this function to manually start up angular application. + * + * See: {@link guide/bootstrap Bootstrap} + * + * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually. + * They must use {@link ng.directive:ngApp ngApp}. + * + * Angular will detect if it has been loaded into the browser more than once and only allow the + * first loaded script to be bootstrapped and will report a warning to the browser console for + * each of the subsequent scripts. This prevents strange results in applications, where otherwise + * multiple instances of Angular try to work on the DOM. + * + * ```html + * + * + * + *
+ * {{greeting}} + *
+ * + * + * + * + * + * ``` + * + * @param {DOMElement} element DOM element which is the root of angular application. + * @param {Array=} modules an array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a `config` block. + * See: {@link angular.module modules} + * @param {Object=} config an object for defining configuration options for the application. The + * following keys are supported: + * + * * `strictDi` - disable automatic function annotation for the application. This is meant to + * assist in finding bugs which break minified code. Defaults to `false`. + * + * @returns {auto.$injector} Returns the newly created injector for this app. + */ +function bootstrap(element, modules, config) { + if (!isObject(config)) config = {}; + var defaultConfig = { + strictDi: false + }; + config = extend(defaultConfig, config); + var doBootstrap = function() { + element = jqLite(element); + + if (element.injector()) { + var tag = (element[0] === document) ? 'document' : startingTag(element); + //Encode angle brackets to prevent input from being sanitized to empty string #8683 + throw ngMinErr( + 'btstrpd', + "App Already Bootstrapped with this Element '{0}'", + tag.replace(//,'>')); + } + + modules = modules || []; + modules.unshift(['$provide', function($provide) { + $provide.value('$rootElement', element); + }]); + + if (config.debugInfoEnabled) { + // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`. + modules.push(['$compileProvider', function($compileProvider) { + $compileProvider.debugInfoEnabled(true); + }]); + } + + modules.unshift('ng'); + var injector = createInjector(modules, config.strictDi); + injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', + function bootstrapApply(scope, element, compile, injector) { + scope.$apply(function() { + element.data('$injector', injector); + compile(element)(scope); + }); + }] + ); + return injector; + }; + + var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/; + var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/; + + if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) { + config.debugInfoEnabled = true; + window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, ''); + } + + if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) { + return doBootstrap(); + } + + window.name = window.name.replace(NG_DEFER_BOOTSTRAP, ''); + angular.resumeBootstrap = function(extraModules) { + forEach(extraModules, function(module) { + modules.push(module); + }); + return doBootstrap(); + }; + + if (isFunction(angular.resumeDeferredBootstrap)) { + angular.resumeDeferredBootstrap(); + } +} + +/** + * @ngdoc function + * @name angular.reloadWithDebugInfo + * @module ng + * @description + * Use this function to reload the current application with debug information turned on. + * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`. + * + * See {@link ng.$compileProvider#debugInfoEnabled} for more. + */ +function reloadWithDebugInfo() { + window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name; + window.location.reload(); +} + +/** + * @name angular.getTestability + * @module ng + * @description + * Get the testability service for the instance of Angular on the given + * element. + * @param {DOMElement} element DOM element which is the root of angular application. + */ +function getTestability(rootElement) { + var injector = angular.element(rootElement).injector(); + if (!injector) { + throw ngMinErr('test', + 'no injector found for element argument to getTestability'); + } + return injector.get('$$testability'); +} + +var SNAKE_CASE_REGEXP = /[A-Z]/g; +function snake_case(name, separator) { + separator = separator || '_'; + return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) { + return (pos ? separator : '') + letter.toLowerCase(); + }); +} + +var bindJQueryFired = false; +var skipDestroyOnNextJQueryCleanData; +function bindJQuery() { + var originalCleanData; + + if (bindJQueryFired) { + return; + } + + // bind to jQuery if present; + jQuery = window.jQuery; + // Use jQuery if it exists with proper functionality, otherwise default to us. + // Angular 1.2+ requires jQuery 1.7+ for on()/off() support. + // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older + // versions. It will not work for sure with jQuery <1.7, though. + if (jQuery && jQuery.fn.on) { + jqLite = jQuery; + extend(jQuery.fn, { + scope: JQLitePrototype.scope, + isolateScope: JQLitePrototype.isolateScope, + controller: JQLitePrototype.controller, + injector: JQLitePrototype.injector, + inheritedData: JQLitePrototype.inheritedData + }); + + // All nodes removed from the DOM via various jQuery APIs like .remove() + // are passed through jQuery.cleanData. Monkey-patch this method to fire + // the $destroy event on all removed nodes. + originalCleanData = jQuery.cleanData; + jQuery.cleanData = function(elems) { + var events; + if (!skipDestroyOnNextJQueryCleanData) { + for (var i = 0, elem; (elem = elems[i]) != null; i++) { + events = jQuery._data(elem, "events"); + if (events && events.$destroy) { + jQuery(elem).triggerHandler('$destroy'); + } + } + } else { + skipDestroyOnNextJQueryCleanData = false; + } + originalCleanData(elems); + }; + } else { + jqLite = JQLite; + } + + angular.element = jqLite; + + // Prevent double-proxying. + bindJQueryFired = true; +} + +/** + * throw error if the argument is falsy. + */ +function assertArg(arg, name, reason) { + if (!arg) { + throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required")); + } + return arg; +} + +function assertArgFn(arg, name, acceptArrayAnnotation) { + if (acceptArrayAnnotation && isArray(arg)) { + arg = arg[arg.length - 1]; + } + + assertArg(isFunction(arg), name, 'not a function, got ' + + (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg)); + return arg; +} + +/** + * throw error if the name given is hasOwnProperty + * @param {String} name the name to test + * @param {String} context the context in which the name is used, such as module or directive + */ +function assertNotHasOwnProperty(name, context) { + if (name === 'hasOwnProperty') { + throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context); + } +} + +/** + * Return the value accessible from the object by path. Any undefined traversals are ignored + * @param {Object} obj starting object + * @param {String} path path to traverse + * @param {boolean} [bindFnToScope=true] + * @returns {Object} value as accessible by path + */ +//TODO(misko): this function needs to be removed +function getter(obj, path, bindFnToScope) { + if (!path) return obj; + var keys = path.split('.'); + var key; + var lastInstance = obj; + var len = keys.length; + + for (var i = 0; i < len; i++) { + key = keys[i]; + if (obj) { + obj = (lastInstance = obj)[key]; + } + } + if (!bindFnToScope && isFunction(obj)) { + return bind(lastInstance, obj); + } + return obj; +} + +/** + * Return the DOM siblings between the first and last node in the given array. + * @param {Array} array like object + * @returns {jqLite} jqLite collection containing the nodes + */ +function getBlockNodes(nodes) { + // TODO(perf): just check if all items in `nodes` are siblings and if they are return the original + // collection, otherwise update the original collection. + var node = nodes[0]; + var endNode = nodes[nodes.length - 1]; + var blockNodes = [node]; + + do { + node = node.nextSibling; + if (!node) break; + blockNodes.push(node); + } while (node !== endNode); + + return jqLite(blockNodes); +} + + +/** + * Creates a new object without a prototype. This object is useful for lookup without having to + * guard against prototypically inherited properties via hasOwnProperty. + * + * Related micro-benchmarks: + * - http://jsperf.com/object-create2 + * - http://jsperf.com/proto-map-lookup/2 + * - http://jsperf.com/for-in-vs-object-keys2 + * + * @returns {Object} + */ +function createMap() { + return Object.create(null); +} + +var NODE_TYPE_ELEMENT = 1; +var NODE_TYPE_ATTRIBUTE = 2; +var NODE_TYPE_TEXT = 3; +var NODE_TYPE_COMMENT = 8; +var NODE_TYPE_DOCUMENT = 9; +var NODE_TYPE_DOCUMENT_FRAGMENT = 11; + +/** + * @ngdoc type + * @name angular.Module + * @module ng + * @description + * + * Interface for configuring angular {@link angular.module modules}. + */ + +function setupModuleLoader(window) { + + var $injectorMinErr = minErr('$injector'); + var ngMinErr = minErr('ng'); + + function ensure(obj, name, factory) { + return obj[name] || (obj[name] = factory()); + } + + var angular = ensure(window, 'angular', Object); + + // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap + angular.$$minErr = angular.$$minErr || minErr; + + return ensure(angular, 'module', function() { + /** @type {Object.} */ + var modules = {}; + + /** + * @ngdoc function + * @name angular.module + * @module ng + * @description + * + * The `angular.module` is a global place for creating, registering and retrieving Angular + * modules. + * All modules (angular core or 3rd party) that should be available to an application must be + * registered using this mechanism. + * + * When passed two or more arguments, a new module is created. If passed only one argument, an + * existing module (the name passed as the first argument to `module`) is retrieved. + * + * + * # Module + * + * A module is a collection of services, directives, controllers, filters, and configuration information. + * `angular.module` is used to configure the {@link auto.$injector $injector}. + * + * ```js + * // Create a new module + * var myModule = angular.module('myModule', []); + * + * // register a new service + * myModule.value('appName', 'MyCoolApp'); + * + * // configure existing services inside initialization blocks. + * myModule.config(['$locationProvider', function($locationProvider) { + * // Configure existing providers + * $locationProvider.hashPrefix('!'); + * }]); + * ``` + * + * Then you can create an injector and load your modules like this: + * + * ```js + * var injector = angular.injector(['ng', 'myModule']) + * ``` + * + * However it's more likely that you'll just use + * {@link ng.directive:ngApp ngApp} or + * {@link angular.bootstrap} to simplify this process for you. + * + * @param {!string} name The name of the module to create or retrieve. + * @param {!Array.=} requires If specified then new module is being created. If + * unspecified then the module is being retrieved for further configuration. + * @param {Function=} configFn Optional configuration function for the module. Same as + * {@link angular.Module#config Module#config()}. + * @returns {module} new module with the {@link angular.Module} api. + */ + return function module(name, requires, configFn) { + var assertNotHasOwnProperty = function(name, context) { + if (name === 'hasOwnProperty') { + throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context); + } + }; + + assertNotHasOwnProperty(name, 'module'); + if (requires && modules.hasOwnProperty(name)) { + modules[name] = null; + } + return ensure(modules, name, function() { + if (!requires) { + throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " + + "the module name or forgot to load it. If registering a module ensure that you " + + "specify the dependencies as the second argument.", name); + } + + /** @type {!Array.>} */ + var invokeQueue = []; + + /** @type {!Array.} */ + var configBlocks = []; + + /** @type {!Array.} */ + var runBlocks = []; + + var config = invokeLater('$injector', 'invoke', 'push', configBlocks); + + /** @type {angular.Module} */ + var moduleInstance = { + // Private state + _invokeQueue: invokeQueue, + _configBlocks: configBlocks, + _runBlocks: runBlocks, + + /** + * @ngdoc property + * @name angular.Module#requires + * @module ng + * + * @description + * Holds the list of modules which the injector will load before the current module is + * loaded. + */ + requires: requires, + + /** + * @ngdoc property + * @name angular.Module#name + * @module ng + * + * @description + * Name of the module. + */ + name: name, + + + /** + * @ngdoc method + * @name angular.Module#provider + * @module ng + * @param {string} name service name + * @param {Function} providerType Construction function for creating new instance of the + * service. + * @description + * See {@link auto.$provide#provider $provide.provider()}. + */ + provider: invokeLater('$provide', 'provider'), + + /** + * @ngdoc method + * @name angular.Module#factory + * @module ng + * @param {string} name service name + * @param {Function} providerFunction Function for creating new instance of the service. + * @description + * See {@link auto.$provide#factory $provide.factory()}. + */ + factory: invokeLater('$provide', 'factory'), + + /** + * @ngdoc method + * @name angular.Module#service + * @module ng + * @param {string} name service name + * @param {Function} constructor A constructor function that will be instantiated. + * @description + * See {@link auto.$provide#service $provide.service()}. + */ + service: invokeLater('$provide', 'service'), + + /** + * @ngdoc method + * @name angular.Module#value + * @module ng + * @param {string} name service name + * @param {*} object Service instance object. + * @description + * See {@link auto.$provide#value $provide.value()}. + */ + value: invokeLater('$provide', 'value'), + + /** + * @ngdoc method + * @name angular.Module#constant + * @module ng + * @param {string} name constant name + * @param {*} object Constant value. + * @description + * Because the constant are fixed, they get applied before other provide methods. + * See {@link auto.$provide#constant $provide.constant()}. + */ + constant: invokeLater('$provide', 'constant', 'unshift'), + + /** + * @ngdoc method + * @name angular.Module#animation + * @module ng + * @param {string} name animation name + * @param {Function} animationFactory Factory function for creating new instance of an + * animation. + * @description + * + * **NOTE**: animations take effect only if the **ngAnimate** module is loaded. + * + * + * Defines an animation hook that can be later used with + * {@link ngAnimate.$animate $animate} service and directives that use this service. + * + * ```js + * module.animation('.animation-name', function($inject1, $inject2) { + * return { + * eventName : function(element, done) { + * //code to run the animation + * //once complete, then run done() + * return function cancellationFunction(element) { + * //code to cancel the animation + * } + * } + * } + * }) + * ``` + * + * See {@link ng.$animateProvider#register $animateProvider.register()} and + * {@link ngAnimate ngAnimate module} for more information. + */ + animation: invokeLater('$animateProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#filter + * @module ng + * @param {string} name Filter name - this must be a valid angular expression identifier + * @param {Function} filterFactory Factory function for creating new instance of filter. + * @description + * See {@link ng.$filterProvider#register $filterProvider.register()}. + * + *
+ * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. + * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace + * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores + * (`myapp_subsection_filterx`). + *
+ */ + filter: invokeLater('$filterProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#controller + * @module ng + * @param {string|Object} name Controller name, or an object map of controllers where the + * keys are the names and the values are the constructors. + * @param {Function} constructor Controller constructor function. + * @description + * See {@link ng.$controllerProvider#register $controllerProvider.register()}. + */ + controller: invokeLater('$controllerProvider', 'register'), + + /** + * @ngdoc method + * @name angular.Module#directive + * @module ng + * @param {string|Object} name Directive name, or an object map of directives where the + * keys are the names and the values are the factories. + * @param {Function} directiveFactory Factory function for creating new instance of + * directives. + * @description + * See {@link ng.$compileProvider#directive $compileProvider.directive()}. + */ + directive: invokeLater('$compileProvider', 'directive'), + + /** + * @ngdoc method + * @name angular.Module#config + * @module ng + * @param {Function} configFn Execute this function on module load. Useful for service + * configuration. + * @description + * Use this method to register work which needs to be performed on module loading. + * For more about how to configure services, see + * {@link providers#provider-recipe Provider Recipe}. + */ + config: config, + + /** + * @ngdoc method + * @name angular.Module#run + * @module ng + * @param {Function} initializationFn Execute this function after injector creation. + * Useful for application initialization. + * @description + * Use this method to register work which should be performed when the injector is done + * loading all modules. + */ + run: function(block) { + runBlocks.push(block); + return this; + } + }; + + if (configFn) { + config(configFn); + } + + return moduleInstance; + + /** + * @param {string} provider + * @param {string} method + * @param {String=} insertMethod + * @returns {angular.Module} + */ + function invokeLater(provider, method, insertMethod, queue) { + if (!queue) queue = invokeQueue; + return function() { + queue[insertMethod || 'push']([provider, method, arguments]); + return moduleInstance; + }; + } + }); + }; + }); + +} + +/* global: toDebugString: true */ + +function serializeObject(obj) { + var seen = []; + + return JSON.stringify(obj, function(key, val) { + val = toJsonReplacer(key, val); + if (isObject(val)) { + + if (seen.indexOf(val) >= 0) return '<>'; + + seen.push(val); + } + return val; + }); +} + +function toDebugString(obj) { + if (typeof obj === 'function') { + return obj.toString().replace(/ \{[\s\S]*$/, ''); + } else if (typeof obj === 'undefined') { + return 'undefined'; + } else if (typeof obj !== 'string') { + return serializeObject(obj); + } + return obj; +} + +/* global angularModule: true, + version: true, + + $LocaleProvider, + $CompileProvider, + + htmlAnchorDirective, + inputDirective, + inputDirective, + formDirective, + scriptDirective, + selectDirective, + styleDirective, + optionDirective, + ngBindDirective, + ngBindHtmlDirective, + ngBindTemplateDirective, + ngClassDirective, + ngClassEvenDirective, + ngClassOddDirective, + ngCspDirective, + ngCloakDirective, + ngControllerDirective, + ngFormDirective, + ngHideDirective, + ngIfDirective, + ngIncludeDirective, + ngIncludeFillContentDirective, + ngInitDirective, + ngNonBindableDirective, + ngPluralizeDirective, + ngRepeatDirective, + ngShowDirective, + ngStyleDirective, + ngSwitchDirective, + ngSwitchWhenDirective, + ngSwitchDefaultDirective, + ngOptionsDirective, + ngTranscludeDirective, + ngModelDirective, + ngListDirective, + ngChangeDirective, + patternDirective, + patternDirective, + requiredDirective, + requiredDirective, + minlengthDirective, + minlengthDirective, + maxlengthDirective, + maxlengthDirective, + ngValueDirective, + ngModelOptionsDirective, + ngAttributeAliasDirectives, + ngEventDirectives, + + $AnchorScrollProvider, + $AnimateProvider, + $BrowserProvider, + $CacheFactoryProvider, + $ControllerProvider, + $DocumentProvider, + $ExceptionHandlerProvider, + $FilterProvider, + $InterpolateProvider, + $IntervalProvider, + $HttpProvider, + $HttpBackendProvider, + $LocationProvider, + $LogProvider, + $ParseProvider, + $RootScopeProvider, + $QProvider, + $$QProvider, + $$SanitizeUriProvider, + $SceProvider, + $SceDelegateProvider, + $SnifferProvider, + $TemplateCacheProvider, + $TemplateRequestProvider, + $$TestabilityProvider, + $TimeoutProvider, + $$RAFProvider, + $$AsyncCallbackProvider, + $WindowProvider, + $$jqLiteProvider +*/ + + +/** + * @ngdoc object + * @name angular.version + * @module ng + * @description + * An object that contains information about the current AngularJS version. This object has the + * following properties: + * + * - `full` – `{string}` – Full version string, such as "0.9.18". + * - `major` – `{number}` – Major version number, such as "0". + * - `minor` – `{number}` – Minor version number, such as "9". + * - `dot` – `{number}` – Dot version number, such as "18". + * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat". + */ +var version = { + full: '1.3.20', // all of these placeholder strings will be replaced by grunt's + major: 1, // package task + minor: 3, + dot: 20, + codeName: 'shallow-translucence' +}; + + +function publishExternalAPI(angular) { + extend(angular, { + 'bootstrap': bootstrap, + 'copy': copy, + 'extend': extend, + 'equals': equals, + 'element': jqLite, + 'forEach': forEach, + 'injector': createInjector, + 'noop': noop, + 'bind': bind, + 'toJson': toJson, + 'fromJson': fromJson, + 'identity': identity, + 'isUndefined': isUndefined, + 'isDefined': isDefined, + 'isString': isString, + 'isFunction': isFunction, + 'isObject': isObject, + 'isNumber': isNumber, + 'isElement': isElement, + 'isArray': isArray, + 'version': version, + 'isDate': isDate, + 'lowercase': lowercase, + 'uppercase': uppercase, + 'callbacks': {counter: 0}, + 'getTestability': getTestability, + '$$minErr': minErr, + '$$csp': csp, + 'reloadWithDebugInfo': reloadWithDebugInfo + }); + + angularModule = setupModuleLoader(window); + try { + angularModule('ngLocale'); + } catch (e) { + angularModule('ngLocale', []).provider('$locale', $LocaleProvider); + } + + angularModule('ng', ['ngLocale'], ['$provide', + function ngModule($provide) { + // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it. + $provide.provider({ + $$sanitizeUri: $$SanitizeUriProvider + }); + $provide.provider('$compile', $CompileProvider). + directive({ + a: htmlAnchorDirective, + input: inputDirective, + textarea: inputDirective, + 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: patternDirective, + required: requiredDirective, + ngRequired: requiredDirective, + minlength: minlengthDirective, + ngMinlength: minlengthDirective, + maxlength: maxlengthDirective, + ngMaxlength: maxlengthDirective, + ngValue: ngValueDirective, + ngModelOptions: ngModelOptionsDirective + }). + directive({ + ngInclude: ngIncludeFillContentDirective + }). + directive(ngAttributeAliasDirectives). + directive(ngEventDirectives); + $provide.provider({ + $anchorScroll: $AnchorScrollProvider, + $animate: $AnimateProvider, + $browser: $BrowserProvider, + $cacheFactory: $CacheFactoryProvider, + $controller: $ControllerProvider, + $document: $DocumentProvider, + $exceptionHandler: $ExceptionHandlerProvider, + $filter: $FilterProvider, + $interpolate: $InterpolateProvider, + $interval: $IntervalProvider, + $http: $HttpProvider, + $httpBackend: $HttpBackendProvider, + $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, + $$asyncCallback: $$AsyncCallbackProvider, + $$jqLite: $$jqLiteProvider + }); + } + ]); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* global JQLitePrototype: true, + addEventListenerFn: true, + removeEventListenerFn: true, + BOOLEAN_ATTR: true, + ALIASED_ATTR: true, +*/ + +////////////////////////////////// +//JQLite +////////////////////////////////// + +/** + * @ngdoc function + * @name angular.element + * @module ng + * @kind function + * + * @description + * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element. + * + * If jQuery is available, `angular.element` is an alias for the + * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element` + * delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." + * + *
jqLite is a tiny, API-compatible subset of jQuery that allows + * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most + * commonly needed functionality with the goal of having a very small footprint.
+ * + * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. + * + *
**Note:** all element references in Angular are always wrapped with jQuery or + * jqLite; they are never raw DOM references.
+ * + * ## Angular's jqLite + * jqLite provides only the following jQuery methods: + * + * - [`addClass()`](http://api.jquery.com/addClass/) + * - [`after()`](http://api.jquery.com/after/) + * - [`append()`](http://api.jquery.com/append/) + * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters + * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData + * - [`children()`](http://api.jquery.com/children/) - Does not support selectors + * - [`clone()`](http://api.jquery.com/clone/) + * - [`contents()`](http://api.jquery.com/contents/) + * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`. As a setter, does not convert numbers to strings or append 'px'. + * - [`data()`](http://api.jquery.com/data/) + * - [`detach()`](http://api.jquery.com/detach/) + * - [`empty()`](http://api.jquery.com/empty/) + * - [`eq()`](http://api.jquery.com/eq/) + * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name + * - [`hasClass()`](http://api.jquery.com/hasClass/) + * - [`html()`](http://api.jquery.com/html/) + * - [`next()`](http://api.jquery.com/next/) - Does not support selectors + * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData + * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces or selectors + * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors + * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors + * - [`prepend()`](http://api.jquery.com/prepend/) + * - [`prop()`](http://api.jquery.com/prop/) + * - [`ready()`](http://api.jquery.com/ready/) + * - [`remove()`](http://api.jquery.com/remove/) + * - [`removeAttr()`](http://api.jquery.com/removeAttr/) + * - [`removeClass()`](http://api.jquery.com/removeClass/) + * - [`removeData()`](http://api.jquery.com/removeData/) + * - [`replaceWith()`](http://api.jquery.com/replaceWith/) + * - [`text()`](http://api.jquery.com/text/) + * - [`toggleClass()`](http://api.jquery.com/toggleClass/) + * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers. + * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces + * - [`val()`](http://api.jquery.com/val/) + * - [`wrap()`](http://api.jquery.com/wrap/) + * + * ## jQuery/jqLite Extras + * Angular also provides the following additional methods and events to both jQuery and jqLite: + * + * ### Events + * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event + * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM + * element before it is removed. + * + * ### Methods + * - `controller(name)` - retrieves the controller of the current element or its parent. By default + * retrieves controller associated with the `ngController` directive. If `name` is provided as + * camelCase directive name, then the controller for this directive will be retrieved (e.g. + * `'ngModel'`). + * - `injector()` - retrieves the injector of the current element or its parent. + * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current + * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to + * be enabled. + * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the + * current element. This getter should be used only on elements that contain a directive which starts a new isolate + * scope. Calling `scope()` on this element always returns the original non-isolate scope. + * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled. + * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top + * parent element is reached. + * + * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. + * @returns {Object} jQuery object. + */ + +JQLite.expando = 'ng339'; + +var jqCache = JQLite.cache = {}, + jqId = 1, + addEventListenerFn = function(element, type, fn) { + element.addEventListener(type, fn, false); + }, + removeEventListenerFn = function(element, type, fn) { + element.removeEventListener(type, fn, false); + }; + +/* + * !!! This is an undocumented "private" function !!! + */ +JQLite._data = function(node) { + //jQuery always returns an object on cache miss + return this.cache[node[this.expando]] || {}; +}; + +function jqNextId() { return ++jqId; } + + +var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g; +var MOZ_HACK_REGEXP = /^moz([A-Z])/; +var MOUSE_EVENT_MAP= { mouseleave: "mouseout", mouseenter: "mouseover"}; +var jqLiteMinErr = minErr('jqLite'); + +/** + * Converts snake_case to camelCase. + * Also there is special case for Moz prefix starting with upper case letter. + * @param name Name to normalize + */ +function camelCase(name) { + return name. + replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) { + return offset ? letter.toUpperCase() : letter; + }). + replace(MOZ_HACK_REGEXP, 'Moz$1'); +} + +var SINGLE_TAG_REGEXP = /^<(\w+)\s*\/?>(?:<\/\1>|)$/; +var HTML_REGEXP = /<|&#?\w+;/; +var TAG_NAME_REGEXP = /<([\w:]+)/; +var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi; + +var wrapMap = { + 'option': [1, ''], + + 'thead': [1, '', '
'], + 'col': [2, '', '
'], + 'tr': [2, '', '
'], + 'td': [3, '', '
'], + '_default': [0, "", ""] +}; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function jqLiteIsTextNode(html) { + return !HTML_REGEXP.test(html); +} + +function jqLiteAcceptsData(node) { + // The window object can accept data but has no nodeType + // Otherwise we are only interested in elements (1) and documents (9) + var nodeType = node.nodeType; + return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT; +} + +function jqLiteBuildFragment(html, context) { + var tmp, tag, wrap, + fragment = context.createDocumentFragment(), + nodes = [], i; + + if (jqLiteIsTextNode(html)) { + // Convert non-html into a text node + nodes.push(context.createTextNode(html)); + } else { + // Convert html into DOM nodes + tmp = tmp || fragment.appendChild(context.createElement("div")); + tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase(); + wrap = wrapMap[tag] || wrapMap._default; + tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1>") + wrap[2]; + + // Descend through wrappers to the right content + i = wrap[0]; + while (i--) { + tmp = tmp.lastChild; + } + + nodes = concat(nodes, tmp.childNodes); + + tmp = fragment.firstChild; + tmp.textContent = ""; + } + + // Remove wrapper from fragment + fragment.textContent = ""; + fragment.innerHTML = ""; // Clear inner HTML + forEach(nodes, function(node) { + fragment.appendChild(node); + }); + + return fragment; +} + +function jqLiteParseHTML(html, context) { + context = context || document; + var parsed; + + if ((parsed = SINGLE_TAG_REGEXP.exec(html))) { + return [context.createElement(parsed[1])]; + } + + if ((parsed = jqLiteBuildFragment(html, context))) { + return parsed.childNodes; + } + + return []; +} + +///////////////////////////////////////////// +function JQLite(element) { + if (element instanceof JQLite) { + return element; + } + + var argIsString; + + if (isString(element)) { + element = trim(element); + argIsString = true; + } + if (!(this instanceof JQLite)) { + if (argIsString && element.charAt(0) != '<') { + throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element'); + } + return new JQLite(element); + } + + if (argIsString) { + jqLiteAddNodes(this, jqLiteParseHTML(element)); + } else { + jqLiteAddNodes(this, element); + } +} + +function jqLiteClone(element) { + return element.cloneNode(true); +} + +function jqLiteDealoc(element, onlyDescendants) { + if (!onlyDescendants) jqLiteRemoveData(element); + + if (element.querySelectorAll) { + var descendants = element.querySelectorAll('*'); + for (var i = 0, l = descendants.length; i < l; i++) { + jqLiteRemoveData(descendants[i]); + } + } +} + +function jqLiteOff(element, type, fn, unsupported) { + if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument'); + + var expandoStore = jqLiteExpandoStore(element); + var events = expandoStore && expandoStore.events; + var handle = expandoStore && expandoStore.handle; + + if (!handle) return; //no listeners registered + + if (!type) { + for (type in events) { + if (type !== '$destroy') { + removeEventListenerFn(element, type, handle); + } + delete events[type]; + } + } else { + forEach(type.split(' '), function(type) { + if (isDefined(fn)) { + var listenerFns = events[type]; + arrayRemove(listenerFns || [], fn); + if (listenerFns && listenerFns.length > 0) { + return; + } + } + + removeEventListenerFn(element, type, handle); + delete events[type]; + }); + } +} + +function jqLiteRemoveData(element, name) { + var expandoId = element.ng339; + var expandoStore = expandoId && jqCache[expandoId]; + + if (expandoStore) { + if (name) { + delete expandoStore.data[name]; + return; + } + + if (expandoStore.handle) { + if (expandoStore.events.$destroy) { + expandoStore.handle({}, '$destroy'); + } + jqLiteOff(element); + } + delete jqCache[expandoId]; + element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it + } +} + + +function jqLiteExpandoStore(element, createIfNecessary) { + var expandoId = element.ng339, + expandoStore = expandoId && jqCache[expandoId]; + + if (createIfNecessary && !expandoStore) { + element.ng339 = expandoId = jqNextId(); + expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined}; + } + + return expandoStore; +} + + +function jqLiteData(element, key, value) { + if (jqLiteAcceptsData(element)) { + + var isSimpleSetter = isDefined(value); + var isSimpleGetter = !isSimpleSetter && key && !isObject(key); + var massGetter = !key; + var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter); + var data = expandoStore && expandoStore.data; + + if (isSimpleSetter) { // data('key', value) + data[key] = value; + } else { + if (massGetter) { // data() + return data; + } else { + if (isSimpleGetter) { // data('key') + // don't force creation of expandoStore if it doesn't exist yet + return data && data[key]; + } else { // mass-setter: data({key1: val1, key2: val2}) + extend(data, key); + } + } + } + } +} + +function jqLiteHasClass(element, selector) { + if (!element.getAttribute) return false; + return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " "). + indexOf(" " + selector + " ") > -1); +} + +function jqLiteRemoveClass(element, cssClasses) { + if (cssClasses && element.setAttribute) { + forEach(cssClasses.split(' '), function(cssClass) { + element.setAttribute('class', trim( + (" " + (element.getAttribute('class') || '') + " ") + .replace(/[\n\t]/g, " ") + .replace(" " + trim(cssClass) + " ", " ")) + ); + }); + } +} + +function jqLiteAddClass(element, cssClasses) { + if (cssClasses && element.setAttribute) { + var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ') + .replace(/[\n\t]/g, " "); + + forEach(cssClasses.split(' '), function(cssClass) { + cssClass = trim(cssClass); + if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) { + existingClasses += cssClass + ' '; + } + }); + + element.setAttribute('class', trim(existingClasses)); + } +} + + +function jqLiteAddNodes(root, elements) { + // THIS CODE IS VERY HOT. Don't make changes without benchmarking. + + if (elements) { + + // if a Node (the most common case) + if (elements.nodeType) { + root[root.length++] = elements; + } else { + var length = elements.length; + + // if an Array or NodeList and not a Window + if (typeof length === 'number' && elements.window !== elements) { + if (length) { + for (var i = 0; i < length; i++) { + root[root.length++] = elements[i]; + } + } + } else { + root[root.length++] = elements; + } + } + } +} + + +function jqLiteController(element, name) { + return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller'); +} + +function jqLiteInheritedData(element, name, value) { + // if element is the document object work with the html element instead + // this makes $(document).scope() possible + if (element.nodeType == NODE_TYPE_DOCUMENT) { + element = element.documentElement; + } + var names = isArray(name) ? name : [name]; + + while (element) { + for (var i = 0, ii = names.length; i < ii; i++) { + if ((value = jqLite.data(element, names[i])) !== undefined) return value; + } + + // If dealing with a document fragment node with a host element, and no parent, use the host + // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM + // to lookup parent controllers. + element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host); + } +} + +function jqLiteEmpty(element) { + jqLiteDealoc(element, true); + while (element.firstChild) { + element.removeChild(element.firstChild); + } +} + +function jqLiteRemove(element, keepData) { + if (!keepData) jqLiteDealoc(element); + var parent = element.parentNode; + if (parent) parent.removeChild(element); +} + + +function jqLiteDocumentLoaded(action, win) { + win = win || window; + if (win.document.readyState === 'complete') { + // Force the action to be run async for consistent behaviour + // from the action's point of view + // i.e. it will definitely not be in a $apply + win.setTimeout(action); + } else { + // No need to unbind this handler as load is only ever called once + jqLite(win).on('load', action); + } +} + +////////////////////////////////////////// +// Functions which are declared directly. +////////////////////////////////////////// +var JQLitePrototype = JQLite.prototype = { + ready: function(fn) { + var fired = false; + + function trigger() { + if (fired) return; + fired = true; + fn(); + } + + // check if document is already loaded + if (document.readyState === 'complete') { + setTimeout(trigger); + } else { + this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9 + // we can not use jqLite since we are not done loading and jQuery could be loaded later. + // jshint -W064 + JQLite(window).on('load', trigger); // fallback to window.onload for others + // jshint +W064 + } + }, + toString: function() { + var value = []; + forEach(this, function(e) { value.push('' + e);}); + return '[' + value.join(', ') + ']'; + }, + + eq: function(index) { + return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]); + }, + + length: 0, + push: push, + sort: [].sort, + splice: [].splice +}; + +////////////////////////////////////////// +// Functions iterating getter/setters. +// these functions return self on setter and +// value on get. +////////////////////////////////////////// +var BOOLEAN_ATTR = {}; +forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) { + BOOLEAN_ATTR[lowercase(value)] = value; +}); +var BOOLEAN_ELEMENTS = {}; +forEach('input,select,option,textarea,button,form,details'.split(','), function(value) { + BOOLEAN_ELEMENTS[value] = true; +}); +var ALIASED_ATTR = { + 'ngMinlength': 'minlength', + 'ngMaxlength': 'maxlength', + 'ngMin': 'min', + 'ngMax': 'max', + 'ngPattern': 'pattern' +}; + +function getBooleanAttrName(element, name) { + // check dom last since we will most likely fail on name + var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()]; + + // booleanAttr is here twice to minimize DOM access + return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr; +} + +function getAliasedAttrName(element, name) { + var nodeName = element.nodeName; + return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name]; +} + +forEach({ + data: jqLiteData, + removeData: jqLiteRemoveData +}, function(fn, name) { + JQLite[name] = fn; +}); + +forEach({ + data: jqLiteData, + inheritedData: jqLiteInheritedData, + + scope: function(element) { + // Can't use jqLiteData here directly so we stay compatible with jQuery! + return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']); + }, + + isolateScope: function(element) { + // Can't use jqLiteData here directly so we stay compatible with jQuery! + return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate'); + }, + + controller: jqLiteController, + + injector: function(element) { + return jqLiteInheritedData(element, '$injector'); + }, + + removeAttr: function(element, name) { + element.removeAttribute(name); + }, + + hasClass: jqLiteHasClass, + + css: function(element, name, value) { + name = camelCase(name); + + if (isDefined(value)) { + element.style[name] = value; + } else { + return element.style[name]; + } + }, + + attr: function(element, name, value) { + var nodeType = element.nodeType; + if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT) { + return; + } + var lowercasedName = lowercase(name); + if (BOOLEAN_ATTR[lowercasedName]) { + if (isDefined(value)) { + if (!!value) { + element[name] = true; + element.setAttribute(name, lowercasedName); + } else { + element[name] = false; + element.removeAttribute(lowercasedName); + } + } else { + return (element[name] || + (element.attributes.getNamedItem(name) || noop).specified) + ? lowercasedName + : undefined; + } + } else if (isDefined(value)) { + element.setAttribute(name, value); + } else if (element.getAttribute) { + // the extra argument "2" is to get the right thing for a.href in IE, see jQuery code + // some elements (e.g. Document) don't have get attribute, so return undefined + var ret = element.getAttribute(name, 2); + // normalize non-existing attributes to undefined (as jQuery) + return ret === null ? undefined : ret; + } + }, + + prop: function(element, name, value) { + if (isDefined(value)) { + element[name] = value; + } else { + return element[name]; + } + }, + + text: (function() { + getText.$dv = ''; + return getText; + + function getText(element, value) { + if (isUndefined(value)) { + var nodeType = element.nodeType; + return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : ''; + } + element.textContent = value; + } + })(), + + val: function(element, value) { + if (isUndefined(value)) { + if (element.multiple && nodeName_(element) === 'select') { + var result = []; + forEach(element.options, function(option) { + if (option.selected) { + result.push(option.value || option.text); + } + }); + return result.length === 0 ? null : result; + } + return element.value; + } + element.value = value; + }, + + html: function(element, value) { + if (isUndefined(value)) { + return element.innerHTML; + } + jqLiteDealoc(element, true); + element.innerHTML = value; + }, + + empty: jqLiteEmpty +}, function(fn, name) { + /** + * Properties: writes return selection, reads return first value + */ + JQLite.prototype[name] = function(arg1, arg2) { + var i, key; + var nodeCount = this.length; + + // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it + // in a way that survives minification. + // jqLiteEmpty takes no arguments but is a setter. + if (fn !== jqLiteEmpty && + (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined)) { + if (isObject(arg1)) { + + // we are a write, but the object properties are the key/values + for (i = 0; i < nodeCount; i++) { + if (fn === jqLiteData) { + // data() takes the whole object in jQuery + fn(this[i], arg1); + } else { + for (key in arg1) { + fn(this[i], key, arg1[key]); + } + } + } + // return self for chaining + return this; + } else { + // we are a read, so read the first child. + // TODO: do we still need this? + var value = fn.$dv; + // Only if we have $dv do we iterate over all, otherwise it is just the first element. + var jj = (value === undefined) ? Math.min(nodeCount, 1) : nodeCount; + for (var j = 0; j < jj; j++) { + var nodeValue = fn(this[j], arg1, arg2); + value = value ? value + nodeValue : nodeValue; + } + return value; + } + } else { + // we are a write, so apply to all children + for (i = 0; i < nodeCount; i++) { + fn(this[i], arg1, arg2); + } + // return self for chaining + return this; + } + }; +}); + +function createEventHandler(element, events) { + var eventHandler = function(event, type) { + // jQuery specific api + event.isDefaultPrevented = function() { + return event.defaultPrevented; + }; + + var eventFns = events[type || event.type]; + var eventFnsLength = eventFns ? eventFns.length : 0; + + if (!eventFnsLength) return; + + if (isUndefined(event.immediatePropagationStopped)) { + var originalStopImmediatePropagation = event.stopImmediatePropagation; + event.stopImmediatePropagation = function() { + event.immediatePropagationStopped = true; + + if (event.stopPropagation) { + event.stopPropagation(); + } + + if (originalStopImmediatePropagation) { + originalStopImmediatePropagation.call(event); + } + }; + } + + event.isImmediatePropagationStopped = function() { + return event.immediatePropagationStopped === true; + }; + + // Copy event handlers in case event handlers array is modified during execution. + if ((eventFnsLength > 1)) { + eventFns = shallowCopy(eventFns); + } + + for (var i = 0; i < eventFnsLength; i++) { + if (!event.isImmediatePropagationStopped()) { + eventFns[i].call(element, event); + } + } + }; + + // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all + // events on `element` + eventHandler.elem = element; + return eventHandler; +} + +////////////////////////////////////////// +// Functions iterating traversal. +// These functions chain results into a single +// selector. +////////////////////////////////////////// +forEach({ + removeData: jqLiteRemoveData, + + on: function jqLiteOn(element, type, fn, unsupported) { + if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters'); + + // Do not add event handlers to non-elements because they will not be cleaned up. + if (!jqLiteAcceptsData(element)) { + return; + } + + var expandoStore = jqLiteExpandoStore(element, true); + var events = expandoStore.events; + var handle = expandoStore.handle; + + if (!handle) { + handle = expandoStore.handle = createEventHandler(element, events); + } + + // http://jsperf.com/string-indexof-vs-split + var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type]; + var i = types.length; + + while (i--) { + type = types[i]; + var eventFns = events[type]; + + if (!eventFns) { + events[type] = []; + + if (type === 'mouseenter' || type === 'mouseleave') { + // Refer to jQuery's implementation of mouseenter & mouseleave + // Read about mouseenter and mouseleave: + // http://www.quirksmode.org/js/events_mouse.html#link8 + + jqLiteOn(element, MOUSE_EVENT_MAP[type], function(event) { + var target = this, related = event.relatedTarget; + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if (!related || (related !== target && !target.contains(related))) { + handle(event, type); + } + }); + + } else { + if (type !== '$destroy') { + addEventListenerFn(element, type, handle); + } + } + eventFns = events[type]; + } + eventFns.push(fn); + } + }, + + off: jqLiteOff, + + one: function(element, type, fn) { + element = jqLite(element); + + //add the listener twice so that when it is called + //you can remove the original function and still be + //able to call element.off(ev, fn) normally + element.on(type, function onFn() { + element.off(type, fn); + element.off(type, onFn); + }); + element.on(type, fn); + }, + + replaceWith: function(element, replaceNode) { + var index, parent = element.parentNode; + jqLiteDealoc(element); + forEach(new JQLite(replaceNode), function(node) { + if (index) { + parent.insertBefore(node, index.nextSibling); + } else { + parent.replaceChild(node, element); + } + index = node; + }); + }, + + children: function(element) { + var children = []; + forEach(element.childNodes, function(element) { + if (element.nodeType === NODE_TYPE_ELEMENT) + children.push(element); + }); + return children; + }, + + contents: function(element) { + return element.contentDocument || element.childNodes || []; + }, + + append: function(element, node) { + var nodeType = element.nodeType; + if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return; + + node = new JQLite(node); + + for (var i = 0, ii = node.length; i < ii; i++) { + var child = node[i]; + element.appendChild(child); + } + }, + + prepend: function(element, node) { + if (element.nodeType === NODE_TYPE_ELEMENT) { + var index = element.firstChild; + forEach(new JQLite(node), function(child) { + element.insertBefore(child, index); + }); + } + }, + + wrap: function(element, wrapNode) { + wrapNode = jqLite(wrapNode).eq(0).clone()[0]; + var parent = element.parentNode; + if (parent) { + parent.replaceChild(wrapNode, element); + } + wrapNode.appendChild(element); + }, + + remove: jqLiteRemove, + + detach: function(element) { + jqLiteRemove(element, true); + }, + + after: function(element, newElement) { + var index = element, parent = element.parentNode; + newElement = new JQLite(newElement); + + for (var i = 0, ii = newElement.length; i < ii; i++) { + var node = newElement[i]; + parent.insertBefore(node, index.nextSibling); + index = node; + } + }, + + addClass: jqLiteAddClass, + removeClass: jqLiteRemoveClass, + + toggleClass: function(element, selector, condition) { + if (selector) { + forEach(selector.split(' '), function(className) { + var classCondition = condition; + if (isUndefined(classCondition)) { + classCondition = !jqLiteHasClass(element, className); + } + (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className); + }); + } + }, + + parent: function(element) { + var parent = element.parentNode; + return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null; + }, + + next: function(element) { + return element.nextElementSibling; + }, + + find: function(element, selector) { + if (element.getElementsByTagName) { + return element.getElementsByTagName(selector); + } else { + return []; + } + }, + + clone: jqLiteClone, + + triggerHandler: function(element, event, extraParameters) { + + var dummyEvent, eventFnsCopy, handlerArgs; + var eventName = event.type || event; + var expandoStore = jqLiteExpandoStore(element); + var events = expandoStore && expandoStore.events; + var eventFns = events && events[eventName]; + + if (eventFns) { + // Create a dummy event to pass to the handlers + dummyEvent = { + preventDefault: function() { this.defaultPrevented = true; }, + isDefaultPrevented: function() { return this.defaultPrevented === true; }, + stopImmediatePropagation: function() { this.immediatePropagationStopped = true; }, + isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; }, + stopPropagation: noop, + type: eventName, + target: element + }; + + // If a custom event was provided then extend our dummy event with it + if (event.type) { + dummyEvent = extend(dummyEvent, event); + } + + // Copy event handlers in case event handlers array is modified during execution. + eventFnsCopy = shallowCopy(eventFns); + handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent]; + + forEach(eventFnsCopy, function(fn) { + if (!dummyEvent.isImmediatePropagationStopped()) { + fn.apply(element, handlerArgs); + } + }); + } + } +}, function(fn, name) { + /** + * chaining functions + */ + JQLite.prototype[name] = function(arg1, arg2, arg3) { + var value; + + for (var i = 0, ii = this.length; i < ii; i++) { + if (isUndefined(value)) { + value = fn(this[i], arg1, arg2, arg3); + if (isDefined(value)) { + // any function which returns a value needs to be wrapped + value = jqLite(value); + } + } else { + jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3)); + } + } + return isDefined(value) ? value : this; + }; + + // bind legacy bind/unbind to on/off + JQLite.prototype.bind = JQLite.prototype.on; + JQLite.prototype.unbind = JQLite.prototype.off; +}); + + +// Provider for private $$jqLite service +function $$jqLiteProvider() { + this.$get = function $$jqLite() { + return extend(JQLite, { + hasClass: function(node, classes) { + if (node.attr) node = node[0]; + return jqLiteHasClass(node, classes); + }, + addClass: function(node, classes) { + if (node.attr) node = node[0]; + return jqLiteAddClass(node, classes); + }, + removeClass: function(node, classes) { + if (node.attr) node = node[0]; + return jqLiteRemoveClass(node, classes); + } + }); + }; +} + +/** + * Computes a hash of an 'obj'. + * Hash of a: + * string is string + * number is number as string + * object is either result of calling $$hashKey function on the object or uniquely generated id, + * that is also assigned to the $$hashKey property of the object. + * + * @param obj + * @returns {string} hash string such that the same input will have the same hash string. + * The resulting string key is in 'type:hashKey' format. + */ +function hashKey(obj, nextUidFn) { + var key = obj && obj.$$hashKey; + + if (key) { + if (typeof key === 'function') { + key = obj.$$hashKey(); + } + return key; + } + + var objType = typeof obj; + if (objType == 'function' || (objType == 'object' && obj !== null)) { + key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)(); + } else { + key = objType + ':' + obj; + } + + return key; +} + +/** + * HashMap which can use objects as keys + */ +function HashMap(array, isolatedUid) { + if (isolatedUid) { + var uid = 0; + this.nextUid = function() { + return ++uid; + }; + } + forEach(array, this.put, this); +} +HashMap.prototype = { + /** + * Store key value pair + * @param key key to store can be any type + * @param value value to store can be any type + */ + put: function(key, value) { + this[hashKey(key, this.nextUid)] = value; + }, + + /** + * @param key + * @returns {Object} the value for the key + */ + get: function(key) { + return this[hashKey(key, this.nextUid)]; + }, + + /** + * Remove the key/value pair + * @param key + */ + remove: function(key) { + var value = this[key = hashKey(key, this.nextUid)]; + delete this[key]; + return value; + } +}; + +/** + * @ngdoc function + * @module ng + * @name angular.injector + * @kind function + * + * @description + * Creates an injector object that can be used for retrieving services as well as for + * dependency injection (see {@link guide/di dependency injection}). + * + * @param {Array.} modules A list of module functions or their aliases. See + * {@link angular.module}. The `ng` module must be explicitly added. + * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which + * disallows argument name annotation inference. + * @returns {injector} Injector object. See {@link auto.$injector $injector}. + * + * @example + * Typical usage + * ```js + * // create an injector + * var $injector = angular.injector(['ng']); + * + * // use the injector to kick off your application + * // use the type inference to auto inject arguments, or use implicit injection + * $injector.invoke(function($rootScope, $compile, $document) { + * $compile($document)($rootScope); + * $rootScope.$digest(); + * }); + * ``` + * + * Sometimes you want to get access to the injector of a currently running Angular app + * from outside Angular. Perhaps, you want to inject and compile some markup after the + * application has been bootstrapped. You can do this using the extra `injector()` added + * to JQuery/jqLite elements. See {@link angular.element}. + * + * *This is fairly rare but could be the case if a third party library is injecting the + * markup.* + * + * In the following example a new block of HTML containing a `ng-controller` + * directive is added to the end of the document body by JQuery. We then compile and link + * it into the current AngularJS scope. + * + * ```js + * var $div = $('
{{content.label}}
'); + * $(document.body).append($div); + * + * angular.element(document).injector().invoke(function($compile) { + * var scope = angular.element($div).scope(); + * $compile($div)(scope); + * }); + * ``` + */ + + +/** + * @ngdoc module + * @name auto + * @description + * + * Implicit module which gets automatically added to each {@link auto.$injector $injector}. + */ + +var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; +var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; +var $injectorMinErr = minErr('$injector'); + +function anonFn(fn) { + // For anonymous functions, showing at the very least the function signature can help in + // debugging. + var fnText = fn.toString().replace(STRIP_COMMENTS, ''), + args = fnText.match(FN_ARGS); + if (args) { + return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')'; + } + return 'fn'; +} + +function annotate(fn, strictDi, name) { + var $inject, + fnText, + argDecl, + last; + + if (typeof fn === 'function') { + if (!($inject = fn.$inject)) { + $inject = []; + if (fn.length) { + if (strictDi) { + if (!isString(name) || !name) { + name = fn.name || anonFn(fn); + } + throw $injectorMinErr('strictdi', + '{0} is not using explicit annotation and cannot be invoked in strict mode', name); + } + fnText = fn.toString().replace(STRIP_COMMENTS, ''); + argDecl = fnText.match(FN_ARGS); + forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) { + arg.replace(FN_ARG, function(all, underscore, name) { + $inject.push(name); + }); + }); + } + fn.$inject = $inject; + } + } else if (isArray(fn)) { + last = fn.length - 1; + assertArgFn(fn[last], 'fn'); + $inject = fn.slice(0, last); + } else { + assertArgFn(fn, 'fn', true); + } + return $inject; +} + +/////////////////////////////////////// + +/** + * @ngdoc service + * @name $injector + * + * @description + * + * `$injector` is used to retrieve object instances as defined by + * {@link auto.$provide provider}, instantiate types, invoke methods, + * and load modules. + * + * The following always holds true: + * + * ```js + * var $injector = angular.injector(); + * expect($injector.get('$injector')).toBe($injector); + * expect($injector.invoke(function($injector) { + * return $injector; + * })).toBe($injector); + * ``` + * + * # Injection Function Annotation + * + * JavaScript does not have annotations, and annotations are needed for dependency injection. The + * following are all valid ways of annotating function with injection arguments and are equivalent. + * + * ```js + * // inferred (only works if code not minified/obfuscated) + * $injector.invoke(function(serviceA){}); + * + * // annotated + * function explicit(serviceA) {}; + * explicit.$inject = ['serviceA']; + * $injector.invoke(explicit); + * + * // inline + * $injector.invoke(['serviceA', function(serviceA){}]); + * ``` + * + * ## Inference + * + * In JavaScript calling `toString()` on a function returns the function definition. The definition + * can then be parsed and the function arguments can be extracted. This method of discovering + * annotations is disallowed when the injector is in strict mode. + * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the + * argument names. + * + * ## `$inject` Annotation + * By adding an `$inject` property onto a function the injection parameters can be specified. + * + * ## Inline + * As an array of injection names, where the last item in the array is the function to call. + */ + +/** + * @ngdoc method + * @name $injector#get + * + * @description + * Return an instance of the service. + * + * @param {string} name The name of the instance to retrieve. + * @param {string=} caller An optional string to provide the origin of the function call for error messages. + * @return {*} The instance. + */ + +/** + * @ngdoc method + * @name $injector#invoke + * + * @description + * Invoke the method and supply the method arguments from the `$injector`. + * + * @param {Function|Array.} fn The injectable function to invoke. Function parameters are + * injected according to the {@link guide/di $inject Annotation} rules. + * @param {Object=} self The `this` for the invoked method. + * @param {Object=} locals Optional object. If preset then any argument names are read from this + * object first, before the `$injector` is consulted. + * @returns {*} the value returned by the invoked `fn` function. + */ + +/** + * @ngdoc method + * @name $injector#has + * + * @description + * Allows the user to query if the particular service exists. + * + * @param {string} name Name of the service to query. + * @returns {boolean} `true` if injector has given service. + */ + +/** + * @ngdoc method + * @name $injector#instantiate + * @description + * Create a new instance of JS type. The method takes a constructor function, invokes the new + * operator, and supplies all of the arguments to the constructor function as specified by the + * constructor annotation. + * + * @param {Function} Type Annotated constructor function. + * @param {Object=} locals Optional object. If preset then any argument names are read from this + * object first, before the `$injector` is consulted. + * @returns {Object} new instance of `Type`. + */ + +/** + * @ngdoc method + * @name $injector#annotate + * + * @description + * Returns an array of service names which the function is requesting for injection. This API is + * used by the injector to determine which services need to be injected into the function when the + * function is invoked. There are three ways in which the function can be annotated with the needed + * dependencies. + * + * # Argument names + * + * The simplest form is to extract the dependencies from the arguments of the function. This is done + * by converting the function into a string using `toString()` method and extracting the argument + * names. + * ```js + * // Given + * function MyController($scope, $route) { + * // ... + * } + * + * // Then + * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); + * ``` + * + * You can disallow this method by using strict injection mode. + * + * This method does not work with code minification / obfuscation. For this reason the following + * annotation strategies are supported. + * + * # The `$inject` property + * + * If a function has an `$inject` property and its value is an array of strings, then the strings + * represent names of services to be injected into the function. + * ```js + * // Given + * var MyController = function(obfuscatedScope, obfuscatedRoute) { + * // ... + * } + * // Define function dependencies + * MyController['$inject'] = ['$scope', '$route']; + * + * // Then + * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']); + * ``` + * + * # The array notation + * + * It is often desirable to inline Injected functions and that's when setting the `$inject` property + * is very inconvenient. In these situations using the array notation to specify the dependencies in + * a way that survives minification is a better choice: + * + * ```js + * // We wish to write this (not minification / obfuscation safe) + * injector.invoke(function($compile, $rootScope) { + * // ... + * }); + * + * // We are forced to write break inlining + * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) { + * // ... + * }; + * tmpFn.$inject = ['$compile', '$rootScope']; + * injector.invoke(tmpFn); + * + * // To better support inline function the inline annotation is supported + * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) { + * // ... + * }]); + * + * // Therefore + * expect(injector.annotate( + * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}]) + * ).toEqual(['$compile', '$rootScope']); + * ``` + * + * @param {Function|Array.} fn Function for which dependent service names need to + * be retrieved as described above. + * + * @param {boolean=} [strictDi=false] Disallow argument name annotation inference. + * + * @returns {Array.} The names of the services which the function requires. + */ + + + + +/** + * @ngdoc service + * @name $provide + * + * @description + * + * The {@link auto.$provide $provide} service has a number of methods for registering components + * with the {@link auto.$injector $injector}. Many of these functions are also exposed on + * {@link angular.Module}. + * + * An Angular **service** is a singleton object created by a **service factory**. These **service + * factories** are functions which, in turn, are created by a **service provider**. + * The **service providers** are constructor functions. When instantiated they must contain a + * property called `$get`, which holds the **service factory** function. + * + * When you request a service, the {@link auto.$injector $injector} is responsible for finding the + * correct **service provider**, instantiating it and then calling its `$get` **service factory** + * function to get the instance of the **service**. + * + * Often services have no configuration options and there is no need to add methods to the service + * provider. The provider will be no more than a constructor function with a `$get` property. For + * these cases the {@link auto.$provide $provide} service has additional helper methods to register + * services without specifying a provider. + * + * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the + * {@link auto.$injector $injector} + * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by + * providers and services. + * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by + * services, not providers. + * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`, + * that will be wrapped in a **service provider** object, whose `$get` property will contain the + * given factory function. + * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class` + * that will be wrapped in a **service provider** object, whose `$get` property will instantiate + * a new object using the given constructor function. + * + * See the individual methods for more information and examples. + */ + +/** + * @ngdoc method + * @name $provide#provider + * @description + * + * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions + * are constructor functions, whose instances are responsible for "providing" a factory for a + * service. + * + * Service provider names start with the name of the service they provide followed by `Provider`. + * For example, the {@link ng.$log $log} service has a provider called + * {@link ng.$logProvider $logProvider}. + * + * Service provider objects can have additional methods which allow configuration of the provider + * and its service. Importantly, you can configure what kind of service is created by the `$get` + * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a + * method {@link ng.$logProvider#debugEnabled debugEnabled} + * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the + * console or not. + * + * @param {string} name The name of the instance. NOTE: the provider will be available under `name + + 'Provider'` key. + * @param {(Object|function())} provider If the provider is: + * + * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using + * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created. + * - `Constructor`: a new instance of the provider will be created using + * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`. + * + * @returns {Object} registered provider instance + + * @example + * + * The following example shows how to create a simple event tracking service and register it using + * {@link auto.$provide#provider $provide.provider()}. + * + * ```js + * // Define the eventTracker provider + * function EventTrackerProvider() { + * var trackingUrl = '/track'; + * + * // A provider method for configuring where the tracked events should been saved + * this.setTrackingUrl = function(url) { + * trackingUrl = url; + * }; + * + * // The service factory function + * this.$get = ['$http', function($http) { + * var trackedEvents = {}; + * return { + * // Call this to track an event + * event: function(event) { + * var count = trackedEvents[event] || 0; + * count += 1; + * trackedEvents[event] = count; + * return count; + * }, + * // Call this to save the tracked events to the trackingUrl + * save: function() { + * $http.post(trackingUrl, trackedEvents); + * } + * }; + * }]; + * } + * + * describe('eventTracker', function() { + * var postSpy; + * + * beforeEach(module(function($provide) { + * // Register the eventTracker provider + * $provide.provider('eventTracker', EventTrackerProvider); + * })); + * + * beforeEach(module(function(eventTrackerProvider) { + * // Configure eventTracker provider + * eventTrackerProvider.setTrackingUrl('/custom-track'); + * })); + * + * it('tracks events', inject(function(eventTracker) { + * expect(eventTracker.event('login')).toEqual(1); + * expect(eventTracker.event('login')).toEqual(2); + * })); + * + * it('saves to the tracking url', inject(function(eventTracker, $http) { + * postSpy = spyOn($http, 'post'); + * eventTracker.event('login'); + * eventTracker.save(); + * expect(postSpy).toHaveBeenCalled(); + * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track'); + * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track'); + * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 }); + * })); + * }); + * ``` + */ + +/** + * @ngdoc method + * @name $provide#factory + * @description + * + * Register a **service factory**, which will be called to return the service instance. + * This is short for registering a service where its provider consists of only a `$get` property, + * which is the given service factory function. + * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to + * configure your service in a provider. + * + * @param {string} name The name of the instance. + * @param {Function|Array.} $getFn The injectable $getFn for the instance creation. + * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`. + * @returns {Object} registered provider instance + * + * @example + * Here is an example of registering a service + * ```js + * $provide.factory('ping', ['$http', function($http) { + * return function ping() { + * return $http.send('/ping'); + * }; + * }]); + * ``` + * You would then inject and use this service like this: + * ```js + * someModule.controller('Ctrl', ['ping', function(ping) { + * ping(); + * }]); + * ``` + */ + + +/** + * @ngdoc method + * @name $provide#service + * @description + * + * Register a **service constructor**, which will be invoked with `new` to create the service + * instance. + * This is short for registering a service where its provider's `$get` property is the service + * constructor function that will be used to instantiate the service instance. + * + * You should use {@link auto.$provide#service $provide.service(class)} if you define your service + * as a type/class. + * + * @param {string} name The name of the instance. + * @param {Function|Array.} constructor An injectable class (constructor function) + * that will be instantiated. + * @returns {Object} registered provider instance + * + * @example + * Here is an example of registering a service using + * {@link auto.$provide#service $provide.service(class)}. + * ```js + * var Ping = function($http) { + * this.$http = $http; + * }; + * + * Ping.$inject = ['$http']; + * + * Ping.prototype.send = function() { + * return this.$http.get('/ping'); + * }; + * $provide.service('ping', Ping); + * ``` + * You would then inject and use this service like this: + * ```js + * someModule.controller('Ctrl', ['ping', function(ping) { + * ping.send(); + * }]); + * ``` + */ + + +/** + * @ngdoc method + * @name $provide#value + * @description + * + * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a + * number, an array, an object or a function. This is short for registering a service where its + * provider's `$get` property is a factory function that takes no arguments and returns the **value + * service**. + * + * Value services are similar to constant services, except that they cannot be injected into a + * module configuration function (see {@link angular.Module#config}) but they can be overridden by + * an Angular + * {@link auto.$provide#decorator decorator}. + * + * @param {string} name The name of the instance. + * @param {*} value The value. + * @returns {Object} registered provider instance + * + * @example + * Here are some examples of creating value services. + * ```js + * $provide.value('ADMIN_USER', 'admin'); + * + * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 }); + * + * $provide.value('halfOf', function(value) { + * return value / 2; + * }); + * ``` + */ + + +/** + * @ngdoc method + * @name $provide#constant + * @description + * + * Register a **constant service**, such as a string, a number, an array, an object or a function, + * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be + * injected into a module configuration function (see {@link angular.Module#config}) and it cannot + * be overridden by an Angular {@link auto.$provide#decorator decorator}. + * + * @param {string} name The name of the constant. + * @param {*} value The constant value. + * @returns {Object} registered instance + * + * @example + * Here a some examples of creating constants: + * ```js + * $provide.constant('SHARD_HEIGHT', 306); + * + * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']); + * + * $provide.constant('double', function(value) { + * return value * 2; + * }); + * ``` + */ + + +/** + * @ngdoc method + * @name $provide#decorator + * @description + * + * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator + * intercepts the creation of a service, allowing it to override or modify the behaviour of the + * service. The object returned by the decorator may be the original service, or a new service + * object which replaces or wraps and delegates to the original service. + * + * @param {string} name The name of the service to decorate. + * @param {Function|Array.} decorator This function will be invoked when the service needs to be + * instantiated and should return the decorated service instance. The function is called using + * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable. + * Local injection arguments: + * + * * `$delegate` - The original service instance, which can be monkey patched, configured, + * decorated or delegated to. + * + * @example + * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting + * calls to {@link ng.$log#error $log.warn()}. + * ```js + * $provide.decorator('$log', ['$delegate', function($delegate) { + * $delegate.warn = $delegate.error; + * return $delegate; + * }]); + * ``` + */ + + +function createInjector(modulesToLoad, strictDi) { + strictDi = (strictDi === true); + var INSTANTIATING = {}, + providerSuffix = 'Provider', + path = [], + loadedModules = new HashMap([], true), + providerCache = { + $provide: { + provider: supportObject(provider), + factory: supportObject(factory), + service: supportObject(service), + value: supportObject(value), + constant: supportObject(constant), + decorator: decorator + } + }, + providerInjector = (providerCache.$injector = + createInternalInjector(providerCache, function(serviceName, caller) { + if (angular.isString(caller)) { + path.push(caller); + } + throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- ')); + })), + instanceCache = {}, + instanceInjector = (instanceCache.$injector = + createInternalInjector(instanceCache, function(serviceName, caller) { + var provider = providerInjector.get(serviceName + providerSuffix, caller); + return instanceInjector.invoke(provider.$get, provider, undefined, serviceName); + })); + + + forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); }); + + return instanceInjector; + + //////////////////////////////////// + // $provider + //////////////////////////////////// + + function supportObject(delegate) { + return function(key, value) { + if (isObject(key)) { + forEach(key, reverseParams(delegate)); + } else { + return delegate(key, value); + } + }; + } + + function provider(name, provider_) { + assertNotHasOwnProperty(name, 'service'); + if (isFunction(provider_) || isArray(provider_)) { + provider_ = providerInjector.instantiate(provider_); + } + if (!provider_.$get) { + throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name); + } + return providerCache[name + providerSuffix] = provider_; + } + + function enforceReturnValue(name, factory) { + return function enforcedReturnValue() { + var result = instanceInjector.invoke(factory, this); + if (isUndefined(result)) { + throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name); + } + return result; + }; + } + + function factory(name, factoryFn, enforce) { + return provider(name, { + $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn + }); + } + + function service(name, constructor) { + return factory(name, ['$injector', function($injector) { + return $injector.instantiate(constructor); + }]); + } + + function value(name, val) { return factory(name, valueFn(val), false); } + + function constant(name, value) { + assertNotHasOwnProperty(name, 'constant'); + providerCache[name] = value; + instanceCache[name] = value; + } + + function decorator(serviceName, decorFn) { + var origProvider = providerInjector.get(serviceName + providerSuffix), + orig$get = origProvider.$get; + + origProvider.$get = function() { + var origInstance = instanceInjector.invoke(orig$get, origProvider); + return instanceInjector.invoke(decorFn, null, {$delegate: origInstance}); + }; + } + + //////////////////////////////////// + // Module Loading + //////////////////////////////////// + function loadModules(modulesToLoad) { + var runBlocks = [], moduleFn; + forEach(modulesToLoad, function(module) { + if (loadedModules.get(module)) return; + loadedModules.put(module, true); + + function runInvokeQueue(queue) { + var i, ii; + for (i = 0, ii = queue.length; i < ii; i++) { + var invokeArgs = queue[i], + provider = providerInjector.get(invokeArgs[0]); + + provider[invokeArgs[1]].apply(provider, invokeArgs[2]); + } + } + + try { + if (isString(module)) { + moduleFn = angularModule(module); + runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); + runInvokeQueue(moduleFn._invokeQueue); + runInvokeQueue(moduleFn._configBlocks); + } else if (isFunction(module)) { + runBlocks.push(providerInjector.invoke(module)); + } else if (isArray(module)) { + runBlocks.push(providerInjector.invoke(module)); + } else { + assertArgFn(module, 'module'); + } + } catch (e) { + if (isArray(module)) { + module = module[module.length - 1]; + } + if (e.message && e.stack && e.stack.indexOf(e.message) == -1) { + // Safari & FF's stack traces don't contain error.message content + // unlike those of Chrome and IE + // So if stack doesn't contain message, we create a new string that contains both. + // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. + /* jshint -W022 */ + e = e.message + '\n' + e.stack; + } + throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}", + module, e.stack || e.message || e); + } + }); + return runBlocks; + } + + //////////////////////////////////// + // internal Injector + //////////////////////////////////// + + function createInternalInjector(cache, factory) { + + function getService(serviceName, caller) { + if (cache.hasOwnProperty(serviceName)) { + if (cache[serviceName] === INSTANTIATING) { + throw $injectorMinErr('cdep', 'Circular dependency found: {0}', + serviceName + ' <- ' + path.join(' <- ')); + } + return cache[serviceName]; + } else { + try { + path.unshift(serviceName); + cache[serviceName] = INSTANTIATING; + return cache[serviceName] = factory(serviceName, caller); + } catch (err) { + if (cache[serviceName] === INSTANTIATING) { + delete cache[serviceName]; + } + throw err; + } finally { + path.shift(); + } + } + } + + function invoke(fn, self, locals, serviceName) { + if (typeof locals === 'string') { + serviceName = locals; + locals = null; + } + + var args = [], + $inject = createInjector.$$annotate(fn, strictDi, serviceName), + length, i, + key; + + for (i = 0, length = $inject.length; i < length; i++) { + key = $inject[i]; + if (typeof key !== 'string') { + throw $injectorMinErr('itkn', + 'Incorrect injection token! Expected service name as string, got {0}', key); + } + args.push( + locals && locals.hasOwnProperty(key) + ? locals[key] + : getService(key, serviceName) + ); + } + if (isArray(fn)) { + fn = fn[length]; + } + + // http://jsperf.com/angularjs-invoke-apply-vs-switch + // #5388 + return fn.apply(self, args); + } + + function instantiate(Type, locals, serviceName) { + // Check if Type is annotated and use just the given function at n-1 as parameter + // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); + // Object creation: http://jsperf.com/create-constructor/2 + var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null); + var returnedValue = invoke(Type, instance, locals, serviceName); + + return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance; + } + + return { + invoke: invoke, + instantiate: instantiate, + get: getService, + annotate: createInjector.$$annotate, + has: function(name) { + return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name); + } + }; + } +} + +createInjector.$$annotate = annotate; + +/** + * @ngdoc provider + * @name $anchorScrollProvider + * + * @description + * Use `$anchorScrollProvider` to disable automatic scrolling whenever + * {@link ng.$location#hash $location.hash()} changes. + */ +function $AnchorScrollProvider() { + + var autoScrollingEnabled = true; + + /** + * @ngdoc method + * @name $anchorScrollProvider#disableAutoScrolling + * + * @description + * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to + * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
+ * Use this method to disable automatic scrolling. + * + * If automatic scrolling is disabled, one must explicitly call + * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the + * current hash. + */ + this.disableAutoScrolling = function() { + autoScrollingEnabled = false; + }; + + /** + * @ngdoc service + * @name $anchorScroll + * @kind function + * @requires $window + * @requires $location + * @requires $rootScope + * + * @description + * When called, it checks the current value of {@link ng.$location#hash $location.hash()} and + * scrolls to the related element, according to the rules specified in the + * [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document). + * + * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to + * match any anchor whenever it changes. This can be disabled by calling + * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}. + * + * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a + * vertical scroll-offset (either fixed or dynamic). + * + * @property {(number|function|jqLite)} yOffset + * If set, specifies a vertical scroll-offset. This is often useful when there are fixed + * positioned elements at the top of the page, such as navbars, headers etc. + * + * `yOffset` can be specified in various ways: + * - **number**: A fixed number of pixels to be used as offset.

+ * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return + * a number representing the offset (in pixels).

+ * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from + * the top of the page to the element's bottom will be used as offset.
+ * **Note**: The element will be taken into account only as long as its `position` is set to + * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust + * their height and/or positioning according to the viewport's size. + * + *
+ *
+ * In order for `yOffset` to work properly, scrolling should take place on the document's root and + * not some child element. + *
+ * + * @example + + +
+ Go to bottom + You're at the bottom! +
+ + + angular.module('anchorScrollExample', []) + .controller('ScrollController', ['$scope', '$location', '$anchorScroll', + function ($scope, $location, $anchorScroll) { + $scope.gotoBottom = function() { + // set the location.hash to the id of + // the element you wish to scroll to. + $location.hash('bottom'); + + // call $anchorScroll() + $anchorScroll(); + }; + }]); + + + #scrollArea { + height: 280px; + overflow: auto; + } + + #bottom { + display: block; + margin-top: 2000px; + } + + + * + *
+ * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value). + * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details. + * + * @example + + + +
+ Anchor {{x}} of 5 +
+
+ + angular.module('anchorScrollOffsetExample', []) + .run(['$anchorScroll', function($anchorScroll) { + $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels + }]) + .controller('headerCtrl', ['$anchorScroll', '$location', '$scope', + function ($anchorScroll, $location, $scope) { + $scope.gotoAnchor = function(x) { + var newHash = 'anchor' + x; + if ($location.hash() !== newHash) { + // set the $location.hash to `newHash` and + // $anchorScroll will automatically scroll to it + $location.hash('anchor' + x); + } else { + // call $anchorScroll() explicitly, + // since $location.hash hasn't changed + $anchorScroll(); + } + }; + } + ]); + + + body { + padding-top: 50px; + } + + .anchor { + border: 2px dashed DarkOrchid; + padding: 10px 10px 200px 10px; + } + + .fixed-header { + background-color: rgba(0, 0, 0, 0.2); + height: 50px; + position: fixed; + top: 0; left: 0; right: 0; + } + + .fixed-header > a { + display: inline-block; + margin: 5px 15px; + } + +
+ */ + this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) { + var document = $window.document; + + // Helper function to get first anchor from a NodeList + // (using `Array#some()` instead of `angular#forEach()` since it's more performant + // and working in all supported browsers.) + function getFirstAnchor(list) { + var result = null; + Array.prototype.some.call(list, function(element) { + if (nodeName_(element) === 'a') { + result = element; + return true; + } + }); + return result; + } + + function getYOffset() { + + var offset = scroll.yOffset; + + if (isFunction(offset)) { + offset = offset(); + } else if (isElement(offset)) { + var elem = offset[0]; + var style = $window.getComputedStyle(elem); + if (style.position !== 'fixed') { + offset = 0; + } else { + offset = elem.getBoundingClientRect().bottom; + } + } else if (!isNumber(offset)) { + offset = 0; + } + + return offset; + } + + function scrollTo(elem) { + if (elem) { + elem.scrollIntoView(); + + var offset = getYOffset(); + + if (offset) { + // `offset` is the number of pixels we should scroll UP in order to align `elem` properly. + // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the + // top of the viewport. + // + // IF the number of pixels from the top of `elem` to the end of the page's content is less + // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some + // way down the page. + // + // This is often the case for elements near the bottom of the page. + // + // In such cases we do not need to scroll the whole `offset` up, just the difference between + // the top of the element and the offset, which is enough to align the top of `elem` at the + // desired position. + var elemTop = elem.getBoundingClientRect().top; + $window.scrollBy(0, elemTop - offset); + } + } else { + $window.scrollTo(0, 0); + } + } + + function scroll() { + var hash = $location.hash(), elm; + + // empty hash, scroll to the top of the page + if (!hash) scrollTo(null); + + // element with given id + else if ((elm = document.getElementById(hash))) scrollTo(elm); + + // first anchor with given name :-D + else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm); + + // no element and hash == 'top', scroll to the top of the page + else if (hash === 'top') scrollTo(null); + } + + // does not scroll when user clicks on anchor link that is currently on + // (no url change, no $location.hash() change), browser native does scroll + if (autoScrollingEnabled) { + $rootScope.$watch(function autoScrollWatch() {return $location.hash();}, + function autoScrollWatchAction(newVal, oldVal) { + // skip the initial scroll if $location.hash is empty + if (newVal === oldVal && newVal === '') return; + + jqLiteDocumentLoaded(function() { + $rootScope.$evalAsync(scroll); + }); + }); + } + + return scroll; + }]; +} + +var $animateMinErr = minErr('$animate'); + +/** + * @ngdoc provider + * @name $animateProvider + * + * @description + * Default implementation of $animate that doesn't perform any animations, instead just + * synchronously performs DOM + * updates and calls done() callbacks. + * + * In order to enable animations the ngAnimate module has to be loaded. + * + * To see the functional implementation check out src/ngAnimate/animate.js + */ +var $AnimateProvider = ['$provide', function($provide) { + + + this.$$selectors = {}; + + + /** + * @ngdoc method + * @name $animateProvider#register + * + * @description + * Registers a new injectable animation factory function. The factory function produces the + * animation object which contains callback functions for each event that is expected to be + * animated. + * + * * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction` + * must be called once the element animation is complete. If a function is returned then the + * animation service will use this function to cancel the animation whenever a cancel event is + * triggered. + * + * + * ```js + * return { + * eventFn : function(element, done) { + * //code to run the animation + * //once complete, then run done() + * return function cancellationFunction() { + * //code to cancel the animation + * } + * } + * } + * ``` + * + * @param {string} name The name of the animation. + * @param {Function} factory The factory function that will be executed to return the animation + * object. + */ + this.register = function(name, factory) { + var key = name + '-animation'; + if (name && name.charAt(0) != '.') throw $animateMinErr('notcsel', + "Expecting class selector starting with '.' got '{0}'.", name); + this.$$selectors[name.substr(1)] = key; + $provide.factory(key, factory); + }; + + /** + * @ngdoc method + * @name $animateProvider#classNameFilter + * + * @description + * Sets and/or returns the CSS class regular expression that is checked when performing + * an animation. Upon bootstrap the classNameFilter value is not set at all and will + * therefore enable $animate to attempt to perform an animation on any element. + * When setting the classNameFilter value, animations will only be performed on elements + * that successfully match the filter expression. This in turn can boost performance + * for low-powered devices as well as applications containing a lot of structural operations. + * @param {RegExp=} expression The className expression which will be checked against all animations + * @return {RegExp} The current CSS className expression value. If null then there is no expression value + */ + this.classNameFilter = function(expression) { + if (arguments.length === 1) { + this.$$classNameFilter = (expression instanceof RegExp) ? expression : null; + } + return this.$$classNameFilter; + }; + + this.$get = ['$$q', '$$asyncCallback', '$rootScope', function($$q, $$asyncCallback, $rootScope) { + + var currentDefer; + + function runAnimationPostDigest(fn) { + var cancelFn, defer = $$q.defer(); + defer.promise.$$cancelFn = function ngAnimateMaybeCancel() { + cancelFn && cancelFn(); + }; + + $rootScope.$$postDigest(function ngAnimatePostDigest() { + cancelFn = fn(function ngAnimateNotifyComplete() { + defer.resolve(); + }); + }); + + return defer.promise; + } + + function resolveElementClasses(element, classes) { + var toAdd = [], toRemove = []; + + var hasClasses = createMap(); + forEach((element.attr('class') || '').split(/\s+/), function(className) { + hasClasses[className] = true; + }); + + forEach(classes, function(status, className) { + var hasClass = hasClasses[className]; + + // If the most recent class manipulation (via $animate) was to remove the class, and the + // element currently has the class, the class is scheduled for removal. Otherwise, if + // the most recent class manipulation (via $animate) was to add the class, and the + // element does not currently have the class, the class is scheduled to be added. + if (status === false && hasClass) { + toRemove.push(className); + } else if (status === true && !hasClass) { + toAdd.push(className); + } + }); + + return (toAdd.length + toRemove.length) > 0 && + [toAdd.length ? toAdd : null, toRemove.length ? toRemove : null]; + } + + function cachedClassManipulation(cache, classes, op) { + for (var i=0, ii = classes.length; i < ii; ++i) { + var className = classes[i]; + cache[className] = op; + } + } + + function asyncPromise() { + // only serve one instance of a promise in order to save CPU cycles + if (!currentDefer) { + currentDefer = $$q.defer(); + $$asyncCallback(function() { + currentDefer.resolve(); + currentDefer = null; + }); + } + return currentDefer.promise; + } + + function applyStyles(element, options) { + if (angular.isObject(options)) { + var styles = extend(options.from || {}, options.to || {}); + element.css(styles); + } + } + + /** + * + * @ngdoc service + * @name $animate + * @description The $animate service provides rudimentary DOM manipulation functions to + * insert, remove and move elements within the DOM, as well as adding and removing classes. + * This service is the core service used by the ngAnimate $animator service which provides + * high-level animation hooks for CSS and JavaScript. + * + * $animate is available in the AngularJS core, however, the ngAnimate module must be included + * to enable full out animation support. Otherwise, $animate will only perform simple DOM + * manipulation operations. + * + * To learn more about enabling animation support, click here to visit the {@link ngAnimate + * ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service + * page}. + */ + return { + animate: function(element, from, to) { + applyStyles(element, { from: from, to: to }); + return asyncPromise(); + }, + + /** + * + * @ngdoc method + * @name $animate#enter + * @kind function + * @description Inserts the element into the DOM either after the `after` element or + * as the first child within the `parent` element. When the function is called a promise + * is returned that will be resolved at a later time. + * @param {DOMElement} element the element which will be inserted into the DOM + * @param {DOMElement} parent the parent element which will append the element as + * a child (if the after element is not present) + * @param {DOMElement} after the sibling element which will append the element + * after itself + * @param {object=} options an optional collection of styles that will be applied to the element. + * @return {Promise} the animation callback promise + */ + enter: function(element, parent, after, options) { + applyStyles(element, options); + after ? after.after(element) + : parent.prepend(element); + return asyncPromise(); + }, + + /** + * + * @ngdoc method + * @name $animate#leave + * @kind function + * @description Removes the element from the DOM. When the function is called a promise + * is returned that will be resolved at a later time. + * @param {DOMElement} element the element which will be removed from the DOM + * @param {object=} options an optional collection of options that will be applied to the element. + * @return {Promise} the animation callback promise + */ + leave: function(element, options) { + applyStyles(element, options); + element.remove(); + return asyncPromise(); + }, + + /** + * + * @ngdoc method + * @name $animate#move + * @kind function + * @description Moves the position of the provided element within the DOM to be placed + * either after the `after` element or inside of the `parent` element. When the function + * is called a promise is returned that will be resolved at a later time. + * + * @param {DOMElement} element the element which will be moved around within the + * DOM + * @param {DOMElement} parent the parent element where the element will be + * inserted into (if the after element is not present) + * @param {DOMElement} after the sibling element where the element will be + * positioned next to + * @param {object=} options an optional collection of options that will be applied to the element. + * @return {Promise} the animation callback promise + */ + move: function(element, parent, after, options) { + // Do not remove element before insert. Removing will cause data associated with the + // element to be dropped. Insert will implicitly do the remove. + return this.enter(element, parent, after, options); + }, + + /** + * + * @ngdoc method + * @name $animate#addClass + * @kind function + * @description Adds the provided className CSS class value to the provided element. + * When the function is called a promise is returned that will be resolved at a later time. + * @param {DOMElement} element the element which will have the className value + * added to it + * @param {string} className the CSS class which will be added to the element + * @param {object=} options an optional collection of options that will be applied to the element. + * @return {Promise} the animation callback promise + */ + addClass: function(element, className, options) { + return this.setClass(element, className, [], options); + }, + + $$addClassImmediately: function(element, className, options) { + element = jqLite(element); + className = !isString(className) + ? (isArray(className) ? className.join(' ') : '') + : className; + forEach(element, function(element) { + jqLiteAddClass(element, className); + }); + applyStyles(element, options); + return asyncPromise(); + }, + + /** + * + * @ngdoc method + * @name $animate#removeClass + * @kind function + * @description Removes the provided className CSS class value from the provided element. + * When the function is called a promise is returned that will be resolved at a later time. + * @param {DOMElement} element the element which will have the className value + * removed from it + * @param {string} className the CSS class which will be removed from the element + * @param {object=} options an optional collection of options that will be applied to the element. + * @return {Promise} the animation callback promise + */ + removeClass: function(element, className, options) { + return this.setClass(element, [], className, options); + }, + + $$removeClassImmediately: function(element, className, options) { + element = jqLite(element); + className = !isString(className) + ? (isArray(className) ? className.join(' ') : '') + : className; + forEach(element, function(element) { + jqLiteRemoveClass(element, className); + }); + applyStyles(element, options); + return asyncPromise(); + }, + + /** + * + * @ngdoc method + * @name $animate#setClass + * @kind function + * @description Adds and/or removes the given CSS classes to and from the element. + * When the function is called a promise is returned that will be resolved at a later time. + * @param {DOMElement} element the element which will have its CSS classes changed + * removed from it + * @param {string} add the CSS classes which will be added to the element + * @param {string} remove the CSS class which will be removed from the element + * @param {object=} options an optional collection of options that will be applied to the element. + * @return {Promise} the animation callback promise + */ + setClass: function(element, add, remove, options) { + var self = this; + var STORAGE_KEY = '$$animateClasses'; + var createdCache = false; + element = jqLite(element); + + var cache = element.data(STORAGE_KEY); + if (!cache) { + cache = { + classes: {}, + options: options + }; + createdCache = true; + } else if (options && cache.options) { + cache.options = angular.extend(cache.options || {}, options); + } + + var classes = cache.classes; + + add = isArray(add) ? add : add.split(' '); + remove = isArray(remove) ? remove : remove.split(' '); + cachedClassManipulation(classes, add, true); + cachedClassManipulation(classes, remove, false); + + if (createdCache) { + cache.promise = runAnimationPostDigest(function(done) { + var cache = element.data(STORAGE_KEY); + element.removeData(STORAGE_KEY); + + // in the event that the element is removed before postDigest + // is run then the cache will be undefined and there will be + // no need anymore to add or remove and of the element classes + if (cache) { + var classes = resolveElementClasses(element, cache.classes); + if (classes) { + self.$$setClassImmediately(element, classes[0], classes[1], cache.options); + } + } + + done(); + }); + element.data(STORAGE_KEY, cache); + } + + return cache.promise; + }, + + $$setClassImmediately: function(element, add, remove, options) { + add && this.$$addClassImmediately(element, add); + remove && this.$$removeClassImmediately(element, remove); + applyStyles(element, options); + return asyncPromise(); + }, + + enabled: noop, + cancel: noop + }; + }]; +}]; + +function $$AsyncCallbackProvider() { + this.$get = ['$$rAF', '$timeout', function($$rAF, $timeout) { + return $$rAF.supported + ? function(fn) { return $$rAF(fn); } + : function(fn) { + return $timeout(fn, 0, false); + }; + }]; +} + +/* global stripHash: true */ + +/** + * ! This is a private undocumented service ! + * + * @name $browser + * @requires $log + * @description + * This object has two goals: + * + * - hide all the global state in the browser caused by the window object + * - abstract away all the browser specific features and inconsistencies + * + * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser` + * service, which can be used for convenient testing of the application without the interaction with + * the real browser apis. + */ +/** + * @param {object} window The global window object. + * @param {object} document jQuery wrapped document. + * @param {object} $log window.console or an object with the same interface. + * @param {object} $sniffer $sniffer service + */ +function Browser(window, document, $log, $sniffer) { + var self = this, + rawDocument = document[0], + location = window.location, + history = window.history, + setTimeout = window.setTimeout, + clearTimeout = window.clearTimeout, + pendingDeferIds = {}; + + self.isMock = false; + + var outstandingRequestCount = 0; + var outstandingRequestCallbacks = []; + + // TODO(vojta): remove this temporary api + self.$$completeOutstandingRequest = completeOutstandingRequest; + self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; }; + + /** + * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` + * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed. + */ + function completeOutstandingRequest(fn) { + try { + fn.apply(null, sliceArgs(arguments, 1)); + } finally { + outstandingRequestCount--; + if (outstandingRequestCount === 0) { + while (outstandingRequestCallbacks.length) { + try { + outstandingRequestCallbacks.pop()(); + } catch (e) { + $log.error(e); + } + } + } + } + } + + function getHash(url) { + var index = url.indexOf('#'); + return index === -1 ? '' : url.substr(index); + } + + /** + * @private + * Note: this method is used only by scenario runner + * TODO(vojta): prefix this method with $$ ? + * @param {function()} callback Function that will be called when no outstanding request + */ + self.notifyWhenNoOutstandingRequests = function(callback) { + // force browser to execute all pollFns - this is needed so that cookies and other pollers fire + // at some deterministic time in respect to the test runner's actions. Leaving things up to the + // regular poller would result in flaky tests. + forEach(pollFns, function(pollFn) { pollFn(); }); + + if (outstandingRequestCount === 0) { + callback(); + } else { + outstandingRequestCallbacks.push(callback); + } + }; + + ////////////////////////////////////////////////////////////// + // Poll Watcher API + ////////////////////////////////////////////////////////////// + var pollFns = [], + pollTimeout; + + /** + * @name $browser#addPollFn + * + * @param {function()} fn Poll function to add + * + * @description + * Adds a function to the list of functions that poller periodically executes, + * and starts polling if not started yet. + * + * @returns {function()} the added function + */ + self.addPollFn = function(fn) { + if (isUndefined(pollTimeout)) startPoller(100, setTimeout); + pollFns.push(fn); + return fn; + }; + + /** + * @param {number} interval How often should browser call poll functions (ms) + * @param {function()} setTimeout Reference to a real or fake `setTimeout` function. + * + * @description + * Configures the poller to run in the specified intervals, using the specified + * setTimeout fn and kicks it off. + */ + function startPoller(interval, setTimeout) { + (function check() { + forEach(pollFns, function(pollFn) { pollFn(); }); + pollTimeout = setTimeout(check, interval); + })(); + } + + ////////////////////////////////////////////////////////////// + // URL API + ////////////////////////////////////////////////////////////// + + var cachedState, lastHistoryState, + lastBrowserUrl = location.href, + baseElement = document.find('base'), + reloadLocation = null; + + cacheState(); + lastHistoryState = cachedState; + + /** + * @name $browser#url + * + * @description + * GETTER: + * Without any argument, this method just returns current value of location.href. + * + * SETTER: + * With at least one argument, this method sets url to new value. + * If html5 history api supported, pushState/replaceState is used, otherwise + * location.href/location.replace is used. + * Returns its own instance to allow chaining + * + * NOTE: this api is intended for use only by the $location service. Please use the + * {@link ng.$location $location service} to change url. + * + * @param {string} url New url (when used as setter) + * @param {boolean=} replace Should new url replace current history record? + * @param {object=} state object to use with pushState/replaceState + */ + self.url = function(url, replace, state) { + // In modern browsers `history.state` is `null` by default; treating it separately + // from `undefined` would cause `$browser.url('/foo')` to change `history.state` + // to undefined via `pushState`. Instead, let's change `undefined` to `null` here. + if (isUndefined(state)) { + state = null; + } + + // Android Browser BFCache causes location, history reference to become stale. + if (location !== window.location) location = window.location; + if (history !== window.history) history = window.history; + + // setter + if (url) { + var sameState = lastHistoryState === state; + + // Don't change anything if previous and current URLs and states match. This also prevents + // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode. + // See https://github.com/angular/angular.js/commit/ffb2701 + if (lastBrowserUrl === url && (!$sniffer.history || sameState)) { + return self; + } + var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url); + lastBrowserUrl = url; + lastHistoryState = state; + // Don't use history API if only the hash changed + // due to a bug in IE10/IE11 which leads + // to not firing a `hashchange` nor `popstate` event + // in some cases (see #9143). + if ($sniffer.history && (!sameBase || !sameState)) { + history[replace ? 'replaceState' : 'pushState'](state, '', url); + cacheState(); + // Do the assignment again so that those two variables are referentially identical. + lastHistoryState = cachedState; + } else { + if (!sameBase || reloadLocation) { + reloadLocation = url; + } + if (replace) { + location.replace(url); + } else if (!sameBase) { + location.href = url; + } else { + location.hash = getHash(url); + } + } + return self; + // getter + } else { + // - reloadLocation is needed as browsers don't allow to read out + // the new location.href if a reload happened. + // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172 + return reloadLocation || location.href.replace(/%27/g,"'"); + } + }; + + /** + * @name $browser#state + * + * @description + * This method is a getter. + * + * Return history.state or null if history.state is undefined. + * + * @returns {object} state + */ + self.state = function() { + return cachedState; + }; + + var urlChangeListeners = [], + urlChangeInit = false; + + function cacheStateAndFireUrlChange() { + cacheState(); + fireUrlChange(); + } + + function getCurrentState() { + try { + return history.state; + } catch (e) { + // MSIE can reportedly throw when there is no state (UNCONFIRMED). + } + } + + // This variable should be used *only* inside the cacheState function. + var lastCachedState = null; + function cacheState() { + // This should be the only place in $browser where `history.state` is read. + cachedState = getCurrentState(); + cachedState = isUndefined(cachedState) ? null : cachedState; + + // Prevent callbacks fo fire twice if both hashchange & popstate were fired. + if (equals(cachedState, lastCachedState)) { + cachedState = lastCachedState; + } + lastCachedState = cachedState; + } + + function fireUrlChange() { + if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) { + return; + } + + lastBrowserUrl = self.url(); + lastHistoryState = cachedState; + forEach(urlChangeListeners, function(listener) { + listener(self.url(), cachedState); + }); + } + + /** + * @name $browser#onUrlChange + * + * @description + * Register callback function that will be called, when url changes. + * + * It's only called when the url is changed from outside of angular: + * - user types different url into address bar + * - user clicks on history (forward/back) button + * - user clicks on a link + * + * It's not called when url is changed by $browser.url() method + * + * The listener gets called with new url as parameter. + * + * NOTE: this api is intended for use only by the $location service. Please use the + * {@link ng.$location $location service} to monitor url changes in angular apps. + * + * @param {function(string)} listener Listener function to be called when url changes. + * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous. + */ + self.onUrlChange = function(callback) { + // TODO(vojta): refactor to use node's syntax for events + if (!urlChangeInit) { + // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera) + // don't fire popstate when user change the address bar and don't fire hashchange when url + // changed by push/replaceState + + // html5 history api - popstate event + if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange); + // hashchange event + jqLite(window).on('hashchange', cacheStateAndFireUrlChange); + + urlChangeInit = true; + } + + urlChangeListeners.push(callback); + return callback; + }; + + /** + * Checks whether the url has changed outside of Angular. + * Needs to be exported to be able to check for changes that have been done in sync, + * as hashchange/popstate events fire in async. + */ + self.$$checkUrlChange = fireUrlChange; + + ////////////////////////////////////////////////////////////// + // Misc API + ////////////////////////////////////////////////////////////// + + /** + * @name $browser#baseHref + * + * @description + * Returns current + * (always relative - without domain) + * + * @returns {string} The current base href + */ + self.baseHref = function() { + var href = baseElement.attr('href'); + return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : ''; + }; + + ////////////////////////////////////////////////////////////// + // Cookies API + ////////////////////////////////////////////////////////////// + var lastCookies = {}; + var lastCookieString = ''; + var cookiePath = self.baseHref(); + + function safeDecodeURIComponent(str) { + try { + return decodeURIComponent(str); + } catch (e) { + return str; + } + } + + /** + * @name $browser#cookies + * + * @param {string=} name Cookie name + * @param {string=} value Cookie value + * + * @description + * The cookies method provides a 'private' low level access to browser cookies. + * It is not meant to be used directly, use the $cookie service instead. + * + * The return values vary depending on the arguments that the method was called with as follows: + * + * - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify + * it + * - cookies(name, value) -> set name to value, if value is undefined delete the cookie + * - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that + * way) + * + * @returns {Object} Hash of all cookies (if called without any parameter) + */ + self.cookies = function(name, value) { + var cookieLength, cookieArray, cookie, i, index; + + if (name) { + if (value === undefined) { + rawDocument.cookie = encodeURIComponent(name) + "=;path=" + cookiePath + + ";expires=Thu, 01 Jan 1970 00:00:00 GMT"; + } else { + if (isString(value)) { + cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + + ';path=' + cookiePath).length + 1; + + // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum: + // - 300 cookies + // - 20 cookies per unique domain + // - 4096 bytes per cookie + if (cookieLength > 4096) { + $log.warn("Cookie '" + name + + "' possibly not set or overflowed because it was too large (" + + cookieLength + " > 4096 bytes)!"); + } + } + } + } else { + if (rawDocument.cookie !== lastCookieString) { + lastCookieString = rawDocument.cookie; + cookieArray = lastCookieString.split("; "); + lastCookies = {}; + + for (i = 0; i < cookieArray.length; i++) { + cookie = cookieArray[i]; + index = cookie.indexOf('='); + if (index > 0) { //ignore nameless cookies + name = safeDecodeURIComponent(cookie.substring(0, index)); + // the first value that is seen for a cookie is the most + // specific one. values for the same cookie name that + // follow are for less specific paths. + if (lastCookies[name] === undefined) { + lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1)); + } + } + } + } + return lastCookies; + } + }; + + + /** + * @name $browser#defer + * @param {function()} fn A function, who's execution should be deferred. + * @param {number=} [delay=0] of milliseconds to defer the function execution. + * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`. + * + * @description + * Executes a fn asynchronously via `setTimeout(fn, delay)`. + * + * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using + * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed + * via `$browser.defer.flush()`. + * + */ + self.defer = function(fn, delay) { + var timeoutId; + outstandingRequestCount++; + timeoutId = setTimeout(function() { + delete pendingDeferIds[timeoutId]; + completeOutstandingRequest(fn); + }, delay || 0); + pendingDeferIds[timeoutId] = true; + return timeoutId; + }; + + + /** + * @name $browser#defer.cancel + * + * @description + * Cancels a deferred task identified with `deferId`. + * + * @param {*} deferId Token returned by the `$browser.defer` function. + * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully + * canceled. + */ + self.defer.cancel = function(deferId) { + if (pendingDeferIds[deferId]) { + delete pendingDeferIds[deferId]; + clearTimeout(deferId); + completeOutstandingRequest(noop); + return true; + } + return false; + }; + +} + +function $BrowserProvider() { + this.$get = ['$window', '$log', '$sniffer', '$document', + function($window, $log, $sniffer, $document) { + return new Browser($window, $document, $log, $sniffer); + }]; +} + +/** + * @ngdoc service + * @name $cacheFactory + * + * @description + * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to + * them. + * + * ```js + * + * var cache = $cacheFactory('cacheId'); + * expect($cacheFactory.get('cacheId')).toBe(cache); + * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined(); + * + * cache.put("key", "value"); + * cache.put("another key", "another value"); + * + * // We've specified no options on creation + * expect(cache.info()).toEqual({id: 'cacheId', size: 2}); + * + * ``` + * + * + * @param {string} cacheId Name or id of the newly created cache. + * @param {object=} options Options object that specifies the cache behavior. Properties: + * + * - `{number=}` `capacity` — turns the cache into LRU cache. + * + * @returns {object} Newly created cache object with the following set of methods: + * + * - `{object}` `info()` — Returns id, size, and options of cache. + * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns + * it. + * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss. + * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache. + * - `{void}` `removeAll()` — Removes all cached values. + * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory. + * + * @example + + +
+ + + + +

Cached Values

+
+ + : + +
+ +

Cache Info

+
+ + : + +
+
+
+ + angular.module('cacheExampleApp', []). + controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) { + $scope.keys = []; + $scope.cache = $cacheFactory('cacheId'); + $scope.put = function(key, value) { + if ($scope.cache.get(key) === undefined) { + $scope.keys.push(key); + } + $scope.cache.put(key, value === undefined ? null : value); + }; + }]); + + + p { + margin: 10px 0 3px; + } + +
+ */ +function $CacheFactoryProvider() { + + this.$get = function() { + var caches = {}; + + function cacheFactory(cacheId, options) { + if (cacheId in caches) { + throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId); + } + + var size = 0, + stats = extend({}, options, {id: cacheId}), + data = {}, + capacity = (options && options.capacity) || Number.MAX_VALUE, + lruHash = {}, + freshEnd = null, + staleEnd = null; + + /** + * @ngdoc type + * @name $cacheFactory.Cache + * + * @description + * A cache object used to store and retrieve data, primarily used by + * {@link $http $http} and the {@link ng.directive:script script} directive to cache + * templates and other data. + * + * ```js + * angular.module('superCache') + * .factory('superCache', ['$cacheFactory', function($cacheFactory) { + * return $cacheFactory('super-cache'); + * }]); + * ``` + * + * Example test: + * + * ```js + * it('should behave like a cache', inject(function(superCache) { + * superCache.put('key', 'value'); + * superCache.put('another key', 'another value'); + * + * expect(superCache.info()).toEqual({ + * id: 'super-cache', + * size: 2 + * }); + * + * superCache.remove('another key'); + * expect(superCache.get('another key')).toBeUndefined(); + * + * superCache.removeAll(); + * expect(superCache.info()).toEqual({ + * id: 'super-cache', + * size: 0 + * }); + * })); + * ``` + */ + return caches[cacheId] = { + + /** + * @ngdoc method + * @name $cacheFactory.Cache#put + * @kind function + * + * @description + * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be + * retrieved later, and incrementing the size of the cache if the key was not already + * present in the cache. If behaving like an LRU cache, it will also remove stale + * entries from the set. + * + * It will not insert undefined values into the cache. + * + * @param {string} key the key under which the cached data is stored. + * @param {*} value the value to store alongside the key. If it is undefined, the key + * will not be stored. + * @returns {*} the value stored. + */ + put: function(key, value) { + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key] || (lruHash[key] = {key: key}); + + refresh(lruEntry); + } + + if (isUndefined(value)) return; + if (!(key in data)) size++; + data[key] = value; + + if (size > capacity) { + this.remove(staleEnd.key); + } + + return value; + }, + + /** + * @ngdoc method + * @name $cacheFactory.Cache#get + * @kind function + * + * @description + * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object. + * + * @param {string} key the key of the data to be retrieved + * @returns {*} the value stored. + */ + get: function(key) { + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key]; + + if (!lruEntry) return; + + refresh(lruEntry); + } + + return data[key]; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#remove + * @kind function + * + * @description + * Removes an entry from the {@link $cacheFactory.Cache Cache} object. + * + * @param {string} key the key of the entry to be removed + */ + remove: function(key) { + if (capacity < Number.MAX_VALUE) { + var lruEntry = lruHash[key]; + + if (!lruEntry) return; + + if (lruEntry == freshEnd) freshEnd = lruEntry.p; + if (lruEntry == staleEnd) staleEnd = lruEntry.n; + link(lruEntry.n,lruEntry.p); + + delete lruHash[key]; + } + + delete data[key]; + size--; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#removeAll + * @kind function + * + * @description + * Clears the cache object of any entries. + */ + removeAll: function() { + data = {}; + size = 0; + lruHash = {}; + freshEnd = staleEnd = null; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#destroy + * @kind function + * + * @description + * Destroys the {@link $cacheFactory.Cache Cache} object entirely, + * removing it from the {@link $cacheFactory $cacheFactory} set. + */ + destroy: function() { + data = null; + stats = null; + lruHash = null; + delete caches[cacheId]; + }, + + + /** + * @ngdoc method + * @name $cacheFactory.Cache#info + * @kind function + * + * @description + * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}. + * + * @returns {object} an object with the following properties: + *
    + *
  • **id**: the id of the cache instance
  • + *
  • **size**: the number of entries kept in the cache instance
  • + *
  • **...**: any additional properties from the options object when creating the + * cache.
  • + *
+ */ + info: function() { + return extend({}, stats, {size: size}); + } + }; + + + /** + * makes the `entry` the freshEnd of the LRU linked list + */ + function refresh(entry) { + if (entry != freshEnd) { + if (!staleEnd) { + staleEnd = entry; + } else if (staleEnd == entry) { + staleEnd = entry.n; + } + + link(entry.n, entry.p); + link(entry, freshEnd); + freshEnd = entry; + freshEnd.n = null; + } + } + + + /** + * bidirectionally links two entries of the LRU linked list + */ + function link(nextEntry, prevEntry) { + if (nextEntry != prevEntry) { + if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify + if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify + } + } + } + + + /** + * @ngdoc method + * @name $cacheFactory#info + * + * @description + * Get information about all the caches that have been created + * + * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info` + */ + cacheFactory.info = function() { + var info = {}; + forEach(caches, function(cache, cacheId) { + info[cacheId] = cache.info(); + }); + return info; + }; + + + /** + * @ngdoc method + * @name $cacheFactory#get + * + * @description + * Get access to a cache object by the `cacheId` used when it was created. + * + * @param {string} cacheId Name or id of a cache to access. + * @returns {object} Cache object identified by the cacheId or undefined if no such cache. + */ + cacheFactory.get = function(cacheId) { + return caches[cacheId]; + }; + + + return cacheFactory; + }; +} + +/** + * @ngdoc service + * @name $templateCache + * + * @description + * The first time a template is used, it is loaded in the template cache for quick retrieval. You + * can load templates directly into the cache in a `script` tag, or by consuming the + * `$templateCache` service directly. + * + * Adding via the `script` tag: + * + * ```html + * + * ``` + * + * **Note:** the `script` tag containing the template does not need to be included in the `head` of + * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE, + * element with ng-app attribute), otherwise the template will be ignored. + * + * Adding via the `$templateCache` service: + * + * ```js + * var myApp = angular.module('myApp', []); + * myApp.run(function($templateCache) { + * $templateCache.put('templateId.html', 'This is the content of the template'); + * }); + * ``` + * + * To retrieve the template later, simply use it in your HTML: + * ```html + *
+ * ``` + * + * or get it via Javascript: + * ```js + * $templateCache.get('templateId.html') + * ``` + * + * See {@link ng.$cacheFactory $cacheFactory}. + * + */ +function $TemplateCacheProvider() { + this.$get = ['$cacheFactory', function($cacheFactory) { + return $cacheFactory('templates'); + }]; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE! + * + * DOM-related variables: + * + * - "node" - DOM Node + * - "element" - DOM Element or Node + * - "$node" or "$element" - jqLite-wrapped node or element + * + * + * Compiler related stuff: + * + * - "linkFn" - linking fn of a single directive + * - "nodeLinkFn" - function that aggregates all linking fns for a particular node + * - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node + * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList) + */ + + +/** + * @ngdoc service + * @name $compile + * @kind function + * + * @description + * Compiles an HTML string or DOM into a template and produces a template function, which + * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together. + * + * The compilation is a process of walking the DOM tree and matching DOM elements to + * {@link ng.$compileProvider#directive directives}. + * + *
+ * **Note:** This document is an in-depth reference of all directive options. + * For a gentle introduction to directives with examples of common use cases, + * see the {@link guide/directive directive guide}. + *
+ * + * ## Comprehensive Directive API + * + * There are many different options for a directive. + * + * The difference resides in the return value of the factory function. + * You can either return a "Directive Definition Object" (see below) that defines the directive properties, + * or just the `postLink` function (all other properties will have the default values). + * + *
+ * **Best Practice:** It's recommended to use the "directive definition object" form. + *
+ * + * Here's an example directive declared with a Directive Definition Object: + * + * ```js + * var myModule = angular.module(...); + * + * myModule.directive('directiveName', function factory(injectables) { + * var directiveDefinitionObject = { + * priority: 0, + * template: '
', // or // function(tElement, tAttrs) { ... }, + * // or + * // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... }, + * transclude: false, + * restrict: 'A', + * templateNamespace: 'html', + * scope: false, + * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, + * controllerAs: 'stringIdentifier', + * bindToController: false, + * require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'], + * compile: function compile(tElement, tAttrs, transclude) { + * return { + * pre: function preLink(scope, iElement, iAttrs, controller) { ... }, + * post: function postLink(scope, iElement, iAttrs, controller) { ... } + * } + * // or + * // return function postLink( ... ) { ... } + * }, + * // or + * // link: { + * // pre: function preLink(scope, iElement, iAttrs, controller) { ... }, + * // post: function postLink(scope, iElement, iAttrs, controller) { ... } + * // } + * // or + * // link: function postLink( ... ) { ... } + * }; + * return directiveDefinitionObject; + * }); + * ``` + * + *
+ * **Note:** Any unspecified options will use the default value. You can see the default values below. + *
+ * + * Therefore the above can be simplified as: + * + * ```js + * var myModule = angular.module(...); + * + * myModule.directive('directiveName', function factory(injectables) { + * var directiveDefinitionObject = { + * link: function postLink(scope, iElement, iAttrs) { ... } + * }; + * return directiveDefinitionObject; + * // or + * // return function postLink(scope, iElement, iAttrs) { ... } + * }); + * ``` + * + * + * + * ### Directive Definition Object + * + * The directive definition object provides instructions to the {@link ng.$compile + * compiler}. The attributes are: + * + * #### `multiElement` + * When this property is set to true, the HTML compiler will collect DOM nodes between + * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them + * together as the directive elements. It is recommended that this feature be used on directives + * which are not strictly behavioural (such as {@link ngClick}), and which + * do not manipulate or replace child nodes (such as {@link ngInclude}). + * + * #### `priority` + * When there are multiple directives defined on a single DOM element, sometimes it + * is necessary to specify the order in which the directives are applied. The `priority` is used + * to sort the directives before their `compile` functions get called. Priority is defined as a + * number. Directives with greater numerical `priority` are compiled first. Pre-link functions + * are also run in priority order, but post-link functions are run in reverse order. The order + * of directives with the same priority is undefined. The default priority is `0`. + * + * #### `terminal` + * If set to true then the current `priority` will be the last set of directives + * which will execute (any directives at the current priority will still execute + * as the order of execution on same `priority` is undefined). Note that expressions + * and other directives used in the directive's template will also be excluded from execution. + * + * #### `scope` + * **If set to `true`,** then a new scope will be created for this directive. If multiple directives on the + * same element request a new scope, only one new scope is created. The new scope rule does not + * apply for the root of the template since the root of the template always gets a new scope. + * + * **If set to `{}` (object hash),** then a new "isolate" scope is created. The 'isolate' scope differs from + * normal scope in that it does not prototypically inherit from the parent scope. This is useful + * when creating reusable components, which should not accidentally read or modify data in the + * parent scope. + * + * The 'isolate' scope takes an object hash which defines a set of local scope properties + * derived from the parent scope. These local properties are useful for aliasing values for + * templates. Locals definition is a hash of local scope property to its source: + * + * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is + * always a string since DOM attributes are strings. If no `attr` name is specified then the + * attribute name is assumed to be the same as the local name. + * Given `` and widget definition + * of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect + * the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the + * `localName` property on the widget scope. The `name` is read from the parent scope (not + * component scope). + * + * * `=` or `=attr` - set up bi-directional binding between a local scope property and the + * parent scope property of name defined via the value of the `attr` attribute. If no `attr` + * name is specified then the attribute name is assumed to be the same as the local name. + * Given `` and widget definition of + * `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the + * value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected + * in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent + * scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You + * can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. If + * you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use + * `=*` or `=*attr` (`=*?` or `=*?attr` if the property is optional). + * + * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. + * If no `attr` name is specified then the attribute name is assumed to be the same as the + * local name. Given `` and widget definition of + * `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to + * a function wrapper for the `count = count + value` expression. Often it's desirable to + * pass data from the isolated scope via an expression to the parent scope, this can be + * done by passing a map of local variable names and values into the expression wrapper fn. + * For example, if the expression is `increment(amount)` then we can specify the amount value + * by calling the `localFn` as `localFn({amount: 22})`. + * + * + * #### `bindToController` + * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will + * allow a component to have its properties bound to the controller, rather than to scope. When the controller + * is instantiated, the initial values of the isolate scope bindings are already available. + * + * #### `controller` + * Controller constructor function. The controller is instantiated before the + * pre-linking phase and it is shared with other directives (see + * `require` attribute). This allows the directives to communicate with each other and augment + * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals: + * + * * `$scope` - Current scope associated with the element + * * `$element` - Current element + * * `$attrs` - Current attributes object for the element + * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope: + * `function([scope], cloneLinkingFn, futureParentElement)`. + * * `scope`: optional argument to override the scope. + * * `cloneLinkingFn`: optional argument to create clones of the original transcluded content. + * * `futureParentElement`: + * * defines the parent to which the `cloneLinkingFn` will add the cloned elements. + * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`. + * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements) + * and when the `cloneLinkinFn` is passed, + * as those elements need to created and cloned in a special way when they are defined outside their + * usual containers (e.g. like ``). + * * See also the `directive.templateNamespace` property. + * + * + * #### `require` + * Require another directive and inject its controller as the fourth argument to the linking function. The + * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the + * injected argument will be an array in corresponding order. If no such directive can be + * found, or if the directive does not have a controller, then an error is raised (unless no link function + * is specified, in which case error checking is skipped). The name can be prefixed with: + * + * * (no prefix) - Locate the required controller on the current element. Throw an error if not found. + * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found. + * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found. + * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found. + * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass + * `null` to the `link` fn if not found. + * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass + * `null` to the `link` fn if not found. + * + * + * #### `controllerAs` + * Controller alias at the directive scope. An alias for the controller so it + * can be referenced at the directive template. The directive needs to define a scope for this + * configuration to be used. Useful in the case when directive is used as component. + * + * + * #### `restrict` + * String of subset of `EACM` which restricts the directive to a specific directive + * declaration style. If omitted, the defaults (elements and attributes) are used. + * + * * `E` - Element name (default): `` + * * `A` - Attribute (default): `
` + * * `C` - Class: `
` + * * `M` - Comment: `` + * + * + * #### `templateNamespace` + * String representing the document type used by the markup in the template. + * AngularJS needs this information as those elements need to be created and cloned + * in a special way when they are defined outside their usual containers like `` and ``. + * + * * `html` - All root nodes in the template are HTML. Root nodes may also be + * top-level elements such as `` or ``. + * * `svg` - The root nodes in the template are SVG elements (excluding ``). + * * `math` - The root nodes in the template are MathML elements (excluding ``). + * + * If no `templateNamespace` is specified, then the namespace is considered to be `html`. + * + * #### `template` + * HTML markup that may: + * * Replace the contents of the directive's element (default). + * * Replace the directive's element itself (if `replace` is true - DEPRECATED). + * * Wrap the contents of the directive's element (if `transclude` is true). + * + * Value may be: + * + * * A string. For example `
{{delete_str}}
`. + * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile` + * function api below) and returns a string value. + * + * + * #### `templateUrl` + * This is similar to `template` but the template is loaded from the specified URL, asynchronously. + * + * Because template loading is asynchronous the compiler will suspend compilation of directives on that element + * for later when the template has been resolved. In the meantime it will continue to compile and link + * sibling and parent elements as though this element had not contained any directives. + * + * The compiler does not suspend the entire compilation to wait for templates to be loaded because this + * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the + * case when only one deeply nested directive has `templateUrl`. + * + * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache} + * + * You can specify `templateUrl` as a string representing the URL or as a function which takes two + * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns + * a string value representing the url. In either case, the template URL is passed through {@link + * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}. + * + * + * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0) + * specify what the template should replace. Defaults to `false`. + * + * * `true` - the template will replace the directive's element. + * * `false` - the template will replace the contents of the directive's element. + * + * The replacement process migrates all of the attributes / classes from the old element to the new + * one. See the {@link guide/directive#template-expanding-directive + * Directives Guide} for an example. + * + * There are very few scenarios where element replacement is required for the application function, + * the main one being reusable custom components that are used within SVG contexts + * (because SVG doesn't work with custom elements in the DOM tree). + * + * #### `transclude` + * Extract the contents of the element where the directive appears and make it available to the directive. + * The contents are compiled and provided to the directive as a **transclusion function**. See the + * {@link $compile#transclusion Transclusion} section below. + * + * There are two kinds of transclusion depending upon whether you want to transclude just the contents of the + * directive's element or the entire element: + * + * * `true` - transclude the content (i.e. the child nodes) of the directive's element. + * * `'element'` - transclude the whole of the directive's element including any directives on this + * element that defined at a lower priority than this directive. When used, the `template` + * property is ignored. + * + * + * #### `compile` + * + * ```js + * function compile(tElement, tAttrs, transclude) { ... } + * ``` + * + * The compile function deals with transforming the template DOM. Since most directives do not do + * template transformation, it is not used often. The compile function takes the following arguments: + * + * * `tElement` - template element - The element where the directive has been declared. It is + * safe to do template transformation on the element and child elements only. + * + * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared + * between all directive compile functions. + * + * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)` + * + *
+ * **Note:** The template instance and the link instance may be different objects if the template has + * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that + * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration + * should be done in a linking function rather than in a compile function. + *
+ + *
+ * **Note:** The compile function cannot handle directives that recursively use themselves in their + * own templates or compile functions. Compiling these directives results in an infinite loop and a + * stack overflow errors. + * + * This can be avoided by manually using $compile in the postLink function to imperatively compile + * a directive's template instead of relying on automatic template compilation via `template` or + * `templateUrl` declaration or manual compilation inside the compile function. + *
+ * + *
+ * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it + * e.g. does not know about the right outer scope. Please use the transclude function that is passed + * to the link function instead. + *
+ + * A compile function can have a return value which can be either a function or an object. + * + * * returning a (post-link) function - is equivalent to registering the linking function via the + * `link` property of the config object when the compile function is empty. + * + * * returning an object with function(s) registered via `pre` and `post` properties - allows you to + * control when a linking function should be called during the linking phase. See info about + * pre-linking and post-linking functions below. + * + * + * #### `link` + * This property is used only if the `compile` property is not defined. + * + * ```js + * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... } + * ``` + * + * The link function is responsible for registering DOM listeners as well as updating the DOM. It is + * executed after the template has been cloned. This is where most of the directive logic will be + * put. + * + * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the + * directive for registering {@link ng.$rootScope.Scope#$watch watches}. + * + * * `iElement` - instance element - The element where the directive is to be used. It is safe to + * manipulate the children of the element only in `postLink` function since the children have + * already been linked. + * + * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared + * between all directive linking functions. + * + * * `controller` - the directive's required controller instance(s) - Instances are shared + * among all directives, which allows the directives to use the controllers as a communication + * channel. The exact value depends on the directive's `require` property: + * * `string`: the controller instance + * * `array`: array of controller instances + * * no controller(s) required: `undefined` + * + * If a required controller cannot be found, and it is optional, the instance is `null`, + * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown. + * + * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope. + * This is the same as the `$transclude` + * parameter of directive controllers, see there for details. + * `function([scope], cloneLinkingFn, futureParentElement)`. + * + * #### Pre-linking function + * + * Executed before the child elements are linked. Not safe to do DOM transformation since the + * compiler linking function will fail to locate the correct elements for linking. + * + * #### Post-linking function + * + * Executed after the child elements are linked. + * + * Note that child elements that contain `templateUrl` directives will not have been compiled + * and linked since they are waiting for their template to load asynchronously and their own + * compilation and linking has been suspended until that occurs. + * + * It is safe to do DOM transformation in the post-linking function on elements that are not waiting + * for their async templates to be resolved. + * + * + * ### Transclusion + * + * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and + * copying them to another part of the DOM, while maintaining their connection to the original AngularJS + * scope from where they were taken. + * + * Transclusion is used (often with {@link ngTransclude}) to insert the + * original contents of a directive's element into a specified place in the template of the directive. + * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded + * content has access to the properties on the scope from which it was taken, even if the directive + * has isolated scope. + * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}. + * + * This makes it possible for the widget to have private state for its template, while the transcluded + * content has access to its originating scope. + * + *
+ * **Note:** When testing an element transclude directive you must not place the directive at the root of the + * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives + * Testing Transclusion Directives}. + *
+ * + * #### Transclusion Functions + * + * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion + * function** to the directive's `link` function and `controller`. This transclusion function is a special + * **linking function** that will return the compiled contents linked to a new transclusion scope. + * + *
+ * If you are just using {@link ngTransclude} then you don't need to worry about this function, since + * ngTransclude will deal with it for us. + *
+ * + * If you want to manually control the insertion and removal of the transcluded content in your directive + * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery + * object that contains the compiled DOM, which is linked to the correct transclusion scope. + * + * When you call a transclusion function you can pass in a **clone attach function**. This function accepts + * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded + * content and the `scope` is the newly created transclusion scope, to which the clone is bound. + * + *
+ * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a translude function + * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope. + *
+ * + * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone + * attach function**: + * + * ```js + * var transcludedContent, transclusionScope; + * + * $transclude(function(clone, scope) { + * element.append(clone); + * transcludedContent = clone; + * transclusionScope = scope; + * }); + * ``` + * + * Later, if you want to remove the transcluded content from your DOM then you should also destroy the + * associated transclusion scope: + * + * ```js + * transcludedContent.remove(); + * transclusionScope.$destroy(); + * ``` + * + *
+ * **Best Practice**: if you intend to add and remove transcluded content manually in your directive + * (by calling the transclude function to get the DOM and and calling `element.remove()` to remove it), + * then you are also responsible for calling `$destroy` on the transclusion scope. + *
+ * + * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat} + * automatically destroy their transluded clones as necessary so you do not need to worry about this if + * you are simply using {@link ngTransclude} to inject the transclusion into your directive. + * + * + * #### Transclusion Scopes + * + * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion + * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed + * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it + * was taken. + * + * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look + * like this: + * + * ```html + *
+ *
+ *
+ *
+ *
+ *
+ * ``` + * + * The `$parent` scope hierarchy will look like this: + * + * ``` + * - $rootScope + * - isolate + * - transclusion + * ``` + * + * but the scopes will inherit prototypically from different scopes to their `$parent`. + * + * ``` + * - $rootScope + * - transclusion + * - isolate + * ``` + * + * + * ### Attributes + * + * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the + * `link()` or `compile()` functions. It has a variety of uses. + * + * accessing *Normalized attribute names:* + * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. + * the attributes object allows for normalized access to + * the attributes. + * + * * *Directive inter-communication:* All directives share the same instance of the attributes + * object which allows the directives to use the attributes object as inter directive + * communication. + * + * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object + * allowing other directives to read the interpolated value. + * + * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes + * that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also + * the only way to easily get the actual value because during the linking phase the interpolation + * hasn't been evaluated yet and so the value is at this time set to `undefined`. + * + * ```js + * function linkingFn(scope, elm, attrs, ctrl) { + * // get the attribute value + * console.log(attrs.ngModel); + * + * // change the attribute + * attrs.$set('ngModel', 'new value'); + * + * // observe changes to interpolated attribute + * attrs.$observe('ngModel', function(value) { + * console.log('ngModel has changed value to ' + value); + * }); + * } + * ``` + * + * ## Example + * + *
+ * **Note**: Typically directives are registered with `module.directive`. The example below is + * to illustrate how `$compile` works. + *
+ * + + + +
+
+
+
+
+
+ + it('should auto compile', function() { + var textarea = $('textarea'); + var output = $('div[compile]'); + // The initial state reads 'Hello Angular'. + expect(output.getText()).toBe('Hello Angular'); + textarea.clear(); + textarea.sendKeys('{{name}}!'); + expect(output.getText()).toBe('Angular!'); + }); + +
+ + * + * + * @param {string|DOMElement} element Element or HTML string to compile into a template function. + * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED. + * + *
+ * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it + * e.g. will not use the right outer scope. Please pass the transclude function as a + * `parentBoundTranscludeFn` to the link function instead. + *
+ * + * @param {number} maxPriority only apply directives lower than given priority (Only effects the + * root element(s), not their children) + * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template + * (a DOM element/tree) to a scope. Where: + * + * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. + * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the + * `template` and call the `cloneAttachFn` function allowing the caller to attach the + * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is + * called as:
`cloneAttachFn(clonedElement, scope)` where: + * + * * `clonedElement` - is a clone of the original `element` passed into the compiler. + * * `scope` - is the current scope with which the linking function is working with. + * + * * `options` - An optional object hash with linking options. If `options` is provided, then the following + * keys may be used to control linking behavior: + * + * * `parentBoundTranscludeFn` - the transclude function made available to + * directives; if given, it will be passed through to the link functions of + * directives found in `element` during compilation. + * * `transcludeControllers` - an object hash with keys that map controller names + * to controller instances; if given, it will make the controllers + * available to directives. + * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add + * the cloned elements; only needed for transcludes that are allowed to contain non html + * elements (e.g. SVG elements). See also the directive.controller property. + * + * Calling the linking function returns the element of the template. It is either the original + * element passed in, or the clone of the element if the `cloneAttachFn` is provided. + * + * After linking the view is not updated until after a call to $digest which typically is done by + * Angular automatically. + * + * If you need access to the bound view, there are two ways to do it: + * + * - If you are not asking the linking function to clone the template, create the DOM element(s) + * before you send them to the compiler and keep this reference around. + * ```js + * var element = $compile('

{{total}}

')(scope); + * ``` + * + * - if on the other hand, you need the element to be cloned, the view reference from the original + * example would not point to the clone, but rather to the original template that was cloned. In + * this case, you can access the clone via the cloneAttachFn: + * ```js + * var templateElement = angular.element('

{{total}}

'), + * scope = ....; + * + * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) { + * //attach the clone to DOM document at the right place + * }); + * + * //now we have reference to the cloned DOM via `clonedElement` + * ``` + * + * + * For information on how the compiler works, see the + * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide. + */ + +var $compileMinErr = minErr('$compile'); + +/** + * @ngdoc provider + * @name $compileProvider + * + * @description + */ +$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider']; +function $CompileProvider($provide, $$sanitizeUriProvider) { + var hasDirectives = {}, + Suffix = 'Directive', + COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\w\-]+)\s+(.*)$/, + CLASS_DIRECTIVE_REGEXP = /(([\w\-]+)(?:\:([^;]+))?;?)/, + ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'), + REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/; + + // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes + // The assumption is that future DOM event attribute names will begin with + // 'on' and be composed of only English letters. + var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/; + + function parseIsolateBindings(scope, directiveName) { + var LOCAL_REGEXP = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/; + + var bindings = {}; + + forEach(scope, function(definition, scopeName) { + var match = definition.match(LOCAL_REGEXP); + + if (!match) { + throw $compileMinErr('iscp', + "Invalid isolate scope definition for directive '{0}'." + + " Definition: {... {1}: '{2}' ...}", + directiveName, scopeName, definition); + } + + bindings[scopeName] = { + mode: match[1][0], + collection: match[2] === '*', + optional: match[3] === '?', + attrName: match[4] || scopeName + }; + }); + + return bindings; + } + + /** + * @ngdoc method + * @name $compileProvider#directive + * @kind function + * + * @description + * Register a new directive with the compiler. + * + * @param {string|Object} name Name of the directive in camel-case (i.e. ngBind which + * will match as ng-bind), or an object map of directives where the keys are the + * names and the values are the factories. + * @param {Function|Array} directiveFactory An injectable directive factory function. See + * {@link guide/directive} for more info. + * @returns {ng.$compileProvider} Self for chaining. + */ + this.directive = function registerDirective(name, directiveFactory) { + assertNotHasOwnProperty(name, 'directive'); + if (isString(name)) { + assertArg(directiveFactory, 'directiveFactory'); + if (!hasDirectives.hasOwnProperty(name)) { + hasDirectives[name] = []; + $provide.factory(name + Suffix, ['$injector', '$exceptionHandler', + function($injector, $exceptionHandler) { + var directives = []; + forEach(hasDirectives[name], function(directiveFactory, index) { + try { + var directive = $injector.invoke(directiveFactory); + if (isFunction(directive)) { + directive = { compile: valueFn(directive) }; + } else if (!directive.compile && directive.link) { + directive.compile = valueFn(directive.link); + } + directive.priority = directive.priority || 0; + directive.index = index; + directive.name = directive.name || name; + directive.require = directive.require || (directive.controller && directive.name); + directive.restrict = directive.restrict || 'EA'; + if (isObject(directive.scope)) { + directive.$$isolateBindings = parseIsolateBindings(directive.scope, directive.name); + } + directives.push(directive); + } catch (e) { + $exceptionHandler(e); + } + }); + return directives; + }]); + } + hasDirectives[name].push(directiveFactory); + } else { + forEach(name, reverseParams(registerDirective)); + } + return this; + }; + + + /** + * @ngdoc method + * @name $compileProvider#aHrefSanitizationWhitelist + * @kind function + * + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during a[href] sanitization. + * + * The sanitization is a security measure aimed at preventing XSS attacks via html links. + * + * Any url about to be assigned to a[href] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.aHrefSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp); + return this; + } else { + return $$sanitizeUriProvider.aHrefSanitizationWhitelist(); + } + }; + + + /** + * @ngdoc method + * @name $compileProvider#imgSrcSanitizationWhitelist + * @kind function + * + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during img[src] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to img[src] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.imgSrcSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp); + return this; + } else { + return $$sanitizeUriProvider.imgSrcSanitizationWhitelist(); + } + }; + + /** + * @ngdoc method + * @name $compileProvider#debugInfoEnabled + * + * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the + * current debugInfoEnabled state + * @returns {*} current value if used as getter or itself (chaining) if used as setter + * + * @kind function + * + * @description + * Call this method to enable/disable various debug runtime information in the compiler such as adding + * binding information and a reference to the current scope on to DOM elements. + * If enabled, the compiler will add the following to DOM elements that have been bound to the scope + * * `ng-binding` CSS class + * * `$binding` data property containing an array of the binding expressions + * + * You may want to disable this in production for a significant performance boost. See + * {@link guide/production#disabling-debug-data Disabling Debug Data} for more. + * + * The default value is true. + */ + var debugInfoEnabled = true; + this.debugInfoEnabled = function(enabled) { + if (isDefined(enabled)) { + debugInfoEnabled = enabled; + return this; + } + return debugInfoEnabled; + }; + + this.$get = [ + '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', + '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri', + function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, + $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) { + + var Attributes = function(element, attributesToCopy) { + if (attributesToCopy) { + var keys = Object.keys(attributesToCopy); + var i, l, key; + + for (i = 0, l = keys.length; i < l; i++) { + key = keys[i]; + this[key] = attributesToCopy[key]; + } + } else { + this.$attr = {}; + } + + this.$$element = element; + }; + + Attributes.prototype = { + /** + * @ngdoc method + * @name $compile.directive.Attributes#$normalize + * @kind function + * + * @description + * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or + * `data-`) to its normalized, camelCase form. + * + * Also there is special case for Moz prefix starting with upper case letter. + * + * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives} + * + * @param {string} name Name to normalize + */ + $normalize: directiveNormalize, + + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$addClass + * @kind function + * + * @description + * Adds the CSS class value specified by the classVal parameter to the element. If animations + * are enabled then an animation will be triggered for the class addition. + * + * @param {string} classVal The className value that will be added to the element + */ + $addClass: function(classVal) { + if (classVal && classVal.length > 0) { + $animate.addClass(this.$$element, classVal); + } + }, + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$removeClass + * @kind function + * + * @description + * Removes the CSS class value specified by the classVal parameter from the element. If + * animations are enabled then an animation will be triggered for the class removal. + * + * @param {string} classVal The className value that will be removed from the element + */ + $removeClass: function(classVal) { + if (classVal && classVal.length > 0) { + $animate.removeClass(this.$$element, classVal); + } + }, + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$updateClass + * @kind function + * + * @description + * Adds and removes the appropriate CSS class values to the element based on the difference + * between the new and old CSS class values (specified as newClasses and oldClasses). + * + * @param {string} newClasses The current CSS className value + * @param {string} oldClasses The former CSS className value + */ + $updateClass: function(newClasses, oldClasses) { + var toAdd = tokenDifference(newClasses, oldClasses); + if (toAdd && toAdd.length) { + $animate.addClass(this.$$element, toAdd); + } + + var toRemove = tokenDifference(oldClasses, newClasses); + if (toRemove && toRemove.length) { + $animate.removeClass(this.$$element, toRemove); + } + }, + + /** + * Set a normalized attribute on the element in a way such that all directives + * can share the attribute. This function properly handles boolean attributes. + * @param {string} key Normalized key. (ie ngAttribute) + * @param {string|boolean} value The value to set. If `null` attribute will be deleted. + * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute. + * Defaults to true. + * @param {string=} attrName Optional none normalized name. Defaults to key. + */ + $set: function(key, value, writeAttr, attrName) { + // TODO: decide whether or not to throw an error if "class" + //is set through this function since it may cause $updateClass to + //become unstable. + + var node = this.$$element[0], + booleanKey = getBooleanAttrName(node, key), + aliasedKey = getAliasedAttrName(node, key), + observer = key, + nodeName; + + if (booleanKey) { + this.$$element.prop(key, value); + attrName = booleanKey; + } else if (aliasedKey) { + this[aliasedKey] = value; + observer = aliasedKey; + } + + this[key] = value; + + // translate normalized key to actual key + if (attrName) { + this.$attr[key] = attrName; + } else { + attrName = this.$attr[key]; + if (!attrName) { + this.$attr[key] = attrName = snake_case(key, '-'); + } + } + + nodeName = nodeName_(this.$$element); + + if ((nodeName === 'a' && key === 'href') || + (nodeName === 'img' && key === 'src')) { + // sanitize a[href] and img[src] values + this[key] = value = $$sanitizeUri(value, key === 'src'); + } else if (nodeName === 'img' && key === 'srcset') { + // sanitize img[srcset] values + var result = ""; + + // first check if there are spaces because it's not the same pattern + var trimmedSrcset = trim(value); + // ( 999x ,| 999w ,| ,|, ) + var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/; + var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/; + + // split srcset into tuple of uri and descriptor except for the last item + var rawUris = trimmedSrcset.split(pattern); + + // for each tuples + var nbrUrisWith2parts = Math.floor(rawUris.length / 2); + for (var i = 0; i < nbrUrisWith2parts; i++) { + var innerIdx = i * 2; + // sanitize the uri + result += $$sanitizeUri(trim(rawUris[innerIdx]), true); + // add the descriptor + result += (" " + trim(rawUris[innerIdx + 1])); + } + + // split the last item into uri and descriptor + var lastTuple = trim(rawUris[i * 2]).split(/\s/); + + // sanitize the last uri + result += $$sanitizeUri(trim(lastTuple[0]), true); + + // and add the last descriptor if any + if (lastTuple.length === 2) { + result += (" " + trim(lastTuple[1])); + } + this[key] = value = result; + } + + if (writeAttr !== false) { + if (value === null || value === undefined) { + this.$$element.removeAttr(attrName); + } else { + this.$$element.attr(attrName, value); + } + } + + // fire observers + var $$observers = this.$$observers; + $$observers && forEach($$observers[observer], function(fn) { + try { + fn(value); + } catch (e) { + $exceptionHandler(e); + } + }); + }, + + + /** + * @ngdoc method + * @name $compile.directive.Attributes#$observe + * @kind function + * + * @description + * Observes an interpolated attribute. + * + * The observer function will be invoked once during the next `$digest` following + * compilation. The observer is then invoked whenever the interpolated value + * changes. + * + * @param {string} key Normalized key. (ie ngAttribute) . + * @param {function(interpolatedValue)} fn Function that will be called whenever + the interpolated value of the attribute changes. + * See the {@link guide/directive#text-and-attribute-bindings Directives} guide for more info. + * @returns {function()} Returns a deregistration function for this observer. + */ + $observe: function(key, fn) { + var attrs = this, + $$observers = (attrs.$$observers || (attrs.$$observers = createMap())), + listeners = ($$observers[key] || ($$observers[key] = [])); + + listeners.push(fn); + $rootScope.$evalAsync(function() { + if (!listeners.$$inter && attrs.hasOwnProperty(key)) { + // no one registered attribute interpolation function, so lets call it manually + fn(attrs[key]); + } + }); + + return function() { + arrayRemove(listeners, fn); + }; + } + }; + + + function safeAddClass($element, className) { + try { + $element.addClass(className); + } catch (e) { + // ignore, since it means that we are trying to set class on + // SVG element, where class name is read-only. + } + } + + + var startSymbol = $interpolate.startSymbol(), + endSymbol = $interpolate.endSymbol(), + denormalizeTemplate = (startSymbol == '{{' || endSymbol == '}}') + ? identity + : function denormalizeTemplate(template) { + return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol); + }, + NG_ATTR_BINDING = /^ngAttr[A-Z]/; + + compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) { + var bindings = $element.data('$binding') || []; + + if (isArray(binding)) { + bindings = bindings.concat(binding); + } else { + bindings.push(binding); + } + + $element.data('$binding', bindings); + } : noop; + + compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) { + safeAddClass($element, 'ng-binding'); + } : noop; + + compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) { + var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope'; + $element.data(dataName, scope); + } : noop; + + compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) { + safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope'); + } : noop; + + return compile; + + //================================ + + function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, + previousCompileContext) { + if (!($compileNodes instanceof jqLite)) { + // jquery always rewraps, whereas we need to preserve the original selector so that we can + // modify it. + $compileNodes = jqLite($compileNodes); + } + // We can not compile top level text elements since text nodes can be merged and we will + // not be able to attach scope data to them, so we will wrap them in + forEach($compileNodes, function(node, index) { + if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/) /* non-empty */ ) { + $compileNodes[index] = jqLite(node).wrap('').parent()[0]; + } + }); + var compositeLinkFn = + compileNodes($compileNodes, transcludeFn, $compileNodes, + maxPriority, ignoreDirective, previousCompileContext); + compile.$$addScopeClass($compileNodes); + var namespace = null; + return function publicLinkFn(scope, cloneConnectFn, options) { + assertArg(scope, 'scope'); + + options = options || {}; + var parentBoundTranscludeFn = options.parentBoundTranscludeFn, + transcludeControllers = options.transcludeControllers, + futureParentElement = options.futureParentElement; + + // When `parentBoundTranscludeFn` is passed, it is a + // `controllersBoundTransclude` function (it was previously passed + // as `transclude` to directive.link) so we must unwrap it to get + // its `boundTranscludeFn` + if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) { + parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude; + } + + if (!namespace) { + namespace = detectNamespaceForChildElements(futureParentElement); + } + var $linkNode; + if (namespace !== 'html') { + // When using a directive with replace:true and templateUrl the $compileNodes + // (or a child element inside of them) + // might change, so we need to recreate the namespace adapted compileNodes + // for call to the link function. + // Note: This will already clone the nodes... + $linkNode = jqLite( + wrapTemplate(namespace, jqLite('
').append($compileNodes).html()) + ); + } else if (cloneConnectFn) { + // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart + // and sometimes changes the structure of the DOM. + $linkNode = JQLitePrototype.clone.call($compileNodes); + } else { + $linkNode = $compileNodes; + } + + if (transcludeControllers) { + for (var controllerName in transcludeControllers) { + $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance); + } + } + + compile.$$addScopeInfo($linkNode, scope); + + if (cloneConnectFn) cloneConnectFn($linkNode, scope); + if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn); + return $linkNode; + }; + } + + function detectNamespaceForChildElements(parentElement) { + // TODO: Make this detect MathML as well... + var node = parentElement && parentElement[0]; + if (!node) { + return 'html'; + } else { + return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html'; + } + } + + /** + * Compile function matches each node in nodeList against the directives. Once all directives + * for a particular node are collected their compile functions are executed. The compile + * functions return values - the linking functions - are combined into a composite linking + * function, which is the a linking function for the node. + * + * @param {NodeList} nodeList an array of nodes or NodeList to compile + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the + * scope argument is auto-generated to the new child of the transcluded parent scope. + * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then + * the rootElement must be set the jqLite collection of the compile root. This is + * needed so that the jqLite collection items can be replaced with widgets. + * @param {number=} maxPriority Max directive priority. + * @returns {Function} A composite linking function of all of the matched directives or null. + */ + function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, + previousCompileContext) { + var linkFns = [], + attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound; + + for (var i = 0; i < nodeList.length; i++) { + attrs = new Attributes(); + + // we must always refer to nodeList[i] since the nodes can be replaced underneath us. + directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined, + ignoreDirective); + + nodeLinkFn = (directives.length) + ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, + null, [], [], previousCompileContext) + : null; + + if (nodeLinkFn && nodeLinkFn.scope) { + compile.$$addScopeClass(attrs.$$element); + } + + childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || + !(childNodes = nodeList[i].childNodes) || + !childNodes.length) + ? null + : compileNodes(childNodes, + nodeLinkFn ? ( + (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement) + && nodeLinkFn.transclude) : transcludeFn); + + if (nodeLinkFn || childLinkFn) { + linkFns.push(i, nodeLinkFn, childLinkFn); + linkFnFound = true; + nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn; + } + + //use the previous context only for the first element in the virtual group + previousCompileContext = null; + } + + // return a linking function if we have found anything, null otherwise + return linkFnFound ? compositeLinkFn : null; + + function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) { + var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn; + var stableNodeList; + + + if (nodeLinkFnFound) { + // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our + // offsets don't get screwed up + var nodeListLength = nodeList.length; + stableNodeList = new Array(nodeListLength); + + // create a sparse array by only copying the elements which have a linkFn + for (i = 0; i < linkFns.length; i+=3) { + idx = linkFns[i]; + stableNodeList[idx] = nodeList[idx]; + } + } else { + stableNodeList = nodeList; + } + + for (i = 0, ii = linkFns.length; i < ii;) { + node = stableNodeList[linkFns[i++]]; + nodeLinkFn = linkFns[i++]; + childLinkFn = linkFns[i++]; + + if (nodeLinkFn) { + if (nodeLinkFn.scope) { + childScope = scope.$new(); + compile.$$addScopeInfo(jqLite(node), childScope); + } else { + childScope = scope; + } + + if (nodeLinkFn.transcludeOnThisElement) { + childBoundTranscludeFn = createBoundTranscludeFn( + scope, nodeLinkFn.transclude, parentBoundTranscludeFn, + nodeLinkFn.elementTranscludeOnThisElement); + + } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) { + childBoundTranscludeFn = parentBoundTranscludeFn; + + } else if (!parentBoundTranscludeFn && transcludeFn) { + childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn); + + } else { + childBoundTranscludeFn = null; + } + + nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn); + + } else if (childLinkFn) { + childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn); + } + } + } + } + + function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn, elementTransclusion) { + + var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) { + + if (!transcludedScope) { + transcludedScope = scope.$new(false, containingScope); + transcludedScope.$$transcluded = true; + } + + return transcludeFn(transcludedScope, cloneFn, { + parentBoundTranscludeFn: previousBoundTranscludeFn, + transcludeControllers: controllers, + futureParentElement: futureParentElement + }); + }; + + return boundTranscludeFn; + } + + /** + * Looks for directives on the given node and adds them to the directive collection which is + * sorted. + * + * @param node Node to search. + * @param directives An array to which the directives are added to. This array is sorted before + * the function returns. + * @param attrs The shared attrs object which is used to populate the normalized attributes. + * @param {number=} maxPriority Max directive priority. + */ + function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) { + var nodeType = node.nodeType, + attrsMap = attrs.$attr, + match, + className; + + switch (nodeType) { + case NODE_TYPE_ELEMENT: /* Element */ + // use the node name: + addDirective(directives, + directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective); + + // iterate over the attributes + for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes, + j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) { + var attrStartName = false; + var attrEndName = false; + + attr = nAttrs[j]; + name = attr.name; + value = trim(attr.value); + + // support ngAttr attribute binding + ngAttrName = directiveNormalize(name); + if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) { + name = name.replace(PREFIX_REGEXP, '') + .substr(8).replace(/_(.)/g, function(match, letter) { + return letter.toUpperCase(); + }); + } + + var directiveNName = ngAttrName.replace(/(Start|End)$/, ''); + if (directiveIsMultiElement(directiveNName)) { + if (ngAttrName === directiveNName + 'Start') { + attrStartName = name; + attrEndName = name.substr(0, name.length - 5) + 'end'; + name = name.substr(0, name.length - 6); + } + } + + nName = directiveNormalize(name.toLowerCase()); + attrsMap[nName] = name; + if (isNgAttr || !attrs.hasOwnProperty(nName)) { + attrs[nName] = value; + if (getBooleanAttrName(node, nName)) { + attrs[nName] = true; // presence means true + } + } + addAttrInterpolateDirective(node, directives, value, nName, isNgAttr); + addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, + attrEndName); + } + + // use class as directive + className = node.className; + if (isObject(className)) { + // Maybe SVGAnimatedString + className = className.animVal; + } + if (isString(className) && className !== '') { + while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) { + nName = directiveNormalize(match[2]); + if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) { + attrs[nName] = trim(match[3]); + } + className = className.substr(match.index + match[0].length); + } + } + break; + case NODE_TYPE_TEXT: /* Text Node */ + addTextInterpolateDirective(directives, node.nodeValue); + break; + case NODE_TYPE_COMMENT: /* Comment */ + try { + match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue); + if (match) { + nName = directiveNormalize(match[1]); + if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) { + attrs[nName] = trim(match[2]); + } + } + } catch (e) { + // turns out that under some circumstances IE9 throws errors when one attempts to read + // comment's node value. + // Just ignore it and continue. (Can't seem to reproduce in test case.) + } + break; + } + + directives.sort(byPriority); + return directives; + } + + /** + * Given a node with an directive-start it collects all of the siblings until it finds + * directive-end. + * @param node + * @param attrStart + * @param attrEnd + * @returns {*} + */ + function groupScan(node, attrStart, attrEnd) { + var nodes = []; + var depth = 0; + if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) { + do { + if (!node) { + throw $compileMinErr('uterdir', + "Unterminated attribute, found '{0}' but no matching '{1}' found.", + attrStart, attrEnd); + } + if (node.nodeType == NODE_TYPE_ELEMENT) { + if (node.hasAttribute(attrStart)) depth++; + if (node.hasAttribute(attrEnd)) depth--; + } + nodes.push(node); + node = node.nextSibling; + } while (depth > 0); + } else { + nodes.push(node); + } + + return jqLite(nodes); + } + + /** + * Wrapper for linking function which converts normal linking function into a grouped + * linking function. + * @param linkFn + * @param attrStart + * @param attrEnd + * @returns {Function} + */ + function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) { + return function(scope, element, attrs, controllers, transcludeFn) { + element = groupScan(element[0], attrStart, attrEnd); + return linkFn(scope, element, attrs, controllers, transcludeFn); + }; + } + + /** + * Once the directives have been collected, their compile functions are executed. This method + * is responsible for inlining directive templates as well as terminating the application + * of the directives if the terminal directive has been reached. + * + * @param {Array} directives Array of collected directives to execute their compile function. + * this needs to be pre-sorted by priority order. + * @param {Node} compileNode The raw DOM node to apply the compile functions to + * @param {Object} templateAttrs The shared attribute function + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the + * scope argument is auto-generated to the new + * child of the transcluded parent scope. + * @param {JQLite} jqCollection If we are working on the root of the compile tree then this + * argument has the root jqLite array so that we can replace nodes + * on it. + * @param {Object=} originalReplaceDirective An optional directive that will be ignored when + * compiling the transclusion. + * @param {Array.} preLinkFns + * @param {Array.} postLinkFns + * @param {Object} previousCompileContext Context used for previous compilation of the current + * node + * @returns {Function} linkFn + */ + function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, + jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, + previousCompileContext) { + previousCompileContext = previousCompileContext || {}; + + var terminalPriority = -Number.MAX_VALUE, + newScopeDirective, + controllerDirectives = previousCompileContext.controllerDirectives, + controllers, + newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective, + templateDirective = previousCompileContext.templateDirective, + nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective, + hasTranscludeDirective = false, + hasTemplate = false, + hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective, + $compileNode = templateAttrs.$$element = jqLite(compileNode), + directive, + directiveName, + $template, + replaceDirective = originalReplaceDirective, + childTranscludeFn = transcludeFn, + linkFn, + directiveValue; + + // executes all directives on the current element + for (var i = 0, ii = directives.length; i < ii; i++) { + directive = directives[i]; + var attrStart = directive.$$start; + var attrEnd = directive.$$end; + + // collect multiblock sections + if (attrStart) { + $compileNode = groupScan(compileNode, attrStart, attrEnd); + } + $template = undefined; + + if (terminalPriority > directive.priority) { + break; // prevent further processing of directives + } + + if (directiveValue = directive.scope) { + + // skip the check for directives with async templates, we'll check the derived sync + // directive when the template arrives + if (!directive.templateUrl) { + if (isObject(directiveValue)) { + // This directive is trying to add an isolated scope. + // Check that there is no scope of any kind already + assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective, + directive, $compileNode); + newIsolateScopeDirective = directive; + } else { + // This directive is trying to add a child scope. + // Check that there is no isolated scope already + assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, + $compileNode); + } + } + + newScopeDirective = newScopeDirective || directive; + } + + directiveName = directive.name; + + if (!directive.templateUrl && directive.controller) { + directiveValue = directive.controller; + controllerDirectives = controllerDirectives || {}; + assertNoDuplicate("'" + directiveName + "' controller", + controllerDirectives[directiveName], directive, $compileNode); + controllerDirectives[directiveName] = directive; + } + + if (directiveValue = directive.transclude) { + hasTranscludeDirective = true; + + // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion. + // This option should only be used by directives that know how to safely handle element transclusion, + // where the transcluded nodes are added or replaced after linking. + if (!directive.$$tlb) { + assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode); + nonTlbTranscludeDirective = directive; + } + + if (directiveValue == 'element') { + hasElementTranscludeDirective = true; + terminalPriority = directive.priority; + $template = $compileNode; + $compileNode = templateAttrs.$$element = + jqLite(document.createComment(' ' + directiveName + ': ' + + templateAttrs[directiveName] + ' ')); + compileNode = $compileNode[0]; + replaceWith(jqCollection, sliceArgs($template), compileNode); + + childTranscludeFn = compile($template, transcludeFn, terminalPriority, + replaceDirective && replaceDirective.name, { + // Don't pass in: + // - controllerDirectives - otherwise we'll create duplicates controllers + // - newIsolateScopeDirective or templateDirective - combining templates with + // element transclusion doesn't make sense. + // + // We need only nonTlbTranscludeDirective so that we prevent putting transclusion + // on the same element more than once. + nonTlbTranscludeDirective: nonTlbTranscludeDirective + }); + } else { + $template = jqLite(jqLiteClone(compileNode)).contents(); + $compileNode.empty(); // clear contents + childTranscludeFn = compile($template, transcludeFn); + } + } + + if (directive.template) { + hasTemplate = true; + assertNoDuplicate('template', templateDirective, directive, $compileNode); + templateDirective = directive; + + directiveValue = (isFunction(directive.template)) + ? directive.template($compileNode, templateAttrs) + : directive.template; + + directiveValue = denormalizeTemplate(directiveValue); + + if (directive.replace) { + replaceDirective = directive; + if (jqLiteIsTextNode(directiveValue)) { + $template = []; + } else { + $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue))); + } + compileNode = $template[0]; + + if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { + throw $compileMinErr('tplrt', + "Template for directive '{0}' must have exactly one root element. {1}", + directiveName, ''); + } + + replaceWith(jqCollection, $compileNode, compileNode); + + var newTemplateAttrs = {$attr: {}}; + + // combine directives from the original node and from the template: + // - take the array of directives for this element + // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed) + // - collect directives from the template and sort them by priority + // - combine directives as: processed + template + unprocessed + var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs); + var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1)); + + if (newIsolateScopeDirective) { + markDirectivesAsIsolate(templateDirectives); + } + directives = directives.concat(templateDirectives).concat(unprocessedDirectives); + mergeTemplateAttributes(templateAttrs, newTemplateAttrs); + + ii = directives.length; + } else { + $compileNode.html(directiveValue); + } + } + + if (directive.templateUrl) { + hasTemplate = true; + assertNoDuplicate('template', templateDirective, directive, $compileNode); + templateDirective = directive; + + if (directive.replace) { + replaceDirective = directive; + } + + nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode, + templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, { + controllerDirectives: controllerDirectives, + newIsolateScopeDirective: newIsolateScopeDirective, + templateDirective: templateDirective, + nonTlbTranscludeDirective: nonTlbTranscludeDirective + }); + ii = directives.length; + } else if (directive.compile) { + try { + linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn); + if (isFunction(linkFn)) { + addLinkFns(null, linkFn, attrStart, attrEnd); + } else if (linkFn) { + addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd); + } + } catch (e) { + $exceptionHandler(e, startingTag($compileNode)); + } + } + + if (directive.terminal) { + nodeLinkFn.terminal = true; + terminalPriority = Math.max(terminalPriority, directive.priority); + } + + } + + nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true; + nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective; + nodeLinkFn.elementTranscludeOnThisElement = hasElementTranscludeDirective; + nodeLinkFn.templateOnThisElement = hasTemplate; + nodeLinkFn.transclude = childTranscludeFn; + + previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective; + + // might be normal or delayed nodeLinkFn depending on if templateUrl is present + return nodeLinkFn; + + //////////////////// + + function addLinkFns(pre, post, attrStart, attrEnd) { + if (pre) { + if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd); + pre.require = directive.require; + pre.directiveName = directiveName; + if (newIsolateScopeDirective === directive || directive.$$isolateScope) { + pre = cloneAndAnnotateFn(pre, {isolateScope: true}); + } + preLinkFns.push(pre); + } + if (post) { + if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd); + post.require = directive.require; + post.directiveName = directiveName; + if (newIsolateScopeDirective === directive || directive.$$isolateScope) { + post = cloneAndAnnotateFn(post, {isolateScope: true}); + } + postLinkFns.push(post); + } + } + + + function getControllers(directiveName, require, $element, elementControllers) { + var value, retrievalMethod = 'data', optional = false; + var $searchElement = $element; + var match; + if (isString(require)) { + match = require.match(REQUIRE_PREFIX_REGEXP); + require = require.substring(match[0].length); + + if (match[3]) { + if (match[1]) match[3] = null; + else match[1] = match[3]; + } + if (match[1] === '^') { + retrievalMethod = 'inheritedData'; + } else if (match[1] === '^^') { + retrievalMethod = 'inheritedData'; + $searchElement = $element.parent(); + } + if (match[2] === '?') { + optional = true; + } + + value = null; + + if (elementControllers && retrievalMethod === 'data') { + if (value = elementControllers[require]) { + value = value.instance; + } + } + value = value || $searchElement[retrievalMethod]('$' + require + 'Controller'); + + if (!value && !optional) { + throw $compileMinErr('ctreq', + "Controller '{0}', required by directive '{1}', can't be found!", + require, directiveName); + } + return value || null; + } else if (isArray(require)) { + value = []; + forEach(require, function(require) { + value.push(getControllers(directiveName, require, $element, elementControllers)); + }); + } + return value; + } + + + function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) { + var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element, + attrs; + + if (compileNode === linkNode) { + attrs = templateAttrs; + $element = templateAttrs.$$element; + } else { + $element = jqLite(linkNode); + attrs = new Attributes($element, templateAttrs); + } + + if (newIsolateScopeDirective) { + isolateScope = scope.$new(true); + } + + if (boundTranscludeFn) { + // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn` + // is later passed as `parentBoundTranscludeFn` to `publicLinkFn` + transcludeFn = controllersBoundTransclude; + transcludeFn.$$boundTransclude = boundTranscludeFn; + } + + if (controllerDirectives) { + // TODO: merge `controllers` and `elementControllers` into single object. + controllers = {}; + elementControllers = {}; + forEach(controllerDirectives, function(directive) { + var locals = { + $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope, + $element: $element, + $attrs: attrs, + $transclude: transcludeFn + }, controllerInstance; + + controller = directive.controller; + if (controller == '@') { + controller = attrs[directive.name]; + } + + controllerInstance = $controller(controller, locals, true, directive.controllerAs); + + // For directives with element transclusion the element is a comment, + // but jQuery .data doesn't support attaching data to comment nodes as it's hard to + // clean up (http://bugs.jquery.com/ticket/8335). + // Instead, we save the controllers for the element in a local hash and attach to .data + // later, once we have the actual element. + elementControllers[directive.name] = controllerInstance; + if (!hasElementTranscludeDirective) { + $element.data('$' + directive.name + 'Controller', controllerInstance.instance); + } + + controllers[directive.name] = controllerInstance; + }); + } + + if (newIsolateScopeDirective) { + compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || + templateDirective === newIsolateScopeDirective.$$originalDirective))); + compile.$$addScopeClass($element, true); + + var isolateScopeController = controllers && controllers[newIsolateScopeDirective.name]; + var isolateBindingContext = isolateScope; + if (isolateScopeController && isolateScopeController.identifier && + newIsolateScopeDirective.bindToController === true) { + isolateBindingContext = isolateScopeController.instance; + } + + forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings, function(definition, scopeName) { + var attrName = definition.attrName, + optional = definition.optional, + mode = definition.mode, // @, =, or & + lastValue, + parentGet, parentSet, compare; + + switch (mode) { + + case '@': + attrs.$observe(attrName, function(value) { + isolateBindingContext[scopeName] = value; + }); + attrs.$$observers[attrName].$$scope = scope; + if (attrs[attrName]) { + // If the attribute has been provided then we trigger an interpolation to ensure + // the value is there for use in the link fn + isolateBindingContext[scopeName] = $interpolate(attrs[attrName])(scope); + } + break; + + case '=': + if (optional && !attrs[attrName]) { + return; + } + parentGet = $parse(attrs[attrName]); + if (parentGet.literal) { + compare = equals; + } else { + compare = function(a, b) { return a === b || (a !== a && b !== b); }; + } + parentSet = parentGet.assign || function() { + // reset the change, or we will throw this exception on every $digest + lastValue = isolateBindingContext[scopeName] = parentGet(scope); + throw $compileMinErr('nonassign', + "Expression '{0}' used with directive '{1}' is non-assignable!", + attrs[attrName], newIsolateScopeDirective.name); + }; + lastValue = isolateBindingContext[scopeName] = parentGet(scope); + var parentValueWatch = function parentValueWatch(parentValue) { + if (!compare(parentValue, isolateBindingContext[scopeName])) { + // we are out of sync and need to copy + if (!compare(parentValue, lastValue)) { + // parent changed and it has precedence + isolateBindingContext[scopeName] = parentValue; + } else { + // if the parent can be assigned then do so + parentSet(scope, parentValue = isolateBindingContext[scopeName]); + } + } + return lastValue = parentValue; + }; + parentValueWatch.$stateful = true; + var unwatch; + if (definition.collection) { + unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch); + } else { + unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal); + } + isolateScope.$on('$destroy', unwatch); + break; + + case '&': + parentGet = $parse(attrs[attrName]); + isolateBindingContext[scopeName] = function(locals) { + return parentGet(scope, locals); + }; + break; + } + }); + } + if (controllers) { + forEach(controllers, function(controller) { + controller(); + }); + controllers = null; + } + + // PRELINKING + for (i = 0, ii = preLinkFns.length; i < ii; i++) { + linkFn = preLinkFns[i]; + invokeLinkFn(linkFn, + linkFn.isolateScope ? isolateScope : scope, + $element, + attrs, + linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), + transcludeFn + ); + } + + // RECURSION + // We only pass the isolate scope, if the isolate directive has a template, + // otherwise the child elements do not belong to the isolate directive. + var scopeToChild = scope; + if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) { + scopeToChild = isolateScope; + } + childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn); + + // POSTLINKING + for (i = postLinkFns.length - 1; i >= 0; i--) { + linkFn = postLinkFns[i]; + invokeLinkFn(linkFn, + linkFn.isolateScope ? isolateScope : scope, + $element, + attrs, + linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), + transcludeFn + ); + } + + // This is the function that is injected as `$transclude`. + // Note: all arguments are optional! + function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) { + var transcludeControllers; + + // No scope passed in: + if (!isScope(scope)) { + futureParentElement = cloneAttachFn; + cloneAttachFn = scope; + scope = undefined; + } + + if (hasElementTranscludeDirective) { + transcludeControllers = elementControllers; + } + if (!futureParentElement) { + futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element; + } + return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild); + } + } + } + + function markDirectivesAsIsolate(directives) { + // mark all directives as needing isolate scope. + for (var j = 0, jj = directives.length; j < jj; j++) { + directives[j] = inherit(directives[j], {$$isolateScope: true}); + } + } + + /** + * looks up the directive and decorates it with exception handling and proper parameters. We + * call this the boundDirective. + * + * @param {string} name name of the directive to look up. + * @param {string} location The directive must be found in specific format. + * String containing any of theses characters: + * + * * `E`: element name + * * `A': attribute + * * `C`: class + * * `M`: comment + * @returns {boolean} true if directive was added. + */ + function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, + endAttrName) { + if (name === ignoreDirective) return null; + var match = null; + if (hasDirectives.hasOwnProperty(name)) { + for (var directive, directives = $injector.get(name + Suffix), + i = 0, ii = directives.length; i < ii; i++) { + try { + directive = directives[i]; + if ((maxPriority === undefined || maxPriority > directive.priority) && + directive.restrict.indexOf(location) != -1) { + if (startAttrName) { + directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName}); + } + tDirectives.push(directive); + match = directive; + } + } catch (e) { $exceptionHandler(e); } + } + } + return match; + } + + + /** + * looks up the directive and returns true if it is a multi-element directive, + * and therefore requires DOM nodes between -start and -end markers to be grouped + * together. + * + * @param {string} name name of the directive to look up. + * @returns true if directive was registered as multi-element. + */ + function directiveIsMultiElement(name) { + if (hasDirectives.hasOwnProperty(name)) { + for (var directive, directives = $injector.get(name + Suffix), + i = 0, ii = directives.length; i < ii; i++) { + directive = directives[i]; + if (directive.multiElement) { + return true; + } + } + } + return false; + } + + /** + * When the element is replaced with HTML template then the new attributes + * on the template need to be merged with the existing attributes in the DOM. + * The desired effect is to have both of the attributes present. + * + * @param {object} dst destination attributes (original DOM) + * @param {object} src source attributes (from the directive template) + */ + function mergeTemplateAttributes(dst, src) { + var srcAttr = src.$attr, + dstAttr = dst.$attr, + $element = dst.$$element; + + // reapply the old attributes to the new element + forEach(dst, function(value, key) { + if (key.charAt(0) != '$') { + if (src[key] && src[key] !== value) { + value += (key === 'style' ? ';' : ' ') + src[key]; + } + dst.$set(key, value, true, srcAttr[key]); + } + }); + + // copy the new attributes on the old attrs object + forEach(src, function(value, key) { + if (key == 'class') { + safeAddClass($element, value); + dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value; + } else if (key == 'style') { + $element.attr('style', $element.attr('style') + ';' + value); + dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value; + // `dst` will never contain hasOwnProperty as DOM parser won't let it. + // You will get an "InvalidCharacterError: DOM Exception 5" error if you + // have an attribute like "has-own-property" or "data-has-own-property", etc. + } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) { + dst[key] = value; + dstAttr[key] = srcAttr[key]; + } + }); + } + + + function compileTemplateUrl(directives, $compileNode, tAttrs, + $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) { + var linkQueue = [], + afterTemplateNodeLinkFn, + afterTemplateChildLinkFn, + beforeTemplateCompileNode = $compileNode[0], + origAsyncDirective = directives.shift(), + derivedSyncDirective = inherit(origAsyncDirective, { + templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective + }), + templateUrl = (isFunction(origAsyncDirective.templateUrl)) + ? origAsyncDirective.templateUrl($compileNode, tAttrs) + : origAsyncDirective.templateUrl, + templateNamespace = origAsyncDirective.templateNamespace; + + $compileNode.empty(); + + $templateRequest(templateUrl) + .then(function(content) { + var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn; + + content = denormalizeTemplate(content); + + if (origAsyncDirective.replace) { + if (jqLiteIsTextNode(content)) { + $template = []; + } else { + $template = removeComments(wrapTemplate(templateNamespace, trim(content))); + } + compileNode = $template[0]; + + if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) { + throw $compileMinErr('tplrt', + "Template for directive '{0}' must have exactly one root element. {1}", + origAsyncDirective.name, templateUrl); + } + + tempTemplateAttrs = {$attr: {}}; + replaceWith($rootElement, $compileNode, compileNode); + var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs); + + if (isObject(origAsyncDirective.scope)) { + markDirectivesAsIsolate(templateDirectives); + } + directives = templateDirectives.concat(directives); + mergeTemplateAttributes(tAttrs, tempTemplateAttrs); + } else { + compileNode = beforeTemplateCompileNode; + $compileNode.html(content); + } + + directives.unshift(derivedSyncDirective); + + afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, + childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, + previousCompileContext); + forEach($rootElement, function(node, i) { + if (node == compileNode) { + $rootElement[i] = $compileNode[0]; + } + }); + afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn); + + while (linkQueue.length) { + var scope = linkQueue.shift(), + beforeTemplateLinkNode = linkQueue.shift(), + linkRootElement = linkQueue.shift(), + boundTranscludeFn = linkQueue.shift(), + linkNode = $compileNode[0]; + + if (scope.$$destroyed) continue; + + if (beforeTemplateLinkNode !== beforeTemplateCompileNode) { + var oldClasses = beforeTemplateLinkNode.className; + + if (!(previousCompileContext.hasElementTranscludeDirective && + origAsyncDirective.replace)) { + // it was cloned therefore we have to clone as well. + linkNode = jqLiteClone(compileNode); + } + replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode); + + // Copy in CSS classes from original node + safeAddClass(jqLite(linkNode), oldClasses); + } + if (afterTemplateNodeLinkFn.transcludeOnThisElement) { + childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); + } else { + childBoundTranscludeFn = boundTranscludeFn; + } + afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, + childBoundTranscludeFn); + } + linkQueue = null; + }); + + return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) { + var childBoundTranscludeFn = boundTranscludeFn; + if (scope.$$destroyed) return; + if (linkQueue) { + linkQueue.push(scope, + node, + rootElement, + childBoundTranscludeFn); + } else { + if (afterTemplateNodeLinkFn.transcludeOnThisElement) { + childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn); + } + afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn); + } + }; + } + + + /** + * Sorting function for bound directives. + */ + function byPriority(a, b) { + var diff = b.priority - a.priority; + if (diff !== 0) return diff; + if (a.name !== b.name) return (a.name < b.name) ? -1 : 1; + return a.index - b.index; + } + + + function assertNoDuplicate(what, previousDirective, directive, element) { + if (previousDirective) { + throw $compileMinErr('multidir', 'Multiple directives [{0}, {1}] asking for {2} on: {3}', + previousDirective.name, directive.name, what, startingTag(element)); + } + } + + + function addTextInterpolateDirective(directives, text) { + var interpolateFn = $interpolate(text, true); + if (interpolateFn) { + directives.push({ + priority: 0, + compile: function textInterpolateCompileFn(templateNode) { + var templateNodeParent = templateNode.parent(), + hasCompileParent = !!templateNodeParent.length; + + // When transcluding a template that has bindings in the root + // we don't have a parent and thus need to add the class during linking fn. + if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); + + return function textInterpolateLinkFn(scope, node) { + var parent = node.parent(); + if (!hasCompileParent) compile.$$addBindingClass(parent); + compile.$$addBindingInfo(parent, interpolateFn.expressions); + scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { + node[0].nodeValue = value; + }); + }; + } + }); + } + } + + + function wrapTemplate(type, template) { + type = lowercase(type || 'html'); + switch (type) { + case 'svg': + case 'math': + var wrapper = document.createElement('div'); + wrapper.innerHTML = '<' + type + '>' + template + ''; + return wrapper.childNodes[0].childNodes; + default: + return template; + } + } + + + function getTrustedContext(node, attrNormalizedName) { + if (attrNormalizedName == "srcdoc") { + return $sce.HTML; + } + var tag = nodeName_(node); + // maction[xlink:href] can source SVG. It's not limited to . + if (attrNormalizedName == "xlinkHref" || + (tag == "form" && attrNormalizedName == "action") || + (tag != "img" && (attrNormalizedName == "src" || + attrNormalizedName == "ngSrc"))) { + return $sce.RESOURCE_URL; + } + } + + + function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) { + var trustedContext = getTrustedContext(node, name); + allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing; + + var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing); + + // no interpolation found -> ignore + if (!interpolateFn) return; + + + if (name === "multiple" && nodeName_(node) === "select") { + throw $compileMinErr("selmulti", + "Binding to the 'multiple' attribute is not supported. Element: {0}", + startingTag(node)); + } + + directives.push({ + priority: 100, + compile: function() { + return { + pre: function attrInterpolatePreLinkFn(scope, element, attr) { + var $$observers = (attr.$$observers || (attr.$$observers = {})); + + if (EVENT_HANDLER_ATTR_REGEXP.test(name)) { + throw $compileMinErr('nodomevents', + "Interpolations for HTML DOM event attributes are disallowed. Please use the " + + "ng- versions (such as ng-click instead of onclick) instead."); + } + + // If the attribute has changed since last $interpolate()ed + var newValue = attr[name]; + if (newValue !== value) { + // we need to interpolate again since the attribute value has been updated + // (e.g. by another directive's compile function) + // ensure unset/empty values make interpolateFn falsy + interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing); + value = newValue; + } + + // if attribute was updated so that there is no interpolation going on we don't want to + // register any observers + if (!interpolateFn) return; + + // initialize attr object so that it's ready in case we need the value for isolate + // scope initialization, otherwise the value would not be available from isolate + // directive's linking fn during linking phase + attr[name] = interpolateFn(scope); + + ($$observers[name] || ($$observers[name] = [])).$$inter = true; + (attr.$$observers && attr.$$observers[name].$$scope || scope). + $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) { + //special case for class attribute addition + removal + //so that class changes can tap into the animation + //hooks provided by the $animate service. Be sure to + //skip animations when the first digest occurs (when + //both the new and the old values are the same) since + //the CSS classes are the non-interpolated values + if (name === 'class' && newValue != oldValue) { + attr.$updateClass(newValue, oldValue); + } else { + attr.$set(name, newValue); + } + }); + } + }; + } + }); + } + + + /** + * This is a special jqLite.replaceWith, which can replace items which + * have no parents, provided that the containing jqLite collection is provided. + * + * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes + * in the root of the tree. + * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep + * the shell, but replace its DOM node reference. + * @param {Node} newNode The new DOM node. + */ + function replaceWith($rootElement, elementsToRemove, newNode) { + var firstElementToRemove = elementsToRemove[0], + removeCount = elementsToRemove.length, + parent = firstElementToRemove.parentNode, + i, ii; + + if ($rootElement) { + for (i = 0, ii = $rootElement.length; i < ii; i++) { + if ($rootElement[i] == firstElementToRemove) { + $rootElement[i++] = newNode; + for (var j = i, j2 = j + removeCount - 1, + jj = $rootElement.length; + j < jj; j++, j2++) { + if (j2 < jj) { + $rootElement[j] = $rootElement[j2]; + } else { + delete $rootElement[j]; + } + } + $rootElement.length -= removeCount - 1; + + // If the replaced element is also the jQuery .context then replace it + // .context is a deprecated jQuery api, so we should set it only when jQuery set it + // http://api.jquery.com/context/ + if ($rootElement.context === firstElementToRemove) { + $rootElement.context = newNode; + } + break; + } + } + } + + if (parent) { + parent.replaceChild(newNode, firstElementToRemove); + } + + // TODO(perf): what's this document fragment for? is it needed? can we at least reuse it? + var fragment = document.createDocumentFragment(); + fragment.appendChild(firstElementToRemove); + + // Copy over user data (that includes Angular's $scope etc.). Don't copy private + // data here because there's no public interface in jQuery to do that and copying over + // event listeners (which is the main use of private data) wouldn't work anyway. + jqLite(newNode).data(jqLite(firstElementToRemove).data()); + + // Remove data of the replaced element. We cannot just call .remove() + // on the element it since that would deallocate scope that is needed + // for the new node. Instead, remove the data "manually". + if (!jQuery) { + delete jqLite.cache[firstElementToRemove[jqLite.expando]]; + } else { + // jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after + // the replaced element. The cleanData version monkey-patched by Angular would cause + // the scope to be trashed and we do need the very same scope to work with the new + // element. However, we cannot just cache the non-patched version and use it here as + // that would break if another library patches the method after Angular does (one + // example is jQuery UI). Instead, set a flag indicating scope destroying should be + // skipped this one time. + skipDestroyOnNextJQueryCleanData = true; + jQuery.cleanData([firstElementToRemove]); + } + + for (var k = 1, kk = elementsToRemove.length; k < kk; k++) { + var element = elementsToRemove[k]; + jqLite(element).remove(); // must do this way to clean up expando + fragment.appendChild(element); + delete elementsToRemove[k]; + } + + elementsToRemove[0] = newNode; + elementsToRemove.length = 1; + } + + + function cloneAndAnnotateFn(fn, annotation) { + return extend(function() { return fn.apply(null, arguments); }, fn, annotation); + } + + + function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) { + try { + linkFn(scope, $element, attrs, controllers, transcludeFn); + } catch (e) { + $exceptionHandler(e, startingTag($element)); + } + } + }]; +} + +var PREFIX_REGEXP = /^((?:x|data)[\:\-_])/i; +/** + * Converts all accepted directives format into proper directive name. + * @param name Name to normalize + */ +function directiveNormalize(name) { + return camelCase(name.replace(PREFIX_REGEXP, '')); +} + +/** + * @ngdoc type + * @name $compile.directive.Attributes + * + * @description + * A shared object between directive compile / linking functions which contains normalized DOM + * element attributes. The values reflect current binding state `{{ }}`. The normalization is + * needed since all of these are treated as equivalent in Angular: + * + * ``` + * + * ``` + */ + +/** + * @ngdoc property + * @name $compile.directive.Attributes#$attr + * + * @description + * A map of DOM element attribute names to the normalized name. This is + * needed to do reverse lookup from normalized name back to actual name. + */ + + +/** + * @ngdoc method + * @name $compile.directive.Attributes#$set + * @kind function + * + * @description + * Set DOM element attribute value. + * + * + * @param {string} name Normalized element attribute name of the property to modify. The name is + * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr} + * property to the original name. + * @param {string} value Value to set the attribute to. The value can be an interpolated string. + */ + + + +/** + * Closure compiler type information + */ + +function nodesetLinkingFn( + /* angular.Scope */ scope, + /* NodeList */ nodeList, + /* Element */ rootElement, + /* function(Function) */ boundTranscludeFn +) {} + +function directiveLinkingFn( + /* nodesetLinkingFn */ nodesetLinkingFn, + /* angular.Scope */ scope, + /* Node */ node, + /* Element */ rootElement, + /* function(Function) */ boundTranscludeFn +) {} + +function tokenDifference(str1, str2) { + var values = '', + tokens1 = str1.split(/\s+/), + tokens2 = str2.split(/\s+/); + + outer: + for (var i = 0; i < tokens1.length; i++) { + var token = tokens1[i]; + for (var j = 0; j < tokens2.length; j++) { + if (token == tokens2[j]) continue outer; + } + values += (values.length > 0 ? ' ' : '') + token; + } + return values; +} + +function removeComments(jqNodes) { + jqNodes = jqLite(jqNodes); + var i = jqNodes.length; + + if (i <= 1) { + return jqNodes; + } + + while (i--) { + var node = jqNodes[i]; + if (node.nodeType === NODE_TYPE_COMMENT) { + splice.call(jqNodes, i, 1); + } + } + return jqNodes; +} + +var $controllerMinErr = minErr('$controller'); + +/** + * @ngdoc provider + * @name $controllerProvider + * @description + * The {@link ng.$controller $controller service} is used by Angular to create new + * controllers. + * + * This provider allows controller registration via the + * {@link ng.$controllerProvider#register register} method. + */ +function $ControllerProvider() { + var controllers = {}, + globals = false, + CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/; + + + /** + * @ngdoc method + * @name $controllerProvider#register + * @param {string|Object} name Controller name, or an object map of controllers where the keys are + * the names and the values are the constructors. + * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI + * annotations in the array notation). + */ + this.register = function(name, constructor) { + assertNotHasOwnProperty(name, 'controller'); + if (isObject(name)) { + extend(controllers, name); + } else { + controllers[name] = constructor; + } + }; + + /** + * @ngdoc method + * @name $controllerProvider#allowGlobals + * @description If called, allows `$controller` to find controller constructors on `window` + */ + this.allowGlobals = function() { + globals = true; + }; + + + this.$get = ['$injector', '$window', function($injector, $window) { + + /** + * @ngdoc service + * @name $controller + * @requires $injector + * + * @param {Function|string} constructor If called with a function then it's considered to be the + * controller constructor function. Otherwise it's considered to be a string which is used + * to retrieve the controller constructor using the following steps: + * + * * check if a controller with given name is registered via `$controllerProvider` + * * check if evaluating the string on the current scope returns a constructor + * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global + * `window` object (not recommended) + * + * The string can use the `controller as property` syntax, where the controller instance is published + * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this + * to work correctly. + * + * @param {Object} locals Injection locals for Controller. + * @return {Object} Instance of given controller. + * + * @description + * `$controller` service is responsible for instantiating controllers. + * + * It's just a simple call to {@link auto.$injector $injector}, but extracted into + * a service, so that one can override this service with [BC version](https://gist.github.com/1649788). + */ + return function(expression, locals, later, ident) { + // PRIVATE API: + // param `later` --- indicates that the controller's constructor is invoked at a later time. + // If true, $controller will allocate the object with the correct + // prototype chain, but will not invoke the controller until a returned + // callback is invoked. + // param `ident` --- An optional label which overrides the label parsed from the controller + // expression, if any. + var instance, match, constructor, identifier; + later = later === true; + if (ident && isString(ident)) { + identifier = ident; + } + + if (isString(expression)) { + match = expression.match(CNTRL_REG); + if (!match) { + throw $controllerMinErr('ctrlfmt', + "Badly formed controller string '{0}'. " + + "Must match `__name__ as __id__` or `__name__`.", expression); + } + constructor = match[1], + identifier = identifier || match[3]; + expression = controllers.hasOwnProperty(constructor) + ? controllers[constructor] + : getter(locals.$scope, constructor, true) || + (globals ? getter($window, constructor, true) : undefined); + + assertArgFn(expression, constructor, true); + } + + if (later) { + // Instantiate controller later: + // This machinery is used to create an instance of the object before calling the + // controller's constructor itself. + // + // This allows properties to be added to the controller before the constructor is + // invoked. Primarily, this is used for isolate scope bindings in $compile. + // + // This feature is not intended for use by applications, and is thus not documented + // publicly. + // Object creation: http://jsperf.com/create-constructor/2 + var controllerPrototype = (isArray(expression) ? + expression[expression.length - 1] : expression).prototype; + instance = Object.create(controllerPrototype || null); + + if (identifier) { + addIdentifier(locals, identifier, instance, constructor || expression.name); + } + + return extend(function() { + $injector.invoke(expression, instance, locals, constructor); + return instance; + }, { + instance: instance, + identifier: identifier + }); + } + + instance = $injector.instantiate(expression, locals, constructor); + + if (identifier) { + addIdentifier(locals, identifier, instance, constructor || expression.name); + } + + return instance; + }; + + function addIdentifier(locals, identifier, instance, name) { + if (!(locals && isObject(locals.$scope))) { + throw minErr('$controller')('noscp', + "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.", + name, identifier); + } + + locals.$scope[identifier] = instance; + } + }]; +} + +/** + * @ngdoc service + * @name $document + * @requires $window + * + * @description + * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object. + * + * @example + + +
+

$document title:

+

window.document title:

+
+
+ + angular.module('documentExample', []) + .controller('ExampleController', ['$scope', '$document', function($scope, $document) { + $scope.title = $document[0].title; + $scope.windowTitle = angular.element(window.document)[0].title; + }]); + +
+ */ +function $DocumentProvider() { + this.$get = ['$window', function(window) { + return jqLite(window.document); + }]; +} + +/** + * @ngdoc service + * @name $exceptionHandler + * @requires ng.$log + * + * @description + * Any uncaught exception in angular expressions is delegated to this service. + * The default implementation simply delegates to `$log.error` which logs it into + * the browser console. + * + * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by + * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing. + * + * ## Example: + * + * ```js + * angular.module('exceptionOverride', []).factory('$exceptionHandler', function() { + * return function(exception, cause) { + * exception.message += ' (caused by "' + cause + '")'; + * throw exception; + * }; + * }); + * ``` + * + * This example will override the normal action of `$exceptionHandler`, to make angular + * exceptions fail hard when they happen, instead of just logging to the console. + * + *
+ * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind` + * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler} + * (unless executed during a digest). + * + * If you wish, you can manually delegate exceptions, e.g. + * `try { ... } catch(e) { $exceptionHandler(e); }` + * + * @param {Error} exception Exception associated with the error. + * @param {string=} cause optional information about the context in which + * the error was thrown. + * + */ +function $ExceptionHandlerProvider() { + this.$get = ['$log', function($log) { + return function(exception, cause) { + $log.error.apply($log, arguments); + }; + }]; +} + +var APPLICATION_JSON = 'application/json'; +var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'}; +var JSON_START = /^\[|^\{(?!\{)/; +var JSON_ENDS = { + '[': /]$/, + '{': /}$/ +}; +var JSON_PROTECTION_PREFIX = /^\)\]\}',?\n/; + +function defaultHttpResponseTransform(data, headers) { + if (isString(data)) { + // Strip json vulnerability protection prefix and trim whitespace + var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim(); + + if (tempData) { + var contentType = headers('Content-Type'); + if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) { + data = fromJson(tempData); + } + } + } + + return data; +} + +function isJsonLike(str) { + var jsonStart = str.match(JSON_START); + return jsonStart && JSON_ENDS[jsonStart[0]].test(str); +} + +/** + * Parse headers into key value object + * + * @param {string} headers Raw headers as a string + * @returns {Object} Parsed headers as key value object + */ +function parseHeaders(headers) { + var parsed = createMap(), key, val, i; + + if (!headers) return parsed; + + forEach(headers.split('\n'), function(line) { + i = line.indexOf(':'); + key = lowercase(trim(line.substr(0, i))); + val = trim(line.substr(i + 1)); + + if (key) { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +} + + +/** + * Returns a function that provides access to parsed headers. + * + * Headers are lazy parsed when first requested. + * @see parseHeaders + * + * @param {(string|Object)} headers Headers to provide access to. + * @returns {function(string=)} Returns a getter function which if called with: + * + * - if called with single an argument returns a single header value or null + * - if called with no arguments returns an object containing all headers. + */ +function headersGetter(headers) { + var headersObj = isObject(headers) ? headers : undefined; + + return function(name) { + if (!headersObj) headersObj = parseHeaders(headers); + + if (name) { + var value = headersObj[lowercase(name)]; + if (value === void 0) { + value = null; + } + return value; + } + + return headersObj; + }; +} + + +/** + * Chain all given functions + * + * This function is used for both request and response transforming + * + * @param {*} data Data to transform. + * @param {function(string=)} headers HTTP headers getter fn. + * @param {number} status HTTP status code of the response. + * @param {(Function|Array.)} fns Function or an array of functions. + * @returns {*} Transformed data. + */ +function transformData(data, headers, status, fns) { + if (isFunction(fns)) + return fns(data, headers, status); + + forEach(fns, function(fn) { + data = fn(data, headers, status); + }); + + return data; +} + + +function isSuccess(status) { + return 200 <= status && status < 300; +} + + +/** + * @ngdoc provider + * @name $httpProvider + * @description + * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service. + * */ +function $HttpProvider() { + /** + * @ngdoc property + * @name $httpProvider#defaults + * @description + * + * Object containing default values for all {@link ng.$http $http} requests. + * + * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`} + * that will provide the cache for all requests who set their `cache` property to `true`. + * If you set the `default.cache = false` then only requests that specify their own custom + * cache object will be cached. See {@link $http#caching $http Caching} for more information. + * + * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token. + * Defaults value is `'XSRF-TOKEN'`. + * + * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the + * XSRF token. Defaults value is `'X-XSRF-TOKEN'`. + * + * - **`defaults.headers`** - {Object} - Default headers for all $http requests. + * Refer to {@link ng.$http#setting-http-headers $http} for documentation on + * setting default headers. + * - **`defaults.headers.common`** + * - **`defaults.headers.post`** + * - **`defaults.headers.put`** + * - **`defaults.headers.patch`** + * + **/ + var defaults = this.defaults = { + // transform incoming response data + transformResponse: [defaultHttpResponseTransform], + + // transform outgoing request data + transformRequest: [function(d) { + return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d; + }], + + // default headers + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + }, + post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), + put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON), + patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON) + }, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN' + }; + + var useApplyAsync = false; + /** + * @ngdoc method + * @name $httpProvider#useApplyAsync + * @description + * + * Configure $http service to combine processing of multiple http responses received at around + * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in + * significant performance improvement for bigger applications that make many HTTP requests + * concurrently (common during application bootstrap). + * + * Defaults to false. If no value is specifed, returns the current configured value. + * + * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred + * "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window + * to load and share the same digest cycle. + * + * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. + * otherwise, returns the current configured value. + **/ + this.useApplyAsync = function(value) { + if (isDefined(value)) { + useApplyAsync = !!value; + return this; + } + return useApplyAsync; + }; + + /** + * @ngdoc property + * @name $httpProvider#interceptors + * @description + * + * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http} + * pre-processing of request or postprocessing of responses. + * + * These service factories are ordered by request, i.e. they are applied in the same order as the + * array, on request, but reverse order, on response. + * + * {@link ng.$http#interceptors Interceptors detailed info} + **/ + var interceptorFactories = this.interceptors = []; + + this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector', + function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) { + + var defaultCache = $cacheFactory('$http'); + + /** + * Interceptors stored in reverse order. Inner interceptors before outer interceptors. + * The reversal is needed so that we can build up the interception chain around the + * server request. + */ + var reversedInterceptors = []; + + forEach(interceptorFactories, function(interceptorFactory) { + reversedInterceptors.unshift(isString(interceptorFactory) + ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory)); + }); + + /** + * @ngdoc service + * @kind function + * @name $http + * @requires ng.$httpBackend + * @requires $cacheFactory + * @requires $rootScope + * @requires $q + * @requires $injector + * + * @description + * The `$http` service is a core Angular service that facilitates communication with the remote + * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest) + * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP). + * + * For unit testing applications that use `$http` service, see + * {@link ngMock.$httpBackend $httpBackend mock}. + * + * For a higher level of abstraction, please check out the {@link ngResource.$resource + * $resource} service. + * + * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by + * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage + * it is important to familiarize yourself with these APIs and the guarantees they provide. + * + * + * ## General usage + * The `$http` service is a function which takes a single argument — a configuration object — + * that is used to generate an HTTP request and returns a {@link ng.$q promise} + * with two $http specific methods: `success` and `error`. + * + * ```js + * // Simple GET request example : + * $http.get('/someUrl'). + * success(function(data, status, headers, config) { + * // this callback will be called asynchronously + * // when the response is available + * }). + * error(function(data, status, headers, config) { + * // called asynchronously if an error occurs + * // or server returns response with an error status. + * }); + * ``` + * + * ```js + * // Simple POST request example (passing data) : + * $http.post('/someUrl', {msg:'hello word!'}). + * success(function(data, status, headers, config) { + * // this callback will be called asynchronously + * // when the response is available + * }). + * error(function(data, status, headers, config) { + * // called asynchronously if an error occurs + * // or server returns response with an error status. + * }); + * ``` + * + * + * Since the returned value of calling the $http function is a `promise`, you can also use + * the `then` method to register callbacks, and these callbacks will receive a single argument – + * an object representing the response. See the API signature and type info below for more + * details. + * + * A response status code between 200 and 299 is considered a success status and + * will result in the success callback being called. Note that if the response is a redirect, + * XMLHttpRequest will transparently follow it, meaning that the error callback will not be + * called for such responses. + * + * ## Writing Unit Tests that use $http + * When unit testing (using {@link ngMock ngMock}), it is necessary to call + * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending + * request using trained responses. + * + * ``` + * $httpBackend.expectGET(...); + * $http.get(...); + * $httpBackend.flush(); + * ``` + * + * ## Shortcut methods + * + * Shortcut methods are also available. All shortcut methods require passing in the URL, and + * request data must be passed in for POST/PUT requests. + * + * ```js + * $http.get('/someUrl').success(successCallback); + * $http.post('/someUrl', data).success(successCallback); + * ``` + * + * Complete list of shortcut methods: + * + * - {@link ng.$http#get $http.get} + * - {@link ng.$http#head $http.head} + * - {@link ng.$http#post $http.post} + * - {@link ng.$http#put $http.put} + * - {@link ng.$http#delete $http.delete} + * - {@link ng.$http#jsonp $http.jsonp} + * - {@link ng.$http#patch $http.patch} + * + * + * ## Setting HTTP Headers + * + * The $http service will automatically add certain HTTP headers to all requests. These defaults + * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration + * object, which currently contains this default configuration: + * + * - `$httpProvider.defaults.headers.common` (headers that are common for all requests): + * - `Accept: application/json, text/plain, * / *` + * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests) + * - `Content-Type: application/json` + * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests) + * - `Content-Type: application/json` + * + * To add or overwrite these defaults, simply add or remove a property from these configuration + * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object + * with the lowercased HTTP method name as the key, e.g. + * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }. + * + * The defaults can also be set at runtime via the `$http.defaults` object in the same + * fashion. For example: + * + * ``` + * module.run(function($http) { + * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w' + * }); + * ``` + * + * In addition, you can supply a `headers` property in the config object passed when + * calling `$http(config)`, which overrides the defaults without changing them globally. + * + * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis, + * Use the `headers` property, setting the desired header to `undefined`. For example: + * + * ```js + * var req = { + * method: 'POST', + * url: 'http://example.com', + * headers: { + * 'Content-Type': undefined + * }, + * data: { test: 'test' } + * } + * + * $http(req).success(function(){...}).error(function(){...}); + * ``` + * + * ## Transforming Requests and Responses + * + * Both requests and responses can be transformed using transformation functions: `transformRequest` + * and `transformResponse`. These properties can be a single function that returns + * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions, + * which allows you to `push` or `unshift` a new transformation function into the transformation chain. + * + * ### Default Transformations + * + * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and + * `defaults.transformResponse` properties. If a request does not provide its own transformations + * then these will be applied. + * + * You can augment or replace the default transformations by modifying these properties by adding to or + * replacing the array. + * + * Angular provides the following default transformations: + * + * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`): + * + * - If the `data` property of the request configuration object contains an object, serialize it + * into JSON format. + * + * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`): + * + * - If XSRF prefix is detected, strip it (see Security Considerations section below). + * - If JSON response is detected, deserialize it using a JSON parser. + * + * + * ### Overriding the Default Transformations Per Request + * + * If you wish override the request/response transformations only for a single request then provide + * `transformRequest` and/or `transformResponse` properties on the configuration object passed + * into `$http`. + * + * Note that if you provide these properties on the config object the default transformations will be + * overwritten. If you wish to augment the default transformations then you must include them in your + * local transformation array. + * + * The following code demonstrates adding a new response transformation to be run after the default response + * transformations have been run. + * + * ```js + * function appendTransform(defaults, transform) { + * + * // We can't guarantee that the default transformation is an array + * defaults = angular.isArray(defaults) ? defaults : [defaults]; + * + * // Append the new transformation to the defaults + * return defaults.concat(transform); + * } + * + * $http({ + * url: '...', + * method: 'GET', + * transformResponse: appendTransform($http.defaults.transformResponse, function(value) { + * return doTransform(value); + * }) + * }); + * ``` + * + * + * ## Caching + * + * To enable caching, set the request configuration `cache` property to `true` (to use default + * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}). + * When the cache is enabled, `$http` stores the response from the server in the specified + * cache. The next time the same request is made, the response is served from the cache without + * sending a request to the server. + * + * Note that even if the response is served from cache, delivery of the data is asynchronous in + * the same way that real requests are. + * + * If there are multiple GET requests for the same URL that should be cached using the same + * cache, but the cache is not populated yet, only one request to the server will be made and + * the remaining requests will be fulfilled using the response from the first request. + * + * You can change the default cache to a new object (built with + * {@link ng.$cacheFactory `$cacheFactory`}) by updating the + * {@link ng.$http#defaults `$http.defaults.cache`} property. All requests who set + * their `cache` property to `true` will now use this cache object. + * + * If you set the default cache to `false` then only requests that specify their own custom + * cache object will be cached. + * + * ## Interceptors + * + * Before you start creating interceptors, be sure to understand the + * {@link ng.$q $q and deferred/promise APIs}. + * + * For purposes of global error handling, authentication, or any kind of synchronous or + * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be + * able to intercept requests before they are handed to the server and + * responses before they are handed over to the application code that + * initiated these requests. The interceptors leverage the {@link ng.$q + * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing. + * + * The interceptors are service factories that are registered with the `$httpProvider` by + * adding them to the `$httpProvider.interceptors` array. The factory is called and + * injected with dependencies (if specified) and returns the interceptor. + * + * There are two kinds of interceptors (and two kinds of rejection interceptors): + * + * * `request`: interceptors get called with a http `config` object. The function is free to + * modify the `config` object or create a new one. The function needs to return the `config` + * object directly, or a promise containing the `config` or a new `config` object. + * * `requestError`: interceptor gets called when a previous interceptor threw an error or + * resolved with a rejection. + * * `response`: interceptors get called with http `response` object. The function is free to + * modify the `response` object or create a new one. The function needs to return the `response` + * object directly, or as a promise containing the `response` or a new `response` object. + * * `responseError`: interceptor gets called when a previous interceptor threw an error or + * resolved with a rejection. + * + * + * ```js + * // register the interceptor as a service + * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) { + * return { + * // optional method + * 'request': function(config) { + * // do something on success + * return config; + * }, + * + * // optional method + * 'requestError': function(rejection) { + * // do something on error + * if (canRecover(rejection)) { + * return responseOrNewPromise + * } + * return $q.reject(rejection); + * }, + * + * + * + * // optional method + * 'response': function(response) { + * // do something on success + * return response; + * }, + * + * // optional method + * 'responseError': function(rejection) { + * // do something on error + * if (canRecover(rejection)) { + * return responseOrNewPromise + * } + * return $q.reject(rejection); + * } + * }; + * }); + * + * $httpProvider.interceptors.push('myHttpInterceptor'); + * + * + * // alternatively, register the interceptor via an anonymous factory + * $httpProvider.interceptors.push(function($q, dependency1, dependency2) { + * return { + * 'request': function(config) { + * // same as above + * }, + * + * 'response': function(response) { + * // same as above + * } + * }; + * }); + * ``` + * + * ## Security Considerations + * + * When designing web applications, consider security threats from: + * + * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) + * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + * + * Both server and the client must cooperate in order to eliminate these threats. Angular comes + * pre-configured with strategies that address these issues, but for this to work backend server + * cooperation is required. + * + * ### JSON Vulnerability Protection + * + * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx) + * allows third party website to turn your JSON resource URL into + * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To + * counter this your server can prefix all JSON requests with following string `")]}',\n"`. + * Angular will automatically strip the prefix before processing it as JSON. + * + * For example if your server needs to return: + * ```js + * ['one','two'] + * ``` + * + * which is vulnerable to attack, your server can return: + * ```js + * )]}', + * ['one','two'] + * ``` + * + * Angular will strip the prefix, before processing the JSON. + * + * + * ### Cross Site Request Forgery (XSRF) Protection + * + * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which + * an unauthorized site can gain your user's private data. Angular provides a mechanism + * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie + * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only + * JavaScript that runs on your domain could read the cookie, your server can be assured that + * the XHR came from JavaScript running on your domain. The header will not be set for + * cross-domain requests. + * + * To take advantage of this, your server needs to set a token in a JavaScript readable session + * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the + * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure + * that only JavaScript running on your domain could have sent the request. The token must be + * unique for each user and must be verifiable by the server (to prevent the JavaScript from + * making up its own tokens). We recommend that the token is a digest of your site's + * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) + * for added security. + * + * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName + * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time, + * or the per-request config object. + * + * + * @param {object} config Object describing the request to be made and how it should be + * processed. The object has following properties: + * + * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc) + * - **url** – `{string}` – Absolute or relative URL of the resource that is being requested. + * - **params** – `{Object.}` – Map of strings or objects which will be turned + * to `?key1=value1&key2=value2` after the url. If the value is not a string, it will be + * JSONified. + * - **data** – `{string|Object}` – Data to be sent as the request message data. + * - **headers** – `{Object}` – Map of strings or functions which return strings representing + * HTTP headers to send to the server. If the return value of a function is null, the + * header will not be sent. + * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token. + * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token. + * - **transformRequest** – + * `{function(data, headersGetter)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * request body and headers and returns its transformed (typically serialized) version. + * See {@link ng.$http#overriding-the-default-transformations-per-request + * Overriding the Default Transformations} + * - **transformResponse** – + * `{function(data, headersGetter, status)|Array.}` – + * transform function or an array of such functions. The transform function takes the http + * response body, headers and status and returns its transformed (typically deserialized) version. + * See {@link ng.$http#overriding-the-default-transformations-per-request + * Overriding the Default Transformations} + * - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the + * GET request, otherwise if a cache instance built with + * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for + * caching. + * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} + * that should abort the request when resolved. + * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the + * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials) + * for more information. + * - **responseType** - `{string}` - see + * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType). + * + * @returns {HttpPromise} Returns a {@link ng.$q promise} object with the + * standard `then` method and two http specific methods: `success` and `error`. The `then` + * method takes two arguments a success and an error callback which will be called with a + * response object. The `success` and `error` methods take a single argument - a function that + * will be called when the request succeeds or fails respectively. The arguments passed into + * these functions are destructured representation of the response object passed into the + * `then` method. The response object has these properties: + * + * - **data** – `{string|Object}` – The response body transformed with the transform + * functions. + * - **status** – `{number}` – HTTP status code of the response. + * - **headers** – `{function([headerName])}` – Header getter function. + * - **config** – `{Object}` – The configuration object that was used to generate the request. + * - **statusText** – `{string}` – HTTP status text of the response. + * + * @property {Array.} pendingRequests Array of config objects for currently pending + * requests. This is primarily meant to be used for debugging purposes. + * + * + * @example + + +
+ + +
+ + + +
http status code: {{status}}
+
http response data: {{data}}
+
+
+ + angular.module('httpExample', []) + .controller('FetchController', ['$scope', '$http', '$templateCache', + function($scope, $http, $templateCache) { + $scope.method = 'GET'; + $scope.url = 'http-hello.html'; + + $scope.fetch = function() { + $scope.code = null; + $scope.response = null; + + $http({method: $scope.method, url: $scope.url, cache: $templateCache}). + success(function(data, status) { + $scope.status = status; + $scope.data = data; + }). + error(function(data, status) { + $scope.data = data || "Request failed"; + $scope.status = status; + }); + }; + + $scope.updateModel = function(method, url) { + $scope.method = method; + $scope.url = url; + }; + }]); + + + Hello, $http! + + + var status = element(by.binding('status')); + var data = element(by.binding('data')); + var fetchBtn = element(by.id('fetchbtn')); + var sampleGetBtn = element(by.id('samplegetbtn')); + var sampleJsonpBtn = element(by.id('samplejsonpbtn')); + var invalidJsonpBtn = element(by.id('invalidjsonpbtn')); + + it('should make an xhr GET request', function() { + sampleGetBtn.click(); + fetchBtn.click(); + expect(status.getText()).toMatch('200'); + expect(data.getText()).toMatch(/Hello, \$http!/); + }); + +// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185 +// it('should make a JSONP request to angularjs.org', function() { +// sampleJsonpBtn.click(); +// fetchBtn.click(); +// expect(status.getText()).toMatch('200'); +// expect(data.getText()).toMatch(/Super Hero!/); +// }); + + it('should make JSONP request to invalid URL and invoke the error handler', + function() { + invalidJsonpBtn.click(); + fetchBtn.click(); + expect(status.getText()).toMatch('0'); + expect(data.getText()).toMatch('Request failed'); + }); + +
+ */ + function $http(requestConfig) { + + if (!angular.isObject(requestConfig)) { + throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig); + } + + var config = extend({ + method: 'get', + transformRequest: defaults.transformRequest, + transformResponse: defaults.transformResponse + }, requestConfig); + + config.headers = mergeHeaders(requestConfig); + config.method = uppercase(config.method); + + var serverRequest = function(config) { + var headers = config.headers; + var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest); + + // strip content-type if data is undefined + if (isUndefined(reqData)) { + forEach(headers, function(value, header) { + if (lowercase(header) === 'content-type') { + delete headers[header]; + } + }); + } + + if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) { + config.withCredentials = defaults.withCredentials; + } + + // send request + return sendReq(config, reqData).then(transformResponse, transformResponse); + }; + + var chain = [serverRequest, undefined]; + var promise = $q.when(config); + + // apply interceptors + forEach(reversedInterceptors, function(interceptor) { + if (interceptor.request || interceptor.requestError) { + chain.unshift(interceptor.request, interceptor.requestError); + } + if (interceptor.response || interceptor.responseError) { + chain.push(interceptor.response, interceptor.responseError); + } + }); + + while (chain.length) { + var thenFn = chain.shift(); + var rejectFn = chain.shift(); + + promise = promise.then(thenFn, rejectFn); + } + + promise.success = function(fn) { + assertArgFn(fn, 'fn'); + + promise.then(function(response) { + fn(response.data, response.status, response.headers, config); + }); + return promise; + }; + + promise.error = function(fn) { + assertArgFn(fn, 'fn'); + + promise.then(null, function(response) { + fn(response.data, response.status, response.headers, config); + }); + return promise; + }; + + return promise; + + function transformResponse(response) { + // make a copy since the response must be cacheable + var resp = extend({}, response); + if (!response.data) { + resp.data = response.data; + } else { + resp.data = transformData(response.data, response.headers, response.status, config.transformResponse); + } + return (isSuccess(response.status)) + ? resp + : $q.reject(resp); + } + + function executeHeaderFns(headers) { + var headerContent, processedHeaders = {}; + + forEach(headers, function(headerFn, header) { + if (isFunction(headerFn)) { + headerContent = headerFn(); + if (headerContent != null) { + processedHeaders[header] = headerContent; + } + } else { + processedHeaders[header] = headerFn; + } + }); + + return processedHeaders; + } + + function mergeHeaders(config) { + var defHeaders = defaults.headers, + reqHeaders = extend({}, config.headers), + defHeaderName, lowercaseDefHeaderName, reqHeaderName; + + defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]); + + // using for-in instead of forEach to avoid unecessary iteration after header has been found + defaultHeadersIteration: + for (defHeaderName in defHeaders) { + lowercaseDefHeaderName = lowercase(defHeaderName); + + for (reqHeaderName in reqHeaders) { + if (lowercase(reqHeaderName) === lowercaseDefHeaderName) { + continue defaultHeadersIteration; + } + } + + reqHeaders[defHeaderName] = defHeaders[defHeaderName]; + } + + // execute if header value is a function for merged headers + return executeHeaderFns(reqHeaders); + } + } + + $http.pendingRequests = []; + + /** + * @ngdoc method + * @name $http#get + * + * @description + * Shortcut method to perform `GET` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#delete + * + * @description + * Shortcut method to perform `DELETE` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#head + * + * @description + * Shortcut method to perform `HEAD` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#jsonp + * + * @description + * Shortcut method to perform `JSONP` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request. + * The name of the callback should be the string `JSON_CALLBACK`. + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + createShortMethods('get', 'delete', 'head', 'jsonp'); + + /** + * @ngdoc method + * @name $http#post + * + * @description + * Shortcut method to perform `POST` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#put + * + * @description + * Shortcut method to perform `PUT` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + + /** + * @ngdoc method + * @name $http#patch + * + * @description + * Shortcut method to perform `PATCH` request. + * + * @param {string} url Relative or absolute URL specifying the destination of the request + * @param {*} data Request content + * @param {Object=} config Optional configuration object + * @returns {HttpPromise} Future object + */ + createShortMethodsWithData('post', 'put', 'patch'); + + /** + * @ngdoc property + * @name $http#defaults + * + * @description + * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of + * default headers, withCredentials as well as request and response transformations. + * + * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above. + */ + $http.defaults = defaults; + + + return $http; + + + function createShortMethods(names) { + forEach(arguments, function(name) { + $http[name] = function(url, config) { + return $http(extend(config || {}, { + method: name, + url: url + })); + }; + }); + } + + + function createShortMethodsWithData(name) { + forEach(arguments, function(name) { + $http[name] = function(url, data, config) { + return $http(extend(config || {}, { + method: name, + url: url, + data: data + })); + }; + }); + } + + + /** + * Makes the request. + * + * !!! ACCESSES CLOSURE VARS: + * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests + */ + function sendReq(config, reqData) { + var deferred = $q.defer(), + promise = deferred.promise, + cache, + cachedResp, + reqHeaders = config.headers, + url = buildUrl(config.url, config.params); + + $http.pendingRequests.push(config); + promise.then(removePendingReq, removePendingReq); + + + if ((config.cache || defaults.cache) && config.cache !== false && + (config.method === 'GET' || config.method === 'JSONP')) { + cache = isObject(config.cache) ? config.cache + : isObject(defaults.cache) ? defaults.cache + : defaultCache; + } + + if (cache) { + cachedResp = cache.get(url); + if (isDefined(cachedResp)) { + if (isPromiseLike(cachedResp)) { + // cached request has already been sent, but there is no response yet + cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult); + } else { + // serving from cache + if (isArray(cachedResp)) { + resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]); + } else { + resolvePromise(cachedResp, 200, {}, 'OK'); + } + } + } else { + // put the promise for the non-transformed response into cache as a placeholder + cache.put(url, promise); + } + } + + + // if we won't have the response in cache, set the xsrf headers and + // send the request to the backend + if (isUndefined(cachedResp)) { + var xsrfValue = urlIsSameOrigin(config.url) + ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName] + : undefined; + if (xsrfValue) { + reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue; + } + + $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, + config.withCredentials, config.responseType); + } + + return promise; + + + /** + * Callback registered to $httpBackend(): + * - caches the response if desired + * - resolves the raw $http promise + * - calls $apply + */ + function done(status, response, headersString, statusText) { + if (cache) { + if (isSuccess(status)) { + cache.put(url, [status, response, parseHeaders(headersString), statusText]); + } else { + // remove promise from the cache + cache.remove(url); + } + } + + function resolveHttpPromise() { + resolvePromise(response, status, headersString, statusText); + } + + if (useApplyAsync) { + $rootScope.$applyAsync(resolveHttpPromise); + } else { + resolveHttpPromise(); + if (!$rootScope.$$phase) $rootScope.$apply(); + } + } + + + /** + * Resolves the raw $http promise. + */ + function resolvePromise(response, status, headers, statusText) { + //status: HTTP response status code, 0, -1 (aborted by timeout / promise) + status = status >= -1 ? status : 0; + + (isSuccess(status) ? deferred.resolve : deferred.reject)({ + data: response, + status: status, + headers: headersGetter(headers), + config: config, + statusText: statusText + }); + } + + function resolvePromiseWithResult(result) { + resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText); + } + + function removePendingReq() { + var idx = $http.pendingRequests.indexOf(config); + if (idx !== -1) $http.pendingRequests.splice(idx, 1); + } + } + + + function buildUrl(url, params) { + if (!params) return url; + var parts = []; + forEachSorted(params, function(value, key) { + if (value === null || isUndefined(value)) return; + if (!isArray(value)) value = [value]; + + forEach(value, function(v) { + if (isObject(v)) { + if (isDate(v)) { + v = v.toISOString(); + } else { + v = toJson(v); + } + } + parts.push(encodeUriQuery(key) + '=' + + encodeUriQuery(v)); + }); + }); + if (parts.length > 0) { + url += ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&'); + } + return url; + } + }]; +} + +function createXhr() { + return new window.XMLHttpRequest(); +} + +/** + * @ngdoc service + * @name $httpBackend + * @requires $window + * @requires $document + * + * @description + * HTTP backend used by the {@link ng.$http service} that delegates to + * XMLHttpRequest object or JSONP and deals with browser incompatibilities. + * + * You should never need to use this service directly, instead use the higher-level abstractions: + * {@link ng.$http $http} or {@link ngResource.$resource $resource}. + * + * During testing this implementation is swapped with {@link ngMock.$httpBackend mock + * $httpBackend} which can be trained with responses. + */ +function $HttpBackendProvider() { + this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) { + return createHttpBackend($browser, createXhr, $browser.defer, $window.angular.callbacks, $document[0]); + }]; +} + +function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) { + // TODO(vojta): fix the signature + return function(method, url, post, callback, headers, timeout, withCredentials, responseType) { + $browser.$$incOutstandingRequestCount(); + url = url || $browser.url(); + + if (lowercase(method) == 'jsonp') { + var callbackId = '_' + (callbacks.counter++).toString(36); + callbacks[callbackId] = function(data) { + callbacks[callbackId].data = data; + callbacks[callbackId].called = true; + }; + + var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId), + callbackId, function(status, text) { + completeRequest(callback, status, callbacks[callbackId].data, "", text); + callbacks[callbackId] = noop; + }); + } else { + + var xhr = createXhr(); + + xhr.open(method, url, true); + forEach(headers, function(value, key) { + if (isDefined(value)) { + xhr.setRequestHeader(key, value); + } + }); + + xhr.onload = function requestLoaded() { + var statusText = xhr.statusText || ''; + + // responseText is the old-school way of retrieving response (supported by IE9) + // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) + var response = ('response' in xhr) ? xhr.response : xhr.responseText; + + // normalize IE9 bug (http://bugs.jquery.com/ticket/1450) + var status = xhr.status === 1223 ? 204 : xhr.status; + + // fix status code when it is 0 (0 status is undocumented). + // Occurs when accessing file resources or on Android 4.1 stock browser + // while retrieving files from application cache. + if (status === 0) { + status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0; + } + + completeRequest(callback, + status, + response, + xhr.getAllResponseHeaders(), + statusText); + }; + + var requestError = function() { + // The response is always empty + // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error + completeRequest(callback, -1, null, null, ''); + }; + + xhr.onerror = requestError; + xhr.onabort = requestError; + + if (withCredentials) { + xhr.withCredentials = true; + } + + if (responseType) { + try { + xhr.responseType = responseType; + } catch (e) { + // WebKit added support for the json responseType value on 09/03/2013 + // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are + // known to throw when setting the value "json" as the response type. Other older + // browsers implementing the responseType + // + // The json response type can be ignored if not supported, because JSON payloads are + // parsed on the client-side regardless. + if (responseType !== 'json') { + throw e; + } + } + } + + xhr.send(post || null); + } + + if (timeout > 0) { + var timeoutId = $browserDefer(timeoutRequest, timeout); + } else if (isPromiseLike(timeout)) { + timeout.then(timeoutRequest); + } + + + function timeoutRequest() { + jsonpDone && jsonpDone(); + xhr && xhr.abort(); + } + + function completeRequest(callback, status, response, headersString, statusText) { + // cancel timeout and subsequent timeout promise resolution + if (timeoutId !== undefined) { + $browserDefer.cancel(timeoutId); + } + jsonpDone = xhr = null; + + callback(status, response, headersString, statusText); + $browser.$$completeOutstandingRequest(noop); + } + }; + + function jsonpReq(url, callbackId, done) { + // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.: + // - fetches local scripts via XHR and evals them + // - adds and immediately removes script elements from the document + var script = rawDocument.createElement('script'), callback = null; + script.type = "text/javascript"; + script.src = url; + script.async = true; + + callback = function(event) { + removeEventListenerFn(script, "load", callback); + removeEventListenerFn(script, "error", callback); + rawDocument.body.removeChild(script); + script = null; + var status = -1; + var text = "unknown"; + + if (event) { + if (event.type === "load" && !callbacks[callbackId].called) { + event = { type: "error" }; + } + text = event.type; + status = event.type === "error" ? 404 : 200; + } + + if (done) { + done(status, text); + } + }; + + addEventListenerFn(script, "load", callback); + addEventListenerFn(script, "error", callback); + rawDocument.body.appendChild(script); + return callback; + } +} + +var $interpolateMinErr = minErr('$interpolate'); + +/** + * @ngdoc provider + * @name $interpolateProvider + * + * @description + * + * Used for configuring the interpolation markup. Defaults to `{{` and `}}`. + * + * @example + + + +
+ //demo.label// +
+
+ + it('should interpolate binding with custom symbols', function() { + expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.'); + }); + +
+ */ +function $InterpolateProvider() { + var startSymbol = '{{'; + var endSymbol = '}}'; + + /** + * @ngdoc method + * @name $interpolateProvider#startSymbol + * @description + * Symbol to denote start of expression in the interpolated string. Defaults to `{{`. + * + * @param {string=} value new value to set the starting symbol to. + * @returns {string|self} Returns the symbol when used as getter and self if used as setter. + */ + this.startSymbol = function(value) { + if (value) { + startSymbol = value; + return this; + } else { + return startSymbol; + } + }; + + /** + * @ngdoc method + * @name $interpolateProvider#endSymbol + * @description + * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. + * + * @param {string=} value new value to set the ending symbol to. + * @returns {string|self} Returns the symbol when used as getter and self if used as setter. + */ + this.endSymbol = function(value) { + if (value) { + endSymbol = value; + return this; + } else { + return endSymbol; + } + }; + + + this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) { + var startSymbolLength = startSymbol.length, + endSymbolLength = endSymbol.length, + escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'), + escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g'); + + function escape(ch) { + return '\\\\\\' + ch; + } + + /** + * @ngdoc service + * @name $interpolate + * @kind function + * + * @requires $parse + * @requires $sce + * + * @description + * + * Compiles a string with markup into an interpolation function. This service is used by the + * HTML {@link ng.$compile $compile} service for data binding. See + * {@link ng.$interpolateProvider $interpolateProvider} for configuring the + * interpolation markup. + * + * + * ```js + * var $interpolate = ...; // injected + * var exp = $interpolate('Hello {{name | uppercase}}!'); + * expect(exp({name:'Angular'}).toEqual('Hello ANGULAR!'); + * ``` + * + * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is + * `true`, the interpolation function will return `undefined` unless all embedded expressions + * evaluate to a value other than `undefined`. + * + * ```js + * var $interpolate = ...; // injected + * var context = {greeting: 'Hello', name: undefined }; + * + * // default "forgiving" mode + * var exp = $interpolate('{{greeting}} {{name}}!'); + * expect(exp(context)).toEqual('Hello !'); + * + * // "allOrNothing" mode + * exp = $interpolate('{{greeting}} {{name}}!', false, null, true); + * expect(exp(context)).toBeUndefined(); + * context.name = 'Angular'; + * expect(exp(context)).toEqual('Hello Angular!'); + * ``` + * + * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior. + * + * ####Escaped Interpolation + * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers + * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash). + * It will be rendered as a regular start/end marker, and will not be interpreted as an expression + * or binding. + * + * This enables web-servers to prevent script injection attacks and defacing attacks, to some + * degree, while also enabling code examples to work without relying on the + * {@link ng.directive:ngNonBindable ngNonBindable} directive. + * + * **For security purposes, it is strongly encouraged that web servers escape user-supplied data, + * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all + * interpolation start/end markers with their escaped counterparts.** + * + * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered + * output when the $interpolate service processes the text. So, for HTML elements interpolated + * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter + * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such, + * this is typically useful only when user-data is used in rendering a template from the server, or + * when otherwise untrusted data is used by a directive. + * + * + * + *
+ *

{{apptitle}}: \{\{ username = "defaced value"; \}\} + *

+ *

{{username}} attempts to inject code which will deface the + * application, but fails to accomplish their task, because the server has correctly + * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash) + * characters.

+ *

Instead, the result of the attempted script injection is visible, and can be removed + * from the database by an administrator.

+ *
+ *
+ *
+ * + * @param {string} text The text with markup to interpolate. + * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have + * embedded expression in order to return an interpolation function. Strings with no + * embedded expression will return null for the interpolation function. + * @param {string=} trustedContext when provided, the returned function passes the interpolated + * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult, + * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that + * provides Strict Contextual Escaping for details. + * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined + * unless all embedded expressions evaluate to a value other than `undefined`. + * @returns {function(context)} an interpolation function which is used to compute the + * interpolated string. The function has these parameters: + * + * - `context`: evaluation context for all expressions embedded in the interpolated text + */ + function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) { + allOrNothing = !!allOrNothing; + var startIndex, + endIndex, + index = 0, + expressions = [], + parseFns = [], + textLength = text.length, + exp, + concat = [], + expressionPositions = []; + + while (index < textLength) { + if (((startIndex = text.indexOf(startSymbol, index)) != -1) && + ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) { + if (index !== startIndex) { + concat.push(unescapeText(text.substring(index, startIndex))); + } + exp = text.substring(startIndex + startSymbolLength, endIndex); + expressions.push(exp); + parseFns.push($parse(exp, parseStringifyInterceptor)); + index = endIndex + endSymbolLength; + expressionPositions.push(concat.length); + concat.push(''); + } else { + // we did not find an interpolation, so we have to add the remainder to the separators array + if (index !== textLength) { + concat.push(unescapeText(text.substring(index))); + } + break; + } + } + + // Concatenating expressions makes it hard to reason about whether some combination of + // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a + // single expression be used for iframe[src], object[src], etc., we ensure that the value + // that's used is assigned or constructed by some JS code somewhere that is more testable or + // make it obvious that you bound the value to some user controlled value. This helps reduce + // the load when auditing for XSS issues. + if (trustedContext && concat.length > 1) { + throw $interpolateMinErr('noconcat', + "Error while interpolating: {0}\nStrict Contextual Escaping disallows " + + "interpolations that concatenate multiple expressions when a trusted value is " + + "required. See http://docs.angularjs.org/api/ng.$sce", text); + } + + if (!mustHaveExpression || expressions.length) { + var compute = function(values) { + for (var i = 0, ii = expressions.length; i < ii; i++) { + if (allOrNothing && isUndefined(values[i])) return; + concat[expressionPositions[i]] = values[i]; + } + return concat.join(''); + }; + + var getValue = function(value) { + return trustedContext ? + $sce.getTrusted(trustedContext, value) : + $sce.valueOf(value); + }; + + var stringify = function(value) { + if (value == null) { // null || undefined + return ''; + } + switch (typeof value) { + case 'string': + break; + case 'number': + value = '' + value; + break; + default: + value = toJson(value); + } + + return value; + }; + + return extend(function interpolationFn(context) { + var i = 0; + var ii = expressions.length; + var values = new Array(ii); + + try { + for (; i < ii; i++) { + values[i] = parseFns[i](context); + } + + return compute(values); + } catch (err) { + var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, + err.toString()); + $exceptionHandler(newErr); + } + + }, { + // all of these properties are undocumented for now + exp: text, //just for compatibility with regular watchers created via $watch + expressions: expressions, + $$watchDelegate: function(scope, listener, objectEquality) { + var lastValue; + return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) { + var currValue = compute(values); + if (isFunction(listener)) { + listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope); + } + lastValue = currValue; + }, objectEquality); + } + }); + } + + function unescapeText(text) { + return text.replace(escapedStartRegexp, startSymbol). + replace(escapedEndRegexp, endSymbol); + } + + function parseStringifyInterceptor(value) { + try { + value = getValue(value); + return allOrNothing && !isDefined(value) ? value : stringify(value); + } catch (err) { + var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, + err.toString()); + $exceptionHandler(newErr); + } + } + } + + + /** + * @ngdoc method + * @name $interpolate#startSymbol + * @description + * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`. + * + * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change + * the symbol. + * + * @returns {string} start symbol. + */ + $interpolate.startSymbol = function() { + return startSymbol; + }; + + + /** + * @ngdoc method + * @name $interpolate#endSymbol + * @description + * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`. + * + * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change + * the symbol. + * + * @returns {string} end symbol. + */ + $interpolate.endSymbol = function() { + return endSymbol; + }; + + return $interpolate; + }]; +} + +function $IntervalProvider() { + this.$get = ['$rootScope', '$window', '$q', '$$q', + function($rootScope, $window, $q, $$q) { + var intervals = {}; + + + /** + * @ngdoc service + * @name $interval + * + * @description + * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay` + * milliseconds. + * + * The return value of registering an interval function is a promise. This promise will be + * notified upon each tick of the interval, and will be resolved after `count` iterations, or + * run indefinitely if `count` is not defined. The value of the notification will be the + * number of iterations that have run. + * To cancel an interval, call `$interval.cancel(promise)`. + * + * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to + * move forward by `millis` milliseconds and trigger any functions scheduled to run in that + * time. + * + *
+ * **Note**: Intervals created by this service must be explicitly destroyed when you are finished + * with them. In particular they are not automatically destroyed when a controller's scope or a + * directive's element are destroyed. + * You should take this into consideration and make sure to always cancel the interval at the + * appropriate moment. See the example below for more details on how and when to do this. + *
+ * + * @param {function()} fn A function that should be called repeatedly. + * @param {number} delay Number of milliseconds between each function call. + * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat + * indefinitely. + * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise + * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @returns {promise} A promise which will be notified on each iteration. + * + * @example + * + * + * + * + *
+ *
+ * Date format:
+ * Current time is: + *
+ * Blood 1 : {{blood_1}} + * Blood 2 : {{blood_2}} + * + * + * + *
+ *
+ * + *
+ *
+ */ + function interval(fn, delay, count, invokeApply) { + var setInterval = $window.setInterval, + clearInterval = $window.clearInterval, + iteration = 0, + skipApply = (isDefined(invokeApply) && !invokeApply), + deferred = (skipApply ? $$q : $q).defer(), + promise = deferred.promise; + + count = isDefined(count) ? count : 0; + + promise.then(null, null, fn); + + promise.$$intervalId = setInterval(function tick() { + deferred.notify(iteration++); + + if (count > 0 && iteration >= count) { + deferred.resolve(iteration); + clearInterval(promise.$$intervalId); + delete intervals[promise.$$intervalId]; + } + + if (!skipApply) $rootScope.$apply(); + + }, delay); + + intervals[promise.$$intervalId] = deferred; + + return promise; + } + + + /** + * @ngdoc method + * @name $interval#cancel + * + * @description + * Cancels a task associated with the `promise`. + * + * @param {promise} promise returned by the `$interval` function. + * @returns {boolean} Returns `true` if the task was successfully canceled. + */ + interval.cancel = function(promise) { + if (promise && promise.$$intervalId in intervals) { + intervals[promise.$$intervalId].reject('canceled'); + $window.clearInterval(promise.$$intervalId); + delete intervals[promise.$$intervalId]; + return true; + } + return false; + }; + + return interval; + }]; +} + +/** + * @ngdoc service + * @name $locale + * + * @description + * $locale service provides localization rules for various Angular components. As of right now the + * only public api is: + * + * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`) + */ +function $LocaleProvider() { + this.$get = function() { + return { + id: 'en-us', + + NUMBER_FORMATS: { + DECIMAL_SEP: '.', + GROUP_SEP: ',', + PATTERNS: [ + { // Decimal Pattern + minInt: 1, + minFrac: 0, + maxFrac: 3, + posPre: '', + posSuf: '', + negPre: '-', + negSuf: '', + gSize: 3, + lgSize: 3 + },{ //Currency Pattern + minInt: 1, + minFrac: 2, + maxFrac: 2, + posPre: '\u00A4', + posSuf: '', + negPre: '(\u00A4', + negSuf: ')', + gSize: 3, + lgSize: 3 + } + ], + CURRENCY_SYM: '$' + }, + + DATETIME_FORMATS: { + MONTH: + 'January,February,March,April,May,June,July,August,September,October,November,December' + .split(','), + SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','), + DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','), + SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','), + AMPMS: ['AM','PM'], + medium: 'MMM d, y h:mm:ss a', + 'short': 'M/d/yy h:mm a', + fullDate: 'EEEE, MMMM d, y', + longDate: 'MMMM d, y', + mediumDate: 'MMM d, y', + shortDate: 'M/d/yy', + mediumTime: 'h:mm:ss a', + shortTime: 'h:mm a', + ERANAMES: [ + "Before Christ", + "Anno Domini" + ], + ERAS: [ + "BC", + "AD" + ] + }, + + pluralCat: function(num) { + if (num === 1) { + return 'one'; + } + return 'other'; + } + }; + }; +} + +var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/, + DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21}; +var $locationMinErr = minErr('$location'); + + +/** + * Encode path using encodeUriSegment, ignoring forward slashes + * + * @param {string} path Path to encode + * @returns {string} + */ +function encodePath(path) { + var segments = path.split('/'), + i = segments.length; + + while (i--) { + segments[i] = encodeUriSegment(segments[i]); + } + + return segments.join('/'); +} + +function parseAbsoluteUrl(absoluteUrl, locationObj) { + var parsedUrl = urlResolve(absoluteUrl); + + locationObj.$$protocol = parsedUrl.protocol; + locationObj.$$host = parsedUrl.hostname; + locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; +} + + +function parseAppUrl(relativeUrl, locationObj) { + var prefixed = (relativeUrl.charAt(0) !== '/'); + if (prefixed) { + relativeUrl = '/' + relativeUrl; + } + var match = urlResolve(relativeUrl); + locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ? + match.pathname.substring(1) : match.pathname); + locationObj.$$search = parseKeyValue(match.search); + locationObj.$$hash = decodeURIComponent(match.hash); + + // make sure path starts with '/'; + if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') { + locationObj.$$path = '/' + locationObj.$$path; + } +} + + +/** + * + * @param {string} begin + * @param {string} whole + * @returns {string} returns text from whole after begin or undefined if it does not begin with + * expected string. + */ +function beginsWith(begin, whole) { + if (whole.indexOf(begin) === 0) { + return whole.substr(begin.length); + } +} + + +function stripHash(url) { + var index = url.indexOf('#'); + return index == -1 ? url : url.substr(0, index); +} + +function trimEmptyHash(url) { + return url.replace(/(#.+)|#$/, '$1'); +} + + +function stripFile(url) { + return url.substr(0, stripHash(url).lastIndexOf('/') + 1); +} + +/* return the server only (scheme://host:port) */ +function serverBase(url) { + return url.substring(0, url.indexOf('/', url.indexOf('//') + 2)); +} + + +/** + * LocationHtml5Url represents an url + * This object is exposed as $location service when HTML5 mode is enabled and supported + * + * @constructor + * @param {string} appBase application base URL + * @param {string} appBaseNoFile application base URL stripped of any filename + * @param {string} basePrefix url path prefix + */ +function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) { + this.$$html5 = true; + basePrefix = basePrefix || ''; + parseAbsoluteUrl(appBase, this); + + + /** + * Parse given html5 (regular) url string into properties + * @param {string} url HTML5 url + * @private + */ + this.$$parse = function(url) { + var pathUrl = beginsWith(appBaseNoFile, url); + if (!isString(pathUrl)) { + throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url, + appBaseNoFile); + } + + parseAppUrl(pathUrl, this); + + if (!this.$$path) { + this.$$path = '/'; + } + + this.$$compose(); + }; + + /** + * Compose url and update `absUrl` property + * @private + */ + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/' + }; + + this.$$parseLinkUrl = function(url, relHref) { + if (relHref && relHref[0] === '#') { + // special case for links to hash fragments: + // keep the old url and only replace the hash fragment + this.hash(relHref.slice(1)); + return true; + } + var appUrl, prevAppUrl; + var rewrittenUrl; + + if ((appUrl = beginsWith(appBase, url)) !== undefined) { + prevAppUrl = appUrl; + if ((appUrl = beginsWith(basePrefix, appUrl)) !== undefined) { + rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl); + } else { + rewrittenUrl = appBase + prevAppUrl; + } + } else if ((appUrl = beginsWith(appBaseNoFile, url)) !== undefined) { + rewrittenUrl = appBaseNoFile + appUrl; + } else if (appBaseNoFile == url + '/') { + rewrittenUrl = appBaseNoFile; + } + if (rewrittenUrl) { + this.$$parse(rewrittenUrl); + } + return !!rewrittenUrl; + }; +} + + +/** + * LocationHashbangUrl represents url + * This object is exposed as $location service when developer doesn't opt into html5 mode. + * It also serves as the base class for html5 mode fallback on legacy browsers. + * + * @constructor + * @param {string} appBase application base URL + * @param {string} appBaseNoFile application base URL stripped of any filename + * @param {string} hashPrefix hashbang prefix + */ +function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) { + + parseAbsoluteUrl(appBase, this); + + + /** + * Parse given hashbang url into properties + * @param {string} url Hashbang url + * @private + */ + this.$$parse = function(url) { + var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url); + var withoutHashUrl; + + if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') { + + // The rest of the url starts with a hash so we have + // got either a hashbang path or a plain hash fragment + withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl); + if (isUndefined(withoutHashUrl)) { + // There was no hashbang prefix so we just have a hash fragment + withoutHashUrl = withoutBaseUrl; + } + + } else { + // There was no hashbang path nor hash fragment: + // If we are in HTML5 mode we use what is left as the path; + // Otherwise we ignore what is left + if (this.$$html5) { + withoutHashUrl = withoutBaseUrl; + } else { + withoutHashUrl = ''; + if (isUndefined(withoutBaseUrl)) { + appBase = url; + this.replace(); + } + } + } + + parseAppUrl(withoutHashUrl, this); + + this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase); + + this.$$compose(); + + /* + * In Windows, on an anchor node on documents loaded from + * the filesystem, the browser will return a pathname + * prefixed with the drive name ('/C:/path') when a + * pathname without a drive is set: + * * a.setAttribute('href', '/foo') + * * a.pathname === '/C:/foo' //true + * + * Inside of Angular, we're always using pathnames that + * do not include drive names for routing. + */ + function removeWindowsDriveName(path, url, base) { + /* + Matches paths for file protocol on windows, + such as /C:/foo/bar, and captures only /foo/bar. + */ + var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; + + var firstPathSegmentMatch; + + //Get the relative path from the input URL. + if (url.indexOf(base) === 0) { + url = url.replace(base, ''); + } + + // The input URL intentionally contains a first path segment that ends with a colon. + if (windowsFilePathExp.exec(url)) { + return path; + } + + firstPathSegmentMatch = windowsFilePathExp.exec(path); + return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; + } + }; + + /** + * Compose hashbang url and update `absUrl` property + * @private + */ + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : ''); + }; + + this.$$parseLinkUrl = function(url, relHref) { + if (stripHash(appBase) == stripHash(url)) { + this.$$parse(url); + return true; + } + return false; + }; +} + + +/** + * LocationHashbangUrl represents url + * This object is exposed as $location service when html5 history api is enabled but the browser + * does not support it. + * + * @constructor + * @param {string} appBase application base URL + * @param {string} appBaseNoFile application base URL stripped of any filename + * @param {string} hashPrefix hashbang prefix + */ +function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) { + this.$$html5 = true; + LocationHashbangUrl.apply(this, arguments); + + this.$$parseLinkUrl = function(url, relHref) { + if (relHref && relHref[0] === '#') { + // special case for links to hash fragments: + // keep the old url and only replace the hash fragment + this.hash(relHref.slice(1)); + return true; + } + + var rewrittenUrl; + var appUrl; + + if (appBase == stripHash(url)) { + rewrittenUrl = url; + } else if ((appUrl = beginsWith(appBaseNoFile, url))) { + rewrittenUrl = appBase + hashPrefix + appUrl; + } else if (appBaseNoFile === url + '/') { + rewrittenUrl = appBaseNoFile; + } + if (rewrittenUrl) { + this.$$parse(rewrittenUrl); + } + return !!rewrittenUrl; + }; + + this.$$compose = function() { + var search = toKeyValue(this.$$search), + hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : ''; + + this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash; + // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#' + this.$$absUrl = appBase + hashPrefix + this.$$url; + }; + +} + + +var locationPrototype = { + + /** + * Are we in html5 mode? + * @private + */ + $$html5: false, + + /** + * Has any change been replacing? + * @private + */ + $$replace: false, + + /** + * @ngdoc method + * @name $location#absUrl + * + * @description + * This method is getter only. + * + * Return full url representation with all segments encoded according to rules specified in + * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt). + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var absUrl = $location.absUrl(); + * // => "http://example.com/#/some/path?foo=bar&baz=xoxo" + * ``` + * + * @return {string} full url + */ + absUrl: locationGetter('$$absUrl'), + + /** + * @ngdoc method + * @name $location#url + * + * @description + * This method is getter / setter. + * + * Return url (e.g. `/path?a=b#hash`) when called without any parameter. + * + * Change path, search and hash, when called with parameter and return `$location`. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var url = $location.url(); + * // => "/some/path?foo=bar&baz=xoxo" + * ``` + * + * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`) + * @return {string} url + */ + url: function(url) { + if (isUndefined(url)) + return this.$$url; + + var match = PATH_MATCH.exec(url); + if (match[1] || url === '') this.path(decodeURIComponent(match[1])); + if (match[2] || match[1] || url === '') this.search(match[3] || ''); + this.hash(match[5] || ''); + + return this; + }, + + /** + * @ngdoc method + * @name $location#protocol + * + * @description + * This method is getter only. + * + * Return protocol of current url. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var protocol = $location.protocol(); + * // => "http" + * ``` + * + * @return {string} protocol of current url + */ + protocol: locationGetter('$$protocol'), + + /** + * @ngdoc method + * @name $location#host + * + * @description + * This method is getter only. + * + * Return host of current url. + * + * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var host = $location.host(); + * // => "example.com" + * + * // given url http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo + * host = $location.host(); + * // => "example.com" + * host = location.host; + * // => "example.com:8080" + * ``` + * + * @return {string} host of current url. + */ + host: locationGetter('$$host'), + + /** + * @ngdoc method + * @name $location#port + * + * @description + * This method is getter only. + * + * Return port of current url. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var port = $location.port(); + * // => 80 + * ``` + * + * @return {Number} port + */ + port: locationGetter('$$port'), + + /** + * @ngdoc method + * @name $location#path + * + * @description + * This method is getter / setter. + * + * Return path of current url when called without any parameter. + * + * Change path when called with parameter and return `$location`. + * + * Note: Path should always begin with forward slash (/), this method will add the forward slash + * if it is missing. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var path = $location.path(); + * // => "/some/path" + * ``` + * + * @param {(string|number)=} path New path + * @return {string} path + */ + path: locationGetterSetter('$$path', function(path) { + path = path !== null ? path.toString() : ''; + return path.charAt(0) == '/' ? path : '/' + path; + }), + + /** + * @ngdoc method + * @name $location#search + * + * @description + * This method is getter / setter. + * + * Return search part (as object) of current url when called without any parameter. + * + * Change search part when called with parameter and return `$location`. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo + * var searchObject = $location.search(); + * // => {foo: 'bar', baz: 'xoxo'} + * + * // set foo to 'yipee' + * $location.search('foo', 'yipee'); + * // $location.search() => {foo: 'yipee', baz: 'xoxo'} + * ``` + * + * @param {string|Object.|Object.>} search New search params - string or + * hash object. + * + * When called with a single argument the method acts as a setter, setting the `search` component + * of `$location` to the specified value. + * + * If the argument is a hash object containing an array of values, these values will be encoded + * as duplicate search parameters in the url. + * + * @param {(string|Number|Array|boolean)=} paramValue If `search` is a string or number, then `paramValue` + * will override only a single search property. + * + * If `paramValue` is an array, it will override the property of the `search` component of + * `$location` specified via the first argument. + * + * If `paramValue` is `null`, the property specified via the first argument will be deleted. + * + * If `paramValue` is `true`, the property specified via the first argument will be added with no + * value nor trailing equal sign. + * + * @return {Object} If called with no arguments returns the parsed `search` object. If called with + * one or more arguments returns `$location` object itself. + */ + search: function(search, paramValue) { + switch (arguments.length) { + case 0: + return this.$$search; + case 1: + if (isString(search) || isNumber(search)) { + search = search.toString(); + this.$$search = parseKeyValue(search); + } else if (isObject(search)) { + search = copy(search, {}); + // remove object undefined or null properties + forEach(search, function(value, key) { + if (value == null) delete search[key]; + }); + + this.$$search = search; + } else { + throw $locationMinErr('isrcharg', + 'The first argument of the `$location#search()` call must be a string or an object.'); + } + break; + default: + if (isUndefined(paramValue) || paramValue === null) { + delete this.$$search[search]; + } else { + this.$$search[search] = paramValue; + } + } + + this.$$compose(); + return this; + }, + + /** + * @ngdoc method + * @name $location#hash + * + * @description + * This method is getter / setter. + * + * Return hash fragment when called without any parameter. + * + * Change hash fragment when called with parameter and return `$location`. + * + * + * ```js + * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue + * var hash = $location.hash(); + * // => "hashValue" + * ``` + * + * @param {(string|number)=} hash New hash fragment + * @return {string} hash + */ + hash: locationGetterSetter('$$hash', function(hash) { + return hash !== null ? hash.toString() : ''; + }), + + /** + * @ngdoc method + * @name $location#replace + * + * @description + * If called, all changes to $location during current `$digest` will be replacing current history + * record, instead of adding new one. + */ + replace: function() { + this.$$replace = true; + return this; + } +}; + +forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) { + Location.prototype = Object.create(locationPrototype); + + /** + * @ngdoc method + * @name $location#state + * + * @description + * This method is getter / setter. + * + * Return the history state object when called without any parameter. + * + * Change the history state object when called with one parameter and return `$location`. + * The state object is later passed to `pushState` or `replaceState`. + * + * NOTE: This method is supported only in HTML5 mode and only in browsers supporting + * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support + * older browsers (like IE9 or Android < 4.0), don't use this method. + * + * @param {object=} state State object for pushState or replaceState + * @return {object} state + */ + Location.prototype.state = function(state) { + if (!arguments.length) + return this.$$state; + + if (Location !== LocationHtml5Url || !this.$$html5) { + throw $locationMinErr('nostate', 'History API state support is available only ' + + 'in HTML5 mode and only in browsers supporting HTML5 History API'); + } + // The user might modify `stateObject` after invoking `$location.state(stateObject)` + // but we're changing the $$state reference to $browser.state() during the $digest + // so the modification window is narrow. + this.$$state = isUndefined(state) ? null : state; + + return this; + }; +}); + + +function locationGetter(property) { + return function() { + return this[property]; + }; +} + + +function locationGetterSetter(property, preprocess) { + return function(value) { + if (isUndefined(value)) + return this[property]; + + this[property] = preprocess(value); + this.$$compose(); + + return this; + }; +} + + +/** + * @ngdoc service + * @name $location + * + * @requires $rootElement + * + * @description + * The $location service parses the URL in the browser address bar (based on the + * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL + * available to your application. Changes to the URL in the address bar are reflected into + * $location service and changes to $location are reflected into the browser address bar. + * + * **The $location service:** + * + * - Exposes the current URL in the browser address bar, so you can + * - Watch and observe the URL. + * - Change the URL. + * - Synchronizes the URL with the browser when the user + * - Changes the address bar. + * - Clicks the back or forward button (or clicks a History link). + * - Clicks on a link. + * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash). + * + * For more information see {@link guide/$location Developer Guide: Using $location} + */ + +/** + * @ngdoc provider + * @name $locationProvider + * @description + * Use the `$locationProvider` to configure how the application deep linking paths are stored. + */ +function $LocationProvider() { + var hashPrefix = '', + html5Mode = { + enabled: false, + requireBase: true, + rewriteLinks: true + }; + + /** + * @ngdoc method + * @name $locationProvider#hashPrefix + * @description + * @param {string=} prefix Prefix for hash part (containing path and search) + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.hashPrefix = function(prefix) { + if (isDefined(prefix)) { + hashPrefix = prefix; + return this; + } else { + return hashPrefix; + } + }; + + /** + * @ngdoc method + * @name $locationProvider#html5Mode + * @description + * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value. + * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported + * properties: + * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to + * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not + * support `pushState`. + * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies + * whether or not a tag is required to be present. If `enabled` and `requireBase` are + * true, and a base tag is not present, an error will be thrown when `$location` is injected. + * See the {@link guide/$location $location guide for more information} + * - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled, + * enables/disables url rewriting for relative links. + * + * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter + */ + this.html5Mode = function(mode) { + if (isBoolean(mode)) { + html5Mode.enabled = mode; + return this; + } else if (isObject(mode)) { + + if (isBoolean(mode.enabled)) { + html5Mode.enabled = mode.enabled; + } + + if (isBoolean(mode.requireBase)) { + html5Mode.requireBase = mode.requireBase; + } + + if (isBoolean(mode.rewriteLinks)) { + html5Mode.rewriteLinks = mode.rewriteLinks; + } + + return this; + } else { + return html5Mode; + } + }; + + /** + * @ngdoc event + * @name $location#$locationChangeStart + * @eventType broadcast on root scope + * @description + * Broadcasted before a URL will change. + * + * This change can be prevented by calling + * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more + * details about event object. Upon successful change + * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired. + * + * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when + * the browser supports the HTML5 History API. + * + * @param {Object} angularEvent Synthetic event object. + * @param {string} newUrl New URL + * @param {string=} oldUrl URL that was before it was changed. + * @param {string=} newState New history state object + * @param {string=} oldState History state object that was before it was changed. + */ + + /** + * @ngdoc event + * @name $location#$locationChangeSuccess + * @eventType broadcast on root scope + * @description + * Broadcasted after a URL was changed. + * + * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when + * the browser supports the HTML5 History API. + * + * @param {Object} angularEvent Synthetic event object. + * @param {string} newUrl New URL + * @param {string=} oldUrl URL that was before it was changed. + * @param {string=} newState New history state object + * @param {string=} oldState History state object that was before it was changed. + */ + + this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window', + function($rootScope, $browser, $sniffer, $rootElement, $window) { + var $location, + LocationMode, + baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to '' + initialUrl = $browser.url(), + appBase; + + if (html5Mode.enabled) { + if (!baseHref && html5Mode.requireBase) { + throw $locationMinErr('nobase', + "$location in HTML5 mode requires a tag to be present!"); + } + appBase = serverBase(initialUrl) + (baseHref || '/'); + LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url; + } else { + appBase = stripHash(initialUrl); + LocationMode = LocationHashbangUrl; + } + var appBaseNoFile = stripFile(appBase); + + $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix); + $location.$$parseLinkUrl(initialUrl, initialUrl); + + $location.$$state = $browser.state(); + + var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i; + + function setBrowserUrlWithFallback(url, replace, state) { + var oldUrl = $location.url(); + var oldState = $location.$$state; + try { + $browser.url(url, replace, state); + + // Make sure $location.state() returns referentially identical (not just deeply equal) + // state object; this makes possible quick checking if the state changed in the digest + // loop. Checking deep equality would be too expensive. + $location.$$state = $browser.state(); + } catch (e) { + // Restore old values if pushState fails + $location.url(oldUrl); + $location.$$state = oldState; + + throw e; + } + } + + $rootElement.on('click', function(event) { + // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser) + // currently we open nice url link and redirect then + + if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return; + + var elm = jqLite(event.target); + + // traverse the DOM up to find first A tag + while (nodeName_(elm[0]) !== 'a') { + // ignore rewriting if no A tag (reached root element, or no parent - removed from document) + if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return; + } + + var absHref = elm.prop('href'); + // get the actual href attribute - see + // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx + var relHref = elm.attr('href') || elm.attr('xlink:href'); + + if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') { + // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during + // an animation. + absHref = urlResolve(absHref.animVal).href; + } + + // Ignore when url is started with javascript: or mailto: + if (IGNORE_URI_REGEXP.test(absHref)) return; + + if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) { + if ($location.$$parseLinkUrl(absHref, relHref)) { + // We do a preventDefault for all urls that are part of the angular application, + // in html5mode and also without, so that we are able to abort navigation without + // getting double entries in the location history. + event.preventDefault(); + // update location manually + if ($location.absUrl() != $browser.url()) { + $rootScope.$apply(); + // hack to work around FF6 bug 684208 when scenario runner clicks on links + $window.angular['ff-684208-preventDefault'] = true; + } + } + } + }); + + + // rewrite hashbang url <> html5 url + if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) { + $browser.url($location.absUrl(), true); + } + + var initializing = true; + + // update $location when $browser url changes + $browser.onUrlChange(function(newUrl, newState) { + + if (isUndefined(beginsWith(appBaseNoFile, newUrl))) { + // If we are navigating outside of the app then force a reload + $window.location.href = newUrl; + return; + } + + $rootScope.$evalAsync(function() { + var oldUrl = $location.absUrl(); + var oldState = $location.$$state; + var defaultPrevented; + + $location.$$parse(newUrl); + $location.$$state = newState; + + defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, + newState, oldState).defaultPrevented; + + // if the location was changed by a `$locationChangeStart` handler then stop + // processing this location change + if ($location.absUrl() !== newUrl) return; + + if (defaultPrevented) { + $location.$$parse(oldUrl); + $location.$$state = oldState; + setBrowserUrlWithFallback(oldUrl, false, oldState); + } else { + initializing = false; + afterLocationChange(oldUrl, oldState); + } + }); + if (!$rootScope.$$phase) $rootScope.$digest(); + }); + + // update browser + $rootScope.$watch(function $locationWatch() { + var oldUrl = trimEmptyHash($browser.url()); + var newUrl = trimEmptyHash($location.absUrl()); + var oldState = $browser.state(); + var currentReplace = $location.$$replace; + var urlOrStateChanged = oldUrl !== newUrl || + ($location.$$html5 && $sniffer.history && oldState !== $location.$$state); + + if (initializing || urlOrStateChanged) { + initializing = false; + + $rootScope.$evalAsync(function() { + var newUrl = $location.absUrl(); + var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, + $location.$$state, oldState).defaultPrevented; + + // if the location was changed by a `$locationChangeStart` handler then stop + // processing this location change + if ($location.absUrl() !== newUrl) return; + + if (defaultPrevented) { + $location.$$parse(oldUrl); + $location.$$state = oldState; + } else { + if (urlOrStateChanged) { + setBrowserUrlWithFallback(newUrl, currentReplace, + oldState === $location.$$state ? null : $location.$$state); + } + afterLocationChange(oldUrl, oldState); + } + }); + } + + $location.$$replace = false; + + // we don't need to return anything because $evalAsync will make the digest loop dirty when + // there is a change + }); + + return $location; + + function afterLocationChange(oldUrl, oldState) { + $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl, + $location.$$state, oldState); + } +}]; +} + +/** + * @ngdoc service + * @name $log + * @requires $window + * + * @description + * Simple service for logging. Default implementation safely writes the message + * into the browser's console (if present). + * + * The main purpose of this service is to simplify debugging and troubleshooting. + * + * The default is to log `debug` messages. You can use + * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this. + * + * @example + + + angular.module('logExample', []) + .controller('LogController', ['$scope', '$log', function($scope, $log) { + $scope.$log = $log; + $scope.message = 'Hello World!'; + }]); + + +
+

Reload this page with open console, enter text and hit the log button...

+ Message: + + + + + + +
+
+
+ */ + +/** + * @ngdoc provider + * @name $logProvider + * @description + * Use the `$logProvider` to configure how the application logs messages + */ +function $LogProvider() { + var debug = true, + self = this; + + /** + * @ngdoc method + * @name $logProvider#debugEnabled + * @description + * @param {boolean=} flag enable or disable debug level messages + * @returns {*} current value if used as getter or itself (chaining) if used as setter + */ + this.debugEnabled = function(flag) { + if (isDefined(flag)) { + debug = flag; + return this; + } else { + return debug; + } + }; + + this.$get = ['$window', function($window) { + return { + /** + * @ngdoc method + * @name $log#log + * + * @description + * Write a log message + */ + log: consoleLog('log'), + + /** + * @ngdoc method + * @name $log#info + * + * @description + * Write an information message + */ + info: consoleLog('info'), + + /** + * @ngdoc method + * @name $log#warn + * + * @description + * Write a warning message + */ + warn: consoleLog('warn'), + + /** + * @ngdoc method + * @name $log#error + * + * @description + * Write an error message + */ + error: consoleLog('error'), + + /** + * @ngdoc method + * @name $log#debug + * + * @description + * Write a debug message + */ + debug: (function() { + var fn = consoleLog('debug'); + + return function() { + if (debug) { + fn.apply(self, arguments); + } + }; + }()) + }; + + function formatError(arg) { + if (arg instanceof Error) { + if (arg.stack) { + arg = (arg.message && arg.stack.indexOf(arg.message) === -1) + ? 'Error: ' + arg.message + '\n' + arg.stack + : arg.stack; + } else if (arg.sourceURL) { + arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; + } + } + return arg; + } + + function consoleLog(type) { + var console = $window.console || {}, + logFn = console[type] || console.log || noop, + hasApply = false; + + // Note: reading logFn.apply throws an error in IE11 in IE8 document mode. + // The reason behind this is that console.log has type "object" in IE8... + try { + hasApply = !!logFn.apply; + } catch (e) {} + + if (hasApply) { + return function() { + var args = []; + forEach(arguments, function(arg) { + args.push(formatError(arg)); + }); + return logFn.apply(console, args); + }; + } + + // we are IE which either doesn't have window.console => this is noop and we do nothing, + // or we are IE where console.log doesn't have apply so we log at least first 2 args + return function(arg1, arg2) { + logFn(arg1, arg2 == null ? '' : arg2); + }; + } + }]; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +var $parseMinErr = minErr('$parse'); + +// Sandboxing Angular Expressions +// ------------------------------ +// Angular expressions are generally considered safe because these expressions only have direct +// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by +// obtaining a reference to native JS functions such as the Function constructor. +// +// As an example, consider the following Angular expression: +// +// {}.toString.constructor('alert("evil JS code")') +// +// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits +// against the expression language, but not to prevent exploits that were enabled by exposing +// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good +// practice and therefore we are not even trying to protect against interaction with an object +// explicitly exposed in this way. +// +// In general, it is not possible to access a Window object from an angular expression unless a +// window or some DOM object that has a reference to window is published onto a Scope. +// Similarly we prevent invocations of function known to be dangerous, as well as assignments to +// native objects. +// +// See https://docs.angularjs.org/guide/security + + +function ensureSafeMemberName(name, fullExpression) { + if (name === "__defineGetter__" || name === "__defineSetter__" + || name === "__lookupGetter__" || name === "__lookupSetter__" + || name === "__proto__") { + throw $parseMinErr('isecfld', + 'Attempting to access a disallowed field in Angular expressions! ' + + 'Expression: {0}', fullExpression); + } + return name; +} + +function getStringValue(name, fullExpression) { + // From the JavaScript docs: + // Property names must be strings. This means that non-string objects cannot be used + // as keys in an object. Any non-string object, including a number, is typecasted + // into a string via the toString method. + // + // So, to ensure that we are checking the same `name` that JavaScript would use, + // we cast it to a string, if possible. + // Doing `name + ''` can cause a repl error if the result to `toString` is not a string, + // this is, this will handle objects that misbehave. + name = name + ''; + if (!isString(name)) { + throw $parseMinErr('iseccst', + 'Cannot convert object to primitive value! ' + + 'Expression: {0}', fullExpression); + } + return name; +} + +function ensureSafeObject(obj, fullExpression) { + // nifty check if obj is Function that is fast and works across iframes and other contexts + if (obj) { + if (obj.constructor === obj) { + throw $parseMinErr('isecfn', + 'Referencing Function in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// isWindow(obj) + obj.window === obj) { + throw $parseMinErr('isecwindow', + 'Referencing the Window in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// isElement(obj) + obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) { + throw $parseMinErr('isecdom', + 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (// block Object so that we can't get hold of dangerous Object.* methods + obj === Object) { + throw $parseMinErr('isecobj', + 'Referencing Object in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } + } + return obj; +} + +var CALL = Function.prototype.call; +var APPLY = Function.prototype.apply; +var BIND = Function.prototype.bind; + +function ensureSafeFunction(obj, fullExpression) { + if (obj) { + if (obj.constructor === obj) { + throw $parseMinErr('isecfn', + 'Referencing Function in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } else if (obj === CALL || obj === APPLY || obj === BIND) { + throw $parseMinErr('isecff', + 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}', + fullExpression); + } + } +} + +//Keyword constants +var CONSTANTS = createMap(); +forEach({ + 'null': function() { return null; }, + 'true': function() { return true; }, + 'false': function() { return false; }, + 'undefined': function() {} +}, function(constantGetter, name) { + constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true; + CONSTANTS[name] = constantGetter; +}); + +//Not quite a constant, but can be lex/parsed the same +CONSTANTS['this'] = function(self) { return self; }; +CONSTANTS['this'].sharedGetter = true; + + +//Operators - will be wrapped by binaryFn/unaryFn/assignment/filter +var OPERATORS = extend(createMap(), { + '+':function(self, locals, a, b) { + a=a(self, locals); b=b(self, locals); + if (isDefined(a)) { + if (isDefined(b)) { + return a + b; + } + return a; + } + return isDefined(b) ? b : undefined;}, + '-':function(self, locals, a, b) { + a=a(self, locals); b=b(self, locals); + return (isDefined(a) ? a : 0) - (isDefined(b) ? b : 0); + }, + '*':function(self, locals, a, b) {return a(self, locals) * b(self, locals);}, + '/':function(self, locals, a, b) {return a(self, locals) / b(self, locals);}, + '%':function(self, locals, a, b) {return a(self, locals) % b(self, locals);}, + '===':function(self, locals, a, b) {return a(self, locals) === b(self, locals);}, + '!==':function(self, locals, a, b) {return a(self, locals) !== b(self, locals);}, + '==':function(self, locals, a, b) {return a(self, locals) == b(self, locals);}, + '!=':function(self, locals, a, b) {return a(self, locals) != b(self, locals);}, + '<':function(self, locals, a, b) {return a(self, locals) < b(self, locals);}, + '>':function(self, locals, a, b) {return a(self, locals) > b(self, locals);}, + '<=':function(self, locals, a, b) {return a(self, locals) <= b(self, locals);}, + '>=':function(self, locals, a, b) {return a(self, locals) >= b(self, locals);}, + '&&':function(self, locals, a, b) {return a(self, locals) && b(self, locals);}, + '||':function(self, locals, a, b) {return a(self, locals) || b(self, locals);}, + '!':function(self, locals, a) {return !a(self, locals);}, + + //Tokenized as operators but parsed as assignment/filters + '=':true, + '|':true +}); +var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'}; + + +///////////////////////////////////////// + + +/** + * @constructor + */ +var Lexer = function(options) { + this.options = options; +}; + +Lexer.prototype = { + constructor: Lexer, + + lex: function(text) { + this.text = text; + this.index = 0; + this.tokens = []; + + while (this.index < this.text.length) { + var ch = this.text.charAt(this.index); + if (ch === '"' || ch === "'") { + this.readString(ch); + } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) { + this.readNumber(); + } else if (this.isIdent(ch)) { + this.readIdent(); + } else if (this.is(ch, '(){}[].,;:?')) { + this.tokens.push({index: this.index, text: ch}); + this.index++; + } else if (this.isWhitespace(ch)) { + this.index++; + } else { + var ch2 = ch + this.peek(); + var ch3 = ch2 + this.peek(2); + var op1 = OPERATORS[ch]; + var op2 = OPERATORS[ch2]; + var op3 = OPERATORS[ch3]; + if (op1 || op2 || op3) { + var token = op3 ? ch3 : (op2 ? ch2 : ch); + this.tokens.push({index: this.index, text: token, operator: true}); + this.index += token.length; + } else { + this.throwError('Unexpected next character ', this.index, this.index + 1); + } + } + } + return this.tokens; + }, + + is: function(ch, chars) { + return chars.indexOf(ch) !== -1; + }, + + peek: function(i) { + var num = i || 1; + return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false; + }, + + isNumber: function(ch) { + return ('0' <= ch && ch <= '9') && typeof ch === "string"; + }, + + isWhitespace: function(ch) { + // IE treats non-breaking space as \u00A0 + return (ch === ' ' || ch === '\r' || ch === '\t' || + ch === '\n' || ch === '\v' || ch === '\u00A0'); + }, + + isIdent: function(ch) { + return ('a' <= ch && ch <= 'z' || + 'A' <= ch && ch <= 'Z' || + '_' === ch || ch === '$'); + }, + + isExpOperator: function(ch) { + return (ch === '-' || ch === '+' || this.isNumber(ch)); + }, + + throwError: function(error, start, end) { + end = end || this.index; + var colStr = (isDefined(start) + ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']' + : ' ' + end); + throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].', + error, colStr, this.text); + }, + + readNumber: function() { + var number = ''; + var start = this.index; + while (this.index < this.text.length) { + var ch = lowercase(this.text.charAt(this.index)); + if (ch == '.' || this.isNumber(ch)) { + number += ch; + } else { + var peekCh = this.peek(); + if (ch == 'e' && this.isExpOperator(peekCh)) { + number += ch; + } else if (this.isExpOperator(ch) && + peekCh && this.isNumber(peekCh) && + number.charAt(number.length - 1) == 'e') { + number += ch; + } else if (this.isExpOperator(ch) && + (!peekCh || !this.isNumber(peekCh)) && + number.charAt(number.length - 1) == 'e') { + this.throwError('Invalid exponent'); + } else { + break; + } + } + this.index++; + } + this.tokens.push({ + index: start, + text: number, + constant: true, + value: Number(number) + }); + }, + + readIdent: function() { + var start = this.index; + while (this.index < this.text.length) { + var ch = this.text.charAt(this.index); + if (!(this.isIdent(ch) || this.isNumber(ch))) { + break; + } + this.index++; + } + this.tokens.push({ + index: start, + text: this.text.slice(start, this.index), + identifier: true + }); + }, + + readString: function(quote) { + var start = this.index; + this.index++; + var string = ''; + var rawString = quote; + var escape = false; + while (this.index < this.text.length) { + var ch = this.text.charAt(this.index); + rawString += ch; + if (escape) { + if (ch === 'u') { + var hex = this.text.substring(this.index + 1, this.index + 5); + if (!hex.match(/[\da-f]{4}/i)) + this.throwError('Invalid unicode escape [\\u' + hex + ']'); + this.index += 4; + string += String.fromCharCode(parseInt(hex, 16)); + } else { + var rep = ESCAPE[ch]; + string = string + (rep || ch); + } + escape = false; + } else if (ch === '\\') { + escape = true; + } else if (ch === quote) { + this.index++; + this.tokens.push({ + index: start, + text: rawString, + constant: true, + value: string + }); + return; + } else { + string += ch; + } + this.index++; + } + this.throwError('Unterminated quote', start); + } +}; + + +function isConstant(exp) { + return exp.constant; +} + +/** + * @constructor + */ +var Parser = function(lexer, $filter, options) { + this.lexer = lexer; + this.$filter = $filter; + this.options = options; +}; + +Parser.ZERO = extend(function() { + return 0; +}, { + sharedGetter: true, + constant: true +}); + +Parser.prototype = { + constructor: Parser, + + parse: function(text) { + this.text = text; + this.tokens = this.lexer.lex(text); + + var value = this.statements(); + + if (this.tokens.length !== 0) { + this.throwError('is an unexpected token', this.tokens[0]); + } + + value.literal = !!value.literal; + value.constant = !!value.constant; + + return value; + }, + + primary: function() { + var primary; + if (this.expect('(')) { + primary = this.filterChain(); + this.consume(')'); + } else if (this.expect('[')) { + primary = this.arrayDeclaration(); + } else if (this.expect('{')) { + primary = this.object(); + } else if (this.peek().identifier && this.peek().text in CONSTANTS) { + primary = CONSTANTS[this.consume().text]; + } else if (this.peek().identifier) { + primary = this.identifier(); + } else if (this.peek().constant) { + primary = this.constant(); + } else { + this.throwError('not a primary expression', this.peek()); + } + + var next, context; + while ((next = this.expect('(', '[', '.'))) { + if (next.text === '(') { + primary = this.functionCall(primary, context); + context = null; + } else if (next.text === '[') { + context = primary; + primary = this.objectIndex(primary); + } else if (next.text === '.') { + context = primary; + primary = this.fieldAccess(primary); + } else { + this.throwError('IMPOSSIBLE'); + } + } + return primary; + }, + + throwError: function(msg, token) { + throw $parseMinErr('syntax', + 'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].', + token.text, msg, (token.index + 1), this.text, this.text.substring(token.index)); + }, + + peekToken: function() { + if (this.tokens.length === 0) + throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); + return this.tokens[0]; + }, + + peek: function(e1, e2, e3, e4) { + return this.peekAhead(0, e1, e2, e3, e4); + }, + peekAhead: function(i, e1, e2, e3, e4) { + if (this.tokens.length > i) { + var token = this.tokens[i]; + var t = token.text; + if (t === e1 || t === e2 || t === e3 || t === e4 || + (!e1 && !e2 && !e3 && !e4)) { + return token; + } + } + return false; + }, + + expect: function(e1, e2, e3, e4) { + var token = this.peek(e1, e2, e3, e4); + if (token) { + this.tokens.shift(); + return token; + } + return false; + }, + + consume: function(e1) { + if (this.tokens.length === 0) { + throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); + } + + var token = this.expect(e1); + if (!token) { + this.throwError('is unexpected, expecting [' + e1 + ']', this.peek()); + } + return token; + }, + + unaryFn: function(op, right) { + var fn = OPERATORS[op]; + return extend(function $parseUnaryFn(self, locals) { + return fn(self, locals, right); + }, { + constant:right.constant, + inputs: [right] + }); + }, + + binaryFn: function(left, op, right, isBranching) { + var fn = OPERATORS[op]; + return extend(function $parseBinaryFn(self, locals) { + return fn(self, locals, left, right); + }, { + constant: left.constant && right.constant, + inputs: !isBranching && [left, right] + }); + }, + + identifier: function() { + var id = this.consume().text; + + //Continue reading each `.identifier` unless it is a method invocation + while (this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2, '(')) { + id += this.consume().text + this.consume().text; + } + + return getterFn(id, this.options, this.text); + }, + + constant: function() { + var value = this.consume().value; + + return extend(function $parseConstant() { + return value; + }, { + constant: true, + literal: true + }); + }, + + statements: function() { + var statements = []; + while (true) { + if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']')) + statements.push(this.filterChain()); + if (!this.expect(';')) { + // optimize for the common case where there is only one statement. + // TODO(size): maybe we should not support multiple statements? + return (statements.length === 1) + ? statements[0] + : function $parseStatements(self, locals) { + var value; + for (var i = 0, ii = statements.length; i < ii; i++) { + value = statements[i](self, locals); + } + return value; + }; + } + } + }, + + filterChain: function() { + var left = this.expression(); + var token; + while ((token = this.expect('|'))) { + left = this.filter(left); + } + return left; + }, + + filter: function(inputFn) { + var fn = this.$filter(this.consume().text); + var argsFn; + var args; + + if (this.peek(':')) { + argsFn = []; + args = []; // we can safely reuse the array + while (this.expect(':')) { + argsFn.push(this.expression()); + } + } + + var inputs = [inputFn].concat(argsFn || []); + + return extend(function $parseFilter(self, locals) { + var input = inputFn(self, locals); + if (args) { + args[0] = input; + + var i = argsFn.length; + while (i--) { + args[i + 1] = argsFn[i](self, locals); + } + + return fn.apply(undefined, args); + } + + return fn(input); + }, { + constant: !fn.$stateful && inputs.every(isConstant), + inputs: !fn.$stateful && inputs + }); + }, + + expression: function() { + return this.assignment(); + }, + + assignment: function() { + var left = this.ternary(); + var right; + var token; + if ((token = this.expect('='))) { + if (!left.assign) { + this.throwError('implies assignment but [' + + this.text.substring(0, token.index) + '] can not be assigned to', token); + } + right = this.ternary(); + return extend(function $parseAssignment(scope, locals) { + return left.assign(scope, right(scope, locals), locals); + }, { + inputs: [left, right] + }); + } + return left; + }, + + ternary: function() { + var left = this.logicalOR(); + var middle; + var token; + if ((token = this.expect('?'))) { + middle = this.assignment(); + if (this.consume(':')) { + var right = this.assignment(); + + return extend(function $parseTernary(self, locals) { + return left(self, locals) ? middle(self, locals) : right(self, locals); + }, { + constant: left.constant && middle.constant && right.constant + }); + } + } + + return left; + }, + + logicalOR: function() { + var left = this.logicalAND(); + var token; + while ((token = this.expect('||'))) { + left = this.binaryFn(left, token.text, this.logicalAND(), true); + } + return left; + }, + + logicalAND: function() { + var left = this.equality(); + var token; + while ((token = this.expect('&&'))) { + left = this.binaryFn(left, token.text, this.equality(), true); + } + return left; + }, + + equality: function() { + var left = this.relational(); + var token; + while ((token = this.expect('==','!=','===','!=='))) { + left = this.binaryFn(left, token.text, this.relational()); + } + return left; + }, + + relational: function() { + var left = this.additive(); + var token; + while ((token = this.expect('<', '>', '<=', '>='))) { + left = this.binaryFn(left, token.text, this.additive()); + } + return left; + }, + + additive: function() { + var left = this.multiplicative(); + var token; + while ((token = this.expect('+','-'))) { + left = this.binaryFn(left, token.text, this.multiplicative()); + } + return left; + }, + + multiplicative: function() { + var left = this.unary(); + var token; + while ((token = this.expect('*','/','%'))) { + left = this.binaryFn(left, token.text, this.unary()); + } + return left; + }, + + unary: function() { + var token; + if (this.expect('+')) { + return this.primary(); + } else if ((token = this.expect('-'))) { + return this.binaryFn(Parser.ZERO, token.text, this.unary()); + } else if ((token = this.expect('!'))) { + return this.unaryFn(token.text, this.unary()); + } else { + return this.primary(); + } + }, + + fieldAccess: function(object) { + var getter = this.identifier(); + + return extend(function $parseFieldAccess(scope, locals, self) { + var o = self || object(scope, locals); + return (o == null) ? undefined : getter(o); + }, { + assign: function(scope, value, locals) { + var o = object(scope, locals); + if (!o) object.assign(scope, o = {}, locals); + return getter.assign(o, value); + } + }); + }, + + objectIndex: function(obj) { + var expression = this.text; + + var indexFn = this.expression(); + this.consume(']'); + + return extend(function $parseObjectIndex(self, locals) { + var o = obj(self, locals), + i = getStringValue(indexFn(self, locals), expression), + v; + + ensureSafeMemberName(i, expression); + if (!o) return undefined; + v = ensureSafeObject(o[i], expression); + return v; + }, { + assign: function(self, value, locals) { + var key = ensureSafeMemberName(getStringValue(indexFn(self, locals), expression), expression); + // prevent overwriting of Function.constructor which would break ensureSafeObject check + var o = ensureSafeObject(obj(self, locals), expression); + if (!o) obj.assign(self, o = {}, locals); + return o[key] = value; + } + }); + }, + + functionCall: function(fnGetter, contextGetter) { + var argsFn = []; + if (this.peekToken().text !== ')') { + do { + argsFn.push(this.expression()); + } while (this.expect(',')); + } + this.consume(')'); + + var expressionText = this.text; + // we can safely reuse the array across invocations + var args = argsFn.length ? [] : null; + + return function $parseFunctionCall(scope, locals) { + var context = contextGetter ? contextGetter(scope, locals) : isDefined(contextGetter) ? undefined : scope; + var fn = fnGetter(scope, locals, context) || noop; + + if (args) { + var i = argsFn.length; + while (i--) { + args[i] = ensureSafeObject(argsFn[i](scope, locals), expressionText); + } + } + + ensureSafeObject(context, expressionText); + ensureSafeFunction(fn, expressionText); + + // IE doesn't have apply for some native functions + var v = fn.apply + ? fn.apply(context, args) + : fn(args[0], args[1], args[2], args[3], args[4]); + + if (args) { + // Free-up the memory (arguments of the last function call). + args.length = 0; + } + + return ensureSafeObject(v, expressionText); + }; + }, + + // This is used with json array declaration + arrayDeclaration: function() { + var elementFns = []; + if (this.peekToken().text !== ']') { + do { + if (this.peek(']')) { + // Support trailing commas per ES5.1. + break; + } + elementFns.push(this.expression()); + } while (this.expect(',')); + } + this.consume(']'); + + return extend(function $parseArrayLiteral(self, locals) { + var array = []; + for (var i = 0, ii = elementFns.length; i < ii; i++) { + array.push(elementFns[i](self, locals)); + } + return array; + }, { + literal: true, + constant: elementFns.every(isConstant), + inputs: elementFns + }); + }, + + object: function() { + var keys = [], valueFns = []; + if (this.peekToken().text !== '}') { + do { + if (this.peek('}')) { + // Support trailing commas per ES5.1. + break; + } + var token = this.consume(); + if (token.constant) { + keys.push(token.value); + } else if (token.identifier) { + keys.push(token.text); + } else { + this.throwError("invalid key", token); + } + this.consume(':'); + valueFns.push(this.expression()); + } while (this.expect(',')); + } + this.consume('}'); + + return extend(function $parseObjectLiteral(self, locals) { + var object = {}; + for (var i = 0, ii = valueFns.length; i < ii; i++) { + object[keys[i]] = valueFns[i](self, locals); + } + return object; + }, { + literal: true, + constant: valueFns.every(isConstant), + inputs: valueFns + }); + } +}; + + +////////////////////////////////////////////////// +// Parser helper functions +////////////////////////////////////////////////// + +function setter(obj, locals, path, setValue, fullExp) { + ensureSafeObject(obj, fullExp); + ensureSafeObject(locals, fullExp); + + var element = path.split('.'), key; + for (var i = 0; element.length > 1; i++) { + key = ensureSafeMemberName(element.shift(), fullExp); + var propertyObj = (i === 0 && locals && locals[key]) || obj[key]; + if (!propertyObj) { + propertyObj = {}; + obj[key] = propertyObj; + } + obj = ensureSafeObject(propertyObj, fullExp); + } + key = ensureSafeMemberName(element.shift(), fullExp); + ensureSafeObject(obj[key], fullExp); + obj[key] = setValue; + return setValue; +} + +var getterFnCacheDefault = createMap(); +var getterFnCacheExpensive = createMap(); + +function isPossiblyDangerousMemberName(name) { + return name == 'constructor'; +} + +/** + * Implementation of the "Black Hole" variant from: + * - http://jsperf.com/angularjs-parse-getter/4 + * - http://jsperf.com/path-evaluation-simplified/7 + */ +function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, expensiveChecks) { + ensureSafeMemberName(key0, fullExp); + ensureSafeMemberName(key1, fullExp); + ensureSafeMemberName(key2, fullExp); + ensureSafeMemberName(key3, fullExp); + ensureSafeMemberName(key4, fullExp); + var eso = function(o) { + return ensureSafeObject(o, fullExp); + }; + var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity; + var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity; + var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity; + var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity; + var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity; + + return function cspSafeGetter(scope, locals) { + var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope; + + if (pathVal == null) return pathVal; + pathVal = eso0(pathVal[key0]); + + if (!key1) return pathVal; + if (pathVal == null) return undefined; + pathVal = eso1(pathVal[key1]); + + if (!key2) return pathVal; + if (pathVal == null) return undefined; + pathVal = eso2(pathVal[key2]); + + if (!key3) return pathVal; + if (pathVal == null) return undefined; + pathVal = eso3(pathVal[key3]); + + if (!key4) return pathVal; + if (pathVal == null) return undefined; + pathVal = eso4(pathVal[key4]); + + return pathVal; + }; +} + +function getterFnWithEnsureSafeObject(fn, fullExpression) { + return function(s, l) { + return fn(s, l, ensureSafeObject, fullExpression); + }; +} + +function getterFn(path, options, fullExp) { + var expensiveChecks = options.expensiveChecks; + var getterFnCache = (expensiveChecks ? getterFnCacheExpensive : getterFnCacheDefault); + var fn = getterFnCache[path]; + if (fn) return fn; + + + var pathKeys = path.split('.'), + pathKeysLength = pathKeys.length; + + // http://jsperf.com/angularjs-parse-getter/6 + if (options.csp) { + if (pathKeysLength < 6) { + fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp, expensiveChecks); + } else { + fn = function cspSafeGetter(scope, locals) { + var i = 0, val; + do { + val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++], + pathKeys[i++], fullExp, expensiveChecks)(scope, locals); + + locals = undefined; // clear after first iteration + scope = val; + } while (i < pathKeysLength); + return val; + }; + } + } else { + var code = ''; + if (expensiveChecks) { + code += 's = eso(s, fe);\nl = eso(l, fe);\n'; + } + var needsEnsureSafeObject = expensiveChecks; + forEach(pathKeys, function(key, index) { + ensureSafeMemberName(key, fullExp); + var lookupJs = (index + // we simply dereference 's' on any .dot notation + ? 's' + // but if we are first then we check locals first, and if so read it first + : '((l&&l.hasOwnProperty("' + key + '"))?l:s)') + '.' + key; + if (expensiveChecks || isPossiblyDangerousMemberName(key)) { + lookupJs = 'eso(' + lookupJs + ', fe)'; + needsEnsureSafeObject = true; + } + code += 'if(s == null) return undefined;\n' + + 's=' + lookupJs + ';\n'; + }); + code += 'return s;'; + + /* jshint -W054 */ + var evaledFnGetter = new Function('s', 'l', 'eso', 'fe', code); // s=scope, l=locals, eso=ensureSafeObject + /* jshint +W054 */ + evaledFnGetter.toString = valueFn(code); + if (needsEnsureSafeObject) { + evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter, fullExp); + } + fn = evaledFnGetter; + } + + fn.sharedGetter = true; + fn.assign = function(self, value, locals) { + return setter(self, locals, path, value, path); + }; + getterFnCache[path] = fn; + return fn; +} + +var objectValueOf = Object.prototype.valueOf; + +function getValueOf(value) { + return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value); +} + +/////////////////////////////////// + +/** + * @ngdoc service + * @name $parse + * @kind function + * + * @description + * + * Converts Angular {@link guide/expression expression} into a function. + * + * ```js + * var getter = $parse('user.name'); + * var setter = getter.assign; + * var context = {user:{name:'angular'}}; + * var locals = {user:{name:'local'}}; + * + * expect(getter(context)).toEqual('angular'); + * setter(context, 'newValue'); + * expect(context.user.name).toEqual('newValue'); + * expect(getter(context, locals)).toEqual('local'); + * ``` + * + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + * + * The returned function also has the following properties: + * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript + * literal. + * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript + * constant literals. + * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be + * set to a function to change its value on the given context. + * + */ + + +/** + * @ngdoc provider + * @name $parseProvider + * + * @description + * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse} + * service. + */ +function $ParseProvider() { + var cacheDefault = createMap(); + var cacheExpensive = createMap(); + + + + this.$get = ['$filter', '$sniffer', function($filter, $sniffer) { + var $parseOptions = { + csp: $sniffer.csp, + expensiveChecks: false + }, + $parseOptionsExpensive = { + csp: $sniffer.csp, + expensiveChecks: true + }; + + function wrapSharedExpression(exp) { + var wrapped = exp; + + if (exp.sharedGetter) { + wrapped = function $parseWrapper(self, locals) { + return exp(self, locals); + }; + wrapped.literal = exp.literal; + wrapped.constant = exp.constant; + wrapped.assign = exp.assign; + } + + return wrapped; + } + + return function $parse(exp, interceptorFn, expensiveChecks) { + var parsedExpression, oneTime, cacheKey; + + switch (typeof exp) { + case 'string': + cacheKey = exp = exp.trim(); + + var cache = (expensiveChecks ? cacheExpensive : cacheDefault); + parsedExpression = cache[cacheKey]; + + if (!parsedExpression) { + if (exp.charAt(0) === ':' && exp.charAt(1) === ':') { + oneTime = true; + exp = exp.substring(2); + } + + var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions; + var lexer = new Lexer(parseOptions); + var parser = new Parser(lexer, $filter, parseOptions); + parsedExpression = parser.parse(exp); + + if (parsedExpression.constant) { + parsedExpression.$$watchDelegate = constantWatchDelegate; + } else if (oneTime) { + //oneTime is not part of the exp passed to the Parser so we may have to + //wrap the parsedExpression before adding a $$watchDelegate + parsedExpression = wrapSharedExpression(parsedExpression); + parsedExpression.$$watchDelegate = parsedExpression.literal ? + oneTimeLiteralWatchDelegate : oneTimeWatchDelegate; + } else if (parsedExpression.inputs) { + parsedExpression.$$watchDelegate = inputsWatchDelegate; + } + + cache[cacheKey] = parsedExpression; + } + return addInterceptor(parsedExpression, interceptorFn); + + case 'function': + return addInterceptor(exp, interceptorFn); + + default: + return addInterceptor(noop, interceptorFn); + } + }; + + function collectExpressionInputs(inputs, list) { + for (var i = 0, ii = inputs.length; i < ii; i++) { + var input = inputs[i]; + if (!input.constant) { + if (input.inputs) { + collectExpressionInputs(input.inputs, list); + } else if (list.indexOf(input) === -1) { // TODO(perf) can we do better? + list.push(input); + } + } + } + + return list; + } + + function expressionInputDirtyCheck(newValue, oldValueOfValue) { + + if (newValue == null || oldValueOfValue == null) { // null/undefined + return newValue === oldValueOfValue; + } + + if (typeof newValue === 'object') { + + // attempt to convert the value to a primitive type + // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can + // be cheaply dirty-checked + newValue = getValueOf(newValue); + + if (typeof newValue === 'object') { + // objects/arrays are not supported - deep-watching them would be too expensive + return false; + } + + // fall-through to the primitive equality check + } + + //Primitive or NaN + return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue); + } + + function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression) { + var inputExpressions = parsedExpression.$$inputs || + (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs, [])); + + var lastResult; + + if (inputExpressions.length === 1) { + var oldInputValue = expressionInputDirtyCheck; // init to something unique so that equals check fails + inputExpressions = inputExpressions[0]; + return scope.$watch(function expressionInputWatch(scope) { + var newInputValue = inputExpressions(scope); + if (!expressionInputDirtyCheck(newInputValue, oldInputValue)) { + lastResult = parsedExpression(scope); + oldInputValue = newInputValue && getValueOf(newInputValue); + } + return lastResult; + }, listener, objectEquality); + } + + var oldInputValueOfValues = []; + for (var i = 0, ii = inputExpressions.length; i < ii; i++) { + oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails + } + + return scope.$watch(function expressionInputsWatch(scope) { + var changed = false; + + for (var i = 0, ii = inputExpressions.length; i < ii; i++) { + var newInputValue = inputExpressions[i](scope); + if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) { + oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue); + } + } + + if (changed) { + lastResult = parsedExpression(scope); + } + + return lastResult; + }, listener, objectEquality); + } + + function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) { + var unwatch, lastValue; + return unwatch = scope.$watch(function oneTimeWatch(scope) { + return parsedExpression(scope); + }, function oneTimeListener(value, old, scope) { + lastValue = value; + if (isFunction(listener)) { + listener.apply(this, arguments); + } + if (isDefined(value)) { + scope.$$postDigest(function() { + if (isDefined(lastValue)) { + unwatch(); + } + }); + } + }, objectEquality); + } + + function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) { + var unwatch, lastValue; + return unwatch = scope.$watch(function oneTimeWatch(scope) { + return parsedExpression(scope); + }, function oneTimeListener(value, old, scope) { + lastValue = value; + if (isFunction(listener)) { + listener.call(this, value, old, scope); + } + if (isAllDefined(value)) { + scope.$$postDigest(function() { + if (isAllDefined(lastValue)) unwatch(); + }); + } + }, objectEquality); + + function isAllDefined(value) { + var allDefined = true; + forEach(value, function(val) { + if (!isDefined(val)) allDefined = false; + }); + return allDefined; + } + } + + function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) { + var unwatch; + return unwatch = scope.$watch(function constantWatch(scope) { + return parsedExpression(scope); + }, function constantListener(value, old, scope) { + if (isFunction(listener)) { + listener.apply(this, arguments); + } + unwatch(); + }, objectEquality); + } + + function addInterceptor(parsedExpression, interceptorFn) { + if (!interceptorFn) return parsedExpression; + var watchDelegate = parsedExpression.$$watchDelegate; + + var regularWatch = + watchDelegate !== oneTimeLiteralWatchDelegate && + watchDelegate !== oneTimeWatchDelegate; + + var fn = regularWatch ? function regularInterceptedExpression(scope, locals) { + var value = parsedExpression(scope, locals); + return interceptorFn(value, scope, locals); + } : function oneTimeInterceptedExpression(scope, locals) { + var value = parsedExpression(scope, locals); + var result = interceptorFn(value, scope, locals); + // we only return the interceptor's result if the + // initial value is defined (for bind-once) + return isDefined(value) ? result : value; + }; + + // Propagate $$watchDelegates other then inputsWatchDelegate + if (parsedExpression.$$watchDelegate && + parsedExpression.$$watchDelegate !== inputsWatchDelegate) { + fn.$$watchDelegate = parsedExpression.$$watchDelegate; + } else if (!interceptorFn.$stateful) { + // If there is an interceptor, but no watchDelegate then treat the interceptor like + // we treat filters - it is assumed to be a pure function unless flagged with $stateful + fn.$$watchDelegate = inputsWatchDelegate; + fn.inputs = [parsedExpression]; + } + + return fn; + } + }]; +} + +/** + * @ngdoc service + * @name $q + * @requires $rootScope + * + * @description + * A service that helps you run functions asynchronously, and use their return values (or exceptions) + * when they are done processing. + * + * This is an implementation of promises/deferred objects inspired by + * [Kris Kowal's Q](https://github.com/kriskowal/q). + * + * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred + * implementations, and the other which resembles ES6 promises to some degree. + * + * # $q constructor + * + * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver` + * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony, + * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). + * + * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are + * available yet. + * + * It can be used like so: + * + * ```js + * // for the purpose of this example let's assume that variables `$q` and `okToGreet` + * // are available in the current lexical scope (they could have been injected or passed in). + * + * function asyncGreet(name) { + * // perform some asynchronous operation, resolve or reject the promise when appropriate. + * return $q(function(resolve, reject) { + * setTimeout(function() { + * if (okToGreet(name)) { + * resolve('Hello, ' + name + '!'); + * } else { + * reject('Greeting ' + name + ' is not allowed.'); + * } + * }, 1000); + * }); + * } + * + * var promise = asyncGreet('Robin Hood'); + * promise.then(function(greeting) { + * alert('Success: ' + greeting); + * }, function(reason) { + * alert('Failed: ' + reason); + * }); + * ``` + * + * Note: progress/notify callbacks are not currently supported via the ES6-style interface. + * + * However, the more traditional CommonJS-style usage is still available, and documented below. + * + * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an + * interface for interacting with an object that represents the result of an action that is + * performed asynchronously, and may or may not be finished at any given point in time. + * + * From the perspective of dealing with error handling, deferred and promise APIs are to + * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming. + * + * ```js + * // for the purpose of this example let's assume that variables `$q` and `okToGreet` + * // are available in the current lexical scope (they could have been injected or passed in). + * + * function asyncGreet(name) { + * var deferred = $q.defer(); + * + * setTimeout(function() { + * deferred.notify('About to greet ' + name + '.'); + * + * if (okToGreet(name)) { + * deferred.resolve('Hello, ' + name + '!'); + * } else { + * deferred.reject('Greeting ' + name + ' is not allowed.'); + * } + * }, 1000); + * + * return deferred.promise; + * } + * + * var promise = asyncGreet('Robin Hood'); + * promise.then(function(greeting) { + * alert('Success: ' + greeting); + * }, function(reason) { + * alert('Failed: ' + reason); + * }, function(update) { + * alert('Got notification: ' + update); + * }); + * ``` + * + * At first it might not be obvious why this extra complexity is worth the trouble. The payoff + * comes in the way of guarantees that promise and deferred APIs make, see + * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md. + * + * Additionally the promise api allows for composition that is very hard to do with the + * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach. + * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the + * section on serial or parallel joining of promises. + * + * # The Deferred API + * + * A new instance of deferred is constructed by calling `$q.defer()`. + * + * The purpose of the deferred object is to expose the associated Promise instance as well as APIs + * that can be used for signaling the successful or unsuccessful completion, as well as the status + * of the task. + * + * **Methods** + * + * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection + * constructed via `$q.reject`, the promise will be rejected instead. + * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to + * resolving it with a rejection constructed via `$q.reject`. + * - `notify(value)` - provides updates on the status of the promise's execution. This may be called + * multiple times before the promise is either resolved or rejected. + * + * **Properties** + * + * - promise – `{Promise}` – promise object associated with this deferred. + * + * + * # The Promise API + * + * A new promise instance is created when a deferred instance is created and can be retrieved by + * calling `deferred.promise`. + * + * The purpose of the promise object is to allow for interested parties to get access to the result + * of the deferred task when it completes. + * + * **Methods** + * + * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or + * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously + * as soon as the result is available. The callbacks are called with a single argument: the result + * or rejection reason. Additionally, the notify callback may be called zero or more times to + * provide a progress indication, before the promise is resolved or rejected. + * + * This method *returns a new promise* which is resolved or rejected via the return value of the + * `successCallback`, `errorCallback`. It also notifies via the return value of the + * `notifyCallback` method. The promise cannot be resolved or rejected from the notifyCallback + * method. + * + * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)` + * + * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise, + * but to do so without modifying the final value. This is useful to release resources or do some + * clean-up that needs to be done whether the promise was rejected or resolved. See the [full + * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for + * more information. + * + * # Chaining promises + * + * Because calling the `then` method of a promise returns a new derived promise, it is easily + * possible to create a chain of promises: + * + * ```js + * promiseB = promiseA.then(function(result) { + * return result + 1; + * }); + * + * // promiseB will be resolved immediately after promiseA is resolved and its value + * // will be the result of promiseA incremented by 1 + * ``` + * + * It is possible to create chains of any length and since a promise can be resolved with another + * promise (which will defer its resolution further), it is possible to pause/defer resolution of + * the promises at any point in the chain. This makes it possible to implement powerful APIs like + * $http's response interceptors. + * + * + * # Differences between Kris Kowal's Q and $q + * + * There are two main differences: + * + * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation + * mechanism in angular, which means faster propagation of resolution or rejection into your + * models and avoiding unnecessary browser repaints, which would result in flickering UI. + * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains + * all the important functionality needed for common async tasks. + * + * # Testing + * + * ```js + * it('should simulate promise', inject(function($q, $rootScope) { + * var deferred = $q.defer(); + * var promise = deferred.promise; + * var resolvedValue; + * + * promise.then(function(value) { resolvedValue = value; }); + * expect(resolvedValue).toBeUndefined(); + * + * // Simulate resolving of promise + * deferred.resolve(123); + * // Note that the 'then' function does not get called synchronously. + * // This is because we want the promise API to always be async, whether or not + * // it got called synchronously or asynchronously. + * expect(resolvedValue).toBeUndefined(); + * + * // Propagate promise resolution to 'then' functions using $apply(). + * $rootScope.$apply(); + * expect(resolvedValue).toEqual(123); + * })); + * ``` + * + * @param {function(function, function)} resolver Function which is responsible for resolving or + * rejecting the newly created promise. The first parameter is a function which resolves the + * promise, the second parameter is a function which rejects the promise. + * + * @returns {Promise} The newly created promise. + */ +function $QProvider() { + + this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) { + return qFactory(function(callback) { + $rootScope.$evalAsync(callback); + }, $exceptionHandler); + }]; +} + +function $$QProvider() { + this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) { + return qFactory(function(callback) { + $browser.defer(callback); + }, $exceptionHandler); + }]; +} + +/** + * Constructs a promise manager. + * + * @param {function(function)} nextTick Function for executing functions in the next turn. + * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for + * debugging purposes. + * @returns {object} Promise manager. + */ +function qFactory(nextTick, exceptionHandler) { + var $qMinErr = minErr('$q', TypeError); + function callOnce(self, resolveFn, rejectFn) { + var called = false; + function wrap(fn) { + return function(value) { + if (called) return; + called = true; + fn.call(self, value); + }; + } + + return [wrap(resolveFn), wrap(rejectFn)]; + } + + /** + * @ngdoc method + * @name ng.$q#defer + * @kind function + * + * @description + * Creates a `Deferred` object which represents a task which will finish in the future. + * + * @returns {Deferred} Returns a new instance of deferred. + */ + var defer = function() { + return new Deferred(); + }; + + function Promise() { + this.$$state = { status: 0 }; + } + + Promise.prototype = { + then: function(onFulfilled, onRejected, progressBack) { + var result = new Deferred(); + + this.$$state.pending = this.$$state.pending || []; + this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]); + if (this.$$state.status > 0) scheduleProcessQueue(this.$$state); + + return result.promise; + }, + + "catch": function(callback) { + return this.then(null, callback); + }, + + "finally": function(callback, progressBack) { + return this.then(function(value) { + return handleCallback(value, true, callback); + }, function(error) { + return handleCallback(error, false, callback); + }, progressBack); + } + }; + + //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native + function simpleBind(context, fn) { + return function(value) { + fn.call(context, value); + }; + } + + function processQueue(state) { + var fn, promise, pending; + + pending = state.pending; + state.processScheduled = false; + state.pending = undefined; + for (var i = 0, ii = pending.length; i < ii; ++i) { + promise = pending[i][0]; + fn = pending[i][state.status]; + try { + if (isFunction(fn)) { + promise.resolve(fn(state.value)); + } else if (state.status === 1) { + promise.resolve(state.value); + } else { + promise.reject(state.value); + } + } catch (e) { + promise.reject(e); + exceptionHandler(e); + } + } + } + + function scheduleProcessQueue(state) { + if (state.processScheduled || !state.pending) return; + state.processScheduled = true; + nextTick(function() { processQueue(state); }); + } + + function Deferred() { + this.promise = new Promise(); + //Necessary to support unbound execution :/ + this.resolve = simpleBind(this, this.resolve); + this.reject = simpleBind(this, this.reject); + this.notify = simpleBind(this, this.notify); + } + + Deferred.prototype = { + resolve: function(val) { + if (this.promise.$$state.status) return; + if (val === this.promise) { + this.$$reject($qMinErr( + 'qcycle', + "Expected promise to be resolved with value other than itself '{0}'", + val)); + } else { + this.$$resolve(val); + } + + }, + + $$resolve: function(val) { + var then, fns; + + fns = callOnce(this, this.$$resolve, this.$$reject); + try { + if ((isObject(val) || isFunction(val))) then = val && val.then; + if (isFunction(then)) { + this.promise.$$state.status = -1; + then.call(val, fns[0], fns[1], this.notify); + } else { + this.promise.$$state.value = val; + this.promise.$$state.status = 1; + scheduleProcessQueue(this.promise.$$state); + } + } catch (e) { + fns[1](e); + exceptionHandler(e); + } + }, + + reject: function(reason) { + if (this.promise.$$state.status) return; + this.$$reject(reason); + }, + + $$reject: function(reason) { + this.promise.$$state.value = reason; + this.promise.$$state.status = 2; + scheduleProcessQueue(this.promise.$$state); + }, + + notify: function(progress) { + var callbacks = this.promise.$$state.pending; + + if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) { + nextTick(function() { + var callback, result; + for (var i = 0, ii = callbacks.length; i < ii; i++) { + result = callbacks[i][0]; + callback = callbacks[i][3]; + try { + result.notify(isFunction(callback) ? callback(progress) : progress); + } catch (e) { + exceptionHandler(e); + } + } + }); + } + } + }; + + /** + * @ngdoc method + * @name $q#reject + * @kind function + * + * @description + * Creates a promise that is resolved as rejected with the specified `reason`. This api should be + * used to forward rejection in a chain of promises. If you are dealing with the last promise in + * a promise chain, you don't need to worry about it. + * + * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of + * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via + * a promise error callback and you want to forward the error to the promise derived from the + * current promise, you have to "rethrow" the error by returning a rejection constructed via + * `reject`. + * + * ```js + * promiseB = promiseA.then(function(result) { + * // success: do something and resolve promiseB + * // with the old or a new result + * return result; + * }, function(reason) { + * // error: handle the error if possible and + * // resolve promiseB with newPromiseOrValue, + * // otherwise forward the rejection to promiseB + * if (canHandle(reason)) { + * // handle the error and recover + * return newPromiseOrValue; + * } + * return $q.reject(reason); + * }); + * ``` + * + * @param {*} reason Constant, message, exception or an object representing the rejection reason. + * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`. + */ + var reject = function(reason) { + var result = new Deferred(); + result.reject(reason); + return result.promise; + }; + + var makePromise = function makePromise(value, resolved) { + var result = new Deferred(); + if (resolved) { + result.resolve(value); + } else { + result.reject(value); + } + return result.promise; + }; + + var handleCallback = function handleCallback(value, isResolved, callback) { + var callbackOutput = null; + try { + if (isFunction(callback)) callbackOutput = callback(); + } catch (e) { + return makePromise(e, false); + } + if (isPromiseLike(callbackOutput)) { + return callbackOutput.then(function() { + return makePromise(value, isResolved); + }, function(error) { + return makePromise(error, false); + }); + } else { + return makePromise(value, isResolved); + } + }; + + /** + * @ngdoc method + * @name $q#when + * @kind function + * + * @description + * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. + * This is useful when you are dealing with an object that might or might not be a promise, or if + * the promise comes from a source that can't be trusted. + * + * @param {*} value Value or a promise + * @returns {Promise} Returns a promise of the passed value or promise + */ + + + var when = function(value, callback, errback, progressBack) { + var result = new Deferred(); + result.resolve(value); + return result.promise.then(callback, errback, progressBack); + }; + + /** + * @ngdoc method + * @name $q#all + * @kind function + * + * @description + * Combines multiple promises into a single promise that is resolved when all of the input + * promises are resolved. + * + * @param {Array.|Object.} promises An array or hash of promises. + * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values, + * each value corresponding to the promise at the same index/key in the `promises` array/hash. + * If any of the promises is resolved with a rejection, this resulting promise will be rejected + * with the same rejection value. + */ + + function all(promises) { + var deferred = new Deferred(), + counter = 0, + results = isArray(promises) ? [] : {}; + + forEach(promises, function(promise, key) { + counter++; + when(promise).then(function(value) { + if (results.hasOwnProperty(key)) return; + results[key] = value; + if (!(--counter)) deferred.resolve(results); + }, function(reason) { + if (results.hasOwnProperty(key)) return; + deferred.reject(reason); + }); + }); + + if (counter === 0) { + deferred.resolve(results); + } + + return deferred.promise; + } + + var $Q = function Q(resolver) { + if (!isFunction(resolver)) { + throw $qMinErr('norslvr', "Expected resolverFn, got '{0}'", resolver); + } + + if (!(this instanceof Q)) { + // More useful when $Q is the Promise itself. + return new Q(resolver); + } + + var deferred = new Deferred(); + + function resolveFn(value) { + deferred.resolve(value); + } + + function rejectFn(reason) { + deferred.reject(reason); + } + + resolver(resolveFn, rejectFn); + + return deferred.promise; + }; + + $Q.defer = defer; + $Q.reject = reject; + $Q.when = when; + $Q.all = all; + + return $Q; +} + +function $$RAFProvider() { //rAF + this.$get = ['$window', '$timeout', function($window, $timeout) { + var requestAnimationFrame = $window.requestAnimationFrame || + $window.webkitRequestAnimationFrame; + + var cancelAnimationFrame = $window.cancelAnimationFrame || + $window.webkitCancelAnimationFrame || + $window.webkitCancelRequestAnimationFrame; + + var rafSupported = !!requestAnimationFrame; + var rafFn = rafSupported + ? function(fn) { + var id = requestAnimationFrame(fn); + return function() { + cancelAnimationFrame(id); + }; + } + : function(fn) { + var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666 + return function() { + $timeout.cancel(timer); + }; + }; + + queueFn.supported = rafSupported; + + var cancelLastRAF; + var taskCount = 0; + var taskQueue = []; + return queueFn; + + function flush() { + for (var i = 0; i < taskQueue.length; i++) { + var task = taskQueue[i]; + if (task) { + taskQueue[i] = null; + task(); + } + } + taskCount = taskQueue.length = 0; + } + + function queueFn(asyncFn) { + var index = taskQueue.length; + + taskCount++; + taskQueue.push(asyncFn); + + if (index === 0) { + cancelLastRAF = rafFn(flush); + } + + return function cancelQueueFn() { + if (index >= 0) { + taskQueue[index] = null; + index = null; + + if (--taskCount === 0 && cancelLastRAF) { + cancelLastRAF(); + cancelLastRAF = null; + taskQueue.length = 0; + } + } + }; + } + }]; +} + +/** + * DESIGN NOTES + * + * The design decisions behind the scope are heavily favored for speed and memory consumption. + * + * The typical use of scope is to watch the expressions, which most of the time return the same + * value as last time so we optimize the operation. + * + * Closures construction is expensive in terms of speed as well as memory: + * - No closures, instead use prototypical inheritance for API + * - Internal state needs to be stored on scope directly, which means that private state is + * exposed as $$____ properties + * + * Loop operations are optimized by using while(count--) { ... } + * - this means that in order to keep the same order of execution as addition we have to add + * items to the array at the beginning (unshift) instead of at the end (push) + * + * Child scopes are created and removed often + * - Using an array would be slow since inserts in middle are expensive so we use linked list + * + * There are few watches then a lot of observers. This is why you don't want the observer to be + * implemented in the same way as watch. Watch requires return of initialization function which + * are expensive to construct. + */ + + +/** + * @ngdoc provider + * @name $rootScopeProvider + * @description + * + * Provider for the $rootScope service. + */ + +/** + * @ngdoc method + * @name $rootScopeProvider#digestTtl + * @description + * + * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and + * assuming that the model is unstable. + * + * The current default is 10 iterations. + * + * In complex applications it's possible that the dependencies between `$watch`s will result in + * several digest iterations. However if an application needs more than the default 10 digest + * iterations for its model to stabilize then you should investigate what is causing the model to + * continuously change during the digest. + * + * Increasing the TTL could have performance implications, so you should not change it without + * proper justification. + * + * @param {number} limit The number of digest iterations. + */ + + +/** + * @ngdoc service + * @name $rootScope + * @description + * + * Every application has a single root {@link ng.$rootScope.Scope scope}. + * All other scopes are descendant scopes of the root scope. Scopes provide separation + * between the model and the view, via a mechanism for watching the model for changes. + * They also provide an event emission/broadcast and subscription facility. See the + * {@link guide/scope developer guide on scopes}. + */ +function $RootScopeProvider() { + var TTL = 10; + var $rootScopeMinErr = minErr('$rootScope'); + var lastDirtyWatch = null; + var applyAsyncId = null; + + this.digestTtl = function(value) { + if (arguments.length) { + TTL = value; + } + return TTL; + }; + + function createChildScopeClass(parent) { + function ChildScope() { + this.$$watchers = this.$$nextSibling = + this.$$childHead = this.$$childTail = null; + this.$$listeners = {}; + this.$$listenerCount = {}; + this.$id = nextUid(); + this.$$ChildScope = null; + } + ChildScope.prototype = parent; + return ChildScope; + } + + this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser', + function($injector, $exceptionHandler, $parse, $browser) { + + function destroyChildScope($event) { + $event.currentScope.$$destroyed = true; + } + + /** + * @ngdoc type + * @name $rootScope.Scope + * + * @description + * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the + * {@link auto.$injector $injector}. Child scopes are created using the + * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when + * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for + * an in-depth introduction and usage examples. + * + * + * # Inheritance + * A scope can inherit from a parent scope, as in this example: + * ```js + var parent = $rootScope; + var child = parent.$new(); + + parent.salutation = "Hello"; + expect(child.salutation).toEqual('Hello'); + + child.salutation = "Welcome"; + expect(child.salutation).toEqual('Welcome'); + expect(parent.salutation).toEqual('Hello'); + * ``` + * + * When interacting with `Scope` in tests, additional helper methods are available on the + * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional + * details. + * + * + * @param {Object.=} providers Map of service factory which need to be + * provided for the current scope. Defaults to {@link ng}. + * @param {Object.=} instanceCache Provides pre-instantiated services which should + * append/override services provided by `providers`. This is handy + * when unit-testing and having the need to override a default + * service. + * @returns {Object} Newly created scope. + * + */ + function Scope() { + this.$id = nextUid(); + this.$$phase = this.$parent = this.$$watchers = + this.$$nextSibling = this.$$prevSibling = + this.$$childHead = this.$$childTail = null; + this.$root = this; + this.$$destroyed = false; + this.$$listeners = {}; + this.$$listenerCount = {}; + this.$$isolateBindings = null; + } + + /** + * @ngdoc property + * @name $rootScope.Scope#$id + * + * @description + * Unique scope ID (monotonically increasing) useful for debugging. + */ + + /** + * @ngdoc property + * @name $rootScope.Scope#$parent + * + * @description + * Reference to the parent scope. + */ + + /** + * @ngdoc property + * @name $rootScope.Scope#$root + * + * @description + * Reference to the root scope. + */ + + Scope.prototype = { + constructor: Scope, + /** + * @ngdoc method + * @name $rootScope.Scope#$new + * @kind function + * + * @description + * Creates a new child {@link ng.$rootScope.Scope scope}. + * + * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event. + * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}. + * + * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is + * desired for the scope and its child scopes to be permanently detached from the parent and + * thus stop participating in model change detection and listener notification by invoking. + * + * @param {boolean} isolate If true, then the scope does not prototypically inherit from the + * parent scope. The scope is isolated, as it can not see parent scope properties. + * When creating widgets, it is useful for the widget to not accidentally read parent + * state. + * + * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent` + * of the newly created scope. Defaults to `this` scope if not provided. + * This is used when creating a transclude scope to correctly place it + * in the scope hierarchy while maintaining the correct prototypical + * inheritance. + * + * @returns {Object} The newly created child scope. + * + */ + $new: function(isolate, parent) { + var child; + + parent = parent || this; + + if (isolate) { + child = new Scope(); + child.$root = this.$root; + } else { + // Only create a child scope class if somebody asks for one, + // but cache it to allow the VM to optimize lookups. + if (!this.$$ChildScope) { + this.$$ChildScope = createChildScopeClass(this); + } + child = new this.$$ChildScope(); + } + child.$parent = parent; + child.$$prevSibling = parent.$$childTail; + if (parent.$$childHead) { + parent.$$childTail.$$nextSibling = child; + parent.$$childTail = child; + } else { + parent.$$childHead = parent.$$childTail = child; + } + + // When the new scope is not isolated or we inherit from `this`, and + // the parent scope is destroyed, the property `$$destroyed` is inherited + // prototypically. In all other cases, this property needs to be set + // when the parent scope is destroyed. + // The listener needs to be added after the parent is set + if (isolate || parent != this) child.$on('$destroy', destroyChildScope); + + return child; + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$watch + * @kind function + * + * @description + * Registers a `listener` callback to be executed whenever the `watchExpression` changes. + * + * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest + * $digest()} and should return the value that will be watched. (Since + * {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the + * `watchExpression` can execute multiple times per + * {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.) + * - The `listener` is called only when the value from the current `watchExpression` and the + * previous call to `watchExpression` are not equal (with the exception of the initial run, + * see below). Inequality is determined according to reference inequality, + * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators) + * via the `!==` Javascript operator, unless `objectEquality == true` + * (see next point) + * - When `objectEquality == true`, inequality of the `watchExpression` is determined + * according to the {@link angular.equals} function. To save the value of the object for + * later comparison, the {@link angular.copy} function is used. This therefore means that + * watching complex objects will have adverse memory and performance implications. + * - The watch `listener` may change the model, which may trigger other `listener`s to fire. + * This is achieved by rerunning the watchers until no changes are detected. The rerun + * iteration limit is 10 to prevent an infinite loop deadlock. + * + * + * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called, + * you can register a `watchExpression` function with no `listener`. (Be prepared for + * multiple calls to your `watchExpression` because it will execute multiple times in a + * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.) + * + * After a watcher is registered with the scope, the `listener` fn is called asynchronously + * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the + * watcher. In rare cases, this is undesirable because the listener is called when the result + * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you + * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the + * listener was called due to initialization. + * + * + * + * # Example + * ```js + // let's assume that scope was dependency injected as the $rootScope + var scope = $rootScope; + scope.name = 'misko'; + scope.counter = 0; + + expect(scope.counter).toEqual(0); + scope.$watch('name', function(newValue, oldValue) { + scope.counter = scope.counter + 1; + }); + expect(scope.counter).toEqual(0); + + scope.$digest(); + // the listener is always called during the first $digest loop after it was registered + expect(scope.counter).toEqual(1); + + scope.$digest(); + // but now it will not be called unless the value changes + expect(scope.counter).toEqual(1); + + scope.name = 'adam'; + scope.$digest(); + expect(scope.counter).toEqual(2); + + + + // Using a function as a watchExpression + var food; + scope.foodCounter = 0; + expect(scope.foodCounter).toEqual(0); + scope.$watch( + // This function returns the value being watched. It is called for each turn of the $digest loop + function() { return food; }, + // This is the change listener, called when the value returned from the above function changes + function(newValue, oldValue) { + if ( newValue !== oldValue ) { + // Only increment the counter if the value changed + scope.foodCounter = scope.foodCounter + 1; + } + } + ); + // No digest has been run so the counter will be zero + expect(scope.foodCounter).toEqual(0); + + // Run the digest but since food has not changed count will still be zero + scope.$digest(); + expect(scope.foodCounter).toEqual(0); + + // Update food and run digest. Now the counter will increment + food = 'cheeseburger'; + scope.$digest(); + expect(scope.foodCounter).toEqual(1); + + * ``` + * + * + * + * @param {(function()|string)} watchExpression Expression that is evaluated on each + * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers + * a call to the `listener`. + * + * - `string`: Evaluated as {@link guide/expression expression} + * - `function(scope)`: called with current `scope` as a parameter. + * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value + * of `watchExpression` changes. + * + * - `newVal` contains the current value of the `watchExpression` + * - `oldVal` contains the previous value of the `watchExpression` + * - `scope` refers to the current scope + * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of + * comparing for reference equality. + * @returns {function()} Returns a deregistration function for this listener. + */ + $watch: function(watchExp, listener, objectEquality) { + var get = $parse(watchExp); + + if (get.$$watchDelegate) { + return get.$$watchDelegate(this, listener, objectEquality, get); + } + var scope = this, + array = scope.$$watchers, + watcher = { + fn: listener, + last: initWatchVal, + get: get, + exp: watchExp, + eq: !!objectEquality + }; + + lastDirtyWatch = null; + + if (!isFunction(listener)) { + watcher.fn = noop; + } + + if (!array) { + array = scope.$$watchers = []; + } + // we use unshift since we use a while loop in $digest for speed. + // the while loop reads in reverse order. + array.unshift(watcher); + + return function deregisterWatch() { + arrayRemove(array, watcher); + lastDirtyWatch = null; + }; + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$watchGroup + * @kind function + * + * @description + * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`. + * If any one expression in the collection changes the `listener` is executed. + * + * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every + * call to $digest() to see if any items changes. + * - The `listener` is called whenever any expression in the `watchExpressions` array changes. + * + * @param {Array.} watchExpressions Array of expressions that will be individually + * watched using {@link ng.$rootScope.Scope#$watch $watch()} + * + * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any + * expression in `watchExpressions` changes + * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching + * those of `watchExpression` + * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching + * those of `watchExpression` + * The `scope` refers to the current scope. + * @returns {function()} Returns a de-registration function for all listeners. + */ + $watchGroup: function(watchExpressions, listener) { + var oldValues = new Array(watchExpressions.length); + var newValues = new Array(watchExpressions.length); + var deregisterFns = []; + var self = this; + var changeReactionScheduled = false; + var firstRun = true; + + if (!watchExpressions.length) { + // No expressions means we call the listener ASAP + var shouldCall = true; + self.$evalAsync(function() { + if (shouldCall) listener(newValues, newValues, self); + }); + return function deregisterWatchGroup() { + shouldCall = false; + }; + } + + if (watchExpressions.length === 1) { + // Special case size of one + return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) { + newValues[0] = value; + oldValues[0] = oldValue; + listener(newValues, (value === oldValue) ? newValues : oldValues, scope); + }); + } + + forEach(watchExpressions, function(expr, i) { + var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) { + newValues[i] = value; + oldValues[i] = oldValue; + if (!changeReactionScheduled) { + changeReactionScheduled = true; + self.$evalAsync(watchGroupAction); + } + }); + deregisterFns.push(unwatchFn); + }); + + function watchGroupAction() { + changeReactionScheduled = false; + + if (firstRun) { + firstRun = false; + listener(newValues, newValues, self); + } else { + listener(newValues, oldValues, self); + } + } + + return function deregisterWatchGroup() { + while (deregisterFns.length) { + deregisterFns.shift()(); + } + }; + }, + + + /** + * @ngdoc method + * @name $rootScope.Scope#$watchCollection + * @kind function + * + * @description + * Shallow watches the properties of an object and fires whenever any of the properties change + * (for arrays, this implies watching the array items; for object maps, this implies watching + * the properties). If a change is detected, the `listener` callback is fired. + * + * - The `obj` collection is observed via standard $watch operation and is examined on every + * call to $digest() to see if any items have been added, removed, or moved. + * - The `listener` is called whenever anything within the `obj` has changed. Examples include + * adding, removing, and moving items belonging to an object or array. + * + * + * # Example + * ```js + $scope.names = ['igor', 'matias', 'misko', 'james']; + $scope.dataCount = 4; + + $scope.$watchCollection('names', function(newNames, oldNames) { + $scope.dataCount = newNames.length; + }); + + expect($scope.dataCount).toEqual(4); + $scope.$digest(); + + //still at 4 ... no changes + expect($scope.dataCount).toEqual(4); + + $scope.names.pop(); + $scope.$digest(); + + //now there's been a change + expect($scope.dataCount).toEqual(3); + * ``` + * + * + * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The + * expression value should evaluate to an object or an array which is observed on each + * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the + * collection will trigger a call to the `listener`. + * + * @param {function(newCollection, oldCollection, scope)} listener a callback function called + * when a change is detected. + * - The `newCollection` object is the newly modified data obtained from the `obj` expression + * - The `oldCollection` object is a copy of the former collection data. + * Due to performance considerations, the`oldCollection` value is computed only if the + * `listener` function declares two or more arguments. + * - The `scope` argument refers to the current scope. + * + * @returns {function()} Returns a de-registration function for this listener. When the + * de-registration function is executed, the internal watch operation is terminated. + */ + $watchCollection: function(obj, listener) { + $watchCollectionInterceptor.$stateful = true; + + var self = this; + // the current value, updated on each dirty-check run + var newValue; + // a shallow copy of the newValue from the last dirty-check run, + // updated to match newValue during dirty-check run + var oldValue; + // a shallow copy of the newValue from when the last change happened + var veryOldValue; + // only track veryOldValue if the listener is asking for it + var trackVeryOldValue = (listener.length > 1); + var changeDetected = 0; + var changeDetector = $parse(obj, $watchCollectionInterceptor); + var internalArray = []; + var internalObject = {}; + var initRun = true; + var oldLength = 0; + + function $watchCollectionInterceptor(_value) { + newValue = _value; + var newLength, key, bothNaN, newItem, oldItem; + + // If the new value is undefined, then return undefined as the watch may be a one-time watch + if (isUndefined(newValue)) return; + + if (!isObject(newValue)) { // if primitive + if (oldValue !== newValue) { + oldValue = newValue; + changeDetected++; + } + } else if (isArrayLike(newValue)) { + if (oldValue !== internalArray) { + // we are transitioning from something which was not an array into array. + oldValue = internalArray; + oldLength = oldValue.length = 0; + changeDetected++; + } + + newLength = newValue.length; + + if (oldLength !== newLength) { + // if lengths do not match we need to trigger change notification + changeDetected++; + oldValue.length = oldLength = newLength; + } + // copy the items to oldValue and look for changes. + for (var i = 0; i < newLength; i++) { + oldItem = oldValue[i]; + newItem = newValue[i]; + + bothNaN = (oldItem !== oldItem) && (newItem !== newItem); + if (!bothNaN && (oldItem !== newItem)) { + changeDetected++; + oldValue[i] = newItem; + } + } + } else { + if (oldValue !== internalObject) { + // we are transitioning from something which was not an object into object. + oldValue = internalObject = {}; + oldLength = 0; + changeDetected++; + } + // copy the items to oldValue and look for changes. + newLength = 0; + for (key in newValue) { + if (newValue.hasOwnProperty(key)) { + newLength++; + newItem = newValue[key]; + oldItem = oldValue[key]; + + if (key in oldValue) { + bothNaN = (oldItem !== oldItem) && (newItem !== newItem); + if (!bothNaN && (oldItem !== newItem)) { + changeDetected++; + oldValue[key] = newItem; + } + } else { + oldLength++; + oldValue[key] = newItem; + changeDetected++; + } + } + } + if (oldLength > newLength) { + // we used to have more keys, need to find them and destroy them. + changeDetected++; + for (key in oldValue) { + if (!newValue.hasOwnProperty(key)) { + oldLength--; + delete oldValue[key]; + } + } + } + } + return changeDetected; + } + + function $watchCollectionAction() { + if (initRun) { + initRun = false; + listener(newValue, newValue, self); + } else { + listener(newValue, veryOldValue, self); + } + + // make a copy for the next time a collection is changed + if (trackVeryOldValue) { + if (!isObject(newValue)) { + //primitive + veryOldValue = newValue; + } else if (isArrayLike(newValue)) { + veryOldValue = new Array(newValue.length); + for (var i = 0; i < newValue.length; i++) { + veryOldValue[i] = newValue[i]; + } + } else { // if object + veryOldValue = {}; + for (var key in newValue) { + if (hasOwnProperty.call(newValue, key)) { + veryOldValue[key] = newValue[key]; + } + } + } + } + } + + return this.$watch(changeDetector, $watchCollectionAction); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$digest + * @kind function + * + * @description + * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and + * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change + * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} + * until no more listeners are firing. This means that it is possible to get into an infinite + * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of + * iterations exceeds 10. + * + * Usually, you don't call `$digest()` directly in + * {@link ng.directive:ngController controllers} or in + * {@link ng.$compileProvider#directive directives}. + * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within + * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`. + * + * If you want to be notified whenever `$digest()` is called, + * you can register a `watchExpression` function with + * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`. + * + * In unit tests, you may need to call `$digest()` to simulate the scope life cycle. + * + * # Example + * ```js + var scope = ...; + scope.name = 'misko'; + scope.counter = 0; + + expect(scope.counter).toEqual(0); + scope.$watch('name', function(newValue, oldValue) { + scope.counter = scope.counter + 1; + }); + expect(scope.counter).toEqual(0); + + scope.$digest(); + // the listener is always called during the first $digest loop after it was registered + expect(scope.counter).toEqual(1); + + scope.$digest(); + // but now it will not be called unless the value changes + expect(scope.counter).toEqual(1); + + scope.name = 'adam'; + scope.$digest(); + expect(scope.counter).toEqual(2); + * ``` + * + */ + $digest: function() { + var watch, value, last, + watchers, + length, + dirty, ttl = TTL, + next, current, target = this, + watchLog = [], + logIdx, logMsg, asyncTask; + + beginPhase('$digest'); + // Check for changes to browser url that happened in sync before the call to $digest + $browser.$$checkUrlChange(); + + if (this === $rootScope && applyAsyncId !== null) { + // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then + // cancel the scheduled $apply and flush the queue of expressions to be evaluated. + $browser.defer.cancel(applyAsyncId); + flushApplyAsync(); + } + + lastDirtyWatch = null; + + do { // "while dirty" loop + dirty = false; + current = target; + + while (asyncQueue.length) { + try { + asyncTask = asyncQueue.shift(); + asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals); + } catch (e) { + $exceptionHandler(e); + } + lastDirtyWatch = null; + } + + traverseScopesLoop: + do { // "traverse the scopes" loop + if ((watchers = current.$$watchers)) { + // process our watches + length = watchers.length; + while (length--) { + try { + watch = watchers[length]; + // Most common watches are on primitives, in which case we can short + // circuit it with === operator, only when === fails do we use .equals + if (watch) { + if ((value = watch.get(current)) !== (last = watch.last) && + !(watch.eq + ? equals(value, last) + : (typeof value === 'number' && typeof last === 'number' + && isNaN(value) && isNaN(last)))) { + dirty = true; + lastDirtyWatch = watch; + watch.last = watch.eq ? copy(value, null) : value; + watch.fn(value, ((last === initWatchVal) ? value : last), current); + if (ttl < 5) { + logIdx = 4 - ttl; + if (!watchLog[logIdx]) watchLog[logIdx] = []; + watchLog[logIdx].push({ + msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp, + newVal: value, + oldVal: last + }); + } + } else if (watch === lastDirtyWatch) { + // If the most recently dirty watcher is now clean, short circuit since the remaining watchers + // have already been tested. + dirty = false; + break traverseScopesLoop; + } + } + } catch (e) { + $exceptionHandler(e); + } + } + } + + // Insanity Warning: scope depth-first traversal + // yes, this code is a bit crazy, but it works and we have tests to prove it! + // this piece should be kept in sync with the traversal in $broadcast + if (!(next = (current.$$childHead || + (current !== target && current.$$nextSibling)))) { + while (current !== target && !(next = current.$$nextSibling)) { + current = current.$parent; + } + } + } while ((current = next)); + + // `break traverseScopesLoop;` takes us to here + + if ((dirty || asyncQueue.length) && !(ttl--)) { + clearPhase(); + throw $rootScopeMinErr('infdig', + '{0} $digest() iterations reached. Aborting!\n' + + 'Watchers fired in the last 5 iterations: {1}', + TTL, watchLog); + } + + } while (dirty || asyncQueue.length); + + clearPhase(); + + while (postDigestQueue.length) { + try { + postDigestQueue.shift()(); + } catch (e) { + $exceptionHandler(e); + } + } + }, + + + /** + * @ngdoc event + * @name $rootScope.Scope#$destroy + * @eventType broadcast on scope being destroyed + * + * @description + * Broadcasted when a scope and its children are being destroyed. + * + * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to + * clean up DOM bindings before an element is removed from the DOM. + */ + + /** + * @ngdoc method + * @name $rootScope.Scope#$destroy + * @kind function + * + * @description + * Removes the current scope (and all of its children) from the parent scope. Removal implies + * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer + * propagate to the current scope and its children. Removal also implies that the current + * scope is eligible for garbage collection. + * + * The `$destroy()` is usually used by directives such as + * {@link ng.directive:ngRepeat ngRepeat} for managing the + * unrolling of the loop. + * + * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. + * Application code can register a `$destroy` event handler that will give it a chance to + * perform any necessary cleanup. + * + * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to + * clean up DOM bindings before an element is removed from the DOM. + */ + $destroy: function() { + // we can't destroy the root scope or a scope that has been already destroyed + if (this.$$destroyed) return; + var parent = this.$parent; + + this.$broadcast('$destroy'); + this.$$destroyed = true; + if (this === $rootScope) return; + + for (var eventName in this.$$listenerCount) { + decrementListenerCount(this, this.$$listenerCount[eventName], eventName); + } + + // sever all the references to parent scopes (after this cleanup, the current scope should + // not be retained by any of our references and should be eligible for garbage collection) + if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling; + if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling; + if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling; + if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling; + + // Disable listeners, watchers and apply/digest methods + this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop; + this.$on = this.$watch = this.$watchGroup = function() { return noop; }; + this.$$listeners = {}; + + // All of the code below is bogus code that works around V8's memory leak via optimized code + // and inline caches. + // + // see: + // - https://code.google.com/p/v8/issues/detail?id=2073#c26 + // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909 + // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 + + this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = + this.$$childTail = this.$root = this.$$watchers = null; + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$eval + * @kind function + * + * @description + * Executes the `expression` on the current scope and returns the result. Any exceptions in + * the expression are propagated (uncaught). This is useful when evaluating Angular + * expressions. + * + * # Example + * ```js + var scope = ng.$rootScope.Scope(); + scope.a = 1; + scope.b = 2; + + expect(scope.$eval('a+b')).toEqual(3); + expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3); + * ``` + * + * @param {(string|function())=} expression An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with the current `scope` parameter. + * + * @param {(object)=} locals Local variables object, useful for overriding values in scope. + * @returns {*} The result of evaluating the expression. + */ + $eval: function(expr, locals) { + return $parse(expr)(this, locals); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$evalAsync + * @kind function + * + * @description + * Executes the expression on the current scope at a later point in time. + * + * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only + * that: + * + * - it will execute after the function that scheduled the evaluation (preferably before DOM + * rendering). + * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after + * `expression` execution. + * + * Any exceptions from the execution of the expression are forwarded to the + * {@link ng.$exceptionHandler $exceptionHandler} service. + * + * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle + * will be scheduled. However, it is encouraged to always call code that changes the model + * from within an `$apply` call. That includes code evaluated via `$evalAsync`. + * + * @param {(string|function())=} expression An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with the current `scope` parameter. + * + * @param {(object)=} locals Local variables object, useful for overriding values in scope. + */ + $evalAsync: function(expr, locals) { + // if we are outside of an $digest loop and this is the first time we are scheduling async + // task also schedule async auto-flush + if (!$rootScope.$$phase && !asyncQueue.length) { + $browser.defer(function() { + if (asyncQueue.length) { + $rootScope.$digest(); + } + }); + } + + asyncQueue.push({scope: this, expression: expr, locals: locals}); + }, + + $$postDigest: function(fn) { + postDigestQueue.push(fn); + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$apply + * @kind function + * + * @description + * `$apply()` is used to execute an expression in angular from outside of the angular + * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries). + * Because we are calling into the angular framework we need to perform proper scope life + * cycle of {@link ng.$exceptionHandler exception handling}, + * {@link ng.$rootScope.Scope#$digest executing watches}. + * + * ## Life cycle + * + * # Pseudo-Code of `$apply()` + * ```js + function $apply(expr) { + try { + return $eval(expr); + } catch (e) { + $exceptionHandler(e); + } finally { + $root.$digest(); + } + } + * ``` + * + * + * Scope's `$apply()` method transitions through the following stages: + * + * 1. The {@link guide/expression expression} is executed using the + * {@link ng.$rootScope.Scope#$eval $eval()} method. + * 2. Any exceptions from the execution of the expression are forwarded to the + * {@link ng.$exceptionHandler $exceptionHandler} service. + * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the + * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. + * + * + * @param {(string|function())=} exp An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with current `scope` parameter. + * + * @returns {*} The result of evaluating the expression. + */ + $apply: function(expr) { + try { + beginPhase('$apply'); + return this.$eval(expr); + } catch (e) { + $exceptionHandler(e); + } finally { + clearPhase(); + try { + $rootScope.$digest(); + } catch (e) { + $exceptionHandler(e); + throw e; + } + } + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$applyAsync + * @kind function + * + * @description + * Schedule the invocation of $apply to occur at a later time. The actual time difference + * varies across browsers, but is typically around ~10 milliseconds. + * + * This can be used to queue up multiple expressions which need to be evaluated in the same + * digest. + * + * @param {(string|function())=} exp An angular expression to be executed. + * + * - `string`: execute using the rules as defined in {@link guide/expression expression}. + * - `function(scope)`: execute the function with current `scope` parameter. + */ + $applyAsync: function(expr) { + var scope = this; + expr && applyAsyncQueue.push($applyAsyncExpression); + scheduleApplyAsync(); + + function $applyAsyncExpression() { + scope.$eval(expr); + } + }, + + /** + * @ngdoc method + * @name $rootScope.Scope#$on + * @kind function + * + * @description + * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for + * discussion of event life cycle. + * + * The event listener function format is: `function(event, args...)`. The `event` object + * passed into the listener has the following attributes: + * + * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or + * `$broadcast`-ed. + * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the + * event propagates through the scope hierarchy, this property is set to null. + * - `name` - `{string}`: name of the event. + * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel + * further event propagation (available only for events that were `$emit`-ed). + * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag + * to true. + * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called. + * + * @param {string} name Event name to listen on. + * @param {function(event, ...args)} listener Function to call when the event is emitted. + * @returns {function()} Returns a deregistration function for this listener. + */ + $on: function(name, listener) { + var namedListeners = this.$$listeners[name]; + if (!namedListeners) { + this.$$listeners[name] = namedListeners = []; + } + namedListeners.push(listener); + + var current = this; + do { + if (!current.$$listenerCount[name]) { + current.$$listenerCount[name] = 0; + } + current.$$listenerCount[name]++; + } while ((current = current.$parent)); + + var self = this; + return function() { + var indexOfListener = namedListeners.indexOf(listener); + if (indexOfListener !== -1) { + namedListeners[indexOfListener] = null; + decrementListenerCount(self, 1, name); + } + }; + }, + + + /** + * @ngdoc method + * @name $rootScope.Scope#$emit + * @kind function + * + * @description + * Dispatches an event `name` upwards through the scope hierarchy notifying the + * registered {@link ng.$rootScope.Scope#$on} listeners. + * + * The event life cycle starts at the scope on which `$emit` was called. All + * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get + * notified. Afterwards, the event traverses upwards toward the root scope and calls all + * registered listeners along the way. The event will stop propagating if one of the listeners + * cancels it. + * + * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed + * onto the {@link ng.$exceptionHandler $exceptionHandler} service. + * + * @param {string} name Event name to emit. + * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. + * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}). + */ + $emit: function(name, args) { + var empty = [], + namedListeners, + scope = this, + stopPropagation = false, + event = { + name: name, + targetScope: scope, + stopPropagation: function() {stopPropagation = true;}, + preventDefault: function() { + event.defaultPrevented = true; + }, + defaultPrevented: false + }, + listenerArgs = concat([event], arguments, 1), + i, length; + + do { + namedListeners = scope.$$listeners[name] || empty; + event.currentScope = scope; + for (i = 0, length = namedListeners.length; i < length; i++) { + + // if listeners were deregistered, defragment the array + if (!namedListeners[i]) { + namedListeners.splice(i, 1); + i--; + length--; + continue; + } + try { + //allow all listeners attached to the current scope to run + namedListeners[i].apply(null, listenerArgs); + } catch (e) { + $exceptionHandler(e); + } + } + //if any listener on the current scope stops propagation, prevent bubbling + if (stopPropagation) { + event.currentScope = null; + return event; + } + //traverse upwards + scope = scope.$parent; + } while (scope); + + event.currentScope = null; + + return event; + }, + + + /** + * @ngdoc method + * @name $rootScope.Scope#$broadcast + * @kind function + * + * @description + * Dispatches an event `name` downwards to all child scopes (and their children) notifying the + * registered {@link ng.$rootScope.Scope#$on} listeners. + * + * The event life cycle starts at the scope on which `$broadcast` was called. All + * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get + * notified. Afterwards, the event propagates to all direct and indirect scopes of the current + * scope and calls all registered listeners along the way. The event cannot be canceled. + * + * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed + * onto the {@link ng.$exceptionHandler $exceptionHandler} service. + * + * @param {string} name Event name to broadcast. + * @param {...*} args Optional one or more arguments which will be passed onto the event listeners. + * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on} + */ + $broadcast: function(name, args) { + var target = this, + current = target, + next = target, + event = { + name: name, + targetScope: target, + preventDefault: function() { + event.defaultPrevented = true; + }, + defaultPrevented: false + }; + + if (!target.$$listenerCount[name]) return event; + + var listenerArgs = concat([event], arguments, 1), + listeners, i, length; + + //down while you can, then up and next sibling or up and next sibling until back at root + while ((current = next)) { + event.currentScope = current; + listeners = current.$$listeners[name] || []; + for (i = 0, length = listeners.length; i < length; i++) { + // if listeners were deregistered, defragment the array + if (!listeners[i]) { + listeners.splice(i, 1); + i--; + length--; + continue; + } + + try { + listeners[i].apply(null, listenerArgs); + } catch (e) { + $exceptionHandler(e); + } + } + + // Insanity Warning: scope depth-first traversal + // yes, this code is a bit crazy, but it works and we have tests to prove it! + // this piece should be kept in sync with the traversal in $digest + // (though it differs due to having the extra check for $$listenerCount) + if (!(next = ((current.$$listenerCount[name] && current.$$childHead) || + (current !== target && current.$$nextSibling)))) { + while (current !== target && !(next = current.$$nextSibling)) { + current = current.$parent; + } + } + } + + event.currentScope = null; + return event; + } + }; + + var $rootScope = new Scope(); + + //The internal queues. Expose them on the $rootScope for debugging/testing purposes. + var asyncQueue = $rootScope.$$asyncQueue = []; + var postDigestQueue = $rootScope.$$postDigestQueue = []; + var applyAsyncQueue = $rootScope.$$applyAsyncQueue = []; + + return $rootScope; + + + function beginPhase(phase) { + if ($rootScope.$$phase) { + throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase); + } + + $rootScope.$$phase = phase; + } + + function clearPhase() { + $rootScope.$$phase = null; + } + + + function decrementListenerCount(current, count, name) { + do { + current.$$listenerCount[name] -= count; + + if (current.$$listenerCount[name] === 0) { + delete current.$$listenerCount[name]; + } + } while ((current = current.$parent)); + } + + /** + * function used as an initial value for watchers. + * because it's unique we can easily tell it apart from other values + */ + function initWatchVal() {} + + function flushApplyAsync() { + while (applyAsyncQueue.length) { + try { + applyAsyncQueue.shift()(); + } catch (e) { + $exceptionHandler(e); + } + } + applyAsyncId = null; + } + + function scheduleApplyAsync() { + if (applyAsyncId === null) { + applyAsyncId = $browser.defer(function() { + $rootScope.$apply(flushApplyAsync); + }); + } + } + }]; +} + +/** + * @description + * Private service to sanitize uris for links and images. Used by $compile and $sanitize. + */ +function $$SanitizeUriProvider() { + var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/, + imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; + + /** + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during a[href] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to a[href] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.aHrefSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + aHrefSanitizationWhitelist = regexp; + return this; + } + return aHrefSanitizationWhitelist; + }; + + + /** + * @description + * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * urls during img[src] sanitization. + * + * The sanitization is a security measure aimed at prevent XSS attacks via html links. + * + * Any url about to be assigned to img[src] via data-binding is first normalized and turned into + * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist` + * regular expression. If a match is found, the original url is written into the dom. Otherwise, + * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM. + * + * @param {RegExp=} regexp New regexp to whitelist urls with. + * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for + * chaining otherwise. + */ + this.imgSrcSanitizationWhitelist = function(regexp) { + if (isDefined(regexp)) { + imgSrcSanitizationWhitelist = regexp; + return this; + } + return imgSrcSanitizationWhitelist; + }; + + this.$get = function() { + return function sanitizeUri(uri, isImage) { + var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; + var normalizedVal; + normalizedVal = urlResolve(uri).href; + if (normalizedVal !== '' && !normalizedVal.match(regex)) { + return 'unsafe:' + normalizedVal; + } + return uri; + }; + }; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Any commits to this file should be reviewed with security in mind. * + * Changes to this file can potentially create security vulnerabilities. * + * An approval from 2 Core members with history of modifying * + * this file is required. * + * * + * Does the change somehow allow for arbitrary javascript to be executed? * + * Or allows for someone to change the prototype of built-in objects? * + * Or gives undesired access to variables likes document or window? * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +var $sceMinErr = minErr('$sce'); + +var SCE_CONTEXTS = { + HTML: 'html', + CSS: 'css', + URL: 'url', + // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a + // url. (e.g. ng-include, script src, templateUrl) + RESOURCE_URL: 'resourceUrl', + JS: 'js' +}; + +// Helper functions follow. + +function adjustMatcher(matcher) { + if (matcher === 'self') { + return matcher; + } else if (isString(matcher)) { + // Strings match exactly except for 2 wildcards - '*' and '**'. + // '*' matches any character except those from the set ':/.?&'. + // '**' matches any character (like .* in a RegExp). + // More than 2 *'s raises an error as it's ill defined. + if (matcher.indexOf('***') > -1) { + throw $sceMinErr('iwcard', + 'Illegal sequence *** in string matcher. String: {0}', matcher); + } + matcher = escapeForRegexp(matcher). + replace('\\*\\*', '.*'). + replace('\\*', '[^:/.?&;]*'); + return new RegExp('^' + matcher + '$'); + } else if (isRegExp(matcher)) { + // The only other type of matcher allowed is a Regexp. + // Match entire URL / disallow partial matches. + // Flags are reset (i.e. no global, ignoreCase or multiline) + return new RegExp('^' + matcher.source + '$'); + } else { + throw $sceMinErr('imatcher', + 'Matchers may only be "self", string patterns or RegExp objects'); + } +} + + +function adjustMatchers(matchers) { + var adjustedMatchers = []; + if (isDefined(matchers)) { + forEach(matchers, function(matcher) { + adjustedMatchers.push(adjustMatcher(matcher)); + }); + } + return adjustedMatchers; +} + + +/** + * @ngdoc service + * @name $sceDelegate + * @kind function + * + * @description + * + * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict + * Contextual Escaping (SCE)} services to AngularJS. + * + * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of + * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is + * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to + * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things + * work because `$sce` delegates to `$sceDelegate` for these operations. + * + * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service. + * + * The default instance of `$sceDelegate` should work out of the box with little pain. While you + * can override it completely to change the behavior of `$sce`, the common case would + * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting + * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as + * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist + * $sceDelegateProvider.resourceUrlWhitelist} and {@link + * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} + */ + +/** + * @ngdoc provider + * @name $sceDelegateProvider + * @description + * + * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate + * $sceDelegate} service. This allows one to get/set the whitelists and blacklists used to ensure + * that the URLs used for sourcing Angular templates are safe. Refer {@link + * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and + * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} + * + * For the general details about this service in Angular, read the main page for {@link ng.$sce + * Strict Contextual Escaping (SCE)}. + * + * **Example**: Consider the following case. + * + * - your app is hosted at url `http://myapp.example.com/` + * - but some of your templates are hosted on other domains you control such as + * `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc. + * - and you have an open redirect at `http://myapp.example.com/clickThru?...`. + * + * Here is what a secure configuration for this scenario might look like: + * + * ``` + * angular.module('myApp', []).config(function($sceDelegateProvider) { + * $sceDelegateProvider.resourceUrlWhitelist([ + * // Allow same origin resource loads. + * 'self', + * // Allow loading from our assets domain. Notice the difference between * and **. + * 'http://srv*.assets.example.com/**' + * ]); + * + * // The blacklist overrides the whitelist so the open redirect here is blocked. + * $sceDelegateProvider.resourceUrlBlacklist([ + * 'http://myapp.example.com/clickThru**' + * ]); + * }); + * ``` + */ + +function $SceDelegateProvider() { + this.SCE_CONTEXTS = SCE_CONTEXTS; + + // Resource URLs can also be trusted by policy. + var resourceUrlWhitelist = ['self'], + resourceUrlBlacklist = []; + + /** + * @ngdoc method + * @name $sceDelegateProvider#resourceUrlWhitelist + * @kind function + * + * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value + * provided. This must be an array or null. A snapshot of this array is used so further + * changes to the array are ignored. + * + * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items + * allowed in this array. + * + * Note: **an empty whitelist array will block all URLs**! + * + * @return {Array} the currently set whitelist array. + * + * The **default value** when no whitelist has been explicitly set is `['self']` allowing only + * same origin resource requests. + * + * @description + * Sets/Gets the whitelist of trusted resource URLs. + */ + this.resourceUrlWhitelist = function(value) { + if (arguments.length) { + resourceUrlWhitelist = adjustMatchers(value); + } + return resourceUrlWhitelist; + }; + + /** + * @ngdoc method + * @name $sceDelegateProvider#resourceUrlBlacklist + * @kind function + * + * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value + * provided. This must be an array or null. A snapshot of this array is used so further + * changes to the array are ignored. + * + * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items + * allowed in this array. + * + * The typical usage for the blacklist is to **block + * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as + * these would otherwise be trusted but actually return content from the redirected domain. + * + * Finally, **the blacklist overrides the whitelist** and has the final say. + * + * @return {Array} the currently set blacklist array. + * + * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there + * is no blacklist.) + * + * @description + * Sets/Gets the blacklist of trusted resource URLs. + */ + + this.resourceUrlBlacklist = function(value) { + if (arguments.length) { + resourceUrlBlacklist = adjustMatchers(value); + } + return resourceUrlBlacklist; + }; + + this.$get = ['$injector', function($injector) { + + var htmlSanitizer = function htmlSanitizer(html) { + throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); + }; + + if ($injector.has('$sanitize')) { + htmlSanitizer = $injector.get('$sanitize'); + } + + + function matchUrl(matcher, parsedUrl) { + if (matcher === 'self') { + return urlIsSameOrigin(parsedUrl); + } else { + // definitely a regex. See adjustMatchers() + return !!matcher.exec(parsedUrl.href); + } + } + + function isResourceUrlAllowedByPolicy(url) { + var parsedUrl = urlResolve(url.toString()); + var i, n, allowed = false; + // Ensure that at least one item from the whitelist allows this url. + for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) { + if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) { + allowed = true; + break; + } + } + if (allowed) { + // Ensure that no item from the blacklist blocked this url. + for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) { + if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) { + allowed = false; + break; + } + } + } + return allowed; + } + + function generateHolderType(Base) { + var holderType = function TrustedValueHolderType(trustedValue) { + this.$$unwrapTrustedValue = function() { + return trustedValue; + }; + }; + if (Base) { + holderType.prototype = new Base(); + } + holderType.prototype.valueOf = function sceValueOf() { + return this.$$unwrapTrustedValue(); + }; + holderType.prototype.toString = function sceToString() { + return this.$$unwrapTrustedValue().toString(); + }; + return holderType; + } + + var trustedValueHolderBase = generateHolderType(), + byType = {}; + + byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase); + byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]); + + /** + * @ngdoc method + * @name $sceDelegate#trustAs + * + * @description + * Returns an object that is trusted by angular for use in specified strict + * contextual escaping contexts (such as ng-bind-html, ng-include, any src + * attribute interpolation, any dom event binding attribute interpolation + * such as for onclick, etc.) that uses the provided value. + * See {@link ng.$sce $sce} for enabling strict contextual escaping. + * + * @param {string} type The kind of context in which this value is safe for use. e.g. url, + * resourceUrl, html, js and css. + * @param {*} value The value that that should be considered trusted/safe. + * @returns {*} A value that can be used to stand in for the provided `value` in places + * where Angular expects a $sce.trustAs() return value. + */ + function trustAs(type, trustedValue) { + var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null); + if (!Constructor) { + throw $sceMinErr('icontext', + 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}', + type, trustedValue); + } + if (trustedValue === null || trustedValue === undefined || trustedValue === '') { + return trustedValue; + } + // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting + // mutable objects, we ensure here that the value passed in is actually a string. + if (typeof trustedValue !== 'string') { + throw $sceMinErr('itype', + 'Attempted to trust a non-string value in a content requiring a string: Context: {0}', + type); + } + return new Constructor(trustedValue); + } + + /** + * @ngdoc method + * @name $sceDelegate#valueOf + * + * @description + * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link + * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. + * + * If the passed parameter is not a value that had been returned by {@link + * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is. + * + * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} + * call or anything else. + * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns + * `value` unchanged. + */ + function valueOf(maybeTrusted) { + if (maybeTrusted instanceof trustedValueHolderBase) { + return maybeTrusted.$$unwrapTrustedValue(); + } else { + return maybeTrusted; + } + } + + /** + * @ngdoc method + * @name $sceDelegate#getTrusted + * + * @description + * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and + * returns the originally supplied value if the queried context type is a supertype of the + * created type. If this condition isn't satisfied, throws an exception. + * + * @param {string} type The kind of context in which this value is to be used. + * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} call. + * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs + * `$sceDelegate.trustAs`} if valid in this context. Otherwise, throws an exception. + */ + function getTrusted(type, maybeTrusted) { + if (maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === '') { + return maybeTrusted; + } + var constructor = (byType.hasOwnProperty(type) ? byType[type] : null); + if (constructor && maybeTrusted instanceof constructor) { + return maybeTrusted.$$unwrapTrustedValue(); + } + // If we get here, then we may only take one of two actions. + // 1. sanitize the value for the requested type, or + // 2. throw an exception. + if (type === SCE_CONTEXTS.RESOURCE_URL) { + if (isResourceUrlAllowedByPolicy(maybeTrusted)) { + return maybeTrusted; + } else { + throw $sceMinErr('insecurl', + 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', + maybeTrusted.toString()); + } + } else if (type === SCE_CONTEXTS.HTML) { + return htmlSanitizer(maybeTrusted); + } + throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.'); + } + + return { trustAs: trustAs, + getTrusted: getTrusted, + valueOf: valueOf }; + }]; +} + + +/** + * @ngdoc provider + * @name $sceProvider + * @description + * + * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service. + * - enable/disable Strict Contextual Escaping (SCE) in a module + * - override the default implementation with a custom delegate + * + * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}. + */ + +/* jshint maxlen: false*/ + +/** + * @ngdoc service + * @name $sce + * @kind function + * + * @description + * + * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS. + * + * # Strict Contextual Escaping + * + * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain + * contexts to result in a value that is marked as safe to use for that context. One example of + * such a context is binding arbitrary html controlled by the user via `ng-bind-html`. We refer + * to these contexts as privileged or SCE contexts. + * + * As of version 1.2, Angular ships with SCE enabled by default. + * + * Note: When enabled (the default), IE<11 in quirks mode is not supported. In this mode, IE<11 allow + * one to execute arbitrary javascript by the use of the expression() syntax. Refer + * to learn more about them. + * You can ensure your document is in standards mode and not quirks mode by adding `` + * to the top of your HTML document. + * + * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for + * security vulnerabilities such as XSS, clickjacking, etc. a lot easier. + * + * Here's an example of a binding in a privileged context: + * + * ``` + * + *
+ * ``` + * + * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE + * disabled, this application allows the user to render arbitrary HTML into the DIV. + * In a more realistic example, one may be rendering user comments, blog articles, etc. via + * bindings. (HTML is just one example of a context where rendering user controlled input creates + * security vulnerabilities.) + * + * For the case of HTML, you might use a library, either on the client side, or on the server side, + * to sanitize unsafe HTML before binding to the value and rendering it in the document. + * + * How would you ensure that every place that used these types of bindings was bound to a value that + * was sanitized by your library (or returned as safe for rendering by your server?) How can you + * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some + * properties/fields and forgot to update the binding to the sanitized value? + * + * To be secure by default, you want to ensure that any such bindings are disallowed unless you can + * determine that something explicitly says it's safe to use a value for binding in that + * context. You can then audit your code (a simple grep would do) to ensure that this is only done + * for those values that you can easily tell are safe - because they were received from your server, + * sanitized by your library, etc. You can organize your codebase to help with this - perhaps + * allowing only the files in a specific directory to do this. Ensuring that the internal API + * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task. + * + * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs} + * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to + * obtain values that will be accepted by SCE / privileged contexts. + * + * + * ## How does it work? + * + * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted + * $sce.getTrusted(context, value)} rather than to the value directly. Directives use {@link + * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the + * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. + * + * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link + * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly + * simplified): + * + * ``` + * var ngBindHtmlDirective = ['$sce', function($sce) { + * return function(scope, element, attr) { + * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) { + * element.html(value || ''); + * }); + * }; + * }]; + * ``` + * + * ## Impact on loading templates + * + * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as + * `templateUrl`'s specified by {@link guide/directive directives}. + * + * By default, Angular only loads templates from the same domain and protocol as the application + * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl + * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or + * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist + * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value. + * + * *Please note*: + * The browser's + * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) + * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/) + * policy apply in addition to this and may further restrict whether the template is successfully + * loaded. This means that without the right CORS policy, loading templates from a different domain + * won't work on all browsers. Also, loading templates from `file://` URL does not work on some + * browsers. + * + * ## This feels like too much overhead + * + * It's important to remember that SCE only applies to interpolation expressions. + * + * If your expressions are constant literals, they're automatically trusted and you don't need to + * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g. + * `
`) just works. + * + * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them + * through {@link ng.$sce#getTrusted $sce.getTrusted}. SCE doesn't play a role here. + * + * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load + * templates in `ng-include` from your application's domain without having to even know about SCE. + * It blocks loading templates from other domains or loading templates over http from an https + * served document. You can change these by setting your own custom {@link + * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link + * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs. + * + * This significantly reduces the overhead. It is far easier to pay the small overhead and have an + * application that's secure and can be audited to verify that with much more ease than bolting + * security onto an application later. + * + * + * ## What trusted context types are supported? + * + * | Context | Notes | + * |---------------------|----------------| + * | `$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. | + * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. | + * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`
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. | + * | `$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. | + * + * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist}
+ * + * Each element in these arrays must be one of the following: + * + * - **'self'** + * - The special **string**, `'self'`, can be used to match against all URLs of the **same + * domain** as the application document using the **same protocol**. + * - **String** (except the special value `'self'`) + * - The string is matched against the full *normalized / absolute URL* of the resource + * being tested (substring matches are not good enough.) + * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters + * match themselves. + * - `*`: matches zero or more occurrences of any character other than one of the following 6 + * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and ';'. It's a useful wildcard for use + * in a whitelist. + * - `**`: matches zero or more occurrences of *any* character. As such, it's not + * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g. + * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might + * not have been the intention.) Its usage at the very end of the path is ok. (e.g. + * http://foo.example.com/templates/**). + * - **RegExp** (*see caveat below*) + * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax + * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to + * accidentally introduce a bug when one updates a complex expression (imho, all regexes should + * have good test coverage). For instance, the use of `.` in the regex is correct only in a + * small number of cases. A `.` character in the regex used when matching the scheme or a + * subdomain could be matched against a `:` or literal `.` that was likely not intended. It + * is highly recommended to use the string patterns and only fall back to regular expressions + * as a last resort. + * - The regular expression must be an instance of RegExp (i.e. not a string.) It is + * matched against the **entire** *normalized / absolute URL* of the resource being tested + * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags + * present on the RegExp (such as multiline, global, ignoreCase) are ignored. + * - If you are generating your JavaScript from some other templating engine (not + * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)), + * remember to escape your regular expression (and be aware that you might need more than + * one level of escaping depending on your templating engine and the way you interpolated + * the value.) Do make use of your platform's escaping mechanism as it might be good + * enough before coding your own. E.g. Ruby has + * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape) + * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape). + * Javascript lacks a similar built in function for escaping. Take a look at Google + * Closure library's [goog.string.regExpEscape(s)]( + * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962). + * + * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example. + * + * ## Show me an example using SCE. + * + * + * + *
+ *

+ * User comments
+ * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when + * $sanitize is available. If $sanitize isn't available, this results in an error instead of an + * exploit. + *
+ *
+ * {{userComment.name}}: + * + *
+ *
+ *
+ *
+ *
+ * + * + * angular.module('mySceApp', ['ngSanitize']) + * .controller('AppController', ['$http', '$templateCache', '$sce', + * function($http, $templateCache, $sce) { + * var self = this; + * $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) { + * self.userComments = userComments; + * }); + * self.explicitlyTrustedHtml = $sce.trustAsHtml( + * 'Hover over this text.'); + * }]); + * + * + * + * [ + * { "name": "Alice", + * "htmlComment": + * "Is anyone reading this?" + * }, + * { "name": "Bob", + * "htmlComment": "Yes! Am I the only other one?" + * } + * ] + * + * + * + * describe('SCE doc demo', function() { + * it('should sanitize untrusted values', function() { + * expect(element.all(by.css('.htmlComment')).first().getInnerHtml()) + * .toBe('Is anyone reading this?'); + * }); + * + * it('should NOT sanitize explicitly trusted values', function() { + * expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe( + * 'Hover over this text.'); + * }); + * }); + * + *
+ * + * + * + * ## Can I disable SCE completely? + * + * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits + * for little coding overhead. It will be much harder to take an SCE disabled application and + * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE + * for cases where you have a lot of existing code that was written before SCE was introduced and + * you're migrating them a module at a time. + * + * That said, here's how you can completely disable SCE: + * + * ``` + * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) { + * // Completely disable SCE. For demonstration purposes only! + * // Do not use in new projects. + * $sceProvider.enabled(false); + * }); + * ``` + * + */ +/* jshint maxlen: 100 */ + +function $SceProvider() { + var enabled = true; + + /** + * @ngdoc method + * @name $sceProvider#enabled + * @kind function + * + * @param {boolean=} value If provided, then enables/disables SCE. + * @return {boolean} true if SCE is enabled, false otherwise. + * + * @description + * Enables/disables SCE and returns the current value. + */ + this.enabled = function(value) { + if (arguments.length) { + enabled = !!value; + } + return enabled; + }; + + + /* Design notes on the default implementation for SCE. + * + * The API contract for the SCE delegate + * ------------------------------------- + * The SCE delegate object must provide the following 3 methods: + * + * - trustAs(contextEnum, value) + * This method is used to tell the SCE service that the provided value is OK to use in the + * contexts specified by contextEnum. It must return an object that will be accepted by + * getTrusted() for a compatible contextEnum and return this value. + * + * - valueOf(value) + * For values that were not produced by trustAs(), return them as is. For values that were + * produced by trustAs(), return the corresponding input value to trustAs. Basically, if + * trustAs is wrapping the given values into some type, this operation unwraps it when given + * such a value. + * + * - getTrusted(contextEnum, value) + * This function should return the a value that is safe to use in the context specified by + * contextEnum or throw and exception otherwise. + * + * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be + * opaque or wrapped in some holder object. That happens to be an implementation detail. For + * instance, an implementation could maintain a registry of all trusted objects by context. In + * such a case, trustAs() would return the same object that was passed in. getTrusted() would + * return the same object passed in if it was found in the registry under a compatible context or + * throw an exception otherwise. An implementation might only wrap values some of the time based + * on some criteria. getTrusted() might return a value and not throw an exception for special + * constants or objects even if not wrapped. All such implementations fulfill this contract. + * + * + * A note on the inheritance model for SCE contexts + * ------------------------------------------------ + * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This + * is purely an implementation details. + * + * The contract is simply this: + * + * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value) + * will also succeed. + * + * Inheritance happens to capture this in a natural way. In some future, we + * may not use inheritance anymore. That is OK because no code outside of + * sce.js and sceSpecs.js would need to be aware of this detail. + */ + + this.$get = ['$parse', '$sceDelegate', function( + $parse, $sceDelegate) { + // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow + // the "expression(javascript expression)" syntax which is insecure. + if (enabled && msie < 8) { + throw $sceMinErr('iequirks', + 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' + + 'mode. You can fix this by adding the text to the top of your HTML ' + + 'document. See http://docs.angularjs.org/api/ng.$sce for more information.'); + } + + var sce = shallowCopy(SCE_CONTEXTS); + + /** + * @ngdoc method + * @name $sce#isEnabled + * @kind function + * + * @return {Boolean} true if SCE is enabled, false otherwise. If you want to set the value, you + * have to do it at module config time on {@link ng.$sceProvider $sceProvider}. + * + * @description + * Returns a boolean indicating if SCE is enabled. + */ + sce.isEnabled = function() { + return enabled; + }; + sce.trustAs = $sceDelegate.trustAs; + sce.getTrusted = $sceDelegate.getTrusted; + sce.valueOf = $sceDelegate.valueOf; + + if (!enabled) { + sce.trustAs = sce.getTrusted = function(type, value) { return value; }; + sce.valueOf = identity; + } + + /** + * @ngdoc method + * @name $sce#parseAs + * + * @description + * Converts Angular {@link guide/expression expression} into a function. This is like {@link + * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it + * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*, + * *result*)} + * + * @param {string} type The kind of SCE context in which this result will be used. + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + sce.parseAs = function sceParseAs(type, expr) { + var parsed = $parse(expr); + if (parsed.literal && parsed.constant) { + return parsed; + } else { + return $parse(expr, function(value) { + return sce.getTrusted(type, value); + }); + } + }; + + /** + * @ngdoc method + * @name $sce#trustAs + * + * @description + * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, + * returns an object that is trusted by angular for use in specified strict contextual + * escaping contexts (such as ng-bind-html, ng-include, any src attribute + * interpolation, any dom event binding attribute interpolation such as for onclick, etc.) + * that uses the provided value. See * {@link ng.$sce $sce} for enabling strict contextual + * escaping. + * + * @param {string} type The kind of context in which this value is safe for use. e.g. url, + * resource_url, html, js and css. + * @param {*} value The value that that should be considered trusted/safe. + * @returns {*} A value that can be used to stand in for the provided `value` in places + * where Angular expects a $sce.trustAs() return value. + */ + + /** + * @ngdoc method + * @name $sce#trustAsHtml + * + * @description + * Shorthand method. `$sce.trustAsHtml(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml + * $sce.getTrustedHtml(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsUrl + * + * @description + * Shorthand method. `$sce.trustAsUrl(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl + * $sce.getTrustedUrl(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsResourceUrl + * + * @description + * Shorthand method. `$sce.trustAsResourceUrl(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl + * $sce.getTrustedResourceUrl(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the return + * value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#trustAsJs + * + * @description + * Shorthand method. `$sce.trustAsJs(value)` → + * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`} + * + * @param {*} value The value to trustAs. + * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs + * $sce.getTrustedJs(value)} to obtain the original value. (privileged directives + * only accept expressions that are either literal constants or are the + * return value of {@link ng.$sce#trustAs $sce.trustAs}.) + */ + + /** + * @ngdoc method + * @name $sce#getTrusted + * + * @description + * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such, + * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the + * originally supplied value if the queried context type is a supertype of the created type. + * If this condition isn't satisfied, throws an exception. + * + * @param {string} type The kind of context in which this value is to be used. + * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`} + * call. + * @returns {*} The value the was originally provided to + * {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context. + * Otherwise, throws an exception. + */ + + /** + * @ngdoc method + * @name $sce#getTrustedHtml + * + * @description + * Shorthand method. `$sce.getTrustedHtml(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedCss + * + * @description + * Shorthand method. `$sce.getTrustedCss(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedUrl + * + * @description + * Shorthand method. `$sce.getTrustedUrl(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedResourceUrl + * + * @description + * Shorthand method. `$sce.getTrustedResourceUrl(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`} + * + * @param {*} value The value to pass to `$sceDelegate.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)` + */ + + /** + * @ngdoc method + * @name $sce#getTrustedJs + * + * @description + * Shorthand method. `$sce.getTrustedJs(value)` → + * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`} + * + * @param {*} value The value to pass to `$sce.getTrusted`. + * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)` + */ + + /** + * @ngdoc method + * @name $sce#parseAsHtml + * + * @description + * Shorthand method. `$sce.parseAsHtml(expression string)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsCss + * + * @description + * Shorthand method. `$sce.parseAsCss(value)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsUrl + * + * @description + * Shorthand method. `$sce.parseAsUrl(value)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsResourceUrl + * + * @description + * Shorthand method. `$sce.parseAsResourceUrl(value)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + /** + * @ngdoc method + * @name $sce#parseAsJs + * + * @description + * Shorthand method. `$sce.parseAsJs(value)` → + * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`} + * + * @param {string} expression String expression to compile. + * @returns {function(context, locals)} a function which represents the compiled expression: + * + * * `context` – `{object}` – an object against which any expressions embedded in the strings + * are evaluated against (typically a scope object). + * * `locals` – `{object=}` – local variables context object, useful for overriding values in + * `context`. + */ + + // Shorthand delegations. + var parse = sce.parseAs, + getTrusted = sce.getTrusted, + trustAs = sce.trustAs; + + forEach(SCE_CONTEXTS, function(enumValue, name) { + var lName = lowercase(name); + sce[camelCase("parse_as_" + lName)] = function(expr) { + return parse(enumValue, expr); + }; + sce[camelCase("get_trusted_" + lName)] = function(value) { + return getTrusted(enumValue, value); + }; + sce[camelCase("trust_as_" + lName)] = function(value) { + return trustAs(enumValue, value); + }; + }); + + return sce; + }]; +} + +/** + * !!! This is an undocumented "private" service !!! + * + * @name $sniffer + * @requires $window + * @requires $document + * + * @property {boolean} history Does the browser support html5 history api ? + * @property {boolean} transitions Does the browser support CSS transition events ? + * @property {boolean} animations Does the browser support CSS animation events ? + * + * @description + * This is very simple implementation of testing browser's features. + */ +function $SnifferProvider() { + this.$get = ['$window', '$document', function($window, $document) { + var eventSupport = {}, + android = + int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]), + boxee = /Boxee/i.test(($window.navigator || {}).userAgent), + document = $document[0] || {}, + vendorPrefix, + vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/, + bodyStyle = document.body && document.body.style, + transitions = false, + animations = false, + match; + + if (bodyStyle) { + for (var prop in bodyStyle) { + if (match = vendorRegex.exec(prop)) { + vendorPrefix = match[0]; + vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1); + break; + } + } + + if (!vendorPrefix) { + vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit'; + } + + transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle)); + animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle)); + + if (android && (!transitions || !animations)) { + transitions = isString(document.body.style.webkitTransition); + animations = isString(document.body.style.webkitAnimation); + } + } + + + return { + // Android has history.pushState, but it does not update location correctly + // so let's not use the history API at all. + // http://code.google.com/p/android/issues/detail?id=17471 + // https://github.com/angular/angular.js/issues/904 + + // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has + // so let's not use the history API also + // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined + // jshint -W018 + history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee), + // jshint +W018 + hasEvent: function(event) { + // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have + // it. In particular the event is not fired when backspace or delete key are pressed or + // when cut operation is performed. + // IE10+ implements 'input' event but it erroneously fires under various situations, + // e.g. when placeholder changes, or a form is focused. + if (event === 'input' && msie <= 11) return false; + + if (isUndefined(eventSupport[event])) { + var divElm = document.createElement('div'); + eventSupport[event] = 'on' + event in divElm; + } + + return eventSupport[event]; + }, + csp: csp(), + vendorPrefix: vendorPrefix, + transitions: transitions, + animations: animations, + android: android + }; + }]; +} + +var $compileMinErr = minErr('$compile'); + +/** + * @ngdoc service + * @name $templateRequest + * + * @description + * The `$templateRequest` service runs security checks then downloads the provided template using + * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request + * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the + * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the + * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted + * when `tpl` is of type string and `$templateCache` has the matching entry. + * + * @param {string|TrustedResourceUrl} tpl The HTTP request template URL + * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty + * + * @return {Promise} the HTTP Promise for the given. + * + * @property {number} totalPendingRequests total amount of pending template requests being downloaded. + */ +function $TemplateRequestProvider() { + this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce) { + function handleRequestFn(tpl, ignoreRequestError) { + handleRequestFn.totalPendingRequests++; + + // We consider the template cache holds only trusted templates, so + // there's no need to go through whitelisting again for keys that already + // are included in there. This also makes Angular accept any script + // directive, no matter its name. However, we still need to unwrap trusted + // types. + if (!isString(tpl) || !$templateCache.get(tpl)) { + tpl = $sce.getTrustedResourceUrl(tpl); + } + + var transformResponse = $http.defaults && $http.defaults.transformResponse; + + if (isArray(transformResponse)) { + transformResponse = transformResponse.filter(function(transformer) { + return transformer !== defaultHttpResponseTransform; + }); + } else if (transformResponse === defaultHttpResponseTransform) { + transformResponse = null; + } + + var httpOptions = { + cache: $templateCache, + transformResponse: transformResponse + }; + + return $http.get(tpl, httpOptions) + ['finally'](function() { + handleRequestFn.totalPendingRequests--; + }) + .then(function(response) { + return response.data; + }, handleError); + + function handleError(resp) { + if (!ignoreRequestError) { + throw $compileMinErr('tpload', 'Failed to load template: {0}', tpl); + } + return $q.reject(resp); + } + } + + handleRequestFn.totalPendingRequests = 0; + + return handleRequestFn; + }]; +} + +function $$TestabilityProvider() { + this.$get = ['$rootScope', '$browser', '$location', + function($rootScope, $browser, $location) { + + /** + * @name $testability + * + * @description + * The private $$testability service provides a collection of methods for use when debugging + * or by automated test and debugging tools. + */ + var testability = {}; + + /** + * @name $$testability#findBindings + * + * @description + * Returns an array of elements that are bound (via ng-bind or {{}}) + * to expressions matching the input. + * + * @param {Element} element The element root to search from. + * @param {string} expression The binding expression to match. + * @param {boolean} opt_exactMatch If true, only returns exact matches + * for the expression. Filters and whitespace are ignored. + */ + testability.findBindings = function(element, expression, opt_exactMatch) { + var bindings = element.getElementsByClassName('ng-binding'); + var matches = []; + forEach(bindings, function(binding) { + var dataBinding = angular.element(binding).data('$binding'); + if (dataBinding) { + forEach(dataBinding, function(bindingName) { + if (opt_exactMatch) { + var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)'); + if (matcher.test(bindingName)) { + matches.push(binding); + } + } else { + if (bindingName.indexOf(expression) != -1) { + matches.push(binding); + } + } + }); + } + }); + return matches; + }; + + /** + * @name $$testability#findModels + * + * @description + * Returns an array of elements that are two-way found via ng-model to + * expressions matching the input. + * + * @param {Element} element The element root to search from. + * @param {string} expression The model expression to match. + * @param {boolean} opt_exactMatch If true, only returns exact matches + * for the expression. + */ + testability.findModels = function(element, expression, opt_exactMatch) { + var prefixes = ['ng-', 'data-ng-', 'ng\\:']; + for (var p = 0; p < prefixes.length; ++p) { + var attributeEquals = opt_exactMatch ? '=' : '*='; + var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]'; + var elements = element.querySelectorAll(selector); + if (elements.length) { + return elements; + } + } + }; + + /** + * @name $$testability#getLocation + * + * @description + * Shortcut for getting the location in a browser agnostic way. Returns + * the path, search, and hash. (e.g. /path?a=b#hash) + */ + testability.getLocation = function() { + return $location.url(); + }; + + /** + * @name $$testability#setLocation + * + * @description + * Shortcut for navigating to a location without doing a full page reload. + * + * @param {string} url The location url (path, search and hash, + * e.g. /path?a=b#hash) to go to. + */ + testability.setLocation = function(url) { + if (url !== $location.url()) { + $location.url(url); + $rootScope.$digest(); + } + }; + + /** + * @name $$testability#whenStable + * + * @description + * Calls the callback when $timeout and $http requests are completed. + * + * @param {function} callback + */ + testability.whenStable = function(callback) { + $browser.notifyWhenNoOutstandingRequests(callback); + }; + + return testability; + }]; +} + +function $TimeoutProvider() { + this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', + function($rootScope, $browser, $q, $$q, $exceptionHandler) { + var deferreds = {}; + + + /** + * @ngdoc service + * @name $timeout + * + * @description + * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch + * block and delegates any exceptions to + * {@link ng.$exceptionHandler $exceptionHandler} service. + * + * The return value of registering a timeout function is a promise, which will be resolved when + * the timeout is reached and the timeout function is executed. + * + * To cancel a timeout request, call `$timeout.cancel(promise)`. + * + * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to + * synchronously flush the queue of deferred functions. + * + * @param {function()} fn A function, whose execution should be delayed. + * @param {number=} [delay=0] Delay in milliseconds. + * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise + * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. + * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this + * promise will be resolved with is the return value of the `fn` function. + * + */ + function timeout(fn, delay, invokeApply) { + var skipApply = (isDefined(invokeApply) && !invokeApply), + deferred = (skipApply ? $$q : $q).defer(), + promise = deferred.promise, + timeoutId; + + timeoutId = $browser.defer(function() { + try { + deferred.resolve(fn()); + } catch (e) { + deferred.reject(e); + $exceptionHandler(e); + } + finally { + delete deferreds[promise.$$timeoutId]; + } + + if (!skipApply) $rootScope.$apply(); + }, delay); + + promise.$$timeoutId = timeoutId; + deferreds[timeoutId] = deferred; + + return promise; + } + + + /** + * @ngdoc method + * @name $timeout#cancel + * + * @description + * Cancels a task associated with the `promise`. As a result of this, the promise will be + * resolved with a rejection. + * + * @param {Promise=} promise Promise returned by the `$timeout` function. + * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully + * canceled. + */ + timeout.cancel = function(promise) { + if (promise && promise.$$timeoutId in deferreds) { + deferreds[promise.$$timeoutId].reject('canceled'); + delete deferreds[promise.$$timeoutId]; + return $browser.defer.cancel(promise.$$timeoutId); + } + return false; + }; + + return timeout; + }]; +} + +// NOTE: The usage of window and document instead of $window and $document here is +// deliberate. This service depends on the specific behavior of anchor nodes created by the +// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and +// cause us to break tests. In addition, when the browser resolves a URL for XHR, it +// doesn't know about mocked locations and resolves URLs to the real document - which is +// exactly the behavior needed here. There is little value is mocking these out for this +// service. +var urlParsingNode = document.createElement("a"); +var originUrl = urlResolve(window.location.href); + + +/** + * + * Implementation Notes for non-IE browsers + * ---------------------------------------- + * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, + * results both in the normalizing and parsing of the URL. Normalizing means that a relative + * URL will be resolved into an absolute URL in the context of the application document. + * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related + * properties are all populated to reflect the normalized URL. This approach has wide + * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See + * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html + * + * Implementation Notes for IE + * --------------------------- + * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other + * browsers. However, the parsed components will not be set if the URL assigned did not specify + * them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We + * work around that by performing the parsing in a 2nd step by taking a previously normalized + * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the + * properties such as protocol, hostname, port, etc. + * + * References: + * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement + * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html + * http://url.spec.whatwg.org/#urlutils + * https://github.com/angular/angular.js/pull/2902 + * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ + * + * @kind function + * @param {string} url The URL to be parsed. + * @description Normalizes and parses a URL. + * @returns {object} Returns the normalized URL as a dictionary. + * + * | member name | Description | + * |---------------|----------------| + * | href | A normalized version of the provided URL if it was not an absolute URL | + * | protocol | The protocol including the trailing colon | + * | host | The host and port (if the port is non-default) of the normalizedUrl | + * | search | The search params, minus the question mark | + * | hash | The hash string, minus the hash symbol + * | hostname | The hostname + * | port | The port, without ":" + * | pathname | The pathname, beginning with "/" + * + */ +function urlResolve(url) { + var href = url; + + if (msie) { + // Normalize before parse. Refer Implementation Notes on why this is + // done in two steps on IE. + urlParsingNode.setAttribute("href", href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') + ? urlParsingNode.pathname + : '/' + urlParsingNode.pathname + }; +} + +/** + * Parse a request URL and determine whether this is a same-origin request as the application document. + * + * @param {string|object} requestUrl The url of the request as a string that will be resolved + * or a parsed URL object. + * @returns {boolean} Whether the request is for the same origin as the application document. + */ +function urlIsSameOrigin(requestUrl) { + var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; + return (parsed.protocol === originUrl.protocol && + parsed.host === originUrl.host); +} + +/** + * @ngdoc service + * @name $window + * + * @description + * A reference to the browser's `window` object. While `window` + * is globally available in JavaScript, it causes testability problems, because + * it is a global variable. In angular we always refer to it through the + * `$window` service, so it may be overridden, removed or mocked for testing. + * + * Expressions, like the one defined for the `ngClick` directive in the example + * below, are evaluated with respect to the current scope. Therefore, there is + * no risk of inadvertently coding in a dependency on a global value in such an + * expression. + * + * @example + + + +
+ + +
+
+ + it('should display the greeting in the input box', function() { + element(by.model('greeting')).sendKeys('Hello, E2E Tests'); + // If we click the button it will block the test runner + // element(':button').click(); + }); + +
+ */ +function $WindowProvider() { + this.$get = valueFn(window); +} + +/* global currencyFilter: true, + dateFilter: true, + filterFilter: true, + jsonFilter: true, + limitToFilter: true, + lowercaseFilter: true, + numberFilter: true, + orderByFilter: true, + uppercaseFilter: true, + */ + +/** + * @ngdoc provider + * @name $filterProvider + * @description + * + * Filters are just functions which transform input to an output. However filters need to be + * Dependency Injected. To achieve this a filter definition consists of a factory function which is + * annotated with dependencies and is responsible for creating a filter function. + * + *
+ * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. + * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace + * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores + * (`myapp_subsection_filterx`). + *
+ * + * ```js + * // Filter registration + * function MyModule($provide, $filterProvider) { + * // create a service to demonstrate injection (not always needed) + * $provide.value('greet', function(name){ + * return 'Hello ' + name + '!'; + * }); + * + * // register a filter factory which uses the + * // greet service to demonstrate DI. + * $filterProvider.register('greet', function(greet){ + * // return the filter function which uses the greet service + * // to generate salutation + * return function(text) { + * // filters need to be forgiving so check input validity + * return text && greet(text) || text; + * }; + * }); + * } + * ``` + * + * The filter function is registered with the `$injector` under the filter name suffix with + * `Filter`. + * + * ```js + * it('should be the same instance', inject( + * function($filterProvider) { + * $filterProvider.register('reverse', function(){ + * return ...; + * }); + * }, + * function($filter, reverseFilter) { + * expect($filter('reverse')).toBe(reverseFilter); + * }); + * ``` + * + * + * For more information about how angular filters work, and how to create your own filters, see + * {@link guide/filter Filters} in the Angular Developer Guide. + */ + +/** + * @ngdoc service + * @name $filter + * @kind function + * @description + * Filters are used for formatting data displayed to the user. + * + * The general syntax in templates is as follows: + * + * {{ expression [| filter_name[:parameter_value] ... ] }} + * + * @param {String} name Name of the filter function to retrieve + * @return {Function} the filter function + * @example + + +
+

{{ originalText }}

+

{{ filteredText }}

+
+
+ + + angular.module('filterExample', []) + .controller('MainCtrl', function($scope, $filter) { + $scope.originalText = 'hello'; + $scope.filteredText = $filter('uppercase')($scope.originalText); + }); + +
+ */ +$FilterProvider.$inject = ['$provide']; +function $FilterProvider($provide) { + var suffix = 'Filter'; + + /** + * @ngdoc method + * @name $filterProvider#register + * @param {string|Object} name Name of the filter function, or an object map of filters where + * the keys are the filter names and the values are the filter factories. + * + *
+ * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`. + * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace + * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores + * (`myapp_subsection_filterx`). + *
+ * @returns {Object} Registered filter instance, or if a map of filters was provided then a map + * of the registered filter instances. + */ + function register(name, factory) { + if (isObject(name)) { + var filters = {}; + forEach(name, function(filter, key) { + filters[key] = register(key, filter); + }); + return filters; + } else { + return $provide.factory(name + suffix, factory); + } + } + this.register = register; + + this.$get = ['$injector', function($injector) { + return function(name) { + return $injector.get(name + suffix); + }; + }]; + + //////////////////////////////////////// + + /* global + currencyFilter: false, + dateFilter: false, + filterFilter: false, + jsonFilter: false, + limitToFilter: false, + lowercaseFilter: false, + numberFilter: false, + orderByFilter: false, + uppercaseFilter: false, + */ + + register('currency', currencyFilter); + register('date', dateFilter); + register('filter', filterFilter); + register('json', jsonFilter); + register('limitTo', limitToFilter); + register('lowercase', lowercaseFilter); + register('number', numberFilter); + register('orderBy', orderByFilter); + register('uppercase', uppercaseFilter); +} + +/** + * @ngdoc filter + * @name filter + * @kind function + * + * @description + * Selects a subset of items from `array` and returns it as a new array. + * + * @param {Array} array The source array. + * @param {string|Object|function()} expression The predicate to be used for selecting items from + * `array`. + * + * Can be one of: + * + * - `string`: The string is used for matching against the contents of the `array`. All strings or + * objects with string properties in `array` that match this string will be returned. This also + * applies to nested object properties. + * The predicate can be negated by prefixing the string with `!`. + * + * - `Object`: A pattern object can be used to filter specific properties on objects contained + * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items + * which have property `name` containing "M" and property `phone` containing "1". A special + * property name `$` can be used (as in `{$:"text"}`) to accept a match against any + * property of the object or its nested object properties. That's equivalent to the simple + * substring match with a `string` as described above. The predicate can be negated by prefixing + * the string with `!`. + * For example `{name: "!M"}` predicate will return an array of items which have property `name` + * not containing "M". + * + * Note that a named property will match properties on the same level only, while the special + * `$` property will match properties on the same level or deeper. E.g. an array item like + * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but + * **will** be matched by `{$: 'John'}`. + * + * - `function(value, index)`: A predicate function can be used to write arbitrary filters. The + * function is called for each element of `array`. The final result is an array of those + * elements that the predicate returned true for. + * + * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in + * determining if the expected value (from the filter expression) and actual value (from + * the object in the array) should be considered a match. + * + * Can be one of: + * + * - `function(actual, expected)`: + * The function will be given the object value and the predicate value to compare and + * should return true if both values should be considered equal. + * + * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`. + * This is essentially strict comparison of expected and actual. + * + * - `false|undefined`: A short hand for a function which will look for a substring match in case + * insensitive way. + * + * @example + + +
+ + Search: + + + + + + +
NamePhone
{{friend.name}}{{friend.phone}}
+
+ Any:
+ Name only
+ Phone only
+ Equality
+ + + + + + +
NamePhone
{{friendObj.name}}{{friendObj.phone}}
+
+ + var expectFriendNames = function(expectedNames, key) { + element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) { + arr.forEach(function(wd, i) { + expect(wd.getText()).toMatch(expectedNames[i]); + }); + }); + }; + + it('should search across all fields when filtering with a string', function() { + var searchText = element(by.model('searchText')); + searchText.clear(); + searchText.sendKeys('m'); + expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend'); + + searchText.clear(); + searchText.sendKeys('76'); + expectFriendNames(['John', 'Julie'], 'friend'); + }); + + it('should search in specific fields when filtering with a predicate object', function() { + var searchAny = element(by.model('search.$')); + searchAny.clear(); + searchAny.sendKeys('i'); + expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj'); + }); + it('should use a equal comparison when comparator is true', function() { + var searchName = element(by.model('search.name')); + var strict = element(by.model('strict')); + searchName.clear(); + searchName.sendKeys('Julie'); + strict.click(); + expectFriendNames(['Julie'], 'friendObj'); + }); + +
+ */ +function filterFilter() { + return function(array, expression, comparator) { + if (!isArray(array)) return array; + + var expressionType = (expression !== null) ? typeof expression : 'null'; + var predicateFn; + var matchAgainstAnyProp; + + switch (expressionType) { + case 'function': + predicateFn = expression; + break; + case 'boolean': + case 'null': + case 'number': + case 'string': + matchAgainstAnyProp = true; + //jshint -W086 + case 'object': + //jshint +W086 + predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp); + break; + default: + return array; + } + + return array.filter(predicateFn); + }; +} + +// Helper functions for `filterFilter` +function createPredicateFn(expression, comparator, matchAgainstAnyProp) { + var shouldMatchPrimitives = isObject(expression) && ('$' in expression); + var predicateFn; + + if (comparator === true) { + comparator = equals; + } else if (!isFunction(comparator)) { + comparator = function(actual, expected) { + if (isUndefined(actual)) { + // No substring matching against `undefined` + return false; + } + if ((actual === null) || (expected === null)) { + // No substring matching against `null`; only match against `null` + return actual === expected; + } + if (isObject(actual) || isObject(expected)) { + // Prevent an object to be considered equal to a string like `'[object'` + return false; + } + + actual = lowercase('' + actual); + expected = lowercase('' + expected); + return actual.indexOf(expected) !== -1; + }; + } + + predicateFn = function(item) { + if (shouldMatchPrimitives && !isObject(item)) { + return deepCompare(item, expression.$, comparator, false); + } + return deepCompare(item, expression, comparator, matchAgainstAnyProp); + }; + + return predicateFn; +} + +function deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) { + var actualType = (actual !== null) ? typeof actual : 'null'; + var expectedType = (expected !== null) ? typeof expected : 'null'; + + if ((expectedType === 'string') && (expected.charAt(0) === '!')) { + return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp); + } else if (isArray(actual)) { + // In case `actual` is an array, consider it a match + // if ANY of it's items matches `expected` + return actual.some(function(item) { + return deepCompare(item, expected, comparator, matchAgainstAnyProp); + }); + } + + switch (actualType) { + case 'object': + var key; + if (matchAgainstAnyProp) { + for (key in actual) { + if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) { + return true; + } + } + return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false); + } else if (expectedType === 'object') { + for (key in expected) { + var expectedVal = expected[key]; + if (isFunction(expectedVal) || isUndefined(expectedVal)) { + continue; + } + + var matchAnyProperty = key === '$'; + var actualVal = matchAnyProperty ? actual : actual[key]; + if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) { + return false; + } + } + return true; + } else { + return comparator(actual, expected); + } + break; + case 'function': + return false; + default: + return comparator(actual, expected); + } +} + +/** + * @ngdoc filter + * @name currency + * @kind function + * + * @description + * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default + * symbol for current locale is used. + * + * @param {number} amount Input to filter. + * @param {string=} symbol Currency symbol or identifier to be displayed. + * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale + * @returns {string} Formatted number. + * + * + * @example + + + +
+
+ default currency symbol ($): {{amount | currency}}
+ custom currency identifier (USD$): {{amount | currency:"USD$"}} + no fractions (0): {{amount | currency:"USD$":0}} +
+
+ + it('should init with 1234.56', function() { + expect(element(by.id('currency-default')).getText()).toBe('$1,234.56'); + expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56'); + expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235'); + }); + it('should update', function() { + if (browser.params.browser == 'safari') { + // Safari does not understand the minus key. See + // https://github.com/angular/protractor/issues/481 + return; + } + element(by.model('amount')).clear(); + element(by.model('amount')).sendKeys('-1234'); + expect(element(by.id('currency-default')).getText()).toBe('($1,234.00)'); + expect(element(by.id('currency-custom')).getText()).toBe('(USD$1,234.00)'); + expect(element(by.id('currency-no-fractions')).getText()).toBe('(USD$1,234)'); + }); + +
+ */ +currencyFilter.$inject = ['$locale']; +function currencyFilter($locale) { + var formats = $locale.NUMBER_FORMATS; + return function(amount, currencySymbol, fractionSize) { + if (isUndefined(currencySymbol)) { + currencySymbol = formats.CURRENCY_SYM; + } + + if (isUndefined(fractionSize)) { + fractionSize = formats.PATTERNS[1].maxFrac; + } + + // if null or undefined pass it through + return (amount == null) + ? amount + : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize). + replace(/\u00A4/g, currencySymbol); + }; +} + +/** + * @ngdoc filter + * @name number + * @kind function + * + * @description + * Formats a number as text. + * + * If the input is null or undefined, it will just be returned. + * If the input is infinite (Infinity/-Infinity) the Infinity symbol '∞' is returned. + * If the input is not a number an empty string is returned. + * + * @param {number|string} number Number to format. + * @param {(number|string)=} fractionSize Number of decimal places to round the number to. + * If this is not provided then the fraction size is computed from the current locale's number + * formatting pattern. In the case of the default locale, it will be 3. + * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit. + * + * @example + + + +
+ Enter number:
+ Default formatting: {{val | number}}
+ No fractions: {{val | number:0}}
+ Negative number: {{-val | number:4}} +
+
+ + it('should format numbers', function() { + expect(element(by.id('number-default')).getText()).toBe('1,234.568'); + expect(element(by.binding('val | number:0')).getText()).toBe('1,235'); + expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679'); + }); + + it('should update', function() { + element(by.model('val')).clear(); + element(by.model('val')).sendKeys('3374.333'); + expect(element(by.id('number-default')).getText()).toBe('3,374.333'); + expect(element(by.binding('val | number:0')).getText()).toBe('3,374'); + expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330'); + }); + +
+ */ + + +numberFilter.$inject = ['$locale']; +function numberFilter($locale) { + var formats = $locale.NUMBER_FORMATS; + return function(number, fractionSize) { + + // if null or undefined pass it through + return (number == null) + ? number + : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, + fractionSize); + }; +} + +var DECIMAL_SEP = '.'; +function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { + if (!isFinite(number) || isObject(number)) return ''; + + var isNegative = number < 0; + number = Math.abs(number); + var numStr = number + '', + formatedText = '', + parts = []; + + var hasExponent = false; + if (numStr.indexOf('e') !== -1) { + var match = numStr.match(/([\d\.]+)e(-?)(\d+)/); + if (match && match[2] == '-' && match[3] > fractionSize + 1) { + number = 0; + } else { + formatedText = numStr; + hasExponent = true; + } + } + + if (!hasExponent) { + var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length; + + // determine fractionSize if it is not specified + if (isUndefined(fractionSize)) { + fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac); + } + + // safely round numbers in JS without hitting imprecisions of floating-point arithmetics + // inspired by: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize); + + var fraction = ('' + number).split(DECIMAL_SEP); + var whole = fraction[0]; + fraction = fraction[1] || ''; + + var i, pos = 0, + lgroup = pattern.lgSize, + group = pattern.gSize; + + if (whole.length >= (lgroup + group)) { + pos = whole.length - lgroup; + for (i = 0; i < pos; i++) { + if ((pos - i) % group === 0 && i !== 0) { + formatedText += groupSep; + } + formatedText += whole.charAt(i); + } + } + + for (i = pos; i < whole.length; i++) { + if ((whole.length - i) % lgroup === 0 && i !== 0) { + formatedText += groupSep; + } + formatedText += whole.charAt(i); + } + + // format fraction part. + while (fraction.length < fractionSize) { + fraction += '0'; + } + + if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize); + } else { + if (fractionSize > 0 && number < 1) { + formatedText = number.toFixed(fractionSize); + number = parseFloat(formatedText); + } + } + + if (number === 0) { + isNegative = false; + } + + parts.push(isNegative ? pattern.negPre : pattern.posPre, + formatedText, + isNegative ? pattern.negSuf : pattern.posSuf); + return parts.join(''); +} + +function padNumber(num, digits, trim) { + var neg = ''; + if (num < 0) { + neg = '-'; + num = -num; + } + num = '' + num; + while (num.length < digits) num = '0' + num; + if (trim) + num = num.substr(num.length - digits); + return neg + num; +} + + +function dateGetter(name, size, offset, trim) { + offset = offset || 0; + return function(date) { + var value = date['get' + name](); + if (offset > 0 || value > -offset) + value += offset; + if (value === 0 && offset == -12) value = 12; + return padNumber(value, size, trim); + }; +} + +function dateStrGetter(name, shortForm) { + return function(date, formats) { + var value = date['get' + name](); + var get = uppercase(shortForm ? ('SHORT' + name) : name); + + return formats[get][value]; + }; +} + +function timeZoneGetter(date) { + var zone = -1 * date.getTimezoneOffset(); + var paddedZone = (zone >= 0) ? "+" : ""; + + paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) + + padNumber(Math.abs(zone % 60), 2); + + return paddedZone; +} + +function getFirstThursdayOfYear(year) { + // 0 = index of January + var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay(); + // 4 = index of Thursday (+1 to account for 1st = 5) + // 11 = index of *next* Thursday (+1 account for 1st = 12) + return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst); +} + +function getThursdayThisWeek(datetime) { + return new Date(datetime.getFullYear(), datetime.getMonth(), + // 4 = index of Thursday + datetime.getDate() + (4 - datetime.getDay())); +} + +function weekGetter(size) { + return function(date) { + var firstThurs = getFirstThursdayOfYear(date.getFullYear()), + thisThurs = getThursdayThisWeek(date); + + var diff = +thisThurs - +firstThurs, + result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week + + return padNumber(result, size); + }; +} + +function ampmGetter(date, formats) { + return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]; +} + +function eraGetter(date, formats) { + return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1]; +} + +function longEraGetter(date, formats) { + return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1]; +} + +var DATE_FORMATS = { + yyyy: dateGetter('FullYear', 4), + yy: dateGetter('FullYear', 2, 0, true), + y: dateGetter('FullYear', 1), + MMMM: dateStrGetter('Month'), + MMM: dateStrGetter('Month', true), + MM: dateGetter('Month', 2, 1), + M: dateGetter('Month', 1, 1), + dd: dateGetter('Date', 2), + d: dateGetter('Date', 1), + HH: dateGetter('Hours', 2), + H: dateGetter('Hours', 1), + hh: dateGetter('Hours', 2, -12), + h: dateGetter('Hours', 1, -12), + mm: dateGetter('Minutes', 2), + m: dateGetter('Minutes', 1), + ss: dateGetter('Seconds', 2), + s: dateGetter('Seconds', 1), + // while ISO 8601 requires fractions to be prefixed with `.` or `,` + // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions + sss: dateGetter('Milliseconds', 3), + EEEE: dateStrGetter('Day'), + EEE: dateStrGetter('Day', true), + a: ampmGetter, + Z: timeZoneGetter, + ww: weekGetter(2), + w: weekGetter(1), + G: eraGetter, + GG: eraGetter, + GGG: eraGetter, + GGGG: longEraGetter +}; + +var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/, + NUMBER_STRING = /^\-?\d+$/; + +/** + * @ngdoc filter + * @name date + * @kind function + * + * @description + * Formats `date` to a string based on the requested `format`. + * + * `format` string can be composed of the following elements: + * + * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010) + * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10) + * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199) + * * `'MMMM'`: Month in year (January-December) + * * `'MMM'`: Month in year (Jan-Dec) + * * `'MM'`: Month in year, padded (01-12) + * * `'M'`: Month in year (1-12) + * * `'dd'`: Day in month, padded (01-31) + * * `'d'`: Day in month (1-31) + * * `'EEEE'`: Day in Week,(Sunday-Saturday) + * * `'EEE'`: Day in Week, (Sun-Sat) + * * `'HH'`: Hour in day, padded (00-23) + * * `'H'`: Hour in day (0-23) + * * `'hh'`: Hour in AM/PM, padded (01-12) + * * `'h'`: Hour in AM/PM, (1-12) + * * `'mm'`: Minute in hour, padded (00-59) + * * `'m'`: Minute in hour (0-59) + * * `'ss'`: Second in minute, padded (00-59) + * * `'s'`: Second in minute (0-59) + * * `'sss'`: Millisecond in second, padded (000-999) + * * `'a'`: AM/PM marker + * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200) + * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year + * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year + * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD') + * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini') + * + * `format` string can also be one of the following predefined + * {@link guide/i18n localizable formats}: + * + * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale + * (e.g. Sep 3, 2010 12:05:08 PM) + * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM) + * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale + * (e.g. Friday, September 3, 2010) + * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010) + * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010) + * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10) + * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM) + * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM) + * + * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g. + * `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence + * (e.g. `"h 'o''clock'"`). + * + * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or + * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its + * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is + * specified in the string input, the time is considered to be in the local timezone. + * @param {string=} format Formatting rules (see Description). If not specified, + * `mediumDate` is used. + * @param {string=} timezone Timezone to be used for formatting. Right now, only `'UTC'` is supported. + * If not specified, the timezone of the browser will be used. + * @returns {string} Formatted string or the input if input is not recognized as date/millis. + * + * @example + + + {{1288323623006 | date:'medium'}}: + {{1288323623006 | date:'medium'}}
+ {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}: + {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
+ {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}: + {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
+ {{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}: + {{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}
+
+ + it('should format date', function() { + expect(element(by.binding("1288323623006 | date:'medium'")).getText()). + toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/); + expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()). + toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/); + expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()). + toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/); + expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()). + toMatch(/10\/2\d\/2010 at \d{1,2}:\d{2}(AM|PM)/); + }); + +
+ */ +dateFilter.$inject = ['$locale']; +function dateFilter($locale) { + + + var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; + // 1 2 3 4 5 6 7 8 9 10 11 + function jsonStringToDate(string) { + var match; + if (match = string.match(R_ISO8601_STR)) { + var date = new Date(0), + tzHour = 0, + tzMin = 0, + dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear, + timeSetter = match[8] ? date.setUTCHours : date.setHours; + + if (match[9]) { + tzHour = int(match[9] + match[10]); + tzMin = int(match[9] + match[11]); + } + dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3])); + var h = int(match[4] || 0) - tzHour; + var m = int(match[5] || 0) - tzMin; + var s = int(match[6] || 0); + var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000); + timeSetter.call(date, h, m, s, ms); + return date; + } + return string; + } + + + return function(date, format, timezone) { + var text = '', + parts = [], + fn, match; + + format = format || 'mediumDate'; + format = $locale.DATETIME_FORMATS[format] || format; + if (isString(date)) { + date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date); + } + + if (isNumber(date)) { + date = new Date(date); + } + + if (!isDate(date)) { + return date; + } + + while (format) { + match = DATE_FORMATS_SPLIT.exec(format); + if (match) { + parts = concat(parts, match, 1); + format = parts.pop(); + } else { + parts.push(format); + format = null; + } + } + + if (timezone && timezone === 'UTC') { + date = new Date(date.getTime()); + date.setMinutes(date.getMinutes() + date.getTimezoneOffset()); + } + forEach(parts, function(value) { + fn = DATE_FORMATS[value]; + text += fn ? fn(date, $locale.DATETIME_FORMATS) + : value.replace(/(^'|'$)/g, '').replace(/''/g, "'"); + }); + + return text; + }; +} + + +/** + * @ngdoc filter + * @name json + * @kind function + * + * @description + * Allows you to convert a JavaScript object into JSON string. + * + * This filter is mostly useful for debugging. When using the double curly {{value}} notation + * the binding is automatically converted to JSON. + * + * @param {*} object Any JavaScript object (including arrays and primitive types) to filter. + * @param {number=} spacing The number of spaces to use per indentation, defaults to 2. + * @returns {string} JSON string. + * + * + * @example + + +
{{ {'name':'value'} | json }}
+
{{ {'name':'value'} | json:4 }}
+
+ + it('should jsonify filtered objects', function() { + expect(element(by.id('default-spacing')).getText()).toMatch(/\{\n "name": ?"value"\n}/); + expect(element(by.id('custom-spacing')).getText()).toMatch(/\{\n "name": ?"value"\n}/); + }); + +
+ * + */ +function jsonFilter() { + return function(object, spacing) { + if (isUndefined(spacing)) { + spacing = 2; + } + return toJson(object, spacing); + }; +} + + +/** + * @ngdoc filter + * @name lowercase + * @kind function + * @description + * Converts string to lowercase. + * @see angular.lowercase + */ +var lowercaseFilter = valueFn(lowercase); + + +/** + * @ngdoc filter + * @name uppercase + * @kind function + * @description + * Converts string to uppercase. + * @see angular.uppercase + */ +var uppercaseFilter = valueFn(uppercase); + +/** + * @ngdoc filter + * @name limitTo + * @kind function + * + * @description + * Creates a new array or string containing only a specified number of elements. The elements + * are taken from either the beginning or the end of the source array, string or number, as specified by + * the value and sign (positive or negative) of `limit`. If a number is used as input, it is + * converted to a string. + * + * @param {Array|string|number} input Source array, string or number to be limited. + * @param {string|number} limit The length of the returned array or string. If the `limit` number + * is positive, `limit` number of items from the beginning of the source array/string are copied. + * If the number is negative, `limit` number of items from the end of the source array/string + * are copied. The `limit` will be trimmed if it exceeds `array.length` + * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array + * had less than `limit` elements. + * + * @example + + + +
+ Limit {{numbers}} to: +

Output numbers: {{ numbers | limitTo:numLimit }}

+ Limit {{letters}} to: +

Output letters: {{ letters | limitTo:letterLimit }}

+ Limit {{longNumber}} to: +

Output long number: {{ longNumber | limitTo:longNumberLimit }}

+
+
+ + var numLimitInput = element(by.model('numLimit')); + var letterLimitInput = element(by.model('letterLimit')); + var longNumberLimitInput = element(by.model('longNumberLimit')); + var limitedNumbers = element(by.binding('numbers | limitTo:numLimit')); + var limitedLetters = element(by.binding('letters | limitTo:letterLimit')); + var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit')); + + it('should limit the number array to first three items', function() { + expect(numLimitInput.getAttribute('value')).toBe('3'); + expect(letterLimitInput.getAttribute('value')).toBe('3'); + expect(longNumberLimitInput.getAttribute('value')).toBe('3'); + expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]'); + expect(limitedLetters.getText()).toEqual('Output letters: abc'); + expect(limitedLongNumber.getText()).toEqual('Output long number: 234'); + }); + + // There is a bug in safari and protractor that doesn't like the minus key + // it('should update the output when -3 is entered', function() { + // numLimitInput.clear(); + // numLimitInput.sendKeys('-3'); + // letterLimitInput.clear(); + // letterLimitInput.sendKeys('-3'); + // longNumberLimitInput.clear(); + // longNumberLimitInput.sendKeys('-3'); + // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]'); + // expect(limitedLetters.getText()).toEqual('Output letters: ghi'); + // expect(limitedLongNumber.getText()).toEqual('Output long number: 342'); + // }); + + it('should not exceed the maximum size of input array', function() { + numLimitInput.clear(); + numLimitInput.sendKeys('100'); + letterLimitInput.clear(); + letterLimitInput.sendKeys('100'); + longNumberLimitInput.clear(); + longNumberLimitInput.sendKeys('100'); + expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]'); + expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi'); + expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342'); + }); + +
+*/ +function limitToFilter() { + return function(input, limit) { + if (isNumber(input)) input = input.toString(); + if (!isArray(input) && !isString(input)) return input; + + if (Math.abs(Number(limit)) === Infinity) { + limit = Number(limit); + } else { + limit = int(limit); + } + + //NaN check on limit + if (limit) { + return limit > 0 ? input.slice(0, limit) : input.slice(limit); + } else { + return isString(input) ? "" : []; + } + }; +} + +/** + * @ngdoc filter + * @name orderBy + * @kind function + * + * @description + * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically + * for strings and numerically for numbers. Note: if you notice numbers are not being sorted + * correctly, make sure they are actually being saved as numbers and not strings. + * + * @param {Array} array The array to sort. + * @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be + * used by the comparator to determine the order of elements. + * + * Can be one of: + * + * - `function`: Getter function. The result of this function will be sorted using the + * `<`, `===`, `>` operator. + * - `string`: An Angular expression. The result of this expression is used to compare elements + * (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by + * 3 first characters of a property called `name`). The result of a constant expression + * is interpreted as a property name to be used in comparisons (for example `"special name"` + * to sort object by the value of their `special name` property). An expression can be + * optionally prefixed with `+` or `-` to control ascending or descending sort order + * (for example, `+name` or `-name`). If no property is provided, (e.g. `'+'`) then the array + * element itself is used to compare where sorting. + * - `Array`: An array of function or string predicates. The first predicate in the array + * is used for sorting, but when two items are equivalent, the next predicate is used. + * + * If the predicate is missing or empty then it defaults to `'+'`. + * + * @param {boolean=} reverse Reverse the order of the array. + * @returns {Array} Sorted copy of the source array. + * + * + * @example + * The example below demonstrates a simple ngRepeat, where the data is sorted + * by age in descending order (predicate is set to `'-age'`). + * `reverse` is not set, which means it defaults to `false`. + + + +
+ + + + + + + + + + + +
NamePhone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
+
+
+
+ * + * The predicate and reverse parameters can be controlled dynamically through scope properties, + * as shown in the next example. + * @example + + + +
+
Sorting predicate = {{predicate}}; reverse = {{reverse}}
+
+ [ unsorted ] + + + + + + + + + + + +
Name + (^)Phone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
+
+
+
+ * + * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the + * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the + * desired parameters. + * + * Example: + * + * @example + + +
+ + + + + + + + + + + +
Name + (^)Phone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
+
+
+ + + angular.module('orderByExample', []) + .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) { + var orderBy = $filter('orderBy'); + $scope.friends = [ + { name: 'John', phone: '555-1212', age: 10 }, + { name: 'Mary', phone: '555-9876', age: 19 }, + { name: 'Mike', phone: '555-4321', age: 21 }, + { name: 'Adam', phone: '555-5678', age: 35 }, + { name: 'Julie', phone: '555-8765', age: 29 } + ]; + $scope.order = function(predicate, reverse) { + $scope.friends = orderBy($scope.friends, predicate, reverse); + }; + $scope.order('-age',false); + }]); + +
+ */ +orderByFilter.$inject = ['$parse']; +function orderByFilter($parse) { + return function(array, sortPredicate, reverseOrder) { + if (!(isArrayLike(array))) return array; + sortPredicate = isArray(sortPredicate) ? sortPredicate : [sortPredicate]; + if (sortPredicate.length === 0) { sortPredicate = ['+']; } + sortPredicate = sortPredicate.map(function(predicate) { + var descending = false, get = predicate || identity; + if (isString(predicate)) { + if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) { + descending = predicate.charAt(0) == '-'; + predicate = predicate.substring(1); + } + if (predicate === '') { + // Effectively no predicate was passed so we compare identity + return reverseComparator(compare, descending); + } + get = $parse(predicate); + if (get.constant) { + var key = get(); + return reverseComparator(function(a, b) { + return compare(a[key], b[key]); + }, descending); + } + } + return reverseComparator(function(a, b) { + return compare(get(a),get(b)); + }, descending); + }); + return slice.call(array).sort(reverseComparator(comparator, reverseOrder)); + + function comparator(o1, o2) { + for (var i = 0; i < sortPredicate.length; i++) { + var comp = sortPredicate[i](o1, o2); + if (comp !== 0) return comp; + } + return 0; + } + function reverseComparator(comp, descending) { + return descending + ? function(a, b) {return comp(b,a);} + : comp; + } + + function isPrimitive(value) { + switch (typeof value) { + case 'number': /* falls through */ + case 'boolean': /* falls through */ + case 'string': + return true; + default: + return false; + } + } + + function objectToString(value) { + if (value === null) return 'null'; + if (typeof value.valueOf === 'function') { + value = value.valueOf(); + if (isPrimitive(value)) return value; + } + if (typeof value.toString === 'function') { + value = value.toString(); + if (isPrimitive(value)) return value; + } + return ''; + } + + function compare(v1, v2) { + var t1 = typeof v1; + var t2 = typeof v2; + if (t1 === t2 && t1 === "object") { + v1 = objectToString(v1); + v2 = objectToString(v2); + } + if (t1 === t2) { + if (t1 === "string") { + v1 = v1.toLowerCase(); + v2 = v2.toLowerCase(); + } + if (v1 === v2) return 0; + return v1 < v2 ? -1 : 1; + } else { + return t1 < t2 ? -1 : 1; + } + } + }; +} + +function ngDirective(directive) { + if (isFunction(directive)) { + directive = { + link: directive + }; + } + directive.restrict = directive.restrict || 'AC'; + return valueFn(directive); +} + +/** + * @ngdoc directive + * @name a + * @restrict E + * + * @description + * Modifies the default behavior of the html A tag so that the default action is prevented when + * the href attribute is empty. + * + * This change permits the easy creation of action links with the `ngClick` directive + * without changing the location or causing page reloads, e.g.: + * `Add Item` + */ +var htmlAnchorDirective = valueFn({ + restrict: 'E', + compile: function(element, attr) { + if (!attr.href && !attr.xlinkHref && !attr.name) { + return function(scope, element) { + // If the linked element is not an anchor tag anymore, do nothing + if (element[0].nodeName.toLowerCase() !== 'a') return; + + // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. + var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? + 'xlink:href' : 'href'; + element.on('click', function(event) { + // if we have no href url, then don't navigate anywhere. + if (!element.attr(href)) { + event.preventDefault(); + } + }); + }; + } + } +}); + +/** + * @ngdoc directive + * @name ngHref + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in an href attribute will + * make the link go to the wrong URL if the user clicks it before + * Angular has a chance to replace the `{{hash}}` markup with its + * value. Until Angular replaces the markup the link will be broken + * and will most likely return a 404 error. The `ngHref` directive + * solves this problem. + * + * The wrong way to write it: + * ```html + * link1 + * ``` + * + * The correct way to write it: + * ```html + * link1 + * ``` + * + * @element A + * @param {template} ngHref any string which can contain `{{}}` markup. + * + * @example + * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes + * in links and their different behaviors: + + +
+ link 1 (link, don't reload)
+ link 2 (link, don't reload)
+ link 3 (link, reload!)
+ anchor (link, don't reload)
+ anchor (no link)
+ link (link, change location) +
+ + it('should execute ng-click but not reload when href without value', function() { + element(by.id('link-1')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('1'); + expect(element(by.id('link-1')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click but not reload when href empty string', function() { + element(by.id('link-2')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('2'); + expect(element(by.id('link-2')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click and change url when ng-href specified', function() { + expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/); + + element(by.id('link-3')).click(); + + // At this point, we navigate away from an Angular page, so we need + // to use browser.driver to get the base webdriver. + + browser.wait(function() { + return browser.driver.getCurrentUrl().then(function(url) { + return url.match(/\/123$/); + }); + }, 5000, 'page should navigate to /123'); + }); + + xit('should execute ng-click but not reload when href empty string and name specified', function() { + element(by.id('link-4')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('4'); + expect(element(by.id('link-4')).getAttribute('href')).toBe(''); + }); + + it('should execute ng-click but not reload when no href but name specified', function() { + element(by.id('link-5')).click(); + expect(element(by.model('value')).getAttribute('value')).toEqual('5'); + expect(element(by.id('link-5')).getAttribute('href')).toBe(null); + }); + + it('should only change url when only ng-href', function() { + element(by.model('value')).clear(); + element(by.model('value')).sendKeys('6'); + expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/); + + element(by.id('link-6')).click(); + + // At this point, we navigate away from an Angular page, so we need + // to use browser.driver to get the base webdriver. + browser.wait(function() { + return browser.driver.getCurrentUrl().then(function(url) { + return url.match(/\/6$/); + }); + }, 5000, 'page should navigate to /6'); + }); + +
+ */ + +/** + * @ngdoc directive + * @name ngSrc + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in a `src` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrc` directive solves this problem. + * + * The buggy way to write it: + * ```html + * + * ``` + * + * The correct way to write it: + * ```html + * + * ``` + * + * @element IMG + * @param {template} ngSrc any string which can contain `{{}}` markup. + */ + +/** + * @ngdoc directive + * @name ngSrcset + * @restrict A + * @priority 99 + * + * @description + * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until Angular replaces the expression inside + * `{{hash}}`. The `ngSrcset` directive solves this problem. + * + * The buggy way to write it: + * ```html + * + * ``` + * + * The correct way to write it: + * ```html + * + * ``` + * + * @element IMG + * @param {template} ngSrcset any string which can contain `{{}}` markup. + */ + +/** + * @ngdoc directive + * @name ngDisabled + * @restrict A + * @priority 100 + * + * @description + * + * This directive sets the `disabled` attribute on the element if the + * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy. + * + * A special directive is necessary because we cannot use interpolation inside the `disabled` + * attribute. The following example would make the button enabled on Chrome/Firefox + * but not on older IEs: + * + * ```html + * + *
+ * + *
+ * ``` + * + * This is because the HTML specification does not require browsers to preserve the values of + * boolean attributes such as `disabled` (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * + * @example + + + Click me to toggle:
+ +
+ + it('should toggle button', function() { + expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy(); + element(by.model('checked')).click(); + expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy(); + }); + +
+ * + * @element INPUT + * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy, + * then the `disabled` attribute will be set on the element + */ + + +/** + * @ngdoc directive + * @name ngChecked + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as checked. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngChecked` directive solves this problem for the `checked` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + + Check me to check both:
+ +
+ + it('should check both checkBoxes', function() { + expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy(); + element(by.model('master')).click(); + expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy(); + }); + +
+ * + * @element INPUT + * @param {expression} ngChecked If the {@link guide/expression expression} is truthy, + * then special attribute "checked" will be set on the element + */ + + +/** + * @ngdoc directive + * @name ngReadonly + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as readonly. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngReadonly` directive solves this problem for the `readonly` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + + Check me to make text readonly:
+ +
+ + it('should toggle readonly attr', function() { + expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy(); + element(by.model('checked')).click(); + expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy(); + }); + +
+ * + * @element INPUT + * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy, + * then special attribute "readonly" will be set on the element + */ + + +/** + * @ngdoc directive + * @name ngSelected + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as selected. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngSelected` directive solves this problem for the `selected` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * + * @example + + + Check me to select:
+ +
+ + it('should select Greetings!', function() { + expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy(); + element(by.model('selected')).click(); + expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy(); + }); + +
+ * + * @element OPTION + * @param {expression} ngSelected If the {@link guide/expression expression} is truthy, + * then special attribute "selected" will be set on the element + */ + +/** + * @ngdoc directive + * @name ngOpen + * @restrict A + * @priority 100 + * + * @description + * The HTML specification does not require browsers to preserve the values of boolean attributes + * such as open. (Their presence means true and their absence means false.) + * If we put an Angular interpolation expression into such an attribute then the + * binding information would be lost when the browser removes the attribute. + * The `ngOpen` directive solves this problem for the `open` attribute. + * This complementary directive is not removed by the browser and so provides + * a permanent reliable place to store the binding information. + * @example + + + Check me check multiple:
+
+ Show/Hide me +
+
+ + it('should toggle open', function() { + expect(element(by.id('details')).getAttribute('open')).toBeFalsy(); + element(by.model('open')).click(); + expect(element(by.id('details')).getAttribute('open')).toBeTruthy(); + }); + +
+ * + * @element DETAILS + * @param {expression} ngOpen If the {@link guide/expression expression} is truthy, + * then special attribute "open" will be set on the element + */ + +var ngAttributeAliasDirectives = {}; + + +// boolean attrs are evaluated +forEach(BOOLEAN_ATTR, function(propName, attrName) { + // binding to multiple is not supported + if (propName == "multiple") return; + + var normalized = directiveNormalize('ng-' + attrName); + ngAttributeAliasDirectives[normalized] = function() { + return { + restrict: 'A', + priority: 100, + link: function(scope, element, attr) { + scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) { + attr.$set(attrName, !!value); + }); + } + }; + }; +}); + +// aliased input attrs are evaluated +forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) { + ngAttributeAliasDirectives[ngAttr] = function() { + return { + priority: 100, + link: function(scope, element, attr) { + //special case ngPattern when a literal regular expression value + //is used as the expression (this way we don't have to watch anything). + if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) == "/") { + var match = attr.ngPattern.match(REGEX_STRING_REGEXP); + if (match) { + attr.$set("ngPattern", new RegExp(match[1], match[2])); + return; + } + } + + scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) { + attr.$set(ngAttr, value); + }); + } + }; + }; +}); + +// ng-src, ng-srcset, ng-href are interpolated +forEach(['src', 'srcset', 'href'], function(attrName) { + var normalized = directiveNormalize('ng-' + attrName); + ngAttributeAliasDirectives[normalized] = function() { + return { + priority: 99, // it needs to run after the attributes are interpolated + link: function(scope, element, attr) { + var propName = attrName, + name = attrName; + + if (attrName === 'href' && + toString.call(element.prop('href')) === '[object SVGAnimatedString]') { + name = 'xlinkHref'; + attr.$attr[name] = 'xlink:href'; + propName = null; + } + + attr.$observe(normalized, function(value) { + if (!value) { + if (attrName === 'href') { + attr.$set(name, null); + } + return; + } + + attr.$set(name, value); + + // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist + // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need + // to set the property as well to achieve the desired effect. + // we use attr[attrName] value since $set can sanitize the url. + if (msie && propName) element.prop(propName, attr[name]); + }); + } + }; + }; +}); + +/* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true + */ +var nullFormCtrl = { + $addControl: noop, + $$renameControl: nullFormRenameControl, + $removeControl: noop, + $setValidity: noop, + $setDirty: noop, + $setPristine: noop, + $setSubmitted: noop +}, +SUBMITTED_CLASS = 'ng-submitted'; + +function nullFormRenameControl(control, name) { + control.$name = name; +} + +/** + * @ngdoc type + * @name form.FormController + * + * @property {boolean} $pristine True if user has not interacted with the form yet. + * @property {boolean} $dirty True if user has already interacted with the form. + * @property {boolean} $valid True if all of the containing forms and controls are valid. + * @property {boolean} $invalid True if at least one containing control or form is invalid. + * @property {boolean} $submitted True if user has submitted the form even if its invalid. + * + * @property {Object} $error Is an object hash, containing references to controls or + * forms with failing validators, where: + * + * - keys are validation tokens (error names), + * - values are arrays of controls or forms that have a failing validator for given error name. + * + * Built-in validation tokens: + * + * - `email` + * - `max` + * - `maxlength` + * - `min` + * - `minlength` + * - `number` + * - `pattern` + * - `required` + * - `url` + * - `date` + * - `datetimelocal` + * - `time` + * - `week` + * - `month` + * + * @description + * `FormController` keeps track of all its controls and nested forms as well as the state of them, + * such as being valid/invalid or dirty/pristine. + * + * Each {@link ng.directive:form form} directive creates an instance + * of `FormController`. + * + */ +//asks for $scope to fool the BC controller module +FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate']; +function FormController(element, attrs, $scope, $animate, $interpolate) { + var form = this, + controls = []; + + var parentForm = form.$$parentForm = element.parent().controller('form') || nullFormCtrl; + + // init state + form.$error = {}; + form.$$success = {}; + form.$pending = undefined; + form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope); + form.$dirty = false; + form.$pristine = true; + form.$valid = true; + form.$invalid = false; + form.$submitted = false; + + parentForm.$addControl(form); + + /** + * @ngdoc method + * @name form.FormController#$rollbackViewValue + * + * @description + * Rollback all form controls pending updates to the `$modelValue`. + * + * Updates may be pending by a debounced event or because the input is waiting for a some future + * event defined in `ng-model-options`. This method is typically needed by the reset button of + * a form that uses `ng-model-options` to pend updates. + */ + form.$rollbackViewValue = function() { + forEach(controls, function(control) { + control.$rollbackViewValue(); + }); + }; + + /** + * @ngdoc method + * @name form.FormController#$commitViewValue + * + * @description + * Commit all form controls pending updates to the `$modelValue`. + * + * Updates may be pending by a debounced event or because the input is waiting for a some future + * event defined in `ng-model-options`. This method is rarely needed as `NgModelController` + * usually handles calling this in response to input events. + */ + form.$commitViewValue = function() { + forEach(controls, function(control) { + control.$commitViewValue(); + }); + }; + + /** + * @ngdoc method + * @name form.FormController#$addControl + * + * @description + * Register a control with the form. + * + * Input elements using ngModelController do this automatically when they are linked. + */ + form.$addControl = function(control) { + // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored + // and not added to the scope. Now we throw an error. + assertNotHasOwnProperty(control.$name, 'input'); + controls.push(control); + + if (control.$name) { + form[control.$name] = control; + } + }; + + // Private API: rename a form control + form.$$renameControl = function(control, newName) { + var oldName = control.$name; + + if (form[oldName] === control) { + delete form[oldName]; + } + form[newName] = control; + control.$name = newName; + }; + + /** + * @ngdoc method + * @name form.FormController#$removeControl + * + * @description + * Deregister a control from the form. + * + * Input elements using ngModelController do this automatically when they are destroyed. + */ + form.$removeControl = function(control) { + if (control.$name && form[control.$name] === control) { + delete form[control.$name]; + } + forEach(form.$pending, function(value, name) { + form.$setValidity(name, null, control); + }); + forEach(form.$error, function(value, name) { + form.$setValidity(name, null, control); + }); + forEach(form.$$success, function(value, name) { + form.$setValidity(name, null, control); + }); + + arrayRemove(controls, control); + }; + + + /** + * @ngdoc method + * @name form.FormController#$setValidity + * + * @description + * Sets the validity of a form control. + * + * This method will also propagate to parent forms. + */ + addSetValidityMethod({ + ctrl: this, + $element: element, + set: function(object, property, controller) { + var list = object[property]; + if (!list) { + object[property] = [controller]; + } else { + var index = list.indexOf(controller); + if (index === -1) { + list.push(controller); + } + } + }, + unset: function(object, property, controller) { + var list = object[property]; + if (!list) { + return; + } + arrayRemove(list, controller); + if (list.length === 0) { + delete object[property]; + } + }, + parentForm: parentForm, + $animate: $animate + }); + + /** + * @ngdoc method + * @name form.FormController#$setDirty + * + * @description + * Sets the form to a dirty state. + * + * This method can be called to add the 'ng-dirty' class and set the form to a dirty + * state (ng-dirty class). This method will also propagate to parent forms. + */ + form.$setDirty = function() { + $animate.removeClass(element, PRISTINE_CLASS); + $animate.addClass(element, DIRTY_CLASS); + form.$dirty = true; + form.$pristine = false; + parentForm.$setDirty(); + }; + + /** + * @ngdoc method + * @name form.FormController#$setPristine + * + * @description + * Sets the form to its pristine state. + * + * This method can be called to remove the 'ng-dirty' class and set the form to its pristine + * state (ng-pristine class). This method will also propagate to all the controls contained + * in this form. + * + * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after + * saving or resetting it. + */ + form.$setPristine = function() { + $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS); + form.$dirty = false; + form.$pristine = true; + form.$submitted = false; + forEach(controls, function(control) { + control.$setPristine(); + }); + }; + + /** + * @ngdoc method + * @name form.FormController#$setUntouched + * + * @description + * Sets the form to its untouched state. + * + * This method can be called to remove the 'ng-touched' class and set the form controls to their + * untouched state (ng-untouched class). + * + * Setting a form controls back to their untouched state is often useful when setting the form + * back to its pristine state. + */ + form.$setUntouched = function() { + forEach(controls, function(control) { + control.$setUntouched(); + }); + }; + + /** + * @ngdoc method + * @name form.FormController#$setSubmitted + * + * @description + * Sets the form to its submitted state. + */ + form.$setSubmitted = function() { + $animate.addClass(element, SUBMITTED_CLASS); + form.$submitted = true; + parentForm.$setSubmitted(); + }; +} + +/** + * @ngdoc directive + * @name ngForm + * @restrict EAC + * + * @description + * Nestable alias of {@link ng.directive:form `form`} directive. HTML + * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a + * sub-group of controls needs to be determined. + * + * Note: the purpose of `ngForm` is to group controls, + * but not to be a replacement for the `
` tag with all of its capabilities + * (e.g. posting to the server, ...). + * + * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into + * related scope, under this name. + * + */ + + /** + * @ngdoc directive + * @name form + * @restrict E + * + * @description + * Directive that instantiates + * {@link form.FormController FormController}. + * + * If the `name` attribute is specified, the form controller is published onto the current scope under + * this name. + * + * # Alias: {@link ng.directive:ngForm `ngForm`} + * + * In Angular, forms can be nested. This means that the outer form is valid when all of the child + * forms are valid as well. However, browsers do not allow nesting of `` elements, so + * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to + * `` but can be nested. This allows you to have nested forms, which is very useful when + * using Angular validation directives in forms that are dynamically generated using the + * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name` + * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an + * `ngForm` directive and nest these in an outer `form` element. + * + * + * # CSS classes + * - `ng-valid` is set if the form is valid. + * - `ng-invalid` is set if the form is invalid. + * - `ng-pristine` is set if the form is pristine. + * - `ng-dirty` is set if the form is dirty. + * - `ng-submitted` is set if the form was submitted. + * + * Keep in mind that ngAnimate can detect each of these classes when added and removed. + * + * + * # Submitting a form and preventing the default action + * + * Since the role of forms in client-side Angular applications is different than in classical + * roundtrip apps, it is desirable for the browser not to translate the form submission into a full + * page reload that sends the data to the server. Instead some javascript logic should be triggered + * to handle the form submission in an application-specific way. + * + * For this reason, Angular prevents the default action (form submission to the server) unless the + * `` element has an `action` attribute specified. + * + * You can use one of the following two ways to specify what javascript method should be called when + * a form is submitted: + * + * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element + * - {@link ng.directive:ngClick ngClick} directive on the first + * button or input field of type submit (input[type=submit]) + * + * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit} + * or {@link ng.directive:ngClick ngClick} directives. + * This is because of the following form submission rules in the HTML specification: + * + * - If a form has only one input field then hitting enter in this field triggers form submit + * (`ngSubmit`) + * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter + * doesn't trigger submit + * - if a form has one or more input fields and one or more buttons or input[type=submit] then + * hitting enter in any of the input fields will trigger the click handler on the *first* button or + * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`) + * + * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is + * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit` + * to have access to the updated model. + * + * ## Animation Hooks + * + * Animations in ngForm are triggered when any of the associated CSS classes are added and removed. + * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any + * other validations that are performed within the form. Animations in ngForm are similar to how + * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well + * as JS animations. + * + * The following example shows a simple way to utilize CSS transitions to style a form element + * that has been rendered as invalid after it has been validated: + * + *
+ * //be sure to include ngAnimate as a module to hook into more
+ * //advanced animations
+ * .my-form {
+ *   transition:0.5s linear all;
+ *   background: white;
+ * }
+ * .my-form.ng-invalid {
+ *   background: red;
+ *   color:white;
+ * }
+ * 
+ * + * @example + + + + + + userType: + Required!
+ userType = {{userType}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+ +
+ + it('should initialize to model', function() { + var userType = element(by.binding('userType')); + var valid = element(by.binding('myForm.input.$valid')); + + expect(userType.getText()).toContain('guest'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + var userType = element(by.binding('userType')); + var valid = element(by.binding('myForm.input.$valid')); + var userInput = element(by.model('userType')); + + userInput.clear(); + userInput.sendKeys(''); + + expect(userType.getText()).toEqual('userType ='); + expect(valid.getText()).toContain('false'); + }); + +
+ * + * @param {string=} name Name of the form. If specified, the form controller will be published into + * related scope, under this name. + */ +var formDirectiveFactory = function(isNgForm) { + return ['$timeout', function($timeout) { + var formDirective = { + name: 'form', + restrict: isNgForm ? 'EAC' : 'E', + controller: FormController, + compile: function ngFormCompile(formElement, attr) { + // Setup initial state of the control + formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS); + + var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false); + + return { + pre: function ngFormPreLink(scope, formElement, attr, controller) { + // if `action` attr is not present on the form, prevent the default action (submission) + if (!('action' in attr)) { + // we can't use jq events because if a form is destroyed during submission the default + // action is not prevented. see #1238 + // + // IE 9 is not affected because it doesn't fire a submit event and try to do a full + // page reload if the form was destroyed by submission of the form via a click handler + // on a button in the form. Looks like an IE9 specific bug. + var handleFormSubmission = function(event) { + scope.$apply(function() { + controller.$commitViewValue(); + controller.$setSubmitted(); + }); + + event.preventDefault(); + }; + + addEventListenerFn(formElement[0], 'submit', handleFormSubmission); + + // unregister the preventDefault listener so that we don't not leak memory but in a + // way that will achieve the prevention of the default action. + formElement.on('$destroy', function() { + $timeout(function() { + removeEventListenerFn(formElement[0], 'submit', handleFormSubmission); + }, 0, false); + }); + } + + var parentFormCtrl = controller.$$parentForm; + + if (nameAttr) { + setter(scope, null, controller.$name, controller, controller.$name); + attr.$observe(nameAttr, function(newValue) { + if (controller.$name === newValue) return; + setter(scope, null, controller.$name, undefined, controller.$name); + parentFormCtrl.$$renameControl(controller, newValue); + setter(scope, null, controller.$name, controller, controller.$name); + }); + } + formElement.on('$destroy', function() { + parentFormCtrl.$removeControl(controller); + if (nameAttr) { + setter(scope, null, attr[nameAttr], undefined, controller.$name); + } + extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards + }); + } + }; + } + }; + + return formDirective; + }]; +}; + +var formDirective = formDirectiveFactory(); +var ngFormDirective = formDirectiveFactory(true); + +/* global VALID_CLASS: false, + INVALID_CLASS: false, + PRISTINE_CLASS: false, + DIRTY_CLASS: false, + UNTOUCHED_CLASS: false, + TOUCHED_CLASS: false, + ngModelMinErr: false, +*/ + +// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231 +var 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)/; +var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/; +var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i; +var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/; +var DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})$/; +var DATETIMELOCAL_REGEXP = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; +var WEEK_REGEXP = /^(\d{4})-W(\d\d)$/; +var MONTH_REGEXP = /^(\d{4})-(\d\d)$/; +var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/; + +var inputType = { + + /** + * @ngdoc input + * @name input[text] + * + * @description + * Standard HTML text input with angular data binding, inherited by most of the `input` elements. + * + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Adds `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of + * any length. + * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string + * that contains the regular expression body that will be converted to a regular expression + * as in the ngPattern directive. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object then this is used directly. + * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` + * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + * This parameter is ignored for input[type=password] controls, which will never trim the + * input. + * + * @example + + + +
+ Single word: + + Required! + + Single word only! + + text = {{example.text}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var text = element(by.binding('example.text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('guest'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if multi word', function() { + input.clear(); + input.sendKeys('hello world'); + + expect(valid.getText()).toContain('false'); + }); + +
+ */ + 'text': textInputType, + + /** + * @ngdoc input + * @name input[date] + * + * @description + * Input with date validation and transformation. In browsers that do not yet support + * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601 + * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many + * modern browsers do not yet support this input type, it is important to provide cues to users on the + * expected input format via a placeholder or label. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a + * valid ISO date string (yyyy-MM-dd). + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be + * a valid ISO date string (yyyy-MM-dd). + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Pick a date in 2013: + + + Required! + + Not a valid date! + value = {{example.value | date: "yyyy-MM-dd"}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var value = element(by.binding('example.value | date: "yyyy-MM-dd"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (see https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('2013-10-22'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('2015-01-01'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
+ */ + 'date': createDateInputType('date', DATE_REGEXP, + createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']), + 'yyyy-MM-dd'), + + /** + * @ngdoc input + * @name input[datetime-local] + * + * @description + * Input with datetime validation and transformation. In browsers that do not yet support + * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 + * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a + * valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be + * a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Pick a date between in 2013: + + + Required! + + Not a valid date! + value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var value = element(by.binding('example.value | date: "yyyy-MM-ddTHH:mm:ss"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('2010-12-28T14:57:00'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('2015-01-01T23:59:00'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
+ */ + 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP, + createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']), + 'yyyy-MM-ddTHH:mm:ss.sss'), + + /** + * @ngdoc input + * @name input[time] + * + * @description + * Input with time validation and transformation. In browsers that do not yet support + * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 + * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a + * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a + * valid ISO time format (HH:mm:ss). + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be a + * valid ISO time format (HH:mm:ss). + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Pick a between 8am and 5pm: + + + Required! + + Not a valid date! + value = {{example.value | date: "HH:mm:ss"}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var value = element(by.binding('example.value | date: "HH:mm:ss"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('14:57:00'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('23:59:00'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
+ */ + 'time': createDateInputType('time', TIME_REGEXP, + createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']), + 'HH:mm:ss.sss'), + + /** + * @ngdoc input + * @name input[week] + * + * @description + * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support + * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 + * week format (yyyy-W##), for example: `2013-W02`. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a + * valid ISO week format (yyyy-W##). + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be + * a valid ISO week format (yyyy-W##). + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Pick a date between in 2013: + + + Required! + + Not a valid date! + value = {{example.value | date: "yyyy-Www"}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var value = element(by.binding('example.value | date: "yyyy-Www"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('2013-W01'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('2015-W01'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
+ */ + 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'), + + /** + * @ngdoc input + * @name input[month] + * + * @description + * Input with month validation and transformation. In browsers that do not yet support + * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601 + * month format (yyyy-MM), for example: `2009-01`. + * + * The model must always be a Date object, otherwise Angular will throw an error. + * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string. + * If the model is not set to the first of the month, the next view to model update will set it + * to the first of the month. + * + * The timezone to be used to read/write the `Date` instance in the model can be defined using + * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be + * a valid ISO month format (yyyy-MM). + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must + * be a valid ISO month format (yyyy-MM). + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Pick a month in 2013: + + + Required! + + Not a valid month! + value = {{example.value | date: "yyyy-MM"}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var value = element(by.binding('example.value | date: "yyyy-MM"')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + // currently protractor/webdriver does not support + // sending keys to all known HTML5 input controls + // for various browsers (https://github.com/angular/protractor/issues/562). + function setInput(val) { + // set the value of the element and force validation. + var scr = "var ipt = document.getElementById('exampleInput'); " + + "ipt.value = '" + val + "';" + + "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });"; + browser.executeScript(scr); + } + + it('should initialize to model', function() { + expect(value.getText()).toContain('2013-10'); + expect(valid.getText()).toContain('myForm.input.$valid = true'); + }); + + it('should be invalid if empty', function() { + setInput(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + + it('should be invalid if over max', function() { + setInput('2015-01'); + expect(value.getText()).toContain(''); + expect(valid.getText()).toContain('myForm.input.$valid = false'); + }); + +
+ */ + 'month': createDateInputType('month', MONTH_REGEXP, + createDateParser(MONTH_REGEXP, ['yyyy', 'MM']), + 'yyyy-MM'), + + /** + * @ngdoc input + * @name input[number] + * + * @description + * Text input with number validation and transformation. Sets the `number` validation + * error if not a valid number. + * + *
+ * The model must always be of type `number` otherwise Angular will throw an error. + * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt} + * error docs for more information and an example of how to convert your model if necessary. + *
+ * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. + * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of + * any length. + * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string + * that contains the regular expression body that will be converted to a regular expression + * as in the ngPattern directive. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object then this is used directly. + * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` + * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Number: + + Required! + + Not valid number! + value = {{example.value}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+
+
+ + var value = element(by.binding('example.value')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('example.value')); + + it('should initialize to model', function() { + expect(value.getText()).toContain('12'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if over max', function() { + input.clear(); + input.sendKeys('123'); + expect(value.getText()).toEqual('value ='); + expect(valid.getText()).toContain('false'); + }); + +
+ */ + 'number': numberInputType, + + + /** + * @ngdoc input + * @name input[url] + * + * @description + * Text input with URL validation. Sets the `url` validation error key if the content is not a + * valid URL. + * + *
+ * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex + * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify + * the built-in validators (see the {@link guide/forms Forms guide}) + *
+ * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of + * any length. + * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string + * that contains the regular expression body that will be converted to a regular expression + * as in the ngPattern directive. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object then this is used directly. + * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` + * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ URL: + + Required! + + Not valid url! + text = {{url.text}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+ myForm.$error.url = {{!!myForm.$error.url}}
+
+
+ + var text = element(by.binding('url.text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('url.text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('http://google.com'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if not url', function() { + input.clear(); + input.sendKeys('box'); + + expect(valid.getText()).toContain('false'); + }); + +
+ */ + 'url': urlInputType, + + + /** + * @ngdoc input + * @name input[email] + * + * @description + * Text input with email validation. Sets the `email` validation error key if not a valid email + * address. + * + *
+ * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex + * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can + * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide}) + *
+ * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of + * any length. + * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string + * that contains the regular expression body that will be converted to a regular expression + * as in the ngPattern directive. + * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match + * a RegExp found by evaluating the Angular expression given in the attribute value. + * If the expression evaluates to a RegExp object then this is used directly. + * If the expression is a string then it will be converted to a RegExp after wrapping it in `^` and `$` + * characters. For instance, `"abc"` will be converted to `new RegExp('^abc$')`. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Email: + + Required! + + Not valid email! + text = {{email.text}}
+ myForm.input.$valid = {{myForm.input.$valid}}
+ myForm.input.$error = {{myForm.input.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+ myForm.$error.email = {{!!myForm.$error.email}}
+
+
+ + var text = element(by.binding('email.text')); + var valid = element(by.binding('myForm.input.$valid')); + var input = element(by.model('email.text')); + + it('should initialize to model', function() { + expect(text.getText()).toContain('me@example.com'); + expect(valid.getText()).toContain('true'); + }); + + it('should be invalid if empty', function() { + input.clear(); + input.sendKeys(''); + expect(text.getText()).toEqual('text ='); + expect(valid.getText()).toContain('false'); + }); + + it('should be invalid if not email', function() { + input.clear(); + input.sendKeys('xxx'); + + expect(valid.getText()).toContain('false'); + }); + +
+ */ + 'email': emailInputType, + + + /** + * @ngdoc input + * @name input[radio] + * + * @description + * HTML radio button. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string} value The value to which the expression should be set when selected. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {string} ngValue Angular expression which sets the value to which the expression should + * be set when selected. + * + * @example + + + +
+ Red
+ Green
+ Blue
+ color = {{color.name | json}}
+
+ Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`. +
+ + it('should change state', function() { + var color = element(by.binding('color.name')); + + expect(color.getText()).toContain('blue'); + + element.all(by.model('color.name')).get(0).click(); + + expect(color.getText()).toContain('red'); + }); + +
+ */ + 'radio': radioInputType, + + + /** + * @ngdoc input + * @name input[checkbox] + * + * @description + * HTML checkbox. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {expression=} ngTrueValue The value to which the expression should be set when selected. + * @param {expression=} ngFalseValue The value to which the expression should be set when not selected. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * + * @example + + + +
+ Value1:
+ Value2:
+ value1 = {{checkboxModel.value1}}
+ value2 = {{checkboxModel.value2}}
+
+
+ + it('should change state', function() { + var value1 = element(by.binding('checkboxModel.value1')); + var value2 = element(by.binding('checkboxModel.value2')); + + expect(value1.getText()).toContain('true'); + expect(value2.getText()).toContain('YES'); + + element(by.model('checkboxModel.value1')).click(); + element(by.model('checkboxModel.value2')).click(); + + expect(value1.getText()).toContain('false'); + expect(value2.getText()).toContain('NO'); + }); + +
+ */ + 'checkbox': checkboxInputType, + + 'hidden': noop, + 'button': noop, + 'submit': noop, + 'reset': noop, + 'file': noop +}; + +function stringBasedInputType(ctrl) { + ctrl.$formatters.push(function(value) { + return ctrl.$isEmpty(value) ? value : value.toString(); + }); +} + +function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + stringBasedInputType(ctrl); +} + +function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) { + var type = lowercase(element[0].type); + + // In composition mode, users are still inputing intermediate text buffer, + // hold the listener until composition is done. + // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent + if (!$sniffer.android) { + var composing = false; + + element.on('compositionstart', function(data) { + composing = true; + }); + + element.on('compositionend', function() { + composing = false; + listener(); + }); + } + + var listener = function(ev) { + if (timeout) { + $browser.defer.cancel(timeout); + timeout = null; + } + if (composing) return; + var value = element.val(), + event = ev && ev.type; + + // By default we will trim the value + // If the attribute ng-trim exists we will avoid trimming + // If input type is 'password', the value is never trimmed + if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) { + value = trim(value); + } + + // If a control is suffering from bad input (due to native validators), browsers discard its + // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the + // control's value is the same empty value twice in a row. + if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) { + ctrl.$setViewValue(value, event); + } + }; + + // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the + // input event on backspace, delete or cut + if ($sniffer.hasEvent('input')) { + element.on('input', listener); + } else { + var timeout; + + var deferListener = function(ev, input, origValue) { + if (!timeout) { + timeout = $browser.defer(function() { + timeout = null; + if (!input || input.value !== origValue) { + listener(ev); + } + }); + } + }; + + element.on('keydown', function(event) { + var key = event.keyCode; + + // ignore + // command modifiers arrows + if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return; + + deferListener(event, this, this.value); + }); + + // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it + if ($sniffer.hasEvent('paste')) { + element.on('paste cut', deferListener); + } + } + + // if user paste into input using mouse on older browser + // or form autocomplete on newer browser, we need "change" event to catch it + element.on('change', listener); + + ctrl.$render = function() { + element.val(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue); + }; +} + +function weekParser(isoWeek, existingDate) { + if (isDate(isoWeek)) { + return isoWeek; + } + + if (isString(isoWeek)) { + WEEK_REGEXP.lastIndex = 0; + var parts = WEEK_REGEXP.exec(isoWeek); + if (parts) { + var year = +parts[1], + week = +parts[2], + hours = 0, + minutes = 0, + seconds = 0, + milliseconds = 0, + firstThurs = getFirstThursdayOfYear(year), + addDays = (week - 1) * 7; + + if (existingDate) { + hours = existingDate.getHours(); + minutes = existingDate.getMinutes(); + seconds = existingDate.getSeconds(); + milliseconds = existingDate.getMilliseconds(); + } + + return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds); + } + } + + return NaN; +} + +function createDateParser(regexp, mapping) { + return function(iso, date) { + var parts, map; + + if (isDate(iso)) { + return iso; + } + + if (isString(iso)) { + // When a date is JSON'ified to wraps itself inside of an extra + // set of double quotes. This makes the date parsing code unable + // to match the date string and parse it as a date. + if (iso.charAt(0) == '"' && iso.charAt(iso.length - 1) == '"') { + iso = iso.substring(1, iso.length - 1); + } + if (ISO_DATE_REGEXP.test(iso)) { + return new Date(iso); + } + regexp.lastIndex = 0; + parts = regexp.exec(iso); + + if (parts) { + parts.shift(); + if (date) { + map = { + yyyy: date.getFullYear(), + MM: date.getMonth() + 1, + dd: date.getDate(), + HH: date.getHours(), + mm: date.getMinutes(), + ss: date.getSeconds(), + sss: date.getMilliseconds() / 1000 + }; + } else { + map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 }; + } + + forEach(parts, function(part, index) { + if (index < mapping.length) { + map[mapping[index]] = +part; + } + }); + return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0); + } + } + + return NaN; + }; +} + +function createDateInputType(type, regexp, parseDate, format) { + return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) { + badInputChecker(scope, element, attr, ctrl); + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + var timezone = ctrl && ctrl.$options && ctrl.$options.timezone; + var previousDate; + + ctrl.$$parserName = type; + ctrl.$parsers.push(function(value) { + if (ctrl.$isEmpty(value)) return null; + if (regexp.test(value)) { + // Note: We cannot read ctrl.$modelValue, as there might be a different + // parser/formatter in the processing chain so that the model + // contains some different data format! + var parsedDate = parseDate(value, previousDate); + if (timezone === 'UTC') { + parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset()); + } + return parsedDate; + } + return undefined; + }); + + ctrl.$formatters.push(function(value) { + if (value && !isDate(value)) { + throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value); + } + if (isValidDate(value)) { + previousDate = value; + if (previousDate && timezone === 'UTC') { + var timezoneOffset = 60000 * previousDate.getTimezoneOffset(); + previousDate = new Date(previousDate.getTime() + timezoneOffset); + } + return $filter('date')(value, format, timezone); + } else { + previousDate = null; + return ''; + } + }); + + if (isDefined(attr.min) || attr.ngMin) { + var minVal; + ctrl.$validators.min = function(value) { + return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal; + }; + attr.$observe('min', function(val) { + minVal = parseObservedDateValue(val); + ctrl.$validate(); + }); + } + + if (isDefined(attr.max) || attr.ngMax) { + var maxVal; + ctrl.$validators.max = function(value) { + return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal; + }; + attr.$observe('max', function(val) { + maxVal = parseObservedDateValue(val); + ctrl.$validate(); + }); + } + + function isValidDate(value) { + // Invalid Date: getTime() returns NaN + return value && !(value.getTime && value.getTime() !== value.getTime()); + } + + function parseObservedDateValue(val) { + return isDefined(val) ? (isDate(val) ? val : parseDate(val)) : undefined; + } + }; +} + +function badInputChecker(scope, element, attr, ctrl) { + var node = element[0]; + var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity); + if (nativeValidation) { + ctrl.$parsers.push(function(value) { + var validity = element.prop(VALIDITY_STATE_PROPERTY) || {}; + // Detect bug in FF35 for input[email] (https://bugzilla.mozilla.org/show_bug.cgi?id=1064430): + // - also sets validity.badInput (should only be validity.typeMismatch). + // - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email) + // - can ignore this case as we can still read out the erroneous email... + return validity.badInput && !validity.typeMismatch ? undefined : value; + }); + } +} + +function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { + badInputChecker(scope, element, attr, ctrl); + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + + ctrl.$$parserName = 'number'; + ctrl.$parsers.push(function(value) { + if (ctrl.$isEmpty(value)) return null; + if (NUMBER_REGEXP.test(value)) return parseFloat(value); + return undefined; + }); + + ctrl.$formatters.push(function(value) { + if (!ctrl.$isEmpty(value)) { + if (!isNumber(value)) { + throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); + } + value = value.toString(); + } + return value; + }); + + if (isDefined(attr.min) || attr.ngMin) { + var minVal; + ctrl.$validators.min = function(value) { + return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal; + }; + + attr.$observe('min', function(val) { + if (isDefined(val) && !isNumber(val)) { + val = parseFloat(val, 10); + } + minVal = isNumber(val) && !isNaN(val) ? val : undefined; + // TODO(matsko): implement validateLater to reduce number of validations + ctrl.$validate(); + }); + } + + if (isDefined(attr.max) || attr.ngMax) { + var maxVal; + ctrl.$validators.max = function(value) { + return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal; + }; + + attr.$observe('max', function(val) { + if (isDefined(val) && !isNumber(val)) { + val = parseFloat(val, 10); + } + maxVal = isNumber(val) && !isNaN(val) ? val : undefined; + // TODO(matsko): implement validateLater to reduce number of validations + ctrl.$validate(); + }); + } +} + +function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) { + // Note: no badInputChecker here by purpose as `url` is only a validation + // in browsers, i.e. we can always read out input.value even if it is not valid! + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + stringBasedInputType(ctrl); + + ctrl.$$parserName = 'url'; + ctrl.$validators.url = function(modelValue, viewValue) { + var value = modelValue || viewValue; + return ctrl.$isEmpty(value) || URL_REGEXP.test(value); + }; +} + +function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) { + // Note: no badInputChecker here by purpose as `url` is only a validation + // in browsers, i.e. we can always read out input.value even if it is not valid! + baseInputType(scope, element, attr, ctrl, $sniffer, $browser); + stringBasedInputType(ctrl); + + ctrl.$$parserName = 'email'; + ctrl.$validators.email = function(modelValue, viewValue) { + var value = modelValue || viewValue; + return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value); + }; +} + +function radioInputType(scope, element, attr, ctrl) { + // make the name unique, if not defined + if (isUndefined(attr.name)) { + element.attr('name', nextUid()); + } + + var listener = function(ev) { + if (element[0].checked) { + ctrl.$setViewValue(attr.value, ev && ev.type); + } + }; + + element.on('click', listener); + + ctrl.$render = function() { + var value = attr.value; + element[0].checked = (value == ctrl.$viewValue); + }; + + attr.$observe('value', ctrl.$render); +} + +function parseConstantExpr($parse, context, name, expression, fallback) { + var parseFn; + if (isDefined(expression)) { + parseFn = $parse(expression); + if (!parseFn.constant) { + throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' + + '`{1}`.', name, expression); + } + return parseFn(context); + } + return fallback; +} + +function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) { + var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true); + var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false); + + var listener = function(ev) { + ctrl.$setViewValue(element[0].checked, ev && ev.type); + }; + + element.on('click', listener); + + ctrl.$render = function() { + element[0].checked = ctrl.$viewValue; + }; + + // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false` + // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert + // it to a boolean. + ctrl.$isEmpty = function(value) { + return value === false; + }; + + ctrl.$formatters.push(function(value) { + return equals(value, trueValue); + }); + + ctrl.$parsers.push(function(value) { + return value ? trueValue : falseValue; + }); +} + + +/** + * @ngdoc directive + * @name textarea + * @restrict E + * + * @description + * HTML textarea element control with angular data-binding. The data-binding and validation + * properties of this element are exactly the same as those of the + * {@link ng.directive:input input element}. + * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to + * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of + * `required` when you want to data-bind to the `required` attribute. + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any + * length. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + */ + + +/** + * @ngdoc directive + * @name input + * @restrict E + * + * @description + * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding, + * input state control, and validation. + * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers. + * + *
+ * **Note:** Not every feature offered is available for all input types. + * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`. + *
+ * + * @param {string} ngModel Assignable angular expression to data-bind to. + * @param {string=} name Property name of the form under which the control is published. + * @param {string=} required Sets `required` validation error key if the value is not entered. + * @param {boolean=} ngRequired Sets `required` attribute if set to true + * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than + * minlength. + * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than + * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any + * length. + * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the + * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for + * patterns defined as scope expressions. + * @param {string=} ngChange Angular expression to be executed when input changes due to user + * interaction with the input element. + * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input. + * This parameter is ignored for input[type=password] controls, which will never trim the + * input. + * + * @example + + + +
+
+ User name: + + Required!
+ Last name: + + Too short! + + Too long!
+
+
+ user = {{user}}
+ myForm.userName.$valid = {{myForm.userName.$valid}}
+ myForm.userName.$error = {{myForm.userName.$error}}
+ myForm.lastName.$valid = {{myForm.lastName.$valid}}
+ myForm.lastName.$error = {{myForm.lastName.$error}}
+ myForm.$valid = {{myForm.$valid}}
+ myForm.$error.required = {{!!myForm.$error.required}}
+ myForm.$error.minlength = {{!!myForm.$error.minlength}}
+ myForm.$error.maxlength = {{!!myForm.$error.maxlength}}
+
+
+ + var user = element(by.exactBinding('user')); + var userNameValid = element(by.binding('myForm.userName.$valid')); + var lastNameValid = element(by.binding('myForm.lastName.$valid')); + var lastNameError = element(by.binding('myForm.lastName.$error')); + var formValid = element(by.binding('myForm.$valid')); + var userNameInput = element(by.model('user.name')); + var userLastInput = element(by.model('user.last')); + + it('should initialize to model', function() { + expect(user.getText()).toContain('{"name":"guest","last":"visitor"}'); + expect(userNameValid.getText()).toContain('true'); + expect(formValid.getText()).toContain('true'); + }); + + it('should be invalid if empty when required', function() { + userNameInput.clear(); + userNameInput.sendKeys(''); + + expect(user.getText()).toContain('{"last":"visitor"}'); + expect(userNameValid.getText()).toContain('false'); + expect(formValid.getText()).toContain('false'); + }); + + it('should be valid if empty when min length is set', function() { + userLastInput.clear(); + userLastInput.sendKeys(''); + + expect(user.getText()).toContain('{"name":"guest","last":""}'); + expect(lastNameValid.getText()).toContain('true'); + expect(formValid.getText()).toContain('true'); + }); + + it('should be invalid if less than required min length', function() { + userLastInput.clear(); + userLastInput.sendKeys('xx'); + + expect(user.getText()).toContain('{"name":"guest"}'); + expect(lastNameValid.getText()).toContain('false'); + expect(lastNameError.getText()).toContain('minlength'); + expect(formValid.getText()).toContain('false'); + }); + + it('should be invalid if longer than max length', function() { + userLastInput.clear(); + userLastInput.sendKeys('some ridiculously long name'); + + expect(user.getText()).toContain('{"name":"guest"}'); + expect(lastNameValid.getText()).toContain('false'); + expect(lastNameError.getText()).toContain('maxlength'); + expect(formValid.getText()).toContain('false'); + }); + +
+ */ +var inputDirective = ['$browser', '$sniffer', '$filter', '$parse', + function($browser, $sniffer, $filter, $parse) { + return { + restrict: 'E', + require: ['?ngModel'], + link: { + pre: function(scope, element, attr, ctrls) { + if (ctrls[0]) { + (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer, + $browser, $filter, $parse); + } + } + } + }; +}]; + + + +var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/; +/** + * @ngdoc directive + * @name ngValue + * + * @description + * Binds the given expression to the value of `