` tag) to a state. If the state has an associated
- * URL, the directive will automatically generate & update the `href` attribute via
- * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
- * the link will trigger a state transition with optional parameters.
- *
- * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
- * handled natively by the browser.
- *
- * You can also use relative state paths within ui-sref, just like the relative
- * paths passed to `$state.go()`. You just need to be aware that the path is relative
- * to the state that the link lives in, in other words the state that loaded the
- * template containing the link.
- *
- * @example
- *
- * Home | About
- *
- *
- *
- *
- * @param {string} ui-sref 'stateName' can be any valid absolute or relative state
- */
$StateRefDirective.$inject = ['$state', '$timeout'];
function $StateRefDirective($state, $timeout) {
return {
@@ -2373,14 +1606,14 @@ function $StateRefDirective($state, $timeout) {
var newHref = $state.href(ref.state, params, { relative: base });
- if (uiSrefActive) {
- uiSrefActive.$$setStateInfo(ref.state, params);
- }
if (!newHref) {
nav = false;
return false;
}
element[0][attr] = newHref;
+ if (uiSrefActive) {
+ uiSrefActive.$$setStateInfo(ref.state, params);
+ }
};
if (ref.paramExpr) {
@@ -2395,10 +1628,13 @@ function $StateRefDirective($state, $timeout) {
element.bind("click", function(e) {
var button = e.which || e.button;
- if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {
+
+ if ((button === 0 || button == 1) && !e.ctrlKey && !e.metaKey && !e.shiftKey) {
// HACK: This is to allow ng-clicks to be processed before the transition is initiated:
$timeout(function() {
- $state.go(ref.state, params, { relative: base });
+ scope.$apply(function() {
+ $state.go(ref.state, params, { relative: base });
+ });
});
e.preventDefault();
}
@@ -2407,38 +1643,11 @@ function $StateRefDirective($state, $timeout) {
};
}
-/**
- * @ngdoc directive
- * @name ui.router.state.directive:ui-sref-active
- *
- * @requires ui.router.state.$state
- * @requires ui.router.state.$stateParams
- * @requires $interpolate
- *
- * @restrict A
- *
- * @description
- * A directive working alongside ui-sref to add classes to an element when the
- * related ui-sref directive's state is active, and removing them when it is inactive.
- * The primary use-case is to simplify the special appearance of navigation menus
- * relying on `ui-sref`, by having the "active" state's menu button appear different,
- * distinguishing it from the inactive menu items.
- *
- * @example
- *
- *
- *
- */
$StateActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];
function $StateActiveDirective($state, $stateParams, $interpolate) {
return {
restrict: "A",
- controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {
+ controller: function($scope, $element, $attrs) {
var state, params, activeClass;
// There probably isn't much point in $observing this
@@ -2465,7 +1674,7 @@ function $StateActiveDirective($state, $stateParams, $interpolate) {
function matchesParams() {
return !params || equalForKeys(params, $stateParams);
}
- }]
+ }
};
}
@@ -2473,60 +1682,6 @@ angular.module('ui.router.state')
.directive('uiSref', $StateRefDirective)
.directive('uiSrefActive', $StateActiveDirective);
-/**
- * @ngdoc filter
- * @name ui.router.state.filter:isState
- *
- * @requires ui.router.state.$state
- *
- * @description
- * Translates to {@link ui.router.state.$state#is $state.is("stateName")}.
- */
-$IsStateFilter.$inject = ['$state'];
-function $IsStateFilter($state) {
- return function(state) {
- return $state.is(state);
- };
-}
-
-/**
- * @ngdoc filter
- * @name ui.router.state.filter:includeByState
- *
- * @requires ui.router.state.$state
- *
- * @description
- * Translates to {@link ui.router.state.$state#includes $state.includes()}.
- */
-$IncludedByStateFilter.$inject = ['$state'];
-function $IncludedByStateFilter($state) {
- return function(state) {
- return $state.includes(state);
- };
-}
-
-angular.module('ui.router.state')
- .filter('isState', $IsStateFilter)
- .filter('includedByState', $IncludedByStateFilter);
-
-/**
- * @ngdoc object
- * @name ui.router.compat.$routeProvider
- *
- * @requires ui.router.state.$stateProvider
- * @requires ui.router.router.$urlRouterProvider
- *
- * @description
- * `$routeProvider` of the `ui.router.compat` module overwrites the existing
- * `routeProvider` from the core. This is done to provide compatibility between
- * the UI Router and the core router.
- *
- * It also provides a `when()` method to register routes that map to certain urls.
- * Behind the scenes it actually delegates either to
- * {@link ui.router.router.$urlRouterProvider $urlRouterProvider} or to the
- * {@link ui.router.state.$stateProvider $stateProvider} to postprocess the given
- * router definition object.
- */
$RouteProvider.$inject = ['$stateProvider', '$urlRouterProvider'];
function $RouteProvider( $stateProvider, $urlRouterProvider) {
@@ -2546,32 +1701,6 @@ function $RouteProvider( $stateProvider, $urlRouterProvider) {
}
this.when = when;
- /**
- * @ngdoc function
- * @name ui.router.compat.$routeProvider#when
- * @methodOf ui.router.compat.$routeProvider
- *
- * @description
- * Registers a route with a given route definition object. The route definition
- * object has the same interface the angular core route definition object has.
- *
- * @example
- *
- * var app = angular.module('app', ['ui.router.compat']);
- *
- * app.config(function ($routeProvider) {
- * $routeProvider.when('home', {
- * controller: function () { ... },
- * templateUrl: 'path/to/template'
- * });
- * });
- *
- *
- * @param {string} url URL as string
- * @param {object} route Route definition object
- *
- * @return {object} $routeProvider - $routeProvider instance
- */
function when(url, route) {
/*jshint validthis: true */
if (route.redirectTo != null) {
@@ -2602,24 +1731,6 @@ function $RouteProvider( $stateProvider, $urlRouterProvider) {
return this;
}
- /**
- * @ngdoc object
- * @name ui.router.compat.$route
- *
- * @requires ui.router.state.$state
- * @requires $rootScope
- * @requires $routeParams
- *
- * @property {object} routes - Array of registered routes.
- * @property {object} params - Current route params as object.
- * @property {string} current - Name of the current route.
- *
- * @description
- * The `$route` service provides interfaces to access defined routes. It also let's
- * you access route params through `$routeParams` service, so you have fully
- * control over all the stuff you would actually get from angular's core `$route`
- * service.
- */
this.$get = $get;
$get.$inject = ['$state', '$rootScope', '$routeParams'];
function $get( $state, $rootScope, $routeParams) {
diff --git a/dist/js/angular-ui/angular-ui-router.min.js b/dist/js/angular-ui/angular-ui-router.min.js
index 2de3701910..fece6d9b91 100755
--- a/dist/js/angular-ui/angular-ui-router.min.js
+++ b/dist/js/angular-ui/angular-ui-router.min.js
@@ -1,46 +1,7 @@
/**
* State-based routing for AngularJS
- * @version v0.2.8, with commit:
- * https://github.com/angular-ui/ui-router/commit/717d3ff7d0ba72d239892dee562b401cdf90e418#diff-544b7ce9751e1a566e17d486dd4ab576
+ * @version v0.2.7
* @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(ha,q,z){function G(a,l){return v(new (v(function(){},{prototype:a})),l)}function Q(a){s(arguments,function(l){l!==a&&s(l,function(d,e){a.hasOwnProperty(e)||(a[e]=d)})});return a}function R(a,l,d,e){var h=[],g;for(g in d.path){if(d.path[g]!==e.path[g])break;h.push(d.path[g])}e={};g=[];for(var m in h)if(h[m].params&&h[m].params.length){d=h[m].params;for(var b in d){var f;a:{f=g;var k=d[b];if(Array.prototype.indexOf)f=f.indexOf(k,Number(void 0)||0);else{var p=f.length>>>0,r=Number(void 0)||
-0,r=0>r?Math.ceil(r):Math.floor(r);for(0>r&&(r+=p);r "));n[t]=d;if(u(c))p.push(t,[function(){return l.get(c)}],g);else{var a=l.annotate(c);s(a,function(c){c!==t&&b.hasOwnProperty(c)&&f(b[c],c)});p.push(t,c,a)}r.pop();n[t]=e}}function k(c){return D(c)&&c.then&&c.$$promises}if(!D(b))throw Error("'invocables' must be an object");var p=[],r=[],n={};s(b,f);b=r=n=null;return function(c,t,b){function e(){--x||(u||
-Q(q,t.$$values),g.$$values=q,g.$$promises=!0,f.resolve(q))}function n(c){g.$$failure=c;f.reject(c)}function d(t,m,k){function f(c){p.reject(c);n(c)}function h(){if(!y(g.$$failure))try{p.resolve(l.invoke(m,b,q)),p.promise.then(function(c){q[t]=c;e()},f)}catch(c){f(c)}}var p=a.defer(),N=0;s(k,function(t){r.hasOwnProperty(t)&&!c.hasOwnProperty(t)&&(N++,r[t].then(function(c){q[t]=c;--N||h()},f))});N||h();r[t]=p.promise}k(c)&&b===z&&(b=t,t=c,c=null);if(!c)c=h;else if(!D(c))throw Error("'locals' must be an object");
-if(!t)t=m;else if(!k(t))throw Error("'parent' must be a promise returned by $resolve.resolve()");var f=a.defer(),g=f.promise,r=g.$$promises={},q=v({},c),x=1+p.length/3,u=!1;if(y(t.$$failure))return n(t.$$failure),g;t.$$values?(u=Q(q,t.$$values),e()):(v(r,t.$$promises),t.then(e,n));for(var A=0,w=p.length;A=E;a--)b=q[a],b.self.onExit&&g.invoke(b.self.onExit,b.self,b.locals.globals),b.locals=null;for(a=E;ae.indexOf("@")&&(e+="@"+a.parent.name);b[e]=d});return b},ownParams:function(a){if(!a.parent)return a.params;var b={};s(a.params,function(a){b[a]=!0});s(a.parent.params,function(d){if(!b[d])throw Error("Missing required parameter '"+d+"' in state '"+a.name+"'");b[d]=!1});var d=[];s(b,function(a,b){a&&d.push(b)});return d},path:function(a){return a.parent?a.parent.path.concat(a):[]},includes:function(a){var b=
-a.parent?v({},a.parent.includes):{};b[a.name]=!0;return b},$delegates:{}};b=g({name:"",url:"^",views:null,"abstract":!0});b.navigable=null;this.decorator=function(a,b){if(u(a)&&!y(b))return n[a];if(!w(b)||!u(a))return this;n[a]&&!n.$delegates[a]&&(n.$delegates[a]=n[a]);n[a]=b;return this};this.state=function(a,b){D(a)?b=a:b.name=a;g(b);return this};this.$get=m;m.$inject="$rootScope $q $view $injector $resolve $stateParams $location $urlRouter".split(" ")}function Y(){function a(a,d){return{load:function(e,
-h){var g;h=v({template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}},h);h.view&&(g=d.fromConfig(h.view,h.params,h.locals));g&&h.notify&&a.$broadcast("$viewContentLoading",h);return g}}}this.$get=a;a.$inject=["$rootScope","$templateFactory"]}function P(a,l,d,e,h,g){function m(a,b,d){var e=function(){return{leave:function(a){a.remove()},enter:function(a,b,c){c.after(a)}}};if(p)return function(a){return a?{enter:function(a,b,c){p.enter(a,null,c)},leave:function(a){p.leave(a,
-function(){a.remove()})}}:e()};if(k){var f=k&&k(d,b);return function(a){return a?{enter:function(a,b,c){f.enter(a,b)},leave:function(a){f.leave(a.contents(),a)}}:e()}}return e}var b=!1,f=function(){return e.has?function(a){return e.has(a)?e.get(a):null}:function(a){try{return e.get(a)}catch(b){return null}}}(),k=f("$animator"),p=f("$animate"),r={restrict:"ECA",compile:function(e,c){var f=e.html(),k=!0,p=q.element(g[0].createComment(" ui-view-anchor ")),s=e.parent();e.prepend(p);return function(g){function u(){x&&
-(G(!0).leave(x),x=null);v&&(v.$destroy(),v=null)}function y(b){var c=a.$current&&a.$current.locals[A];k&&(k=!1,e.replaceWith(p));c?c!==z&&(u(),x=e.clone(),x.html(c.$template?c.$template:f),G(!0).enter(x,s,p),x.data("$uiView",H),z=c,H.state=c.$$state,b=l(x.contents()),v=g.$new(),c.$$controller&&(c.$scope=v,c=d(c.$$controller,c),x.children().data("$ngControllerController",c)),b(v),v.$emit("$viewContentLoaded"),C&&v.$eval(C),q.isDefined(D)&&D&&!g.$eval(D)||h(x)):(u(),x=e.clone(),x.html(f),G(b).enter(x,
-s,p),v=g.$new(),l(x.contents())(v))}var w=s.inheritedData("$uiView"),v,x,z,A=c[r.name]||c.name||"",C=c.onload||"",D=c.autoscroll,G=m(e,c,g);0>A.indexOf("@")&&(A=A+"@"+(w?w.state.name:""));var H={name:A,state:null},w=function(){if(!b){b=!0;try{y(!0)}catch(a){throw b=!1,a;}b=!1}};g.$on("$stateChangeSuccess",w);g.$on("$viewContentLoading",w);y(!1)}}};return r}function ga(a){var l=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/);if(!l||4!==l.length)throw Error("Invalid state ref '"+a+"'");return{state:l[1],
-paramExpr:l[3]||null}}function Z(a){if((a=a.parent().inheritedData("$uiView"))&&a.state&&a.state.name)return a.state}function $(a,l){return{restrict:"A",require:"?^uiSrefActive",link:function(d,e,h,g){var m=ga(h.uiSref),b=null,f=Z(e)||a.$current,k=(h="FORM"===e[0].nodeName)?"action":"href",p=!0,r=function(d){d&&(b=d);if(p){d=a.href(m.state,b,{relative:f});g&&g.$$setStateInfo(m.state,b);if(!d)return p=!1;e[0][k]=d}};m.paramExpr&&(d.$watch(m.paramExpr,function(a,c){a!==b&&r(a)},!0),b=d.$eval(m.paramExpr));
-r();h||e.bind("click",function(d){1<(d.which||d.button)||d.ctrlKey||d.metaKey||d.shiftKey||e.attr("target")||(l(function(){a.go(m.state,b,{relative:f})}),d.preventDefault())})}}}function aa(a,l,d){return{restrict:"A",controller:["$scope","$element","$attrs",function(e,h,g){function m(){a.$current.self!==b||f&&!H(f,l)?h.removeClass(k):h.addClass(k)}var b,f,k;k=d(g.uiSrefActive||"",!1)(e);this.$$setStateInfo=function(d,e){b=a.get(d,Z(h));f=e;m()};e.$on("$stateChangeSuccess",m)}]}}function ba(a){return function(l){return a.is(l)}}
-function ca(a){return function(l){return a.includes(l)}}function da(a,l){function d(a){this.locals=a.locals.globals;this.params=this.locals.$stateParams}function e(){this.params=this.locals=null}function h(a,b,d){function e(a){return""!==a.name?a:z}var h={routes:g,params:d,current:z};b.$on("$stateChangeStart",function(a,d,c,f,g){b.$broadcast("$routeChangeStart",e(d),e(f))});b.$on("$stateChangeSuccess",function(a,d,c,f,g){h.current=e(d);b.$broadcast("$routeChangeSuccess",e(d),e(f));X(c,h.params)});
-b.$on("$stateChangeError",function(a,d,c,f,g,h){b.$broadcast("$routeChangeError",e(d),e(f),h)});return h}var g=[];d.$inject=["$$state"];this.when=function(h,b){if(null!=b.redirectTo){var f=b.redirectTo,k;if(u(f))k=f;else if(w(f))k=function(a,b){return f(a,b.path(),b.search())};else throw Error("Invalid 'redirectTo' in when()");l.when(h,k)}else a.state(G(b,{parent:null,name:"route:"+encodeURIComponent(h),url:h,onEnter:d,onExit:e}));g.push(b);return this};this.$get=h;h.$inject=["$state","$rootScope",
-"$routeParams"]}var y=q.isDefined,w=q.isFunction,u=q.isString,D=q.isObject,O=q.isArray,s=q.forEach,v=q.extend,X=q.copy;q.module("ui.router.util",["ng"]);q.module("ui.router.router",["ui.router.util"]);q.module("ui.router.state",["ui.router.router","ui.router.util"]);q.module("ui.router",["ui.router.state"]);q.module("ui.router.compat",["ui.router"]);T.$inject=["$q","$injector"];q.module("ui.router.util").service("$resolve",T);U.$inject=["$http","$templateCache","$injector"];q.module("ui.router.util").service("$templateFactory",
-U);C.prototype.concat=function(a){return new C(this.sourcePath+a+this.sourceSearch)};C.prototype.toString=function(){return this.source};C.prototype.exec=function(a,l){var d=this.regexp.exec(a);if(!d)return null;var e=this.params,h=e.length,g=this.segments.length-1,m={},b;if(g!==d.length-1)throw Error("Unbalanced capture group in route '"+this.source+"'");for(b=0;b>>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 E({},i,b)}function i(a,b){var c={};return D(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,A(a))m.push(c,[function(){return b.get(a)}],h);else{var e=b.annotate(a);D(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 B(a)&&a.then&&a.$$promises}if(!B(g))throw new Error("'invocables' must be an object");var m=[],n=[],o={};return D(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(!y(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;D(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(!B(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=E({},d),s=1+m.length/3,t=!1;if(y(f.$$failure))return k(f.$$failure),p;f.$$values?(t=e(r,f.$$values),h()):(E(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 y(a.template)?this.fromString(a.template,b):y(a.templateUrl)?this.fromUrl(a.templateUrl,b):y(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return z(a)?a(b):a},this.fromUrl=function(c,d){return z(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),D(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 B(a)&&z(a.exec)&&z(a.format)&&z(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 y(d)?d:!0}var e=[],f=null;this.rule=function(a){if(!z(a))throw new Error("'rule' must be a function");return e.push(a),this},this.otherwise=function(a){if(A(a)){var b=a;a=function(){return b}}else if(!z(a))throw new Error("'rule' must be a function");return f=a,this},this.when=function(e,f){var g,h=A(f);if(A(e)&&(e=a.compile(e)),!h&&!z(f)&&!C(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)}]),E(function(a,e){return d(a,c,b.exec(e.path(),e.search()))},{prefix:A(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)}]),E(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?(A(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=A(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=u[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function m(a,b){v[a]||(v[a]=[]),v[a].push(b)}function n(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!A(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(u.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):A(b.parent)?b.parent:"";if(e&&!u[e])return m(e,b.self);for(var f in x)z(x[f])&&(b[f]=x[f](b,x.$delegates[f]));if(u[c]=b,!b[w]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){t.$current.navigable==b&&j(a,c)||t.transitionTo(b,a,{location:!1})}]),v[c])for(var g=0;g=I;d--)g=u[d],g.self.onExit&&m.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=I;d").html(a).contents();return r.enter(d,c),d}},"false":{remove:function(a){a.html("")},restore:function(a,b){b.append(a)},populate:function(a,b){return b.html(a),b.contents()}}}[a.toString()]};j.append(s);var u=j.parent().inheritedData("$uiView");p.indexOf("@")<0&&(p=p+"@"+(u?u.state.name:""));var v={name:p,state:null};j.data("$uiView",v);var w=function(){if(!h){h=!0;try{m(!0)}catch(a){throw h=!1,a}h=!1}};e.$on("$stateChangeSuccess",w),e.$on("$viewContentLoading",w),m(!1)}}};return i}function t(a){var b=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/);if(!b||4!==b.length)throw new Error("Invalid state ref '"+a+"'");return{state:b[1],paramExpr:b[3]||null}}function u(a){var b=a.parent().inheritedData("$uiView");return b&&b.state&&b.state.name?b.state:void 0}function v(a,b){return{restrict:"A",require:"?^uiSrefActive",link:function(c,d,e,f){var g=t(e.uiSref),h=null,i=u(d)||a.$current,j="FORM"===d[0].nodeName,k=j?"action":"href",l=!0,m=function(b){if(b&&(h=b),l){var c=a.href(g.state,h,{relative:i});if(!c)return l=!1,!1;d[0][k]=c,f&&f.$$setStateInfo(g.state,h)}};g.paramExpr&&(c.$watch(g.paramExpr,function(a){a!==h&&m(a)},!0),h=c.$eval(g.paramExpr)),m(),j||d.bind("click",function(d){var e=d.which||d.button;0!==e&&1!=e||d.ctrlKey||d.metaKey||d.shiftKey||(b(function(){c.$apply(function(){a.go(g.state,h,{relative:i})})}),d.preventDefault())})}}}function w(a,b,c){return{restrict:"A",controller: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,u(e)),k=c,g()},d.$on("$stateChangeSuccess",g)}}}function x(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(A(j))h=j;else{if(!z(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)),F(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 y=b.isDefined,z=b.isFunction,A=b.isString,B=b.isObject,C=b.isArray,D=b.forEach,E=b.extend,F=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),s.$inject=["$state","$compile","$controller","$injector","$anchorScroll"],b.module("ui.router.state").directive("uiView",s),v.$inject=["$state","$timeout"],w.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",v).directive("uiSrefActive",w),x.$inject=["$stateProvider","$urlRouterProvider"],b.module("ui.router.compat").provider("$route",x).directive("ngView",s)}(window,window.angular);
\ No newline at end of file