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A,IAAG,AAAY;AA3R5F,OAAK,cAAc,kBA2R2B,KAAG,WA3RjD,CAAA,MAAK,YAAuB,AA2RkC,CAAA,IAAG,CAAE,QAAM,CAAC,AA3R3B,OA2RoC,WAAS,CA3RtD,CAAA;AA4RpC,KAAI,OAAM,AAAC,CAAC,aAAY,CAAC;AAAG,gBAAY,EAAI,CAAA,QAAO,iBAAiB,AAAC,CAAC,aAAY,CAAC,CAAC;AAAA,AAChF,IAAA,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;AAhSlE,OAAO,CAAA,MAAK,WAAW,AAAC,CAAC,CAiShB,aAAY,sBAAsB,AAAC,CAAC,cAAa,CAAC,CAjShB,CA2RqD,SAAO,CA3RxC,CAAA;AAkS/D;AAlSA,KAAK,eAAe,AAAC,kCACb,EAAC,GAAE,CAAG,UAAS,AAAD,CAAG;AAAC,YA0RoB,IAAG,IA3RjD,MAAK,YAAuB,AA2RkC,CAAA,IAAG,CAAE,QAAM,CAAC,AA3R3B,IA2RoC,UAAS,GA1R3C;EAAC,CAAC,CAAC,CAAC;AAkSrD","file":"angular2/src/core/application.es6","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"]}