!function(e){function r(e,r,o){return 4===arguments.length?t.apply(this,arguments):void n(e,{declarative:!0,deps:r,declare:o})}function t(e,r,t,o){n(e,{declarative:!1,deps:r,executingRequire:t,execute:o})}function n(e,r){r.name=e,e in p||(p[e]=r),r.normalizedDeps=r.deps}function o(e,r){if(r[e.groupIndex]=r[e.groupIndex]||[],-1==v.call(r[e.groupIndex],e)){r[e.groupIndex].push(e);for(var t=0,n=e.normalizedDeps.length;n>t;t++){var a=e.normalizedDeps[t],u=p[a];if(u&&!u.evaluated){var d=e.groupIndex+(u.declarative!=e.declarative);if(void 0===u.groupIndex||u.groupIndex=0;a--){for(var u=t[a],i=0;ia;a++){var d=t.importers[a];if(!d.locked)for(var i=0;ia;a++){var l,s=r.normalizedDeps[a],c=p[s],v=x[s];v?l=v.exports:c&&!c.declarative?l=c.esModule:c?(d(c),v=c.module,l=v.exports):l=f(s),v&&v.importers?(v.importers.push(t),t.dependencies.push(v)):t.dependencies.push(null),t.setters[a]&&t.setters[a](l)}}}function i(e){var r,t=p[e];if(t)t.declarative?c(e,[]):t.evaluated||l(t),r=t.module.exports;else if(r=f(e),!r)throw new Error("Unable to load dependency "+e+".");return(!t||t.declarative)&&r&&r.__useDefault?r["default"]:r}function l(r){if(!r.module){var t={},n=r.module={exports:t,id:r.name};if(!r.executingRequire)for(var o=0,a=r.normalizedDeps.length;a>o;o++){var u=r.normalizedDeps[o],d=p[u];d&&l(d)}r.evaluated=!0;var c=r.execute.call(e,function(e){for(var t=0,n=r.deps.length;n>t;t++)if(r.deps[t]==e)return i(r.normalizedDeps[t]);throw new TypeError("Module "+e+" not declared as a dependency.")},t,n);c&&(n.exports=c),t=n.exports,t&&t.__esModule?r.esModule=t:r.esModule=s(t)}}function s(r){if(r===e)return r;var t={};if("object"==typeof r||"function"==typeof r)if(g){var n;for(var o in r)(n=Object.getOwnPropertyDescriptor(r,o))&&h(t,o,n)}else{var a=r&&r.hasOwnProperty;for(var o in r)(!a||r.hasOwnProperty(o))&&(t[o]=r[o])}return t["default"]=r,h(t,"__useDefault",{value:!0}),t}function c(r,t){var n=p[r];if(n&&!n.evaluated&&n.declarative){t.push(r);for(var o=0,a=n.normalizedDeps.length;a>o;o++){var u=n.normalizedDeps[o];-1==v.call(t,u)&&(p[u]?c(u,t):f(u))}n.evaluated||(n.evaluated=!0,n.module.execute.call(e))}}function f(e){if(D[e])return D[e];if("@node/"==e.substr(0,6))return y(e.substr(6));var r=p[e];if(!r)throw"Module "+e+" not present.";return a(e),c(e,[]),p[e]=void 0,r.declarative&&h(r.module.exports,"__esModule",{value:!0}),D[e]=r.declarative?r.module.exports:r.esModule}var p={},v=Array.prototype.indexOf||function(e){for(var r=0,t=this.length;t>r;r++)if(this[r]===e)return r;return-1},g=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(m){g=!1}var h;!function(){try{Object.defineProperty({},"a",{})&&(h=Object.defineProperty)}catch(e){h=function(e,r,t){try{e[r]=t.value||t.get.call(e)}catch(n){}}}}();var x={},y="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&require.resolve&&"undefined"!=typeof process&&require,D={"@empty":{}};return function(e,n,o){return function(a){a(function(a){for(var u={_nodeRequire:y,register:r,registerDynamic:t,get:f,set:function(e,r){D[e]=r},newModule:function(e){return e}},d=0;d1)for(var d=1;d0},ObservableWrapper.dispose=function(subscription){subscription.unsubscribe()},ObservableWrapper.callNext=function(emitter,value){emitter.emit(value)},ObservableWrapper.callEmit=function(emitter,value){emitter.emit(value)},ObservableWrapper.callError=function(emitter,error){emitter.error(error)},ObservableWrapper.callComplete=function(emitter){emitter.complete()},ObservableWrapper.fromPromise=function(promise){return PromiseObservable_1.PromiseObservable.create(promise)},ObservableWrapper.toPromise=function(obj){return toPromise_1.toPromise.call(obj)},ObservableWrapper}();exports.ObservableWrapper=ObservableWrapper;var EventEmitter=function(_super){function EventEmitter(isAsync){void 0===isAsync&&(isAsync=!1),_super.call(this),this.__isAsync=isAsync}return __extends(EventEmitter,_super),EventEmitter.prototype.emit=function(value){_super.prototype.next.call(this,value)},EventEmitter.prototype.next=function(value){_super.prototype.next.call(this,value)},EventEmitter.prototype.subscribe=function(generatorOrNext,error,complete){var schedulerFn,errorFn=function(err){return null},completeFn=function(){return null};return generatorOrNext&&"object"==typeof generatorOrNext?(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext.next(value)})}:function(value){generatorOrNext.next(value)},generatorOrNext.error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return generatorOrNext.error(err)})}:function(err){generatorOrNext.error(err)}),generatorOrNext.complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return generatorOrNext.complete()})}:function(){generatorOrNext.complete()})):(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext(value)})}:function(value){generatorOrNext(value)},error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return error(err)})}:function(err){error(err)}),complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return complete()})}:function(){complete()})),_super.prototype.subscribe.call(this,schedulerFn,errorFn,completeFn)},EventEmitter}(Subject_1.Subject);return exports.EventEmitter=EventEmitter,module.exports}),$__System.registerDynamic("@angular/platform-browser-dynamic/src/facade/base_wrapped_exception.js",[],!0,function($__require,exports,module){"use strict";var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},BaseWrappedException=function(_super){function BaseWrappedException(message){_super.call(this,message)}return __extends(BaseWrappedException,_super),Object.defineProperty(BaseWrappedException.prototype,"wrapperMessage",{get:function(){return""},enumerable:!0,configurable:!0}),Object.defineProperty(BaseWrappedException.prototype,"wrapperStack",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(BaseWrappedException.prototype,"originalException",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(BaseWrappedException.prototype,"originalStack",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(BaseWrappedException.prototype,"context",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(BaseWrappedException.prototype,"message",{get:function(){return""},enumerable:!0,configurable:!0}),BaseWrappedException}(Error);return exports.BaseWrappedException=BaseWrappedException,module.exports}),$__System.registerDynamic("@angular/platform-browser-dynamic/src/facade/collection.js",["@angular/platform-browser-dynamic/src/facade/lang.js"],!0,function($__require,exports,module){"use strict";function _flattenArray(source,target){if(lang_1.isPresent(source))for(var i=0;i-1&&(list.splice(index,1),!0)},ListWrapper.clear=function(list){list.length=0},ListWrapper.isEmpty=function(list){return 0==list.length},ListWrapper.fill=function(list,value,start,end){void 0===start&&(start=0),void 0===end&&(end=null),list.fill(value,start,null===end?list.length:end)},ListWrapper.equals=function(a,b){if(a.length!=b.length)return!1;for(var i=0;imaxValue&&(solution=candidate,maxValue=candidateValue)}}return solution},ListWrapper.flatten=function(list){var target=[];return _flattenArray(list,target),target},ListWrapper.addAll=function(list,source){for(var i=0;i1;){var name=parts.shift();obj=obj.hasOwnProperty(name)&&isPresent(obj[name])?obj[name]:obj[name]={}}void 0!==obj&&null!==obj||(obj={}),obj[parts.shift()]=value}function getSymbolIterator(){if(isBlank(_symbolIterator))if(isPresent(globalScope.Symbol)&&isPresent(Symbol.iterator))_symbolIterator=Symbol.iterator;else for(var keys=Object.getOwnPropertyNames(Map.prototype),i=0;i=0&&s[i]==charVal;i--)pos--;s=s.substring(0,pos)}return s},StringWrapper.replace=function(s,from,replace){return s.replace(from,replace)},StringWrapper.replaceAll=function(s,from,replace){return s.replace(from,replace)},StringWrapper.slice=function(s,from,to){return void 0===from&&(from=0),void 0===to&&(to=null),s.slice(from,null===to?void 0:to)},StringWrapper.replaceAllMapped=function(s,from,cb){return s.replace(from,function(){for(var matches=[],_i=0;_ib?1:0},StringWrapper}();exports.StringWrapper=StringWrapper;var StringJoiner=function(){function StringJoiner(parts){void 0===parts&&(parts=[]),this.parts=parts}return StringJoiner.prototype.add=function(part){this.parts.push(part)},StringJoiner.prototype.toString=function(){return this.parts.join("")},StringJoiner}();exports.StringJoiner=StringJoiner;var NumberParseError=function(_super){function NumberParseError(message){_super.call(this),this.message=message}return __extends(NumberParseError,_super),NumberParseError.prototype.toString=function(){return this.message},NumberParseError}(Error);exports.NumberParseError=NumberParseError;var NumberWrapper=function(){function NumberWrapper(){}return NumberWrapper.toFixed=function(n,fractionDigits){return n.toFixed(fractionDigits)},NumberWrapper.equal=function(a,b){return a===b},NumberWrapper.parseIntAutoRadix=function(text){var result=parseInt(text); if(isNaN(result))throw new NumberParseError("Invalid integer literal when parsing "+text);return result},NumberWrapper.parseInt=function(text,radix){if(10==radix){if(/^(\-|\+)?[0-9]+$/.test(text))return parseInt(text,radix)}else if(16==radix){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(text))return parseInt(text,radix)}else{var result=parseInt(text,radix);if(!isNaN(result))return result}throw new NumberParseError("Invalid integer literal when parsing "+text+" in base "+radix)},NumberWrapper.parseFloat=function(text){return parseFloat(text)},Object.defineProperty(NumberWrapper,"NaN",{get:function(){return NaN},enumerable:!0,configurable:!0}),NumberWrapper.isNumeric=function(value){return!isNaN(value-parseFloat(value))},NumberWrapper.isNaN=function(value){return isNaN(value)},NumberWrapper.isInteger=function(value){return Number.isInteger(value)},NumberWrapper}();exports.NumberWrapper=NumberWrapper,exports.RegExp=_global.RegExp;var RegExpWrapper=function(){function RegExpWrapper(){}return RegExpWrapper.create=function(regExpStr,flags){return void 0===flags&&(flags=""),flags=flags.replace(/g/g,""),new _global.RegExp(regExpStr,flags+"g")},RegExpWrapper.firstMatch=function(regExp,input){return regExp.lastIndex=0,regExp.exec(input)},RegExpWrapper.test=function(regExp,input){return regExp.lastIndex=0,regExp.test(input)},RegExpWrapper.matcher=function(regExp,input){return regExp.lastIndex=0,{re:regExp,input:input}},RegExpWrapper.replaceAll=function(regExp,input,replace){var c=regExp.exec(input),res="";regExp.lastIndex=0;for(var prev=0;c;)res+=input.substring(prev,c.index),res+=replace(c),prev=c.index+c[0].length,regExp.lastIndex=prev,c=regExp.exec(input);return res+=input.substring(prev)},RegExpWrapper}();exports.RegExpWrapper=RegExpWrapper;var RegExpMatcherWrapper=function(){function RegExpMatcherWrapper(){}return RegExpMatcherWrapper.next=function(matcher){return matcher.re.exec(matcher.input)},RegExpMatcherWrapper}();exports.RegExpMatcherWrapper=RegExpMatcherWrapper;var FunctionWrapper=function(){function FunctionWrapper(){}return FunctionWrapper.apply=function(fn,posArgs){return fn.apply(null,posArgs)},FunctionWrapper.bind=function(fn,scope){return fn.bind(scope)},FunctionWrapper}();exports.FunctionWrapper=FunctionWrapper,exports.looseIdentical=looseIdentical,exports.getMapKey=getMapKey,exports.normalizeBlank=normalizeBlank,exports.normalizeBool=normalizeBool,exports.isJsObject=isJsObject,exports.print=print,exports.warn=warn;var Json=function(){function Json(){}return Json.parse=function(s){return _global.JSON.parse(s)},Json.stringify=function(data){return _global.JSON.stringify(data,null,2)},Json}();exports.Json=Json;var DateWrapper=function(){function DateWrapper(){}return DateWrapper.create=function(year,month,day,hour,minutes,seconds,milliseconds){return void 0===month&&(month=1),void 0===day&&(day=1),void 0===hour&&(hour=0),void 0===minutes&&(minutes=0),void 0===seconds&&(seconds=0),void 0===milliseconds&&(milliseconds=0),new exports.Date(year,month-1,day,hour,minutes,seconds,milliseconds)},DateWrapper.fromISOString=function(str){return new exports.Date(str)},DateWrapper.fromMillis=function(ms){return new exports.Date(ms)},DateWrapper.toMillis=function(date){return date.getTime()},DateWrapper.now=function(){return new exports.Date},DateWrapper.toJson=function(date){return date.toJSON()},DateWrapper}();exports.DateWrapper=DateWrapper,exports.setValueOnPath=setValueOnPath;var _symbolIterator=null;return exports.getSymbolIterator=getSymbolIterator,exports.evalExpression=evalExpression,exports.isPrimitive=isPrimitive,exports.hasConstructor=hasConstructor,exports.escape=escape,exports.escapeRegExp=escapeRegExp,module.exports}),$__System.registerDynamic("@angular/platform-browser-dynamic/src/facade/promise.js",[],!0,function($__require,exports,module){"use strict";var PromiseCompleter=function(){function PromiseCompleter(){var _this=this;this.promise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return PromiseCompleter}();exports.PromiseCompleter=PromiseCompleter;var PromiseWrapper=function(){function PromiseWrapper(){}return PromiseWrapper.resolve=function(obj){return Promise.resolve(obj)},PromiseWrapper.reject=function(obj,_){return Promise.reject(obj)},PromiseWrapper.catchError=function(promise,onError){return promise["catch"](onError)},PromiseWrapper.all=function(promises){return 0==promises.length?Promise.resolve([]):Promise.all(promises)},PromiseWrapper.then=function(promise,success,rejection){return promise.then(success,rejection)},PromiseWrapper.wrap=function(computation){return new Promise(function(res,rej){try{res(computation())}catch(e){rej(e)}})},PromiseWrapper.scheduleMicrotask=function(computation){PromiseWrapper.then(PromiseWrapper.resolve(null),computation,function(_){})},PromiseWrapper.completer=function(){return new PromiseCompleter},PromiseWrapper}();return exports.PromiseWrapper=PromiseWrapper,module.exports}),$__System.registerDynamic("@angular/platform-browser-dynamic/src/xhr/xhr_impl.js",["@angular/compiler/index.js","@angular/platform-browser-dynamic/src/facade/lang.js","@angular/platform-browser-dynamic/src/facade/promise.js"],!0,function($__require,exports,module){"use strict";var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},compiler_1=$__require("@angular/compiler/index.js"),lang_1=$__require("@angular/platform-browser-dynamic/src/facade/lang.js"),promise_1=$__require("@angular/platform-browser-dynamic/src/facade/promise.js"),XHRImpl=function(_super){function XHRImpl(){_super.apply(this,arguments)}return __extends(XHRImpl,_super),XHRImpl.prototype.get=function(url){var completer=promise_1.PromiseWrapper.completer(),xhr=new XMLHttpRequest;return xhr.open("GET",url,!0),xhr.responseType="text",xhr.onload=function(){var response=lang_1.isPresent(xhr.response)?xhr.response:xhr.responseText,status=1223===xhr.status?204:xhr.status;0===status&&(status=response?200:0),200<=status&&status<=300?completer.resolve(response):completer.reject("Failed to load "+url,null)},xhr.onerror=function(){completer.reject("Failed to load "+url,null)},xhr.send(),completer.promise},XHRImpl}(compiler_1.XHR);return exports.XHRImpl=XHRImpl,module.exports}),$__System.registerDynamic("@angular/platform-browser-dynamic/index.js",["@angular/common/index.js","@angular/compiler/index.js","@angular/core/index.js","@angular/platform-browser/index.js","@angular/platform-browser-dynamic/core_private.js","@angular/platform-browser-dynamic/src/facade/async.js","@angular/platform-browser-dynamic/src/facade/lang.js","@angular/platform-browser-dynamic/src/xhr/xhr_cache.js","@angular/platform-browser-dynamic/src/xhr/xhr_impl.js"],!0,function($__require,exports,module){"use strict";function bootstrap(appComponentType,customProviders){core_private_1.reflector.reflectionCapabilities=new core_private_1.ReflectionCapabilities;var providers=[platform_browser_1.BROWSER_APP_PROVIDERS,exports.BROWSER_APP_COMPILER_PROVIDERS,lang_1.isPresent(customProviders)?customProviders:[]],appInjector=core_1.ReflectiveInjector.resolveAndCreate(providers,platform_browser_1.browserPlatform().injector);return core_1.coreLoadAndBootstrap(appComponentType,appInjector)}function bootstrapWorkerUi(workerScriptUri,customProviders){var app=core_1.ReflectiveInjector.resolveAndCreate([platform_browser_1.WORKER_UI_APPLICATION_PROVIDERS,exports.BROWSER_APP_COMPILER_PROVIDERS,{provide:platform_browser_1.WORKER_SCRIPT,useValue:workerScriptUri},lang_1.isPresent(customProviders)?customProviders:[]],platform_browser_1.workerUiPlatform().injector);return async_1.PromiseWrapper.resolve(app.get(core_1.ApplicationRef))}function bootstrapWorkerApp(appComponentType,customProviders){var appInjector=core_1.ReflectiveInjector.resolveAndCreate([platform_browser_1.WORKER_APP_APPLICATION_PROVIDERS,WORKER_APP_COMPILER_PROVIDERS,lang_1.isPresent(customProviders)?customProviders:[]],platform_browser_1.workerAppPlatform().injector);return core_1.coreLoadAndBootstrap(appComponentType,appInjector)}var common_1=$__require("@angular/common/index.js"),compiler_1=$__require("@angular/compiler/index.js"),core_1=$__require("@angular/core/index.js"),platform_browser_1=$__require("@angular/platform-browser/index.js"),core_private_1=$__require("@angular/platform-browser-dynamic/core_private.js"),async_1=$__require("@angular/platform-browser-dynamic/src/facade/async.js"),lang_1=$__require("@angular/platform-browser-dynamic/src/facade/lang.js"),xhr_cache_1=$__require("@angular/platform-browser-dynamic/src/xhr/xhr_cache.js"),xhr_impl_1=$__require("@angular/platform-browser-dynamic/src/xhr/xhr_impl.js");exports.BROWSER_APP_COMPILER_PROVIDERS=[compiler_1.COMPILER_PROVIDERS,{provide:compiler_1.CompilerConfig,useFactory:function(platformDirectives,platformPipes){return new compiler_1.CompilerConfig({platformDirectives:platformDirectives,platformPipes:platformPipes})},deps:[core_1.PLATFORM_DIRECTIVES,core_1.PLATFORM_PIPES]},{provide:compiler_1.XHR,useClass:xhr_impl_1.XHRImpl},{provide:core_1.PLATFORM_DIRECTIVES,useValue:common_1.COMMON_DIRECTIVES,multi:!0},{provide:core_1.PLATFORM_PIPES,useValue:common_1.COMMON_PIPES,multi:!0}],exports.CACHED_TEMPLATE_PROVIDER=[{provide:compiler_1.XHR,useClass:xhr_cache_1.CachedXHR}],exports.bootstrap=bootstrap,exports.bootstrapWorkerUi=bootstrapWorkerUi;var WORKER_APP_COMPILER_PROVIDERS=[compiler_1.COMPILER_PROVIDERS,{provide:compiler_1.CompilerConfig,useFactory:function(platformDirectives,platformPipes){return new compiler_1.CompilerConfig({platformDirectives:platformDirectives,platformPipes:platformPipes})},deps:[core_1.PLATFORM_DIRECTIVES,core_1.PLATFORM_PIPES]},{provide:compiler_1.XHR,useClass:xhr_impl_1.XHRImpl},{provide:core_1.PLATFORM_DIRECTIVES,useValue:common_1.COMMON_DIRECTIVES,multi:!0},{provide:core_1.PLATFORM_PIPES,useValue:common_1.COMMON_PIPES,multi:!0}];return exports.bootstrapWorkerApp=bootstrapWorkerApp,module.exports}),$__System.registerDynamic("@angular/compiler/src/offline_compiler.js",["@angular/core/index.js","@angular/compiler/src/compile_metadata.js","@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/output/output_ast.js","@angular/compiler/src/util.js","@angular/compiler/src/view_compiler/view_compiler.js"],!0,function($__require,exports,module){"use strict";function _resolveViewStatements(compileResult){return compileResult.dependencies.forEach(function(dep){if(dep instanceof view_compiler_1.ViewFactoryDependency){var vfd=dep;vfd.placeholder.moduleUrl=_ngfactoryModuleUrl(vfd.comp)}else if(dep instanceof view_compiler_1.ComponentFactoryDependency){var cfd=dep;cfd.placeholder.name=_componentFactoryName(cfd.comp),cfd.placeholder.moduleUrl=_ngfactoryModuleUrl(cfd.comp)}}),compileResult.statements}function _resolveStyleStatements(compileResult,fileSuffix){return compileResult.dependencies.forEach(function(dep){dep.valuePlaceholder.moduleUrl=_stylesModuleUrl(dep.moduleUrl,dep.isShimmed,fileSuffix)}),compileResult.statements}function _ngfactoryModuleUrl(comp){var urlWithSuffix=_splitLastSuffix(comp.moduleUrl);return urlWithSuffix[0]+".ngfactory"+urlWithSuffix[1]}function _componentFactoryName(comp){return comp.name+"NgFactory"}function _stylesModuleUrl(stylesheetUrl,shim,suffix){return shim?stylesheetUrl+".shim"+suffix:""+stylesheetUrl+suffix}function _assertComponent(meta){if(!meta.isComponent)throw new exceptions_1.BaseException("Could not compile '"+meta.type.name+"' because it is not a component.")}function _splitLastSuffix(path){var lastDot=path.lastIndexOf(".");return lastDot!==-1?[path.substring(0,lastDot),path.substring(lastDot)]:[path,""]}var core_1=$__require("@angular/core/index.js"),compile_metadata_1=$__require("@angular/compiler/src/compile_metadata.js"),collection_1=$__require("@angular/compiler/src/facade/collection.js"),exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),o=$__require("@angular/compiler/src/output/output_ast.js"),util_1=$__require("@angular/compiler/src/util.js"),view_compiler_1=$__require("@angular/compiler/src/view_compiler/view_compiler.js"),_COMPONENT_FACTORY_IDENTIFIER=new compile_metadata_1.CompileIdentifierMetadata({name:"ComponentFactory",runtime:core_1.ComponentFactory,moduleUrl:util_1.assetUrl("core","linker/component_factory")}),SourceModule=function(){function SourceModule(moduleUrl,source){this.moduleUrl=moduleUrl,this.source=source}return SourceModule}();exports.SourceModule=SourceModule;var StyleSheetSourceWithImports=function(){function StyleSheetSourceWithImports(source,importedUrls){this.source=source,this.importedUrls=importedUrls}return StyleSheetSourceWithImports}();exports.StyleSheetSourceWithImports=StyleSheetSourceWithImports;var NormalizedComponentWithViewDirectives=function(){function NormalizedComponentWithViewDirectives(component,directives,pipes){this.component=component,this.directives=directives,this.pipes=pipes}return NormalizedComponentWithViewDirectives}();exports.NormalizedComponentWithViewDirectives=NormalizedComponentWithViewDirectives;var OfflineCompiler=function(){function OfflineCompiler(_directiveNormalizer,_templateParser,_styleCompiler,_viewCompiler,_outputEmitter){this._directiveNormalizer=_directiveNormalizer,this._templateParser=_templateParser,this._styleCompiler=_styleCompiler,this._viewCompiler=_viewCompiler,this._outputEmitter=_outputEmitter}return OfflineCompiler.prototype.normalizeDirectiveMetadata=function(directive){return this._directiveNormalizer.normalizeDirective(directive).asyncResult},OfflineCompiler.prototype.compileTemplates=function(components){var _this=this;if(0===components.length)throw new exceptions_1.BaseException("No components given");var statements=[],exportedVars=[],moduleUrl=_ngfactoryModuleUrl(components[0].component.type),outputSourceModules=[];return components.forEach(function(componentWithDirs){var compMeta=componentWithDirs.component;_assertComponent(compMeta);var fileSuffix=_splitLastSuffix(compMeta.type.moduleUrl)[1],stylesCompileResults=_this._styleCompiler.compileComponent(compMeta);stylesCompileResults.externalStylesheets.forEach(function(compiledStyleSheet){outputSourceModules.push(_this._codgenStyles(compiledStyleSheet,fileSuffix))});var compViewFactoryVar=_this._compileComponent(compMeta,componentWithDirs.directives,componentWithDirs.pipes,stylesCompileResults.componentStylesheet,fileSuffix,statements);exportedVars.push(compViewFactoryVar);var hostMeta=compile_metadata_1.createHostComponentMeta(compMeta.type,compMeta.selector),hostViewFactoryVar=_this._compileComponent(hostMeta,[compMeta],[],null,fileSuffix,statements),compFactoryVar=_componentFactoryName(compMeta.type);statements.push(o.variable(compFactoryVar).set(o.importExpr(_COMPONENT_FACTORY_IDENTIFIER,[o.importType(compMeta.type)]).instantiate([o.literal(compMeta.selector),o.variable(hostViewFactoryVar),o.importExpr(compMeta.type)],o.importType(_COMPONENT_FACTORY_IDENTIFIER,[o.importType(compMeta.type)],[o.TypeModifier.Const]))).toDeclStmt(null,[o.StmtModifier.Final])),exportedVars.push(compFactoryVar)}),outputSourceModules.unshift(this._codegenSourceModule(moduleUrl,statements,exportedVars)),outputSourceModules},OfflineCompiler.prototype._compileComponent=function(compMeta,directives,pipes,componentStyles,fileSuffix,targetStatements){var parsedTemplate=this._templateParser.parse(compMeta,compMeta.template.template,directives,pipes,compMeta.type.name),stylesExpr=componentStyles?o.variable(componentStyles.stylesVar):o.literalArr([]),viewResult=this._viewCompiler.compileComponent(compMeta,parsedTemplate,stylesExpr,pipes);return componentStyles&&collection_1.ListWrapper.addAll(targetStatements,_resolveStyleStatements(componentStyles,fileSuffix)),collection_1.ListWrapper.addAll(targetStatements,_resolveViewStatements(viewResult)),viewResult.viewFactoryVar},OfflineCompiler.prototype._codgenStyles=function(stylesCompileResult,fileSuffix){return _resolveStyleStatements(stylesCompileResult,fileSuffix),this._codegenSourceModule(_stylesModuleUrl(stylesCompileResult.meta.moduleUrl,stylesCompileResult.isShimmed,fileSuffix),stylesCompileResult.statements,[stylesCompileResult.stylesVar])},OfflineCompiler.prototype._codegenSourceModule=function(moduleUrl,statements,exportedVars){return new SourceModule(moduleUrl,this._outputEmitter.emitStatements(moduleUrl,statements,exportedVars))},OfflineCompiler}();return exports.OfflineCompiler=OfflineCompiler,module.exports}),$__System.registerDynamic("@angular/compiler/src/output/abstract_js_emitter.js",["@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/output/abstract_emitter.js","@angular/compiler/src/output/output_ast.js"],!0,function($__require,exports,module){"use strict";var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),abstract_emitter_1=$__require("@angular/compiler/src/output/abstract_emitter.js"),o=$__require("@angular/compiler/src/output/output_ast.js"),AbstractJsEmitterVisitor=function(_super){function AbstractJsEmitterVisitor(){_super.call(this,!1)}return __extends(AbstractJsEmitterVisitor,_super),AbstractJsEmitterVisitor.prototype.visitDeclareClassStmt=function(stmt,ctx){var _this=this;return ctx.pushClass(stmt),this._visitClassConstructor(stmt,ctx),lang_1.isPresent(stmt.parent)&&(ctx.print(stmt.name+".prototype = Object.create("),stmt.parent.visitExpression(this,ctx),ctx.println(".prototype);")),stmt.getters.forEach(function(getter){return _this._visitClassGetter(stmt,getter,ctx)}),stmt.methods.forEach(function(method){return _this._visitClassMethod(stmt,method,ctx)}),ctx.popClass(),null},AbstractJsEmitterVisitor.prototype._visitClassConstructor=function(stmt,ctx){ctx.print("function "+stmt.name+"("),lang_1.isPresent(stmt.constructorMethod)&&this._visitParams(stmt.constructorMethod.params,ctx),ctx.println(") {"),ctx.incIndent(),lang_1.isPresent(stmt.constructorMethod)&&stmt.constructorMethod.body.length>0&&(ctx.println("var self = this;"),this.visitAllStatements(stmt.constructorMethod.body,ctx)),ctx.decIndent(),ctx.println("}")},AbstractJsEmitterVisitor.prototype._visitClassGetter=function(stmt,getter,ctx){ctx.println("Object.defineProperty("+stmt.name+".prototype, '"+getter.name+"', { get: function() {"),ctx.incIndent(),getter.body.length>0&&(ctx.println("var self = this;"),this.visitAllStatements(getter.body,ctx)),ctx.decIndent(),ctx.println("}});")},AbstractJsEmitterVisitor.prototype._visitClassMethod=function(stmt,method,ctx){ctx.print(stmt.name+".prototype."+method.name+" = function("),this._visitParams(method.params,ctx),ctx.println(") {"),ctx.incIndent(),method.body.length>0&&(ctx.println("var self = this;"),this.visitAllStatements(method.body,ctx)),ctx.decIndent(),ctx.println("};")},AbstractJsEmitterVisitor.prototype.visitReadVarExpr=function(ast,ctx){if(ast.builtin===o.BuiltinVar.This)ctx.print("self");else{if(ast.builtin===o.BuiltinVar.Super)throw new exceptions_1.BaseException("'super' needs to be handled at a parent ast node, not at the variable level!");_super.prototype.visitReadVarExpr.call(this,ast,ctx)}return null},AbstractJsEmitterVisitor.prototype.visitDeclareVarStmt=function(stmt,ctx){return ctx.print("var "+stmt.name+" = "),stmt.value.visitExpression(this,ctx),ctx.println(";"),null},AbstractJsEmitterVisitor.prototype.visitCastExpr=function(ast,ctx){return ast.value.visitExpression(this,ctx),null},AbstractJsEmitterVisitor.prototype.visitInvokeFunctionExpr=function(expr,ctx){var fnExpr=expr.fn;return fnExpr instanceof o.ReadVarExpr&&fnExpr.builtin===o.BuiltinVar.Super?(ctx.currentClass.parent.visitExpression(this,ctx),ctx.print(".call(this"),expr.args.length>0&&(ctx.print(", "),this.visitAllExpressions(expr.args,ctx,",")),ctx.print(")")):_super.prototype.visitInvokeFunctionExpr.call(this,expr,ctx),null},AbstractJsEmitterVisitor.prototype.visitFunctionExpr=function(ast,ctx){return ctx.print("function("),this._visitParams(ast.params,ctx),ctx.println(") {"),ctx.incIndent(),this.visitAllStatements(ast.statements,ctx),ctx.decIndent(),ctx.print("}"),null},AbstractJsEmitterVisitor.prototype.visitDeclareFunctionStmt=function(stmt,ctx){return ctx.print("function "+stmt.name+"("),this._visitParams(stmt.params,ctx),ctx.println(") {"),ctx.incIndent(),this.visitAllStatements(stmt.statements,ctx),ctx.decIndent(),ctx.println("}"),null},AbstractJsEmitterVisitor.prototype.visitTryCatchStmt=function(stmt,ctx){ctx.println("try {"),ctx.incIndent(),this.visitAllStatements(stmt.bodyStmts,ctx),ctx.decIndent(),ctx.println("} catch ("+abstract_emitter_1.CATCH_ERROR_VAR.name+") {"),ctx.incIndent();var catchStmts=[abstract_emitter_1.CATCH_STACK_VAR.set(abstract_emitter_1.CATCH_ERROR_VAR.prop("stack")).toDeclStmt(null,[o.StmtModifier.Final])].concat(stmt.catchStmts);return this.visitAllStatements(catchStmts,ctx),ctx.decIndent(),ctx.println("}"),null},AbstractJsEmitterVisitor.prototype._visitParams=function(params,ctx){this.visitAllObjects(function(param){return ctx.print(param.name)},params,ctx,",")},AbstractJsEmitterVisitor.prototype.getBuiltinMethodName=function(method){var name;switch(method){case o.BuiltinMethod.ConcatArray:name="concat";break;case o.BuiltinMethod.SubscribeObservable:name="subscribe";break;case o.BuiltinMethod.bind:name="bind";break;default:throw new exceptions_1.BaseException("Unknown builtin method: "+method)}return name},AbstractJsEmitterVisitor}(abstract_emitter_1.AbstractEmitterVisitor);return exports.AbstractJsEmitterVisitor=AbstractJsEmitterVisitor,module.exports}),$__System.registerDynamic("@angular/compiler/src/output/output_jit.js",["@angular/compiler/src/facade/lang.js","@angular/compiler/src/output/abstract_emitter.js","@angular/compiler/src/output/abstract_js_emitter.js","@angular/compiler/src/util.js"],!0,function($__require,exports,module){"use strict";function jitStatements(sourceUrl,statements,resultVar){var converter=new JitEmitterVisitor,ctx=abstract_emitter_1.EmitterVisitorContext.createRoot([resultVar]);return converter.visitAllStatements(statements,ctx),lang_1.evalExpression(sourceUrl,resultVar,ctx.toSource(),converter.getArgs())}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},lang_1=$__require("@angular/compiler/src/facade/lang.js"),abstract_emitter_1=$__require("@angular/compiler/src/output/abstract_emitter.js"),abstract_js_emitter_1=$__require("@angular/compiler/src/output/abstract_js_emitter.js"),util_1=$__require("@angular/compiler/src/util.js");exports.jitStatements=jitStatements;var JitEmitterVisitor=function(_super){function JitEmitterVisitor(){_super.apply(this,arguments),this._evalArgNames=[],this._evalArgValues=[]}return __extends(JitEmitterVisitor,_super),JitEmitterVisitor.prototype.getArgs=function(){for(var result={},i=0;i0},ObservableWrapper.dispose=function(subscription){subscription.unsubscribe()},ObservableWrapper.callNext=function(emitter,value){emitter.emit(value)},ObservableWrapper.callEmit=function(emitter,value){emitter.emit(value)},ObservableWrapper.callError=function(emitter,error){emitter.error(error)},ObservableWrapper.callComplete=function(emitter){emitter.complete()},ObservableWrapper.fromPromise=function(promise){return PromiseObservable_1.PromiseObservable.create(promise)},ObservableWrapper.toPromise=function(obj){return toPromise_1.toPromise.call(obj)},ObservableWrapper}();exports.ObservableWrapper=ObservableWrapper;var EventEmitter=function(_super){function EventEmitter(isAsync){void 0===isAsync&&(isAsync=!1),_super.call(this),this.__isAsync=isAsync}return __extends(EventEmitter,_super),EventEmitter.prototype.emit=function(value){_super.prototype.next.call(this,value)},EventEmitter.prototype.next=function(value){_super.prototype.next.call(this,value)},EventEmitter.prototype.subscribe=function(generatorOrNext,error,complete){var schedulerFn,errorFn=function(err){return null},completeFn=function(){return null};return generatorOrNext&&"object"==typeof generatorOrNext?(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext.next(value)})}:function(value){generatorOrNext.next(value)},generatorOrNext.error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return generatorOrNext.error(err)})}:function(err){generatorOrNext.error(err)}),generatorOrNext.complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return generatorOrNext.complete()})}:function(){generatorOrNext.complete()})):(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext(value)})}:function(value){generatorOrNext(value)},error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return error(err)})}:function(err){error(err)}),complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return complete()})}:function(){complete()})),_super.prototype.subscribe.call(this,schedulerFn,errorFn,completeFn)},EventEmitter}(Subject_1.Subject);return exports.EventEmitter=EventEmitter,module.exports}),$__System.registerDynamic("@angular/compiler/src/output/dart_emitter.js",["@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/output/output_ast.js","@angular/compiler/src/output/abstract_emitter.js"],!0,function($__require,exports,module){"use strict";function debugOutputAstAsDart(ast){var asts,converter=new _DartEmitterVisitor(_debugModuleUrl),ctx=abstract_emitter_1.EmitterVisitorContext.createRoot([]);return asts=lang_1.isArray(ast)?ast:[ast],asts.forEach(function(ast){if(ast instanceof o.Statement)ast.visitStatement(converter,ctx);else if(ast instanceof o.Expression)ast.visitExpression(converter,ctx);else{if(!(ast instanceof o.Type))throw new exceptions_1.BaseException("Don't know how to print debug info for "+ast);ast.visitType(converter,ctx)}}),ctx.toSource()}function getSuperConstructorCallExpr(stmt){if(stmt instanceof o.ExpressionStatement){var expr=stmt.expr;if(expr instanceof o.InvokeFunctionExpr){var fn=expr.fn;if(fn instanceof o.ReadVarExpr&&fn.builtin===o.BuiltinVar.Super)return expr}}return null}function isConstType(type){return lang_1.isPresent(type)&&type.hasModifier(o.TypeModifier.Const)}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),o=$__require("@angular/compiler/src/output/output_ast.js"),abstract_emitter_1=$__require("@angular/compiler/src/output/abstract_emitter.js"),_debugModuleUrl="asset://debug/lib";exports.debugOutputAstAsDart=debugOutputAstAsDart;var DartEmitter=function(){function DartEmitter(_importGenerator){this._importGenerator=_importGenerator}return DartEmitter.prototype.emitStatements=function(moduleUrl,stmts,exportedVars){var _this=this,srcParts=[],converter=new _DartEmitterVisitor(moduleUrl),ctx=abstract_emitter_1.EmitterVisitorContext.createRoot(exportedVars);return converter.visitAllStatements(stmts,ctx),converter.importsWithPrefixes.forEach(function(prefix,importedModuleUrl){srcParts.push("import '"+_this._importGenerator.getImportPath(moduleUrl,importedModuleUrl)+"' as "+prefix+";")}),srcParts.push(ctx.toSource()),srcParts.join("\n")},DartEmitter}();exports.DartEmitter=DartEmitter;var _DartEmitterVisitor=function(_super){function _DartEmitterVisitor(_moduleUrl){_super.call(this,!0),this._moduleUrl=_moduleUrl,this.importsWithPrefixes=new Map}return __extends(_DartEmitterVisitor,_super),_DartEmitterVisitor.prototype.visitExternalExpr=function(ast,ctx){return this._visitIdentifier(ast.value,ast.typeParams,ctx),null},_DartEmitterVisitor.prototype.visitDeclareVarStmt=function(stmt,ctx){return stmt.hasModifier(o.StmtModifier.Final)?isConstType(stmt.type)?ctx.print("const "):ctx.print("final "):lang_1.isBlank(stmt.type)&&ctx.print("var "), lang_1.isPresent(stmt.type)&&(stmt.type.visitType(this,ctx),ctx.print(" ")),ctx.print(stmt.name+" = "),stmt.value.visitExpression(this,ctx),ctx.println(";"),null},_DartEmitterVisitor.prototype.visitCastExpr=function(ast,ctx){return ctx.print("("),ast.value.visitExpression(this,ctx),ctx.print(" as "),ast.type.visitType(this,ctx),ctx.print(")"),null},_DartEmitterVisitor.prototype.visitDeclareClassStmt=function(stmt,ctx){var _this=this;return ctx.pushClass(stmt),ctx.print("class "+stmt.name),lang_1.isPresent(stmt.parent)&&(ctx.print(" extends "),stmt.parent.visitExpression(this,ctx)),ctx.println(" {"),ctx.incIndent(),stmt.fields.forEach(function(field){return _this._visitClassField(field,ctx)}),lang_1.isPresent(stmt.constructorMethod)&&this._visitClassConstructor(stmt,ctx),stmt.getters.forEach(function(getter){return _this._visitClassGetter(getter,ctx)}),stmt.methods.forEach(function(method){return _this._visitClassMethod(method,ctx)}),ctx.decIndent(),ctx.println("}"),ctx.popClass(),null},_DartEmitterVisitor.prototype._visitClassField=function(field,ctx){field.hasModifier(o.StmtModifier.Final)?ctx.print("final "):lang_1.isBlank(field.type)&&ctx.print("var "),lang_1.isPresent(field.type)&&(field.type.visitType(this,ctx),ctx.print(" ")),ctx.println(field.name+";")},_DartEmitterVisitor.prototype._visitClassGetter=function(getter,ctx){lang_1.isPresent(getter.type)&&(getter.type.visitType(this,ctx),ctx.print(" ")),ctx.println("get "+getter.name+" {"),ctx.incIndent(),this.visitAllStatements(getter.body,ctx),ctx.decIndent(),ctx.println("}")},_DartEmitterVisitor.prototype._visitClassConstructor=function(stmt,ctx){ctx.print(stmt.name+"("),this._visitParams(stmt.constructorMethod.params,ctx),ctx.print(")");var ctorStmts=stmt.constructorMethod.body,superCtorExpr=ctorStmts.length>0?getSuperConstructorCallExpr(ctorStmts[0]):null;lang_1.isPresent(superCtorExpr)&&(ctx.print(": "),superCtorExpr.visitExpression(this,ctx),ctorStmts=ctorStmts.slice(1)),ctx.println(" {"),ctx.incIndent(),this.visitAllStatements(ctorStmts,ctx),ctx.decIndent(),ctx.println("}")},_DartEmitterVisitor.prototype._visitClassMethod=function(method,ctx){lang_1.isPresent(method.type)?method.type.visitType(this,ctx):ctx.print("void"),ctx.print(" "+method.name+"("),this._visitParams(method.params,ctx),ctx.println(") {"),ctx.incIndent(),this.visitAllStatements(method.body,ctx),ctx.decIndent(),ctx.println("}")},_DartEmitterVisitor.prototype.visitFunctionExpr=function(ast,ctx){return ctx.print("("),this._visitParams(ast.params,ctx),ctx.println(") {"),ctx.incIndent(),this.visitAllStatements(ast.statements,ctx),ctx.decIndent(),ctx.print("}"),null},_DartEmitterVisitor.prototype.visitDeclareFunctionStmt=function(stmt,ctx){return lang_1.isPresent(stmt.type)?stmt.type.visitType(this,ctx):ctx.print("void"),ctx.print(" "+stmt.name+"("),this._visitParams(stmt.params,ctx),ctx.println(") {"),ctx.incIndent(),this.visitAllStatements(stmt.statements,ctx),ctx.decIndent(),ctx.println("}"),null},_DartEmitterVisitor.prototype.getBuiltinMethodName=function(method){var name;switch(method){case o.BuiltinMethod.ConcatArray:name=".addAll";break;case o.BuiltinMethod.SubscribeObservable:name="listen";break;case o.BuiltinMethod.bind:name=null;break;default:throw new exceptions_1.BaseException("Unknown builtin method: "+method)}return name},_DartEmitterVisitor.prototype.visitTryCatchStmt=function(stmt,ctx){return ctx.println("try {"),ctx.incIndent(),this.visitAllStatements(stmt.bodyStmts,ctx),ctx.decIndent(),ctx.println("} catch ("+abstract_emitter_1.CATCH_ERROR_VAR.name+", "+abstract_emitter_1.CATCH_STACK_VAR.name+") {"),ctx.incIndent(),this.visitAllStatements(stmt.catchStmts,ctx),ctx.decIndent(),ctx.println("}"),null},_DartEmitterVisitor.prototype.visitBinaryOperatorExpr=function(ast,ctx){switch(ast.operator){case o.BinaryOperator.Identical:ctx.print("identical("),ast.lhs.visitExpression(this,ctx),ctx.print(", "),ast.rhs.visitExpression(this,ctx),ctx.print(")");break;case o.BinaryOperator.NotIdentical:ctx.print("!identical("),ast.lhs.visitExpression(this,ctx),ctx.print(", "),ast.rhs.visitExpression(this,ctx),ctx.print(")");break;default:_super.prototype.visitBinaryOperatorExpr.call(this,ast,ctx)}return null},_DartEmitterVisitor.prototype.visitLiteralArrayExpr=function(ast,ctx){return isConstType(ast.type)&&ctx.print("const "),_super.prototype.visitLiteralArrayExpr.call(this,ast,ctx)},_DartEmitterVisitor.prototype.visitLiteralMapExpr=function(ast,ctx){return isConstType(ast.type)&&ctx.print("const "),lang_1.isPresent(ast.valueType)&&(ctx.print("")),_super.prototype.visitLiteralMapExpr.call(this,ast,ctx)},_DartEmitterVisitor.prototype.visitInstantiateExpr=function(ast,ctx){return ctx.print(isConstType(ast.type)?"const":"new"),ctx.print(" "),ast.classExpr.visitExpression(this,ctx),ctx.print("("),this.visitAllExpressions(ast.args,ctx,","),ctx.print(")"),null},_DartEmitterVisitor.prototype.visitBuiltintType=function(type,ctx){var typeStr;switch(type.name){case o.BuiltinTypeName.Bool:typeStr="bool";break;case o.BuiltinTypeName.Dynamic:typeStr="dynamic";break;case o.BuiltinTypeName.Function:typeStr="Function";break;case o.BuiltinTypeName.Number:typeStr="num";break;case o.BuiltinTypeName.Int:typeStr="int";break;case o.BuiltinTypeName.String:typeStr="String";break;default:throw new exceptions_1.BaseException("Unsupported builtin type "+type.name)}return ctx.print(typeStr),null},_DartEmitterVisitor.prototype.visitExternalType=function(ast,ctx){return this._visitIdentifier(ast.value,ast.typeParams,ctx),null},_DartEmitterVisitor.prototype.visitArrayType=function(type,ctx){return ctx.print("List<"),lang_1.isPresent(type.of)?type.of.visitType(this,ctx):ctx.print("dynamic"),ctx.print(">"),null},_DartEmitterVisitor.prototype.visitMapType=function(type,ctx){return ctx.print("Map"),null},_DartEmitterVisitor.prototype._visitParams=function(params,ctx){var _this=this;this.visitAllObjects(function(param){lang_1.isPresent(param.type)&&(param.type.visitType(_this,ctx),ctx.print(" ")),ctx.print(param.name)},params,ctx,",")},_DartEmitterVisitor.prototype._visitIdentifier=function(value,typeParams,ctx){var _this=this;if(lang_1.isBlank(value.name))throw new exceptions_1.BaseException("Internal error: unknown identifier "+value);if(lang_1.isPresent(value.moduleUrl)&&value.moduleUrl!=this._moduleUrl){var prefix=this.importsWithPrefixes.get(value.moduleUrl);lang_1.isBlank(prefix)&&(prefix="import"+this.importsWithPrefixes.size,this.importsWithPrefixes.set(value.moduleUrl,prefix)),ctx.print(prefix+".")}ctx.print(value.name),lang_1.isPresent(typeParams)&&typeParams.length>0&&(ctx.print("<"),this.visitAllObjects(function(type){return type.visitType(_this,ctx)},typeParams,ctx,","),ctx.print(">"))},_DartEmitterVisitor}(abstract_emitter_1.AbstractEmitterVisitor);return module.exports}),$__System.registerDynamic("@angular/compiler/src/output/output_interpreter.js",["@angular/compiler/core_private.js","@angular/compiler/src/facade/async.js","@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/output/dart_emitter.js","@angular/compiler/src/output/output_ast.js","@angular/compiler/src/output/ts_emitter.js"],!0,function($__require,exports,module){"use strict";function interpretStatements(statements,resultVar,instanceFactory){var stmtsWithReturn=statements.concat([new o.ReturnStatement(o.variable(resultVar))]),ctx=new _ExecutionContext(null,null,null,null,new Map,new Map,new Map,new Map,instanceFactory),visitor=new StatementInterpreter,result=visitor.visitAllStatements(stmtsWithReturn,ctx);return lang_1.isPresent(result)?result.value:null}function isDynamicInstance(instance){return lang_1.IS_DART?instance instanceof DynamicInstance:lang_1.isPresent(instance)&&lang_1.isPresent(instance.props)&&lang_1.isPresent(instance.getters)&&lang_1.isPresent(instance.methods)}function _executeFunctionStatements(varNames,varValues,statements,ctx,visitor){for(var childCtx=ctx.createChildWihtLocalVars(),i=0;irhs();case o.BinaryOperator.BiggerEquals:return lhs()>=rhs();default:throw new exceptions_1.BaseException("Unknown operator "+ast.operator)}},StatementInterpreter.prototype.visitReadPropExpr=function(ast,ctx){var result,receiver=ast.receiver.visitExpression(this,ctx);if(isDynamicInstance(receiver)){var di=receiver;result=di.props.has(ast.name)?di.props.get(ast.name):di.getters.has(ast.name)?di.getters.get(ast.name)():di.methods.has(ast.name)?di.methods.get(ast.name):core_private_1.reflector.getter(ast.name)(receiver)}else result=core_private_1.reflector.getter(ast.name)(receiver);return result},StatementInterpreter.prototype.visitReadKeyExpr=function(ast,ctx){var receiver=ast.receiver.visitExpression(this,ctx),prop=ast.index.visitExpression(this,ctx);return receiver[prop]},StatementInterpreter.prototype.visitLiteralArrayExpr=function(ast,ctx){return this.visitAllExpressions(ast.entries,ctx)},StatementInterpreter.prototype.visitLiteralMapExpr=function(ast,ctx){var _this=this,result={};return ast.entries.forEach(function(entry){return result[entry[0]]=entry[1].visitExpression(_this,ctx)}),result},StatementInterpreter.prototype.visitAllExpressions=function(expressions,ctx){var _this=this;return expressions.map(function(expr){return expr.visitExpression(_this,ctx)})},StatementInterpreter.prototype.visitAllStatements=function(statements,ctx){for(var i=0;i0){var errorString=rootNodesAndErrors.errors.join("\n");throw new exceptions_1.BaseException("Template parse errors:\n"+errorString)}var templateMetadataStyles=this.normalizeStylesheet(new compile_metadata_1.CompileStylesheetMetadata({styles:templateMeta.styles,styleUrls:templateMeta.styleUrls,moduleUrl:directiveType.moduleUrl})),visitor=new TemplatePreparseVisitor;html_ast_1.htmlVisitAll(visitor,rootNodesAndErrors.rootNodes);var templateStyles=this.normalizeStylesheet(new compile_metadata_1.CompileStylesheetMetadata({styles:visitor.styles,styleUrls:visitor.styleUrls,moduleUrl:templateAbsUrl})),allStyles=templateMetadataStyles.styles.concat(templateStyles.styles),allStyleUrls=templateMetadataStyles.styleUrls.concat(templateStyles.styleUrls),encapsulation=templateMeta.encapsulation;return lang_1.isBlank(encapsulation)&&(encapsulation=this._config.defaultEncapsulation),encapsulation===core_1.ViewEncapsulation.Emulated&&0===allStyles.length&&0===allStyleUrls.length&&(encapsulation=core_1.ViewEncapsulation.None),new compile_metadata_1.CompileTemplateMetadata({encapsulation:encapsulation,template:template,templateUrl:templateAbsUrl,styles:allStyles,styleUrls:allStyleUrls,externalStylesheets:templateMeta.externalStylesheets,ngContentSelectors:visitor.ngContentSelectors,animations:templateMeta.animations,interpolation:templateMeta.interpolation})},DirectiveNormalizer.prototype.normalizeExternalStylesheets=function(templateMeta){return this._loadMissingExternalStylesheets(templateMeta.styleUrls).then(function(externalStylesheets){return new compile_metadata_1.CompileTemplateMetadata({encapsulation:templateMeta.encapsulation,template:templateMeta.template,templateUrl:templateMeta.templateUrl,styles:templateMeta.styles,styleUrls:templateMeta.styleUrls,externalStylesheets:externalStylesheets,ngContentSelectors:templateMeta.ngContentSelectors,animations:templateMeta.animations,interpolation:templateMeta.interpolation})})},DirectiveNormalizer.prototype._loadMissingExternalStylesheets=function(styleUrls,loadedStylesheets){var _this=this;return void 0===loadedStylesheets&&(loadedStylesheets=new Map),Promise.all(styleUrls.filter(function(styleUrl){return!loadedStylesheets.has(styleUrl)}).map(function(styleUrl){return _this._fetch(styleUrl).then(function(loadedStyle){var stylesheet=_this.normalizeStylesheet(new compile_metadata_1.CompileStylesheetMetadata({styles:[loadedStyle],moduleUrl:styleUrl}));return loadedStylesheets.set(styleUrl,stylesheet),_this._loadMissingExternalStylesheets(stylesheet.styleUrls,loadedStylesheets)})})).then(function(_){return collection_1.MapWrapper.values(loadedStylesheets)})},DirectiveNormalizer.prototype.normalizeStylesheet=function(stylesheet){var _this=this,allStyleUrls=stylesheet.styleUrls.filter(style_url_resolver_1.isStyleUrlResolvable).map(function(url){return _this._urlResolver.resolve(stylesheet.moduleUrl,url)}),allStyles=stylesheet.styles.map(function(style){var styleWithImports=style_url_resolver_1.extractStyleUrls(_this._urlResolver,stylesheet.moduleUrl,style);return allStyleUrls.push.apply(allStyleUrls,styleWithImports.styleUrls),styleWithImports.style});return new compile_metadata_1.CompileStylesheetMetadata({styles:allStyles,styleUrls:allStyleUrls,moduleUrl:stylesheet.moduleUrl})},DirectiveNormalizer.decorators=[{type:core_1.Injectable}],DirectiveNormalizer.ctorParameters=[{type:xhr_1.XHR},{type:url_resolver_1.UrlResolver},{type:html_parser_1.HtmlParser},{type:config_1.CompilerConfig}],DirectiveNormalizer}();exports.DirectiveNormalizer=DirectiveNormalizer;var TemplatePreparseVisitor=function(){function TemplatePreparseVisitor(){this.ngContentSelectors=[],this.styles=[],this.styleUrls=[],this.ngNonBindableStackCount=0}return TemplatePreparseVisitor.prototype.visitElement=function(ast,context){var preparsedElement=template_preparser_1.preparseElement(ast);switch(preparsedElement.type){case template_preparser_1.PreparsedElementType.NG_CONTENT:0===this.ngNonBindableStackCount&&this.ngContentSelectors.push(preparsedElement.selectAttr);break;case template_preparser_1.PreparsedElementType.STYLE:var textContent="";ast.children.forEach(function(child){child instanceof html_ast_1.HtmlTextAst&&(textContent+=child.value)}),this.styles.push(textContent);break;case template_preparser_1.PreparsedElementType.STYLESHEET:this.styleUrls.push(preparsedElement.hrefAttr)}return preparsedElement.nonBindable&&this.ngNonBindableStackCount++,html_ast_1.htmlVisitAll(this,ast.children),preparsedElement.nonBindable&&this.ngNonBindableStackCount--,null},TemplatePreparseVisitor.prototype.visitComment=function(ast,context){return null},TemplatePreparseVisitor.prototype.visitAttr=function(ast,context){return null},TemplatePreparseVisitor.prototype.visitText=function(ast,context){return null},TemplatePreparseVisitor.prototype.visitExpansion=function(ast,context){return null},TemplatePreparseVisitor.prototype.visitExpansionCase=function(ast,context){return null},TemplatePreparseVisitor}();return module.exports}),$__System.registerDynamic("@angular/compiler/src/i18n/expander.js",["@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/html_ast.js","@angular/compiler/src/i18n/shared.js"],!0,function($__require,exports,module){"use strict";function expandNodes(nodes){var expander=new _Expander;return new ExpansionResult(html_ast_1.htmlVisitAll(expander,nodes),expander.isExpanded,expander.errors)}function _expandPluralForm(ast,errors){var children=ast.cases.map(function(c){PLURAL_CASES.indexOf(c.value)!=-1||c.value.match(/^=\d+$/)||errors.push(new shared_1.I18nError(c.valueSourceSpan,'Plural cases should be "=" or one of '+PLURAL_CASES.join(", ")));var expansionResult=expandNodes(c.expression);return errors.push.apply(errors,expansionResult.errors),new html_ast_1.HtmlElementAst("template",[new html_ast_1.HtmlAttrAst("ngPluralCase",""+c.value,c.valueSourceSpan)],expansionResult.nodes,c.sourceSpan,c.sourceSpan,c.sourceSpan)}),switchAttr=new html_ast_1.HtmlAttrAst("[ngPlural]",ast.switchValue,ast.switchValueSourceSpan);return new html_ast_1.HtmlElementAst("ng-container",[switchAttr],children,ast.sourceSpan,ast.sourceSpan,ast.sourceSpan)}function _expandDefaultForm(ast,errors){var children=ast.cases.map(function(c){var expansionResult=expandNodes(c.expression);return errors.push.apply(errors,expansionResult.errors),new html_ast_1.HtmlElementAst("template",[new html_ast_1.HtmlAttrAst("ngSwitchCase",""+c.value,c.valueSourceSpan)],expansionResult.nodes,c.sourceSpan,c.sourceSpan,c.sourceSpan)}),switchAttr=new html_ast_1.HtmlAttrAst("[ngSwitch]",ast.switchValue,ast.switchValueSourceSpan);return new html_ast_1.HtmlElementAst("ng-container",[switchAttr],children,ast.sourceSpan,ast.sourceSpan,ast.sourceSpan)}var exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),html_ast_1=$__require("@angular/compiler/src/html_ast.js"),shared_1=$__require("@angular/compiler/src/i18n/shared.js"),PLURAL_CASES=["zero","one","two","few","many","other"];exports.expandNodes=expandNodes;var ExpansionResult=function(){function ExpansionResult(nodes,expanded,errors){this.nodes=nodes,this.expanded=expanded,this.errors=errors}return ExpansionResult}();exports.ExpansionResult=ExpansionResult;var _Expander=function(){function _Expander(){this.isExpanded=!1,this.errors=[]}return _Expander.prototype.visitElement=function(ast,context){return new html_ast_1.HtmlElementAst(ast.name,ast.attrs,html_ast_1.htmlVisitAll(this,ast.children),ast.sourceSpan,ast.startSourceSpan,ast.endSourceSpan)},_Expander.prototype.visitAttr=function(ast,context){return ast},_Expander.prototype.visitText=function(ast,context){return ast},_Expander.prototype.visitComment=function(ast,context){return ast},_Expander.prototype.visitExpansion=function(ast,context){return this.isExpanded=!0,"plural"==ast.type?_expandPluralForm(ast,this.errors):_expandDefaultForm(ast,this.errors)},_Expander.prototype.visitExpansionCase=function(ast,context){throw new exceptions_1.BaseException("Should not be reached")},_Expander}();return module.exports}),$__System.registerDynamic("@angular/compiler/src/i18n/i18n_html_parser.js",["@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/html_ast.js","@angular/compiler/src/html_parser.js","@angular/compiler/src/interpolation_config.js","@angular/compiler/src/i18n/expander.js","@angular/compiler/src/i18n/message.js","@angular/compiler/src/i18n/shared.js"],!0,function($__require,exports,module){"use strict";var collection_1=$__require("@angular/compiler/src/facade/collection.js"),exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),html_ast_1=$__require("@angular/compiler/src/html_ast.js"),html_parser_1=$__require("@angular/compiler/src/html_parser.js"),interpolation_config_1=$__require("@angular/compiler/src/interpolation_config.js"),expander_1=$__require("@angular/compiler/src/i18n/expander.js"),message_1=$__require("@angular/compiler/src/i18n/message.js"),shared_1=$__require("@angular/compiler/src/i18n/shared.js"),_PLACEHOLDER_ELEMENT="ph",_NAME_ATTR="name",_PLACEHOLDER_EXPANDED_REGEXP=/<\/ph>/gi,I18nHtmlParser=function(){function I18nHtmlParser(_htmlParser,_parser,_messagesContent,_messages,_implicitTags,_implicitAttrs){this._htmlParser=_htmlParser,this._parser=_parser,this._messagesContent=_messagesContent,this._messages=_messages,this._implicitTags=_implicitTags,this._implicitAttrs=_implicitAttrs}return I18nHtmlParser.prototype.parse=function(sourceContent,sourceUrl,parseExpansionForms,interpolationConfig){void 0===parseExpansionForms&&(parseExpansionForms=!1),void 0===interpolationConfig&&(interpolationConfig=interpolation_config_1.DEFAULT_INTERPOLATION_CONFIG),this.errors=[],this._interpolationConfig=interpolationConfig;var res=this._htmlParser.parse(sourceContent,sourceUrl,!0);if(res.errors.length>0)return res;var expanded=expander_1.expandNodes(res.rootNodes),nodes=this._recurse(expanded.nodes);return(_a=this.errors).push.apply(_a,expanded.errors),this.errors.length>0?new html_parser_1.HtmlParseTreeResult([],this.errors):new html_parser_1.HtmlParseTreeResult(nodes,[]);var _a},I18nHtmlParser.prototype._processI18nPart=function(part){try{return part.hasI18n?this._mergeI18Part(part):this._recurseIntoI18nPart(part)}catch(e){if(e instanceof shared_1.I18nError)return this.errors.push(e),[];throw e}},I18nHtmlParser.prototype._mergeI18Part=function(part){var message=part.createMessage(this._parser,this._interpolationConfig),messageId=message_1.id(message);if(!collection_1.StringMapWrapper.contains(this._messages,messageId))throw new shared_1.I18nError(part.sourceSpan,"Cannot find message for id '"+messageId+"', content '"+message.content+"'.");var parsedMessage=this._messages[messageId];return this._mergeTrees(part,parsedMessage,part.children)},I18nHtmlParser.prototype._recurseIntoI18nPart=function(p){if(lang_1.isPresent(p.rootElement)){var root=p.rootElement,children=this._recurse(p.children),attrs=this._i18nAttributes(root);return[new html_ast_1.HtmlElementAst(root.name,attrs,children,root.sourceSpan,root.startSourceSpan,root.endSourceSpan)]}return lang_1.isPresent(p.rootTextNode)?[p.rootTextNode]:this._recurse(p.children)},I18nHtmlParser.prototype._recurse=function(nodes){var _this=this,parts=shared_1.partition(nodes,this.errors,this._implicitTags);return collection_1.ListWrapper.flatten(parts.map(function(p){return _this._processI18nPart(p)}))},I18nHtmlParser.prototype._mergeTrees=function(p,translated,original){var l=new _CreateNodeMapping;html_ast_1.htmlVisitAll(l,original);var merged=this._mergeTreesHelper(translated,l.mapping);if(lang_1.isPresent(p.rootElement)){var root=p.rootElement,attrs=this._i18nAttributes(root);return[new html_ast_1.HtmlElementAst(root.name,attrs,merged,root.sourceSpan,root.startSourceSpan,root.endSourceSpan)]}if(lang_1.isPresent(p.rootTextNode))throw new exceptions_1.BaseException("should not be reached");return merged},I18nHtmlParser.prototype._mergeTreesHelper=function(translated,mapping){var _this=this;return translated.map(function(t){if(t instanceof html_ast_1.HtmlElementAst)return _this._mergeElementOrInterpolation(t,translated,mapping);if(t instanceof html_ast_1.HtmlTextAst)return t;throw new exceptions_1.BaseException("should not be reached")})},I18nHtmlParser.prototype._mergeElementOrInterpolation=function(t,translated,mapping){var name=this._getName(t),type=name[0],index=lang_1.NumberWrapper.parseInt(name.substring(1),10),originalNode=mapping[index];if("t"==type)return this._mergeTextInterpolation(t,originalNode);if("e"==type)return this._mergeElement(t,originalNode,mapping);throw new exceptions_1.BaseException("should not be reached")},I18nHtmlParser.prototype._getName=function(t){if(t.name!=_PLACEHOLDER_ELEMENT)throw new shared_1.I18nError(t.sourceSpan,'Unexpected tag "'+t.name+'". Only "'+_PLACEHOLDER_ELEMENT+'" tags are allowed.');var names=t.attrs.filter(function(a){return a.name==_NAME_ATTR});if(0==names.length)throw new shared_1.I18nError(t.sourceSpan,'Missing "'+_NAME_ATTR+'" attribute.');return names[0].value},I18nHtmlParser.prototype._mergeTextInterpolation=function(t,originalNode){var split=this._parser.splitInterpolation(originalNode.value,originalNode.sourceSpan.toString(),this._interpolationConfig),exps=lang_1.isPresent(split)?split.expressions:[],messageSubstring=this._messagesContent.substring(t.startSourceSpan.end.offset,t.endSourceSpan.start.offset),translated=this._replacePlaceholdersWithExpressions(messageSubstring,exps,originalNode.sourceSpan);return new html_ast_1.HtmlTextAst(translated,originalNode.sourceSpan)},I18nHtmlParser.prototype._mergeElement=function(t,originalNode,mapping){var children=this._mergeTreesHelper(t.children,mapping);return new html_ast_1.HtmlElementAst(originalNode.name,this._i18nAttributes(originalNode),children,originalNode.sourceSpan,originalNode.startSourceSpan,originalNode.endSourceSpan)},I18nHtmlParser.prototype._i18nAttributes=function(el){var _this=this,res=[],implicitAttrs=lang_1.isPresent(this._implicitAttrs[el.name])?this._implicitAttrs[el.name]:[];return el.attrs.forEach(function(attr){if(!attr.name.startsWith(shared_1.I18N_ATTR_PREFIX)&&attr.name!=shared_1.I18N_ATTR){var message,i18ns=el.attrs.filter(function(a){return a.name==""+shared_1.I18N_ATTR_PREFIX+attr.name});if(0==i18ns.length){if(implicitAttrs.indexOf(attr.name)==-1)return void res.push(attr);message=shared_1.messageFromAttribute(_this._parser,_this._interpolationConfig,attr)}else message=shared_1.messageFromI18nAttribute(_this._parser,_this._interpolationConfig,el,i18ns[0]);var messageId=message_1.id(message);if(!collection_1.StringMapWrapper.contains(_this._messages,messageId))throw new shared_1.I18nError(attr.sourceSpan,"Cannot find message for id '"+messageId+"', content '"+message.content+"'.");var updatedMessage=_this._replaceInterpolationInAttr(attr,_this._messages[messageId]);res.push(new html_ast_1.HtmlAttrAst(attr.name,updatedMessage,attr.sourceSpan))}}),res},I18nHtmlParser.prototype._replaceInterpolationInAttr=function(attr,msg){var split=this._parser.splitInterpolation(attr.value,attr.sourceSpan.toString(),this._interpolationConfig),exps=lang_1.isPresent(split)?split.expressions:[],first=msg[0],last=msg[msg.length-1],start=first.sourceSpan.start.offset,end=last instanceof html_ast_1.HtmlElementAst?last.endSourceSpan.end.offset:last.sourceSpan.end.offset,messageSubstring=this._messagesContent.substring(start,end);return this._replacePlaceholdersWithExpressions(messageSubstring,exps,attr.sourceSpan)},I18nHtmlParser.prototype._replacePlaceholdersWithExpressions=function(message,exps,sourceSpan){var _this=this,expMap=this._buildExprMap(exps);return lang_1.RegExpWrapper.replaceAll(_PLACEHOLDER_EXPANDED_REGEXP,message,function(match){var nameWithQuotes=match[2],name=nameWithQuotes.substring(1,nameWithQuotes.length-1);return _this._convertIntoExpression(name,expMap,sourceSpan)})},I18nHtmlParser.prototype._buildExprMap=function(exps){for(var expMap=new Map,usedNames=new Map,i=0;i-1;parts.push(new Part(node,null,node.children,lang_1.isPresent(i18n)?i18n.value:null,hasI18n))}else node instanceof html_ast_1.HtmlTextAst&&parts.push(new Part(null,node,null,null,(!1)))}return parts}function _isOpeningComment(n){return n instanceof html_ast_1.HtmlCommentAst&&lang_1.isPresent(n.value)&&n.value.startsWith("i18n")}function _isClosingComment(n){return n instanceof html_ast_1.HtmlCommentAst&&lang_1.isPresent(n.value)&&"/i18n"===n.value}function _findI18nAttr(p){for(var attrs=p.attrs,i=0;i1?parts[1]:null}function messageFromI18nAttribute(parser,interpolationConfig,p,i18nAttr){ var expectedName=i18nAttr.name.substring(5),attr=p.attrs.find(function(a){return a.name==expectedName});if(attr)return messageFromAttribute(parser,interpolationConfig,attr,meaning(i18nAttr.value),description(i18nAttr.value));throw new I18nError(p.sourceSpan,"Missing attribute '"+expectedName+"'.")}function messageFromAttribute(parser,interpolationConfig,attr,meaning,description){void 0===meaning&&(meaning=null),void 0===description&&(description=null);var value=removeInterpolation(attr.value,attr.sourceSpan,parser,interpolationConfig);return new message_1.Message(value,meaning,description)}function removeInterpolation(value,source,parser,interpolationConfig){try{var parsed=parser.splitInterpolation(value,source.toString(),interpolationConfig),usedNames=new Map;if(lang_1.isPresent(parsed)){for(var res="",i=0;i'}return res}return value}catch(e){return value}}function getPhNameFromBinding(input,index){var customPhMatch=lang_1.StringWrapper.split(input,CUSTOM_PH_EXP);return customPhMatch.length>1?customPhMatch[1]:""+index}function dedupePhName(usedNames,name){var duplicateNameCount=usedNames.get(name);return lang_1.isPresent(duplicateNameCount)?(usedNames.set(name,duplicateNameCount+1),name+"_"+duplicateNameCount):(usedNames.set(name,1),name)}function stringifyNodes(nodes,parser,interpolationConfig){var visitor=new _StringifyVisitor(parser,interpolationConfig);return html_ast_1.htmlVisitAll(visitor,nodes).join("")}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},lang_1=$__require("@angular/compiler/src/facade/lang.js"),html_ast_1=$__require("@angular/compiler/src/html_ast.js"),parse_util_1=$__require("@angular/compiler/src/parse_util.js"),message_1=$__require("@angular/compiler/src/i18n/message.js");exports.I18N_ATTR="i18n",exports.I18N_ATTR_PREFIX="i18n-";var CUSTOM_PH_EXP=/\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*"([\s\S]*?)"[\s\S]*\)/g,I18nError=function(_super){function I18nError(span,msg){_super.call(this,span,msg)}return __extends(I18nError,_super),I18nError}(parse_util_1.ParseError);exports.I18nError=I18nError,exports.partition=partition;var Part=function(){function Part(rootElement,rootTextNode,children,i18n,hasI18n){this.rootElement=rootElement,this.rootTextNode=rootTextNode,this.children=children,this.i18n=i18n,this.hasI18n=hasI18n}return Object.defineProperty(Part.prototype,"sourceSpan",{get:function(){return lang_1.isPresent(this.rootElement)?this.rootElement.sourceSpan:lang_1.isPresent(this.rootTextNode)?this.rootTextNode.sourceSpan:this.children[0].sourceSpan},enumerable:!0,configurable:!0}),Part.prototype.createMessage=function(parser,interpolationConfig){return new message_1.Message(stringifyNodes(this.children,parser,interpolationConfig),meaning(this.i18n),description(this.i18n))},Part}();exports.Part=Part,exports.meaning=meaning,exports.description=description,exports.messageFromI18nAttribute=messageFromI18nAttribute,exports.messageFromAttribute=messageFromAttribute,exports.removeInterpolation=removeInterpolation,exports.getPhNameFromBinding=getPhNameFromBinding,exports.dedupePhName=dedupePhName,exports.stringifyNodes=stringifyNodes;var _StringifyVisitor=function(){function _StringifyVisitor(_parser,_interpolationConfig){this._parser=_parser,this._interpolationConfig=_interpolationConfig,this._index=0}return _StringifyVisitor.prototype.visitElement=function(ast,context){var name=this._index++,children=this._join(html_ast_1.htmlVisitAll(this,ast.children),"");return''+children+""},_StringifyVisitor.prototype.visitAttr=function(ast,context){return null},_StringifyVisitor.prototype.visitText=function(ast,context){var index=this._index++,noInterpolation=removeInterpolation(ast.value,ast.sourceSpan,this._parser,this._interpolationConfig);return noInterpolation!=ast.value?''+noInterpolation+"":ast.value},_StringifyVisitor.prototype.visitComment=function(ast,context){return""},_StringifyVisitor.prototype.visitExpansion=function(ast,context){return null},_StringifyVisitor.prototype.visitExpansionCase=function(ast,context){return null},_StringifyVisitor.prototype._join=function(strs,str){return strs.filter(function(s){return s.length>0}).join(str)},_StringifyVisitor}();return module.exports}),$__System.registerDynamic("@angular/compiler/src/i18n/message_extractor.js",["@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/html_ast.js","@angular/compiler/src/interpolation_config.js","@angular/compiler/src/i18n/message.js","@angular/compiler/src/i18n/shared.js"],!0,function($__require,exports,module){"use strict";function removeDuplicates(messages){var uniq={};return messages.forEach(function(m){collection_1.StringMapWrapper.contains(uniq,message_1.id(m))||(uniq[message_1.id(m)]=m)}),collection_1.StringMapWrapper.values(uniq)}var collection_1=$__require("@angular/compiler/src/facade/collection.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),html_ast_1=$__require("@angular/compiler/src/html_ast.js"),interpolation_config_1=$__require("@angular/compiler/src/interpolation_config.js"),message_1=$__require("@angular/compiler/src/i18n/message.js"),shared_1=$__require("@angular/compiler/src/i18n/shared.js"),ExtractionResult=function(){function ExtractionResult(messages,errors){this.messages=messages,this.errors=errors}return ExtractionResult}();exports.ExtractionResult=ExtractionResult,exports.removeDuplicates=removeDuplicates;var MessageExtractor=function(){function MessageExtractor(_htmlParser,_parser,_implicitTags,_implicitAttrs){this._htmlParser=_htmlParser,this._parser=_parser,this._implicitTags=_implicitTags,this._implicitAttrs=_implicitAttrs}return MessageExtractor.prototype.extract=function(template,sourceUrl,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=interpolation_config_1.DEFAULT_INTERPOLATION_CONFIG),this._messages=[],this._errors=[];var res=this._htmlParser.parse(template,sourceUrl,!0);return 0==res.errors.length&&this._recurse(res.rootNodes,interpolationConfig),new ExtractionResult(this._messages,this._errors.concat(res.errors))},MessageExtractor.prototype._extractMessagesFromPart=function(part,interpolationConfig){part.hasI18n?(this._messages.push(part.createMessage(this._parser,interpolationConfig)),this._recurseToExtractMessagesFromAttributes(part.children,interpolationConfig)):this._recurse(part.children,interpolationConfig),lang_1.isPresent(part.rootElement)&&this._extractMessagesFromAttributes(part.rootElement,interpolationConfig)},MessageExtractor.prototype._recurse=function(nodes,interpolationConfig){var _this=this;if(lang_1.isPresent(nodes)){var parts=shared_1.partition(nodes,this._errors,this._implicitTags);parts.forEach(function(part){return _this._extractMessagesFromPart(part,interpolationConfig)})}},MessageExtractor.prototype._recurseToExtractMessagesFromAttributes=function(nodes,interpolationConfig){var _this=this;nodes.forEach(function(n){n instanceof html_ast_1.HtmlElementAst&&(_this._extractMessagesFromAttributes(n,interpolationConfig),_this._recurseToExtractMessagesFromAttributes(n.children,interpolationConfig))})},MessageExtractor.prototype._extractMessagesFromAttributes=function(p,interpolationConfig){var _this=this,transAttrs=lang_1.isPresent(this._implicitAttrs[p.name])?this._implicitAttrs[p.name]:[],explicitAttrs=[];p.attrs.filter(function(attr){return attr.name.startsWith(shared_1.I18N_ATTR_PREFIX)}).forEach(function(attr){try{explicitAttrs.push(attr.name.substring(shared_1.I18N_ATTR_PREFIX.length)),_this._messages.push(shared_1.messageFromI18nAttribute(_this._parser,interpolationConfig,p,attr))}catch(e){if(!(e instanceof shared_1.I18nError))throw e;_this._errors.push(e)}}),p.attrs.filter(function(attr){return!attr.name.startsWith(shared_1.I18N_ATTR_PREFIX)}).filter(function(attr){return explicitAttrs.indexOf(attr.name)==-1}).filter(function(attr){return transAttrs.indexOf(attr.name)>-1}).forEach(function(attr){return _this._messages.push(shared_1.messageFromAttribute(_this._parser,interpolationConfig,attr))})},MessageExtractor}();return exports.MessageExtractor=MessageExtractor,module.exports}),$__System.registerDynamic("@angular/compiler/src/i18n/message.js",["@angular/compiler/src/facade/lang.js"],!0,function($__require,exports,module){"use strict";function id(m){var meaning=lang_1.isPresent(m.meaning)?m.meaning:"",content=lang_1.isPresent(m.content)?m.content:"";return lang_1.escape("$ng|"+meaning+"|"+content)}var lang_1=$__require("@angular/compiler/src/facade/lang.js"),Message=function(){function Message(content,meaning,description){void 0===description&&(description=null),this.content=content,this.meaning=meaning,this.description=description}return Message}();return exports.Message=Message,exports.id=id,module.exports}),$__System.registerDynamic("@angular/compiler/src/i18n/xmb_serializer.js",["@angular/compiler/src/facade/lang.js","@angular/compiler/src/html_ast.js","@angular/compiler/src/html_parser.js","@angular/compiler/src/parse_util.js","@angular/compiler/src/i18n/message.js"],!0,function($__require,exports,module){"use strict";function serializeXmb(messages){var ms=messages.map(function(m){return _serializeMessage(m)}).join("");return""+ms+""}function deserializeXmb(content,url){var parser=new html_parser_1.HtmlParser,normalizedContent=_expandPlaceholder(content.trim()),parsed=parser.parse(normalizedContent,url);if(parsed.errors.length>0)return new XmbDeserializationResult(null,{},parsed.errors);if(_checkRootElement(parsed.rootNodes))return new XmbDeserializationResult(null,{},[new XmbDeserializationError(null,'Missing element "'+_BUNDLE_ELEMENT+'"')]);var bundleEl=parsed.rootNodes[0],errors=[],messages={};return _createMessages(bundleEl.children,messages,errors),0==errors.length?new XmbDeserializationResult(normalizedContent,messages,[]):new XmbDeserializationResult(null,{},errors)}function _checkRootElement(nodes){return nodes.length<1||!(nodes[0]instanceof html_ast_1.HtmlElementAst)||nodes[0].name!=_BUNDLE_ELEMENT}function _createMessages(nodes,messages,errors){nodes.forEach(function(item){if(item instanceof html_ast_1.HtmlElementAst){var msg=item;if(msg.name!=_MSG_ELEMENT)return void errors.push(new XmbDeserializationError(item.sourceSpan,'Unexpected element "'+msg.name+'"'));var id_1=_id(msg);if(lang_1.isBlank(id_1))return void errors.push(new XmbDeserializationError(item.sourceSpan,'"'+_ID_ATTR+'" attribute is missing'));messages[id_1]=msg.children}})}function _id(el){var ids=el.attrs.filter(function(a){return a.name==_ID_ATTR});return ids.length>0?ids[0].value:null}function _serializeMessage(m){var desc=lang_1.isPresent(m.description)?" desc='"+_escapeXml(m.description)+"'":"",meaning=lang_1.isPresent(m.meaning)?" meaning='"+_escapeXml(m.meaning)+"'":"";return""+m.content+""}function _expandPlaceholder(input){return lang_1.RegExpWrapper.replaceAll(_PLACEHOLDER_REGEXP,input,function(match){var nameWithQuotes=match[2];return""})}function _escapeXml(value){return _XML_ESCAPED_CHARS.reduce(function(value,escape){return value.replace(escape[0],escape[1])},value)}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},lang_1=$__require("@angular/compiler/src/facade/lang.js"),html_ast_1=$__require("@angular/compiler/src/html_ast.js"),html_parser_1=$__require("@angular/compiler/src/html_parser.js"),parse_util_1=$__require("@angular/compiler/src/parse_util.js"),message_1=$__require("@angular/compiler/src/i18n/message.js"),_PLACEHOLDER_REGEXP=lang_1.RegExpWrapper.create('\\'),_ID_ATTR="id",_MSG_ELEMENT="msg",_BUNDLE_ELEMENT="message-bundle";exports.serializeXmb=serializeXmb;var XmbDeserializationResult=function(){function XmbDeserializationResult(content,messages,errors){this.content=content,this.messages=messages,this.errors=errors}return XmbDeserializationResult}();exports.XmbDeserializationResult=XmbDeserializationResult;var XmbDeserializationError=function(_super){function XmbDeserializationError(span,msg){_super.call(this,span,msg)}return __extends(XmbDeserializationError,_super),XmbDeserializationError}(parse_util_1.ParseError);exports.XmbDeserializationError=XmbDeserializationError,exports.deserializeXmb=deserializeXmb;var _XML_ESCAPED_CHARS=[[/&/g,"&"],[/"/g,"""],[/'/g,"'"],[//g,">"]];return module.exports}),$__System.registerDynamic("@angular/compiler/src/assertions.js",["@angular/core/index.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js"],!0,function($__require,exports,module){"use strict";function assertArrayOfStrings(identifier,value){if(core_1.isDevMode()&&!lang_1.isBlank(value)){if(!lang_1.isArray(value))throw new exceptions_1.BaseException("Expected '"+identifier+"' to be an array of strings.");for(var i=0;i]/,/^[{}]$/,/&(#|[a-z])/i];return exports.assertInterpolationSymbols=assertInterpolationSymbols,module.exports}),$__System.registerDynamic("@angular/compiler/src/directive_lifecycle_reflector.js",["@angular/core/index.js","@angular/compiler/core_private.js","@angular/compiler/src/facade/collection.js"],!0,function($__require,exports,module){"use strict";function hasLifecycleHook(hook,token){var lcInterface=LIFECYCLE_INTERFACES.get(hook),lcProp=LIFECYCLE_PROPS.get(hook);return core_private_1.reflector.hasLifecycleHook(token,lcInterface,lcProp)}var core_1=$__require("@angular/core/index.js"),core_private_1=$__require("@angular/compiler/core_private.js"),collection_1=$__require("@angular/compiler/src/facade/collection.js"),LIFECYCLE_INTERFACES=collection_1.MapWrapper.createFromPairs([[core_private_1.LifecycleHooks.OnInit,core_1.OnInit],[core_private_1.LifecycleHooks.OnDestroy,core_1.OnDestroy],[core_private_1.LifecycleHooks.DoCheck,core_1.DoCheck],[core_private_1.LifecycleHooks.OnChanges,core_1.OnChanges],[core_private_1.LifecycleHooks.AfterContentInit,core_1.AfterContentInit],[core_private_1.LifecycleHooks.AfterContentChecked,core_1.AfterContentChecked],[core_private_1.LifecycleHooks.AfterViewInit,core_1.AfterViewInit],[core_private_1.LifecycleHooks.AfterViewChecked,core_1.AfterViewChecked]]),LIFECYCLE_PROPS=collection_1.MapWrapper.createFromPairs([[core_private_1.LifecycleHooks.OnInit,"ngOnInit"],[core_private_1.LifecycleHooks.OnDestroy,"ngOnDestroy"],[core_private_1.LifecycleHooks.DoCheck,"ngDoCheck"],[core_private_1.LifecycleHooks.OnChanges,"ngOnChanges"],[core_private_1.LifecycleHooks.AfterContentInit,"ngAfterContentInit"],[core_private_1.LifecycleHooks.AfterContentChecked,"ngAfterContentChecked"],[core_private_1.LifecycleHooks.AfterViewInit,"ngAfterViewInit"],[core_private_1.LifecycleHooks.AfterViewChecked,"ngAfterViewChecked"]]);return exports.hasLifecycleHook=hasLifecycleHook,module.exports}),$__System.registerDynamic("@angular/compiler/src/directive_resolver.js",["@angular/core/index.js","@angular/compiler/core_private.js","@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js"],!0,function($__require,exports,module){"use strict";function _isDirectiveMetadata(type){return type instanceof core_1.DirectiveMetadata}var core_1=$__require("@angular/core/index.js"),core_private_1=$__require("@angular/compiler/core_private.js"),collection_1=$__require("@angular/compiler/src/facade/collection.js"),exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),DirectiveResolver=function(){function DirectiveResolver(_reflector){void 0===_reflector&&(_reflector=core_private_1.reflector),this._reflector=_reflector}return DirectiveResolver.prototype.resolve=function(type){var typeMetadata=this._reflector.annotations(core_1.resolveForwardRef(type));if(lang_1.isPresent(typeMetadata)){var metadata=typeMetadata.find(_isDirectiveMetadata);if(lang_1.isPresent(metadata)){var propertyMetadata=this._reflector.propMetadata(type);return this._mergeWithPropertyMetadata(metadata,propertyMetadata,type)}}throw new exceptions_1.BaseException("No Directive annotation found on "+lang_1.stringify(type))},DirectiveResolver.prototype._mergeWithPropertyMetadata=function(dm,propertyMetadata,directiveType){var inputs=[],outputs=[],host={},queries={};return collection_1.StringMapWrapper.forEach(propertyMetadata,function(metadata,propName){metadata.forEach(function(a){if(a instanceof core_1.InputMetadata&&(lang_1.isPresent(a.bindingPropertyName)?inputs.push(propName+": "+a.bindingPropertyName):inputs.push(propName)),a instanceof core_1.OutputMetadata&&(lang_1.isPresent(a.bindingPropertyName)?outputs.push(propName+": "+a.bindingPropertyName):outputs.push(propName)),a instanceof core_1.HostBindingMetadata&&(lang_1.isPresent(a.hostPropertyName)?host["["+a.hostPropertyName+"]"]=propName:host["["+propName+"]"]=propName),a instanceof core_1.HostListenerMetadata){var args=lang_1.isPresent(a.args)?a.args.join(", "):"";host["("+a.eventName+")"]=propName+"("+args+")"}a instanceof core_1.QueryMetadata&&(queries[propName]=a)})}),this._merge(dm,inputs,outputs,host,queries,directiveType)},DirectiveResolver.prototype._merge=function(dm,inputs,outputs,host,queries,directiveType){var mergedOutputs,mergedInputs=lang_1.isPresent(dm.inputs)?collection_1.ListWrapper.concat(dm.inputs,inputs):inputs;lang_1.isPresent(dm.outputs)?(dm.outputs.forEach(function(propName){if(collection_1.ListWrapper.contains(outputs,propName))throw new exceptions_1.BaseException("Output event '"+propName+"' defined multiple times in '"+lang_1.stringify(directiveType)+"'")}),mergedOutputs=collection_1.ListWrapper.concat(dm.outputs,outputs)):mergedOutputs=outputs;var mergedHost=lang_1.isPresent(dm.host)?collection_1.StringMapWrapper.merge(dm.host,host):host,mergedQueries=lang_1.isPresent(dm.queries)?collection_1.StringMapWrapper.merge(dm.queries,queries):queries;return dm instanceof core_1.ComponentMetadata?new core_1.ComponentMetadata({selector:dm.selector,inputs:mergedInputs,outputs:mergedOutputs,host:mergedHost,exportAs:dm.exportAs,moduleId:dm.moduleId,queries:mergedQueries,changeDetection:dm.changeDetection,providers:dm.providers,viewProviders:dm.viewProviders,precompile:dm.precompile}):new core_1.DirectiveMetadata({selector:dm.selector,inputs:mergedInputs,outputs:mergedOutputs,host:mergedHost,exportAs:dm.exportAs,queries:mergedQueries,providers:dm.providers})},DirectiveResolver.decorators=[{type:core_1.Injectable}],DirectiveResolver.ctorParameters=[{type:core_private_1.ReflectorReader}],DirectiveResolver}();return exports.DirectiveResolver=DirectiveResolver,exports.CODEGEN_DIRECTIVE_RESOLVER=new DirectiveResolver(core_private_1.reflector),module.exports}),$__System.registerDynamic("@angular/compiler/src/pipe_resolver.js",["@angular/core/index.js","@angular/compiler/core_private.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js"],!0,function($__require,exports,module){"use strict";function _isPipeMetadata(type){return type instanceof core_1.PipeMetadata}var core_1=$__require("@angular/core/index.js"),core_private_1=$__require("@angular/compiler/core_private.js"),exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),PipeResolver=function(){function PipeResolver(_reflector){void 0===_reflector&&(_reflector=core_private_1.reflector),this._reflector=_reflector}return PipeResolver.prototype.resolve=function(type){var metas=this._reflector.annotations(core_1.resolveForwardRef(type));if(lang_1.isPresent(metas)){var annotation=metas.find(_isPipeMetadata);if(lang_1.isPresent(annotation))return annotation}throw new exceptions_1.BaseException("No Pipe decorator found on "+lang_1.stringify(type))},PipeResolver.decorators=[{type:core_1.Injectable}],PipeResolver.ctorParameters=[{type:core_private_1.ReflectorReader}],PipeResolver}();return exports.PipeResolver=PipeResolver,module.exports}),$__System.registerDynamic("@angular/compiler/src/view_resolver.js",["@angular/core/index.js","@angular/compiler/core_private.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/facade/exceptions.js"],!0,function($__require,exports,module){"use strict";var core_1=$__require("@angular/core/index.js"),core_private_1=$__require("@angular/compiler/core_private.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),ViewResolver=function(){function ViewResolver(_reflector){void 0===_reflector&&(_reflector=core_private_1.reflector),this._reflector=_reflector}return ViewResolver.prototype.resolve=function(component){var compMeta;if(this._reflector.annotations(component).forEach(function(m){m instanceof core_1.ComponentMetadata&&(compMeta=m)}),lang_1.isPresent(compMeta)){if(lang_1.isBlank(compMeta.template)&&lang_1.isBlank(compMeta.templateUrl))throw new exceptions_1.BaseException("Component '"+lang_1.stringify(component)+"' must have either 'template' or 'templateUrl' set.");return new core_1.ViewMetadata({templateUrl:compMeta.templateUrl,template:compMeta.template,directives:compMeta.directives,pipes:compMeta.pipes,encapsulation:compMeta.encapsulation,styles:compMeta.styles,styleUrls:compMeta.styleUrls,animations:compMeta.animations,interpolation:compMeta.interpolation})}throw new exceptions_1.BaseException("Could not compile '"+lang_1.stringify(component)+"' because it is not a component.")},ViewResolver.decorators=[{type:core_1.Injectable}],ViewResolver.ctorParameters=[{type:core_private_1.ReflectorReader}],ViewResolver}();return exports.ViewResolver=ViewResolver,module.exports}),$__System.registerDynamic("@angular/compiler/src/metadata_resolver.js",["@angular/core/index.js","@angular/compiler/core_private.js","@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/assertions.js","@angular/compiler/src/compile_metadata.js","@angular/compiler/src/config.js","@angular/compiler/src/directive_lifecycle_reflector.js","@angular/compiler/src/directive_resolver.js","@angular/compiler/src/pipe_resolver.js","@angular/compiler/src/url_resolver.js","@angular/compiler/src/util.js","@angular/compiler/src/view_resolver.js"],!0,function($__require,exports,module){"use strict";function flattenDirectives(view,platformDirectives){var directives=[];return lang_1.isPresent(platformDirectives)&&flattenArray(platformDirectives,directives),lang_1.isPresent(view.directives)&&flattenArray(view.directives,directives),directives}function flattenPipes(view,platformPipes){var pipes=[];return lang_1.isPresent(platformPipes)&&flattenArray(platformPipes,pipes),lang_1.isPresent(view.pipes)&&flattenArray(view.pipes,pipes),pipes}function flattenArray(tree,out){void 0===out&&(out=[]);for(var i=0;i0?moduleId:"package:"+moduleId+util_1.MODULE_SUFFIX}return reflector.importUri(type)}function convertToCompileValue(value){return util_1.visitValue(value,new _CompileValueConverter,null)}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},core_1=$__require("@angular/core/index.js"),core_private_1=$__require("@angular/compiler/core_private.js"),collection_1=$__require("@angular/compiler/src/facade/collection.js"),exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),assertions_1=$__require("@angular/compiler/src/assertions.js"),cpl=$__require("@angular/compiler/src/compile_metadata.js"),config_1=$__require("@angular/compiler/src/config.js"),directive_lifecycle_reflector_1=$__require("@angular/compiler/src/directive_lifecycle_reflector.js"),directive_resolver_1=$__require("@angular/compiler/src/directive_resolver.js"),pipe_resolver_1=$__require("@angular/compiler/src/pipe_resolver.js"),url_resolver_1=$__require("@angular/compiler/src/url_resolver.js"),util_1=$__require("@angular/compiler/src/util.js"),view_resolver_1=$__require("@angular/compiler/src/view_resolver.js"),CompileMetadataResolver=function(){function CompileMetadataResolver(_directiveResolver,_pipeResolver,_viewResolver,_config,_reflector){void 0===_reflector&&(_reflector=core_private_1.reflector),this._directiveResolver=_directiveResolver,this._pipeResolver=_pipeResolver,this._viewResolver=_viewResolver,this._config=_config,this._reflector=_reflector,this._directiveCache=new Map,this._pipeCache=new Map,this._anonymousTypes=new Map,this._anonymousTypeIndex=0}return CompileMetadataResolver.prototype.sanitizeTokenName=function(token){var identifier=lang_1.stringify(token);if(identifier.indexOf("(")>=0){var found=this._anonymousTypes.get(token);lang_1.isBlank(found)&&(this._anonymousTypes.set(token,this._anonymousTypeIndex++),found=this._anonymousTypes.get(token)),identifier="anonymous_token_"+found+"_"}return util_1.sanitizeIdentifier(identifier)},CompileMetadataResolver.prototype.clearCacheFor=function(compType){this._directiveCache["delete"](compType),this._pipeCache["delete"](compType)},CompileMetadataResolver.prototype.clearCache=function(){this._directiveCache.clear(),this._pipeCache.clear()},CompileMetadataResolver.prototype.getAnimationEntryMetadata=function(entry){var _this=this,defs=entry.definitions.map(function(def){return _this.getAnimationStateMetadata(def)});return new cpl.CompileAnimationEntryMetadata(entry.name,defs)},CompileMetadataResolver.prototype.getAnimationStateMetadata=function(value){if(value instanceof core_1.AnimationStateDeclarationMetadata){var styles=this.getAnimationStyleMetadata(value.styles);return new cpl.CompileAnimationStateDeclarationMetadata(value.stateNameExpr,styles)}return value instanceof core_1.AnimationStateTransitionMetadata?new cpl.CompileAnimationStateTransitionMetadata(value.stateChangeExpr,this.getAnimationMetadata(value.steps)):null},CompileMetadataResolver.prototype.getAnimationStyleMetadata=function(value){return new cpl.CompileAnimationStyleMetadata(value.offset,value.styles)},CompileMetadataResolver.prototype.getAnimationMetadata=function(value){var _this=this;if(value instanceof core_1.AnimationStyleMetadata)return this.getAnimationStyleMetadata(value);if(value instanceof core_1.AnimationKeyframesSequenceMetadata)return new cpl.CompileAnimationKeyframesSequenceMetadata(value.steps.map(function(entry){return _this.getAnimationStyleMetadata(entry)}));if(value instanceof core_1.AnimationAnimateMetadata){var animateData=this.getAnimationMetadata(value.styles);return new cpl.CompileAnimationAnimateMetadata(value.timings,animateData)}if(value instanceof core_1.AnimationWithStepsMetadata){var steps=value.steps.map(function(step){return _this.getAnimationMetadata(step)});return value instanceof core_1.AnimationGroupMetadata?new cpl.CompileAnimationGroupMetadata(steps):new cpl.CompileAnimationSequenceMetadata(steps)}return null},CompileMetadataResolver.prototype.getDirectiveMetadata=function(directiveType){var _this=this,meta=this._directiveCache.get(directiveType);if(lang_1.isBlank(meta)){var dirMeta=this._directiveResolver.resolve(directiveType),templateMeta=null,changeDetectionStrategy=null,viewProviders=[],moduleUrl=staticTypeModuleUrl(directiveType),precompileTypes=[];if(dirMeta instanceof core_1.ComponentMetadata){var cmpMeta=dirMeta,viewMeta=this._viewResolver.resolve(directiveType);assertions_1.assertArrayOfStrings("styles",viewMeta.styles),assertions_1.assertInterpolationSymbols("interpolation",viewMeta.interpolation);var animations=lang_1.isPresent(viewMeta.animations)?viewMeta.animations.map(function(e){return _this.getAnimationEntryMetadata(e)}):null;assertions_1.assertArrayOfStrings("styles",viewMeta.styles),assertions_1.assertArrayOfStrings("styleUrls",viewMeta.styleUrls),templateMeta=new cpl.CompileTemplateMetadata({encapsulation:viewMeta.encapsulation,template:viewMeta.template,templateUrl:viewMeta.templateUrl,styles:viewMeta.styles,styleUrls:viewMeta.styleUrls,animations:animations,interpolation:viewMeta.interpolation}),changeDetectionStrategy=cmpMeta.changeDetection,lang_1.isPresent(dirMeta.viewProviders)&&(viewProviders=this.getProvidersMetadata(verifyNonBlankProviders(directiveType,dirMeta.viewProviders,"viewProviders"))),moduleUrl=componentModuleUrl(this._reflector,directiveType,cmpMeta),cmpMeta.precompile&&(precompileTypes=flattenArray(cmpMeta.precompile).map(function(cmp){return _this.getTypeMetadata(cmp,staticTypeModuleUrl(cmp))}))}var providers=[];lang_1.isPresent(dirMeta.providers)&&(providers=this.getProvidersMetadata(verifyNonBlankProviders(directiveType,dirMeta.providers,"providers")));var queries=[],viewQueries=[];lang_1.isPresent(dirMeta.queries)&&(queries=this.getQueriesMetadata(dirMeta.queries,!1,directiveType),viewQueries=this.getQueriesMetadata(dirMeta.queries,!0,directiveType)),meta=cpl.CompileDirectiveMetadata.create({selector:dirMeta.selector,exportAs:dirMeta.exportAs,isComponent:lang_1.isPresent(templateMeta),type:this.getTypeMetadata(directiveType,moduleUrl),template:templateMeta,changeDetection:changeDetectionStrategy,inputs:dirMeta.inputs,outputs:dirMeta.outputs,host:dirMeta.host,lifecycleHooks:core_private_1.LIFECYCLE_HOOKS_VALUES.filter(function(hook){return directive_lifecycle_reflector_1.hasLifecycleHook(hook,directiveType); }),providers:providers,viewProviders:viewProviders,queries:queries,viewQueries:viewQueries,precompile:precompileTypes}),this._directiveCache.set(directiveType,meta)}return meta},CompileMetadataResolver.prototype.maybeGetDirectiveMetadata=function(someType){try{return this.getDirectiveMetadata(someType)}catch(e){if(e.message.indexOf("No Directive annotation")!==-1)return null;throw e}},CompileMetadataResolver.prototype.getTypeMetadata=function(type,moduleUrl,dependencies){return void 0===dependencies&&(dependencies=null),new cpl.CompileTypeMetadata({name:this.sanitizeTokenName(type),moduleUrl:moduleUrl,runtime:type,diDeps:this.getDependenciesMetadata(type,dependencies)})},CompileMetadataResolver.prototype.getFactoryMetadata=function(factory,moduleUrl,dependencies){return void 0===dependencies&&(dependencies=null),new cpl.CompileFactoryMetadata({name:this.sanitizeTokenName(factory),moduleUrl:moduleUrl,runtime:factory,diDeps:this.getDependenciesMetadata(factory,dependencies)})},CompileMetadataResolver.prototype.getPipeMetadata=function(pipeType){var meta=this._pipeCache.get(pipeType);if(lang_1.isBlank(meta)){var pipeMeta=this._pipeResolver.resolve(pipeType);meta=new cpl.CompilePipeMetadata({type:this.getTypeMetadata(pipeType,staticTypeModuleUrl(pipeType)),name:pipeMeta.name,pure:pipeMeta.pure,lifecycleHooks:core_private_1.LIFECYCLE_HOOKS_VALUES.filter(function(hook){return directive_lifecycle_reflector_1.hasLifecycleHook(hook,pipeType)})}),this._pipeCache.set(pipeType,meta)}return meta},CompileMetadataResolver.prototype.getViewDirectivesMetadata=function(component){for(var _this=this,view=this._viewResolver.resolve(component),directives=flattenDirectives(view,this._config.platformDirectives),i=0;i0&&this._currentLine.parts.push(part),newLine&&this._lines.push(new _EmittedLine(this._indent))},EmitterVisitorContext.prototype.removeEmptyLastLine=function(){this.lineIsEmpty()&&this._lines.pop()},EmitterVisitorContext.prototype.incIndent=function(){this._indent++,this._currentLine.indent=this._indent},EmitterVisitorContext.prototype.decIndent=function(){this._indent--,this._currentLine.indent=this._indent},EmitterVisitorContext.prototype.pushClass=function(clazz){this._classes.push(clazz)},EmitterVisitorContext.prototype.popClass=function(){return this._classes.pop()},Object.defineProperty(EmitterVisitorContext.prototype,"currentClass",{get:function(){return this._classes.length>0?this._classes[this._classes.length-1]:null},enumerable:!0,configurable:!0}),EmitterVisitorContext.prototype.toSource=function(){var lines=this._lines;return 0===lines[lines.length-1].parts.length&&(lines=lines.slice(0,lines.length-1)),lines.map(function(line){return line.parts.length>0?_createIndent(line.indent)+line.parts.join(""):""}).join("\n")},EmitterVisitorContext}();exports.EmitterVisitorContext=EmitterVisitorContext;var AbstractEmitterVisitor=function(){function AbstractEmitterVisitor(_escapeDollarInStrings){this._escapeDollarInStrings=_escapeDollarInStrings}return AbstractEmitterVisitor.prototype.visitExpressionStmt=function(stmt,ctx){return stmt.expr.visitExpression(this,ctx),ctx.println(";"),null},AbstractEmitterVisitor.prototype.visitReturnStmt=function(stmt,ctx){return ctx.print("return "),stmt.value.visitExpression(this,ctx),ctx.println(";"),null},AbstractEmitterVisitor.prototype.visitIfStmt=function(stmt,ctx){ctx.print("if ("),stmt.condition.visitExpression(this,ctx),ctx.print(") {");var hasElseCase=lang_1.isPresent(stmt.falseCase)&&stmt.falseCase.length>0;return stmt.trueCase.length<=1&&!hasElseCase?(ctx.print(" "),this.visitAllStatements(stmt.trueCase,ctx),ctx.removeEmptyLastLine(),ctx.print(" ")):(ctx.println(),ctx.incIndent(),this.visitAllStatements(stmt.trueCase,ctx),ctx.decIndent(),hasElseCase&&(ctx.println("} else {"),ctx.incIndent(),this.visitAllStatements(stmt.falseCase,ctx),ctx.decIndent())),ctx.println("}"),null},AbstractEmitterVisitor.prototype.visitThrowStmt=function(stmt,ctx){return ctx.print("throw "),stmt.error.visitExpression(this,ctx),ctx.println(";"),null},AbstractEmitterVisitor.prototype.visitCommentStmt=function(stmt,ctx){var lines=stmt.comment.split("\n");return lines.forEach(function(line){ctx.println("// "+line)}),null},AbstractEmitterVisitor.prototype.visitWriteVarExpr=function(expr,ctx){var lineWasEmpty=ctx.lineIsEmpty();return lineWasEmpty||ctx.print("("),ctx.print(expr.name+" = "),expr.value.visitExpression(this,ctx),lineWasEmpty||ctx.print(")"),null},AbstractEmitterVisitor.prototype.visitWriteKeyExpr=function(expr,ctx){var lineWasEmpty=ctx.lineIsEmpty();return lineWasEmpty||ctx.print("("),expr.receiver.visitExpression(this,ctx),ctx.print("["),expr.index.visitExpression(this,ctx),ctx.print("] = "),expr.value.visitExpression(this,ctx),lineWasEmpty||ctx.print(")"),null},AbstractEmitterVisitor.prototype.visitWritePropExpr=function(expr,ctx){var lineWasEmpty=ctx.lineIsEmpty();return lineWasEmpty||ctx.print("("),expr.receiver.visitExpression(this,ctx),ctx.print("."+expr.name+" = "),expr.value.visitExpression(this,ctx),lineWasEmpty||ctx.print(")"),null},AbstractEmitterVisitor.prototype.visitInvokeMethodExpr=function(expr,ctx){expr.receiver.visitExpression(this,ctx);var name=expr.name;return lang_1.isPresent(expr.builtin)&&(name=this.getBuiltinMethodName(expr.builtin),lang_1.isBlank(name))?null:(ctx.print("."+name+"("),this.visitAllExpressions(expr.args,ctx,","),ctx.print(")"),null)},AbstractEmitterVisitor.prototype.visitInvokeFunctionExpr=function(expr,ctx){return expr.fn.visitExpression(this,ctx),ctx.print("("),this.visitAllExpressions(expr.args,ctx,","),ctx.print(")"),null},AbstractEmitterVisitor.prototype.visitReadVarExpr=function(ast,ctx){var varName=ast.name;if(lang_1.isPresent(ast.builtin))switch(ast.builtin){case o.BuiltinVar.Super:varName="super";break;case o.BuiltinVar.This:varName="this";break;case o.BuiltinVar.CatchError:varName=exports.CATCH_ERROR_VAR.name;break;case o.BuiltinVar.CatchStack:varName=exports.CATCH_STACK_VAR.name;break;default:throw new exceptions_1.BaseException("Unknown builtin variable "+ast.builtin)}return ctx.print(varName),null},AbstractEmitterVisitor.prototype.visitInstantiateExpr=function(ast,ctx){return ctx.print("new "),ast.classExpr.visitExpression(this,ctx),ctx.print("("),this.visitAllExpressions(ast.args,ctx,","),ctx.print(")"),null},AbstractEmitterVisitor.prototype.visitLiteralExpr=function(ast,ctx){var value=ast.value;return lang_1.isString(value)?ctx.print(escapeSingleQuoteString(value,this._escapeDollarInStrings)):lang_1.isBlank(value)?ctx.print("null"):ctx.print(""+value),null},AbstractEmitterVisitor.prototype.visitConditionalExpr=function(ast,ctx){return ctx.print("("),ast.condition.visitExpression(this,ctx),ctx.print("? "),ast.trueCase.visitExpression(this,ctx),ctx.print(": "),ast.falseCase.visitExpression(this,ctx),ctx.print(")"),null},AbstractEmitterVisitor.prototype.visitNotExpr=function(ast,ctx){return ctx.print("!"),ast.condition.visitExpression(this,ctx),null},AbstractEmitterVisitor.prototype.visitBinaryOperatorExpr=function(ast,ctx){var opStr;switch(ast.operator){case o.BinaryOperator.Equals:opStr="==";break;case o.BinaryOperator.Identical:opStr="===";break;case o.BinaryOperator.NotEquals:opStr="!=";break;case o.BinaryOperator.NotIdentical:opStr="!==";break;case o.BinaryOperator.And:opStr="&&";break;case o.BinaryOperator.Or:opStr="||";break;case o.BinaryOperator.Plus:opStr="+";break;case o.BinaryOperator.Minus:opStr="-";break;case o.BinaryOperator.Divide:opStr="/";break;case o.BinaryOperator.Multiply:opStr="*";break;case o.BinaryOperator.Modulo:opStr="%";break;case o.BinaryOperator.Lower:opStr="<";break;case o.BinaryOperator.LowerEquals:opStr="<=";break;case o.BinaryOperator.Bigger:opStr=">";break;case o.BinaryOperator.BiggerEquals:opStr=">=";break;default:throw new exceptions_1.BaseException("Unknown operator "+ast.operator)}return ctx.print("("),ast.lhs.visitExpression(this,ctx),ctx.print(" "+opStr+" "),ast.rhs.visitExpression(this,ctx),ctx.print(")"),null},AbstractEmitterVisitor.prototype.visitReadPropExpr=function(ast,ctx){return ast.receiver.visitExpression(this,ctx),ctx.print("."),ctx.print(ast.name),null},AbstractEmitterVisitor.prototype.visitReadKeyExpr=function(ast,ctx){return ast.receiver.visitExpression(this,ctx),ctx.print("["),ast.index.visitExpression(this,ctx),ctx.print("]"),null},AbstractEmitterVisitor.prototype.visitLiteralArrayExpr=function(ast,ctx){var useNewLine=ast.entries.length>1;return ctx.print("[",useNewLine),ctx.incIndent(),this.visitAllExpressions(ast.entries,ctx,",",useNewLine),ctx.decIndent(),ctx.print("]",useNewLine),null},AbstractEmitterVisitor.prototype.visitLiteralMapExpr=function(ast,ctx){var _this=this,useNewLine=ast.entries.length>1;return ctx.print("{",useNewLine),ctx.incIndent(),this.visitAllObjects(function(entry){ctx.print(escapeSingleQuoteString(entry[0],_this._escapeDollarInStrings)+": "),entry[1].visitExpression(_this,ctx)},ast.entries,ctx,",",useNewLine),ctx.decIndent(),ctx.print("}",useNewLine),null},AbstractEmitterVisitor.prototype.visitAllExpressions=function(expressions,ctx,separator,newLine){var _this=this;void 0===newLine&&(newLine=!1),this.visitAllObjects(function(expr){return expr.visitExpression(_this,ctx)},expressions,ctx,separator,newLine)},AbstractEmitterVisitor.prototype.visitAllObjects=function(handler,expressions,ctx,separator,newLine){void 0===newLine&&(newLine=!1);for(var i=0;i0&&ctx.print(separator,newLine),handler(expressions[i]);newLine&&ctx.println()},AbstractEmitterVisitor.prototype.visitAllStatements=function(statements,ctx){var _this=this;statements.forEach(function(stmt){return stmt.visitStatement(_this,ctx)})},AbstractEmitterVisitor}();return exports.AbstractEmitterVisitor=AbstractEmitterVisitor,exports.escapeSingleQuoteString=escapeSingleQuoteString,module.exports}),$__System.registerDynamic("@angular/compiler/src/output/ts_emitter.js",["@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/output/abstract_emitter.js","@angular/compiler/src/output/output_ast.js"],!0,function($__require,exports,module){"use strict";function debugOutputAstAsTypeScript(ast){var asts,converter=new _TsEmitterVisitor(_debugModuleUrl),ctx=abstract_emitter_1.EmitterVisitorContext.createRoot([]);return asts=lang_1.isArray(ast)?ast:[ast],asts.forEach(function(ast){if(ast instanceof o.Statement)ast.visitStatement(converter,ctx);else if(ast instanceof o.Expression)ast.visitExpression(converter,ctx);else{if(!(ast instanceof o.Type))throw new exceptions_1.BaseException("Don't know how to print debug info for "+ast);ast.visitType(converter,ctx)}}),ctx.toSource()}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),abstract_emitter_1=$__require("@angular/compiler/src/output/abstract_emitter.js"),o=$__require("@angular/compiler/src/output/output_ast.js"),_debugModuleUrl="asset://debug/lib";exports.debugOutputAstAsTypeScript=debugOutputAstAsTypeScript;var TypeScriptEmitter=function(){function TypeScriptEmitter(_importGenerator){this._importGenerator=_importGenerator}return TypeScriptEmitter.prototype.emitStatements=function(moduleUrl,stmts,exportedVars){var _this=this,converter=new _TsEmitterVisitor(moduleUrl),ctx=abstract_emitter_1.EmitterVisitorContext.createRoot(exportedVars);converter.visitAllStatements(stmts,ctx);var srcParts=[];return converter.importsWithPrefixes.forEach(function(prefix,importedModuleUrl){srcParts.push("imp"+("ort * as "+prefix+" from '"+_this._importGenerator.getImportPath(moduleUrl,importedModuleUrl)+"';"))}),srcParts.push(ctx.toSource()),srcParts.join("\n")},TypeScriptEmitter}();exports.TypeScriptEmitter=TypeScriptEmitter;var _TsEmitterVisitor=function(_super){function _TsEmitterVisitor(_moduleUrl){_super.call(this,!1),this._moduleUrl=_moduleUrl,this.importsWithPrefixes=new Map}return __extends(_TsEmitterVisitor,_super),_TsEmitterVisitor.prototype.visitType=function(t,ctx,defaultType){void 0===defaultType&&(defaultType="any"),lang_1.isPresent(t)?t.visitType(this,ctx):ctx.print(defaultType)},_TsEmitterVisitor.prototype.visitExternalExpr=function(ast,ctx){return this._visitIdentifier(ast.value,ast.typeParams,ctx),null},_TsEmitterVisitor.prototype.visitDeclareVarStmt=function(stmt,ctx){return ctx.isExportedVar(stmt.name)&&ctx.print("export "),stmt.hasModifier(o.StmtModifier.Final)?ctx.print("const"):ctx.print("var"),ctx.print(" "+stmt.name+":"),this.visitType(stmt.type,ctx),ctx.print(" = "),stmt.value.visitExpression(this,ctx),ctx.println(";"),null},_TsEmitterVisitor.prototype.visitCastExpr=function(ast,ctx){return ctx.print("(<"),ast.type.visitType(this,ctx),ctx.print(">"),ast.value.visitExpression(this,ctx),ctx.print(")"),null},_TsEmitterVisitor.prototype.visitDeclareClassStmt=function(stmt,ctx){var _this=this;return ctx.pushClass(stmt),ctx.isExportedVar(stmt.name)&&ctx.print("export "),ctx.print("class "+stmt.name),lang_1.isPresent(stmt.parent)&&(ctx.print(" extends "),stmt.parent.visitExpression(this,ctx)),ctx.println(" {"),ctx.incIndent(),stmt.fields.forEach(function(field){return _this._visitClassField(field,ctx)}),lang_1.isPresent(stmt.constructorMethod)&&this._visitClassConstructor(stmt,ctx),stmt.getters.forEach(function(getter){return _this._visitClassGetter(getter,ctx)}),stmt.methods.forEach(function(method){return _this._visitClassMethod(method,ctx)}),ctx.decIndent(),ctx.println("}"),ctx.popClass(),null},_TsEmitterVisitor.prototype._visitClassField=function(field,ctx){field.hasModifier(o.StmtModifier.Private)&&ctx.print("private "),ctx.print(field.name),ctx.print(":"),this.visitType(field.type,ctx),ctx.println(";")},_TsEmitterVisitor.prototype._visitClassGetter=function(getter,ctx){getter.hasModifier(o.StmtModifier.Private)&&ctx.print("private "),ctx.print("get "+getter.name+"()"),ctx.print(":"),this.visitType(getter.type,ctx),ctx.println(" {"),ctx.incIndent(),this.visitAllStatements(getter.body,ctx),ctx.decIndent(),ctx.println("}")},_TsEmitterVisitor.prototype._visitClassConstructor=function(stmt,ctx){ctx.print("constructor("),this._visitParams(stmt.constructorMethod.params,ctx),ctx.println(") {"),ctx.incIndent(),this.visitAllStatements(stmt.constructorMethod.body,ctx),ctx.decIndent(),ctx.println("}")},_TsEmitterVisitor.prototype._visitClassMethod=function(method,ctx){method.hasModifier(o.StmtModifier.Private)&&ctx.print("private "),ctx.print(method.name+"("),this._visitParams(method.params,ctx),ctx.print("):"),this.visitType(method.type,ctx,"void"),ctx.println(" {"),ctx.incIndent(),this.visitAllStatements(method.body,ctx),ctx.decIndent(),ctx.println("}")},_TsEmitterVisitor.prototype.visitFunctionExpr=function(ast,ctx){return ctx.print("("),this._visitParams(ast.params,ctx),ctx.print("):"),this.visitType(ast.type,ctx,"void"),ctx.println(" => {"),ctx.incIndent(),this.visitAllStatements(ast.statements,ctx),ctx.decIndent(),ctx.print("}"),null},_TsEmitterVisitor.prototype.visitDeclareFunctionStmt=function(stmt,ctx){return ctx.isExportedVar(stmt.name)&&ctx.print("export "),ctx.print("function "+stmt.name+"("),this._visitParams(stmt.params,ctx),ctx.print("):"),this.visitType(stmt.type,ctx,"void"),ctx.println(" {"),ctx.incIndent(),this.visitAllStatements(stmt.statements,ctx),ctx.decIndent(),ctx.println("}"),null},_TsEmitterVisitor.prototype.visitTryCatchStmt=function(stmt,ctx){ctx.println("try {"),ctx.incIndent(),this.visitAllStatements(stmt.bodyStmts,ctx),ctx.decIndent(),ctx.println("} catch ("+abstract_emitter_1.CATCH_ERROR_VAR.name+") {"),ctx.incIndent();var catchStmts=[abstract_emitter_1.CATCH_STACK_VAR.set(abstract_emitter_1.CATCH_ERROR_VAR.prop("stack")).toDeclStmt(null,[o.StmtModifier.Final])].concat(stmt.catchStmts);return this.visitAllStatements(catchStmts,ctx),ctx.decIndent(),ctx.println("}"),null},_TsEmitterVisitor.prototype.visitBuiltintType=function(type,ctx){var typeStr;switch(type.name){case o.BuiltinTypeName.Bool:typeStr="boolean";break;case o.BuiltinTypeName.Dynamic:typeStr="any";break;case o.BuiltinTypeName.Function:typeStr="Function";break;case o.BuiltinTypeName.Number:typeStr="number";break;case o.BuiltinTypeName.Int:typeStr="number";break;case o.BuiltinTypeName.String:typeStr="string";break;default:throw new exceptions_1.BaseException("Unsupported builtin type "+type.name)}return ctx.print(typeStr),null},_TsEmitterVisitor.prototype.visitExternalType=function(ast,ctx){return this._visitIdentifier(ast.value,ast.typeParams,ctx),null},_TsEmitterVisitor.prototype.visitArrayType=function(type,ctx){return this.visitType(type.of,ctx),ctx.print("[]"),null},_TsEmitterVisitor.prototype.visitMapType=function(type,ctx){return ctx.print("{[key: string]:"),this.visitType(type.valueType,ctx),ctx.print("}"),null},_TsEmitterVisitor.prototype.getBuiltinMethodName=function(method){var name;switch(method){case o.BuiltinMethod.ConcatArray:name="concat";break;case o.BuiltinMethod.SubscribeObservable:name="subscribe";break;case o.BuiltinMethod.bind:name="bind";break;default:throw new exceptions_1.BaseException("Unknown builtin method: "+method)}return name},_TsEmitterVisitor.prototype._visitParams=function(params,ctx){var _this=this;this.visitAllObjects(function(param){ctx.print(param.name),ctx.print(":"),_this.visitType(param.type,ctx)},params,ctx,",")},_TsEmitterVisitor.prototype._visitIdentifier=function(value,typeParams,ctx){var _this=this;if(lang_1.isBlank(value.name))throw new exceptions_1.BaseException("Internal error: unknown identifier "+value);if(lang_1.isPresent(value.moduleUrl)&&value.moduleUrl!=this._moduleUrl){var prefix=this.importsWithPrefixes.get(value.moduleUrl);lang_1.isBlank(prefix)&&(prefix="import"+this.importsWithPrefixes.size,this.importsWithPrefixes.set(value.moduleUrl,prefix)),ctx.print(prefix+".")}ctx.print(value.name),lang_1.isPresent(typeParams)&&typeParams.length>0&&(ctx.print("<"),this.visitAllObjects(function(type){return type.visitType(_this,ctx)},typeParams,ctx,","),ctx.print(">"))},_TsEmitterVisitor}(abstract_emitter_1.AbstractEmitterVisitor);return module.exports}),$__System.registerDynamic("@angular/compiler/src/schema/dom_security_schema.js",["@angular/compiler/core_private.js"],!0,function($__require,exports,module){"use strict";function registerContext(ctx,specs){for(var _i=0,specs_1=specs;_i0?currentBlockParts.push(part):(currentBlockParts.length>0&&(escapedBlocks.push(currentBlockParts.join("")),resultParts.push(BLOCK_PLACEHOLDER),currentBlockParts=[]),resultParts.push(part)),part==OPEN_CURLY&&bracketCount++}return currentBlockParts.length>0&&(escapedBlocks.push(currentBlockParts.join("")),resultParts.push(BLOCK_PLACEHOLDER)),new StringWithEscapedBlocks(resultParts.join(""),escapedBlocks)}var collection_1=$__require("@angular/compiler/src/facade/collection.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),ShadowCss=function(){function ShadowCss(){this.strictStyling=!0}return ShadowCss.prototype.shimCssText=function(cssText,selector,hostSelector){return void 0===hostSelector&&(hostSelector=""),cssText=stripComments(cssText),cssText=this._insertDirectives(cssText),this._scopeCssText(cssText,selector,hostSelector)},ShadowCss.prototype._insertDirectives=function(cssText){return cssText=this._insertPolyfillDirectivesInCssText(cssText),this._insertPolyfillRulesInCssText(cssText)},ShadowCss.prototype._insertPolyfillDirectivesInCssText=function(cssText){return lang_1.StringWrapper.replaceAllMapped(cssText,_cssContentNextSelectorRe,function(m){return m[1]+"{"})},ShadowCss.prototype._insertPolyfillRulesInCssText=function(cssText){return lang_1.StringWrapper.replaceAllMapped(cssText,_cssContentRuleRe,function(m){var rule=m[0];return rule=lang_1.StringWrapper.replace(rule,m[1],""),rule=lang_1.StringWrapper.replace(rule,m[2],""),m[3]+rule})},ShadowCss.prototype._scopeCssText=function(cssText,scopeSelector,hostSelector){var unscoped=this._extractUnscopedRulesFromCssText(cssText);return cssText=this._insertPolyfillHostInCssText(cssText),cssText=this._convertColonHost(cssText),cssText=this._convertColonHostContext(cssText),cssText=this._convertShadowDOMSelectors(cssText),lang_1.isPresent(scopeSelector)&&(cssText=this._scopeSelectors(cssText,scopeSelector,hostSelector)),cssText=cssText+"\n"+unscoped,cssText.trim()},ShadowCss.prototype._extractUnscopedRulesFromCssText=function(cssText){for(var m,r="",matcher=lang_1.RegExpWrapper.matcher(_cssContentUnscopedRuleRe,cssText);lang_1.isPresent(m=lang_1.RegExpMatcherWrapper.next(matcher));){var rule=m[0];rule=lang_1.StringWrapper.replace(rule,m[2],""),rule=lang_1.StringWrapper.replace(rule,m[1],m[3]),r+=rule+"\n\n"}return r},ShadowCss.prototype._convertColonHost=function(cssText){return this._convertColonRule(cssText,_cssColonHostRe,this._colonHostPartReplacer)},ShadowCss.prototype._convertColonHostContext=function(cssText){return this._convertColonRule(cssText,_cssColonHostContextRe,this._colonHostContextPartReplacer)},ShadowCss.prototype._convertColonRule=function(cssText,regExp,partReplacer){return lang_1.StringWrapper.replaceAllMapped(cssText,regExp,function(m){if(lang_1.isPresent(m[2])){for(var parts=m[2].split(","),r=[],i=0;i","+","~"],scoped=selector,attrName="["+scopeSelector+"]",i=0;i0&&!collection_1.ListWrapper.contains(splits,t)&&!lang_1.StringWrapper.contains(t,attrName)){var re=/([^:]*)(:*)(.*)/g,m=lang_1.RegExpWrapper.firstMatch(re,t);lang_1.isPresent(m)&&(p=m[1]+attrName+m[2]+m[3])}return p}).join(sep)}return scoped},ShadowCss.prototype._insertPolyfillHostInCssText=function(selector){return selector=lang_1.StringWrapper.replaceAll(selector,_colonHostContextRe,_polyfillHostContext),selector=lang_1.StringWrapper.replaceAll(selector,_colonHostRe,_polyfillHost)},ShadowCss}();exports.ShadowCss=ShadowCss;var _cssContentNextSelectorRe=/polyfill-next-selector[^}]*content:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim,_cssContentRuleRe=/(polyfill-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,_cssContentUnscopedRuleRe=/(polyfill-unscoped-rule)[^}]*(content:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,_polyfillHost="-shadowcsshost",_polyfillHostContext="-shadowcsscontext",_parenSuffix=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",_cssColonHostRe=lang_1.RegExpWrapper.create("("+_polyfillHost+_parenSuffix,"im"),_cssColonHostContextRe=lang_1.RegExpWrapper.create("("+_polyfillHostContext+_parenSuffix,"im"),_polyfillHostNoCombinator=_polyfillHost+"-no-combinator",_shadowDOMSelectorsRe=[/::shadow/g,/::content/g,/\/shadow-deep\//g,/\/shadow\//g],_shadowDeepSelectors=/(?:>>>)|(?:\/deep\/)/g,_selectorReSuffix="([>\\s~+[.,{:][\\s\\S]*)?$",_polyfillHostRe=lang_1.RegExpWrapper.create(_polyfillHost,"im"),_colonHostRe=/:host/gim,_colonHostContextRe=/:host-context/gim,_commentRe=/\/\*[\s\S]*?\*\//g,_ruleRe=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,_curlyRe=/([{}])/g,OPEN_CURLY="{",CLOSE_CURLY="}",BLOCK_PLACEHOLDER="%BLOCK%",CssRule=function(){function CssRule(selector,content){this.selector=selector,this.content=content}return CssRule}();exports.CssRule=CssRule,exports.processRules=processRules;var StringWithEscapedBlocks=function(){function StringWithEscapedBlocks(escapedString,blocks){this.escapedString=escapedString,this.blocks=blocks}return StringWithEscapedBlocks}();return module.exports}),$__System.registerDynamic("@angular/compiler/src/style_compiler.js",["@angular/core/index.js","@angular/compiler/src/compile_metadata.js","@angular/compiler/src/output/output_ast.js","@angular/compiler/src/shadow_css.js","@angular/compiler/src/url_resolver.js"],!0,function($__require,exports,module){"use strict";function getStylesVarName(component){var result="styles";return component&&(result+="_"+component.type.name),result}var core_1=$__require("@angular/core/index.js"),compile_metadata_1=$__require("@angular/compiler/src/compile_metadata.js"),o=$__require("@angular/compiler/src/output/output_ast.js"),shadow_css_1=$__require("@angular/compiler/src/shadow_css.js"),url_resolver_1=$__require("@angular/compiler/src/url_resolver.js"),COMPONENT_VARIABLE="%COMP%",HOST_ATTR="_nghost-"+COMPONENT_VARIABLE,CONTENT_ATTR="_ngcontent-"+COMPONENT_VARIABLE,StylesCompileDependency=function(){function StylesCompileDependency(moduleUrl,isShimmed,valuePlaceholder){this.moduleUrl=moduleUrl,this.isShimmed=isShimmed,this.valuePlaceholder=valuePlaceholder}return StylesCompileDependency}();exports.StylesCompileDependency=StylesCompileDependency;var StylesCompileResult=function(){function StylesCompileResult(componentStylesheet,externalStylesheets){this.componentStylesheet=componentStylesheet,this.externalStylesheets=externalStylesheets}return StylesCompileResult}();exports.StylesCompileResult=StylesCompileResult;var CompiledStylesheet=function(){function CompiledStylesheet(statements,stylesVar,dependencies,isShimmed,meta){this.statements=statements,this.stylesVar=stylesVar,this.dependencies=dependencies,this.isShimmed=isShimmed,this.meta=meta}return CompiledStylesheet}();exports.CompiledStylesheet=CompiledStylesheet;var StyleCompiler=function(){function StyleCompiler(_urlResolver){this._urlResolver=_urlResolver,this._shadowCss=new shadow_css_1.ShadowCss}return StyleCompiler.prototype.compileComponent=function(comp){var _this=this,externalStylesheets=(comp.template.encapsulation===core_1.ViewEncapsulation.Emulated,[]),componentStylesheet=this._compileStyles(comp,new compile_metadata_1.CompileStylesheetMetadata({styles:comp.template.styles,styleUrls:comp.template.styleUrls,moduleUrl:comp.type.moduleUrl}),!0);return comp.template.externalStylesheets.forEach(function(stylesheetMeta){var compiledStylesheet=_this._compileStyles(comp,stylesheetMeta,!1);externalStylesheets.push(compiledStylesheet)}),new StylesCompileResult(componentStylesheet,externalStylesheets)},StyleCompiler.prototype._compileStyles=function(comp,stylesheet,isComponentStylesheet){for(var _this=this,shim=comp.template.encapsulation===core_1.ViewEncapsulation.Emulated,styleExpressions=stylesheet.styles.map(function(plainStyle){return o.literal(_this._shimIfNeeded(plainStyle,shim))}),dependencies=[],i=0;i=this.length?chars.$EOF:lang_1.StringWrapper.charCodeAt(this.input,this.index)},_Scanner.prototype.scanToken=function(){for(var input=this.input,length=this.length,peek=this.peek,index=this.index;peek<=chars.$SPACE;){if(++index>=length){peek=chars.$EOF;break}peek=lang_1.StringWrapper.charCodeAt(input,index)}if(this.peek=peek,this.index=index,index>=length)return null;if(isIdentifierStart(peek))return this.scanIdentifier();if(chars.isDigit(peek))return this.scanNumber(index);var start=index;switch(peek){case chars.$PERIOD:return this.advance(),chars.isDigit(this.peek)?this.scanNumber(start):newCharacterToken(start,chars.$PERIOD);case chars.$LPAREN:case chars.$RPAREN:case chars.$LBRACE:case chars.$RBRACE:case chars.$LBRACKET:case chars.$RBRACKET:case chars.$COMMA:case chars.$COLON:case chars.$SEMICOLON:return this.scanCharacter(start,peek);case chars.$SQ:case chars.$DQ:return this.scanString();case chars.$HASH:case chars.$PLUS:case chars.$MINUS:case chars.$STAR:case chars.$SLASH:case chars.$PERCENT:case chars.$CARET:return this.scanOperator(start,lang_1.StringWrapper.fromCharCode(peek));case chars.$QUESTION:return this.scanComplexOperator(start,"?",chars.$PERIOD,".");case chars.$LT:case chars.$GT:return this.scanComplexOperator(start,lang_1.StringWrapper.fromCharCode(peek),chars.$EQ,"=");case chars.$BANG:case chars.$EQ:return this.scanComplexOperator(start,lang_1.StringWrapper.fromCharCode(peek),chars.$EQ,"=",chars.$EQ,"=");case chars.$AMPERSAND:return this.scanComplexOperator(start,"&",chars.$AMPERSAND,"&");case chars.$BAR:return this.scanComplexOperator(start,"|",chars.$BAR,"|");case chars.$NBSP:for(;chars.isWhitespace(this.peek);)this.advance();return this.scanToken()}return this.error("Unexpected character ["+lang_1.StringWrapper.fromCharCode(peek)+"]",0),null},_Scanner.prototype.scanCharacter=function(start,code){return this.advance(),newCharacterToken(start,code)},_Scanner.prototype.scanOperator=function(start,str){return this.advance(),newOperatorToken(start,str)},_Scanner.prototype.scanComplexOperator=function(start,one,twoCode,two,threeCode,three){this.advance();var str=one;return this.peek==twoCode&&(this.advance(),str+=two),lang_1.isPresent(threeCode)&&this.peek==threeCode&&(this.advance(),str+=three),newOperatorToken(start,str)},_Scanner.prototype.scanIdentifier=function(){var start=this.index;for(this.advance();isIdentifierPart(this.peek);)this.advance();var str=this.input.substring(start,this.index);return KEYWORDS.indexOf(str)>-1?newKeywordToken(start,str):newIdentifierToken(start,str)},_Scanner.prototype.scanNumber=function(start){var simple=this.index===start;for(this.advance();;){if(chars.isDigit(this.peek));else if(this.peek==chars.$PERIOD)simple=!1;else{if(!isExponentStart(this.peek))break;this.advance(),isExponentSign(this.peek)&&this.advance(),chars.isDigit(this.peek)||this.error("Invalid exponent",-1),simple=!1}this.advance()}var str=this.input.substring(start,this.index),value=simple?lang_1.NumberWrapper.parseIntAutoRadix(str):lang_1.NumberWrapper.parseFloat(str);return newNumberToken(start,value)},_Scanner.prototype.scanString=function(){var start=this.index,quote=this.peek;this.advance();for(var buffer,marker=this.index,input=this.input;this.peek!=quote;)if(this.peek==chars.$BACKSLASH){null==buffer&&(buffer=new lang_1.StringJoiner),buffer.add(input.substring(marker,this.index)),this.advance();var unescapedCode;if(this.peek==chars.$u){var hex=input.substring(this.index+1,this.index+5);try{unescapedCode=lang_1.NumberWrapper.parseInt(hex,16)}catch(e){this.error("Invalid unicode escape [\\u"+hex+"]",0)}for(var i=0;i<5;i++)this.advance()}else unescapedCode=unescape(this.peek),this.advance();buffer.add(lang_1.StringWrapper.fromCharCode(unescapedCode)),marker=this.index}else this.peek==chars.$EOF?this.error("Unterminated quote",0):this.advance();var last=input.substring(marker,this.index);this.advance();var unescaped=last;return null!=buffer&&(buffer.add(last),unescaped=buffer.toString()),newStringToken(start,unescaped)},_Scanner.prototype.error=function(message,offset){var position=this.index+offset;throw new ScannerError("Lexer Error: "+message+" at column "+position+" in expression ["+this.input+"]")},_Scanner}();return exports.isIdentifier=isIdentifier,exports.isQuote=isQuote,module.exports}),$__System.registerDynamic("@angular/compiler/src/expression_parser/parser.js",["@angular/core/index.js","@angular/compiler/src/chars.js","@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/interpolation_config.js","@angular/compiler/src/expression_parser/ast.js","@angular/compiler/src/expression_parser/lexer.js"],!0,function($__require,exports,module){"use strict";function _createInterpolateRegExp(config){var regexp=lang_1.escapeRegExp(config.start)+"([\\s\\S]*?)"+lang_1.escapeRegExp(config.end);return lang_1.RegExpWrapper.create(regexp,"g")}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},core_1=$__require("@angular/core/index.js"),chars=$__require("@angular/compiler/src/chars.js"),collection_1=$__require("@angular/compiler/src/facade/collection.js"),exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),interpolation_config_1=$__require("@angular/compiler/src/interpolation_config.js"),ast_1=$__require("@angular/compiler/src/expression_parser/ast.js"),lexer_1=$__require("@angular/compiler/src/expression_parser/lexer.js"),_implicitReceiver=new ast_1.ImplicitReceiver,ParseException=function(_super){function ParseException(message,input,errLocation,ctxLocation){_super.call(this,"Parser Error: "+message+" "+errLocation+" ["+input+"] in "+ctxLocation)}return __extends(ParseException,_super),ParseException}(exceptions_1.BaseException),SplitInterpolation=function(){function SplitInterpolation(strings,expressions){this.strings=strings,this.expressions=expressions}return SplitInterpolation}();exports.SplitInterpolation=SplitInterpolation;var TemplateBindingParseResult=function(){function TemplateBindingParseResult(templateBindings,warnings){this.templateBindings=templateBindings,this.warnings=warnings}return TemplateBindingParseResult}();exports.TemplateBindingParseResult=TemplateBindingParseResult;var Parser=function(){function Parser(_lexer){this._lexer=_lexer}return Parser.prototype.parseAction=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=interpolation_config_1.DEFAULT_INTERPOLATION_CONFIG),this._checkNoInterpolation(input,location,interpolationConfig);var tokens=this._lexer.tokenize(this._stripComments(input)),ast=new _ParseAST(input,location,tokens,(!0)).parseChain();return new ast_1.ASTWithSource(ast,input,location)},Parser.prototype.parseBinding=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=interpolation_config_1.DEFAULT_INTERPOLATION_CONFIG);var ast=this._parseBindingAst(input,location,interpolationConfig);return new ast_1.ASTWithSource(ast,input,location)},Parser.prototype.parseSimpleBinding=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=interpolation_config_1.DEFAULT_INTERPOLATION_CONFIG);var ast=this._parseBindingAst(input,location,interpolationConfig);if(!SimpleExpressionChecker.check(ast))throw new ParseException("Host binding expression can only contain field access and constants",input,location);return new ast_1.ASTWithSource(ast,input,location)},Parser.prototype._parseBindingAst=function(input,location,interpolationConfig){var quote=this._parseQuote(input,location);if(lang_1.isPresent(quote))return quote;this._checkNoInterpolation(input,location,interpolationConfig);var tokens=this._lexer.tokenize(this._stripComments(input));return new _ParseAST(input,location,tokens,(!1)).parseChain()},Parser.prototype._parseQuote=function(input,location){if(lang_1.isBlank(input))return null;var prefixSeparatorIndex=input.indexOf(":");if(prefixSeparatorIndex==-1)return null;var prefix=input.substring(0,prefixSeparatorIndex).trim();if(!lexer_1.isIdentifier(prefix))return null;var uninterpretedExpression=input.substring(prefixSeparatorIndex+1);return new ast_1.Quote(prefix,uninterpretedExpression,location)},Parser.prototype.parseTemplateBindings=function(input,location){var tokens=this._lexer.tokenize(input);return new _ParseAST(input,location,tokens,(!1)).parseTemplateBindings()},Parser.prototype.parseInterpolation=function(input,location,interpolationConfig){void 0===interpolationConfig&&(interpolationConfig=interpolation_config_1.DEFAULT_INTERPOLATION_CONFIG);var split=this.splitInterpolation(input,location,interpolationConfig);if(null==split)return null;for(var expressions=[],i=0;i0))throw new ParseException("Blank expressions are not allowed in interpolated strings",input,"at column "+this._findInterpolationErrorColumn(parts,i,interpolationConfig)+" in",location);expressions.push(part)}}return new SplitInterpolation(strings,expressions)},Parser.prototype.wrapLiteralPrimitive=function(input,location){return new ast_1.ASTWithSource(new ast_1.LiteralPrimitive(input),input,location)},Parser.prototype._stripComments=function(input){var i=this._commentStart(input);return lang_1.isPresent(i)?input.substring(0,i).trim():input},Parser.prototype._commentStart=function(input){for(var outerQuote=null,i=0;i1)throw new ParseException("Got interpolation ("+interpolationConfig.start+interpolationConfig.end+") where expression was expected",input,"at column "+this._findInterpolationErrorColumn(parts,1,interpolationConfig)+" in",location)},Parser.prototype._findInterpolationErrorColumn=function(parts,partInErrIdx,interpolationConfig){for(var errLocation="",j=0;j"))result=new ast_1.Binary(">",result,this.parseAdditive());else if(this.optionalOperator("<="))result=new ast_1.Binary("<=",result,this.parseAdditive());else{if(!this.optionalOperator(">="))return result;result=new ast_1.Binary(">=",result,this.parseAdditive())}},_ParseAST.prototype.parseAdditive=function(){for(var result=this.parseMultiplicative();;)if(this.optionalOperator("+"))result=new ast_1.Binary("+",result,this.parseMultiplicative());else{if(!this.optionalOperator("-"))return result;result=new ast_1.Binary("-",result,this.parseMultiplicative())}},_ParseAST.prototype.parseMultiplicative=function(){for(var result=this.parsePrefix();;)if(this.optionalOperator("*"))result=new ast_1.Binary("*",result,this.parsePrefix());else if(this.optionalOperator("%"))result=new ast_1.Binary("%",result,this.parsePrefix());else{if(!this.optionalOperator("/"))return result;result=new ast_1.Binary("/",result,this.parsePrefix())}},_ParseAST.prototype.parsePrefix=function(){return this.optionalOperator("+")?this.parsePrefix():this.optionalOperator("-")?new ast_1.Binary("-",new ast_1.LiteralPrimitive(0),this.parsePrefix()):this.optionalOperator("!")?new ast_1.PrefixNot(this.parsePrefix()):this.parseCallChain()},_ParseAST.prototype.parseCallChain=function(){for(var result=this.parsePrimary();;)if(this.optionalCharacter(chars.$PERIOD))result=this.parseAccessMemberOrMethodCall(result,!1);else if(this.optionalOperator("?."))result=this.parseAccessMemberOrMethodCall(result,!0);else if(this.optionalCharacter(chars.$LBRACKET)){var key=this.parsePipe();if(this.expectCharacter(chars.$RBRACKET),this.optionalOperator("=")){var value=this.parseConditional();result=new ast_1.KeyedWrite(result,key,value)}else result=new ast_1.KeyedRead(result,key)}else{if(!this.optionalCharacter(chars.$LPAREN))return result;var args=this.parseCallArguments();this.expectCharacter(chars.$RPAREN),result=new ast_1.FunctionCall(result,args)}},_ParseAST.prototype.parsePrimary=function(){if(this.optionalCharacter(chars.$LPAREN)){var result=this.parsePipe();return this.expectCharacter(chars.$RPAREN),result}if(this.next.isKeywordNull()||this.next.isKeywordUndefined())return this.advance(),new ast_1.LiteralPrimitive(null);if(this.next.isKeywordTrue())return this.advance(),new ast_1.LiteralPrimitive((!0));if(this.next.isKeywordFalse())return this.advance(),new ast_1.LiteralPrimitive((!1));if(this.optionalCharacter(chars.$LBRACKET)){var elements=this.parseExpressionList(chars.$RBRACKET);return this.expectCharacter(chars.$RBRACKET),new ast_1.LiteralArray(elements)}if(this.next.isCharacter(chars.$LBRACE))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(_implicitReceiver,!1);if(this.next.isNumber()){var value=this.next.toNumber();return this.advance(),new ast_1.LiteralPrimitive(value)}if(this.next.isString()){var literalValue=this.next.toString();return this.advance(),new ast_1.LiteralPrimitive(literalValue)}throw this.index>=this.tokens.length?this.error("Unexpected end of expression: "+this.input):this.error("Unexpected token "+this.next),new exceptions_1.BaseException("Fell through all cases in parsePrimary")},_ParseAST.prototype.parseExpressionList=function(terminator){var result=[];if(!this.next.isCharacter(terminator))do result.push(this.parsePipe());while(this.optionalCharacter(chars.$COMMA));return result},_ParseAST.prototype.parseLiteralMap=function(){var keys=[],values=[];if(this.expectCharacter(chars.$LBRACE),!this.optionalCharacter(chars.$RBRACE)){do{var key=this.expectIdentifierOrKeywordOrString();keys.push(key),this.expectCharacter(chars.$COLON),values.push(this.parsePipe())}while(this.optionalCharacter(chars.$COMMA));this.expectCharacter(chars.$RBRACE)}return new ast_1.LiteralMap(keys,values)},_ParseAST.prototype.parseAccessMemberOrMethodCall=function(receiver,isSafe){void 0===isSafe&&(isSafe=!1);var id=this.expectIdentifierOrKeyword();if(this.optionalCharacter(chars.$LPAREN)){var args=this.parseCallArguments();return this.expectCharacter(chars.$RPAREN),isSafe?new ast_1.SafeMethodCall(receiver,id,args):new ast_1.MethodCall(receiver,id,args)}if(!isSafe){if(this.optionalOperator("=")){this.parseAction||this.error("Bindings cannot contain assignments");var value=this.parseConditional();return new ast_1.PropertyWrite(receiver,id,value)}return new ast_1.PropertyRead(receiver,id)}return this.optionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),null):new ast_1.SafePropertyRead(receiver,id)},_ParseAST.prototype.parseCallArguments=function(){if(this.next.isCharacter(chars.$RPAREN))return[];var positionals=[];do positionals.push(this.parsePipe());while(this.optionalCharacter(chars.$COMMA));return positionals},_ParseAST.prototype.expectTemplateBindingKey=function(){var result="",operatorFound=!1;do result+=this.expectIdentifierOrKeywordOrString(),operatorFound=this.optionalOperator("-"),operatorFound&&(result+="-");while(operatorFound);return result.toString()},_ParseAST.prototype.parseTemplateBindings=function(){for(var bindings=[],prefix=null,warnings=[];this.index=exports.$TAB&&code<=exports.$SPACE||code==exports.$NBSP}function isDigit(code){return exports.$0<=code&&code<=exports.$9}function isAsciiLetter(code){return code>=exports.$a&&code<=exports.$z||code>=exports.$A&&code<=exports.$Z}function isAsciiHexDigit(code){return code>=exports.$a&&code<=exports.$f||code>=exports.$A&&code<=exports.$F||isDigit(code)}return exports.$EOF=0,exports.$TAB=9,exports.$LF=10,exports.$VTAB=11,exports.$FF=12,exports.$CR=13,exports.$SPACE=32,exports.$BANG=33,exports.$DQ=34,exports.$HASH=35,exports.$$=36,exports.$PERCENT=37,exports.$AMPERSAND=38,exports.$SQ=39,exports.$LPAREN=40,exports.$RPAREN=41,exports.$STAR=42,exports.$PLUS=43,exports.$COMMA=44,exports.$MINUS=45,exports.$PERIOD=46,exports.$SLASH=47,exports.$COLON=58,exports.$SEMICOLON=59,exports.$LT=60,exports.$EQ=61,exports.$GT=62,exports.$QUESTION=63,exports.$0=48,exports.$9=57,exports.$A=65,exports.$E=69,exports.$F=70,exports.$X=88,exports.$Z=90,exports.$LBRACKET=91,exports.$BACKSLASH=92,exports.$RBRACKET=93,exports.$CARET=94,exports.$_=95,exports.$a=97,exports.$e=101,exports.$f=102,exports.$n=110,exports.$r=114,exports.$t=116,exports.$u=117,exports.$v=118,exports.$x=120,exports.$z=122,exports.$LBRACE=123,exports.$BAR=124,exports.$RBRACE=125,exports.$NBSP=160,exports.$PIPE=124,exports.$TILDA=126,exports.$AT=64,exports.$BT=96,exports.isWhitespace=isWhitespace,exports.isDigit=isDigit,exports.isAsciiLetter=isAsciiLetter,exports.isAsciiHexDigit=isAsciiHexDigit,module.exports}),$__System.registerDynamic("@angular/compiler/src/interpolation_config.js",[],!0,function($__require,exports,module){"use strict";return exports.DEFAULT_INTERPOLATION_CONFIG={start:"{{",end:"}}"},module.exports}),$__System.registerDynamic("@angular/compiler/src/html_lexer.js",["@angular/compiler/src/chars.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/html_tags.js","@angular/compiler/src/interpolation_config.js","@angular/compiler/src/parse_util.js"],!0,function($__require,exports,module){"use strict";function tokenizeHtml(sourceContent,sourceUrl,tokenizeExpansionForms,interpolationConfig){return void 0===tokenizeExpansionForms&&(tokenizeExpansionForms=!1),void 0===interpolationConfig&&(interpolationConfig=interpolation_config_1.DEFAULT_INTERPOLATION_CONFIG),new _HtmlTokenizer(new parse_util_1.ParseSourceFile(sourceContent,sourceUrl),tokenizeExpansionForms,interpolationConfig).tokenize()}function unexpectedCharacterErrorMsg(charCode){var char=charCode===chars.$EOF?"EOF":lang_1.StringWrapper.fromCharCode(charCode);return'Unexpected character "'+char+'"'}function unknownEntityErrorMsg(entitySrc){return'Unknown entity "'+entitySrc+'" - use the "&#;" or "&#x;" syntax'}function isNotWhitespace(code){return!chars.isWhitespace(code)||code===chars.$EOF}function isNameEnd(code){return chars.isWhitespace(code)||code===chars.$GT||code===chars.$SLASH||code===chars.$SQ||code===chars.$DQ||code===chars.$EQ}function isPrefixEnd(code){return(codechars.$9)}function isDigitEntityEnd(code){return code==chars.$SEMICOLON||code==chars.$EOF||!chars.isAsciiHexDigit(code)}function isNamedEntityEnd(code){return code==chars.$SEMICOLON||code==chars.$EOF||!chars.isAsciiLetter(code)}function isExpansionFormStart(input,offset,interpolationStart){return input.charCodeAt(offset)==chars.$LBRACE&&input.indexOf(interpolationStart,offset)!=offset}function isExpansionCaseStart(peek){return peek===chars.$EQ||chars.isAsciiLetter(peek)}function compareCharCodeCaseInsensitive(code1,code2){return toUpperCaseCharCode(code1)==toUpperCaseCharCode(code2)}function toUpperCaseCharCode(code){return code>=chars.$a&&code<=chars.$z?code-chars.$a+chars.$A:code}function mergeTextTokens(srcTokens){for(var lastDstToken,dstTokens=[],i=0;i=this._length)throw this._createError(unexpectedCharacterErrorMsg(chars.$EOF),this._getSpan());this._peek===chars.$LF?(this._line++,this._column=0):this._peek!==chars.$LF&&this._peek!==chars.$CR&&this._column++,this._index++,this._peek=this._index>=this._length?chars.$EOF:lang_1.StringWrapper.charCodeAt(this._input,this._index),this._nextPeek=this._index+1>=this._length?chars.$EOF:lang_1.StringWrapper.charCodeAt(this._input,this._index+1)},_HtmlTokenizer.prototype._attemptCharCode=function(charCode){return this._peek===charCode&&(this._advance(),!0)},_HtmlTokenizer.prototype._attemptCharCodeCaseInsensitive=function(charCode){return!!compareCharCodeCaseInsensitive(this._peek,charCode)&&(this._advance(),!0)},_HtmlTokenizer.prototype._requireCharCode=function(charCode){var location=this._getLocation();if(!this._attemptCharCode(charCode))throw this._createError(unexpectedCharacterErrorMsg(this._peek),this._getSpan(location,location))},_HtmlTokenizer.prototype._attemptStr=function(chars){var len=chars.length;if(this._index+len>this._length)return!1;for(var initialPosition=this._savePosition(),i=0;itagCloseStart.offset&&parts.push(this._input.substring(tagCloseStart.offset,this._index));this._peek!==firstCharOfEnd;)parts.push(this._readChar(decodeEntities))}return this._endToken([this._processCarriageReturns(parts.join(""))],tagCloseStart)},_HtmlTokenizer.prototype._consumeComment=function(start){var _this=this;this._beginToken(HtmlTokenType.COMMENT_START,start),this._requireCharCode(chars.$MINUS),this._endToken([]);var textToken=this._consumeRawText(!1,chars.$MINUS,function(){return _this._attemptStr("->")});this._beginToken(HtmlTokenType.COMMENT_END,textToken.sourceSpan.end),this._endToken([])},_HtmlTokenizer.prototype._consumeCdata=function(start){var _this=this;this._beginToken(HtmlTokenType.CDATA_START,start),this._requireStr("CDATA["),this._endToken([]);var textToken=this._consumeRawText(!1,chars.$RBRACKET,function(){return _this._attemptStr("]>")});this._beginToken(HtmlTokenType.CDATA_END,textToken.sourceSpan.end),this._endToken([])},_HtmlTokenizer.prototype._consumeDocType=function(start){this._beginToken(HtmlTokenType.DOC_TYPE,start),this._attemptUntilChar(chars.$GT),this._advance(),this._endToken([this._input.substring(start.offset+2,this._index-1)])},_HtmlTokenizer.prototype._consumePrefixAndName=function(){for(var nameOrPrefixStart=this._index,prefix=null;this._peek!==chars.$COLON&&!isPrefixEnd(this._peek);)this._advance();var nameStart;this._peek===chars.$COLON?(this._advance(),prefix=this._input.substring(nameOrPrefixStart,this._index-1),nameStart=this._index):nameStart=nameOrPrefixStart,this._requireCharCodeUntilFn(isNameEnd,this._index===nameStart?1:0);var name=this._input.substring(nameStart,this._index);return[prefix,name]},_HtmlTokenizer.prototype._consumeTagOpen=function(start){var lowercaseTagName,savedPos=this._savePosition();try{if(!chars.isAsciiLetter(this._peek))throw this._createError(unexpectedCharacterErrorMsg(this._peek),this._getSpan());var nameStart=this._index;for(this._consumeTagOpenStart(start),lowercaseTagName=this._input.substring(nameStart,this._index).toLowerCase(),this._attemptCharCodeUntilFn(isNotWhitespace);this._peek!==chars.$SLASH&&this._peek!==chars.$GT;)this._consumeAttributeName(),this._attemptCharCodeUntilFn(isNotWhitespace),this._attemptCharCode(chars.$EQ)&&(this._attemptCharCodeUntilFn(isNotWhitespace),this._consumeAttributeValue()),this._attemptCharCodeUntilFn(isNotWhitespace);this._consumeTagOpenEnd()}catch(e){if(e instanceof ControlFlowError)return this._restorePosition(savedPos),this._beginToken(HtmlTokenType.TEXT,start),void this._endToken(["<"]);throw e}var contentTokenType=html_tags_1.getHtmlTagDefinition(lowercaseTagName).contentType;contentTokenType===html_tags_1.HtmlTagContentType.RAW_TEXT?this._consumeRawTextWithTagClose(lowercaseTagName,!1):contentTokenType===html_tags_1.HtmlTagContentType.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(lowercaseTagName,!0)},_HtmlTokenizer.prototype._consumeRawTextWithTagClose=function(lowercaseTagName,decodeEntities){var _this=this,textToken=this._consumeRawText(decodeEntities,chars.$LT,function(){return!!_this._attemptCharCode(chars.$SLASH)&&(_this._attemptCharCodeUntilFn(isNotWhitespace),!!_this._attemptStrCaseInsensitive(lowercaseTagName)&&(_this._attemptCharCodeUntilFn(isNotWhitespace),!!_this._attemptCharCode(chars.$GT)))});this._beginToken(HtmlTokenType.TAG_CLOSE,textToken.sourceSpan.end),this._endToken([null,lowercaseTagName])},_HtmlTokenizer.prototype._consumeTagOpenStart=function(start){this._beginToken(HtmlTokenType.TAG_OPEN_START,start);var parts=this._consumePrefixAndName();this._endToken(parts)},_HtmlTokenizer.prototype._consumeAttributeName=function(){this._beginToken(HtmlTokenType.ATTR_NAME);var prefixAndName=this._consumePrefixAndName();this._endToken(prefixAndName)},_HtmlTokenizer.prototype._consumeAttributeValue=function(){this._beginToken(HtmlTokenType.ATTR_VALUE);var value;if(this._peek===chars.$SQ||this._peek===chars.$DQ){var quoteChar=this._peek;this._advance();for(var parts=[];this._peek!==quoteChar;)parts.push(this._readChar(!0));value=parts.join(""),this._advance()}else{var valueStart=this._index;this._requireCharCodeUntilFn(isNameEnd,1),value=this._input.substring(valueStart,this._index)}this._endToken([this._processCarriageReturns(value)])},_HtmlTokenizer.prototype._consumeTagOpenEnd=function(){var tokenType=this._attemptCharCode(chars.$SLASH)?HtmlTokenType.TAG_OPEN_END_VOID:HtmlTokenType.TAG_OPEN_END;this._beginToken(tokenType),this._requireCharCode(chars.$GT),this._endToken([])},_HtmlTokenizer.prototype._consumeTagClose=function(start){this._beginToken(HtmlTokenType.TAG_CLOSE,start),this._attemptCharCodeUntilFn(isNotWhitespace);var prefixAndName=this._consumePrefixAndName();this._attemptCharCodeUntilFn(isNotWhitespace),this._requireCharCode(chars.$GT),this._endToken(prefixAndName)},_HtmlTokenizer.prototype._consumeExpansionFormStart=function(){this._beginToken(HtmlTokenType.EXPANSION_FORM_START,this._getLocation()),this._requireCharCode(chars.$LBRACE),this._endToken([]),this._beginToken(HtmlTokenType.RAW_TEXT,this._getLocation());var condition=this._readUntil(chars.$COMMA);this._endToken([condition],this._getLocation()),this._requireCharCode(chars.$COMMA),this._attemptCharCodeUntilFn(isNotWhitespace),this._beginToken(HtmlTokenType.RAW_TEXT,this._getLocation());var type=this._readUntil(chars.$COMMA);this._endToken([type],this._getLocation()),this._requireCharCode(chars.$COMMA),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.push(HtmlTokenType.EXPANSION_FORM_START)},_HtmlTokenizer.prototype._consumeExpansionCaseStart=function(){this._beginToken(HtmlTokenType.EXPANSION_CASE_VALUE,this._getLocation());var value=this._readUntil(chars.$LBRACE).trim();this._endToken([value],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._beginToken(HtmlTokenType.EXPANSION_CASE_EXP_START,this._getLocation()),this._requireCharCode(chars.$LBRACE),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.push(HtmlTokenType.EXPANSION_CASE_EXP_START)},_HtmlTokenizer.prototype._consumeExpansionCaseEnd=function(){this._beginToken(HtmlTokenType.EXPANSION_CASE_EXP_END,this._getLocation()),this._requireCharCode(chars.$RBRACE),this._endToken([],this._getLocation()),this._attemptCharCodeUntilFn(isNotWhitespace),this._expansionCaseStack.pop()},_HtmlTokenizer.prototype._consumeExpansionFormEnd=function(){this._beginToken(HtmlTokenType.EXPANSION_FORM_END,this._getLocation()),this._requireCharCode(chars.$RBRACE),this._endToken([]),this._expansionCaseStack.pop()},_HtmlTokenizer.prototype._consumeText=function(){var start=this._getLocation();this._beginToken(HtmlTokenType.TEXT,start);var parts=[];do this._attemptStr(this.interpolationConfig.start)?(parts.push(this.interpolationConfig.start),this._inInterpolation=!0):this._attemptStr(this.interpolationConfig.end)&&this._inInterpolation?(parts.push(this.interpolationConfig.end),this._inInterpolation=!1):parts.push(this._readChar(!0));while(!this._isTextEnd());this._endToken([this._processCarriageReturns(parts.join(""))])},_HtmlTokenizer.prototype._isTextEnd=function(){if(this._peek===chars.$LT||this._peek===chars.$EOF)return!0;if(this.tokenizeExpansionForms){if(isExpansionFormStart(this._input,this._index,this.interpolationConfig.start))return!0;if(this._peek===chars.$RBRACE&&!this._inInterpolation&&this._isInExpansionCase())return!0}return!1},_HtmlTokenizer.prototype._savePosition=function(){return[this._peek,this._index,this._column,this._line,this.tokens.length]},_HtmlTokenizer.prototype._readUntil=function(char){var start=this._index;return this._attemptUntilChar(char),this._input.substring(start,this._index)},_HtmlTokenizer.prototype._restorePosition=function(position){this._peek=position[0],this._index=position[1],this._column=position[2],this._line=position[3];var nbTokens=position[4];nbTokens0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===HtmlTokenType.EXPANSION_CASE_EXP_START},_HtmlTokenizer.prototype._isInExpansionForm=function(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===HtmlTokenType.EXPANSION_FORM_START},_HtmlTokenizer}();return module.exports}),$__System.registerDynamic("@angular/compiler/src/html_parser.js",["@angular/core/index.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/facade/collection.js","@angular/compiler/src/html_ast.js","@angular/compiler/src/html_lexer.js","@angular/compiler/src/parse_util.js","@angular/compiler/src/html_tags.js"],!0,function($__require,exports,module){"use strict";function getElementFullName(prefix,localName,parentElement){return lang_1.isBlank(prefix)&&(prefix=html_tags_1.getHtmlTagDefinition(localName).implicitNamespacePrefix,lang_1.isBlank(prefix)&&lang_1.isPresent(parentElement)&&(prefix=html_tags_1.getNsPrefix(parentElement.name))),html_tags_1.mergeNsAndName(prefix,localName)}function lastOnStack(stack,element){return stack.length>0&&stack[stack.length-1]===element}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},core_1=$__require("@angular/core/index.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),collection_1=$__require("@angular/compiler/src/facade/collection.js"),html_ast_1=$__require("@angular/compiler/src/html_ast.js"),html_lexer_1=$__require("@angular/compiler/src/html_lexer.js"),parse_util_1=$__require("@angular/compiler/src/parse_util.js"),html_tags_1=$__require("@angular/compiler/src/html_tags.js"),HtmlTreeError=function(_super){function HtmlTreeError(elementName,span,msg){_super.call(this,span,msg),this.elementName=elementName}return __extends(HtmlTreeError,_super),HtmlTreeError.create=function(elementName,span,msg){return new HtmlTreeError(elementName,span,msg)},HtmlTreeError}(parse_util_1.ParseError);exports.HtmlTreeError=HtmlTreeError;var HtmlParseTreeResult=function(){function HtmlParseTreeResult(rootNodes,errors){this.rootNodes=rootNodes,this.errors=errors}return HtmlParseTreeResult}();exports.HtmlParseTreeResult=HtmlParseTreeResult;var HtmlParser=function(){function HtmlParser(){}return HtmlParser.prototype.parse=function(sourceContent,sourceUrl,parseExpansionForms){void 0===parseExpansionForms&&(parseExpansionForms=!1);var tokensAndErrors=html_lexer_1.tokenizeHtml(sourceContent,sourceUrl,parseExpansionForms),treeAndErrors=new TreeBuilder(tokensAndErrors.tokens).build();return new HtmlParseTreeResult(treeAndErrors.rootNodes,tokensAndErrors.errors.concat(treeAndErrors.errors))},HtmlParser.decorators=[{type:core_1.Injectable}],HtmlParser}();exports.HtmlParser=HtmlParser;var TreeBuilder=function(){function TreeBuilder(tokens){this.tokens=tokens,this.index=-1,this.rootNodes=[],this.errors=[],this.elementStack=[],this._advance()}return TreeBuilder.prototype.build=function(){for(;this.peek.type!==html_lexer_1.HtmlTokenType.EOF;)this.peek.type===html_lexer_1.HtmlTokenType.TAG_OPEN_START?this._consumeStartTag(this._advance()):this.peek.type===html_lexer_1.HtmlTokenType.TAG_CLOSE?this._consumeEndTag(this._advance()):this.peek.type===html_lexer_1.HtmlTokenType.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this.peek.type===html_lexer_1.HtmlTokenType.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this.peek.type===html_lexer_1.HtmlTokenType.TEXT||this.peek.type===html_lexer_1.HtmlTokenType.RAW_TEXT||this.peek.type===html_lexer_1.HtmlTokenType.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this.peek.type===html_lexer_1.HtmlTokenType.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._advance();return new HtmlParseTreeResult(this.rootNodes,this.errors)},TreeBuilder.prototype._advance=function(){var prev=this.peek;return this.index0)return this.errors=this.errors.concat(parsedExp.errors),null;var sourceSpan=new parse_util_1.ParseSourceSpan(value.sourceSpan.start,end.sourceSpan.end),expSourceSpan=new parse_util_1.ParseSourceSpan(start.sourceSpan.start,end.sourceSpan.end);return new html_ast_1.HtmlExpansionCaseAst(value.parts[0],parsedExp.rootNodes,sourceSpan,value.sourceSpan,expSourceSpan)},TreeBuilder.prototype._collectExpansionExpTokens=function(start){for(var exp=[],expansionFormStack=[html_lexer_1.HtmlTokenType.EXPANSION_CASE_EXP_START];;){if(this.peek.type!==html_lexer_1.HtmlTokenType.EXPANSION_FORM_START&&this.peek.type!==html_lexer_1.HtmlTokenType.EXPANSION_CASE_EXP_START||expansionFormStack.push(this.peek.type),this.peek.type===html_lexer_1.HtmlTokenType.EXPANSION_CASE_EXP_END){if(!lastOnStack(expansionFormStack,html_lexer_1.HtmlTokenType.EXPANSION_CASE_EXP_START))return this.errors.push(HtmlTreeError.create(null,start.sourceSpan,"Invalid expansion form. Missing '}'.")),null;if(expansionFormStack.pop(),0==expansionFormStack.length)return exp}if(this.peek.type===html_lexer_1.HtmlTokenType.EXPANSION_FORM_END){if(!lastOnStack(expansionFormStack,html_lexer_1.HtmlTokenType.EXPANSION_FORM_START))return this.errors.push(HtmlTreeError.create(null,start.sourceSpan,"Invalid expansion form. Missing '}'.")),null;expansionFormStack.pop()}if(this.peek.type===html_lexer_1.HtmlTokenType.EOF)return this.errors.push(HtmlTreeError.create(null,start.sourceSpan,"Invalid expansion form. Missing '}'.")),null;exp.push(this._advance())}},TreeBuilder.prototype._consumeText=function(token){var text=token.parts[0];if(text.length>0&&"\n"==text[0]){var parent_1=this._getParentElement();lang_1.isPresent(parent_1)&&0==parent_1.children.length&&html_tags_1.getHtmlTagDefinition(parent_1.name).ignoreFirstLf&&(text=text.substring(1))}text.length>0&&this._addToParent(new html_ast_1.HtmlTextAst(text,token.sourceSpan))},TreeBuilder.prototype._closeVoidElement=function(){if(this.elementStack.length>0){var el=collection_1.ListWrapper.last(this.elementStack);html_tags_1.getHtmlTagDefinition(el.name).isVoid&&this.elementStack.pop()}},TreeBuilder.prototype._consumeStartTag=function(startTagToken){for(var prefix=startTagToken.parts[0],name=startTagToken.parts[1],attrs=[];this.peek.type===html_lexer_1.HtmlTokenType.ATTR_NAME;)attrs.push(this._consumeAttr(this._advance()));var fullName=getElementFullName(prefix,name,this._getParentElement()),selfClosing=!1;this.peek.type===html_lexer_1.HtmlTokenType.TAG_OPEN_END_VOID?(this._advance(),selfClosing=!0,null!=html_tags_1.getNsPrefix(fullName)||html_tags_1.getHtmlTagDefinition(fullName).isVoid||this.errors.push(HtmlTreeError.create(fullName,startTagToken.sourceSpan,'Only void and foreign elements can be self closed "'+startTagToken.parts[1]+'"'))):this.peek.type===html_lexer_1.HtmlTokenType.TAG_OPEN_END&&(this._advance(),selfClosing=!1);var end=this.peek.sourceSpan.start,span=new parse_util_1.ParseSourceSpan(startTagToken.sourceSpan.start,end),el=new html_ast_1.HtmlElementAst(fullName,attrs,[],span,span,null);this._pushElement(el),selfClosing&&(this._popElement(fullName),el.endSourceSpan=span)},TreeBuilder.prototype._pushElement=function(el){if(this.elementStack.length>0){var parentEl=collection_1.ListWrapper.last(this.elementStack);html_tags_1.getHtmlTagDefinition(parentEl.name).isClosedByChild(el.name)&&this.elementStack.pop()}var tagDef=html_tags_1.getHtmlTagDefinition(el.name),_a=this._getParentElementSkippingContainers(),parent=_a.parent,container=_a.container;if(lang_1.isPresent(parent)&&tagDef.requireExtraParent(parent.name)){var newParent=new html_ast_1.HtmlElementAst(tagDef.parentToAdd,[],[],el.sourceSpan,el.startSourceSpan,el.endSourceSpan);this._insertBeforeContainer(parent,container,newParent)}this._addToParent(el),this.elementStack.push(el)},TreeBuilder.prototype._consumeEndTag=function(endTagToken){var fullName=getElementFullName(endTagToken.parts[0],endTagToken.parts[1],this._getParentElement());this._getParentElement()&&(this._getParentElement().endSourceSpan=endTagToken.sourceSpan),html_tags_1.getHtmlTagDefinition(fullName).isVoid?this.errors.push(HtmlTreeError.create(fullName,endTagToken.sourceSpan,'Void elements do not have end tags "'+endTagToken.parts[1]+'"')):this._popElement(fullName)||this.errors.push(HtmlTreeError.create(fullName,endTagToken.sourceSpan,'Unexpected closing tag "'+endTagToken.parts[1]+'"'))},TreeBuilder.prototype._popElement=function(fullName){for(var stackIndex=this.elementStack.length-1;stackIndex>=0;stackIndex--){var el=this.elementStack[stackIndex];if(el.name==fullName)return collection_1.ListWrapper.splice(this.elementStack,stackIndex,this.elementStack.length-stackIndex),!0;if(!html_tags_1.getHtmlTagDefinition(el.name).closedByParent)return!1}return!1},TreeBuilder.prototype._consumeAttr=function(attrName){var fullName=html_tags_1.mergeNsAndName(attrName.parts[0],attrName.parts[1]),end=attrName.sourceSpan.end,value="";if(this.peek.type===html_lexer_1.HtmlTokenType.ATTR_VALUE){var valueToken=this._advance();value=valueToken.parts[0],end=valueToken.sourceSpan.end}return new html_ast_1.HtmlAttrAst(fullName,value,new parse_util_1.ParseSourceSpan(attrName.sourceSpan.start,end))},TreeBuilder.prototype._getParentElement=function(){return this.elementStack.length>0?collection_1.ListWrapper.last(this.elementStack):null},TreeBuilder.prototype._getParentElementSkippingContainers=function(){for(var container=null,i=this.elementStack.length-1;i>=0;i--){if("ng-container"!==this.elementStack[i].name)return{parent:this.elementStack[i],container:container};container=this.elementStack[i]}return{parent:collection_1.ListWrapper.last(this.elementStack),container:container}},TreeBuilder.prototype._addToParent=function(node){var parent=this._getParentElement();lang_1.isPresent(parent)?parent.children.push(node):this.rootNodes.push(node)},TreeBuilder.prototype._insertBeforeContainer=function(parent,container,node){if(container){if(parent){var index=parent.children.indexOf(container);parent.children[index]=node}else this.rootNodes.push(node);node.children.push(container),this.elementStack.splice(this.elementStack.indexOf(container),0,node)}else this._addToParent(node),this.elementStack.push(node)},TreeBuilder}();return module.exports}),$__System.registerDynamic("@angular/compiler/src/schema/element_schema_registry.js",[],!0,function($__require,exports,module){"use strict";var ElementSchemaRegistry=function(){function ElementSchemaRegistry(){}return ElementSchemaRegistry}();return exports.ElementSchemaRegistry=ElementSchemaRegistry,module.exports}),$__System.registerDynamic("@angular/compiler/src/html_tags.js",["@angular/compiler/src/facade/lang.js"],!0,function($__require,exports,module){"use strict";function getHtmlTagDefinition(tagName){var result=TAG_DEFINITIONS[tagName.toLowerCase()];return lang_1.isPresent(result)?result:DEFAULT_TAG_DEFINITION}function splitNsName(elementName){if(":"!=elementName[0])return[null,elementName];var match=lang_1.RegExpWrapper.firstMatch(NS_PREFIX_RE,elementName);return[match[1],match[2]]}function getNsPrefix(elementName){return splitNsName(elementName)[0]}function mergeNsAndName(prefix,localName){return lang_1.isPresent(prefix)?":"+prefix+":"+localName:localName}var lang_1=$__require("@angular/compiler/src/facade/lang.js");exports.NAMED_ENTITIES={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",alefsym:"ℵ",Alpha:"Α",alpha:"α",amp:"&",and:"∧",ang:"∠",apos:"'",Aring:"Å",aring:"å",asymp:"≈",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",bdquo:"„",Beta:"Β",beta:"β",brvbar:"¦",bull:"•",cap:"∩",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",Chi:"Χ",chi:"χ",circ:"ˆ",clubs:"♣",cong:"≅",copy:"©",crarr:"↵",cup:"∪",curren:"¤",dagger:"†",Dagger:"‡",darr:"↓",dArr:"⇓",deg:"°",Delta:"Δ",delta:"δ",diams:"♦",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",empty:"∅",emsp:" ",ensp:" ",Epsilon:"Ε",epsilon:"ε",equiv:"≡",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",exist:"∃",fnof:"ƒ",forall:"∀",frac12:"½",frac14:"¼",frac34:"¾",frasl:"⁄",Gamma:"Γ",gamma:"γ",ge:"≥",gt:">",harr:"↔",hArr:"⇔",hearts:"♥",hellip:"…",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",image:"ℑ",infin:"∞","int":"∫",Iota:"Ι",iota:"ι",iquest:"¿",isin:"∈",Iuml:"Ï",iuml:"ï",Kappa:"Κ",kappa:"κ",Lambda:"Λ",lambda:"λ",lang:"⟨",laquo:"«",larr:"←",lArr:"⇐",lceil:"⌈",ldquo:"“",le:"≤",lfloor:"⌊",lowast:"∗",loz:"◊",lrm:"‎",lsaquo:"‹",lsquo:"‘",lt:"<",macr:"¯",mdash:"—",micro:"µ",middot:"·",minus:"−",Mu:"Μ",mu:"μ",nabla:"∇",nbsp:" ",ndash:"–",ne:"≠",ni:"∋",not:"¬",notin:"∉",nsub:"⊄",Ntilde:"Ñ",ntilde:"ñ",Nu:"Ν",nu:"ν",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",OElig:"Œ",oelig:"œ",Ograve:"Ò",ograve:"ò",oline:"‾",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",oplus:"⊕",or:"∨",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",otimes:"⊗",Ouml:"Ö",ouml:"ö",para:"¶",permil:"‰",perp:"⊥",Phi:"Φ",phi:"φ",Pi:"Π",pi:"π",piv:"ϖ",plusmn:"±",pound:"£",prime:"′",Prime:"″",prod:"∏",prop:"∝",Psi:"Ψ",psi:"ψ",quot:'"',radic:"√",rang:"⟩",raquo:"»",rarr:"→",rArr:"⇒",rceil:"⌉",rdquo:"”",real:"ℜ",reg:"®",rfloor:"⌋",Rho:"Ρ",rho:"ρ",rlm:"‏",rsaquo:"›",rsquo:"’",sbquo:"‚",Scaron:"Š",scaron:"š",sdot:"⋅",sect:"§",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sim:"∼",spades:"♠",sub:"⊂",sube:"⊆",sum:"∑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supe:"⊇",szlig:"ß",Tau:"Τ",tau:"τ",there4:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thinsp:" ",THORN:"Þ",thorn:"þ",tilde:"˜",times:"×",trade:"™",Uacute:"Ú",uacute:"ú",uarr:"↑",uArr:"⇑",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",Uuml:"Ü",uuml:"ü",weierp:"℘",Xi:"Ξ",xi:"ξ",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ",Yuml:"Ÿ",Zeta:"Ζ",zeta:"ζ",zwj:"‍",zwnj:"‌"},function(HtmlTagContentType){ HtmlTagContentType[HtmlTagContentType.RAW_TEXT=0]="RAW_TEXT",HtmlTagContentType[HtmlTagContentType.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",HtmlTagContentType[HtmlTagContentType.PARSABLE_DATA=2]="PARSABLE_DATA"}(exports.HtmlTagContentType||(exports.HtmlTagContentType={}));var HtmlTagContentType=exports.HtmlTagContentType,HtmlTagDefinition=function(){function HtmlTagDefinition(_a){var _this=this,_b=void 0===_a?{}:_a,closedByChildren=_b.closedByChildren,requiredParents=_b.requiredParents,implicitNamespacePrefix=_b.implicitNamespacePrefix,contentType=_b.contentType,closedByParent=_b.closedByParent,isVoid=_b.isVoid,ignoreFirstLf=_b.ignoreFirstLf;this.closedByChildren={},this.closedByParent=!1,lang_1.isPresent(closedByChildren)&&closedByChildren.length>0&&closedByChildren.forEach(function(tagName){return _this.closedByChildren[tagName]=!0}),this.isVoid=lang_1.normalizeBool(isVoid),this.closedByParent=lang_1.normalizeBool(closedByParent)||this.isVoid,lang_1.isPresent(requiredParents)&&requiredParents.length>0&&(this.requiredParents={},this.parentToAdd=requiredParents[0],requiredParents.forEach(function(tagName){return _this.requiredParents[tagName]=!0})),this.implicitNamespacePrefix=implicitNamespacePrefix,this.contentType=lang_1.isPresent(contentType)?contentType:HtmlTagContentType.PARSABLE_DATA,this.ignoreFirstLf=lang_1.normalizeBool(ignoreFirstLf)}return HtmlTagDefinition.prototype.requireExtraParent=function(currentParent){if(lang_1.isBlank(this.requiredParents))return!1;if(lang_1.isBlank(currentParent))return!0;var lcParent=currentParent.toLowerCase();return 1!=this.requiredParents[lcParent]&&"template"!=lcParent},HtmlTagDefinition.prototype.isClosedByChild=function(name){return this.isVoid||lang_1.normalizeBool(this.closedByChildren[name.toLowerCase()])},HtmlTagDefinition}();exports.HtmlTagDefinition=HtmlTagDefinition;var TAG_DEFINITIONS={base:new HtmlTagDefinition({isVoid:!0}),meta:new HtmlTagDefinition({isVoid:!0}),area:new HtmlTagDefinition({isVoid:!0}),embed:new HtmlTagDefinition({isVoid:!0}),link:new HtmlTagDefinition({isVoid:!0}),img:new HtmlTagDefinition({isVoid:!0}),input:new HtmlTagDefinition({isVoid:!0}),param:new HtmlTagDefinition({isVoid:!0}),hr:new HtmlTagDefinition({isVoid:!0}),br:new HtmlTagDefinition({isVoid:!0}),source:new HtmlTagDefinition({isVoid:!0}),track:new HtmlTagDefinition({isVoid:!0}),wbr:new HtmlTagDefinition({isVoid:!0}),p:new HtmlTagDefinition({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"]}),tbody:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new HtmlTagDefinition({closedByChildren:["tbody"],closedByParent:!0}),tr:new HtmlTagDefinition({closedByChildren:["tr"],requiredParents:["tbody","tfoot","thead"],closedByParent:!0}),td:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:!0}),th:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:!0}),col:new HtmlTagDefinition({requiredParents:["colgroup"],isVoid:!0}),svg:new HtmlTagDefinition({implicitNamespacePrefix:"svg"}),math:new HtmlTagDefinition({implicitNamespacePrefix:"math"}),li:new HtmlTagDefinition({closedByChildren:["li"],closedByParent:!0}),dt:new HtmlTagDefinition({closedByChildren:["dt","dd"]}),dd:new HtmlTagDefinition({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new HtmlTagDefinition({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new HtmlTagDefinition({closedByChildren:["optgroup"],closedByParent:!0}),option:new HtmlTagDefinition({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new HtmlTagDefinition({ignoreFirstLf:!0}),listing:new HtmlTagDefinition({ignoreFirstLf:!0}),style:new HtmlTagDefinition({contentType:HtmlTagContentType.RAW_TEXT}),script:new HtmlTagDefinition({contentType:HtmlTagContentType.RAW_TEXT}),title:new HtmlTagDefinition({contentType:HtmlTagContentType.ESCAPABLE_RAW_TEXT}),textarea:new HtmlTagDefinition({contentType:HtmlTagContentType.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})},DEFAULT_TAG_DEFINITION=new HtmlTagDefinition;exports.getHtmlTagDefinition=getHtmlTagDefinition;var NS_PREFIX_RE=/^:([^:]+):(.+)/g;return exports.splitNsName=splitNsName,exports.getNsPrefix=getNsPrefix,exports.mergeNsAndName=mergeNsAndName,module.exports}),$__System.registerDynamic("@angular/compiler/src/template_preparser.js",["@angular/compiler/src/facade/lang.js","@angular/compiler/src/html_tags.js"],!0,function($__require,exports,module){"use strict";function preparseElement(ast){var selectAttr=null,hrefAttr=null,relAttr=null,nonBindable=!1,projectAs=null;ast.attrs.forEach(function(attr){var lcAttrName=attr.name.toLowerCase();lcAttrName==NG_CONTENT_SELECT_ATTR?selectAttr=attr.value:lcAttrName==LINK_STYLE_HREF_ATTR?hrefAttr=attr.value:lcAttrName==LINK_STYLE_REL_ATTR?relAttr=attr.value:attr.name==NG_NON_BINDABLE_ATTR?nonBindable=!0:attr.name==NG_PROJECT_AS&&attr.value.length>0&&(projectAs=attr.value)}),selectAttr=normalizeNgContentSelect(selectAttr);var nodeName=ast.name.toLowerCase(),type=PreparsedElementType.OTHER;return html_tags_1.splitNsName(nodeName)[1]==NG_CONTENT_ELEMENT?type=PreparsedElementType.NG_CONTENT:nodeName==STYLE_ELEMENT?type=PreparsedElementType.STYLE:nodeName==SCRIPT_ELEMENT?type=PreparsedElementType.SCRIPT:nodeName==LINK_ELEMENT&&relAttr==LINK_STYLE_REL_VALUE&&(type=PreparsedElementType.STYLESHEET),new PreparsedElement(type,selectAttr,hrefAttr,nonBindable,projectAs)}function normalizeNgContentSelect(selectAttr){return lang_1.isBlank(selectAttr)||0===selectAttr.length?"*":selectAttr}var lang_1=$__require("@angular/compiler/src/facade/lang.js"),html_tags_1=$__require("@angular/compiler/src/html_tags.js"),NG_CONTENT_SELECT_ATTR="select",NG_CONTENT_ELEMENT="ng-content",LINK_ELEMENT="link",LINK_STYLE_REL_ATTR="rel",LINK_STYLE_HREF_ATTR="href",LINK_STYLE_REL_VALUE="stylesheet",STYLE_ELEMENT="style",SCRIPT_ELEMENT="script",NG_NON_BINDABLE_ATTR="ngNonBindable",NG_PROJECT_AS="ngProjectAs";exports.preparseElement=preparseElement,function(PreparsedElementType){PreparsedElementType[PreparsedElementType.NG_CONTENT=0]="NG_CONTENT",PreparsedElementType[PreparsedElementType.STYLE=1]="STYLE",PreparsedElementType[PreparsedElementType.STYLESHEET=2]="STYLESHEET",PreparsedElementType[PreparsedElementType.SCRIPT=3]="SCRIPT",PreparsedElementType[PreparsedElementType.OTHER=4]="OTHER"}(exports.PreparsedElementType||(exports.PreparsedElementType={}));var PreparsedElementType=exports.PreparsedElementType,PreparsedElement=function(){function PreparsedElement(type,selectAttr,hrefAttr,nonBindable,projectAs){this.type=type,this.selectAttr=selectAttr,this.hrefAttr=hrefAttr,this.nonBindable=nonBindable,this.projectAs=projectAs}return PreparsedElement}();return exports.PreparsedElement=PreparsedElement,module.exports}),$__System.registerDynamic("@angular/compiler/src/style_url_resolver.js",["@angular/compiler/src/facade/lang.js"],!0,function($__require,exports,module){"use strict";function isStyleUrlResolvable(url){if(lang_1.isBlank(url)||0===url.length||"/"==url[0])return!1;var schemeMatch=lang_1.RegExpWrapper.firstMatch(_urlWithSchemaRe,url);return lang_1.isBlank(schemeMatch)||"package"==schemeMatch[1]||"asset"==schemeMatch[1]}function extractStyleUrls(resolver,baseUrl,cssText){var foundUrls=[],modifiedCssText=lang_1.StringWrapper.replaceAllMapped(cssText,_cssImportRe,function(m){var url=lang_1.isPresent(m[1])?m[1]:m[2];return isStyleUrlResolvable(url)?(foundUrls.push(resolver.resolve(baseUrl,url)),""):m[0]});return new StyleWithImports(modifiedCssText,foundUrls)}var lang_1=$__require("@angular/compiler/src/facade/lang.js"),StyleWithImports=function(){function StyleWithImports(style,styleUrls){this.style=style,this.styleUrls=styleUrls}return StyleWithImports}();exports.StyleWithImports=StyleWithImports,exports.isStyleUrlResolvable=isStyleUrlResolvable,exports.extractStyleUrls=extractStyleUrls;var _cssImportRe=/@import\s+(?:url\()?\s*(?:(?:['"]([^'"]*))|([^;\)\s]*))[^;]*;?/g,_urlWithSchemaRe=/^([a-zA-Z\-\+\.]+):/g;return module.exports}),$__System.registerDynamic("@angular/compiler/src/html_ast.js",["@angular/compiler/src/facade/lang.js"],!0,function($__require,exports,module){"use strict";function htmlVisitAll(visitor,asts,context){void 0===context&&(context=null);var result=[];return asts.forEach(function(ast){var astResult=ast.visit(visitor,context);lang_1.isPresent(astResult)&&result.push(astResult)}),result}var lang_1=$__require("@angular/compiler/src/facade/lang.js"),HtmlTextAst=function(){function HtmlTextAst(value,sourceSpan){this.value=value,this.sourceSpan=sourceSpan}return HtmlTextAst.prototype.visit=function(visitor,context){return visitor.visitText(this,context)},HtmlTextAst}();exports.HtmlTextAst=HtmlTextAst;var HtmlExpansionAst=function(){function HtmlExpansionAst(switchValue,type,cases,sourceSpan,switchValueSourceSpan){this.switchValue=switchValue,this.type=type,this.cases=cases,this.sourceSpan=sourceSpan,this.switchValueSourceSpan=switchValueSourceSpan}return HtmlExpansionAst.prototype.visit=function(visitor,context){return visitor.visitExpansion(this,context)},HtmlExpansionAst}();exports.HtmlExpansionAst=HtmlExpansionAst;var HtmlExpansionCaseAst=function(){function HtmlExpansionCaseAst(value,expression,sourceSpan,valueSourceSpan,expSourceSpan){this.value=value,this.expression=expression,this.sourceSpan=sourceSpan,this.valueSourceSpan=valueSourceSpan,this.expSourceSpan=expSourceSpan}return HtmlExpansionCaseAst.prototype.visit=function(visitor,context){return visitor.visitExpansionCase(this,context)},HtmlExpansionCaseAst}();exports.HtmlExpansionCaseAst=HtmlExpansionCaseAst;var HtmlAttrAst=function(){function HtmlAttrAst(name,value,sourceSpan){this.name=name,this.value=value,this.sourceSpan=sourceSpan}return HtmlAttrAst.prototype.visit=function(visitor,context){return visitor.visitAttr(this,context)},HtmlAttrAst}();exports.HtmlAttrAst=HtmlAttrAst;var HtmlElementAst=function(){function HtmlElementAst(name,attrs,children,sourceSpan,startSourceSpan,endSourceSpan){this.name=name,this.attrs=attrs,this.children=children,this.sourceSpan=sourceSpan,this.startSourceSpan=startSourceSpan,this.endSourceSpan=endSourceSpan}return HtmlElementAst.prototype.visit=function(visitor,context){return visitor.visitElement(this,context)},HtmlElementAst}();exports.HtmlElementAst=HtmlElementAst;var HtmlCommentAst=function(){function HtmlCommentAst(value,sourceSpan){this.value=value,this.sourceSpan=sourceSpan}return HtmlCommentAst.prototype.visit=function(visitor,context){return visitor.visitComment(this,context)},HtmlCommentAst}();return exports.HtmlCommentAst=HtmlCommentAst,exports.htmlVisitAll=htmlVisitAll,module.exports}),$__System.registerDynamic("@angular/compiler/src/provider_parser.js",["@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/compile_metadata.js","@angular/compiler/src/identifiers.js","@angular/compiler/src/parse_util.js","@angular/compiler/src/template_ast.js"],!0,function($__require,exports,module){"use strict";function _transformProvider(provider,_a){var useExisting=_a.useExisting,useValue=_a.useValue,deps=_a.deps;return new compile_metadata_1.CompileProviderMetadata({token:provider.token,useClass:provider.useClass,useExisting:useExisting,useFactory:provider.useFactory,useValue:useValue,deps:deps,multi:provider.multi})}function _transformProviderAst(provider,_a){var eager=_a.eager,providers=_a.providers;return new template_ast_1.ProviderAst(provider.token,provider.multiProvider,provider.eager||eager,providers,provider.providerType,provider.sourceSpan)}function _normalizeProviders(providers,sourceSpan,targetErrors,targetProviders){return void 0===targetProviders&&(targetProviders=null),lang_1.isBlank(targetProviders)&&(targetProviders=[]),lang_1.isPresent(providers)&&providers.forEach(function(provider){if(lang_1.isArray(provider))_normalizeProviders(provider,sourceSpan,targetErrors,targetProviders);else{var normalizeProvider;provider instanceof compile_metadata_1.CompileProviderMetadata?normalizeProvider=provider:provider instanceof compile_metadata_1.CompileTypeMetadata?normalizeProvider=new compile_metadata_1.CompileProviderMetadata({token:new compile_metadata_1.CompileTokenMetadata({identifier:provider}),useClass:provider}):targetErrors.push(new ProviderError("Unknown provider type "+provider,sourceSpan)),lang_1.isPresent(normalizeProvider)&&targetProviders.push(normalizeProvider)}}),targetProviders}function _resolveProvidersFromDirectives(directives,sourceSpan,targetErrors){var providersByToken=new compile_metadata_1.CompileTokenMap;directives.forEach(function(directive){var dirProvider=new compile_metadata_1.CompileProviderMetadata({token:new compile_metadata_1.CompileTokenMetadata({identifier:directive.type}),useClass:directive.type});_resolveProviders([dirProvider],directive.isComponent?template_ast_1.ProviderAstType.Component:template_ast_1.ProviderAstType.Directive,!0,sourceSpan,targetErrors,providersByToken)});var directivesWithComponentFirst=directives.filter(function(dir){return dir.isComponent}).concat(directives.filter(function(dir){return!dir.isComponent}));return directivesWithComponentFirst.forEach(function(directive){_resolveProviders(_normalizeProviders(directive.providers,sourceSpan,targetErrors),template_ast_1.ProviderAstType.PublicService,!1,sourceSpan,targetErrors,providersByToken),_resolveProviders(_normalizeProviders(directive.viewProviders,sourceSpan,targetErrors),template_ast_1.ProviderAstType.PrivateService,!1,sourceSpan,targetErrors,providersByToken)}),providersByToken}function _resolveProviders(providers,providerType,eager,sourceSpan,targetErrors,targetProvidersByToken){providers.forEach(function(provider){var resolvedProvider=targetProvidersByToken.get(provider.token);lang_1.isPresent(resolvedProvider)&&resolvedProvider.multiProvider!==provider.multi&&targetErrors.push(new ProviderError("Mixing multi and non multi provider is not possible for token "+resolvedProvider.token.name,sourceSpan)),lang_1.isBlank(resolvedProvider)?(resolvedProvider=new template_ast_1.ProviderAst(provider.token,provider.multi,eager,[provider],providerType,sourceSpan),targetProvidersByToken.add(provider.token,resolvedProvider)):(provider.multi||collection_1.ListWrapper.clear(resolvedProvider.providers),resolvedProvider.providers.push(provider))})}function _getViewQueries(component){var viewQueries=new compile_metadata_1.CompileTokenMap;return lang_1.isPresent(component.viewQueries)&&component.viewQueries.forEach(function(query){return _addQueryToTokenMap(viewQueries,query)}),component.type.diDeps.forEach(function(dep){lang_1.isPresent(dep.viewQuery)&&_addQueryToTokenMap(viewQueries,dep.viewQuery)}),viewQueries}function _getContentQueries(directives){var contentQueries=new compile_metadata_1.CompileTokenMap;return directives.forEach(function(directive){lang_1.isPresent(directive.queries)&&directive.queries.forEach(function(query){return _addQueryToTokenMap(contentQueries,query)}),directive.type.diDeps.forEach(function(dep){lang_1.isPresent(dep.query)&&_addQueryToTokenMap(contentQueries,dep.query)})}),contentQueries}function _addQueryToTokenMap(map,query){query.selectors.forEach(function(token){var entry=map.get(token);lang_1.isBlank(entry)&&(entry=[],map.add(token,entry)),entry.push(query)})}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},collection_1=$__require("@angular/compiler/src/facade/collection.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),compile_metadata_1=$__require("@angular/compiler/src/compile_metadata.js"),identifiers_1=$__require("@angular/compiler/src/identifiers.js"),parse_util_1=$__require("@angular/compiler/src/parse_util.js"),template_ast_1=$__require("@angular/compiler/src/template_ast.js"),ProviderError=function(_super){function ProviderError(message,span){_super.call(this,span,message)}return __extends(ProviderError,_super),ProviderError}(parse_util_1.ParseError);exports.ProviderError=ProviderError;var ProviderViewContext=function(){function ProviderViewContext(component,sourceSpan){var _this=this;this.component=component,this.sourceSpan=sourceSpan,this.errors=[],this.viewQueries=_getViewQueries(component),this.viewProviders=new compile_metadata_1.CompileTokenMap,_normalizeProviders(component.viewProviders,sourceSpan,this.errors).forEach(function(provider){lang_1.isBlank(_this.viewProviders.get(provider.token))&&_this.viewProviders.add(provider.token,!0)})}return ProviderViewContext}();exports.ProviderViewContext=ProviderViewContext;var ProviderElementContext=function(){function ProviderElementContext(_viewContext,_parent,_isViewRoot,_directiveAsts,attrs,refs,_sourceSpan){var _this=this;this._viewContext=_viewContext,this._parent=_parent,this._isViewRoot=_isViewRoot,this._directiveAsts=_directiveAsts,this._sourceSpan=_sourceSpan,this._transformedProviders=new compile_metadata_1.CompileTokenMap,this._seenProviders=new compile_metadata_1.CompileTokenMap,this._hasViewContainer=!1,this._attrs={},attrs.forEach(function(attrAst){return _this._attrs[attrAst.name]=attrAst.value});var directivesMeta=_directiveAsts.map(function(directiveAst){return directiveAst.directive});this._allProviders=_resolveProvidersFromDirectives(directivesMeta,_sourceSpan,_viewContext.errors),this._contentQueries=_getContentQueries(directivesMeta);var queriedTokens=new compile_metadata_1.CompileTokenMap;this._allProviders.values().forEach(function(provider){_this._addQueryReadsTo(provider.token,queriedTokens)}),refs.forEach(function(refAst){_this._addQueryReadsTo(new compile_metadata_1.CompileTokenMetadata({value:refAst.name}),queriedTokens)}),lang_1.isPresent(queriedTokens.get(identifiers_1.identifierToken(identifiers_1.Identifiers.ViewContainerRef)))&&(this._hasViewContainer=!0),this._allProviders.values().forEach(function(provider){var eager=provider.eager||lang_1.isPresent(queriedTokens.get(provider.token));eager&&_this._getOrCreateLocalProvider(provider.providerType,provider.token,!0)})}return ProviderElementContext.prototype.afterElement=function(){var _this=this;this._allProviders.values().forEach(function(provider){_this._getOrCreateLocalProvider(provider.providerType,provider.token,!1)})},Object.defineProperty(ProviderElementContext.prototype,"transformProviders",{get:function(){return this._transformedProviders.values()},enumerable:!0,configurable:!0}),Object.defineProperty(ProviderElementContext.prototype,"transformedDirectiveAsts",{get:function(){var sortedProviderTypes=this._transformedProviders.values().map(function(provider){return provider.token.identifier}),sortedDirectives=collection_1.ListWrapper.clone(this._directiveAsts);return collection_1.ListWrapper.sort(sortedDirectives,function(dir1,dir2){return sortedProviderTypes.indexOf(dir1.directive.type)-sortedProviderTypes.indexOf(dir2.directive.type)}),sortedDirectives},enumerable:!0,configurable:!0}),Object.defineProperty(ProviderElementContext.prototype,"transformedHasViewContainer",{get:function(){return this._hasViewContainer},enumerable:!0,configurable:!0}),ProviderElementContext.prototype._addQueryReadsTo=function(token,queryReadTokens){this._getQueriesFor(token).forEach(function(query){var queryReadToken=lang_1.isPresent(query.read)?query.read:token;lang_1.isBlank(queryReadTokens.get(queryReadToken))&&queryReadTokens.add(queryReadToken,!0)})},ProviderElementContext.prototype._getQueriesFor=function(token){for(var queries,result=[],currentEl=this,distance=0;null!==currentEl;)queries=currentEl._contentQueries.get(token),lang_1.isPresent(queries)&&collection_1.ListWrapper.addAll(result,queries.filter(function(query){return query.descendants||distance<=1})),currentEl._directiveAsts.length>0&&distance++,currentEl=currentEl._parent;return queries=this._viewContext.viewQueries.get(token),lang_1.isPresent(queries)&&collection_1.ListWrapper.addAll(result,queries),result},ProviderElementContext.prototype._getOrCreateLocalProvider=function(requestingProviderType,token,eager){var _this=this,resolvedProvider=this._allProviders.get(token);if(lang_1.isBlank(resolvedProvider)||(requestingProviderType===template_ast_1.ProviderAstType.Directive||requestingProviderType===template_ast_1.ProviderAstType.PublicService)&&resolvedProvider.providerType===template_ast_1.ProviderAstType.PrivateService||(requestingProviderType===template_ast_1.ProviderAstType.PrivateService||requestingProviderType===template_ast_1.ProviderAstType.PublicService)&&resolvedProvider.providerType===template_ast_1.ProviderAstType.Builtin)return null;var transformedProviderAst=this._transformedProviders.get(token);if(lang_1.isPresent(transformedProviderAst))return transformedProviderAst;if(lang_1.isPresent(this._seenProviders.get(token)))return this._viewContext.errors.push(new ProviderError("Cannot instantiate cyclic dependency! "+token.name,this._sourceSpan)),null;this._seenProviders.add(token,!0);var transformedProviders=resolvedProvider.providers.map(function(provider){var transformedDeps,transformedUseValue=provider.useValue,transformedUseExisting=provider.useExisting;if(lang_1.isPresent(provider.useExisting)){var existingDiDep=_this._getDependency(resolvedProvider.providerType,new compile_metadata_1.CompileDiDependencyMetadata({token:provider.useExisting}),eager);lang_1.isPresent(existingDiDep.token)?transformedUseExisting=existingDiDep.token:(transformedUseExisting=null,transformedUseValue=existingDiDep.value)}else if(lang_1.isPresent(provider.useFactory)){var deps=lang_1.isPresent(provider.deps)?provider.deps:provider.useFactory.diDeps;transformedDeps=deps.map(function(dep){return _this._getDependency(resolvedProvider.providerType,dep,eager)})}else if(lang_1.isPresent(provider.useClass)){var deps=lang_1.isPresent(provider.deps)?provider.deps:provider.useClass.diDeps;transformedDeps=deps.map(function(dep){return _this._getDependency(resolvedProvider.providerType,dep,eager)})}return _transformProvider(provider,{useExisting:transformedUseExisting,useValue:transformedUseValue,deps:transformedDeps})});return transformedProviderAst=_transformProviderAst(resolvedProvider,{eager:eager,providers:transformedProviders}),this._transformedProviders.add(token,transformedProviderAst),transformedProviderAst},ProviderElementContext.prototype._getLocalDependency=function(requestingProviderType,dep,eager){if(void 0===eager&&(eager=null),dep.isAttribute){var attrValue=this._attrs[dep.token.value];return new compile_metadata_1.CompileDiDependencyMetadata({isValue:!0,value:lang_1.normalizeBlank(attrValue)})}if(lang_1.isPresent(dep.query)||lang_1.isPresent(dep.viewQuery))return dep;if(lang_1.isPresent(dep.token)){if(requestingProviderType===template_ast_1.ProviderAstType.Directive||requestingProviderType===template_ast_1.ProviderAstType.Component){if(dep.token.equalsTo(identifiers_1.identifierToken(identifiers_1.Identifiers.Renderer))||dep.token.equalsTo(identifiers_1.identifierToken(identifiers_1.Identifiers.ElementRef))||dep.token.equalsTo(identifiers_1.identifierToken(identifiers_1.Identifiers.ChangeDetectorRef))||dep.token.equalsTo(identifiers_1.identifierToken(identifiers_1.Identifiers.TemplateRef)))return dep;dep.token.equalsTo(identifiers_1.identifierToken(identifiers_1.Identifiers.ViewContainerRef))&&(this._hasViewContainer=!0)}if(dep.token.equalsTo(identifiers_1.identifierToken(identifiers_1.Identifiers.Injector)))return dep;if(lang_1.isPresent(this._getOrCreateLocalProvider(requestingProviderType,dep.token,eager)))return dep}return null},ProviderElementContext.prototype._getDependency=function(requestingProviderType,dep,eager){void 0===eager&&(eager=null);var currElement=this,currEager=eager,result=null;if(dep.isSkipSelf||(result=this._getLocalDependency(requestingProviderType,dep,eager)),dep.isSelf)lang_1.isBlank(result)&&dep.isOptional&&(result=new compile_metadata_1.CompileDiDependencyMetadata({isValue:!0,value:null}));else{for(;lang_1.isBlank(result)&&lang_1.isPresent(currElement._parent);){var prevElement=currElement;currElement=currElement._parent,prevElement._isViewRoot&&(currEager=!1),result=currElement._getLocalDependency(template_ast_1.ProviderAstType.PublicService,dep,currEager)}lang_1.isBlank(result)&&(result=!dep.isHost||this._viewContext.component.type.isHost||identifiers_1.identifierToken(this._viewContext.component.type).equalsTo(dep.token)||lang_1.isPresent(this._viewContext.viewProviders.get(dep.token))?dep:dep.isOptional?result=new compile_metadata_1.CompileDiDependencyMetadata({isValue:!0,value:null}):null)}return lang_1.isBlank(result)&&this._viewContext.errors.push(new ProviderError("No provider for "+dep.token.name,this._sourceSpan)),result},ProviderElementContext}();return exports.ProviderElementContext=ProviderElementContext,module.exports}),$__System.registerDynamic("@angular/compiler/src/template_parser.js",["@angular/core/index.js","@angular/compiler/core_private.js","@angular/compiler/src/facade/collection.js","@angular/compiler/src/facade/lang.js","@angular/compiler/src/facade/exceptions.js","@angular/compiler/src/expression_parser/ast.js","@angular/compiler/src/expression_parser/parser.js","@angular/compiler/src/html_parser.js","@angular/compiler/src/html_tags.js","@angular/compiler/src/parse_util.js","@angular/compiler/src/template_ast.js","@angular/compiler/src/selector.js","@angular/compiler/src/schema/element_schema_registry.js","@angular/compiler/src/template_preparser.js","@angular/compiler/src/style_url_resolver.js","@angular/compiler/src/html_ast.js","@angular/compiler/src/util.js","@angular/compiler/src/identifiers.js","@angular/compiler/src/provider_parser.js"],!0,function($__require,exports,module){"use strict";function splitClasses(classAttrValue){return lang_1.StringWrapper.split(classAttrValue.trim(),/\s+/g)}function createElementCssSelector(elementName,matchableAttrs){var cssSelector=new selector_1.CssSelector,elNameNoNs=html_tags_1.splitNsName(elementName)[1];cssSelector.setElement(elNameNoNs);for(var i=0;i0;hasMatch||res.push(item)}),res}var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},core_1=$__require("@angular/core/index.js"),core_private_1=$__require("@angular/compiler/core_private.js"),collection_1=$__require("@angular/compiler/src/facade/collection.js"),lang_1=$__require("@angular/compiler/src/facade/lang.js"),exceptions_1=$__require("@angular/compiler/src/facade/exceptions.js"),ast_1=$__require("@angular/compiler/src/expression_parser/ast.js"),parser_1=$__require("@angular/compiler/src/expression_parser/parser.js"),html_parser_1=$__require("@angular/compiler/src/html_parser.js"),html_tags_1=$__require("@angular/compiler/src/html_tags.js"),parse_util_1=$__require("@angular/compiler/src/parse_util.js"),template_ast_1=$__require("@angular/compiler/src/template_ast.js"),selector_1=$__require("@angular/compiler/src/selector.js"),element_schema_registry_1=$__require("@angular/compiler/src/schema/element_schema_registry.js"),template_preparser_1=$__require("@angular/compiler/src/template_preparser.js"),style_url_resolver_1=$__require("@angular/compiler/src/style_url_resolver.js"),html_ast_1=$__require("@angular/compiler/src/html_ast.js"),util_1=$__require("@angular/compiler/src/util.js"),identifiers_1=$__require("@angular/compiler/src/identifiers.js"),provider_parser_1=$__require("@angular/compiler/src/provider_parser.js"),BIND_NAME_REGEXP=/^(?:(?:(?:(bind-)|(var-)|(let-)|(ref-|#)|(on-)|(bindon-)|(animate-|@))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g,TEMPLATE_ELEMENT="template",TEMPLATE_ATTR="template",TEMPLATE_ATTR_PREFIX="*",CLASS_ATTR="class",PROPERTY_PARTS_SEPARATOR=".",ATTRIBUTE_PREFIX="attr",CLASS_PREFIX="class",STYLE_PREFIX="style",TEXT_CSS_SELECTOR=selector_1.CssSelector.parse("*")[0];exports.TEMPLATE_TRANSFORMS=new core_1.OpaqueToken("TemplateTransforms");var TemplateParseError=function(_super){function TemplateParseError(message,span,level){_super.call(this,span,message,level)}return __extends(TemplateParseError,_super),TemplateParseError}(parse_util_1.ParseError);exports.TemplateParseError=TemplateParseError;var TemplateParseResult=function(){function TemplateParseResult(templateAst,errors){this.templateAst=templateAst,this.errors=errors}return TemplateParseResult}();exports.TemplateParseResult=TemplateParseResult;var TemplateParser=function(){function TemplateParser(_exprParser,_schemaRegistry,_htmlParser,_console,transforms){this._exprParser=_exprParser,this._schemaRegistry=_schemaRegistry,this._htmlParser=_htmlParser,this._console=_console,this.transforms=transforms}return TemplateParser.prototype.parse=function(component,template,directives,pipes,templateUrl){var result=this.tryParse(component,template,directives,pipes,templateUrl),warnings=result.errors.filter(function(error){return error.level===parse_util_1.ParseErrorLevel.WARNING}),errors=result.errors.filter(function(error){return error.level===parse_util_1.ParseErrorLevel.FATAL});if(warnings.length>0&&this._console.warn("Template parse warnings:\n"+warnings.join("\n")),errors.length>0){var errorString=errors.join("\n");throw new exceptions_1.BaseException("Template parse errors:\n"+errorString)}return result.templateAst},TemplateParser.prototype.tryParse=function(component,template,directives,pipes,templateUrl){var result,htmlAstWithErrors=this._htmlParser.parse(template,templateUrl),errors=htmlAstWithErrors.errors;if(htmlAstWithErrors.rootNodes.length>0){var uniqDirectives=removeDuplicates(directives),uniqPipes=removeDuplicates(pipes),providerViewContext=new provider_parser_1.ProviderViewContext(component,htmlAstWithErrors.rootNodes[0].sourceSpan),parseVisitor=new TemplateParseVisitor(providerViewContext,uniqDirectives,uniqPipes,this._exprParser,this._schemaRegistry);result=html_ast_1.htmlVisitAll(parseVisitor,htmlAstWithErrors.rootNodes,EMPTY_ELEMENT_CONTEXT),errors=errors.concat(parseVisitor.errors).concat(providerViewContext.errors)}else result=[];return this._assertNoReferenceDuplicationOnTemplate(result,errors),errors.length>0?new TemplateParseResult(result,errors):(lang_1.isPresent(this.transforms)&&this.transforms.forEach(function(transform){result=template_ast_1.templateVisitAll(transform,result)}),new TemplateParseResult(result,errors))},TemplateParser.prototype._assertNoReferenceDuplicationOnTemplate=function(result,errors){var existingReferences=[];result.filter(function(element){return!!element.references}).forEach(function(element){return element.references.forEach(function(reference){var name=reference.name;if(existingReferences.indexOf(name)<0)existingReferences.push(name);else{var error=new TemplateParseError('Reference "#'+name+'" is defined several times',reference.sourceSpan,parse_util_1.ParseErrorLevel.FATAL);errors.push(error)}})})},TemplateParser.decorators=[{type:core_1.Injectable}],TemplateParser.ctorParameters=[{ type:parser_1.Parser},{type:element_schema_registry_1.ElementSchemaRegistry},{type:html_parser_1.HtmlParser},{type:core_private_1.Console},{type:Array,decorators:[{type:core_1.Optional},{type:core_1.Inject,args:[exports.TEMPLATE_TRANSFORMS]}]}],TemplateParser}();exports.TemplateParser=TemplateParser;var TemplateParseVisitor=function(){function TemplateParseVisitor(providerViewContext,directives,pipes,_exprParser,_schemaRegistry){var _this=this;this.providerViewContext=providerViewContext,this._exprParser=_exprParser,this._schemaRegistry=_schemaRegistry,this.errors=[],this.directivesIndex=new Map,this.ngContentCount=0,this.selectorMatcher=new selector_1.SelectorMatcher;var tempMeta=providerViewContext.component.template;lang_1.isPresent(tempMeta)&&lang_1.isPresent(tempMeta.interpolation)&&(this._interpolationConfig={start:tempMeta.interpolation[0],end:tempMeta.interpolation[1]}),collection_1.ListWrapper.forEachWithIndex(directives,function(directive,index){var selector=selector_1.CssSelector.parse(directive.selector);_this.selectorMatcher.addSelectables(selector,directive),_this.directivesIndex.set(directive,index)}),this.pipesByName=new Map,pipes.forEach(function(pipe){return _this.pipesByName.set(pipe.name,pipe)})}return TemplateParseVisitor.prototype._reportError=function(message,sourceSpan,level){void 0===level&&(level=parse_util_1.ParseErrorLevel.FATAL),this.errors.push(new TemplateParseError(message,sourceSpan,level))},TemplateParseVisitor.prototype._parseInterpolation=function(value,sourceSpan){var sourceInfo=sourceSpan.start.toString();try{var ast=this._exprParser.parseInterpolation(value,sourceInfo,this._interpolationConfig);if(this._checkPipes(ast,sourceSpan),lang_1.isPresent(ast)&&ast.ast.expressions.length>core_private_1.MAX_INTERPOLATION_VALUES)throw new exceptions_1.BaseException("Only support at most "+core_private_1.MAX_INTERPOLATION_VALUES+" interpolation values!");return ast}catch(e){return this._reportError(""+e,sourceSpan),this._exprParser.wrapLiteralPrimitive("ERROR",sourceInfo)}},TemplateParseVisitor.prototype._parseAction=function(value,sourceSpan){var sourceInfo=sourceSpan.start.toString();try{var ast=this._exprParser.parseAction(value,sourceInfo,this._interpolationConfig);return this._checkPipes(ast,sourceSpan),ast}catch(e){return this._reportError(""+e,sourceSpan),this._exprParser.wrapLiteralPrimitive("ERROR",sourceInfo)}},TemplateParseVisitor.prototype._parseBinding=function(value,sourceSpan){var sourceInfo=sourceSpan.start.toString();try{var ast=this._exprParser.parseBinding(value,sourceInfo,this._interpolationConfig);return this._checkPipes(ast,sourceSpan),ast}catch(e){return this._reportError(""+e,sourceSpan),this._exprParser.wrapLiteralPrimitive("ERROR",sourceInfo)}},TemplateParseVisitor.prototype._parseTemplateBindings=function(value,sourceSpan){var _this=this,sourceInfo=sourceSpan.start.toString();try{var bindingsResult=this._exprParser.parseTemplateBindings(value,sourceInfo);return bindingsResult.templateBindings.forEach(function(binding){lang_1.isPresent(binding.expression)&&_this._checkPipes(binding.expression,sourceSpan)}),bindingsResult.warnings.forEach(function(warning){_this._reportError(warning,sourceSpan,parse_util_1.ParseErrorLevel.WARNING)}),bindingsResult.templateBindings}catch(e){return this._reportError(""+e,sourceSpan),[]}},TemplateParseVisitor.prototype._checkPipes=function(ast,sourceSpan){var _this=this;if(lang_1.isPresent(ast)){var collector=new PipeCollector;ast.visit(collector),collector.pipes.forEach(function(pipeName){_this.pipesByName.has(pipeName)||_this._reportError("The pipe '"+pipeName+"' could not be found",sourceSpan)})}},TemplateParseVisitor.prototype.visitExpansion=function(ast,context){return null},TemplateParseVisitor.prototype.visitExpansionCase=function(ast,context){return null},TemplateParseVisitor.prototype.visitText=function(ast,parent){var ngContentIndex=parent.findNgContentIndex(TEXT_CSS_SELECTOR),expr=this._parseInterpolation(ast.value,ast.sourceSpan);return lang_1.isPresent(expr)?new template_ast_1.BoundTextAst(expr,ngContentIndex,ast.sourceSpan):new template_ast_1.TextAst(ast.value,ngContentIndex,ast.sourceSpan)},TemplateParseVisitor.prototype.visitAttr=function(ast,contex){return new template_ast_1.AttrAst(ast.name,ast.value,ast.sourceSpan)},TemplateParseVisitor.prototype.visitComment=function(ast,context){return null},TemplateParseVisitor.prototype.visitElement=function(element,parent){var _this=this,nodeName=element.name,preparsedElement=template_preparser_1.preparseElement(element);if(preparsedElement.type===template_preparser_1.PreparsedElementType.SCRIPT||preparsedElement.type===template_preparser_1.PreparsedElementType.STYLE)return null;if(preparsedElement.type===template_preparser_1.PreparsedElementType.STYLESHEET&&style_url_resolver_1.isStyleUrlResolvable(preparsedElement.hrefAttr))return null;var matchableAttrs=[],elementOrDirectiveProps=[],elementOrDirectiveRefs=[],elementVars=[],animationProps=[],events=[],templateElementOrDirectiveProps=[],templateMatchableAttrs=[],templateElementVars=[],hasInlineTemplates=!1,attrs=[],lcElName=html_tags_1.splitNsName(nodeName.toLowerCase())[1],isTemplateElement=lcElName==TEMPLATE_ELEMENT;element.attrs.forEach(function(attr){var hasBinding=_this._parseAttr(isTemplateElement,attr,matchableAttrs,elementOrDirectiveProps,animationProps,events,elementOrDirectiveRefs,elementVars),hasTemplateBinding=_this._parseInlineTemplateBinding(attr,templateMatchableAttrs,templateElementOrDirectiveProps,templateElementVars);hasTemplateBinding&&hasInlineTemplates&&_this._reportError("Can't have multiple template bindings on one element. Use only one attribute named 'template' or prefixed with *",attr.sourceSpan),hasBinding||hasTemplateBinding||(attrs.push(_this.visitAttr(attr,null)),matchableAttrs.push([attr.name,attr.value])),hasTemplateBinding&&(hasInlineTemplates=!0)});var elementCssSelector=createElementCssSelector(nodeName,matchableAttrs),directiveMetas=this._parseDirectives(this.selectorMatcher,elementCssSelector),references=[],directiveAsts=this._createDirectiveAsts(isTemplateElement,element.name,directiveMetas,elementOrDirectiveProps,elementOrDirectiveRefs,element.sourceSpan,references),elementProps=this._createElementPropertyAsts(element.name,elementOrDirectiveProps,directiveAsts).concat(animationProps),isViewRoot=parent.isTemplateElement||hasInlineTemplates,providerContext=new provider_parser_1.ProviderElementContext(this.providerViewContext,parent.providerContext,isViewRoot,directiveAsts,attrs,references,element.sourceSpan),children=html_ast_1.htmlVisitAll(preparsedElement.nonBindable?NON_BINDABLE_VISITOR:this,element.children,ElementContext.create(isTemplateElement,directiveAsts,isTemplateElement?parent.providerContext:providerContext));providerContext.afterElement();var parsedElement,projectionSelector=lang_1.isPresent(preparsedElement.projectAs)?selector_1.CssSelector.parse(preparsedElement.projectAs)[0]:elementCssSelector,ngContentIndex=parent.findNgContentIndex(projectionSelector);if(preparsedElement.type===template_preparser_1.PreparsedElementType.NG_CONTENT)lang_1.isPresent(element.children)&&element.children.length>0&&this._reportError(" element cannot have content. must be immediately followed by ",element.sourceSpan),parsedElement=new template_ast_1.NgContentAst((this.ngContentCount++),hasInlineTemplates?null:ngContentIndex,element.sourceSpan);else if(isTemplateElement)this._assertAllEventsPublishedByDirectives(directiveAsts,events),this._assertNoComponentsNorElementBindingsOnTemplate(directiveAsts,elementProps,element.sourceSpan),parsedElement=new template_ast_1.EmbeddedTemplateAst(attrs,events,references,elementVars,providerContext.transformedDirectiveAsts,providerContext.transformProviders,providerContext.transformedHasViewContainer,children,hasInlineTemplates?null:ngContentIndex,element.sourceSpan);else{this._assertOnlyOneComponent(directiveAsts,element.sourceSpan);var ngContentIndex_1=hasInlineTemplates?null:parent.findNgContentIndex(projectionSelector);parsedElement=new template_ast_1.ElementAst(nodeName,attrs,elementProps,events,references,providerContext.transformedDirectiveAsts,providerContext.transformProviders,providerContext.transformedHasViewContainer,children,hasInlineTemplates?null:ngContentIndex_1,element.sourceSpan)}if(hasInlineTemplates){var templateCssSelector=createElementCssSelector(TEMPLATE_ELEMENT,templateMatchableAttrs),templateDirectiveMetas=this._parseDirectives(this.selectorMatcher,templateCssSelector),templateDirectiveAsts=this._createDirectiveAsts(!0,element.name,templateDirectiveMetas,templateElementOrDirectiveProps,[],element.sourceSpan,[]),templateElementProps=this._createElementPropertyAsts(element.name,templateElementOrDirectiveProps,templateDirectiveAsts);this._assertNoComponentsNorElementBindingsOnTemplate(templateDirectiveAsts,templateElementProps,element.sourceSpan);var templateProviderContext=new provider_parser_1.ProviderElementContext(this.providerViewContext,parent.providerContext,parent.isTemplateElement,templateDirectiveAsts,[],[],element.sourceSpan);templateProviderContext.afterElement(),parsedElement=new template_ast_1.EmbeddedTemplateAst([],[],[],templateElementVars,templateProviderContext.transformedDirectiveAsts,templateProviderContext.transformProviders,templateProviderContext.transformedHasViewContainer,[parsedElement],ngContentIndex,element.sourceSpan)}return parsedElement},TemplateParseVisitor.prototype._parseInlineTemplateBinding=function(attr,targetMatchableAttrs,targetProps,targetVars){var templateBindingsSource=null;if(attr.name==TEMPLATE_ATTR)templateBindingsSource=attr.value;else if(attr.name.startsWith(TEMPLATE_ATTR_PREFIX)){var key=attr.name.substring(TEMPLATE_ATTR_PREFIX.length);templateBindingsSource=0==attr.value.length?key:key+" "+attr.value}if(lang_1.isPresent(templateBindingsSource)){for(var bindings=this._parseTemplateBindings(templateBindingsSource,attr.sourceSpan),i=0;i elements is deprecated. Use "let-" instead!',attr.sourceSpan,parse_util_1.ParseErrorLevel.WARNING),this._parseVariable(identifier,attrValue,attr.sourceSpan,targetVars)):(this._reportError('"var-" on non