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,CAAA,cAAa,EAAI,CAAA,SAAQ,AAAC,CAAC,QAAO,CAAC,CAAA,CACnC,CAAA,WAAU,OAAO,AAAC,CAAC,iBAAgB,AAAC,CAAC,gBAAe,CAAC,CAAG,SAAO,CAAC,CAAA,CAChE,CAAA,iBAAgB,AAAC,CAAC,gBAAe,CAAC,CAAC;AACvC,YAAU,KAAK,AAAC,CAAC,cAAa,CAAG,CAAA,IAAG,AAAC,CAAC,UAAS,CAAC,QAAQ,AAAC,CAAC,IAAG,CAAC,CAAC,CAAC;AAChE,OAAO,CAAA,aAAY,sBAAsB,AAAC,CAAC,cAAa,CAAC,CAAC;AAC5D;AAAA,AAlSA,KAAK,eAAe,AAAC,kCACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,YA0RoB,IAAG,IA3RjD,eAAc,YAAc,AA2RkC,CAAA,IAAG,CAAE,QAAM,CAAC,AA3R3B,IA2RoC,UAAS,GA1R3C;EAAC,CAAC,CAAC,CAAC;AAkSrD","file":"angular2/src/core/application.js","sourcesContent":["import {Injector, bind, OpaqueToken, Optional} from 'angular2/di';\nimport {NumberWrapper, Type, isBlank, isPresent, BaseException,\n    assertionsEnabled, print, stringify} from 'angular2/src/facade/lang';\nimport {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';\nimport {DOM} from 'angular2/src/dom/dom_adapter';\nimport {Compiler, CompilerCache} from './compiler/compiler';\nimport {Reflector, reflector} from 'angular2/src/reflection/reflection';\nimport {Parser, Lexer, ChangeDetection, DynamicChangeDetection, PipeRegistry, defaultPipeRegistry} from 'angular2/change_detection';\nimport {ExceptionHandler} from './exception_handler';\nimport {TemplateLoader} from 'angular2/src/render/dom/compiler/template_loader';\nimport {TemplateResolver} from './compiler/template_resolver';\nimport {DirectiveMetadataReader} from './compiler/directive_metadata_reader';\nimport {List, ListWrapper} from 'angular2/src/facade/collection';\nimport {Promise, PromiseWrapper} from 'angular2/src/facade/async';\nimport {VmTurnZone} from 'angular2/src/core/zone/vm_turn_zone';\nimport {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';\nimport {ShadowDomStrategy} from 'angular2/src/render/dom/shadow_dom/shadow_dom_strategy';\nimport {EmulatedUnscopedShadowDomStrategy} from 'angular2/src/render/dom/shadow_dom/emulated_unscoped_shadow_dom_strategy';\nimport {XHR} from 'angular2/src/services/xhr';\nimport {XHRImpl} from 'angular2/src/services/xhr_impl';\nimport {EventManager, DomEventsPlugin} from 'angular2/src/render/dom/events/event_manager';\nimport {KeyEventsPlugin} from 'angular2/src/render/dom/events/key_events';\nimport {HammerGesturesPlugin} from 'angular2/src/render/dom/events/hammer_gestures';\nimport {Binding} from 'angular2/src/di/binding';\nimport {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';\nimport {UrlResolver} from 'angular2/src/services/url_resolver';\nimport {StyleUrlResolver} from 'angular2/src/render/dom/shadow_dom/style_url_resolver';\nimport {StyleInliner} from 'angular2/src/render/dom/shadow_dom/style_inliner';\nimport {ComponentRef, DynamicComponentLoader} from 'angular2/src/core/compiler/dynamic_component_loader';\nimport {TestabilityRegistry, Testability} from 'angular2/src/core/testability/testability';\nimport {ViewFactory, VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_factory';\nimport {AppViewHydrator} from 'angular2/src/core/compiler/view_hydrator';\nimport {ProtoViewFactory} from 'angular2/src/core/compiler/proto_view_factory';\nimport {Renderer} from 'angular2/src/render/api';\nimport {DirectDomRenderer} from 'angular2/src/render/dom/direct_dom_renderer';\nimport * as rc from 'angular2/src/render/dom/compiler/compiler';\nimport * as rvf from 'angular2/src/render/dom/view/view_factory';\nimport * as rvh from 'angular2/src/render/dom/view/view_hydrator';\n\nimport {\n  appComponentRefToken,\n  appChangeDetectorToken,\n  appElementToken,\n  appComponentAnnotatedTypeToken,\n  appDocumentToken,\n} from './application_tokens';\n\nvar _rootInjector: Injector;\n\n// Contains everything that is safe to share between applications.\nvar _rootBindings = [\n  bind(Reflector).toValue(reflector),\n  TestabilityRegistry\n];\n\nfunction _injectorBindings(appComponentType): List<Binding> {\n  return [\n      bind(appDocumentToken).toValue(DOM.defaultDoc()),\n      bind(appComponentAnnotatedTypeToken).toFactory((reader) => {\n        // TODO(rado): investigate whether to support bindings on root component.\n        return reader.read(appComponentType);\n      }, [DirectiveMetadataReader]),\n\n      bind(appElementToken).toFactory((appComponentAnnotatedType, appDocument) => {\n        var selector = appComponentAnnotatedType.annotation.selector;\n        var element = DOM.querySelector(appDocument, selector);\n        if (isBlank(element)) {\n          throw new BaseException(`The app selector \"${selector}\" did not match any elements`);\n        }\n        return element;\n      }, [appComponentAnnotatedTypeToken, appDocumentToken]),\n      bind(appComponentRefToken).toAsyncFactory((dynamicComponentLoader, injector, appElement,\n        appComponentAnnotatedType, testability, registry) => {\n\n        // We need to do this here to ensure that we create Testability and\n        // it's ready on the window for users.\n        registry.registerApplication(appElement, testability);\n        return dynamicComponentLoader.loadIntoNewLocation(appComponentAnnotatedType.type, null, appElement, injector);\n      }, [DynamicComponentLoader, Injector, appElementToken, appComponentAnnotatedTypeToken,\n        Testability, TestabilityRegistry]),\n\n      bind(appChangeDetectorToken).toFactory((ref) => ref.hostView.changeDetector,\n          [appComponentRefToken]),\n      bind(appComponentType).toFactory((ref) => ref.instance,\n          [appComponentRefToken]),\n      bind(LifeCycle).toFactory((exceptionHandler) => new LifeCycle(exceptionHandler, null, assertionsEnabled()),[ExceptionHandler]),\n      bind(EventManager).toFactory((zone) => {\n        var plugins = [new HammerGesturesPlugin(), new KeyEventsPlugin(), new DomEventsPlugin()];\n        return new EventManager(plugins, zone);\n      }, [VmTurnZone]),\n      bind(ShadowDomStrategy).toFactory(\n          (styleUrlResolver, doc) => new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, doc.head),\n          [StyleUrlResolver, appDocumentToken]),\n      DirectDomRenderer,\n      bind(Renderer).toClass(DirectDomRenderer),\n      bind(rc.Compiler).toClass(rc.DefaultCompiler),\n      // TODO(tbosch): We need an explicit factory here, as\n      // we are getting errors in dart2js with mirrors...\n      bind(rvf.ViewFactory).toFactory(\n        (capacity, eventManager, shadowDomStrategy) => new rvf.ViewFactory(capacity, eventManager, shadowDomStrategy),\n        [rvf.VIEW_POOL_CAPACITY, EventManager, ShadowDomStrategy]\n      ),\n      bind(rvf.VIEW_POOL_CAPACITY).toValue(10000),\n      rvh.RenderViewHydrator,\n      ProtoViewFactory,\n      // TODO(tbosch): We need an explicit factory here, as\n      // we are getting errors in dart2js with mirrors...\n      bind(ViewFactory).toFactory(\n        (capacity, renderer) => new ViewFactory(capacity, renderer),\n        [VIEW_POOL_CAPACITY, Renderer]\n      ),\n      bind(VIEW_POOL_CAPACITY).toValue(10000),\n      AppViewHydrator,\n      Compiler,\n      CompilerCache,\n      TemplateResolver,\n      bind(PipeRegistry).toValue(defaultPipeRegistry),\n      bind(ChangeDetection).toClass(DynamicChangeDetection),\n      TemplateLoader,\n      DirectiveMetadataReader,\n      Parser,\n      Lexer,\n      ExceptionHandler,\n      bind(XHR).toValue(new XHRImpl()),\n      ComponentUrlMapper,\n      UrlResolver,\n      StyleUrlResolver,\n      StyleInliner,\n      DynamicComponentLoader,\n      Testability\n  ];\n}\n\nfunction _createVmZone(givenReporter:Function): VmTurnZone {\n  var defaultErrorReporter = (exception, stackTrace) => {\n    var longStackTrace = ListWrapper.join(stackTrace, \"\\n\\n-----async gap-----\\n\");\n    print(`${exception}\\n\\n${longStackTrace}`);\n    throw exception;\n  };\n\n  var reporter = isPresent(givenReporter) ? givenReporter : defaultErrorReporter;\n\n  var zone = new VmTurnZone({enableLongStackTrace: assertionsEnabled()});\n  zone.initCallbacks({onErrorHandler: reporter});\n  return zone;\n}\n\n/**\n * Bootstrapping for Angular applications.\n *\n * You instantiate an Angular application by explicitly specifying a component to use as the root component for your\n * application via the `bootstrap()` method.\n *\n * ## Simple Example\n *\n * Assuming this `index.html`:\n *\n * ```html\n * <html>\n *   <!-- load Angular script tags here. -->\n *   <body>\n *     <my-app>loading...</my-app>\n *   </body>\n * </html>\n * ```\n *\n * An application is bootstrapped inside an existing browser DOM, typically `index.html`. Unlike Angular 1, Angular 2\n * does not compile/process bindings in `index.html`. This is mainly for security reasons, as well as architectural\n * changes in Angular 2. This means that `index.html` can safely be processed using server-side technologies such as\n * bindings. Bindings can thus use double-curly `{{ syntax }}` without collision from Angular 2 component double-curly\n * `{{ syntax }}`.\n *\n * We can use this script code:\n *\n * ```\n * @Component({\n *    selector: 'my-app'\n * })\n * @View({\n *    template: 'Hello {{ name }}!'\n * })\n * class MyApp {\n *   name:string;\n *\n *   constructor() {\n *     this.name = 'World';\n *   }\n * }\n *\n * main() {\n *   return bootstrap(MyApp);\n * }\n * ```\n *\n * When the app developer invokes `bootstrap()` with the root component `MyApp` as its argument, Angular performs the\n * following tasks:\n *\n *  1. It uses the component's `selector` property to locate the DOM element which needs to be upgraded into\n *     the angular component.\n *  2. It creates a new child injector (from the platform injector) and configures the injector with the component's\n *     `injectables`. Optionally, you can also override the injector configuration for an app by invoking\n *     `bootstrap` with the `componentInjectableBindings` argument.\n *  3. It creates a new `Zone` and connects it to the angular application's change detection domain instance.\n *  4. It creates a shadow DOM on the selected component's host element and loads the template into it.\n *  5. It instantiates the specified component.\n *  6. Finally, Angular performs change detection to apply the initial data bindings for the application.\n *\n *\n * ## Instantiating Multiple Applications on a Single Page\n *\n * There are two ways to do this.\n *\n *\n * ### Isolated Applications\n *\n * Angular creates a new application each time that the `bootstrap()` method is invoked. When multiple applications\n * are created for a page, Angular treats each application as independent within an isolated change detection and\n * `Zone` domain. If you need to share data between applications, use the strategy described in the next\n * section, \"Applications That Share Change Detection.\"\n *\n *\n * ### Applications That Share Change Detection\n *\n * If you need to bootstrap multiple applications that share common data, the applications must share a common\n * change detection and zone. To do that, create a meta-component that lists the application components in its template.\n * By only invoking the `bootstrap()` method once, with the meta-component as its argument, you ensure that only a\n * single change detection zone is created and therefore data can be shared across the applications.\n *\n *\n * ## Platform Injector\n *\n * When working within a browser window, there are many singleton resources: cookies, title, location, and others.\n * Angular services that represent these resources must likewise be shared across all Angular applications that\n * occupy the same browser window.  For this reason, Angular creates exactly one global platform injector which stores\n * all shared services, and each angular application injector has the platform injector as its parent.\n *\n * Each application has its own private injector as well. When there are multiple applications on a page, Angular treats\n * each application injector's services as private to that application.\n *\n *\n * # API\n * - `appComponentType`: The root component which should act as the application. This is a reference to a `Type`\n *   which is annotated with `@Component(...)`.\n * - `componentInjectableBindings`: An additional set of bindings that can be added to `injectables` for the\n * {@link Component} to override default injection behavior.\n * - `errorReporter`: `function(exception:any, stackTrace:string)` a default error reporter for unhandled exceptions.\n *\n * Returns a `Promise` with the application`s private {@link Injector}.\n *\n * @exportedAs angular2/core\n */\nexport function bootstrap(appComponentType: Type,\n                          componentInjectableBindings: List<Binding> = null,\n                          errorReporter: Function = null): Promise<ComponentRef> {\n  BrowserDomAdapter.makeCurrent();\n  var bootstrapProcess = PromiseWrapper.completer();\n\n  var zone = _createVmZone(errorReporter);\n  zone.run(() => {\n    // TODO(rado): prepopulate template cache, so applications with only\n    // index.html and main.js are possible.\n\n    var appInjector = _createAppInjector(appComponentType, componentInjectableBindings, zone);\n\n    PromiseWrapper.then(appInjector.asyncGet(appComponentRefToken),\n      (componentRef) => {\n        var appChangeDetector = componentRef.hostView.changeDetector;\n        // retrieve life cycle: may have already been created if injected in root component\n        var lc = appInjector.get(LifeCycle);\n        lc.registerWith(zone, appChangeDetector);\n        lc.tick(); //the first tick that will bootstrap the app\n\n        bootstrapProcess.resolve(componentRef);\n      },\n\n      (err) => {\n        bootstrapProcess.reject(err)\n      });\n  });\n\n  return bootstrapProcess.promise;\n}\n\nfunction _createAppInjector(appComponentType: Type, bindings: List<Binding>, zone: VmTurnZone): Injector {\n  if (isBlank(_rootInjector)) _rootInjector = Injector.resolveAndCreate(_rootBindings);\n  var mergedBindings = isPresent(bindings) ?\n      ListWrapper.concat(_injectorBindings(appComponentType), bindings) :\n      _injectorBindings(appComponentType);\n  ListWrapper.push(mergedBindings, bind(VmTurnZone).toValue(zone));\n  return _rootInjector.resolveAndCreateChild(mergedBindings);\n}\n"]}