diff --git a/config/lib/js/angular-ui/angular-ui-router.js b/config/lib/js/angular-ui/angular-ui-router.js index c8770993eb..bf8f0bcebb 100644 --- a/config/lib/js/angular-ui/angular-ui-router.js +++ b/config/lib/js/angular-ui/angular-ui-router.js @@ -1,6 +1,7 @@ /** * State-based routing for AngularJS * @version v0.2.10 + * Ionic fork, updated for Angular v1.3 * @link http://angular-ui.github.com/ * @license MIT License, http://www.opensource.org/licenses/MIT */ @@ -191,7 +192,7 @@ angular.module('ui.router.util', ['ng']); /** * @ngdoc overview * @name ui.router.router - * + * * @requires ui.router.util * * @description @@ -205,7 +206,7 @@ angular.module('ui.router.router', ['ui.router.util']); /** * @ngdoc overview * @name ui.router.state - * + * * @requires ui.router.router * @requires ui.router.util * @@ -214,7 +215,7 @@ angular.module('ui.router.router', ['ui.router.util']); * * This module is a dependency of the main ui.router module. Do not include this module as a dependency * in your angular app (use {@link ui.router} module instead). - * + * */ angular.module('ui.router.state', ['ui.router.router', 'ui.router.util']); @@ -226,17 +227,17 @@ angular.module('ui.router.state', ['ui.router.router', 'ui.router.util']); * * @description * # ui.router - * - * ## The main module for ui.router + * + * ## The main module for ui.router * There are several sub-modules included with the ui.router module, however only this module is needed - * as a dependency within your angular app. The other modules are for organization purposes. + * as a dependency within your angular app. The other modules are for organization purposes. * * The modules are: * * ui.router - the main "umbrella" module - * * ui.router.router - - * + * * ui.router.router - + * * *You'll need to include **only** this module as the dependency within your angular app.* - * + * *
*
*
@@ -270,14 +271,14 @@ angular.module('ui.router.compat', ['ui.router']);
*/
$Resolve.$inject = ['$q', '$injector'];
function $Resolve( $q, $injector) {
-
+
var VISIT_IN_PROGRESS = 1,
VISIT_DONE = 2,
NOTHING = {},
NO_DEPENDENCIES = [],
NO_LOCALS = NOTHING,
NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });
-
+
/**
* @ngdoc function
@@ -293,7 +294,7 @@ function $Resolve( $q, $injector) {
*
* $resolve.resolve(invocables, locals, parent, self)
*
- * but the former is more efficient (in fact `resolve` just calls `study`
+ * but the former is more efficient (in fact `resolve` just calls `study`
* internally).
*
* @param {object} invocables Invocable objects
@@ -301,19 +302,19 @@ function $Resolve( $q, $injector) {
*/
this.study = function (invocables) {
if (!isObject(invocables)) throw new Error("'invocables' must be an object");
-
+
// Perform a topological sort of invocables to build an ordered plan
var plan = [], cycle = [], visited = {};
function visit(value, key) {
if (visited[key] === VISIT_DONE) return;
-
+
cycle.push(key);
if (visited[key] === VISIT_IN_PROGRESS) {
cycle.splice(0, cycle.indexOf(key));
throw new Error("Cyclic dependency: " + cycle.join(" -> "));
}
visited[key] = VISIT_IN_PROGRESS;
-
+
if (isString(value)) {
plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);
} else {
@@ -323,17 +324,17 @@ function $Resolve( $q, $injector) {
});
plan.push(key, value, params);
}
-
+
cycle.pop();
visited[key] = VISIT_DONE;
}
forEach(invocables, visit);
invocables = cycle = visited = null; // plan is all that's required
-
+
function isResolve(value) {
return isObject(value) && value.then && value.$$promises;
}
-
+
return function (locals, parent, self) {
if (isResolve(locals) && self === undefined) {
self = parent; parent = locals; locals = null;
@@ -341,12 +342,12 @@ function $Resolve( $q, $injector) {
if (!locals) locals = NO_LOCALS;
else if (!isObject(locals)) {
throw new Error("'locals' must be an object");
- }
+ }
if (!parent) parent = NO_PARENT;
else if (!isResolve(parent)) {
throw new Error("'parent' must be a promise returned by $resolve.resolve()");
}
-
+
// To complete the overall resolution, we have to wait for the parent
// promise and for the promise for each invokable in our plan.
var resolution = $q.defer(),
@@ -355,28 +356,28 @@ function $Resolve( $q, $injector) {
values = extend({}, locals),
wait = 1 + plan.length/3,
merged = false;
-
+
function done() {
// Merge parent values we haven't got yet and publish our own $$values
if (!--wait) {
- if (!merged) merge(values, parent.$$values);
+ if (!merged) merge(values, parent.$$values);
result.$$values = values;
result.$$promises = true; // keep for isResolve()
resolution.resolve(values);
}
}
-
+
function fail(reason) {
result.$$failure = reason;
resolution.reject(reason);
}
-
+
// Short-circuit if parent has already failed
if (isDefined(parent.$$failure)) {
fail(parent.$$failure);
return result;
}
-
+
// Merge parent values if the parent has already resolved, or merge
// parent promises and wait if the parent resolve is still in progress.
if (parent.$$values) {
@@ -386,13 +387,13 @@ function $Resolve( $q, $injector) {
extend(promises, parent.$$promises);
parent.then(done, fail);
}
-
+
// Process each invocable in the plan, but ignore any where a local of the same name exists.
for (var i=0, ii=plan.length; i} The template html as a string, or a promise
+ * @return {string|Promise.} The template html as a string, or a promise
* for that string.
*/
this.fromUrl = function (url, params) {
@@ -600,9 +601,9 @@ function $TemplateFactory( $http, $templateCache, $injector) {
*
* @param {Function} provider Function to invoke via `$injector.invoke`
* @param {Object} params Parameters for the template.
- * @param {Object} locals Locals to pass to `invoke`. Defaults to
+ * @param {Object} locals Locals to pass to `invoke`. Defaults to
* `{ params: params }`.
- * @return {string|Promise.} The template html as a string, or a promise
+ * @return {string|Promise.} The template html as a string, or a promise
* for that string.
*/
this.fromProvider = function (provider, params, locals) {
@@ -622,7 +623,7 @@ angular.module('ui.router.util').service('$templateFactory', $TemplateFactory);
* of search parameters. Multiple search parameter names are separated by '&'. Search parameters
* do not influence whether or not a URL is matched, but their values are passed through into
* the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.
- *
+ *
* Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace
* syntax, which optionally allows a regular expression for the parameter to be specified:
*
@@ -633,13 +634,13 @@ angular.module('ui.router.util').service('$templateFactory', $TemplateFactory);
* curly braces, they must be in matched pairs or escaped with a backslash.
*
* Parameter names may contain only word characters (latin letters, digits, and underscore) and
- * must be unique within the pattern (across both path and search parameters). For colon
+ * must be unique within the pattern (across both path and search parameters). For colon
* placeholders or curly placeholders without an explicit regexp, a path parameter matches any
* number of characters other than '/'. For catch-all placeholders the path parameter matches
* any number of characters.
- *
+ *
* Examples:
- *
+ *
* * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for
* trailing slashes, and patterns have to match the entire path, not just a prefix.
* * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
@@ -664,7 +665,7 @@ angular.module('ui.router.util').service('$templateFactory', $TemplateFactory);
*
* @property {string} sourceSearch The search portion of the source property
*
- * @property {string} regex The constructed regex that will be used to match against the url when
+ * @property {string} regex The constructed regex that will be used to match against the url when
* it is time to determine which url will match.
*
* @returns {Object} New UrlMatcher object
@@ -814,7 +815,7 @@ UrlMatcher.prototype.exec = function (path, searchParams) {
*
* @description
* Returns the names of all path and search parameters of this pattern in an unspecified order.
- *
+ *
* @returns {Array.} An array of parameter names. Must be treated as read-only. If the
* pattern has no parameters, an empty array is returned.
*/
@@ -884,7 +885,7 @@ function $UrlMatcherFactory() {
*
* @description
* Creates a {@link ui.router.util.type:UrlMatcher} for the specified pattern.
- *
+ *
* @param {string} pattern The URL pattern.
* @returns {ui.router.util.type:UrlMatcher} The UrlMatcher.
*/
@@ -906,7 +907,7 @@ function $UrlMatcherFactory() {
this.isMatcher = function (o) {
return isObject(o) && isFunction(o.exec) && isFunction(o.format) && isFunction(o.concat);
};
-
+
/* No need to document $get, since it returns this */
this.$get = function () {
return this;
@@ -923,9 +924,9 @@ angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFacto
* @requires ui.router.util.$urlMatcherFactoryProvider
*
* @description
- * `$urlRouterProvider` has the responsibility of watching `$location`.
- * When `$location` changes it runs through a list of rules one by one until a
- * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify
+ * `$urlRouterProvider` has the responsibility of watching `$location`.
+ * When `$location` changes it runs through a list of rules one by one until a
+ * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify
* a url in a state configuration. All urls are compiled into a UrlMatcher object.
*
* There are several methods on `$urlRouterProvider` that make it useful to use directly
@@ -933,7 +934,7 @@ angular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFacto
*/
$UrlRouterProvider.$inject = ['$urlMatcherFactoryProvider'];
function $UrlRouterProvider( $urlMatcherFactory) {
- var rules = [],
+ var rules = [],
otherwise = null;
// Returns a string that is a prefix of all strings matching the RegExp
@@ -1012,8 +1013,8 @@ function $UrlRouterProvider( $urlMatcherFactory) {
* });
*
*
- * @param {string|object} rule The url path you want to redirect to or a function
- * rule that returns the url path. The function version is passed two params:
+ * @param {string|object} rule The url path you want to redirect to or a function
+ * rule that returns the url path. The function version is passed two params:
* `$injector` and `$location` services.
*
* @return {object} $urlRouterProvider - $urlRouterProvider instance
@@ -1131,8 +1132,8 @@ function $UrlRouterProvider( $urlMatcherFactory) {
*
*/
this.$get =
- [ '$location', '$rootScope', '$injector',
- function ($location, $rootScope, $injector) {
+ [ '$location', '$rootScope', '$injector', '$log',
+ function ($location, $rootScope, $injector, $log) {
// TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree
function update(evt) {
if (evt && evt.defaultPrevented) return;
@@ -1149,7 +1150,7 @@ function $UrlRouterProvider( $urlMatcherFactory) {
if (check(rules[i])) return;
}
if($location.$$path && $location.$$path !== '/') {
- console.warn('Routing: No route matched for', $location.$$path + '. Check your Ionic route definitions.');
+ $log.warn('Routing: No route matched for', $location.$$path + '. Check your Ionic route definitions.');
}
// always check otherwise last to allow dynamic updates to the set of rules
if (otherwise) check(otherwise);
@@ -1165,8 +1166,8 @@ function $UrlRouterProvider( $urlMatcherFactory) {
*
* @description
* Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.
- * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,
- * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed
+ * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,
+ * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed
* with the transition by calling `$urlRouter.sync()`.
*
* @example
@@ -1465,9 +1466,9 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* @methodOf ui.router.state.$stateProvider
*
* @description
- * Allows you to extend (carefully) or override (at your own peril) the
- * `stateBuilder` object used internally by `$stateProvider`. This can be used
- * to add custom functionality to ui-router, for example inferring templateUrl
+ * Allows you to extend (carefully) or override (at your own peril) the
+ * `stateBuilder` object used internally by `$stateProvider`. This can be used
+ * to add custom functionality to ui-router, for example inferring templateUrl
* based on the state name.
*
* When passing only a name, it returns the current (original or decorated) builder
@@ -1476,14 +1477,14 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* The builder functions that can be decorated are listed below. Though not all
* necessarily have a good use case for decoration, that is up to you to decide.
*
- * In addition, users can attach custom decorators, which will generate new
- * properties within the state's internal definition. There is currently no clear
- * use-case for this beyond accessing internal states (i.e. $state.$current),
- * however, expect this to become increasingly relevant as we introduce additional
+ * In addition, users can attach custom decorators, which will generate new
+ * properties within the state's internal definition. There is currently no clear
+ * use-case for this beyond accessing internal states (i.e. $state.$current),
+ * however, expect this to become increasingly relevant as we introduce additional
* meta-programming features.
*
- * **Warning**: Decorators should not be interdependent because the order of
- * execution of the builder functions in non-deterministic. Builder functions
+ * **Warning**: Decorators should not be interdependent because the order of
+ * execution of the builder functions in non-deterministic. Builder functions
* should only be dependent on the state definition object and super function.
*
*
@@ -1493,21 +1494,21 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* - **data** `{object}` - returns state data, including any inherited data that is not
* overridden by own values (if any).
* - **url** `{object}` - returns a {link ui.router.util.type:UrlMatcher} or null.
- * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
+ * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
* navigable).
- * - **params** `{object}` - returns an array of state params that are ensured to
+ * - **params** `{object}` - returns an array of state params that are ensured to
* be a super-set of parent's params.
- * - **views** `{object}` - returns a views object where each key is an absolute view
- * name (i.e. "viewName@stateName") and each value is the config object
- * (template, controller) for the view. Even when you don't use the views object
+ * - **views** `{object}` - returns a views object where each key is an absolute view
+ * name (i.e. "viewName@stateName") and each value is the config object
+ * (template, controller) for the view. Even when you don't use the views object
* explicitly on a state config, one is still created for you internally.
- * So by decorating this builder function you have access to decorating template
+ * So by decorating this builder function you have access to decorating template
* and controller properties.
- * - **ownParams** `{object}` - returns an array of params that belong to the state,
+ * - **ownParams** `{object}` - returns an array of params that belong to the state,
* not including any params defined by ancestor states.
- * - **path** `{string}` - returns the full path from the root down to this state.
+ * - **path** `{string}` - returns the full path from the root down to this state.
* Needed for state activation.
- * - **includes** `{object}` - returns an object that includes every state that
+ * - **includes** `{object}` - returns an object that includes every state that
* would pass a '$state.includes()' test.
*
* @example
@@ -1540,8 +1541,8 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* // and /partials/home/contact/item.html, respectively.
*
*
- * @param {string} name The name of the builder function to decorate.
- * @param {object} func A function that is responsible for decorating the original
+ * @param {string} name The name of the builder function to decorate.
+ * @param {object} func A function that is responsible for decorating the original
* builder function. The function receives two parameters:
*
* - `{object}` - state - The state config object.
@@ -1577,9 +1578,9 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
*
* - **`template`** - {string|function=} - html template as a string or a function that returns
- * an html template as a string which should be used by the uiView directives. This property
+ * an html template as a string which should be used by the uiView directives. This property
* takes precedence over templateUrl.
- *
+ *
* If `template` is a function, it will be called with the following parameters:
*
* - {array.<object>} - state parameters extracted from the current $location.path() by
@@ -1587,12 +1588,12 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
*
*
- * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html
+ * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html
* template that should be used by uiView.
- *
+ *
* If `templateUrl` is a function, it will be called with the following parameters:
*
- * - {array.<object>} - state parameters extracted from the current $location.path() by
+ * - {array.<object>} - state parameters extracted from the current $location.path() by
* applying the current state
*
*
@@ -1602,7 +1603,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
*
*
- * - **`controller`** - {string|function=} - Controller fn that should be associated with newly
+ * - **`controller`** - {string|function=} - Controller fn that should be associated with newly
* related scope or the name of a registered controller if passed as a string.
*
*
@@ -1611,35 +1612,35 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* the actual controller or string.
*
*
- *
- * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be
+ *
+ * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be
* published to scope under the controllerAs name.
*
*
*
- * - **`resolve`** - {object.<string, function>=} - An optional map of dependencies which
- * should be injected into the controller. If any of these dependencies are promises,
- * the router will wait for them all to be resolved or one to be rejected before the
- * controller is instantiated. If all the promises are resolved successfully, the values
- * of the resolved promises are injected and $stateChangeSuccess event is fired. If any
+ * - **`resolve`** - {object.<string, function>=} - An optional map of dependencies which
+ * should be injected into the controller. If any of these dependencies are promises,
+ * the router will wait for them all to be resolved or one to be rejected before the
+ * controller is instantiated. If all the promises are resolved successfully, the values
+ * of the resolved promises are injected and $stateChangeSuccess event is fired. If any
* of the promises are rejected the $stateChangeError event is fired. The map object is:
- *
+ *
* - key - {string}: name of dependency to be injected into controller
- * - factory - {string|function}: If string then it is alias for service. Otherwise if function,
- * it is injected and return value it treated as dependency. If result is a promise, it is
+ * - factory - {string|function}: If string then it is alias for service. Otherwise if function,
+ * it is injected and return value it treated as dependency. If result is a promise, it is
* resolved before its value is injected into controller.
*
*
*
* - **`url`** - {string=} - A url with optional parameters. When a state is navigated or
- * transitioned to, the `$stateParams` service will be populated with any
+ * transitioned to, the `$stateParams` service will be populated with any
* parameters that were passed.
*
*
*
- * - **`params`** - {object=} - An array of parameter names or regular expressions. Only
+ * - **`params`** - {object=} - An array of parameter names or regular expressions. Only
* use this within a state if you are not using url. Otherwise you can specify your
- * parameters within the url. When a state is navigated or transitioned to, the
+ * parameters within the url. When a state is navigated or transitioned to, the
* $stateParams service will be populated with any parameters that were passed.
*
*
@@ -1649,7 +1650,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
*
*
- * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,
+ * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,
* but can provide inherited properties to its common children states.
*
*
@@ -1664,8 +1665,8 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
*
*
- * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state
- * just because a search/query parameter has changed (via $location.search() or $location.hash()).
+ * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state
+ * just because a search/query parameter has changed (via $location.search() or $location.hash()).
* Useful for when you'd like to modify $location.search() without triggering a reload.
*
*
@@ -1679,7 +1680,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* // stateName can be a single top-level name (must be unique).
* $stateProvider.state("home", {});
*
- * // Or it can be a nested state name. This state is a child of the
+ * // Or it can be a nested state name. This state is a child of the
* // above "home" state.
* $stateProvider.state("home.newest", {});
*
@@ -1693,7 +1694,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* .state("contacts", {});
*
*
- * @param {string} name A unique state name, e.g. "home", "about", "contacts".
+ * @param {string} name A unique state name, e.g. "home", "about", "contacts".
* To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
* @param {object} definition State configuration object.
*/
@@ -1717,11 +1718,11 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* @requires ui.router.util.$resolve
* @requires ui.router.state.$stateParams
*
- * @property {object} params A param object, e.g. {sectionId: section.id)}, that
+ * @property {object} params A param object, e.g. {sectionId: section.id)}, that
* you'd like to test against the current active state.
- * @property {object} current A reference to the state's config object. However
+ * @property {object} current A reference to the state's config object. However
* you passed it in. Useful for accessing custom data.
- * @property {object} transition Currently pending transition. A promise that'll
+ * @property {object} transition Currently pending transition. A promise that'll
* resolve or reject.
*
* @description
@@ -1762,7 +1763,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* @methodOf ui.router.state.$state
*
* @description
- * A method that force reloads the current state. All resolves are re-resolved, events are not re-fired,
+ * A method that force reloads the current state. All resolves are re-resolved, events are not re-fired,
* and controllers reinstantiated (bug with controllers reinstantiating right now, fixing soon).
*
* @example
@@ -1778,8 +1779,8 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
* `reload()` is just an alias for:
*
- * $state.transitionTo($state.current, $stateParams, {
- * reload: true, inherit: false, notify: false
+ * $state.transitionTo($state.current, $stateParams, {
+ * reload: true, inherit: false, notify: false
* });
*
*/
@@ -1793,11 +1794,11 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* @methodOf ui.router.state.$state
*
* @description
- * Convenience method for transitioning to a new state. `$state.go` calls
- * `$state.transitionTo` internally but automatically sets options to
- * `{ location: true, inherit: true, relative: $state.$current, notify: true }`.
- * This allows you to easily use an absolute or relative to path and specify
- * only the parameters you'd like to update (while letting unspecified parameters
+ * Convenience method for transitioning to a new state. `$state.go` calls
+ * `$state.transitionTo` internally but automatically sets options to
+ * `{ location: true, inherit: true, relative: $state.$current, notify: true }`.
+ * This allows you to easily use an absolute or relative to path and specify
+ * only the parameters you'd like to update (while letting unspecified parameters
* inherit from the currently active ancestor states).
*
* @example
@@ -1819,8 +1820,8 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* - `$state.go('^.sibling')` - will go to a sibling state
* - `$state.go('.child.grandchild')` - will go to grandchild state
*
- * @param {object=} params A map of the parameters that will be sent to the state,
- * will populate $stateParams. Any parameters that are not specified will be inherited from currently
+ * @param {object=} params A map of the parameters that will be sent to the state,
+ * will populate $stateParams. Any parameters that are not specified will be inherited from currently
* defined parameters. This allows, for example, going to a sibling state that shares parameters
* specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.
* transitioning to a sibling will get you the parameters for all parents, transitioning to a child
@@ -1830,10 +1831,10 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
* will not. If string, must be `"replace"`, which will update url and also replace last history record.
* - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.
- * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
+ * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
- * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
+ * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
* have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
* use this when you want to force a reload when *everything* is the same, including search params.
*
@@ -1885,10 +1886,10 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`
* will not. If string, must be `"replace"`, which will update url and also replace last history record.
* - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.
- * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'),
+ * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
- * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
+ * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
* have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
* use this when you want to force a reload when *everything* is the same, including search params.
*
@@ -2157,8 +2158,8 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
* @description
* Similar to {@link ui.router.state.$state#methods_includes $state.includes},
- * but only checks for the full state name. If params is supplied then it will be
- * tested for strict equality against the current active params object, so all params
+ * but only checks for the full state name. If params is supplied then it will be
+ * tested for strict equality against the current active params object, so all params
* must match with none missing and no extras.
*
* @example
@@ -2170,7 +2171,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
*
* @param {string|object} stateName The state name or state object you'd like to check.
- * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like
+ * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like
* to test against the current active state.
* @returns {boolean} Returns true if it is the state.
*/
@@ -2194,7 +2195,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* @methodOf ui.router.state.$state
*
* @description
- * A method to determine if the current active state is equal to or is the child of the
+ * A method to determine if the current active state is equal to or is the child of the
* state stateName. If any params are passed then they will be tested for a match as well.
* Not all the parameters need to be passed, just the ones you'd like to test for equality.
*
@@ -2226,7 +2227,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
*
*
* @param {string} stateOrName A partial name to be searched for within the current state name.
- * @param {object} params A param object, e.g. `{sectionId: section.id}`,
+ * @param {object} params A param object, e.g. `{sectionId: section.id}`,
* that you'd like to test against the current active state.
* @returns {boolean} Returns true if it does include the state
*/
@@ -2280,10 +2281,10 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
* first parameter, then the constructed href url will be built from the first navigable ancestor (aka
* ancestor with a valid url).
* - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.
- * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
+ * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
- *
+ *
* @returns {string} compiled state url
*/
$state.href = function href(stateOrName, params, options) {
@@ -2294,12 +2295,20 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
params = inheritParams($stateParams, params || {}, $state.$current, state);
var nav = (state && options.lossy) ? state.navigable : state;
var url = (nav && nav.url) ? nav.url.format(normalize(state.params, params || {})) : null;
- if (!$locationProvider.html5Mode() && url) {
+
+ var isHtml5 = $locationProvider.html5Mode();
+
+ // Angular 1.3.X +
+ if (isObject(isHtml5)) {
+ isHtml5 = isHtml5.enabled;
+ }
+
+ if (!isHtml5 && url) {
url = "#" + $locationProvider.hashPrefix() + url;
}
if (baseHref !== '/') {
- if ($locationProvider.html5Mode()) {
+ if (isHtml5) {
url = baseHref.slice(0, -1) + url;
} else if (options.absolute){
url = baseHref.slice(1) + url;
@@ -2307,10 +2316,10 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory, $
}
if (options.absolute && url) {
- url = $location.protocol() + '://' +
- $location.host() +
- ($location.port() == 80 || $location.port() == 443 ? '' : ':' + $location.port()) +
- (!$locationProvider.html5Mode() && url ? '/' : '') +
+ url = $location.protocol() + '://' +
+ $location.host() +
+ ($location.port() == 80 || $location.port() == 443 ? '' : ':' + $location.port()) +
+ (!isHtml5 && url ? '/' : '') +
url;
}
return url;
@@ -2551,26 +2560,26 @@ angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider)
* functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*
*
* @param {string=} onload Expression to evaluate whenever the view updates.
- *
+ *
* @example
- * A view can be unnamed or named.
+ * A view can be unnamed or named.
* * - * - * + * + * * * ** - * You can only have one unnamed view within any template (or root html). If you are only using a + * You can only have one unnamed view within any template (or root html). If you are only using a * single view and it is unnamed then you can populate it like so: *
- *
+ *
* $stateProvider.state("home", {
* template: "HELLO!
"
* })
*
- *
+ *
* The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#views `views`}
* config property, by name, in this case an empty name:
*
@@ -2579,33 +2588,33 @@ angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider)
* "": {
* template: "HELLO!
"
* }
- * }
+ * }
* })
*
- *
- * But typically you'll only use the views property if you name your view or have more than one view
- * in the same template. There's not really a compelling reason to name a view if its the only one,
+ *
+ * But typically you'll only use the views property if you name your view or have more than one view
+ * in the same template. There's not really a compelling reason to name a view if its the only one,
* but you could if you wanted, like so:
* * - *+ * *
* $stateProvider.state("home", {
* views: {
* "main": {
* template: "HELLO!
"
* }
- * }
+ * }
* })
*
- *
+ *
* Really though, you'll use views to set up multiple views:
* * - * - * + * + * *- * + * *
* $stateProvider.state("home", {
* views: {
@@ -2618,7 +2627,7 @@ angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider)
* "data": {
* template: " "
* }
- * }
+ * }
* })
*
*
@@ -2667,8 +2676,14 @@ function $ViewDirective( $state, $injector, $uiViewScroll) {
if ($animate) {
return {
- enter: function(element, target, cb) { $animate.enter(element, null, target, cb); },
- leave: function(element, cb) { $animate.leave(element, cb); }
+ enter: function(element, target, cb) {
+ var promise = $animate.enter(element, null, target, cb);
+ if (promise && promise.then) promise.then(cb);
+ },
+ leave: function(element, cb) {
+ var promise = $animate.leave(element, cb);
+ if (promise && promise.then) promise.then(cb);
+ }
};
}
@@ -2838,17 +2853,17 @@ function stateContext(el) {
* @restrict A
*
* @description
- * A directive that binds a link (`` tag) to a state. If the state has an associated
- * URL, the directive will automatically generate & update the `href` attribute via
- * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
- * the link will trigger a state transition with optional parameters.
+ * A directive that binds a link (`` tag) to a state. If the state has an associated
+ * URL, the directive will automatically generate & update the `href` attribute via
+ * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
+ * the link will trigger a state transition with optional parameters.
*
- * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
+ * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
* handled natively by the browser.
*
- * You can also use relative state paths within ui-sref, just like the relative
+ * You can also use relative state paths within ui-sref, just like the relative
* paths passed to `$state.go()`. You just need to be aware that the path is relative
- * to the state that the link lives in, in other words the state that loaded the
+ * to the state that the link lives in, in other words the state that loaded the
* template containing the link.
*
* You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
@@ -2856,22 +2871,22 @@ function stateContext(el) {
* and `reload`.
*
* @example
- * Here's an example of how you'd use ui-sref and how it would compile. If you have the
+ * Here's an example of how you'd use ui-sref and how it would compile. If you have the
* following template:
* * Home | About - * + * *
* Home | About - * + * *
*
*
* var app = angular.module('app', ['ui.router.compat']);
diff --git a/config/lib/js/angular-ui/angular-ui-router.min.js b/config/lib/js/angular-ui/angular-ui-router.min.js
index f065ecc960..a14cae6864 100644
--- a/config/lib/js/angular-ui/angular-ui-router.min.js
+++ b/config/lib/js/angular-ui/angular-ui-router.min.js
@@ -1,7 +1,8 @@
/**
* State-based routing for AngularJS
* @version v0.2.10
+ * Ionic fork, updated for Angular v1.3
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
-"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return I(new(I(function(){},{prototype:a})),b)}function e(a){return H(arguments,function(b){b!==a&&H(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function h(a,b,c,d){var e,h=f(c,d),i={},j=[];for(var k in h)if(h[k].params&&h[k].params.length){e=h[k].params;for(var l in e)g(j,e[l])>=0||(j.push(e[l]),i[e[l]]=a[e[l]])}return I({},i,b)}function i(a,b){var c={};return H(a,function(a){var d=b[a];c[a]=null!=d?String(d):null}),c}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(o[c]=d,E(a))m.push(c,[function(){return b.get(a)}],h);else{var e=b.annotate(a);H(e,function(a){a!==c&&g.hasOwnProperty(a)&&k(g[a],a)}),m.push(c,a,e)}n.pop(),o[c]=f}}function l(a){return F(a)&&a.then&&a.$$promises}if(!F(g))throw new Error("'invocables' must be an object");var m=[],n=[],o={};return H(g,k),g=n=o=null,function(d,f,g){function h(){--s||(t||e(r,f.$$values),p.$$values=r,p.$$promises=!0,o.resolve(r))}function k(a){p.$$failure=a,o.reject(a)}function n(c,e,f){function i(a){l.reject(a),k(a)}function j(){if(!C(p.$$failure))try{l.resolve(b.invoke(e,g,r)),l.promise.then(function(a){r[c]=a,h()},i)}catch(a){i(a)}}var l=a.defer(),m=0;H(f,function(a){q.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,q[a].then(function(b){r[a]=b,--m||j()},i))}),m||j(),q[c]=l.promise}if(l(d)&&g===c&&(g=f,f=d,d=null),d){if(!F(d))throw new Error("'locals' must be an object")}else d=i;if(f){if(!l(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=j;var o=a.defer(),p=o.promise,q=p.$$promises={},r=I({},d),s=1+m.length/3,t=!1;if(C(f.$$failure))return k(f.$$failure),p;f.$$values?(t=e(r,f.$$values),h()):(I(q,f.$$promises),f.then(h,k));for(var u=0,v=m.length;v>u;u+=3)d.hasOwnProperty(m[u])?h():n(m[u],m[u+1],m[u+2]);return p}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function m(a,b,c){this.fromConfig=function(a,b,c){return C(a.template)?this.fromString(a.template,b):C(a.templateUrl)?this.fromUrl(a.templateUrl,b):C(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return D(a)?a(b):a},this.fromUrl=function(c,d){return D(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function n(a){function b(b){if(!/^\w+(-+\w+)*$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(f[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");f[b]=!0,j.push(b)}function c(a){return a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&")}var d,e=/([:*])(\w+)|\{(\w+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,f={},g="^",h=0,i=this.segments=[],j=this.params=[];this.source=a;for(var k,l,m;(d=e.exec(a))&&(k=d[2]||d[3],l=d[4]||("*"==d[1]?".*":"[^/]*"),m=a.substring(h,d.index),!(m.indexOf("?")>=0));)g+=c(m)+"("+l+")",b(k),i.push(m),h=e.lastIndex;m=a.substring(h);var n=m.indexOf("?");if(n>=0){var o=this.sourceSearch=m.substring(n);m=m.substring(0,n),this.sourcePath=a.substring(0,h+n),H(o.substring(1).split(/[&?]/),b)}else this.sourcePath=a,this.sourceSearch="";g+=c(m)+"$",i.push(m),this.regexp=new RegExp(g),this.prefix=i[0]}function o(){this.compile=function(a){return new n(a)},this.isMatcher=function(a){return F(a)&&D(a.exec)&&D(a.format)&&D(a.concat)},this.$get=function(){return this}}function p(a){function b(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function c(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function d(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return C(d)?d:!0}var e=[],f=null;this.rule=function(a){if(!D(a))throw new Error("'rule' must be a function");return e.push(a),this},this.otherwise=function(a){if(E(a)){var b=a;a=function(){return b}}else if(!D(a))throw new Error("'rule' must be a function");return f=a,this},this.when=function(e,f){var g,h=E(f);if(E(e)&&(e=a.compile(e)),!h&&!D(f)&&!G(f))throw new Error("invalid 'handler' in when()");var i={matcher:function(b,c){return h&&(g=a.compile(c),c=["$match",function(a){return g.format(a)}]),I(function(a,e){return d(a,c,b.exec(e.path(),e.search()))},{prefix:E(b.prefix)?b.prefix:""})},regex:function(a,e){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(g=e,e=["$match",function(a){return c(g,a)}]),I(function(b,c){return d(b,e,a.exec(c.path()))},{prefix:b(a)})}},j={matcher:a.isMatcher(e),regex:e instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](e,f));throw new Error("invalid 'what' in when()")},this.$get=["$location","$rootScope","$injector",function(a,b,c){function d(b){function d(b){var d=b(c,a);return d?(E(d)&&a.replace().url(d),!0):!1}if(!b||!b.defaultPrevented){var g,h=e.length;for(g=0;h>g;g++)if(d(e[g]))return;f&&d(f)}}return b.$on("$locationChangeSuccess",d),{sync:function(){d()}}}]}function q(a,e,f){function g(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function l(a,b){var d=E(a),e=d?a:a.name,f=g(e);if(f){if(!b)throw new Error("No reference point given for path '"+e+"'");for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=w[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function m(a,b){x[a]||(x[a]=[]),x[a].push(b)}function n(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!E(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(w.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):E(b.parent)?b.parent:"";if(e&&!w[e])return m(e,b.self);for(var f in z)D(z[f])&&(b[f]=z[f](b,z.$delegates[f]));if(w[c]=b,!b[y]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){v.$current.navigable==b&&j(a,c)||v.transitionTo(b,a,{location:!1})}]),x[c])for(var g=0;g-1}function p(a){var b=a.split("."),c=v.$current.name.split(".");if("**"===b[0]&&(c=c.slice(c.indexOf(b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(c.indexOf(b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length)return!1;for(var d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return c.join("")===b.join("")}function q(a,b){return E(a)&&!C(b)?z[a]:D(b)&&E(a)?(z[a]&&!z.$delegates[a]&&(z.$delegates[a]=z[a]),z[a]=b,this):this}function r(a,b){return F(a)?b=a:b.name=a,n(b),this}function s(a,e,g,m,n,q,r,s,x){function z(){r.url()!==M&&(r.url(M),r.replace())}function A(a,c,d,f,h){var i=d?c:k(a.params,c),j={$stateParams:i};h.resolve=n.resolve(a.resolve,j,h.resolve,a);var l=[h.resolve.then(function(a){h.globals=a})];return f&&l.push(f),H(a.views,function(c,d){var e=c.resolve&&c.resolve!==a.resolve?c.resolve:{};e.$template=[function(){return g.load(d,{view:c,locals:j,params:i,notify:!1})||""}],l.push(n.resolve(e,j,h.resolve,a).then(function(f){if(D(c.controllerProvider)||G(c.controllerProvider)){var g=b.extend({},e,j);f.$$controller=m.invoke(c.controllerProvider,null,g)}else f.$$controller=c.controller;f.$$state=a,f.$$controllerAs=c.controllerAs,h[d]=f}))}),e.all(l).then(function(){return h})}var B=e.reject(new Error("transition superseded")),F=e.reject(new Error("transition prevented")),K=e.reject(new Error("transition aborted")),L=e.reject(new Error("transition failed")),M=r.url(),N=x.baseHref();return u.locals={resolve:null,globals:{$stateParams:{}}},v={params:{},current:u.self,$current:u,transition:null},v.reload=function(){v.transitionTo(v.current,q,{reload:!0,inherit:!1,notify:!1})},v.go=function(a,b,c){return this.transitionTo(a,b,I({inherit:!0,relative:v.$current},c))},v.transitionTo=function(b,c,f){c=c||{},f=I({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,k=v.$current,n=v.params,o=k.path,p=l(b,f.relative);if(!C(p)){var s={to:b,toParams:c,options:f};if(g=a.$broadcast("$stateNotFound",s,k.self,n),g.defaultPrevented)return z(),K;if(g.retry){if(f.$retry)return z(),L;var w=v.transition=e.when(g.retry);return w.then(function(){return w!==v.transition?B:(s.options.$retry=!0,v.transitionTo(s.to,s.toParams,s.options))},function(){return K}),z(),w}if(b=s.to,c=s.toParams,f=s.options,p=l(b,f.relative),!C(p)){if(f.relative)throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'");throw new Error("No such state '"+b+"'")}}if(p[y])throw new Error("Cannot transition to abstract state '"+b+"'");f.inherit&&(c=h(q,c||{},v.$current,p)),b=p;var x,D,E=b.path,G=u.locals,H=[];for(x=0,D=E[x];D&&D===o[x]&&j(c,n,D.ownParams)&&!f.reload;x++,D=E[x])G=H[x]=D.locals;if(t(b,k,G,f))return b.self.reloadOnSearch!==!1&&z(),v.transition=null,e.when(v.current);if(c=i(b.params,c||{}),f.notify&&(g=a.$broadcast("$stateChangeStart",b.self,c,k.self,n),g.defaultPrevented))return z(),F;for(var N=e.when(G),O=x;O=x;d--)g=o[d],g.self.onExit&&m.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=x;d1||b.ctrlKey||b.metaKey||b.shiftKey||f.attr("target")||(c(function(){a.go(i.state,j,o)}),b.preventDefault())})}}}function y(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs",function(d,e,f){function g(){a.$current.self===i&&h()?e.addClass(l):e.removeClass(l)}function h(){return!k||j(k,b)}var i,k,l;l=c(f.uiSrefActive||"",!1)(d),this.$$setStateInfo=function(b,c){i=a.get(b,w(e)),k=c,g()},d.$on("$stateChangeSuccess",g)}]}}function z(a){return function(b){return a.is(b)}}function A(a){return function(b){return a.includes(b)}}function B(a,b){function e(a){this.locals=a.locals.globals,this.params=this.locals.$stateParams}function f(){this.locals=null,this.params=null}function g(c,g){if(null!=g.redirectTo){var h,j=g.redirectTo;if(E(j))h=j;else{if(!D(j))throw new Error("Invalid 'redirectTo' in when()");h=function(a,b){return j(a,b.path(),b.search())}}b.when(c,h)}else a.state(d(g,{parent:null,name:"route:"+encodeURIComponent(c),url:c,onEnter:e,onExit:f}));return i.push(g),this}function h(a,b,d){function e(a){return""!==a.name?a:c}var f={routes:i,params:d,current:c};return b.$on("$stateChangeStart",function(a,c,d,f){b.$broadcast("$routeChangeStart",e(c),e(f))}),b.$on("$stateChangeSuccess",function(a,c,d,g){f.current=e(c),b.$broadcast("$routeChangeSuccess",e(c),e(g)),J(d,f.params)}),b.$on("$stateChangeError",function(a,c,d,f,g,h){b.$broadcast("$routeChangeError",e(c),e(f),h)}),f}var i=[];e.$inject=["$$state"],this.when=g,this.$get=h,h.$inject=["$state","$rootScope","$routeParams"]}var C=b.isDefined,D=b.isFunction,E=b.isString,F=b.isObject,G=b.isArray,H=b.forEach,I=b.extend,J=b.copy;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),l.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",l),m.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",m),n.prototype.concat=function(a){return new n(this.sourcePath+a+this.sourceSearch)},n.prototype.toString=function(){return this.source},n.prototype.exec=function(a,b){var c=this.regexp.exec(a);if(!c)return null;var d,e=this.params,f=e.length,g=this.segments.length-1,h={};if(g!==c.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(d=0;g>d;d++)h[e[d]]=c[d+1];for(;f>d;d++)h[e[d]]=b[e[d]];return h},n.prototype.parameters=function(){return this.params},n.prototype.format=function(a){var b=this.segments,c=this.params;if(!a)return b.join("");var d,e,f,g=b.length-1,h=c.length,i=b[0];for(d=0;g>d;d++)f=a[c[d]],null!=f&&(i+=encodeURIComponent(f)),i+=b[d+1];for(;h>d;d++)f=a[c[d]],null!=f&&(i+=(e?"&":"?")+c[d]+"="+encodeURIComponent(f),e=!0);return i},b.module("ui.router.util").provider("$urlMatcherFactory",o),p.$inject=["$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",p),q.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider","$locationProvider"],b.module("ui.router.state").value("$stateParams",{}).provider("$state",q),r.$inject=[],b.module("ui.router.state").provider("$view",r),b.module("ui.router.state").provider("$uiViewScroll",s),t.$inject=["$state","$injector","$uiViewScroll"],u.$inject=["$compile","$controller","$state"],b.module("ui.router.state").directive("uiView",t),b.module("ui.router.state").directive("uiView",u),x.$inject=["$state","$timeout"],y.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",x).directive("uiSrefActive",y),z.$inject=["$state"],A.$inject=["$state"],b.module("ui.router.state").filter("isState",z).filter("includedByState",A),B.$inject=["$stateProvider","$urlRouterProvider"],b.module("ui.router.compat").provider("$route",B).directive("ngView",t)}(window,window.angular);
\ No newline at end of file
+"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(r,t,e){"use strict";function n(r,t){return R(new(R(function(){},{prototype:r})),t)}function o(r){return M(arguments,function(t){t!==r&&M(t,function(t,e){r.hasOwnProperty(e)||(r[e]=t)})}),r}function i(r,t){var e=[];for(var n in r.path){if(r.path[n]!==t.path[n])break;e.push(r.path[n])}return e}function a(r,t){if(Array.prototype.indexOf)return r.indexOf(t,+arguments[2]||0);var e=r.length>>>0,n=+arguments[2]||0;for(n=0>n?Math.ceil(n):Math.floor(n),0>n&&(n+=e);e>n;n++)if(n in r&&r[n]===t)return n;return-1}function u(r,t,e,n){var o,u=i(e,n),l={},s=[];for(var c in u)if(u[c].params&&u[c].params.length){o=u[c].params;for(var f in o)a(s,o[f])<0&&(s.push(o[f]),l[o[f]]=r[o[f]])}return R({},l,t)}function l(r,t){var e={};return M(r,function(r){var n=t[r];e[r]=null!=n?n+"":null}),e}function s(r,t,e){if(!e){e=[];for(var n in r)e.push(n)}for(var o=0;o "));if(p[e]=n,I(r))h.push(e,[function(){return t.get(r)}],u);else{var o=t.annotate(r);M(o,function(r){r!==e&&a.hasOwnProperty(r)&&c(a[r],r)}),h.push(e,r,o)}$.pop(),p[e]=i}}function f(r){return V(r)&&r.then&&r.$$promises}if(!V(a))throw Error("'invocables' must be an object");var h=[],$=[],p={};return M(a,c),a=$=p=null,function(n,i,a){function u(){--g||(w||o(d,i.$$values),v.$$values=d,v.$$promises=!0,p.resolve(d))}function c(r){v.$$failure=r,p.reject(r)}function $(e,o,i){function l(r){f.reject(r),c(r)}function s(){if(!O(v.$$failure))try{f.resolve(t.invoke(o,a,d)),f.promise.then(function(r){d[e]=r,u()},l)}catch(r){l(r)}}var f=r.defer(),h=0;M(i,function(r){m.hasOwnProperty(r)&&!n.hasOwnProperty(r)&&(h++,m[r].then(function(t){d[r]=t,--h||s()},l))}),h||s(),m[e]=f.promise}if(f(n)&&a===e&&(a=i,i=n,n=null),n){if(!V(n))throw Error("'locals' must be an object")}else n=l;if(i){if(!f(i))throw Error("'parent' must be a promise returned by $resolve.resolve()")}else i=s;var p=r.defer(),v=p.promise,m=v.$$promises={},d=R({},n),g=1+h.length/3,w=!1;if(O(i.$$failure))return c(i.$$failure),v;i.$$values?(w=o(d,i.$$values),u()):(R(m,i.$$promises),i.then(u,c));for(var b=0,y=h.length;y>b;b+=3)n.hasOwnProperty(h[b])?u():$(h[b],h[b+1],h[b+2]);return v}},this.resolve=function(r,t,e,n){return this.study(r)(t,e,n)}}function h(r,t,e){this.fromConfig=function(r,t,e){return O(r.template)?this.fromString(r.template,t):O(r.templateUrl)?this.fromUrl(r.templateUrl,t):O(r.templateProvider)?this.fromProvider(r.templateProvider,t,e):null},this.fromString=function(r,t){return A(r)?r(t):r},this.fromUrl=function(e,n){return A(e)&&(e=e(n)),null==e?null:r.get(e,{cache:t}).then(function(r){return r.data})},this.fromProvider=function(r,t,n){return e.invoke(r,null,n||{params:t})}}function $(r){function t(t){if(!/^\w+(-+\w+)*$/.test(t))throw Error("Invalid parameter name '"+t+"' in pattern '"+r+"'");if(i[t])throw Error("Duplicate parameter name '"+t+"' in pattern '"+r+"'");i[t]=!0,s.push(t)}function e(r){return r.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&")}var n,o=/([:*])(\w+)|\{(\w+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,i={},a="^",u=0,l=this.segments=[],s=this.params=[];this.source=r;for(var c,f,h;(n=o.exec(r))&&(c=n[2]||n[3],f=n[4]||("*"==n[1]?".*":"[^/]*"),h=r.substring(u,n.index),h.indexOf("?")<0);)a+=e(h)+"("+f+")",t(c),l.push(h),u=o.lastIndex;h=r.substring(u);var $=h.indexOf("?");if($<0)this.sourcePath=r,this.sourceSearch="";else{var p=this.sourceSearch=h.substring($);h=h.substring(0,$),this.sourcePath=r.substring(0,u+$),M(p.substring(1).split(/[&?]/),t)}a+=e(h)+"$",l.push(h),this.regexp=RegExp(a),this.prefix=l[0]}function p(){this.compile=function(r){return new $(r)},this.isMatcher=function(r){return V(r)&&A(r.exec)&&A(r.format)&&A(r.concat)},this.$get=function(){return this}}function v(r){function t(r){var t=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(r.source);return null!=t?t[1].replace(/\\(.)/g,"$1"):""}function e(r,t){return r.replace(/\$(\$|\d{1,2})/,function(r,e){return t["$"===e?0:+e]})}function n(r,t,e){if(!e)return!1;var n=r.invoke(t,t,{$match:e});return O(n)?n:!0}var o=[],i=null;this.rule=function(r){if(!A(r))throw Error("'rule' must be a function");return o.push(r),this},this.otherwise=function(r){if(I(r)){var t=r;r=function(){return t}}else if(!A(r))throw Error("'rule' must be a function");return i=r,this},this.when=function(o,i){var a,u=I(i);if(I(o)&&(o=r.compile(o)),!u&&!A(i)&&!k(i))throw Error("invalid 'handler' in when()");var l={matcher:function(t,e){return u&&(a=r.compile(e),e=["$match",function(r){return a.format(r)}]),R(function(r,o){return n(r,e,t.exec(o.path(),o.search()))},{prefix:I(t.prefix)?t.prefix:""})},regex:function(r,o){if(r.global||r.sticky)throw Error("when() RegExp must not be global or sticky");return u&&(a=o,o=["$match",function(r){return e(a,r)}]),R(function(t,e){return n(t,o,r.exec(e.path()))},{prefix:t(r)})}},s={matcher:r.isMatcher(o),regex:o instanceof RegExp};for(var c in s)if(s[c])return this.rule(l[c](o,i));throw Error("invalid 'what' in when()")},this.$get=["$location","$rootScope","$injector","$log",function(r,t,e,n){function a(t){function a(t){var n=t(e,r);return n?(I(n)&&r.replace().url(n),!0):!1}if(!t||!t.defaultPrevented){var u,l=o.length;for(u=0;l>u;u++)if(a(o[u]))return;r.$$path&&"/"!==r.$$path&&n.warn("Routing: No route matched for",r.$$path+". Check your Ionic route definitions."),i&&a(i)}}return t.$on("$locationChangeSuccess",a),{sync:function(){a()}}}]}function m(r,o,i){function a(r){return 0===r.indexOf(".")||0===r.indexOf("^")}function f(r,t){var n=I(r),o=n?r:r.name,i=a(o);if(i){if(!t)throw Error("No reference point given for path '"+o+"'");for(var u=o.split("."),l=0,s=u.length,c=t;s>l;l++)if(""!==u[l]||0!==l){if("^"!==u[l])break;if(!c.parent)throw Error("Path '"+o+"' not valid for state '"+t.name+"'");c=c.parent}else c=t;u=u.slice(l).join("."),o=c.name+(c.name&&u?".":"")+u}var f=x[o];return!f||!n&&(n||f!==r&&f.self!==r)?e:f}function h(r,t){E[r]||(E[r]=[]),E[r].push(t)}function $(t){t=n(t,{self:t,resolve:t.resolve||{},toString:function(){return this.name}});var e=t.name;if(!I(e)||e.indexOf("@")>=0)throw Error("State must have a valid name");if(x.hasOwnProperty(e))throw Error("State '"+e+"'' is already defined");var o=-1!==e.indexOf(".")?e.substring(0,e.lastIndexOf(".")):I(t.parent)?t.parent:"";if(o&&!x[o])return h(o,t.self);for(var i in S)A(S[i])&&(t[i]=S[i](t,S.$delegates[i]));if(x[e]=t,!t[P]&&t.url&&r.when(t.url,["$match","$stateParams",function(r,e){y.$current.navigable==t&&s(r,e)||y.transitionTo(t,r,{location:!1})}]),E[e])for(var a=0;a-1}function v(r){var t=r.split("."),e=y.$current.name.split(".");if("**"===t[0]&&(e=e.slice(e.indexOf(t[1])),e.unshift("**")),"**"===t[t.length-1]&&(e.splice(e.indexOf(t[t.length-2])+1,Number.MAX_VALUE),e.push("**")),t.length!=e.length)return!1;for(var n=0,o=t.length;o>n;n++)"*"===t[n]&&(e[n]="*");return e.join("")===t.join("")}function m(r,t){return I(r)&&!O(t)?S[r]:A(t)&&I(r)?(S[r]&&!S.$delegates[r]&&(S.$delegates[r]=S[r]),S[r]=t,this):this}function d(r,t){return V(r)?t=r:t.name=r,$(t),this}function g(r,o,a,h,$,m,d,g,E){function S(){d.url()!==D&&(d.url(D),d.replace())}function j(r,e,n,i,u){var l=n?e:c(r.params,e),s={$stateParams:l};u.resolve=$.resolve(r.resolve,s,u.resolve,r);var f=[u.resolve.then(function(r){u.globals=r})];return i&&f.push(i),M(r.views,function(e,n){var o=e.resolve&&e.resolve!==r.resolve?e.resolve:{};o.$template=[function(){return a.load(n,{view:e,locals:s,params:l,notify:!1})||""}],f.push($.resolve(o,s,u.resolve,r).then(function(i){if(A(e.controllerProvider)||k(e.controllerProvider)){var a=t.extend({},o,s);i.$$controller=h.invoke(e.controllerProvider,null,a)}else i.$$controller=e.controller;i.$$state=r,i.$$controllerAs=e.controllerAs,u[n]=i}))}),o.all(f).then(function(){return u})}var C=o.reject(Error("transition superseded")),U=o.reject(Error("transition prevented")),F=o.reject(Error("transition aborted")),T=o.reject(Error("transition failed")),D=d.url(),q=E.baseHref();return b.locals={resolve:null,globals:{$stateParams:{}}},y={params:{},current:b.self,$current:b,transition:null},y.reload=function(){y.transitionTo(y.current,m,{reload:!0,inherit:!1,notify:!1})},y.go=function(r,t,e){return this.transitionTo(r,t,R({inherit:!0,relative:y.$current},e))},y.transitionTo=function(t,e,i){e=e||{},i=R({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},i||{});var a,c=y.$current,$=y.params,p=c.path,v=f(t,i.relative);if(!O(v)){var g={to:t,toParams:e,options:i};if(a=r.$broadcast("$stateNotFound",g,c.self,$),a.defaultPrevented)return S(),F;if(a.retry){if(i.$retry)return S(),T;var x=y.transition=o.when(a.retry);return x.then(function(){return x!==y.transition?C:(g.options.$retry=!0,y.transitionTo(g.to,g.toParams,g.options))},function(){return F}),S(),x}if(t=g.to,e=g.toParams,i=g.options,v=f(t,i.relative),!O(v)){if(i.relative)throw Error("Could not resolve '"+t+"' from state '"+i.relative+"'");throw Error("No such state '"+t+"'")}}if(v[P])throw Error("Cannot transition to abstract state '"+t+"'");i.inherit&&(e=u(m,e||{},y.$current,v)),t=v;var E,A,I=t.path,V=b.locals,k=[];for(E=0,A=I[E];A&&A===p[E]&&s(e,$,A.ownParams)&&!i.reload;E++,A=I[E])V=k[E]=A.locals;if(w(t,c,V,i))return t.self.reloadOnSearch!==!1&&S(),y.transition=null,o.when(y.current);if(e=l(t.params,e||{}),i.notify&&(a=r.$broadcast("$stateChangeStart",t.self,e,c.self,$),a.defaultPrevented))return S(),U;for(var M=o.when(V),q=E;q=E;n--)a=p[n],a.self.onExit&&h.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(n=E;n1||t.ctrlKey||t.metaKey||t.shiftKey||a.attr("target")||(n(function(){r.go(s.state,c,v)}),t.preventDefault())})}}}function P(r,t,e){return{restrict:"A",controller:["$scope","$element","$attrs",function(n,o,i){function a(){r.$current.self===l&&u()?o.addClass(f):o.removeClass(f)}function u(){return!c||s(c,t)}var l,c,f;f=e(i.uiSrefActive||"",!1)(n),this.$$setStateInfo=function(t,e){l=r.get(t,x(o)),c=e,a()},n.$on("$stateChangeSuccess",a)}]}}function S(r){return function(t){return r.is(t)}}function j(r){return function(t){return r.includes(t)}}function C(r,t){function o(r){this.locals=r.locals.globals,this.params=this.locals.$stateParams}function i(){this.locals=null,this.params=null}function a(e,a){if(null!=a.redirectTo){var u,s=a.redirectTo;if(I(s))u=s;else{if(!A(s))throw Error("Invalid 'redirectTo' in when()");u=function(r,t){return s(r,t.path(),t.search())}}t.when(e,u)}else r.state(n(a,{parent:null,name:"route:"+encodeURIComponent(e),url:e,onEnter:o,onExit:i}));return l.push(a),this}function u(r,t,n){function o(r){return""!==r.name?r:e}var i={routes:l,params:n,current:e};return t.$on("$stateChangeStart",function(r,e,n,i){t.$broadcast("$routeChangeStart",o(e),o(i))}),t.$on("$stateChangeSuccess",function(r,e,n,a){i.current=o(e),t.$broadcast("$routeChangeSuccess",o(e),o(a)),N(n,i.params)}),t.$on("$stateChangeError",function(r,e,n,i,a,u){t.$broadcast("$routeChangeError",o(e),o(i),u)}),i}var l=[];o.$inject=["$$state"],this.when=a,this.$get=u,u.$inject=["$state","$rootScope","$routeParams"]}var O=t.isDefined,A=t.isFunction,I=t.isString,V=t.isObject,k=t.isArray,M=t.forEach,R=t.extend,N=t.copy;t.module("ui.router.util",["ng"]),t.module("ui.router.router",["ui.router.util"]),t.module("ui.router.state",["ui.router.router","ui.router.util"]),t.module("ui.router",["ui.router.state"]),t.module("ui.router.compat",["ui.router"]),f.$inject=["$q","$injector"],t.module("ui.router.util").service("$resolve",f),h.$inject=["$http","$templateCache","$injector"],t.module("ui.router.util").service("$templateFactory",h),$.prototype.concat=function(r){return new $(this.sourcePath+r+this.sourceSearch)},$.prototype.toString=function(){return this.source},$.prototype.exec=function(r,t){var e=this.regexp.exec(r);if(!e)return null;var n,o=this.params,i=o.length,a=this.segments.length-1,u={};if(a!==e.length-1)throw Error("Unbalanced capture group in route '"+this.source+"'");for(n=0;a>n;n++)u[o[n]]=e[n+1];for(;i>n;n++)u[o[n]]=t[o[n]];return u},$.prototype.parameters=function(){return this.params},$.prototype.format=function(r){var t=this.segments,e=this.params;if(!r)return t.join("");var n,o,i,a=t.length-1,u=e.length,l=t[0];for(n=0;a>n;n++)i=r[e[n]],null!=i&&(l+=encodeURIComponent(i)),l+=t[n+1];for(;u>n;n++)i=r[e[n]],null!=i&&(l+=(o?"&":"?")+e[n]+"="+encodeURIComponent(i),o=!0);return l},t.module("ui.router.util").provider("$urlMatcherFactory",p),v.$inject=["$urlMatcherFactoryProvider"],t.module("ui.router.router").provider("$urlRouter",v),m.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider","$locationProvider"],t.module("ui.router.state").value("$stateParams",{}).provider("$state",m),d.$inject=[],t.module("ui.router.state").provider("$view",d),t.module("ui.router.state").provider("$uiViewScroll",g),w.$inject=["$state","$injector","$uiViewScroll"],b.$inject=["$compile","$controller","$state"],t.module("ui.router.state").directive("uiView",w),t.module("ui.router.state").directive("uiView",b),E.$inject=["$state","$timeout"],P.$inject=["$state","$stateParams","$interpolate"],t.module("ui.router.state").directive("uiSref",E).directive("uiSrefActive",P),S.$inject=["$state"],j.$inject=["$state"],t.module("ui.router.state").filter("isState",S).filter("includedByState",j),C.$inject=["$stateProvider","$urlRouterProvider"],t.module("ui.router.compat").provider("$route",C).directive("ngView",w)}(window,window.angular);