From 33ea9915dddc37f87d4ec96b4d0b0a7753be9e45 Mon Sep 17 00:00:00 2001 From: Evan Schultz Date: Thu, 28 Apr 2016 15:54:09 -0400 Subject: [PATCH] feat(*): Typescript Port (#33) * Adds .idea (intellij IDE) to .gitignore * Ports the library to TypeScript, and adds (basic) generic support * Examples now work with Typed Stores, and Angular 2 Beta 1 * Upgraded tsd to typings * Updates/prunes dependencies adds postinstall for typings to the example * Purge typings * Fixes typings postinstall when used as a dependency * Updates typings and excludes tmp from tsconfig * Fix reflect-metadata issue * Fix counter and dev tools * Remove lib folder * Update counter to load ng2-redux from src * Update webpack config * Ports the library to TypeScript, and adds (basic) generic support * Update peer dependencies * Lock down versions * Adds redux-logger typings/dependency * Tests are now TypeScript * Remove old service code from provider.ts * Left ng-redux.ts as own file * Fix exports from src/index.ts * Remove extra 'reflect-metadata' from counter example * chore(tests) Add typings for mocha and chai * add chai to dev dep * update node version for tests * Observable Store and official redux typings * Remove js version of connector spec * Add ability to provide a custom compare function to .select * Fix path to index.d.ts * Update contributors on package.json * Cleanup example * Update readme with .select details * Change provider to use NgRedux class directly * Add alias for @Inject('ngRedux') To prevent breaking changes from people using @Inject('ngRedux'), setup an alias so that code using this style of injection will still work. * refactor(connector) Merge ng-redux and connector Refactored connector so all of the ng-redux.ts functionality was moved into it, then renamed it. * Updated tests, and cleaned up the provide factory. * Fix type issue for action creator * chore(readme) Update bootstrap * No longer need to register NgRedux directly as a provider * docs(ngRedux): Add docs to public api methods (#35) * chore(package): Update repo details (#36) * chore(ci): Setup circleci (#37) * chore(ci): Setup circleci * chore(ci): Change badge to be circleci (#38) * Chore ci changes (#39) * chore(ci): remove .travis.yml * chore(ci): Change node version * Chore/example project cleanup (#52) * chore(example): use npm package instead of source. * Prefer the chrome extension dev tools in README (#50) This is because they don't require a dependency on React. Also showed an example of enabling Angular 2 to refresh after events fired by the dev tools. * Dependency cleanup, minor corrections to example devtools. (#55) * Core changelog (#53) * add changelog --- packages/store/.babelrc | 2 +- packages/store/.gitignore | 10 +- packages/store/.npmignore | 6 +- packages/store/.travis.yml | 3 - packages/store/CHANGELOG.md | 61 + packages/store/README.md | 119 +- packages/store/circle.yml | 3 + .../counter/actions/CounterActions.ts | 6 +- .../examples/counter/components/Counter.ts | 18 +- .../store/examples/counter/containers/App.ts | 67 +- packages/store/examples/counter/devTools.js | 32 - .../store/examples/counter/dist/bundle.js | 1916 ----------------- packages/store/examples/counter/index.ts | 14 +- packages/store/examples/counter/package.json | 31 +- .../store/examples/counter/reducers/index.ts | 6 +- packages/store/examples/counter/server.js | 2 +- .../examples/counter/store/configureStore.ts | 24 +- .../store/examples/counter/store/utils.d.ts | 3 + packages/store/examples/counter/tsconfig.json | 54 +- packages/store/examples/counter/tsd.json | 24 - packages/store/examples/counter/typings.json | 12 + .../counter/typings/_custom/webpack.d.ts | 5 - .../examples/counter/typings/redux/redux.d.ts | 52 - .../store/examples/counter/typings/tsd.d.ts | 3 - packages/store/examples/counter/vendor.js | 15 - packages/store/examples/counter/vendor.ts | 10 + .../store/examples/counter/webpack.config.js | 9 +- .../examples/counter/webpack.dev.config.js | 40 + packages/store/package.json | 51 +- .../___tests___/components/ng-redux.spec.ts | 273 +++ packages/store/src/___tests___/mocha.opts | 3 + .../___tests___/tests.entry.ts} | 0 .../___tests___/utils/shallowEqual.spec.ts} | 16 +- .../utils/wrapActionCreators.spec.ts | 41 + packages/store/src/components/connector.js | 79 - packages/store/src/components/ng-redux.ts | 211 ++ packages/store/src/components/provider.js | 29 - packages/store/src/components/provider.ts | 10 + packages/store/src/index.js | 1 - packages/store/src/index.ts | 2 + .../{shallowEqual.js => shallowEqual.ts} | 4 +- .../store/src/utils/wrapActionCreators.js | 5 - .../store/src/utils/wrapActionCreators.ts | 9 + .../store/test/components/connector.spec.js | 97 - .../test/utils/wrapActionCreators.spec.js | 31 - packages/store/tsconfig.json | 29 + packages/store/typings.json | 19 + 47 files changed, 1021 insertions(+), 2436 deletions(-) delete mode 100644 packages/store/.travis.yml create mode 100644 packages/store/CHANGELOG.md create mode 100644 packages/store/circle.yml delete mode 100644 packages/store/examples/counter/devTools.js delete mode 100644 packages/store/examples/counter/dist/bundle.js create mode 100644 packages/store/examples/counter/store/utils.d.ts delete mode 100644 packages/store/examples/counter/tsd.json create mode 100644 packages/store/examples/counter/typings.json delete mode 100644 packages/store/examples/counter/typings/_custom/webpack.d.ts delete mode 100644 packages/store/examples/counter/typings/redux/redux.d.ts delete mode 100644 packages/store/examples/counter/typings/tsd.d.ts delete mode 100644 packages/store/examples/counter/vendor.js create mode 100644 packages/store/examples/counter/vendor.ts create mode 100644 packages/store/examples/counter/webpack.dev.config.js create mode 100644 packages/store/src/___tests___/components/ng-redux.spec.ts create mode 100644 packages/store/src/___tests___/mocha.opts rename packages/store/{examples/counter/typings/_custom/custom.d.ts => src/___tests___/tests.entry.ts} (100%) rename packages/store/{test/utils/shallowEqual.spec.js => src/___tests___/utils/shallowEqual.spec.ts} (82%) create mode 100644 packages/store/src/___tests___/utils/wrapActionCreators.spec.ts delete mode 100644 packages/store/src/components/connector.js create mode 100644 packages/store/src/components/ng-redux.ts delete mode 100644 packages/store/src/components/provider.js create mode 100644 packages/store/src/components/provider.ts delete mode 100644 packages/store/src/index.js create mode 100644 packages/store/src/index.ts rename packages/store/src/utils/{shallowEqual.js => shallowEqual.ts} (85%) delete mode 100644 packages/store/src/utils/wrapActionCreators.js create mode 100644 packages/store/src/utils/wrapActionCreators.ts delete mode 100644 packages/store/test/components/connector.spec.js delete mode 100644 packages/store/test/utils/wrapActionCreators.spec.js create mode 100644 packages/store/tsconfig.json create mode 100644 packages/store/typings.json diff --git a/packages/store/.babelrc b/packages/store/.babelrc index 53f2ae95..15d27ad9 100644 --- a/packages/store/.babelrc +++ b/packages/store/.babelrc @@ -1,4 +1,4 @@ { "stage": 0, "loose": "all" -} \ No newline at end of file +} diff --git a/packages/store/.gitignore b/packages/store/.gitignore index b42683dd..9d535021 100644 --- a/packages/store/.gitignore +++ b/packages/store/.gitignore @@ -1,6 +1,12 @@ node_modules/ -lib/ *.tgz examples/counter/dist/components/* examples/counter/dist/containers/* -examples/counter/dist/index.* \ No newline at end of file +examples/counter/dist/index.* +.idea +npm-debug.log +examples/counter/typings/ +src/typings/ +typings/ +tmp/ +lib/ diff --git a/packages/store/.npmignore b/packages/store/.npmignore index c0dc18da..4899bff5 100644 --- a/packages/store/.npmignore +++ b/packages/store/.npmignore @@ -1,3 +1,7 @@ src test -examples \ No newline at end of file +examples +.travis.yml +.gitignore +.babelrc +lib/___tests___ \ No newline at end of file diff --git a/packages/store/.travis.yml b/packages/store/.travis.yml deleted file mode 100644 index d99c2e7b..00000000 --- a/packages/store/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "iojs" \ No newline at end of file diff --git a/packages/store/CHANGELOG.md b/packages/store/CHANGELOG.md new file mode 100644 index 00000000..1e7eb576 --- /dev/null +++ b/packages/store/CHANGELOG.md @@ -0,0 +1,61 @@ +# 2.2.2 + +### Features + +* **type definitions**: + * Ported to typescript + * Supports typed stores / reducers + * Uses offical Redux type definitions +* **Type Injectable**: + * Able to inject `NgRedux` into your component by type, and not need `@Inject('ngRedux')` + * `@Inject('ngRedux')` still works + + ```ts + import { NgRedux } from 'ng2-redux'; + // ... + export class MyComponent { + constructor(private ngRedux: NgRedux) { + } + } + ``` +* **State as Observable**: Ability to expose parts of your state as an observable. + + ```ts + select(selector: string | number | symbol | ((state: RootState) => S), comparer?: (x: any, y: any) => boolean): Observable; + wrapActionCreators: (actions: any) => (dispatch: Redux.Dispatch) => Redux.ActionCreator<{}> | Redux.ActionCreatorsMapObject; + ``` + + Example use: + + ```js + import { NgRedux } from 'ng2-redux'; + // ... + export class MyComponent implements OnInit { + countByKey$: Observable; + countByFunc$: Observable; + constructor(private ngRedux: NgRedux) { + } + ngOnInit() { + this.countByKey$ = this.ngRedux.select('count'); + this.countByFunc$ = this.ngRedux.select(state=>state.count); + } + } + ``` + + Also have the ability to provide a custom compare function. + + ```js + import { is, Map } from 'immutable'; + import { NgRedux } from 'ng2-redux'; + + // ... + export class MyComponent implements OnInit { + person$: Observable>; + constructor(private ngRedux: ngRedux) { } + ngOnInit() { + // even if the reference of the object has changed, + // if the data is the same - it wont be treated as a change + this.person$ = this.ngRedux.select(state=>state.people.get(0),is); + } +} +``` \ No newline at end of file diff --git a/packages/store/README.md b/packages/store/README.md index 2dc3cf92..386458d1 100644 --- a/packages/store/README.md +++ b/packages/store/README.md @@ -3,7 +3,7 @@ For Angular 1 see [ng-redux](https://github.com/wbuchwalter/ng-redux) -[![build status](https://img.shields.io/travis/wbuchwalter/ng2-redux/master.svg?style=flat-square)](https://travis-ci.org/wbuchwalter/ng2-redux) +[![Circle CI](https://circleci.com/gh/angular-redux/ng2-redux/tree/master.svg?style=svg)](https://circleci.com/gh/angular-redux/ng2-redux/tree/master) [![npm version](https://img.shields.io/npm/v/ng2-redux.svg?style=flat-square)](https://www.npmjs.com/package/ng2-redux) ngRedux lets you easily connect your angular components with Redux. @@ -24,7 +24,7 @@ npm install --save ng2-redux ## Quick Start -#### Initialization +### Initialization ```JS import {bootstrap} from 'angular2/platform/browser'; @@ -45,11 +45,41 @@ bootstrap( #### Usage +`ng2-redux` has two ways that it can be used. The first way is using the `ngRedux.connect` API, which will map the state and dispatch actions to the provided target. + +There is also `ngRedux.select`, which will expose a slice of your state as an RxJs observable. + + +#### ngRedux.select +```JS +import * as CounterActions from '../actions/CounterActions'; +import {NgRedux} from 'ng2-redux'; +import {Observable} from 'rxjs'; + +class CounterApp { + count$: Observable; + counterSubscription: Function; + + constructor(private ngRedux: NgRedux) { } + + ngOnInit() { + this.count$ = this.ngRedux + .select(n=>n.counter) + this.ngRedux.mapDispatchToTarget(CounterActions) + + } + +} +``` + +#### ngRedux.connect + ```JS import * as CounterActions from '../actions/CounterActions'; +import {NgRedux} from 'ng2-redux'; class CounterApp { - constructor( @Inject('ngRedux') ngRedux) { + constructor(ngRedux: NgRedux) { this.unsubscribe = ngRedux.connect(this.mapStateToThis, this.mapDispatchToThis)(this); } @@ -71,6 +101,7 @@ class CounterApp { } ``` + ## API ### `provider(store)` @@ -98,11 +129,35 @@ connect(this.mapStateToThis, this.mapDispatchToThis)(this); connect(this.mapState, this.mapDispatch)((selectedState, actions) => {/* ... */}); ``` - #### Remarks * The `mapStateToTarget` function takes a single argument of the entire Redux store’s state and returns an object to be passed as props. It is often called a selector. Use reselect to efficiently compose selectors and compute derived data. +### select(key | function,[comparer]) => Observable + +Exposes a slice of state as an observable. Accepts either a key-path, or a selector function. + +If using the async pipe, you do not need to subscribe to it explicitly, but can use the angular Async pipe to observe for values. + +#### Arguments + +* `key` \(*string*): A key within the state that you want to subscribe to. +* `selector` \(*Function*): A function that accepts the application state, and returns the slice you want subscribe to for changes. + + +e.g: +```JS +this.counter$ = this.ngRedux.select(state=>state.counter); +// or +this.counterSubscription = this.ngRedux + .select(state=>state.counter) + .subscribe(count=>this.counter = count); +// or + +this.counter$ = this.ngRedux.select('counter'); +``` + + ### Store API All of redux's store methods (i.e. `dispatch`, `subscribe` and `getState`) are exposed by $ngRedux and can be accessed directly. For example: @@ -115,9 +170,59 @@ ngRedux.subscribe(() => { This means that you are free to use Redux basic API in advanced cases where `connect`'s API would not fill your needs. - ## Using DevTools -In order to use Redux DevTools with your angular app, you need to install [react](https://www.npmjs.com/package/react), [react-redux](https://www.npmjs.com/package/react-redux) and [redux-devtools](https://www.npmjs.com/package/redux-devtools) as development dependencies. +Ng2Redux is fully compatible with the Chrome extension version of the Redux dev tools: + +https://github.com/zalmoxisus/redux-devtools-extension + +Here's how to enable them in your app (you probably only want to do +this in development mode): -You can find a sample devtools implentation in the [counter example](https://github.com/wbuchwalter/ng2-redux/blob/master/examples/counter/devTools.js) +1. Add the extension to your storeEnhancers: + +```typescript +const enhancers = []; + +// Add Whatever other enhancers you want. + +if (__DEVMODE__ && window.devToolsExtension) { + enhancers = [ ...enhancers, window.devToolsExtension() ]; +} + +const store = compose( + applyMiddleware(middleware), + ...enhancers + )(createStore)(rootReducer, initialState); +``` + +2. Make Angular 2 update when store events come from the dev tools +instead of Ng2Redux: + +```typescript +@Component({ + // etc. +}) +export class App { + private unsubscribe: () => void; + + constructor( + private ngRedux: NgRedux, + applicationRef: ApplicationRef) { + + // etc. + + if (__DEVMODE__) { + this.unsubscribe = ngRedux.subscribe(() => { + applicationRef.tick(); + }); + } + } + + ngOnDestroy() { + if (this.unsubscribe) { + this.unsubscribe(); + } + } +}; +``` diff --git a/packages/store/circle.yml b/packages/store/circle.yml new file mode 100644 index 00000000..b29c4e87 --- /dev/null +++ b/packages/store/circle.yml @@ -0,0 +1,3 @@ +machine: + node: + version: 4.4.3 \ No newline at end of file diff --git a/packages/store/examples/counter/actions/CounterActions.ts b/packages/store/examples/counter/actions/CounterActions.ts index d1d96b86..e823e54c 100644 --- a/packages/store/examples/counter/actions/CounterActions.ts +++ b/packages/store/examples/counter/actions/CounterActions.ts @@ -1,14 +1,16 @@ export const INCREMENT_COUNTER:string = 'INCREMENT_COUNTER'; export const DECREMENT_COUNTER:string = 'DECREMENT_COUNTER'; +import * as Redux from 'redux'; + export var increment = () => { - return { + return { type: INCREMENT_COUNTER }; } export var decrement = () => { - return { + return { type: DECREMENT_COUNTER }; } diff --git a/packages/store/examples/counter/components/Counter.ts b/packages/store/examples/counter/components/Counter.ts index f527557c..8decb238 100644 --- a/packages/store/examples/counter/components/Counter.ts +++ b/packages/store/examples/counter/components/Counter.ts @@ -1,14 +1,7 @@ -import {Component} from 'angular2/core'; +import {Component, Input} from 'angular2/core'; @Component({ selector: 'counter', - inputs: [ - 'counter', - 'increment', - 'decrement', - 'incrementIfOdd', - 'incrementAsync' - ], template: `

Clicked: {{ counter }} times @@ -19,4 +12,11 @@ import {Component} from 'angular2/core';

` }) -export class Counter {} +export class Counter { + @Input() counter: number; + @Input() increment: () => void; + @Input() decrement: () => void; + @Input() incrementIfOdd: () => void; + @Input() incrementAsync: () => void; + +} diff --git a/packages/store/examples/counter/containers/App.ts b/packages/store/examples/counter/containers/App.ts index 7c35a500..33a114ce 100644 --- a/packages/store/examples/counter/containers/App.ts +++ b/packages/store/examples/counter/containers/App.ts @@ -1,13 +1,18 @@ -import {Component, Inject, OnDestroy} from 'angular2/core'; -import {bindActionCreators} from 'redux'; +import {Component, Inject, OnDestroy, ApplicationRef} from 'angular2/core'; +import {Observable} from 'rxjs'; +import {AsyncPipe} from 'angular2/common'; import {Counter} from '../components/Counter'; import * as CounterActions from '../actions/CounterActions'; +import {NgRedux} from 'ng2-redux'; + +import {RootState} from '../store/configureStore'; @Component({ - selector: 'root', - directives: [Counter], - template: ` - ` }) -export default class App implements OnDestroy { - protected unsubscribe: Function; +export class App { + + counter$: any; + unsubscribe: () => void; + + // Will be added to instance with mapDispatchToTarget + + increment: () => any; + decrement: () => any; + + constructor( + private ngRedux: NgRedux, + private applicationRef: ApplicationRef) {} + + ngOnInit() { + let {increment, decrement } = CounterActions; + this.counter$ = this.ngRedux + .select(state => state.counter) + this.ngRedux.mapDispatchToTarget({ increment, decrement })(this); + + this.unsubscribe = this.ngRedux.subscribe(() => { + this.applicationRef.tick(); + }); + } + + ngOnDestroy() { + this.unsubscribe(); + } - constructor( @Inject('ngRedux') ngRedux, @Inject('devTools') devTools) { - devTools.start(ngRedux); - this.unsubscribe = ngRedux.connect(this.mapStateToThis, this.mapDispatchToThis)(this); - } + // Can also call ngRedux.dispatch directly - ngOnDestroy() { - this.unsubscribe(); - } + incrementIfOdd = () => this.ngRedux + .dispatch(CounterActions.incrementIfOdd()); - mapStateToThis(state) { - return { - counter: state.counter - }; - } + incrementAsync = () => this.ngRedux + .dispatch(CounterActions.incrementAsync()); - mapDispatchToThis(dispatch) { - return bindActionCreators(CounterActions, dispatch); - } } diff --git a/packages/store/examples/counter/devTools.js b/packages/store/examples/counter/devTools.js deleted file mode 100644 index 085b709a..00000000 --- a/packages/store/examples/counter/devTools.js +++ /dev/null @@ -1,32 +0,0 @@ -import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'; -import React, { Component } from 'react'; -import {provide} from 'angular2/core'; - -let devTools = provide('devTools', {useFactory: () => { - return { - start: (ngRedux) => { - startDevTools(ngRedux); - } - }; - }}); - -export default devTools; - -function startDevTools(ngRedux) { - React.render( - , - document.getElementById('devTools') - ); -} - -class DevToolsReactComponent extends Component { - render() { - return ( -
- - - -
- ); - } -} diff --git a/packages/store/examples/counter/dist/bundle.js b/packages/store/examples/counter/dist/bundle.js deleted file mode 100644 index 54814a46..00000000 --- a/packages/store/examples/counter/dist/bundle.js +++ /dev/null @@ -1,1916 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ var parentHotUpdateCallback = this["webpackHotUpdate"]; -/******/ this["webpackHotUpdate"] = -/******/ function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars -/******/ hotAddUpdateChunk(chunkId, moreModules); -/******/ if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); -/******/ } -/******/ -/******/ function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars -/******/ var head = document.getElementsByTagName("head")[0]; -/******/ var script = document.createElement("script"); -/******/ script.type = "text/javascript"; -/******/ script.charset = "utf-8"; -/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; -/******/ head.appendChild(script); -/******/ } -/******/ -/******/ function hotDownloadManifest(callback) { // eslint-disable-line no-unused-vars -/******/ if(typeof XMLHttpRequest === "undefined") -/******/ return callback(new Error("No browser support")); -/******/ try { -/******/ var request = new XMLHttpRequest(); -/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; -/******/ request.open("GET", requestPath, true); -/******/ request.timeout = 10000; -/******/ request.send(null); -/******/ } catch(err) { -/******/ return callback(err); -/******/ } -/******/ request.onreadystatechange = function() { -/******/ if(request.readyState !== 4) return; -/******/ if(request.status === 0) { -/******/ // timeout -/******/ callback(new Error("Manifest request to " + requestPath + " timed out.")); -/******/ } else if(request.status === 404) { -/******/ // no update available -/******/ callback(); -/******/ } else if(request.status !== 200 && request.status !== 304) { -/******/ // other failure -/******/ callback(new Error("Manifest request to " + requestPath + " failed.")); -/******/ } else { -/******/ // success -/******/ try { -/******/ var update = JSON.parse(request.responseText); -/******/ } catch(e) { -/******/ callback(e); -/******/ return; -/******/ } -/******/ callback(null, update); -/******/ } -/******/ }; -/******/ } - -/******/ -/******/ -/******/ var hotApplyOnUpdate = true; -/******/ var hotCurrentHash = "a652ce200033abd787a2"; // eslint-disable-line no-unused-vars -/******/ var hotCurrentModuleData = {}; -/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars -/******/ -/******/ function hotCreateRequire(moduleId) { // eslint-disable-line no-unused-vars -/******/ var me = installedModules[moduleId]; -/******/ if(!me) return __webpack_require__; -/******/ var fn = function(request) { -/******/ if(me.hot.active) { -/******/ if(installedModules[request]) { -/******/ if(installedModules[request].parents.indexOf(moduleId) < 0) -/******/ installedModules[request].parents.push(moduleId); -/******/ if(me.children.indexOf(request) < 0) -/******/ me.children.push(request); -/******/ } else hotCurrentParents = [moduleId]; -/******/ } else { -/******/ console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); -/******/ hotCurrentParents = []; -/******/ } -/******/ return __webpack_require__(request); -/******/ }; -/******/ for(var name in __webpack_require__) { -/******/ if(Object.prototype.hasOwnProperty.call(__webpack_require__, name)) { -/******/ fn[name] = __webpack_require__[name]; -/******/ } -/******/ } -/******/ fn.e = function(chunkId, callback) { -/******/ if(hotStatus === "ready") -/******/ hotSetStatus("prepare"); -/******/ hotChunksLoading++; -/******/ __webpack_require__.e(chunkId, function() { -/******/ try { -/******/ callback.call(null, fn); -/******/ } finally { -/******/ finishChunkLoading(); -/******/ } -/******/ -/******/ function finishChunkLoading() { -/******/ hotChunksLoading--; -/******/ if(hotStatus === "prepare") { -/******/ if(!hotWaitingFilesMap[chunkId]) { -/******/ hotEnsureUpdateChunk(chunkId); -/******/ } -/******/ if(hotChunksLoading === 0 && hotWaitingFiles === 0) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ } -/******/ } -/******/ }); -/******/ }; -/******/ return fn; -/******/ } -/******/ -/******/ function hotCreateModule(moduleId) { // eslint-disable-line no-unused-vars -/******/ var hot = { -/******/ // private stuff -/******/ _acceptedDependencies: {}, -/******/ _declinedDependencies: {}, -/******/ _selfAccepted: false, -/******/ _selfDeclined: false, -/******/ _disposeHandlers: [], -/******/ -/******/ // Module API -/******/ active: true, -/******/ accept: function(dep, callback) { -/******/ if(typeof dep === "undefined") -/******/ hot._selfAccepted = true; -/******/ else if(typeof dep === "function") -/******/ hot._selfAccepted = dep; -/******/ else if(typeof dep === "object") -/******/ for(var i = 0; i < dep.length; i++) -/******/ hot._acceptedDependencies[dep[i]] = callback; -/******/ else -/******/ hot._acceptedDependencies[dep] = callback; -/******/ }, -/******/ decline: function(dep) { -/******/ if(typeof dep === "undefined") -/******/ hot._selfDeclined = true; -/******/ else if(typeof dep === "number") -/******/ hot._declinedDependencies[dep] = true; -/******/ else -/******/ for(var i = 0; i < dep.length; i++) -/******/ hot._declinedDependencies[dep[i]] = true; -/******/ }, -/******/ dispose: function(callback) { -/******/ hot._disposeHandlers.push(callback); -/******/ }, -/******/ addDisposeHandler: function(callback) { -/******/ hot._disposeHandlers.push(callback); -/******/ }, -/******/ removeDisposeHandler: function(callback) { -/******/ var idx = hot._disposeHandlers.indexOf(callback); -/******/ if(idx >= 0) hot._disposeHandlers.splice(idx, 1); -/******/ }, -/******/ -/******/ // Management API -/******/ check: hotCheck, -/******/ apply: hotApply, -/******/ status: function(l) { -/******/ if(!l) return hotStatus; -/******/ hotStatusHandlers.push(l); -/******/ }, -/******/ addStatusHandler: function(l) { -/******/ hotStatusHandlers.push(l); -/******/ }, -/******/ removeStatusHandler: function(l) { -/******/ var idx = hotStatusHandlers.indexOf(l); -/******/ if(idx >= 0) hotStatusHandlers.splice(idx, 1); -/******/ }, -/******/ -/******/ //inherit from previous dispose call -/******/ data: hotCurrentModuleData[moduleId] -/******/ }; -/******/ return hot; -/******/ } -/******/ -/******/ var hotStatusHandlers = []; -/******/ var hotStatus = "idle"; -/******/ -/******/ function hotSetStatus(newStatus) { -/******/ hotStatus = newStatus; -/******/ for(var i = 0; i < hotStatusHandlers.length; i++) -/******/ hotStatusHandlers[i].call(null, newStatus); -/******/ } -/******/ -/******/ // while downloading -/******/ var hotWaitingFiles = 0; -/******/ var hotChunksLoading = 0; -/******/ var hotWaitingFilesMap = {}; -/******/ var hotRequestedFilesMap = {}; -/******/ var hotAvailibleFilesMap = {}; -/******/ var hotCallback; -/******/ -/******/ // The update info -/******/ var hotUpdate, hotUpdateNewHash; -/******/ -/******/ function toModuleId(id) { -/******/ var isNumber = (+id) + "" === id; -/******/ return isNumber ? +id : id; -/******/ } -/******/ -/******/ function hotCheck(apply, callback) { -/******/ if(hotStatus !== "idle") throw new Error("check() is only allowed in idle status"); -/******/ if(typeof apply === "function") { -/******/ hotApplyOnUpdate = false; -/******/ callback = apply; -/******/ } else { -/******/ hotApplyOnUpdate = apply; -/******/ callback = callback || function(err) { -/******/ if(err) throw err; -/******/ }; -/******/ } -/******/ hotSetStatus("check"); -/******/ hotDownloadManifest(function(err, update) { -/******/ if(err) return callback(err); -/******/ if(!update) { -/******/ hotSetStatus("idle"); -/******/ callback(null, null); -/******/ return; -/******/ } -/******/ -/******/ hotRequestedFilesMap = {}; -/******/ hotAvailibleFilesMap = {}; -/******/ hotWaitingFilesMap = {}; -/******/ for(var i = 0; i < update.c.length; i++) -/******/ hotAvailibleFilesMap[update.c[i]] = true; -/******/ hotUpdateNewHash = update.h; -/******/ -/******/ hotSetStatus("prepare"); -/******/ hotCallback = callback; -/******/ hotUpdate = {}; -/******/ var chunkId = 0; -/******/ { // eslint-disable-line no-lone-blocks -/******/ /*globals chunkId */ -/******/ hotEnsureUpdateChunk(chunkId); -/******/ } -/******/ if(hotStatus === "prepare" && hotChunksLoading === 0 && hotWaitingFiles === 0) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ }); -/******/ } -/******/ -/******/ function hotAddUpdateChunk(chunkId, moreModules) { // eslint-disable-line no-unused-vars -/******/ if(!hotAvailibleFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) -/******/ return; -/******/ hotRequestedFilesMap[chunkId] = false; -/******/ for(var moduleId in moreModules) { -/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { -/******/ hotUpdate[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(--hotWaitingFiles === 0 && hotChunksLoading === 0) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ } -/******/ -/******/ function hotEnsureUpdateChunk(chunkId) { -/******/ if(!hotAvailibleFilesMap[chunkId]) { -/******/ hotWaitingFilesMap[chunkId] = true; -/******/ } else { -/******/ hotRequestedFilesMap[chunkId] = true; -/******/ hotWaitingFiles++; -/******/ hotDownloadUpdateChunk(chunkId); -/******/ } -/******/ } -/******/ -/******/ function hotUpdateDownloaded() { -/******/ hotSetStatus("ready"); -/******/ var callback = hotCallback; -/******/ hotCallback = null; -/******/ if(!callback) return; -/******/ if(hotApplyOnUpdate) { -/******/ hotApply(hotApplyOnUpdate, callback); -/******/ } else { -/******/ var outdatedModules = []; -/******/ for(var id in hotUpdate) { -/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) { -/******/ outdatedModules.push(toModuleId(id)); -/******/ } -/******/ } -/******/ callback(null, outdatedModules); -/******/ } -/******/ } -/******/ -/******/ function hotApply(options, callback) { -/******/ if(hotStatus !== "ready") throw new Error("apply() is only allowed in ready status"); -/******/ if(typeof options === "function") { -/******/ callback = options; -/******/ options = {}; -/******/ } else if(options && typeof options === "object") { -/******/ callback = callback || function(err) { -/******/ if(err) throw err; -/******/ }; -/******/ } else { -/******/ options = {}; -/******/ callback = callback || function(err) { -/******/ if(err) throw err; -/******/ }; -/******/ } -/******/ -/******/ function getAffectedStuff(module) { -/******/ var outdatedModules = [module]; -/******/ var outdatedDependencies = {}; -/******/ -/******/ var queue = outdatedModules.slice(); -/******/ while(queue.length > 0) { -/******/ var moduleId = queue.pop(); -/******/ var module = installedModules[moduleId]; -/******/ if(!module || module.hot._selfAccepted) -/******/ continue; -/******/ if(module.hot._selfDeclined) { -/******/ return new Error("Aborted because of self decline: " + moduleId); -/******/ } -/******/ if(moduleId === 0) { -/******/ return; -/******/ } -/******/ for(var i = 0; i < module.parents.length; i++) { -/******/ var parentId = module.parents[i]; -/******/ var parent = installedModules[parentId]; -/******/ if(parent.hot._declinedDependencies[moduleId]) { -/******/ return new Error("Aborted because of declined dependency: " + moduleId + " in " + parentId); -/******/ } -/******/ if(outdatedModules.indexOf(parentId) >= 0) continue; -/******/ if(parent.hot._acceptedDependencies[moduleId]) { -/******/ if(!outdatedDependencies[parentId]) -/******/ outdatedDependencies[parentId] = []; -/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); -/******/ continue; -/******/ } -/******/ delete outdatedDependencies[parentId]; -/******/ outdatedModules.push(parentId); -/******/ queue.push(parentId); -/******/ } -/******/ } -/******/ -/******/ return [outdatedModules, outdatedDependencies]; -/******/ } -/******/ -/******/ function addAllToSet(a, b) { -/******/ for(var i = 0; i < b.length; i++) { -/******/ var item = b[i]; -/******/ if(a.indexOf(item) < 0) -/******/ a.push(item); -/******/ } -/******/ } -/******/ -/******/ // at begin all updates modules are outdated -/******/ // the "outdated" status can propagate to parents if they don't accept the children -/******/ var outdatedDependencies = {}; -/******/ var outdatedModules = []; -/******/ var appliedUpdate = {}; -/******/ for(var id in hotUpdate) { -/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) { -/******/ var moduleId = toModuleId(id); -/******/ var result = getAffectedStuff(moduleId); -/******/ if(!result) { -/******/ if(options.ignoreUnaccepted) -/******/ continue; -/******/ hotSetStatus("abort"); -/******/ return callback(new Error("Aborted because " + moduleId + " is not accepted")); -/******/ } -/******/ if(result instanceof Error) { -/******/ hotSetStatus("abort"); -/******/ return callback(result); -/******/ } -/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; -/******/ addAllToSet(outdatedModules, result[0]); -/******/ for(var moduleId in result[1]) { -/******/ if(Object.prototype.hasOwnProperty.call(result[1], moduleId)) { -/******/ if(!outdatedDependencies[moduleId]) -/******/ outdatedDependencies[moduleId] = []; -/******/ addAllToSet(outdatedDependencies[moduleId], result[1][moduleId]); -/******/ } -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Store self accepted outdated modules to require them later by the module system -/******/ var outdatedSelfAcceptedModules = []; -/******/ for(var i = 0; i < outdatedModules.length; i++) { -/******/ var moduleId = outdatedModules[i]; -/******/ if(installedModules[moduleId] && installedModules[moduleId].hot._selfAccepted) -/******/ outdatedSelfAcceptedModules.push({ -/******/ module: moduleId, -/******/ errorHandler: installedModules[moduleId].hot._selfAccepted -/******/ }); -/******/ } -/******/ -/******/ // Now in "dispose" phase -/******/ hotSetStatus("dispose"); -/******/ var queue = outdatedModules.slice(); -/******/ while(queue.length > 0) { -/******/ var moduleId = queue.pop(); -/******/ var module = installedModules[moduleId]; -/******/ if(!module) continue; -/******/ -/******/ var data = {}; -/******/ -/******/ // Call dispose handlers -/******/ var disposeHandlers = module.hot._disposeHandlers; -/******/ for(var j = 0; j < disposeHandlers.length; j++) { -/******/ var cb = disposeHandlers[j]; -/******/ cb(data); -/******/ } -/******/ hotCurrentModuleData[moduleId] = data; -/******/ -/******/ // disable module (this disables requires from this module) -/******/ module.hot.active = false; -/******/ -/******/ // remove module from cache -/******/ delete installedModules[moduleId]; -/******/ -/******/ // remove "parents" references from all children -/******/ for(var j = 0; j < module.children.length; j++) { -/******/ var child = installedModules[module.children[j]]; -/******/ if(!child) continue; -/******/ var idx = child.parents.indexOf(moduleId); -/******/ if(idx >= 0) { -/******/ child.parents.splice(idx, 1); -/******/ } -/******/ } -/******/ } -/******/ -/******/ // remove outdated dependency from module children -/******/ for(var moduleId in outdatedDependencies) { -/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) { -/******/ var module = installedModules[moduleId]; -/******/ var moduleOutdatedDependencies = outdatedDependencies[moduleId]; -/******/ for(var j = 0; j < moduleOutdatedDependencies.length; j++) { -/******/ var dependency = moduleOutdatedDependencies[j]; -/******/ var idx = module.children.indexOf(dependency); -/******/ if(idx >= 0) module.children.splice(idx, 1); -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Not in "apply" phase -/******/ hotSetStatus("apply"); -/******/ -/******/ hotCurrentHash = hotUpdateNewHash; -/******/ -/******/ // insert new code -/******/ for(var moduleId in appliedUpdate) { -/******/ if(Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { -/******/ modules[moduleId] = appliedUpdate[moduleId]; -/******/ } -/******/ } -/******/ -/******/ // call accept handlers -/******/ var error = null; -/******/ for(var moduleId in outdatedDependencies) { -/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) { -/******/ var module = installedModules[moduleId]; -/******/ var moduleOutdatedDependencies = outdatedDependencies[moduleId]; -/******/ var callbacks = []; -/******/ for(var i = 0; i < moduleOutdatedDependencies.length; i++) { -/******/ var dependency = moduleOutdatedDependencies[i]; -/******/ var cb = module.hot._acceptedDependencies[dependency]; -/******/ if(callbacks.indexOf(cb) >= 0) continue; -/******/ callbacks.push(cb); -/******/ } -/******/ for(var i = 0; i < callbacks.length; i++) { -/******/ var cb = callbacks[i]; -/******/ try { -/******/ cb(outdatedDependencies); -/******/ } catch(err) { -/******/ if(!error) -/******/ error = err; -/******/ } -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Load self accepted modules -/******/ for(var i = 0; i < outdatedSelfAcceptedModules.length; i++) { -/******/ var item = outdatedSelfAcceptedModules[i]; -/******/ var moduleId = item.module; -/******/ hotCurrentParents = [moduleId]; -/******/ try { -/******/ __webpack_require__(moduleId); -/******/ } catch(err) { -/******/ if(typeof item.errorHandler === "function") { -/******/ try { -/******/ item.errorHandler(err); -/******/ } catch(err) { -/******/ if(!error) -/******/ error = err; -/******/ } -/******/ } else if(!error) -/******/ error = err; -/******/ } -/******/ } -/******/ -/******/ // handle errors in accept handlers and self accepted module load -/******/ if(error) { -/******/ hotSetStatus("fail"); -/******/ return callback(error); -/******/ } -/******/ -/******/ hotSetStatus("idle"); -/******/ callback(null, outdatedModules); -/******/ } - -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false, -/******/ hot: hotCreateModule(moduleId), -/******/ parents: hotCurrentParents, -/******/ children: [] -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/static/"; - -/******/ // __webpack_hash__ -/******/ __webpack_require__.h = function() { return hotCurrentHash; }; - -/******/ // Load entry module and return exports -/******/ return hotCreateRequire(0)(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - eval("__webpack_require__(1);\n__webpack_require__(14);\n__webpack_require__(38);\n__webpack_require__(40);\nmodule.exports = __webpack_require__(210);\n\n\n/*****************\n ** WEBPACK FOOTER\n ** multi main\n ** module id = 0\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///multi_main?"); - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar core = __webpack_require__(2);\nvar browserPatch = __webpack_require__(5);\n\nglobal.zone = new core.Zone();\n\nmodule.exports = {\n Zone: core.Zone,\n zone: global.zone\n};\n\nbrowserPatch.apply();\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/zone.js\n ** module id = 1\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/zone.js?"); - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nfunction Zone(parentZone, data) {\n var zone = (arguments.length) ? Object.create(parentZone) : this;\n\n zone.parent = parentZone || null;\n\n Object.keys(data || {}).forEach(function(property) {\n\n var _property = property.substr(1);\n\n // augment the new zone with a hook decorates the parent's hook\n if (property[0] === '$') {\n zone[_property] = data[property](parentZone[_property] || function () {});\n\n // augment the new zone with a hook that runs after the parent's hook\n } else if (property[0] === '+') {\n if (parentZone[_property]) {\n zone[_property] = function () {\n var result = parentZone[_property].apply(this, arguments);\n data[property].apply(this, arguments);\n return result;\n };\n } else {\n zone[_property] = data[property];\n }\n\n // augment the new zone with a hook that runs before the parent's hook\n } else if (property[0] === '-') {\n if (parentZone[_property]) {\n zone[_property] = function () {\n data[property].apply(this, arguments);\n return parentZone[_property].apply(this, arguments);\n };\n } else {\n zone[_property] = data[property];\n }\n\n // set the new zone's hook (replacing the parent zone's)\n } else {\n zone[property] = (typeof data[property] === 'object') ?\n JSON.parse(JSON.stringify(data[property])) :\n data[property];\n }\n });\n\n zone.$id = Zone.nextId++;\n\n return zone;\n}\n\nZone.prototype = {\n constructor: Zone,\n\n fork: function (locals) {\n this.onZoneCreated();\n return new Zone(this, locals);\n },\n\n bind: function (fn, skipEnqueue) {\n if (typeof fn !== 'function') {\n throw new Error('Expecting function got: ' + fn);\n }\n skipEnqueue || this.enqueueTask(fn);\n var zone = this.isRootZone() ? this : this.fork();\n return function zoneBoundFn() {\n return zone.run(fn, this, arguments);\n };\n },\n\n bindOnce: function (fn) {\n var boundZone = this;\n return this.bind(function () {\n var result = fn.apply(this, arguments);\n boundZone.dequeueTask(fn);\n return result;\n });\n },\n\n isRootZone: function() {\n return this.parent === null;\n },\n\n run: function run (fn, applyTo, applyWith) {\n applyWith = applyWith || [];\n\n var oldZone = global.zone;\n\n // MAKE THIS ZONE THE CURRENT ZONE\n global.zone = this;\n\n try {\n this.beforeTask();\n return fn.apply(applyTo, applyWith);\n } catch (e) {\n if (this.onError) {\n this.onError(e);\n } else {\n throw e;\n }\n } finally {\n this.afterTask();\n // REVERT THE CURRENT ZONE BACK TO THE ORIGINAL ZONE\n global.zone = oldZone;\n }\n },\n\n // onError is used to override error handling.\n // When a custom error handler is provided, it should most probably rethrow the exception\n // not to break the expected control flow:\n //\n // `promise.then(fnThatThrows).catch(fn);`\n //\n // When this code is executed in a zone with a custom onError handler that doesn't rethrow, the\n // `.catch()` branch will not be taken as the `fnThatThrows` exception will be swallowed by the\n // handler.\n onError: null,\n beforeTask: function () {},\n onZoneCreated: function () {},\n afterTask: function () {},\n enqueueTask: function () {},\n dequeueTask: function () {}\n};\n\n// Root zone ID === 1\nZone.nextId = 1;\n\nZone.bindPromiseFn = __webpack_require__(3).bindPromiseFn;\n\nmodule.exports = {\n Zone: Zone\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/core.js\n ** module id = 2\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/core.js?"); - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar utils = __webpack_require__(4);\n\n/*\n * Patches a function that returns a Promise-like instance.\n *\n * This function must be used when either:\n * - Native Promises are not available,\n * - The function returns a Promise-like object.\n *\n * This is required because zones rely on a Promise monkey patch that could not be applied when\n * Promise is not natively available or when the returned object is not an instance of Promise.\n *\n * Note that calling `bindPromiseFn` on a function that returns a native Promise will also work\n * with minimal overhead.\n *\n * ```\n * var boundFunction = bindPromiseFn(FunctionReturningAPromise);\n *\n * boundFunction.then(successHandler, errorHandler);\n * ```\n */\nvar bindPromiseFn;\n\nif (global.Promise) {\n bindPromiseFn = function (delegate) {\n return function() {\n var delegatePromise = delegate.apply(this, arguments);\n\n // if the delegate returned an instance of Promise, forward it.\n if (delegatePromise instanceof Promise) {\n return delegatePromise;\n }\n\n // Otherwise wrap the Promise-like in a global Promise\n return new Promise(function(resolve, reject) {\n delegatePromise.then(resolve, reject);\n });\n };\n };\n} else {\n bindPromiseFn = function (delegate) {\n return function () {\n return _patchThenable(delegate.apply(this, arguments));\n };\n };\n}\n\n\nfunction _patchPromiseFnsOnObject(objectPath, fnNames) {\n var obj = global;\n\n var exists = objectPath.every(function (segment) {\n obj = obj[segment];\n return obj;\n });\n\n if (!exists) {\n return;\n }\n\n fnNames.forEach(function (name) {\n var fn = obj[name];\n if (fn) {\n obj[name] = bindPromiseFn(fn);\n }\n });\n}\n\nfunction _patchThenable(thenable) {\n var then = thenable.then;\n thenable.then = function () {\n var args = utils.bindArguments(arguments);\n var nextThenable = then.apply(thenable, args);\n return _patchThenable(nextThenable);\n };\n\n var ocatch = thenable.catch;\n thenable.catch = function () {\n var args = utils.bindArguments(arguments);\n var nextThenable = ocatch.apply(thenable, args);\n return _patchThenable(nextThenable);\n };\n\n return thenable;\n}\n\n\nfunction apply() {\n // Patch .then() and .catch() on native Promises to execute callbacks in the zone where\n // those functions are called.\n if (global.Promise) {\n utils.patchPrototype(Promise.prototype, [\n 'then',\n 'catch'\n ]);\n\n // Patch browser APIs that return a Promise\n var patchFns = [\n // fetch\n [[], ['fetch']],\n [['Response', 'prototype'], ['arrayBuffer', 'blob', 'json', 'text']]\n ];\n\n patchFns.forEach(function(objPathAndFns) {\n _patchPromiseFnsOnObject(objPathAndFns[0], objPathAndFns[1]);\n });\n }\n}\n\nmodule.exports = {\n apply: apply,\n bindPromiseFn: bindPromiseFn\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/promise.js\n ** module id = 3\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/promise.js?"); - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nfunction bindArguments(args) {\n for (var i = args.length - 1; i >= 0; i--) {\n if (typeof args[i] === 'function') {\n args[i] = global.zone.bind(args[i]);\n }\n }\n return args;\n};\n\nfunction bindArgumentsOnce(args) {\n for (var i = args.length - 1; i >= 0; i--) {\n if (typeof args[i] === 'function') {\n args[i] = global.zone.bindOnce(args[i]);\n }\n }\n return args;\n};\n\nfunction patchPrototype(obj, fnNames) {\n fnNames.forEach(function (name) {\n var delegate = obj[name];\n if (delegate) {\n obj[name] = function () {\n return delegate.apply(this, bindArguments(arguments));\n };\n }\n });\n};\n\nfunction patchProperty(obj, prop) {\n var desc = Object.getOwnPropertyDescriptor(obj, prop) || {\n enumerable: true,\n configurable: true\n };\n\n // A property descriptor cannot have getter/setter and be writable\n // deleting the writable and value properties avoids this error:\n //\n // TypeError: property descriptors must not specify a value or be writable when a\n // getter or setter has been specified\n delete desc.writable;\n delete desc.value;\n\n // substr(2) cuz 'onclick' -> 'click', etc\n var eventName = prop.substr(2);\n var _prop = '_' + prop;\n\n desc.set = function (fn) {\n if (this[_prop]) {\n this.removeEventListener(eventName, this[_prop]);\n }\n\n if (typeof fn === 'function') {\n this[_prop] = fn;\n this.addEventListener(eventName, fn, false);\n } else {\n this[_prop] = null;\n }\n };\n\n desc.get = function () {\n return this[_prop];\n };\n\n Object.defineProperty(obj, prop, desc);\n};\n\nfunction patchProperties(obj, properties) {\n\n (properties || (function () {\n var props = [];\n for (var prop in obj) {\n props.push(prop);\n }\n return props;\n }()).\n filter(function (propertyName) {\n return propertyName.substr(0,2) === 'on';\n })).\n forEach(function (eventName) {\n patchProperty(obj, eventName);\n });\n};\n\nfunction patchEventTargetMethods(obj) {\n var addDelegate = obj.addEventListener;\n obj.addEventListener = function (eventName, fn) {\n fn._bound = fn._bound || {};\n arguments[1] = fn._bound[eventName] = zone.bind(fn);\n return addDelegate.apply(this, arguments);\n };\n\n var removeDelegate = obj.removeEventListener;\n obj.removeEventListener = function (eventName, fn) {\n if(arguments[1]._bound && arguments[1]._bound[eventName]) {\n var _bound = arguments[1]._bound;\n arguments[1] = _bound[eventName];\n delete _bound[eventName];\n }\n var result = removeDelegate.apply(this, arguments);\n global.zone.dequeueTask(fn);\n return result;\n };\n};\n\n// wrap some native API on `window`\nfunction patchClass(className) {\n var OriginalClass = global[className];\n if (!OriginalClass) return;\n\n global[className] = function () {\n var a = bindArguments(arguments);\n switch (a.length) {\n case 0: this._o = new OriginalClass(); break;\n case 1: this._o = new OriginalClass(a[0]); break;\n case 2: this._o = new OriginalClass(a[0], a[1]); break;\n case 3: this._o = new OriginalClass(a[0], a[1], a[2]); break;\n case 4: this._o = new OriginalClass(a[0], a[1], a[2], a[3]); break;\n default: throw new Error('what are you even doing?');\n }\n };\n\n var instance = new OriginalClass();\n\n var prop;\n for (prop in instance) {\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n global[className].prototype[prop] = function () {\n return this._o[prop].apply(this._o, arguments);\n };\n } else {\n Object.defineProperty(global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this._o[prop] = global.zone.bind(fn);\n } else {\n this._o[prop] = fn;\n }\n },\n get: function () {\n return this._o[prop];\n }\n });\n }\n }(prop));\n }\n\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n global[className][prop] = OriginalClass[prop];\n }\n }\n};\n\nmodule.exports = {\n bindArguments: bindArguments,\n bindArgumentsOnce: bindArgumentsOnce,\n patchPrototype: patchPrototype,\n patchProperty: patchProperty,\n patchProperties: patchProperties,\n patchEventTargetMethods: patchEventTargetMethods,\n patchClass: patchClass\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/utils.js\n ** module id = 4\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/utils.js?"); - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar fnPatch = __webpack_require__(6);\nvar promisePatch = __webpack_require__(3);\nvar mutationObserverPatch = __webpack_require__(7);\nvar definePropertyPatch = __webpack_require__(8);\nvar registerElementPatch = __webpack_require__(9);\nvar webSocketPatch = __webpack_require__(10);\nvar eventTargetPatch = __webpack_require__(11);\nvar propertyDescriptorPatch = __webpack_require__(12);\nvar geolocationPatch = __webpack_require__(13);\n\nfunction apply() {\n fnPatch.patchSetClearFunction(global, [\n 'timeout',\n 'interval',\n 'immediate'\n ]);\n\n fnPatch.patchSetFunction(global, [\n 'requestAnimationFrame',\n 'mozRequestAnimationFrame',\n 'webkitRequestAnimationFrame'\n ]);\n\n fnPatch.patchFunction(global, [\n 'alert',\n 'prompt'\n ]);\n\n eventTargetPatch.apply();\n\n propertyDescriptorPatch.apply();\n\n promisePatch.apply();\n\n mutationObserverPatch.patchClass('MutationObserver');\n mutationObserverPatch.patchClass('WebKitMutationObserver');\n\n definePropertyPatch.apply();\n\n registerElementPatch.apply();\n\n geolocationPatch.apply();\n}\n\nmodule.exports = {\n apply: apply\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/browser.js\n ** module id = 5\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/browser.js?"); - -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar utils = __webpack_require__(4);\n\nfunction patchSetClearFunction(obj, fnNames) {\n fnNames.map(function (name) {\n return name[0].toUpperCase() + name.substr(1);\n }).forEach(function (name) {\n var setName = 'set' + name;\n var delegate = obj[setName];\n\n if (delegate) {\n var clearName = 'clear' + name;\n var ids = {};\n\n var bindArgs = setName === 'setInterval' ? utils.bindArguments : utils.bindArgumentsOnce;\n\n global.zone[setName] = function (fn) {\n var id, fnRef = fn;\n arguments[0] = function () {\n delete ids[id];\n return fnRef.apply(this, arguments);\n };\n var args = bindArgs(arguments);\n id = delegate.apply(obj, args);\n ids[id] = true;\n return id;\n };\n\n obj[setName] = function () {\n return global.zone[setName].apply(this, arguments);\n };\n\n var clearDelegate = obj[clearName];\n\n global.zone[clearName] = function (id) {\n if (ids[id]) {\n delete ids[id];\n global.zone.dequeueTask();\n }\n return clearDelegate.apply(this, arguments);\n };\n\n obj[clearName] = function () {\n return global.zone[clearName].apply(this, arguments);\n };\n }\n });\n};\n\nfunction patchSetFunction(obj, fnNames) {\n fnNames.forEach(function (name) {\n var delegate = obj[name];\n\n if (delegate) {\n global.zone[name] = function (fn) {\n var fnRef = fn;\n arguments[0] = function () {\n return fnRef.apply(this, arguments);\n };\n var args = utils.bindArgumentsOnce(arguments);\n return delegate.apply(obj, args);\n };\n\n obj[name] = function () {\n return zone[name].apply(this, arguments);\n };\n }\n });\n};\n\nfunction patchFunction(obj, fnNames) {\n fnNames.forEach(function (name) {\n var delegate = obj[name];\n global.zone[name] = function () {\n return delegate.apply(obj, arguments);\n };\n\n obj[name] = function () {\n return global.zone[name].apply(this, arguments);\n };\n });\n};\n\n\nmodule.exports = {\n patchSetClearFunction: patchSetClearFunction,\n patchSetFunction: patchSetFunction,\n patchFunction: patchFunction\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/functions.js\n ** module id = 6\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/functions.js?"); - -/***/ }, -/* 7 */ -/***/ function(module, exports) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\n// wrap some native API on `window`\nfunction patchClass(className) {\n var OriginalClass = global[className];\n if (!OriginalClass) return;\n\n global[className] = function (fn) {\n this._o = new OriginalClass(global.zone.bind(fn, true));\n // Remember where the class was instantiate to execute the enqueueTask and dequeueTask hooks\n this._creationZone = global.zone;\n };\n\n var instance = new OriginalClass(function () {});\n\n global[className].prototype.disconnect = function () {\n var result = this._o.disconnect.apply(this._o, arguments);\n if (this._active) {\n this._creationZone.dequeueTask();\n this._active = false;\n }\n return result;\n };\n\n global[className].prototype.observe = function () {\n if (!this._active) {\n this._creationZone.enqueueTask();\n this._active = true;\n }\n return this._o.observe.apply(this._o, arguments);\n };\n\n var prop;\n for (prop in instance) {\n (function (prop) {\n if (typeof global[className].prototype !== undefined) {\n return;\n }\n if (typeof instance[prop] === 'function') {\n global[className].prototype[prop] = function () {\n return this._o[prop].apply(this._o, arguments);\n };\n } else {\n Object.defineProperty(global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this._o[prop] = global.zone.bind(fn);\n } else {\n this._o[prop] = fn;\n }\n },\n get: function () {\n return this._o[prop];\n }\n });\n }\n }(prop));\n }\n};\n\nmodule.exports = {\n patchClass: patchClass\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/mutation-observer.js\n ** module id = 7\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/mutation-observer.js?"); - -/***/ }, -/* 8 */ -/***/ function(module, exports) { - - eval("'use strict';\n\n// might need similar for object.freeze\n// i regret nothing\n\nvar _defineProperty = Object.defineProperty;\nvar _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar _create = Object.create;\n\nfunction apply() {\n Object.defineProperty = function (obj, prop, desc) {\n if (isUnconfigurable(obj, prop)) {\n throw new TypeError('Cannot assign to read only property \\'' + prop + '\\' of ' + obj);\n }\n if (prop !== 'prototype') {\n desc = rewriteDescriptor(obj, prop, desc);\n }\n return _defineProperty(obj, prop, desc);\n };\n\n Object.defineProperties = function (obj, props) {\n Object.keys(props).forEach(function (prop) {\n Object.defineProperty(obj, prop, props[prop]);\n });\n return obj;\n };\n\n Object.create = function (obj, proto) {\n if (typeof proto === 'object') {\n Object.keys(proto).forEach(function (prop) {\n proto[prop] = rewriteDescriptor(obj, prop, proto[prop]);\n });\n }\n return _create(obj, proto);\n };\n\n Object.getOwnPropertyDescriptor = function (obj, prop) {\n var desc = _getOwnPropertyDescriptor(obj, prop);\n if (isUnconfigurable(obj, prop)) {\n desc.configurable = false;\n }\n return desc;\n };\n};\n\nfunction _redefineProperty(obj, prop, desc) {\n desc = rewriteDescriptor(obj, prop, desc);\n return _defineProperty(obj, prop, desc);\n};\n\nfunction isUnconfigurable (obj, prop) {\n return obj && obj.__unconfigurables && obj.__unconfigurables[prop];\n}\n\nfunction rewriteDescriptor (obj, prop, desc) {\n desc.configurable = true;\n if (!desc.configurable) {\n if (!obj.__unconfigurables) {\n _defineProperty(obj, '__unconfigurables', { writable: true, value: {} });\n }\n obj.__unconfigurables[prop] = true;\n }\n return desc;\n}\n\nmodule.exports = {\n apply: apply,\n _redefineProperty: _redefineProperty\n};\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/define-property.js\n ** module id = 8\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/define-property.js?"); - -/***/ }, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar _redefineProperty = __webpack_require__(8)._redefineProperty;\n\nfunction apply() {\n if (!('registerElement' in global.document)) {\n return;\n }\n\n var _registerElement = document.registerElement;\n var callbacks = [\n 'createdCallback',\n 'attachedCallback',\n 'detachedCallback',\n 'attributeChangedCallback'\n ];\n\n document.registerElement = function (name, opts) {\n if (opts && opts.prototype) {\n callbacks.forEach(function (callback) {\n if (opts.prototype.hasOwnProperty(callback)) {\n var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback);\n if (descriptor.value) {\n descriptor.value = global.zone.bind(descriptor.value);\n _redefineProperty(opts.prototype, callback, descriptor);\n } else {\n opts.prototype[callback] = global.zone.bind(opts.prototype[callback]);\n }\n } else if (opts.prototype[callback]) {\n opts.prototype[callback] = global.zone.bind(opts.prototype[callback]);\n }\n });\n }\n\n return _registerElement.apply(document, [name, opts]);\n };\n}\n\nmodule.exports = {\n apply: apply\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/register-element.js\n ** module id = 9\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/register-element.js?"); - -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar utils = __webpack_require__(4);\n\n// we have to patch the instance since the proto is non-configurable\nfunction apply() {\n var WS = global.WebSocket;\n utils.patchEventTargetMethods(WS.prototype);\n global.WebSocket = function(a, b) {\n var socket = arguments.length > 1 ? new WS(a, b) : new WS(a);\n var proxySocket;\n\n // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance\n var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage');\n if (onmessageDesc && onmessageDesc.configurable === false) {\n proxySocket = Object.create(socket);\n ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function(propName) {\n proxySocket[propName] = function() {\n return socket[propName].apply(socket, arguments);\n };\n });\n } else {\n // we can patch the real socket\n proxySocket = socket;\n }\n\n utils.patchProperties(proxySocket, ['onclose', 'onerror', 'onmessage', 'onopen']);\n\n return proxySocket;\n };\n}\n\nmodule.exports = {\n apply: apply\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/websocket.js\n ** module id = 10\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/websocket.js?"); - -/***/ }, -/* 11 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar utils = __webpack_require__(4);\n\nfunction apply() {\n // patched properties depend on addEventListener, so this needs to come first\n if (global.EventTarget) {\n utils.patchEventTargetMethods(global.EventTarget.prototype);\n\n // Note: EventTarget is not available in all browsers,\n // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget\n } else {\n var apis = [ 'ApplicationCache',\n 'EventSource',\n 'FileReader',\n 'InputMethodContext',\n 'MediaController',\n 'MessagePort',\n 'Node',\n 'Performance',\n 'SVGElementInstance',\n 'SharedWorker',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebKitNamedFlow',\n 'Window',\n 'Worker',\n 'WorkerGlobalScope',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload'\n ];\n\n apis.forEach(function(thing) {\n global[thing] && utils.patchEventTargetMethods(global[thing].prototype);\n });\n }\n}\n\nmodule.exports = {\n apply: apply\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/event-target.js\n ** module id = 11\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/event-target.js?"); - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar webSocketPatch = __webpack_require__(10);\nvar utils = __webpack_require__(4);\n\nvar eventNames = 'copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror'.split(' ');\n\nfunction apply() {\n if (canPatchViaPropertyDescriptor()) {\n // for browsers that we can patch the descriptor: Chrome & Firefox\n var onEventNames = eventNames.map(function (property) {\n return 'on' + property;\n });\n utils.patchProperties(HTMLElement.prototype, onEventNames);\n utils.patchProperties(XMLHttpRequest.prototype);\n if (typeof WebSocket !== 'undefined') {\n utils.patchProperties(WebSocket.prototype);\n }\n } else {\n // Safari\n patchViaCapturingAllTheEvents();\n utils.patchClass('XMLHttpRequest');\n webSocketPatch.apply();\n }\n}\n\nfunction canPatchViaPropertyDescriptor() {\n if (!Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') && typeof Element !== 'undefined') {\n // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364\n // IDL interface attributes are not configurable\n var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick');\n if (desc && !desc.configurable) return false;\n }\n\n Object.defineProperty(HTMLElement.prototype, 'onclick', {\n get: function () {\n return true;\n }\n });\n var elt = document.createElement('div');\n var result = !!elt.onclick;\n Object.defineProperty(HTMLElement.prototype, 'onclick', {});\n return result;\n};\n\n// Whenever any event fires, we check the event target and all parents\n// for `onwhatever` properties and replace them with zone-bound functions\n// - Chrome (for now)\nfunction patchViaCapturingAllTheEvents() {\n eventNames.forEach(function (property) {\n var onproperty = 'on' + property;\n document.addEventListener(property, function (event) {\n var elt = event.target, bound;\n while (elt) {\n if (elt[onproperty] && !elt[onproperty]._unbound) {\n bound = global.zone.bind(elt[onproperty]);\n bound._unbound = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n });\n};\n\nmodule.exports = {\n apply: apply\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/property-descriptor.js\n ** module id = 12\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/property-descriptor.js?"); - -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\nvar utils = __webpack_require__(4);\n\nfunction apply() {\n if (global.navigator && global.navigator.geolocation) {\n utils.patchPrototype(global.navigator.geolocation, [\n 'getCurrentPosition',\n 'watchPosition'\n ]);\n }\n}\n\nmodule.exports = {\n apply: apply\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/zone.js/lib/patch/geolocation.js\n ** module id = 13\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/zone.js/lib/patch/geolocation.js?"); - -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global) {/*! *****************************************************************************\r\nCopyright (C) Microsoft. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n***************************************************************************** */\r\n\"use strict\";\r\nvar Reflect;\r\n(function (Reflect) {\r\n // Load global or shim versions of Map, Set, and WeakMap\r\n var functionPrototype = Object.getPrototypeOf(Function);\r\n var _Map = typeof Map === \"function\" ? Map : CreateMapPolyfill();\r\n var _Set = typeof Set === \"function\" ? Set : CreateSetPolyfill();\r\n var _WeakMap = typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill();\r\n // [[Metadata]] internal slot\r\n var __Metadata__ = new _WeakMap();\r\n /**\r\n * Applies a set of decorators to a property of a target object.\r\n * @param decorators An array of decorators.\r\n * @param target The target object.\r\n * @param targetKey (Optional) The property key to decorate.\r\n * @param targetDescriptor (Optional) The property descriptor for the target key\r\n * @remarks Decorators are applied in reverse order.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * C = Reflect.decorate(decoratorsArray, C);\r\n *\r\n * // property (on constructor)\r\n * Reflect.decorate(decoratorsArray, C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * Reflect.decorate(decoratorsArray, C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * Object.defineProperty(C, \"staticMethod\",\r\n * Reflect.decorate(decoratorsArray, C, \"staticMethod\",\r\n * Object.getOwnPropertyDescriptor(C, \"staticMethod\")));\r\n *\r\n * // method (on prototype)\r\n * Object.defineProperty(C.prototype, \"method\",\r\n * Reflect.decorate(decoratorsArray, C.prototype, \"method\",\r\n * Object.getOwnPropertyDescriptor(C.prototype, \"method\")));\r\n *\r\n */\r\n function decorate(decorators, target, targetKey, targetDescriptor) {\r\n if (!IsUndefined(targetDescriptor)) {\r\n if (!IsArray(decorators)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (IsUndefined(targetKey)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsObject(targetDescriptor)) {\r\n throw new TypeError();\r\n }\r\n targetKey = ToPropertyKey(targetKey);\r\n return DecoratePropertyWithDescriptor(decorators, target, targetKey, targetDescriptor);\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n if (!IsArray(decorators)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n targetKey = ToPropertyKey(targetKey);\r\n return DecoratePropertyWithoutDescriptor(decorators, target, targetKey);\r\n }\r\n else {\r\n if (!IsArray(decorators)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsConstructor(target)) {\r\n throw new TypeError();\r\n }\r\n return DecorateConstructor(decorators, target);\r\n }\r\n }\r\n Reflect.decorate = decorate;\r\n /**\r\n * A default metadata decorator factory that can be used on a class, class member, or parameter.\r\n * @param metadataKey The key for the metadata entry.\r\n * @param metadataValue The value for the metadata entry.\r\n * @returns A decorator function.\r\n * @remarks\r\n * If `metadataKey` is already defined for the target and target key, the\r\n * metadataValue for that key will be overwritten.\r\n * @example\r\n *\r\n * // constructor\r\n * @Reflect.metadata(key, value)\r\n * class C {\r\n * }\r\n *\r\n * // property (on constructor, TypeScript only)\r\n * class C {\r\n * @Reflect.metadata(key, value)\r\n * static staticProperty;\r\n * }\r\n *\r\n * // property (on prototype, TypeScript only)\r\n * class C {\r\n * @Reflect.metadata(key, value)\r\n * property;\r\n * }\r\n *\r\n * // method (on constructor)\r\n * class C {\r\n * @Reflect.metadata(key, value)\r\n * static staticMethod() { }\r\n * }\r\n *\r\n * // method (on prototype)\r\n * class C {\r\n * @Reflect.metadata(key, value)\r\n * method() { }\r\n * }\r\n *\r\n */\r\n function metadata(metadataKey, metadataValue) {\r\n function decorator(target, targetKey) {\r\n if (!IsUndefined(targetKey)) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n targetKey = ToPropertyKey(targetKey);\r\n OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey);\r\n }\r\n else {\r\n if (!IsConstructor(target)) {\r\n throw new TypeError();\r\n }\r\n OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, undefined);\r\n }\r\n }\r\n return decorator;\r\n }\r\n Reflect.metadata = metadata;\r\n /**\r\n * Define a unique metadata entry on the target.\r\n * @param metadataKey A key used to store and retrieve metadata.\r\n * @param metadataValue A value that contains attached metadata.\r\n * @param target The target object on which to define metadata.\r\n * @param targetKey (Optional) The property key for the target.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * Reflect.defineMetadata(\"custom:annotation\", options, C);\r\n *\r\n * // property (on constructor)\r\n * Reflect.defineMetadata(\"custom:annotation\", options, C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * Reflect.defineMetadata(\"custom:annotation\", options, C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * Reflect.defineMetadata(\"custom:annotation\", options, C, \"staticMethod\");\r\n *\r\n * // method (on prototype)\r\n * Reflect.defineMetadata(\"custom:annotation\", options, C.prototype, \"method\");\r\n *\r\n * // decorator factory as metadata-producing annotation.\r\n * function MyAnnotation(options): Decorator {\r\n * return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\r\n * }\r\n *\r\n */\r\n function defineMetadata(metadataKey, metadataValue, target, targetKey) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n targetKey = ToPropertyKey(targetKey);\r\n }\r\n return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey);\r\n }\r\n Reflect.defineMetadata = defineMetadata;\r\n /**\r\n * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\r\n * @param metadataKey A key used to store and retrieve metadata.\r\n * @param target The target object on which the metadata is defined.\r\n * @param targetKey (Optional) The property key for the target.\r\n * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * result = Reflect.hasMetadata(\"custom:annotation\", C);\r\n *\r\n * // property (on constructor)\r\n * result = Reflect.hasMetadata(\"custom:annotation\", C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * result = Reflect.hasMetadata(\"custom:annotation\", C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * result = Reflect.hasMetadata(\"custom:annotation\", C, \"staticMethod\");\r\n *\r\n * // method (on prototype)\r\n * result = Reflect.hasMetadata(\"custom:annotation\", C.prototype, \"method\");\r\n *\r\n */\r\n function hasMetadata(metadataKey, target, targetKey) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n targetKey = ToPropertyKey(targetKey);\r\n }\r\n return OrdinaryHasMetadata(metadataKey, target, targetKey);\r\n }\r\n Reflect.hasMetadata = hasMetadata;\r\n /**\r\n * Gets a value indicating whether the target object has the provided metadata key defined.\r\n * @param metadataKey A key used to store and retrieve metadata.\r\n * @param target The target object on which the metadata is defined.\r\n * @param targetKey (Optional) The property key for the target.\r\n * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", C);\r\n *\r\n * // property (on constructor)\r\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", C, \"staticMethod\");\r\n *\r\n * // method (on prototype)\r\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", C.prototype, \"method\");\r\n *\r\n */\r\n function hasOwnMetadata(metadataKey, target, targetKey) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n targetKey = ToPropertyKey(targetKey);\r\n }\r\n return OrdinaryHasOwnMetadata(metadataKey, target, targetKey);\r\n }\r\n Reflect.hasOwnMetadata = hasOwnMetadata;\r\n /**\r\n * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\r\n * @param metadataKey A key used to store and retrieve metadata.\r\n * @param target The target object on which the metadata is defined.\r\n * @param targetKey (Optional) The property key for the target.\r\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * result = Reflect.getMetadata(\"custom:annotation\", C);\r\n *\r\n * // property (on constructor)\r\n * result = Reflect.getMetadata(\"custom:annotation\", C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * result = Reflect.getMetadata(\"custom:annotation\", C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * result = Reflect.getMetadata(\"custom:annotation\", C, \"staticMethod\");\r\n *\r\n * // method (on prototype)\r\n * result = Reflect.getMetadata(\"custom:annotation\", C.prototype, \"method\");\r\n *\r\n */\r\n function getMetadata(metadataKey, target, targetKey) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n targetKey = ToPropertyKey(targetKey);\r\n }\r\n return OrdinaryGetMetadata(metadataKey, target, targetKey);\r\n }\r\n Reflect.getMetadata = getMetadata;\r\n /**\r\n * Gets the metadata value for the provided metadata key on the target object.\r\n * @param metadataKey A key used to store and retrieve metadata.\r\n * @param target The target object on which the metadata is defined.\r\n * @param targetKey (Optional) The property key for the target.\r\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * result = Reflect.getOwnMetadata(\"custom:annotation\", C);\r\n *\r\n * // property (on constructor)\r\n * result = Reflect.getOwnMetadata(\"custom:annotation\", C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * result = Reflect.getOwnMetadata(\"custom:annotation\", C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * result = Reflect.getOwnMetadata(\"custom:annotation\", C, \"staticMethod\");\r\n *\r\n * // method (on prototype)\r\n * result = Reflect.getOwnMetadata(\"custom:annotation\", C.prototype, \"method\");\r\n *\r\n */\r\n function getOwnMetadata(metadataKey, target, targetKey) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n targetKey = ToPropertyKey(targetKey);\r\n }\r\n return OrdinaryGetOwnMetadata(metadataKey, target, targetKey);\r\n }\r\n Reflect.getOwnMetadata = getOwnMetadata;\r\n /**\r\n * Gets the metadata keys defined on the target object or its prototype chain.\r\n * @param target The target object on which the metadata is defined.\r\n * @param targetKey (Optional) The property key for the target.\r\n * @returns An array of unique metadata keys.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * result = Reflect.getMetadataKeys(C);\r\n *\r\n * // property (on constructor)\r\n * result = Reflect.getMetadataKeys(C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * result = Reflect.getMetadataKeys(C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * result = Reflect.getMetadataKeys(C, \"staticMethod\");\r\n *\r\n * // method (on prototype)\r\n * result = Reflect.getMetadataKeys(C.prototype, \"method\");\r\n *\r\n */\r\n function getMetadataKeys(target, targetKey) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n targetKey = ToPropertyKey(targetKey);\r\n }\r\n return OrdinaryMetadataKeys(target, targetKey);\r\n }\r\n Reflect.getMetadataKeys = getMetadataKeys;\r\n /**\r\n * Gets the unique metadata keys defined on the target object.\r\n * @param target The target object on which the metadata is defined.\r\n * @param targetKey (Optional) The property key for the target.\r\n * @returns An array of unique metadata keys.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * result = Reflect.getOwnMetadataKeys(C);\r\n *\r\n * // property (on constructor)\r\n * result = Reflect.getOwnMetadataKeys(C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * result = Reflect.getOwnMetadataKeys(C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * result = Reflect.getOwnMetadataKeys(C, \"staticMethod\");\r\n *\r\n * // method (on prototype)\r\n * result = Reflect.getOwnMetadataKeys(C.prototype, \"method\");\r\n *\r\n */\r\n function getOwnMetadataKeys(target, targetKey) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n targetKey = ToPropertyKey(targetKey);\r\n }\r\n return OrdinaryOwnMetadataKeys(target, targetKey);\r\n }\r\n Reflect.getOwnMetadataKeys = getOwnMetadataKeys;\r\n /**\r\n * Deletes the metadata entry from the target object with the provided key.\r\n * @param metadataKey A key used to store and retrieve metadata.\r\n * @param target The target object on which the metadata is defined.\r\n * @param targetKey (Optional) The property key for the target.\r\n * @returns `true` if the metadata entry was found and deleted; otherwise, false.\r\n * @example\r\n *\r\n * class C {\r\n * // property declarations are not part of ES6, though they are valid in TypeScript:\r\n * // static staticProperty;\r\n * // property;\r\n *\r\n * constructor(p) { }\r\n * static staticMethod(p) { }\r\n * method(p) { }\r\n * }\r\n *\r\n * // constructor\r\n * result = Reflect.deleteMetadata(\"custom:annotation\", C);\r\n *\r\n * // property (on constructor)\r\n * result = Reflect.deleteMetadata(\"custom:annotation\", C, \"staticProperty\");\r\n *\r\n * // property (on prototype)\r\n * result = Reflect.deleteMetadata(\"custom:annotation\", C.prototype, \"property\");\r\n *\r\n * // method (on constructor)\r\n * result = Reflect.deleteMetadata(\"custom:annotation\", C, \"staticMethod\");\r\n *\r\n * // method (on prototype)\r\n * result = Reflect.deleteMetadata(\"custom:annotation\", C.prototype, \"method\");\r\n *\r\n */\r\n function deleteMetadata(metadataKey, target, targetKey) {\r\n if (!IsObject(target)) {\r\n throw new TypeError();\r\n }\r\n else if (!IsUndefined(targetKey)) {\r\n targetKey = ToPropertyKey(targetKey);\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p-\r\n var metadataMap = GetOrCreateMetadataMap(target, targetKey, false);\r\n if (IsUndefined(metadataMap)) {\r\n return false;\r\n }\r\n if (!metadataMap.delete(metadataKey)) {\r\n return false;\r\n }\r\n if (metadataMap.size > 0) {\r\n return true;\r\n }\r\n var targetMetadata = __Metadata__.get(target);\r\n targetMetadata.delete(targetKey);\r\n if (targetMetadata.size > 0) {\r\n return true;\r\n }\r\n __Metadata__.delete(target);\r\n return true;\r\n }\r\n Reflect.deleteMetadata = deleteMetadata;\r\n function DecorateConstructor(decorators, target) {\r\n for (var i = decorators.length - 1; i >= 0; --i) {\r\n var decorator = decorators[i];\r\n var decorated = decorator(target);\r\n if (!IsUndefined(decorated)) {\r\n if (!IsConstructor(decorated)) {\r\n throw new TypeError();\r\n }\r\n target = decorated;\r\n }\r\n }\r\n return target;\r\n }\r\n function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) {\r\n for (var i = decorators.length - 1; i >= 0; --i) {\r\n var decorator = decorators[i];\r\n var decorated = decorator(target, propertyKey, descriptor);\r\n if (!IsUndefined(decorated)) {\r\n if (!IsObject(decorated)) {\r\n throw new TypeError();\r\n }\r\n descriptor = decorated;\r\n }\r\n }\r\n return descriptor;\r\n }\r\n function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) {\r\n for (var i = decorators.length - 1; i >= 0; --i) {\r\n var decorator = decorators[i];\r\n decorator(target, propertyKey);\r\n }\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create-\r\n function GetOrCreateMetadataMap(target, targetKey, create) {\r\n var targetMetadata = __Metadata__.get(target);\r\n if (!targetMetadata) {\r\n if (!create) {\r\n return undefined;\r\n }\r\n targetMetadata = new _Map();\r\n __Metadata__.set(target, targetMetadata);\r\n }\r\n var keyMetadata = targetMetadata.get(targetKey);\r\n if (!keyMetadata) {\r\n if (!create) {\r\n return undefined;\r\n }\r\n keyMetadata = new _Map();\r\n targetMetadata.set(targetKey, keyMetadata);\r\n }\r\n return keyMetadata;\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p-\r\n function OrdinaryHasMetadata(MetadataKey, O, P) {\r\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\r\n if (hasOwn) {\r\n return true;\r\n }\r\n var parent = GetPrototypeOf(O);\r\n if (parent !== null) {\r\n return OrdinaryHasMetadata(MetadataKey, parent, P);\r\n }\r\n return false;\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p-\r\n function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\r\n var metadataMap = GetOrCreateMetadataMap(O, P, false);\r\n if (metadataMap === undefined) {\r\n return false;\r\n }\r\n return Boolean(metadataMap.has(MetadataKey));\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p-\r\n function OrdinaryGetMetadata(MetadataKey, O, P) {\r\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\r\n if (hasOwn) {\r\n return OrdinaryGetOwnMetadata(MetadataKey, O, P);\r\n }\r\n var parent = GetPrototypeOf(O);\r\n if (parent !== null) {\r\n return OrdinaryGetMetadata(MetadataKey, parent, P);\r\n }\r\n return undefined;\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p-\r\n function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\r\n var metadataMap = GetOrCreateMetadataMap(O, P, false);\r\n if (metadataMap === undefined) {\r\n return undefined;\r\n }\r\n return metadataMap.get(MetadataKey);\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p-\r\n function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\r\n var metadataMap = GetOrCreateMetadataMap(O, P, true);\r\n metadataMap.set(MetadataKey, MetadataValue);\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p-\r\n function OrdinaryMetadataKeys(O, P) {\r\n var ownKeys = OrdinaryOwnMetadataKeys(O, P);\r\n var parent = GetPrototypeOf(O);\r\n if (parent === null) {\r\n return ownKeys;\r\n }\r\n var parentKeys = OrdinaryMetadataKeys(parent, P);\r\n if (parentKeys.length <= 0) {\r\n return ownKeys;\r\n }\r\n if (ownKeys.length <= 0) {\r\n return parentKeys;\r\n }\r\n var set = new _Set();\r\n var keys = [];\r\n for (var _i = 0; _i < ownKeys.length; _i++) {\r\n var key = ownKeys[_i];\r\n var hasKey = set.has(key);\r\n if (!hasKey) {\r\n set.add(key);\r\n keys.push(key);\r\n }\r\n }\r\n for (var _a = 0; _a < parentKeys.length; _a++) {\r\n var key = parentKeys[_a];\r\n var hasKey = set.has(key);\r\n if (!hasKey) {\r\n set.add(key);\r\n keys.push(key);\r\n }\r\n }\r\n return keys;\r\n }\r\n // https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p-\r\n function OrdinaryOwnMetadataKeys(target, targetKey) {\r\n var metadataMap = GetOrCreateMetadataMap(target, targetKey, false);\r\n var keys = [];\r\n if (metadataMap) {\r\n metadataMap.forEach(function (_, key) { return keys.push(key); });\r\n }\r\n return keys;\r\n }\r\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type\r\n function IsUndefined(x) {\r\n return x === undefined;\r\n }\r\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray\r\n function IsArray(x) {\r\n return Array.isArray(x);\r\n }\r\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type\r\n function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }\r\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor\r\n function IsConstructor(x) {\r\n return typeof x === \"function\";\r\n }\r\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type\r\n function IsSymbol(x) {\r\n return typeof x === \"symbol\";\r\n }\r\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey\r\n function ToPropertyKey(value) {\r\n if (IsSymbol(value)) {\r\n return value;\r\n }\r\n return String(value);\r\n }\r\n function GetPrototypeOf(O) {\r\n var proto = Object.getPrototypeOf(O);\r\n if (typeof O !== \"function\" || O === functionPrototype) {\r\n return proto;\r\n }\r\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard. \r\n // Try to determine the superclass constructor. Compatible implementations\r\n // must either set __proto__ on a subclass constructor to the superclass constructor,\r\n // or ensure each class has a valid `constructor` property on its prototype that\r\n // points back to the constructor.\r\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\r\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\r\n if (proto !== functionPrototype) {\r\n return proto;\r\n }\r\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\r\n var prototype = O.prototype;\r\n var prototypeProto = Object.getPrototypeOf(prototype);\r\n if (prototypeProto == null || prototypeProto === Object.prototype) {\r\n return proto;\r\n }\r\n // if the constructor was not a function, then we cannot determine the heritage.\r\n var constructor = prototypeProto.constructor;\r\n if (typeof constructor !== \"function\") {\r\n return proto;\r\n }\r\n // if we have some kind of self-reference, then we cannot determine the heritage.\r\n if (constructor === O) {\r\n return proto;\r\n }\r\n // we have a pretty good guess at the heritage.\r\n return constructor;\r\n }\r\n // naive Map shim\r\n function CreateMapPolyfill() {\r\n var cacheSentinel = {};\r\n function Map() {\r\n this._keys = [];\r\n this._values = [];\r\n this._cache = cacheSentinel;\r\n }\r\n Map.prototype = {\r\n get size() {\r\n return this._keys.length;\r\n },\r\n has: function (key) {\r\n if (key === this._cache) {\r\n return true;\r\n }\r\n if (this._find(key) >= 0) {\r\n this._cache = key;\r\n return true;\r\n }\r\n return false;\r\n },\r\n get: function (key) {\r\n var index = this._find(key);\r\n if (index >= 0) {\r\n this._cache = key;\r\n return this._values[index];\r\n }\r\n return undefined;\r\n },\r\n set: function (key, value) {\r\n this.delete(key);\r\n this._keys.push(key);\r\n this._values.push(value);\r\n this._cache = key;\r\n return this;\r\n },\r\n delete: function (key) {\r\n var index = this._find(key);\r\n if (index >= 0) {\r\n this._keys.splice(index, 1);\r\n this._values.splice(index, 1);\r\n this._cache = cacheSentinel;\r\n return true;\r\n }\r\n return false;\r\n },\r\n clear: function () {\r\n this._keys.length = 0;\r\n this._values.length = 0;\r\n this._cache = cacheSentinel;\r\n },\r\n forEach: function (callback, thisArg) {\r\n var size = this.size;\r\n for (var i = 0; i < size; ++i) {\r\n var key = this._keys[i];\r\n var value = this._values[i];\r\n this._cache = key;\r\n callback.call(this, value, key, this);\r\n }\r\n },\r\n _find: function (key) {\r\n var keys = this._keys;\r\n var size = keys.length;\r\n for (var i = 0; i < size; ++i) {\r\n if (keys[i] === key) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n }\r\n };\r\n return Map;\r\n }\r\n // naive Set shim\r\n function CreateSetPolyfill() {\r\n var cacheSentinel = {};\r\n function Set() {\r\n this._map = new _Map();\r\n }\r\n Set.prototype = {\r\n get size() {\r\n return this._map.length;\r\n },\r\n has: function (value) {\r\n return this._map.has(value);\r\n },\r\n add: function (value) {\r\n this._map.set(value, value);\r\n return this;\r\n },\r\n delete: function (value) {\r\n return this._map.delete(value);\r\n },\r\n clear: function () {\r\n this._map.clear();\r\n },\r\n forEach: function (callback, thisArg) {\r\n this._map.forEach(callback, thisArg);\r\n }\r\n };\r\n return Set;\r\n }\r\n // naive WeakMap shim\r\n function CreateWeakMapPolyfill() {\r\n var UUID_SIZE = 16;\r\n var isNode = typeof global !== \"undefined\" &&\r\n typeof module === \"object\" &&\r\n typeof module.exports === \"object\" &&\r\n \"function\" === \"function\";\r\n var nodeCrypto = isNode && __webpack_require__(15);\r\n var hasOwn = Object.prototype.hasOwnProperty;\r\n var keys = {};\r\n var rootKey = CreateUniqueKey();\r\n function WeakMap() {\r\n this._key = CreateUniqueKey();\r\n }\r\n WeakMap.prototype = {\r\n has: function (target) {\r\n var table = GetOrCreateWeakMapTable(target, false);\r\n if (table) {\r\n return this._key in table;\r\n }\r\n return false;\r\n },\r\n get: function (target) {\r\n var table = GetOrCreateWeakMapTable(target, false);\r\n if (table) {\r\n return table[this._key];\r\n }\r\n return undefined;\r\n },\r\n set: function (target, value) {\r\n var table = GetOrCreateWeakMapTable(target, true);\r\n table[this._key] = value;\r\n return this;\r\n },\r\n delete: function (target) {\r\n var table = GetOrCreateWeakMapTable(target, false);\r\n if (table && this._key in table) {\r\n return delete table[this._key];\r\n }\r\n return false;\r\n },\r\n clear: function () {\r\n // NOTE: not a real clear, just makes the previous data unreachable\r\n this._key = CreateUniqueKey();\r\n }\r\n };\r\n function FillRandomBytes(buffer, size) {\r\n for (var i = 0; i < size; ++i) {\r\n buffer[i] = Math.random() * 255 | 0;\r\n }\r\n }\r\n function GenRandomBytes(size) {\r\n if (nodeCrypto) {\r\n var data = nodeCrypto.randomBytes(size);\r\n return data;\r\n }\r\n else if (typeof Uint8Array === \"function\") {\r\n var data = new Uint8Array(size);\r\n if (typeof crypto !== \"undefined\") {\r\n crypto.getRandomValues(data);\r\n }\r\n else if (typeof msCrypto !== \"undefined\") {\r\n msCrypto.getRandomValues(data);\r\n }\r\n else {\r\n FillRandomBytes(data, size);\r\n }\r\n return data;\r\n }\r\n else {\r\n var data = new Array(size);\r\n FillRandomBytes(data, size);\r\n return data;\r\n }\r\n }\r\n function CreateUUID() {\r\n var data = GenRandomBytes(UUID_SIZE);\r\n // mark as random - RFC 4122 § 4.4\r\n data[6] = data[6] & 0x4f | 0x40;\r\n data[8] = data[8] & 0xbf | 0x80;\r\n var result = \"\";\r\n for (var offset = 0; offset < UUID_SIZE; ++offset) {\r\n var byte = data[offset];\r\n if (offset === 4 || offset === 6 || offset === 8) {\r\n result += \"-\";\r\n }\r\n if (byte < 16) {\r\n result += \"0\";\r\n }\r\n result += byte.toString(16).toLowerCase();\r\n }\r\n return result;\r\n }\r\n function CreateUniqueKey() {\r\n var key;\r\n do {\r\n key = \"@@WeakMap@@\" + CreateUUID();\r\n } while (hasOwn.call(keys, key));\r\n keys[key] = true;\r\n return key;\r\n }\r\n function GetOrCreateWeakMapTable(target, create) {\r\n if (!hasOwn.call(target, rootKey)) {\r\n if (!create) {\r\n return undefined;\r\n }\r\n Object.defineProperty(target, rootKey, { value: Object.create(null) });\r\n }\r\n return target[rootKey];\r\n }\r\n return WeakMap;\r\n }\r\n // hook global Reflect\r\n (function (__global) {\r\n if (typeof __global.Reflect !== \"undefined\") {\r\n if (__global.Reflect !== Reflect) {\r\n for (var p in Reflect) {\r\n __global.Reflect[p] = Reflect[p];\r\n }\r\n }\r\n }\r\n else {\r\n __global.Reflect = Reflect;\r\n }\r\n })(typeof window !== \"undefined\" ? window :\r\n typeof WorkerGlobalScope !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n Function(\"return this;\")());\r\n})(Reflect || (Reflect = {}));\r\n//# sourceMappingURL=Reflect.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/reflect-metadata/Reflect.js\n ** module id = 14\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/reflect-metadata/Reflect.js?"); - -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var rng = __webpack_require__(20)\n\nfunction error () {\n var m = [].slice.call(arguments).join(' ')\n throw new Error([\n m,\n 'we accept pull requests',\n 'http://github.com/dominictarr/crypto-browserify'\n ].join('\\n'))\n}\n\nexports.createHash = __webpack_require__(22)\n\nexports.createHmac = __webpack_require__(35)\n\nexports.randomBytes = function(size, callback) {\n if (callback && callback.call) {\n try {\n callback.call(this, undefined, new Buffer(rng(size)))\n } catch (err) { callback(err) }\n } else {\n return new Buffer(rng(size))\n }\n}\n\nfunction each(a, f) {\n for(var i in a)\n f(a[i], i)\n}\n\nexports.getHashes = function () {\n return ['sha1', 'sha256', 'sha512', 'md5', 'rmd160']\n}\n\nvar p = __webpack_require__(36)(exports)\nexports.pbkdf2 = p.pbkdf2\nexports.pbkdf2Sync = p.pbkdf2Sync\n\n\n// the least I can do is make error messages for the rest of the node.js/crypto api.\neach(['createCredentials'\n, 'createCipher'\n, 'createCipheriv'\n, 'createDecipher'\n, 'createDecipheriv'\n, 'createSign'\n, 'createVerify'\n, 'createDiffieHellman'\n], function (name) {\n exports[name] = function () {\n error('sorry,', name, 'is not implemented yet')\n }\n})\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/index.js\n ** module id = 15\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/index.js?"); - -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\nvar base64 = __webpack_require__(17)\nvar ieee754 = __webpack_require__(18)\nvar isArray = __webpack_require__(19)\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\nBuffer.poolSize = 8192 // not used by this implementation\n\nvar rootParent = {}\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property\n * on objects.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = (function () {\n function Bar () {}\n try {\n var arr = new Uint8Array(1)\n arr.foo = function () { return 42 }\n arr.constructor = Bar\n return arr.foo() === 42 && // typed array instances can be augmented\n arr.constructor === Bar && // constructor can be set\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n})()\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\n/**\n * Class: Buffer\n * =============\n *\n * The Buffer constructor returns instances of `Uint8Array` that are augmented\n * with function properties for all the node `Buffer` API functions. We use\n * `Uint8Array` so that square bracket notation works as expected -- it returns\n * a single octet.\n *\n * By augmenting the instances, we can avoid modifying the `Uint8Array`\n * prototype.\n */\nfunction Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}\n\nfunction fromNumber (that, length) {\n that = allocate(that, length < 0 ? 0 : checked(length) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < length; i++) {\n that[i] = 0\n }\n }\n return that\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'\n\n // Assumption: byteLength() return value is always < kMaxLength.\n var length = byteLength(string, encoding) | 0\n that = allocate(that, length)\n\n that.write(string, encoding)\n return that\n}\n\nfunction fromObject (that, object) {\n if (Buffer.isBuffer(object)) return fromBuffer(that, object)\n\n if (isArray(object)) return fromArray(that, object)\n\n if (object == null) {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (typeof ArrayBuffer !== 'undefined') {\n if (object.buffer instanceof ArrayBuffer) {\n return fromTypedArray(that, object)\n }\n if (object instanceof ArrayBuffer) {\n return fromArrayBuffer(that, object)\n }\n }\n\n if (object.length) return fromArrayLike(that, object)\n\n return fromJsonObject(that, object)\n}\n\nfunction fromBuffer (that, buffer) {\n var length = checked(buffer.length) | 0\n that = allocate(that, length)\n buffer.copy(that, 0, 0, length)\n return that\n}\n\nfunction fromArray (that, array) {\n var length = checked(array.length) | 0\n that = allocate(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\n// Duplicate of fromArray() to keep fromArray() monomorphic.\nfunction fromTypedArray (that, array) {\n var length = checked(array.length) | 0\n that = allocate(that, length)\n // Truncating the elements is probably not what people expect from typed\n // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior\n // of the old Buffer constructor.\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array) {\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n array.byteLength\n that = Buffer._augment(new Uint8Array(array))\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromTypedArray(that, new Uint8Array(array))\n }\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = checked(array.length) | 0\n that = allocate(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\n// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.\n// Returns a zero-length buffer for inputs that don't conform to the spec.\nfunction fromJsonObject (that, object) {\n var array\n var length = 0\n\n if (object.type === 'Buffer' && isArray(object.data)) {\n array = object.data\n length = checked(array.length) | 0\n }\n that = allocate(that, length)\n\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction allocate (that, length) {\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = Buffer._augment(new Uint8Array(length))\n } else {\n // Fallback: Return an object instance of the Buffer class\n that.length = length\n that._isBuffer = true\n }\n\n var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1\n if (fromPool) that.parent = rootParent\n\n return that\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (subject, encoding) {\n if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)\n\n var buf = new Buffer(subject, encoding)\n delete buf.parent\n return buf\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n var i = 0\n var len = Math.min(x, y)\n while (i < len) {\n if (a[i] !== b[i]) break\n\n ++i\n }\n\n if (i !== len) {\n x = a[i]\n y = b[i]\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'binary':\n case 'base64':\n case 'raw':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.')\n\n if (list.length === 0) {\n return new Buffer(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; i++) {\n length += list[i].length\n }\n }\n\n var buf = new Buffer(length)\n var pos = 0\n for (i = 0; i < list.length; i++) {\n var item = list[i]\n item.copy(buf, pos)\n pos += item.length\n }\n return buf\n}\n\nfunction byteLength (string, encoding) {\n if (typeof string !== 'string') string = '' + string\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'binary':\n // Deprecated\n case 'raw':\n case 'raws':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\n// pre-set for values that may exist in the future\nBuffer.prototype.length = undefined\nBuffer.prototype.parent = undefined\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n start = start | 0\n end = end === undefined || end === Infinity ? this.length : end | 0\n\n if (!encoding) encoding = 'utf8'\n if (start < 0) start = 0\n if (end > this.length) end = this.length\n if (end <= start) return ''\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'binary':\n return binarySlice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return 0\n return Buffer.compare(this, b)\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset) {\n if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff\n else if (byteOffset < -0x80000000) byteOffset = -0x80000000\n byteOffset >>= 0\n\n if (this.length === 0) return -1\n if (byteOffset >= this.length) return -1\n\n // Negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)\n\n if (typeof val === 'string') {\n if (val.length === 0) return -1 // special case: looking for empty string always fails\n return String.prototype.indexOf.call(this, val, byteOffset)\n }\n if (Buffer.isBuffer(val)) {\n return arrayIndexOf(this, val, byteOffset)\n }\n if (typeof val === 'number') {\n if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {\n return Uint8Array.prototype.indexOf.call(this, val, byteOffset)\n }\n return arrayIndexOf(this, [ val ], byteOffset)\n }\n\n function arrayIndexOf (arr, val, byteOffset) {\n var foundIndex = -1\n for (var i = 0; byteOffset + i < arr.length; i++) {\n if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex\n } else {\n foundIndex = -1\n }\n }\n return -1\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\n// `get` is deprecated\nBuffer.prototype.get = function get (offset) {\n console.log('.get() is deprecated. Access using array indexes instead.')\n return this.readUInt8(offset)\n}\n\n// `set` is deprecated\nBuffer.prototype.set = function set (v, offset) {\n console.log('.set() is deprecated. Access using array indexes instead.')\n return this.writeUInt8(v, offset)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new Error('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; i++) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) throw new Error('Invalid hex string')\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction binaryWrite (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n var swap = encoding\n encoding = offset\n offset = length | 0\n length = swap\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'binary':\n return binaryWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n var res = ''\n var tmp = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; i++) {\n if (buf[i] <= 0x7F) {\n res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])\n tmp = ''\n } else {\n tmp += '%' + buf[i].toString(16)\n }\n }\n\n return res + decodeUtf8Char(tmp)\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; i++) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction binarySlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; i++) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; i++) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = Buffer._augment(this.subarray(start, end))\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; i++) {\n newBuf[i] = this[i + start]\n }\n }\n\n if (newBuf.length) newBuf.parent = this.parent || this\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('value is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = value\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = value\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = value\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = value\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = value < 0 ? 1 : 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = value < 0 ? 1 : 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = value\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = value\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = value\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (value > max || value < min) throw new RangeError('value is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('index out of range')\n if (offset < 0) throw new RangeError('index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; i--) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; i++) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n target._set(this.subarray(start, start + len), targetStart)\n }\n\n return len\n}\n\n// fill(value, start=0, end=buffer.length)\nBuffer.prototype.fill = function fill (value, start, end) {\n if (!value) value = 0\n if (!start) start = 0\n if (!end) end = this.length\n\n if (end < start) throw new RangeError('end < start')\n\n // Fill 0 bytes; we're done\n if (end === start) return\n if (this.length === 0) return\n\n if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')\n if (end < 0 || end > this.length) throw new RangeError('end out of bounds')\n\n var i\n if (typeof value === 'number') {\n for (i = start; i < end; i++) {\n this[i] = value\n }\n } else {\n var bytes = utf8ToBytes(value.toString())\n var len = bytes.length\n for (i = start; i < end; i++) {\n this[i] = bytes[i % len]\n }\n }\n\n return this\n}\n\n/**\n * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.\n * Added in Node 0.12. Only available in browsers that support ArrayBuffer.\n */\nBuffer.prototype.toArrayBuffer = function toArrayBuffer () {\n if (typeof Uint8Array !== 'undefined') {\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n return (new Buffer(this)).buffer\n } else {\n var buf = new Uint8Array(this.length)\n for (var i = 0, len = buf.length; i < len; i += 1) {\n buf[i] = this[i]\n }\n return buf.buffer\n }\n } else {\n throw new TypeError('Buffer.toArrayBuffer not supported in this browser')\n }\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar BP = Buffer.prototype\n\n/**\n * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods\n */\nBuffer._augment = function _augment (arr) {\n arr.constructor = Buffer\n arr._isBuffer = true\n\n // save reference to original Uint8Array set method before overwriting\n arr._set = arr.set\n\n // deprecated\n arr.get = BP.get\n arr.set = BP.set\n\n arr.write = BP.write\n arr.toString = BP.toString\n arr.toLocaleString = BP.toString\n arr.toJSON = BP.toJSON\n arr.equals = BP.equals\n arr.compare = BP.compare\n arr.indexOf = BP.indexOf\n arr.copy = BP.copy\n arr.slice = BP.slice\n arr.readUIntLE = BP.readUIntLE\n arr.readUIntBE = BP.readUIntBE\n arr.readUInt8 = BP.readUInt8\n arr.readUInt16LE = BP.readUInt16LE\n arr.readUInt16BE = BP.readUInt16BE\n arr.readUInt32LE = BP.readUInt32LE\n arr.readUInt32BE = BP.readUInt32BE\n arr.readIntLE = BP.readIntLE\n arr.readIntBE = BP.readIntBE\n arr.readInt8 = BP.readInt8\n arr.readInt16LE = BP.readInt16LE\n arr.readInt16BE = BP.readInt16BE\n arr.readInt32LE = BP.readInt32LE\n arr.readInt32BE = BP.readInt32BE\n arr.readFloatLE = BP.readFloatLE\n arr.readFloatBE = BP.readFloatBE\n arr.readDoubleLE = BP.readDoubleLE\n arr.readDoubleBE = BP.readDoubleBE\n arr.writeUInt8 = BP.writeUInt8\n arr.writeUIntLE = BP.writeUIntLE\n arr.writeUIntBE = BP.writeUIntBE\n arr.writeUInt16LE = BP.writeUInt16LE\n arr.writeUInt16BE = BP.writeUInt16BE\n arr.writeUInt32LE = BP.writeUInt32LE\n arr.writeUInt32BE = BP.writeUInt32BE\n arr.writeIntLE = BP.writeIntLE\n arr.writeIntBE = BP.writeIntBE\n arr.writeInt8 = BP.writeInt8\n arr.writeInt16LE = BP.writeInt16LE\n arr.writeInt16BE = BP.writeInt16BE\n arr.writeInt32LE = BP.writeInt32LE\n arr.writeInt32BE = BP.writeInt32BE\n arr.writeFloatLE = BP.writeFloatLE\n arr.writeFloatBE = BP.writeFloatBE\n arr.writeDoubleLE = BP.writeDoubleLE\n arr.writeDoubleBE = BP.writeDoubleBE\n arr.fill = BP.fill\n arr.inspect = BP.inspect\n arr.toArrayBuffer = BP.toArrayBuffer\n\n return arr\n}\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n var i = 0\n\n for (; i < length; i++) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (leadSurrogate) {\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n } else {\n // valid surrogate pair\n codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000\n leadSurrogate = null\n }\n } else {\n // no lead yet\n\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else {\n // valid lead\n leadSurrogate = codePoint\n continue\n }\n }\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = null\n }\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x200000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; i++) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; i++) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; i++) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction decodeUtf8Char (str) {\n try {\n return decodeURIComponent(str)\n } catch (err) {\n return String.fromCharCode(0xFFFD) // UTF 8 invalid char\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/buffer/index.js\n ** module id = 16\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/buffer/index.js?"); - -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { - - eval("var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n;(function (exports) {\n\t'use strict';\n\n var Arr = (typeof Uint8Array !== 'undefined')\n ? Uint8Array\n : Array\n\n\tvar PLUS = '+'.charCodeAt(0)\n\tvar SLASH = '/'.charCodeAt(0)\n\tvar NUMBER = '0'.charCodeAt(0)\n\tvar LOWER = 'a'.charCodeAt(0)\n\tvar UPPER = 'A'.charCodeAt(0)\n\tvar PLUS_URL_SAFE = '-'.charCodeAt(0)\n\tvar SLASH_URL_SAFE = '_'.charCodeAt(0)\n\n\tfunction decode (elt) {\n\t\tvar code = elt.charCodeAt(0)\n\t\tif (code === PLUS ||\n\t\t code === PLUS_URL_SAFE)\n\t\t\treturn 62 // '+'\n\t\tif (code === SLASH ||\n\t\t code === SLASH_URL_SAFE)\n\t\t\treturn 63 // '/'\n\t\tif (code < NUMBER)\n\t\t\treturn -1 //no match\n\t\tif (code < NUMBER + 10)\n\t\t\treturn code - NUMBER + 26 + 26\n\t\tif (code < UPPER + 26)\n\t\t\treturn code - UPPER\n\t\tif (code < LOWER + 26)\n\t\t\treturn code - LOWER + 26\n\t}\n\n\tfunction b64ToByteArray (b64) {\n\t\tvar i, j, l, tmp, placeHolders, arr\n\n\t\tif (b64.length % 4 > 0) {\n\t\t\tthrow new Error('Invalid string. Length must be a multiple of 4')\n\t\t}\n\n\t\t// the number of equal signs (place holders)\n\t\t// if there are two placeholders, than the two characters before it\n\t\t// represent one byte\n\t\t// if there is only one, then the three characters before it represent 2 bytes\n\t\t// this is just a cheap hack to not do indexOf twice\n\t\tvar len = b64.length\n\t\tplaceHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0\n\n\t\t// base64 is 4/3 + up to two characters of the original data\n\t\tarr = new Arr(b64.length * 3 / 4 - placeHolders)\n\n\t\t// if there are placeholders, only get up to the last complete 4 chars\n\t\tl = placeHolders > 0 ? b64.length - 4 : b64.length\n\n\t\tvar L = 0\n\n\t\tfunction push (v) {\n\t\t\tarr[L++] = v\n\t\t}\n\n\t\tfor (i = 0, j = 0; i < l; i += 4, j += 3) {\n\t\t\ttmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))\n\t\t\tpush((tmp & 0xFF0000) >> 16)\n\t\t\tpush((tmp & 0xFF00) >> 8)\n\t\t\tpush(tmp & 0xFF)\n\t\t}\n\n\t\tif (placeHolders === 2) {\n\t\t\ttmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)\n\t\t\tpush(tmp & 0xFF)\n\t\t} else if (placeHolders === 1) {\n\t\t\ttmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)\n\t\t\tpush((tmp >> 8) & 0xFF)\n\t\t\tpush(tmp & 0xFF)\n\t\t}\n\n\t\treturn arr\n\t}\n\n\tfunction uint8ToBase64 (uint8) {\n\t\tvar i,\n\t\t\textraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes\n\t\t\toutput = \"\",\n\t\t\ttemp, length\n\n\t\tfunction encode (num) {\n\t\t\treturn lookup.charAt(num)\n\t\t}\n\n\t\tfunction tripletToBase64 (num) {\n\t\t\treturn encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)\n\t\t}\n\n\t\t// go through the array every three bytes, we'll deal with trailing stuff later\n\t\tfor (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {\n\t\t\ttemp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n\t\t\toutput += tripletToBase64(temp)\n\t\t}\n\n\t\t// pad the end with zeros, but make sure to not forget the extra bytes\n\t\tswitch (extraBytes) {\n\t\t\tcase 1:\n\t\t\t\ttemp = uint8[uint8.length - 1]\n\t\t\t\toutput += encode(temp >> 2)\n\t\t\t\toutput += encode((temp << 4) & 0x3F)\n\t\t\t\toutput += '=='\n\t\t\t\tbreak\n\t\t\tcase 2:\n\t\t\t\ttemp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])\n\t\t\t\toutput += encode(temp >> 10)\n\t\t\t\toutput += encode((temp >> 4) & 0x3F)\n\t\t\t\toutput += encode((temp << 2) & 0x3F)\n\t\t\t\toutput += '='\n\t\t\t\tbreak\n\t\t}\n\n\t\treturn output\n\t}\n\n\texports.toByteArray = b64ToByteArray\n\texports.fromByteArray = uint8ToBase64\n}( false ? (this.base64js = {}) : exports))\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/buffer/~/base64-js/lib/b64.js\n ** module id = 17\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/buffer/~/base64-js/lib/b64.js?"); - -/***/ }, -/* 18 */ -/***/ function(module, exports) { - - eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/buffer/~/ieee754/index.js\n ** module id = 18\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/buffer/~/ieee754/index.js?"); - -/***/ }, -/* 19 */ -/***/ function(module, exports) { - - eval("\n/**\n * isArray\n */\n\nvar isArray = Array.isArray;\n\n/**\n * toString\n */\n\nvar str = Object.prototype.toString;\n\n/**\n * Whether or not the given `val`\n * is an array.\n *\n * example:\n *\n * isArray([]);\n * // > true\n * isArray(arguments);\n * // > false\n * isArray('');\n * // > false\n *\n * @param {mixed} val\n * @return {bool}\n */\n\nmodule.exports = isArray || function (val) {\n return !! val && '[object Array]' == str.call(val);\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/buffer/~/is-array/index.js\n ** module id = 19\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/buffer/~/is-array/index.js?"); - -/***/ }, -/* 20 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global, Buffer) {(function() {\n var g = ('undefined' === typeof window ? global : window) || {}\n _crypto = (\n g.crypto || g.msCrypto || __webpack_require__(21)\n )\n module.exports = function(size) {\n // Modern Browsers\n if(_crypto.getRandomValues) {\n var bytes = new Buffer(size); //in browserify, this is an extended Uint8Array\n /* This will not work in older browsers.\n * See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n */\n \n _crypto.getRandomValues(bytes);\n return bytes;\n }\n else if (_crypto.randomBytes) {\n return _crypto.randomBytes(size)\n }\n else\n throw new Error(\n 'secure random number generation not supported by this browser\\n'+\n 'use chrome, FireFox or Internet Explorer 11'\n )\n }\n}())\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(16).Buffer))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/rng.js\n ** module id = 20\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/rng.js?"); - -/***/ }, -/* 21 */ -/***/ function(module, exports) { - - eval("/* (ignored) */\n\n/*****************\n ** WEBPACK FOOTER\n ** crypto (ignored)\n ** module id = 21\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///crypto_(ignored)?"); - -/***/ }, -/* 22 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(23)\n\nvar md5 = toConstructor(__webpack_require__(32))\nvar rmd160 = toConstructor(__webpack_require__(34))\n\nfunction toConstructor (fn) {\n return function () {\n var buffers = []\n var m= {\n update: function (data, enc) {\n if(!Buffer.isBuffer(data)) data = new Buffer(data, enc)\n buffers.push(data)\n return this\n },\n digest: function (enc) {\n var buf = Buffer.concat(buffers)\n var r = fn(buf)\n buffers = null\n return enc ? r.toString(enc) : r\n }\n }\n return m\n }\n}\n\nmodule.exports = function (alg) {\n if('md5' === alg) return new md5()\n if('rmd160' === alg) return new rmd160()\n return createHash(alg)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/create-hash.js\n ** module id = 22\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/create-hash.js?"); - -/***/ }, -/* 23 */ -/***/ function(module, exports, __webpack_require__) { - - eval("var exports = module.exports = function (alg) {\n var Alg = exports[alg]\n if(!Alg) throw new Error(alg + ' is not supported (we accept pull requests)')\n return new Alg()\n}\n\nvar Buffer = __webpack_require__(16).Buffer\nvar Hash = __webpack_require__(24)(Buffer)\n\nexports.sha1 = __webpack_require__(25)(Buffer, Hash)\nexports.sha256 = __webpack_require__(30)(Buffer, Hash)\nexports.sha512 = __webpack_require__(31)(Buffer, Hash)\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/~/sha.js/index.js\n ** module id = 23\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/~/sha.js/index.js?"); - -/***/ }, -/* 24 */ -/***/ function(module, exports) { - - eval("module.exports = function (Buffer) {\n\n //prototype class for hash functions\n function Hash (blockSize, finalSize) {\n this._block = new Buffer(blockSize) //new Uint32Array(blockSize/4)\n this._finalSize = finalSize\n this._blockSize = blockSize\n this._len = 0\n this._s = 0\n }\n\n Hash.prototype.init = function () {\n this._s = 0\n this._len = 0\n }\n\n Hash.prototype.update = function (data, enc) {\n if (\"string\" === typeof data) {\n enc = enc || \"utf8\"\n data = new Buffer(data, enc)\n }\n\n var l = this._len += data.length\n var s = this._s = (this._s || 0)\n var f = 0\n var buffer = this._block\n\n while (s < l) {\n var t = Math.min(data.length, f + this._blockSize - (s % this._blockSize))\n var ch = (t - f)\n\n for (var i = 0; i < ch; i++) {\n buffer[(s % this._blockSize) + i] = data[i + f]\n }\n\n s += ch\n f += ch\n\n if ((s % this._blockSize) === 0) {\n this._update(buffer)\n }\n }\n this._s = s\n\n return this\n }\n\n Hash.prototype.digest = function (enc) {\n // Suppose the length of the message M, in bits, is l\n var l = this._len * 8\n\n // Append the bit 1 to the end of the message\n this._block[this._len % this._blockSize] = 0x80\n\n // and then k zero bits, where k is the smallest non-negative solution to the equation (l + 1 + k) === finalSize mod blockSize\n this._block.fill(0, this._len % this._blockSize + 1)\n\n if (l % (this._blockSize * 8) >= this._finalSize * 8) {\n this._update(this._block)\n this._block.fill(0)\n }\n\n // to this append the block which is equal to the number l written in binary\n // TODO: handle case where l is > Math.pow(2, 29)\n this._block.writeInt32BE(l, this._blockSize - 4)\n\n var hash = this._update(this._block) || this._hash()\n\n return enc ? hash.toString(enc) : hash\n }\n\n Hash.prototype._update = function () {\n throw new Error('_update must be implemented by subclass')\n }\n\n return Hash\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/~/sha.js/hash.js\n ** module id = 24\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/~/sha.js/hash.js?"); - -/***/ }, -/* 25 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar inherits = __webpack_require__(26).inherits\n\nmodule.exports = function (Buffer, Hash) {\n\n var A = 0|0\n var B = 4|0\n var C = 8|0\n var D = 12|0\n var E = 16|0\n\n var W = new (typeof Int32Array === 'undefined' ? Array : Int32Array)(80)\n\n var POOL = []\n\n function Sha1 () {\n if(POOL.length)\n return POOL.pop().init()\n\n if(!(this instanceof Sha1)) return new Sha1()\n this._w = W\n Hash.call(this, 16*4, 14*4)\n\n this._h = null\n this.init()\n }\n\n inherits(Sha1, Hash)\n\n Sha1.prototype.init = function () {\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n this._e = 0xc3d2e1f0\n\n Hash.prototype.init.call(this)\n return this\n }\n\n Sha1.prototype._POOL = POOL\n Sha1.prototype._update = function (X) {\n\n var a, b, c, d, e, _a, _b, _c, _d, _e\n\n a = _a = this._a\n b = _b = this._b\n c = _c = this._c\n d = _d = this._d\n e = _e = this._e\n\n var w = this._w\n\n for(var j = 0; j < 80; j++) {\n var W = w[j] = j < 16 ? X.readInt32BE(j*4)\n : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1)\n\n var t = add(\n add(rol(a, 5), sha1_ft(j, b, c, d)),\n add(add(e, W), sha1_kt(j))\n )\n\n e = d\n d = c\n c = rol(b, 30)\n b = a\n a = t\n }\n\n this._a = add(a, _a)\n this._b = add(b, _b)\n this._c = add(c, _c)\n this._d = add(d, _d)\n this._e = add(e, _e)\n }\n\n Sha1.prototype._hash = function () {\n if(POOL.length < 100) POOL.push(this)\n var H = new Buffer(20)\n //console.log(this._a|0, this._b|0, this._c|0, this._d|0, this._e|0)\n H.writeInt32BE(this._a|0, A)\n H.writeInt32BE(this._b|0, B)\n H.writeInt32BE(this._c|0, C)\n H.writeInt32BE(this._d|0, D)\n H.writeInt32BE(this._e|0, E)\n return H\n }\n\n /*\n * Perform the appropriate triplet combination function for the current\n * iteration\n */\n function sha1_ft(t, b, c, d) {\n if(t < 20) return (b & c) | ((~b) & d);\n if(t < 40) return b ^ c ^ d;\n if(t < 60) return (b & c) | (b & d) | (c & d);\n return b ^ c ^ d;\n }\n\n /*\n * Determine the appropriate additive constant for the current iteration\n */\n function sha1_kt(t) {\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n }\n\n /*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n * //dominictarr: this is 10 years old, so maybe this can be dropped?)\n *\n */\n function add(x, y) {\n return (x + y ) | 0\n //lets see how this goes on testling.\n // var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n // return (msw << 16) | (lsw & 0xFFFF);\n }\n\n /*\n * Bitwise rotate a 32-bit number to the left.\n */\n function rol(num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt));\n }\n\n return Sha1\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/~/sha.js/sha1.js\n ** module id = 25\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/~/sha.js/sha1.js?"); - -/***/ }, -/* 26 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = __webpack_require__(28);\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = __webpack_require__(29);\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(27)))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/util/util.js\n ** module id = 26\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/util/util.js?"); - -/***/ }, -/* 27 */ -/***/ function(module, exports) { - - eval("// shim for using process in browser\n\nvar process = module.exports = {};\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = setTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n currentQueue[queueIndex].run();\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n clearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n setTimeout(drainQueue, 0);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\n// TODO(shtylman)\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/process/browser.js\n ** module id = 27\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/process/browser.js?"); - -/***/ }, -/* 28 */ -/***/ function(module, exports) { - - eval("module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/util/support/isBufferBrowser.js\n ** module id = 28\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/util/support/isBufferBrowser.js?"); - -/***/ }, -/* 29 */ -/***/ function(module, exports) { - - eval("if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/util/~/inherits/inherits_browser.js\n ** module id = 29\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/util/~/inherits/inherits_browser.js?"); - -/***/ }, -/* 30 */ -/***/ function(module, exports, __webpack_require__) { - - eval("\n/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = __webpack_require__(26).inherits\n\nmodule.exports = function (Buffer, Hash) {\n\n var K = [\n 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n ]\n\n var W = new Array(64)\n\n function Sha256() {\n this.init()\n\n this._w = W //new Array(64)\n\n Hash.call(this, 16*4, 14*4)\n }\n\n inherits(Sha256, Hash)\n\n Sha256.prototype.init = function () {\n\n this._a = 0x6a09e667|0\n this._b = 0xbb67ae85|0\n this._c = 0x3c6ef372|0\n this._d = 0xa54ff53a|0\n this._e = 0x510e527f|0\n this._f = 0x9b05688c|0\n this._g = 0x1f83d9ab|0\n this._h = 0x5be0cd19|0\n\n this._len = this._s = 0\n\n return this\n }\n\n function S (X, n) {\n return (X >>> n) | (X << (32 - n));\n }\n\n function R (X, n) {\n return (X >>> n);\n }\n\n function Ch (x, y, z) {\n return ((x & y) ^ ((~x) & z));\n }\n\n function Maj (x, y, z) {\n return ((x & y) ^ (x & z) ^ (y & z));\n }\n\n function Sigma0256 (x) {\n return (S(x, 2) ^ S(x, 13) ^ S(x, 22));\n }\n\n function Sigma1256 (x) {\n return (S(x, 6) ^ S(x, 11) ^ S(x, 25));\n }\n\n function Gamma0256 (x) {\n return (S(x, 7) ^ S(x, 18) ^ R(x, 3));\n }\n\n function Gamma1256 (x) {\n return (S(x, 17) ^ S(x, 19) ^ R(x, 10));\n }\n\n Sha256.prototype._update = function(M) {\n\n var W = this._w\n var a, b, c, d, e, f, g, h\n var T1, T2\n\n a = this._a | 0\n b = this._b | 0\n c = this._c | 0\n d = this._d | 0\n e = this._e | 0\n f = this._f | 0\n g = this._g | 0\n h = this._h | 0\n\n for (var j = 0; j < 64; j++) {\n var w = W[j] = j < 16\n ? M.readInt32BE(j * 4)\n : Gamma1256(W[j - 2]) + W[j - 7] + Gamma0256(W[j - 15]) + W[j - 16]\n\n T1 = h + Sigma1256(e) + Ch(e, f, g) + K[j] + w\n\n T2 = Sigma0256(a) + Maj(a, b, c);\n h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2;\n }\n\n this._a = (a + this._a) | 0\n this._b = (b + this._b) | 0\n this._c = (c + this._c) | 0\n this._d = (d + this._d) | 0\n this._e = (e + this._e) | 0\n this._f = (f + this._f) | 0\n this._g = (g + this._g) | 0\n this._h = (h + this._h) | 0\n\n };\n\n Sha256.prototype._hash = function () {\n var H = new Buffer(32)\n\n H.writeInt32BE(this._a, 0)\n H.writeInt32BE(this._b, 4)\n H.writeInt32BE(this._c, 8)\n H.writeInt32BE(this._d, 12)\n H.writeInt32BE(this._e, 16)\n H.writeInt32BE(this._f, 20)\n H.writeInt32BE(this._g, 24)\n H.writeInt32BE(this._h, 28)\n\n return H\n }\n\n return Sha256\n\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/~/sha.js/sha256.js\n ** module id = 30\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/~/sha.js/sha256.js?"); - -/***/ }, -/* 31 */ -/***/ function(module, exports, __webpack_require__) { - - eval("var inherits = __webpack_require__(26).inherits\n\nmodule.exports = function (Buffer, Hash) {\n var K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n ]\n\n var W = new Array(160)\n\n function Sha512() {\n this.init()\n this._w = W\n\n Hash.call(this, 128, 112)\n }\n\n inherits(Sha512, Hash)\n\n Sha512.prototype.init = function () {\n\n this._a = 0x6a09e667|0\n this._b = 0xbb67ae85|0\n this._c = 0x3c6ef372|0\n this._d = 0xa54ff53a|0\n this._e = 0x510e527f|0\n this._f = 0x9b05688c|0\n this._g = 0x1f83d9ab|0\n this._h = 0x5be0cd19|0\n\n this._al = 0xf3bcc908|0\n this._bl = 0x84caa73b|0\n this._cl = 0xfe94f82b|0\n this._dl = 0x5f1d36f1|0\n this._el = 0xade682d1|0\n this._fl = 0x2b3e6c1f|0\n this._gl = 0xfb41bd6b|0\n this._hl = 0x137e2179|0\n\n this._len = this._s = 0\n\n return this\n }\n\n function S (X, Xl, n) {\n return (X >>> n) | (Xl << (32 - n))\n }\n\n function Ch (x, y, z) {\n return ((x & y) ^ ((~x) & z));\n }\n\n function Maj (x, y, z) {\n return ((x & y) ^ (x & z) ^ (y & z));\n }\n\n Sha512.prototype._update = function(M) {\n\n var W = this._w\n var a, b, c, d, e, f, g, h\n var al, bl, cl, dl, el, fl, gl, hl\n\n a = this._a | 0\n b = this._b | 0\n c = this._c | 0\n d = this._d | 0\n e = this._e | 0\n f = this._f | 0\n g = this._g | 0\n h = this._h | 0\n\n al = this._al | 0\n bl = this._bl | 0\n cl = this._cl | 0\n dl = this._dl | 0\n el = this._el | 0\n fl = this._fl | 0\n gl = this._gl | 0\n hl = this._hl | 0\n\n for (var i = 0; i < 80; i++) {\n var j = i * 2\n\n var Wi, Wil\n\n if (i < 16) {\n Wi = W[j] = M.readInt32BE(j * 4)\n Wil = W[j + 1] = M.readInt32BE(j * 4 + 4)\n\n } else {\n var x = W[j - 15*2]\n var xl = W[j - 15*2 + 1]\n var gamma0 = S(x, xl, 1) ^ S(x, xl, 8) ^ (x >>> 7)\n var gamma0l = S(xl, x, 1) ^ S(xl, x, 8) ^ S(xl, x, 7)\n\n x = W[j - 2*2]\n xl = W[j - 2*2 + 1]\n var gamma1 = S(x, xl, 19) ^ S(xl, x, 29) ^ (x >>> 6)\n var gamma1l = S(xl, x, 19) ^ S(x, xl, 29) ^ S(xl, x, 6)\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n var Wi7 = W[j - 7*2]\n var Wi7l = W[j - 7*2 + 1]\n\n var Wi16 = W[j - 16*2]\n var Wi16l = W[j - 16*2 + 1]\n\n Wil = gamma0l + Wi7l\n Wi = gamma0 + Wi7 + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0)\n Wil = Wil + gamma1l\n Wi = Wi + gamma1 + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0)\n Wil = Wil + Wi16l\n Wi = Wi + Wi16 + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0)\n\n W[j] = Wi\n W[j + 1] = Wil\n }\n\n var maj = Maj(a, b, c)\n var majl = Maj(al, bl, cl)\n\n var sigma0h = S(a, al, 28) ^ S(al, a, 2) ^ S(al, a, 7)\n var sigma0l = S(al, a, 28) ^ S(a, al, 2) ^ S(a, al, 7)\n var sigma1h = S(e, el, 14) ^ S(e, el, 18) ^ S(el, e, 9)\n var sigma1l = S(el, e, 14) ^ S(el, e, 18) ^ S(e, el, 9)\n\n // t1 = h + sigma1 + ch + K[i] + W[i]\n var Ki = K[j]\n var Kil = K[j + 1]\n\n var ch = Ch(e, f, g)\n var chl = Ch(el, fl, gl)\n\n var t1l = hl + sigma1l\n var t1 = h + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0)\n t1l = t1l + chl\n t1 = t1 + ch + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0)\n t1l = t1l + Kil\n t1 = t1 + Ki + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0)\n t1l = t1l + Wil\n t1 = t1 + Wi + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0)\n\n // t2 = sigma0 + maj\n var t2l = sigma0l + majl\n var t2 = sigma0h + maj + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0)\n\n h = g\n hl = gl\n g = f\n gl = fl\n f = e\n fl = el\n el = (dl + t1l) | 0\n e = (d + t1 + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0\n d = c\n dl = cl\n c = b\n cl = bl\n b = a\n bl = al\n al = (t1l + t2l) | 0\n a = (t1 + t2 + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0\n }\n\n this._al = (this._al + al) | 0\n this._bl = (this._bl + bl) | 0\n this._cl = (this._cl + cl) | 0\n this._dl = (this._dl + dl) | 0\n this._el = (this._el + el) | 0\n this._fl = (this._fl + fl) | 0\n this._gl = (this._gl + gl) | 0\n this._hl = (this._hl + hl) | 0\n\n this._a = (this._a + a + ((this._al >>> 0) < (al >>> 0) ? 1 : 0)) | 0\n this._b = (this._b + b + ((this._bl >>> 0) < (bl >>> 0) ? 1 : 0)) | 0\n this._c = (this._c + c + ((this._cl >>> 0) < (cl >>> 0) ? 1 : 0)) | 0\n this._d = (this._d + d + ((this._dl >>> 0) < (dl >>> 0) ? 1 : 0)) | 0\n this._e = (this._e + e + ((this._el >>> 0) < (el >>> 0) ? 1 : 0)) | 0\n this._f = (this._f + f + ((this._fl >>> 0) < (fl >>> 0) ? 1 : 0)) | 0\n this._g = (this._g + g + ((this._gl >>> 0) < (gl >>> 0) ? 1 : 0)) | 0\n this._h = (this._h + h + ((this._hl >>> 0) < (hl >>> 0) ? 1 : 0)) | 0\n }\n\n Sha512.prototype._hash = function () {\n var H = new Buffer(64)\n\n function writeInt64BE(h, l, offset) {\n H.writeInt32BE(h, offset)\n H.writeInt32BE(l, offset + 4)\n }\n\n writeInt64BE(this._a, this._al, 0)\n writeInt64BE(this._b, this._bl, 8)\n writeInt64BE(this._c, this._cl, 16)\n writeInt64BE(this._d, this._dl, 24)\n writeInt64BE(this._e, this._el, 32)\n writeInt64BE(this._f, this._fl, 40)\n writeInt64BE(this._g, this._gl, 48)\n writeInt64BE(this._h, this._hl, 56)\n\n return H\n }\n\n return Sha512\n\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/~/sha.js/sha512.js\n ** module id = 31\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/~/sha.js/sha512.js?"); - -/***/ }, -/* 32 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/*\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\nvar helpers = __webpack_require__(33);\n\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length\n */\nfunction core_md5(x, len)\n{\n /* append padding */\n x[len >> 5] |= 0x80 << ((len) % 32);\n x[(((len + 64) >>> 9) << 4) + 14] = len;\n\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for(var i = 0; i < x.length; i += 16)\n {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n\n a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);\n d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);\n c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);\n b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);\n a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);\n d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);\n c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);\n b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);\n a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\n d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);\n c = md5_ff(c, d, a, b, x[i+10], 17, -42063);\n b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);\n a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);\n d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);\n c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);\n b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);\n\n a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);\n d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\n c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);\n b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);\n a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);\n d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);\n c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);\n b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);\n a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);\n d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);\n c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);\n b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);\n a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);\n d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);\n c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);\n b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);\n\n a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);\n d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);\n c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);\n b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);\n a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\n d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);\n c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);\n b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);\n a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);\n d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);\n c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);\n b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);\n a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);\n d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);\n c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);\n b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);\n\n a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);\n d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);\n c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);\n b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);\n a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);\n d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);\n c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);\n b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);\n a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\n d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);\n c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);\n b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);\n a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);\n d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);\n c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);\n b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);\n\n a = safe_add(a, olda);\n b = safe_add(b, oldb);\n c = safe_add(c, oldc);\n d = safe_add(d, oldd);\n }\n return Array(a, b, c, d);\n\n}\n\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\nfunction md5_cmn(q, a, b, x, s, t)\n{\n return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);\n}\nfunction md5_ff(a, b, c, d, x, s, t)\n{\n return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);\n}\nfunction md5_gg(a, b, c, d, x, s, t)\n{\n return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);\n}\nfunction md5_hh(a, b, c, d, x, s, t)\n{\n return md5_cmn(b ^ c ^ d, a, b, x, s, t);\n}\nfunction md5_ii(a, b, c, d, x, s, t)\n{\n return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);\n}\n\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\nfunction safe_add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}\n\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\nfunction bit_rol(num, cnt)\n{\n return (num << cnt) | (num >>> (32 - cnt));\n}\n\nmodule.exports = function md5(buf) {\n return helpers.hash(buf, core_md5, 16);\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/md5.js\n ** module id = 32\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/md5.js?"); - -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var intSize = 4;\nvar zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);\nvar chrsz = 8;\n\nfunction toArray(buf, bigEndian) {\n if ((buf.length % intSize) !== 0) {\n var len = buf.length + (intSize - (buf.length % intSize));\n buf = Buffer.concat([buf, zeroBuffer], len);\n }\n\n var arr = [];\n var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;\n for (var i = 0; i < buf.length; i += intSize) {\n arr.push(fn.call(buf, i));\n }\n return arr;\n}\n\nfunction toBuffer(arr, size, bigEndian) {\n var buf = new Buffer(size);\n var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;\n for (var i = 0; i < arr.length; i++) {\n fn.call(buf, arr[i], i * 4, true);\n }\n return buf;\n}\n\nfunction hash(buf, fn, hashSize, bigEndian) {\n if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);\n var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);\n return toBuffer(arr, hashSize, bigEndian);\n}\n\nmodule.exports = { hash: hash };\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/helpers.js\n ** module id = 33\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/helpers.js?"); - -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nmodule.exports = ripemd160\n\n\n\n/*\nCryptoJS v3.1.2\ncode.google.com/p/crypto-js\n(c) 2009-2013 by Jeff Mott. All rights reserved.\ncode.google.com/p/crypto-js/wiki/License\n*/\n/** @preserve\n(c) 2012 by Cédric Mesnil. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n// Constants table\nvar zl = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13];\nvar zr = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11];\nvar sl = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ];\nvar sr = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ];\n\nvar hl = [ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E];\nvar hr = [ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000];\n\nvar bytesToWords = function (bytes) {\n var words = [];\n for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n }\n return words;\n};\n\nvar wordsToBytes = function (words) {\n var bytes = [];\n for (var b = 0; b < words.length * 32; b += 8) {\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n }\n return bytes;\n};\n\nvar processBlock = function (H, M, offset) {\n\n // Swap endian\n for (var i = 0; i < 16; i++) {\n var offset_i = offset + i;\n var M_offset_i = M[offset_i];\n\n // Swap\n M[offset_i] = (\n (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |\n (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n );\n }\n\n // Working variables\n var al, bl, cl, dl, el;\n var ar, br, cr, dr, er;\n\n ar = al = H[0];\n br = bl = H[1];\n cr = cl = H[2];\n dr = dl = H[3];\n er = el = H[4];\n // Computation\n var t;\n for (var i = 0; i < 80; i += 1) {\n t = (al + M[offset+zl[i]])|0;\n if (i<16){\n t += f1(bl,cl,dl) + hl[0];\n } else if (i<32) {\n t += f2(bl,cl,dl) + hl[1];\n } else if (i<48) {\n t += f3(bl,cl,dl) + hl[2];\n } else if (i<64) {\n t += f4(bl,cl,dl) + hl[3];\n } else {// if (i<80) {\n t += f5(bl,cl,dl) + hl[4];\n }\n t = t|0;\n t = rotl(t,sl[i]);\n t = (t+el)|0;\n al = el;\n el = dl;\n dl = rotl(cl, 10);\n cl = bl;\n bl = t;\n\n t = (ar + M[offset+zr[i]])|0;\n if (i<16){\n t += f5(br,cr,dr) + hr[0];\n } else if (i<32) {\n t += f4(br,cr,dr) + hr[1];\n } else if (i<48) {\n t += f3(br,cr,dr) + hr[2];\n } else if (i<64) {\n t += f2(br,cr,dr) + hr[3];\n } else {// if (i<80) {\n t += f1(br,cr,dr) + hr[4];\n }\n t = t|0;\n t = rotl(t,sr[i]) ;\n t = (t+er)|0;\n ar = er;\n er = dr;\n dr = rotl(cr, 10);\n cr = br;\n br = t;\n }\n // Intermediate hash value\n t = (H[1] + cl + dr)|0;\n H[1] = (H[2] + dl + er)|0;\n H[2] = (H[3] + el + ar)|0;\n H[3] = (H[4] + al + br)|0;\n H[4] = (H[0] + bl + cr)|0;\n H[0] = t;\n};\n\nfunction f1(x, y, z) {\n return ((x) ^ (y) ^ (z));\n}\n\nfunction f2(x, y, z) {\n return (((x)&(y)) | ((~x)&(z)));\n}\n\nfunction f3(x, y, z) {\n return (((x) | (~(y))) ^ (z));\n}\n\nfunction f4(x, y, z) {\n return (((x) & (z)) | ((y)&(~(z))));\n}\n\nfunction f5(x, y, z) {\n return ((x) ^ ((y) |(~(z))));\n}\n\nfunction rotl(x,n) {\n return (x<>>(32-n));\n}\n\nfunction ripemd160(message) {\n var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0];\n\n if (typeof message == 'string')\n message = new Buffer(message, 'utf8');\n\n var m = bytesToWords(message);\n\n var nBitsLeft = message.length * 8;\n var nBitsTotal = message.length * 8;\n\n // Add padding\n m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |\n (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)\n );\n\n for (var i=0 ; i>> 24)) & 0x00ff00ff) |\n (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n }\n\n var digestbytes = wordsToBytes(H);\n return new Buffer(digestbytes);\n}\n\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/~/ripemd160/lib/ripemd160.js\n ** module id = 34\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/~/ripemd160/lib/ripemd160.js?"); - -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(22)\n\nvar zeroBuffer = new Buffer(128)\nzeroBuffer.fill(0)\n\nmodule.exports = Hmac\n\nfunction Hmac (alg, key) {\n if(!(this instanceof Hmac)) return new Hmac(alg, key)\n this._opad = opad\n this._alg = alg\n\n var blocksize = (alg === 'sha512') ? 128 : 64\n\n key = this._key = !Buffer.isBuffer(key) ? new Buffer(key) : key\n\n if(key.length > blocksize) {\n key = createHash(alg).update(key).digest()\n } else if(key.length < blocksize) {\n key = Buffer.concat([key, zeroBuffer], blocksize)\n }\n\n var ipad = this._ipad = new Buffer(blocksize)\n var opad = this._opad = new Buffer(blocksize)\n\n for(var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n this._hash = createHash(alg).update(ipad)\n}\n\nHmac.prototype.update = function (data, enc) {\n this._hash.update(data, enc)\n return this\n}\n\nHmac.prototype.digest = function (enc) {\n var h = this._hash.digest()\n return createHash(this._alg).update(this._opad).update(h).digest(enc)\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/create-hmac.js\n ** module id = 35\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/create-hmac.js?"); - -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { - - eval("var pbkdf2Export = __webpack_require__(37)\n\nmodule.exports = function (crypto, exports) {\n exports = exports || {}\n\n var exported = pbkdf2Export(crypto)\n\n exports.pbkdf2 = exported.pbkdf2\n exports.pbkdf2Sync = exported.pbkdf2Sync\n\n return exports\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/pbkdf2.js\n ** module id = 36\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/pbkdf2.js?"); - -/***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { - - eval("/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function(crypto) {\n function pbkdf2(password, salt, iterations, keylen, digest, callback) {\n if ('function' === typeof digest) {\n callback = digest\n digest = undefined\n }\n\n if ('function' !== typeof callback)\n throw new Error('No callback provided to pbkdf2')\n\n setTimeout(function() {\n var result\n\n try {\n result = pbkdf2Sync(password, salt, iterations, keylen, digest)\n } catch (e) {\n return callback(e)\n }\n\n callback(undefined, result)\n })\n }\n\n function pbkdf2Sync(password, salt, iterations, keylen, digest) {\n if ('number' !== typeof iterations)\n throw new TypeError('Iterations not a number')\n\n if (iterations < 0)\n throw new TypeError('Bad iterations')\n\n if ('number' !== typeof keylen)\n throw new TypeError('Key length not a number')\n\n if (keylen < 0)\n throw new TypeError('Bad key length')\n\n digest = digest || 'sha1'\n\n if (!Buffer.isBuffer(password)) password = new Buffer(password)\n if (!Buffer.isBuffer(salt)) salt = new Buffer(salt)\n\n var hLen, l = 1, r, T\n var DK = new Buffer(keylen)\n var block1 = new Buffer(salt.length + 4)\n salt.copy(block1, 0, 0, salt.length)\n\n for (var i = 1; i <= l; i++) {\n block1.writeUInt32BE(i, salt.length)\n\n var U = crypto.createHmac(digest, password).update(block1).digest()\n\n if (!hLen) {\n hLen = U.length\n T = new Buffer(hLen)\n l = Math.ceil(keylen / hLen)\n r = keylen - (l - 1) * hLen\n\n if (keylen > (Math.pow(2, 32) - 1) * hLen)\n throw new TypeError('keylen exceeds maximum length')\n }\n\n U.copy(T, 0, 0, hLen)\n\n for (var j = 1; j < iterations; j++) {\n U = crypto.createHmac(digest, password).update(U).digest()\n\n for (var k = 0; k < hLen; k++) {\n T[k] ^= U[k]\n }\n }\n\n var destPos = (i - 1) * hLen\n var len = (i == l ? r : hLen)\n T.copy(DK, destPos, 0, len)\n }\n\n return DK\n }\n\n return {\n pbkdf2: pbkdf2,\n pbkdf2Sync: pbkdf2Sync\n }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16).Buffer))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/node-libs-browser/~/crypto-browserify/~/pbkdf2-compat/pbkdf2.js\n ** module id = 37\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/node-libs-browser/~/crypto-browserify/~/pbkdf2-compat/pbkdf2.js?"); - -/***/ }, -/* 38 */ -/***/ function(module, exports, __webpack_require__) { - - eval("'use strict';function __export(m) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n__export(__webpack_require__(39));\r\nexports.__esModule = true;\r\n//# sourceMappingURL=rtts_assert.js.map\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/rtts_assert/rtts_assert.js\n ** module id = 38\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/rtts_assert/rtts_assert.js?"); - -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { - - eval("var __WEBPACK_AMD_DEFINE_RESULT__;var __WEBPACK_AMD_DEFINE_RESULT__;var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global) {'use strict';var _global = typeof window === 'object' ? window : global;\r\n// TODO(vojta):\r\n// - extract into multiple files\r\n// - different error types\r\n// - simplify/humanize error messages\r\n// - throw when invalid input (such as odd number of args into assert.argumentTypes)\r\nvar POSITION_NAME = ['', '1st', '2nd', '3rd'];\r\nfunction argPositionName(i) {\r\n var position = (i / 2) + 1;\r\n return POSITION_NAME[position] || (position + 'th');\r\n}\r\nvar primitives;\r\nvar genericType;\r\nif (typeof _global['$traceurRuntime'] === 'object') {\r\n primitives = _global['$traceurRuntime'].type;\r\n genericType = _global['$traceurRuntime'].genericType;\r\n}\r\nelse {\r\n // Allow to work without traceur runtime as well!\r\n primitives = {\r\n any: { name: 'any' },\r\n boolean: { name: 'boolean' },\r\n number: { name: 'number' },\r\n string: { name: 'string' },\r\n symbol: { name: 'symbol' }, void: { name: 'void' }\r\n };\r\n genericType = function (type, args) {\r\n return { type: type, args: args };\r\n };\r\n}\r\nObject.keys(primitives).forEach(function (name) { primitives[name].__assertName = name; });\r\nfunction proxy() { }\r\nexports.proxy = proxy;\r\nfunction assertArgumentTypes() {\r\n var params = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n params[_i - 0] = arguments[_i];\r\n }\r\n var actual, type;\r\n var currentArgErrors;\r\n var errors = [];\r\n var msg;\r\n for (var i = 0, l = params.length; i < l; i = i + 2) {\r\n actual = params[i];\r\n type = params[i + 1];\r\n currentArgErrors = [];\r\n // currentStack = [];\r\n //\r\n if (!isType(actual, type, currentArgErrors)) {\r\n // console.log(JSON.stringify(errors, null, ' '));\r\n // TODO(vojta): print \"an instance of\" only if T starts with uppercase.\r\n errors.push(argPositionName(i) + ' argument has to be an instance of ' + prettyPrint(type) +\r\n ', got ' + prettyPrint(actual));\r\n if (currentArgErrors.length) {\r\n errors.push(currentArgErrors);\r\n }\r\n }\r\n }\r\n if (errors.length) {\r\n throw new Error('Invalid arguments given!\\n' + formatErrors(errors));\r\n }\r\n}\r\nfunction prettyPrint(value, depth) {\r\n if (typeof (depth) === 'undefined') {\r\n depth = 0;\r\n }\r\n if (depth++ > 3) {\r\n return '[...]';\r\n }\r\n if (typeof value === 'undefined') {\r\n return 'undefined';\r\n }\r\n if (typeof value === 'string') {\r\n return '\"' + value + '\"';\r\n }\r\n if (typeof value === 'boolean') {\r\n return value.toString();\r\n }\r\n if (value === null) {\r\n return 'null';\r\n }\r\n if (typeof value === 'object') {\r\n if (value.__assertName) {\r\n return value.__assertName;\r\n }\r\n if (value.map && typeof value.map === 'function') {\r\n return '[' + value.map(function (v) { return prettyPrint(v, depth); }).join(', ') + ']';\r\n }\r\n var properties = Object.keys(value);\r\n var suffix = '}';\r\n if (properties.length > 20) {\r\n properties.length = 20;\r\n suffix = ', ... }';\r\n }\r\n return '{' + properties.map(function (p) { return p + ': ' + prettyPrint(value[p], depth); }).join(', ') + suffix;\r\n }\r\n return value.__assertName || value.name || value.toString();\r\n}\r\nfunction isType(value, T, errors) {\r\n if (T && T.type) {\r\n // needed for generics.\r\n // TODO(tbosch): read out T.args and do assertions based on them as well!\r\n T = T.type;\r\n }\r\n if (T === primitives.void) {\r\n return typeof value === 'undefined';\r\n }\r\n if (_isProxy(value)) {\r\n return true;\r\n }\r\n if (T === primitives.any || value === null) {\r\n return true;\r\n }\r\n if (T === primitives.string) {\r\n return typeof value === 'string';\r\n }\r\n if (T === primitives.number) {\r\n return typeof value === 'number';\r\n }\r\n if (T === primitives.boolean) {\r\n return typeof value === 'boolean';\r\n }\r\n // var parentStack = currentStack;\r\n // currentStack = [];\r\n // shouldnt this create new stack?\r\n if (typeof T.assert === 'function') {\r\n var parentStack = currentStack;\r\n var isValid;\r\n currentStack = errors;\r\n try {\r\n isValid = T.assert(value);\r\n }\r\n catch (e) {\r\n fail(e.message);\r\n isValid = false;\r\n }\r\n currentStack = parentStack;\r\n if (typeof isValid === 'undefined') {\r\n isValid = errors.length === 0;\r\n }\r\n return isValid;\r\n }\r\n return value instanceof T;\r\n // if (!(value instanceof T)) {\r\n // fail('not instance of ' + prettyPrint(T));\r\n // }\r\n // var res = currentStack;\r\n // currentStack = parentStack;\r\n // return res;\r\n}\r\nfunction _isProxy(obj) {\r\n if (!obj || !obj.constructor || !obj.constructor.annotations)\r\n return false;\r\n return obj.constructor.annotations.filter(function (a) { return a instanceof proxy; }).length > 0;\r\n}\r\nfunction formatErrors(errors, indent) {\r\n if (indent === void 0) { indent = ' '; }\r\n return errors.map(function (e) {\r\n if (typeof e === 'string')\r\n return indent + '- ' + e;\r\n return formatErrors(e, indent + ' ');\r\n })\r\n .join('\\n');\r\n}\r\n// assert a type of given value and throw if does not pass\r\nvar type = function (actual, T) {\r\n var errors = [];\r\n // currentStack = [];\r\n if (!isType(actual, T, errors)) {\r\n // console.log(JSON.stringify(errors, null, ' '));\r\n // TODO(vojta): print \"an instance of\" only if T starts with uppercase.\r\n var msg = 'Expected an instance of ' + prettyPrint(T) + ', got ' + prettyPrint(actual) + '!';\r\n if (errors.length) {\r\n msg += '\\n' + formatErrors(errors);\r\n }\r\n throw new Error(msg);\r\n }\r\n return actual;\r\n};\r\nfunction returnType(actual, T) {\r\n var errors = [];\r\n // currentStack = [];\r\n if (!isType(actual, T, errors)) {\r\n // console.log(JSON.stringify(errors, null, ' '));\r\n // TODO(vojta): print \"an instance of\" only if T starts with uppercase.\r\n var msg = 'Expected to return an instance of ' + prettyPrint(T) + ', got ' +\r\n prettyPrint(actual) + '!';\r\n if (errors.length) {\r\n msg += '\\n' + formatErrors(errors);\r\n }\r\n throw new Error(msg);\r\n }\r\n return actual;\r\n}\r\n// TODO(vojta): define these with DSL?\r\nvar string = type.string = !(__WEBPACK_AMD_DEFINE_RESULT__ = function (value) { return \"function\" === 'string'; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\nvar boolean = type.boolean =\r\n !(__WEBPACK_AMD_DEFINE_RESULT__ = function (value) { return \"function\" === 'boolean'; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\nvar number = type.number = !(__WEBPACK_AMD_DEFINE_RESULT__ = function (value) { return \"function\" === 'number'; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\nfunction arrayOf() {\r\n var types = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n types[_i - 0] = arguments[_i];\r\n }\r\n return assert.define('array of ' + types.map(prettyPrint).join('/'), function (value) {\r\n if (assert(value).is(Array)) {\r\n for (var i = 0; i < value.length; i++) {\r\n (_a = assert(value[i])).is.apply(_a, types);\r\n }\r\n }\r\n var _a;\r\n });\r\n}\r\nfunction structure(definition) {\r\n var properties = Object.keys(definition);\r\n return assert.define('object with properties ' + properties.join(', '), function (value) {\r\n if (assert(value).is(Object)) {\r\n for (var i = 0; i < properties.length; i++) {\r\n var property = properties[i];\r\n assert(value[property]).is(definition[property]);\r\n }\r\n }\r\n });\r\n}\r\n// I'm sorry, bad global state... to make the API nice ;-)\r\nvar currentStack = [];\r\nfunction fail(message) {\r\n currentStack.push(message);\r\n}\r\nfunction define(classOrName, check) {\r\n var cls = classOrName;\r\n if (typeof classOrName === 'string') {\r\n cls = function () { };\r\n cls.__assertName = classOrName;\r\n }\r\n cls.assert = function (value) {\r\n // var parentStack = currentStack;\r\n // currentStack = [];\r\n return check(value);\r\n // if (currentStack.length) {\r\n // parentStack.push(currentStack)\r\n // }\r\n // currentStack = parentStack;\r\n };\r\n return cls;\r\n}\r\nvar assert = function (value) {\r\n return {\r\n is: function is() {\r\n var types = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n types[_i - 0] = arguments[_i];\r\n }\r\n // var errors = []\r\n var allErrors = [];\r\n var errors;\r\n for (var i = 0; i < types.length; i++) {\r\n var type = types[i];\r\n errors = [];\r\n if (isType(value, type, errors)) {\r\n return true;\r\n }\r\n // if no errors, merge multiple \"is not instance of \" into x/y/z ?\r\n allErrors.push(prettyPrint(value) + ' is not instance of ' + prettyPrint(type));\r\n if (errors.length) {\r\n allErrors.push(errors);\r\n }\r\n }\r\n // if (types.length > 1) {\r\n // currentStack.push(['has to be ' + types.map(prettyPrint).join(' or '),\r\n // ...allErrors]);\r\n // } else {\r\n currentStack.push.apply(currentStack, allErrors);\r\n // }\r\n return false;\r\n }\r\n };\r\n};\r\nexports.assert = assert;\r\n// PUBLIC API\r\n// asserting API\r\n// throw if no type provided\r\nassert.type = type;\r\nfor (var prop in primitives) {\r\n assert.type[prop] = primitives[prop];\r\n}\r\nassert.genericType = genericType;\r\n// throw if odd number of args\r\nassert.argumentTypes = assertArgumentTypes;\r\nassert.returnType = returnType;\r\n// define AP;\r\nassert.define = define;\r\nassert.fail = fail;\r\n// primitive value type;\r\nassert.string = string;\r\nassert.number = number;\r\nassert.boolean = boolean;\r\n// custom types\r\nassert.arrayOf = arrayOf;\r\nassert.structure = structure;\r\nexports.__esModule = true;\r\n//# sourceMappingURL=rtts_assert.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/rtts_assert/src/rtts_assert.js\n ** module id = 39\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/rtts_assert/src/rtts_assert.js?"); - -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { - - eval("'use strict';function __export(m) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n/**\r\n * The `angular2` is the single place to import all of the individual types.\r\n */\r\n__export(__webpack_require__(41));\r\n__export(__webpack_require__(102));\r\n// TO BE CLEANED UP.\r\nvar change_detection_1 = __webpack_require__(46);\r\nexports.DehydratedException = change_detection_1.DehydratedException;\r\nexports.ExpressionChangedAfterItHasBeenChecked = change_detection_1.ExpressionChangedAfterItHasBeenChecked;\r\nexports.ChangeDetectionError = change_detection_1.ChangeDetectionError;\r\nexports.ChangeDetection = change_detection_1.ChangeDetection;\r\nexports.ON_PUSH = change_detection_1.ON_PUSH;\r\nexports.DEFAULT = change_detection_1.DEFAULT;\r\nexports.ChangeDetectorRef = change_detection_1.ChangeDetectorRef;\r\nexports.PipeRegistry = change_detection_1.PipeRegistry;\r\nexports.WrappedValue = change_detection_1.WrappedValue;\r\nexports.NullPipe = change_detection_1.NullPipe;\r\nexports.NullPipeFactory = change_detection_1.NullPipeFactory;\r\nexports.defaultPipes = change_detection_1.defaultPipes;\r\nexports.DynamicChangeDetection = change_detection_1.DynamicChangeDetection;\r\nexports.JitChangeDetection = change_detection_1.JitChangeDetection;\r\nexports.PreGeneratedChangeDetection = change_detection_1.PreGeneratedChangeDetection;\r\nexports.preGeneratedProtoDetectors = change_detection_1.preGeneratedProtoDetectors;\r\nexports.defaultPipeRegistry = change_detection_1.defaultPipeRegistry;\r\nexports.DirectiveIndex = change_detection_1.DirectiveIndex;\r\nexports.BindingRecord = change_detection_1.BindingRecord;\r\nexports.Locals = change_detection_1.Locals;\r\nexports.ChangeDetectorDefinition = change_detection_1.ChangeDetectorDefinition;\r\nexports.BasePipe = change_detection_1.BasePipe;\r\nexports.DirectiveRecord = change_detection_1.DirectiveRecord;\r\nvar di_1 = __webpack_require__(89);\r\nexports.Inject = di_1.Inject;\r\nexports.Optional = di_1.Optional;\r\nexports.Injectable = di_1.Injectable;\r\nexports.forwardRef = di_1.forwardRef;\r\nexports.resolveForwardRef = di_1.resolveForwardRef;\r\nexports.Injector = di_1.Injector;\r\nexports.ProtoInjector = di_1.ProtoInjector;\r\nexports.Binding = di_1.Binding;\r\nexports.bind = di_1.bind;\r\nexports.Key = di_1.Key;\r\nexports.NoBindingError = di_1.NoBindingError;\r\nexports.AbstractBindingError = di_1.AbstractBindingError;\r\nexports.AsyncBindingError = di_1.AsyncBindingError;\r\nexports.CyclicDependencyError = di_1.CyclicDependencyError;\r\nexports.InstantiationError = di_1.InstantiationError;\r\nexports.InvalidBindingError = di_1.InvalidBindingError;\r\nexports.NoAnnotationError = di_1.NoAnnotationError;\r\nexports.OpaqueToken = di_1.OpaqueToken;\r\nexports.ResolvedBinding = di_1.ResolvedBinding;\r\nexports.BindingBuilder = di_1.BindingBuilder;\r\nexports.Dependency = di_1.Dependency;\r\nexports.Visibility = di_1.Visibility;\r\nexports.Self = di_1.Self;\r\nexports.Parent = di_1.Parent;\r\nexports.Ancestor = di_1.Ancestor;\r\nexports.Unbounded = di_1.Unbounded;\r\n__export(__webpack_require__(169));\r\nvar forms_1 = __webpack_require__(176);\r\nexports.AbstractControl = forms_1.AbstractControl;\r\nexports.Control = forms_1.Control;\r\nexports.ControlGroup = forms_1.ControlGroup;\r\nexports.ControlArray = forms_1.ControlArray;\r\nexports.NgControlName = forms_1.NgControlName;\r\nexports.NgFormControl = forms_1.NgFormControl;\r\nexports.NgModel = forms_1.NgModel;\r\nexports.NgControl = forms_1.NgControl;\r\nexports.NgControlGroup = forms_1.NgControlGroup;\r\nexports.NgFormModel = forms_1.NgFormModel;\r\nexports.NgForm = forms_1.NgForm;\r\nexports.DefaultValueAccessor = forms_1.DefaultValueAccessor;\r\nexports.CheckboxControlValueAccessor = forms_1.CheckboxControlValueAccessor;\r\nexports.SelectControlValueAccessor = forms_1.SelectControlValueAccessor;\r\nexports.formDirectives = forms_1.formDirectives;\r\nexports.Validators = forms_1.Validators;\r\nexports.NgValidator = forms_1.NgValidator;\r\nexports.NgRequiredValidator = forms_1.NgRequiredValidator;\r\nexports.FormBuilder = forms_1.FormBuilder;\r\nexports.formInjectables = forms_1.formInjectables;\r\n__export(__webpack_require__(197));\r\n__export(__webpack_require__(112));\r\nvar dom_renderer_1 = __webpack_require__(148);\r\nexports.DomRenderer = dom_renderer_1.DomRenderer;\r\nexports.DOCUMENT_TOKEN = dom_renderer_1.DOCUMENT_TOKEN;\r\nexports.__esModule = true;\r\n//# sourceMappingURL=angular2.js.map\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/angular2/angular2.js\n ** module id = 40\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/angular2/angular2.js?"); - -/***/ }, -/* 41 */ -/***/ function(module, exports, __webpack_require__) { - - eval("'use strict';/**\r\n * @module\r\n * @public\r\n * @description\r\n *\r\n * Annotations provide the additional information that Angular requires in order to run your\r\n * application. This module\r\n * contains {@link Component}, {@link Directive}, and {@link View} annotations, as well as\r\n * {@link Parent} and {@link Ancestor} annotations that are\r\n * used by Angular to resolve dependencies.\r\n *\r\n */\r\nvar annotations_1 = __webpack_require__(42);\r\nexports.ComponentAnnotation = annotations_1.ComponentAnnotation;\r\nexports.DirectiveAnnotation = annotations_1.DirectiveAnnotation;\r\nexports.LifecycleEvent = annotations_1.LifecycleEvent;\r\nexports.onDestroy = annotations_1.onDestroy;\r\nexports.onChange = annotations_1.onChange;\r\nexports.onCheck = annotations_1.onCheck;\r\nexports.onInit = annotations_1.onInit;\r\nexports.onAllChangesDone = annotations_1.onAllChangesDone;\r\nvar view_1 = __webpack_require__(97);\r\nexports.ViewAnnotation = view_1.ViewAnnotation;\r\nvar di_1 = __webpack_require__(99);\r\nexports.QueryAnnotation = di_1.QueryAnnotation;\r\nexports.AttributeAnnotation = di_1.AttributeAnnotation;\r\nvar decorators_1 = __webpack_require__(52);\r\nexports.Class = decorators_1.Class;\r\nvar decorators_2 = __webpack_require__(101);\r\nexports.Attribute = decorators_2.Attribute;\r\nexports.Component = decorators_2.Component;\r\nexports.Directive = decorators_2.Directive;\r\nexports.View = decorators_2.View;\r\nexports.Query = decorators_2.Query;\r\nexports.__esModule = true;\r\n//# sourceMappingURL=annotations.js.map\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/angular2/annotations.js\n ** module id = 41\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/angular2/annotations.js?"); - -/***/ }, -/* 42 */ -/***/ function(module, exports, __webpack_require__) { - - eval("'use strict';/**\r\n * This indirection is needed to free up Component, etc symbols in the public API\r\n * to be used by the decorator versions of these annotations.\r\n */\r\nvar annotations_1 = __webpack_require__(43);\r\nexports.ComponentAnnotation = annotations_1.Component;\r\nexports.DirectiveAnnotation = annotations_1.Directive;\r\nexports.LifecycleEvent = annotations_1.LifecycleEvent;\r\nexports.onDestroy = annotations_1.onDestroy;\r\nexports.onChange = annotations_1.onChange;\r\nexports.onCheck = annotations_1.onCheck;\r\nexports.onInit = annotations_1.onInit;\r\nexports.onAllChangesDone = annotations_1.onAllChangesDone;\r\nexports.__esModule = true;\r\n//# sourceMappingURL=annotations.js.map\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/angular2/src/core/annotations/annotations.js\n ** module id = 42\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/angular2/src/core/annotations/annotations.js?"); - -/***/ }, -/* 43 */ -/***/ function(module, exports, __webpack_require__) { - - eval("'use strict';var __extends = (this && this.__extends) || function (d, b) {\r\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\r\n function __() { this.constructor = d; }\r\n __.prototype = b.prototype;\r\n d.prototype = new __();\r\n};\r\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\r\n switch (arguments.length) {\r\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\r\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\r\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\r\n }\r\n};\r\nvar __metadata = (this && this.__metadata) || function (k, v) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\r\n};\r\nvar lang_1 = __webpack_require__(44);\r\nvar annotations_impl_1 = __webpack_require__(45);\r\nvar change_detection_1 = __webpack_require__(46);\r\n/**\r\n * Directives allow you to attach behavior to elements in the DOM.\r\n *\r\n * {@link Directive}s with an embedded view are called {@link Component}s.\r\n *\r\n * A directive consists of a single directive annotation and a controller class. When the\r\n * directive's `selector` matches\r\n * elements in the DOM, the following steps occur:\r\n *\r\n * 1. For each directive, the `ElementInjector` attempts to resolve the directive's constructor\r\n * arguments.\r\n * 2. Angular instantiates directives for each matched element using `ElementInjector` in a\r\n * depth-first order,\r\n * as declared in the HTML.\r\n *\r\n * ## Understanding How Injection Works\r\n *\r\n * There are three stages of injection resolution.\r\n * - *Pre-existing Injectors*:\r\n * - The terminal {@link Injector} cannot resolve dependencies. It either throws an error or, if\r\n * the dependency was\r\n * specified as `@Optional`, returns `null`.\r\n * - The platform injector resolves browser singleton resources, such as: cookies, title,\r\n * location, and others.\r\n * - *Component Injectors*: Each component instance has its own {@link Injector}, and they follow\r\n * the same parent-child hierarchy\r\n * as the component instances in the DOM.\r\n * - *Element Injectors*: Each component instance has a Shadow DOM. Within the Shadow DOM each\r\n * element has an `ElementInjector`\r\n * which follow the same parent-child hierarchy as the DOM elements themselves.\r\n *\r\n * When a template is instantiated, it also must instantiate the corresponding directives in a\r\n * depth-first order. The\r\n * current `ElementInjector` resolves the constructor dependencies for each directive.\r\n *\r\n * Angular then resolves dependencies as follows, according to the order in which they appear in the\r\n * {@link View}:\r\n *\r\n * 1. Dependencies on the current element\r\n * 2. Dependencies on element injectors and their parents until it encounters a Shadow DOM boundary\r\n * 3. Dependencies on component injectors and their parents until it encounters the root component\r\n * 4. Dependencies on pre-existing injectors\r\n *\r\n *\r\n * The `ElementInjector` can inject other directives, element-specific special objects, or it can\r\n * delegate to the parent\r\n * injector.\r\n *\r\n * To inject other directives, declare the constructor parameter as:\r\n * - `directive:DirectiveType`: a directive on the current element only\r\n * - `@Ancestor() directive:DirectiveType`: any directive that matches the type between the current\r\n * element and the\r\n * Shadow DOM root. Current element is not included in the resolution, therefore even if it could\r\n * resolve it, it will\r\n * be ignored.\r\n * - `@Parent() directive:DirectiveType`: any directive that matches the type on a direct parent\r\n * element only.\r\n * - `@Query(DirectiveType) query:QueryList`: A live collection of direct child\r\n * directives.\r\n * - `@QueryDescendants(DirectiveType) query:QueryList`: A live collection of any\r\n * child directives.\r\n *\r\n * To inject element-specific special objects, declare the constructor parameter as:\r\n * - `element: ElementRef` to obtain a reference to logical element in the view.\r\n * - `viewContainer: ViewContainerRef` to control child template instantiation, for\r\n * {@link Directive} directives only\r\n * - `bindingPropagation: BindingPropagation` to control change detection in a more granular way.\r\n *\r\n * ## Example\r\n *\r\n * The following example demonstrates how dependency injection resolves constructor arguments in\r\n * practice.\r\n *\r\n *\r\n * Assume this HTML template:\r\n *\r\n * ```\r\n *
\r\n *
\r\n *
\r\n *
\r\n *
\r\n *
\r\n *
\r\n *
\r\n *
\r\n *
\r\n * ```\r\n *\r\n * With the following `dependency` decorator and `SomeService` injectable class.\r\n *\r\n * ```\r\n * @Injectable()\r\n * class SomeService {\r\n * }\r\n *\r\n * @Directive({\r\n * selector: '[dependency]',\r\n * properties: [\r\n * 'id: dependency'\r\n * ]\r\n * })\r\n * class Dependency {\r\n * id:string;\r\n * }\r\n * ```\r\n *\r\n * Let's step through the different ways in which `MyDirective` could be declared...\r\n *\r\n *\r\n * ### No injection\r\n *\r\n * Here the constructor is declared with no arguments, therefore nothing is injected into\r\n * `MyDirective`.\r\n *\r\n * ```\r\n * @Directive({ selector: '[my-directive]' })\r\n * class MyDirective {\r\n * constructor() {\r\n * }\r\n * }\r\n * ```\r\n *\r\n * This directive would be instantiated with no dependencies.\r\n *\r\n *\r\n * ### Component-level injection\r\n *\r\n * Directives can inject any injectable instance from the closest component injector or any of its\r\n * parents.\r\n *\r\n * Here, the constructor declares a parameter, `someService`, and injects the `SomeService` type\r\n * from the parent\r\n * component's injector.\r\n * ```\r\n * @Directive({ selector: '[my-directive]' })\r\n * class MyDirective {\r\n * constructor(someService: SomeService) {\r\n * }\r\n * }\r\n * ```\r\n *\r\n * This directive would be instantiated with a dependency on `SomeService`.\r\n *\r\n *\r\n * ### Injecting a directive from the current element\r\n *\r\n * Directives can inject other directives declared on the current element.\r\n *\r\n * ```\r\n * @Directive({ selector: '[my-directive]' })\r\n * class MyDirective {\r\n * constructor(dependency: Dependency) {\r\n * expect(dependency.id).toEqual(3);\r\n * }\r\n * }\r\n * ```\r\n * This directive would be instantiated with `Dependency` declared at the same element, in this case\r\n * `dependency=\"3\"`.\r\n *\r\n *\r\n * ### Injecting a directive from a direct parent element\r\n *\r\n * Directives can inject other directives declared on a direct parent element. By definition, a\r\n * directive with a\r\n * `@Parent` annotation does not attempt to resolve dependencies for the current element, even if\r\n * this would satisfy\r\n * the dependency.\r\n *\r\n * ```\r\n * @Directive({ selector: '[my-directive]' })\r\n * class MyDirective {\r\n * constructor(@Parent() dependency: Dependency) {\r\n * expect(dependency.id).toEqual(2);\r\n * }\r\n * }\r\n * ```\r\n * This directive would be instantiated with `Dependency` declared at the parent element, in this\r\n * case `dependency=\"2\"`.\r\n *\r\n *\r\n * ### Injecting a directive from any ancestor elements\r\n *\r\n * Directives can inject other directives declared on any ancestor element (in the current Shadow\r\n * DOM), i.e. on the\r\n * parent element and its parents. By definition, a directive with an `@Ancestor` annotation does\r\n * not attempt to\r\n * resolve dependencies for the current element, even if this would satisfy the dependency.\r\n *\r\n * ```\r\n * @Directive({ selector: '[my-directive]' })\r\n * class MyDirective {\r\n * constructor(@Ancestor() dependency: Dependency) {\r\n * expect(dependency.id).toEqual(2);\r\n * }\r\n * }\r\n * ```\r\n *\r\n * Unlike the `@Parent` which only checks the parent, `@Ancestor` checks the parent, as well as its\r\n * parents recursively. If `dependency=\"2\"` didn't exist on the direct parent, this injection would\r\n * have returned\r\n * `dependency=\"1\"`.\r\n *\r\n *\r\n * ### Injecting a live collection of direct child directives\r\n *\r\n *\r\n * A directive can also query for other child directives. Since parent directives are instantiated\r\n * before child directives, a directive can't simply inject the list of child directives. Instead,\r\n * the directive injects a {@link QueryList}, which updates its contents as children are added,\r\n * removed, or moved by a directive that uses a {@link ViewContainerRef} such as a `ng-for`, an\r\n * `ng-if`, or an `ng-switch`.\r\n *\r\n * ```\r\n * @Directive({ selector: '[my-directive]' })\r\n * class MyDirective {\r\n * constructor(@Query(Dependency) dependencies:QueryList) {\r\n * }\r\n * }\r\n * ```\r\n *\r\n * This directive would be instantiated with a {@link QueryList} which contains `Dependency` 4 and\r\n * 6. Here, `Dependency` 5 would not be included, because it is not a direct child.\r\n *\r\n * ### Injecting a live collection of descendant directives\r\n *\r\n * By passing the descendant flag to `@Query` above, we can include the children of the child\r\n * elements.\r\n *\r\n * ```\r\n * @Directive({ selector: '[my-directive]' })\r\n * class MyDirective {\r\n * constructor(@Query(Dependency, {descendants: true}) dependencies:QueryList) {\r\n * }\r\n * }\r\n * ```\r\n *\r\n * This directive would be instantiated with a Query which would contain `Dependency` 4, 5 and 6.\r\n *\r\n * ### Optional injection\r\n *\r\n * The normal behavior of directives is to return an error when a specified dependency cannot be\r\n * resolved. If you\r\n * would like to inject `null` on unresolved dependency instead, you can annotate that dependency\r\n * with `@Optional()`.\r\n * This explicitly permits the author of a template to treat some of the surrounding directives as\r\n * optional.\r\n *\r\n * ```\r\n * @Directive({ selector: '[my-directive]' })\r\n * class MyDirective {\r\n * constructor(@Optional() dependency:Dependency) {\r\n * }\r\n * }\r\n * ```\r\n *\r\n * This directive would be instantiated with a `Dependency` directive found on the current element.\r\n * If none can be\r\n * found, the injector supplies `null` instead of throwing an error.\r\n *\r\n * ## Example\r\n *\r\n * Here we use a decorator directive to simply define basic tool-tip behavior.\r\n *\r\n * ```\r\n * @Directive({\r\n * selector: '[tooltip]',\r\n * properties: [\r\n * 'text: tooltip'\r\n * ],\r\n * hostListeners: {\r\n * 'onmouseenter': 'onMouseEnter()',\r\n * 'onmouseleave': 'onMouseLeave()'\r\n * }\r\n * })\r\n * class Tooltip{\r\n * text:string;\r\n * overlay:Overlay; // NOT YET IMPLEMENTED\r\n * overlayManager:OverlayManager; // NOT YET IMPLEMENTED\r\n *\r\n * constructor(overlayManager:OverlayManager) {\r\n * this.overlay = overlay;\r\n * }\r\n *\r\n * onMouseEnter() {\r\n * // exact signature to be determined\r\n * this.overlay = this.overlayManager.open(text, ...);\r\n * }\r\n *\r\n * onMouseLeave() {\r\n * this.overlay.close();\r\n * this.overlay = null;\r\n * }\r\n * }\r\n * ```\r\n * In our HTML template, we can then add this behavior to a `
` or any other element with the\r\n * `tooltip` selector,\r\n * like so:\r\n *\r\n * ```\r\n *
\r\n * ```\r\n *\r\n * Directives can also control the instantiation, destruction, and positioning of inline template\r\n * elements:\r\n *\r\n * A directive uses a {@link ViewContainerRef} to instantiate, insert, move, and destroy views at\r\n * runtime.\r\n * The {@link ViewContainerRef} is created as a result of `