@angular/router 0.1.0 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/router.umd.js +1812 -0
- package/bundles/router.umd.min.js +2 -0
- package/esm/index.d.ts +15 -0
- package/esm/index.js +15 -0
- package/esm/index.js.map +1 -0
- package/esm/src/constants.d.ts +5 -0
- package/esm/src/constants.js +6 -0
- package/esm/src/constants.js.map +1 -0
- package/esm/src/constants.metadata.json +1 -0
- package/esm/src/core_private.d.ts +3 -0
- package/esm/src/core_private.js +4 -0
- package/esm/src/core_private.js.map +1 -0
- package/esm/src/core_private.metadata.json +1 -0
- package/esm/src/directives/router_directives.d.ts +21 -0
- package/esm/src/directives/router_directives.js +24 -0
- package/esm/src/directives/router_directives.js.map +1 -0
- package/esm/src/directives/router_directives.metadata.json +1 -0
- package/esm/src/directives/router_link.d.ts +49 -0
- package/esm/src/directives/router_link.js +68 -0
- package/esm/src/directives/router_link.js.map +1 -0
- package/esm/src/directives/router_link.metadata.json +1 -0
- package/esm/src/directives/router_outlet.d.ts +36 -0
- package/esm/src/directives/router_outlet.js +42 -0
- package/esm/src/directives/router_outlet.js.map +1 -0
- package/esm/src/directives/router_outlet.metadata.json +1 -0
- package/esm/src/facade/async.d.ts +90 -0
- package/esm/src/facade/async.js +137 -0
- package/esm/src/facade/async.js.map +1 -0
- package/esm/src/facade/base_wrapped_exception.d.ts +14 -0
- package/esm/src/facade/base_wrapped_exception.js +17 -0
- package/esm/src/facade/base_wrapped_exception.js.map +1 -0
- package/esm/src/facade/collection.d.ts +103 -0
- package/esm/src/facade/collection.js +343 -0
- package/esm/src/facade/collection.js.map +1 -0
- package/esm/src/facade/collection.metadata.json +1 -0
- package/esm/src/facade/exception_handler.d.ts +29 -0
- package/esm/src/facade/exception_handler.js +124 -0
- package/esm/src/facade/exception_handler.js.map +1 -0
- package/esm/src/facade/exceptions.d.ts +32 -0
- package/esm/src/facade/exceptions.js +42 -0
- package/esm/src/facade/exceptions.js.map +1 -0
- package/esm/src/facade/exceptions.metadata.json +1 -0
- package/esm/src/facade/lang.d.ts +158 -0
- package/esm/src/facade/lang.js +386 -0
- package/esm/src/facade/lang.js.map +1 -0
- package/esm/src/facade/lang.metadata.json +1 -0
- package/esm/src/facade/promise.d.ts +17 -0
- package/esm/src/facade/promise.js +41 -0
- package/esm/src/facade/promise.js.map +1 -0
- package/esm/src/interfaces.d.ts +23 -0
- package/esm/src/interfaces.js +1 -0
- package/esm/src/interfaces.js.map +1 -0
- package/esm/src/lifecycle_reflector.d.ts +1 -0
- package/esm/src/lifecycle_reflector.js +10 -0
- package/esm/src/lifecycle_reflector.js.map +1 -0
- package/esm/src/link.d.ts +2 -0
- package/esm/src/link.js +183 -0
- package/esm/src/link.js.map +1 -0
- package/esm/src/metadata/decorators.d.ts +16 -0
- package/esm/src/metadata/decorators.js +9 -0
- package/esm/src/metadata/decorators.js.map +1 -0
- package/esm/src/metadata/decorators.metadata.json +1 -0
- package/esm/src/metadata/metadata.d.ts +48 -0
- package/esm/src/metadata/metadata.js +48 -0
- package/esm/src/metadata/metadata.js.map +1 -0
- package/esm/src/recognize.d.ts +4 -0
- package/esm/src/recognize.js +164 -0
- package/esm/src/recognize.js.map +1 -0
- package/esm/src/router.d.ts +95 -0
- package/esm/src/router.js +243 -0
- package/esm/src/router.js.map +1 -0
- package/esm/src/router_providers.d.ts +23 -0
- package/esm/src/router_providers.js +26 -0
- package/esm/src/router_providers.js.map +1 -0
- package/esm/src/router_providers.metadata.json +1 -0
- package/esm/src/router_providers_common.d.ts +11 -0
- package/esm/src/router_providers_common.js +32 -0
- package/esm/src/router_providers_common.js.map +1 -0
- package/esm/src/router_providers_common.metadata.json +1 -0
- package/esm/src/router_url_serializer.d.ts +21 -0
- package/esm/src/router_url_serializer.js +164 -0
- package/esm/src/router_url_serializer.js.map +1 -0
- package/esm/src/segments.d.ts +51 -0
- package/esm/src/segments.js +137 -0
- package/esm/src/segments.js.map +1 -0
- package/esm/src/segments.metadata.json +1 -0
- package/esm/testing/router_testing_providers.d.ts +1 -0
- package/esm/testing/router_testing_providers.js +31 -0
- package/esm/testing/router_testing_providers.js.map +1 -0
- package/esm/testing/router_testing_providers.metadata.json +1 -0
- package/esm/testing.d.ts +1 -0
- package/esm/testing.js +2 -0
- package/esm/testing.js.map +1 -0
- package/index.d.ts +15 -0
- package/index.js +31 -0
- package/index.js.map +1 -0
- package/package.json +16 -1
- package/src/constants.d.ts +5 -0
- package/src/constants.js +7 -0
- package/src/constants.js.map +1 -0
- package/src/constants.metadata.json +1 -0
- package/src/core_private.d.ts +3 -0
- package/src/core_private.js +5 -0
- package/src/core_private.js.map +1 -0
- package/src/core_private.metadata.json +1 -0
- package/src/directives/router_directives.d.ts +21 -0
- package/src/directives/router_directives.js +25 -0
- package/src/directives/router_directives.js.map +1 -0
- package/src/directives/router_directives.metadata.json +1 -0
- package/src/directives/router_link.d.ts +49 -0
- package/src/directives/router_link.js +76 -0
- package/src/directives/router_link.js.map +1 -0
- package/src/directives/router_link.metadata.json +1 -0
- package/src/directives/router_outlet.d.ts +36 -0
- package/src/directives/router_outlet.js +53 -0
- package/src/directives/router_outlet.js.map +1 -0
- package/src/directives/router_outlet.metadata.json +1 -0
- package/src/facade/async.d.ts +90 -0
- package/src/facade/async.js +160 -0
- package/src/facade/async.js.map +1 -0
- package/src/facade/base_wrapped_exception.d.ts +14 -0
- package/src/facade/base_wrapped_exception.js +50 -0
- package/src/facade/base_wrapped_exception.js.map +1 -0
- package/src/facade/collection.d.ts +103 -0
- package/src/facade/collection.js +368 -0
- package/src/facade/collection.js.map +1 -0
- package/src/facade/collection.metadata.json +1 -0
- package/src/facade/exception_handler.d.ts +29 -0
- package/src/facade/exception_handler.js +133 -0
- package/src/facade/exception_handler.js.map +1 -0
- package/src/facade/exceptions.d.ts +32 -0
- package/src/facade/exceptions.js +82 -0
- package/src/facade/exceptions.js.map +1 -0
- package/src/facade/exceptions.metadata.json +1 -0
- package/src/facade/lang.d.ts +158 -0
- package/src/facade/lang.js +480 -0
- package/src/facade/lang.js.map +1 -0
- package/src/facade/lang.metadata.json +1 -0
- package/src/facade/promise.d.ts +17 -0
- package/src/facade/promise.js +49 -0
- package/src/facade/promise.js.map +1 -0
- package/src/interfaces.d.ts +23 -0
- package/src/interfaces.js +2 -0
- package/src/interfaces.js.map +1 -0
- package/src/lifecycle_reflector.d.ts +1 -0
- package/src/lifecycle_reflector.js +12 -0
- package/src/lifecycle_reflector.js.map +1 -0
- package/src/link.d.ts +2 -0
- package/src/link.js +189 -0
- package/src/link.js.map +1 -0
- package/src/metadata/decorators.d.ts +16 -0
- package/src/metadata/decorators.js +10 -0
- package/src/metadata/decorators.js.map +1 -0
- package/src/metadata/decorators.metadata.json +1 -0
- package/src/metadata/metadata.d.ts +48 -0
- package/src/metadata/metadata.js +66 -0
- package/src/metadata/metadata.js.map +1 -0
- package/src/recognize.d.ts +4 -0
- package/src/recognize.js +172 -0
- package/src/recognize.js.map +1 -0
- package/src/router.d.ts +95 -0
- package/src/router.js +276 -0
- package/src/router.js.map +1 -0
- package/src/router_providers.d.ts +23 -0
- package/src/router_providers.js +27 -0
- package/src/router_providers.js.map +1 -0
- package/src/router_providers.metadata.json +1 -0
- package/src/router_providers_common.d.ts +11 -0
- package/src/router_providers_common.js +35 -0
- package/src/router_providers_common.js.map +1 -0
- package/src/router_providers_common.metadata.json +1 -0
- package/src/router_url_serializer.d.ts +21 -0
- package/src/router_url_serializer.js +184 -0
- package/src/router_url_serializer.js.map +1 -0
- package/src/segments.d.ts +51 -0
- package/src/segments.js +181 -0
- package/src/segments.js.map +1 -0
- package/src/segments.metadata.json +1 -0
- package/testing/router_testing_providers.d.ts +1 -0
- package/testing/router_testing_providers.js +35 -0
- package/testing/router_testing_providers.js.map +1 -0
- package/testing/router_testing_providers.metadata.json +1 -0
- package/testing.d.ts +1 -0
- package/testing.js +6 -0
- package/testing.js.map +1 -0
- package/angular1/angular_1_router.js +0 -2922
- package/angular1/ng_route_shim.js +0 -349
- package/angular2/router.dev.js +0 -3107
- package/angular2/router.js +0 -3107
- package/angular2/router.min.js +0 -3
package/angular2/router.min.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"format register";System.register("angular2/src/router/router_link_transform",["angular2/compiler","angular2/src/core/change_detection/parser/ast","angular2/src/facade/exceptions","angular2/core","angular2/src/core/change_detection/parser/parser"],!0,function(t,e,r){function n(t,e){var r=new y(t,e.trim()).tokenize();return new v(r).generate()}var o=System.global,a=o.define;o.define=void 0;var i=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)},s=this&&this.__decorate||function(t,e,r,n){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},u=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},c=t("angular2/compiler"),l=t("angular2/src/core/change_detection/parser/ast"),p=t("angular2/src/facade/exceptions"),f=t("angular2/core"),h=t("angular2/src/core/change_detection/parser/parser"),g=function(){function t(t){this.value=t}return t}(),m=function(){function t(){}return t}(),d=function(){function t(){}return t}(),_=function(){function t(t){this.ast=t}return t}(),y=function(){function t(t,e){this.parser=t,this.exp=e,this.index=0}return t.prototype.tokenize=function(){for(var t=[];this.index<this.exp.length;)t.push(this._parseToken());return t},t.prototype._parseToken=function(){var t=this.exp[this.index];return"["==t?(this.index++,new m):"]"==t?(this.index++,new d):"("==t?this._parseParams():"/"==t&&0!==this.index?(this.index++,this._parseFixedPart()):this._parseFixedPart()},t.prototype._parseParams=function(){for(var t=this.index;this.index<this.exp.length;++this.index){var e=this.exp[this.index];if(")"==e){var r=this.exp.substring(t+1,this.index);return this.index++,new _(this.parser.parseBinding("{"+r+"}",null).ast)}}throw new p.BaseException("Cannot find ')'")},t.prototype._parseFixedPart=function(){for(var t=this.index,e=!1;this.index<this.exp.length;++this.index){var r=this.exp[this.index];if("("==r||"["==r||"]"==r||"/"==r&&e)break;"."!=r&&"/"!=r&&(e=!0)}var n=this.exp.substring(t,this.index);if(t===this.index||!e||n.startsWith("//"))throw new p.BaseException("Invalid router link");return new g(n)},t}(),v=function(){function t(t){this.tokens=t,this.index=0}return t.prototype.generate=function(){return this._genAuxiliary()},t.prototype._genAuxiliary=function(){for(var t=[];this.index<this.tokens.length;this.index++){var e=this.tokens[this.index];if(e instanceof g)t.push(new l.LiteralPrimitive(e.value));else if(e instanceof _)t.push(e.ast);else{if(e instanceof d)break;e instanceof m&&(this.index++,t.push(this._genAuxiliary()))}}return new l.LiteralArray(t)},t}(),R=function(t){function e(e){t.call(this),this.parser=e}return i(e,t),e.prototype.visitQuote=function(e){return"route"==e.prefix?n(this.parser,e.uninterpretedExpression):t.prototype.visitQuote.call(this,e)},e}(l.AstTransformer);e.parseRouterLinkExpression=n;var P=function(){function t(t){this.astTransformer=new R(t)}return t.prototype.visitNgContent=function(t,e){return t},t.prototype.visitEmbeddedTemplate=function(t,e){return t},t.prototype.visitElement=function(t,e){var r=this,n=t.children.map(function(t){return t.visit(r,e)}),o=t.inputs.map(function(t){return t.visit(r,e)}),a=t.directives.map(function(t){return t.visit(r,e)});return new c.ElementAst(t.name,t.attrs,o,t.outputs,t.exportAsVars,a,n,t.ngContentIndex,t.sourceSpan)},t.prototype.visitVariable=function(t,e){return t},t.prototype.visitEvent=function(t,e){return t},t.prototype.visitElementProperty=function(t,e){return t},t.prototype.visitAttr=function(t,e){return t},t.prototype.visitBoundText=function(t,e){return t},t.prototype.visitText=function(t,e){return t},t.prototype.visitDirective=function(t,e){var r=this,n=t.inputs.map(function(t){return t.visit(r,e)});return new c.DirectiveAst(t.directive,n,t.hostProperties,t.hostEvents,t.exportAsVars,t.sourceSpan)},t.prototype.visitDirectiveProperty=function(t,e){var r=t.value.visit(this.astTransformer);return new c.BoundDirectivePropertyAst(t.directiveName,t.templateName,r,t.sourceSpan)},t=s([f.Injectable(),u("design:paramtypes",[h.Parser])],t)}();return e.RouterLinkTransform=P,o.define=a,r.exports}),System.register("angular2/router/router_link_dsl",["angular2/compiler","angular2/core","angular2/src/router/router_link_transform","angular2/src/facade/lang","angular2/src/router/router_link_transform"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=t("angular2/compiler"),i=t("angular2/core"),s=t("angular2/src/router/router_link_transform"),u=t("angular2/src/facade/lang"),c=t("angular2/src/router/router_link_transform");return e.RouterLinkTransform=c.RouterLinkTransform,e.ROUTER_LINK_DSL_PROVIDER=u.CONST_EXPR(new i.Provider(a.TEMPLATE_TRANSFORMS,{useClass:s.RouterLinkTransform,multi:!0})),n.define=o,r.exports}),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){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},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 f=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=f,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(t,e,r){this.component=t,this.child=e,this.auxInstruction=r}return Object.defineProperty(t.prototype,"urlPath",{get:function(){return s.isPresent(this.component)?this.component.urlPath:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"urlParams",{get:function(){return s.isPresent(this.component)?this.component.urlParams:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"specificity",{get:function(){var t="";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 f(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.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 f=function(t){function e(e,r,n){t.call(this,e,r,n)}return a(e,t),e.prototype.resolveComponent=function(){return u.PromiseWrapper.resolve(this.component)},e}(p);e.ResolvedInstruction=f;var h=function(t){function e(e,r){t.call(this,e,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=h;var g=function(t){function e(e,r,n){void 0===r&&(r=""),void 0===n&&(n=s.CONST_EXPR([])),t.call(this,null,null,{}),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,o){t.call(this,e,r,n),this._specificity=o}return a(e,t),Object.defineProperty(e.prototype,"specificity",{get:function(){return this._specificity},enumerable:!0,configurable:!0}),e}(f);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 f(t[t.length-1]),r=t.length-2;r>=0;r-=1)e=new f(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){t===!0?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"),f=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=f;var h=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}(f);e.RootUrl=h,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 f(""):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 h(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 f(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){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},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){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},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){var r=this;this._router=t,this._location=e,this._router.subscribe(function(t){return r._updateLink()})}return t.prototype._updateLink=function(){this._navigationInstruction=this._router.generate(this._routeParams);var t=this._navigationInstruction.toLinkUrl();this.visibleHref=this._location.prepareExternalUrl(t)},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._updateLink()},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:"[routerLink]",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/platform_location",[],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=function(){function t(){}return t}();return e.PlatformLocation=a,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){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},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"),f=t("angular2/src/router/platform_location"),h=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),this._platformLocation.onHashChange(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.replaceState=function(t,e,r,n){var o=this.prepareExternalUrl(r+l.normalizeQueryParams(n));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.replaceState(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",[f.PlatformLocation,String])],e)}(l.LocationStrategy);return e.HashLocationStrategy=h,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){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},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"),f=t("angular2/src/router/location_strategy"),h=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 f.joinWithSlash(this._baseHref,t)},e.prototype.path=function(){return this._platformLocation.pathname+f.normalizeQueryParams(this._platformLocation.search)},e.prototype.pushState=function(t,e,r,n){var o=this.prepareExternalUrl(r+f.normalizeQueryParams(n));this._platformLocation.pushState(t,e,o)},e.prototype.replaceState=function(t,e,r,n){var o=this.prepareExternalUrl(r+f.normalizeQueryParams(n));this._platformLocation.replaceState(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(f.APP_BASE_HREF)),s("design:paramtypes",[h.PlatformLocation,String])],e)}(f.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/router_providers_common",["angular2/src/router/location_strategy","angular2/src/router/path_location_strategy","angular2/src/router/router","angular2/src/router/route_registry","angular2/src/router/location","angular2/src/facade/lang","angular2/core","angular2/src/facade/exceptions"],!0,function(t,e,r){function n(t,e,r,n){var o=new c.RootRouter(t,e,r);return n.registerDisposeListener(function(){return o.dispose()}),o}function o(t){if(0==t.componentTypes.length)throw new g.BaseException("Bootstrap at least one component before injecting Router.");return t.componentTypes[0]}var a=System.global,i=a.define;a.define=void 0;var s=t("angular2/src/router/location_strategy"),u=t("angular2/src/router/path_location_strategy"),c=t("angular2/src/router/router"),l=t("angular2/src/router/route_registry"),p=t("angular2/src/router/location"),f=t("angular2/src/facade/lang"),h=t("angular2/core"),g=t("angular2/src/facade/exceptions");return e.ROUTER_PROVIDERS_COMMON=f.CONST_EXPR([l.RouteRegistry,f.CONST_EXPR(new h.Provider(s.LocationStrategy,{useClass:u.PathLocationStrategy})),p.Location,f.CONST_EXPR(new h.Provider(c.Router,{useFactory:n,deps:f.CONST_EXPR([l.RouteRegistry,p.Location,l.ROUTER_PRIMARY_COMPONENT,h.ApplicationRef])})),f.CONST_EXPR(new h.Provider(l.ROUTER_PRIMARY_COMPONENT,{useFactory:o,deps:f.CONST_EXPR([h.ApplicationRef])}))]),a.define=i,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==e.length&&(n+="2");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+="1";else if(l.isPresent(s=l.RegExpWrapper.firstMatch(R,u)))r.push(new y(s[1])),n+="0";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+="2"}return{segments:r,specificity:n}}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"),f=t("angular2/src/facade/collection"),h=t("angular2/src/router/url_parser"),g=function(){function t(t){var e=this;this.map={},this.keys={},l.isPresent(t)&&f.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 f.StringMapWrapper["delete"](this.keys,t),this.map[t]},t.prototype.getUnused=function(){var t=this,e={},r=f.StringMapWrapper.keys(this.keys);return r.forEach(function(r){return e[r]=f.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(!f.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("//|\\(|\\)|;|\\?|="),x=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);
|
|
2
|
-
}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(i instanceof y){n[i.name]=e.toString(),o.push(e.toString()),r=null;break}if(o.push(e.path),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 h.RootUrl?t:e;c=l.isPresent(g.params)?f.StringMapWrapper.merge(g.params,n):n,u=h.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=h.serializeParams(i);return{urlPath:a,urlParams:s}},t}();return e.PathRecognizer=x,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"),f=t("angular2/src/router/sync_route_handler"),h=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 f.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 f.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)}),0==e.length&&a.isPresent(t)&&t.auxiliary.length>0?[u.PromiseWrapper.resolve(new c.PathMatch(null,null,t.auxiliary))]: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=h,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,data:t.data,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,data:t.data,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){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},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"),f=t("angular2/core"),h=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,type:t.type})})}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.replaceState=function(t,e){void 0===e&&(e=""),this.platformStrategy.replaceState(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([f.Injectable(),c("design:paramtypes",[l.LocationStrategy])],t)}();return e.Location=h,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){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},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"),f=t("angular2/core"),h=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=f.Injector.resolve([f.provide(g.RouteData,{useValue:t.routeData}),f.provide(g.RouteParams,{useValue:new g.RouteParams(t.params)}),f.provide(h.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([f.Directive({selector:"router-outlet"}),s(3,f.Attribute("name")),i("design:paramtypes",[f.ElementRef,f.DynamicComponentLoader,h.Router,String])],t)}();return e.RouterOutlet=y,n.define=o,r.exports}),System.register("angular2/src/router/browser_platform_location",["angular2/core","angular2/src/router/platform_location","angular2/src/platform/dom/dom_adapter"],!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){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},s=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},u=t("angular2/core"),c=t("angular2/src/router/platform_location"),l=t("angular2/src/platform/dom/dom_adapter"),p=function(t){function e(){t.call(this),this._init()}return a(e,t),e.prototype._init=function(){this._location=l.DOM.getLocation(),this._history=l.DOM.getHistory()},Object.defineProperty(e.prototype,"location",{get:function(){return this._location},enumerable:!0,configurable:!0}),e.prototype.getBaseHrefFromDOM=function(){return l.DOM.getBaseHref()},e.prototype.onPopState=function(t){l.DOM.getGlobalEventTarget("window").addEventListener("popstate",t,!1)},e.prototype.onHashChange=function(t){l.DOM.getGlobalEventTarget("window").addEventListener("hashchange",t,!1)},Object.defineProperty(e.prototype,"pathname",{get:function(){return this._location.pathname},set:function(t){this._location.pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"search",{get:function(){return this._location.search},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hash",{get:function(){return this._location.hash},enumerable:!0,configurable:!0}),e.prototype.pushState=function(t,e,r){this._history.pushState(t,e,r)},e.prototype.replaceState=function(t,e,r){this._history.replaceState(t,e,r)},e.prototype.forward=function(){this._history.forward()},e.prototype.back=function(){this._history.back()},e=i([u.Injectable(),s("design:paramtypes",[])],e)}(c.PlatformLocation);return e.BrowserPlatformLocation=p,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"),f=function(){function t(){}return t}();e.RouteMatch=f;var h=function(t){function e(e,r,n){t.call(this),this.instruction=e,this.remaining=r,this.remainingAux=n}return a(e,t),e}(f);e.PathMatch=h;var g=function(t){function e(e,r){t.call(this),this.redirectTo=e,this.specificity=r}return a(e,t),e}(f);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 h(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/router_providers",["angular2/router","angular2/core","angular2/src/facade/lang","angular2/src/router/browser_platform_location","angular2/src/router/platform_location"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=t("angular2/router"),i=t("angular2/core"),s=t("angular2/src/facade/lang"),u=t("angular2/src/router/browser_platform_location"),c=t("angular2/src/router/platform_location");return e.ROUTER_PROVIDERS=s.CONST_EXPR([a.ROUTER_PROVIDERS_COMMON,s.CONST_EXPR(new i.Provider(c.PlatformLocation,{useClass:u.BrowserPlatformLocation}))]),e.ROUTER_BINDINGS=e.ROUTER_PROVIDERS,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(g.isString(e)){var r=e;return t.concat(r.split("/"))}return t.push(e),t},[])}function o(t){if(t=t.filter(function(t){return g.isPresent(t)}),0==t.length)return null;if(1==t.length)return t[0];var e=t[0],r=t.slice(1);return r.reduce(function(t,e){return-1==a(e.specificity,t.specificity)?e:t},e)}function a(t,e){for(var r=g.Math.min(t.length,e.length),n=0;r>n;n+=1){var o=g.StringWrapper.charCodeAt(t,n),a=g.StringWrapper.charCodeAt(e,n),i=a-o;if(0!=i)return i}return t.length-e.length}function i(t,e){if(g.isType(t)){var r=d.reflector.annotations(t);if(g.isPresent(r))for(var n=0;n<r.length;n++){var o=r[n];if(o instanceof y.RouteConfig)throw new m.BaseException('Child routes are not allowed for "'+e+'". Use "..." on the parent\'s route path.')}}}var s=System.global,u=s.define;s.define=void 0;var c=this&&this.__decorate||function(t,e,r,n){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},l=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},p=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},f=t("angular2/src/facade/collection"),h=t("angular2/src/facade/async"),g=t("angular2/src/facade/lang"),m=t("angular2/src/facade/exceptions"),d=t("angular2/src/core/reflection/reflection"),_=t("angular2/core"),y=t("angular2/src/router/route_config_impl"),v=t("angular2/src/router/route_recognizer"),R=t("angular2/src/router/component_recognizer"),P=t("angular2/src/router/instruction"),x=t("angular2/src/router/route_config_nomalizer"),S=t("angular2/src/router/url_parser"),b=h.PromiseWrapper.resolve(null);e.ROUTER_PRIMARY_COMPONENT=g.CONST_EXPR(new _.OpaqueToken("RouterPrimaryComponent"));var O=function(){function t(t){this._rootComponent=t,this._rules=new f.Map}return t.prototype.config=function(t,e){e=x.normalizeRouteConfig(e,this),e instanceof y.Route?x.assertComponentExists(e.component,e.path):e instanceof y.AuxRoute&&x.assertComponentExists(e.component,e.path);var r=this._rules.get(t);g.isBlank(r)&&(r=new R.ComponentRecognizer,this._rules.set(t,r));var n=r.config(e);e instanceof y.Route&&(n?i(e.component,e.path):this.configFromComponent(e.component))},t.prototype.configFromComponent=function(t){var e=this;if(g.isType(t)&&!this._rules.has(t)){var r=d.reflector.annotations(t);if(g.isPresent(r))for(var n=0;n<r.length;n++){var o=r[n];if(o instanceof y.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,[])},t.prototype._recognize=function(t,e,r){var n=this;void 0===r&&(r=!1);var a=f.ListWrapper.last(e),i=g.isPresent(a)?a.component.componentType:this._rootComponent,s=this._rules.get(i);if(g.isBlank(s))return b;var u=r?s.recognizeAuxiliary(t):s.recognize(t),c=u.map(function(t){return t.then(function(t){if(t instanceof v.PathMatch){var r=e.length>0?[f.ListWrapper.last(e)]:[],o=n._auxRoutesToUnresolved(t.remainingAux,r),a=new P.ResolvedInstruction(t.instruction,null,o);if(g.isBlank(t.instruction)||t.instruction.terminal)return a;var i=e.concat([a]);return n._recognize(t.remaining,i).then(function(t){return g.isBlank(t)?null:t instanceof P.RedirectInstruction?t:(a.child=t,a)})}if(t instanceof v.RedirectMatch){var a=n.generate(t.redirectTo,e.concat([null]));return new P.RedirectInstruction(a.component,a.child,a.auxInstruction,t.specificity)}})});return!g.isBlank(t)&&""!=t.path||0!=u.length?h.PromiseWrapper.all(c).then(o):h.PromiseWrapper.resolve(this.generateDefault(i))},t.prototype._auxRoutesToUnresolved=function(t,e){var r=this,n={};return t.forEach(function(t){n[t.path]=new P.UnresolvedInstruction(function(){return r._recognize(t,e,!0)})}),n},t.prototype.generate=function(t,e,r){void 0===r&&(r=!1);var o,a=n(t);if(""==f.ListWrapper.first(a))a.shift(),o=f.ListWrapper.first(e),e=[];else if(o=e.length>0?e.pop():null,"."==f.ListWrapper.first(a))a.shift();else if(".."==f.ListWrapper.first(a))for(;".."==f.ListWrapper.first(a);){if(e.length<=0)throw new m.BaseException('Link "'+f.ListWrapper.toJSON(t)+'" has too many "../" segments.');o=e.pop(),a=f.ListWrapper.slice(a,1)}else{var i=f.ListWrapper.first(a),s=this._rootComponent,u=null;if(e.length>1){var c=e[e.length-1],l=e[e.length-2];s=c.component.componentType,u=l.component.componentType}else 1==e.length&&(s=e[0].component.componentType,u=this._rootComponent);var p=this.hasRoute(i,s),h=g.isPresent(u)&&this.hasRoute(i,u);if(h&&p){var d='Link "'+f.ListWrapper.toJSON(t)+'" is ambiguous, use "./" or "../" to disambiguate.';throw new m.BaseException(d)}h&&(o=e.pop())}if(""==a[a.length-1]&&a.pop(),a.length>0&&""==a[0]&&a.shift(),a.length<1){var d='Link "'+f.ListWrapper.toJSON(t)+'" must include a route name.';throw new m.BaseException(d)}for(var _=this._generate(a,e,o,r,t),y=e.length-1;y>=0;y--){var v=e[y];if(g.isBlank(v))break;_=v.replaceChild(_)}return _},t.prototype._generate=function(t,e,r,n,o){var a=this;void 0===n&&(n=!1);var i=this._rootComponent,s=null,u={},c=f.ListWrapper.last(e);if(g.isPresent(c)&&g.isPresent(c.component)&&(i=c.component.componentType),0==t.length){var l=this.generateDefault(i);if(g.isBlank(l))throw new m.BaseException('Link "'+f.ListWrapper.toJSON(o)+'" does not resolve to a terminal instruction.');return l}g.isPresent(r)&&!n&&(u=f.StringMapWrapper.merge(r.auxInstruction,u),s=r.component);var p=this._rules.get(i);if(g.isBlank(p))throw new m.BaseException('Component "'+g.getTypeNameForDebugging(i)+'" has no route config.');var h=0,d={};if(h<t.length&&g.isString(t[h])){var _=t[h];if(""==_||"."==_||".."==_)throw new m.BaseException('"'+_+'/" is only allowed at the beginning of a link DSL.');if(h+=1,h<t.length){var y=t[h];g.isStringMap(y)&&!g.isArray(y)&&(d=y,h+=1)}var v=(n?p.auxNames:p.names).get(_);if(g.isBlank(v))throw new m.BaseException('Component "'+g.getTypeNameForDebugging(i)+'" has no route named "'+_+'".');if(g.isBlank(v.handler.componentType)){var R=v.generateComponentPathValues(d);return new P.UnresolvedInstruction(function(){return v.handler.resolveComponentType().then(function(i){return a._generate(t,e,r,n,o)})},R.urlPath,R.urlParams)}s=n?p.generateAuxiliary(_,d):p.generate(_,d)}for(;h<t.length&&g.isArray(t[h]);){var x=[c],S=this._generate(t[h],x,null,!0,o);u[S.component.urlPath]=S,h+=1}var b=new P.ResolvedInstruction(s,null,u);if(g.isPresent(s)&&g.isPresent(s.componentType)){var O=null;if(s.terminal)h>=t.length;else{var w=e.concat([b]),E=t.slice(h);O=this._generate(E,w,null,!1,o)}b.child=O}return b},t.prototype.hasRoute=function(t,e){var r=this._rules.get(e);return g.isBlank(r)?!1:r.hasRoute(t)},t.prototype.generateDefault=function(t){var e=this;if(g.isBlank(t))return null;var r=this._rules.get(t);if(g.isBlank(r)||g.isBlank(r.defaultRoute))return null;var n=null;if(g.isPresent(r.defaultRoute.handler.componentType)){var o=r.defaultRoute.generate({});return r.defaultRoute.terminal||(n=this.generateDefault(r.defaultRoute.handler.componentType)),new P.DefaultInstruction(o,n)}return new P.UnresolvedInstruction(function(){return r.defaultRoute.handler.resolveComponentType().then(function(r){return e.generateDefault(t)})})},t=c([_.Injectable(),p(0,_.Inject(e.ROUTER_PRIMARY_COMPONENT)),l("design:paramtypes",[g.Type])],t)}();return e.RouteRegistry=O,s.define=u,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 f.isBlank(t.component)?r:(f.isPresent(t.child)&&(r=n(t.child,f.isPresent(e)?e.child:null)),r.then(function(r){if(0==r)return!1;if(t.component.reuse)return!0;var n=_.getCanActivateHook(t.component.componentType);return f.isPresent(n)?n(t.component,f.isPresent(e)?e.component:null):!0}))}var o=System.global,a=o.define;o.define=void 0;var i=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)},s=this&&this.__decorate||function(t,e,r,n){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},u=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},c=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},l=t("angular2/src/facade/async"),p=t("angular2/src/facade/collection"),f=t("angular2/src/facade/lang"),h=t("angular2/src/facade/exceptions"),g=t("angular2/core"),m=t("angular2/src/router/route_registry"),d=t("angular2/src/router/location"),_=t("angular2/src/router/route_lifecycle_reflector"),y=l.PromiseWrapper.resolve(!0),v=l.PromiseWrapper.resolve(!1),R=function(){function t(t,e,r){this.registry=t,this.parent=e,this.hostComponent=r,this.navigating=!1,this._currentInstruction=null,this._currentNavigation=y,this._outlet=null,this._auxRouters=new p.Map,this._subject=new l.EventEmitter}return t.prototype.childRouter=function(t){return this._childRouter=new x(this,t)},t.prototype.auxRouter=function(t){return new x(this,t)},t.prototype.registerPrimaryOutlet=function(t){if(f.isPresent(t.name))throw new h.BaseException("registerPrimaryOutlet expects to be called with an unnamed outlet.");return this._outlet=t,f.isPresent(this._currentInstruction)?this.commit(this._currentInstruction,!1):y},t.prototype.registerAuxOutlet=function(t){var e=t.name;if(f.isBlank(e))throw new h.BaseException("registerAuxOutlet expects to be called with an outlet with a name.");var r=this.auxRouter(this.hostComponent);this._auxRouters.set(e,r),r._outlet=t;var n;return f.isPresent(this._currentInstruction)&&f.isPresent(n=this._currentInstruction.auxInstruction[e])?r.commit(n):y},t.prototype.isRouteActive=function(t){for(var e=this;f.isPresent(e.parent)&&f.isPresent(t.child);)e=e.parent,t=t.child;return f.isPresent(this._currentInstruction)&&this._currentInstruction.component==t.component},t.prototype.config=function(t){var e=this;return t.forEach(function(t){e.registry.config(e.hostComponent,t)}),this.renavigate()},t.prototype.navigate=function(t){var e=this.generate(t);return this.navigateByInstruction(e,!1)},t.prototype.navigateByUrl=function(t,e){var r=this;return void 0===e&&(e=!1),this._currentNavigation=this._currentNavigation.then(function(n){return r.lastNavigationAttempt=t,r._startNavigating(),r._afterPromiseFinishNavigating(r.recognize(t).then(function(t){return f.isBlank(t)?!1:r._navigate(t,e)}))})},t.prototype.navigateByInstruction=function(t,e){var r=this;return void 0===e&&(e=!1),f.isBlank(t)?v:this._currentNavigation=this._currentNavigation.then(function(n){return r._startNavigating(),r._afterPromiseFinishNavigating(r._navigate(t,e))})},t.prototype._navigate=function(t,e){var r=this;return this._settleInstruction(t).then(function(e){return r._routerCanReuse(t)}).then(function(e){return r._canActivate(t)}).then(function(n){return n?r._routerCanDeactivate(t).then(function(n){return n?r.commit(t,e).then(function(e){return r._emitNavigationFinish(t.toRootUrl()),!0}):void 0}):!1})},t.prototype._settleInstruction=function(t){var e=this;return t.resolveComponent().then(function(r){var n=[];return f.isPresent(t.component)&&(t.component.reuse=!1),f.isPresent(t.child)&&n.push(e._settleInstruction(t.child)),p.StringMapWrapper.forEach(t.auxInstruction,function(t,r){n.push(e._settleInstruction(t))}),l.PromiseWrapper.all(n)})},t.prototype._emitNavigationFinish=function(t){l.ObservableWrapper.callEmit(this._subject,t)},t.prototype._afterPromiseFinishNavigating=function(t){var e=this;return l.PromiseWrapper.catchError(t.then(function(t){return e._finishNavigating()}),function(t){throw e._finishNavigating(),t})},t.prototype._routerCanReuse=function(t){var e=this;return f.isBlank(this._outlet)?v:f.isBlank(t.component)?y:this._outlet.routerCanReuse(t.component).then(function(r){return t.component.reuse=r,r&&f.isPresent(e._childRouter)&&f.isPresent(t.child)?e._childRouter._routerCanReuse(t.child):void 0})},t.prototype._canActivate=function(t){return n(t,this._currentInstruction)},t.prototype._routerCanDeactivate=function(t){var e=this;if(f.isBlank(this._outlet))return y;var r,n=null,o=!1,a=null;return f.isPresent(t)&&(n=t.child,
|
|
3
|
-
a=t.component,o=f.isBlank(t.component)||t.component.reuse),r=o?y:this._outlet.routerCanDeactivate(a),r.then(function(t){return 0==t?!1:f.isPresent(e._childRouter)?e._childRouter._routerCanDeactivate(n):!0})},t.prototype.commit=function(t,e){var r=this;void 0===e&&(e=!1),this._currentInstruction=t;var n=y;if(f.isPresent(this._outlet)&&f.isPresent(t.component)){var o=t.component;n=o.reuse?this._outlet.reuse(o):this.deactivate(t).then(function(t){return r._outlet.activate(o)}),f.isPresent(t.child)&&(n=n.then(function(e){return f.isPresent(r._childRouter)?r._childRouter.commit(t.child):void 0}))}var a=[];return this._auxRouters.forEach(function(e,r){f.isPresent(t.auxInstruction[r])&&a.push(e.commit(t.auxInstruction[r]))}),n.then(function(t){return l.PromiseWrapper.all(a)})},t.prototype._startNavigating=function(){this.navigating=!0},t.prototype._finishNavigating=function(){this.navigating=!1},t.prototype.subscribe=function(t){return l.ObservableWrapper.subscribe(this._subject,t)},t.prototype.deactivate=function(t){var e=this,r=null,n=null;f.isPresent(t)&&(r=t.child,n=t.component);var o=y;return f.isPresent(this._childRouter)&&(o=this._childRouter.deactivate(r)),f.isPresent(this._outlet)&&(o=o.then(function(t){return e._outlet.deactivate(n)})),o},t.prototype.recognize=function(t){var e=this._getAncestorInstructions();return this.registry.recognize(t,e)},t.prototype._getAncestorInstructions=function(){for(var t=[this._currentInstruction],e=this;f.isPresent(e=e.parent);)t.unshift(e._currentInstruction);return t},t.prototype.renavigate=function(){return f.isBlank(this.lastNavigationAttempt)?this._currentNavigation:this.navigateByUrl(this.lastNavigationAttempt)},t.prototype.generate=function(t){var e=this._getAncestorInstructions();return this.registry.generate(t,e)},t}();e.Router=R;var P=function(t){function e(e,r,n){var o=this;t.call(this,e,null,n),this._location=r,this._locationSub=this._location.subscribe(function(t){o.recognize(t.url).then(function(e){o.navigateByInstruction(e,f.isPresent(t.pop)).then(function(r){if(!f.isPresent(t.pop)||"hashchange"==t.type){var n=e.toUrlPath(),a=e.toUrlQuery();n.length>0&&"/"!=n[0]&&(n="/"+n),"hashchange"==t.type?e.toRootUrl()!=o._location.path()&&o._location.replaceState(n,a):o._location.go(n,a)}})})}),this.registry.configFromComponent(n),this.navigateByUrl(r.path())}return i(e,t),e.prototype.commit=function(e,r){var n=this;void 0===r&&(r=!1);var o=e.toUrlPath(),a=e.toUrlQuery();o.length>0&&"/"!=o[0]&&(o="/"+o);var i=t.prototype.commit.call(this,e);return r||(i=i.then(function(t){n._location.go(o,a)})),i},e.prototype.dispose=function(){f.isPresent(this._locationSub)&&(l.ObservableWrapper.dispose(this._locationSub),this._locationSub=null)},e=s([g.Injectable(),c(2,g.Inject(m.ROUTER_PRIMARY_COMPONENT)),u("design:paramtypes",[m.RouteRegistry,d.Location,f.Type])],e)}(R);e.RootRouter=P;var x=function(t){function e(e,r){t.call(this,e.registry,e,r),this.parent=e}return i(e,t),e.prototype.navigateByUrl=function(t,e){return void 0===e&&(e=!1),this.parent.navigateByUrl(t,e)},e.prototype.navigateByInstruction=function(t,e){return void 0===e&&(e=!1),this.parent.navigateByInstruction(t,e)},e}(R);return o.define=a,r.exports}),System.register("angular2/router",["angular2/src/router/router","angular2/src/router/router_outlet","angular2/src/router/router_link","angular2/src/router/instruction","angular2/src/router/platform_location","angular2/src/router/route_registry","angular2/src/router/location_strategy","angular2/src/router/hash_location_strategy","angular2/src/router/path_location_strategy","angular2/src/router/location","angular2/src/router/route_config_decorator","angular2/src/router/route_definition","angular2/src/router/lifecycle_annotations","angular2/src/router/instruction","angular2/core","angular2/src/router/router_providers_common","angular2/src/router/router_providers","angular2/src/router/router_outlet","angular2/src/router/router_link","angular2/src/facade/lang"],!0,function(t,e,r){function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}var o=System.global,a=o.define;o.define=void 0;var i=t("angular2/src/router/router");e.Router=i.Router;var s=t("angular2/src/router/router_outlet");e.RouterOutlet=s.RouterOutlet;var u=t("angular2/src/router/router_link");e.RouterLink=u.RouterLink;var c=t("angular2/src/router/instruction");e.RouteParams=c.RouteParams,e.RouteData=c.RouteData;var l=t("angular2/src/router/platform_location");e.PlatformLocation=l.PlatformLocation;var p=t("angular2/src/router/route_registry");e.RouteRegistry=p.RouteRegistry,e.ROUTER_PRIMARY_COMPONENT=p.ROUTER_PRIMARY_COMPONENT;var f=t("angular2/src/router/location_strategy");e.LocationStrategy=f.LocationStrategy,e.APP_BASE_HREF=f.APP_BASE_HREF;var h=t("angular2/src/router/hash_location_strategy");e.HashLocationStrategy=h.HashLocationStrategy;var g=t("angular2/src/router/path_location_strategy");e.PathLocationStrategy=g.PathLocationStrategy;var m=t("angular2/src/router/location");e.Location=m.Location,n(t("angular2/src/router/route_config_decorator")),n(t("angular2/src/router/route_definition"));var d=t("angular2/src/router/lifecycle_annotations");e.CanActivate=d.CanActivate;var _=t("angular2/src/router/instruction");e.Instruction=_.Instruction,e.ComponentInstruction=_.ComponentInstruction;var y=t("angular2/core");e.OpaqueToken=y.OpaqueToken;var v=t("angular2/src/router/router_providers_common");e.ROUTER_PROVIDERS_COMMON=v.ROUTER_PROVIDERS_COMMON;var R=t("angular2/src/router/router_providers");e.ROUTER_PROVIDERS=R.ROUTER_PROVIDERS,e.ROUTER_BINDINGS=R.ROUTER_BINDINGS;var P=t("angular2/src/router/router_outlet"),x=t("angular2/src/router/router_link"),S=t("angular2/src/facade/lang");return e.ROUTER_DIRECTIVES=S.CONST_EXPR([P.RouterOutlet,x.RouterLink]),o.define=a,r.exports});
|