/** * State-based routing for AngularJS * @version v0.4.3 * @link http://angular-ui.github.com/ * @license MIT License, http://www.opensource.org/licenses/MIT */"undefined"!=typeofmodule&&"undefined"!=typeofexports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";functiond(a,b){returnT(new(T(function(){},{prototype:a})),b)}functione(a){returnS(arguments,function(b){b!==a&&S(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}functionf(a,b){varc=[];for(vardina.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}returnc}functiong(a){if(Object.keys)returnObject.keys(a);varb=[];returnS(a,function(a,c){b.push(c)}),b}functionh(a,b){if(Array.prototype.indexOf)returna.indexOf(b,Number(arguments[2])||0);varc=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d<c;d++)if(dina&&a[d]===b)returnd;return-1}functioni(a,b,c,d){vare,i=f(c,d),j={},k=[];for(varlini)if(i[l]&&i[l].params&&(e=g(i[l].params),e.length))for(varmine)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);returnT({},j,b)}functionj(a,b,c){if(!c){c=[];for(vardina)c.push(d)}for(vare=0;e<c.length;e++){varf=c[e];if(a[f]!=b[f])return!1}return!0}functionk(a,b){varc={};returnS(a,function(a){c[a]=b[a]}),c}functionl(a){varb={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));returnS(c,function(c){cina&&(b[c]=a[c])}),b}functionm(a){varb={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(vardina)-1==h(c,d)&&(b[d]=a[d]);returnb}functionn(a,b){varc=R(a),d=c?[]:{};returnS(a,function(a,e){b(a,e)&&(d[c?d.length:e]=a)}),d}functiono(a,b){varc=R(a)?[]:{};returnS(a,function(a,d){c[d]=b(a,d)}),c}functionp(a){returna.then(c,function(){})&&a}functionq(a,b){vard=1,f=2,i={},j=[],k=i,l=T(a.when(i),{$$promises:i,$$values:i});this.study=function(i){functionn(a,c){if(t[c]!==f){if(s.push(c),t[c]===d)throws.splice(0,h(s,c)),newError("Cyclic dependency: "+s.join(" -> "));if(t[c]=d,P(a))r.push(c,[function(){returnb.get(a)}],j);else{vare=b.annotate(a);S(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),r.push(c,a,e)}s.pop(),t[c]=f}}functiono(a){returnQ(a)&&a.then&&a.$$promises}if(!Q(i))thrownewError("'invocables' must be an object");varq=g(i||{}),r=[],s=[],t={};returnS(i,n),i=s=t=null,function(d,f,g){functionh(){--v||(w||e(u,f.$$values),s.$$values=u,s.$$promises=s.$$promises||!0,deletes.$$inheritedValues,n.resolve(u))}functioni(a){s.$$failure=a,n.reject(a)}functionj(c,e,f){functionj(a){l.reject(a),i(a)}functionk(){if(!N(s.$$failure))try{l.resolve(b.invoke(e,g,u)),l.promise.then(function(a){u[c]=a,h()},j)}catch(a){j(a)}}varl=a.defer(),m=0;S(f,function(a){t.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,t[a].then(function(b){u[a]=b,--m||k()},j))}),m||k(),t[c]=p(l.promise)}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!Q(d))thrownewError("'locals' must be an object")}elsed=k;if(f){if(!o(f))thrownewError("'parent' must be a promise returned by $resolve.resolve()")}elsef=l;varn=a.defer(),s=p(n.promise),t=s.$$promises={},u=T({},d),v=1+r.length/3,w=!1;if(p(s),N(f.$$failure))returni(f.$$failure),s;f.$$inheritedValues&&e(u,m(f.$$inheritedValues,q)),T(t,f.$$promises),f.$$values?(w=e(u,m(f.$$values,q)),s.$$inheritedValues=m(f.$$values,q),h()):(f.$$inheritedValues&&(s.$$inheritedValues=m(f.$$inheritedValues,q)),f.then(h,i));for(varx=0,y=r.length;x<y;x+=3)d.hasOwnProperty(r[x])?h():j(r[x],r[x+1],r[x+2]);returns}},this.resolve=function(a,b,c,d){returnthis.study(a)(b,c,d)}}functionr(){vara=b.version.minor<3;this.shouldUnsafelyUseHttp=function(b){a=!!b},this.$get=["$http","$templateCache","$injector",function(b,c,d){returnnews(b,c,d,a)}]}functions(a,b,c,d){this.fromConfig=function(a,b,c){returnN(a.template)?this.fromString(a.template,b):N(a.templateUrl)?this.fromUrl(a.templateUrl,b):N(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){returnO(a)?a(b):a},this.fromUrl=function(e,f){returnO(e)&&(e=e(f)),null==e?null:d?a.get(e,{cache:b,headers:{Accept:"text/html"}}).then(function(a){returna.data}):c.get("$templateRequest")(e)},this.fromProvider=function(a,b,d){returnc.invoke(a,null,d||{params:b})}}functiont(a,b,e){functionf(b,c,d,e){if(q.push(b),o[b])returno[b];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(b))thrownewError("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])thrownewError("Duplicate parameter name '"+b+"' in pattern '"+a+"'");returnp[b]=newW.Param(b,c,d,e),p[b]}functiong(a,b,c,d){vare=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)returnf;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:f=f.replace(/\/$/,""),e=["(?:/(",")|/)?"];break;default:e=["("+c+"|",")?"]}returnf+e[0]+b+e[1]}functionh(e,f){varg,h,i,j,k;returng=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),h&&(j=W.type(h)||d(W.type("string"),{pattern:newRegExp(h,b.caseInsensitive?"i":c)})),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=T({params:{}},Q(b)?b:{});vari,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():newW.ParamSet,q=[];this.source=a;for(varr,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);varu=t.indexOf("?");if(u>=0){varv=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}elsethis.sourcePath=a,this.sourceSearch="";l+=g(t)+(!1===b.strict?"/?":"")+"$",n.push(t),this.regexp=newRegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}functionu(a){T(this,a)}functionv(){functiona(a){returnnull!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}functione(a){returnnull!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}functionf(){return{strict:p,caseInsensitive:m}}functioni(a){returnO(a)||R(a)&&O(a[a.length-1])}functionj(){for(;w.length;){vara=w.shift();if(a.pattern)thrownewError("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}functionk(a){T(this,a||{})}W=this;varl,m=!1,p=!0,q=!1,r={},s=!0,w=[],x={string:{encode:a,decode:e,is:function(a){returnnull==a||!N(a)||"string"==typeofa},pattern:/[^\/]*/},int:{encode:a,decode:function(a){returnparseInt(a,10)},is:function(a){returna!==c&&null!==a&&this.decode(a.toString())===a},pattern:/-?\d+/},bool:{encode:function(a){returna?1:0},decode:function(a){return0!==parseInt(a,10)},is:function(a){return!0===a||!1===a},pattern:/0|1/},date:{encode:function(a){returnthis.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))returna;varb=this.capture.exec(a);returnb?newDate(b[1],b[2]-1,b[3]):c},is:function(a){returnainstanceofDate&&!isNaN(a.valueOf())},equals:function(a,b){returnthis.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};v.$$getDefaultValue=function(a){if(!i(a.value))returna.value;if(!l)thrownewError("Injectable functions cannot be called at configuration time");returnl.invoke(a.value)},this.caseInsensitive=function(a){returnN(a)&&(m=a),m},this.strictMode=function(a){returnN(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!N(a))returnq;if(!0!==a&&!1!==a&&!P(a))thrownewError("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");returnq=a,a},this.compile=function(a,b){returnnewt(a,T(f(),b))},this.isMatcher=function(a){if(!Q(a))return!1;varb=!0;returnS(t.prototype,function(c,d){O(c)&&(b=b&&N(a[d])&&O(a[d]))}),b},this.type=function(a,b,c){if(!N(b))returnr[a];if(r.hasOwnProperty(a))thrownewError("A type named '"+a+"' has already been defined.");returnr[a]=newu(T({name:a},b)),c&&(w.push({name:a,def:c}),s||j()),this},S(x,function(a,b){r[b]=newu(T({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){returnl=a,s=!1,j(),S(x,function(a,b){r[b]||(r[b]=newu(a))}),this}],this.Param=function(a,d,e,f){functionj(a){varb=Q(a)?g(a):[];return-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array")&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){returna.value},a}functionk(c,d,e){if(c.type&&d)thrownewError("Param '"+a+"' has two type configurations.");returnd||(c.type?b.isString(c.type)?r[c.type]:c.typeinstanceofu?c.type:newu(c.type):"config"===e?r.any:r.string)}functionm(){varb={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};returnT(b,c,e).array}functionp(a,b){varc=a.squash;if(!b||!1===c)return!1;if(!N(c)||null==c)returnq;if(!0===c||P(c))returnc;thrownewError("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}functions(a,b,d,e){varf,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];returnf=R(a.replace)?a.replace:[],P(e)&&f.push({from:e,to:c}),g=o(f,function(a){returna.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}functiont(){if(!l)thrownewError("Injectable functions cannot be called at configuration time");vara=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))thrownewError("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");returna}functionv(a){functionb(a){returnfunction(b){returnb.from===a}}functionc(a){varc=o(n(x.replace,b(a)),function(a){returna.to});returnc.length?c[0]:a}returna=c(a),N(a)?x.type.$normalize(a):t()}functionw(){return"{Param:"+a+""+d+" squash: '"+A+"' optional: "+z+"}"}varx=this;e=j(e),d=k(e,d,f);vary=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");varz=e.value!==c,A=p(e,z),B=s(e,y,z,A);T(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){returnd(this,T(newk,{$$parent:this}))},$$keys:function(){for(vara=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;returnb.reverse(),S(b,function(b){S(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){varb={},c=this;returnS(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){varc=!0,d=this;returnS(d.$$keys(),function(e){varf=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){vard,e,f,g,h,i=this.$$keys();for(d=0;d<i.length&&(e=this[i[d]],(f=a[i[d]])!==c&&null!==f||!e.isOptional);d++){if(g=e.type.$normalize(f),!e.type.is(g))return!1;if(h=e.type.encode(g),b.isString(h)&&!e.type.pattern.exec(h))return!1}return!0},$$parent:c},this.ParamSet=k}functionw(a,d){functione(a){varb=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);returnnull!=b?b[1].replace(/\\(.)/g,"$1"):""}functionf(a,b){returna.replace(/\$(\$|\d{1,2})/,function(a,c){returnb["$"===c?0:Number(c)]})}functiong(a,b,c){if(!c)return!1;vard=a.invoke(b,b,{$match:c});return!N(d)||d}functionh(d,e,f,g,h){functionm(a,b,c){return"/"===q?a:b?q.slice(0,-1)+a:c?q.slice(1)+a:a}functionn(a){functionb(a){varb=a(f,d);return!!b&&(P(b)&&d.replace().url(b),!0)}if(!a||!a.defaultPrevented){p&&d.url();p=c;vare,g=j.length;for(e=0;e<g;e++)if(b(j[e]))return;k&&b(k)}}functiono(){returni=i||e.$on("$locationChangeSuccess",n)}varp,q=g.baseHref(),r=d.url();returnl||o(),{sync:function(){n()},listen:function(){returno()},update:function(a){if(a)returnvoid(r=d.url());d.url()!==r&&(d.url(r),d.replace())},push:function(a,b,e){varf=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),p=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))returnnull;varg=a.html5Mode();b.isObject(g)&&(g=g.enabled),g=g&&h.history;vari=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=m(i,g,f.absolute),!f.absolute||!i)returni;varj=!g&&i?"/":"",k=d.port();returnk=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}vari,j=[],k=null,l=!1;this.rule=function(a){if(!O(a))thrownewError("'rule' must be a function");returnj.push(a),this},this.otherwise=function(a){if(P(a)){varb=a;a=function(){returnb}}elseif(!O(a))thrownewError("'rule' must be a function");returnk=a,this},this.when=function(a,b){varc,h=P(b);if(P(a)&&(a=d.compile(a)),!h&&!O(b)&&!R(b))thrownewError("invalid 'handler' in when()");vari={matcher:function(a,b){returnh&&(c=d.compile(b),b=["$match",function(a){returnc.format(a)}]),T(function(c,d){returng(c,b,a.exec(d.path(),d.search()))},{prefix:P(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)thrownewError("when() RegExp must not be global or sticky");returnh&&(c=b,b=["$match",function(a){returnf(c,a)}]),T(function(c,d){returng(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:ainstanceofRegExp};for(varkinj)if(j[k])returnthis.rule(i[k](a,b));thrownewError("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}functionx(a,e){functionf(a){return0===a.indexOf(".")||0===a.indexOf("^")}functionm(a,b){if(!a)returnc;vard=P(a),e=d?a:a.name;if(f(e)){if(!b)thrownewError("No reference point given for path '"+e+"'");b=m(b);for(varg=e.split("."),h=0,i=g.length,j=b;h<i;h++)if(""!==g[h]||0!==h){if("^"!==g[h])break;if(!j.parent)thrownewError("Path '"+e+"' not valid for state '"+b.name+"'");j=j.parent}elsej=b;g=g.slice(h).join("."),e=j.name+(j.name&&g?".":"")+g}vark=A[e];return!k||!d&&(d||k!==a&&k.self!==a)?c:k}functionn(a,b){B[a]||(B[a]=[]),B[a].push(b)}functionq(a){for(varb=B[a]||[];b.length;)r(b.shift())}functionr(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){returnthis.name}});varc=b.name;if(!P(c)||c.indexOf("@")>=0)thrownewError("State must have a valid name");if(A.hasOwnProperty(c))thrownewError("State '"+c+"' is already defined");vare=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):P(b.parent)?b.parent:Q(b.parent)&&P(b.parent.name)?b.parent.name:"";if(e&&!A[e])returnn(e,b.self);for(varfinD)O(D[f])&&(b[f]=D[f](b,D.$delegates[f]));returnA[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}functions(a){returna.indexOf("*")>-1}functiont(a){for(varb=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d<e;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length==c.length&&c.join("")===b.join("")}functionu(a,b){returnP(a)&&!N(b)?D[a]:O(b)&&P(a)?(D[a]&&!D.$delegates[a]&&(D.$delegates[a]=D[a]),D[a]=b,this):this}functionv(a,b){returnQ(a)?b=a:b.name=a,r(b),this}functionw(a,e,f,h,j,l,n,q,r){functionu(b,c,d,f){varg=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)returnn.update(),E;if(!g.retry)returnnull;if(f.$retry)returnn.update(),F;varh=z.transition=e.when(g.retry);returnh.then(function(){returnh!==z.transition?(a.$broadcast("$stateChangeCancel",b.to,b.toParams,c,d),B):(b.options.$retry=!0,z.transitionTo(b.to,b.toParams,b.options))},function(){returnE}),n.update(),h}functionv(a,c,d,g,i,l){functionm(){varc=[];returnS(a.views,function(d,e){varg=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){returnf.load(e,{view:d,locals:i.globals,params:n,notify:l.notify})||""}],c.push(j.resolve(g,i.globals,i.resolve,a).then(function(c){if(O(d.controllerProvider)||R(d.controllerProvider)){varf=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}elsec.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,c.$$resolveAs=d.resolveAs,i[e]=c}))}),e.all(c).then(function(){returni.globals})}varn=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=j.resolve(a.resolve,o,i.resolve,a);varp=[i.resolve.then(function(a){i.globals=a})];returng&&p.push(g),e.all(p).then(m).then(function(a){returni})}varw=newError("transition superseded"),B=p(e.reject(w)),D=p(e.reject(newError("transition prevented"))),E=p(e.reject(newError("transition aborted"))),F=p(e.reject(newError("transition failed")));returny.locals={resolve:null,globals:{$stateParams:{}}},z={params:{},current:y.self,$current:y,transition:null},z.reload=function(a){returnz.transitionTo(z.current,l,{reload:a||!0,inherit:!1,notify:!0})},z.go=function(a,b,c){returnz.transitionTo(a,b,T({inherit:!0,relative:z.$current},c))},z.transitionTo=function(b,c,f){c=c||{},f=T({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});varg,j=z.$current,o=z.params,q=j.path,r=m(b,f.relative),s=c["#"];if(!N(r)){vart={to:b,toParams:c,options:f},A=u(t,j.self,o,f);if(A)returnA;if(b=t.to,c=t.toParams,f=t.options,r=m(b,f.relative),!N(r)){if(!f.relative)thrownewError("No such state '"+b+"'");thrownewError("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(r[C])thrownewError("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(l,c||{},z.$current,r)),!r.params.$$validates(c))returnF;c=r.params.$$values(c),b=r;varE=b.path,G=0,H=E[G],I=y.locals,J=[];if(f.reload){if(P(f.reload)||Q(f.reload)){if(Q(f.reload)&&!f.reload.name)thrownewError("Invalid reload state object");varK=!0===f.reload?q[0]:m(f.reload);if(f.reload&&!K)thrownewError("No such reload state '"+(P(f.reload)?f.reload:f.reload.name)+"'");for(;H&&H===q[G]&&H!==K;)I=J[G]=H.locals,G++,H=E[G]}}elsefor(;H&&H===q[G]&&H.ownParams.$$equals(c,o);)I=J[G]=H.locals,G++,H=E[G];if(x(b,c,j,o,I,f))returns&&(c["#"]=s),z.params=c,U(z.params,l),U(k(b.params.$$keys(),l),b.locals.globals.$stateParams),f.location&&b.navigable&&b.navigable.url&&(n.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),n.update(!0)),z.transition=null,e.when(z.current);if(c=k(b.params.$$keys(),c||{}),s&&(c["#"]=s),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,o,f).defaultPrevented)returna.$broadcast("$stateChangeCancel",b.self,c,j.self,o),null==z.transition&&n.update(),D;for(varL=e.when(I),M=G;M<E.length;M++,H=E[M])I=J[M]=d(I),L=v(H,c,H===b,L,I,f);varO=z.transition=L.then(function(){vard,e,g;if(z.transition!==O)returna.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B;for(d=q.length-1;d>=G;d--)g=q[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=G;d<E.length;d++)e=E[d],e.locals=J[d],e.self.onEnter&&h.invoke(e.self.onEnter,e.self,e.locals.globals);returnz.transition!==O?(a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B):(z.$current=b,z.current=b.self,z.params=c,U(z.params,l),z.transition=null,f.location&&b.navigable&&n.push(b.navigable.url,b.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===f.location}),f.notify&&a.$broadcast("$stateChangeSuccess",b.self,c,j.self,o),n.update(!0),z.current)}).then(null,function(d){returnd===w?B:z.transition!==O?(a.$broadcast("$stateChangeCancel",b.self,c,j.self,o),B):(z.transition=null,g=a.$broadcast("$stateChangeError",b.self,c,j.self,o,d),g.defaultPrevented||n.update(),e.reject(d))});returnp(O),O},z.is=function(a,b,d){d=T({relative:z.$current},d||{});vare=m(a,d.relative);returnN(e)?z.$current===e&&(!b||g(b).reduce(function(a,c){vard=e.params[c];returna&&(!d||d.type.equals(l[c],b[c]))},!0)):c},z.includes=function(a,b,d){if(d=T({relative:z.$current},d||{}),P(a)&&s(a)){if(!t(a))return!1;a=z.$current.name}vare=m(a,d.relative);if(!N(e))returnc;if(!N(z.$current.includes[e.name]))return!1;if(!b)return!0;for(varf=g(b),h=0;h<f.length;h++){vari=f[h],j=e.params[i];if(j&&!j.type.equals(l[i],b[i]))return!1}returng(b).reduce(function(a,c){vard=e.params[c];returna&&!d||d.type.equals(l[c],b[c])},!0)},z.href=function(a,b,d){d=T({lossy:!0,inherit:!0,absolute:!1,relative:z.$current},d||{});vare=m(a,d.relative);if(!N(e))returnnull;d.inherit&&(b=i(l,b||{},z.$current,e));varf=e&&d.lossy?e.navigable:e;returnf&&f.url!==c&&null!==f.url?n.href(f.url,k(e.params.$$keys().concat("#"),b||{}),{absolute:d.absolute}):null},z.get=function(a,b){if(0===arguments.length)returno(g(A),function(a){returnA[a].self});varc=m(a,b||z.$current);returnc&&c.self?c.self:null},z}functionx(a,b,c,d,e,f){functiong(a,b,c){functiond(b){return"search"!=a.params[b].location}vare=a.params.$$keys().filter(d),f=l.apply({},[a.params].concat(e));returnnewW.ParamSet(f).$$equals(b,c)}if(!f.reload&&a===c&&(e===c.locals||!1===a.self.reloadOnSearch&&g(c,d,b)))return!0}vary,z,A={},B={},C="abstract",D={parent:function(a){if(N(a.parent)&&a.parent)returnm(a.parent);varb=/^(.+)\.[^.]+$/.exec(a.name);returnb?m(b[1]):y},data:function(a){returna.parent&&a.parent.data&&(a.data=a.self.data=d(a.parent.data,a.data)),a.data},url:function(a){varb=a.url,c={params:a.params||{}};if(P(b))return"^"==b.charAt(0)?e.compile(b.substring(1),c):(a.parent.navigable||y).url.concat(b,c);if(!b||e.isMatcher(b))returnb;thrownewError("Invalid url '"+b+"' in state '"+a+"'")},navigable:function(a){returna.url?a:a.parent?a.parent.navigable:null},ownParams:function(a){varb=a.url&&a.url.params||newW.ParamSet;returnS(a.params||{},function(a,c){b[c]||(b[c]=newW.Param(c,null,a,"config"))}),b},params:function(a){varb=l(a.ownParams,a.ownParams.$$keys());returna.parent&&a.parent.params?T(a.parent.params.$$new(),b):newW.ParamSet},views:function(a){varb={};returnS(N(a.views)?a.views:{"":a},function(c,d){d.indexOf("@")<0&&(d+="@"+a.parent.name),c.resolveAs=c.resolveAs||a.resolveAs||"$resolve",b[d]=c}),b},path:function(a){returna.parent?a.parent.path.concat(a):[]},includes:function(a){varb=a.parent?T({},a.parent.includes):{};returnb[a.name]=!0,b},$delegates:{}};y=r({name:"",url:"^",views:null,abstract:!0}),y.navigable=null,this.decorator=u,this.state=v,this.$get=w,w.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}functiony(){functiona(a,b){return{load:function(a,c){vard;returnc=T({template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}},c),c.view&&(d=b.fromConfig(c.view,c.params,c.locals)),d}}}this.$get=a,a.$inject=["$rootScope","$templateFactory"]}functionz(){vara=!1;this.useAnchorScroll=function(){a=!0},this.$get=["$anchorScroll","$timeout",function(b,c){returna?b:function(a){returnc(function(){a[0].scrollIntoView()},0,!1)}}]}functionA(a,c,d,e,f){functiong(){returnc.has?function(a){returnc.has(a)?c.get(a):null}:function(a){try{returnc.get(a)}catch(a){returnnull}}}functionh(a,c){vard=function(){return{enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}}};if(k)return{enter:function(a,c,d){b.version.minor>2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){vare=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}returnd()}vari=g(),j=i("$animator"),k=i("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){returnfunction(c,g,j){functionk(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){vara=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}functionl(h){varl,m=C(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);varu=i(l,function(a){vare=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}varm,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}}}functionB(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){varg=f.html();returnf.empty?f.empty():f[0].innerHTML=null,function(f,h,i){varj=d.$current,k=C(f,i,h,e),l=j&&j.locals[k];if(!l)returnh.html(g),voida(h.contents())(f);h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);varm=b.extend({},l);f[l.$$resolveAs]=m;varn=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;varo=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),O(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}functionC(a,b,c,d){vare=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");returne.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}functionD(a,b){varc,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),!(c=a.replace(/\n/g,"").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==c.length)thrownewError("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}functionE(a){varb=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)returnb.state}functionF(a){varb="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}functionG(a,b,c,d,e){returnfunction(f){varg=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){vari=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();varj=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}functionH(a,b){return{relative:E(a)||b.$current,inherit:!0}}functionI(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){varh,i=D(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=F(e),l=g[1]||g[0],m=null;j.options=T(H(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});varn=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=G(e,a,c,k,function(){returnj}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}functionJ(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){functiong(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}varh,i=F(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){returna||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=G(d,a,b,i,function(){returnm}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}functionK(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){functiong(b,c,e){varf=a.get(b,E(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};returnp.push(i),q[g]=e,function(){vara=p.indexOf(i);-1!==a&&p.splice(a,1)}}functionh(a,c){if(!P(a))thrownewError("state should be a string");returnQ(c)?a+V(c):(c=b.$eval(c),Q(c)?a+V(c):a)}functioni(){for(vara=0;a<p.length;a++)l(p[a].state,p[a].params)?j(d,q[p[a].hash]):k(d,q[p[a].hash]),m(p[a].state,p[a].params)?j(d,n):k(d,n)}functionj(a,b){f(function(){a.addClass(b)})}functionk(a,b){a.removeClass(b)}functionl(b,c){returna.includes(b.name,c)}functionm(b,c){returna.is(b.name,c)}varn,o,p=[],q={};n=c(e.uiSrefActiveEq||"",!1)(b);try{o=b.$eval(e.uiSrefActive)}catch(a){}o=o||c(e.uiSrefActive||"",!1)(b),Q(o)&&S(o,function(c,d){if(P(c)){vare=D(c,a.current.name);g(e.state,b.$eval(e.paramExpr),d)}}),this.$$addStateInfo=function(a,b){if(!(Q(o)&&p.length>0)){varc=g(a,b,o);returni(),c}},b.$on("$stateChangeSuccess",i),i()}]}}functionL(a){varb=function(b,c){returna.is(b,c)};returnb.$stateful=!0,b}functionM(a){varb=function(b,c,d){returna.includes(b,c,d)};returnb.$stateful=!0,b}varN=b.isDefined,O=b.isFunction,P=b.isString,Q=b.isObject,R=b.isArray,S=b.forEach,T=b.extend,U=b.copy,V=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),b.module("ui.router.util").provider("$templateFactory",r);varW;t.prototype.concat=function(a,b){varc={caseInsensitive:W.caseInsensitive(),strict:W.strictMode(),squash:W.defaultSquashPolicy()};returnnewt(this.sourcePath+a+this.sourceSearch,T(c,b),this)},t.prototype.toString=function(){returnthis.source},t.prototype.exec=function(a,b){functionc(a){functionb(a){returna.split("").reverse().join("")}functionc(a){returna.replace(/\\-/g,"-")}returno(o(b(a).split(/-(?!\\)/),b),c).reverse()}vard=this.regexp.exec(a);if(!d)returnnull;b=b||{};vare,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)thrownewError("Unbalanced capture group in route '"+this.source+"'");varl,m;for(e=0;e<j;e++){for(g=h[e],l=this.params[g],m=d[e+1],f=0;f<l.replace.length;f++)l.replace[f].from===m&&(m=l.replace[f].to);m&&!0===l.array&&(m=c(m)),N(m)&&(m=l.type.decode(m)),k[g]=l.value(m)}for(;e<i;e++){for(g=h[e],k[g]=this.params[g].value(b[g]),l=this.params[g],m=b[g],f=0;f<l.replace.length;f++)l.replace[f].from===m&&(m=l.replace[f].to);N(m)&&(m=l.type.decode(m)),k[g]=l.value(m)}returnk},t.prototype.parameters=function(a){returnN(a)?this.params[a]||null:this.$$paramNames},t.prototype.validates=function(a){returnthis.params.$$validates(a)},t.prototype.format=function(a){functionb(a){returnencodeURIComponent(a).replace(/-/g,function(a){return"%5C%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a||{};varc=this.segments,d=this.parameters(),e=this.params;if(!this.validates(a))returnnull;varf,g=!1,h=c.length-1,i=d.length,j=c[0];for(f=0;f<i;f++){vark=f<h,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=!!p&&m.squash,r=m.type.encode(n);if(k){vars=c[f+1],t=f+1===h;if(!1===q)null!=r&&(R(r)?j+=o(r,b).join("-"):j+=encodeURIComponent(r)),j+=s;elseif(!0===q){varu=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(u)[1]}elseP(q)&&(j+=q+s);t&&!0===m.squash&&"/"===j.slice(-1)&&(j=j.slice(0,-1))}else{if(null==r||p&&!1!==q)continue;if(R(r)||(r=[r]),0===r.length)continue;r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+l+"="+r,g=!0}}returnj},u.prototype.is=function(a,b){return!0},u.prototype.encode=function(a,b){returna},u.prototype.decode=function(a,b){returna},u.prototype.equals=function(a,b){returna==b},u.prototype.$subPattern=function(){vara=this.pattern.toString();returna.substr(1,a.length-2)},u.prototype.pattern=/.*/,u.prototype.toString=function(){return"{Type:"+this.name+"}"},u.prototype.$normalize=function(a){returnthis.is(a)?a:this.decode(a)},u.prototype.$asArray=function(a,b){functiond(a,b){functiond(a,b){returnfunction(){returna[b].apply(a,arguments)}}functione(a){returnR(a)?a:N(a)?[a]:[]}functionf(a){switch(a.length){case0:returnc;case1:return"auto"===b?a[0]:a;default:returna}}functiong(a){return!a}functionh(a,b){returnfunction(c){if(R(c)&&0===c.length)returnc;c=e(c);vard=o(c,a);return!0===b?0===n(d,g).length:f(d)}}functioni(a){returnfunction(b,c){vard=e(b),f=e(c);if(d.length!==f.length)return!1;for(varg=0;g<d.length;g++)if(!a(d[g],f[g]))return!1;return!0}}this.encode=h(d(a,"encode")),this.decode=h(d(a,"decode")),this.is=h(d(a,"is"),!0),this.equals=i(d(a,"equals")),this.pattern=a.pattern,this.$normalize=h(d(a,"$normalize")),this.name=a.name,this.$arrayMode=b}if(!a)returnthis;if("auto"===a&&!b)thrownewError("'auto' array mode is for query parameters only");returnnewd(this,a)},b.module("ui.router.util").provider("$urlMatcherFactory",v),b.module("ui.router.util").run(["$urlMatcherFactory",function(a){}]),w.$inject=["$locationProvider","$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",w),x.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],b.module("ui.router.state").factory("$stateParams",function(){return{}}).constant("$state.runtime",{autoinject:!0}).provider("$state",x).run(["$injector",function(a){a.get("$state.runtime").autoinject&&a.get("$state")}]),y.$inject=[],b.module("ui.router.state").provider("$view",y),b.module("ui.router.state").provider("$uiViewScroll",z),A.$inject=["$state","$injector","$uiViewScroll","$interpolate","$q"],B.$inject=["$compile","$controller","$state","$interpolate"],b.module("ui.router.state").directive("uiView",A),b.module("ui.router.state").directive("uiView",B),I.$inject=["$state","$timeout"],J.$inject=["$state","$timeout"],K.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",I).directive("uiSrefActive",K).directive("uiSrefActiveEq",K).directive("uiState",J),L.$inject=["$state"],M.$inject=["$state"],b.module("ui.router.state").filter("isState",L).filter("includedByState",M)}(window,window.angular);