/** * State-based routing for AngularJS 1.x * NOTICE: This monolithic bundle also bundles the @uirouter/core code. * This causes it to be incompatible with plugins that depend on @uirouter/core. * We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead. * For more information, see https://ui-router.github.io/blog/uirouter-for-angularjs-umd-bundles * @version v1.0.22 * @link https://ui-router.github.io * @license MIT License, http://www.opensource.org/licenses/MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("angular")):"function"==typeof define&&define.amd?define(["exports","angular"],e):e((t=t||self)["@uirouter/angularjs"]={},t.angular)}(this,function(d,t){"use strict";var e=angular,b=t&&t.module?t:e;function c(r){var t=[].slice.apply(arguments,[1]),n=r.length;return function t(e){return e.length>=n?r.apply(null,e):function(){return t(e.concat([].slice.apply(arguments)))}}(t)}function r(){var r=arguments,n=r.length-1;return function(){for(var t=n,e=r[n].apply(this,arguments);t--;)e=r[t].call(this,e);return e}}function s(){for(var t=[],e=0;ethis._limit&&this.evict(),t},t.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach(function(t){return t(e)}),e},t.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},t.prototype.clear=function(){var t=this._items;return this._items=[],t},t.prototype.size=function(){return this._items.length},t.prototype.remove=function(t){var e=this._items.indexOf(t);return-1 "+Bt(t))},t.prototype.traceTransitionIgnored=function(t){this.enabled(d.Category.TRANSITION)&&console.log(ue(t)+": Ignored <> "+Bt(t))},t.prototype.traceHookInvocation=function(t,e,r){if(this.enabled(d.Category.HOOK)){var n=R("traceData.hookType")(r)||"internal",i=R("traceData.context.state.name")(r)||R("traceData.context")(r)||"unknown",o=Ft(t.registeredHook.callback);console.log(ue(e)+": Hook -> "+n+" context: "+i+", "+Dt(200,o))}},t.prototype.traceHookResult=function(t,e,r){this.enabled(d.Category.HOOK)&&console.log(ue(e)+": <- Hook returned: "+Dt(200,Bt(t)))},t.prototype.traceResolvePath=function(t,e,r){this.enabled(d.Category.RESOLVE)&&console.log(ue(r)+": Resolving "+t+" ("+e+")")},t.prototype.traceResolvableResolved=function(t,e){this.enabled(d.Category.RESOLVE)&&console.log(ue(e)+": <- Resolved "+t+" to: "+Dt(200,Bt(t.data)))},t.prototype.traceError=function(t,e){this.enabled(d.Category.TRANSITION)&&console.log(ue(e)+": <- Rejected "+Bt(e)+", reason: "+t)},t.prototype.traceSuccess=function(t,e){this.enabled(d.Category.TRANSITION)&&console.log(ue(e)+": <- Success "+Bt(e)+", final state: "+t.name)},t.prototype.traceUIViewEvent=function(t,e,r){void 0===r&&(r=""),this.enabled(d.Category.UIVIEW)&&console.log("ui-view: "+qt(30,t)+" "+te(e)+r)},t.prototype.traceUIViewConfigUpdated=function(t,e){this.enabled(d.Category.UIVIEW)&&this.traceUIViewEvent("Updating",t," with ViewConfig from context='"+e+"'")},t.prototype.traceUIViewFill=function(t,e){this.enabled(d.Category.UIVIEW)&&this.traceUIViewEvent("Fill",t," with: "+Dt(200,e))},t.prototype.traceViewSync=function(t){if(this.enabled(d.Category.VIEWCONFIG)){var a="uiview component fqn",e=t.map(function(t){var e,r=t.uiView,n=t.viewConfig,i=r&&r.fqn,o=n&&n.viewDecl.$context.name+": ("+n.viewDecl.$name+")";return(e={})[a]=i,e["view config state (view name)"]=o,e}).sort(function(t,e){return(t[a]||"").localeCompare(e[a]||"")});ie(e)}},t.prototype.traceViewServiceEvent=function(t,e){var r,n,i;this.enabled(d.Category.VIEWCONFIG)&&console.log("VIEWCONFIG: "+t+" "+(n=(r=e).viewDecl,i=n.$context.name||"(root)","[View#"+r.$id+" from '"+i+"' state]: target ui-view: '"+n.$uiViewName+"@"+n.$uiViewContextAnchor+"'"))},t.prototype.traceViewServiceUIViewEvent=function(t,e){this.enabled(d.Category.VIEWCONFIG)&&console.log("VIEWCONFIG: "+t+" "+te(e))},t}(),ce=new se,fe=function(){function t(t){this.pattern=/.*/,this.inherit=!0,L(this,t)}return t.prototype.is=function(t,e){return!0},t.prototype.encode=function(t,e){return t},t.prototype.decode=function(t,e){return t},t.prototype.equals=function(t,e){return t==e},t.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},t.prototype.toString=function(){return"{ParamType:"+this.name+"}"},t.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},t.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new le(this,t)},t}();function le(n,i){var o=this;function a(t){return O(t)?t:E(t)?[t]:[]}function u(r,n){return function(t){if(O(t)&&0===t.length)return t;var e=ft(a(t),r);return!0===n?0===ut(e,function(t){return!t}).length:function(t){switch(t.length){case 0:return;case 1:return"auto"===i?t[0]:t;default:return t}}(e)}}function s(o){return function(t,e){var r=a(t),n=a(e);if(r.length!==n.length)return!1;for(var i=0;i=r.invokeLimit&&r.deregister()}}},o.prototype.handleHookResult=function(t){var e=this,r=this.getNotCurrentRejection();return r||(I(t)?t.then(function(t){return e.handleHookResult(t)}):(ce.traceHookResult(t,this.transition,this.options),!1===t?At.aborted("Hook aborted transition").toPromise():p(Se)(t)?At.redirected(t).toPromise():void 0))},o.prototype.getNotCurrentRejection=function(){var t=this.transition.router;return t._disposed?At.aborted("UIRouter instance #"+t.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?At.aborted().toPromise():this.isSuperseded()?At.superseded(this.options.current()).toPromise():void 0},o.prototype.toString=function(){var t=this.options,e=this.registeredHook;return(R("traceData.hookType")(t)||"internal")+" context: "+(R("traceData.context.state.name")(t)||R("traceData.context")(t)||"unknown")+", "+Dt(200,Nt(e.callback))},o.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},o.LOG_REJECTED_RESULT=function(e){return function(t){I(t)&&t.catch(function(t){return e.logError(At.normalize(t))})}},o.LOG_ERROR=function(e){return function(t){return e.logError(t)}},o.REJECT_ERROR=function(t){return function(t){return jt(t)}},o.THROW_ERROR=function(t){return function(t){throw t}},o}();function Je(t,e,r){var i=P(e)?[e]:e;return!!(C(i)?i:function(t){for(var e=i,r=0;r "+(this.valid()?"":"(X) ")+"'"+(k(e)?e.name:e)+"'"+Bt(r(this.params()))+" )"},e.diToken=e}();function tr(t,e){var r=["",""],n=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return n;switch(e.squash){case!1:r=["(",")"+(e.isOptional?"?":"")];break;case!0:n=n.replace(/\/$/,""),r=["(?:/(",")|/)?"];break;default:r=["("+e.squash+"|",")?"]}return n+r[0]+e.type.pattern.source+r[1]}var er=Zt("/"),rr={state:{params:{}},strict:!0,caseInsensitive:!0},nr=function(){function m(o,a,t,e){var u=this;this._cache={path:[this]},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.config=e=et(e,rr),this.pattern=o;for(var r,n,i,s=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,c=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,f=[],l=0,h=function(t){if(!m.nameValidator.test(t))throw new Error("Invalid parameter name '"+t+"' in pattern '"+o+"'");if(st(u._params,y("id",t)))throw new Error("Duplicate parameter name '"+t+"' in pattern '"+o+"'")},p=function(t,e){var r,n=t[2]||t[3],i=e?t[4]:t[4]||("*"===t[1]?"[\\s\\S]*":null);return{id:n,regexp:i,segment:o.substring(l,t.index),type:i?a.type(i)||(r=i,z(a.type(e?"query":"path"),{pattern:new RegExp(r,u.config.caseInsensitive?"i":void 0)})):null}};(r=s.exec(o))&&!(0<=(n=p(r,!1)).segment.indexOf("?"));)h(n.id),this._params.push(t.fromPath(n.id,n.type,e.state)),this._segments.push(n.segment),f.push([n.segment,Ct(this._params)]),l=s.lastIndex;var v=(i=o.substring(l)).indexOf("?");if(0<=v){var d=i.substring(v);if(i=i.substring(0,v),0 Registering",t),this._viewConfigs.push(t)},s.prototype.sync=function(){var r=this,n=this._uiViews.map(function(t){return[t.fqn,t]}).reduce(Et,{});function i(t){for(var e=t.viewDecl.$context,r=0;++r&&e.parent;)e=e.parent;return r}var o=c(function(t,e,r,n){return e*(t(r)-t(n))}),t=this._uiViews.sort(o(function(t){var e=function(t){return t&&t.parent?e(t.parent)+1:1};return 1e4*t.fqn.split(".").length+e(t.creationContext)},1)).map(function(t){var e=r._viewConfigs.filter(s.matches(n,t));return 1 Registering",e);var t=this._uiViews;return t.filter(function(t){return t.fqn===e.fqn&&t.$type===e.$type}).length&&ce.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(ce.traceViewServiceUIViewEvent("<- Deregistering",e),K(t)(e)):ce.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},s.prototype.available=function(){return this._uiViews.map(w("fqn"))},s.prototype.active=function(){return this._uiViews.filter(w("$config")).map(w("name"))},s.matches=function(u,s){return function(t){if(s.$type!==t.viewDecl.$type)return!1;var e=t.viewDecl,r=e.$uiViewName.split("."),n=s.fqn.split(".");if(!M(r,n.slice(0-r.length)))return!1;var i=1-r.length||void 0,o=n.slice(0,i).join("."),a=u[o].creationContext;return e.$uiViewContextAnchor===(a&&a.name)}},s}(),hr=function(){function t(){this.params=new we,this.lastStartedTransitionId=-1,this.transitionHistory=new It([],1),this.successfulTransitions=new It([],1)}return t.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},t}();function pr(t){if(!(C(t)||P(t)||p(Se)(t)||Se.isDef(t)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return C(t)?t:v(t)}cr=function(t,e){var r,n,i,o,a,u,s,c,f=(r=t,(e.priority||0)-(r.priority||0));return 0!==f?f:(n=e,0!==(f=((i={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1})[t.type]||0)-(i[n.type]||0))?f:(a=e,0!==(f=(o=t).urlMatcher&&a.urlMatcher?nr.compare(o.urlMatcher,a.urlMatcher):0)?f:(s=e,(c={STATE:!0,URLMATCHER:!0})[(u=t).type]&&c[s.type]?0:(u.$id||0)-(s.$id||0))))};var vr=function(){function t(t){this.router=t,this._sortFn=cr,this._rules=[],this._id=0,this.urlRuleFactory=new ur(t)}return t.prototype.dispose=function(t){this._rules=[],delete this._otherwiseFn},t.prototype.initial=function(t){var e=pr(t);this.rule(this.urlRuleFactory.create(function(t,e){return 0===e.globals.transitionHistory.size()&&!!/^\/?$/.exec(t.path)},e))},t.prototype.otherwise=function(t){var e=pr(t);this._otherwiseFn=this.urlRuleFactory.create(v(!0),e),this._sorted=!1},t.prototype.removeRule=function(t){K(this._rules,t)},t.prototype.rule=function(t){var e=this;if(!ur.isUrlRule(t))throw new Error("invalid rule");return t.$id=this._id++,t.priority=t.priority||0,this._rules.push(t),this._sorted=!1,function(){return e.removeRule(t)}},t.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},t.prototype.sort=function(t){for(var e=this.stableSort(this._rules,this._sortFn=t||this._sortFn),r=0,n=0;nr.weight?u:r}return r},t}(),yr=0,gr=H("LocationServices",["url","path","search","hash","onChange"]),wr=H("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),_r=function(){function t(t,e){void 0===t&&(t=gr),void 0===e&&(e=wr),this.locationService=t,this.locationConfig=e,this.$id=yr++,this._disposed=!1,this._disposables=[],this.trace=ce,this.viewService=new lr(this),this.globals=new hr,this.transitionService=new Lr(this),this.urlMatcherFactory=new ar(this),this.urlRouter=new fr(this),this.urlService=new mr(this),this.stateRegistry=new Ge(this),this.stateService=new Mr(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(t),this.disposable(e)}return t.prototype.disposable=function(t){this._disposables.push(t)},t.prototype.dispose=function(t){var e=this;t&&C(t.dispose)?t.dispose(this):(this._disposed=!0,this._disposables.slice().forEach(function(t){try{"function"==typeof t.dispose&&t.dispose(e),K(e._disposables,t)}catch(t){}}))},t.prototype.plugin=function(t,e){void 0===e&&(e={});var r=new t(this,e);if(!r.name)throw new Error("Required property `name` missing on plugin: "+r);return this._disposables.push(r),this._plugins[r.name]=r},t.prototype.getPlugin=function(t){return t?this._plugins[t]:lt(this._plugins)},t}();function Sr(e){e.addResolvable(Ee.fromData(_r,e.router),""),e.addResolvable(Ee.fromData(Xe,e),""),e.addResolvable(Ee.fromData("$transition$",e),""),e.addResolvable(Ee.fromData("$stateParams",e.params()),""),e.entering().forEach(function(t){e.addResolvable(Ee.fromData("$state$",t),t)})}var $r=J(["$transition$",Xe]),br=function(t){var e=lt(t.treeChanges()).reduce(vt,[]).reduce(yt,[]),r=function(t){return $r(t.token)?Ee.fromData(t.token,null):t};e.forEach(function(t){t.resolvables=t.resolvables.map(r)})},Rr=function(e){var t=e.to().redirectTo;if(t){var r=e.router.stateService;return C(t)?A.$q.when(t(e)).then(n):n(t)}function n(t){if(t)return t instanceof Se?t:P(t)?r.target(t,e.params(),e.options()):t.state||t.params?r.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function Er(r){return function(t,e){return(0,e.$$state()[r])(t,e)}}var Cr=Er("onExit"),Tr=Er("onRetain"),Pr=Er("onEnter"),kr=function(t){return new Oe(t.treeChanges().to).resolvePath("EAGER",t).then(G)},Or=function(t,e){return new Oe(t.treeChanges().to).subContext(e.$$state()).resolvePath("LAZY",t).then(G)},xr=function(t){return new Oe(t.treeChanges().to).resolvePath("LAZY",t).then(G)},jr=function(t){var e=A.$q,r=t.views("entering");if(r.length)return e.all(r.map(function(t){return e.when(t.load())})).then(G)},Vr=function(t){var e=t.views("entering"),r=t.views("exiting");if(e.length||r.length){var n=t.router.viewService;r.forEach(function(t){return n.deactivateViewConfig(t)}),e.forEach(function(t){return n.activateViewConfig(t)}),n.sync()}},Ir=function(t){var e=t.router.globals,r=function(){e.transition===t&&(e.transition=null)};t.onSuccess({},function(){e.successfulTransitions.enqueue(t),e.$current=t.$to(),e.current=e.$current.self,Tt(t.params(),e.params)},{priority:1e4}),t.promise.then(r,r)},Hr=function(t){var e=t.options(),r=t.router.stateService,n=t.router.urlRouter;if("url"!==e.source&&e.location&&r.$current.navigable){var i={replace:"replace"===e.location};n.push(r.$current.navigable.url,r.params,i)}n.update(!0)},Ar=function(a){var u=a.router;var t=a.entering().filter(function(t){return!!t.$$state().lazyLoad}).map(function(t){return Dr(a,t)});return A.$q.all(t).then(function(){if("url"!==a.originalTransition().options().source){var t=a.targetState();return u.stateService.target(t.identifier(),t.params(),t.options())}var e=u.urlService,r=e.match(e.parts()),n=r&&r.rule;if(n&&"STATE"===n.type){var i=n.state,o=r.match;return u.stateService.target(i,o,a.options())}u.urlService.sync()})};function Dr(e,r){var n=r.$$state().lazyLoad,t=n._promise;if(!t){t=n._promise=A.$q.when(n(e,r)).then(function(t){t&&Array.isArray(t.states)&&t.states.forEach(function(t){return e.router.stateRegistry.register(t)});return t}).then(function(t){return delete r.lazyLoad,delete r.$$state().lazyLoad,delete n._promise,t},function(t){return delete n._promise,A.$q.reject(t)})}return t}var qr=function(t,e,r,n,i,o,a,u){void 0===i&&(i=!1),void 0===o&&(o=ze.HANDLE_RESULT),void 0===a&&(a=ze.REJECT_ERROR),void 0===u&&(u=!1),this.name=t,this.hookPhase=e,this.hookOrder=r,this.criteriaMatchPath=n,this.reverseSort=i,this.getResultHandler=o,this.getErrorHandler=a,this.synchronous=u};function Ur(t){var e=t._ignoredReason();if(e){ce.traceTransitionIgnored(t);var r=t.router.globals.transition;return"SameAsCurrent"===e&&r&&r.abort(),At.ignored().toPromise()}}function Fr(t){if(!t.valid())throw new Error(t.error().toString())}var Nr={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,custom:{},current:function(){return null},source:"unknown"},Lr=function(){function t(t){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=t,this.$view=t.viewService,this._deregisterHookFns={},this._pluginapi=W(v(this),{},v(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),t.globals.successfulTransitions.onEvict(br)}return t.prototype.onCreate=function(t,e,r){},t.prototype.onBefore=function(t,e,r){},t.prototype.onStart=function(t,e,r){},t.prototype.onExit=function(t,e,r){},t.prototype.onRetain=function(t,e,r){},t.prototype.onEnter=function(t,e,r){},t.prototype.onFinish=function(t,e,r){},t.prototype.onSuccess=function(t,e,r){},t.prototype.onError=function(t,e,r){},t.prototype.dispose=function(t){lt(this._registeredHooks).forEach(function(e){return e.forEach(function(t){t._deregistered=!0,K(e,t)})})},t.prototype.create=function(t,e){return new Xe(t,e,this._router)},t.prototype._defineCoreEvents=function(){var t=d.TransitionHookPhase,e=ze,r=this._criteriaPaths;this._defineEvent("onCreate",t.CREATE,0,r.to,!1,e.LOG_REJECTED_RESULT,e.THROW_ERROR,!0),this._defineEvent("onBefore",t.BEFORE,0,r.to),this._defineEvent("onStart",t.RUN,0,r.to),this._defineEvent("onExit",t.RUN,100,r.exiting,!0),this._defineEvent("onRetain",t.RUN,200,r.retained),this._defineEvent("onEnter",t.RUN,300,r.entering),this._defineEvent("onFinish",t.RUN,400,r.to),this._defineEvent("onSuccess",t.SUCCESS,0,r.to,!1,e.LOG_REJECTED_RESULT,e.LOG_ERROR,!0),this._defineEvent("onError",t.ERROR,0,r.to,!1,e.LOG_REJECTED_RESULT,e.LOG_ERROR,!0)},t.prototype._defineCorePaths=function(){var t=d.TransitionHookScope.STATE,e=d.TransitionHookScope.TRANSITION;this._definePathType("to",e),this._definePathType("from",e),this._definePathType("exiting",t),this._definePathType("retained",t),this._definePathType("entering",t)},t.prototype._defineEvent=function(t,e,r,n,i,o,a,u){void 0===i&&(i=!1),void 0===o&&(o=ze.HANDLE_RESULT),void 0===a&&(a=ze.REJECT_ERROR),void 0===u&&(u=!1);var s=new qr(t,e,r,n,i,o,a,u);this._eventTypes.push(s),Ke(this,this,s)},t.prototype._getEvents=function(e){return(E(e)?this._eventTypes.filter(function(t){return t.hookPhase===e}):this._eventTypes.slice()).sort(function(t,e){var r=t.hookPhase-e.hookPhase;return 0===r?t.hookOrder-e.hookOrder:r})},t.prototype._definePathType=function(t,e){this._criteriaPaths[t]={name:t,scope:e}},t.prototype._getPathTypes=function(){return this._criteriaPaths},t.prototype.getHooks=function(t){return this._registeredHooks[t]},t.prototype._registerCoreTransitionHooks=function(){var t=this._deregisterHookFns;t.addCoreResolves=this.onCreate({},Sr),t.ignored=this.onBefore({},Ur,{priority:-9999}),t.invalid=this.onBefore({},Fr,{priority:-1e4}),t.redirectTo=this.onStart({to:function(t){return!!t.redirectTo}},Rr),t.onExit=this.onExit({exiting:function(t){return!!t.onExit}},Cr),t.onRetain=this.onRetain({retained:function(t){return!!t.onRetain}},Tr),t.onEnter=this.onEnter({entering:function(t){return!!t.onEnter}},Pr),t.eagerResolve=this.onStart({},kr,{priority:1e3}),t.lazyResolve=this.onEnter({entering:v(!0)},Or,{priority:1e3}),t.resolveAll=this.onFinish({},xr,{priority:1e3}),t.loadViews=this.onFinish({},jr),t.activateViews=this.onSuccess({},Vr),t.updateGlobals=this.onCreate({},Ir),t.updateUrl=this.onSuccess({},Hr,{priority:9999}),t.lazyLoad=this.onBefore({entering:function(t){return!!t.lazyLoad}},Ar)},t}(),Mr=function(){function r(t){this.router=t,this.invalidCallbacks=[],this._defaultErrorHandler=function(t){t instanceof Error&&t.stack?(console.error(t),console.error(t.stack)):t instanceof At?(console.error(t.toString()),t.detail&&t.detail.stack&&console.error(t.detail.stack)):console.error(t)};var e=Object.keys(r.prototype).filter(l(J(["current","$current","params","transition"])));W(v(r.prototype),this,v(this),e)}return Object.defineProperty(r.prototype,"transition",{get:function(){return this.router.globals.transition},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"params",{get:function(){return this.router.globals.params},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"current",{get:function(){return this.router.globals.current},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"$current",{get:function(){return this.router.globals.$current},enumerable:!0,configurable:!0}),r.prototype.dispose=function(){this.defaultErrorHandler(G),this.invalidCallbacks=[]},r.prototype._handleInvalidTargetState=function(t,r){var n=this,i=$e.makeTargetState(this.router.stateRegistry,t),e=this.router.globals,o=function(){return e.transitionHistory.peekTail()},a=o(),u=new It(this.invalidCallbacks.slice()),s=new Oe(t).injector(),c=function(t){if(t instanceof Se){var e=t;return(e=n.target(e.identifier(),e.params(),e.options())).valid()?o()!==a?At.superseded().toPromise():n.transitionTo(e.identifier(),e.params(),e.options()):At.invalid(e.error()).toPromise()}};return function e(){var t=u.dequeue();return void 0===t?At.invalid(r.error()).toPromise():A.$q.when(t(r,i,s)).then(c).then(function(t){return t||e()})}()},r.prototype.onInvalid=function(t){return this.invalidCallbacks.push(t),function(){K(this.invalidCallbacks)(t)}.bind(this)},r.prototype.reload=function(t){return this.transitionTo(this.current,this.params,{reload:!E(t)||t,inherit:!1,notify:!1})},r.prototype.go=function(t,e,r){var n=et(r,{relative:this.$current,inherit:!0},Nr);return this.transitionTo(t,e,n)},r.prototype.target=function(t,e,r){if(void 0===r&&(r={}),k(r.reload)&&!r.reload.name)throw new Error("Invalid reload state object");var n=this.router.stateRegistry;if(r.reloadState=!0===r.reload?n.root():n.matcher.find(r.reload,r.relative),r.reload&&!r.reloadState)throw new Error("No such reload state '"+(P(r.reload)?r.reload:r.reload.name)+"'");return new Se(this.router.stateRegistry,t,e,r)},r.prototype.getCurrentPath=function(){var t=this,e=this.router.globals.successfulTransitions.peekTail();return e?e.treeChanges().to:[new _e(t.router.stateRegistry.root())]},r.prototype.transitionTo=function(t,e,r){var o=this;void 0===e&&(e={}),void 0===r&&(r={});var a=this.router,u=a.globals;r=et(r,Nr);r=L(r,{current:function(){return u.transition}});var n=this.target(t,e,r),i=this.getCurrentPath();if(!n.exists())return this._handleInvalidTargetState(i,n);if(!n.valid())return jt(n.error());var s=function(i){return function(t){if(t instanceof At){var e=a.globals.lastStartedTransitionId<=i.$id;if(t.type===d.RejectType.IGNORED)return e&&a.urlRouter.update(),A.$q.when(u.current);var r=t.detail;if(t.type===d.RejectType.SUPERSEDED&&t.redirected&&r instanceof Se){var n=i.redirect(r);return n.run().catch(s(n))}if(t.type===d.RejectType.ABORTED)return e&&a.urlRouter.update(),A.$q.reject(t)}return o.defaultErrorHandler()(t),A.$q.reject(t)}},c=this.router.transitionService.create(i,n),f=c.run().catch(s(c));return xt(f),L(f,{transition:c})},r.prototype.is=function(t,e,r){r=et(r,{relative:this.$current});var n=this.router.stateRegistry.matcher.find(t,r.relative);if(E(n)){if(this.$current!==n)return!1;if(!e)return!0;var i=n.parameters({inherit:!0,matchingKeys:e});return ye.equals(i,ye.values(i,e),this.params)}},r.prototype.includes=function(t,e,r){r=et(r,{relative:this.$current});var n=P(t)&&Vt.fromString(t);if(n){if(!n.matches(this.$current.name))return!1;t=this.$current.name}var i=this.router.stateRegistry.matcher.find(t,r.relative),o=this.$current.includes;if(E(i)){if(!E(o[i.name]))return!1;if(!e)return!0;var a=i.parameters({inherit:!0,matchingKeys:e});return ye.equals(a,ye.values(a,e),this.params)}},r.prototype.href=function(t,e,r){r=et(r,{lossy:!0,inherit:!0,absolute:!1,relative:this.$current}),e=e||{};var n=this.router.stateRegistry.matcher.find(t,r.relative);if(!E(n))return null;r.inherit&&(e=this.params.$inherit(e,this.$current,n));var i=n&&r.lossy?n.navigable:n;return i&&void 0!==i.url&&null!==i.url?this.router.urlRouter.href(i.url,e,{absolute:r.absolute}):null},r.prototype.defaultErrorHandler=function(t){return this._defaultErrorHandler=t||this._defaultErrorHandler},r.prototype.get=function(t,e){var r=this.router.stateRegistry;return 0===arguments.length?r.get():r.get(t,e||this.$current)},r.prototype.lazyLoad=function(t,e){var r=this.get(t);if(!r||!r.lazyLoad)throw new Error("Can not lazy load "+t);var n=this.getCurrentPath(),i=$e.makeTargetState(this.router.stateRegistry,n);return Dr(e=e||this.router.transitionService.create(n,i),r)},r}(),Br={when:function(r){return new Promise(function(t,e){return t(r)})},reject:function(r){return new Promise(function(t,e){e(r)})},defer:function(){var r={};return r.promise=new Promise(function(t,e){r.resolve=t,r.reject=e}),r},all:function(t){if(O(t))return Promise.all(t);if(k(t)){var e=Object.keys(t).map(function(e){return t[e].then(function(t){return{key:e,val:t}})});return Br.all(e).then(function(t){return t.reduce(function(t,e){return t[e.key]=e.val,t},{})})}}},Gr={},Wr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,zr=/([^\s,]+)/g,Jr={get:function(t){return Gr[t]},has:function(t){return null!=Jr.get(t)},invoke:function(t,e,r){var n=L({},Gr,r||{}),i=Jr.annotate(t),o=_t(function(t){return n.hasOwnProperty(t)},function(t){return"DI can't find injectable: '"+t+"'"}),a=i.filter(o).map(function(t){return n[t]});return C(t)?t.apply(e,a):t.slice(-1)[0].apply(e,a)},annotate:function(t){if(!V(t))throw new Error("Not an injectable function: "+t);if(t&&t.$inject)return t.$inject;if(O(t))return t.slice(0,-1);var e=t.toString().replace(Wr,"");return e.slice(e.indexOf("(")+1,e.indexOf(")")).match(zr)||[]}},Qr=function(t,e){var r=e[0],n=e[1];return t.hasOwnProperty(r)?O(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n,t},Kr=function(t){return t.split("&").filter(B).map(Kt).reduce(Qr,{})};function Yr(t){var e=function(t){return t||""},r=Jt(t).map(e),n=r[0],i=r[1],o=Qt(n).map(e);return{path:o[0],search:o[1],hash:i,url:t}}var Zr=function(t){var e=t.path(),r=t.search(),n=t.hash(),i=Object.keys(r).map(function(e){var t=r[e];return(O(t)?t:[t]).map(function(t){return e+"="+t})}).reduce(vt,[]).join("&");return e+(i?"?"+i:"")+(n?"#"+n:"")};function Xr(n,i,o,a){return function(t){var e=t.locationService=new o(t),r=t.locationConfig=new a(t,i);return{name:n,service:e,configuration:r,dispose:function(t){t.dispose(e),t.dispose(r)}}}}var tn,en,rn,nn=function(){function t(t,e){var r=this;this.fireAfterUpdate=e,this._listeners=[],this._listener=function(e){return r._listeners.forEach(function(t){return t(e)})},this.hash=function(){return Yr(r._get()).hash},this.path=function(){return Yr(r._get()).path},this.search=function(){return Kr(Yr(r._get()).search)},this._location=D.location,this._history=D.history}return t.prototype.url=function(e,t){return void 0===t&&(t=!0),E(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach(function(t){return t({url:e})})),Zr(this)},t.prototype.onChange=function(t){var e=this;return this._listeners.push(t),function(){return K(e._listeners,t)}},t.prototype.dispose=function(t){tt(this._listeners)},t}(),on=(tn=function(t,e){return(tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}tn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),an=function(r){function t(t){var e=r.call(this,t,!1)||this;return D.addEventListener("hashchange",e._listener,!1),e}return on(t,r),t.prototype._get=function(){return Yt(this._location.hash)},t.prototype._set=function(t,e,r,n){this._location.hash=r},t.prototype.dispose=function(t){r.prototype.dispose.call(this,t),D.removeEventListener("hashchange",this._listener)},t}(nn),un=(en=function(t,e){return(en=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}en(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),sn=function(e){function t(t){return e.call(this,t,!0)||this}return un(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(t,e,r,n){this._url=r},t}(nn),cn=(rn=function(t,e){return(rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}rn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),fn=function(r){function t(t){var e=r.call(this,t,!0)||this;return e._config=t.urlService.config,D.addEventListener("popstate",e._listener,!1),e}return cn(t,r),t.prototype._getBasePrefix=function(){return zt(this._config.baseHref())},t.prototype._get=function(){var t=this._location,e=t.pathname,r=t.hash,n=t.search;n=Qt(n)[1],r=Jt(r)[1];var i=this._getBasePrefix(),o=e===this._config.baseHref(),a=e.substr(0,i.length)===i;return(e=o?"/":a?e.substring(i.length):e)+(n?"?"+n:"")+(r?"#"+r:"")},t.prototype._set=function(t,e,r,n){var i=this._getBasePrefix(),o=r&&"/"!==r[0]?"/":"",a=""===r||"/"===r?this._config.baseHref():i+o+r;n?this._history.replaceState(t,e,a):this._history.pushState(t,e,a)},t.prototype.dispose=function(t){r.prototype.dispose.call(this,t),D.removeEventListener("popstate",this._listener)},t}(nn),ln=function(){var e=this;this.dispose=G,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return E(t)?e._hashPrefix=t:e._hashPrefix}},hn=function(){function t(t,e){void 0===e&&(e=!1),this._isHtml5=e,this._baseHref=void 0,this._hashPrefix=""}return t.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},t.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},t.prototype.host=function(){return location.hostname},t.prototype.html5Mode=function(){return this._isHtml5},t.prototype.hashPrefix=function(t){return E(t)?this._hashPrefix=t:this._hashPrefix},t.prototype.baseHref=function(t){return E(t)&&(this._baseHref=t),_(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},t.prototype.getBaseHref=function(){var t=document.getElementsByTagName("base")[0];return t&&t.href?t.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},t.prototype.dispose=function(){},t}();function pn(t){return A.$injector=Jr,{name:"vanilla.services",$q:A.$q=Br,$injector:Jr,dispose:function(){return null}}}var vn=Xr("vanilla.hashBangLocation",!1,an,hn),dn=Xr("vanilla.pushStateLocation",!0,fn,hn),mn=Xr("vanilla.memoryLocation",!1,sn,ln),yn=function(){function t(){}return t.prototype.dispose=function(t){},t}(),gn=Object.freeze({root:D,fromJson:U,toJson:F,forEach:N,extend:L,equals:M,identity:B,noop:G,createProxyFunctions:W,inherit:z,inArray:J,_inArray:Q,removeFrom:K,_removeFrom:Y,pushTo:Z,_pushTo:X,deregAll:tt,defaults:et,mergeR:rt,ancestors:nt,pick:it,omit:ot,pluck:at,filter:ut,find:st,mapObj:ct,map:ft,values:lt,allTrueR:ht,anyTrueR:pt,unnestR:vt,flattenR:dt,pushR:mt,uniqR:yt,unnest:gt,flatten:wt,assertPredicate:_t,assertMap:St,assertFn:$t,pairs:bt,arrayTuples:Rt,applyPairs:Et,tail:Ct,copy:Tt,_extend:Pt,silenceUncaughtInPromise:xt,silentRejection:jt,makeStub:H,services:A,Glob:Vt,curry:c,compose:r,pipe:s,prop:w,propEq:y,parse:R,not:l,and:n,or:i,all:f,any:h,is:p,eq:o,val:v,invoke:a,pattern:m,isUndefined:_,isDefined:E,isNull:S,isNullOrUndefined:$,isFunction:C,isNumber:T,isString:P,isObject:k,isArray:O,isDate:x,isRegExp:j,isInjectable:V,isPromise:I,Queue:It,maxLength:Dt,padString:qt,kebobString:Ut,functionToString:Ft,fnToString:Nt,stringify:Bt,beforeAfterSubstr:Gt,hostRegex:Wt,stripLastPathElement:zt,splitHash:Jt,splitQuery:Qt,splitEqual:Kt,trimHashVal:Yt,splitOnDelim:Zt,joinNeighborsR:Xt,get Category(){return d.Category},Trace:se,trace:ce,get DefType(){return d.DefType},Param:ye,ParamTypes:ge,StateParams:we,ParamType:fe,PathNode:_e,PathUtils:$e,resolvePolicies:be,defaultResolvePolicy:Re,Resolvable:Ee,NATIVE_INJECTOR_TOKEN:ke,ResolveContext:Oe,resolvablesBuilder:qe,StateBuilder:Ne,StateObject:Le,StateMatcher:Me,StateQueueManager:Be,StateRegistry:Ge,StateService:Mr,TargetState:Se,get TransitionHookPhase(){return d.TransitionHookPhase},get TransitionHookScope(){return d.TransitionHookScope},HookBuilder:Ye,matchState:Je,RegisteredHook:Qe,makeEvent:Ke,get RejectType(){return d.RejectType},Rejection:At,Transition:Xe,TransitionHook:ze,TransitionEventType:qr,defaultTransOpts:Nr,TransitionService:Lr,UrlRules:vr,UrlConfig:dr,UrlMatcher:nr,ParamFactory:or,UrlMatcherFactory:ar,UrlRouter:fr,UrlRuleFactory:ur,BaseUrlRule:sr,UrlService:mr,ViewService:lr,UIRouterGlobals:hr,UIRouter:_r,$q:Br,$injector:Jr,BaseLocationServices:nn,HashLocationService:an,MemoryLocationService:sn,PushStateLocationService:fn,MemoryLocationConfig:ln,BrowserLocationConfig:hn,keyValsToObjectR:Qr,getParams:Kr,parseUrl:Yr,buildUrl:Zr,locationPluginFactory:Xr,servicesPlugin:pn,hashLocationPlugin:vn,pushStateLocationPlugin:dn,memoryLocationPlugin:mn,UIRouterPluginBase:yn});function wn(){var r=null;return function(t,e){return r=r||A.$injector.get("$templateFactory"),[new bn(t,e,r)]}}var _n=function(t,r){return t.reduce(function(t,e){return t||E(r[e])},!1)};function Sn(n){if(!n.parent)return{};var i=["component","bindings","componentProvider"],o=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),t=i.concat(o);if(E(n.views)&&_n(t,n))throw new Error("State '"+n.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+t.filter(function(t){return E(n[t])}).join(", "));var a={},e=n.views||{$default:it(n,t)};return N(e,function(t,e){if(e=e||"$default",P(t)&&(t={component:t}),t=L({},t),_n(i,t)&&_n(o,t))throw new Error("Cannot combine: "+i.join("|")+" with: "+o.join("|")+" in stateview: '"+e+"@"+n.name+"'");t.resolveAs=t.resolveAs||"$resolve",t.$type="ng1",t.$context=n,t.$name=e;var r=lr.normalizeUIViewTarget(t.$context,t.$name);t.$uiViewName=r.uiViewName,t.$uiViewContextAnchor=r.uiViewContextAnchor,a[e]=t}),a}var $n=0,bn=function(){function t(t,e,r){var n=this;this.path=t,this.viewDecl=e,this.factory=r,this.$id=$n++,this.loaded=!1,this.getTemplate=function(t,e){return n.component?n.factory.makeComponentTemplate(t,e,n.component,n.viewDecl.bindings):n.template}}return t.prototype.load=function(){var e=this,t=A.$q,r=new Oe(this.path),n=this.path.reduce(function(t,e){return L(t,e.paramValues)},{}),i={template:t.when(this.factory.fromConfig(this.viewDecl,n,r)),controller:t.when(this.getController(r))};return t.all(i).then(function(t){return ce.traceViewServiceEvent("Loaded",e),e.controller=t.controller,L(e,t.template),e})},t.prototype.getController=function(t){var e=this.viewDecl.controllerProvider;if(!V(e))return this.viewDecl.controller;var r=A.$injector.annotate(e),n=O(e)?Ct(e):e;return new Ee("",n,r).get(t)},t}(),Rn=function(){function t(){var n=this;this._useHttp=b.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,e,r){return n.$templateRequest=r.has&&r.has("$templateRequest")&&r.get("$templateRequest"),n.$http=t,n.$templateCache=e,n}]}return t.prototype.useHttpService=function(t){this._useHttp=t},t.prototype.fromConfig=function(t,e,r){var n=function(t){return A.$q.when(t).then(function(t){return{template:t}})},i=function(t){return A.$q.when(t).then(function(t){return{component:t}})};return E(t.template)?n(this.fromString(t.template,e)):E(t.templateUrl)?n(this.fromUrl(t.templateUrl,e)):E(t.templateProvider)?n(this.fromProvider(t.templateProvider,e,r)):E(t.component)?i(t.component):E(t.componentProvider)?i(this.fromComponentProvider(t.componentProvider,e,r)):n("")},t.prototype.fromString=function(t,e){return C(t)?t(e):t},t.prototype.fromUrl=function(t,e){return C(t)&&(t=t(e)),null==t?null:this._useHttp?this.$http.get(t,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then(function(t){return t.data}):this.$templateRequest(t)},t.prototype.fromProvider=function(t,e,r){var n=A.$injector.annotate(t),i=O(t)?Ct(t):t;return new Ee("",i,n).get(r)},t.prototype.fromComponentProvider=function(t,e,r){var n=A.$injector.annotate(t),i=O(t)?Ct(t):t;return new Ee("",i,n).get(r)},t.prototype.makeComponentTemplate=function(s,c,t,f){f=f||{};var l=3<=b.version.minor?"::":"",h=function(t){var e=Ut(t);return/^(x|data)-/.exec(e)?"x-"+e:e},e=function(t){var e=A.$injector.get(t+"Directive");if(!e||!e.length)throw new Error("Unable to find component named '"+t+"'");return e.map(En).reduce(vt,[])}(t).map(function(t){var e=t.name,r=t.type,n=h(e);if(s.attr(n)&&!f[e])return n+"='"+s.attr(n)+"'";var i=f[e]||e;if("@"===r)return n+"='{{"+l+"$resolve."+i+"}}'";if("&"!==r)return n+"='"+l+"$resolve."+i+"'";var o=c.getResolvable(i),a=o&&o.data,u=a&&A.$injector.annotate(a)||[];return n+"='$resolve."+i+(O(a)?"["+(a.length-1)+"]":"")+"("+u.join(",")+")'"}).join(" "),r=h(t);return"<"+r+" "+e+">"},t}();var En=function(t){return k(t.bindToController)?Cn(t.bindToController):Cn(t.scope)},Cn=function(e){return Object.keys(e||{}).map(function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]}).filter(function(t){return E(t)&&O(t[1])}).map(function(t){return{name:t[1][2]||t[0],type:t[1][1]}})},Tn=function(){function r(t,e){this.stateRegistry=t,this.stateService=e,W(v(r.prototype),this,v(this))}return r.prototype.decorator=function(t,e){return this.stateRegistry.decorator(t,e)||this},r.prototype.state=function(t,e){return k(t)?e=t:e.name=t,this.stateRegistry.register(e),this},r.prototype.onInvalid=function(t){return this.stateService.onInvalid(t)},r}(),Pn=function(r){return function(t,e){var i=t[r],o="onExit"===r?"from":"to";return i?function(t,e){var r=new Oe(t.treeChanges(o)).subContext(e.$$state()),n=L(Gn(r),{$state$:e,$transition$:t});return A.$injector.invoke(i,this,n)}:void 0}},kn=function(){function t(t){this._urlListeners=[],this.$locationProvider=t;var e=v(t);W(e,this,e,["hashPrefix"])}return t.monkeyPatchPathParameterType=function(t){var e=t.urlMatcherFactory.type("path");e.encode=function(t){return null!=t?t.toString().replace(/(~|\/)/g,function(t){return{"~":"~~","/":"~2F"}[t]}):t},e.decode=function(t){return null!=t?t.toString().replace(/(~~|~2F)/g,function(t){return{"~~":"~","~2F":"/"}[t]}):t}},t.prototype.dispose=function(){},t.prototype.onChange=function(t){var e=this;return this._urlListeners.push(t),function(){return K(e._urlListeners)(t)}},t.prototype.html5Mode=function(){var t=this.$locationProvider.html5Mode();return(t=k(t)?t.enabled:t)&&this.$sniffer.history},t.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},t.prototype.url=function(t,e,r){return void 0===e&&(e=!1),E(t)&&this.$location.url(t),e&&this.$location.replace(),r&&this.$location.state(r),this.$location.url()},t.prototype._runtimeServices=function(t,e,r,n,i){var o=this;this.$location=e,this.$sniffer=r,this.$browser=n,this.$window=i,t.$on("$locationChangeSuccess",function(e){return o._urlListeners.forEach(function(t){return t(e)})});var a=v(e);W(a,this,a,["replace","path","search","hash"]),W(a,this,a,["port","protocol","host"])},t}(),On=function(){function r(t){this.router=t}return r.injectableHandler=function(e,r){return function(t){return A.$injector.invoke(r,null,{$match:t,$stateParams:e.globals.params})}},r.prototype.$get=function(){var t=this.router.urlService;return this.router.urlRouter.update(!0),t.interceptDeferred||t.listen(),this.router.urlRouter},r.prototype.rule=function(t){var e=this;if(!C(t))throw new Error("'rule' must be a function");var r=new sr(function(){return t(A.$injector,e.router.locationService)},B);return this.router.urlService.rules.rule(r),this},r.prototype.otherwise=function(t){var e=this,r=this.router.urlService.rules;if(P(t))r.otherwise(t);else{if(!C(t))throw new Error("'rule' must be a string or function");r.otherwise(function(){return t(A.$injector,e.router.locationService)})}return this},r.prototype.when=function(t,e){return(O(e)||C(e))&&(e=r.injectableHandler(this.router,e)),this.router.urlService.rules.when(t,e),this},r.prototype.deferIntercept=function(t){this.router.urlService.deferIntercept(t)},r}();b.module("ui.router.angular1",[]);var xn=b.module("ui.router.init",["ng"]),jn=b.module("ui.router.util",["ui.router.init"]),Vn=b.module("ui.router.router",["ui.router.util"]),In=b.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),Hn=b.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),An=(b.module("ui.router.compat",["ui.router"]),null);function Dn(t){(An=this.router=new _r).stateProvider=new Tn(An.stateRegistry,An.stateService),An.stateRegistry.decorator("views",Sn),An.stateRegistry.decorator("onExit",Pn("onExit")),An.stateRegistry.decorator("onRetain",Pn("onRetain")),An.stateRegistry.decorator("onEnter",Pn("onEnter")),An.viewService._pluginapi._viewConfigFactory("ng1",wn());var u=An.locationService=An.locationConfig=new kn(t);function e(t,e,r,n,i,o,a){return u._runtimeServices(i,t,n,e,r),delete An.router,delete An.$get,An}return kn.monkeyPatchPathParameterType(An),((An.router=An).$get=e).$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],An}Dn.$inject=["$locationProvider"];var qn=function(r){return["$uiRouterProvider",function(t){var e=t.router[r];return e.$get=function(){return e},e}]};function Un(e,t,r){if(A.$injector=e,A.$q=t,!e.hasOwnProperty("strictDi"))try{e.invoke(function(t){})}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}r.stateRegistry.get().map(function(t){return t.$$state().resolvables}).reduce(vt,[]).filter(function(t){return"deferred"===t.deps}).forEach(function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)})}Un.$inject=["$injector","$q","$uiRouter"];function Fn(t){t.$watch(function(){ce.approximateDigests++})}Fn.$inject=["$rootScope"],xn.provider("$uiRouter",Dn),Vn.provider("$urlRouter",["$uiRouterProvider",function(t){return t.urlRouterProvider=new On(t)}]),jn.provider("$urlService",qn("urlService")),jn.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return An.urlMatcherFactory}]),jn.provider("$templateFactory",function(){return new Rn}),In.provider("$stateRegistry",qn("stateRegistry")),In.provider("$uiRouterGlobals",qn("globals")),In.provider("$transitions",qn("transitionService")),In.provider("$state",["$uiRouterProvider",function(){return L(An.stateProvider,{$get:function(){return An.stateService}})}]),In.factory("$stateParams",["$uiRouter",function(t){return t.globals.params}]),Hn.factory("$view",function(){return An.viewService}),Hn.service("$trace",function(){return ce}),Hn.run(Fn),jn.run(["$urlMatcherFactory",function(t){}]),In.run(["$state",function(t){}]),Vn.run(["$urlRouter",function(t){}]),xn.run(Un);var Nn,Ln,Mn,Bn,Gn=function(r){return r.getTokens().filter(P).map(function(t){var e=r.getResolvable(t);return[t,"NOWAIT"===r.getPolicy(e).async?e.promise:e.data]}).reduce(Et,{})};function Wn(t){var e,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t="("+r[1]+")"),!(e=t.replace(/\n/g," ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/))||4!==e.length)throw new Error("Invalid state ref '"+t+"'");return{state:e[1]||null,paramExpr:e[3]||null}}function zn(t){var e=t.parent().inheritedData("$uiView"),r=R("$cfg.path")(e);return r?Ct(r).state.name:void 0}function Jn(t,e,r){var n,i=r.uiState||t.current.name,o=L((n=t,{relative:zn(e)||n.$current,inherit:!0,source:"sref"}),r.uiStateOpts||{}),a=t.href(i,r.uiStateParams,o);return{uiState:i,uiStateParams:r.uiStateParams,uiStateOpts:o,href:a}}function Qn(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),r="FORM"===t[0].nodeName;return{attr:r?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!r}}function Kn(o,a,u,s,c){return function(t){var e=t.which||t.button,r=c();if(!(1