diff --git a/build/main.js b/build/main.js index bd969f2..dc2a165 100644 --- a/build/main.js +++ b/build/main.js @@ -86,10 +86,12 @@ // custom states (pages) myApp.config(['$stateProvider', __webpack_require__(119)]); - myApp.config(['NgAdminConfigurationProvider', function (nga) { + myApp.config(['NgAdminConfigurationProvider', '$windowProvider', function (nga, $window) { // create the admin application var admin = nga.application('My First Admin').baseApiUrl('/'); + var isAdminRole = $window.$get().localStorage.getItem('posters_galore_login') == 'admin'; //retrieving current role + // add entities admin.addEntity(nga.entity('customers')); admin.addEntity(nga.entity('categories')); @@ -98,15 +100,15 @@ admin.addEntity(nga.entity('commands')); // configure entities - __webpack_require__(122)(nga, admin); - __webpack_require__(123)(nga, admin); - __webpack_require__(124)(nga, admin); - __webpack_require__(126)(nga, admin); - __webpack_require__(127)(nga, admin); + __webpack_require__(122)(nga, admin, isAdminRole); + __webpack_require__(123)(nga, admin, isAdminRole); + __webpack_require__(124)(nga, admin, isAdminRole); + __webpack_require__(126)(nga, admin, isAdminRole); + __webpack_require__(127)(nga, admin, isAdminRole); - admin.dashboard(__webpack_require__(128)(nga, admin)); + admin.dashboard(__webpack_require__(128)(nga, admin, isAdminRole)); admin.header(__webpack_require__(129)); - admin.menu(__webpack_require__(130)(nga, admin)); + admin.menu(__webpack_require__(130)(nga, admin, isAdminRole)); // attach the admin application to the DOM and execute it nga.configure(admin); @@ -2574,7 +2576,9 @@ currentQueue = queue; queue = []; while (++queueIndex < len) { - currentQueue[queueIndex].run(); + if (currentQueue) { + currentQueue[queueIndex].run(); + } } queueIndex = -1; len = queue.length; @@ -2626,7 +2630,6 @@ throw new Error('process.binding is not supported'); }; - // TODO(shtylman) process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); @@ -4004,7 +4007,7 @@ var has_seen_alert = false; - function dashboardSummary(Restangular) { + function dashboardSummary(Restangular, $window) { 'use strict'; return { @@ -4013,33 +4016,36 @@ controller: function controller($scope) { $scope.stats = {}; $scope.has_seen_alert = has_seen_alert; + $scope.isAdmin = $window.localStorage.getItem('posters_galore_login') == 'admin'; $scope.dismissAlert = function () { has_seen_alert = true; $scope.has_seen_alert = true; }; - Restangular.all('commands').getList({ filter: '{"date_gte":"' + oneMonthAgo.toISOString() + '"}', sort: '["date","DESC"]' }).then(function (commands) { - $scope.stats.commands = commands.data.reduce(function (stats, command) { - if (command.status != 'cancelled') stats.revenue += command.total; - if (command.status == 'ordered') stats.pending_orders++; - return stats; - }, { revenue: 0, pending_orders: 0 }); - }); + if ($scope.isAdmin) { + Restangular.all('commands').getList({ filter: '{"date_gte":"' + oneMonthAgo.toISOString() + '"}', sort: '["date","DESC"]' }).then(function (commands) { + $scope.stats.commands = commands.data.reduce(function (stats, command) { + if (command.status != 'cancelled') stats.revenue += command.total; + if (command.status == 'ordered') stats.pending_orders++; + return stats; + }, { revenue: 0, pending_orders: 0 }); + }); + Restangular.all('reviews').getList({ range: '[1,100]', sort: '["date","DESC"]', filter: '{"status":"pending"}' }).then(function (reviews) { + $scope.stats.reviews = reviews.data.reduce(function (nb) { + return ++nb; + }, 0); + }); + } Restangular.all('customers').getList({ range: '[1,100]', sort: '["first_seen","DESC"]', filter: '{"has_ordered":true,"first_seen_gte":"' + oneMonthAgo.toISOString() + '"}' }).then(function (customers) { $scope.stats.customers = customers.data.reduce(function (nb) { return ++nb; }, 0); }); - Restangular.all('reviews').getList({ range: '[1,100]', sort: '["date","DESC"]', filter: '{"status":"pending"}' }).then(function (reviews) { - $scope.stats.reviews = reviews.data.reduce(function (nb) { - return ++nb; - }, 0); - }); }, template: _dashboardSummaryHtml2['default'] }; } - dashboardSummary.$inject = ['Restangular']; + dashboardSummary.$inject = ['Restangular', '$window']; exports['default'] = dashboardSummary; module.exports = exports['default']; @@ -15508,7 +15514,7 @@ /* 118 */ /***/ function(module, exports) { - module.exports = "
\n
\n \n Welcome to the ng-admin demo! Fell free to explore and modify the data - it's local to your computer, and will reset each time you reload.\n \n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{{ stats.commands.revenue | number:0 }}
\n
Monthly revenue
\n
\n
\n
\n \n
\n View Details\n \n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{{ stats.commands.pending_orders }}
\n
Pending orders
\n
\n
\n
\n \n
\n View Details\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{{ stats.reviews }}
\n
Pending reviews
\n
\n
\n
\n \n
\n View Details\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{{ stats.customers }}
\n
New customers
\n
\n
\n
\n \n
\n View Details\n \n
\n
\n
\n
\n
\n
\n"; + module.exports = "
\n
\n \n Welcome to the ng-admin demo! Fell free to explore and modify the data - it's local to your computer, and will reset each time you reload.\n \n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{{ stats.commands.revenue | number:0 }}
\n
Monthly revenue
\n
\n
\n
\n \n
\n View Details\n \n
\n
\n
\n\n
\n
\n\n\n
\n
\n
\n
\n
\n \n
\n
\n
{{ stats.commands.pending_orders }}
\n
Pending orders
\n
\n
\n
\n \n
\n View Details\n \n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n \n
\n
\n
{{ stats.reviews }}
\n
Pending reviews
\n
\n
\n
\n \n
\n View Details\n \n
\n
\n
\n
\n
\n\n\n
\n
\n
\n
\n
\n \n
\n
\n
{{ stats.customers }}
\n
New customers
\n
\n
\n
\n \n
\n View Details\n \n
\n
\n
\n
\n
\n
\n"; /***/ }, /* 119 */ @@ -15586,33 +15592,32 @@ var segments = __webpack_require__(121).choices; - exports['default'] = function (nga, admin) { + exports['default'] = function (nga, admin, isAdminRole) { var customer = admin.getEntity('customers'); customer.listView().title('Visitors').fields([nga.field('avatar', 'template').label('').template(''), nga.field('last_name', 'template') // use last_name for sorting - .label('Name').isDetailLink(true).template('{{ entry.values.first_name }} {{ entry.values.last_name }}'), nga.field('last_seen', 'datetime').map(fromNow).cssClasses('hidden-xs'), nga.field('nb_commands', 'number').label('Commands').cssClasses(function (entry) { - return entry.values.nb_commands ? 'hidden-xs' : 'transparent hidden-xs'; - }), nga.field('total_spent', 'amount').cssClasses(function (entry) { - return entry.values.total_spent ? 'hidden-xs' : 'transparent hidden-xs'; - }), nga.field('latest_purchase', 'datetime').cssClasses('hidden-xs'), nga.field('has_newsletter', 'boolean').label('Newsletter').cssClasses('hidden-xs'), nga.field('segments', 'template').template('{{ group }}').cssClasses('hidden-xs')]).filters([nga.field('q', 'template').label('').pinned(true).template('
'), nga.field('groups', 'choice').label('Segment').choices(segments), nga.field('last_seen_gte', 'datetime').label('Visited since'), nga.field('has_ordered', 'boolean'), nga.field('has_newsletter', 'boolean')]).sortField('first_seen').sortDir('DESC').listActions(['edit']); - customer.editionView().title(' {{ entry.values.first_name }} {{ entry.values.last_name }}\'s details').fields([nga.field('first_name'), nga.field('last_name'), nga.field('email', 'email'), nga.field('address', 'text'), nga.field('zipcode'), nga.field('city'), nga.field('birthday', 'date'), nga.field('first_seen', 'datetime').editable(false), nga.field('latest_purchase', 'datetime').editable(false), nga.field('last_seen', 'datetime').editable(false), nga.field('has_newsletter', 'boolean'), nga.field('groups', 'choices').choices(segments), nga.field('commands', 'referenced_list').label('Latest commands').targetEntity(admin.getEntity('commands')).targetReferenceField('customer_id').targetFields([nga.field('date').map(fromNow), nga.field('reference').isDetailLink(true), nga.field('nb_items').map(function (v, e) { - return e.basket.length; - }), nga.field('total', 'amount'), nga.field('status')]).perPage(5).sortField('date').sortDir('DESC'), nga.field('commands button', 'template').label('').template(''), nga.field('reviews', 'referenced_list').label('Latest reviews').targetEntity(admin.getEntity('reviews')).targetReferenceField('customer_id').targetFields([nga.field('date').label('Posted').map(fromNow).isDetailLink(true), nga.field('rating', 'template').template(''), nga.field('comment').map(function truncate(value) { - if (!value) { - return ''; - } - return value.length > 50 ? value.substr(0, 50) + '...' : value; - }), nga.field('status', 'choice').choices([{ label: 'accepted', value: 'accepted' }, { label: 'rejected', value: 'rejected' }, { label: 'pending', value: 'pending' }]).cssClasses(function (entry) { - // add custom CSS classes to inputs and columns - if (entry.values.status == 'accepted') { - return 'text-center bg-success'; - } - if (entry.values.status == 'rejected') { - return 'text-center bg-danger'; - } - return 'text-center bg-warning'; - })]).perPage(5).sortField('date').sortDir('DESC'), nga.field('reviews button', 'template').label('').template('')]); - + .label('Name').isDetailLink(true).template('{{ entry.values.first_name }} {{ entry.values.last_name }}'), nga.field('last_seen', 'datetime').map(fromNow).cssClasses('hidden-xs'), nga.field('nb_commands', 'template').label('Commands').template('{{ entry.values.nb_commands ? entry.values.nb_commands : "" }}').cssClasses('hidden-xs'), nga.field('total_spent', 'template').template('
$
').cssClasses('hidden-xs text-right'), nga.field('latest_purchase', 'datetime').cssClasses('hidden-xs'), nga.field('has_newsletter', 'boolean').label('Newsletter').cssClasses('hidden-xs'), nga.field('segments', 'template').template('{{ group }}').cssClasses('hidden-xs')]).filters([nga.field('q', 'template').label('').pinned(true).template('
'), nga.field('groups', 'choice').label('Segment').choices(segments), nga.field('last_seen_gte', 'datetime').label('Visited since'), nga.field('has_ordered', 'boolean'), nga.field('has_newsletter', 'boolean')]).sortField('first_seen').sortDir('DESC').listActions(['edit']); + + if (isAdminRole) { + // + customer.editionView().title(' {{ entry.values.first_name }} {{ entry.values.last_name }}\'s details').fields([nga.field('first_name'), nga.field('last_name'), nga.field('email', 'email'), nga.field('address', 'text'), nga.field('zipcode'), nga.field('city'), nga.field('birthday', 'date'), nga.field('first_seen', 'datetime').editable(false), nga.field('latest_purchase', 'datetime').editable(false), nga.field('last_seen', 'datetime').editable(false), nga.field('has_newsletter', 'boolean'), nga.field('groups', 'choices').choices(segments), nga.field('commands', 'referenced_list').label('Latest commands').targetEntity(admin.getEntity('commands')).targetReferenceField('customer_id').targetFields([nga.field('date').map(fromNow), nga.field('reference').isDetailLink(true), nga.field('nb_items').map(function (v, e) { + return e.basket.length; + }), nga.field('total', 'amount'), nga.field('status')]).perPage(5).sortField('date').sortDir('DESC'), nga.field('commands button', 'template').label('').template(''), nga.field('reviews', 'referenced_list').label('Latest reviews').targetEntity(admin.getEntity('reviews')).targetReferenceField('customer_id').targetFields([nga.field('date').label('Posted').map(fromNow).isDetailLink(true), nga.field('rating', 'template').template(''), nga.field('comment').map(function truncate(value) { + if (!value) { + return ''; + } + return value.length > 50 ? value.substr(0, 50) + '...' : value; + }), nga.field('status', 'choice').choices([{ label: 'accepted', value: 'accepted' }, { label: 'rejected', value: 'rejected' }, { label: 'pending', value: 'pending' }]).cssClasses(function (entry) { + // add custom CSS classes to inputs and columns + if (entry.values.status == 'accepted') { + return 'text-center bg-success'; + } + if (entry.values.status == 'rejected') { + return 'text-center bg-danger'; + } + return 'text-center bg-warning'; + })]).perPage(5).sortField('date').sortDir('DESC'), nga.field('reviews button', 'template').label('').template('')]); + } return customer; }; @@ -15628,12 +15633,17 @@ value: true }); - exports['default'] = function (nga, admin) { + exports['default'] = function (nga, admin, isAdminRole) { var categories = admin.getEntity('categories'); - categories.listView().fields([nga.field('name')]).listActions(['', 'edit', 'delete']); - categories.creationView().fields([nga.field('name').validation({ required: true }), nga.field('', 'template').label('').template('')]); - categories.editionView().fields(categories.creationView().fields()); + categories.listView().fields([nga.field('name')]); + if (isAdminRole) { + categories.listView().listActions(['', 'edit', 'delete']); + categories.creationView().fields([nga.field('name').validation({ required: true }), nga.field('', 'template').label('').template('')]); + categories.editionView().fields(categories.creationView().fields()); + } else { + categories.listView().batchActions([]).listActions(); + } return categories; }; @@ -15664,17 +15674,23 @@ return (0, _moment2['default'])(v).fromNow(); }; - exports['default'] = function (nga, admin) { + exports['default'] = function (nga, admin, isAdminRole) { var products = admin.getEntity('products').label('Posters'); - products.listView().title('All Posters').fields([nga.field('i', 'template').isDetailLink(true).label('').template(''), nga.field('reference').isDetailLink(true), nga.field('price', 'amount').cssClasses('hidden-xs'), nga.field('width', 'float').format('0.00').cssClasses('hidden-xs'), nga.field('height', 'float').format('0.00').cssClasses('hidden-xs'), nga.field('category_id', 'reference').label('Category').targetEntity(admin.getEntity('categories')).targetField(nga.field('name')).cssClasses('hidden-xs'), nga.field('stock', 'number').cssClasses('hidden-xs')]).filters([nga.field('q', 'template').label('').pinned(true).template('
'), nga.field('category_id', 'reference').label('Category').targetEntity(admin.getEntity('categories')).targetField(nga.field('name')), nga.field('width_gte', 'number').label('Min width'), nga.field('width_lte', 'number').label('Max width'), nga.field('height_gte', 'number').label('Min height'), nga.field('height_lte', 'number').label('Max height'), nga.field('stock_lte', 'template').label('Low stock').defaultValue(10)]).listActions(['edit', 'delete']); - products.creationView().title('Create new Poster').fields([nga.field('reference').validation({ required: true }).cssClasses('col-sm-4'), nga.field('price', 'amount').validation({ required: true }).cssClasses('col-sm-4'), nga.field('width', 'float').validation({ required: true }).cssClasses('col-sm-2'), nga.field('height', 'float').validation({ required: true }).cssClasses('col-sm-2'), nga.field('category_id', 'reference').label('Category').targetEntity(admin.getEntity('categories')).targetField(nga.field('name')).validation({ required: true }).cssClasses('col-sm-4'), nga.field('stock', 'number').validation({ required: true, min: 2 }).cssClasses('col-sm-2'), nga.field('thumbnail').validation({ required: true }).cssClasses('col-sm-4'), nga.field('image').validation({ required: true }).cssClasses('col-sm-4'), nga.field('description', 'wysiwyg')]); - products.editionView().template(_productsEditionTemplateHtml2['default']).fields(products.creationView().fields(), nga.field('reviews', 'referenced_list').targetEntity(admin.getEntity('reviews')).targetReferenceField('product_id').permanentFilters({ status: 'accepted' }).targetFields([nga.field('date').label('Posted').map(fromNow).isDetailLink(true), nga.field('rating', 'template').template(''), nga.field('comment').map(function truncate(value) { - if (!value) { - return ''; - } - return value.length > 50 ? value.substr(0, 50) + '...' : value; - })]).sortField('date').sortDir('DESC')); + products.listView().title('All Posters').fields([nga.field('i', 'template').isDetailLink(true).label('').template(''), nga.field('reference').isDetailLink(true), nga.field('price', 'amount').cssClasses('hidden-xs'), nga.field('width', 'float').format('0.00').cssClasses('hidden-xs'), nga.field('height', 'float').format('0.00').cssClasses('hidden-xs'), nga.field('category_id', 'reference').label('Category').targetEntity(admin.getEntity('categories')).targetField(nga.field('name')).cssClasses('hidden-xs'), nga.field('stock', 'number').cssClasses('hidden-xs')]).filters([nga.field('q', 'template').label('').pinned(true).template('
'), nga.field('category_id', 'reference').label('Category').targetEntity(admin.getEntity('categories')).targetField(nga.field('name')), nga.field('width_gte', 'number').label('Min width'), nga.field('width_lte', 'number').label('Max width'), nga.field('height_gte', 'number').label('Min height'), nga.field('height_lte', 'number').label('Max height'), nga.field('stock_lte', 'template').label('Low stock').defaultValue(10)]); + if (isAdminRole) { + products.listView().listActions(['edit', 'delete']); + + products.creationView().title('Create new Poster').fields([nga.field('reference').validation({ required: true }).cssClasses('col-sm-4'), nga.field('price', 'amount').validation({ required: true }).cssClasses('col-sm-4'), nga.field('width', 'float').validation({ required: true }).cssClasses('col-sm-2'), nga.field('height', 'float').validation({ required: true }).cssClasses('col-sm-2'), nga.field('category_id', 'reference').label('Category').targetEntity(admin.getEntity('categories')).targetField(nga.field('name')).validation({ required: true }).cssClasses('col-sm-4'), nga.field('stock', 'number').validation({ required: true, min: 2 }).cssClasses('col-sm-2'), nga.field('thumbnail').validation({ required: true }).cssClasses('col-sm-4'), nga.field('image').validation({ required: true }).cssClasses('col-sm-4'), nga.field('description', 'wysiwyg')]); + products.editionView().template(_productsEditionTemplateHtml2['default']).fields(products.creationView().fields(), nga.field('reviews', 'referenced_list').targetEntity(admin.getEntity('reviews')).targetReferenceField('product_id').permanentFilters({ status: 'accepted' }).targetFields([nga.field('date').label('Posted').map(fromNow).isDetailLink(true), nga.field('rating', 'template').template(''), nga.field('comment').map(function truncate(value) { + if (!value) { + return ''; + } + return value.length > 50 ? value.substr(0, 50) + '...' : value; + })]).sortField('date').sortDir('DESC')); + } else { + products.listView().batchActions([]).listActions(); + } return products; }; @@ -15697,7 +15713,11 @@ value: true }); - exports['default'] = function (nga, admin) { + exports['default'] = function (nga, admin, isAdminRole) { + + if (!isAdminRole) { + return null; + } var statuses = ['pending', 'accepted', 'rejected']; var statusChoices = statuses.map(function (status) { @@ -15714,6 +15734,9 @@ return value.length > 50 ? value.substr(0, 50) + '...' : value; }).cssClasses('hidden-xs'), nga.field('status', 'choice').choices(statusChoices).cssClasses(function (entry) { // add custom CSS classes to inputs and columns + if (!entry) { + return ''; + } if (entry.values.status == 'accepted') { return 'text-center bg-success'; } @@ -15752,7 +15775,11 @@ value: true }); - exports['default'] = function (nga, admin) { + exports['default'] = function (nga, admin, isAdminRole) { + + if (!isAdminRole) { + return null; + } var commands = admin.getEntity('commands'); commands.listView().sortField('date').sortDir('DESC').fields([nga.field('date', 'datetime'), nga.field('reference').isDetailLink(true), nga.field('customer_id', 'reference').label('Customer').targetEntity(admin.getEntity('customers')).targetField(nga.field('last_name').map(function (v, e) { @@ -15765,7 +15792,7 @@ searchQuery: function searchQuery(search) { return { q: search }; } - }), nga.field('status', 'choice').choices([{ label: 'ordered', value: 'ordered' }, { label: 'delivered', value: 'delivered' }, { label: 'cancelled', value: 'cancelled' }]), nga.field('date_gte', 'datetime').label('Passed since'), nga.field('date_lte', 'datetime').label('Passed before'), nga.field('total_gte', 'amount').label('Min amount'), nga.field('returned', 'boolean')]).listActions(['']); + }), nga.field('status', 'choice').choices([{ label: 'ordered', value: 'ordered' }, { label: 'delivered', value: 'delivered' }, { label: 'cancelled', value: 'cancelled' }]), nga.field('date_gte', 'datetime').label('Passed after'), nga.field('date_lte', 'datetime').label('Passed before'), nga.field('total_gte', 'amount').label('Min amount'), nga.field('returned', 'boolean')]).listActions(['']); commands.editionView().title('Command #{{ entry.values.reference }}').fields([nga.field('date', 'datetime').editable(false), nga.field('customer_id', 'reference').label('Customer').targetEntity(admin.getEntity('customers')).targetField(nga.field('last_name').map(function (v, e) { return e.first_name + ' ' + e.last_name; })).editable(false), nga.field('Items', 'template').template(''), nga.field('status', 'choice').choices([{ label: 'ordered', value: 'ordered' }, { label: 'delivered', value: 'delivered' }, { label: 'cancelled', value: 'cancelled' }]).cssClasses('col-sm-4 col-lg-2'), nga.field('returned', 'boolean')]); @@ -15789,18 +15816,22 @@ return moment(v).fromNow(); }; - exports['default'] = function (nga, admin) { - - return nga.dashboard().addCollection(nga.collection(admin.getEntity('commands')).name('monthly_revenue').title('Monthly revenue') - //.permanentFilters({ date: { gte: moment().substract(1, 'months').toDate() } }) - .fields([nga.field('date', 'datetime'), nga.field('total', 'amount')]).sortField('date').sortDir('ASC').perPage(100)).addCollection(nga.collection(admin.getEntity('commands')).name('pending_orders').title('Pending orders').fields([nga.field('date', 'datetime').isDetailLink(true), nga.field('reference'), nga.field('customer_id', 'reference').label('Customer').targetEntity(admin.getEntity('customers')).targetField(nga.field('last_name').map(function (v, e) { - return e.first_name + ' ' + e.last_name; - })).cssClasses('hidden-xs'), nga.field('nb_items').map(function (v, e) { - return e.basket.length; - }), nga.field('total', 'amount').cssClasses('amount')]).permanentFilters({ status: 'ordered' }).sortField('date').sortDir('DESC')).addCollection(nga.collection(admin.getEntity('reviews')).name('latest_reviews').title('Latest reviews').fields([nga.field('customer_id', 'reference').label('Customer').targetEntity(admin.getEntity('customers')).targetField(nga.field('last_name').map(function (v, e) { - return e.first_name + ' ' + e.last_name; - })), nga.field('product_id', 'reference').label('Product').targetEntity(admin.getEntity('products')).targetField(nga.field('reference')), nga.field('rating', 'template').template('')]).sortField('date').sortDir('DESC').perPage(10)).addCollection(nga.collection(admin.getEntity('customers')).name('new_customers').title('New customers').fields([nga.field('avatar', 'template').label('').template(''), nga.field('last_name', 'template') // use last_name for sorting - .label('Name').isDetailLink(true).template('{{ entry.values.first_name }} {{ entry.values.last_name }}'), nga.field('last_seen', 'datetime').map(fromNow)]).permanentFilters({ has_ordered: true }).sortField('first_seen').sortDir('DESC').perPage(10)).template('\n
\n\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n'); + exports['default'] = function (nga, admin, isAdminRole) { + if (isAdminRole) { + return nga.dashboard().addCollection(nga.collection(admin.getEntity('commands')).name('monthly_revenue').title('Monthly revenue') + //.permanentFilters({ date: { gte: moment().substract(1, 'months').toDate() } }) + .fields([nga.field('date', 'datetime'), nga.field('total', 'amount')]).sortField('date').sortDir('ASC').perPage(100)).addCollection(nga.collection(admin.getEntity('commands')).name('pending_orders').title('Pending orders').fields([nga.field('date', 'datetime').isDetailLink(true), nga.field('reference'), nga.field('customer_id', 'reference').label('Customer').targetEntity(admin.getEntity('customers')).targetField(nga.field('last_name').map(function (v, e) { + return e.first_name + ' ' + e.last_name; + })).cssClasses('hidden-xs'), nga.field('nb_items').map(function (v, e) { + return e.basket.length; + }), nga.field('total', 'amount').cssClasses('amount')]).permanentFilters({ status: 'ordered' }).sortField('date').sortDir('DESC')).addCollection(nga.collection(admin.getEntity('reviews')).name('latest_reviews').title('Latest reviews').fields([nga.field('customer_id', 'reference').label('Customer').targetEntity(admin.getEntity('customers')).targetField(nga.field('last_name').map(function (v, e) { + return e.first_name + ' ' + e.last_name; + })), nga.field('product_id', 'reference').label('Product').targetEntity(admin.getEntity('products')).targetField(nga.field('reference')), nga.field('rating', 'template').template('')]).sortField('date').sortDir('DESC').perPage(10)).addCollection(nga.collection(admin.getEntity('customers')).name('new_customers').title('New customers').fields([nga.field('avatar', 'template').label('').template(''), nga.field('last_name', 'template') // use last_name for sorting + .label('Name').isDetailLink(true).template('{{ entry.values.first_name }} {{ entry.values.last_name }}'), nga.field('last_seen', 'datetime').map(fromNow)]).permanentFilters({ has_ordered: true }).sortField('first_seen').sortDir('DESC').perPage(10)).template('\n
\n \n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n '); + } else { + return nga.dashboard().addCollection(nga.collection(admin.getEntity('customers')).name('new_customers').title('New customers').fields([nga.field('avatar', 'template').label('').template(''), nga.field('last_name', 'template') // use last_name for sorting + .label('Name').isDetailLink(true).template('{{ entry.values.first_name }} {{ entry.values.last_name }}'), nga.field('last_seen', 'datetime').map(fromNow)]).permanentFilters({ has_ordered: true }).sortField('first_seen').sortDir('DESC').perPage(10)).template('\n
\n \n
\n
\n
\n \n
\n
\n
\n '); + } }; module.exports = exports['default']; @@ -15821,20 +15852,34 @@ value: true }); - exports['default'] = function (nga, admin) { - return nga.menu().addChild(nga.menu().title('Visitors').icon('').active(function (path) { - return path.indexOf('/customers') === 0; - }) // active() is the function that determines if the menu is active - .addChild(nga.menu().title('Leads').link('/customers/list?search={"has_ordered":"false"}') // use the same entity list for several menu items - .icon('')) // no active() function => will never appear active - .addChild(nga.menu().title('Customers').link('/customers/list?search={"has_ordered":"true"}') // use the same entity list for several menu items - .icon('')).addChild(nga.menu().title('Segments').link('/segments') // this state isn't handled by ng-admin - no problem - .active(function (path) { - return path == '/segments'; - }).icon(''))).addChild(nga.menu().title('Sales').icon('').active(function (path) { - return path.indexOf('/commands') === 0; - }).addChild(nga.menu().title('Orders').link('/commands/list?search={"status":"ordered"}').icon('')).addChild(nga.menu().title('Invoices').link('/commands/list?search={"status":"delivered"}').icon('')).addChild(nga.menu().title('Cancels').link('/commands/list?search={"status":"cancelled"}').icon(''))).addChild(nga.menu().title('Catalog').icon('').addChild(nga.menu(admin.getEntity('products')) // nga.menu(entity) sets defaults title, link and active values correctly - .icon('')).addChild(nga.menu(admin.getEntity('categories')).icon(''))).addChild(nga.menu(admin.getEntity('reviews')).icon('')); + exports['default'] = function (nga, admin, isAdminRole) { + if (isAdminRole) { + return nga.menu().addChild(nga.menu().title('Visitors').icon('').active(function (path) { + return path.indexOf('/customers') === 0; + }) // active() is the function that determines if the menu is active + .addChild(nga.menu().title('Leads').link('/customers/list?search={"has_ordered":"false"}') // use the same entity list for several menu items + .icon('')) // no active() function => will never appear active + .addChild(nga.menu().title('Customers').link('/customers/list?search={"has_ordered":"true"}') // use the same entity list for several menu items + .icon('')).addChild(nga.menu().title('Segments').link('/segments') // this state isn't handled by ng-admin - no problem + .active(function (path) { + return path == '/segments'; + }).icon(''))).addChild(nga.menu().title('Sales').icon('').active(function (path) { + return path.indexOf('/commands') === 0; + }).addChild(nga.menu().title('Orders').link('/commands/list?search={"status":"ordered"}').icon('')).addChild(nga.menu().title('Invoices').link('/commands/list?search={"status":"delivered"}').icon('')).addChild(nga.menu().title('Cancels').link('/commands/list?search={"status":"cancelled"}').icon(''))).addChild(nga.menu().title('Catalog').icon('').addChild(nga.menu(admin.getEntity('products')) // nga.menu(entity) sets defaults title, link and active values correctly + .icon('')).addChild(nga.menu(admin.getEntity('categories')).icon(''))).addChild(nga.menu(admin.getEntity('reviews')).icon('')); + } else { + return nga.menu().addChild(nga.menu().title('Visitors').icon('').active(function (path) { + return path.indexOf('/customers') === 0; + }) // active() is the function that determines if the menu is active + .addChild(nga.menu().title('Leads').link('/customers/list?search={"has_ordered":"false"}') // use the same entity list for several menu items + .icon('')) // no active() function => will never appear active + .addChild(nga.menu().title('Customers').link('/customers/list?search={"has_ordered":"true"}') // use the same entity list for several menu items + .icon('')).addChild(nga.menu().title('Segments').link('/segments') // this state isn't handled by ng-admin - no problem + .active(function (path) { + return path == '/segments'; + }).icon(''))).addChild(nga.menu().title('Catalog').icon('').addChild(nga.menu(admin.getEntity('products')) // nga.menu(entity) sets defaults title, link and active values correctly + .icon('')).addChild(nga.menu(admin.getEntity('categories')).icon(''))); + } }; module.exports = exports['default']; diff --git a/build/main.js.map b/build/main.js.map index 39547d0..6e11058 100644 --- a/build/main.js.map +++ b/build/main.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 7ed60426b9bef805d977","webpack:///./js/main.js","webpack:///./js/api.js","webpack:///./~/fakerest/dist/FakeRest.min.js","webpack:///./~/sinon/lib/sinon/util/fake_server.js","webpack:///./~/sinon/lib/sinon/util/core.js","webpack:///./~/sinon/lib/sinon/util/fake_xdomain_request.js","webpack:///./~/sinon/lib/sinon/extend.js","webpack:///./~/sinon/lib/sinon/util/event.js","webpack:///./~/sinon/lib/sinon/log_error.js","webpack:///./~/sinon/lib/sinon/util/fake_xml_http_request.js","webpack:///./~/sinon/lib/sinon/format.js","webpack:///./~/sinon/~/util/util.js","webpack:///(webpack)/~/node-libs-browser/~/process/browser.js","webpack:///./~/sinon/~/util/support/isBufferBrowser.js","webpack:///./~/sinon/~/util/~/inherits/inherits_browser.js","webpack:///./~/sinon/~/formatio/lib/formatio.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./~/sinon/~/samsam/lib/samsam.js","webpack:///./js/api_flavor.js","webpack:///./js/types/AmountField.js","webpack:///./~/admin-config/lib/Field/NumberField.js","webpack:///./~/admin-config/lib/Field/Field.js","webpack:///./~/admin-config/lib/Utils/stringUtils.js","webpack:///./js/types/AmountFieldView.js","webpack:///./js/reviews/approveReview.js","webpack:///./js/reviews/batchApprove.js","webpack:///./js/reviews/starRating.js","webpack:///./js/commands/basket.js","webpack:///./js/dashboard/dashboardSummary.js","webpack:///./~/moment/moment.js","webpack:///(webpack)/buildin/module.js","webpack:///./~/moment/locale ^\\.\\/.*$","webpack:///./~/moment/locale/af.js","webpack:///./~/moment/locale/ar.js","webpack:///./~/moment/locale/ar-ma.js","webpack:///./~/moment/locale/ar-sa.js","webpack:///./~/moment/locale/ar-tn.js","webpack:///./~/moment/locale/az.js","webpack:///./~/moment/locale/be.js","webpack:///./~/moment/locale/bg.js","webpack:///./~/moment/locale/bn.js","webpack:///./~/moment/locale/bo.js","webpack:///./~/moment/locale/br.js","webpack:///./~/moment/locale/bs.js","webpack:///./~/moment/locale/ca.js","webpack:///./~/moment/locale/cs.js","webpack:///./~/moment/locale/cv.js","webpack:///./~/moment/locale/cy.js","webpack:///./~/moment/locale/da.js","webpack:///./~/moment/locale/de.js","webpack:///./~/moment/locale/de-at.js","webpack:///./~/moment/locale/el.js","webpack:///./~/moment/locale/en-au.js","webpack:///./~/moment/locale/en-ca.js","webpack:///./~/moment/locale/en-gb.js","webpack:///./~/moment/locale/eo.js","webpack:///./~/moment/locale/es.js","webpack:///./~/moment/locale/et.js","webpack:///./~/moment/locale/eu.js","webpack:///./~/moment/locale/fa.js","webpack:///./~/moment/locale/fi.js","webpack:///./~/moment/locale/fo.js","webpack:///./~/moment/locale/fr.js","webpack:///./~/moment/locale/fr-ca.js","webpack:///./~/moment/locale/fy.js","webpack:///./~/moment/locale/gl.js","webpack:///./~/moment/locale/he.js","webpack:///./~/moment/locale/hi.js","webpack:///./~/moment/locale/hr.js","webpack:///./~/moment/locale/hu.js","webpack:///./~/moment/locale/hy-am.js","webpack:///./~/moment/locale/id.js","webpack:///./~/moment/locale/is.js","webpack:///./~/moment/locale/it.js","webpack:///./~/moment/locale/ja.js","webpack:///./~/moment/locale/jv.js","webpack:///./~/moment/locale/ka.js","webpack:///./~/moment/locale/km.js","webpack:///./~/moment/locale/ko.js","webpack:///./~/moment/locale/lb.js","webpack:///./~/moment/locale/lt.js","webpack:///./~/moment/locale/lv.js","webpack:///./~/moment/locale/me.js","webpack:///./~/moment/locale/mk.js","webpack:///./~/moment/locale/ml.js","webpack:///./~/moment/locale/mr.js","webpack:///./~/moment/locale/ms.js","webpack:///./~/moment/locale/ms-my.js","webpack:///./~/moment/locale/my.js","webpack:///./~/moment/locale/nb.js","webpack:///./~/moment/locale/ne.js","webpack:///./~/moment/locale/nl.js","webpack:///./~/moment/locale/nn.js","webpack:///./~/moment/locale/pl.js","webpack:///./~/moment/locale/pt.js","webpack:///./~/moment/locale/pt-br.js","webpack:///./~/moment/locale/ro.js","webpack:///./~/moment/locale/ru.js","webpack:///./~/moment/locale/si.js","webpack:///./~/moment/locale/sk.js","webpack:///./~/moment/locale/sl.js","webpack:///./~/moment/locale/sq.js","webpack:///./~/moment/locale/sr.js","webpack:///./~/moment/locale/sr-cyrl.js","webpack:///./~/moment/locale/sv.js","webpack:///./~/moment/locale/ta.js","webpack:///./~/moment/locale/th.js","webpack:///./~/moment/locale/tl-ph.js","webpack:///./~/moment/locale/tr.js","webpack:///./~/moment/locale/tzl.js","webpack:///./~/moment/locale/tzm.js","webpack:///./~/moment/locale/tzm-latn.js","webpack:///./~/moment/locale/uk.js","webpack:///./~/moment/locale/uz.js","webpack:///./~/moment/locale/vi.js","webpack:///./~/moment/locale/zh-cn.js","webpack:///./~/moment/locale/zh-tw.js","webpack:///./js/dashboard/dashboardSummary.html","webpack:///./js/segments/segmentsState.js","webpack:///./js/segments/segmentsTemplate.html","webpack:///./js/segments/segments.js","webpack:///./js/customers/config.js","webpack:///./js/categories/config.js","webpack:///./js/products/config.js","webpack:///./js/products/productsEditionTemplate.html","webpack:///./js/reviews/config.js","webpack:///./js/commands/config.js","webpack:///./js/dashboard/config.js","webpack:///./js/header.html","webpack:///./js/menu.js","webpack:///./css/main.scss"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;ACrCA,oBAAO,CAAC,CAAO,CAAC,CAAC;;AAEjB,KAAI,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;;;AAGlD,KAAI,SAAS,GAAG,mBAAO,CAAC,EAAc,CAAC,CAAC;AACxC,MAAK,CAAC,MAAM,CAAC,CAAC,qBAAqB,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACpE,MAAK,CAAC,MAAM,CAAC,CAAC,qBAAqB,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;;;AAGrE,MAAK,CAAC,MAAM,CAAC,CAAC,8BAA8B,EAAE,gCAAgC,EAAE,UAAS,GAAG,EAAE,GAAG,EAAE;AAC/F,QAAG,CAAC,iBAAiB,CAAC,QAAQ,EAAE,mBAAO,CAAC,EAAqB,CAAC,CAAC,CAAC;AAChE,QAAG,CAAC,iBAAiB,CAAC,QAAQ,EAAE,mBAAO,CAAC,EAAyB,CAAC,CAAC,CAAC;EACvE,CAAC,CAAC,CAAC;;;AAGJ,MAAK,CAAC,SAAS,CAAC,eAAe,EAAE,mBAAO,CAAC,EAAyB,CAAC,CAAC,CAAC;AACrE,MAAK,CAAC,SAAS,CAAC,cAAc,EAAE,mBAAO,CAAC,EAAwB,CAAC,CAAC,CAAC;AACnE,MAAK,CAAC,SAAS,CAAC,YAAY,EAAE,mBAAO,CAAC,EAAsB,CAAC,CAAC,CAAC;AAC/D,MAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,mBAAO,CAAC,EAAmB,CAAC,CAAC,CAAC;AACxD,MAAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,mBAAO,CAAC,EAA8B,CAAC,CAAC,CAAC;;;AAG7E,MAAK,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAS,MAAM,EAAE,OAAO,EAAE;;AACzE,WAAM,CAAC,QAAQ,GAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;EAC3E,CAAC,CAAC;;;AAGH,MAAK,CAAC,MAAM,CAAC,CAAC,gBAAgB,EAAE,mBAAO,CAAC,GAA0B,CAAC,CAAC,CAAC,CAAC;;AAEtE,MAAK,CAAC,MAAM,CAAC,CAAC,8BAA8B,EAAE,UAAU,GAAG,EAAE;;AAEzD,SAAI,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,gBAAgB,CAAC,CACxC,UAAU,CAAC,GAAG,CAAC,CAAC;;;AAGrB,UAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;AACzC,UAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;AAC1C,UAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AACxC,UAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AACvC,UAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;;;AAGxC,wBAAO,CAAC,GAAoB,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC1C,wBAAO,CAAC,GAAqB,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC3C,wBAAO,CAAC,GAAmB,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACzC,wBAAO,CAAC,GAAkB,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACxC,wBAAO,CAAC,GAAmB,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;;AAEzC,UAAK,CAAC,SAAS,CAAC,mBAAO,CAAC,GAAoB,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3D,UAAK,CAAC,MAAM,CAAC,mBAAO,CAAC,GAAe,CAAC,CAAC,CAAC;AACvC,UAAK,CAAC,IAAI,CAAC,mBAAO,CAAC,GAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;;;AAG1C,QAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;EACxB,CAAC,CAAC,C;;;;;;;;ACxDH,KAAI,QAAQ,GAAG,mBAAO,CAAC,CAAU,CAAC,CAAC;AACnC,KAAI,KAAK,GAAG,mBAAO,CAAC,CAAkC,CAAC,CAAC;;AAExD,KAAI,UAAU,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;AACvC,WAAU,CAAC,aAAa,EAAE,CAAC;AAC3B,WAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;AAEtB,MAAK,CAAC,kBAAkB,CAAC,UAAU,GAAG,IAAI,CAAC;AAC3C,MAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE;;AAEtD,YAAO,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;EAC/E,CAAC,CAAC;;AAEH,KAAI,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;AACvC,OAAM,CAAC,WAAW,GAAG,IAAI,CAAC;AAC1B,OAAM,CAAC,gBAAgB,GAAG,CAAC,CAAC;AAC5B,OAAM,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,C;;;;;;AChB3C,gBAAe,sIAAkL,iBAAiB,mBAAmB,cAAc,4BAA4B,YAAY,UAAU,iBAAiB,gEAAgE,SAAS,+BAA+B,kBAAkB,aAAa,sBAAsB,sCAAsC,SAAS,EAAE,gCAAgC,cAAc,4CAA4C,wBAAwB,iBAAiB,aAAa,cAAc,eAAe,QAAQ,gBAAgB,yBAAyB,+BAA+B,KAAK,0CAA0C,qCAAqC,sCAAsC,IAAI,gHAAgH,sCAAsC,SAAS,EAAE,+BAA+B,aAAa,iEAAiE,4CAA4C,oGAAoG,aAAa,6BAA6B,6DAA6D,EAAE,qCAAqC,0CAA0C,EAAE,iCAAiC,iBAAiB,EAAE,wCAAwC,uBAAuB,EAAE,sCAAsC,4BAA4B,EAAE,0CAA0C,4BAA4B,EAAE,8CAA8C,kCAAkC,EAAE,+CAA+C,mCAAmC,EAAE,mCAAmC,wCAAwC,EAAE,iCAAiC,sCAAsC,EAAE,iCAAiC,sCAAsC,EAAE,iCAAiC,sCAAsC,EAAE,sCAAsC,2CAA2C,EAAE,oCAAoC,yCAAyC,EAAE,+BAA+B,mHAAmH,iCAAiC,UAAU,qDAAqD,YAAY,KAAK,EAAE,oCAAoC,kEAAkE,QAAQ,4DAA4D,OAAO,2BAA2B,wDAAwD,cAAc,wEAAwE,EAAE,8BAA8B,uiBAAuiB,EAAE,8BAA8B,kEAAkE,SAAS,+BAA+B,yBAAyB,GAAG,sBAAsB,kBAAkB,OAAO,mBAAmB,gBAAgB,qBAAqB,4BAA4B,GAAG,GAAG,EAAE,wBAAwB,SAAS,EAAE,+BAA+B,iGAAiG,uBAAuB,IAAI,yCAAyC,uBAAuB,MAAM,4FAA4F,cAAc,WAAW,uBAAuB,uBAAuB,8BAA8B,SAAS,sBAAsB,uBAAuB,iCAAiC,8BAA8B,SAAS,sBAAsB,0BAA0B,0BAA0B,8BAA8B,SAAS,uBAAuB,KAAK,oBAAoB,oBAAoB,wCAAwC,oDAAoD,QAAQ,mBAAmB,kFAAkF,+CAA+C,8BAA8B,uBAAuB,kBAAkB,MAAM,qBAAqB,6FAA6F,uBAAuB,WAAW,WAAW,SAAS,SAAS,QAAQ,IAAI,+BAA+B,QAAQ,gBAAgB,EAAE,kCAAkC,+BAA+B,KAAK,GAAG,sCAAsC,iBAAiB,aAAa,gBAAgB,2CAA2C,wBAAwB,2BAA2B,YAAY,iBAAiB,0BAA0B,OAAO,cAAc,kEAAkE,WAAW,GAAG,iCAAiC,WAAW,2BAA2B,iBAAiB,8BAA8B,OAAO,cAAc,iBAAiB,GAAG,iCAAiC,2BAA2B,iBAAiB,8BAA8B,OAAO,cAAc,iBAAiB,GAAG,iCAAiC,0BAA0B,iBAAiB,6BAA6B,OAAO,cAAc,gBAAgB,GAAG,iCAAiC,0BAA0B,iBAAiB,6BAA6B,OAAO,cAAc,gBAAgB,GAAG,iCAAiC,mBAAmB,yLAAyL,EAAE,4BAA4B,8BAA8B,eAAe,KAAK,EAAE,2CAA2C,gBAAgB,yCAAyC,kDAAkD,kCAAkC,EAAE,qBAAqB,iBAAiB,4CAA4C,OAAO,uBAAuB,oCAAoC,GAAG,GAAG,iCAAiC,yCAAyC,gBAAgB,qEAAqE,0CAA0C,0DAA0D,sCAAsC,SAAS,OAAO,iBAAiB,aAAa,gIAAgI,0HAA0H,kFAAkF,aAAa,iCAAiC,8BAA8B,EAAE,+BAA+B,iCAAiC,SAAS,EAAE,6FAA6F,EAAE,iCAAiC,WAAW,wCAAwC,8BAA8B,GAAG,EAAE,+BAA+B,uBAAuB,wDAAwD,sBAAsB,EAAE,+BAA+B,6BAA6B,eAAe,6FAA6F,0CAA0C,4CAA4C,6BAA6B,EAAE,oCAAoC,uBAAuB,wDAAwD,qCAAqC,sBAAsB,EAAE,kCAAkC,uBAAuB,wDAAwD,oBAAoB,qEAAqE,KAAK,GAAG,sCAAsC,eAAe,aAAa,yBAAyB,0BAA0B,aAAa,iBAAiB,iBAAiB,aAAa,uBAAuB,wBAAwB,gBAAgB,YAAY,WAAW,KAAK,WAAW,2FAA2F,uBAAuB,wCAAwC,mBAAmB,eAAe,aAAa,2BAA2B,8EAA8E,iBAAiB,iBAAiB,WAAW,+BAA+B,iBAAiB,aAAa,yCAAyC,wBAAwB,gBAAgB,4BAA4B,IAAI,iBAAiB,2DAA2D,OAAO,SAAS,SAAS,QAAQ,IAAI,+BAA+B,QAAQ,cAAc,SAAS,qBAAqB,6BAA6B,8BAA8B,6EAA6E,mBAAmB,iBAAiB,WAAW,+BAA+B,YAAY,YAAY,+BAA+B,kBAAkB,8CAA8C,kBAAkB,sJAAsJ,qDAAqD,IAAI,mCAAmC,UAAU,6BAA6B,mDAAmD,oCAAoC,EAAE,UAAU,0DAA0D,OAAO,iBAAiB,WAAW,+BAA+B,iBAAiB,WAAW,+BAA+B,iBAAiB,mDAAmD,iBAAiB,uCAAuC,iBAAiB,kDAAkD,iBAAiB,YAAY,0BAA0B,yBAAyB,iBAAiB,MAAM,kIAAkI,0FAA0F,iBAAiB,kEAAkE,kCAAkC,UAAU,gBAAgB,EAAE,YAAY,4BAA4B,wDAAwD,EAAE,iBAAiB,yBAAyB,sCAAsC,iBAAiB,aAAa,cAAc,kCAAkC,gBAAgB,OAAO,+DAA+D,kBAAkB,gBAAgB,cAAc,yBAAyB,6BAA6B,GAAG,cAAc,4DAA4D,cAAc,2BAA2B,cAAc,yDAAyD,SAAS,kEAAkE,6BAA6B,8EAA8E,IAAI,cAAc,MAAM,eAAe,UAAU,IAAI,WAAW,6BAA6B,6FAA6F,YAAY,kCAAkC,sCAAsC,uBAAuB,kCAAkC,mBAAmB,mBAAmB,4SAA4S,yBAAyB,kDAAkD,EAAE,kEAAkE,iBAAiB,8CAA8C,qKAAqK,wBAAwB,yBAAyB,sBAAsB,mBAAmB,kBAAkB,mBAAmB,kBAAkB,mBAAmB,kBAAkB,oBAAoB,kBAAkB,oBAAoB,kBAAkB,oBAAoB,oBAAoB,iBAAiB,kBAAkB,qCAAqC,kBAAkB,eAAe,WAAW,IAAI,OAAO,SAAS,IAAI,wBAAwB,EAAE,iBAAiB,YAAY,sBAAsB,qBAAqB,iEAAiE,kLAAkL,iBAAiB,cAAc,8EAA8E,QAAQ,qCAAqC,iBAAiB,aAAa,gBAAgB,oCAAoC,6GAA6G,uBAAuB,sEAAsE,OAAO,kBAAkB,gBAAgB,6BAA6B,oDAAoD,iBAAiB,mBAAmB,+GAA+G,gCAAgC,2BAA2B,iBAAiB,2BAA2B,iBAAiB,iHAAiH,kCAAkC,cAAc,cAAc,kBAAkB,UAAU,yBAAyB,gBAAgB,yBAAyB,gBAAgB,kBAAkB,gBAAgB,gBAAgB,sEAAsE,MAAM,gCAAgC,gDAAgD,oDAAoD,6DAA6D,kCAAkC,6BAA6B,iBAAiB,wEAAwE,kCAAkC,cAAc,wBAAwB,EAAE,YAAY,kCAAkC,6FAA6F,kEAAkE,iBAAiB,6BAA6B,sBAAsB,oEAAoE,aAAa,sBAAsB,gCAAgC,iBAAiB,gBAAgB,kBAAkB,6BAA6B,kBAAkB,sDAAsD,gCAAgC,EAAE,SAAS,4HAA4H,cAAc,uCAAuC,yBAAyB,2EAA2E,UAAU,0CAA0C,kDAAkD,iBAAiB,cAAc,IAAI,YAAY,SAAS,kBAAkB,gBAAgB,mHAAmH,0BAA0B,8DAA8D,iBAAiB,qBAAqB,iBAAiB,cAAc,6BAA6B,uCAAuC,UAAU,sBAAsB,QAAQ,2FAA2F,uBAAuB,8CAA8C,aAAa,iBAAiB,kBAAkB,+BAA+B,YAAY,uCAAuC,6DAA6D,SAAS,mBAAmB,0DAA0D,SAAS,wBAAwB,oEAAoE,SAAS,aAAa,iBAAiB,uDAAuD,EAAE,sBAAsB,qBAAqB,GAAG,aAAa,uBAAuB,GAAG,E;;;;;;ACA/0iB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,gCAA+B;AAC/B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA,0BAAyB;;AAEzB;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA,oFAAmF;AACnF;AACA;;AAEA;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB;AACjB;AACA;AACA,cAAa;;AAEb;AACA;;AAEA;AACA;;AAEA;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB;AACjB,cAAa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA,6DAA4D;;AAE5D;AACA,uEAAsE,QAAQ;AAC9E;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;;;;;;AC7OD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,mEAAkE,cAAc;AAChF;AACA;;AAEA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA2B,kBAAkB;AAC7C;AACA;AACA;;AAEA;AACA,4BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA,kBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA6C,OAAO;AACpD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA,EAAC;;;;;;;ACpXD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,gBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA,sBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAAyB;AACzB;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA,mEAAkE;;AAElE;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB;;AAEjB;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;;;;;;;ACjND;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,kBAAiB;AACjB;AACA;AACA,kBAAiB;AACjB;AACA;AACA,kBAAiB;AACjB;AACA;AACA,kBAAiB;AACjB;AACA;AACA,kBAAiB;AACjB;AACA;AACA,kBAAiB;AACjB;AACA;AACA,kBAAiB;AACjB;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wBAAuB,oBAAoB;AAC3C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,EAAC;;;;;;;ACxFD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;;AAEb,4CAA2C;;AAE3C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;;AAEA,sDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA;;AAEA,gCAA+B,sBAAsB;AACrD;AACA;AACA,sBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;;;;;;;ACjGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa;AACb;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,EAAC;;;;;;;ACpDD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa;AACb;;AAEA,wCAAuC,QAAQ;AAC/C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kCAAiC,mCAAmC;AACpE;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,+CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA,4BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA,cAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA0D,kBAAkB;AAC5E;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA,4FAA2F,wBAAwB;AACnH,qFAAoF,wBAAwB;AAC5G;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,cAAa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;AACA,8EAA6E;AAC7E,yEAAwE;AACxE,sBAAqB;AACrB,2EAA0E;AAC1E;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,cAAa;;AAEb;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA,sDAAqD;AACrD;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA,+EAA8E,cAAc;AAC5F;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,EAAC;;;;;;;;AC1mBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAa;AACb;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,EAAC;AACD;AACA;AACA;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAmB,sBAAsB;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,IAAG;AACH,wBAAuB,SAAS;AAChC;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6CAA4C,KAAK;;AAEjD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA,MAAK;AACL;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA,oCAAmC,OAAO;AAC1C;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;;AAGA;AACA;AACA,0DAAyD;AACzD;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;AACX,UAAS;AACT;AACA;AACA,YAAW;AACX;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA,YAAW,SAAS;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;ACzkBA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4BAA2B;AAC3B;AACA;AACA;AACA,6BAA4B,UAAU;;;;;;;ACzFtC;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;iGCtBA;AACA;AACA,EAAC;AACD;AACA,EAAC,mBAAmB,gCAAgC;AACpD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,8BAA6B,2CAA2C;AACxE;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,8BAA6B,2CAA2C;AACxE;;AAEA;AACA,qBAAoB,WAAW;AAC/B,gCAA+B,yBAAyB;AACxD,yBAAwB,kBAAkB;AAC1C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,yCAAwC,OAAO;AAC/C;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA,0CAAyC,cAAc;AACvD;AACA,wCAAuC,OAAO;AAC9C,yCAAwC,aAAa;AACrD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,6CAA4C,qBAAqB;;AAEjE;AACA;AACA;;AAEA,uBAAsB,yDAAyD;AAC/E,wCAAuC,8BAA8B;;AAErE;AACA;AACA;AACA;;AAEA;AACA,+CAA8C,OAAO;AACrD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,yDAAwD;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAmB,OAAO;AAC1B;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAmB,OAAO;AAC1B;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAA+B,OAAO,OAAO,WAAW;;AAExD;AACA;;AAEA;AACA,+BAA8B;AAC9B,wBAAuB;AACvB;AACA,2BAA0B,4BAA4B;AACtD;;AAEA;AACA;AACA;;AAEA,sCAAqC,OAAO;AAC5C;AACA;AACA;AACA;AACA,6BAA4B,2CAA2C;AACvE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;;AAET;AACA;AACA,UAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA,EAAC;;;;;;;;ACpND;;;;;;;;ACAA,2IAA8D,0VAAqB,EAAE;AACrF;AACA,qBAAoB,sBAAsB,EAAE;AAC5C,gBAAe,mBAAmB,EAAE;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAwB;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAA+C,aAAa;AAC5D;AACA;AACA;AACA;AACA,kDAAiD,aAAa;AAC9D;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAuD,cAAc;AACrE;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAsD,eAAe;AACrE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,sDAAqD,cAAc;;AAEnE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2DAA0D,cAAc;AACxE;;AAEA;AACA;AACA;AACA;;AAEA;AACA,mDAAkD,cAAc;AAChE,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,0CAAyC,OAAO;AAChD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,UAAS;AACT;;AAEA;;AAEA;AACA,mCAAkC,aAAa;AAC/C;AACA,sCAAqC,OAAO;AAC5C;AACA,+CAA8C,OAAO;AACrD,2DAA0D,cAAc;AACxE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;;;;;;;;;;;AC9YD,UAAS,kBAAkB,CAAC,mBAAmB,EAAE;;AAE7C,wBAAmB,CAAC,yBAAyB,CAAC,UAAS,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE;AACnG,aAAI,SAAS,IAAI,SAAS,EAAE;;AAExB,iBAAI,MAAM,CAAC,KAAK,EAAE;AACd,qBAAI,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC;AACjD,qBAAI,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC;AAC7C,uBAAM,CAAC,KAAK,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAC7C,wBAAO,MAAM,CAAC,KAAK,CAAC;AACpB,wBAAO,MAAM,CAAC,QAAQ,CAAC;cAC1B;;AAED,iBAAI,MAAM,CAAC,UAAU,EAAE;AACnB,uBAAM,CAAC,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;AACxE,wBAAO,MAAM,CAAC,UAAU,CAAC;AACzB,wBAAO,MAAM,CAAC,QAAQ,CAAC;cAC1B;;AAED,iBAAI,MAAM,CAAC,QAAQ,EAAE;AACjB,uBAAM,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;AAChC,wBAAO,MAAM,CAAC,QAAQ,CAAC;cAC1B;AACD,iBAAI,OAAO,CAAC,eAAe,CAAC,EAAE;AAC1B,wBAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;cACxE;UAEJ;AACD,gBAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;MAC/C,CAAC,CAAC;EACN;;AAED,UAAS,mBAAmB,CAAC,mBAAmB,EAAE;AAC9C,wBAAmB,CAAC,sBAAsB,CAAC,UAAS,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE;AACtF,aAAI,SAAS,IAAI,SAAS,EAAE;AACxB,iBAAI,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AACrD,qBAAQ,CAAC,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;UACpD;AACD,gBAAO,IAAI,CAAC;MACf,CAAC,CAAC;EACN;;sBAEc,EAAE,kBAAkB,EAAlB,kBAAkB,EAAE,mBAAmB,EAAnB,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;2DC1ClC,EAAoC;;;;KAEtD,WAAW;eAAX,WAAW;;AACF,cADT,WAAW,CACD,IAAI,EAAE;+BADhB,WAAW;;AAET,oCAFF,WAAW,6CAEH,IAAI,EAAE;AACZ,aAAI,CAAC,SAAS,GAAG,GAAG,CAAC;AACrB,aAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;AACtB,aAAI,CAAC,WAAW,GAAG,MAAM,CAAC;AAC1B,aAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC;MACpD;;kBAPC,WAAW;;gBASL,kBAAC,SAAQ,EAAE;AACf,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,SAAS,CAAC;AAC7C,iBAAI,CAAC,SAAS,GAAG,SAAQ,CAAC;AAC1B,iBAAI,CAAC,OAAO,GAAG,SAAQ,GAAG,IAAI,CAAC,WAAW,CAAC;AAC3C,oBAAO,IAAI,CAAC;UACf;;;YAdC,WAAW;;;sBAkBF,WAAW;;;;;;;;;;;;;;;;;;;;;;;mCCpBR,EAAS;;;;KAErB,WAAW;eAAX,WAAW;;AACF,cADT,WAAW,CACD,IAAI,EAAE;+BADhB,WAAW;;AAET,oCAFF,WAAW,6CAEH,IAAI,EAAE;AACZ,aAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;AACtB,aAAI,CAAC,OAAO,GAAG,SAAS,CAAC;MAC5B;;;;;;;;;;;;;;kBALC,WAAW;;gBAkBP,gBAAC,KAAK,EAAE;AACV,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,OAAO,CAAC;AAC3C,iBAAI,CAAC,OAAO,GAAG,KAAK,CAAC;AACrB,oBAAO,IAAI,CAAC;UACf;;;gBAEW,sBAAC,QAAQ,EAAE;AACnB,oBAAO,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;AAC3F,iBAAI,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AACzC,oBAAO,IAAI,CAAC;UACf;;;YA5BC,WAAW;;;sBAgCF,WAAW;;;;;;;;;;;;;;;;;;;6CClCF,EAAsB;;;;KAExC,KAAK;AACI,cADT,KAAK,CACK,IAAI,EAAE;+BADhB,KAAK;;AAEH,aAAI,CAAC,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC7D,aAAI,CAAC,WAAW,GAAI,IAAI,KAAK,IAAK,CAAC;AACnC,aAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;AACtB,aAAI,CAAC,MAAM,GAAG,IAAI,CAAC;AACnB,aAAI,CAAC,MAAM,GAAG,IAAI,CAAC;AACnB,aAAI,CAAC,KAAK,GAAG,EAAE,CAAC;AAChB,aAAI,CAAC,WAAW,GAAG,EAAE,CAAC;AACtB,aAAI,CAAC,WAAW,GAAG,EAAE,CAAC;AACtB,aAAI,CAAC,WAAW,GAAG,IAAI,CAAC;AACxB,aAAI,CAAC,WAAW,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAG,CAAC,EAAE,SAAS,EAAG,KAAK,EAAE,CAAC;AACzE,aAAI,CAAC,aAAa,GAAG,IAAI,CAAC;AAC1B,aAAI,CAAC,SAAS,GAAG,IAAI,CAAC;AACtB,aAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;AAC/B,aAAI,CAAC,OAAO,GAAG,KAAK,CAAC;AACrB,aAAI,CAAC,YAAY,GAAG,IAAI,CAAC;AACzB,aAAI,CAAC,SAAS,GAAG,IAAI,CAAC;AACtB,aAAI,CAAC,IAAI,GAAG,IAAI,CAAC;MACpB;;kBAnBC,KAAK;;gBAqBF,iBAAG;AACJ,iBAAI,SAAS,CAAC,MAAM,EAAE;AAClB,qBAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC3B,wBAAO,IAAI,CAAC;cACf;;AAED,iBAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE;AACtB,wBAAO,8BAAY,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;cAC5C;;AAED,oBAAO,IAAI,CAAC,MAAM,CAAC;UACtB;;;gBAEG,gBAAG;AACH,oBAAO,IAAI,CAAC,KAAK,CAAC;UACrB;;;gBAEG,gBAAG;AACH,iBAAI,SAAS,CAAC,MAAM,EAAE;AAClB,qBAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,wBAAO,IAAI,CAAC;cACf;;AAED,oBAAO,IAAI,CAAC,KAAK,CAAC;UACrB;;;gBAEI,iBAAG;AACJ,iBAAI,SAAS,CAAC,MAAM,EAAE;AAClB,qBAAG,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;AACtB,4BAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;kBAChG;AACD,qBAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC3B,wBAAO,IAAI,CAAC;cACf;;AAED,oBAAO,IAAI,CAAC,MAAM,CAAC;UACtB;;;gBAEW,sBAAC,UAAU,EAAE;AACrB,iBAAI,SAAS,CAAC,MAAM,EAAE;AAClB,qBAAI,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,wBAAO,IAAI,CAAC;cACf;;AAED,iBAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE;AAC3B,wBAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC;cAC9B;;AAED,oBAAO,IAAI,CAAC,WAAW,CAAC;UAC3B;;;;;;;gBASE,aAAC,EAAE,EAAE;AACJ,iBAAI,CAAC,EAAE,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC;AAC3B,iBAAI,OAAO,EAAG,KAAK,UAAU,EAAE;AAC3B,qBAAI,IAAI,GAAG,OAAO,EAAG,CAAC;AACtB,uBAAM,IAAI,KAAK,yCAAuC,IAAI,aAAU,CAAC;cACxE;;AAED,iBAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;AAEpB,oBAAO,IAAI,CAAC;UACf;;;gBAEM,mBAAG;AACN,oBAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;UAC9B;;;gBAEa,wBAAC,KAAK,EAAE,KAAK,EAAE;AACzB,kBAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE;AACtB,sBAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;cACvC;;AAED,oBAAO,KAAK,CAAC;UAChB;;;;;;;gBAKQ,mBAAC,EAAE,EAAE;AACV,iBAAI,CAAC,EAAE,EAAE,OAAO,IAAI,CAAC,WAAW,CAAC;AACjC,iBAAI,OAAO,EAAG,KAAK,UAAU,EAAE;AAC3B,qBAAI,IAAI,GAAG,OAAO,EAAG,CAAC;AACtB,uBAAM,IAAI,KAAK,+CAA6C,IAAI,aAAU,CAAC;cAC9E;;AAED,iBAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;AAE1B,oBAAO,IAAI,CAAC;UACf;;;gBAEW,wBAAG;AACX,oBAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;UACpC;;;gBAEkB,6BAAC,KAAK,EAAE,KAAK,EAAE;AAC9B,kBAAK,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE;AAC5B,sBAAK,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;cAC7C;;AAED,oBAAO,KAAK,CAAC;UAChB;;;gBAES,oBAAC,WAAU,EAAE;AACnB,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE;AACnB,wBAAO,IAAI,CAAC,WAAW,CAAC;cAC3B;;AAED,iBAAI,CAAC,WAAW,GAAG,WAAU,CAAC;;AAE9B,oBAAO,IAAI,CAAC;UACf;;;gBAES,oBAAC,OAAO,EAAE;AAChB,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,WAAW,CAAC;AAC/C,iBAAI,CAAC,WAAW,GAAG,OAAO,CAAC;AAC3B,oBAAO,IAAI,CAAC;UACf;;;gBAEY,uBAAC,KAAK,EAAE;AACjB,iBAAI,CAAC,IAAI,CAAC,WAAW,EAAE;AACnB,wBAAO,EAAE,CAAC;cACb;;AAED,iBAAI,IAAI,CAAC,WAAW,CAAC,WAAW,KAAK,KAAK,EAAE;AACxC,wBAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;cACrC;;AAED,iBAAI,OAAO,IAAI,CAAC,WAAY,KAAK,UAAU,EAAE;AACzC,wBAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;cAClC;;AAED,oBAAO,IAAI,CAAC,WAAW,CAAC;UAC3B;;;gBAES,oBAAC,WAAU,EAAE;AACnB,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE;AACnB,wBAAO,IAAI,CAAC,WAAW,CAAC;cAC3B;;AAED,kBAAK,IAAI,QAAQ,IAAI,WAAU,EAAE;AAC7B,qBAAI,CAAC,WAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,SAAS;AACnD,qBAAI,WAAU,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;AAC/B,4BAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;kBACrC,MAAM;AACH,yBAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,WAAU,CAAC,QAAQ,CAAC,CAAC;kBACrD;cACJ;;AAED,oBAAO,IAAI,CAAC;UACf;;;gBAEW,sBAAC,aAAY,EAAE;AACvB,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,aAAa,CAAC;AACjD,iBAAI,CAAC,aAAa,GAAG,aAAY,CAAC;AAClC,oBAAO,IAAI,CAAC;UACf;;;gBAEO,kBAAC,SAAQ,EAAE;AACf,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,SAAS,CAAC;AAC7C,iBAAI,CAAC,SAAS,GAAG,SAAQ,CAAC;AAC1B,oBAAO,IAAI,CAAC;UACf;;;gBAEc,yBAAC,KAAK,EAAE;AACnB,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,gBAAgB,CAAC;AACpD,iBAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;AAC9B,oBAAO,IAAI,CAAC;UACf;;;gBAEK,gBAAC,OAAM,EAAE;AACX,iBAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,OAAO,CAAC;AAC3C,iBAAI,CAAC,OAAO,GAAG,OAAM,CAAC;AACtB,oBAAO,IAAI,CAAC;UACf;;;gBAEU,uBAAG;AACV,oBAAO,IAAI,CAAC,YAAY,CAAC;UAC5B;;;cArIa,aAAC,YAAY,EAAE;AACzB,oBAAO,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC;UAC1C;;;YA1EC,KAAK;;;sBAgNI,KAAK;;;;;;;;;;;;sBClNL;;;;;AAKX,cAAS,EAAE,mBAAS,IAAI,EAAE;AACtB,aAAI,CAAC,IAAI,EAAE;AACP,oBAAO,IAAI,CAAC;UACf;;AAED,aAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACrC,aAAI,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;;AAE1B,gBAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,KAAK,EAAE,MAAM,EAAE;AACxD,oBAAO,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;UACrC,CAAC,CAAC;MACN;EACJ;;;;;;;;;;;;sBCjBc;AACX,kBAAa,EAAI;gBAAM,4FAA4F;MAAA;AACnH,kBAAa,EAAI;gBAAM,6BAA6B,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,MAAM;MAAA;AAC9F,oBAAe,EAAE;gBAAM,yGAAyG;MAAA;AAChI,mBAAc,EAAG;gBAAM,2MAA2M;MAAA;EACrO;;;;;;;;;;;;ACLD,UAAS,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE;AACtD,iBAAY,CAAC;;AAEb,YAAO;AACH,iBAAQ,EAAE,GAAG;AACb,cAAK,EAAE;AACH,mBAAM,EAAE,GAAG;AACX,iBAAI,EAAE,GAAG;UACZ;AACD,aAAI,EAAE,cAAS,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;AAClC,kBAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;AAC9B,kBAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AACxB,kBAAK,CAAC,OAAO,GAAG,UAAS,MAAM,EAAE;AAC7B,4BAAW,CACN,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAC5C,IAAI,CAAC,gBAAM,EAAI;AACZ,2BAAM,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAC5B,4BAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;kBAC5B,CAAC,CACD,IAAI,CAAC;4BAAM,MAAM,CAAC,MAAM,EAAE;kBAAA,CAAC,CAC3B,IAAI,CAAC;4BAAM,YAAY,CAAC,GAAG,CAAC,SAAS,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;kBAAA,CAAE,SAClF,CAAC,WAAC;4BAAI,YAAY,CAAC,GAAG,CAAC,sCAAsC,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;kBAAA,CAAE;cACrI;UACJ;AACD,iBAAQ,6fAMX;MACA,CAAC;EACL;;AAED,cAAa,CAAC,OAAO,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;;sBAEnD,aAAa;;;;;;;;;;;;ACpC5B,UAAS,YAAY,CAAC,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE;AACzD,iBAAY,CAAC;;AAEb,YAAO;AACH,iBAAQ,EAAE,GAAG;AACb,cAAK,EAAE;AACH,sBAAS,EAAE,GAAG;AACd,iBAAI,EAAE,GAAG;UACZ;AACD,aAAI,EAAE,cAAS,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;AAClC,iBAAM,MAAM,GAAG,KAAK,CAAC,IAAI,IAAI,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAChE,kBAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,QAAQ,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AACtF,kBAAK,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,IAAI,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC3D,kBAAK,CAAC,YAAY,GAAG,YAAW;AAC5B,mBAAE,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,WAAC;4BAAI,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE;kBAAA,CAAC,CAAC,CAC1E,IAAI,CAAC,wBAAc;4BAAI,cAAc,CAAC,GAAG,CAAC,WAAC;gCAAI,CAAC,CAAC,IAAI;sBAAA,CAAC;kBAAA,CAAC,CACvD,IAAI,CAAC,iBAAO;4BAAI,OAAO,CAAC,GAAG,CAAC,gBAAM,EAAI;;AACnC,+BAAM,CAAC,MAAM,GAAG,MAAM,CAAC;AACvB,gCAAO,MAAM,CAAC,GAAG,EAAE,CAAC;sBACvB,CAAC;kBAAA,CAAC;kBACF,IAAI,CAAC;4BAAM,MAAM,CAAC,MAAM,EAAE;kBAAA,CAAC,CAC3B,IAAI,CAAC;4BAAM,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,WAAW,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;kBAAA,CAAE,SAC7G,CAAC,WAAC;4BAAI,YAAY,CAAC,GAAG,CAAC,sCAAsC,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;kBAAA,CAAE;cACrI;UACJ;AACD,iBAAQ,0HAA0H;MACrI,CAAC;EACL;;AAED,aAAY,CAAC,OAAO,GAAG,CAAC,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;;sBAExD,YAAY;;;;;;;;;;;;AC/B3B,UAAS,UAAU,GAAG;AAClB,iBAAY,CAAC;;AAEb,YAAO;AACH,iBAAQ,EAAE,GAAG;AACb,cAAK,EAAE;AACN,kBAAK,EAAE,GAAG;UACV;AACD,aAAI,EAAE,cAAS,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE;AACvC,kBAAK,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;UACjG;AACD,iBAAQ,2EAA2E;MACtF,CAAC;EACL;;AAED,WAAU,CAAC,OAAO,GAAG,EAAE,CAAC;;sBAET,UAAU;;;;;;;;;;;;ACjBzB,UAAS,MAAM,CAAC,WAAW,EAAE,EAAE,EAAE;AAC7B,iBAAY,CAAC;;AAEb,YAAO;AACH,iBAAQ,EAAE,GAAG;AACb,cAAK,EAAE;AACN,oBAAO,EAAE,GAAG;UACZ;AACD,mBAAU,EAAE,oBAAS,MAAM,EAAE;AACzB,mBAAM,CAAC,YAAY,GAAG,EAAE,CAAC;AAC5B,iBAAI,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAC9B,GAAG,CAAC,cAAI;wBAAI,IAAI,CAAC,UAAU;cAAA,CAAC,CAC5B,MAAM,CAAC,UAAC,QAAQ,EAAE,OAAO,EAAK;AAC3B,qBAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;AAC5D,wBAAO,QAAQ,CAAC;cACnB,EAAE,EAAE,CAAC,CAAC;AACX,iBAAI,QAAQ,GAAG,UAAU,CACpB,GAAG,CAAC,oBAAU,EAAI;AACf,wBAAO,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC;cACxD,CAAC,CAAC;AACP,eAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,kBAAQ,EAAI;AAC9B,qBAAI,YAAY,GAAG,EAAE,CAAC;AACtB,yBAAQ,CAAC,OAAO,CAAC,iBAAO,EAAI;AACxB,iCAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;kBAChD,CAAC,CAAC;AACH,uBAAM,CAAC,YAAY,GAAG,YAAY;cACrC,CAAC;AACF,mBAAM,CAAC,MAAM,CAAC,SAAS,EAAE,UAAS,OAAO,EAAE;AACvC,qBAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO;AAC1D,wBAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,cAAI;4BAAI,IAAI,CAAC,QAAQ,GAAG,CAAC;kBAAA,CAAC,CAAC;AAClE,wBAAO,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,UAAC,KAAK,EAAE,IAAI,EAAK;AAC5D,0BAAK,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ;AACnE,4BAAO,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;kBACvC,EAAE,CAAC,CAAC,CAAC;AACN,wBAAO,CAAC,KAAK,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACpF,qBAAI,KAAK,GAAG,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;AAC3E,wBAAO,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;cAChD,EAAE,IAAI,CAAC,CAAC;UACZ;AACD,iBAAQ,6oDAyCf;MACI,CAAC;EACL;;AAED,OAAM,CAAC,OAAO,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;;sBAExB,MAAM;;;;;;;;;;;;;;;mCCtFF,EAAQ;;;;iDACU,GAAyB;;;;AAE9D,KAAI,WAAW,GAAG,0BAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;;AAE1D,KAAI,cAAc,GAAG,KAAK,CAAC;;AAE3B,UAAS,gBAAgB,CAAC,WAAW,EAAE;AACnC,iBAAY,CAAC;;AAEb,YAAO;AACH,iBAAQ,EAAE,GAAG;AACb,cAAK,EAAE,EAAE;AACT,mBAAU,EAAE,oBAAS,MAAM,EAAE;AACzB,mBAAM,CAAC,KAAK,GAAG,EAAE,CAAC;AAClB,mBAAM,CAAC,cAAc,GAAG,cAAc,CAAC;AACvC,mBAAM,CAAC,YAAY,GAAG,YAAM;AACxB,+BAAc,GAAG,IAAI,CAAC;AACtB,uBAAM,CAAC,cAAc,GAAG,IAAI,CAAC;cAChC,CAAC;AACF,wBAAW,CACN,GAAG,CAAC,UAAU,CAAC,CACf,OAAO,CAAC,EAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CAAC,WAAW,EAAE,GAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAC,CAAC,CAC7F,IAAI,CAAC,kBAAQ,EAAI;AACd,uBAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAChC,MAAM,CAAC,UAAC,KAAK,EAAE,OAAO,EAAK;AACxB,yBAAI,OAAO,CAAC,MAAM,IAAI,WAAW,EAAE,KAAK,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC;AAClE,yBAAI,OAAO,CAAC,MAAM,IAAI,SAAS,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC;AACxD,4BAAO,KAAK,CAAC;kBAChB,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAC,CAAC;cAC3C,CAAC,CAAC;AACP,wBAAW,CACN,GAAG,CAAC,WAAW,CAAC,CAChB,OAAO,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE,wCAAwC,GAAE,WAAW,CAAC,WAAW,EAAE,GAAG,IAAI,EAAC,CAAC,CAC9I,IAAI,CAAC,mBAAS,EAAI;AACf,uBAAM,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,YAAE;4BAAI,EAAE,EAAE;kBAAA,EAAE,CAAC,CAAC;cAChE,CAAC,CAAC;AACP,wBAAW,CACN,GAAG,CAAC,SAAS,CAAC,CACd,OAAO,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,sBAAsB,EAAC,CAAC,CACpF,IAAI,CAAC,iBAAO,EAAI;AACb,uBAAM,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,YAAE;4BAAI,EAAE,EAAE;kBAAA,EAAE,CAAC,CAAC;cAC5D,CAAC,CAAC;UACV;AACD,iBAAQ,mCAA0B;MACrC,CAAC;EACL;;AAED,iBAAgB,CAAC,OAAO,GAAG,CAAC,aAAa,CAAC,CAAC;;sBAE5B,gBAAgB;;;;;;;AClD/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,oBAAoB;;AAErB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,YAAY;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iCAAgC;AAChC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2KAA0K,IAAI;;AAE9K,sEAAqE,IAAI;;AAEzE;;AAEA;;AAEA;AACA;AACA;AACA,+BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,2CAA0C,YAAY;AACtD;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA,wBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+BAA8B;AAC9B,iCAAgC;AAChC,8BAA6B,EAAE,EAAE;AACjC,8BAA6B,EAAE,EAAE;AACjC,mCAAkC,EAAE,EAAE;AACtC,kCAAiC;AACjC,8BAA6B,IAAI,EAAE;AACnC,8BAA6B,IAAI,EAAE;AACnC,mCAAkC,IAAI,EAAE;;AAExC,gCAA+B;AAC/B,qCAAoC;;AAEpC,+CAA8C;;AAE9C,yCAAwC,IAAI,IAAI;;AAEhD;AACA,iIAAgI,IAAI;;AAEpI;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS,+BAA+B;AACxC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,kBAAkB;AACrC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,gDAA+C,EAAE,IAAI,EAAE;;AAEvD;AACA,kCAAiC,EAAE,IAAI,EAAE,IAAI,EAAE;AAC/C,4BAA2B,EAAE,IAAI,EAAE,IAAI,EAAE;AACzC,8BAA6B,EAAE,KAAK,EAAE;AACtC,4BAA2B,EAAE,KAAK,EAAE;AACpC,0BAAyB,EAAE,IAAI,EAAE;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA,6CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAmB,+BAA+B;AAClD;AACA;;AAEA;AACA,eAAc,OAAO;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,oBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAmB,sBAAsB;AACzC;AACA,uCAAsC;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,0CAAyC,gBAAgB;AACzD;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sEAAqE,EAAE;;AAEvE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS,6BAA6B;AACtC;AACA,UAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAmB;;AAEnB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA0B,cAAc;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wCAAuC,qBAAqB;AAC5D;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wCAAuC,qBAAqB;AAC5D;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yBAAwB;AACxB;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,oBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;;;AAGL;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,yBAAwB,mBAAmB;AAC3C;AACA;;AAEA;AACA;AACA;;AAEA,sBAAqB,mBAAmB;AACxC;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAS;;AAET;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,mCAAkC,IAAI;;AAEtC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,uFAAsF,IAAI;AAC1F;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;;AAEL;;;AAGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,EAAC,G;;;;;;;AC1nGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,uDAAuD;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvLA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA,6FAA4F;AAC5F,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACvED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACtID;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACzDD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACrGD;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACvDD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA,gCAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACtGD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACjJD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC/GD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC5GD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACzGD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC3ID;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7ED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,4BAA2B,IAAI;AAC/B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC3JD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC;AACnC,kBAAiB;AACjB;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7ED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC1DD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACzED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC1ED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA,yEAAwE;AACxE;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,kCAAiC;AACjC,iCAAgC;AAChC,iCAAgC;AAChC,gCAA+B;AAC/B;AACA;AACA;AACA,0DAAyD;AACzD;AACA,2DAA0D;AAC1D;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,sCAAqC;AACrC,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC5FD;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AChED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACjED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACvED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,4BAA2B,IAAI;AAC/B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7ED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC9ED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC9DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACvGD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACzGD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC1DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC5DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxDD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACrED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,4BAA2B,IAAI;AAC/B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACzED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AChFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACzHD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC1ID;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC3GD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,2BAA0B,IAAI,IAAI,IAAI;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7GD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACjFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7HD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,4BAA2B,IAAI;AAC/B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACpED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC/DD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACjFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,qCAAoC,IAAI,IAAI,IAAI;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACrGD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxDD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,4BAA2B,IAAI;AAC/B;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AClED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB;AACtB,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACpID;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC3HD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC9FD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC3GD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACrED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACvHD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AChFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AChFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC3FD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC3DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACzHD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACrED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC1DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACvGD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA4C;AAC5C,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC9DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA4C;AAC5C,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC1DD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,sBAAqB;AACrB;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AClKD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC/DD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC5JD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC9JD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACnED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC1GD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC1GD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACjED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,cAAa;AACb,iCAAgC;AAChC,cAAa;AACb,gCAA+B;AAC/B,cAAa;AACb,mCAAkC;AAClC,cAAa;AACb,mCAAkC;AAClC,cAAa;AACb,gCAA+B;AAC/B,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7FD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC/DD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC5DD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA,gCAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;;AAI3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,EAAC,G;;;;;;ACnFD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxDD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxDD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACvJD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACxDD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AChED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;AC7HD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC,0BAA0B;;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,2BAA0B,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA,EAAC,G;;;;;;ACnGD,0yBAAyyB,qCAAqC,mKAAmK,kBAAkB,ouBAAouB,iCAAiC,kKAAkK,0BAA0B,kBAAkB,8tBAA8tB,iBAAiB,mKAAmK,0BAA0B,kBAAkB,4tBAA4tB,mBAAmB,iKAAiK,2BAA2B,kBAAkB,6V;;;;;;;;;;;;;;iDCApzH,GAAyB;;;;qCACjC,GAAY;;;;sBAElB,UAAU,cAAc,EAAE;AACrC,mBAAc,CAAC,KAAK,CAAC,UAAU,EAAE;AAC7B,eAAM,EAAE,MAAM;AACd,YAAG,EAAE,WAAW;AAChB,eAAM,EAAE,EAAG;AACX,mBAAU,EAAE,CAAC,QAAQ,EAAE,UAAC,MAAM,EAAK;AAC/B,mBAAM,CAAC,QAAQ,GAAG,sBAAS,MAAM,CAAC;UACrC,CAAC;AACF,iBAAQ,mCAAkB;MAC7B,CAAC,CAAC;EACN;;AAAA,EAAC;;;;;;;ACbF,iqBAAgqB,WAAW,8KAA8K,kBAAkB,2J;;;;;;;;;;;ACA32B,KAAI,QAAQ,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC;;sBAE7E;AACd,QAAM,EAAE,QAAQ;AAChB,SAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,iBAAO,EAAI;AAAE,UAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;GAAE,CAAC;EAC/E;;;;;;;;;;;;ACLD,KAAI,MAAM,GAAG,mBAAO,CAAC,EAAQ,CAAC,CAAC;AAC/B,KAAI,OAAO,GAAG,SAAV,OAAO,CAAG,CAAC;YAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;EAAA,CAAC;;AAEvC,KAAI,QAAQ,GAAG,mBAAO,CAAC,GAAsB,CAAC,CAAC,OAAO,CAAC;;sBAExC,UAAU,GAAG,EAAE,KAAK,EAAE;;AAEjC,SAAI,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;AAC5C,aAAQ,CAAC,QAAQ,EAAE,CACd,KAAK,CAAC,UAAU,CAAC,CACjB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAC1B,KAAK,CAAC,EAAE,CAAC,CACT,QAAQ,CAAC,4EAA4E,CAAC,EAC3F,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC;MAC7B,KAAK,CAAC,MAAM,CAAC,CACb,YAAY,CAAC,IAAI,CAAC,CAClB,QAAQ,CAAC,4DAA4D,CAAC,EAC3E,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAC7B,GAAG,CAAC,OAAO,CAAC,CACZ,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC7B,KAAK,CAAC,UAAU,CAAC,CACjB,UAAU,CAAC,eAAK;gBAAI,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW,GAAG,uBAAuB;MAAA,CAAC,EAC1F,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC7B,UAAU,CAAC,eAAK;gBAAI,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW,GAAG,uBAAuB;MAAA,CAAC,EAC1F,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,UAAU,CAAC,CACnC,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,SAAS,CAAC,CACjC,KAAK,CAAC,YAAY,CAAC,CACnB,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC5B,QAAQ,CAAC,+GAA+G,CAAC,CACzH,UAAU,CAAC,WAAW,CAAC,CAC/B,CAAC,CACD,OAAO,CAAC,CACL,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,CACrB,KAAK,CAAC,EAAE,CAAC,CACT,MAAM,CAAC,IAAI,CAAC,CACZ,QAAQ,CAAC,wMAAwM,CAAC,EACvN,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACxB,KAAK,CAAC,SAAS,CAAC,CAChB,OAAO,CAAC,QAAQ,CAAC,EACtB,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,UAAU,CAAC,CACjC,KAAK,CAAC,eAAe,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,SAAS,CAAC,EACnC,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,SAAS,CAAC,CACzC,CAAC,CACD,SAAS,CAAC,YAAY,CAAC,CACvB,OAAO,CAAC,MAAM,CAAC,CACf,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3B,aAAQ,CAAC,WAAW,EAAE,CACjB,KAAK,CAAC,6JAA6J,CAAC,CACpK,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,EACvB,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,EACtB,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EACjB,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,EAC7B,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,UAAU,CAAC,CAC9B,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,UAAU,CAAC,CACnC,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAC7B,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,SAAS,CAAC,EACtC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CACzB,OAAO,CAAC,QAAQ,CAAC,EACtB,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,iBAAiB,CAAC,CACnC,KAAK,CAAC,iBAAiB,CAAC,CACxB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CACzC,oBAAoB,CAAC,aAAa,CAAC,CACnC,YAAY,CAAC,CACV,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CACZ,GAAG,CAAC,OAAO,CAAC,EACjB,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CACjB,YAAY,CAAC,IAAI,CAAC,EACvB,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAChB,GAAG,CAAC,UAAC,CAAC,EAAC,CAAC;gBAAK,CAAC,CAAC,MAAM,CAAC,MAAM;MAAA,CAAC,EAClC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CACtB,CAAC,CACD,OAAO,CAAC,CAAC,CAAC,CACV,SAAS,CAAC,MAAM,CAAC,CACjB,OAAO,CAAC,MAAM,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,UAAU,CAAC,CACnC,KAAK,CAAC,EAAE,CAAC,CACT,QAAQ,CAAC,sHAAsH,CAAC,EACrI,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAClC,KAAK,CAAC,gBAAgB,CAAC,CACvB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CACxC,oBAAoB,CAAC,aAAa,CAAC,CACnC,YAAY,CAAC,CACV,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,QAAQ,CAAC,CACf,GAAG,CAAC,OAAO,CAAC,CACZ,YAAY,CAAC,IAAI,CAAC,EACvB,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAC1B,QAAQ,CAAC,+DAA+D,CAAC,EAC9E,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CACf,GAAG,CAAC,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC1B,aAAI,CAAC,KAAK,EAAE;AACR,oBAAO,EAAE,CAAC;UACb;AACD,gBAAO,KAAK,CAAC,MAAM,GAAG,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;MAClE,CAAC,EACN,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACxB,OAAO,CAAC,CACL,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EACxC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,EACxC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CACzC,CAAC,CACD,UAAU,CAAC,UAAS,KAAK,EAAE;;AACxB,aAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,UAAU,EAAE;AACnC,oBAAO,wBAAwB,CAAC;UACnC;AACD,aAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,UAAU,EAAE;AACnC,oBAAO,uBAAuB,CAAC;UAClC;AACD,gBAAO,wBAAwB,CAAC;MACnC,CAAC,CACT,CAAC,CACD,OAAO,CAAC,CAAC,CAAC,CACV,SAAS,CAAC,MAAM,CAAC,CACjB,OAAO,CAAC,MAAM,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAClC,KAAK,CAAC,EAAE,CAAC,CACT,QAAQ,CAAC,qHAAqH,CAAC,CACvI,CAAC;;AAEN,YAAO,QAAQ,CAAC;EACnB;;;;;;;;;;;;;;sBCrIc,UAAU,GAAG,EAAE,KAAK,EAAE;;AAEjC,SAAI,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AAC/C,eAAU,CAAC,QAAQ,EAAE,CAChB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CACpB,CAAC,CACD,WAAW,CAAC,CAAC,yJAAyJ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAChM,eAAU,CAAC,YAAY,EAAE,CACpB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CACZ,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EACnC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU,CAAC,CACpB,KAAK,CAAC,EAAE,CAAC,CACT,QAAQ,CAAC,gKAAgK,CAAC,CAElL,CAAC,CAAC;AACP,eAAU,CAAC,WAAW,EAAE,CACnB,MAAM,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;;AAEhD,YAAO,UAAU,CAAC;EACrB;;;;;;;;;;;;;;;;mCCrBkB,EAAQ;;;;wDACS,GAAgC;;;;AAEpE,KAAI,OAAO,GAAG,SAAV,OAAO,CAAG,CAAC;YAAI,yBAAO,CAAC,CAAC,CAAC,OAAO,EAAE;EAAA,CAAC;;sBAExB,UAAU,GAAG,EAAE,KAAK,EAAE;;AAEjC,SAAI,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CACrC,KAAK,CAAC,SAAS,CAAC,CAAC;AACtB,aAAQ,CAAC,QAAQ,EAAE,CACd,KAAK,CAAC,aAAa,CAAC,CACpB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,CACrB,YAAY,CAAC,IAAI,CAAC,CAClB,KAAK,CAAC,EAAE,CAAC,CACT,QAAQ,CAAC,0EAA0E,CAAC,EACzF,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,EACzC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CACvB,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CACtB,MAAM,CAAC,MAAM,CAAC,CACd,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CACvB,MAAM,CAAC,MAAM,CAAC,CACd,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAC3C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAC9B,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CACvB,UAAU,CAAC,WAAW,CAAC,CAC/B,CAAC,CACD,OAAO,CAAC,CACL,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,CACrB,KAAK,CAAC,EAAE,CAAC,CACT,MAAM,CAAC,IAAI,CAAC,CACZ,QAAQ,CAAC,wMAAwM,CAAC,EACvN,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAC3C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EACnC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC,CAC3B,KAAK,CAAC,WAAW,CAAC,EACvB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC,CAC3B,KAAK,CAAC,WAAW,CAAC,EACvB,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,QAAQ,CAAC,CAC5B,KAAK,CAAC,YAAY,CAAC,EACxB,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,QAAQ,CAAC,CAC5B,KAAK,CAAC,YAAY,CAAC,EACxB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAC7B,KAAK,CAAC,WAAW,CAAC,CAClB,YAAY,CAAC,EAAE,CAAC,CACxB,CAAC,CACD,WAAW,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrC,aAAQ,CAAC,YAAY,EAAE,CAClB,KAAK,CAAC,mBAAmB,CAAC,CAC1B,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CACjB,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC7B,UAAU,CAAC,UAAU,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CACvB,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC7B,UAAU,CAAC,UAAU,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CACtB,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC7B,UAAU,CAAC,UAAU,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CACvB,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC7B,UAAU,CAAC,UAAU,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAC3C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAC9B,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC7B,UAAU,CAAC,UAAU,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CACvB,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CACrC,UAAU,CAAC,UAAU,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CACjB,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC7B,UAAU,CAAC,UAAU,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CACb,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC7B,UAAU,CAAC,UAAU,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,SAAS,CAAC,CACtC,CAAC,CAAC;AACP,aAAQ,CAAC,WAAW,EAAE,CACjB,QAAQ,0CAAyB,CACjC,MAAM,CACH,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,EAChC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAC9B,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CACxC,oBAAoB,CAAC,YAAY,CAAC,CAClC,gBAAgB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CACxC,YAAY,CAAC,CACV,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CACZ,KAAK,CAAC,QAAQ,CAAC,CACf,GAAG,CAAC,OAAO,CAAC,CACZ,YAAY,CAAC,IAAI,CAAC,EACvB,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAC1B,QAAQ,CAAC,+DAA+D,CAAC,EAC9E,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CACf,GAAG,CAAC,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC1B,aAAI,CAAC,KAAK,EAAE;AACR,oBAAO,EAAE,CAAC;UACb;AACD,gBAAO,KAAK,CAAC,MAAM,GAAG,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;MAClE,CAAC,CACT,CAAC,CACD,SAAS,CAAC,MAAM,CAAC,CACjB,OAAO,CAAC,MAAM,CAAC,CAC3B,CAAC;;AAEN,YAAO,QAAQ,CAAC;EACnB;;;;;;;;ACnHD,4YAA2Y,4BAA4B,uoBAAuoB,OAAO,svBAAsvB,OAAO,k1BAAk1B,OAAO,4wBAA4wB,OAAO,+xBAA+xB,OAAO,6yBAA6yB,OAAO,yxBAAyxB,OAAO,svBAAsvB,OAAO,knCAAknC,sBAAsB,0qBAA0qB,8BAA8B,kJ;;;;;;;;;;;;sBCAt1Q,UAAU,GAAG,EAAE,KAAK,EAAE;;AAEjC,SAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACrD,SAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,gBAAM,EAAI;AAAE,gBAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;MAAE,CAAC,CAAC;;AAE1F,SAAI,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AACzC,YAAO,CAAC,QAAQ,EAAE,CACb,SAAS,CAAC,MAAM,CAAC,CACjB,OAAO,CAAC,MAAM,CAAC,CACf,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,EAC7B,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAC1C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;gBAAK,CAAC,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS;MAAA,CAAC,CAAC,CACnF,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC,CAC/B,KAAK,CAAC,SAAS,CAAC,CAChB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CACzC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CACnC,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAC1B,QAAQ,CAAC,+DAA+D,CAAC,EAC9E,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CACf,GAAG,CAAC,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC1B,aAAI,CAAC,KAAK,EAAE;AACR,oBAAO,EAAE,CAAC;UACb;AACD,gBAAO,KAAK,CAAC,MAAM,GAAG,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;MAClE,CAAC,CACD,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACxB,OAAO,CAAC,aAAa,CAAC,CACtB,UAAU,CAAC,UAAS,KAAK,EAAE;;AACxB,aAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,UAAU,EAAE;AACnC,oBAAO,wBAAwB,CAAC;UACnC;AACD,aAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,UAAU,EAAE;AACnC,oBAAO,uBAAuB,CAAC;UAClC;AACD,gBAAO,wBAAwB,CAAC;MACnC,CAAC,CACT,CAAC,CACD,OAAO,CAAC,CACL,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,CACrB,KAAK,CAAC,EAAE,CAAC,CACT,MAAM,CAAC,IAAI,CAAC,CACZ,QAAQ,CAAC,wMAAwM,CAAC,EACvN,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACxB,OAAO,CAAC,aAAa,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAC1C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;gBAAK,CAAC,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS;MAAA,CAAC,CAAC,CACnF,cAAc,CAAC,IAAI,EAAE;AAClB,oBAAW,EAAE,qBAAS,MAAM,EAAE;AAAE,oBAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;UAAE;MAC1D,CAAC,EACN,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC,CAC/B,KAAK,CAAC,SAAS,CAAC,CAChB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CACzC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CACnC,cAAc,CAAC,IAAI,EAAE;AAClB,oBAAW,EAAE,qBAAS,MAAM,EAAE;AAAE,oBAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;UAAE;MAC1D,CAAC,EACN,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC5B,KAAK,CAAC,cAAc,CAAC,EAC1B,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC5B,KAAK,CAAC,eAAe,CAAC,CAC9B,CAAC,CACD,WAAW,CAAC,CACT,+FAA+F,EAC/F,4DAA4D,CAC/D,CAAC,CACD,YAAY,CAAC,CACV,qEAAqE,EACrE,qEAAqE,EACrE,QAAQ,CACX,CAAC,CAAC;;AAEP,YAAO,CAAC,WAAW,EAAE,CAChB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CACxB,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAC1C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;gBAAK,CAAC,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS;MAAA,CAAC,CAAC,CACnF,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC,CAC/B,KAAK,CAAC,SAAS,CAAC,CAChB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CACzC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CACnC,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC,CAC/B,KAAK,CAAC,SAAS,CAAC,CAChB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CACzC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CACnC,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAC1B,QAAQ,CAAC,+DAA+D,CAAC,CACzE,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACxB,OAAO,CAAC,aAAa,CAAC,CAC9B,CAAC,CACD,OAAO,CAAC,CACL,kDAAkD,EAClD,MAAM,EACN,QAAQ,CACX,CAAC;;AAEN,YAAO,OAAO,CAAC;EAClB;;;;;;;;;;;;;;sBChHc,UAAU,GAAG,EAAE,KAAK,EAAE;;AAEjC,SAAI,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC3C,aAAQ,CAAC,QAAQ,EAAE,CACd,SAAS,CAAC,MAAM,CAAC,CACjB,OAAO,CAAC,MAAM,CAAC,CACf,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,EAC7B,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,EACzC,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAC1C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;gBAAK,CAAC,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS;MAAA,CAAC,CAAC,CACnF,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAChB,GAAG,CAAC,UAAC,CAAC,EAAC,CAAC;gBAAK,CAAC,CAAC,MAAM,CAAC,MAAM;MAAA,CAAC,CAC7B,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CACvB,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EACnB,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,CAAC,CAC3B,UAAU,CAAC,WAAW,CAAC,CAC/B,CAAC,CACD,OAAO,CAAC,CACL,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,CACrB,KAAK,CAAC,EAAE,CAAC,CACT,MAAM,CAAC,IAAI,CAAC,CACZ,QAAQ,CAAC,wMAAwM,CAAC,EACvN,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAC1C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;gBAAK,CAAC,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS;MAAA,CAAC,CAAC,CACnF,cAAc,CAAC,IAAI,EAAE;AAClB,oBAAW,EAAE,qBAAS,MAAM,EAAE;AAAE,oBAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;UAAE;MAC1D,CAAC,EACN,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACxB,OAAO,CAAC,CACL,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,EACtC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,EAC1C,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,CAC7C,CAAC,EACN,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC5B,KAAK,CAAC,cAAc,CAAC,EAC1B,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAC5B,KAAK,CAAC,eAAe,CAAC,EAC3B,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC,CAC3B,KAAK,CAAC,YAAY,CAAC,EACxB,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,CAAC,CACnC,CAAC,CACD,WAAW,CAAC,CAAC,+FAA+F,CAAC,CAAC,CAAC;AACpH,aAAQ,CAAC,WAAW,EAAE,CACjB,KAAK,CAAC,uCAAuC,CAAC,CAC9C,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CACxB,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAC1C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;gBAAK,CAAC,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS;MAAA,CAAC,CAAC,CACnF,QAAQ,CAAC,KAAK,CAAC,EACpB,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,CACzB,QAAQ,CAAC,0CAA0C,CAAC,EACzD,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACxB,OAAO,CAAC,CACL,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,EACtC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,EAC1C,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,CAC7C,CAAC,CACD,UAAU,CAAC,mBAAmB,CAAC,EACpC,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,CAAC,CACnC,CAAC;;AAEN,YAAO,QAAQ,CAAC;EACnB;;;;;;;;;;;;;ACzED,KAAI,MAAM,GAAG,mBAAO,CAAC,EAAQ,CAAC,CAAC;AAC/B,KAAI,OAAO,GAAG,SAAV,OAAO,CAAG,CAAC;YAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;EAAA,CAAC;;sBAExB,UAAU,GAAG,EAAE,KAAK,EAAE;;AAEjC,YAAO,GAAG,CAAC,SAAS,EAAE,CACjB,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CACjD,IAAI,CAAC,iBAAiB,CAAC,CACvB,KAAK,CAAC,iBAAiB,CAAC;;MAExB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,EAC7B,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAC/B,CAAC,CACD,SAAS,CAAC,MAAM,CAAC,CACjB,OAAO,CAAC,KAAK,CAAC,CACd,OAAO,CAAC,GAAG,CAAC,CACpB,CACA,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CACrD,IAAI,CAAC,gBAAgB,CAAC,CACtB,KAAK,CAAC,gBAAgB,CAAC,CACvB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,EAChD,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,EACtB,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAC1C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;gBAAK,CAAC,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS;MAAA,CAAC,CAAC,CACnF,UAAU,CAAC,WAAW,CAAC,EAC5B,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAChB,GAAG,CAAC,UAAC,CAAC,EAAC,CAAC;gBAAK,CAAC,CAAC,MAAM,CAAC,MAAM;MAAA,CAAC,EAClC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CACvB,UAAU,CAAC,QAAQ,CAAC,CAC5B,CAAC,CACD,gBAAgB,CAAC,EAAC,MAAM,EAAE,SAAS,EAAC,CAAC,CACrC,SAAS,CAAC,MAAM,CAAC,CACjB,OAAO,CAAC,MAAM,CAAC,CACnB,CACA,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CACpD,IAAI,CAAC,gBAAgB,CAAC,CACtB,KAAK,CAAC,gBAAgB,CAAC,CACvB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAChC,KAAK,CAAC,UAAU,CAAC,CACjB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAC1C,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,CAAC;gBAAK,CAAC,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,CAAC,SAAS;MAAA,CAAC,CAAC,EACxF,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC,CAC/B,KAAK,CAAC,SAAS,CAAC,CAChB,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CACzC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EACxC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAC1B,QAAQ,CAAC,+DAA+D,CAAC,CACjF,CAAC,CACD,SAAS,CAAC,MAAM,CAAC,CACjB,OAAO,CAAC,MAAM,CAAC,CACf,OAAO,CAAC,EAAE,CAAC,CACf,CACA,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CACtD,IAAI,CAAC,eAAe,CAAC,CACrB,KAAK,CAAC,eAAe,CAAC,CACtB,MAAM,CAAC,CACJ,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAC1B,KAAK,CAAC,EAAE,CAAC,CACT,QAAQ,CAAC,oDAAoD,CAAC,EACnE,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC;MAC7B,KAAK,CAAC,MAAM,CAAC,CACb,YAAY,CAAC,IAAI,CAAC,CAClB,QAAQ,CAAC,4DAA4D,CAAC,EAC3E,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAC7B,GAAG,CAAC,OAAO,CAAC,CACpB,CAAC,CACD,gBAAgB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CACvC,SAAS,CAAC,YAAY,CAAC,CACvB,OAAO,CAAC,MAAM,CAAC,CACf,OAAO,CAAC,EAAE,CAAC,CACf,CACA,QAAQ,83BAkBf,CAAC;EACF;;;;;;;;AC/FD,+kBAA8kB,oMAAoM,YAAY,MAAM,kQ;;;;;;;;;;;;sBCArxB,UAAU,GAAG,EAAE,KAAK,EAAE;AACjC,YAAO,GAAG,CAAC,IAAI,EAAE,CACZ,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,UAAU,CAAC,CACjB,IAAI,CAAC,yCAAyC,CAAC,CAC/C,MAAM,CAAC,cAAI;gBAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC;MAAA,CAAC;MAChD,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,OAAO,CAAC,CACd,IAAI,CAAC,gDAAgD,CAAC;MACtD,IAAI,CAAC,8CAA8C,CAAC,CAAC;MACzD,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,WAAW,CAAC,CAClB,IAAI,CAAC,+CAA+C,CAAC;MACrD,IAAI,CAAC,wCAAwC,CAAC,CAAC,CACnD,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,UAAU,CAAC,CACjB,IAAI,CAAC,WAAW,CAAC;MACjB,MAAM,CAAC,cAAI;gBAAI,IAAI,IAAI,WAAW;MAAA,CAAC,CACnC,IAAI,CAAC,4CAA4C,CAAC,CAAC,CAC3D,CACA,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,OAAO,CAAC,CACd,IAAI,CAAC,iDAAiD,CAAC,CACvD,MAAM,CAAC,cAAI;gBAAI,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC;MAAA,CAAC,CAC/C,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,QAAQ,CAAC,CACf,IAAI,CAAC,4CAA4C,CAAC,CAClD,IAAI,CAAC,+CAA+C,CAAC,CAAC,CAC1D,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,UAAU,CAAC,CACjB,IAAI,CAAC,8CAA8C,CAAC,CACpD,IAAI,CAAC,uCAAuC,CAAC,CAAC,CAClD,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,SAAS,CAAC,CAChB,IAAI,CAAC,8CAA8C,CAAC,CACpD,IAAI,CAAC,+CAA+C,CAAC,CAAC,CAC9D,CACA,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CACf,KAAK,CAAC,SAAS,CAAC,CAChB,IAAI,CAAC,2CAA2C,CAAC,CACjD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;MAC1C,IAAI,CAAC,6CAA6C,CAAC,CAAC,CACxD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAC5C,IAAI,CAAC,wCAAwC,CAAC,CAAC,CACvD,CACA,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CACzC,IAAI,CAAC,4CAA4C,CAAC,CAAC,CAC3D;EACJ;;;;;;;;AChDD,0C","file":"main.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/build\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 7ed60426b9bef805d977\n **/","// require('ng-admin'); removed here and added back as a \n\t * \n\t * \n\t * \n\t * \n\t * \n\t * \n\t * \n\t * \n\t */\n\tangular.module('ui.router', ['ui.router.state']);\n\t\n\tangular.module('ui.router.compat', ['ui.router']);\n\t\n\t/**\n\t * @ngdoc object\n\t * @name ui.router.util.$resolve\n\t *\n\t * @requires $q\n\t * @requires $injector\n\t *\n\t * @description\n\t * Manages resolution of (acyclic) graphs of promises.\n\t */\n\t$Resolve.$inject = ['$q', '$injector'];\n\tfunction $Resolve( $q, $injector) {\n\t \n\t var VISIT_IN_PROGRESS = 1,\n\t VISIT_DONE = 2,\n\t NOTHING = {},\n\t NO_DEPENDENCIES = [],\n\t NO_LOCALS = NOTHING,\n\t NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });\n\t \n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.util.$resolve#study\n\t * @methodOf ui.router.util.$resolve\n\t *\n\t * @description\n\t * Studies a set of invocables that are likely to be used multiple times.\n\t *
\n\t   * $resolve.study(invocables)(locals, parent, self)\n\t   * 
\n\t * is equivalent to\n\t *
\n\t   * $resolve.resolve(invocables, locals, parent, self)\n\t   * 
\n\t * but the former is more efficient (in fact `resolve` just calls `study` \n\t * internally).\n\t *\n\t * @param {object} invocables Invocable objects\n\t * @return {function} a function to pass in locals, parent and self\n\t */\n\t this.study = function (invocables) {\n\t if (!isObject(invocables)) throw new Error(\"'invocables' must be an object\");\n\t var invocableKeys = objectKeys(invocables || {});\n\t \n\t // Perform a topological sort of invocables to build an ordered plan\n\t var plan = [], cycle = [], visited = {};\n\t function visit(value, key) {\n\t if (visited[key] === VISIT_DONE) return;\n\t \n\t cycle.push(key);\n\t if (visited[key] === VISIT_IN_PROGRESS) {\n\t cycle.splice(0, indexOf(cycle, key));\n\t throw new Error(\"Cyclic dependency: \" + cycle.join(\" -> \"));\n\t }\n\t visited[key] = VISIT_IN_PROGRESS;\n\t \n\t if (isString(value)) {\n\t plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);\n\t } else {\n\t var params = $injector.annotate(value);\n\t forEach(params, function (param) {\n\t if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);\n\t });\n\t plan.push(key, value, params);\n\t }\n\t \n\t cycle.pop();\n\t visited[key] = VISIT_DONE;\n\t }\n\t forEach(invocables, visit);\n\t invocables = cycle = visited = null; // plan is all that's required\n\t \n\t function isResolve(value) {\n\t return isObject(value) && value.then && value.$$promises;\n\t }\n\t \n\t return function (locals, parent, self) {\n\t if (isResolve(locals) && self === undefined) {\n\t self = parent; parent = locals; locals = null;\n\t }\n\t if (!locals) locals = NO_LOCALS;\n\t else if (!isObject(locals)) {\n\t throw new Error(\"'locals' must be an object\");\n\t } \n\t if (!parent) parent = NO_PARENT;\n\t else if (!isResolve(parent)) {\n\t throw new Error(\"'parent' must be a promise returned by $resolve.resolve()\");\n\t }\n\t \n\t // To complete the overall resolution, we have to wait for the parent\n\t // promise and for the promise for each invokable in our plan.\n\t var resolution = $q.defer(),\n\t result = resolution.promise,\n\t promises = result.$$promises = {},\n\t values = extend({}, locals),\n\t wait = 1 + plan.length/3,\n\t merged = false;\n\t \n\t function done() {\n\t // Merge parent values we haven't got yet and publish our own $$values\n\t if (!--wait) {\n\t if (!merged) merge(values, parent.$$values); \n\t result.$$values = values;\n\t result.$$promises = result.$$promises || true; // keep for isResolve()\n\t delete result.$$inheritedValues;\n\t resolution.resolve(values);\n\t }\n\t }\n\t \n\t function fail(reason) {\n\t result.$$failure = reason;\n\t resolution.reject(reason);\n\t }\n\t\n\t // Short-circuit if parent has already failed\n\t if (isDefined(parent.$$failure)) {\n\t fail(parent.$$failure);\n\t return result;\n\t }\n\t \n\t if (parent.$$inheritedValues) {\n\t merge(values, omit(parent.$$inheritedValues, invocableKeys));\n\t }\n\t\n\t // Merge parent values if the parent has already resolved, or merge\n\t // parent promises and wait if the parent resolve is still in progress.\n\t extend(promises, parent.$$promises);\n\t if (parent.$$values) {\n\t merged = merge(values, omit(parent.$$values, invocableKeys));\n\t result.$$inheritedValues = omit(parent.$$values, invocableKeys);\n\t done();\n\t } else {\n\t if (parent.$$inheritedValues) {\n\t result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);\n\t } \n\t parent.then(done, fail);\n\t }\n\t \n\t // Process each invocable in the plan, but ignore any where a local of the same name exists.\n\t for (var i=0, ii=plan.length; i} The template html as a string, or a promise \n\t * for that string.\n\t */\n\t this.fromUrl = function (url, params) {\n\t if (isFunction(url)) url = url(params);\n\t if (url == null) return null;\n\t else return $http\n\t .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})\n\t .then(function(response) { return response.data; });\n\t };\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.util.$templateFactory#fromProvider\n\t * @methodOf ui.router.util.$templateFactory\n\t *\n\t * @description\n\t * Creates a template by invoking an injectable provider function.\n\t *\n\t * @param {Function} provider Function to invoke via `$injector.invoke`\n\t * @param {Object} params Parameters for the template.\n\t * @param {Object} locals Locals to pass to `invoke`. Defaults to \n\t * `{ params: params }`.\n\t * @return {string|Promise.} The template html as a string, or a promise \n\t * for that string.\n\t */\n\t this.fromProvider = function (provider, params, locals) {\n\t return $injector.invoke(provider, null, locals || { params: params });\n\t };\n\t}\n\t\n\tangular.module('ui.router.util').service('$templateFactory', $TemplateFactory);\n\t\n\tvar $$UMFP; // reference to $UrlMatcherFactoryProvider\n\t\n\t/**\n\t * @ngdoc object\n\t * @name ui.router.util.type:UrlMatcher\n\t *\n\t * @description\n\t * Matches URLs against patterns and extracts named parameters from the path or the search\n\t * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list\n\t * of search parameters. Multiple search parameter names are separated by '&'. Search parameters\n\t * do not influence whether or not a URL is matched, but their values are passed through into\n\t * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.\n\t *\n\t * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace\n\t * syntax, which optionally allows a regular expression for the parameter to be specified:\n\t *\n\t * * `':'` name - colon placeholder\n\t * * `'*'` name - catch-all placeholder\n\t * * `'{' name '}'` - curly placeholder\n\t * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the\n\t * regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n\t *\n\t * Parameter names may contain only word characters (latin letters, digits, and underscore) and\n\t * must be unique within the pattern (across both path and search parameters). For colon\n\t * placeholders or curly placeholders without an explicit regexp, a path parameter matches any\n\t * number of characters other than '/'. For catch-all placeholders the path parameter matches\n\t * any number of characters.\n\t *\n\t * Examples:\n\t *\n\t * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\n\t * trailing slashes, and patterns have to match the entire path, not just a prefix.\n\t * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\n\t * '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\n\t * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\n\t * * `'/user/{id:[^/]*}'` - Same as the previous example.\n\t * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\n\t * parameter consists of 1 to 8 hex digits.\n\t * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\n\t * path into the parameter 'path'.\n\t * * `'/files/*path'` - ditto.\n\t * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\n\t * in the built-in `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start\n\t *\n\t * @param {string} pattern The pattern to compile into a matcher.\n\t * @param {Object} config A configuration object hash:\n\t * @param {Object=} parentMatcher Used to concatenate the pattern/config onto\n\t * an existing UrlMatcher\n\t *\n\t * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.\n\t * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.\n\t *\n\t * @property {string} prefix A static prefix of this pattern. The matcher guarantees that any\n\t * URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns\n\t * non-null) will start with this prefix.\n\t *\n\t * @property {string} source The pattern that was passed into the constructor\n\t *\n\t * @property {string} sourcePath The path portion of the source property\n\t *\n\t * @property {string} sourceSearch The search portion of the source property\n\t *\n\t * @property {string} regex The constructed regex that will be used to match against the url when\n\t * it is time to determine which url will match.\n\t *\n\t * @returns {Object} New `UrlMatcher` object\n\t */\n\tfunction UrlMatcher(pattern, config, parentMatcher) {\n\t config = extend({ params: {} }, isObject(config) ? config : {});\n\t\n\t // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\n\t // '*' name\n\t // ':' name\n\t // '{' name '}'\n\t // '{' name ':' regexp '}'\n\t // The regular expression is somewhat complicated due to the need to allow curly braces\n\t // inside the regular expression. The placeholder regexp breaks down as follows:\n\t // ([:*])([\\w\\[\\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)\n\t // \\{([\\w\\[\\]]+)(?:\\:( ... ))?\\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\n\t // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either\n\t // [^{}\\\\]+ - anything other than curly braces or backslash\n\t // \\\\. - a backslash escape\n\t // \\{(?:[^{}\\\\]+|\\\\.)*\\} - a matched set of curly braces containing other atoms\n\t var placeholder = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n\t searchPlaceholder = /([:]?)([\\w\\[\\]-]+)|\\{([\\w\\[\\]-]+)(?:\\:((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n\t compiled = '^', last = 0, m,\n\t segments = this.segments = [],\n\t parentParams = parentMatcher ? parentMatcher.params : {},\n\t params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),\n\t paramNames = [];\n\t\n\t function addParameter(id, type, config, location) {\n\t paramNames.push(id);\n\t if (parentParams[id]) return parentParams[id];\n\t if (!/^\\w+(-+\\w+)*(?:\\[\\])?$/.test(id)) throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n\t if (params[id]) throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n\t params[id] = new $$UMFP.Param(id, type, config, location);\n\t return params[id];\n\t }\n\t\n\t function quoteRegExp(string, pattern, squash, optional) {\n\t var surroundPattern = ['',''], result = string.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, \"\\\\$&\");\n\t if (!pattern) return result;\n\t switch(squash) {\n\t case false: surroundPattern = ['(', ')' + (optional ? \"?\" : \"\")]; break;\n\t case true: surroundPattern = ['?(', ')?']; break;\n\t default: surroundPattern = ['(' + squash + \"|\", ')?']; break;\n\t }\n\t return result + surroundPattern[0] + pattern + surroundPattern[1];\n\t }\n\t\n\t this.source = pattern;\n\t\n\t // Split into static segments separated by path parameter placeholders.\n\t // The number of segments is always 1 more than the number of parameters.\n\t function matchDetails(m, isSearch) {\n\t var id, regexp, segment, type, cfg, arrayMode;\n\t id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null\n\t cfg = config.params[id];\n\t segment = pattern.substring(last, m.index);\n\t regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);\n\t type = $$UMFP.type(regexp || \"string\") || inherit($$UMFP.type(\"string\"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });\n\t return {\n\t id: id, regexp: regexp, segment: segment, type: type, cfg: cfg\n\t };\n\t }\n\t\n\t var p, param, segment;\n\t while ((m = placeholder.exec(pattern))) {\n\t p = matchDetails(m, false);\n\t if (p.segment.indexOf('?') >= 0) break; // we're into the search part\n\t\n\t param = addParameter(p.id, p.type, p.cfg, \"path\");\n\t compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional);\n\t segments.push(p.segment);\n\t last = placeholder.lastIndex;\n\t }\n\t segment = pattern.substring(last);\n\t\n\t // Find any search parameter names and remove them from the last segment\n\t var i = segment.indexOf('?');\n\t\n\t if (i >= 0) {\n\t var search = this.sourceSearch = segment.substring(i);\n\t segment = segment.substring(0, i);\n\t this.sourcePath = pattern.substring(0, last + i);\n\t\n\t if (search.length > 0) {\n\t last = 0;\n\t while ((m = searchPlaceholder.exec(search))) {\n\t p = matchDetails(m, true);\n\t param = addParameter(p.id, p.type, p.cfg, \"search\");\n\t last = placeholder.lastIndex;\n\t // check if ?&\n\t }\n\t }\n\t } else {\n\t this.sourcePath = pattern;\n\t this.sourceSearch = '';\n\t }\n\t\n\t compiled += quoteRegExp(segment) + (config.strict === false ? '\\/?' : '') + '$';\n\t segments.push(segment);\n\t\n\t this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);\n\t this.prefix = segments[0];\n\t this.$$paramNames = paramNames;\n\t}\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:UrlMatcher#concat\n\t * @methodOf ui.router.util.type:UrlMatcher\n\t *\n\t * @description\n\t * Returns a new matcher for a pattern constructed by appending the path part and adding the\n\t * search parameters of the specified pattern to this pattern. The current pattern is not\n\t * modified. This can be understood as creating a pattern for URLs that are relative to (or\n\t * suffixes of) the current pattern.\n\t *\n\t * @example\n\t * The following two matchers are equivalent:\n\t *
\n\t * new UrlMatcher('/user/{id}?q').concat('/details?date');\n\t * new UrlMatcher('/user/{id}/details?q&date');\n\t * 
\n\t *\n\t * @param {string} pattern The pattern to append.\n\t * @param {Object} config An object hash of the configuration for the matcher.\n\t * @returns {UrlMatcher} A matcher for the concatenated pattern.\n\t */\n\tUrlMatcher.prototype.concat = function (pattern, config) {\n\t // Because order of search parameters is irrelevant, we can add our own search\n\t // parameters to the end of the new pattern. Parse the new pattern by itself\n\t // and then join the bits together, but it's much easier to do this on a string level.\n\t var defaultConfig = {\n\t caseInsensitive: $$UMFP.caseInsensitive(),\n\t strict: $$UMFP.strictMode(),\n\t squash: $$UMFP.defaultSquashPolicy()\n\t };\n\t return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);\n\t};\n\t\n\tUrlMatcher.prototype.toString = function () {\n\t return this.source;\n\t};\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:UrlMatcher#exec\n\t * @methodOf ui.router.util.type:UrlMatcher\n\t *\n\t * @description\n\t * Tests the specified path against this matcher, and returns an object containing the captured\n\t * parameter values, or null if the path does not match. The returned object contains the values\n\t * of any search parameters that are mentioned in the pattern, but their value may be null if\n\t * they are not present in `searchParams`. This means that search parameters are always treated\n\t * as optional.\n\t *\n\t * @example\n\t *
\n\t * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\n\t *   x: '1', q: 'hello'\n\t * });\n\t * // returns { id: 'bob', q: 'hello', r: null }\n\t * 
\n\t *\n\t * @param {string} path The URL path to match, e.g. `$location.path()`.\n\t * @param {Object} searchParams URL search parameters, e.g. `$location.search()`.\n\t * @returns {Object} The captured parameter values.\n\t */\n\tUrlMatcher.prototype.exec = function (path, searchParams) {\n\t var m = this.regexp.exec(path);\n\t if (!m) return null;\n\t searchParams = searchParams || {};\n\t\n\t var paramNames = this.parameters(), nTotal = paramNames.length,\n\t nPath = this.segments.length - 1,\n\t values = {}, i, j, cfg, paramName;\n\t\n\t if (nPath !== m.length - 1) throw new Error(\"Unbalanced capture group in route '\" + this.source + \"'\");\n\t\n\t function decodePathArray(string) {\n\t function reverseString(str) { return str.split(\"\").reverse().join(\"\"); }\n\t function unquoteDashes(str) { return str.replace(/\\\\-/g, \"-\"); }\n\t\n\t var split = reverseString(string).split(/-(?!\\\\)/);\n\t var allReversed = map(split, reverseString);\n\t return map(allReversed, unquoteDashes).reverse();\n\t }\n\t\n\t for (i = 0; i < nPath; i++) {\n\t paramName = paramNames[i];\n\t var param = this.params[paramName];\n\t var paramVal = m[i+1];\n\t // if the param value matches a pre-replace pair, replace the value before decoding.\n\t for (j = 0; j < param.replace; j++) {\n\t if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n\t }\n\t if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);\n\t values[paramName] = param.value(paramVal);\n\t }\n\t for (/**/; i < nTotal; i++) {\n\t paramName = paramNames[i];\n\t values[paramName] = this.params[paramName].value(searchParams[paramName]);\n\t }\n\t\n\t return values;\n\t};\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:UrlMatcher#parameters\n\t * @methodOf ui.router.util.type:UrlMatcher\n\t *\n\t * @description\n\t * Returns the names of all path and search parameters of this pattern in an unspecified order.\n\t *\n\t * @returns {Array.} An array of parameter names. Must be treated as read-only. If the\n\t * pattern has no parameters, an empty array is returned.\n\t */\n\tUrlMatcher.prototype.parameters = function (param) {\n\t if (!isDefined(param)) return this.$$paramNames;\n\t return this.params[param] || null;\n\t};\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:UrlMatcher#validate\n\t * @methodOf ui.router.util.type:UrlMatcher\n\t *\n\t * @description\n\t * Checks an object hash of parameters to validate their correctness according to the parameter\n\t * types of this `UrlMatcher`.\n\t *\n\t * @param {Object} params The object hash of parameters to validate.\n\t * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.\n\t */\n\tUrlMatcher.prototype.validates = function (params) {\n\t return this.params.$$validates(params);\n\t};\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:UrlMatcher#format\n\t * @methodOf ui.router.util.type:UrlMatcher\n\t *\n\t * @description\n\t * Creates a URL that matches this pattern by substituting the specified values\n\t * for the path and search parameters. Null values for path parameters are\n\t * treated as empty strings.\n\t *\n\t * @example\n\t *
\n\t * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n\t * // returns '/user/bob?q=yes'\n\t * 
\n\t *\n\t * @param {Object} values the values to substitute for the parameters in this pattern.\n\t * @returns {string} the formatted URL (path and optionally search part).\n\t */\n\tUrlMatcher.prototype.format = function (values) {\n\t values = values || {};\n\t var segments = this.segments, params = this.parameters(), paramset = this.params;\n\t if (!this.validates(values)) return null;\n\t\n\t var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];\n\t\n\t function encodeDashes(str) { // Replace dashes with encoded \"\\-\"\n\t return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });\n\t }\n\t\n\t for (i = 0; i < nTotal; i++) {\n\t var isPathParam = i < nPath;\n\t var name = params[i], param = paramset[name], value = param.value(values[name]);\n\t var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);\n\t var squash = isDefaultValue ? param.squash : false;\n\t var encoded = param.type.encode(value);\n\t\n\t if (isPathParam) {\n\t var nextSegment = segments[i + 1];\n\t if (squash === false) {\n\t if (encoded != null) {\n\t if (isArray(encoded)) {\n\t result += map(encoded, encodeDashes).join(\"-\");\n\t } else {\n\t result += encodeURIComponent(encoded);\n\t }\n\t }\n\t result += nextSegment;\n\t } else if (squash === true) {\n\t var capture = result.match(/\\/$/) ? /\\/?(.*)/ : /(.*)/;\n\t result += nextSegment.match(capture)[1];\n\t } else if (isString(squash)) {\n\t result += squash + nextSegment;\n\t }\n\t } else {\n\t if (encoded == null || (isDefaultValue && squash !== false)) continue;\n\t if (!isArray(encoded)) encoded = [ encoded ];\n\t encoded = map(encoded, encodeURIComponent).join('&' + name + '=');\n\t result += (search ? '&' : '?') + (name + '=' + encoded);\n\t search = true;\n\t }\n\t }\n\t\n\t return result;\n\t};\n\t\n\t/**\n\t * @ngdoc object\n\t * @name ui.router.util.type:Type\n\t *\n\t * @description\n\t * Implements an interface to define custom parameter types that can be decoded from and encoded to\n\t * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}\n\t * objects when matching or formatting URLs, or comparing or validating parameter values.\n\t *\n\t * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more\n\t * information on registering custom types.\n\t *\n\t * @param {Object} config A configuration object which contains the custom type definition. The object's\n\t * properties will override the default methods and/or pattern in `Type`'s public interface.\n\t * @example\n\t *
\n\t * {\n\t *   decode: function(val) { return parseInt(val, 10); },\n\t *   encode: function(val) { return val && val.toString(); },\n\t *   equals: function(a, b) { return this.is(a) && a === b; },\n\t *   is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },\n\t *   pattern: /\\d+/\n\t * }\n\t * 
\n\t *\n\t * @property {RegExp} pattern The regular expression pattern used to match values of this type when\n\t * coming from a substring of a URL.\n\t *\n\t * @returns {Object} Returns a new `Type` object.\n\t */\n\tfunction Type(config) {\n\t extend(this, config);\n\t}\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:Type#is\n\t * @methodOf ui.router.util.type:Type\n\t *\n\t * @description\n\t * Detects whether a value is of a particular type. Accepts a native (decoded) value\n\t * and determines whether it matches the current `Type` object.\n\t *\n\t * @param {*} val The value to check.\n\t * @param {string} key Optional. If the type check is happening in the context of a specific\n\t * {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the\n\t * parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.\n\t * @returns {Boolean} Returns `true` if the value matches the type, otherwise `false`.\n\t */\n\tType.prototype.is = function(val, key) {\n\t return true;\n\t};\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:Type#encode\n\t * @methodOf ui.router.util.type:Type\n\t *\n\t * @description\n\t * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the\n\t * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it\n\t * only needs to be a representation of `val` that has been coerced to a string.\n\t *\n\t * @param {*} val The value to encode.\n\t * @param {string} key The name of the parameter in which `val` is stored. Can be used for\n\t * meta-programming of `Type` objects.\n\t * @returns {string} Returns a string representation of `val` that can be encoded in a URL.\n\t */\n\tType.prototype.encode = function(val, key) {\n\t return val;\n\t};\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:Type#decode\n\t * @methodOf ui.router.util.type:Type\n\t *\n\t * @description\n\t * Converts a parameter value (from URL string or transition param) to a custom/native value.\n\t *\n\t * @param {string} val The URL parameter value to decode.\n\t * @param {string} key The name of the parameter in which `val` is stored. Can be used for\n\t * meta-programming of `Type` objects.\n\t * @returns {*} Returns a custom representation of the URL parameter value.\n\t */\n\tType.prototype.decode = function(val, key) {\n\t return val;\n\t};\n\t\n\t/**\n\t * @ngdoc function\n\t * @name ui.router.util.type:Type#equals\n\t * @methodOf ui.router.util.type:Type\n\t *\n\t * @description\n\t * Determines whether two decoded values are equivalent.\n\t *\n\t * @param {*} a A value to compare against.\n\t * @param {*} b A value to compare against.\n\t * @returns {Boolean} Returns `true` if the values are equivalent/equal, otherwise `false`.\n\t */\n\tType.prototype.equals = function(a, b) {\n\t return a == b;\n\t};\n\t\n\tType.prototype.$subPattern = function() {\n\t var sub = this.pattern.toString();\n\t return sub.substr(1, sub.length - 2);\n\t};\n\t\n\tType.prototype.pattern = /.*/;\n\t\n\tType.prototype.toString = function() { return \"{Type:\" + this.name + \"}\"; };\n\t\n\t/** Given an encoded string, or a decoded object, returns a decoded object */\n\tType.prototype.$normalize = function(val) {\n\t return this.is(val) ? val : this.decode(val);\n\t};\n\t\n\t/*\n\t * Wraps an existing custom Type as an array of Type, depending on 'mode'.\n\t * e.g.:\n\t * - urlmatcher pattern \"/path?{queryParam[]:int}\"\n\t * - url: \"/path?queryParam=1&queryParam=2\n\t * - $stateParams.queryParam will be [1, 2]\n\t * if `mode` is \"auto\", then\n\t * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\n\t * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\n\t */\n\tType.prototype.$asArray = function(mode, isSearch) {\n\t if (!mode) return this;\n\t if (mode === \"auto\" && !isSearch) throw new Error(\"'auto' array mode is for query parameters only\");\n\t\n\t function ArrayType(type, mode) {\n\t function bindTo(type, callbackName) {\n\t return function() {\n\t return type[callbackName].apply(type, arguments);\n\t };\n\t }\n\t\n\t // Wrap non-array value as array\n\t function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }\n\t // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n\t function arrayUnwrap(val) {\n\t switch(val.length) {\n\t case 0: return undefined;\n\t case 1: return mode === \"auto\" ? val[0] : val;\n\t default: return val;\n\t }\n\t }\n\t function falsey(val) { return !val; }\n\t\n\t // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n\t function arrayHandler(callback, allTruthyMode) {\n\t return function handleArray(val) {\n\t val = arrayWrap(val);\n\t var result = map(val, callback);\n\t if (allTruthyMode === true)\n\t return filter(result, falsey).length === 0;\n\t return arrayUnwrap(result);\n\t };\n\t }\n\t\n\t // Wraps type (.equals) functions to operate on each value of an array\n\t function arrayEqualsHandler(callback) {\n\t return function handleArray(val1, val2) {\n\t var left = arrayWrap(val1), right = arrayWrap(val2);\n\t if (left.length !== right.length) return false;\n\t for (var i = 0; i < left.length; i++) {\n\t if (!callback(left[i], right[i])) return false;\n\t }\n\t return true;\n\t };\n\t }\n\t\n\t this.encode = arrayHandler(bindTo(type, 'encode'));\n\t this.decode = arrayHandler(bindTo(type, 'decode'));\n\t this.is = arrayHandler(bindTo(type, 'is'), true);\n\t this.equals = arrayEqualsHandler(bindTo(type, 'equals'));\n\t this.pattern = type.pattern;\n\t this.$normalize = arrayHandler(bindTo(type, '$normalize'));\n\t this.name = type.name;\n\t this.$arrayMode = mode;\n\t }\n\t\n\t return new ArrayType(this, mode);\n\t};\n\t\n\t\n\t\n\t/**\n\t * @ngdoc object\n\t * @name ui.router.util.$urlMatcherFactory\n\t *\n\t * @description\n\t * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory\n\t * is also available to providers under the name `$urlMatcherFactoryProvider`.\n\t */\n\tfunction $UrlMatcherFactory() {\n\t $$UMFP = this;\n\t\n\t var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;\n\t\n\t function valToString(val) { return val != null ? val.toString().replace(/\\//g, \"%2F\") : val; }\n\t function valFromString(val) { return val != null ? val.toString().replace(/%2F/g, \"/\") : val; }\n\t\n\t var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {\n\t string: {\n\t encode: valToString,\n\t decode: valFromString,\n\t // TODO: in 1.0, make string .is() return false if value is undefined/null by default.\n\t // In 0.2.x, string params are optional by default for backwards compat\n\t is: function(val) { return val == null || !isDefined(val) || typeof val === \"string\"; },\n\t pattern: /[^/]*/\n\t },\n\t int: {\n\t encode: valToString,\n\t decode: function(val) { return parseInt(val, 10); },\n\t is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },\n\t pattern: /\\d+/\n\t },\n\t bool: {\n\t encode: function(val) { return val ? 1 : 0; },\n\t decode: function(val) { return parseInt(val, 10) !== 0; },\n\t is: function(val) { return val === true || val === false; },\n\t pattern: /0|1/\n\t },\n\t date: {\n\t encode: function (val) {\n\t if (!this.is(val))\n\t return undefined;\n\t return [ val.getFullYear(),\n\t ('0' + (val.getMonth() + 1)).slice(-2),\n\t ('0' + val.getDate()).slice(-2)\n\t ].join(\"-\");\n\t },\n\t decode: function (val) {\n\t if (this.is(val)) return val;\n\t var match = this.capture.exec(val);\n\t return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n\t },\n\t is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },\n\t equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },\n\t pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n\t capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/\n\t },\n\t json: {\n\t encode: angular.toJson,\n\t decode: angular.fromJson,\n\t is: angular.isObject,\n\t equals: angular.equals,\n\t pattern: /[^/]*/\n\t },\n\t any: { // does not encode/decode\n\t encode: angular.identity,\n\t decode: angular.identity,\n\t equals: angular.equals,\n\t pattern: /.*/\n\t }\n\t };\n\t\n\t function getDefaultConfig() {\n\t return {\n\t strict: isStrictMode,\n\t caseInsensitive: isCaseInsensitive\n\t };\n\t }\n\t\n\t function isInjectable(value) {\n\t return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));\n\t }\n\t\n\t /**\n\t * [Internal] Get the default value of a parameter, which may be an injectable function.\n\t */\n\t $UrlMatcherFactory.$$getDefaultValue = function(config) {\n\t if (!isInjectable(config.value)) return config.value;\n\t if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n\t return injector.invoke(config.value);\n\t };\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.util.$urlMatcherFactory#caseInsensitive\n\t * @methodOf ui.router.util.$urlMatcherFactory\n\t *\n\t * @description\n\t * Defines whether URL matching should be case sensitive (the default behavior), or not.\n\t *\n\t * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;\n\t * @returns {boolean} the current value of caseInsensitive\n\t */\n\t this.caseInsensitive = function(value) {\n\t if (isDefined(value))\n\t isCaseInsensitive = value;\n\t return isCaseInsensitive;\n\t };\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.util.$urlMatcherFactory#strictMode\n\t * @methodOf ui.router.util.$urlMatcherFactory\n\t *\n\t * @description\n\t * Defines whether URLs should match trailing slashes, or not (the default behavior).\n\t *\n\t * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.\n\t * @returns {boolean} the current value of strictMode\n\t */\n\t this.strictMode = function(value) {\n\t if (isDefined(value))\n\t isStrictMode = value;\n\t return isStrictMode;\n\t };\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy\n\t * @methodOf ui.router.util.$urlMatcherFactory\n\t *\n\t * @description\n\t * Sets the default behavior when generating or matching URLs with default parameter values.\n\t *\n\t * @param {string} value A string that defines the default parameter URL squashing behavior.\n\t * `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\n\t * `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\n\t * parameter is surrounded by slashes, squash (remove) one slash from the URL\n\t * any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\n\t * the parameter value from the URL and replace it with this string.\n\t */\n\t this.defaultSquashPolicy = function(value) {\n\t if (!isDefined(value)) return defaultSquashPolicy;\n\t if (value !== true && value !== false && !isString(value))\n\t throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n\t defaultSquashPolicy = value;\n\t return value;\n\t };\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.util.$urlMatcherFactory#compile\n\t * @methodOf ui.router.util.$urlMatcherFactory\n\t *\n\t * @description\n\t * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.\n\t *\n\t * @param {string} pattern The URL pattern.\n\t * @param {Object} config The config object hash.\n\t * @returns {UrlMatcher} The UrlMatcher.\n\t */\n\t this.compile = function (pattern, config) {\n\t return new UrlMatcher(pattern, extend(getDefaultConfig(), config));\n\t };\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.util.$urlMatcherFactory#isMatcher\n\t * @methodOf ui.router.util.$urlMatcherFactory\n\t *\n\t * @description\n\t * Returns true if the specified object is a `UrlMatcher`, or false otherwise.\n\t *\n\t * @param {Object} object The object to perform the type check against.\n\t * @returns {Boolean} Returns `true` if the object matches the `UrlMatcher` interface, by\n\t * implementing all the same methods.\n\t */\n\t this.isMatcher = function (o) {\n\t if (!isObject(o)) return false;\n\t var result = true;\n\t\n\t forEach(UrlMatcher.prototype, function(val, name) {\n\t if (isFunction(val)) {\n\t result = result && (isDefined(o[name]) && isFunction(o[name]));\n\t }\n\t });\n\t return result;\n\t };\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.util.$urlMatcherFactory#type\n\t * @methodOf ui.router.util.$urlMatcherFactory\n\t *\n\t * @description\n\t * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to\n\t * generate URLs with typed parameters.\n\t *\n\t * @param {string} name The type name.\n\t * @param {Object|Function} definition The type definition. See\n\t * {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n\t * @param {Object|Function} definitionFn (optional) A function that is injected before the app\n\t * runtime starts. The result of this function is merged into the existing `definition`.\n\t * See {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n\t *\n\t * @returns {Object} Returns `$urlMatcherFactoryProvider`.\n\t *\n\t * @example\n\t * This is a simple example of a custom type that encodes and decodes items from an\n\t * array, using the array index as the URL-encoded value:\n\t *\n\t *
\n\t   * var list = ['John', 'Paul', 'George', 'Ringo'];\n\t   *\n\t   * $urlMatcherFactoryProvider.type('listItem', {\n\t   *   encode: function(item) {\n\t   *     // Represent the list item in the URL using its corresponding index\n\t   *     return list.indexOf(item);\n\t   *   },\n\t   *   decode: function(item) {\n\t   *     // Look up the list item by index\n\t   *     return list[parseInt(item, 10)];\n\t   *   },\n\t   *   is: function(item) {\n\t   *     // Ensure the item is valid by checking to see that it appears\n\t   *     // in the list\n\t   *     return list.indexOf(item) > -1;\n\t   *   }\n\t   * });\n\t   *\n\t   * $stateProvider.state('list', {\n\t   *   url: \"/list/{item:listItem}\",\n\t   *   controller: function($scope, $stateParams) {\n\t   *     console.log($stateParams.item);\n\t   *   }\n\t   * });\n\t   *\n\t   * // ...\n\t   *\n\t   * // Changes URL to '/list/3', logs \"Ringo\" to the console\n\t   * $state.go('list', { item: \"Ringo\" });\n\t   * 
\n\t *\n\t * This is a more complex example of a type that relies on dependency injection to\n\t * interact with services, and uses the parameter name from the URL to infer how to\n\t * handle encoding and decoding parameter values:\n\t *\n\t *
\n\t   * // Defines a custom type that gets a value from a service,\n\t   * // where each service gets different types of values from\n\t   * // a backend API:\n\t   * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {\n\t   *\n\t   *   // Matches up services to URL parameter names\n\t   *   var services = {\n\t   *     user: Users,\n\t   *     post: Posts\n\t   *   };\n\t   *\n\t   *   return {\n\t   *     encode: function(object) {\n\t   *       // Represent the object in the URL using its unique ID\n\t   *       return object.id;\n\t   *     },\n\t   *     decode: function(value, key) {\n\t   *       // Look up the object by ID, using the parameter\n\t   *       // name (key) to call the correct service\n\t   *       return services[key].findById(value);\n\t   *     },\n\t   *     is: function(object, key) {\n\t   *       // Check that object is a valid dbObject\n\t   *       return angular.isObject(object) && object.id && services[key];\n\t   *     }\n\t   *     equals: function(a, b) {\n\t   *       // Check the equality of decoded objects by comparing\n\t   *       // their unique IDs\n\t   *       return a.id === b.id;\n\t   *     }\n\t   *   };\n\t   * });\n\t   *\n\t   * // In a config() block, you can then attach URLs with\n\t   * // type-annotated parameters:\n\t   * $stateProvider.state('users', {\n\t   *   url: \"/users\",\n\t   *   // ...\n\t   * }).state('users.item', {\n\t   *   url: \"/{user:dbObject}\",\n\t   *   controller: function($scope, $stateParams) {\n\t   *     // $stateParams.user will now be an object returned from\n\t   *     // the Users service\n\t   *   },\n\t   *   // ...\n\t   * });\n\t   * 
\n\t */\n\t this.type = function (name, definition, definitionFn) {\n\t if (!isDefined(definition)) return $types[name];\n\t if ($types.hasOwnProperty(name)) throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n\t\n\t $types[name] = new Type(extend({ name: name }, definition));\n\t if (definitionFn) {\n\t typeQueue.push({ name: name, def: definitionFn });\n\t if (!enqueue) flushTypeQueue();\n\t }\n\t return this;\n\t };\n\t\n\t // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s\n\t function flushTypeQueue() {\n\t while(typeQueue.length) {\n\t var type = typeQueue.shift();\n\t if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n\t angular.extend($types[type.name], injector.invoke(type.def));\n\t }\n\t }\n\t\n\t // Register default types. Store them in the prototype of $types.\n\t forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });\n\t $types = inherit($types, {});\n\t\n\t /* No need to document $get, since it returns this */\n\t this.$get = ['$injector', function ($injector) {\n\t injector = $injector;\n\t enqueue = false;\n\t flushTypeQueue();\n\t\n\t forEach(defaultTypes, function(type, name) {\n\t if (!$types[name]) $types[name] = new Type(type);\n\t });\n\t return this;\n\t }];\n\t\n\t this.Param = function Param(id, type, config, location) {\n\t var self = this;\n\t config = unwrapShorthand(config);\n\t type = getType(config, type, location);\n\t var arrayMode = getArrayMode();\n\t type = arrayMode ? type.$asArray(arrayMode, location === \"search\") : type;\n\t if (type.name === \"string\" && !arrayMode && location === \"path\" && config.value === undefined)\n\t config.value = \"\"; // for 0.2.x; in 0.3.0+ do not automatically default to \"\"\n\t var isOptional = config.value !== undefined;\n\t var squash = getSquashPolicy(config, isOptional);\n\t var replace = getReplace(config, arrayMode, isOptional, squash);\n\t\n\t function unwrapShorthand(config) {\n\t var keys = isObject(config) ? objectKeys(config) : [];\n\t var isShorthand = indexOf(keys, \"value\") === -1 && indexOf(keys, \"type\") === -1 &&\n\t indexOf(keys, \"squash\") === -1 && indexOf(keys, \"array\") === -1;\n\t if (isShorthand) config = { value: config };\n\t config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };\n\t return config;\n\t }\n\t\n\t function getType(config, urlType, location) {\n\t if (config.type && urlType) throw new Error(\"Param '\"+id+\"' has two type configurations.\");\n\t if (urlType) return urlType;\n\t if (!config.type) return (location === \"config\" ? $types.any : $types.string);\n\t return config.type instanceof Type ? config.type : new Type(config.type);\n\t }\n\t\n\t // array config: param name (param[]) overrides default settings. explicit config overrides param name.\n\t function getArrayMode() {\n\t var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n\t var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n\t return extend(arrayDefaults, arrayParamNomenclature, config).array;\n\t }\n\t\n\t /**\n\t * returns false, true, or the squash value to indicate the \"default parameter url squash policy\".\n\t */\n\t function getSquashPolicy(config, isOptional) {\n\t var squash = config.squash;\n\t if (!isOptional || squash === false) return false;\n\t if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n\t if (squash === true || isString(squash)) return squash;\n\t throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n\t }\n\t\n\t function getReplace(config, arrayMode, isOptional, squash) {\n\t var replace, configuredKeys, defaultPolicy = [\n\t { from: \"\", to: (isOptional || arrayMode ? undefined : \"\") },\n\t { from: null, to: (isOptional || arrayMode ? undefined : \"\") }\n\t ];\n\t replace = isArray(config.replace) ? config.replace : [];\n\t if (isString(squash))\n\t replace.push({ from: squash, to: undefined });\n\t configuredKeys = map(replace, function(item) { return item.from; } );\n\t return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);\n\t }\n\t\n\t /**\n\t * [Internal] Get the default value of a parameter, which may be an injectable function.\n\t */\n\t function $$getDefaultValue() {\n\t if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n\t var defaultValue = injector.invoke(config.$$fn);\n\t if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n\t throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n\t return defaultValue;\n\t }\n\t\n\t /**\n\t * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\n\t * default value, which may be the result of an injectable function.\n\t */\n\t function $value(value) {\n\t function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n\t function $replace(value) {\n\t var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n\t return replacement.length ? replacement[0] : value;\n\t }\n\t value = $replace(value);\n\t return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n\t }\n\t\n\t function toString() { return \"{Param:\" + id + \" \" + type + \" squash: '\" + squash + \"' optional: \" + isOptional + \"}\"; }\n\t\n\t extend(this, {\n\t id: id,\n\t type: type,\n\t location: location,\n\t array: arrayMode,\n\t squash: squash,\n\t replace: replace,\n\t isOptional: isOptional,\n\t value: $value,\n\t dynamic: undefined,\n\t config: config,\n\t toString: toString\n\t });\n\t };\n\t\n\t function ParamSet(params) {\n\t extend(this, params || {});\n\t }\n\t\n\t ParamSet.prototype = {\n\t $$new: function() {\n\t return inherit(this, extend(new ParamSet(), { $$parent: this}));\n\t },\n\t $$keys: function () {\n\t var keys = [], chain = [], parent = this,\n\t ignore = objectKeys(ParamSet.prototype);\n\t while (parent) { chain.push(parent); parent = parent.$$parent; }\n\t chain.reverse();\n\t forEach(chain, function(paramset) {\n\t forEach(objectKeys(paramset), function(key) {\n\t if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);\n\t });\n\t });\n\t return keys;\n\t },\n\t $$values: function(paramValues) {\n\t var values = {}, self = this;\n\t forEach(self.$$keys(), function(key) {\n\t values[key] = self[key].value(paramValues && paramValues[key]);\n\t });\n\t return values;\n\t },\n\t $$equals: function(paramValues1, paramValues2) {\n\t var equal = true, self = this;\n\t forEach(self.$$keys(), function(key) {\n\t var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];\n\t if (!self[key].type.equals(left, right)) equal = false;\n\t });\n\t return equal;\n\t },\n\t $$validates: function $$validate(paramValues) {\n\t var keys = this.$$keys(), i, param, rawVal, normalized, encoded;\n\t for (i = 0; i < keys.length; i++) {\n\t param = this[keys[i]];\n\t rawVal = paramValues[keys[i]];\n\t if ((rawVal === undefined || rawVal === null) && param.isOptional)\n\t break; // There was no parameter value, but the param is optional\n\t normalized = param.type.$normalize(rawVal);\n\t if (!param.type.is(normalized))\n\t return false; // The value was not of the correct Type, and could not be decoded to the correct Type\n\t encoded = param.type.encode(normalized);\n\t if (angular.isString(encoded) && !param.type.pattern.exec(encoded))\n\t return false; // The value was of the correct type, but when encoded, did not match the Type's regexp\n\t }\n\t return true;\n\t },\n\t $$parent: undefined\n\t };\n\t\n\t this.ParamSet = ParamSet;\n\t}\n\t\n\t// Register as a provider so it's available to other providers\n\tangular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);\n\tangular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);\n\t\n\t/**\n\t * @ngdoc object\n\t * @name ui.router.router.$urlRouterProvider\n\t *\n\t * @requires ui.router.util.$urlMatcherFactoryProvider\n\t * @requires $locationProvider\n\t *\n\t * @description\n\t * `$urlRouterProvider` has the responsibility of watching `$location`. \n\t * When `$location` changes it runs through a list of rules one by one until a \n\t * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify \n\t * a url in a state configuration. All urls are compiled into a UrlMatcher object.\n\t *\n\t * There are several methods on `$urlRouterProvider` that make it useful to use directly\n\t * in your module config.\n\t */\n\t$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];\n\tfunction $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {\n\t var rules = [], otherwise = null, interceptDeferred = false, listener;\n\t\n\t // Returns a string that is a prefix of all strings matching the RegExp\n\t function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }\n\t\n\t // Interpolates matched values into a String.replace()-style pattern\n\t function interpolate(pattern, match) {\n\t return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n\t return match[what === '$' ? 0 : Number(what)];\n\t });\n\t }\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.router.$urlRouterProvider#rule\n\t * @methodOf ui.router.router.$urlRouterProvider\n\t *\n\t * @description\n\t * Defines rules that are used by `$urlRouterProvider` to find matches for\n\t * specific URLs.\n\t *\n\t * @example\n\t *
\n\t   * var app = angular.module('app', ['ui.router.router']);\n\t   *\n\t   * app.config(function ($urlRouterProvider) {\n\t   *   // Here's an example of how you might allow case insensitive urls\n\t   *   $urlRouterProvider.rule(function ($injector, $location) {\n\t   *     var path = $location.path(),\n\t   *         normalized = path.toLowerCase();\n\t   *\n\t   *     if (path !== normalized) {\n\t   *       return normalized;\n\t   *     }\n\t   *   });\n\t   * });\n\t   * 
\n\t *\n\t * @param {object} rule Handler function that takes `$injector` and `$location`\n\t * services as arguments. You can use them to return a valid path as a string.\n\t *\n\t * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n\t */\n\t this.rule = function (rule) {\n\t if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n\t rules.push(rule);\n\t return this;\n\t };\n\t\n\t /**\n\t * @ngdoc object\n\t * @name ui.router.router.$urlRouterProvider#otherwise\n\t * @methodOf ui.router.router.$urlRouterProvider\n\t *\n\t * @description\n\t * Defines a path that is used when an invalid route is requested.\n\t *\n\t * @example\n\t *
\n\t   * var app = angular.module('app', ['ui.router.router']);\n\t   *\n\t   * app.config(function ($urlRouterProvider) {\n\t   *   // if the path doesn't match any of the urls you configured\n\t   *   // otherwise will take care of routing the user to the\n\t   *   // specified url\n\t   *   $urlRouterProvider.otherwise('/index');\n\t   *\n\t   *   // Example of using function rule as param\n\t   *   $urlRouterProvider.otherwise(function ($injector, $location) {\n\t   *     return '/a/valid/url';\n\t   *   });\n\t   * });\n\t   * 
\n\t *\n\t * @param {string|object} rule The url path you want to redirect to or a function \n\t * rule that returns the url path. The function version is passed two params: \n\t * `$injector` and `$location` services, and must return a url string.\n\t *\n\t * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n\t */\n\t this.otherwise = function (rule) {\n\t if (isString(rule)) {\n\t var redirect = rule;\n\t rule = function () { return redirect; };\n\t }\n\t else if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n\t otherwise = rule;\n\t return this;\n\t };\n\t\n\t\n\t function handleIfMatch($injector, handler, match) {\n\t if (!match) return false;\n\t var result = $injector.invoke(handler, handler, { $match: match });\n\t return isDefined(result) ? result : true;\n\t }\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.router.$urlRouterProvider#when\n\t * @methodOf ui.router.router.$urlRouterProvider\n\t *\n\t * @description\n\t * Registers a handler for a given url matching. if handle is a string, it is\n\t * treated as a redirect, and is interpolated according to the syntax of match\n\t * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n\t *\n\t * If the handler is a function, it is injectable. It gets invoked if `$location`\n\t * matches. You have the option of inject the match object as `$match`.\n\t *\n\t * The handler can return\n\t *\n\t * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n\t * will continue trying to find another one that matches.\n\t * - **string** which is treated as a redirect and passed to `$location.url()`\n\t * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n\t *\n\t * @example\n\t *
\n\t   * var app = angular.module('app', ['ui.router.router']);\n\t   *\n\t   * app.config(function ($urlRouterProvider) {\n\t   *   $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n\t   *     if ($state.$current.navigable !== state ||\n\t   *         !equalForKeys($match, $stateParams) {\n\t   *      $state.transitionTo(state, $match, false);\n\t   *     }\n\t   *   });\n\t   * });\n\t   * 
\n\t *\n\t * @param {string|object} what The incoming path that you want to redirect.\n\t * @param {string|object} handler The path you want to redirect your user to.\n\t */\n\t this.when = function (what, handler) {\n\t var redirect, handlerIsString = isString(handler);\n\t if (isString(what)) what = $urlMatcherFactory.compile(what);\n\t\n\t if (!handlerIsString && !isFunction(handler) && !isArray(handler))\n\t throw new Error(\"invalid 'handler' in when()\");\n\t\n\t var strategies = {\n\t matcher: function (what, handler) {\n\t if (handlerIsString) {\n\t redirect = $urlMatcherFactory.compile(handler);\n\t handler = ['$match', function ($match) { return redirect.format($match); }];\n\t }\n\t return extend(function ($injector, $location) {\n\t return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));\n\t }, {\n\t prefix: isString(what.prefix) ? what.prefix : ''\n\t });\n\t },\n\t regex: function (what, handler) {\n\t if (what.global || what.sticky) throw new Error(\"when() RegExp must not be global or sticky\");\n\t\n\t if (handlerIsString) {\n\t redirect = handler;\n\t handler = ['$match', function ($match) { return interpolate(redirect, $match); }];\n\t }\n\t return extend(function ($injector, $location) {\n\t return handleIfMatch($injector, handler, what.exec($location.path()));\n\t }, {\n\t prefix: regExpPrefix(what)\n\t });\n\t }\n\t };\n\t\n\t var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };\n\t\n\t for (var n in check) {\n\t if (check[n]) return this.rule(strategies[n](what, handler));\n\t }\n\t\n\t throw new Error(\"invalid 'what' in when()\");\n\t };\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.router.$urlRouterProvider#deferIntercept\n\t * @methodOf ui.router.router.$urlRouterProvider\n\t *\n\t * @description\n\t * Disables (or enables) deferring location change interception.\n\t *\n\t * If you wish to customize the behavior of syncing the URL (for example, if you wish to\n\t * defer a transition but maintain the current URL), call this method at configuration time.\n\t * Then, at run time, call `$urlRouter.listen()` after you have configured your own\n\t * `$locationChangeSuccess` event handler.\n\t *\n\t * @example\n\t *
\n\t   * var app = angular.module('app', ['ui.router.router']);\n\t   *\n\t   * app.config(function ($urlRouterProvider) {\n\t   *\n\t   *   // Prevent $urlRouter from automatically intercepting URL changes;\n\t   *   // this allows you to configure custom behavior in between\n\t   *   // location changes and route synchronization:\n\t   *   $urlRouterProvider.deferIntercept();\n\t   *\n\t   * }).run(function ($rootScope, $urlRouter, UserService) {\n\t   *\n\t   *   $rootScope.$on('$locationChangeSuccess', function(e) {\n\t   *     // UserService is an example service for managing user state\n\t   *     if (UserService.isLoggedIn()) return;\n\t   *\n\t   *     // Prevent $urlRouter's default handler from firing\n\t   *     e.preventDefault();\n\t   *\n\t   *     UserService.handleLogin().then(function() {\n\t   *       // Once the user has logged in, sync the current URL\n\t   *       // to the router:\n\t   *       $urlRouter.sync();\n\t   *     });\n\t   *   });\n\t   *\n\t   *   // Configures $urlRouter's listener *after* your custom listener\n\t   *   $urlRouter.listen();\n\t   * });\n\t   * 
\n\t *\n\t * @param {boolean} defer Indicates whether to defer location change interception. Passing\n\t no parameter is equivalent to `true`.\n\t */\n\t this.deferIntercept = function (defer) {\n\t if (defer === undefined) defer = true;\n\t interceptDeferred = defer;\n\t };\n\t\n\t /**\n\t * @ngdoc object\n\t * @name ui.router.router.$urlRouter\n\t *\n\t * @requires $location\n\t * @requires $rootScope\n\t * @requires $injector\n\t * @requires $browser\n\t *\n\t * @description\n\t *\n\t */\n\t this.$get = $get;\n\t $get.$inject = ['$location', '$rootScope', '$injector', '$browser'];\n\t function $get( $location, $rootScope, $injector, $browser) {\n\t\n\t var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;\n\t\n\t function appendBasePath(url, isHtml5, absolute) {\n\t if (baseHref === '/') return url;\n\t if (isHtml5) return baseHref.slice(0, -1) + url;\n\t if (absolute) return baseHref.slice(1) + url;\n\t return url;\n\t }\n\t\n\t // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree\n\t function update(evt) {\n\t if (evt && evt.defaultPrevented) return;\n\t var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n\t lastPushedUrl = undefined;\n\t // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n\t //if (ignoreUpdate) return true;\n\t\n\t function check(rule) {\n\t var handled = rule($injector, $location);\n\t\n\t if (!handled) return false;\n\t if (isString(handled)) $location.replace().url(handled);\n\t return true;\n\t }\n\t var n = rules.length, i;\n\t\n\t for (i = 0; i < n; i++) {\n\t if (check(rules[i])) return;\n\t }\n\t // always check otherwise last to allow dynamic updates to the set of rules\n\t if (otherwise) check(otherwise);\n\t }\n\t\n\t function listen() {\n\t listener = listener || $rootScope.$on('$locationChangeSuccess', update);\n\t return listener;\n\t }\n\t\n\t if (!interceptDeferred) listen();\n\t\n\t return {\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.router.$urlRouter#sync\n\t * @methodOf ui.router.router.$urlRouter\n\t *\n\t * @description\n\t * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.\n\t * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,\n\t * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed\n\t * with the transition by calling `$urlRouter.sync()`.\n\t *\n\t * @example\n\t *
\n\t       * angular.module('app', ['ui.router'])\n\t       *   .run(function($rootScope, $urlRouter) {\n\t       *     $rootScope.$on('$locationChangeSuccess', function(evt) {\n\t       *       // Halt state change from even starting\n\t       *       evt.preventDefault();\n\t       *       // Perform custom logic\n\t       *       var meetsRequirement = ...\n\t       *       // Continue with the update and state transition if logic allows\n\t       *       if (meetsRequirement) $urlRouter.sync();\n\t       *     });\n\t       * });\n\t       * 
\n\t */\n\t sync: function() {\n\t update();\n\t },\n\t\n\t listen: function() {\n\t return listen();\n\t },\n\t\n\t update: function(read) {\n\t if (read) {\n\t location = $location.url();\n\t return;\n\t }\n\t if ($location.url() === location) return;\n\t\n\t $location.url(location);\n\t $location.replace();\n\t },\n\t\n\t push: function(urlMatcher, params, options) {\n\t var url = urlMatcher.format(params || {});\n\t\n\t // Handle the special hash param, if needed\n\t if (url !== null && params && params['#']) {\n\t url += '#' + params['#'];\n\t }\n\t\n\t $location.url(url);\n\t lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;\n\t if (options && options.replace) $location.replace();\n\t },\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.router.$urlRouter#href\n\t * @methodOf ui.router.router.$urlRouter\n\t *\n\t * @description\n\t * A URL generation method that returns the compiled URL for a given\n\t * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.\n\t *\n\t * @example\n\t *
\n\t       * $bob = $urlRouter.href(new UrlMatcher(\"/about/:person\"), {\n\t       *   person: \"bob\"\n\t       * });\n\t       * // $bob == \"/about/bob\";\n\t       * 
\n\t *\n\t * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.\n\t * @param {object=} params An object of parameter values to fill the matcher's required parameters.\n\t * @param {object=} options Options object. The options are:\n\t *\n\t * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n\t *\n\t * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n\t */\n\t href: function(urlMatcher, params, options) {\n\t if (!urlMatcher.validates(params)) return null;\n\t\n\t var isHtml5 = $locationProvider.html5Mode();\n\t if (angular.isObject(isHtml5)) {\n\t isHtml5 = isHtml5.enabled;\n\t }\n\t \n\t var url = urlMatcher.format(params);\n\t options = options || {};\n\t\n\t if (!isHtml5 && url !== null) {\n\t url = \"#\" + $locationProvider.hashPrefix() + url;\n\t }\n\t\n\t // Handle special hash param, if needed\n\t if (url !== null && params && params['#']) {\n\t url += '#' + params['#'];\n\t }\n\t\n\t url = appendBasePath(url, isHtml5, options.absolute);\n\t\n\t if (!options.absolute || !url) {\n\t return url;\n\t }\n\t\n\t var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();\n\t port = (port === 80 || port === 443 ? '' : ':' + port);\n\t\n\t return [$location.protocol(), '://', $location.host(), port, slash, url].join('');\n\t }\n\t };\n\t }\n\t}\n\t\n\tangular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);\n\t\n\t/**\n\t * @ngdoc object\n\t * @name ui.router.state.$stateProvider\n\t *\n\t * @requires ui.router.router.$urlRouterProvider\n\t * @requires ui.router.util.$urlMatcherFactoryProvider\n\t *\n\t * @description\n\t * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n\t * on state.\n\t *\n\t * A state corresponds to a \"place\" in the application in terms of the overall UI and\n\t * navigation. A state describes (via the controller / template / view properties) what\n\t * the UI looks like and does at that place.\n\t *\n\t * States often have things in common, and the primary way of factoring out these\n\t * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n\t * nested states.\n\t *\n\t * The `$stateProvider` provides interfaces to declare these states for your app.\n\t */\n\t$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];\n\tfunction $StateProvider( $urlRouterProvider, $urlMatcherFactory) {\n\t\n\t var root, states = {}, $state, queue = {}, abstractKey = 'abstract';\n\t\n\t // Builds state properties from definition passed to registerState()\n\t var stateBuilder = {\n\t\n\t // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.\n\t // state.children = [];\n\t // if (parent) parent.children.push(state);\n\t parent: function(state) {\n\t if (isDefined(state.parent) && state.parent) return findState(state.parent);\n\t // regex matches any valid composite state name\n\t // would match \"contact.list\" but not \"contacts\"\n\t var compositeName = /^(.+)\\.[^.]+$/.exec(state.name);\n\t return compositeName ? findState(compositeName[1]) : root;\n\t },\n\t\n\t // inherit 'data' from parent and override by own values (if any)\n\t data: function(state) {\n\t if (state.parent && state.parent.data) {\n\t state.data = state.self.data = extend({}, state.parent.data, state.data);\n\t }\n\t return state.data;\n\t },\n\t\n\t // Build a URLMatcher if necessary, either via a relative or absolute URL\n\t url: function(state) {\n\t var url = state.url, config = { params: state.params || {} };\n\t\n\t if (isString(url)) {\n\t if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);\n\t return (state.parent.navigable || root).url.concat(url, config);\n\t }\n\t\n\t if (!url || $urlMatcherFactory.isMatcher(url)) return url;\n\t throw new Error(\"Invalid url '\" + url + \"' in state '\" + state + \"'\");\n\t },\n\t\n\t // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n\t navigable: function(state) {\n\t return state.url ? state : (state.parent ? state.parent.navigable : null);\n\t },\n\t\n\t // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params\n\t ownParams: function(state) {\n\t var params = state.url && state.url.params || new $$UMFP.ParamSet();\n\t forEach(state.params || {}, function(config, id) {\n\t if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, \"config\");\n\t });\n\t return params;\n\t },\n\t\n\t // Derive parameters for this state and ensure they're a super-set of parent's parameters\n\t params: function(state) {\n\t return state.parent && state.parent.params ? extend(state.parent.params.$$new(), state.ownParams) : new $$UMFP.ParamSet();\n\t },\n\t\n\t // If there is no explicit multi-view configuration, make one up so we don't have\n\t // to handle both cases in the view directive later. Note that having an explicit\n\t // 'views' property will mean the default unnamed view properties are ignored. This\n\t // is also a good time to resolve view names to absolute names, so everything is a\n\t // straight lookup at link time.\n\t views: function(state) {\n\t var views = {};\n\t\n\t forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {\n\t if (name.indexOf('@') < 0) name += '@' + state.parent.name;\n\t views[name] = view;\n\t });\n\t return views;\n\t },\n\t\n\t // Keep a full path from the root down to this state as this is needed for state activation.\n\t path: function(state) {\n\t return state.parent ? state.parent.path.concat(state) : []; // exclude root from path\n\t },\n\t\n\t // Speed up $state.contains() as it's used a lot\n\t includes: function(state) {\n\t var includes = state.parent ? extend({}, state.parent.includes) : {};\n\t includes[state.name] = true;\n\t return includes;\n\t },\n\t\n\t $delegates: {}\n\t };\n\t\n\t function isRelative(stateName) {\n\t return stateName.indexOf(\".\") === 0 || stateName.indexOf(\"^\") === 0;\n\t }\n\t\n\t function findState(stateOrName, base) {\n\t if (!stateOrName) return undefined;\n\t\n\t var isStr = isString(stateOrName),\n\t name = isStr ? stateOrName : stateOrName.name,\n\t path = isRelative(name);\n\t\n\t if (path) {\n\t if (!base) throw new Error(\"No reference point given for path '\" + name + \"'\");\n\t base = findState(base);\n\t \n\t var rel = name.split(\".\"), i = 0, pathLength = rel.length, current = base;\n\t\n\t for (; i < pathLength; i++) {\n\t if (rel[i] === \"\" && i === 0) {\n\t current = base;\n\t continue;\n\t }\n\t if (rel[i] === \"^\") {\n\t if (!current.parent) throw new Error(\"Path '\" + name + \"' not valid for state '\" + base.name + \"'\");\n\t current = current.parent;\n\t continue;\n\t }\n\t break;\n\t }\n\t rel = rel.slice(i).join(\".\");\n\t name = current.name + (current.name && rel ? \".\" : \"\") + rel;\n\t }\n\t var state = states[name];\n\t\n\t if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n\t return state;\n\t }\n\t return undefined;\n\t }\n\t\n\t function queueState(parentName, state) {\n\t if (!queue[parentName]) {\n\t queue[parentName] = [];\n\t }\n\t queue[parentName].push(state);\n\t }\n\t\n\t function flushQueuedChildren(parentName) {\n\t var queued = queue[parentName] || [];\n\t while(queued.length) {\n\t registerState(queued.shift());\n\t }\n\t }\n\t\n\t function registerState(state) {\n\t // Wrap a new object around the state so we can store our private details easily.\n\t state = inherit(state, {\n\t self: state,\n\t resolve: state.resolve || {},\n\t toString: function() { return this.name; }\n\t });\n\t\n\t var name = state.name;\n\t if (!isString(name) || name.indexOf('@') >= 0) throw new Error(\"State must have a valid name\");\n\t if (states.hasOwnProperty(name)) throw new Error(\"State '\" + name + \"'' is already defined\");\n\t\n\t // Get parent name\n\t var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))\n\t : (isString(state.parent)) ? state.parent\n\t : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name\n\t : '';\n\t\n\t // If parent is not registered yet, add state to queue and register later\n\t if (parentName && !states[parentName]) {\n\t return queueState(parentName, state.self);\n\t }\n\t\n\t for (var key in stateBuilder) {\n\t if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);\n\t }\n\t states[name] = state;\n\t\n\t // Register the state in the global state list and with $urlRouter if necessary.\n\t if (!state[abstractKey] && state.url) {\n\t $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {\n\t if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {\n\t $state.transitionTo(state, $match, { inherit: true, location: false });\n\t }\n\t }]);\n\t }\n\t\n\t // Register any queued children\n\t flushQueuedChildren(name);\n\t\n\t return state;\n\t }\n\t\n\t // Checks text to see if it looks like a glob.\n\t function isGlob (text) {\n\t return text.indexOf('*') > -1;\n\t }\n\t\n\t // Returns true if glob matches current $state name.\n\t function doesStateMatchGlob (glob) {\n\t var globSegments = glob.split('.'),\n\t segments = $state.$current.name.split('.');\n\t\n\t //match single stars\n\t for (var i = 0, l = globSegments.length; i < l; i++) {\n\t if (globSegments[i] === '*') {\n\t segments[i] = '*';\n\t }\n\t }\n\t\n\t //match greedy starts\n\t if (globSegments[0] === '**') {\n\t segments = segments.slice(indexOf(segments, globSegments[1]));\n\t segments.unshift('**');\n\t }\n\t //match greedy ends\n\t if (globSegments[globSegments.length - 1] === '**') {\n\t segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n\t segments.push('**');\n\t }\n\t\n\t if (globSegments.length != segments.length) {\n\t return false;\n\t }\n\t\n\t return segments.join('') === globSegments.join('');\n\t }\n\t\n\t\n\t // Implicit root state that is always active\n\t root = registerState({\n\t name: '',\n\t url: '^',\n\t views: null,\n\t 'abstract': true\n\t });\n\t root.navigable = null;\n\t\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.state.$stateProvider#decorator\n\t * @methodOf ui.router.state.$stateProvider\n\t *\n\t * @description\n\t * Allows you to extend (carefully) or override (at your own peril) the \n\t * `stateBuilder` object used internally by `$stateProvider`. This can be used \n\t * to add custom functionality to ui-router, for example inferring templateUrl \n\t * based on the state name.\n\t *\n\t * When passing only a name, it returns the current (original or decorated) builder\n\t * function that matches `name`.\n\t *\n\t * The builder functions that can be decorated are listed below. Though not all\n\t * necessarily have a good use case for decoration, that is up to you to decide.\n\t *\n\t * In addition, users can attach custom decorators, which will generate new \n\t * properties within the state's internal definition. There is currently no clear \n\t * use-case for this beyond accessing internal states (i.e. $state.$current), \n\t * however, expect this to become increasingly relevant as we introduce additional \n\t * meta-programming features.\n\t *\n\t * **Warning**: Decorators should not be interdependent because the order of \n\t * execution of the builder functions in non-deterministic. Builder functions \n\t * should only be dependent on the state definition object and super function.\n\t *\n\t *\n\t * Existing builder functions and current return values:\n\t *\n\t * - **parent** `{object}` - returns the parent state object.\n\t * - **data** `{object}` - returns state data, including any inherited data that is not\n\t * overridden by own values (if any).\n\t * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n\t * or `null`.\n\t * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is \n\t * navigable).\n\t * - **params** `{object}` - returns an array of state params that are ensured to \n\t * be a super-set of parent's params.\n\t * - **views** `{object}` - returns a views object where each key is an absolute view \n\t * name (i.e. \"viewName@stateName\") and each value is the config object \n\t * (template, controller) for the view. Even when you don't use the views object \n\t * explicitly on a state config, one is still created for you internally.\n\t * So by decorating this builder function you have access to decorating template \n\t * and controller properties.\n\t * - **ownParams** `{object}` - returns an array of params that belong to the state, \n\t * not including any params defined by ancestor states.\n\t * - **path** `{string}` - returns the full path from the root down to this state. \n\t * Needed for state activation.\n\t * - **includes** `{object}` - returns an object that includes every state that \n\t * would pass a `$state.includes()` test.\n\t *\n\t * @example\n\t *
\n\t   * // Override the internal 'views' builder with a function that takes the state\n\t   * // definition, and a reference to the internal function being overridden:\n\t   * $stateProvider.decorator('views', function (state, parent) {\n\t   *   var result = {},\n\t   *       views = parent(state);\n\t   *\n\t   *   angular.forEach(views, function (config, name) {\n\t   *     var autoName = (state.name + '.' + name).replace('.', '/');\n\t   *     config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n\t   *     result[name] = config;\n\t   *   });\n\t   *   return result;\n\t   * });\n\t   *\n\t   * $stateProvider.state('home', {\n\t   *   views: {\n\t   *     'contact.list': { controller: 'ListController' },\n\t   *     'contact.item': { controller: 'ItemController' }\n\t   *   }\n\t   * });\n\t   *\n\t   * // ...\n\t   *\n\t   * $state.go('home');\n\t   * // Auto-populates list and item views with /partials/home/contact/list.html,\n\t   * // and /partials/home/contact/item.html, respectively.\n\t   * 
\n\t *\n\t * @param {string} name The name of the builder function to decorate. \n\t * @param {object} func A function that is responsible for decorating the original \n\t * builder function. The function receives two parameters:\n\t *\n\t * - `{object}` - state - The state config object.\n\t * - `{object}` - super - The original builder function.\n\t *\n\t * @return {object} $stateProvider - $stateProvider instance\n\t */\n\t this.decorator = decorator;\n\t function decorator(name, func) {\n\t /*jshint validthis: true */\n\t if (isString(name) && !isDefined(func)) {\n\t return stateBuilder[name];\n\t }\n\t if (!isFunction(func) || !isString(name)) {\n\t return this;\n\t }\n\t if (stateBuilder[name] && !stateBuilder.$delegates[name]) {\n\t stateBuilder.$delegates[name] = stateBuilder[name];\n\t }\n\t stateBuilder[name] = func;\n\t return this;\n\t }\n\t\n\t /**\n\t * @ngdoc function\n\t * @name ui.router.state.$stateProvider#state\n\t * @methodOf ui.router.state.$stateProvider\n\t *\n\t * @description\n\t * Registers a state configuration under a given state name. The stateConfig object\n\t * has the following acceptable properties.\n\t *\n\t * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n\t * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n\t * @param {object} stateConfig State configuration object.\n\t * @param {string|function=} stateConfig.template\n\t * \n\t * html template as a string or a function that returns\n\t * an html template as a string which should be used by the uiView directives. This property \n\t * takes precedence over templateUrl.\n\t * \n\t * If `template` is a function, it will be called with the following parameters:\n\t *\n\t * - {array.<object>} - state parameters extracted from the current $location.path() by\n\t * applying the current state\n\t *\n\t *
template:\n\t   *   \"

inline template definition

\" +\n\t * \"
\"
\n\t *
template: function(params) {\n\t   *       return \"

generated template

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

HELLO!

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

HELLO!

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

HELLO!

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

HELLO!

\"\n\t * },\n\t * \"chart\": {\n\t * template: \"\"\n\t * },\n\t * \"data\": {\n\t * template: \"\"\n\t * }\n\t * } \n\t * })\n\t *
\n\t *\n\t * Examples for `autoscroll`:\n\t *\n\t *
\n\t * \n\t * \n\t *\n\t * \n\t * \n\t * \n\t * \n\t * 
\n\t */\n\t$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate'];\n\tfunction $ViewDirective( $state, $injector, $uiViewScroll, $interpolate) {\n\t\n\t function getService() {\n\t return ($injector.has) ? function(service) {\n\t return $injector.has(service) ? $injector.get(service) : null;\n\t } : function(service) {\n\t try {\n\t return $injector.get(service);\n\t } catch (e) {\n\t return null;\n\t }\n\t };\n\t }\n\t\n\t var service = getService(),\n\t $animator = service('$animator'),\n\t $animate = service('$animate');\n\t\n\t // Returns a set of DOM manipulation functions based on which Angular version\n\t // it should use\n\t function getRenderer(attrs, scope) {\n\t var statics = function() {\n\t return {\n\t enter: function (element, target, cb) { target.after(element); cb(); },\n\t leave: function (element, cb) { element.remove(); cb(); }\n\t };\n\t };\n\t\n\t if ($animate) {\n\t return {\n\t enter: function(element, target, cb) {\n\t var promise = $animate.enter(element, null, target, cb);\n\t if (promise && promise.then) promise.then(cb);\n\t },\n\t leave: function(element, cb) {\n\t var promise = $animate.leave(element, cb);\n\t if (promise && promise.then) promise.then(cb);\n\t }\n\t };\n\t }\n\t\n\t if ($animator) {\n\t var animate = $animator && $animator(scope, attrs);\n\t\n\t return {\n\t enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n\t leave: function(element, cb) { animate.leave(element); cb(); }\n\t };\n\t }\n\t\n\t return statics();\n\t }\n\t\n\t var directive = {\n\t restrict: 'ECA',\n\t terminal: true,\n\t priority: 400,\n\t transclude: 'element',\n\t compile: function (tElement, tAttrs, $transclude) {\n\t return function (scope, $element, attrs) {\n\t var previousEl, currentEl, currentScope, latestLocals,\n\t onloadExp = attrs.onload || '',\n\t autoScrollExp = attrs.autoscroll,\n\t renderer = getRenderer(attrs, scope);\n\t\n\t scope.$on('$stateChangeSuccess', function() {\n\t updateView(false);\n\t });\n\t scope.$on('$viewContentLoading', function() {\n\t updateView(false);\n\t });\n\t\n\t updateView(true);\n\t\n\t function cleanupLastView() {\n\t if (previousEl) {\n\t previousEl.remove();\n\t previousEl = null;\n\t }\n\t\n\t if (currentScope) {\n\t currentScope.$destroy();\n\t currentScope = null;\n\t }\n\t\n\t if (currentEl) {\n\t renderer.leave(currentEl, function() {\n\t previousEl = null;\n\t });\n\t\n\t previousEl = currentEl;\n\t currentEl = null;\n\t }\n\t }\n\t\n\t function updateView(firstTime) {\n\t var newScope,\n\t name = getUiViewName(scope, attrs, $element, $interpolate),\n\t previousLocals = name && $state.$current && $state.$current.locals[name];\n\t\n\t if (!firstTime && previousLocals === latestLocals) return; // nothing to do\n\t newScope = scope.$new();\n\t latestLocals = $state.$current.locals[name];\n\t\n\t var clone = $transclude(newScope, function(clone) {\n\t renderer.enter(clone, $element, function onUiViewEnter() {\n\t if(currentScope) {\n\t currentScope.$emit('$viewContentAnimationEnded');\n\t }\n\t\n\t if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {\n\t $uiViewScroll(clone);\n\t }\n\t });\n\t cleanupLastView();\n\t });\n\t\n\t currentEl = clone;\n\t currentScope = newScope;\n\t /**\n\t * @ngdoc event\n\t * @name ui.router.state.directive:ui-view#$viewContentLoaded\n\t * @eventOf ui.router.state.directive:ui-view\n\t * @eventType emits on ui-view directive scope\n\t * @description *\n\t * Fired once the view is **loaded**, *after* the DOM is rendered.\n\t *\n\t * @param {Object} event Event object.\n\t */\n\t currentScope.$emit('$viewContentLoaded');\n\t currentScope.$eval(onloadExp);\n\t }\n\t };\n\t }\n\t };\n\t\n\t return directive;\n\t}\n\t\n\t$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];\n\tfunction $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) {\n\t return {\n\t restrict: 'ECA',\n\t priority: -400,\n\t compile: function (tElement) {\n\t var initial = tElement.html();\n\t return function (scope, $element, attrs) {\n\t var current = $state.$current,\n\t name = getUiViewName(scope, attrs, $element, $interpolate),\n\t locals = current && current.locals[name];\n\t\n\t if (! locals) {\n\t return;\n\t }\n\t\n\t $element.data('$uiView', { name: name, state: locals.$$state });\n\t $element.html(locals.$template ? locals.$template : initial);\n\t\n\t var link = $compile($element.contents());\n\t\n\t if (locals.$$controller) {\n\t locals.$scope = scope;\n\t locals.$element = $element;\n\t var controller = $controller(locals.$$controller, locals);\n\t if (locals.$$controllerAs) {\n\t scope[locals.$$controllerAs] = controller;\n\t }\n\t $element.data('$ngControllerController', controller);\n\t $element.children().data('$ngControllerController', controller);\n\t }\n\t\n\t link(scope);\n\t };\n\t }\n\t };\n\t}\n\t\n\t/**\n\t * Shared ui-view code for both directives:\n\t * Given scope, element, and its attributes, return the view's name\n\t */\n\tfunction getUiViewName(scope, attrs, element, $interpolate) {\n\t var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n\t var inherited = element.inheritedData('$uiView');\n\t return name.indexOf('@') >= 0 ? name : (name + '@' + (inherited ? inherited.state.name : ''));\n\t}\n\t\n\tangular.module('ui.router.state').directive('uiView', $ViewDirective);\n\tangular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n\t\n\tfunction parseStateRef(ref, current) {\n\t var preparsed = ref.match(/^\\s*({[^}]*})\\s*$/), parsed;\n\t if (preparsed) ref = current + '(' + preparsed[1] + ')';\n\t parsed = ref.replace(/\\n/g, \" \").match(/^([^(]+?)\\s*(\\((.*)\\))?$/);\n\t if (!parsed || parsed.length !== 4) throw new Error(\"Invalid state ref '\" + ref + \"'\");\n\t return { state: parsed[1], paramExpr: parsed[3] || null };\n\t}\n\t\n\tfunction stateContext(el) {\n\t var stateData = el.parent().inheritedData('$uiView');\n\t\n\t if (stateData && stateData.state && stateData.state.name) {\n\t return stateData.state;\n\t }\n\t}\n\t\n\t/**\n\t * @ngdoc directive\n\t * @name ui.router.state.directive:ui-sref\n\t *\n\t * @requires ui.router.state.$state\n\t * @requires $timeout\n\t *\n\t * @restrict A\n\t *\n\t * @description\n\t * A directive that binds a link (`` tag) to a state. If the state has an associated \n\t * URL, the directive will automatically generate & update the `href` attribute via \n\t * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking \n\t * the link will trigger a state transition with optional parameters. \n\t *\n\t * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be \n\t * handled natively by the browser.\n\t *\n\t * You can also use relative state paths within ui-sref, just like the relative \n\t * paths passed to `$state.go()`. You just need to be aware that the path is relative\n\t * to the state that the link lives in, in other words the state that loaded the \n\t * template containing the link.\n\t *\n\t * You can specify options to pass to {@link ui.router.state.$state#go $state.go()}\n\t * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,\n\t * and `reload`.\n\t *\n\t * @example\n\t * Here's an example of how you'd use ui-sref and how it would compile. If you have the \n\t * following template:\n\t *
\n\t * Home | About | Next page\n\t * \n\t * \n\t * 
\n\t * \n\t * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):\n\t *
\n\t * Home | About | Next page\n\t * \n\t * 
    \n\t *
  • \n\t * Joe\n\t *
  • \n\t *
  • \n\t * Alice\n\t *
  • \n\t *
  • \n\t * Bob\n\t *
  • \n\t *
\n\t *\n\t * Home\n\t *
\n\t *\n\t * @param {string} ui-sref 'stateName' can be any valid absolute or relative state\n\t * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#go $state.go()}\n\t */\n\t$StateRefDirective.$inject = ['$state', '$timeout'];\n\tfunction $StateRefDirective($state, $timeout) {\n\t var allowedOptions = ['location', 'inherit', 'reload', 'absolute'];\n\t\n\t return {\n\t restrict: 'A',\n\t require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n\t link: function(scope, element, attrs, uiSrefActive) {\n\t var ref = parseStateRef(attrs.uiSref, $state.current.name);\n\t var params = null, url = null, base = stateContext(element) || $state.$current;\n\t // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n\t var hrefKind = Object.prototype.toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n\t 'xlink:href' : 'href';\n\t var newHref = null, isAnchor = element.prop(\"tagName\").toUpperCase() === \"A\";\n\t var isForm = element[0].nodeName === \"FORM\";\n\t var attr = isForm ? \"action\" : hrefKind, nav = true;\n\t\n\t var options = { relative: base, inherit: true };\n\t var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};\n\t\n\t angular.forEach(allowedOptions, function(option) {\n\t if (option in optionsOverride) {\n\t options[option] = optionsOverride[option];\n\t }\n\t });\n\t\n\t var update = function(newVal) {\n\t if (newVal) params = angular.copy(newVal);\n\t if (!nav) return;\n\t\n\t newHref = $state.href(ref.state, params, options);\n\t\n\t var activeDirective = uiSrefActive[1] || uiSrefActive[0];\n\t if (activeDirective) {\n\t activeDirective.$$addStateInfo(ref.state, params);\n\t }\n\t if (newHref === null) {\n\t nav = false;\n\t return false;\n\t }\n\t attrs.$set(attr, newHref);\n\t };\n\t\n\t if (ref.paramExpr) {\n\t scope.$watch(ref.paramExpr, function(newVal, oldVal) {\n\t if (newVal !== params) update(newVal);\n\t }, true);\n\t params = angular.copy(scope.$eval(ref.paramExpr));\n\t }\n\t update();\n\t\n\t if (isForm) return;\n\t\n\t element.bind(\"click\", function(e) {\n\t var button = e.which || e.button;\n\t if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {\n\t // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\n\t var transition = $timeout(function() {\n\t $state.go(ref.state, params, options);\n\t });\n\t e.preventDefault();\n\t\n\t // if the state has no URL, ignore one preventDefault from the directive.\n\t var ignorePreventDefaultCount = isAnchor && !newHref ? 1: 0;\n\t e.preventDefault = function() {\n\t if (ignorePreventDefaultCount-- <= 0)\n\t $timeout.cancel(transition);\n\t };\n\t }\n\t });\n\t }\n\t };\n\t}\n\t\n\t/**\n\t * @ngdoc directive\n\t * @name ui.router.state.directive:ui-sref-active\n\t *\n\t * @requires ui.router.state.$state\n\t * @requires ui.router.state.$stateParams\n\t * @requires $interpolate\n\t *\n\t * @restrict A\n\t *\n\t * @description\n\t * A directive working alongside ui-sref to add classes to an element when the\n\t * related ui-sref directive's state is active, and removing them when it is inactive.\n\t * The primary use-case is to simplify the special appearance of navigation menus\n\t * relying on `ui-sref`, by having the \"active\" state's menu button appear different,\n\t * distinguishing it from the inactive menu items.\n\t *\n\t * ui-sref-active can live on the same element as ui-sref or on a parent element. The first\n\t * ui-sref-active found at the same level or above the ui-sref will be used.\n\t *\n\t * Will activate when the ui-sref's target state or any child state is active. If you\n\t * need to activate only when the ui-sref target state is active and *not* any of\n\t * it's children, then you will use\n\t * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}\n\t *\n\t * @example\n\t * Given the following template:\n\t *
\n\t * \n\t * 
\n\t *\n\t *\n\t * When the app state is \"app.user\" (or any children states), and contains the state parameter \"user\" with value \"bilbobaggins\",\n\t * the resulting HTML will appear as (note the 'active' class):\n\t *
\n\t * \n\t * 
\n\t *\n\t * The class name is interpolated **once** during the directives link time (any further changes to the\n\t * interpolated value are ignored).\n\t *\n\t * Multiple classes may be specified in a space-separated format:\n\t *
\n\t * 
    \n\t *
  • \n\t * link\n\t *
  • \n\t *
\n\t *
\n\t */\n\t\n\t/**\n\t * @ngdoc directive\n\t * @name ui.router.state.directive:ui-sref-active-eq\n\t *\n\t * @requires ui.router.state.$state\n\t * @requires ui.router.state.$stateParams\n\t * @requires $interpolate\n\t *\n\t * @restrict A\n\t *\n\t * @description\n\t * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate\n\t * when the exact target state used in the `ui-sref` is active; no child states.\n\t *\n\t */\n\t$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];\n\tfunction $StateRefActiveDirective($state, $stateParams, $interpolate) {\n\t return {\n\t restrict: \"A\",\n\t controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {\n\t var states = [], activeClass;\n\t\n\t // There probably isn't much point in $observing this\n\t // uiSrefActive and uiSrefActiveEq share the same directive object with some\n\t // slight difference in logic routing\n\t activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);\n\t\n\t // Allow uiSref to communicate with uiSrefActive[Equals]\n\t this.$$addStateInfo = function (newState, newParams) {\n\t var state = $state.get(newState, stateContext($element));\n\t\n\t states.push({\n\t state: state || { name: newState },\n\t params: newParams\n\t });\n\t\n\t update();\n\t };\n\t\n\t $scope.$on('$stateChangeSuccess', update);\n\t\n\t // Update route state\n\t function update() {\n\t if (anyMatch()) {\n\t $element.addClass(activeClass);\n\t } else {\n\t $element.removeClass(activeClass);\n\t }\n\t }\n\t\n\t function anyMatch() {\n\t for (var i = 0; i < states.length; i++) {\n\t if (isMatch(states[i].state, states[i].params)) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }\n\t\n\t function isMatch(state, params) {\n\t if (typeof $attrs.uiSrefActiveEq !== 'undefined') {\n\t return $state.is(state.name, params);\n\t } else {\n\t return $state.includes(state.name, params);\n\t }\n\t }\n\t }]\n\t };\n\t}\n\t\n\tangular.module('ui.router.state')\n\t .directive('uiSref', $StateRefDirective)\n\t .directive('uiSrefActive', $StateRefActiveDirective)\n\t .directive('uiSrefActiveEq', $StateRefActiveDirective);\n\t\n\t/**\n\t * @ngdoc filter\n\t * @name ui.router.state.filter:isState\n\t *\n\t * @requires ui.router.state.$state\n\t *\n\t * @description\n\t * Translates to {@link ui.router.state.$state#methods_is $state.is(\"stateName\")}.\n\t */\n\t$IsStateFilter.$inject = ['$state'];\n\tfunction $IsStateFilter($state) {\n\t var isFilter = function (state) {\n\t return $state.is(state);\n\t };\n\t isFilter.$stateful = true;\n\t return isFilter;\n\t}\n\t\n\t/**\n\t * @ngdoc filter\n\t * @name ui.router.state.filter:includedByState\n\t *\n\t * @requires ui.router.state.$state\n\t *\n\t * @description\n\t * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.\n\t */\n\t$IncludedByStateFilter.$inject = ['$state'];\n\tfunction $IncludedByStateFilter($state) {\n\t var includesFilter = function (state) {\n\t return $state.includes(state);\n\t };\n\t includesFilter.$stateful = true;\n\t return includesFilter;\n\t}\n\t\n\tangular.module('ui.router.state')\n\t .filter('isState', $IsStateFilter)\n\t .filter('includedByState', $IncludedByStateFilter);\n\t})(window, window.angular);\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tvar _MenuMenu = __webpack_require__(17);\n\t\n\tvar _MenuMenu2 = _interopRequireDefault(_MenuMenu);\n\t\n\tvar _Collection = __webpack_require__(11);\n\t\n\tvar _Collection2 = _interopRequireDefault(_Collection);\n\t\n\tvar _Dashboard = __webpack_require__(12);\n\t\n\tvar _Dashboard2 = _interopRequireDefault(_Dashboard);\n\t\n\tvar _UtilsOrderElement = __webpack_require__(21);\n\t\n\tvar _UtilsOrderElement2 = _interopRequireDefault(_UtilsOrderElement);\n\t\n\tvar Application = (function () {\n\t function Application() {\n\t var title = arguments.length <= 0 || arguments[0] === undefined ? 'ng-admin' : arguments[0];\n\t var debug = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1];\n\t\n\t _classCallCheck(this, Application);\n\t\n\t this._baseApiUrl = '';\n\t this._customTemplate = function (viewName) {};\n\t this._title = title;\n\t this._menu = null;\n\t this._dashboard = null;\n\t this._layout = false;\n\t this._header = false;\n\t this._entities = [];\n\t this._errorMessage = this.defaultErrorMessage;\n\t this._debug = debug;\n\t }\n\t\n\t _createClass(Application, [{\n\t key: 'defaultErrorMessage',\n\t value: function defaultErrorMessage(response) {\n\t var body = response.data;\n\t\n\t if (typeof body === 'object') {\n\t body = JSON.stringify(body);\n\t }\n\t\n\t return 'Oops, an error occured : (code: ' + response.status + ') ' + body;\n\t }\n\t }, {\n\t key: 'getViewsOfType',\n\t value: function getViewsOfType(type) {\n\t return _UtilsOrderElement2['default'].order(this.entities.map(function (entity) {\n\t return entity.views[type];\n\t }).filter(function (view) {\n\t return view.enabled;\n\t }));\n\t }\n\t }, {\n\t key: 'getRouteFor',\n\t value: function getRouteFor(entity, viewUrl, viewType, identifierValue, identifierName) {\n\t var baseApiUrl = entity.baseApiUrl() || this.baseApiUrl(),\n\t url = viewUrl || entity.getUrl(viewType, identifierValue, identifierName);\n\t\n\t // If the view or the entity don't define the url, retrieve it from the baseURL of the entity or the app\n\t if (!url) {\n\t url = baseApiUrl + entity.name();\n\t if (identifierValue) {\n\t url += '/' + identifierValue;\n\t }\n\t } else if (!/^(?:[a-z]+:)?\\/\\//.test(url)) {\n\t // Add baseUrl for relative URL\n\t url = baseApiUrl + url;\n\t }\n\t\n\t return url;\n\t }\n\t }, {\n\t key: 'debug',\n\t value: function debug(_debug) {\n\t if (!arguments.length) return this._debug;\n\t this._debug = _debug;\n\t return this;\n\t }\n\t }, {\n\t key: 'layout',\n\t value: function layout(_layout) {\n\t if (!arguments.length) return this._layout;\n\t this._layout = _layout;\n\t return this;\n\t }\n\t }, {\n\t key: 'header',\n\t value: function header(_header) {\n\t if (!arguments.length) return this._header;\n\t this._header = _header;\n\t return this;\n\t }\n\t }, {\n\t key: 'title',\n\t value: function title(_title) {\n\t if (!arguments.length) return this._title;\n\t this._title = _title;\n\t return this;\n\t }\n\t\n\t /**\n\t * Getter/Setter for the main application menu\n\t *\n\t * If the getter is called first, it will return a menu based on entities.\n\t *\n\t * application.addEntity(new Entity('posts'));\n\t * application.addEntity(new Entity('comments'));\n\t * application.menu(); // Menu { children: [ Menu { title: \"Posts\" }, Menu { title: \"Comments\" } ]}\n\t *\n\t * If the setter is called first, all subsequent calls to the getter will return the set menu.\n\t *\n\t * application.addEntity(new Entity('posts'));\n\t * application.addEntity(new Entity('comments'));\n\t * application.menu(new Menu().addChild(new Menu().title('Foo')));\n\t * application.menu(); // Menu { children: [ Menu { title: \"Foo\" } ]}\n\t *\n\t * @see Menu\n\t */\n\t }, {\n\t key: 'menu',\n\t value: function menu(_menu) {\n\t if (!arguments.length) {\n\t if (!this._menu) {\n\t this._menu = this.buildMenuFromEntities();\n\t }\n\t return this._menu;\n\t }\n\t\n\t this._menu = _menu;\n\t return this;\n\t }\n\t }, {\n\t key: 'buildMenuFromEntities',\n\t value: function buildMenuFromEntities() {\n\t return new _MenuMenu2['default']().children(this.entities.filter(function (entity) {\n\t return entity.menuView().enabled;\n\t }).sort(function (e1, e2) {\n\t return e1.menuView().order() - e2.menuView().order();\n\t }).map(function (entity) {\n\t return new _MenuMenu2['default']().populateFromEntity(entity);\n\t }));\n\t }\n\t }, {\n\t key: 'dashboard',\n\t value: function dashboard(_dashboard) {\n\t if (!arguments.length) {\n\t if (!this._dashboard) {\n\t this._dashboard = this.buildDashboardFromEntities();\n\t }\n\t return this._dashboard;\n\t }\n\t this._dashboard = _dashboard;\n\t return this;\n\t }\n\t }, {\n\t key: 'buildDashboardFromEntities',\n\t value: function buildDashboardFromEntities() {\n\t var dashboard = new _Dashboard2['default']();\n\t this.entities.filter(function (entity) {\n\t return entity.dashboardView().enabled;\n\t }).map(function (entity) {\n\t dashboard.addCollection(entity.dashboardView()); // yep, a collection is a ListView, and so is a DashboardView - forgive this duck typing for BC sake\n\t });\n\t if (!dashboard.hasCollections()) {\n\t // still no collection from dashboardViews, let's use listViews instead\n\t this.entities.filter(function (entity) {\n\t return entity.listView().enabled;\n\t }).map(function (entity, index) {\n\t var collection = new _Collection2['default']();\n\t var listView = entity.listView();\n\t collection.setEntity(entity);\n\t collection.perPage(listView.perPage());\n\t collection.sortField(listView.sortField());\n\t collection.sortDir(listView.sortDir());\n\t collection.order(index);\n\t // use only the first 3 cols\n\t collection.fields(listView.fields().filter(function (el, index) {\n\t return index < 3;\n\t }));\n\t dashboard.addCollection(collection);\n\t });\n\t }\n\t return dashboard;\n\t }\n\t }, {\n\t key: 'customTemplate',\n\t value: function customTemplate(_customTemplate) {\n\t if (!arguments.length) return this._customTemplate;\n\t this._customTemplate = _customTemplate;\n\t return this;\n\t }\n\t }, {\n\t key: 'baseApiUrl',\n\t value: function baseApiUrl(url) {\n\t if (!arguments.length) return this._baseApiUrl;\n\t this._baseApiUrl = url;\n\t return this;\n\t }\n\t }, {\n\t key: 'addEntity',\n\t value: function addEntity(entity) {\n\t if (!entity) {\n\t throw new Error(\"No entity given\");\n\t }\n\t\n\t this._entities.push(entity);\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'getEntity',\n\t value: function getEntity(entityName) {\n\t var foundEntity = this._entities.filter(function (e) {\n\t return e.name() === entityName;\n\t })[0];\n\t if (!foundEntity) {\n\t throw new Error('Unable to find entity \"' + entityName + '\"');\n\t }\n\t\n\t return foundEntity;\n\t }\n\t }, {\n\t key: 'hasEntity',\n\t value: function hasEntity(fieldName) {\n\t return !!this._entities.filter(function (f) {\n\t return f.name() === fieldName;\n\t }).length;\n\t }\n\t }, {\n\t key: 'getViewByEntityAndType',\n\t value: function getViewByEntityAndType(entityName, type) {\n\t return this._entities.filter(function (e) {\n\t return e.name() === entityName;\n\t })[0].views[type];\n\t }\n\t }, {\n\t key: 'getErrorMessage',\n\t value: function getErrorMessage(response) {\n\t if (typeof this._errorMessage === 'function') {\n\t return this._errorMessage(response);\n\t }\n\t\n\t return this._errorMessage;\n\t }\n\t }, {\n\t key: 'errorMessage',\n\t value: function errorMessage(_errorMessage) {\n\t if (!arguments.length) return this._errorMessage;\n\t this._errorMessage = _errorMessage;\n\t return this;\n\t }\n\t }, {\n\t key: 'getErrorMessageFor',\n\t value: function getErrorMessageFor(view, response) {\n\t return view.getErrorMessage(response) || view.getEntity().getErrorMessage(response) || this.getErrorMessage(response);\n\t }\n\t }, {\n\t key: 'getEntityNames',\n\t value: function getEntityNames() {\n\t return this.entities.map(function (f) {\n\t return f.name();\n\t });\n\t }\n\t }, {\n\t key: 'entities',\n\t get: function get() {\n\t return this._entities;\n\t }\n\t }]);\n\t\n\t return Application;\n\t})();\n\t\n\texports['default'] = Application;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tvar _Application = __webpack_require__(26);\n\t\n\tvar _Application2 = _interopRequireDefault(_Application);\n\t\n\tvar _EntityEntity = __webpack_require__(14);\n\t\n\tvar _EntityEntity2 = _interopRequireDefault(_EntityEntity);\n\t\n\tvar _DataStoreDataStore = __webpack_require__(13);\n\t\n\tvar _DataStoreDataStore2 = _interopRequireDefault(_DataStoreDataStore);\n\t\n\tvar _UtilsPromisesResolver = __webpack_require__(43);\n\t\n\tvar _UtilsPromisesResolver2 = _interopRequireDefault(_UtilsPromisesResolver);\n\t\n\tvar _QueriesReadQueries = __webpack_require__(41);\n\t\n\tvar _QueriesReadQueries2 = _interopRequireDefault(_QueriesReadQueries);\n\t\n\tvar _QueriesWriteQueries = __webpack_require__(42);\n\t\n\tvar _QueriesWriteQueries2 = _interopRequireDefault(_QueriesWriteQueries);\n\t\n\tvar _FieldField = __webpack_require__(1);\n\t\n\tvar _FieldField2 = _interopRequireDefault(_FieldField);\n\t\n\tvar _FieldBooleanField = __webpack_require__(28);\n\t\n\tvar _FieldBooleanField2 = _interopRequireDefault(_FieldBooleanField);\n\t\n\tvar _FieldChoiceField = __webpack_require__(7);\n\t\n\tvar _FieldChoiceField2 = _interopRequireDefault(_FieldChoiceField);\n\t\n\tvar _FieldChoicesField = __webpack_require__(29);\n\t\n\tvar _FieldChoicesField2 = _interopRequireDefault(_FieldChoicesField);\n\t\n\tvar _FieldDateField = __webpack_require__(15);\n\t\n\tvar _FieldDateField2 = _interopRequireDefault(_FieldDateField);\n\t\n\tvar _FieldDateTimeField = __webpack_require__(30);\n\t\n\tvar _FieldDateTimeField2 = _interopRequireDefault(_FieldDateTimeField);\n\t\n\tvar _FieldEmailField = __webpack_require__(31);\n\t\n\tvar _FieldEmailField2 = _interopRequireDefault(_FieldEmailField);\n\t\n\tvar _FieldFloatFieldJs = __webpack_require__(33);\n\t\n\tvar _FieldFloatFieldJs2 = _interopRequireDefault(_FieldFloatFieldJs);\n\t\n\tvar _FieldFileField = __webpack_require__(32);\n\t\n\tvar _FieldFileField2 = _interopRequireDefault(_FieldFileField);\n\t\n\tvar _FieldJsonField = __webpack_require__(34);\n\t\n\tvar _FieldJsonField2 = _interopRequireDefault(_FieldJsonField);\n\t\n\tvar _FieldNumberField = __webpack_require__(16);\n\t\n\tvar _FieldNumberField2 = _interopRequireDefault(_FieldNumberField);\n\t\n\tvar _FieldPasswordField = __webpack_require__(35);\n\t\n\tvar _FieldPasswordField2 = _interopRequireDefault(_FieldPasswordField);\n\t\n\tvar _FieldReferenceField = __webpack_require__(8);\n\t\n\tvar _FieldReferenceField2 = _interopRequireDefault(_FieldReferenceField);\n\t\n\tvar _FieldReferencedListField = __webpack_require__(37);\n\t\n\tvar _FieldReferencedListField2 = _interopRequireDefault(_FieldReferencedListField);\n\t\n\tvar _FieldReferenceManyField = __webpack_require__(36);\n\t\n\tvar _FieldReferenceManyField2 = _interopRequireDefault(_FieldReferenceManyField);\n\t\n\tvar _FieldTemplateField = __webpack_require__(38);\n\t\n\tvar _FieldTemplateField2 = _interopRequireDefault(_FieldTemplateField);\n\t\n\tvar _FieldTextField = __webpack_require__(39);\n\t\n\tvar _FieldTextField2 = _interopRequireDefault(_FieldTextField);\n\t\n\tvar _FieldWysiwygField = __webpack_require__(40);\n\t\n\tvar _FieldWysiwygField2 = _interopRequireDefault(_FieldWysiwygField);\n\t\n\tvar _MenuMenu = __webpack_require__(17);\n\t\n\tvar _MenuMenu2 = _interopRequireDefault(_MenuMenu);\n\t\n\tvar _Collection = __webpack_require__(11);\n\t\n\tvar _Collection2 = _interopRequireDefault(_Collection);\n\t\n\tvar _Dashboard = __webpack_require__(12);\n\t\n\tvar _Dashboard2 = _interopRequireDefault(_Dashboard);\n\t\n\tvar _Entry = __webpack_require__(5);\n\t\n\tvar _Entry2 = _interopRequireDefault(_Entry);\n\t\n\tvar Factory = (function () {\n\t function Factory() {\n\t _classCallCheck(this, Factory);\n\t\n\t this._fieldTypes = [];\n\t this._init();\n\t }\n\t\n\t _createClass(Factory, [{\n\t key: \"application\",\n\t value: function application(name, baseApiUrl) {\n\t return new _Application2[\"default\"](name, baseApiUrl);\n\t }\n\t }, {\n\t key: \"entity\",\n\t value: function entity(name) {\n\t return new _EntityEntity2[\"default\"](name);\n\t }\n\t }, {\n\t key: \"field\",\n\t value: function field(name, type) {\n\t type = type || 'string';\n\t\n\t if (!(type in this._fieldTypes)) {\n\t throw new Error(\"Unknown field type \\\"\" + type + \"\\\".\");\n\t }\n\t\n\t return new this._fieldTypes[type](name);\n\t }\n\t }, {\n\t key: \"registerFieldType\",\n\t value: function registerFieldType(name, constructor) {\n\t this._fieldTypes[name] = constructor;\n\t }\n\t }, {\n\t key: \"getFieldConstructor\",\n\t value: function getFieldConstructor(name) {\n\t return this._fieldTypes[name];\n\t }\n\t }, {\n\t key: \"menu\",\n\t value: function menu(entity) {\n\t var menu = new _MenuMenu2[\"default\"]();\n\t if (entity) {\n\t menu.populateFromEntity(entity);\n\t }\n\t return menu;\n\t }\n\t }, {\n\t key: \"dashboard\",\n\t value: function dashboard() {\n\t return new _Dashboard2[\"default\"]();\n\t }\n\t }, {\n\t key: \"collection\",\n\t value: function collection(entity) {\n\t var collection = new _Collection2[\"default\"]();\n\t if (entity) {\n\t collection.setEntity(entity);\n\t }\n\t return collection;\n\t }\n\t }, {\n\t key: \"getEntryConstructor\",\n\t value: function getEntryConstructor() {\n\t return _Entry2[\"default\"];\n\t }\n\t }, {\n\t key: \"getDataStore\",\n\t value: function getDataStore() {\n\t return new _DataStoreDataStore2[\"default\"]();\n\t }\n\t }, {\n\t key: \"getReadQueries\",\n\t value: function getReadQueries(RestWrapper, PromisesResolver, Application) {\n\t return new _QueriesReadQueries2[\"default\"](RestWrapper, PromisesResolver, Application);\n\t }\n\t }, {\n\t key: \"getWriteQueries\",\n\t value: function getWriteQueries(RestWrapper, PromisesResolver, Application) {\n\t return new _QueriesWriteQueries2[\"default\"](RestWrapper, PromisesResolver, Application);\n\t }\n\t }, {\n\t key: \"getPromisesResolver\",\n\t value: function getPromisesResolver() {\n\t return _UtilsPromisesResolver2[\"default\"];\n\t }\n\t }, {\n\t key: \"_init\",\n\t value: function _init() {\n\t this.registerFieldType('boolean', _FieldBooleanField2[\"default\"]);\n\t this.registerFieldType('choice', _FieldChoiceField2[\"default\"]);\n\t this.registerFieldType('choices', _FieldChoicesField2[\"default\"]);\n\t this.registerFieldType('date', _FieldDateField2[\"default\"]);\n\t this.registerFieldType('datetime', _FieldDateTimeField2[\"default\"]);\n\t this.registerFieldType('email', _FieldEmailField2[\"default\"]);\n\t this.registerFieldType('float', _FieldFloatFieldJs2[\"default\"]);\n\t this.registerFieldType('string', _FieldField2[\"default\"]);\n\t this.registerFieldType('file', _FieldFileField2[\"default\"]);\n\t this.registerFieldType('json', _FieldJsonField2[\"default\"]);\n\t this.registerFieldType('number', _FieldNumberField2[\"default\"]);\n\t this.registerFieldType('password', _FieldPasswordField2[\"default\"]);\n\t this.registerFieldType('reference', _FieldReferenceField2[\"default\"]);\n\t this.registerFieldType('reference_many', _FieldReferenceManyField2[\"default\"]);\n\t this.registerFieldType('referenced_list', _FieldReferencedListField2[\"default\"]);\n\t this.registerFieldType('template', _FieldTemplateField2[\"default\"]);\n\t this.registerFieldType('text', _FieldTextField2[\"default\"]);\n\t this.registerFieldType('wysiwyg', _FieldWysiwygField2[\"default\"]);\n\t }\n\t }]);\n\t\n\t return Factory;\n\t})();\n\t\n\texports[\"default\"] = Factory;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _ChoiceField2 = __webpack_require__(7);\n\t\n\tvar _ChoiceField3 = _interopRequireDefault(_ChoiceField2);\n\t\n\tvar BooleanField = (function (_ChoiceField) {\n\t _inherits(BooleanField, _ChoiceField);\n\t\n\t function BooleanField(name) {\n\t _classCallCheck(this, BooleanField);\n\t\n\t _get(Object.getPrototypeOf(BooleanField.prototype), \"constructor\", this).call(this, name);\n\t this._type = \"boolean\";\n\t this._choices = [{ value: null, label: 'undefined' }, { value: true, label: 'true' }, { value: false, label: 'false' }];\n\t }\n\t\n\t return BooleanField;\n\t})(_ChoiceField3[\"default\"]);\n\t\n\texports[\"default\"] = BooleanField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 29 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _ChoiceField2 = __webpack_require__(7);\n\t\n\tvar _ChoiceField3 = _interopRequireDefault(_ChoiceField2);\n\t\n\tvar ChoicesField = (function (_ChoiceField) {\n\t _inherits(ChoicesField, _ChoiceField);\n\t\n\t function ChoicesField(name) {\n\t _classCallCheck(this, ChoicesField);\n\t\n\t _get(Object.getPrototypeOf(ChoicesField.prototype), \"constructor\", this).call(this, name);\n\t this._type = \"choices\";\n\t }\n\t\n\t return ChoicesField;\n\t})(_ChoiceField3[\"default\"]);\n\t\n\texports[\"default\"] = ChoicesField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 30 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _DateField2 = __webpack_require__(15);\n\t\n\tvar _DateField3 = _interopRequireDefault(_DateField2);\n\t\n\tvar DateTimeField = (function (_DateField) {\n\t _inherits(DateTimeField, _DateField);\n\t\n\t function DateTimeField(name) {\n\t _classCallCheck(this, DateTimeField);\n\t\n\t _get(Object.getPrototypeOf(DateTimeField.prototype), \"constructor\", this).call(this, name);\n\t\n\t this._format = null;\n\t this._parse = function (date) {\n\t return date;\n\t };\n\t\n\t this._type = 'datetime';\n\t }\n\t\n\t return DateTimeField;\n\t})(_DateField3[\"default\"]);\n\t\n\texports[\"default\"] = DateTimeField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Field2 = __webpack_require__(1);\n\t\n\tvar _Field3 = _interopRequireDefault(_Field2);\n\t\n\tvar EmailField = (function (_Field) {\n\t _inherits(EmailField, _Field);\n\t\n\t function EmailField(name) {\n\t _classCallCheck(this, EmailField);\n\t\n\t _get(Object.getPrototypeOf(EmailField.prototype), \"constructor\", this).call(this, name);\n\t this._type = \"email\";\n\t }\n\t\n\t return EmailField;\n\t})(_Field3[\"default\"]);\n\t\n\texports[\"default\"] = EmailField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 32 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Field2 = __webpack_require__(1);\n\t\n\tvar _Field3 = _interopRequireDefault(_Field2);\n\t\n\tvar FileField = (function (_Field) {\n\t _inherits(FileField, _Field);\n\t\n\t function FileField(name) {\n\t _classCallCheck(this, FileField);\n\t\n\t _get(Object.getPrototypeOf(FileField.prototype), \"constructor\", this).call(this, name);\n\t this._type = \"file\";\n\t this._uploadInformation = {\n\t url: '/upload',\n\t accept: '*'\n\t };\n\t }\n\t\n\t _createClass(FileField, [{\n\t key: \"uploadInformation\",\n\t value: function uploadInformation(information) {\n\t if (!arguments.length) return this._uploadInformation;\n\t this._uploadInformation = information;\n\t return this;\n\t }\n\t }]);\n\t\n\t return FileField;\n\t})(_Field3[\"default\"]);\n\t\n\texports[\"default\"] = FileField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 33 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _NumberField2 = __webpack_require__(16);\n\t\n\tvar _NumberField3 = _interopRequireDefault(_NumberField2);\n\t\n\tvar FloatField = (function (_NumberField) {\n\t _inherits(FloatField, _NumberField);\n\t\n\t function FloatField(name) {\n\t _classCallCheck(this, FloatField);\n\t\n\t _get(Object.getPrototypeOf(FloatField.prototype), 'constructor', this).call(this, name);\n\t this._type = 'float';\n\t this._format = '0.000';\n\t }\n\t\n\t return FloatField;\n\t})(_NumberField3['default']);\n\t\n\texports['default'] = FloatField;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Field2 = __webpack_require__(1);\n\t\n\tvar _Field3 = _interopRequireDefault(_Field2);\n\t\n\tvar JsonField = (function (_Field) {\n\t _inherits(JsonField, _Field);\n\t\n\t function JsonField(name) {\n\t _classCallCheck(this, JsonField);\n\t\n\t _get(Object.getPrototypeOf(JsonField.prototype), \"constructor\", this).call(this, name);\n\t this._type = \"json\";\n\t this._flattenable = false;\n\t }\n\t\n\t return JsonField;\n\t})(_Field3[\"default\"]);\n\t\n\texports[\"default\"] = JsonField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 35 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Field2 = __webpack_require__(1);\n\t\n\tvar _Field3 = _interopRequireDefault(_Field2);\n\t\n\tvar PasswordField = (function (_Field) {\n\t _inherits(PasswordField, _Field);\n\t\n\t function PasswordField(name) {\n\t _classCallCheck(this, PasswordField);\n\t\n\t _get(Object.getPrototypeOf(PasswordField.prototype), \"constructor\", this).call(this, name);\n\t this._type = \"password\";\n\t }\n\t\n\t return PasswordField;\n\t})(_Field3[\"default\"]);\n\t\n\texports[\"default\"] = PasswordField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 36 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _ReferenceField2 = __webpack_require__(8);\n\t\n\tvar _ReferenceField3 = _interopRequireDefault(_ReferenceField2);\n\t\n\tvar ReferenceManyField = (function (_ReferenceField) {\n\t _inherits(ReferenceManyField, _ReferenceField);\n\t\n\t function ReferenceManyField(name) {\n\t _classCallCheck(this, ReferenceManyField);\n\t\n\t _get(Object.getPrototypeOf(ReferenceManyField.prototype), \"constructor\", this).call(this, name);\n\t this._type = 'reference_many';\n\t }\n\t\n\t return ReferenceManyField;\n\t})(_ReferenceField3[\"default\"]);\n\t\n\texports[\"default\"] = ReferenceManyField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 37 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _ReferenceField2 = __webpack_require__(8);\n\t\n\tvar _ReferenceField3 = _interopRequireDefault(_ReferenceField2);\n\t\n\tvar _UtilsReferenceExtractor = __webpack_require__(19);\n\t\n\tvar _UtilsReferenceExtractor2 = _interopRequireDefault(_UtilsReferenceExtractor);\n\t\n\tvar ReferencedListField = (function (_ReferenceField) {\n\t _inherits(ReferencedListField, _ReferenceField);\n\t\n\t function ReferencedListField(name) {\n\t _classCallCheck(this, ReferencedListField);\n\t\n\t _get(Object.getPrototypeOf(ReferencedListField.prototype), 'constructor', this).call(this, name);\n\t this._type = 'referenced_list';\n\t this._targetReferenceField = null;\n\t this._targetFields = [];\n\t this._detailLink = false;\n\t this._listActions = [];\n\t }\n\t\n\t _createClass(ReferencedListField, [{\n\t key: 'targetReferenceField',\n\t value: function targetReferenceField(value) {\n\t if (!arguments.length) return this._targetReferenceField;\n\t this._targetReferenceField = value;\n\t return this;\n\t }\n\t }, {\n\t key: 'targetFields',\n\t value: function targetFields(value) {\n\t if (!arguments.length) return this._targetFields;\n\t this._targetFields = value;\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'getGridColumns',\n\t value: function getGridColumns() {\n\t var columns = [];\n\t for (var i = 0, l = this._targetFields.length; i < l; i++) {\n\t var field = this._targetFields[i];\n\t columns.push({\n\t field: field,\n\t label: field.label()\n\t });\n\t }\n\t\n\t return columns;\n\t }\n\t }, {\n\t key: 'getSortFieldName',\n\t value: function getSortFieldName() {\n\t if (!this.sortField()) {\n\t return null;\n\t }\n\t\n\t return this._targetEntity.name() + '_ListView.' + this.sortField();\n\t }\n\t }, {\n\t key: 'listActions',\n\t value: function listActions(actions) {\n\t if (!arguments.length) {\n\t return this._listActions;\n\t }\n\t\n\t this._listActions = actions;\n\t\n\t return this;\n\t }\n\t }, {\n\t key: 'getReferences',\n\t value: function getReferences(withRemoteComplete) {\n\t return _UtilsReferenceExtractor2['default'].getReferences(this._targetFields, withRemoteComplete);\n\t }\n\t }, {\n\t key: 'getNonOptimizedReferences',\n\t value: function getNonOptimizedReferences(withRemoteComplete) {\n\t return _UtilsReferenceExtractor2['default'].getNonOptimizedReferences(this._targetFields, withRemoteComplete);\n\t }\n\t }, {\n\t key: 'getOptimizedReferences',\n\t value: function getOptimizedReferences(withRemoteComplete) {\n\t return _UtilsReferenceExtractor2['default'].getOptimizedReferences(this._targetFields, withRemoteComplete);\n\t }\n\t }]);\n\t\n\t return ReferencedListField;\n\t})(_ReferenceField3['default']);\n\t\n\texports['default'] = ReferencedListField;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 38 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Field2 = __webpack_require__(1);\n\t\n\tvar _Field3 = _interopRequireDefault(_Field2);\n\t\n\tvar TemplateField = (function (_Field) {\n\t _inherits(TemplateField, _Field);\n\t\n\t function TemplateField(name) {\n\t _classCallCheck(this, TemplateField);\n\t\n\t _get(Object.getPrototypeOf(TemplateField.prototype), \"constructor\", this).call(this, name);\n\t this._template = function () {\n\t return '';\n\t };\n\t this._type = \"template\";\n\t }\n\t\n\t _createClass(TemplateField, [{\n\t key: \"getTemplateValue\",\n\t value: function getTemplateValue(data) {\n\t if (typeof this._template === 'function') {\n\t return this._template(data);\n\t }\n\t\n\t return this._template;\n\t }\n\t }, {\n\t key: \"template\",\n\t value: function template(_template) {\n\t if (!arguments.length) return this._template;\n\t this._template = _template;\n\t return this;\n\t }\n\t }]);\n\t\n\t return TemplateField;\n\t})(_Field3[\"default\"]);\n\t\n\texports[\"default\"] = TemplateField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 39 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Field2 = __webpack_require__(1);\n\t\n\tvar _Field3 = _interopRequireDefault(_Field2);\n\t\n\tvar TextField = (function (_Field) {\n\t _inherits(TextField, _Field);\n\t\n\t function TextField(name) {\n\t _classCallCheck(this, TextField);\n\t\n\t _get(Object.getPrototypeOf(TextField.prototype), \"constructor\", this).call(this, name);\n\t this._type = \"text\";\n\t }\n\t\n\t return TextField;\n\t})(_Field3[\"default\"]);\n\t\n\texports[\"default\"] = TextField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 40 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Field2 = __webpack_require__(1);\n\t\n\tvar _Field3 = _interopRequireDefault(_Field2);\n\t\n\tvar WysiwygField = (function (_Field) {\n\t _inherits(WysiwygField, _Field);\n\t\n\t function WysiwygField(name) {\n\t _classCallCheck(this, WysiwygField);\n\t\n\t _get(Object.getPrototypeOf(WysiwygField.prototype), \"constructor\", this).call(this, name);\n\t this._type = \"wysiwyg\";\n\t this._stripTags = false;\n\t this._sanitize = true;\n\t }\n\t\n\t _createClass(WysiwygField, [{\n\t key: \"stripTags\",\n\t value: function stripTags(value) {\n\t if (!arguments.length) return this._stripTags;\n\t this._stripTags = value;\n\t return this;\n\t }\n\t }, {\n\t key: \"sanitize\",\n\t value: function sanitize(value) {\n\t if (!arguments.length) return this._sanitize;\n\t this._sanitize = value;\n\t return this;\n\t }\n\t }]);\n\t\n\t return WysiwygField;\n\t})(_Field3[\"default\"]);\n\t\n\texports[\"default\"] = WysiwygField;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 41 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Queries2 = __webpack_require__(18);\n\t\n\tvar _Queries3 = _interopRequireDefault(_Queries2);\n\t\n\tvar ReadQueries = (function (_Queries) {\n\t _inherits(ReadQueries, _Queries);\n\t\n\t function ReadQueries() {\n\t _classCallCheck(this, ReadQueries);\n\t\n\t _get(Object.getPrototypeOf(ReadQueries.prototype), 'constructor', this).apply(this, arguments);\n\t }\n\t\n\t _createClass(ReadQueries, [{\n\t key: 'getOne',\n\t\n\t /**\n\t * Get one entity\n\t *\n\t * @param {Entity} entity\n\t * @param {String} viewType\n\t * @param {mixed} identifierValue\n\t * @param {String} identifierName\n\t * @param {String} url\n\t *\n\t * @returns {promise} (list of fields (with their values if set) & the entity name, label & id-\n\t */\n\t value: function getOne(entity, viewType, identifierValue, identifierName, url) {\n\t return this._restWrapper.getOne(entity.name(), this._application.getRouteFor(entity, url, viewType, identifierValue, identifierName), entity.retrieveMethod());\n\t }\n\t\n\t /**\n\t * Return the list of all object of entityName type\n\t * Get all the object from the API\n\t *\n\t * @param {ListView} view the view associated to the entity\n\t * @param {Number} page the page number\n\t * @param {Object} filterValues searchQuery to filter elements\n\t * @param {String} sortField the field to be sorted ex: entity.fieldName\n\t * @param {String} sortDir the direction of the sort\n\t *\n\t * @returns {promise} the entity config & the list of objects\n\t */\n\t }, {\n\t key: 'getAll',\n\t value: function getAll(view, page, filterValues, sortField, sortDir) {\n\t page = page || 1;\n\t filterValues = filterValues || {};\n\t var url = view.getUrl();\n\t\n\t if (sortField && sortField.split('.')[0] === view.name()) {\n\t sortField = sortField;\n\t sortDir = sortDir;\n\t } else {\n\t sortField = view.getSortFieldName();\n\t sortDir = view.sortDir();\n\t }\n\t\n\t var allFilterValues = {};\n\t var permanentFilters = view.permanentFilters();\n\t Object.keys(filterValues).forEach(function (key) {\n\t allFilterValues[key] = filterValues[key];\n\t });\n\t Object.keys(permanentFilters).forEach(function (key) {\n\t allFilterValues[key] = permanentFilters[key];\n\t });\n\t\n\t return this.getRawValues(view.entity, view.name(), view.type, page, view.perPage(), allFilterValues, view.filters(), sortField, sortDir, url).then(function (values) {\n\t return {\n\t data: values.data,\n\t totalItems: values.totalCount || values.headers('X-Total-Count') || values.data.length\n\t };\n\t });\n\t }\n\t\n\t /**\n\t * Return the list of all object of entityName type\n\t * Get all the object from the API\n\t *\n\t * @param {Entity} entity\n\t * @param {String} viewName\n\t * @param {String} viewType\n\t * @param {Number} page\n\t * @param {Number} perPage\n\t * @param {Object} filterValues\n\t * @param {Object} filterFields\n\t * @param {String} sortField\n\t * @param {String} sortDir\n\t * @param {String} url\n\t *\n\t * @returns {promise} the entity config & the list of objects\n\t */\n\t }, {\n\t key: 'getRawValues',\n\t value: function getRawValues(entity, viewName, viewType, page, perPage, filterValues, filterFields, sortField, sortDir, url) {\n\t var params = {};\n\t\n\t // Compute pagination\n\t if (page !== -1) {\n\t params._page = typeof page === 'undefined' ? 1 : parseInt(page, 10);\n\t params._perPage = perPage;\n\t }\n\t\n\t // Compute sorting\n\t if (sortField && sortField.split('.')[0] === viewName) {\n\t params._sortField = sortField.split('.')[1];\n\t params._sortDir = sortDir;\n\t }\n\t\n\t // Compute filtering\n\t if (filterValues && Object.keys(filterValues).length !== 0) {\n\t (function () {\n\t params._filters = {};\n\t var filterName = undefined,\n\t mappedValue = undefined;\n\t for (filterName in filterValues) {\n\t if (filterFields.hasOwnProperty(filterName) && filterFields[filterName].hasMaps()) {\n\t mappedValue = filterFields[filterName].getMappedValue(filterValues[filterName]);\n\t Object.keys(mappedValue).forEach(function (key) {\n\t params._filters[key] = mappedValue[key];\n\t });\n\t continue;\n\t }\n\t\n\t // It's weird to not map, but why not.\n\t params._filters[filterName] = filterValues[filterName];\n\t }\n\t })();\n\t }\n\t\n\t // Get grid data\n\t return this._restWrapper.getList(params, entity.name(), this._application.getRouteFor(entity, url, viewType), entity.retrieveMethod());\n\t }\n\t\n\t /**\n\t * Returns all References for an entity with associated values [{targetEntity.identifier: targetLabel}, ...]\n\t * by calling the API for each entries\n\t *\n\t * @param {ReferenceField} references A hash of Reference and ReferenceMany objects\n\t * @param {Array} rawValues\n\t *\n\t * @returns {Promise}\n\t */\n\t }, {\n\t key: 'getFilteredReferenceData',\n\t value: function getFilteredReferenceData(references, rawValues) {\n\t if (!references || !Object.keys(references).length) {\n\t return this._promisesResolver.empty({});\n\t }\n\t\n\t var getOne = this.getOne.bind(this),\n\t calls = [];\n\t\n\t for (var i in references) {\n\t var reference = references[i],\n\t targetEntity = reference.targetEntity(),\n\t identifiers = reference.getIdentifierValues(rawValues);\n\t\n\t for (var k in identifiers) {\n\t calls.push(getOne(targetEntity, 'listView', identifiers[k], reference.name()));\n\t }\n\t }\n\t\n\t return this.fillFilteredReferencedData(calls, references, rawValues);\n\t }\n\t\n\t /**\n\t * Returns all References for an entity with associated values [{targetEntity.identifier: targetLabel}, ...]\n\t * by calling the API once\n\t *\n\t * @param {[ReferenceField]} references A hash of Reference and ReferenceMany objects\n\t * @param {Array} rawValues\n\t *\n\t * @returns {Promise}\n\t */\n\t }, {\n\t key: 'getOptimizedReferencedData',\n\t value: function getOptimizedReferencedData(references, rawValues) {\n\t if (!references || !Object.keys(references).length) {\n\t return this._promisesResolver.empty({});\n\t }\n\t\n\t var getRawValues = this.getRawValues.bind(this),\n\t calls = [];\n\t\n\t for (var i in references) {\n\t var reference = references[i],\n\t targetEntity = reference.targetEntity(),\n\t identifiers = reference.getIdentifierValues(rawValues);\n\t\n\t // Check if we should retrieve values with 1 or multiple requests\n\t var singleCallFilters = reference.getSingleApiCall(identifiers);\n\t calls.push(getRawValues(targetEntity, targetEntity.name() + '_ListView', 'listView', 1, reference.perPage(), singleCallFilters, {}, reference.sortField(), reference.sortDir()));\n\t }\n\t\n\t return this.fillOptimizedReferencedData(calls, references);\n\t }\n\t\n\t /**\n\t * Returns all References for an entity with associated values [{targetEntity.identifier: targetLabel}, ...]\n\t * without filters on an entity\n\t *\n\t * @param {[ReferenceField]} references A hash of Reference and ReferenceMany objects\n\t *\n\t * @returns {Promise}\n\t */\n\t }, {\n\t key: 'getAllReferencedData',\n\t value: function getAllReferencedData(references, search) {\n\t if (!references || !Object.keys(references).length) {\n\t return this._promisesResolver.empty({});\n\t }\n\t\n\t var calls = [],\n\t getRawValues = this.getRawValues.bind(this);\n\t\n\t var _loop = function (i) {\n\t var reference = references[i];\n\t var targetEntity = reference.targetEntity();\n\t\n\t var permanentFilters = reference.permanentFilters();\n\t var filterValues = permanentFilters || {};\n\t\n\t if (typeof permanentFilters === 'function') {\n\t console.warn('Reference.permanentFilters() called with a function is deprecated. Use the searchQuery option for remoteComplete() instead');\n\t filterValues = permanentFilters(search);\n\t }\n\t\n\t if (search) {\n\t // remote complete situation\n\t var options = reference.remoteCompleteOptions();\n\t if (options.searchQuery) {\n\t (function () {\n\t var filterValuesFromRemoteComplete = options.searchQuery(search);\n\t Object.keys(filterValuesFromRemoteComplete).forEach(function (key) {\n\t filterValues[key] = filterValuesFromRemoteComplete[key];\n\t });\n\t })();\n\t } else {\n\t // by default, filter the list by the referenceField name\n\t filterValues[reference.targetField().name()] = search;\n\t }\n\t }\n\t\n\t var filterFields = {};\n\t filterFields[reference.name()] = reference;\n\t\n\t calls.push(getRawValues(targetEntity, targetEntity.name() + '_ListView', 'listView', 1, reference.perPage(), filterValues, filterFields, reference.getSortFieldName(), reference.sortDir()));\n\t };\n\t\n\t for (var i in references) {\n\t _loop(i);\n\t }\n\t\n\t return this.fillOptimizedReferencedData(calls, references);\n\t }\n\t\n\t /**\n\t * Fill all reference entries to return [{targetEntity.identifier: targetLabel}, ...]\n\t *\n\t * @param {[Promise]} apiCalls\n\t * @param {[Reference]} references\n\t * @returns {Promise}\n\t */\n\t }, {\n\t key: 'fillOptimizedReferencedData',\n\t value: function fillOptimizedReferencedData(apiCalls, references) {\n\t return this._promisesResolver.allEvenFailed(apiCalls).then(function (responses) {\n\t if (responses.length === 0) {\n\t return {};\n\t }\n\t\n\t var referencedData = {},\n\t i = 0;\n\t\n\t for (var j in references) {\n\t var reference = references[j],\n\t response = responses[i++];\n\t\n\t // Retrieve entries depending on 1 or many request was done\n\t if (response.status == 'error') {\n\t // the response failed\n\t continue;\n\t }\n\t\n\t referencedData[reference.name()] = response.result.data;\n\t }\n\t\n\t return referencedData;\n\t });\n\t }\n\t\n\t /**\n\t * Fill all reference entries to return [{targetEntity.identifier: targetLabel}, ...]\n\t *\n\t * @param {[Promise]} apiCalls\n\t * @param {[Reference]} references\n\t * @param {[Object]} rawValues\n\t * @returns {Promise}\n\t */\n\t }, {\n\t key: 'fillFilteredReferencedData',\n\t value: function fillFilteredReferencedData(apiCalls, references, rawValues) {\n\t return this._promisesResolver.allEvenFailed(apiCalls).then(function (responses) {\n\t if (responses.length === 0) {\n\t return {};\n\t }\n\t\n\t var referencedData = {},\n\t response = undefined,\n\t i = 0;\n\t\n\t for (var j in references) {\n\t var data = [],\n\t reference = references[j],\n\t identifiers = reference.getIdentifierValues(rawValues);\n\t\n\t for (var k in identifiers) {\n\t response = responses[i++];\n\t if (response.status == 'error') {\n\t // one of the responses failed\n\t continue;\n\t }\n\t data.push(response.result);\n\t }\n\t\n\t if (!data.length) {\n\t continue;\n\t }\n\t\n\t referencedData[reference.name()] = data;\n\t }\n\t\n\t return referencedData;\n\t });\n\t }\n\t\n\t /**\n\t * Returns all ReferencedList for an entity for associated values [{targetEntity.identifier: [targetFields, ...]}}\n\t *\n\t * @param {View} referencedLists\n\t * @param {String} sortField\n\t * @param {String} sortDir\n\t * @param {*} entityId\n\t *\n\t * @returns {promise}\n\t */\n\t }, {\n\t key: 'getReferencedListData',\n\t value: function getReferencedListData(referencedLists, sortField, sortDir, entityId) {\n\t var getRawValues = this.getRawValues.bind(this),\n\t calls = [];\n\t\n\t var _loop2 = function (i) {\n\t var referencedList = referencedLists[i],\n\t targetEntity = referencedList.targetEntity(),\n\t viewName = referencedList.datagridName(),\n\t currentSortField = referencedList.getSortFieldName(),\n\t currentSortDir = referencedList.sortDir(),\n\t filter = {};\n\t\n\t if (sortField && sortField.split('.')[0] === viewName) {\n\t currentSortField = sortField;\n\t currentSortDir = sortDir || 'ASC';\n\t }\n\t\n\t var permanentFilters = referencedList.permanentFilters() || {};\n\t Object.keys(permanentFilters).forEach(function (key) {\n\t filter[key] = permanentFilters[key];\n\t });\n\t filter[referencedList.targetReferenceField()] = entityId;\n\t\n\t calls.push(getRawValues(targetEntity, viewName, 'listView', 1, referencedList.perPage(), filter, {}, currentSortField, currentSortDir));\n\t };\n\t\n\t for (var i in referencedLists) {\n\t _loop2(i);\n\t }\n\t\n\t return this._promisesResolver.allEvenFailed(calls).then(function (responses) {\n\t var j = 0,\n\t entries = {};\n\t\n\t for (var i in referencedLists) {\n\t var response = responses[j++];\n\t if (response.status == 'error') {\n\t // If a response fail, skip it\n\t continue;\n\t }\n\t\n\t entries[i] = response.result.data;\n\t }\n\t\n\t return entries;\n\t });\n\t }\n\t }, {\n\t key: 'getRecordsByIds',\n\t value: function getRecordsByIds(entity, ids) {\n\t var _this = this;\n\t\n\t if (!ids || !ids.length) {\n\t return this._promisesResolver.empty();\n\t }\n\t\n\t var calls = ids.map(function (id) {\n\t return _this.getOne(entity, 'listView', id, entity.identifier().name());\n\t });\n\t\n\t return this._promisesResolver.allEvenFailed(calls).then(function (responses) {\n\t return responses.filter(function (r) {\n\t return r.status != 'error';\n\t }).map(function (r) {\n\t return r.result;\n\t });\n\t });\n\t }\n\t }]);\n\t\n\t return ReadQueries;\n\t})(_Queries3['default']);\n\t\n\texports['default'] = ReadQueries;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 42 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Queries2 = __webpack_require__(18);\n\t\n\tvar _Queries3 = _interopRequireDefault(_Queries2);\n\t\n\tvar WriteQueries = (function (_Queries) {\n\t _inherits(WriteQueries, _Queries);\n\t\n\t function WriteQueries() {\n\t _classCallCheck(this, WriteQueries);\n\t\n\t _get(Object.getPrototypeOf(WriteQueries.prototype), 'constructor', this).apply(this, arguments);\n\t }\n\t\n\t _createClass(WriteQueries, [{\n\t key: 'createOne',\n\t\n\t /**\n\t * Create a new entity\n\t * Post the data to the API to create the new object\n\t *\n\t * @param {View} view the formView related to the entity\n\t * @param {Object} rawEntity the entity's object\n\t *\n\t * @returns {promise} the new object\n\t */\n\t value: function createOne(view, rawEntity) {\n\t return this._restWrapper.createOne(rawEntity, view.entity.name(), this._application.getRouteFor(view.entity, view.getUrl(), view.type), view.entity.createMethod());\n\t }\n\t\n\t /**\n\t * Update an entity\n\t * Put the data to the API to create the new object\n\t *\n\t * @param {View} view the formView related to the entity\n\t * @param {Object} rawEntity the entity's object\n\t * @param {String} originEntityId if entity identifier is modified\n\t *\n\t * @returns {promise} the updated object\n\t */\n\t }, {\n\t key: 'updateOne',\n\t value: function updateOne(view, rawEntity, originEntityId) {\n\t var entityId = originEntityId || rawEntity[view.entity.identifier().name()];\n\t\n\t // Update element data\n\t return this._restWrapper.updateOne(rawEntity, view.entity.name(), this._application.getRouteFor(view.entity, view.getUrl(entityId), view.type, entityId, view.identifier()), view.entity.updateMethod());\n\t }\n\t\n\t /**\n\t * Delete an entity\n\t * Delete the data to the API\n\t *\n\t * @param {String} view the formView related to the entity\n\t * @param {*} entityId the entity's id\n\t *\n\t * @returns {promise}\n\t */\n\t }, {\n\t key: 'deleteOne',\n\t value: function deleteOne(view, entityId) {\n\t return this._restWrapper.deleteOne(view.entity.name(), this._application.getRouteFor(view.entity, view.getUrl(entityId), view.type, entityId, view.identifier()), view.entity.deleteMethod());\n\t }\n\t\n\t /**\n\t * Delete a batch of entity\n\t * Delete the data to the API\n\t *\n\t * @param {String} view the formView related to the entity\n\t * @param {*} entityIds the entities ids\n\t *\n\t * @returns {promise}\n\t */\n\t }, {\n\t key: 'batchDelete',\n\t value: function batchDelete(view, entityIds) {\n\t var deleteOne = this.deleteOne.bind(this);\n\t var promises = entityIds.map(function (id) {\n\t return deleteOne(view, id);\n\t });\n\t\n\t return this._promisesResolver.allEvenFailed(promises);\n\t }\n\t }]);\n\t\n\t return WriteQueries;\n\t})(_Queries3['default']);\n\t\n\texports['default'] = WriteQueries;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 43 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tvar PromisesResolver = (function () {\n\t function PromisesResolver() {\n\t _classCallCheck(this, PromisesResolver);\n\t }\n\t\n\t _createClass(PromisesResolver, null, [{\n\t key: 'empty',\n\t value: function empty(value) {\n\t return new Promise(function (resolve) {\n\t resolve(value);\n\t });\n\t }\n\t }, {\n\t key: 'allEvenFailed',\n\t value: function allEvenFailed(promises) {\n\t if (!Array.isArray(promises)) {\n\t throw Error('allEvenFailed can only handle an array of promises');\n\t }\n\t\n\t return new Promise(function (resolve, reject) {\n\t if (promises.length === 0) {\n\t return resolve([]);\n\t }\n\t\n\t var states = [],\n\t results = [];\n\t\n\t promises.forEach(function (promise, key) {\n\t states[key] = false; // promises are not resolved by default\n\t });\n\t\n\t promises.forEach(function (promise, key) {\n\t function resolveState(result) {\n\t states[key] = true;\n\t results[key] = result; // result may be an error\n\t for (var i in states) {\n\t if (!states[i]) {\n\t return;\n\t }\n\t }\n\t\n\t resolve(results);\n\t }\n\t\n\t function resolveSuccess(result) {\n\t return resolveState({ status: 'success', result: result });\n\t }\n\t\n\t function resolveError(result) {\n\t return resolveState({ status: 'error', error: result });\n\t }\n\t\n\t // whether the promise ends with success or error, consider it done\n\t promise.then(resolveSuccess, resolveError);\n\t });\n\t });\n\t }\n\t }]);\n\t\n\t return PromisesResolver;\n\t})();\n\t\n\texports['default'] = PromisesResolver;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 44 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _View2 = __webpack_require__(2);\n\t\n\tvar _View3 = _interopRequireDefault(_View2);\n\t\n\tvar BatchDeleteView = (function (_View) {\n\t _inherits(BatchDeleteView, _View);\n\t\n\t function BatchDeleteView(name) {\n\t _classCallCheck(this, BatchDeleteView);\n\t\n\t _get(Object.getPrototypeOf(BatchDeleteView.prototype), 'constructor', this).call(this, name);\n\t\n\t this._type = 'BatchDeleteView';\n\t this._enabled = true;\n\t }\n\t\n\t return BatchDeleteView;\n\t})(_View3['default']);\n\t\n\texports['default'] = BatchDeleteView;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 45 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _View2 = __webpack_require__(2);\n\t\n\tvar _View3 = _interopRequireDefault(_View2);\n\t\n\tvar CreateView = (function (_View) {\n\t _inherits(CreateView, _View);\n\t\n\t function CreateView(name) {\n\t _classCallCheck(this, CreateView);\n\t\n\t _get(Object.getPrototypeOf(CreateView.prototype), 'constructor', this).call(this, name);\n\t this._type = 'CreateView';\n\t }\n\t\n\t return CreateView;\n\t})(_View3['default']);\n\t\n\texports['default'] = CreateView;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 46 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _ListView2 = __webpack_require__(6);\n\t\n\tvar _ListView3 = _interopRequireDefault(_ListView2);\n\t\n\tvar DashboardView = (function (_ListView) {\n\t _inherits(DashboardView, _ListView);\n\t\n\t function DashboardView() {\n\t _classCallCheck(this, DashboardView);\n\t\n\t _get(Object.getPrototypeOf(DashboardView.prototype), 'constructor', this).apply(this, arguments);\n\t }\n\t\n\t _createClass(DashboardView, [{\n\t key: 'setEntity',\n\t value: function setEntity(entity) {\n\t this.entity = entity;\n\t if (!this._name) {\n\t this._name = entity.name();\n\t }\n\t return this;\n\t }\n\t }]);\n\t\n\t return DashboardView;\n\t})(_ListView3['default']);\n\t\n\texports['default'] = DashboardView;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 47 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _View2 = __webpack_require__(2);\n\t\n\tvar _View3 = _interopRequireDefault(_View2);\n\t\n\tvar DeleteView = (function (_View) {\n\t _inherits(DeleteView, _View);\n\t\n\t function DeleteView(name) {\n\t _classCallCheck(this, DeleteView);\n\t\n\t _get(Object.getPrototypeOf(DeleteView.prototype), 'constructor', this).call(this, name);\n\t this._type = 'DeleteView';\n\t this._enabled = true;\n\t }\n\t\n\t return DeleteView;\n\t})(_View3['default']);\n\t\n\texports['default'] = DeleteView;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 48 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _View2 = __webpack_require__(2);\n\t\n\tvar _View3 = _interopRequireDefault(_View2);\n\t\n\tvar EditView = (function (_View) {\n\t _inherits(EditView, _View);\n\t\n\t function EditView(name) {\n\t _classCallCheck(this, EditView);\n\t\n\t _get(Object.getPrototypeOf(EditView.prototype), 'constructor', this).call(this, name);\n\t this._type = 'EditView';\n\t }\n\t\n\t return EditView;\n\t})(_View3['default']);\n\t\n\texports['default'] = EditView;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 49 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _ListView2 = __webpack_require__(6);\n\t\n\tvar _ListView3 = _interopRequireDefault(_ListView2);\n\t\n\tvar ExportView = (function (_ListView) {\n\t _inherits(ExportView, _ListView);\n\t\n\t function ExportView(name) {\n\t _classCallCheck(this, ExportView);\n\t\n\t _get(Object.getPrototypeOf(ExportView.prototype), 'constructor', this).call(this, name);\n\t this._fields = [];\n\t this._type = 'ExportView';\n\t }\n\t\n\t return ExportView;\n\t})(_ListView3['default']);\n\t\n\texports['default'] = ExportView;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 50 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _View2 = __webpack_require__(2);\n\t\n\tvar _View3 = _interopRequireDefault(_View2);\n\t\n\tvar MenuView = (function (_View) {\n\t _inherits(MenuView, _View);\n\t\n\t function MenuView(name) {\n\t _classCallCheck(this, MenuView);\n\t\n\t _get(Object.getPrototypeOf(MenuView.prototype), 'constructor', this).call(this, name);\n\t this._type = 'MenuView';\n\t this._icon = null;\n\t }\n\t\n\t _createClass(MenuView, [{\n\t key: 'icon',\n\t value: function icon() {\n\t if (arguments.length) {\n\t console.warn('entity.menuView() is deprecated. Please use the Menu class instead');\n\t this._icon = arguments[0];\n\t return this;\n\t }\n\t\n\t if (this._icon === null) {\n\t return '';\n\t }\n\t\n\t return this._icon;\n\t }\n\t }, {\n\t key: 'enabled',\n\t get: function get() {\n\t return this._enabled || this.entity.views['ListView'].enabled;\n\t }\n\t }]);\n\t\n\t return MenuView;\n\t})(_View3['default']);\n\t\n\texports['default'] = MenuView;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 51 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _View2 = __webpack_require__(2);\n\t\n\tvar _View3 = _interopRequireDefault(_View2);\n\t\n\tvar ShowView = (function (_View) {\n\t _inherits(ShowView, _View);\n\t\n\t function ShowView(name) {\n\t _classCallCheck(this, ShowView);\n\t\n\t _get(Object.getPrototypeOf(ShowView.prototype), 'constructor', this).call(this, name);\n\t this._type = 'ShowView';\n\t }\n\t\n\t return ShowView;\n\t})(_View3['default']);\n\t\n\texports['default'] = ShowView;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 52 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _adminConfigLibFactory = __webpack_require__(27);\n\t\n\tvar _adminConfigLibFactory2 = _interopRequireDefault(_adminConfigLibFactory);\n\t\n\t__webpack_require__(171).polyfill(); // for IE\n\t\n\t__webpack_require__(138);\n\t__webpack_require__(53);\n\t\n\tvar factory = angular.module('AdminDescriptionModule', []);\n\tfactory.constant('AdminDescription', new _adminConfigLibFactory2['default']());\n\t\n\tvar ngadmin = angular.module('ng-admin', ['ui.select', 'main', 'crud', 'AdminDescriptionModule']);\n\tngadmin.config([\"NgAdminConfigurationProvider\", \"AdminDescription\", function (NgAdminConfigurationProvider, AdminDescription) {\n\t NgAdminConfigurationProvider.setAdminDescription(AdminDescription);\n\t}]);\n\t\n\tngadmin.config([\"uiSelectConfig\", function (uiSelectConfig) {\n\t uiSelectConfig.theme = 'bootstrap';\n\t}]);\n\n/***/ },\n/* 53 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar angular = __webpack_require__(4);\n\t\n\tvar CrudModule = angular.module('crud', ['ui.router', 'ui.bootstrap', 'ngSanitize', 'textAngular', 'ngInflection', 'ui.codemirror', 'ngFileUpload', 'ngNumeraljs']);\n\t\n\tCrudModule.controller('ListLayoutController', __webpack_require__(118));\n\tCrudModule.controller('ListController', __webpack_require__(117));\n\tCrudModule.controller('ShowController', __webpack_require__(136));\n\tCrudModule.controller('FormController', __webpack_require__(116));\n\tCrudModule.controller('DeleteController', __webpack_require__(78));\n\tCrudModule.controller('BatchDeleteController', __webpack_require__(77));\n\t\n\tCrudModule.service('EntryFormatter', __webpack_require__(128));\n\tCrudModule.service('PromisesResolver', __webpack_require__(129));\n\tCrudModule.service('ReadQueries', __webpack_require__(132));\n\tCrudModule.service('ReferenceRefresher', __webpack_require__(133));\n\tCrudModule.service('WriteQueries', __webpack_require__(134));\n\t\n\tCrudModule.service('RestWrapper', __webpack_require__(130));\n\t\n\tCrudModule.directive('maJsonValidator', __webpack_require__(137));\n\t\n\tCrudModule.directive('datepickerPopup', __webpack_require__(79));\n\tCrudModule.directive('maField', __webpack_require__(85));\n\tCrudModule.directive('maButtonField', __webpack_require__(80));\n\tCrudModule.directive('maChoiceField', __webpack_require__(82));\n\tCrudModule.directive('maChoicesField', __webpack_require__(83));\n\tCrudModule.directive('maDateField', __webpack_require__(84));\n\tCrudModule.directive('maInputField', __webpack_require__(87));\n\tCrudModule.directive('maJsonField', __webpack_require__(88));\n\tCrudModule.directive('maFileField', __webpack_require__(86));\n\tCrudModule.directive('maCheckboxField', __webpack_require__(81));\n\tCrudModule.directive('maReferenceField', __webpack_require__(89));\n\tCrudModule.directive('maReferenceManyField', __webpack_require__(90));\n\tCrudModule.directive('maTextField', __webpack_require__(92));\n\tCrudModule.directive('maWysiwygField', __webpack_require__(93));\n\tCrudModule.directive('maTemplateField', __webpack_require__(91));\n\tCrudModule.directive('uiSelectRequired', __webpack_require__(94));\n\t\n\tCrudModule.provider('FieldViewConfiguration', __webpack_require__(101));\n\t\n\tCrudModule.directive('maListActions', __webpack_require__(126));\n\tCrudModule.directive('maDatagrid', __webpack_require__(119));\n\tCrudModule.directive('maDatagridPagination', __webpack_require__(124));\n\tCrudModule.directive('maDatagridInfinitePagination', __webpack_require__(121));\n\tCrudModule.directive('maDatagridItemSelector', __webpack_require__(122));\n\tCrudModule.directive('maDatagridMultiSelector', __webpack_require__(123));\n\tCrudModule.directive('maFilter', __webpack_require__(114));\n\tCrudModule.directive('maFilterButton', __webpack_require__(115));\n\t\n\tCrudModule.directive('maColumn', __webpack_require__(66));\n\tCrudModule.directive('maBooleanColumn', __webpack_require__(64));\n\tCrudModule.directive('maChoicesColumn', __webpack_require__(65));\n\tCrudModule.directive('maDateColumn', __webpack_require__(67));\n\tCrudModule.directive('maJsonColumn', __webpack_require__(68));\n\tCrudModule.directive('maNumberColumn', __webpack_require__(69));\n\tCrudModule.directive('maReferencedListColumn', __webpack_require__(72));\n\tCrudModule.directive('maReferenceManyColumn', __webpack_require__(70));\n\tCrudModule.directive('maReferenceManyLinkColumn', __webpack_require__(71));\n\tCrudModule.directive('maStringColumn', __webpack_require__(73));\n\tCrudModule.directive('maTemplateColumn', __webpack_require__(74));\n\tCrudModule.directive('maWysiwygColumn', __webpack_require__(75));\n\t\n\tCrudModule.directive('maBackButton', __webpack_require__(54));\n\tCrudModule.directive('maCreateButton', __webpack_require__(56));\n\tCrudModule.directive('maEditButton', __webpack_require__(58));\n\tCrudModule.directive('maFilteredListButton', __webpack_require__(60));\n\tCrudModule.directive('maShowButton', __webpack_require__(62));\n\tCrudModule.directive('maListButton', __webpack_require__(61));\n\tCrudModule.directive('maDeleteButton', __webpack_require__(57));\n\tCrudModule.directive('maBatchDeleteButton', __webpack_require__(55));\n\tCrudModule.directive('maExportToCsvButton', __webpack_require__(59));\n\tCrudModule.directive('maViewBatchActions', __webpack_require__(63));\n\t\n\tCrudModule.directive('maViewActions', __webpack_require__(131));\n\tCrudModule.directive('compile', __webpack_require__(127));\n\t\n\tCrudModule.config(__webpack_require__(135));\n\tCrudModule.config(__webpack_require__(76));\n\t\n\tCrudModule.factory('Papa', function () {\n\t return __webpack_require__(175);\n\t});\n\t\n\tCrudModule.factory('notification', function () {\n\t var humane = __webpack_require__(172);\n\t humane.timeout = 5000;\n\t humane.clickToClose = true;\n\t return humane;\n\t});\n\t\n\tCrudModule.factory('progression', function () {\n\t return __webpack_require__(174);\n\t});\n\t\n\tmodule.exports = CrudModule;\n\n/***/ },\n/* 54 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function maBackButtonDirective($window) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t size: '@',\n\t label: '@'\n\t },\n\t link: function link($scope) {\n\t $scope.label = $scope.label || 'Back';\n\t\n\t $scope.back = function () {\n\t $window.history.back();\n\t };\n\t },\n\t template: ' \\n  {{ ::label }}\\n'\n\t };\n\t }\n\t\n\t maBackButtonDirective.$inject = ['$window'];\n\t\n\t return maBackButtonDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 55 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function maBatchDeleteButtonDirective($state) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entity: '&',\n\t selection: '&',\n\t label: '@'\n\t },\n\t link: function link($scope) {\n\t $scope.label = $scope.label || 'Delete';\n\t\n\t $scope.gotoBatchDelete = function () {\n\t var entity = $scope.entity();\n\t var ids = $scope.selection().map(function (entry) {\n\t return entry.identifierValue;\n\t });\n\t\n\t $state.go('batchDelete', angular.extend({\n\t ids: ids,\n\t entity: $scope.entity().name()\n\t }, $state.params));\n\t };\n\t },\n\t template: '\\n  {{ ::label }}\\n'\n\t\n\t };\n\t }\n\t\n\t maBatchDeleteButtonDirective.$inject = ['$state'];\n\t\n\t return maBatchDeleteButtonDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 56 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function maCreateButtonDirective($state) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entity: '&',\n\t size: '@',\n\t label: '@'\n\t },\n\t link: function link(scope) {\n\t scope.label = scope.label || 'Create';\n\t\n\t scope.gotoCreate = function () {\n\t if ($state.params.entity == scope.entity().name()) {\n\t // link to the same entity, so preserve active filters\n\t $state.go($state.get('create'), angular.extend({\n\t entity: scope.entity().name()\n\t }, $state.params));\n\t } else {\n\t // link to anoter entity, so forget filters\n\t $state.go($state.get('create'), {\n\t entity: scope.entity().name()\n\t });\n\t }\n\t };\n\t },\n\t template: ' \\n  {{ ::label }}\\n'\n\t };\n\t }\n\t\n\t maCreateButtonDirective.$inject = ['$state'];\n\t\n\t return maCreateButtonDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 57 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function maDeleteButtonDirective($state) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entity: '&',\n\t entry: '&',\n\t size: '@',\n\t label: '@'\n\t },\n\t link: function link(scope) {\n\t scope.label = scope.label || 'Delete';\n\t scope.gotoDelete = function () {\n\t if ($state.params.entity == scope.entity().name()) {\n\t // link to the same entity, so preserve active filters\n\t $state.go($state.get('delete'), angular.extend({\n\t entity: scope.entity().name(),\n\t id: scope.entry().identifierValue\n\t }, $state.params));\n\t } else {\n\t // link to anoter entity, so forget filters\n\t $state.go($state.get('delete'), {\n\t entity: scope.entity().name(),\n\t id: scope.entry().identifierValue\n\t });\n\t }\n\t };\n\t },\n\t template: ' \\n  {{ ::label }}\\n'\n\t\n\t };\n\t }\n\t\n\t maDeleteButtonDirective.$inject = ['$state'];\n\t\n\t return maDeleteButtonDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 58 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function maEditButtonDirective($state) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entity: '&',\n\t entry: '&',\n\t size: '@',\n\t label: '@'\n\t },\n\t link: function link(scope) {\n\t scope.label = scope.label || 'Edit';\n\t scope.gotoEdit = function () {\n\t if ($state.params.entity == scope.entity().name()) {\n\t // link to the same entity, so preserve active filters\n\t $state.go($state.get('edit'), angular.extend({\n\t entity: scope.entity().name(),\n\t id: scope.entry().identifierValue\n\t }, $state.params));\n\t } else {\n\t // link to anoter entity, so forget filters\n\t $state.go($state.get('edit'), {\n\t entity: scope.entity().name(),\n\t id: scope.entry().identifierValue\n\t });\n\t }\n\t };\n\t },\n\t template: ' \\n  {{ ::label }}\\n'\n\t };\n\t }\n\t\n\t maEditButtonDirective.$inject = ['$state'];\n\t\n\t return maEditButtonDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 59 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function maExportToCsvButton($stateParams, Papa, notification, AdminDescription, entryFormatter, ReadQueries) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entity: '&',\n\t label: '@',\n\t datastore: '&',\n\t search: '&'\n\t },\n\t link: function link(scope) {\n\t scope.label = scope.label || 'Export';\n\t\n\t scope.datastore = scope.datastore();\n\t scope.entity = scope.entity();\n\t var exportView = scope.entity.exportView();\n\t var listView = scope.entity.listView();\n\t if (exportView.fields().length === 0) {\n\t var exportFields = listView.exportFields();\n\t if (exportFields === null) {\n\t exportFields = listView.fields();\n\t }\n\t exportView.fields(exportFields);\n\t exportView.filters(listView.filters());\n\t }\n\t scope.has_export = exportView.fields().length > 0;\n\t var formatEntry = entryFormatter.getFormatter(exportView.fields());\n\t\n\t scope.exportToCsv = function () {\n\t var rawEntries;\n\t var nonOptimizedReferencedData;\n\t var optimizedReferencedData;\n\t\n\t ReadQueries.getAll(exportView, -1, scope.search(), $stateParams.sortField, $stateParams.sortDir).then(function (response) {\n\t rawEntries = response.data;\n\t return rawEntries;\n\t }).then(function (rawEntries) {\n\t return ReadQueries.getFilteredReferenceData(exportView.getNonOptimizedReferences(), rawEntries);\n\t }).then(function (nonOptimizedReference) {\n\t nonOptimizedReferencedData = nonOptimizedReference;\n\t return ReadQueries.getOptimizedReferencedData(exportView.getOptimizedReferences(), rawEntries);\n\t }).then(function (optimizedReference) {\n\t optimizedReferencedData = optimizedReference;\n\t var references = exportView.getReferences(),\n\t referencedData = angular.extend(nonOptimizedReferencedData, optimizedReferencedData),\n\t referencedEntries;\n\t\n\t for (var name in referencedData) {\n\t referencedEntries = AdminDescription.getEntryConstructor().createArrayFromRest(referencedData[name], [references[name].targetField()], references[name].targetEntity().name(), references[name].targetEntity().identifier().name());\n\t\n\t scope.datastore.setEntries(references[name].targetEntity().uniqueId + '_values', referencedEntries);\n\t }\n\t }).then(function () {\n\t var entries = exportView.mapEntries(rawEntries);\n\t\n\t // shortcut to diplay collection of entry with included referenced values\n\t scope.datastore.fillReferencesValuesFromCollection(entries, exportView.getReferences(), true);\n\t\n\t var results = [];\n\t for (var i = entries.length - 1; i >= 0; i--) {\n\t results[i] = formatEntry(entries[i]);\n\t }\n\t var csv = Papa.unparse(results);\n\t var fakeLink = document.createElement('a');\n\t document.body.appendChild(fakeLink);\n\t\n\t fakeLink.setAttribute('href', 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(csv));\n\t fakeLink.setAttribute('download', scope.entity.name() + '.csv');\n\t fakeLink.click();\n\t }, function (error) {\n\t notification.log(error.message, { addnCls: 'humane-flatty-error' });\n\t });\n\t };\n\t },\n\t template: '\\n \\n  {{ ::label }}\\n \\n'\n\t };\n\t }\n\t\n\t maExportToCsvButton.$inject = ['$stateParams', 'Papa', 'notification', 'AdminDescription', 'EntryFormatter', 'ReadQueries'];\n\t\n\t return maExportToCsvButton;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 60 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t /**\n\t * Link to filtered list\n\t * \n\t * Usage:\n\t *\n\t * \n\t * \n\t * ')\n\t *\n\t * Usage as a template field:\n\t *\n\t * nga.field('', 'template')\n\t * .label('')\n\t * .template('')\n\t */\n\t function maFilteredListButtonDirective($state) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entityName: '@',\n\t filter: '&',\n\t label: '@',\n\t size: '@'\n\t },\n\t link: function link(scope) {\n\t scope.label = scope.label || 'See all related ' + scope.entityName;\n\t scope.gotoList = function () {\n\t $state.go($state.get('list'), { 'entity': scope.entityName, 'search': scope.filter() });\n\t };\n\t },\n\t template: ' \\n  {{ ::label }}\\n'\n\t };\n\t }\n\t\n\t maFilteredListButtonDirective.$inject = ['$state'];\n\t\n\t return maFilteredListButtonDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 61 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t /**\n\t * Link to list\n\t *\n\t * Usage:\n\t * \n\t */\n\t function maListButtonDirective($state) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entity: '&',\n\t size: '@',\n\t label: '@'\n\t },\n\t link: function link(scope) {\n\t scope.label = scope.label || 'List';\n\t var parentEntityName = scope.$parent.entity ? scope.$parent.entity.name() : null;\n\t var entityName = scope.entity().name();\n\t\n\t var params = {\n\t entity: entityName\n\t };\n\t if (entityName === parentEntityName) {\n\t angular.extend(params, $state.params);\n\t }\n\t\n\t scope.gotoList = function () {\n\t $state.go($state.get('list'), params);\n\t };\n\t },\n\t template: ' \\n  {{ ::label }}\\n'\n\t };\n\t }\n\t\n\t maListButtonDirective.$inject = ['$state'];\n\t\n\t return maListButtonDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 62 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function maShowButtonDirective($state) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entity: '&',\n\t entry: '&',\n\t size: '@',\n\t label: '@'\n\t },\n\t link: function link(scope) {\n\t scope.label = scope.label || 'Show';\n\t scope.gotoShow = function () {\n\t if ($state.params.entity == scope.entity().name()) {\n\t // link to the same entity, so preserve active filters\n\t $state.go($state.get('show'), angular.extend({\n\t entity: scope.entity().name(),\n\t id: scope.entry().identifierValue\n\t }, $state.params));\n\t } else {\n\t // link to anoter entity, so forget filters\n\t $state.go($state.get('show'), {\n\t entity: scope.entity().name(),\n\t id: scope.entry().identifierValue\n\t });\n\t }\n\t };\n\t },\n\t template: ' \\n  {{ ::label }}\\n'\n\t };\n\t }\n\t\n\t maShowButtonDirective.$inject = ['$state'];\n\t\n\t return maShowButtonDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 63 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction maViewBatchActionsDirective($injector) {\n\t var $compile = $injector.get('$compile');\n\t\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t 'entity': '=',\n\t 'selection': '=',\n\t 'buttons': '&'\n\t },\n\t link: function link(scope) {\n\t scope.isopen = false;\n\t\n\t scope.toggleDropdown = function ($event) {\n\t $event.preventDefault();\n\t $event.stopPropagation();\n\t scope.isopen = !scope.isopen;\n\t };\n\t\n\t scope.buttons = scope.buttons();\n\t if (typeof scope.buttons === 'string') {\n\t scope.customTemplate = scope.buttons;\n\t scope.buttons = null;\n\t }\n\t },\n\t // the ng-class hidden is necessary to hide the inner blank space used for spacing buttons when the selection is not empty\n\t template: ' \\n \\n \\n'\n\t };\n\t}\n\t\n\tmaViewBatchActionsDirective.$inject = ['$injector'];\n\t\n\tmodule.exports = maViewBatchActionsDirective;\n\n/***/ },\n/* 64 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maBooleanColumn() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t value: '&'\n\t },\n\t link: function link(scope) {\n\t scope.value = scope.value();\n\t },\n\t template: ''\n\t };\n\t }\n\t\n\t maBooleanColumn.$inject = [];\n\t\n\t return maBooleanColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 65 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maChoicesColumn() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t values: '&'\n\t },\n\t template: '{{ ref }}'\n\t };\n\t }\n\t\n\t maChoicesColumn.$inject = [];\n\t\n\t return maChoicesColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 66 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maColumn($state, $anchorScroll, $compile, Configuration, FieldViewConfiguration) {\n\t\n\t function getDetailLinkRouteName(field, entity) {\n\t if (entity.isReadOnly) {\n\t return entity.showView().enabled ? 'show' : false;\n\t }\n\t if (field.detailLinkRoute() == 'edit' && entity.editionView().enabled) {\n\t return 'edit';\n\t }\n\t return entity.showView().enabled ? 'show' : false;\n\t }\n\t\n\t function isDetailLink(field, entity) {\n\t if (field.isDetailLink() === false) {\n\t return false;\n\t }\n\t if (field.type() == 'reference' || field.type() == 'reference_many') {\n\t var relatedEntity = Configuration().getEntity(field.targetEntity().name());\n\t if (!relatedEntity) {\n\t return false;\n\t }\n\t return getDetailLinkRouteName(field, relatedEntity) !== false;\n\t }\n\t return getDetailLinkRouteName(field, entity) !== false;\n\t }\n\t\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t field: '&',\n\t entry: '&',\n\t entity: '&',\n\t datastore: '&'\n\t },\n\t link: function link(scope, element) {\n\t scope.datastore = scope.datastore();\n\t scope.field = scope.field();\n\t scope.entry = scope.entry();\n\t scope.entity = scope.entity();\n\t var type = scope.field.type();\n\t if (isDetailLink(scope.field, scope.entity)) {\n\t element.append(FieldViewConfiguration[type].getLinkWidget());\n\t } else {\n\t element.append(FieldViewConfiguration[type].getReadWidget());\n\t }\n\t $compile(element.contents())(scope);\n\t scope.gotoDetail = function () {\n\t var route = getDetailLinkRouteName(scope.field, scope.entity);\n\t $state.go($state.get(route), angular.extend({}, $state.params, {\n\t entity: scope.entry.entityName,\n\t id: scope.entry.identifierValue\n\t }));\n\t };\n\t scope.gotoReference = function () {\n\t var referenceEntity = scope.field.targetEntity().name();\n\t var relatedEntity = Configuration().getEntity(referenceEntity);\n\t var referenceId = scope.entry.values[scope.field.name()];\n\t var route = getDetailLinkRouteName(scope.field, relatedEntity);\n\t $state.go($state.get(route), {\n\t entity: referenceEntity,\n\t id: referenceId\n\t });\n\t };\n\t }\n\t };\n\t }\n\t\n\t maColumn.$inject = ['$state', '$anchorScroll', '$compile', 'NgAdminConfiguration', 'FieldViewConfiguration'];\n\t\n\t return maColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 67 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function maDateColumn() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t value: '&',\n\t field: '&'\n\t },\n\t link: function link(scope) {\n\t var field = scope.field();\n\t scope.format = field.format();\n\t if (!scope.format) {\n\t scope.format = field.type() === 'date' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss';\n\t }\n\t },\n\t template: '{{ value() | date:format }}'\n\t };\n\t }\n\t\n\t maDateColumn.$inject = [];\n\t\n\t return maDateColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 68 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maJsonColumn($compile) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t value: '&'\n\t },\n\t link: function link(scope, element) {\n\t scope.guessType = function (obj) {\n\t var type = Object.prototype.toString.call(obj);\n\t\n\t if (type === \"[object Object]\") {\n\t return \"Object\";\n\t }\n\t\n\t if (type === \"[object Array]\") {\n\t return \"Array\";\n\t }\n\t\n\t return \"Literal\";\n\t };\n\t\n\t var template = '' + '' + '' + '' + '' + '' + '' + '
' + '' + '' + '{{ val }}' + '
' + '' + '' + '' + '' + '' + '' + '' + '
{{ key }}' + '' + '' + '{{ val }}' + '
' + '
';\n\t\n\t var newElement = angular.element(template);\n\t $compile(newElement)(scope);\n\t element.replaceWith(newElement);\n\t }\n\t };\n\t }\n\t\n\t maJsonColumn.$inject = ['$compile'];\n\t\n\t return maJsonColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 69 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maNumberColumn() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t value: '&',\n\t field: '&'\n\t },\n\t template: '{{ value() | numeraljs:field().format() }}'\n\t };\n\t }\n\t\n\t maNumberColumn.$inject = [];\n\t\n\t return maNumberColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 70 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maReferenceManyColumn() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t values: '&'\n\t },\n\t template: '' + '{{ ref }}' + ''\n\t };\n\t }\n\t\n\t maReferenceManyColumn.$inject = [];\n\t\n\t return maReferenceManyColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 71 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maReferenceManyLinkColumn($state, Configuration) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t field: '&',\n\t values: '&',\n\t ids: '&'\n\t },\n\t link: function link(scope) {\n\t scope.field = scope.field();\n\t scope.values = scope.values();\n\t scope.ids = scope.ids();\n\t var referenceEntity = scope.field.targetEntity().name(),\n\t relatedEntity = Configuration().getEntity(referenceEntity);\n\t scope.gotoReference = function (referenceId) {\n\t var route = relatedEntity.isReadOnly ? 'show' : 'edit';\n\t $state.go($state.get(route), { entity: referenceEntity, id: referenceId });\n\t };\n\t },\n\t template: '' + '{{ ref }}' + ''\n\t };\n\t }\n\t\n\t maReferenceManyLinkColumn.$inject = ['$state', 'NgAdminConfiguration'];\n\t\n\t return maReferenceManyLinkColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 72 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction maReferencedListColumn(NgAdminConfiguration) {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'datastore': '&'\n\t },\n\t restrict: 'E',\n\t link: {\n\t pre: function pre(scope) {\n\t scope.field = scope.field();\n\t var targetEntity = scope.field.targetEntity();\n\t scope.entries = scope.datastore().getEntries(targetEntity.uniqueId + '_list');\n\t scope.entity = NgAdminConfiguration().getEntity(targetEntity.name());\n\t }\n\t },\n\t template: '\\n\\n'\n\t };\n\t}\n\t\n\tmaReferencedListColumn.$inject = ['NgAdminConfiguration'];\n\t\n\tmodule.exports = maReferencedListColumn;\n\n/***/ },\n/* 73 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maStringColumn() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t value: '&'\n\t },\n\t template: '{{ value() }}'\n\t };\n\t }\n\t\n\t maStringColumn.$inject = [];\n\t\n\t return maStringColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 74 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maTemplateColumn() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t field: '&',\n\t entry: '&',\n\t entity: '&'\n\t },\n\t link: function link(scope) {\n\t scope.field = scope.field();\n\t scope.entry = scope.entry();\n\t scope.entity = scope.entity();\n\t },\n\t template: ''\n\t };\n\t }\n\t\n\t maTemplateColumn.$inject = [];\n\t\n\t return maTemplateColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 75 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maWysiwygColumn($filter) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t value: '&',\n\t field: '&'\n\t },\n\t link: function link(scope) {\n\t var value = scope.value();\n\t if (scope.field().stripTags()) {\n\t value = $filter('stripTags')(value);\n\t }\n\t scope.htmlValue = value;\n\t },\n\t template: ''\n\t };\n\t }\n\t\n\t maWysiwygColumn.$inject = ['$filter'];\n\t\n\t return maWysiwygColumn;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 76 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tfunction factories(fvp) {\n\t fvp.registerFieldView('boolean', __webpack_require__(95));\n\t fvp.registerFieldView('choice', __webpack_require__(96));\n\t fvp.registerFieldView('choices', __webpack_require__(97));\n\t fvp.registerFieldView('date', __webpack_require__(98));\n\t fvp.registerFieldView('datetime', __webpack_require__(99));\n\t fvp.registerFieldView('email', __webpack_require__(100));\n\t fvp.registerFieldView('file', __webpack_require__(102));\n\t fvp.registerFieldView('float', __webpack_require__(103));\n\t fvp.registerFieldView('json', __webpack_require__(104));\n\t fvp.registerFieldView('number', __webpack_require__(105));\n\t fvp.registerFieldView('password', __webpack_require__(106));\n\t fvp.registerFieldView('referenced_list', __webpack_require__(109));\n\t fvp.registerFieldView('reference', __webpack_require__(107));\n\t fvp.registerFieldView('reference_many', __webpack_require__(108));\n\t fvp.registerFieldView('string', __webpack_require__(110));\n\t fvp.registerFieldView('template', __webpack_require__(111));\n\t fvp.registerFieldView('text', __webpack_require__(112));\n\t fvp.registerFieldView('wysiwyg', __webpack_require__(113));\n\t}\n\t\n\tfactories.$inject = ['FieldViewConfigurationProvider'];\n\t\n\tmodule.exports = factories;\n\n/***/ },\n/* 77 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t var BatchDeleteController = function BatchDeleteController($scope, $state, WriteQueries, notification, view) {\n\t\n\t this.$scope = $scope;\n\t this.$state = $state;\n\t this.WriteQueries = WriteQueries;\n\t this.notification = notification;\n\t this.view = view;\n\t this.entity = view.getEntity();\n\t this.entityIds = $state.params.ids;\n\t this.selection = []; // fixme: query db to get selection\n\t this.title = view.title();\n\t this.description = view.description();\n\t this.actions = view.actions();\n\t this.loadingPage = false;\n\t this.fields = view.fields();\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t };\n\t\n\t BatchDeleteController.prototype.batchDelete = function () {\n\t var notification = this.notification,\n\t $state = this.$state,\n\t entityName = this.entity.name();\n\t\n\t this.WriteQueries.batchDelete(this.view, this.entityIds).then(function () {\n\t $state.go($state.get('list'), angular.extend({\n\t entity: entityName\n\t }, $state.params));\n\t notification.log('Elements successfully deleted.', { addnCls: 'humane-flatty-success' });\n\t }, function (response) {\n\t // @TODO: share this method when splitting controllers\n\t var body = response.data;\n\t if (typeof body === 'object') {\n\t body = JSON.stringify(body);\n\t }\n\t\n\t notification.log('Oops, an error occured : (code: ' + response.status + ') ' + body, { addnCls: 'humane-flatty-error' });\n\t });\n\t };\n\t\n\t BatchDeleteController.prototype.back = function () {\n\t\n\t this.$state.go(this.$state.get('list'), angular.extend({\n\t entity: this.entity.name()\n\t }, this.$state.params));\n\t };\n\t\n\t BatchDeleteController.prototype.destroy = function () {\n\t this.$scope = undefined;\n\t this.$state = undefined;\n\t this.WriteQueries = undefined;\n\t };\n\t\n\t BatchDeleteController.$inject = ['$scope', '$state', 'WriteQueries', 'notification', 'view'];\n\t\n\t return BatchDeleteController;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 78 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t var DeleteController = function DeleteController($scope, $window, $state, $q, WriteQueries, notification, params, view, entry) {\n\t var _this = this;\n\t\n\t this.$scope = $scope;\n\t this.$window = $window;\n\t this.$state = $state;\n\t this.WriteQueries = WriteQueries;\n\t this.entityLabel = params.entity;\n\t this.entityId = params.id;\n\t this.view = view;\n\t this.title = view.title();\n\t this.description = view.description();\n\t this.actions = view.actions();\n\t this.entity = view.getEntity();\n\t this.notification = notification;\n\t this.$scope.entry = entry;\n\t this.$scope.view = view;\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t\n\t this.previousStateParametersDeferred = $q.defer();\n\t $scope.$on('$stateChangeSuccess', function (event, to, toParams, from, fromParams) {\n\t _this.previousStateParametersDeferred.resolve(fromParams);\n\t });\n\t };\n\t\n\t DeleteController.prototype.deleteOne = function () {\n\t var _this2 = this;\n\t\n\t var notification = this.notification,\n\t entityName = this.entity.name();\n\t\n\t return this.WriteQueries.deleteOne(this.view, this.entityId).then(function () {\n\t _this2.previousStateParametersDeferred.promise.then(function (previousStateParameters) {\n\t // if previous page was related to deleted entity, redirect to list\n\t if (previousStateParameters.entity === entityName && previousStateParameters.id === _this2.entityId) {\n\t _this2.$state.go(_this2.$state.get('list'), angular.extend({\n\t entity: entityName\n\t }, _this2.$state.params));\n\t } else {\n\t _this2.back();\n\t }\n\t\n\t notification.log('Element successfully deleted.', { addnCls: 'humane-flatty-success' });\n\t });\n\t }, function (response) {\n\t // @TODO: share this method when splitting controllers\n\t var body = response.data;\n\t if (typeof body === 'object') {\n\t body = JSON.stringify(body);\n\t }\n\t\n\t notification.log('Oops, an error occured : (code: ' + response.status + ') ' + body, { addnCls: 'humane-flatty-error' });\n\t });\n\t };\n\t\n\t DeleteController.prototype.back = function () {\n\t this.$window.history.back();\n\t };\n\t\n\t DeleteController.prototype.destroy = function () {\n\t this.$scope = undefined;\n\t this.WriteQueries = undefined;\n\t this.view = undefined;\n\t this.entity = undefined;\n\t };\n\t\n\t DeleteController.$inject = ['$scope', '$window', '$state', '$q', 'WriteQueries', 'notification', 'params', 'view', 'entry'];\n\t\n\t return DeleteController;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 79 */\n/***/ function(module, exports) {\n\n\t/* Fixes an issue with Bootstrap Date Picker\n\t @see https://github.com/angular-ui/bootstrap/issues/2659 */\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tvar datepickerPopup = function datepickerPopup() {\n\t return {\n\t restrict: 'EAC',\n\t require: 'ngModel',\n\t link: function link(scope, element, attr, controller) {\n\t //remove the default formatter from the input directive to prevent conflict\n\t controller.$formatters.shift();\n\t }\n\t };\n\t};\n\t\n\tdatepickerPopup.$inject = [];\n\t\n\texports['default'] = datepickerPopup;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 80 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t /**\n\t * Toggle input\n\t *\n\t * @example \n\t */\n\t function maButtonField() {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '='\n\t },\n\t restrict: 'E',\n\t link: function link(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.label = field.label();\n\t scope.value = !!scope.value;\n\t var a = element.children()[0];\n\t var attributes = field.attributes();\n\t for (var name in attributes) {\n\t a.setAttribute(name, attributes[name]);\n\t }\n\t scope.toggle = function () {\n\t this.value = !this.value;\n\t };\n\t scope.isActive = function () {\n\t return !!this.value;\n\t };\n\t },\n\t template: '{{ label }}'\n\t };\n\t }\n\t\n\t maButtonField.$inject = [];\n\t\n\t return maButtonField;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 81 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t /**\n\t * Generic edition field\n\t *\n\t * @example \n\t */\n\t function maCheckboxField() {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '='\n\t },\n\t restrict: 'E',\n\t link: function link(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t scope.value = !!scope.value;\n\t var input = element.children()[0];\n\t var attributes = field.attributes();\n\t for (var name in attributes) {\n\t input.setAttribute(name, attributes[name]);\n\t }\n\t },\n\t template: ''\n\t };\n\t }\n\t\n\t maCheckboxField.$inject = [];\n\t\n\t return maCheckboxField;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 82 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction updateChoices(scope, choices) {\n\t scope.choices = choices;\n\t scope.$root.$$phase || scope.$digest();\n\t}\n\t\n\tfunction maChoiceField($compile) {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '=',\n\t 'entry': '=?',\n\t 'datastore': '&?',\n\t 'refresh': '&',\n\t 'choices': '&?'\n\t },\n\t restrict: 'E',\n\t compile: function compile() {\n\t return {\n\t pre: function pre(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t scope.$watch('value', function (newValue, oldValue) {\n\t if (newValue !== oldValue && newValue === undefined) {\n\t // fix for https://github.com/angular-ui/ui-select/issues/863\n\t scope.value = null;\n\t }\n\t });\n\t\n\t var refreshAttributes = '';\n\t if (field.type().indexOf('reference') === 0 && field.remoteComplete()) {\n\t scope.refreshDelay = field.remoteCompleteOptions().refreshDelay;\n\t refreshAttributes = 'refresh-delay=\"refreshDelay\" refresh=\"refresh({ $search: $select.search })\"';\n\t }\n\t\n\t var choices = scope.choices() ? scope.choices : field.choices ? field.choices() : [];\n\t var attributes = field.attributes();\n\t scope.placeholder = attributes && attributes.placeholder || 'Filter values';\n\t\n\t var template = '\\n \\n {{ $select.selected.label }}\\n \\n {{ item.label }}\\n \\n ';\n\t\n\t scope.choices = typeof choices === 'function' ? choices(scope.entry) : choices;\n\t element.html(template);\n\t\n\t var select = element.children()[0];\n\t for (var name in attributes) {\n\t select.setAttribute(name, attributes[name]);\n\t }\n\t\n\t $compile(element.contents())(scope);\n\t },\n\t post: function post(scope) {\n\t scope.$on('choices:update', function (e, data) {\n\t updateChoices(scope, data.choices);\n\t });\n\t }\n\t };\n\t }\n\t };\n\t}\n\t\n\tmaChoiceField.$inject = ['$compile'];\n\t\n\tmodule.exports = maChoiceField;\n\n/***/ },\n/* 83 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Edition field for a selection of elements in a list - a multiple select.\n\t *\n\t * @example \n\t */\n\t'use strict';\n\t\n\tfunction maChoicesField($compile) {\n\t 'use strict';\n\t\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '=',\n\t 'entry': '=?',\n\t 'datastore': '&?',\n\t 'refresh': '&'\n\t },\n\t restrict: 'E',\n\t compile: function compile() {\n\t return {\n\t pre: function pre(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t\n\t var refreshAttributes = '';\n\t if (field.type().indexOf('reference') === 0 && field.remoteComplete()) {\n\t scope.refreshDelay = field.remoteCompleteOptions().refreshDelay;\n\t refreshAttributes = 'refresh-delay=\"refreshDelay\" refresh=\"refresh({ $search: $select.search })\"';\n\t }\n\t\n\t var choices = field.choices ? field.choices() : [];\n\t var attributes = field.attributes();\n\t scope.placeholder = attributes && attributes.placeholder || 'Filter values';\n\t\n\t var template = '\\n \\n {{ $item.label }}\\n \\n {{ item.label }}\\n \\n ';\n\t\n\t scope.choices = typeof choices === 'function' ? choices(scope.entry) : choices;\n\t element.html(template);\n\t\n\t var select = element.children()[0];\n\t\n\t for (var name in attributes) {\n\t select.setAttribute(name, attributes[name]);\n\t }\n\t\n\t $compile(element.contents())(scope);\n\t },\n\t post: function post(scope) {\n\t scope.$on('choices:update', function (e, data) {\n\t scope.choices = data.choices;\n\t scope.$root.$$phase || scope.$digest();\n\t });\n\t }\n\t };\n\t }\n\t };\n\t}\n\t\n\tmaChoicesField.$inject = ['$compile'];\n\t\n\tmodule.exports = maChoicesField;\n\n/***/ },\n/* 84 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Edition field for a date - a text input with a datepicker.\n\t *\n\t * @example \n\t */\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tfunction maDateField() {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '='\n\t },\n\t restrict: 'E',\n\t link: function link(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.rawValue = scope.value;\n\t scope.$watch('rawValue', function (rawValue) {\n\t scope.value = field.parse()(rawValue);\n\t });\n\t scope.format = field.format();\n\t if (!scope.format) {\n\t scope.format = field.type() === 'date' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss';\n\t }\n\t\n\t scope.v = field.validation();\n\t scope.isOpen = false;\n\t var input = element.find('input').eq(0);\n\t var attributes = field.attributes();\n\t for (var name in attributes) {\n\t input.attr(name, attributes[name]);\n\t }\n\t scope.toggleDatePicker = function ($event) {\n\t $event.preventDefault();\n\t $event.stopPropagation();\n\t scope.isOpen = !scope.isOpen;\n\t };\n\t },\n\t template: '\\n
\\n \\n \\n \\n \\n
\\n '\n\t };\n\t}\n\t\n\tmaDateField.$inject = [];\n\t\n\texports['default'] = maDateField;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 85 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _ = __webpack_require__(23);\n\t\n\tfunction maField(FieldViewConfiguration) {\n\t var writeWidgetTypes = _(FieldViewConfiguration).map(function (fieldView, field) {\n\t return '' + fieldView.getWriteWidget() + '';\n\t }).join('');\n\t var template = '
' + '' + '
' + writeWidgetTypes + '' + '
' + '
' + '

' + '' + '

' + '
' + '
';\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t field: '&',\n\t entry: '=',\n\t entity: '&',\n\t form: '&',\n\t datastore: '&'\n\t },\n\t link: function link(scope) {\n\t scope.field = scope.field();\n\t scope.type = scope.field.type();\n\t scope.entity = scope.entity();\n\t scope.form = scope.form();\n\t scope.datastore = scope.datastore();\n\t\n\t scope.getClassesForField = function (field, entry) {\n\t return 'ng-admin-field-' + field.name().replace('.', '_') + ' ' + 'ng-admin-type-' + field.type() + ' ' + (field.getCssClasses(entry) || 'col-sm-10 col-md-8 col-lg-7');\n\t };\n\t\n\t scope.getInputForField = function (field) {\n\t return scope.form[field.name()];\n\t };\n\t\n\t /**\n\t * Should validation status be displayed for a given field?\n\t *\n\t * - No for non-editable fields, or template fields which not have a corresponding input\n\t * - No for non-altered input\n\t * - Yes otherwise\n\t */\n\t scope.fieldHasValidation = function (field) {\n\t var input = this.getInputForField(field);\n\t return input && input.$dirty;\n\t };\n\t\n\t scope.fieldIsValid = function (field) {\n\t var input = this.getInputForField(field);\n\t return input && input.$valid;\n\t };\n\t\n\t scope.getFieldValidationClass = function (field) {\n\t if (this.fieldHasValidation(field)) {\n\t return this.fieldIsValid(field) ? 'has-success' : 'has-error';\n\t }\n\t };\n\t },\n\t template: template\n\t };\n\t}\n\t\n\tmaField.$inject = ['FieldViewConfiguration'];\n\t\n\tmodule.exports = maField;\n\n/***/ },\n/* 86 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t /**\n\t * Edition field for a file - a file uploader.\n\t *\n\t * @example \n\t */\n\t function maFileField(Upload) {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '='\n\t },\n\t restrict: 'E',\n\t link: {\n\t pre: function pre(scope) {\n\t var uploadInformation = scope.field().uploadInformation();\n\t if (!uploadInformation.hasOwnProperty('url')) {\n\t throw new Error('You must provide a URL property to allow the upload of files.');\n\t }\n\t\n\t scope.multiple = uploadInformation.hasOwnProperty('multiple') ? uploadInformation.multiple : false;\n\t scope.accept = \"*\";\n\t if (uploadInformation.hasOwnProperty('accept')) {\n\t scope.accept = uploadInformation.accept;\n\t }\n\t scope.apifilename = uploadInformation.hasOwnProperty('apifilename') ? uploadInformation.apifilename : false;\n\t\n\t var files = scope.value ? scope.value.split(',') : [];\n\t scope.files = {};\n\t for (var file in files) {\n\t scope.files[files[file]] = {\n\t \"name\": files[file],\n\t \"progress\": 0\n\t };\n\t }\n\t },\n\t post: function post(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t if (scope.value) {\n\t scope.v.required = false;\n\t }\n\t var input = element.find('input')[0];\n\t var attributes = field.attributes();\n\t for (var name in attributes) {\n\t input.setAttribute(name, attributes[name]);\n\t }\n\t\n\t scope.fileSelected = function (selectedFiles) {\n\t if (!selectedFiles || !selectedFiles.length) {\n\t return;\n\t }\n\t\n\t var uploadParams;\n\t\n\t scope.files = {};\n\t for (var file in selectedFiles) {\n\t uploadParams = angular.copy(scope.field().uploadInformation());\n\t uploadParams.file = selectedFiles[file];\n\t Upload.upload(uploadParams).progress(function (evt) {\n\t scope.files[evt.config.file.name] = {\n\t \"name\": evt.config.file.name,\n\t \"progress\": Math.min(100, parseInt(100.0 * evt.loaded / evt.total))\n\t };\n\t }).success(function (data, status, headers, config) {\n\t scope.files[config.file.name] = {\n\t \"name\": scope.apifilename ? data[scope.apifilename] : config.file.name,\n\t \"progress\": 0\n\t };\n\t if (scope.apifilename) {\n\t var apiNames = Object.keys(scope.files).map(function (fileindex) {\n\t return scope.files[fileindex].name;\n\t });\n\t scope.value = apiNames.join(',');\n\t } else {\n\t scope.value = Object.keys(scope.files).join(',');\n\t }\n\t }).error(function (data, status, headers, config) {\n\t delete scope.files[config.file.name];\n\t\n\t scope.value = Object.keys(scope.files).join(',');\n\t });\n\t }\n\t };\n\t\n\t scope.selectFile = function () {\n\t input.click();\n\t };\n\t }\n\t },\n\t template: '
' + '' + '
' + '
' + '
' + '
' + '
' + '{{ file.progress }}% Complete' + '
' + '
' + '
' + '
{{ file.name }}
' + '
' + '
' + '
' + ''\n\t };\n\t }\n\t\n\t maFileField.$inject = ['Upload'];\n\t\n\t return maFileField;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 87 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t /**\n\t * Generic edition field\n\t *\n\t * @example \n\t */\n\t function maInputField() {\n\t return {\n\t scope: {\n\t 'type': '@',\n\t 'step': '@?',\n\t 'field': '&',\n\t 'value': '='\n\t },\n\t restrict: 'E',\n\t link: function link(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t var input = element.children()[0];\n\t var attributes = field.attributes();\n\t for (var name in attributes) {\n\t if (name === 'step') {\n\t // allow to use `step` attribute instead of `scope.step`\n\t scope.step = attributes[name];\n\t continue;\n\t }\n\t\n\t input.setAttribute(name, attributes[name]);\n\t }\n\t },\n\t template: ''\n\t };\n\t }\n\t\n\t maInputField.$inject = [];\n\t\n\t return maInputField;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 88 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tvar codemirror = __webpack_require__(3);\n\t\n\tglobal.jsonlint = __webpack_require__(173);\n\t\n\t__webpack_require__(165);\n\t__webpack_require__(166);\n\t__webpack_require__(168);\n\t__webpack_require__(167);\n\t__webpack_require__(169);\n\t__webpack_require__(170);\n\t\n\tcodemirror.defineOption(\"matchBrackets\", true);\n\tcodemirror.defineOption(\"autoCloseBrackets\", true);\n\tcodemirror.defineOption(\"lineWrapping\", true);\n\tcodemirror.defineOption(\"tabSize\", 2);\n\tcodemirror.defineOption(\"mode\", \"application/json\");\n\tcodemirror.defineOption(\"gutters\", [\"CodeMirror-lint-markers\"]);\n\tcodemirror.defineOption(\"lint\", true);\n\tcodemirror.defineOption(\"styleActiveLine\", true);\n\t\n\tglobal.CodeMirror = codemirror;\n\t\n\t/**\n\t * Edition field for a JSON string in a textarea.\n\t *\n\t * @example \n\t */\n\tfunction maJsonField() {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '='\n\t },\n\t restrict: 'E',\n\t link: function link(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t scope.jsonValue = scope.value === null ? '' : angular.toJson(scope.value, true);\n\t var input = element.children()[0];\n\t var attributes = field.attributes();\n\t for (var name in attributes) {\n\t input.setAttribute(name, attributes[name]);\n\t }\n\t scope.$watch('jsonValue', function (jsonValue) {\n\t if (jsonValue == '' || typeof jsonValue === 'undefined') {\n\t scope.value = null;\n\t\n\t return;\n\t }\n\t try {\n\t var value = angular.fromJson(jsonValue);\n\t scope.value = value;\n\t } catch (e) {\n\t // incorrect JSON, do not convert back to value\n\t }\n\t });\n\t },\n\t template: ''\n\t };\n\t}\n\t\n\tmaJsonField.$inject = [];\n\t\n\tmodule.exports = maJsonField;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 89 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction maReferenceField(ReferenceRefresher) {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '=',\n\t 'entry': '=?',\n\t 'datastore': '&?'\n\t },\n\t restrict: 'E',\n\t link: function link(scope) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t\n\t function refresh(search) {\n\t return ReferenceRefresher.refresh(field, scope.value, search).then(function (formattedResults) {\n\t scope.$broadcast('choices:update', { choices: formattedResults });\n\t });\n\t }\n\t\n\t if (field.remoteComplete()) {\n\t ReferenceRefresher.getInitialChoices(field, [scope.value]).then(function (options) {\n\t scope.$broadcast('choices:update', { choices: options });\n\t });\n\t\n\t scope.refresh = refresh;\n\t } else {\n\t refresh();\n\t }\n\t },\n\t template: '\\n '\n\t };\n\t}\n\t\n\tmaReferenceField.$inject = ['ReferenceRefresher'];\n\t\n\tmodule.exports = maReferenceField;\n\n/***/ },\n/* 90 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction maReferenceManyField(ReferenceRefresher) {\n\t 'use strict';\n\t\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '=',\n\t 'entry': '=?',\n\t 'datastore': '&?'\n\t },\n\t restrict: 'E',\n\t link: function link(scope) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t scope.choices = [];\n\t\n\t function refresh(search) {\n\t return ReferenceRefresher.refresh(field, scope.value, search).then(function (formattedResults) {\n\t scope.$broadcast('choices:update', { choices: formattedResults });\n\t });\n\t }\n\t\n\t // if value is set, we should retrieve references label from server\n\t if (scope.value && scope.value.length) {\n\t ReferenceRefresher.getInitialChoices(field, scope.value).then(function (options) {\n\t scope.$broadcast('choices:update', { choices: options });\n\t\n\t if (field.remoteComplete()) {\n\t scope.refresh = refresh;\n\t } else {\n\t refresh();\n\t }\n\t });\n\t } else {\n\t if (field.remoteComplete()) {\n\t scope.refresh = refresh;\n\t } else {\n\t refresh();\n\t }\n\t }\n\t },\n\t template: '\\n '\n\t };\n\t}\n\t\n\tmaReferenceManyField.$inject = ['ReferenceRefresher'];\n\t\n\tmodule.exports = maReferenceManyField;\n\n/***/ },\n/* 91 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maTemplateField() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t field: '&',\n\t entry: '&',\n\t entity: '&',\n\t value: '='\n\t },\n\t link: function link(scope) {\n\t scope.field = scope.field();\n\t scope.entry = scope.entry();\n\t scope.entity = scope.entity();\n\t },\n\t template: ''\n\t };\n\t }\n\t\n\t maTemplateField.$inject = [];\n\t\n\t return maTemplateField;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 92 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t /**\n\t * Edition field for a multiline string - a textarea.\n\t *\n\t * @example \n\t */\n\t function maTextField() {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '='\n\t },\n\t restrict: 'E',\n\t link: function link(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t scope.v = field.validation();\n\t var input = element.children()[0];\n\t var attributes = field.attributes();\n\t for (var name in attributes) {\n\t input.setAttribute(name, attributes[name]);\n\t }\n\t },\n\t template: ''\n\t };\n\t }\n\t\n\t maTextField.$inject = [];\n\t\n\t return maTextField;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 93 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t /**\n\t * Edition field for a multiline HTML string - a rich text editor.\n\t *\n\t * @example \n\t */\n\t function maWysiwygField() {\n\t return {\n\t scope: {\n\t 'field': '&',\n\t 'value': '='\n\t },\n\t restrict: 'E',\n\t link: function link(scope, element) {\n\t var field = scope.field();\n\t scope.name = field.name();\n\t },\n\t template: '
' + '
'\n\t };\n\t }\n\t\n\t maWysiwygField.$inject = [];\n\t\n\t return maWysiwygField;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 94 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Directive created to fix a bug with ui-select and multiple required values.\n\t * @see https://github.com/angular-ui/ui-select/issues/258\n\t */\n\t'use strict';\n\t\n\tfunction uiSelectRequired() {\n\t 'use strict';\n\t\n\t return {\n\t restrict: 'A',\n\t require: 'ngModel',\n\t link: function link(scope, elm, attrs, ctrl) {\n\t ctrl.$validators.uiSelectRequired = function (modelValue, viewValue) {\n\t var determineVal;\n\t if (angular.isArray(modelValue)) {\n\t determineVal = modelValue;\n\t } else if (angular.isArray(viewValue)) {\n\t determineVal = viewValue;\n\t } else {\n\t return false;\n\t }\n\t\n\t return determineVal.length > 0;\n\t };\n\t }\n\t };\n\t}\n\t\n\tuiSelectRequired.$inject = [];\n\t\n\tmodule.exports = uiSelectRequired;\n\n/***/ },\n/* 95 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '
';\n\t }\n\t};\n\n/***/ },\n/* 96 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 97 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 98 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '
';\n\t }\n\t};\n\n/***/ },\n/* 99 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '
';\n\t }\n\t};\n\n/***/ },\n/* 100 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 101 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function FieldViewConfiguration() {\n\t this.fieldViews = {};\n\t }\n\t\n\t FieldViewConfiguration.prototype.registerFieldView = function (type, FieldView) {\n\t this.fieldViews[type] = FieldView;\n\t };\n\t\n\t FieldViewConfiguration.prototype.$get = function () {\n\t return this.fieldViews;\n\t };\n\t\n\t FieldViewConfiguration.$inject = [];\n\t\n\t return FieldViewConfiguration;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 102 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return 'error: cannot display file field as readable';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return 'error: cannot display file field as linkable';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return 'error: cannot display file field as filter';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 103 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 104 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return 'error: cannot display a json field as linkable';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 105 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 106 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return 'error: cannot display password field as readable';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return 'error: cannot display password field as linkable';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return 'error: cannot display password field as filter';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 107 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 108 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 109 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return 'error: cannot display referenced_list field as linkable';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return 'error: cannot display referenced_list field as filter';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 110 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 111 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 112 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 113 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t getReadWidget: function getReadWidget() {\n\t return '';\n\t },\n\t getLinkWidget: function getLinkWidget() {\n\t return '' + module.exports.getReadWidget() + '';\n\t },\n\t getFilterWidget: function getFilterWidget() {\n\t return '';\n\t },\n\t getWriteWidget: function getWriteWidget() {\n\t return '';\n\t }\n\t};\n\n/***/ },\n/* 114 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _ = __webpack_require__(23);\n\t\n\tfunction maFilterDirective(FieldViewConfiguration) {\n\t 'use strict';\n\t\n\t var filterWidgetTypes = _(FieldViewConfiguration).map(function (fieldView, field) {\n\t return '' + fieldView.getFilterWidget() + '';\n\t }).join('');\n\t\n\t var template = '\\n
\\n
\\n
\\n
\\n \\n
\\n \\n
\\n ' + filterWidgetTypes + '\\n
\\n
\\n
\\n
\\n ';\n\t\n\t return {\n\t restrict: 'E',\n\t template: template,\n\t scope: {\n\t filters: '=',\n\t datastore: '&',\n\t values: '=',\n\t removeFilter: '&'\n\t },\n\t link: function link(scope) {\n\t scope.datastore = scope.datastore();\n\t scope.removeFilter = scope.removeFilter();\n\t scope.shouldFilter = function () {\n\t return Object.keys(scope.filters).length;\n\t };\n\t }\n\t };\n\t}\n\t\n\tmaFilterDirective.$inject = ['FieldViewConfiguration'];\n\t\n\tmodule.exports = maFilterDirective;\n\n/***/ },\n/* 115 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction maFilterButtonDirective() {\n\t 'use strict';\n\t\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t filters: '&',\n\t enabledFilters: '=',\n\t enableFilter: '&'\n\t },\n\t link: function link(scope) {\n\t scope.notYetEnabledFilters = function () {\n\t return scope.filters().filter(function (filter) {\n\t return scope.enabledFilters.indexOf(filter) === -1;\n\t });\n\t };\n\t scope.hasFilters = function () {\n\t return scope.notYetEnabledFilters().length > 0;\n\t };\n\t },\n\t template: '\\n \\n \\n'\n\t };\n\t}\n\t\n\tmaFilterButtonDirective.$inject = [];\n\t\n\tmodule.exports = maFilterButtonDirective;\n\n/***/ },\n/* 116 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar FormController = function FormController($scope, $state, WriteQueries, Configuration, progression, notification, view, dataStore) {\n\t\n\t this.$scope = $scope;\n\t this.$state = $state;\n\t this.WriteQueries = WriteQueries;\n\t this.dataStore = dataStore;\n\t this.progression = progression;\n\t this.notification = notification;\n\t this.title = view.title();\n\t this.description = view.description();\n\t this.actions = view.actions();\n\t this.fields = view.fields();\n\t this.config = Configuration();\n\t this.view = view;\n\t this.entity = this.view.getEntity();\n\t this.$scope.entry = dataStore.getFirstEntry(this.entity.uniqueId);\n\t this.$scope.view = view;\n\t this.$scope.entity = this.entity;\n\t\n\t // in case of entity identifier being modified\n\t this.originEntityId = this.$scope.entry.values[this.entity.identifier().name()];\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t};\n\t\n\tFormController.prototype.validateEntry = function () {\n\t if (!this.form.$valid) {\n\t this.notification.log('invalid form', { addnCls: 'humane-flatty-error' });\n\t return false;\n\t }\n\t\n\t try {\n\t this.view.validate(this.$scope.entry);\n\t } catch (e) {\n\t this.notification.log(e, { addnCls: 'humane-flatty-error' });\n\t return false;\n\t }\n\t\n\t return true;\n\t};\n\t\n\tFormController.prototype.submitCreation = function ($event) {\n\t var _this = this;\n\t\n\t $event.preventDefault();\n\t if (!this.validateEntry()) {\n\t return;\n\t }\n\t var entity = this.entity;\n\t var view = this.view;\n\t var route = !entity.editionView().enabled ? 'show' : 'edit';\n\t var restEntry = this.$scope.entry.transformToRest(view.fields());\n\t this.progression.start();\n\t this.WriteQueries.createOne(view, restEntry).then(function (rawEntry) {\n\t _this.progression.done();\n\t _this.notification.log('Element successfully created.', { addnCls: 'humane-flatty-success' });\n\t var entry = view.mapEntry(rawEntry);\n\t _this.$state.go(_this.$state.get(route), { entity: entity.name(), id: entry.identifierValue });\n\t }, this.handleError.bind(this));\n\t};\n\t\n\tFormController.prototype.submitEdition = function ($event) {\n\t var _this2 = this;\n\t\n\t $event.preventDefault();\n\t if (!this.validateEntry()) {\n\t return;\n\t }\n\t var view = this.view;\n\t var restEntry = this.$scope.entry.transformToRest(view.fields());\n\t this.progression.start();\n\t this.WriteQueries.updateOne(view, restEntry, this.originEntityId).then(function () {\n\t _this2.progression.done();\n\t _this2.notification.log('Changes successfully saved.', { addnCls: 'humane-flatty-success' });\n\t }, this.handleError.bind(this));\n\t};\n\t\n\t/**\n\t * Handle create or update errors\n\t *\n\t * @param {Object} response\n\t */\n\tFormController.prototype.handleError = function (response) {\n\t var errorMessage = this.config.getErrorMessageFor(this.view, response);\n\t\n\t this.progression.done();\n\t this.notification.log(errorMessage, { addnCls: 'humane-flatty-error' });\n\t};\n\t\n\tFormController.prototype.destroy = function () {\n\t this.$scope = undefined;\n\t this.$state = undefined;\n\t this.WriteQueries = undefined;\n\t this.dataStore = undefined;\n\t this.view = undefined;\n\t this.entity = undefined;\n\t};\n\t\n\tFormController.$inject = ['$scope', '$state', 'WriteQueries', 'NgAdminConfiguration', 'progression', 'notification', 'view', 'dataStore'];\n\t\n\tmodule.exports = FormController;\n\n/***/ },\n/* 117 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t var ListController = function ListController($scope, $stateParams, $location, $anchorScroll, ReadQueries, progression, view, dataStore, totalItems) {\n\t this.$scope = $scope;\n\t this.$stateParams = $stateParams;\n\t this.$location = $location;\n\t this.$anchorScroll = $anchorScroll;\n\t this.ReadQueries = ReadQueries;\n\t this.progression = progression;\n\t this.view = view;\n\t this.entity = view.getEntity();\n\t this.loadingPage = false;\n\t this.search = $stateParams.search;\n\t this.dataStore = dataStore;\n\t this.fields = view.fields();\n\t this.listActions = view.listActions();\n\t this.totalItems = totalItems;\n\t this.page = $stateParams.page || 1;\n\t this.infinitePagination = this.view.infinitePagination();\n\t this.nextPageCallback = this.nextPage.bind(this);\n\t this.setPageCallback = this.setPage.bind(this);\n\t this.sortField = this.$stateParams.sortField || this.view.getSortFieldName();\n\t this.sortDir = this.$stateParams.sortDir || this.view.sortDir();\n\t\n\t if ($scope.selectionUpdater) {\n\t $scope.selection = $scope.selection || [];\n\t $scope.$watch('selection', $scope.selectionUpdater);\n\t } else {\n\t $scope.selection = null;\n\t }\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t };\n\t\n\t ListController.prototype.nextPage = function (page) {\n\t var _this = this;\n\t\n\t if (this.loadingPage) {\n\t return;\n\t }\n\t\n\t var view = this.view,\n\t dataStore = this.dataStore;\n\t\n\t this.progression.start();\n\t\n\t this.ReadQueries.getAll(view, page, this.search, this.sortField, this.sortDir).then(function (response) {\n\t _this.progression.done();\n\t var references = view.getReferences();\n\t\n\t view.mapEntries(response.data).map(function (entry) {\n\t dataStore.fillReferencesValuesFromEntry(entry, references, true);\n\t dataStore.addEntry(_this.entity.uniqueId, entry);\n\t });\n\t\n\t _this.loadingPage = false;\n\t });\n\t };\n\t\n\t ListController.prototype.setPage = function (number) {\n\t this.$location.search('page', number);\n\t this.$anchorScroll(0);\n\t };\n\t\n\t ListController.prototype.destroy = function () {\n\t this.$scope = undefined;\n\t this.$stateParams = undefined;\n\t this.$location = undefined;\n\t this.$anchorScroll = undefined;\n\t this.dataStore = undefined;\n\t };\n\t\n\t ListController.$inject = ['$scope', '$stateParams', '$location', '$anchorScroll', 'ReadQueries', 'progression', 'view', 'dataStore', 'totalItems'];\n\t\n\t return ListController;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 118 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar ListLayoutController = function ListLayoutController($scope, $stateParams, $state, $location, $timeout, view, dataStore) {\n\t var _this = this;\n\t\n\t this.$scope = $scope;\n\t this.$state = $state;\n\t this.$stateParams = $stateParams;\n\t this.$timeout = $timeout;\n\t this.view = view;\n\t this.dataStore = dataStore;\n\t this.entity = view.getEntity();\n\t this.actions = view.actions();\n\t this.batchActions = view.batchActions();\n\t this.loadingPage = false;\n\t this.search = $location.search().search ? JSON.parse($location.search().search) : {};\n\t // since search isn't a $stateParam of the listLayout state,\n\t // the controller doesn't change when the search changes\n\t // so we must update filter values manually when the location changes\n\t $scope.$watch(function () {\n\t return $location.search() && $location.search().search;\n\t }, function (newval, oldval) {\n\t if (newval === oldval) return;\n\t _this.search = $location.search().search ? JSON.parse($location.search().search) : {};\n\t _this.enabledFilters = _this.getEnabledFilters();\n\t });\n\t // apply filters when filter values change\n\t $scope.$watch(function () {\n\t return _this.search;\n\t }, _.debounce(function (newValues, oldValues) {\n\t if (newValues != oldValues) {\n\t _this.updateFilters();\n\t }\n\t }, 500), true);\n\t this.filters = view.filters();\n\t this.enabledFilters = this.getEnabledFilters();\n\t this.hasFilters = Object.keys(this.filters).length > 0;\n\t this.focusedFilterId = null;\n\t this.enableFilter = this.enableFilter.bind(this);\n\t this.removeFilter = this.removeFilter.bind(this);\n\t if (this.batchActions.length) {\n\t // required in scope to communicate with listView\n\t $scope.selectionUpdater = function (selection) {\n\t return $scope.selection = selection;\n\t };\n\t $scope.selection = [];\n\t }\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t};\n\t\n\tListLayoutController.prototype.enableFilter = function (filter) {\n\t var _this2 = this;\n\t\n\t var defaultValue = filter.defaultValue();\n\t if (defaultValue !== null) {\n\t this.search[filter.name()] = defaultValue;\n\t }\n\t this.enabledFilters.push(filter);\n\t this.focusedFilterId = filter.name();\n\t this.$timeout(function () {\n\t var el = window.document.getElementById(_this2.focusedFilterId);\n\t el && el.focus && el.focus();\n\t }, 200, false);\n\t};\n\t\n\tListLayoutController.prototype.getEnabledFilters = function () {\n\t var _this3 = this;\n\t\n\t return this.filters.filter(function (filter) {\n\t if (filter.pinned()) return true;\n\t return _this3.search && filter.name() in _this3.search;\n\t });\n\t};\n\t\n\tListLayoutController.prototype.updateFilters = function () {\n\t var values = {},\n\t filters = this.enabledFilters,\n\t fieldName,\n\t field,\n\t i;\n\t for (i in filters) {\n\t field = filters[i];\n\t fieldName = field.name();\n\t if (this.search[fieldName] === '') {\n\t delete this.search[fieldName];\n\t continue;\n\t }\n\t\n\t if (field.type() === 'boolean' && this.search[fieldName] || // for boolean false is the same as null\n\t field.type() !== 'boolean' && this.search[fieldName] !== null) {\n\t values[fieldName] = this.search[fieldName];\n\t }\n\t }\n\t this.$stateParams.search = values;\n\t this.$stateParams.page = 1;\n\t this.$state.go('list', this.$stateParams);\n\t};\n\t\n\tListLayoutController.prototype.removeFilter = function (filter) {\n\t delete this.search[filter.name()];\n\t this.enabledFilters = this.enabledFilters.filter(function (f) {\n\t return f !== filter;\n\t });\n\t};\n\t\n\tListLayoutController.prototype.destroy = function () {\n\t this.$scope = undefined;\n\t this.$state = undefined;\n\t this.$stateParams = undefined;\n\t this.$timeout = undefined;\n\t this.dataStore = undefined;\n\t};\n\t\n\tListLayoutController.$inject = ['$scope', '$stateParams', '$state', '$location', '$timeout', 'view', 'dataStore'];\n\t\n\tmodule.exports = ListLayoutController;\n\n/***/ },\n/* 119 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t var maDatagridController = __webpack_require__(120);\n\t\n\t function maDatagridDirective() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t name: '@',\n\t entries: '=',\n\t selection: '=',\n\t fields: '&',\n\t listActions: '&',\n\t entity: '&'\n\t },\n\t controllerAs: 'datagrid',\n\t controller: maDatagridController,\n\t template: '\\n \\n \\n \\n \\n \\n \\n \\n\\n \\n \\n \\n \\n \\n \\n \\n
\\n \\n \\n \\n \\n\\n {{ field.label() }}\\n \\n \\n Actions\\n
\\n \\n \\n \\n \\n \\n
'\n\t };\n\t }\n\t\n\t maDatagridDirective.$inject = [];\n\t\n\t return maDatagridDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 120 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t /**\n\t *\n\t * @param {$scope} $scope\n\t * @param {$location} $location\n\t * @param {$stateParams} $stateParams\n\t * @param {$anchorScroll} $anchorScroll\n\t *\n\t * @constructor\n\t */\n\t function DatagridController($scope, $location, $stateParams, $anchorScroll) {\n\t $scope.entity = $scope.entity();\n\t this.$scope = $scope;\n\t this.$location = $location;\n\t this.$anchorScroll = $anchorScroll;\n\t this.filters = {};\n\t this.shouldDisplayActions = this.$scope.listActions() && this.$scope.listActions().length > 0;\n\t\n\t $scope.toggleSelect = this.toggleSelect.bind(this);\n\t $scope.toggleSelectAll = this.toggleSelectAll.bind(this);\n\t\n\t this.sortField = 'sortField' in $stateParams ? $stateParams.sortField : null;\n\t this.sortDir = 'sortDir' in $stateParams ? $stateParams.sortDir : null;\n\t }\n\t\n\t /**\n\t * Return true if a column is being sorted\n\t *\n\t * @param {Field} field\n\t *\n\t * @returns {Boolean}\n\t */\n\t DatagridController.prototype.isSorting = function (field) {\n\t return this.sortField === this.getSortName(field);\n\t };\n\t\n\t /**\n\t * Return 'even'|'odd' based on the index parameter\n\t *\n\t * @param {Number} index\n\t * @returns {string}\n\t */\n\t DatagridController.prototype.itemClass = function (index) {\n\t return index % 2 === 0 ? 'even' : 'odd';\n\t };\n\t\n\t /**\n\t *\n\t * @param {Field} field\n\t */\n\t DatagridController.prototype.sort = function (field) {\n\t var dir = 'ASC',\n\t fieldName = this.getSortName(field);\n\t\n\t if (this.sortField === fieldName) {\n\t dir = this.sortDir === 'ASC' ? 'DESC' : 'ASC';\n\t }\n\t\n\t this.$location.search('sortField', fieldName);\n\t this.$location.search('sortDir', dir);\n\t };\n\t\n\t /**\n\t * Return fieldName like (view.fieldName) to sort\n\t *\n\t * @param {Field} field\n\t *\n\t * @returns {String}\n\t */\n\t DatagridController.prototype.getSortName = function (field) {\n\t return this.$scope.name + '.' + field.name();\n\t };\n\t\n\t DatagridController.prototype.toggleSelect = function (entry) {\n\t var selection = this.$scope.selection.slice();\n\t\n\t var index = selection.indexOf(entry);\n\t\n\t if (index === -1) {\n\t this.$scope.selection = selection.concat(entry);\n\t return;\n\t }\n\t selection.splice(index, 1);\n\t this.$scope.selection = selection;\n\t };\n\t\n\t DatagridController.prototype.toggleSelectAll = function () {\n\t\n\t if (this.$scope.selection.length < this.$scope.entries.length) {\n\t this.$scope.selection = this.$scope.entries;\n\t return;\n\t }\n\t\n\t this.$scope.selection = [];\n\t };\n\t\n\t DatagridController.$inject = ['$scope', '$location', '$stateParams', '$anchorScroll'];\n\t\n\t return DatagridController;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 121 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t var angular = __webpack_require__(4);\n\t\n\t function DatagridInfinitePaginationDirective($window, $document) {\n\t\n\t var windowElement = angular.element($window);\n\t var offset = 100,\n\t body = $document[0].body;\n\t\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t perPage: '@',\n\t totalItems: '@',\n\t nextPage: '&'\n\t },\n\t link: function link(scope) {\n\t var perPage = parseInt(scope.perPage, 10) || 1,\n\t totalItems = parseInt(scope.totalItems, 10),\n\t nbPages = Math.ceil(totalItems / perPage) || 1,\n\t page = 1;\n\t function handler() {\n\t if (body.offsetHeight - $window.innerHeight - $window.scrollY < offset) {\n\t if (page >= nbPages) {\n\t return;\n\t }\n\t page++;\n\t scope.nextPage()(page);\n\t }\n\t }\n\t windowElement.bind('scroll', handler);\n\t scope.$on('$destroy', function destroy() {\n\t windowElement.unbind('scroll', handler);\n\t });\n\t }\n\t };\n\t }\n\t\n\t DatagridInfinitePaginationDirective.$inject = ['$window', '$document'];\n\t\n\t return DatagridInfinitePaginationDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 122 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function DatagridItemSelectorDirective() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entry: '=',\n\t selection: '=',\n\t toggleSelect: '&'\n\t },\n\t template: '',\n\t link: function link(scope) {\n\t scope.toggle = function (entry) {\n\t return scope.toggleSelect({ entry: entry });\n\t };\n\t var e = scope.entry;\n\t scope.isInSelection = function () {\n\t return scope.selection.filter(function (s) {\n\t return s._entityName == e._entityName && s._identifierValue == e._identifierValue;\n\t }).length > 0;\n\t };\n\t }\n\t };\n\t }\n\t\n\t DatagridItemSelectorDirective.$inject = [];\n\t\n\t return DatagridItemSelectorDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 123 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function DatagridMultiSelectorDirective() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t entries: '=',\n\t selection: '=',\n\t toggleSelectAll: '&'\n\t },\n\t template: '',\n\t link: function link(scope, element) {\n\t scope.$watch('selection', function (selection) {\n\t element.children()[0].indeterminate = selection.length > 0 && selection.length != scope.entries.length;\n\t });\n\t scope.$watch('entries', function (entries) {\n\t element.children()[0].indeterminate = scope.selection.length > 0 && scope.selection.length != entries.length;\n\t });\n\t }\n\t };\n\t }\n\t\n\t DatagridMultiSelectorDirective.$inject = [];\n\t\n\t return DatagridMultiSelectorDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 124 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t var paginationView = __webpack_require__(157),\n\t DatagridPaginationController = __webpack_require__(125);\n\t\n\t function DatagridPaginationDirective() {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t page: '@',\n\t perPage: '@',\n\t totalItems: '@',\n\t setPage: '&'\n\t },\n\t template: paginationView,\n\t controllerAs: 'paginationCtrl',\n\t controller: DatagridPaginationController\n\t };\n\t }\n\t\n\t DatagridPaginationDirective.$inject = [];\n\t\n\t return DatagridPaginationDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 125 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t var angular = __webpack_require__(4);\n\t\n\t function DatagridPaginationController($scope) {\n\t this.$scope = $scope;\n\t var perPage = parseInt(this.$scope.perPage, 10) || 1,\n\t totalItems = parseInt(this.$scope.totalItems, 10),\n\t page = Math.max(parseInt(this.$scope.page, 10), 1);\n\t\n\t this.nbPages = Math.ceil(totalItems / perPage) || 1;\n\t this.page = Math.min(this.nbPages, page);\n\t this.offsetEnd = Math.min(this.page * perPage, totalItems);\n\t this.offsetBegin = Math.min((this.page - 1) * perPage + 1, this.offsetEnd);\n\t this.totalItems = totalItems;\n\t this.displayPagination = perPage < totalItems;\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t }\n\t\n\t /**\n\t * Return an array with the range between min & max, useful for pagination\n\t *\n\t * @param {int} min\n\t * @param {int} max\n\t * @returns {Array}\n\t */\n\t DatagridPaginationController.prototype.range = function (page) {\n\t var input = [],\n\t nbPages = this.nbPages;\n\t\n\t // display page links around the current page\n\t if (page > 2) {\n\t input.push('1');\n\t }\n\t if (page == 4) {\n\t input.push('2');\n\t }\n\t if (page > 4) {\n\t input.push('.');\n\t }\n\t if (page > 1) {\n\t input.push(page - 1);\n\t }\n\t input.push(page);\n\t if (page < nbPages) {\n\t input.push(page + 1);\n\t }\n\t if (page == nbPages - 3) {\n\t input.push(nbPages - 1);\n\t }\n\t if (page < nbPages - 3) {\n\t input.push('.');\n\t }\n\t if (page < nbPages - 1) {\n\t input.push(nbPages);\n\t }\n\t\n\t return input;\n\t };\n\t\n\t /**\n\t * Link to page number of the list\n\t *\n\t * @param {int} number\n\t */\n\t DatagridPaginationController.prototype.setPage = function (number) {\n\t if (number <= 0 || number > this.nbPages) {\n\t return;\n\t }\n\t this.$scope.setPage()(number);\n\t };\n\t\n\t DatagridPaginationController.prototype.destroy = function () {\n\t this.$scope = undefined;\n\t };\n\t\n\t DatagridPaginationController.$inject = ['$scope'];\n\t\n\t return DatagridPaginationController;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 126 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function ListActionsDirective() {\n\t\n\t return {\n\t restrict: 'E',\n\t transclude: true,\n\t scope: {\n\t 'buttons': '&',\n\t 'entry': '&',\n\t 'entity': '&'\n\t },\n\t link: function link($scope) {\n\t $scope.buttons = $scope.buttons();\n\t $scope.entry = $scope.entry();\n\t $scope.entity = $scope.entity();\n\t $scope.customTemplate = false;\n\t if (typeof $scope.buttons === 'string') {\n\t $scope.customTemplate = $scope.buttons;\n\t $scope.buttons = null;\n\t }\n\t },\n\t template: '\\n \\n \\n \\n \\n \\n \\n'\n\t };\n\t }\n\t\n\t return ListActionsDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 127 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t// @see https://docs.angularjs.org/api/ng/service/$compile\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function Compile($injector) {\n\t var $compile = $injector.get('$compile');\n\t\n\t return {\n\t transclude: true,\n\t link: function link(scope, element, attrs, controller, transcludeFn) {\n\t var unbindWatcher = scope.$watch(function (scope) {\n\t // watch the 'compile' expression for changes\n\t return scope.$eval(attrs.compile);\n\t }, function (value) {\n\t if (false === value) {\n\t // use the default tag content\n\t transcludeFn(scope, function (clone) {\n\t element.append(clone);\n\t });\n\t return;\n\t }\n\t // when the 'compile' expression changes assign it into the current DOM\n\t element.html(value);\n\t\n\t // compile the new DOM and link it to the current scope.\n\t $compile(element.contents())(scope);\n\t\n\t if (attrs.compileOnce == 'true') {\n\t unbindWatcher();\n\t };\n\t });\n\t }\n\t };\n\t }\n\t\n\t Compile.$inject = ['$injector'];\n\t\n\t return Compile;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 128 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function EntryFormatter($filter) {\n\t this.formatDate = function (format) {\n\t return function (date) {\n\t return $filter('date')(date, format);\n\t };\n\t };\n\t this.formatNumber = function (format) {\n\t return function (number) {\n\t return $filter('numeraljs')(number, format);\n\t };\n\t };\n\t }\n\t\n\t EntryFormatter.prototype.formatField = function formatField(field) {\n\t var label = field.label() || field.name();\n\t var type = field.type();\n\t\n\t switch (type) {\n\t case 'boolean':\n\t case 'choice':\n\t case 'choices':\n\t case 'string':\n\t case 'text':\n\t case 'wysiwyg':\n\t case 'email':\n\t case 'json':\n\t case 'file':\n\t case 'template':\n\t return function (entry) {\n\t return {\n\t name: label,\n\t value: entry.values[field.name()]\n\t };\n\t };\n\t case 'number':\n\t case 'float':\n\t var format = field.format();\n\t var formatNumber = this.formatNumber(format);\n\t return function (entry) {\n\t return {\n\t name: label,\n\t value: formatNumber(entry.values[field.name()])\n\t };\n\t };\n\t case 'date':\n\t case 'datetime':\n\t var format = field.format();\n\t if (!format) {\n\t format = type === 'date' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss';\n\t }\n\t\n\t var formatDate = this.formatDate(format);\n\t return function (entry) {\n\t return {\n\t name: label,\n\t value: formatDate(entry.values[field.name()])\n\t };\n\t };\n\t case 'reference':\n\t return function (entry) {\n\t return {\n\t name: label,\n\t value: entry.listValues[field.name()]\n\t };\n\t };\n\t case 'referenced_many':\n\t case 'referenced_list':\n\t return; //ignored\n\t }\n\t };\n\t\n\t EntryFormatter.prototype.getFormatter = function getFormatter(fields) {\n\t var fieldsFormatters = fields.map(this.formatField.bind(this));\n\t\n\t return function formatEntry(entry) {\n\t var result = {};\n\t fieldsFormatters.map(function (formatter) {\n\t if (!formatter) return;\n\t return formatter(entry);\n\t }).forEach(function (field) {\n\t if (!field) return;\n\t result[field.name] = field.value;\n\t });\n\t\n\t return result;\n\t };\n\t };\n\t\n\t EntryFormatter.$inject = ['$filter'];\n\t\n\t return EntryFormatter;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 129 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function PromisesResolver(AdminDescription) {\n\t return AdminDescription.getPromisesResolver();\n\t }\n\t\n\t PromisesResolver.$inject = ['AdminDescription'];\n\t\n\t return PromisesResolver;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 130 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function RestWrapper(Restangular) {\n\t this.Restangular = Restangular;\n\t\n\t Restangular.setFullResponse(true);\n\t }\n\t\n\t /**\n\t * Returns the promise of one resource by URL\n\t *\n\t * @param {String} entityName\n\t * @param {String} url\n\t *\n\t * @returns {promise}\n\t */\n\t RestWrapper.prototype.getOne = function (entityName, url) {\n\t return this.Restangular.oneUrl(entityName, url).get().then(function (response) {\n\t return response.data;\n\t });\n\t };\n\t\n\t /**\n\t * Returns the promise of a list of resources\n\t *\n\t * @param {Object} params\n\t * @param {String} entityName\n\t * @param {String} url\n\t *\n\t * @returns {promise}\n\t */\n\t RestWrapper.prototype.getList = function (params, entityName, url) {\n\t return this.Restangular.allUrl(entityName, url).getList(params);\n\t };\n\t\n\t RestWrapper.prototype.createOne = function (rawEntity, entityName, url, method) {\n\t var resource = this.Restangular.oneUrl(entityName, url),\n\t operation = method ? resource.customOperation(method, null, {}, {}, rawEntity) : resource.customPOST(rawEntity);\n\t\n\t return operation.then(function (response) {\n\t return response.data;\n\t });\n\t };\n\t\n\t RestWrapper.prototype.updateOne = function (rawEntity, entityName, url, method) {\n\t var resource = this.Restangular.oneUrl(entityName, url),\n\t operation = method ? resource.customOperation(method, null, {}, {}, rawEntity) : resource.customPUT(rawEntity);\n\t\n\t return operation.then(function (response) {\n\t return response.data;\n\t });\n\t };\n\t\n\t RestWrapper.prototype.deleteOne = function (entityName, url) {\n\t return this.Restangular.oneUrl(entityName, url).customDELETE();\n\t };\n\t\n\t RestWrapper.$inject = ['Restangular'];\n\t\n\t return RestWrapper;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 131 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t var viewActionsTemplate = __webpack_require__(158);\n\t\n\t function ViewActionsDirective($injector) {\n\t var $compile = $injector.get('$compile');\n\t\n\t return {\n\t restrict: 'E',\n\t transclude: true,\n\t scope: {\n\t override: '&',\n\t entry: '=',\n\t entity: '=',\n\t selection: '=',\n\t batchButtons: '&',\n\t datastore: '=',\n\t search: '=',\n\t filters: '&',\n\t enabledFilters: '=',\n\t enableFilter: '&'\n\t },\n\t template: viewActionsTemplate,\n\t link: function link($scope, element, attrs, controller, transcludeFn) {\n\t var override = $scope.override();\n\t if (!override) {\n\t // use the default tag content\n\t transcludeFn($scope, function (clone) {\n\t element.append(clone);\n\t });\n\t return;\n\t }\n\t if (typeof override == 'string') {\n\t // custom template, use it instead of default template\n\t element.html(override);\n\t $compile(element.contents())($scope);\n\t return;\n\t }\n\t // list of buttons - default template\n\t $scope.buttons = override;\n\t }\n\t };\n\t }\n\t\n\t ViewActionsDirective.$inject = ['$injector'];\n\t\n\t return ViewActionsDirective;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 132 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t /**\n\t *\n\t * @param {RestWrapper} RestWrapper\n\t * @param {Configuration} Configuration\n\t * @param {AdminDescription} AdminDescription\n\t * @param {PromisesResolver} PromisesResolver\n\t *\n\t * @returns {ReadQueries}\n\t * @constructor\n\t */\n\t function ReadQueries(RestWrapper, Configuration, AdminDescription, PromisesResolver) {\n\t return AdminDescription.getReadQueries(RestWrapper, PromisesResolver, Configuration());\n\t }\n\t\n\t ReadQueries.$inject = ['RestWrapper', 'NgAdminConfiguration', 'AdminDescription', 'PromisesResolver'];\n\t\n\t return ReadQueries;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 133 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tvar _adminConfigLibEntry = __webpack_require__(5);\n\t\n\tvar _adminConfigLibEntry2 = _interopRequireDefault(_adminConfigLibEntry);\n\t\n\tvar ReferenceRefresher = (function () {\n\t function ReferenceRefresher(ReadQueries) {\n\t _classCallCheck(this, ReferenceRefresher);\n\t\n\t this.ReadQueries = ReadQueries;\n\t }\n\t\n\t _createClass(ReferenceRefresher, [{\n\t key: 'refresh',\n\t value: function refresh(field, currentValue, search) {\n\t var _this = this;\n\t\n\t var referenceFields = {};\n\t referenceFields[field.name()] = field;\n\t\n\t var promise = this.ReadQueries.getAllReferencedData(referenceFields, search).then(function (r) {\n\t return r[field.name()];\n\t }).then(function (results) {\n\t return _this._transformRecords(field, results);\n\t });\n\t\n\t if (field.type() === 'reference_many' || field.type() === 'choices') {\n\t promise = promise.then(function (formattedResults) {\n\t return _this._removeDuplicates(formattedResults, currentValue);\n\t });\n\t }\n\t\n\t return promise;\n\t }\n\t }, {\n\t key: 'getInitialChoices',\n\t value: function getInitialChoices(field, values) {\n\t var _this2 = this;\n\t\n\t return this.ReadQueries.getRecordsByIds(field.targetEntity(), values).then(function (results) {\n\t return _this2._removeDuplicates(results, values);\n\t }).then(function (records) {\n\t return _this2._transformRecords(field, records);\n\t });\n\t }\n\t }, {\n\t key: '_removeDuplicates',\n\t value: function _removeDuplicates(results, currentValue) {\n\t // remove already assigned values: ui-select still return them if multiple\n\t if (!currentValue) {\n\t return results;\n\t }\n\t\n\t if (!Array.isArray(currentValue)) {\n\t currentValue = [currentValue];\n\t }\n\t\n\t return results.filter(function (fr) {\n\t return currentValue.indexOf(fr.value) === -1;\n\t });\n\t }\n\t }, {\n\t key: '_transformRecords',\n\t value: function _transformRecords(field, records) {\n\t var targetEntity = field.targetEntity();\n\t var targetField = field.targetField();\n\t var valueFieldName = targetEntity.identifier().name();\n\t var labelFieldName = targetField.name();\n\t return _adminConfigLibEntry2['default'].createArrayFromRest(records, [targetField], targetEntity.name(), valueFieldName).map(function (r) {\n\t return {\n\t value: r.values[valueFieldName],\n\t label: r.values[labelFieldName]\n\t };\n\t });\n\t }\n\t }]);\n\t\n\t return ReferenceRefresher;\n\t})();\n\t\n\tReferenceRefresher.$inject = ['ReadQueries'];\n\t\n\texports['default'] = ReferenceRefresher;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 134 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t /**\n\t *\n\t * @param {RestWrapper} RestWrapper\n\t * @param {Configuration} Configuration\n\t * @param {AdminDescription} AdminDescription\n\t * @param {PromisesResolver} PromisesResolver\n\t *\n\t * @returns {ReadQueries}\n\t * @constructor\n\t */\n\t function WriteQueries(RestWrapper, Configuration, AdminDescription, PromisesResolver) {\n\t return AdminDescription.getWriteQueries(RestWrapper, PromisesResolver, Configuration());\n\t }\n\t\n\t WriteQueries.$inject = ['RestWrapper', 'NgAdminConfiguration', 'AdminDescription', 'PromisesResolver'];\n\t\n\t return WriteQueries;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 135 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _adminConfigLibEntry = __webpack_require__(5);\n\t\n\tvar _adminConfigLibEntry2 = _interopRequireDefault(_adminConfigLibEntry);\n\t\n\tvar _adminConfigLibDataStoreDataStore = __webpack_require__(13);\n\t\n\tvar _adminConfigLibDataStoreDataStore2 = _interopRequireDefault(_adminConfigLibDataStoreDataStore);\n\t\n\tvar _listListLayoutHtml = __webpack_require__(156);\n\t\n\tvar _listListLayoutHtml2 = _interopRequireDefault(_listListLayoutHtml);\n\t\n\tvar _listListHtml = __webpack_require__(155);\n\t\n\tvar _listListHtml2 = _interopRequireDefault(_listListHtml);\n\t\n\tvar _showShowHtml = __webpack_require__(159);\n\t\n\tvar _showShowHtml2 = _interopRequireDefault(_showShowHtml);\n\t\n\tvar _formCreateHtml = __webpack_require__(153);\n\t\n\tvar _formCreateHtml2 = _interopRequireDefault(_formCreateHtml);\n\t\n\tvar _formEditHtml = __webpack_require__(154);\n\t\n\tvar _formEditHtml2 = _interopRequireDefault(_formEditHtml);\n\t\n\tvar _deleteDeleteHtml = __webpack_require__(152);\n\t\n\tvar _deleteDeleteHtml2 = _interopRequireDefault(_deleteDeleteHtml);\n\t\n\tvar _deleteBatchDeleteHtml = __webpack_require__(151);\n\t\n\tvar _deleteBatchDeleteHtml2 = _interopRequireDefault(_deleteBatchDeleteHtml);\n\t\n\tfunction templateProvider(viewName, defaultView) {\n\t return ['$stateParams', 'NgAdminConfiguration', function ($stateParams, Configuration) {\n\t var customTemplate;\n\t var view = Configuration().getViewByEntityAndType($stateParams.entity, viewName);\n\t customTemplate = view.template();\n\t if (customTemplate) return customTemplate;\n\t customTemplate = Configuration().customTemplate()(viewName);\n\t if (customTemplate) return customTemplate;\n\t return defaultView;\n\t }];\n\t}\n\t\n\tfunction viewProvider(viewName) {\n\t return ['$stateParams', 'NgAdminConfiguration', function ($stateParams, Configuration) {\n\t var view;\n\t try {\n\t view = Configuration().getViewByEntityAndType($stateParams.entity, viewName);\n\t } catch (e) {\n\t var error404 = new Error('Unknown view or entity name');\n\t error404.status = 404; // trigger the 404 error\n\t throw error404;\n\t }\n\t if (!view.enabled) {\n\t throw new Error('The ' + viewName + ' is disabled for this entity');\n\t }\n\t return view;\n\t }];\n\t}\n\t\n\tfunction routing($stateProvider) {\n\t\n\t $stateProvider.state('listLayout', {\n\t abstract: true,\n\t url: '/:entity/list',\n\t params: {\n\t entity: null\n\t },\n\t parent: 'main',\n\t controller: 'ListLayoutController',\n\t controllerAs: 'llCtrl',\n\t templateProvider: templateProvider('ListView', _listListLayoutHtml2['default']),\n\t resolve: {\n\t dataStore: function dataStore() {\n\t return new _adminConfigLibDataStoreDataStore2['default']();\n\t },\n\t view: viewProvider('ListView'),\n\t filterData: ['ReadQueries', 'view', function (ReadQueries, view) {\n\t return ReadQueries.getAllReferencedData(view.getFilterReferences(false));\n\t }],\n\t filterEntries: ['dataStore', 'view', 'filterData', function (dataStore, view, filterData) {\n\t var filters = view.getFilterReferences(false);\n\t var filterEntries;\n\t\n\t for (var name in filterData) {\n\t filterEntries = _adminConfigLibEntry2['default'].createArrayFromRest(filterData[name], [filters[name].targetField()], filters[name].targetEntity().name(), filters[name].targetEntity().identifier().name());\n\t\n\t dataStore.setEntries(filters[name].targetEntity().uniqueId + '_choices', filterEntries);\n\t }\n\t\n\t return true;\n\t }]\n\t }\n\t }).state('list', {\n\t url: '?{search:json}&{page:int}&sortField&sortDir',\n\t params: {\n\t page: { value: 1, squash: true },\n\t search: { value: {}, squash: true },\n\t sortField: null,\n\t sortDir: null\n\t },\n\t parent: 'listLayout',\n\t views: {\n\t grid: {\n\t controller: 'ListController',\n\t controllerAs: 'listController',\n\t template: _listListHtml2['default'],\n\t resolve: {\n\t dataStore: function dataStore() {\n\t return new _adminConfigLibDataStoreDataStore2['default']();\n\t },\n\t view: viewProvider('ListView'),\n\t response: ['$stateParams', 'ReadQueries', 'view', function ($stateParams, ReadQueries, view) {\n\t var page = $stateParams.page,\n\t filters = $stateParams.search,\n\t sortField = $stateParams.sortField,\n\t sortDir = $stateParams.sortDir;\n\t\n\t return ReadQueries.getAll(view, page, filters, sortField, sortDir);\n\t }],\n\t totalItems: ['response', function (response) {\n\t return response.totalItems;\n\t }],\n\t nonOptimizedReferencedData: ['ReadQueries', 'view', 'response', function (ReadQueries, view, response) {\n\t return ReadQueries.getFilteredReferenceData(view.getNonOptimizedReferences(), response.data);\n\t }],\n\t optimizedReferencedData: ['ReadQueries', 'view', 'response', function (ReadQueries, view, response) {\n\t return ReadQueries.getOptimizedReferencedData(view.getOptimizedReferences(), response.data);\n\t }],\n\t referencedEntries: ['dataStore', 'view', 'nonOptimizedReferencedData', 'optimizedReferencedData', function (dataStore, view, nonOptimizedReferencedData, optimizedReferencedData) {\n\t var references = view.getReferences(),\n\t referencedData = angular.extend(nonOptimizedReferencedData, optimizedReferencedData);\n\t\n\t for (var name in referencedData) {\n\t _adminConfigLibEntry2['default'].createArrayFromRest(referencedData[name], [references[name].targetField()], references[name].targetEntity().name(), references[name].targetEntity().identifier().name()).map(function (entry) {\n\t return dataStore.addEntry(references[name].targetEntity().uniqueId + '_values', entry);\n\t });\n\t }\n\t\n\t return true;\n\t }],\n\t entries: ['dataStore', 'view', 'response', 'referencedEntries', function (dataStore, view, response, referencedEntries) {\n\t var entries = view.mapEntries(response.data);\n\t\n\t // shortcut to diplay collection of entry with included referenced values\n\t dataStore.fillReferencesValuesFromCollection(entries, view.getReferences(), true);\n\t\n\t // set entries here ???\n\t dataStore.setEntries(view.getEntity().uniqueId, entries);\n\t\n\t return true;\n\t }]\n\t }\n\t }\n\t }\n\t });\n\t\n\t $stateProvider.state('show', {\n\t parent: 'main',\n\t url: '/:entity/show/:id?sortField&sortDir',\n\t controller: 'ShowController',\n\t controllerAs: 'showController',\n\t templateProvider: templateProvider('ShowView', _showShowHtml2['default']),\n\t params: {\n\t entity: null,\n\t id: null,\n\t page: { value: 1, squash: true },\n\t search: { value: {}, squash: true },\n\t sortField: null,\n\t sortDir: null\n\t },\n\t resolve: {\n\t dataStore: function dataStore() {\n\t return new _adminConfigLibDataStoreDataStore2['default']();\n\t },\n\t view: viewProvider('ShowView'),\n\t rawEntry: ['$stateParams', 'ReadQueries', 'view', function ($stateParams, ReadQueries, view) {\n\t return ReadQueries.getOne(view.getEntity(), view.type, $stateParams.id, view.identifier(), view.getUrl());\n\t }],\n\t entry: ['view', 'rawEntry', function (view, rawEntry) {\n\t return view.mapEntry(rawEntry);\n\t }],\n\t nonOptimizedReferencedData: ['ReadQueries', 'view', 'entry', function (ReadQueries, view, entry) {\n\t return ReadQueries.getFilteredReferenceData(view.getNonOptimizedReferences(), [entry.values]);\n\t }],\n\t optimizedReferencedData: ['ReadQueries', 'view', 'entry', function (ReadQueries, view, entry) {\n\t return ReadQueries.getOptimizedReferencedData(view.getOptimizedReferences(), [entry.values]);\n\t }],\n\t referencedEntries: ['dataStore', 'view', 'nonOptimizedReferencedData', 'optimizedReferencedData', function (dataStore, view, nonOptimizedReferencedData, optimizedReferencedData) {\n\t var references = view.getReferences(),\n\t referencedData = angular.extend(nonOptimizedReferencedData, optimizedReferencedData);\n\t\n\t for (var name in referencedData) {\n\t _adminConfigLibEntry2['default'].createArrayFromRest(referencedData[name], [references[name].targetField()], references[name].targetEntity().name(), references[name].targetEntity().identifier().name()).map(function (entry) {\n\t return dataStore.addEntry(references[name].targetEntity().uniqueId + '_values', entry);\n\t });\n\t }\n\t\n\t return true;\n\t }],\n\t referencedListData: ['$stateParams', 'ReadQueries', 'view', 'entry', function ($stateParams, ReadQueries, view, entry) {\n\t var referencedLists = view.getReferencedLists();\n\t var sortField = $stateParams.sortField;\n\t var sortDir = $stateParams.sortDir;\n\t\n\t return ReadQueries.getReferencedListData(referencedLists, sortField, sortDir, entry.identifierValue);\n\t }],\n\t referencedListEntries: ['dataStore', 'view', 'referencedListData', function (dataStore, view, referencedListData) {\n\t var referencedLists = view.getReferencedLists();\n\t var referencedList;\n\t var referencedListEntries;\n\t\n\t for (var i in referencedLists) {\n\t referencedList = referencedLists[i];\n\t referencedListEntries = referencedListData[i];\n\t\n\t _adminConfigLibEntry2['default'].createArrayFromRest(referencedListEntries, referencedList.targetFields(), referencedList.targetEntity().name(), referencedList.targetEntity().identifier().name()).map(function (entry) {\n\t return dataStore.addEntry(referencedList.targetEntity().uniqueId + '_list', entry);\n\t });\n\t }\n\t }],\n\t entryWithReferences: ['dataStore', 'view', 'entry', 'referencedEntries', function (dataStore, view, entry, referencedEntries) {\n\t dataStore.fillReferencesValuesFromEntry(entry, view.getReferences(), true);\n\t\n\t dataStore.addEntry(view.getEntity().uniqueId, entry);\n\t\n\t return true;\n\t }]\n\t }\n\t });\n\t\n\t $stateProvider.state('create', {\n\t parent: 'main',\n\t url: '/:entity/create',\n\t controller: 'FormController',\n\t controllerAs: 'formController',\n\t templateProvider: templateProvider('CreateView', _formCreateHtml2['default']),\n\t params: {\n\t page: { value: 1, squash: true },\n\t search: { value: {}, squash: true },\n\t sortField: null,\n\t sortDir: null\n\t },\n\t resolve: {\n\t dataStore: function dataStore() {\n\t return new _adminConfigLibDataStoreDataStore2['default']();\n\t },\n\t view: viewProvider('CreateView'),\n\t entry: ['dataStore', 'view', function (dataStore, view) {\n\t var entry = _adminConfigLibEntry2['default'].createForFields(view.getFields(), view.entity.name());\n\t dataStore.addEntry(view.getEntity().uniqueId, entry);\n\t\n\t return entry;\n\t }],\n\t choiceData: ['ReadQueries', 'view', function (ReadQueries, view) {\n\t return ReadQueries.getAllReferencedData(view.getReferences(false));\n\t }],\n\t choiceEntries: ['dataStore', 'view', 'choiceData', function (dataStore, view, filterData) {\n\t var choices = view.getReferences(false);\n\t var choiceEntries;\n\t\n\t for (var name in filterData) {\n\t choiceEntries = _adminConfigLibEntry2['default'].createArrayFromRest(filterData[name], [choices[name].targetField()], choices[name].targetEntity().name(), choices[name].targetEntity().identifier().name());\n\t\n\t dataStore.setEntries(choices[name].targetEntity().uniqueId + '_choices', choiceEntries);\n\t }\n\t\n\t return true;\n\t }]\n\t }\n\t });\n\t\n\t $stateProvider.state('edit', {\n\t parent: 'main',\n\t url: '/:entity/edit/:id?sortField&sortDir',\n\t controller: 'FormController',\n\t controllerAs: 'formController',\n\t templateProvider: templateProvider('EditView', _formEditHtml2['default']),\n\t params: {\n\t entity: null,\n\t id: null,\n\t page: { value: 1, squash: true },\n\t search: { value: {}, squash: true },\n\t sortField: null,\n\t sortDir: null\n\t },\n\t resolve: {\n\t dataStore: function dataStore() {\n\t return new _adminConfigLibDataStoreDataStore2['default']();\n\t },\n\t view: viewProvider('EditView'),\n\t rawEntry: ['$stateParams', 'ReadQueries', 'view', function ($stateParams, ReadQueries, view) {\n\t return ReadQueries.getOne(view.getEntity(), view.type, $stateParams.id, view.identifier(), view.getUrl());\n\t }],\n\t entry: ['view', 'rawEntry', function (view, rawEntry) {\n\t return view.mapEntry(rawEntry);\n\t }],\n\t nonOptimizedReferencedData: ['ReadQueries', 'view', 'entry', function (ReadQueries, view, entry) {\n\t return ReadQueries.getFilteredReferenceData(view.getNonOptimizedReferences(), [entry.values]);\n\t }],\n\t optimizedReferencedData: ['ReadQueries', 'view', 'entry', function (ReadQueries, view, entry) {\n\t return ReadQueries.getOptimizedReferencedData(view.getOptimizedReferences(), [entry.values]);\n\t }],\n\t referencedEntries: ['dataStore', 'view', 'nonOptimizedReferencedData', 'optimizedReferencedData', function (dataStore, view, nonOptimizedReferencedData, optimizedReferencedData) {\n\t var references = view.getReferences(),\n\t referencedData = angular.extend(nonOptimizedReferencedData, optimizedReferencedData);\n\t\n\t for (var name in referencedData) {\n\t _adminConfigLibEntry2['default'].createArrayFromRest(referencedData[name], [references[name].targetField()], references[name].targetEntity().name(), references[name].targetEntity().identifier().name()).map(function (entry) {\n\t return dataStore.addEntry(references[name].targetEntity().uniqueId + '_values', entry);\n\t });\n\t }\n\t\n\t return true;\n\t }],\n\t referencedListData: ['$stateParams', 'ReadQueries', 'view', 'entry', function ($stateParams, ReadQueries, view, entry) {\n\t var referencedLists = view.getReferencedLists();\n\t var sortField = $stateParams.sortField;\n\t var sortDir = $stateParams.sortDir;\n\t\n\t return ReadQueries.getReferencedListData(referencedLists, sortField, sortDir, entry.identifierValue);\n\t }],\n\t referencedListEntries: ['dataStore', 'view', 'referencedListData', function (dataStore, view, referencedListData) {\n\t var referencedLists = view.getReferencedLists();\n\t var referencedList;\n\t var referencedListEntries;\n\t\n\t for (var i in referencedLists) {\n\t referencedList = referencedLists[i];\n\t referencedListEntries = referencedListData[i];\n\t\n\t referencedListEntries = _adminConfigLibEntry2['default'].createArrayFromRest(referencedListEntries, referencedList.targetFields(), referencedList.targetEntity().name(), referencedList.targetEntity().identifier().name());\n\t\n\t dataStore.setEntries(referencedList.targetEntity().uniqueId + '_list', referencedListEntries);\n\t }\n\t }],\n\t entryWithReferences: ['dataStore', 'view', 'entry', 'referencedEntries', function (dataStore, view, entry, referencedEntries) {\n\t dataStore.fillReferencesValuesFromEntry(entry, view.getReferences(), true);\n\t\n\t dataStore.addEntry(view.getEntity().uniqueId, entry);\n\t return true;\n\t }],\n\t choiceData: ['ReadQueries', 'view', function (ReadQueries, view) {\n\t return ReadQueries.getAllReferencedData(view.getReferences(false));\n\t }],\n\t choiceEntries: ['dataStore', 'view', 'choiceData', function (dataStore, view, filterData) {\n\t var choices = view.getReferences(false);\n\t var choiceEntries;\n\t\n\t for (var name in filterData) {\n\t choiceEntries = _adminConfigLibEntry2['default'].createArrayFromRest(filterData[name], [choices[name].targetField()], choices[name].targetEntity().name(), choices[name].targetEntity().identifier().name());\n\t\n\t dataStore.setEntries(choices[name].targetEntity().uniqueId + '_choices', choiceEntries);\n\t }\n\t\n\t return true;\n\t }]\n\t }\n\t });\n\t\n\t $stateProvider.state('delete', {\n\t parent: 'main',\n\t url: '/:entity/delete/:id',\n\t controller: 'DeleteController',\n\t controllerAs: 'deleteController',\n\t templateProvider: templateProvider('DeleteView', _deleteDeleteHtml2['default']),\n\t params: {\n\t page: { value: 1, squash: true },\n\t search: { value: {}, squash: true },\n\t sortField: null,\n\t sortDir: null\n\t },\n\t resolve: {\n\t dataStore: function dataStore() {\n\t return new _adminConfigLibDataStoreDataStore2['default']();\n\t },\n\t view: viewProvider('DeleteView'),\n\t params: ['$stateParams', function ($stateParams) {\n\t return $stateParams;\n\t }],\n\t rawEntry: ['$stateParams', 'ReadQueries', 'view', function ($stateParams, ReadQueries, view) {\n\t return ReadQueries.getOne(view.getEntity(), view.type, $stateParams.id, view.identifier(), view.getUrl());\n\t }],\n\t entry: ['view', 'rawEntry', function (view, rawEntry) {\n\t return view.mapEntry(rawEntry);\n\t }]\n\t }\n\t });\n\t\n\t $stateProvider.state('batchDelete', {\n\t parent: 'main',\n\t url: '/:entity/batch-delete/{ids:json}',\n\t controller: 'BatchDeleteController',\n\t controllerAs: 'batchDeleteController',\n\t templateProvider: templateProvider('BatchDeleteView', _deleteBatchDeleteHtml2['default']),\n\t params: {\n\t entity: null,\n\t ids: [],\n\t page: { value: 1, squash: true },\n\t search: { value: {}, squash: true },\n\t sortField: null,\n\t sortDir: null\n\t },\n\t resolve: {\n\t view: viewProvider('BatchDeleteView'),\n\t params: ['$stateParams', function ($stateParams) {\n\t return $stateParams;\n\t }]\n\t }\n\t });\n\t}\n\t\n\trouting.$inject = ['$stateProvider'];\n\t\n\tmodule.exports = routing;\n\n/***/ },\n/* 136 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t var ShowController = function ShowController($scope, $location, view, dataStore) {\n\t this.$scope = $scope;\n\t this.$location = $location;\n\t this.title = view.title();\n\t this.description = view.description();\n\t this.actions = view.actions();\n\t\n\t this.fields = view.fields();\n\t this.$scope.entry = dataStore.getFirstEntry(view.getEntity().uniqueId);\n\t this.$scope.view = view;\n\t this.view = view;\n\t this.entity = this.view.getEntity();\n\t this.dataStore = dataStore;\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t };\n\t\n\t ShowController.prototype.destroy = function () {\n\t this.$scope = undefined;\n\t this.$location = undefined;\n\t this.view = undefined;\n\t this.entity = undefined;\n\t this.dataStore = undefined;\n\t };\n\t\n\t ShowController.$inject = ['$scope', '$location', 'view', 'dataStore'];\n\t\n\t return ShowController;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 137 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t function maJsonValidator() {\n\t return {\n\t require: 'ngModel',\n\t link: function link(scope, elm, attr, ctrl) {\n\t ctrl.$validators.json = function (value) {\n\t if (ctrl.$isEmpty(value)) {\n\t return true;\n\t }\n\t\n\t try {\n\t angular.fromJson(value);\n\t\n\t return true;\n\t } catch (e) {\n\t return false;\n\t }\n\t };\n\t }\n\t };\n\t }\n\t\n\t maJsonValidator.$inject = [];\n\t\n\t return maJsonValidator;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 138 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar angular = __webpack_require__(4);\n\t\n\t__webpack_require__(25);\n\t__webpack_require__(176);\n\t\n\tvar MainModule = angular.module('main', ['ui.router', 'restangular']);\n\t\n\tMainModule.controller('AppController', __webpack_require__(139));\n\tMainModule.controller('DashboardController', __webpack_require__(140));\n\t\n\tMainModule.provider('NgAdminConfiguration', __webpack_require__(145));\n\t\n\tMainModule.filter('orderElement', __webpack_require__(143));\n\tMainModule.filter('stripTags', __webpack_require__(144));\n\t\n\tMainModule.directive('maDashboardPanel', __webpack_require__(141));\n\tMainModule.directive('maMenuBar', __webpack_require__(142));\n\t\n\tMainModule.config(__webpack_require__(146));\n\tMainModule.config(__webpack_require__(147));\n\t\n\tMainModule.run(__webpack_require__(148));\n\tMainModule.run(__webpack_require__(149));\n\n/***/ },\n/* 139 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t /**\n\t *\n\t * @param {$scope} $scope\n\t * @param {$state} $state\n\t * @param {NgAdmin} Configuration\n\t * @constructor\n\t */\n\t var AppController = function AppController($scope, $state, Configuration) {\n\t var application = Configuration();\n\t this.$scope = $scope;\n\t this.$state = $state;\n\t this.$scope.isCollapsed = true;\n\t this.menu = application.menu();\n\t this.applicationName = application.title();\n\t this.header = application.header();\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t };\n\t\n\t AppController.prototype.displayHome = function () {\n\t this.$state.go(this.$state.get('dashboard'));\n\t };\n\t\n\t AppController.prototype.destroy = function () {\n\t this.$scope = undefined;\n\t this.$state = undefined;\n\t };\n\t\n\t AppController.$inject = ['$scope', '$state', 'NgAdminConfiguration'];\n\t\n\t return AppController;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 140 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {\n\t 'use strict';\n\t\n\t /**\n\t *\n\t * @param {$scope} $scope\n\t * @param {$state} $state\n\t * @param {PanelBuilder} PanelBuilder\n\t * @constructor\n\t */\n\t function DashboardController($scope, $state, collections, entries, hasEntities) {\n\t this.$state = $state;\n\t this.collections = collections;\n\t this.entries = entries;\n\t this.hasEntities = hasEntities;\n\t\n\t $scope.$on('$destroy', this.destroy.bind(this));\n\t }\n\t\n\t DashboardController.prototype.gotoList = function (entityName) {\n\t this.$state.go(this.$state.get('list'), { entity: entityName });\n\t };\n\t\n\t DashboardController.prototype.destroy = function () {\n\t this.$state = undefined;\n\t };\n\t\n\t DashboardController.$inject = ['$scope', '$state', 'collections', 'entries', 'hasEntities'];\n\t\n\t return DashboardController;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 141 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction maDashboardPanel($state) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t collection: '&',\n\t entries: '&'\n\t },\n\t link: function link(scope) {\n\t scope.gotoList = function () {\n\t $state.go($state.get('list'), { entity: scope.collection().entity.name() });\n\t };\n\t },\n\t template: '' + '' + ''\n\t };\n\t}\n\t\n\tmaDashboardPanel.$inject = ['$state'];\n\t\n\tmodule.exports = maDashboardPanel;\n\n/***/ },\n/* 142 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar menuBarView = __webpack_require__(163);\n\tvar angular = __webpack_require__(4);\n\t\n\tfunction maMenuBar($location, $rootScope, $compile) {\n\t return {\n\t restrict: 'E',\n\t scope: {\n\t 'menu': '&'\n\t },\n\t link: function link(scope, element) {\n\t scope.menu = scope.menu();\n\t scope.path = $location.path();\n\t // initialize openMenus\n\t var openMenus = scope.menu.children().filter(function (menu) {\n\t return menu.isChildActive(scope.path);\n\t });\n\t // manually render on change to avoid checking menu.isActive at each dirty check\n\t var listener = $rootScope.$on('$locationChangeSuccess', function () {\n\t scope.path = $location.path();\n\t render();\n\t });\n\t $rootScope.$on('$destroy', listener);\n\t scope.toggleMenu = function (menu) {\n\t // handle click on parent menu manually\n\t // because we chose bindOnce in the template for performance reasons\n\t if (openMenus.indexOf(menu) !== -1) {\n\t // menu is already open, the click closes it\n\t // except if a submenu is open\n\t if (menu.isChildActive(scope.path)) {\n\t return;\n\t }\n\t openMenus.splice(openMenus.indexOf(menu), 1);\n\t closeMenu(menu);\n\t } else {\n\t // menu is closed, the click opens it\n\t openMenus.push(menu);\n\t openMenu(menu);\n\t }\n\t // we don't render() in that case because it would cut the animation\n\t return;\n\t };\n\t scope.gotoLink = function (menu) {\n\t if (!menu.link()) {\n\t return;\n\t }\n\t // close all open menus\n\t // no need to close the menus with animation using closeMenu(),\n\t // the menu will rerender anyway because of the listener on $locationChangeSuccess\n\t // so the animation don't work in that case\n\t if (menu.autoClose()) {\n\t openMenus = [];\n\t }\n\t $location.url(menu.link());\n\t };\n\t scope.isOpen = function (menu) {\n\t return menu.isChildActive(scope.path) || openMenus.indexOf(menu) !== -1;\n\t };\n\t render();\n\t\n\t function render() {\n\t element.html(menuBarView);\n\t $compile(element.contents())(scope);\n\t }\n\t function closeMenu(menu) {\n\t var elements = getElementsForMenu(menu);\n\t elements.ul.addClass('collapsed');\n\t elements.arrow.removeClass('glyphicon-menu-down');\n\t elements.arrow.addClass('glyphicon-menu-right');\n\t }\n\t function openMenu(menu) {\n\t var elements = getElementsForMenu(menu);\n\t elements.ul.removeClass('collapsed');\n\t elements.arrow.removeClass('glyphicon-menu-right');\n\t elements.arrow.addClass('glyphicon-menu-down');\n\t }\n\t function getElementsForMenu(menu) {\n\t var parentLi;\n\t angular.forEach(element.find('li'), function (li) {\n\t var liElement = angular.element(li);\n\t if (liElement.attr('data-menu-id') == menu.uuid) {\n\t parentLi = liElement;\n\t }\n\t });\n\t return {\n\t arrow: angular.element(parentLi.find('a')[0].getElementsByClassName('arrow')[0]),\n\t ul: parentLi.find('ul').eq(0)\n\t };\n\t }\n\t }\n\t };\n\t}\n\t\n\tmaMenuBar.$inject = ['$location', '$rootScope', '$compile'];\n\t\n\tmodule.exports = maMenuBar;\n\n/***/ },\n/* 143 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function OrderElement() {\n\t return function (input) {\n\t var results = [],\n\t objectKey;\n\t\n\t for (objectKey in input) {\n\t results.push(input[objectKey]);\n\t }\n\t\n\t results.sort(function (field1, field2) {\n\t return typeof field1.order === 'function' ? field1.order() - field2.order() : field1.order - field2.order;\n\t });\n\t\n\t return results;\n\t };\n\t }\n\t\n\t OrderElement.$inject = [];\n\t\n\t return OrderElement;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 144 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function stripTags() {\n\t return function (input) {\n\t return input.replace(/(<([^>]+)>)/ig, '');\n\t };\n\t }\n\t\n\t stripTags.$inject = [];\n\t\n\t return stripTags;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 145 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tfunction NgAdminConfiguration($compileProvider) {\n\t this.config = null;\n\t this.adminDescription = null;\n\t this.$compileProvider = $compileProvider;\n\t}\n\t\n\tNgAdminConfiguration.prototype.setAdminDescription = function (adminDescription) {\n\t this.adminDescription = adminDescription;\n\t};\n\t\n\tNgAdminConfiguration.prototype.configure = function (config) {\n\t this.config = config;\n\t\n\t this.$compileProvider.debugInfoEnabled(this.config.debug());\n\t};\n\t\n\tNgAdminConfiguration.prototype.$get = function () {\n\t var config = this.config;\n\t return function () {\n\t return config;\n\t };\n\t};\n\t\n\tNgAdminConfiguration.prototype.application = function (name, debug) {\n\t return this.adminDescription.application(name, debug);\n\t};\n\t\n\tNgAdminConfiguration.prototype.entity = function (name) {\n\t return this.adminDescription.entity(name);\n\t};\n\t\n\tNgAdminConfiguration.prototype.field = function (name, type) {\n\t return this.adminDescription.field(name, type);\n\t};\n\t\n\tNgAdminConfiguration.prototype.registerFieldType = function (name, type) {\n\t return this.adminDescription.registerFieldType(name, type);\n\t};\n\t\n\tNgAdminConfiguration.prototype.getFieldConstructor = function (name) {\n\t return this.adminDescription.getFieldConstructor(name);\n\t};\n\t\n\tNgAdminConfiguration.prototype.menu = function (entity) {\n\t return this.adminDescription.menu(entity);\n\t};\n\t\n\tNgAdminConfiguration.prototype.collection = function (collection) {\n\t return this.adminDescription.collection(collection);\n\t};\n\t\n\tNgAdminConfiguration.prototype.dashboard = function (dashboard) {\n\t return this.adminDescription.dashboard(dashboard);\n\t};\n\t\n\tNgAdminConfiguration.$inject = ['$compileProvider'];\n\t\n\tmodule.exports = NgAdminConfiguration;\n\n/***/ },\n/* 146 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function http($httpProvider) {\n\t\n\t $httpProvider.useApplyAsync(true);\n\t }\n\t\n\t http.$inject = ['$httpProvider'];\n\t\n\t return http;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 147 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar layoutTemplate = __webpack_require__(162),\n\t dashboardTemplate = __webpack_require__(161),\n\t errorTemplate = __webpack_require__(160);\n\t\n\tfunction dataStoreProvider() {\n\t return ['AdminDescription', function (AdminDescription) {\n\t return AdminDescription.getDataStore();\n\t }];\n\t}\n\t\n\tfunction entryConstructorProvider() {\n\t return ['AdminDescription', function (AdminDescription) {\n\t return AdminDescription.getEntryConstructor();\n\t }];\n\t}\n\t\n\tfunction routing($stateProvider, $urlRouterProvider) {\n\t\n\t $stateProvider.state('main', {\n\t abstract: true,\n\t controller: 'AppController',\n\t controllerAs: 'appController',\n\t templateProvider: ['NgAdminConfiguration', function (Configuration) {\n\t return Configuration().layout() || layoutTemplate;\n\t }]\n\t });\n\t\n\t $stateProvider.state('dashboard', {\n\t parent: 'main',\n\t url: '/dashboard?sortField&sortDir',\n\t params: {\n\t sortField: null,\n\t sortDir: null\n\t },\n\t controller: 'DashboardController',\n\t controllerAs: 'dashboardController',\n\t templateProvider: ['NgAdminConfiguration', function (Configuration) {\n\t return Configuration().dashboard().template() || dashboardTemplate;\n\t }],\n\t resolve: {\n\t dataStore: dataStoreProvider(),\n\t Entry: entryConstructorProvider(),\n\t hasEntities: ['NgAdminConfiguration', function (Configuration) {\n\t return Configuration().entities.length > 0;\n\t }],\n\t collections: ['NgAdminConfiguration', function (Configuration) {\n\t return Configuration().dashboard().collections();\n\t }],\n\t responses: ['$stateParams', '$q', 'collections', 'dataStore', 'Entry', 'ReadQueries', function ($stateParams, $q, collections, dataStore, Entry, ReadQueries) {\n\t var sortField = 'sortField' in $stateParams ? $stateParams.sortField : null;\n\t var sortDir = 'sortDir' in $stateParams ? $stateParams.sortDir : null;\n\t\n\t var promises = {},\n\t collection,\n\t collectionSortField,\n\t collectionSortDir,\n\t collectionName;\n\t\n\t for (collectionName in collections) {\n\t collection = collections[collectionName];\n\t collectionSortField = collection.getSortFieldName();\n\t collectionSortDir = collection.sortDir();\n\t if (sortField && sortField.split('.')[0] === collection.name()) {\n\t collectionSortField = sortField;\n\t collectionSortDir = sortDir;\n\t }\n\t promises[collectionName] = (function (collection, collectionSortField, collectionSortDir) {\n\t var rawEntries, nonOptimizedReferencedData, optimizedReferencedData;\n\t\n\t return ReadQueries.getAll(collection, 1, {}, collectionSortField, collectionSortDir).then(function (response) {\n\t rawEntries = response.data;\n\t return rawEntries;\n\t }).then(function (rawEntries) {\n\t return ReadQueries.getFilteredReferenceData(collection.getNonOptimizedReferences(), rawEntries);\n\t }).then(function (nonOptimizedReference) {\n\t nonOptimizedReferencedData = nonOptimizedReference;\n\t return ReadQueries.getOptimizedReferencedData(collection.getOptimizedReferences(), rawEntries);\n\t }).then(function (optimizedReference) {\n\t optimizedReferencedData = optimizedReference;\n\t\n\t var references = collection.getReferences(),\n\t referencedData = angular.extend(nonOptimizedReferencedData, optimizedReferencedData);\n\t\n\t for (var name in referencedData) {\n\t Entry.createArrayFromRest(referencedData[name], [references[name].targetField()], references[name].targetEntity().name(), references[name].targetEntity().identifier().name()).map(function (entry) {\n\t return dataStore.addEntry(references[name].targetEntity().uniqueId + '_values', entry);\n\t });\n\t }\n\t }).then(function () {\n\t var entries = collection.mapEntries(rawEntries);\n\t\n\t // shortcut to display collection of entry with included referenced values\n\t dataStore.fillReferencesValuesFromCollection(entries, collection.getReferences(), true);\n\t\n\t return entries;\n\t });\n\t })(collection, collectionSortField, collectionSortDir);\n\t }\n\t\n\t return $q.all(promises);\n\t }],\n\t entries: ['responses', 'collections', function (responses, collections) {\n\t var collectionName,\n\t entries = {};\n\t\n\t for (collectionName in responses) {\n\t entries[collections[collectionName].name()] = responses[collectionName];\n\t }\n\t\n\t return entries;\n\t }]\n\t }\n\t });\n\t\n\t $stateProvider.state('ma-404', {\n\t parent: 'main',\n\t template: errorTemplate\n\t });\n\t\n\t $urlRouterProvider.when('', '/dashboard');\n\t\n\t $urlRouterProvider.otherwise(function ($injector, $location) {\n\t var state = $injector.get('$state');\n\t state.go('ma-404');\n\t return $location.path();\n\t });\n\t}\n\t\n\trouting.$inject = ['$stateProvider', '$urlRouterProvider'];\n\t\n\tmodule.exports = routing;\n\n/***/ },\n/* 148 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t function errorHandler($rootScope, $state, notification) {\n\t $rootScope.$on(\"$stateChangeError\", function handleError(event, toState, toParams, fromState, fromParams, error) {\n\t if (error.status == 404) {\n\t $state.go('ma-404');\n\t event.preventDefault();\n\t } else {\n\t notification.log('State change error: ' + error.message, { addnCls: 'humane-flatty-error' });\n\t throw error;\n\t }\n\t });\n\t }\n\t\n\t errorHandler.$inject = ['$rootScope', '$state', 'notification'];\n\t\n\t return errorHandler;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 149 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/*global define*/\n\t\n\t'use strict';\n\t\n\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t 'use strict';\n\t\n\t /**\n\t * Display loader on each route change\n\t *\n\t * @param {$rootScope} $rootScope\n\t * @param {$window} $window\n\t * @param {progression} progression\n\t */\n\t function loader($rootScope, $window, progression) {\n\t $rootScope.$on('$stateChangeStart', function () {\n\t progression.start();\n\t });\n\t\n\t $rootScope.$on('$stateChangeSuccess', function () {\n\t progression.done();\n\t $window.scrollTo(0, 0);\n\t });\n\t\n\t $rootScope.$on(\"$stateChangeError\", function () {\n\t progression.done();\n\t });\n\t }\n\t\n\t loader.$inject = ['$rootScope', '$window', 'progression'];\n\t\n\t return loader;\n\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n/***/ },\n/* 150 */\n/***/ function(module, exports) {\n\n\t// removed by extract-text-webpack-plugin\n\n/***/ },\n/* 151 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"

Are you sure ?

\";\n\n/***/ },\n/* 152 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"

Are you sure ?

\";\n\n/***/ },\n/* 153 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"
\";\n\n/***/ },\n/* 154 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"
\";\n\n/***/ },\n/* 155 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"
\";\n\n/***/ },\n/* 156 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"
\";\n\n/***/ },\n/* 157 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"\";\n\n/***/ },\n/* 158 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"\";\n\n/***/ },\n/* 159 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"
\";\n\n/***/ },\n/* 160 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"
The page you are looking for cannot be found. Take a break before trying again.



\\n\\n       |\\\\      _,,,---,,_\\n       /,`.-'`'    -.  ;-;;,_\\n      |,4-  ) )-,_..;\\\\ (  `'-'\\n     '---''(_/--'  `-'\\\\_)\\n\\n    
\";\n\n/***/ },\n/* 161 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"

All dependencies are set, ng-admin is ready to run!

Now you can update the configuration: add entities to the admin, then refresh.

\";\n\n/***/ },\n/* 162 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"\";\n\n/***/ },\n/* 163 */\n/***/ function(module, exports) {\n\n\tmodule.exports = \"\";\n\n/***/ },\n/* 164 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar require;/**\n\t * @license AngularJS v1.3.17\n\t * (c) 2010-2014 Google, Inc. http://angularjs.org\n\t * License: MIT\n\t */\n\t(function(window, document, undefined) {'use strict';\n\t\n\t/**\n\t * @description\n\t *\n\t * This object provides a utility for producing rich Error messages within\n\t * Angular. It can be called as follows:\n\t *\n\t * var exampleMinErr = minErr('example');\n\t * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n\t *\n\t * The above creates an instance of minErr in the example namespace. The\n\t * resulting error will have a namespaced error code of example.one. The\n\t * resulting error will replace {0} with the value of foo, and {1} with the\n\t * value of bar. The object is not restricted in the number of arguments it can\n\t * take.\n\t *\n\t * If fewer arguments are specified than necessary for interpolation, the extra\n\t * interpolation markers will be preserved in the final string.\n\t *\n\t * Since data will be parsed statically during a build step, some restrictions\n\t * are applied with respect to how minErr instances are created and called.\n\t * Instances should have names of the form namespaceMinErr for a minErr created\n\t * using minErr('namespace') . Error codes, namespaces and template strings\n\t * should all be static strings, not variables or general expressions.\n\t *\n\t * @param {string} module The namespace to use for the new minErr instance.\n\t * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n\t * error from returned function, for cases when a particular type of error is useful.\n\t * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n\t */\n\t\n\tfunction minErr(module, ErrorConstructor) {\n\t ErrorConstructor = ErrorConstructor || Error;\n\t return function() {\n\t var code = arguments[0],\n\t prefix = '[' + (module ? module + ':' : '') + code + '] ',\n\t template = arguments[1],\n\t templateArgs = arguments,\n\t\n\t message, i;\n\t\n\t message = prefix + template.replace(/\\{\\d+\\}/g, function(match) {\n\t var index = +match.slice(1, -1), arg;\n\t\n\t if (index + 2 < templateArgs.length) {\n\t return toDebugString(templateArgs[index + 2]);\n\t }\n\t return match;\n\t });\n\t\n\t message = message + '\\nhttp://errors.angularjs.org/1.3.17/' +\n\t (module ? module + '/' : '') + code;\n\t for (i = 2; i < arguments.length; i++) {\n\t message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +\n\t encodeURIComponent(toDebugString(arguments[i]));\n\t }\n\t return new ErrorConstructor(message);\n\t };\n\t}\n\t\n\t/* We need to tell jshint what variables are being exported */\n\t/* global angular: true,\n\t msie: true,\n\t jqLite: true,\n\t jQuery: true,\n\t slice: true,\n\t splice: true,\n\t push: true,\n\t toString: true,\n\t ngMinErr: true,\n\t angularModule: true,\n\t uid: true,\n\t REGEX_STRING_REGEXP: true,\n\t VALIDITY_STATE_PROPERTY: true,\n\t\n\t lowercase: true,\n\t uppercase: true,\n\t manualLowercase: true,\n\t manualUppercase: true,\n\t nodeName_: true,\n\t isArrayLike: true,\n\t forEach: true,\n\t sortedKeys: true,\n\t forEachSorted: true,\n\t reverseParams: true,\n\t nextUid: true,\n\t setHashKey: true,\n\t extend: true,\n\t int: true,\n\t inherit: true,\n\t noop: true,\n\t identity: true,\n\t valueFn: true,\n\t isUndefined: true,\n\t isDefined: true,\n\t isObject: true,\n\t isString: true,\n\t isNumber: true,\n\t isDate: true,\n\t isArray: true,\n\t isFunction: true,\n\t isRegExp: true,\n\t isWindow: true,\n\t isScope: true,\n\t isFile: true,\n\t isFormData: true,\n\t isBlob: true,\n\t isBoolean: true,\n\t isPromiseLike: true,\n\t trim: true,\n\t escapeForRegexp: true,\n\t isElement: true,\n\t makeMap: true,\n\t includes: true,\n\t arrayRemove: true,\n\t copy: true,\n\t shallowCopy: true,\n\t equals: true,\n\t csp: true,\n\t concat: true,\n\t sliceArgs: true,\n\t bind: true,\n\t toJsonReplacer: true,\n\t toJson: true,\n\t fromJson: true,\n\t startingTag: true,\n\t tryDecodeURIComponent: true,\n\t parseKeyValue: true,\n\t toKeyValue: true,\n\t encodeUriSegment: true,\n\t encodeUriQuery: true,\n\t angularInit: true,\n\t bootstrap: true,\n\t getTestability: true,\n\t snake_case: true,\n\t bindJQuery: true,\n\t assertArg: true,\n\t assertArgFn: true,\n\t assertNotHasOwnProperty: true,\n\t getter: true,\n\t getBlockNodes: true,\n\t hasOwnProperty: true,\n\t createMap: true,\n\t\n\t NODE_TYPE_ELEMENT: true,\n\t NODE_TYPE_ATTRIBUTE: true,\n\t NODE_TYPE_TEXT: true,\n\t NODE_TYPE_COMMENT: true,\n\t NODE_TYPE_DOCUMENT: true,\n\t NODE_TYPE_DOCUMENT_FRAGMENT: true,\n\t*/\n\t\n\t////////////////////////////////////\n\t\n\t/**\n\t * @ngdoc module\n\t * @name ng\n\t * @module ng\n\t * @description\n\t *\n\t * # ng (core module)\n\t * The ng module is loaded by default when an AngularJS application is started. The module itself\n\t * contains the essential components for an AngularJS application to function. The table below\n\t * lists a high level breakdown of each of the services/factories, filters, directives and testing\n\t * components available within this core module.\n\t *\n\t *
\n\t */\n\t\n\tvar REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\t\n\t// The name of a form control's ValidityState property.\n\t// This is used so that it's possible for internal tests to create mock ValidityStates.\n\tvar VALIDITY_STATE_PROPERTY = 'validity';\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.lowercase\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description Converts the specified string to lowercase.\n\t * @param {string} string String to be converted to lowercase.\n\t * @returns {string} Lowercased string.\n\t */\n\tvar lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};\n\tvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.uppercase\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description Converts the specified string to uppercase.\n\t * @param {string} string String to be converted to uppercase.\n\t * @returns {string} Uppercased string.\n\t */\n\tvar uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};\n\t\n\t\n\tvar manualLowercase = function(s) {\n\t /* jshint bitwise: false */\n\t return isString(s)\n\t ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})\n\t : s;\n\t};\n\tvar manualUppercase = function(s) {\n\t /* jshint bitwise: false */\n\t return isString(s)\n\t ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})\n\t : s;\n\t};\n\t\n\t\n\t// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish\n\t// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods\n\t// with correct but slower alternatives.\n\tif ('i' !== 'I'.toLowerCase()) {\n\t lowercase = manualLowercase;\n\t uppercase = manualUppercase;\n\t}\n\t\n\t\n\tvar\n\t msie, // holds major version number for IE, or NaN if UA is not IE.\n\t jqLite, // delay binding since jQuery could be loaded after us.\n\t jQuery, // delay binding\n\t slice = [].slice,\n\t splice = [].splice,\n\t push = [].push,\n\t toString = Object.prototype.toString,\n\t ngMinErr = minErr('ng'),\n\t\n\t /** @name angular */\n\t angular = window.angular || (window.angular = {}),\n\t angularModule,\n\t uid = 0;\n\t\n\t/**\n\t * documentMode is an IE-only property\n\t * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n\t */\n\tmsie = document.documentMode;\n\t\n\t\n\t/**\n\t * @private\n\t * @param {*} obj\n\t * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n\t * String ...)\n\t */\n\tfunction isArrayLike(obj) {\n\t if (obj == null || isWindow(obj)) {\n\t return false;\n\t }\n\t\n\t // Support: iOS 8.2 (not reproducible in simulator)\n\t // \"length\" in obj used to prevent JIT error (gh-11508)\n\t var length = \"length\" in Object(obj) && obj.length;\n\t\n\t if (obj.nodeType === NODE_TYPE_ELEMENT && length) {\n\t return true;\n\t }\n\t\n\t return isString(obj) || isArray(obj) || length === 0 ||\n\t typeof length === 'number' && length > 0 && (length - 1) in obj;\n\t}\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.forEach\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n\t * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n\t * is the value of an object property or an array element, `key` is the object property key or\n\t * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n\t *\n\t * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n\t * using the `hasOwnProperty` method.\n\t *\n\t * Unlike ES262's\n\t * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n\t * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n\t * return the value provided.\n\t *\n\t ```js\n\t var values = {name: 'misko', gender: 'male'};\n\t var log = [];\n\t angular.forEach(values, function(value, key) {\n\t this.push(key + ': ' + value);\n\t }, log);\n\t expect(log).toEqual(['name: misko', 'gender: male']);\n\t ```\n\t *\n\t * @param {Object|Array} obj Object to iterate over.\n\t * @param {Function} iterator Iterator function.\n\t * @param {Object=} context Object to become context (`this`) for the iterator function.\n\t * @returns {Object|Array} Reference to `obj`.\n\t */\n\t\n\tfunction forEach(obj, iterator, context) {\n\t var key, length;\n\t if (obj) {\n\t if (isFunction(obj)) {\n\t for (key in obj) {\n\t // Need to check if hasOwnProperty exists,\n\t // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n\t if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n\t iterator.call(context, obj[key], key, obj);\n\t }\n\t }\n\t } else if (isArray(obj) || isArrayLike(obj)) {\n\t var isPrimitive = typeof obj !== 'object';\n\t for (key = 0, length = obj.length; key < length; key++) {\n\t if (isPrimitive || key in obj) {\n\t iterator.call(context, obj[key], key, obj);\n\t }\n\t }\n\t } else if (obj.forEach && obj.forEach !== forEach) {\n\t obj.forEach(iterator, context, obj);\n\t } else {\n\t for (key in obj) {\n\t if (obj.hasOwnProperty(key)) {\n\t iterator.call(context, obj[key], key, obj);\n\t }\n\t }\n\t }\n\t }\n\t return obj;\n\t}\n\t\n\tfunction sortedKeys(obj) {\n\t return Object.keys(obj).sort();\n\t}\n\t\n\tfunction forEachSorted(obj, iterator, context) {\n\t var keys = sortedKeys(obj);\n\t for (var i = 0; i < keys.length; i++) {\n\t iterator.call(context, obj[keys[i]], keys[i]);\n\t }\n\t return keys;\n\t}\n\t\n\t\n\t/**\n\t * when using forEach the params are value, key, but it is often useful to have key, value.\n\t * @param {function(string, *)} iteratorFn\n\t * @returns {function(*, string)}\n\t */\n\tfunction reverseParams(iteratorFn) {\n\t return function(value, key) { iteratorFn(key, value); };\n\t}\n\t\n\t/**\n\t * A consistent way of creating unique IDs in angular.\n\t *\n\t * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n\t * we hit number precision issues in JavaScript.\n\t *\n\t * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n\t *\n\t * @returns {number} an unique alpha-numeric string\n\t */\n\tfunction nextUid() {\n\t return ++uid;\n\t}\n\t\n\t\n\t/**\n\t * Set or clear the hashkey for an object.\n\t * @param obj object\n\t * @param h the hashkey (!truthy to delete the hashkey)\n\t */\n\tfunction setHashKey(obj, h) {\n\t if (h) {\n\t obj.$$hashKey = h;\n\t } else {\n\t delete obj.$$hashKey;\n\t }\n\t}\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.extend\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n\t * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n\t * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n\t * Note: Keep in mind that `angular.extend` does not support recursive merge (deep copy).\n\t *\n\t * @param {Object} dst Destination object.\n\t * @param {...Object} src Source object(s).\n\t * @returns {Object} Reference to `dst`.\n\t */\n\tfunction extend(dst) {\n\t var h = dst.$$hashKey;\n\t\n\t for (var i = 1, ii = arguments.length; i < ii; i++) {\n\t var obj = arguments[i];\n\t if (obj) {\n\t var keys = Object.keys(obj);\n\t for (var j = 0, jj = keys.length; j < jj; j++) {\n\t var key = keys[j];\n\t dst[key] = obj[key];\n\t }\n\t }\n\t }\n\t\n\t setHashKey(dst, h);\n\t return dst;\n\t}\n\t\n\tfunction int(str) {\n\t return parseInt(str, 10);\n\t}\n\t\n\t\n\tfunction inherit(parent, extra) {\n\t return extend(Object.create(parent), extra);\n\t}\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.noop\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * A function that performs no operations. This function can be useful when writing code in the\n\t * functional style.\n\t ```js\n\t function foo(callback) {\n\t var result = calculateResult();\n\t (callback || angular.noop)(result);\n\t }\n\t ```\n\t */\n\tfunction noop() {}\n\tnoop.$inject = [];\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.identity\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * A function that returns its first argument. This function is useful when writing code in the\n\t * functional style.\n\t *\n\t ```js\n\t function transformer(transformationFn, value) {\n\t return (transformationFn || angular.identity)(value);\n\t };\n\t ```\n\t * @param {*} value to be returned.\n\t * @returns {*} the value passed in.\n\t */\n\tfunction identity($) {return $;}\n\tidentity.$inject = [];\n\t\n\t\n\tfunction valueFn(value) {return function() {return value;};}\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.isUndefined\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if a reference is undefined.\n\t *\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is undefined.\n\t */\n\tfunction isUndefined(value) {return typeof value === 'undefined';}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.isDefined\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if a reference is defined.\n\t *\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is defined.\n\t */\n\tfunction isDefined(value) {return typeof value !== 'undefined';}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.isObject\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n\t * considered to be objects. Note that JavaScript arrays are objects.\n\t *\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is an `Object` but not `null`.\n\t */\n\tfunction isObject(value) {\n\t // http://jsperf.com/isobject4\n\t return value !== null && typeof value === 'object';\n\t}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.isString\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if a reference is a `String`.\n\t *\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is a `String`.\n\t */\n\tfunction isString(value) {return typeof value === 'string';}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.isNumber\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if a reference is a `Number`.\n\t *\n\t * This includes the \"special\" numbers `NaN`, `+Infinity` and `-Infinity`.\n\t *\n\t * If you wish to exclude these then you can use the native\n\t * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)\n\t * method.\n\t *\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is a `Number`.\n\t */\n\tfunction isNumber(value) {return typeof value === 'number';}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.isDate\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if a value is a date.\n\t *\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is a `Date`.\n\t */\n\tfunction isDate(value) {\n\t return toString.call(value) === '[object Date]';\n\t}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.isArray\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if a reference is an `Array`.\n\t *\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is an `Array`.\n\t */\n\tvar isArray = Array.isArray;\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.isFunction\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if a reference is a `Function`.\n\t *\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is a `Function`.\n\t */\n\tfunction isFunction(value) {return typeof value === 'function';}\n\t\n\t\n\t/**\n\t * Determines if a value is a regular expression object.\n\t *\n\t * @private\n\t * @param {*} value Reference to check.\n\t * @returns {boolean} True if `value` is a `RegExp`.\n\t */\n\tfunction isRegExp(value) {\n\t return toString.call(value) === '[object RegExp]';\n\t}\n\t\n\t\n\t/**\n\t * Checks if `obj` is a window object.\n\t *\n\t * @private\n\t * @param {*} obj Object to check\n\t * @returns {boolean} True if `obj` is a window obj.\n\t */\n\tfunction isWindow(obj) {\n\t return obj && obj.window === obj;\n\t}\n\t\n\t\n\tfunction isScope(obj) {\n\t return obj && obj.$evalAsync && obj.$watch;\n\t}\n\t\n\t\n\tfunction isFile(obj) {\n\t return toString.call(obj) === '[object File]';\n\t}\n\t\n\t\n\tfunction isFormData(obj) {\n\t return toString.call(obj) === '[object FormData]';\n\t}\n\t\n\t\n\tfunction isBlob(obj) {\n\t return toString.call(obj) === '[object Blob]';\n\t}\n\t\n\t\n\tfunction isBoolean(value) {\n\t return typeof value === 'boolean';\n\t}\n\t\n\t\n\tfunction isPromiseLike(obj) {\n\t return obj && isFunction(obj.then);\n\t}\n\t\n\t\n\tvar trim = function(value) {\n\t return isString(value) ? value.trim() : value;\n\t};\n\t\n\t// Copied from:\n\t// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n\t// Prereq: s is a string.\n\tvar escapeForRegexp = function(s) {\n\t return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#= 0)\n\t array.splice(index, 1);\n\t return value;\n\t}\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.copy\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Creates a deep copy of `source`, which should be an object or an array.\n\t *\n\t * * If no destination is supplied, a copy of the object or array is created.\n\t * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n\t * are deleted and then all elements/properties from the source are copied to it.\n\t * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n\t * * If `source` is identical to 'destination' an exception will be thrown.\n\t *\n\t * @param {*} source The source that will be used to make a copy.\n\t * Can be any type, including primitives, `null`, and `undefined`.\n\t * @param {(Object|Array)=} destination Destination into which the source is copied. If\n\t * provided, must be of the same type as `source`.\n\t * @returns {*} The copy or updated `destination`, if `destination` was specified.\n\t *\n\t * @example\n\t \n\t \n\t
\n\t
\n\t Name:
\n\t E-mail:
\n\t Gender: male\n\t female
\n\t \n\t \n\t
\n\t
form = {{user | json}}
\n\t
master = {{master | json}}
\n\t
\n\t\n\t \n\t
\n\t
\n\t */\n\tfunction copy(source, destination, stackSource, stackDest) {\n\t if (isWindow(source) || isScope(source)) {\n\t throw ngMinErr('cpws',\n\t \"Can't copy! Making copies of Window or Scope instances is not supported.\");\n\t }\n\t\n\t if (!destination) {\n\t destination = source;\n\t if (source) {\n\t if (isArray(source)) {\n\t destination = copy(source, [], stackSource, stackDest);\n\t } else if (isDate(source)) {\n\t destination = new Date(source.getTime());\n\t } else if (isRegExp(source)) {\n\t destination = new RegExp(source.source, source.toString().match(/[^\\/]*$/)[0]);\n\t destination.lastIndex = source.lastIndex;\n\t } else if (isObject(source)) {\n\t var emptyObject = Object.create(Object.getPrototypeOf(source));\n\t destination = copy(source, emptyObject, stackSource, stackDest);\n\t }\n\t }\n\t } else {\n\t if (source === destination) throw ngMinErr('cpi',\n\t \"Can't copy! Source and destination are identical.\");\n\t\n\t stackSource = stackSource || [];\n\t stackDest = stackDest || [];\n\t\n\t if (isObject(source)) {\n\t var index = stackSource.indexOf(source);\n\t if (index !== -1) return stackDest[index];\n\t\n\t stackSource.push(source);\n\t stackDest.push(destination);\n\t }\n\t\n\t var result;\n\t if (isArray(source)) {\n\t destination.length = 0;\n\t for (var i = 0; i < source.length; i++) {\n\t result = copy(source[i], null, stackSource, stackDest);\n\t if (isObject(source[i])) {\n\t stackSource.push(source[i]);\n\t stackDest.push(result);\n\t }\n\t destination.push(result);\n\t }\n\t } else {\n\t var h = destination.$$hashKey;\n\t if (isArray(destination)) {\n\t destination.length = 0;\n\t } else {\n\t forEach(destination, function(value, key) {\n\t delete destination[key];\n\t });\n\t }\n\t for (var key in source) {\n\t if (source.hasOwnProperty(key)) {\n\t result = copy(source[key], null, stackSource, stackDest);\n\t if (isObject(source[key])) {\n\t stackSource.push(source[key]);\n\t stackDest.push(result);\n\t }\n\t destination[key] = result;\n\t }\n\t }\n\t setHashKey(destination,h);\n\t }\n\t\n\t }\n\t return destination;\n\t}\n\t\n\t/**\n\t * Creates a shallow copy of an object, an array or a primitive.\n\t *\n\t * Assumes that there are no proto properties for objects.\n\t */\n\tfunction shallowCopy(src, dst) {\n\t if (isArray(src)) {\n\t dst = dst || [];\n\t\n\t for (var i = 0, ii = src.length; i < ii; i++) {\n\t dst[i] = src[i];\n\t }\n\t } else if (isObject(src)) {\n\t dst = dst || {};\n\t\n\t for (var key in src) {\n\t if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n\t dst[key] = src[key];\n\t }\n\t }\n\t }\n\t\n\t return dst || src;\n\t}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.equals\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Determines if two objects or two values are equivalent. Supports value types, regular\n\t * expressions, arrays and objects.\n\t *\n\t * Two objects or values are considered equivalent if at least one of the following is true:\n\t *\n\t * * Both objects or values pass `===` comparison.\n\t * * Both objects or values are of the same type and all of their properties are equal by\n\t * comparing them with `angular.equals`.\n\t * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n\t * * Both values represent the same regular expression (In JavaScript,\n\t * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n\t * representation matches).\n\t *\n\t * During a property comparison, properties of `function` type and properties with names\n\t * that begin with `$` are ignored.\n\t *\n\t * Scope and DOMWindow objects are being compared only by identify (`===`).\n\t *\n\t * @param {*} o1 Object or value to compare.\n\t * @param {*} o2 Object or value to compare.\n\t * @returns {boolean} True if arguments are equal.\n\t */\n\tfunction equals(o1, o2) {\n\t if (o1 === o2) return true;\n\t if (o1 === null || o2 === null) return false;\n\t if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n\t var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n\t if (t1 == t2) {\n\t if (t1 == 'object') {\n\t if (isArray(o1)) {\n\t if (!isArray(o2)) return false;\n\t if ((length = o1.length) == o2.length) {\n\t for (key = 0; key < length; key++) {\n\t if (!equals(o1[key], o2[key])) return false;\n\t }\n\t return true;\n\t }\n\t } else if (isDate(o1)) {\n\t if (!isDate(o2)) return false;\n\t return equals(o1.getTime(), o2.getTime());\n\t } else if (isRegExp(o1)) {\n\t return isRegExp(o2) ? o1.toString() == o2.toString() : false;\n\t } else {\n\t if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||\n\t isArray(o2) || isDate(o2) || isRegExp(o2)) return false;\n\t keySet = {};\n\t for (key in o1) {\n\t if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n\t if (!equals(o1[key], o2[key])) return false;\n\t keySet[key] = true;\n\t }\n\t for (key in o2) {\n\t if (!keySet.hasOwnProperty(key) &&\n\t key.charAt(0) !== '$' &&\n\t o2[key] !== undefined &&\n\t !isFunction(o2[key])) return false;\n\t }\n\t return true;\n\t }\n\t }\n\t }\n\t return false;\n\t}\n\t\n\tvar csp = function() {\n\t if (isDefined(csp.isActive_)) return csp.isActive_;\n\t\n\t var active = !!(document.querySelector('[ng-csp]') ||\n\t document.querySelector('[data-ng-csp]'));\n\t\n\t if (!active) {\n\t try {\n\t /* jshint -W031, -W054 */\n\t new Function('');\n\t /* jshint +W031, +W054 */\n\t } catch (e) {\n\t active = true;\n\t }\n\t }\n\t\n\t return (csp.isActive_ = active);\n\t};\n\t\n\t\n\t\n\tfunction concat(array1, array2, index) {\n\t return array1.concat(slice.call(array2, index));\n\t}\n\t\n\tfunction sliceArgs(args, startIndex) {\n\t return slice.call(args, startIndex || 0);\n\t}\n\t\n\t\n\t/* jshint -W101 */\n\t/**\n\t * @ngdoc function\n\t * @name angular.bind\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n\t * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n\t * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n\t * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n\t *\n\t * @param {Object} self Context which `fn` should be evaluated in.\n\t * @param {function()} fn Function to be bound.\n\t * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n\t * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n\t */\n\t/* jshint +W101 */\n\tfunction bind(self, fn) {\n\t var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n\t if (isFunction(fn) && !(fn instanceof RegExp)) {\n\t return curryArgs.length\n\t ? function() {\n\t return arguments.length\n\t ? fn.apply(self, concat(curryArgs, arguments, 0))\n\t : fn.apply(self, curryArgs);\n\t }\n\t : function() {\n\t return arguments.length\n\t ? fn.apply(self, arguments)\n\t : fn.call(self);\n\t };\n\t } else {\n\t // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)\n\t return fn;\n\t }\n\t}\n\t\n\t\n\tfunction toJsonReplacer(key, value) {\n\t var val = value;\n\t\n\t if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n\t val = undefined;\n\t } else if (isWindow(value)) {\n\t val = '$WINDOW';\n\t } else if (value && document === value) {\n\t val = '$DOCUMENT';\n\t } else if (isScope(value)) {\n\t val = '$SCOPE';\n\t }\n\t\n\t return val;\n\t}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.toJson\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n\t * stripped since angular uses this notation internally.\n\t *\n\t * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.\n\t * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.\n\t * If set to an integer, the JSON output will contain that many spaces per indentation.\n\t * @returns {string|undefined} JSON-ified string representing `obj`.\n\t */\n\tfunction toJson(obj, pretty) {\n\t if (typeof obj === 'undefined') return undefined;\n\t if (!isNumber(pretty)) {\n\t pretty = pretty ? 2 : null;\n\t }\n\t return JSON.stringify(obj, toJsonReplacer, pretty);\n\t}\n\t\n\t\n\t/**\n\t * @ngdoc function\n\t * @name angular.fromJson\n\t * @module ng\n\t * @kind function\n\t *\n\t * @description\n\t * Deserializes a JSON string.\n\t *\n\t * @param {string} json JSON string to deserialize.\n\t * @returns {Object|Array|string|number} Deserialized JSON string.\n\t */\n\tfunction fromJson(json) {\n\t return isString(json)\n\t ? JSON.parse(json)\n\t : json;\n\t}\n\t\n\t\n\t/**\n\t * @returns {string} Returns the string representation of the element.\n\t */\n\tfunction startingTag(element) {\n\t element = jqLite(element).clone();\n\t try {\n\t // turns out IE does not let you set .html() on elements which\n\t // are not allowed to have children. So we just ignore it.\n\t element.empty();\n\t } catch (e) {}\n\t var elemHtml = jqLite('
').append(element).html();\n\t try {\n\t return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :\n\t elemHtml.\n\t match(/^(<[^>]+>)/)[1].\n\t replace(/^<([\\w\\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });\n\t } catch (e) {\n\t return lowercase(elemHtml);\n\t }\n\t\n\t}\n\t\n\t\n\t/////////////////////////////////////////////////\n\t\n\t/**\n\t * Tries to decode the URI component without throwing an exception.\n\t *\n\t * @private\n\t * @param str value potential URI component to check.\n\t * @returns {boolean} True if `value` can be decoded\n\t * with the decodeURIComponent function.\n\t */\n\tfunction tryDecodeURIComponent(value) {\n\t try {\n\t return decodeURIComponent(value);\n\t } catch (e) {\n\t // Ignore any invalid uri component\n\t }\n\t}\n\t\n\t\n\t/**\n\t * Parses an escaped url query string into key-value pairs.\n\t * @returns {Object.}\n\t */\n\tfunction parseKeyValue(/**string*/keyValue) {\n\t var obj = {}, key_value, key;\n\t forEach((keyValue || \"\").split('&'), function(keyValue) {\n\t if (keyValue) {\n\t key_value = keyValue.replace(/\\+/g,'%20').split('=');\n\t key = tryDecodeURIComponent(key_value[0]);\n\t if (isDefined(key)) {\n\t var val = isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true;\n\t if (!hasOwnProperty.call(obj, key)) {\n\t obj[key] = val;\n\t } else if (isArray(obj[key])) {\n\t obj[key].push(val);\n\t } else {\n\t obj[key] = [obj[key],val];\n\t }\n\t }\n\t }\n\t });\n\t return obj;\n\t}\n\t\n\tfunction toKeyValue(obj) {\n\t var parts = [];\n\t forEach(obj, function(value, key) {\n\t if (isArray(value)) {\n\t forEach(value, function(arrayValue) {\n\t parts.push(encodeUriQuery(key, true) +\n\t (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));\n\t });\n\t } else {\n\t parts.push(encodeUriQuery(key, true) +\n\t (value === true ? '' : '=' + encodeUriQuery(value, true)));\n\t }\n\t });\n\t return parts.length ? parts.join('&') : '';\n\t}\n\t\n\t\n\t/**\n\t * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n\t * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n\t * segments:\n\t * segment = *pchar\n\t * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n\t * pct-encoded = \"%\" HEXDIG HEXDIG\n\t * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n\t * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n\t * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n\t */\n\tfunction encodeUriSegment(val) {\n\t return encodeUriQuery(val, true).\n\t replace(/%26/gi, '&').\n\t replace(/%3D/gi, '=').\n\t replace(/%2B/gi, '+');\n\t}\n\t\n\t\n\t/**\n\t * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n\t * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n\t * encoded per http://tools.ietf.org/html/rfc3986:\n\t * query = *( pchar / \"/\" / \"?\" )\n\t * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n\t * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n\t * pct-encoded = \"%\" HEXDIG HEXDIG\n\t * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n\t * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n\t */\n\tfunction encodeUriQuery(val, pctEncodeSpaces) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%3B/gi, ';').\n\t replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n\t}\n\t\n\tvar ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];\n\t\n\tfunction getNgAttribute(element, ngAttr) {\n\t var attr, i, ii = ngAttrPrefixes.length;\n\t element = jqLite(element);\n\t for (i = 0; i < ii; ++i) {\n\t attr = ngAttrPrefixes[i] + ngAttr;\n\t if (isString(attr = element.attr(attr))) {\n\t return attr;\n\t }\n\t }\n\t return null;\n\t}\n\t\n\t/**\n\t * @ngdoc directive\n\t * @name ngApp\n\t * @module ng\n\t *\n\t * @element ANY\n\t * @param {angular.Module} ngApp an optional application\n\t * {@link angular.module module} name to load.\n\t * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n\t * created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n\t * do not use explicit function annotation (and are thus unsuitable for minification), as described\n\t * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n\t * tracking down the root of these bugs.\n\t *\n\t * @description\n\t *\n\t * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n\t * designates the **root element** of the application and is typically placed near the root element\n\t * of the page - e.g. on the `` or `` tags.\n\t *\n\t * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n\t * found in the document will be used to define the root element to auto-bootstrap as an\n\t * application. To run multiple applications in an HTML document you must manually bootstrap them using\n\t * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.\n\t *\n\t * You can specify an **AngularJS module** to be used as the root module for the application. This\n\t * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n\t * should contain the application code needed or have dependencies on other modules that will\n\t * contain the code. See {@link angular.module} for more information.\n\t *\n\t * In the example below if the `ngApp` directive were not placed on the `html` element then the\n\t * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n\t * would not be resolved to `3`.\n\t *\n\t * `ngApp` is the easiest, and most common way to bootstrap an application.\n\t *\n\t \n\t \n\t
\n\t I can add: {{a}} + {{b}} = {{ a+b }}\n\t
\n\t
\n\t \n\t angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n\t $scope.a = 1;\n\t $scope.b = 2;\n\t });\n\t \n\t
\n\t *\n\t * Using `ngStrictDi`, you would see something like this:\n\t *\n\t \n\t \n\t
\n\t
\n\t I can add: {{a}} + {{b}} = {{ a+b }}\n\t\n\t

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

\n\t
\n\t\n\t
\n\t Name:
\n\t Hello, {{name}}!\n\t\n\t

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

\n\t
\n\t\n\t
\n\t I can add: {{a}} + {{b}} = {{ a+b }}\n\t\n\t

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

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

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

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

Cached Values

\n\t
\n\t \n\t : \n\t \n\t
\n\t\n\t

Cache Info

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

{{total}}

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

{{total}}

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

$document title:

\n\t

window.document title:

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

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

\n\t *

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

\n\t *

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

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

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

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

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

{{ originalText }}

\n\t

{{ filteredText }}

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

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

\n\t Limit {{letters}} to: \n\t

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

\n\t Limit {{longNumber}} to: \n\t

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

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