UNPKG

angular2

Version:

Angular 2 - a web framework for modern web apps

2 lines 61.3 kB
"format register";System.register("angular2/src/router/route_config_impl",["angular2/src/facade/lang"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},i=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},s=t("angular2/src/facade/lang"),u=function(){function t(t){this.configs=t}return t=a([s.CONST(),i("design:paramtypes",[Array])],t)}();e.RouteConfig=u;var c=function(){function t(t){var e=t.path,r=t.component,n=t.name,o=t.data,a=t.useAsDefault;this.aux=null,this.loader=null,this.redirectTo=null,this.path=e,this.component=r,this.name=n,this.data=o,this.useAsDefault=a}return t=a([s.CONST(),i("design:paramtypes",[Object])],t)}();e.Route=c;var l=function(){function t(t){var e=t.path,r=t.component,n=t.name;this.data=null,this.aux=null,this.loader=null,this.redirectTo=null,this.useAsDefault=!1,this.path=e,this.component=r,this.name=n}return t=a([s.CONST(),i("design:paramtypes",[Object])],t)}();e.AuxRoute=l;var p=function(){function t(t){var e=t.path,r=t.loader,n=t.name,o=t.data,a=t.useAsDefault;this.aux=null,this.path=e,this.loader=r,this.name=n,this.data=o,this.useAsDefault=a}return t=a([s.CONST(),i("design:paramtypes",[Object])],t)}();e.AsyncRoute=p;var h=function(){function t(t){var e=t.path,r=t.redirectTo;this.name=null,this.loader=null,this.data=null,this.aux=null,this.useAsDefault=!1,this.path=e,this.redirectTo=r}return t=a([s.CONST(),i("design:paramtypes",[Object])],t)}();return e.Redirect=h,n.define=o,r.exports}),System.register("angular2/src/router/instruction",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/async"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=t("angular2/src/facade/collection"),s=t("angular2/src/facade/lang"),u=t("angular2/src/facade/async"),c=function(){function t(t){this.params=t}return t.prototype.get=function(t){return s.normalizeBlank(i.StringMapWrapper.get(this.params,t))},t}();e.RouteParams=c;var l=function(){function t(t){void 0===t&&(t=s.CONST_EXPR({})),this.data=t}return t.prototype.get=function(t){return s.normalizeBlank(i.StringMapWrapper.get(this.data,t))},t}();e.RouteData=l,e.BLANK_ROUTE_DATA=new l;var p=function(){function t(){this.auxInstruction={}}return Object.defineProperty(t.prototype,"urlPath",{get:function(){return this.component.urlPath},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"urlParams",{get:function(){return this.component.urlParams},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"specificity",{get:function(){var t=0;return s.isPresent(this.component)&&(t+=this.component.specificity),s.isPresent(this.child)&&(t+=this.child.specificity),t},enumerable:!0,configurable:!0}),t.prototype.toRootUrl=function(){return this.toUrlPath()+this.toUrlQuery()},t.prototype._toNonRootUrl=function(){return this._stringifyPathMatrixAuxPrefixed()+(s.isPresent(this.child)?this.child._toNonRootUrl():"")},t.prototype.toUrlQuery=function(){return this.urlParams.length>0?"?"+this.urlParams.join("&"):""},t.prototype.replaceChild=function(t){return new h(this.component,t,this.auxInstruction)},t.prototype.toUrlPath=function(){return this.urlPath+this._stringifyAux()+(s.isPresent(this.child)?this.child._toNonRootUrl():"")},t.prototype.toLinkUrl=function(){return this.urlPath+this._stringifyAux()+(s.isPresent(this.child)?this.child._toLinkUrl():"")},t.prototype._toLinkUrl=function(){return this._stringifyPathMatrixAuxPrefixed()+(s.isPresent(this.child)?this.child._toLinkUrl():"")},t.prototype._stringifyPathMatrixAuxPrefixed=function(){var t=this._stringifyPathMatrixAux();return t.length>0&&(t="/"+t),t},t.prototype._stringifyMatrixParams=function(){return this.urlParams.length>0?";"+this.component.urlParams.join(";"):""},t.prototype._stringifyPathMatrixAux=function(){return s.isBlank(this.component)?"":this.urlPath+this._stringifyMatrixParams()+this._stringifyAux()},t.prototype._stringifyAux=function(){var t=[];return i.StringMapWrapper.forEach(this.auxInstruction,function(e,r){t.push(e._stringifyPathMatrixAux())}),t.length>0?"("+t.join("//")+")":""},t}();e.Instruction=p;var h=function(t){function e(e,r,n){t.call(this),this.component=e,this.child=r,this.auxInstruction=n}return a(e,t),e.prototype.resolveComponent=function(){return u.PromiseWrapper.resolve(this.component)},e}(p);e.ResolvedInstruction=h;var f=function(t){function e(e,r){t.call(this),this.component=e,this.child=r}return a(e,t),e.prototype.resolveComponent=function(){return u.PromiseWrapper.resolve(this.component)},e.prototype.toLinkUrl=function(){return""},e.prototype._toLinkUrl=function(){return""},e}(p);e.DefaultInstruction=f;var g=function(t){function e(e,r,n){void 0===r&&(r=""),void 0===n&&(n=s.CONST_EXPR([])),t.call(this),this._resolver=e,this._urlPath=r,this._urlParams=n}return a(e,t),Object.defineProperty(e.prototype,"urlPath",{get:function(){return s.isPresent(this.component)?this.component.urlPath:s.isPresent(this._urlPath)?this._urlPath:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"urlParams",{get:function(){return s.isPresent(this.component)?this.component.urlParams:s.isPresent(this._urlParams)?this._urlParams:[]},enumerable:!0,configurable:!0}),e.prototype.resolveComponent=function(){var t=this;return s.isPresent(this.component)?u.PromiseWrapper.resolve(this.component):this._resolver().then(function(e){return t.child=e.child,t.component=e.component})},e}(p);e.UnresolvedInstruction=g;var m=function(t){function e(e,r,n){t.call(this,e,r,n)}return a(e,t),e}(h);e.RedirectInstruction=m;var d=function(){function t(t,r,n,o,a,i,u){void 0===u&&(u=null),this.urlPath=t,this.urlParams=r,this.componentType=o,this.terminal=a,this.specificity=i,this.params=u,this.reuse=!1,this.routeData=s.isPresent(n)?n:e.BLANK_ROUTE_DATA}return t}();return e.ComponentInstruction=d,n.define=o,r.exports}),System.register("angular2/src/router/url_parser",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/exceptions"],!0,function(t,e,r){function n(t){for(var e=new h(t[t.length-1]),r=t.length-2;r>=0;r-=1)e=new h(t[r],e);return e}function o(t){var e=l.RegExpWrapper.firstMatch(g,t);return l.isPresent(e)?e[0]:""}function a(t){var e=[];return l.isPresent(t)&&c.StringMapWrapper.forEach(t,function(t,r){1==t?e.push(r):e.push(r+"="+t)}),e}var i=System.global,s=i.define;i.define=void 0;var u=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},c=t("angular2/src/facade/collection"),l=t("angular2/src/facade/lang"),p=t("angular2/src/facade/exceptions"),h=function(){function t(t,e,r,n){void 0===e&&(e=null),void 0===r&&(r=l.CONST_EXPR([])),void 0===n&&(n=null),this.path=t,this.child=e,this.auxiliary=r,this.params=n}return t.prototype.toString=function(){return this.path+this._matrixParamsToString()+this._auxToString()+this._childString()},t.prototype.segmentToString=function(){return this.path+this._matrixParamsToString()},t.prototype._auxToString=function(){return this.auxiliary.length>0?"("+this.auxiliary.map(function(t){return t.toString()}).join("//")+")":""},t.prototype._matrixParamsToString=function(){return l.isBlank(this.params)?"":";"+a(this.params).join(";")},t.prototype._childString=function(){return l.isPresent(this.child)?"/"+this.child.toString():""},t}();e.Url=h;var f=function(t){function e(e,r,n,o){void 0===r&&(r=null),void 0===n&&(n=l.CONST_EXPR([])),void 0===o&&(o=null),t.call(this,e,r,n,o)}return u(e,t),e.prototype.toString=function(){return this.path+this._auxToString()+this._childString()+this._queryParamsToString()},e.prototype.segmentToString=function(){return this.path+this._queryParamsToString()},e.prototype._queryParamsToString=function(){return l.isBlank(this.params)?"":"?"+a(this.params).join("&")},e}(h);e.RootUrl=f,e.pathSegmentsToUrl=n;var g=l.RegExpWrapper.create("^[^\\/\\(\\)\\?;=&#]+"),m=function(){function t(){}return t.prototype.peekStartsWith=function(t){return this._remaining.startsWith(t)},t.prototype.capture=function(t){if(!this._remaining.startsWith(t))throw new p.BaseException('Expected "'+t+'".');this._remaining=this._remaining.substring(t.length)},t.prototype.parse=function(t){return this._remaining=t,""==t||"/"==t?new h(""):this.parseRoot()},t.prototype.parseRoot=function(){this.peekStartsWith("/")&&this.capture("/");var t=o(this._remaining);this.capture(t);var e=[];this.peekStartsWith("(")&&(e=this.parseAuxiliaryRoutes()),this.peekStartsWith(";")&&this.parseMatrixParams();var r=null;this.peekStartsWith("/")&&!this.peekStartsWith("//")&&(this.capture("/"),r=this.parseSegment());var n=null;return this.peekStartsWith("?")&&(n=this.parseQueryParams()),new f(t,r,e,n)},t.prototype.parseSegment=function(){if(0==this._remaining.length)return null;this.peekStartsWith("/")&&this.capture("/");var t=o(this._remaining);this.capture(t);var e=null;this.peekStartsWith(";")&&(e=this.parseMatrixParams());var r=[];this.peekStartsWith("(")&&(r=this.parseAuxiliaryRoutes());var n=null;return this.peekStartsWith("/")&&!this.peekStartsWith("//")&&(this.capture("/"),n=this.parseSegment()),new h(t,n,r,e)},t.prototype.parseQueryParams=function(){var t={};for(this.capture("?"),this.parseParam(t);this._remaining.length>0&&this.peekStartsWith("&");)this.capture("&"),this.parseParam(t);return t},t.prototype.parseMatrixParams=function(){for(var t={};this._remaining.length>0&&this.peekStartsWith(";");)this.capture(";"),this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=o(this._remaining);if(!l.isBlank(e)){this.capture(e);var r=!0;if(this.peekStartsWith("=")){this.capture("=");var n=o(this._remaining);l.isPresent(n)&&(r=n,this.capture(r))}t[e]=r}},t.prototype.parseAuxiliaryRoutes=function(){var t=[];for(this.capture("(");!this.peekStartsWith(")")&&this._remaining.length>0;)t.push(this.parseSegment()),this.peekStartsWith("//")&&this.capture("//");return this.capture(")"),t},t}();return e.UrlParser=m,e.parser=new m,e.serializeParams=a,i.define=s,r.exports}),System.register("angular2/src/router/async_route_handler",["angular2/src/facade/lang","angular2/src/router/instruction"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=t("angular2/src/facade/lang"),i=t("angular2/src/router/instruction"),s=function(){function t(t,e){void 0===e&&(e=null),this._loader=t,this._resolvedComponent=null,this.data=a.isPresent(e)?new i.RouteData(e):i.BLANK_ROUTE_DATA}return t.prototype.resolveComponentType=function(){var t=this;return a.isPresent(this._resolvedComponent)?this._resolvedComponent:this._resolvedComponent=this._loader().then(function(e){return t.componentType=e,e})},t}();return e.AsyncRouteHandler=s,n.define=o,r.exports}),System.register("angular2/src/router/sync_route_handler",["angular2/src/facade/async","angular2/src/facade/lang","angular2/src/router/instruction"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=t("angular2/src/facade/async"),i=t("angular2/src/facade/lang"),s=t("angular2/src/router/instruction"),u=function(){function t(t,e){this.componentType=t,this._resolvedComponent=null,this._resolvedComponent=a.PromiseWrapper.resolve(t),this.data=i.isPresent(e)?new s.RouteData(e):s.BLANK_ROUTE_DATA}return t.prototype.resolveComponentType=function(){return this._resolvedComponent},t}();return e.SyncRouteHandler=u,n.define=o,r.exports}),System.register("angular2/src/router/route_config_decorator",["angular2/src/router/route_config_impl","angular2/src/core/util/decorators","angular2/src/router/route_config_impl"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=t("angular2/src/router/route_config_impl"),i=t("angular2/src/core/util/decorators"),s=t("angular2/src/router/route_config_impl");return e.Route=s.Route,e.Redirect=s.Redirect,e.AuxRoute=s.AuxRoute,e.AsyncRoute=s.AsyncRoute,e.RouteConfig=i.makeDecorator(a.RouteConfig),n.define=o,r.exports}),System.register("angular2/src/router/location_strategy",["angular2/src/facade/lang","angular2/core"],!0,function(t,e,r){function n(t){return t.length>0&&"?"!=t.substring(0,1)?"?"+t:t}function o(t,e){if(0==t.length)return e;if(0==e.length)return t;var r=0;return t.endsWith("/")&&r++,e.startsWith("/")&&r++,2==r?t+e.substring(1):1==r?t+e:t+"/"+e}var a=System.global,i=a.define;a.define=void 0;var s=t("angular2/src/facade/lang"),u=t("angular2/core"),c=function(){function t(){}return t}();return e.LocationStrategy=c,e.APP_BASE_HREF=s.CONST_EXPR(new u.OpaqueToken("appBaseHref")),e.normalizeQueryParams=n,e.joinWithSlash=o,a.define=i,r.exports}),System.register("angular2/src/router/lifecycle_annotations_impl",["angular2/src/facade/lang"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},i=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},s=t("angular2/src/facade/lang"),u=function(){function t(t){this.name=t}return t=a([s.CONST(),i("design:paramtypes",[String])],t)}();e.RouteLifecycleHook=u;var c=function(){function t(t){this.fn=t}return t=a([s.CONST(),i("design:paramtypes",[Function])],t)}();return e.CanActivate=c,e.routerCanReuse=s.CONST_EXPR(new u("routerCanReuse")),e.routerCanDeactivate=s.CONST_EXPR(new u("routerCanDeactivate")),e.routerOnActivate=s.CONST_EXPR(new u("routerOnActivate")),e.routerOnReuse=s.CONST_EXPR(new u("routerOnReuse")),e.routerOnDeactivate=s.CONST_EXPR(new u("routerOnDeactivate")),n.define=o,r.exports}),System.register("angular2/src/router/lifecycle_annotations",["angular2/src/core/util/decorators","angular2/src/router/lifecycle_annotations_impl","angular2/src/router/lifecycle_annotations_impl"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=t("angular2/src/core/util/decorators"),i=t("angular2/src/router/lifecycle_annotations_impl"),s=t("angular2/src/router/lifecycle_annotations_impl");return e.routerCanReuse=s.routerCanReuse,e.routerCanDeactivate=s.routerCanDeactivate,e.routerOnActivate=s.routerOnActivate,e.routerOnReuse=s.routerOnReuse,e.routerOnDeactivate=s.routerOnDeactivate,e.CanActivate=a.makeDecorator(i.CanActivate),n.define=o,r.exports}),System.register("angular2/src/router/router_link",["angular2/core","angular2/src/facade/lang","angular2/src/router/router","angular2/src/router/location"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},i=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},s=t("angular2/core"),u=t("angular2/src/facade/lang"),c=t("angular2/src/router/router"),l=t("angular2/src/router/location"),p=function(){function t(t,e){this._router=t,this._location=e}return Object.defineProperty(t.prototype,"isRouteActive",{get:function(){return this._router.isRouteActive(this._navigationInstruction)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"routeParams",{set:function(t){this._routeParams=t,this._navigationInstruction=this._router.generate(this._routeParams);var e=this._navigationInstruction.toLinkUrl();this.visibleHref=this._location.prepareExternalUrl(e)},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){return u.isString(this.target)&&"_self"!=this.target?!0:(this._router.navigateByInstruction(this._navigationInstruction),!1)},t=a([s.Directive({selector:"[router-link]",inputs:["routeParams: routerLink","target: target"],host:{"(click)":"onClick()","[attr.href]":"visibleHref","[class.router-link-active]":"isRouteActive"}}),i("design:paramtypes",[c.Router,l.Location])],t)}();return e.RouterLink=p,n.define=o,r.exports}),System.register("angular2/src/router/hash_location_strategy",["angular2/core","angular2/src/router/location_strategy","angular2/src/facade/lang","angular2/src/router/platform_location"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},s=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},u=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},c=t("angular2/core"),l=t("angular2/src/router/location_strategy"),p=t("angular2/src/facade/lang"),h=t("angular2/src/router/platform_location"),f=function(t){function e(e,r){t.call(this),this._platformLocation=e,this._baseHref="",p.isPresent(r)&&(this._baseHref=r)}return a(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.path=function(){var t=this._platformLocation.hash;return(t.length>0?t.substring(1):t)+l.normalizeQueryParams(this._platformLocation.search)},e.prototype.prepareExternalUrl=function(t){var e=l.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},e.prototype.pushState=function(t,e,r,n){var o=this.prepareExternalUrl(r+l.normalizeQueryParams(n));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.pushState(t,e,o)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e=i([c.Injectable(),u(1,c.Optional()),u(1,c.Inject(l.APP_BASE_HREF)),s("design:paramtypes",[h.PlatformLocation,String])],e)}(l.LocationStrategy);return e.HashLocationStrategy=f,n.define=o,r.exports}),System.register("angular2/src/router/path_location_strategy",["angular2/core","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/router/location_strategy","angular2/src/router/platform_location"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},s=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},u=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},c=t("angular2/core"),l=t("angular2/src/facade/lang"),p=t("angular2/src/facade/exceptions"),h=t("angular2/src/router/location_strategy"),f=t("angular2/src/router/platform_location"),g=function(t){function e(e,r){if(t.call(this),this._platformLocation=e,l.isBlank(r)&&(r=this._platformLocation.getBaseHrefFromDOM()),l.isBlank(r))throw new p.BaseException("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=r}return a(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.prepareExternalUrl=function(t){return h.joinWithSlash(this._baseHref,t)},e.prototype.path=function(){return this._platformLocation.pathname+h.normalizeQueryParams(this._platformLocation.search)},e.prototype.pushState=function(t,e,r,n){var o=this.prepareExternalUrl(r+h.normalizeQueryParams(n));this._platformLocation.pushState(t,e,o)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e=i([c.Injectable(),u(1,c.Optional()),u(1,c.Inject(h.APP_BASE_HREF)),s("design:paramtypes",[f.PlatformLocation,String])],e)}(h.LocationStrategy);return e.PathLocationStrategy=g,n.define=o,r.exports}),System.register("angular2/src/router/route_definition",[],!0,function(t,e,r){var n=System.global,o=n.define;return n.define=void 0,n.define=o,r.exports}),System.register("angular2/src/router/path_recognizer",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/router/url_parser"],!0,function(t,e,r){function n(t){return l.isBlank(t)?null:t.toString()}function o(t){t.startsWith("/")&&(t=t.substring(1));var e=i(t),r=[],n=0;if(e.length>98)throw new p.BaseException("'"+t+"' has more than the maximum supported number of segments.");for(var o=e.length-1,a=0;o>=a;a++){var s,u=e[a];if(l.isPresent(s=l.RegExpWrapper.firstMatch(v,u)))r.push(new _(s[1])),n+=100-a;else if(l.isPresent(s=l.RegExpWrapper.firstMatch(R,u)))r.push(new y(s[1]));else if("..."==u){if(o>a)throw new p.BaseException('Unexpected "..." before the end of the path for "'+t+'".');r.push(new m)}else r.push(new d(u)),n+=100*(100-a)}var c=h.StringMapWrapper.create();return h.StringMapWrapper.set(c,"segments",r),h.StringMapWrapper.set(c,"specificity",n),c}function a(t){return t.map(function(t){return t instanceof y?"*":t instanceof m?"...":t instanceof _?":":t instanceof d?t.path:void 0}).join("/")}function i(t){return t.split("/")}function s(t){if(l.StringWrapper.contains(t,"#"))throw new p.BaseException('Path "'+t+'" should not include "#". Use "HashLocationStrategy" instead.');var e=l.RegExpWrapper.firstMatch(P,t);if(l.isPresent(e))throw new p.BaseException('Path "'+t+'" contains "'+e[0]+'" which is not allowed in a route config.')}var u=System.global,c=u.define;u.define=void 0;var l=t("angular2/src/facade/lang"),p=t("angular2/src/facade/exceptions"),h=t("angular2/src/facade/collection"),f=t("angular2/src/router/url_parser"),g=function(){function t(t){var e=this;this.map={},this.keys={},l.isPresent(t)&&h.StringMapWrapper.forEach(t,function(t,r){e.map[r]=l.isPresent(t)?t.toString():null,e.keys[r]=!0})}return t.prototype.get=function(t){return h.StringMapWrapper["delete"](this.keys,t),this.map[t]},t.prototype.getUnused=function(){var t=this,e={},r=h.StringMapWrapper.keys(this.keys);return r.forEach(function(r){return e[r]=h.StringMapWrapper.get(t.map,r)}),e},t}(),m=function(){function t(){this.name=""}return t.prototype.generate=function(t){return""},t.prototype.match=function(t){return!0},t}(),d=function(){function t(t){this.path=t,this.name=""}return t.prototype.match=function(t){return t==this.path},t.prototype.generate=function(t){return this.path},t}(),_=function(){function t(t){this.name=t}return t.prototype.match=function(t){return t.length>0},t.prototype.generate=function(t){if(!h.StringMapWrapper.contains(t.map,this.name))throw new p.BaseException("Route generator for '"+this.name+"' was not included in parameters passed.");return n(t.get(this.name))},t}(),y=function(){function t(t){this.name=t}return t.prototype.match=function(t){return!0},t.prototype.generate=function(t){return n(t.get(this.name))},t}(),v=/^:([^\/]+)$/g,R=/^\*([^\/]+)$/g,P=l.RegExpWrapper.create("//|\\(|\\)|;|\\?|="),S=function(){function t(t){this.path=t,this.terminal=!0,s(t);var e=o(t);this._segments=e.segments,this.specificity=e.specificity,this.hash=a(this._segments);var r=this._segments[this._segments.length-1];this.terminal=!(r instanceof m)}return t.prototype.recognize=function(t){for(var e,r=t,n={},o=[],a=0;a<this._segments.length;a+=1){var i=this._segments[a];if(e=r,i instanceof m)break;if(l.isPresent(e)){if(o.push(e.path),i instanceof y){n[i.name]=e.toString(),r=null;break}if(i instanceof _)n[i.name]=e.path;else if(!i.match(e.path))return null;r=e.child}else if(!i.match(""))return null}if(this.terminal&&l.isPresent(r))return null;var s,u,c,p=o.join("/");if(l.isPresent(e)){var g=t instanceof f.RootUrl?t:e;c=l.isPresent(g.params)?h.StringMapWrapper.merge(g.params,n):n,u=f.serializeParams(g.params),s=e.auxiliary}else c=n,s=[],u=[];return{urlPath:p,urlParams:u,allParams:c,auxiliary:s,nextSegment:r}},t.prototype.generate=function(t){for(var e=new g(t),r=[],n=0;n<this._segments.length;n++){var o=this._segments[n];o instanceof m||r.push(o.generate(e))}var a=r.join("/"),i=e.getUnused(),s=f.serializeParams(i);return{urlPath:a,urlParams:s}},t}();return e.PathRecognizer=S,u.define=c,r.exports}),System.register("angular2/src/router/component_recognizer",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/facade/async","angular2/src/router/route_recognizer","angular2/src/router/route_config_impl","angular2/src/router/async_route_handler","angular2/src/router/sync_route_handler"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=t("angular2/src/facade/lang"),i=t("angular2/src/facade/exceptions"),s=t("angular2/src/facade/collection"),u=t("angular2/src/facade/async"),c=t("angular2/src/router/route_recognizer"),l=t("angular2/src/router/route_config_impl"),p=t("angular2/src/router/async_route_handler"),h=t("angular2/src/router/sync_route_handler"),f=function(){function t(){this.names=new s.Map,this.auxNames=new s.Map,this.auxRoutes=new s.Map,this.matchers=[],this.defaultRoute=null}return t.prototype.config=function(t){var e;if(a.isPresent(t.name)&&t.name[0].toUpperCase()!=t.name[0]){var r=t.name[0].toUpperCase()+t.name.substring(1);throw new i.BaseException('Route "'+t.path+'" with name "'+t.name+'" does not begin with an uppercase letter. Route names should be CamelCase like "'+r+'".')}if(t instanceof l.AuxRoute){e=new h.SyncRouteHandler(t.component,t.data);var n=t.path.startsWith("/")?t.path.substring(1):t.path,o=new c.RouteRecognizer(t.path,e);return this.auxRoutes.set(n,o),a.isPresent(t.name)&&this.auxNames.set(t.name,o),o.terminal}var s=!1;if(t instanceof l.Redirect){var u=new c.RedirectRecognizer(t.path,t.redirectTo);return this._assertNoHashCollision(u.hash,t.path),this.matchers.push(u),!0}t instanceof l.Route?(e=new h.SyncRouteHandler(t.component,t.data),s=a.isPresent(t.useAsDefault)&&t.useAsDefault):t instanceof l.AsyncRoute&&(e=new p.AsyncRouteHandler(t.loader,t.data),s=a.isPresent(t.useAsDefault)&&t.useAsDefault);var o=new c.RouteRecognizer(t.path,e);if(this._assertNoHashCollision(o.hash,t.path),s){if(a.isPresent(this.defaultRoute))throw new i.BaseException("Only one route can be default");this.defaultRoute=o}return this.matchers.push(o),a.isPresent(t.name)&&this.names.set(t.name,o),o.terminal},t.prototype._assertNoHashCollision=function(t,e){this.matchers.forEach(function(r){if(t==r.hash)throw new i.BaseException("Configuration '"+e+"' conflicts with existing route '"+r.path+"'")})},t.prototype.recognize=function(t){var e=[];return this.matchers.forEach(function(r){var n=r.recognize(t);a.isPresent(n)&&e.push(n)}),e},t.prototype.recognizeAuxiliary=function(t){var e=this.auxRoutes.get(t.path);return a.isPresent(e)?[e.recognize(t)]:[u.PromiseWrapper.resolve(null)]},t.prototype.hasRoute=function(t){return this.names.has(t)},t.prototype.componentLoaded=function(t){return this.hasRoute(t)&&a.isPresent(this.names.get(t).handler.componentType)},t.prototype.loadComponent=function(t){return this.names.get(t).handler.resolveComponentType()},t.prototype.generate=function(t,e){var r=this.names.get(t);return a.isBlank(r)?null:r.generate(e)},t.prototype.generateAuxiliary=function(t,e){var r=this.auxNames.get(t);return a.isBlank(r)?null:r.generate(e)},t}();return e.ComponentRecognizer=f,n.define=o,r.exports}),System.register("angular2/src/router/route_config_nomalizer",["angular2/src/router/route_config_decorator","angular2/src/facade/lang","angular2/src/facade/exceptions"],!0,function(t,e,r){function n(t,e){if(t instanceof u.AsyncRoute){var r=o(t.loader,e);return new u.AsyncRoute({path:t.path,loader:r,name:t.name,data:t.data,useAsDefault:t.useAsDefault})}if(t instanceof u.Route||t instanceof u.Redirect||t instanceof u.AuxRoute)return t;if(+!!t.component+ +!!t.redirectTo+ +!!t.loader!=1)throw new l.BaseException('Route config should contain exactly one "component", "loader", or "redirectTo" property.');if(t.as&&t.name)throw new l.BaseException('Route config should contain exactly one "as" or "name" property.');if(t.as&&(t.name=t.as),t.loader){var r=o(t.loader,e);return new u.AsyncRoute({path:t.path,loader:r,name:t.name,useAsDefault:t.useAsDefault})}if(t.aux)return new u.AuxRoute({path:t.aux,component:t.component,name:t.name});if(t.component){if("object"==typeof t.component){var n=t.component;if("constructor"==n.type)return new u.Route({path:t.path,component:n.constructor,name:t.name,data:t.data,useAsDefault:t.useAsDefault});if("loader"==n.type)return new u.AsyncRoute({path:t.path,loader:n.loader,name:t.name,useAsDefault:t.useAsDefault});throw new l.BaseException('Invalid component type "'+n.type+'". Valid types are "constructor" and "loader".')}return new u.Route(t)}return t.redirectTo?new u.Redirect({path:t.path,redirectTo:t.redirectTo}):t}function o(t,e){return function(){return t().then(function(t){return e.configFromComponent(t),t})}}function a(t,e){if(!c.isType(t))throw new l.BaseException('Component for route "'+e+'" is not defined, or is not a class.')}var i=System.global,s=i.define;i.define=void 0;var u=t("angular2/src/router/route_config_decorator"),c=t("angular2/src/facade/lang"),l=t("angular2/src/facade/exceptions");return e.normalizeRouteConfig=n,e.assertComponentExists=a,i.define=s,r.exports}),System.register("angular2/src/router/location",["angular2/src/router/location_strategy","angular2/src/facade/async","angular2/core"],!0,function(t,e,r){function n(t,e){return t.length>0&&e.startsWith(t)?e.substring(t.length):e}function o(t){return/\/index.html$/g.test(t)?t.substring(0,t.length-11):t}function a(t){return/\/$/g.test(t)&&(t=t.substring(0,t.length-1)),t}var i=System.global,s=i.define;i.define=void 0;var u=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},c=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},l=t("angular2/src/router/location_strategy"),p=t("angular2/src/facade/async"),h=t("angular2/core"),f=function(){function t(t){var e=this;this.platformStrategy=t, this._subject=new p.EventEmitter;var r=this.platformStrategy.getBaseHref();this._baseHref=a(o(r)),this.platformStrategy.onPopState(function(t){p.ObservableWrapper.callEmit(e._subject,{url:e.path(),pop:!0})})}return t.prototype.path=function(){return this.normalize(this.platformStrategy.path())},t.prototype.normalize=function(t){return a(n(this._baseHref,o(t)))},t.prototype.prepareExternalUrl=function(t){return t.length>0&&!t.startsWith("/")&&(t="/"+t),this.platformStrategy.prepareExternalUrl(t)},t.prototype.go=function(t,e){void 0===e&&(e=""),this.platformStrategy.pushState(null,"",t,e)},t.prototype.forward=function(){this.platformStrategy.forward()},t.prototype.back=function(){this.platformStrategy.back()},t.prototype.subscribe=function(t,e,r){return void 0===e&&(e=null),void 0===r&&(r=null),p.ObservableWrapper.subscribe(this._subject,t,e,r)},t=u([h.Injectable(),c("design:paramtypes",[l.LocationStrategy])],t)}();return e.Location=f,i.define=s,r.exports}),System.register("angular2/src/router/route_lifecycle_reflector",["angular2/src/facade/lang","angular2/src/router/lifecycle_annotations_impl","angular2/src/core/reflection/reflection"],!0,function(t,e,r){function n(t,e){return e instanceof s.Type?t.name in e.prototype:!1}function o(t){for(var e=c.reflector.annotations(t),r=0;r<e.length;r+=1){var n=e[r];if(n instanceof u.CanActivate)return n.fn}return null}var a=System.global,i=a.define;a.define=void 0;var s=t("angular2/src/facade/lang"),u=t("angular2/src/router/lifecycle_annotations_impl"),c=t("angular2/src/core/reflection/reflection");return e.hasLifecycleHook=n,e.getCanActivateHook=o,a.define=i,r.exports}),System.register("angular2/src/router/router_outlet",["angular2/src/facade/async","angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/core","angular2/src/router/router","angular2/src/router/instruction","angular2/src/router/lifecycle_annotations","angular2/src/router/route_lifecycle_reflector"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},i=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},s=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},u=t("angular2/src/facade/async"),c=t("angular2/src/facade/collection"),l=t("angular2/src/facade/lang"),p=t("angular2/src/facade/exceptions"),h=t("angular2/core"),f=t("angular2/src/router/router"),g=t("angular2/src/router/instruction"),m=t("angular2/src/router/lifecycle_annotations"),d=t("angular2/src/router/route_lifecycle_reflector"),_=u.PromiseWrapper.resolve(!0),y=function(){function t(t,e,r,n){this._elementRef=t,this._loader=e,this._parentRouter=r,this.name=null,this._componentRef=null,this._currentInstruction=null,l.isPresent(n)?(this.name=n,this._parentRouter.registerAuxOutlet(this)):this._parentRouter.registerPrimaryOutlet(this)}return t.prototype.activate=function(t){var e=this,r=this._currentInstruction;this._currentInstruction=t;var n=t.componentType,o=this._parentRouter.childRouter(n),a=h.Injector.resolve([h.provide(g.RouteData,{useValue:t.routeData}),h.provide(g.RouteParams,{useValue:new g.RouteParams(t.params)}),h.provide(f.Router,{useValue:o})]);return this._loader.loadNextToLocation(n,this._elementRef,a).then(function(o){return e._componentRef=o,d.hasLifecycleHook(m.routerOnActivate,n)?e._componentRef.instance.routerOnActivate(t,r):void 0})},t.prototype.reuse=function(t){var e=this._currentInstruction;if(this._currentInstruction=t,l.isBlank(this._componentRef))throw new p.BaseException("Cannot reuse an outlet that does not contain a component.");return u.PromiseWrapper.resolve(d.hasLifecycleHook(m.routerOnReuse,this._currentInstruction.componentType)?this._componentRef.instance.routerOnReuse(t,e):!0)},t.prototype.deactivate=function(t){var e=this,r=_;return l.isPresent(this._componentRef)&&l.isPresent(this._currentInstruction)&&d.hasLifecycleHook(m.routerOnDeactivate,this._currentInstruction.componentType)&&(r=u.PromiseWrapper.resolve(this._componentRef.instance.routerOnDeactivate(t,this._currentInstruction))),r.then(function(t){l.isPresent(e._componentRef)&&(e._componentRef.dispose(),e._componentRef=null)})},t.prototype.routerCanDeactivate=function(t){return l.isBlank(this._currentInstruction)?_:d.hasLifecycleHook(m.routerCanDeactivate,this._currentInstruction.componentType)?u.PromiseWrapper.resolve(this._componentRef.instance.routerCanDeactivate(t,this._currentInstruction)):_},t.prototype.routerCanReuse=function(t){var e;return e=l.isBlank(this._currentInstruction)||this._currentInstruction.componentType!=t.componentType?!1:d.hasLifecycleHook(m.routerCanReuse,this._currentInstruction.componentType)?this._componentRef.instance.routerCanReuse(t,this._currentInstruction):t==this._currentInstruction||l.isPresent(t.params)&&l.isPresent(this._currentInstruction.params)&&c.StringMapWrapper.equals(t.params,this._currentInstruction.params),u.PromiseWrapper.resolve(e)},t=a([h.Directive({selector:"router-outlet"}),s(3,h.Attribute("name")),i("design:paramtypes",[h.ElementRef,h.DynamicComponentLoader,f.Router,String])],t)}();return e.RouterOutlet=y,n.define=o,r.exports}),System.register("angular2/src/router/platform_location",["angular2/src/platform/dom/dom_adapter","angular2/core"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},i=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},s=t("angular2/src/platform/dom/dom_adapter"),u=t("angular2/core"),c=function(){function t(){this._init()}return t.prototype._init=function(){this._location=s.DOM.getLocation(),this._history=s.DOM.getHistory()},t.prototype.getBaseHrefFromDOM=function(){return s.DOM.getBaseHref()},t.prototype.onPopState=function(t){s.DOM.getGlobalEventTarget("window").addEventListener("popstate",t,!1)},t.prototype.onHashChange=function(t){s.DOM.getGlobalEventTarget("window").addEventListener("hashchange",t,!1)},Object.defineProperty(t.prototype,"pathname",{get:function(){return this._location.pathname},set:function(t){this._location.pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"search",{get:function(){return this._location.search},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hash",{get:function(){return this._location.hash},enumerable:!0,configurable:!0}),t.prototype.pushState=function(t,e,r){this._history.pushState(t,e,r)},t.prototype.forward=function(){this._history.forward()},t.prototype.back=function(){this._history.back()},t=a([u.Injectable(),i("design:paramtypes",[])],t)}();return e.PlatformLocation=c,n.define=o,r.exports}),System.register("angular2/src/router/route_recognizer",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/promise","angular2/src/facade/collection","angular2/src/router/instruction","angular2/src/router/path_recognizer"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=t("angular2/src/facade/lang"),s=t("angular2/src/facade/exceptions"),u=t("angular2/src/facade/promise"),c=t("angular2/src/facade/collection"),l=t("angular2/src/router/instruction"),p=t("angular2/src/router/path_recognizer"),h=function(){function t(){}return t}();e.RouteMatch=h;var f=function(t){function e(e,r,n){t.call(this),this.instruction=e,this.remaining=r,this.remainingAux=n}return a(e,t),e}(h);e.PathMatch=f;var g=function(t){function e(e,r){t.call(this),this.redirectTo=e,this.specificity=r}return a(e,t),e}(h);e.RedirectMatch=g;var m=function(){function t(t,e){this.path=t,this.redirectTo=e,this._pathRecognizer=new p.PathRecognizer(t),this.hash=this._pathRecognizer.hash}return t.prototype.recognize=function(t){var e=null;return i.isPresent(this._pathRecognizer.recognize(t))&&(e=new g(this.redirectTo,this._pathRecognizer.specificity)),u.PromiseWrapper.resolve(e)},t.prototype.generate=function(t){throw new s.BaseException("Tried to generate a redirect.")},t}();e.RedirectRecognizer=m;var d=function(){function t(t,e){this.path=t,this.handler=e,this.terminal=!0,this._cache=new c.Map,this._pathRecognizer=new p.PathRecognizer(t),this.specificity=this._pathRecognizer.specificity,this.hash=this._pathRecognizer.hash,this.terminal=this._pathRecognizer.terminal}return t.prototype.recognize=function(t){var e=this,r=this._pathRecognizer.recognize(t);return i.isBlank(r)?null:this.handler.resolveComponentType().then(function(t){var n=e._getInstruction(r.urlPath,r.urlParams,r.allParams);return new f(n,r.nextSegment,r.auxiliary)})},t.prototype.generate=function(t){var e=this._pathRecognizer.generate(t),r=e.urlPath,n=e.urlParams;return this._getInstruction(r,n,t)},t.prototype.generateComponentPathValues=function(t){return this._pathRecognizer.generate(t)},t.prototype._getInstruction=function(t,e,r){if(i.isBlank(this.handler.componentType))throw new s.BaseException("Tried to get instruction before the type was loaded.");var n=t+"?"+e.join("?");if(this._cache.has(n))return this._cache.get(n);var o=new l.ComponentInstruction(t,e,this.handler.data,this.handler.componentType,this.terminal,this.specificity,r);return this._cache.set(n,o),o},t}();return e.RouteRecognizer=d,n.define=o,r.exports}),System.register("angular2/src/router/route_registry",["angular2/src/facade/collection","angular2/src/facade/async","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/reflection/reflection","angular2/core","angular2/src/router/route_config_impl","angular2/src/router/route_recognizer","angular2/src/router/component_recognizer","angular2/src/router/instruction","angular2/src/router/route_config_nomalizer","angular2/src/router/url_parser"],!0,function(t,e,r){function n(t){return t.reduce(function(t,e){if(f.isString(e)){var r=e;return t.concat(r.split("/"))}return t.push(e),t},[])}function o(t){return p.ListWrapper.maximum(t,function(t){return t.specificity})}function a(t,e){if(f.isType(t)){var r=m.reflector.annotations(t);if(f.isPresent(r))for(var n=0;n<r.length;n++){var o=r[n];if(o instanceof _.RouteConfig)throw new g.BaseException('Child routes are not allowed for "'+e+'". Use "..." on the parent\'s route path.')}}}var i=System.global,s=i.define;i.define=void 0;var u=this&&this.__decorate||function(t,e,r,n){if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)return Reflect.decorate(t,e,r,n);switch(arguments.length){case 2:return t.reduceRight(function(t,e){return e&&e(t)||t},e);case 3:return t.reduceRight(function(t,n){return void(n&&n(e,r))},void 0);case 4:return t.reduceRight(function(t,n){return n&&n(e,r,t)||t},n)}},c=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},l=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},p=t("angular2/src/facade/collection"),h=t("angular2/src/facade/async"),f=t("angular2/src/facade/lang"),g=t("angular2/src/facade/exceptions"),m=t("angular2/src/core/reflection/reflection"),d=t("angular2/core"),_=t("angular2/src/router/route_config_impl"),y=t("angular2/src/router/route_recognizer"),v=t("angular2/src/router/component_recognizer"),R=t("angular2/src/router/instruction"),P=t("angular2/src/router/route_config_nomalizer"),S=t("angular2/src/router/url_parser"),x=h.PromiseWrapper.resolve(null);e.ROUTER_PRIMARY_COMPONENT=f.CONST_EXPR(new d.OpaqueToken("RouterPrimaryComponent"));var b=function(){function t(t){this._rootComponent=t,this._rules=new p.Map}return t.prototype.config=function(t,e){e=P.normalizeRouteConfig(e,this),e instanceof _.Route?P.assertComponentExists(e.component,e.path):e instanceof _.AuxRoute&&P.assertComponentExists(e.component,e.path);var r=this._rules.get(t);f.isBlank(r)&&(r=new v.ComponentRecognizer,this._rules.set(t,r));var n=r.config(e);e instanceof _.Route&&(n?a(e.component,e.path):this.configFromComponent(e.component))},t.prototype.configFromComponent=function(t){var e=this;if(f.isType(t)&&!this._rules.has(t)){var r=m.reflector.annotations(t);if(f.isPresent(r))for(var n=0;n<r.length;n++){var o=r[n];if(o instanceof _.RouteConfig){var a=o.configs;a.forEach(function(r){return e.config(t,r)})}}}},t.prototype.recognize=function(t,e){var r=S.parser.parse(t);return this._recognize(r,e)},t.prototype._recognize=function(t,e,r){var n=this;void 0===r&&(r=!1);var a=e.length>0?e[e.length-1].component.componentType:this._rootComponent,i=this._rules.get(a);if(f.isBlank(i))return x;var s=r?i.recognizeAuxiliary(t):i.recognize(t),u=s.map(function(t){return t.then(function(t){if(t instanceof y.PathMatch){var r=e.length>0?[e[e.length-1]]:[],o=n._auxRoutesToUnresolved(t.remainingAux,r),a=new R.ResolvedInstruction(t.instruction,null,o);if(t.instruction.terminal)return a;var i=e.concat([a]);return n._recognize(t.remaining,i).then(function(t){return f.isBlank(t)?null:t instanceof R.RedirectInstruction?t:(a.child=t,a)})}if(t instanceof y.RedirectMatch){var a=n.generate(t.redirectTo,e);return new R.RedirectInstruction(a.component,a.child,a.auxInstruction)}})});return!f.isBlank(t)&&""!=t.path||0!=s.length?h.PromiseWrapper.all(u).then(o):h.PromiseWrapper.resolve(this.generateDefault(a))},t.prototype._auxRoutesToUnresolved=function(t,e){var r=this,n={};return t.forEach(function(t){n[t.path]=new R.UnresolvedInstruction(function(){return r._recognize(t,e,!0)})}),n},t.prototype.generate=function(t,e,r){void 0===r&&(r=!1);var o=n(t),a=p.ListWrapper.first(o),i=p.ListWrapper.slice(o,1);if(""==a)e=[];else if(".."==a){for(e.pop();".."==p.ListWrapper.first(i);)if(i=p.ListWrapper.slice(i,1),e.pop(),e.length<=0)throw new g.BaseException('Link "'+p.ListWrapper.toJSON(t)+'" has too many "../" segments.')}else if("."!=a){var s=this._rootComponent,u=null;e.length>1?(s=e[e.length-1].component.componentType,u=e[e.length-2].component.componentType):1==e.length&&(s=e[0].component.componentType,u=this._rootComponent);var c=this.hasRoute(a,s),l=f.isPresent(u)&&this.hasRoute(a,u);if(l&&c){var h='Link "'+p.ListWrapper.toJSON(t)+'" is ambiguous, use "./" or "../" to disambiguate.';throw new g.BaseException(h)}l&&e.pop(),i=t}if(""==i[i.length-1]&&i.pop(),i.length<1){var h='Link "'+p.ListWrapper.toJSON(t)+'" must include a route name.';throw new g.BaseException(h)}for(var m=this._generate(i,e,r),d=e.length-1;d>=0;d--){var _=e[d];m=_.replaceChild(m)}return m},t.prototype._generate=function(t,e,r){var n=this;void 0===r&&(r=!1);var o=e.length>0?e[e.length-1].component.componentType:this._rootComponent;if(0==t.length)return this.generateDefault(o);var a=0,i=t[a];if(!f.isString(i))throw new g.BaseException('Unexpected segment "'+i+'" in link DSL. Expected a string.');if(""==i||"."==i||".."==i)throw new g.BaseException('"'+i+'/" is only allowed at the beginning of a link DSL.');var s={};if(a+1<t.length){var u=t[a+1];f.isStringMap(u)&&!f.isArray(u)&&(s=u,a+=1)}for(var c,l={};a+1<t.length&&f.isArray(c=t[a+1]);){var h=e.length>0?[e[e.length-1]]:[],m=this._generate(c,h,!0);l[m.component.urlPath]=m,a+=1}var d=this._rules.get(o);if(f.isBlank(d))throw new g.BaseException('Component "'+f.getTypeNameForDebugging(o)+'" has no route config.');var _=(r?d.auxNames:d.names).get(i);if(!f.isPresent(_))throw new g.BaseException('Component "'+f.getTypeNameForDebugging(o)+'" has no route named "'+i+'".');if(!f.isPresent(_.handler.componentType)){var y=_.generateComponentPathValues(s);return new R.UnresolvedInstruction(function(){return _.handler.resolveComponentType().then(function(o){return n._generate(t,e,r)})},y.urlPath,y.urlParams)}var v=r?d.generateAuxiliary(i,s):d.generate(i,s),P=t.slice(a+1),S=new R.ResolvedInstruction(v,null,l);if(f.isPresent(v.componentType)){var x=null;if(a+1<t.length){var b=e.concat([S]);x=this._generate(P,b)}else if(!v.terminal&&(x=this.generateDefault(v.componentType),f.isBlank(x)))throw new g.BaseException('Link "'+p.ListWrapper.toJSON(t)+'" does not resolve to a terminal instruction.');S.child=x}return S},t.prototype.hasRoute=function(t,e){var r=this._rules.get(e);return f.isBlank(r)?!1:r.hasRoute(t)},t.prototype.generateDefault=function(t){var e=this;if(f.isBlank(t))return null;var r=this._rules.get(t);if(f.isBlank(r)||f.isBlank(r.defaultRoute))return null;var n=null;if(f.isPresent(r.defaultRoute.handler.componentType)){var o=r.defaultRoute.generate({});return r.defaultRoute.terminal||(n=this.generateDefault(r.defaultRoute.handler.componentType)),new R.DefaultInstruction(o,n)}return new R.UnresolvedInstruction(function(){return r.defaultRoute.handler.resolveComponentType().then(function(r){return e.generateDefault(t)})})},t=u([d.Injectable(),l(0,d.Inject(e.ROUTER_PRIMARY_COMPONENT)),c("design:paramtypes",[f.Type])],t)}();return e.RouteRegistry=b,i.define=s,r.exports}),System.register("angular2/src/router/router",["angular2/src/facade/async","angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/core","angular2/src/router/route_registry","angular2/src/router/location","angular2/src/router/route_lifecycle_reflector"],!0,function(t,e,r){function n(t,e){var r=y;return h.isPresent(t.child)&&