Socket
Socket
Sign inDemoInstall

zone.js

Package Overview
Dependencies
0
Maintainers
3
Versions
121
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.16 to 0.8.17

28

CHANGELOG.md

@@ -0,1 +1,29 @@

<a name="0.8.17"></a>
## [0.8.17](https://github.com/angular/zone.js/compare/v0.8.16...0.8.17) (2017-08-23)
### Bug Fixes
* readonly property should not be patched ([#860](https://github.com/angular/zone.js/issues/860)) ([7fbd655](https://github.com/angular/zone.js/commit/7fbd655))
* suppress closure warnings/errors ([#861](https://github.com/angular/zone.js/issues/861)) ([deae751](https://github.com/angular/zone.js/commit/deae751))
* **module:** fix [#875](https://github.com/angular/zone.js/issues/875), can disable requestAnimationFrame ([#876](https://github.com/angular/zone.js/issues/876)) ([fcf187c](https://github.com/angular/zone.js/commit/fcf187c))
* **node:** remove reference to 'noop' ([#865](https://github.com/angular/zone.js/issues/865)) ([4032ddf](https://github.com/angular/zone.js/commit/4032ddf))
* **patch:** fix [#869](https://github.com/angular/zone.js/issues/869), should not patch readonly method ([#871](https://github.com/angular/zone.js/issues/871)) ([31d38c1](https://github.com/angular/zone.js/commit/31d38c1))
* **rxjs:** asap should runGuarded to let error inZone ([#884](https://github.com/angular/zone.js/issues/884)) ([ce3f12f](https://github.com/angular/zone.js/commit/ce3f12f))
* **rxjs:** fix [#863](https://github.com/angular/zone.js/issues/863), fix asap scheduler issue, add testcases ([#848](https://github.com/angular/zone.js/issues/848)) ([cbc58c1](https://github.com/angular/zone.js/commit/cbc58c1))
* **spec:** fix flush() behavior in handling periodic timers ([#881](https://github.com/angular/zone.js/issues/881)) ([eed776c](https://github.com/angular/zone.js/commit/eed776c))
* **task:** fix closure compatibility issue with ZoneDelegate._updateTaskCount ([#878](https://github.com/angular/zone.js/issues/878)) ([a03b84b](https://github.com/angular/zone.js/commit/a03b84b))
### Features
* **cordova:** fix [#868](https://github.com/angular/zone.js/issues/868), patch cordova FileReader ([#879](https://github.com/angular/zone.js/issues/879)) ([b1e5970](https://github.com/angular/zone.js/commit/b1e5970))
* **onProperty:** fix [#875](https://github.com/angular/zone.js/issues/875), can disable patch specified onProperties ([#877](https://github.com/angular/zone.js/issues/877)) ([a733688](https://github.com/angular/zone.js/commit/a733688))
* **patch:** fix [#833](https://github.com/angular/zone.js/issues/833), add IntersectionObserver support ([#880](https://github.com/angular/zone.js/issues/880)) ([f27ff14](https://github.com/angular/zone.js/commit/f27ff14))
* **performance:** onProperty handler use global wrapFn, other performance improve. ([#872](https://github.com/angular/zone.js/issues/872)) ([a66595a](https://github.com/angular/zone.js/commit/a66595a))
* **performance:** reuse microTaskQueue native promise ([#874](https://github.com/angular/zone.js/issues/874)) ([7ee8bcd](https://github.com/angular/zone.js/commit/7ee8bcd))
* **spec:** add a 'tick' callback to flush() ([#866](https://github.com/angular/zone.js/issues/866)) ([02cd40e](https://github.com/angular/zone.js/commit/02cd40e))
<a name="0.8.16"></a>

@@ -2,0 +30,0 @@ ## [0.8.16](https://github.com/angular/zone.js/compare/v0.8.15...0.8.16) (2017-07-27)

74

dist/fake-async-test.js

@@ -66,5 +66,10 @@ /**

};
Scheduler.prototype.tick = function (millis) {
Scheduler.prototype.tick = function (millis, doTick) {
if (millis === void 0) { millis = 0; }
var finalTime = this._currentTime + millis;
var lastCurrentTime = 0;
if (this._schedulerQueue.length === 0 && doTick) {
doTick(millis);
return;
}
while (this._schedulerQueue.length > 0) {

@@ -79,3 +84,7 @@ var current = this._schedulerQueue[0];

var current_1 = this._schedulerQueue.shift();
lastCurrentTime = this._currentTime;
this._currentTime = current_1.endTime;
if (doTick) {
doTick(this._currentTime - lastCurrentTime);
}
var retval = current_1.func.apply(global, current_1.args);

@@ -90,9 +99,27 @@ if (!retval) {

};
Scheduler.prototype.flush = function (limit, flushPeriodic) {
var _this = this;
Scheduler.prototype.flush = function (limit, flushPeriodic, doTick) {
if (limit === void 0) { limit = 20; }
if (flushPeriodic === void 0) { flushPeriodic = false; }
if (flushPeriodic) {
return this.flushPeriodic(doTick);
}
else {
return this.flushNonPeriodic(limit, doTick);
}
};
Scheduler.prototype.flushPeriodic = function (doTick) {
if (this._schedulerQueue.length === 0) {
return 0;
}
// Find the last task currently queued in the scheduler queue and tick
// till that time.
var startTime = this._currentTime;
var lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];
this.tick(lastTask.endTime - startTime, doTick);
return this._currentTime - startTime;
};
Scheduler.prototype.flushNonPeriodic = function (limit, doTick) {
var startTime = this._currentTime;
var lastCurrentTime = 0;
var count = 0;
var seenTimers = [];
while (this._schedulerQueue.length > 0) {

@@ -104,26 +131,15 @@ count++;

}
if (!flushPeriodic) {
// flush only non-periodic timers.
// If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing.
if (this._schedulerQueue.filter(function (task) { return !task.isPeriodic && !task.isRequestAnimationFrame; })
.length === 0) {
break;
}
// flush only non-periodic timers.
// If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing.
if (this._schedulerQueue.filter(function (task) { return !task.isPeriodic && !task.isRequestAnimationFrame; })
.length === 0) {
break;
}
else {
// flushPeriodic has been requested.
// Stop when all timer id-s have been seen at least once.
if (this._schedulerQueue
.filter(function (task) {
return seenTimers.indexOf(task.id) === -1 || _this._currentTime === task.endTime;
})
.length === 0) {
break;
}
}
var current = this._schedulerQueue.shift();
if (seenTimers.indexOf(current.id) === -1) {
seenTimers.push(current.id);
lastCurrentTime = this._currentTime;
this._currentTime = current.endTime;
if (doTick) {
// Update any secondary schedulers like Jasmine mock Date.
doTick(this._currentTime - lastCurrentTime);
}
this._currentTime = current.endTime;
var retval = current.func.apply(global, current.args);

@@ -248,7 +264,7 @@ if (!retval) {

};
FakeAsyncTestZoneSpec.prototype.tick = function (millis) {
FakeAsyncTestZoneSpec.prototype.tick = function (millis, doTick) {
if (millis === void 0) { millis = 0; }
FakeAsyncTestZoneSpec.assertInZone();
this.flushMicrotasks();
this._scheduler.tick(millis);
this._scheduler.tick(millis, doTick);
if (this._lastError !== null) {

@@ -273,6 +289,6 @@ this._resetLastErrorAndThrow();

};
FakeAsyncTestZoneSpec.prototype.flush = function (limit, flushPeriodic) {
FakeAsyncTestZoneSpec.prototype.flush = function (limit, flushPeriodic, doTick) {
FakeAsyncTestZoneSpec.assertInZone();
this.flushMicrotasks();
var elapsed = this._scheduler.flush(limit, flushPeriodic);
var elapsed = this._scheduler.flush(limit, flushPeriodic, doTick);
if (this._lastError !== null) {

@@ -279,0 +295,0 @@ this._resetLastErrorAndThrow();

@@ -21,2 +21,6 @@ /**

*/
/**
* @fileoverview
* @suppress {missingRequire}
*/
(function (global) {

@@ -23,0 +27,0 @@ // Detect and setup WTF.

@@ -27,5 +27,6 @@ /**

// safe to just expose a method to patch Bluebird explicitly
Zone[Zone.__symbol__('bluebird')] = function patchBluebird(Bluebird) {
var BLUEBIRD = 'bluebird';
Zone[Zone.__symbol__(BLUEBIRD)] = function patchBluebird(Bluebird) {
Bluebird.setScheduler(function (fn) {
Zone.current.scheduleMicroTask('bluebird', fn);
Zone.current.scheduleMicroTask(BLUEBIRD, fn);
});

@@ -32,0 +33,0 @@ };

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(this,function(){"use strict";Zone.__load_patch("bluebird",function(e,n,t){n[n.__symbol__("bluebird")]=function(e){e.setScheduler(function(e){n.current.scheduleMicroTask("bluebird",e)})}})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(this,function(){"use strict";Zone.__load_patch("bluebird",function(e,n,t){var o="bluebird";n[n.__symbol__(o)]=function(e){e.setScheduler(function(e){n.current.scheduleMicroTask(o,e)})}})});

@@ -21,2 +21,6 @@ /**

*/
/**
* @fileoverview
* @suppress {globalThis,undefinedVars}
*/
Zone.__load_patch('Error', function (global, Zone, api) {

@@ -92,5 +96,6 @@ /*

Object.keys(error).concat('stack', 'message').forEach(function (key) {
if (error[key] !== undefined) {
var value = error[key];
if (value !== undefined) {
try {
_this[key] = error[key];
_this[key] = value;
}

@@ -150,2 +155,3 @@ catch (e) {

}
var ZONE_CAPTURESTACKTRACE = 'zoneCaptureStackTrace';
Object.defineProperty(ZoneAwareError, 'prepareStackTrace', {

@@ -165,3 +171,3 @@ get: function () {

// remove the first function which name is zoneCaptureStackTrace
if (st.getFunctionName() === 'zoneCaptureStackTrace') {
if (st.getFunctionName() === ZONE_CAPTURESTACKTRACE) {
structuredStackTrace.splice(i, 1);

@@ -180,2 +186,10 @@ break;

// find the frames of interest.
var ZONE_AWARE_ERROR = 'ZoneAwareError';
var ERROR_DOT = 'Error.';
var EMPTY = '';
var RUN_GUARDED = 'runGuarded';
var RUN_TASK = 'runTask';
var RUN = 'run';
var BRACKETS = '(';
var AT = '@';
var detectZone = Zone.current.fork({

@@ -199,16 +213,16 @@ name: 'detect',

// Safari: run@http://localhost:9876/base/build/lib/zone.js:101:24
var fnName = frame.split('(')[0].split('@')[0];
var fnName = frame.split(BRACKETS)[0].split(AT)[0];
var frameType = 1;
if (fnName.indexOf('ZoneAwareError') !== -1) {
if (fnName.indexOf(ZONE_AWARE_ERROR) !== -1) {
zoneAwareFrame1 = frame;
zoneAwareFrame2 = frame.replace('Error.', '');
zoneAwareFrame2 = frame.replace(ERROR_DOT, EMPTY);
blackListedStackFrames[zoneAwareFrame2] = 0 /* blackList */;
}
if (fnName.indexOf('runGuarded') !== -1) {
if (fnName.indexOf(RUN_GUARDED) !== -1) {
runGuardedFrame = true;
}
else if (fnName.indexOf('runTask') !== -1) {
else if (fnName.indexOf(RUN_TASK) !== -1) {
runTaskFrame = true;
}
else if (fnName.indexOf('run') !== -1) {
else if (fnName.indexOf(RUN) !== -1) {
runFrame = true;

@@ -215,0 +229,0 @@ }

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(this,function(){"use strict";Zone.__load_patch("Error",function(t,e,r){function n(){var t=this,e=o.apply(this,arguments),i=e.originalStack=e.stack;if(n[f]&&i){for(var s=i.split("\n"),k=r.currentZoneFrame(),p=0;s[p]!==a&&s[p]!==c&&p<s.length;)p++;for(;p<s.length&&k;p++){var l=s[p];if(l.trim())switch(u[l]){case 0:s.splice(p,1),p--;break;case 1:k=k.parent?k.parent:null,s.splice(p,1),p--;break;default:s[p]+=" ["+k.zone.name+"]"}}try{e.stack=e.zoneAwareStack=s.join("\n")}catch(d){}}return this instanceof o&&this.constructor!=o?(Object.keys(e).concat("stack","message").forEach(function(r){if(void 0!==e[r])try{t[r]=e[r]}catch(n){}}),this):e}var a,c,i=r.symbol("blacklistedStackFrames"),o=t[r.symbol("Error")]=t.Error,u={};t.Error=n;var f="stackRewrite";n.prototype=o.prototype,n[i]=u,n[f]=!1;var s=["stackTraceLimit","captureStackTrace","prepareStackTrace"],k=Object.keys(o);k&&k.forEach(function(t){0===s.filter(function(e){return e===t}).length&&Object.defineProperty(n,t,{get:function(){return o[t]},set:function(e){o[t]=e}})}),o.hasOwnProperty("stackTraceLimit")&&(o.stackTraceLimit=Math.max(o.stackTraceLimit,15),Object.defineProperty(n,"stackTraceLimit",{get:function(){return o.stackTraceLimit},set:function(t){return o.stackTraceLimit=t}})),o.hasOwnProperty("captureStackTrace")&&Object.defineProperty(n,"captureStackTrace",{value:function(t,e){o.captureStackTrace(t,e)}}),Object.defineProperty(n,"prepareStackTrace",{get:function(){return o.prepareStackTrace},set:function(t){return t&&"function"==typeof t?o.prepareStackTrace=function(e,r){if(r)for(var n=0;n<r.length;n++){var a=r[n];if("zoneCaptureStackTrace"===a.getFunctionName()){r.splice(n,1);break}}return t.apply(this,[e,r])}:o.prepareStackTrace=t}});var p=e.current.fork({name:"detect",onHandleError:function(t,e,r,i){if(i.originalStack&&Error===n)for(var o=i.originalStack.split(/\n/),s=!1,k=!1,p=!1;o.length;){var l=o.shift();if(/:\d+:\d+/.test(l)){var d=l.split("(")[0].split("@")[0],T=1;if(d.indexOf("ZoneAwareError")!==-1&&(a=l,c=l.replace("Error.",""),u[c]=0),d.indexOf("runGuarded")!==-1?k=!0:d.indexOf("runTask")!==-1?p=!0:d.indexOf("run")!==-1?s=!0:T=0,u[l]=T,s&&k&&p){n[f]=!0;break}}}return!1}}),l=p.fork({name:"child",onScheduleTask:function(t,e,r,n){return t.scheduleTask(r,n)},onInvokeTask:function(t,e,r,n,a,c){return t.invokeTask(r,n,a,c)},onCancelTask:function(t,e,r,n){return t.cancelTask(r,n)},onInvoke:function(t,e,r,n,a,c,i){return t.invoke(r,n,a,c,i)}}),d=Error.stackTraceLimit;Error.stackTraceLimit=100,l.run(function(){l.runGuarded(function(){var t=function(t,e,r){};l.scheduleEventTask(i,function(){l.scheduleMacroTask(i,function(){l.scheduleMicroTask(i,function(){throw new n(n,o)},null,function(e){e._transitionTo=t,e.invoke()})},null,function(e){e._transitionTo=t,e.invoke()},function(){})},null,function(e){e._transitionTo=t,e.invoke()},function(){})})}),Error.stackTraceLimit=d})});
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";Zone.__load_patch("Error",function(r,t,e){function n(){var r=this,t=o.apply(this,arguments),i=t.originalStack=t.stack;if(n[f]&&i){for(var s=i.split("\n"),k=e.currentZoneFrame(),p=0;s[p]!==a&&s[p]!==c&&p<s.length;)p++;for(;p<s.length&&k;p++){var l=s[p];if(l.trim())switch(u[l]){case 0:s.splice(p,1),p--;break;case 1:k=k.parent?k.parent:null,s.splice(p,1),p--;break;default:s[p]+=" ["+k.zone.name+"]"}}try{t.stack=t.zoneAwareStack=s.join("\n")}catch(d){}}return this instanceof o&&this.constructor!=o?(Object.keys(t).concat("stack","message").forEach(function(e){var n=t[e];if(void 0!==n)try{r[e]=n}catch(a){}}),this):t}var a,c,i=e.symbol("blacklistedStackFrames"),o=r[e.symbol("Error")]=r.Error,u={};r.Error=n;var f="stackRewrite";n.prototype=o.prototype,n[i]=u,n[f]=!1;var s=["stackTraceLimit","captureStackTrace","prepareStackTrace"],k=Object.keys(o);k&&k.forEach(function(r){0===s.filter(function(t){return t===r}).length&&Object.defineProperty(n,r,{get:function(){return o[r]},set:function(t){o[r]=t}})}),o.hasOwnProperty("stackTraceLimit")&&(o.stackTraceLimit=Math.max(o.stackTraceLimit,15),Object.defineProperty(n,"stackTraceLimit",{get:function(){return o.stackTraceLimit},set:function(r){return o.stackTraceLimit=r}})),o.hasOwnProperty("captureStackTrace")&&Object.defineProperty(n,"captureStackTrace",{value:function(r,t){o.captureStackTrace(r,t)}});var p="zoneCaptureStackTrace";Object.defineProperty(n,"prepareStackTrace",{get:function(){return o.prepareStackTrace},set:function(r){return r&&"function"==typeof r?o.prepareStackTrace=function(t,e){if(e)for(var n=0;n<e.length;n++){var a=e[n];if(a.getFunctionName()===p){e.splice(n,1);break}}return r.apply(this,[t,e])}:o.prepareStackTrace=r}});var l="ZoneAwareError",d="Error.",T="",h="runGuarded",v="runTask",m="run",y="(",S="@",b=t.current.fork({name:"detect",onHandleError:function(r,t,e,i){if(i.originalStack&&Error===n)for(var o=i.originalStack.split(/\n/),s=!1,k=!1,p=!1;o.length;){var b=o.shift();if(/:\d+:\d+/.test(b)){var E=b.split(y)[0].split(S)[0],g=1;if(E.indexOf(l)!==-1&&(a=b,c=b.replace(d,T),u[c]=0),E.indexOf(h)!==-1?k=!0:E.indexOf(v)!==-1?p=!0:E.indexOf(m)!==-1?s=!0:g=0,u[b]=g,s&&k&&p){n[f]=!0;break}}}return!1}}),E=b.fork({name:"child",onScheduleTask:function(r,t,e,n){return r.scheduleTask(e,n)},onInvokeTask:function(r,t,e,n,a,c){return r.invokeTask(e,n,a,c)},onCancelTask:function(r,t,e,n){return r.cancelTask(e,n)},onInvoke:function(r,t,e,n,a,c,i){return r.invoke(e,n,a,c,i)}}),g=Error.stackTraceLimit;Error.stackTraceLimit=100,E.run(function(){E.runGuarded(function(){var r=function(r,t,e){};E.scheduleEventTask(i,function(){E.scheduleMacroTask(i,function(){E.scheduleMicroTask(i,function(){throw new n(n,o)},null,function(t){t._transitionTo=r,t.invoke()})},null,function(t){t._transitionTo=r,t.invoke()},function(){})},null,function(t){t._transitionTo=r,t.invoke()},function(){})})}),Error.stackTraceLimit=g})});

@@ -23,8 +23,11 @@ /**

if (global.cordova) {
var SUCCESS_SOURCE_1 = 'cordova.exec.success';
var ERROR_SOURCE_1 = 'cordova.exec.error';
var FUNCTION_1 = 'function';
var nativeExec_1 = api.patchMethod(global.cordova, 'exec', function (delegate) { return function (self, args) {
if (args.length > 0 && typeof args[0] === 'function') {
args[0] = Zone.current.wrap(args[0], 'cordova.exec.success');
if (args.length > 0 && typeof args[0] === FUNCTION_1) {
args[0] = Zone.current.wrap(args[0], SUCCESS_SOURCE_1);
}
if (args.length > 1 && typeof args[1] === 'function') {
args[1] = Zone.current.wrap(args[1], 'cordova.exec.error');
if (args.length > 1 && typeof args[1] === FUNCTION_1) {
args[1] = Zone.current.wrap(args[1], ERROR_SOURCE_1);
}

@@ -35,3 +38,19 @@ return nativeExec_1.apply(self, args);

});
Zone.__load_patch('cordova.FileReader', function (global, Zone, api) {
if (global.cordova && typeof global['FileReader'] !== 'undefined') {
document.addEventListener('deviceReady', function () {
var FileReader = global['FileReader'];
['abort', 'error', 'load', 'loadstart', 'loadend', 'progress'].forEach(function (prop) {
var eventNameSymbol = Zone.__symbol__('ON_PROPERTY' + prop);
Object.defineProperty(FileReader.prototype, eventNameSymbol, {
configurable: true,
get: function () {
return this._realReader && this._realReader[eventNameSymbol];
}
});
});
});
}
});
})));

@@ -1,1 +0,1 @@

!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o():"function"==typeof define&&define.amd?define(o):o()}(this,function(){"use strict";Zone.__load_patch("cordova",function(e,o,n){if(e.cordova)var t=n.patchMethod(e.cordova,"exec",function(e){return function(e,n){return n.length>0&&"function"==typeof n[0]&&(n[0]=o.current.wrap(n[0],"cordova.exec.success")),n.length>1&&"function"==typeof n[1]&&(n[1]=o.current.wrap(n[1],"cordova.exec.error")),t.apply(e,n)}})})});
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o():"function"==typeof define&&define.amd?define(o):o()}(this,function(){"use strict";Zone.__load_patch("cordova",function(e,o,r){if(e.cordova)var t="cordova.exec.success",n="cordova.exec.error",a="function",c=r.patchMethod(e.cordova,"exec",function(e){return function(e,r){return r.length>0&&typeof r[0]===a&&(r[0]=o.current.wrap(r[0],t)),r.length>1&&typeof r[1]===a&&(r[1]=o.current.wrap(r[1],n)),c.apply(e,r)}})}),Zone.__load_patch("cordova.FileReader",function(e,o,r){e.cordova&&"undefined"!=typeof e.FileReader&&document.addEventListener("deviceReady",function(){var r=e.FileReader;["abort","error","load","loadstart","loadend","progress"].forEach(function(e){var t=o.__symbol__("ON_PROPERTY"+e);Object.defineProperty(r.prototype,t,{configurable:!0,get:function(){return this._realReader&&this._realReader[t]}})})})})});

@@ -9,6 +9,6 @@ /**

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('rxjs/Rx')) :
typeof define === 'function' && define.amd ? define(['rxjs/Rx'], factory) :
(factory(global.Rx));
}(this, (function (Rx) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('rxjs/add/observable/bindCallback'), require('rxjs/add/observable/bindNodeCallback'), require('rxjs/add/observable/defer'), require('rxjs/add/observable/forkJoin'), require('rxjs/add/observable/fromEventPattern'), require('rxjs/add/operator/multicast'), require('rxjs/Observable'), require('rxjs/scheduler/asap'), require('rxjs/Subscriber'), require('rxjs/Subscription'), require('rxjs/symbol/rxSubscriber')) :
typeof define === 'function' && define.amd ? define(['rxjs/add/observable/bindCallback', 'rxjs/add/observable/bindNodeCallback', 'rxjs/add/observable/defer', 'rxjs/add/observable/forkJoin', 'rxjs/add/observable/fromEventPattern', 'rxjs/add/operator/multicast', 'rxjs/Observable', 'rxjs/scheduler/asap', 'rxjs/Subscriber', 'rxjs/Subscription', 'rxjs/symbol/rxSubscriber'], factory) :
(factory(null,null,null,null,null,null,global.Rx,global.Rx.Scheduler,global.Rx,global.Rx,global.Rx.Symbol));
}(this, (function (rxjs_add_observable_bindCallback,rxjs_add_observable_bindNodeCallback,rxjs_add_observable_defer,rxjs_add_observable_forkJoin,rxjs_add_observable_fromEventPattern,rxjs_add_operator_multicast,rxjs_Observable,rxjs_scheduler_asap,rxjs_Subscriber,rxjs_Subscription,rxjs_symbol_rxSubscriber) { 'use strict';

@@ -30,127 +30,130 @@ /**

var teardownSource = 'rxjs.Subscriber.teardownLogic';
var patchObservableInstance = function (observable) {
observable._zone = Zone.current;
// patch inner function this._subscribe to check
// SubscriptionZone is same with ConstuctorZone or not
if (observable._subscribe && typeof observable._subscribe === 'function' &&
!observable._originalSubscribe) {
observable._originalSubscribe = observable._subscribe;
observable._subscribe = _patchedSubscribe;
}
var empty = {
closed: true,
next: function (value) { },
error: function (err) { throw err; },
complete: function () { }
};
var _patchedSubscribe = function () {
var currentZone = Zone.current;
var _zone = this._zone;
var args = Array.prototype.slice.call(arguments);
var subscriber = args.length > 0 ? args[0] : undefined;
// also keep currentZone in Subscriber
// for later Subscriber.next/error/complete method
if (subscriber && !subscriber._zone) {
subscriber._zone = currentZone;
function toSubscriber(nextOrObserver, error, complete) {
if (nextOrObserver) {
if (nextOrObserver instanceof rxjs_Subscriber.Subscriber) {
return nextOrObserver;
}
if (nextOrObserver[rxjs_symbol_rxSubscriber.rxSubscriber]) {
return nextOrObserver[rxjs_symbol_rxSubscriber.rxSubscriber]();
}
}
// _subscribe should run in ConstructorZone
// but for performance concern, we should check
// whether ConsturctorZone === Zone.current here
var tearDownLogic = _zone !== Zone.current ?
_zone.run(this._originalSubscribe, this, args, subscribeSource) :
this._originalSubscribe.apply(this, args);
if (tearDownLogic && typeof tearDownLogic === 'function') {
var patchedTearDownLogic = function () {
// tearDownLogic should also run in ConstructorZone
// but for performance concern, we should check
// whether ConsturctorZone === Zone.current here
if (_zone && _zone !== Zone.current) {
return _zone.run(tearDownLogic, this, arguments, teardownSource);
if (!nextOrObserver && !error && !complete) {
return new rxjs_Subscriber.Subscriber(empty);
}
return new rxjs_Subscriber.Subscriber(nextOrObserver, error, complete);
}
var patchObservable = function () {
var ObservablePrototype = rxjs_Observable.Observable.prototype;
var symbolSubscribe = symbol('subscribe');
var _symbolSubscribe = symbol('_subscribe');
var _subscribe = ObservablePrototype[_symbolSubscribe] = ObservablePrototype._subscribe;
var subscribe = ObservablePrototype[symbolSubscribe] = ObservablePrototype.subscribe;
Object.defineProperties(rxjs_Observable.Observable.prototype, {
_zone: { value: null, writable: true, configurable: true },
_zoneSource: { value: null, writable: true, configurable: true },
_zoneSubscribe: { value: null, writable: true, configurable: true },
source: {
configurable: true,
get: function () {
return this._zoneSource;
},
set: function (source) {
this._zone = Zone.current;
this._zoneSource = source;
}
else {
return tearDownLogic.apply(this, arguments);
},
_subscribe: {
configurable: true,
get: function () {
if (this._zoneSubscribe) {
return this._zoneSubscribe;
}
else if (this.constructor === rxjs_Observable.Observable) {
return _subscribe;
}
var proto = Object.getPrototypeOf(this);
return proto && proto._subscribe;
},
set: function (subscribe) {
this._zone = Zone.current;
this._zoneSubscribe = subscribe;
}
};
return patchedTearDownLogic;
}
return tearDownLogic;
},
subscribe: {
writable: true,
configurable: true,
value: function (observerOrNext, error, complete) {
// Only grab a zone if we Zone exists and it is different from the current zone.
var _zone = this._zone;
if (_zone && _zone !== Zone.current) {
// Current Zone is different from the intended zone.
// Restore the zone before invoking the subscribe callback.
return _zone.run(subscribe, this, [toSubscriber(observerOrNext, error, complete)]);
}
return subscribe.call(this, observerOrNext, error, complete);
}
}
});
};
var patchObservable = function (Rx$$1, observableType) {
var symbolObservable = symbol(observableType);
var Observable$$1 = Rx$$1[observableType];
if (!Observable$$1 || Observable$$1[symbolObservable]) {
// the subclass of Observable not loaded or have been patched
return;
}
// monkey-patch Observable to save the
// current zone as ConstructorZone
var patchedObservable = Rx$$1[observableType] = function () {
Observable$$1.apply(this, arguments);
patchObservableInstance(this);
return this;
};
patchedObservable.prototype = Observable$$1.prototype;
patchedObservable[symbolObservable] = Observable$$1;
Object.keys(Observable$$1).forEach(function (key) {
patchedObservable[key] = Observable$$1[key];
});
var ObservablePrototype = Observable$$1.prototype;
var symbolSubscribe = symbol('subscribe');
if (!ObservablePrototype[symbolSubscribe]) {
var subscribe_1 = ObservablePrototype[symbolSubscribe] = ObservablePrototype.subscribe;
// patch Observable.prototype.subscribe
// if SubscripitionZone is different with ConstructorZone
// we should run _subscribe in ConstructorZone and
// create sinke in SubscriptionZone,
// and tearDown should also run into ConstructorZone
Observable$$1.prototype.subscribe = function () {
var _zone = this._zone;
var currentZone = Zone.current;
// if operator is involved, we should also
// patch the call method to save the Subscription zone
if (this.operator && _zone && _zone !== currentZone) {
var call_1 = this.operator.call;
this.operator.call = function () {
var args = Array.prototype.slice.call(arguments);
var subscriber = args.length > 0 ? args[0] : undefined;
if (!subscriber._zone) {
subscriber._zone = currentZone;
}
return _zone.run(call_1, this, args, subscribeSource);
};
var patchSubscription = function () {
var unsubscribeSymbol = symbol('unsubscribe');
var unsubscribe = rxjs_Subscription.Subscription.prototype[unsubscribeSymbol] =
rxjs_Subscription.Subscription.prototype.unsubscribe;
Object.defineProperties(rxjs_Subscription.Subscription.prototype, {
_zone: { value: null, writable: true, configurable: true },
_zoneUnsubscribe: { value: null, writable: true, configurable: true },
_unsubscribe: {
get: function () {
if (this._zoneUnsubscribe) {
return this._zoneUnsubscribe;
}
var proto = Object.getPrototypeOf(this);
return proto && proto._unsubscribe;
},
set: function (unsubscribe) {
this._zone = Zone.current;
this._zoneUnsubscribe = unsubscribe;
}
var result = subscribe_1.apply(this, arguments);
// the result is the subscriber sink,
// we save the current Zone here
if (!result._zone) {
result._zone = currentZone;
},
unsubscribe: {
writable: true,
configurable: true,
value: function () {
// Only grab a zone if we Zone exists and it is different from the current zone.
var _zone = this._zone;
if (_zone && _zone !== Zone.current) {
// Current Zone is different from the intended zone.
// Restore the zone before invoking the subscribe callback.
_zone.run(unsubscribe, this);
}
else {
unsubscribe.apply(this);
}
}
return result;
};
}
var symbolLift = symbol('lift');
if (!ObservablePrototype[symbolLift]) {
var lift_1 = ObservablePrototype[symbolLift] = ObservablePrototype.lift;
// patch lift method to save ConstructorZone of Observable
Observable$$1.prototype.lift = function () {
var observable = lift_1.apply(this, arguments);
patchObservableInstance(observable);
return observable;
};
}
var symbolCreate = symbol('create');
if (!patchedObservable[symbolCreate]) {
var create_1 = patchedObservable[symbolCreate] = Observable$$1.create;
// patch create method to save ConstructorZone of Observable
Rx$$1.Observable.create = function () {
var observable = create_1.apply(this, arguments);
patchObservableInstance(observable);
return observable;
};
}
}
});
};
var patchSubscriber = function () {
var Subscriber$$1 = Rx.Subscriber;
var next = Subscriber$$1.prototype.next;
var error = Subscriber$$1.prototype.error;
var complete = Subscriber$$1.prototype.complete;
var unsubscribe = Subscriber$$1.prototype.unsubscribe;
var next = rxjs_Subscriber.Subscriber.prototype.next;
var error = rxjs_Subscriber.Subscriber.prototype.error;
var complete = rxjs_Subscriber.Subscriber.prototype.complete;
Object.defineProperty(rxjs_Subscriber.Subscriber.prototype, 'destination', {
configurable: true,
get: function () {
return this._zoneDestination;
},
set: function (destination) {
this._zone = Zone.current;
this._zoneDestination = destination;
}
});
// patch Subscriber.next to make sure it run
// into SubscriptionZone
Subscriber$$1.prototype.next = function () {
rxjs_Subscriber.Subscriber.prototype.next = function () {
var currentZone = Zone.current;

@@ -167,3 +170,3 @@ var subscriptionZone = this._zone;

};
Subscriber$$1.prototype.error = function () {
rxjs_Subscriber.Subscriber.prototype.error = function () {
var currentZone = Zone.current;

@@ -180,3 +183,3 @@ var subscriptionZone = this._zone;

};
Subscriber$$1.prototype.complete = function () {
rxjs_Subscriber.Subscriber.prototype.complete = function () {
var currentZone = Zone.current;

@@ -193,15 +196,6 @@ var subscriptionZone = this._zone;

};
Subscriber$$1.prototype.unsubscribe = function () {
var currentZone = Zone.current;
var subscriptionZone = this._zone;
// for performance concern, check Zone.current
// equal with this._zone(SubscriptionZone) or not
if (subscriptionZone && subscriptionZone !== currentZone) {
return subscriptionZone.run(unsubscribe, this, arguments, unsubscribeSource);
}
else {
return unsubscribe.apply(this, arguments);
}
};
};
var patchObservableInstance = function (observable) {
observable._zone = Zone.current;
};
var patchObservableFactoryCreator = function (obj, factoryName) {

@@ -213,2 +207,5 @@ var symbolFactory = symbol(factoryName);

var factoryCreator = obj[symbolFactory] = obj[factoryName];
if (!factoryCreator) {
return;
}
obj[factoryName] = function () {

@@ -223,8 +220,134 @@ var factory = factoryCreator.apply(this, arguments);

};
patchObservable(Rx, 'Observable');
var patchObservableFactory = function (obj, factoryName) {
var symbolFactory = symbol(factoryName);
if (obj[symbolFactory]) {
return;
}
var factory = obj[symbolFactory] = obj[factoryName];
if (!factory) {
return;
}
obj[factoryName] = function () {
var observable = factory.apply(this, arguments);
patchObservableInstance(observable);
return observable;
};
};
var patchObservableFactoryArgs = function (obj, factoryName) {
var symbolFactory = symbol(factoryName);
if (obj[symbolFactory]) {
return;
}
var factory = obj[symbolFactory] = obj[factoryName];
if (!factory) {
return;
}
obj[factoryName] = function () {
var initZone = Zone.current;
var args = Array.prototype.slice.call(arguments);
var _loop_1 = function (i) {
var arg = args[i];
if (typeof arg === 'function') {
args[i] = function () {
var argArgs = Array.prototype.slice.call(arguments);
var runningZone = Zone.current;
if (initZone && runningZone && initZone !== runningZone) {
return initZone.run(arg, this, argArgs);
}
else {
return arg.apply(this, argArgs);
}
};
}
};
for (var i = 0; i < args.length; i++) {
_loop_1(i);
}
var observable = factory.apply(this, args);
patchObservableInstance(observable);
return observable;
};
};
var patchMulticast = function () {
var obj = rxjs_Observable.Observable.prototype;
var factoryName = 'multicast';
var symbolFactory = symbol(factoryName);
if (obj[symbolFactory]) {
return;
}
var factory = obj[symbolFactory] = obj[factoryName];
if (!factory) {
return;
}
obj[factoryName] = function () {
var _zone = Zone.current;
var args = Array.prototype.slice.call(arguments);
var subjectOrSubjectFactory = args.length > 0 ? args[0] : undefined;
if (typeof subjectOrSubjectFactory !== 'function') {
var originalFactory_1 = subjectOrSubjectFactory;
subjectOrSubjectFactory = function () {
return originalFactory_1;
};
}
args[0] = function () {
var subject;
if (_zone && _zone !== Zone.current) {
subject = _zone.run(subjectOrSubjectFactory, this, arguments);
}
else {
subject = subjectOrSubjectFactory.apply(this, arguments);
}
if (subject && _zone) {
subject._zone = _zone;
}
return subject;
};
var observable = factory.apply(this, args);
patchObservableInstance(observable);
return observable;
};
};
var patchImmediate = function (asap$$1) {
if (!asap$$1) {
return;
}
var scheduleSymbol = symbol('scheduleSymbol');
var flushSymbol = symbol('flushSymbol');
var zoneSymbol = symbol('zone');
if (asap$$1[scheduleSymbol]) {
return;
}
var schedule = asap$$1[scheduleSymbol] = asap$$1.schedule;
asap$$1.schedule = function () {
var args = Array.prototype.slice.call(arguments);
var work = args.length > 0 ? args[0] : undefined;
var delay = args.length > 1 ? args[1] : 0;
var state = (args.length > 2 ? args[2] : undefined) || {};
state[zoneSymbol] = Zone.current;
var patchedWork = function () {
var workArgs = Array.prototype.slice.call(arguments);
var action = workArgs.length > 0 ? workArgs[0] : undefined;
var scheduleZone = action && action[zoneSymbol];
if (scheduleZone && scheduleZone !== Zone.current) {
return scheduleZone.runGuarded(work, this, arguments);
}
else {
return work.apply(this, arguments);
}
};
return schedule.apply(this, [patchedWork, delay, state]);
};
};
patchObservable();
patchSubscription();
patchSubscriber();
patchObservableFactoryCreator(Rx.Observable, 'bindCallback');
patchObservableFactoryCreator(Rx.Observable, 'bindNodeCallback');
patchObservableFactoryCreator(rxjs_Observable.Observable, 'bindCallback');
patchObservableFactoryCreator(rxjs_Observable.Observable, 'bindNodeCallback');
patchObservableFactory(rxjs_Observable.Observable, 'defer');
patchObservableFactory(rxjs_Observable.Observable, 'forkJoin');
patchObservableFactoryArgs(rxjs_Observable.Observable, 'fromEventPattern');
patchMulticast();
patchImmediate(rxjs_scheduler_asap.asap);
});
})));

@@ -1,1 +0,1 @@

!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("rxjs/Rx")):"function"==typeof define&&define.amd?define(["rxjs/Rx"],t):t(r.Rx)}(this,function(r){"use strict";Zone.__load_patch("rxjs",function(t,e,n){var i=e.__symbol__,o="rxjs.subscribe",s="rxjs.Subscriber.next",u="rxjs.Subscriber.error",c="rxjs.Subscriber.complete",a="rxjs.Subscriber.unsubscribe",p="rxjs.Subscriber.teardownLogic",b=function(r){r._zone=e.current,r._subscribe&&"function"==typeof r._subscribe&&!r._originalSubscribe&&(r._originalSubscribe=r._subscribe,r._subscribe=l)},l=function(){var r=e.current,t=this._zone,n=Array.prototype.slice.call(arguments),i=n.length>0?n[0]:void 0;i&&!i._zone&&(i._zone=r);var s=t!==e.current?t.run(this._originalSubscribe,this,n,o):this._originalSubscribe.apply(this,n);if(s&&"function"==typeof s){var u=function(){return t&&t!==e.current?t.run(s,this,arguments,p):s.apply(this,arguments)};return u}return s},f=function(r,t){var n=i(t),s=r[t];if(s&&!s[n]){var u=r[t]=function(){return s.apply(this,arguments),b(this),this};u.prototype=s.prototype,u[n]=s,Object.keys(s).forEach(function(r){u[r]=s[r]});var c=s.prototype,a=i("subscribe");if(!c[a]){var p=c[a]=c.subscribe;s.prototype.subscribe=function(){var r=this._zone,t=e.current;if(this.operator&&r&&r!==t){var n=this.operator.call;this.operator.call=function(){var e=Array.prototype.slice.call(arguments),i=e.length>0?e[0]:void 0;return i._zone||(i._zone=t),r.run(n,this,e,o)}}var i=p.apply(this,arguments);return i._zone||(i._zone=t),i}}var l=i("lift");if(!c[l]){var f=c[l]=c.lift;s.prototype.lift=function(){var r=f.apply(this,arguments);return b(r),r}}var h=i("create");if(!u[h]){var y=u[h]=s.create;r.Observable.create=function(){var r=y.apply(this,arguments);return b(r),r}}}},h=function(){var t=r.Subscriber,n=t.prototype.next,i=t.prototype.error,o=t.prototype.complete,p=t.prototype.unsubscribe;t.prototype.next=function(){var r=e.current,t=this._zone;return t&&t!==r?t.run(n,this,arguments,s):n.apply(this,arguments)},t.prototype.error=function(){var r=e.current,t=this._zone;return t&&t!==r?t.run(i,this,arguments,u):i.apply(this,arguments)},t.prototype.complete=function(){var r=e.current,t=this._zone;return t&&t!==r?t.run(o,this,arguments,c):o.apply(this,arguments)},t.prototype.unsubscribe=function(){var r=e.current,t=this._zone;return t&&t!==r?t.run(p,this,arguments,a):p.apply(this,arguments)}},y=function(r,t){var e=i(t);if(!r[e]){var n=r[e]=r[t];r[t]=function(){var r=n.apply(this,arguments);return function(){var t=r.apply(this,arguments);return b(t),t}}}};f(r,"Observable"),h(),y(r.Observable,"bindCallback"),y(r.Observable,"bindNodeCallback")})});
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("rxjs/add/observable/bindCallback"),require("rxjs/add/observable/bindNodeCallback"),require("rxjs/add/observable/defer"),require("rxjs/add/observable/forkJoin"),require("rxjs/add/observable/fromEventPattern"),require("rxjs/add/operator/multicast"),require("rxjs/Observable"),require("rxjs/scheduler/asap"),require("rxjs/Subscriber"),require("rxjs/Subscription"),require("rxjs/symbol/rxSubscriber")):"function"==typeof define&&define.amd?define(["rxjs/add/observable/bindCallback","rxjs/add/observable/bindNodeCallback","rxjs/add/observable/defer","rxjs/add/observable/forkJoin","rxjs/add/observable/fromEventPattern","rxjs/add/operator/multicast","rxjs/Observable","rxjs/scheduler/asap","rxjs/Subscriber","rxjs/Subscription","rxjs/symbol/rxSubscriber"],e):e(null,null,null,null,null,null,r.Rx,r.Rx.Scheduler,r.Rx,r.Rx,r.Rx.Symbol)}(this,function(r,e,t,n,i,u,o,s,b,c,a){"use strict";Zone.__load_patch("rxjs",function(r,e,t){function n(r,e,t){if(r){if(r instanceof b.Subscriber)return r;if(r[a.rxSubscriber])return r[a.rxSubscriber]()}return r||e||t?new b.Subscriber(r,e,t):new b.Subscriber(p)}var i=e.__symbol__,u="rxjs.Subscriber.next",l="rxjs.Subscriber.error",f="rxjs.Subscriber.complete",p={closed:!0,next:function(r){},error:function(r){throw r},complete:function(){}},v=function(){var r=o.Observable.prototype,t=i("subscribe"),u=i("_subscribe"),s=r[u]=r._subscribe,b=r[t]=r.subscribe;Object.defineProperties(o.Observable.prototype,{_zone:{value:null,writable:!0,configurable:!0},_zoneSource:{value:null,writable:!0,configurable:!0},_zoneSubscribe:{value:null,writable:!0,configurable:!0},source:{configurable:!0,get:function(){return this._zoneSource},set:function(r){this._zone=e.current,this._zoneSource=r}},_subscribe:{configurable:!0,get:function(){if(this._zoneSubscribe)return this._zoneSubscribe;if(this.constructor===o.Observable)return s;var r=Object.getPrototypeOf(this);return r&&r._subscribe},set:function(r){this._zone=e.current,this._zoneSubscribe=r}},subscribe:{writable:!0,configurable:!0,value:function(r,t,i){var u=this._zone;return u&&u!==e.current?u.run(b,this,[n(r,t,i)]):b.call(this,r,t,i)}}})},d=function(){var r=i("unsubscribe"),t=c.Subscription.prototype[r]=c.Subscription.prototype.unsubscribe;Object.defineProperties(c.Subscription.prototype,{_zone:{value:null,writable:!0,configurable:!0},_zoneUnsubscribe:{value:null,writable:!0,configurable:!0},_unsubscribe:{get:function(){if(this._zoneUnsubscribe)return this._zoneUnsubscribe;var r=Object.getPrototypeOf(this);return r&&r._unsubscribe},set:function(r){this._zone=e.current,this._zoneUnsubscribe=r}},unsubscribe:{writable:!0,configurable:!0,value:function(){var r=this._zone;r&&r!==e.current?r.run(t,this):t.apply(this)}}})},h=function(){var r=b.Subscriber.prototype.next,t=b.Subscriber.prototype.error,n=b.Subscriber.prototype.complete;Object.defineProperty(b.Subscriber.prototype,"destination",{configurable:!0,get:function(){return this._zoneDestination},set:function(r){this._zone=e.current,this._zoneDestination=r}}),b.Subscriber.prototype.next=function(){var t=e.current,n=this._zone;return n&&n!==t?n.run(r,this,arguments,u):r.apply(this,arguments)},b.Subscriber.prototype.error=function(){var r=e.current,n=this._zone;return n&&n!==r?n.run(t,this,arguments,l):t.apply(this,arguments)},b.Subscriber.prototype.complete=function(){var r=e.current,t=this._zone;return t&&t!==r?t.run(n,this,arguments,f):n.apply(this,arguments)}},y=function(r){r._zone=e.current},x=function(r,e){var t=i(e);if(!r[t]){var n=r[t]=r[e];n&&(r[e]=function(){var r=n.apply(this,arguments);return function(){var e=r.apply(this,arguments);return y(e),e}})}},_=function(r,e){var t=i(e);if(!r[t]){var n=r[t]=r[e];n&&(r[e]=function(){var r=n.apply(this,arguments);return y(r),r})}},S=function(r,t){var n=i(t);if(!r[n]){var u=r[n]=r[t];u&&(r[t]=function(){for(var r=e.current,t=Array.prototype.slice.call(arguments),n=function(n){var i=t[n];"function"==typeof i&&(t[n]=function(){var t=Array.prototype.slice.call(arguments),n=e.current;return r&&n&&r!==n?r.run(i,this,t):i.apply(this,t)})},i=0;i<t.length;i++)n(i);var o=u.apply(this,t);return y(o),o})}},j=function(){var r=o.Observable.prototype,t="multicast",n=i(t);if(!r[n]){var u=r[n]=r[t];u&&(r[t]=function(){var r=e.current,t=Array.prototype.slice.call(arguments),n=t.length>0?t[0]:void 0;if("function"!=typeof n){var i=n;n=function(){return i}}t[0]=function(){var t;return t=r&&r!==e.current?r.run(n,this,arguments):n.apply(this,arguments),t&&r&&(t._zone=r),t};var o=u.apply(this,t);return y(o),o})}},z=function(r){if(r){var t=i("scheduleSymbol"),n=(i("flushSymbol"),i("zone"));if(!r[t]){var u=r[t]=r.schedule;r.schedule=function(){var r=Array.prototype.slice.call(arguments),t=r.length>0?r[0]:void 0,i=r.length>1?r[1]:0,o=(r.length>2?r[2]:void 0)||{};o[n]=e.current;var s=function(){var r=Array.prototype.slice.call(arguments),i=r.length>0?r[0]:void 0,u=i&&i[n];return u&&u!==e.current?u.runGuarded(t,this,arguments):t.apply(this,arguments)};return u.apply(this,[s,i,o])}}}};v(),d(),h(),x(o.Observable,"bindCallback"),x(o.Observable,"bindNodeCallback"),_(o.Observable,"defer"),_(o.Observable,"forkJoin"),S(o.Observable,"fromEventPattern"),j(),z(s.asap)})});

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,t){for(var n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,n){for(var r=t.constructor.name,o=function(o){var a=n[o],i=t[a];i&&(t[a]=function(t){var n=function(){return t.apply(this,e(arguments,r+"."+a))};return s(n,t),n}(i))},a=0;a<n.length;a++)o(a)}function n(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);if(!r&&n){var o=Object.getOwnPropertyDescriptor(n,t);o&&(r={enumerable:!0,configurable:!0})}if(r&&r.configurable){delete r.writable,delete r.value;var a=r.get,i=t.substr(2),s=w("_"+t);r.set=function(t){var n=this;if(n||e!==E||(n=E),n){var r=n[s];if(r&&n.removeEventListener(i,r),"function"==typeof t){var o=function(e){var n=t.apply(this,arguments);return void 0==n||n||e.preventDefault(),n};n[s]=o,n.addEventListener(i,o,!1)}else n[s]=null}},r.get=function(){var n=this;if(n||e!==E||(n=E),!n)return null;if(n.hasOwnProperty(s))return n[s];if(a){var o=a&&a.apply(this);if(o)return r.set.apply(this,[o]),"function"==typeof n.removeAttribute&&n.removeAttribute(t),o}return null},Object.defineProperty(e,t,r)}}function r(e,t,r){if(t)for(var o=0;o<t.length;o++)n(e,"on"+t[o],r);else{var a=[];for(var i in e)"on"==i.substr(0,2)&&a.push(i);for(var s=0;s<a.length;s++)n(e,a[s],r)}}function o(t){var n=E[t];if(n){E[w(t)]=n,E[t]=function(){var r=e(arguments,t);switch(r.length){case 0:this[z]=new n;break;case 1:this[z]=new n(r[0]);break;case 2:this[z]=new n(r[0],r[1]);break;case 3:this[z]=new n(r[0],r[1],r[2]);break;case 4:this[z]=new n(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}},s(E[t],n);var r,o=new n(function(){});for(r in o)"XMLHttpRequest"===t&&"responseBlob"===r||!function(e){"function"==typeof o[e]?E[t].prototype[e]=function(){return this[z][e].apply(this[z],arguments)}:Object.defineProperty(E[t].prototype,e,{set:function(n){"function"==typeof n?(this[z][e]=Zone.current.wrap(n,t+"."+e),s(this[z][e],n)):this[z][e]=n},get:function(){return this[z][e]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(E[t][r]=n[r])}}function a(e,t,n){for(var r=e;r&&!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);!r&&e[t]&&(r=e);var o,a=w(t);if(r&&!(o=r[a])){o=r[a]=r[t];var i=n(o,a,t);r[t]=function(){return i(this,arguments)},s(r[t],o)}return o}function i(e,t,n){function r(e){var t=e.data;return t.args[t.callbackIndex]=function(){e.invoke.apply(this,arguments)},o.apply(t.target,t.args),e}var o=null;o=a(e,t,function(e){return function(t,o){var a=n(t,o);if(a.callbackIndex>=0&&"function"==typeof o[a.callbackIndex]){var i=Zone.current.scheduleMacroTask(a.name,o[a.callbackIndex],a,r,null);return i}return e.apply(t,o)}})}function s(e,t){e[w("OriginalDelegate")]=t}function c(){if(P)return j;P=!0;try{var e=window.navigator.userAgent;e.indexOf("MSIE ");return e.indexOf("MSIE ")===-1&&e.indexOf("Trident/")===-1&&e.indexOf("Edge/")===-1||(j=!0),j}catch(t){}}function u(e,t,n){function r(t,n){if(!t)return!1;var r=!0;n&&void 0!==n.useGlobalCallback&&(r=n.useGlobalCallback);var d=n&&n.validateHandler,y=!0;n&&void 0!==n.checkDuplicate&&(y=n.checkDuplicate);var k=!1;n&&void 0!==n.returnTarget&&(k=n.returnTarget);for(var m=t;m&&!m.hasOwnProperty(o);)m=Object.getPrototypeOf(m);if(!m&&t[o]&&(m=t),!m)return!1;if(m[u])return!1;var b,_={},T=m[u]=m[o],E=m[w(a)]=m[a],D=m[w(i)]=m[i],Z=m[w(c)]=m[c];n&&n.prependEventListenerFnName&&(b=m[w(n.prependEventListenerFnName)]=m[n.prependEventListenerFnName]);var O=function(e){if(!_.isExisting)return T.apply(_.target,[_.eventName,_.capture?g:v,_.options])},S=function(e){if(!e.isRemoved){var t=I[e.eventName],n=void 0;t&&(n=t[e.capture?C:L]);var r=n&&e.target[n];if(r)for(var o=0;o<r.length;o++){var a=r[o];if(a===e){r.splice(o,1),e.isRemoved=!0,0===r.length&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return E.apply(e.target,[e.eventName,e.capture?g:v,e.options])},z=function(e){return T.apply(_.target,[_.eventName,e.invoke,_.options])},P=function(e){return b.apply(_.target,[_.eventName,e.invoke,_.options])},j=function(e){return E.apply(e.target,[e.eventName,e.invoke,e.options])},N=r?O:z,A=r?S:j,X=function(e,t){var n=typeof t;return n===R&&e.callback===t||n===x&&e.originalDelegate===t},W=n&&n.compareTaskCallbackVsDelegate?n.compareTaskCallbackVsDelegate:X,U=function(t,n,o,a,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),function(){var c=this||e,u=(Zone.current,arguments[1]);if(!u)return t.apply(this,arguments);var l=!1;if(typeof u!==R){if(!u.handleEvent)return t.apply(this,arguments);l=!0}if(!d||d(t,u,c,arguments)){var p,f=arguments[0],h=arguments[2],v=!1;void 0===h?p=!1:h===!0?p=!0:h===!1?p=!1:(p=!!h&&!!h.capture,v=!!h&&!!h.once);var g,k=Zone.current,m=I[f];if(m)g=m[p?C:L];else{var b=f+L,T=f+C,w=q+b,E=q+T;I[f]={},I[f][L]=w,I[f][C]=E,g=p?E:w}var D=c[g],Z=!1;if(D){if(Z=!0,y)for(var O=0;O<D.length;O++)if(W(D[O],u))return}else D=c[g]=[];var S,z=c.constructor[F],P=H[z];P&&(S=P[f]),S||(S=z+n+f),_.options=h,v&&(_.options.once=!1),_.target=c,_.capture=p,_.eventName=f,_.isExisting=Z;var j=r?M:null,x=k.scheduleEventTask(S,u,j,o,a);return v&&(h.once=!0),x.options=h,x.target=c,x.capture=p,x.eventName=f,l&&(x.originalDelegate=u),s?D.unshift(x):D.push(x),i?c:void 0}}};return m[o]=U(T,p,N,A,k),b&&(m[f]=U(b,h,P,A,k,!0)),m[a]=function(){var t,n=this||e,r=arguments[0],o=arguments[2];t=void 0!==o&&(o===!0||o!==!1&&(!!o&&!!o.capture));var a=arguments[1];if(!a)return E.apply(this,arguments);if(!d||d(E,a,n,arguments)){var i,s=I[r];s&&(i=s[t?C:L]);var c=i&&n[i];if(c)for(var u=0;u<c.length;u++){var l=c[u];if(W(l,a))return c.splice(u,1),l.isRemoved=!0,0===c.length&&(l.allRemoved=!0,n[i]=null),void l.zone.cancelTask(l)}}},m[i]=function(){for(var t=this||e,n=arguments[0],r=[],o=l(t,n),a=0;a<o.length;a++){var i=o[a],s=i.originalDelegate?i.originalDelegate:i.callback;r.push(s)}return r},m[c]=function(){var t=this||e,n=arguments[0];if(n){var r=I[n];if(r){var o=r[L],i=r[C],s=t[o],u=t[i];if(s)for(var l=s.slice(),p=0;p<l.length;p++){var f=l[p],h=f.originalDelegate?f.originalDelegate:f.callback;this[a].apply(this,[n,h,f.options])}if(u)for(var l=u.slice(),p=0;p<l.length;p++){var f=l[p],h=f.originalDelegate?f.originalDelegate:f.callback;this[a].apply(this,[n,h,f.options])}}}else{for(var d=Object.keys(t),p=0;p<d.length;p++){var v=d[p],g=B.exec(v),y=g&&g[1];y&&"removeListener"!==y&&this[c].apply(this,[y])}this[c].apply(this,["removeListener"])}},s(m[o],T),s(m[a],E),Z&&s(m[c],Z),D&&s(m[i],D),!0}for(var o=n&&n.addEventListenerFnName||"addEventListener",a=n&&n.removeEventListenerFnName||"removeEventListener",i=n&&n.listenersFnName||"eventListeners",c=n&&n.removeAllFnName||"removeAllListeners",u=w(o),p="."+o+":",f="prependListener",h="."+f+":",d=function(e,t,n){if(!e.isRemoved){var r=e.callback;typeof r===x&&r.handleEvent&&(e.callback=function(e){return r.handleEvent(e)},e.originalDelegate=r),e.invoke(e,t,[n]);var o=e.options;if(o&&"object"==typeof o&&o.once){var i=e.originalDelegate?e.originalDelegate:e.callback;t[a].apply(t,[n.type,i,o])}}},v=function(t){var n=this||e,r=n[I[t.type][L]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length;a++)d(o[a],n,t)},g=function(t){var n=this||e,r=n[I[t.type][C]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length;a++)d(o[a],n,t)},y=[],k=0;k<t.length;k++)y[k]=r(t[k],n);return y}function l(e,t){var n=[];for(var r in e){var o=B.exec(r),a=o&&o[1];if(a&&(!t||a===t)){var i=e[r];if(i)for(var s=0;s<i.length;s++)n.push(i[s])}}return n}function p(e,t,n,r){function o(t){function n(){try{t.invoke.apply(this,arguments)}finally{"number"==typeof r.handleId&&delete u[r.handleId]}}var r=t.data;return r.args[0]=n,r.handleId=s.apply(e,r.args),"number"==typeof r.handleId&&(u[r.handleId]=t),t}function i(e){return"number"==typeof e.data.handleId&&delete u[e.data.handleId],c(e.data.handleId)}var s=null,c=null;t+=r,n+=r;var u={};s=a(e,t,function(n){return function(a,s){if("function"==typeof s[0]){var c=Zone.current,u={handleId:null,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?s[1]||0:null,args:s},l=c.scheduleMacroTask(t,s[0],u,o,i);if(!l)return l;var p=l.data.handleId;return p&&p.ref&&p.unref&&"function"==typeof p.ref&&"function"==typeof p.unref&&(l.ref=p.ref.bind(p),l.unref=p.unref.bind(p)),l}return n.apply(e,s)}}),c=a(e,n,function(t){return function(n,r){var o="number"==typeof r[0]?u[r[0]]:r[0];o&&"string"==typeof o.type?"notScheduled"!==o.state&&(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&o.zone.cancelTask(o):t.apply(e,r)}})}function f(){Object.defineProperty=function(e,t,n){if(d(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return"prototype"!==t&&(n=v(e,t,n)),g(e,t,n,r)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(n){Object.defineProperty(e,n,t[n])}),e},Object.create=function(e,t){return"object"!=typeof t||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=v(e,n,t[n])}),X(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=A(e,t);return d(e,t)&&(n.configurable=!1),n}}function h(e,t,n){var r=n.configurable;return n=v(e,t,n),g(e,t,n,r)}function d(e,t){return e&&e[W]&&e[W][t]}function v(e,t,n){return n.configurable=!0,n.configurable||(e[W]||N(e,W,{writable:!0,value:{}}),e[W][t]=!0),n}function g(e,t,n,r){try{return N(e,t,n)}catch(o){if(!n.configurable)throw o;"undefined"==typeof r?delete n.configurable:n.configurable=r;try{return N(e,t,n)}catch(o){var a=null;try{a=JSON.stringify(n)}catch(o){a=a.toString()}console.log("Attempting to configure '"+t+"' with descriptor '"+a+"' on object '"+e+"' and got error, giving up: "+o)}}}function y(e,t){var n=t.WebSocket;t.EventTarget||u(e,t,[n.prototype]),t.WebSocket=function(e,t){var o,a,i=arguments.length>1?new n(e,t):new n(e),s=Object.getOwnPropertyDescriptor(i,"onmessage");return s&&s.configurable===!1?(o=Object.create(i),a=i,["addEventListener","removeEventListener","send","close"].forEach(function(e){o[e]=function(){return i[e].apply(i,arguments)}})):o=i,r(o,["close","error","message","open"],a),o};for(var o in n)t.WebSocket[o]=n[o]}function k(e,t){if(!Z||S){var n="undefined"!=typeof WebSocket;if(m()){if(O){r(window,se,Object.getPrototypeOf(window)),r(Document.prototype,se),"undefined"!=typeof window.SVGElement&&r(window.SVGElement.prototype,se),r(Element.prototype,se),r(HTMLElement.prototype,se),r(HTMLMediaElement.prototype,J),r(HTMLFrameSetElement.prototype,V.concat(ne)),r(HTMLBodyElement.prototype,V.concat(ne)),r(HTMLFrameElement.prototype,te),r(HTMLIFrameElement.prototype,te);var a=window.HTMLMarqueeElement;a&&r(a.prototype,re)}r(XMLHttpRequest.prototype,oe);var i=t.XMLHttpRequestEventTarget;i&&r(i&&i.prototype,oe),"undefined"!=typeof IDBIndex&&(r(IDBIndex.prototype,ae),r(IDBRequest.prototype,ae),r(IDBOpenDBRequest.prototype,ae),r(IDBDatabase.prototype,ae),r(IDBTransaction.prototype,ae),r(IDBCursor.prototype,ae)),n&&r(WebSocket.prototype,ie)}else b(),o("XMLHttpRequest"),n&&y(e,t)}}function m(){if((O||S)&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}var t=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"onreadystatechange");if(t){Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{enumerable:!0,configurable:!0,get:function(){return!0}});var n=new XMLHttpRequest,r=!!n.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",t||{}),r}Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{enumerable:!0,configurable:!0,get:function(){return this[w("fakeonreadystatechange")]},set:function(e){this[w("fakeonreadystatechange")]=e}});var n=new XMLHttpRequest,o=function(){};n.onreadystatechange=o;var r=n[w("fakeonreadystatechange")]===o;return n.onreadystatechange=null,r}function b(){for(var e=function(e){var t=se[e],n="on"+t;self.addEventListener(t,function(e){var t,r,o=e.target;for(r=o?o.constructor.name+"."+n:"unknown."+n;o;)o[n]&&!o[n][ce]&&(t=Zone.current.wrap(o[n],r),t[ce]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<se.length;t++)e(t)}function _(e,t){var n="Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video",r="ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket".split(","),o="EventTarget",a=[],i=e.wtf,s=n.split(",");i?a=s.map(function(e){return"HTML"+e+"Element"}).concat(r):e[o]?a.push(o):a=r;for(var l=e.__Zone_disable_IE_check||!1,p=e.__Zone_enable_cross_context_check||!1,f=c(),h=".addEventListener:",d="[object FunctionWrapper]",v="function __BROWSERTOOLS_CONSOLE_SAFEFUNC() { [native code] }",g=0;g<se.length;g++){var y=se[g],k=y+L,m=y+C,b=q+k,_=q+m;I[y]={},I[y][L]=b,I[y][C]=_}for(var g=0;g<n.length;g++)for(var T=s[g],w=H[T]={},E=0;E<se.length;E++){var y=se[E];w[y]=T+h+y}for(var D=function(e,t,n,r){if(!l&&f)if(p)try{var o=t.toString();if(o===d||o==v)return e.apply(n,r),!1}catch(a){return e.apply(n,r),!1}else{var o=t.toString();if(o===d||o==v)return e.apply(n,r),!1}else if(p)try{t.toString()}catch(a){return e.apply(n,r),!1}return!0},Z=[],g=0;g<a.length;g++){var O=e[a[g]];Z.push(O&&O.prototype)}return u(e,Z,{validateHandler:D}),t.patchEventTarget=u,!0}function T(e){if((O||S)&&"registerElement"in e.document){var t=document.registerElement,n=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(e,r){return r&&r.prototype&&n.forEach(function(e){var t="Document.registerElement::"+e;if(r.prototype.hasOwnProperty(e)){var n=Object.getOwnPropertyDescriptor(r.prototype,e);n&&n.value?(n.value=Zone.current.wrap(n.value,t),h(r.prototype,e,n)):r.prototype[e]=Zone.current.wrap(r.prototype[e],t)}else r.prototype[e]&&(r.prototype[e]=Zone.current.wrap(r.prototype[e],t))}),t.apply(document,[e,r])},s(document.registerElement,t)}}(function(e){function t(e){s&&s.mark&&s.mark(e)}function n(e,t){s&&s.measure&&s.measure(e,t)}function r(t){0===j&&0===v.length&&(e[h]?e[h].resolve(0)[d](o):e[f](o,0)),t&&v.push(t)}function o(){if(!g){for(g=!0;v.length;){var e=v;v=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){S.onUnhandledError(r)}}}!c[i("ignoreConsoleErrorUncaughtError")];S.microtaskDrainDone(),g=!1}}function a(){}function i(e){return"__zone_symbol__"+e}var s=e.performance;if(t("Zone"),e.Zone)throw new Error("Zone already loaded.");var c=function(){function r(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new l(this,this._parent&&this._parent._zoneDelegate,t)}return r.assertZonePatched=function(){if(e.Promise!==O.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(r,"root",{get:function(){for(var e=r.current;e.parent;)e=e.parent;return e},enumerable:!0,configurable:!0}),Object.defineProperty(r,"current",{get:function(){return z.zone},enumerable:!0,configurable:!0}),Object.defineProperty(r,"currentTask",{get:function(){return P},enumerable:!0,configurable:!0}),r.__load_patch=function(o,a){if(O.hasOwnProperty(o))throw Error("Already loaded patch: "+o);if(!e["__Zone_disable_"+o]){var i="Zone:"+o;t(i),O[o]=a(e,r,S),n(i,i)}},Object.defineProperty(r.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),r.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},r.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},r.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},r.prototype.wrap=function(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},r.prototype.run=function(e,t,n,r){void 0===t&&(t=void 0),void 0===n&&(n=null),void 0===r&&(r=null),z={parent:z,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{z=z.parent}},r.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),z={parent:z,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{z=z.parent}},r.prototype.runTask=function(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");var r=e.state===k;if(!r||e.type!==Z){var o=e.state!=_;o&&e._transitionTo(_,b),e.runCount++;var a=P;P=e,z={parent:z,zone:this};try{e.type==D&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(i){if(this._zoneDelegate.handleError(this,i))throw i}}finally{e.state!==k&&e.state!==w&&(e.type==Z||e.data&&e.data.isPeriodic?o&&e._transitionTo(b,_):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(k,_,k))),z=z.parent,P=a}}},r.prototype.scheduleTask=function(e){if(e.zone&&e.zone!==this)for(var t=this;t;){if(t===e.zone)throw Error("can not reschedule task to "+this.name+" which is descendants of the original zone "+e.zone.name);t=t.parent}e._transitionTo(m,k);var n=[];e._zoneDelegates=n,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(r){throw e._transitionTo(w,m,k),this._zoneDelegate.handleError(this,r),r}return e._zoneDelegates===n&&this._updateTaskCount(e,1),e.state==m&&e._transitionTo(b,m),e},r.prototype.scheduleMicroTask=function(e,t,n,r){return this.scheduleTask(new p(E,e,t,n,r,null))},r.prototype.scheduleMacroTask=function(e,t,n,r,o){return this.scheduleTask(new p(D,e,t,n,r,o))},r.prototype.scheduleEventTask=function(e,t,n,r,o){return this.scheduleTask(new p(Z,e,t,n,r,o))},r.prototype.cancelTask=function(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");e._transitionTo(T,b,_);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(w,T),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(k,T),e.runCount=0,e},r.prototype._updateTaskCount=function(e,t){var n=e._zoneDelegates;t==-1&&(e._zoneDelegates=null);for(var r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)},r}();c.__symbol__=i;var u={name:"",onHasTask:function(e,t,n,r){return e.hasTask(n,r)},onScheduleTask:function(e,t,n,r){return e.scheduleTask(n,r)},onInvokeTask:function(e,t,n,r,o,a){return e.invokeTask(n,r,o,a)},onCancelTask:function(e,t,n,r){return e.cancelTask(n,r)}},l=function(){function e(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t.zone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t.zone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t.zone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t.zone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t.zone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t.zone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t.zone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;var r=n&&n.onHasTask,o=t&&t._hasTaskZS;(r||o)&&(this._hasTaskZS=r?n:u,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=u,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=u,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=u,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}return e.prototype.fork=function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new c(e,t)},e.prototype.intercept=function(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t},e.prototype.invoke=function(e,t,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,o):t.apply(n,r)},e.prototype.handleError=function(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)},e.prototype.scheduleTask=function(e,t){var n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=E)throw new Error("Task is missing scheduleFn.");r(t)}return n},e.prototype.invokeTask=function(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)},e.prototype.cancelTask=function(e,t){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n},e.prototype.hasTask=function(e,t){try{return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}},e.prototype._updateTaskCount=function(e,t){var n=this._taskCounts,r=n[e],o=n[e]=r+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){var a={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this.zone,a)}},e}(),p=function(){function t(n,r,o,a,i,s){this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=n,this.source=r,this.data=a,this.scheduleFn=i,this.cancelFn=s,this.callback=o;var c=this;n===Z&&a&&a.isUsingGlobalCallback?this.invoke=t.invokeTask:this.invoke=function(){return t.invokeTask.apply(e,[c,this,arguments])}}return t.invokeTask=function(e,t,n){e||(e=this),j++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==j&&o(),j--}},Object.defineProperty(t.prototype,"zone",{get:function(){return this._zone},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),t.prototype.cancelScheduleRequest=function(){this._transitionTo(k,m)},t.prototype._transitionTo=function(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(this.type+" '"+this.source+"': can not transition to '"+e+"', expecting state '"+t+"'"+(n?" or '"+n+"'":"")+", was '"+this._state+"'.");this._state=e,e==k&&(this._zoneDelegates=null)},t.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},t.prototype.toJSON=function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,invoke:this.invoke,scheduleFn:this.scheduleFn,cancelFn:this.cancelFn,runCount:this.runCount,callback:this.callback}},t}(),f=i("setTimeout"),h=i("Promise"),d=i("then"),v=[],g=!1,y={name:"NO ZONE"},k="notScheduled",m="scheduling",b="scheduled",_="running",T="canceling",w="unknown",E="microTask",D="macroTask",Z="eventTask",O={},S={symbol:i,currentZoneFrame:function(){return z},onUnhandledError:a,microtaskDrainDone:a,scheduleMicroTask:r,showUncaughtError:function(){return!c[i("ignoreConsoleErrorUncaughtError")]},patchEventTarget:function(){return[]},patchOnProperties:a,patchMethod:function(){return a}},z={parent:null,zone:new c(null,null)},P=null,j=0;return n("Zone","Zone"),e.Zone=c})("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global);Zone.__load_patch("ZoneAwarePromise",function(e,t,n){function r(e){n.onUnhandledError(e);try{var r=t[h("unhandledPromiseRejectionHandler")];r&&"function"==typeof r&&r.apply(this,[e])}catch(o){}}function o(e){return e&&e.then}function a(e){return e}function i(e){return D.reject(e)}function s(e,t){return function(n){try{c(e,t,n)}catch(r){c(e,!1,r)}}}function c(e,r,o){var a=E();if(e===o)throw new TypeError("Promise resolved with itself");if(e[y]===b){var i=null;try{"object"!=typeof o&&"function"!=typeof o||(i=o&&o.then)}catch(p){return a(function(){c(e,!1,p)})(),e}if(r!==T&&o instanceof D&&o.hasOwnProperty(y)&&o.hasOwnProperty(k)&&o[y]!==b)u(o),c(e,o[y],o[k]);else if(r!==T&&"function"==typeof i)try{i.apply(o,[a(s(e,r)),a(s(e,!1))])}catch(p){a(function(){c(e,!1,p)})()}else{e[y]=r;var f=e[k];e[k]=o,r===T&&o instanceof Error&&(o[h("currentTask")]=t.currentTask);for(var v=0;v<f.length;)l(e,f[v++],f[v++],f[v++],f[v++]);if(0==f.length&&r==T){e[y]=w;try{throw new Error("Uncaught (in promise): "+o+(o&&o.stack?"\n"+o.stack:""))}catch(p){var g=p;g.rejection=o,g.promise=e,g.zone=t.current,g.task=t.currentTask,d.push(g),n.scheduleMicroTask()}}}}return e}function u(e){if(e[y]===w){try{var n=t[h("rejectionHandledHandler")];n&&"function"==typeof n&&n.apply(this,[{rejection:e[k],promise:e}])}catch(r){}e[y]=T;for(var o=0;o<d.length;o++)e===d[o].promise&&d.splice(o,1)}}function l(e,t,n,r,o){u(e);var s=e[y]?"function"==typeof r?r:a:"function"==typeof o?o:i;t.scheduleMicroTask(m,function(){try{c(n,!0,t.run(s,void 0,[e[k]]))}catch(r){c(n,!1,r)}})}function p(e){var t=e.prototype,n=t.then;t[g]=n;var r=Object.getOwnPropertyDescriptor(e.prototype,"then");r&&r.writable===!1&&r.configurable&&Object.defineProperty(e.prototype,"then",{writable:!0}),e.prototype.then=function(e,t){var r=this,o=new D(function(e,t){n.call(r,e,t)});return o.then(e,t)},e[O]=!0}function f(e){return function(){var t=e.apply(this,arguments);if(t instanceof D)return t;var n=t.constructor;return n[O]||p(n),t}}var h=n.symbol,d=[],v=h("Promise"),g=h("then");n.onUnhandledError=function(e){if(n.showUncaughtError()){var t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=function(){for(;d.length;)for(var e=function(){var e=d.shift();try{e.zone.runGuarded(function(){throw e})}catch(t){r(t)}};d.length;)e()};var y=h("state"),k=h("value"),m="Promise.then",b=null,_=!0,T=!1,w=0,E=function(){var e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},D=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[y]=b,n[k]=[];try{t&&t(s(n,_),s(n,T))}catch(r){c(n,!1,r)}}return e.toString=function(){return"function ZoneAwarePromise() { [native code] }"},e.resolve=function(e){return c(new this(null),_,e)},e.reject=function(e){return c(new this(null),T,e)},e.race=function(e){function t(e){i&&(i=r(e))}function n(e){i&&(i=a(e))}for(var r,a,i=new this(function(e,t){n=[e,t],r=n[0],a=n[1];var n}),s=0,c=e;s<c.length;s++){var u=c[s];o(u)||(u=this.resolve(u)),u.then(t,n)}return i},e.all=function(e){for(var t,n,r=new this(function(e,r){t=e,n=r}),a=0,i=[],s=0,c=e;s<c.length;s++){var u=c[s];o(u)||(u=this.resolve(u)),u.then(function(e){return function(n){i[e]=n,a--,a||t(i)}}(a),n),a++}return a||t(i),r},e.prototype.then=function(e,n){var r=new this.constructor(null),o=t.current;return this[y]==b?this[k].push(o,r,e,n):l(this,o,r,e,n),r},e.prototype["catch"]=function(e){return this.then(null,e)},e}();D.resolve=D.resolve,D.reject=D.reject,D.race=D.race,D.all=D.all;var Z=e[v]=e.Promise;e.Promise=D;var O=h("thenPatched");if(Z){p(Z);var S=e.fetch;"function"==typeof S&&(e.fetch=f(S))}return Promise[t.__symbol__("uncaughtPromiseErrors")]=d,D});var w=Zone.__symbol__,E="object"==typeof window&&window||"object"==typeof self&&self||global,D="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Z=!("nw"in E)&&"undefined"!=typeof E.process&&"[object process]"==={}.toString.call(E.process),O=!Z&&!D&&!("undefined"==typeof window||!window.HTMLElement),S="undefined"!=typeof E.process&&"[object process]"==={}.toString.call(E.process)&&!D&&!("undefined"==typeof window||!window.HTMLElement),z=w("originalInstance"),P=!1,j=!1;Zone.__load_patch("toString",function(e,t,n){var r=t.__zone_symbol__originalToString=Function.prototype.toString;Function.prototype.toString=function(){if("function"==typeof this){var t=this[w("OriginalDelegate")];if(t)return"function"==typeof t?r.apply(this[w("OriginalDelegate")],arguments):Object.prototype.toString.call(t);if(this===Promise){var n=e[w("Promise")];if(n)return r.apply(n,arguments)}if(this===Error){var o=e[w("Error")];if(o)return r.apply(o,arguments)}}return r.apply(this,arguments)};var o=Object.prototype.toString;Object.prototype.toString=function(){return this instanceof Promise?"[object Promise]":o.apply(this,arguments)}});var C="true",L="false",M={isUsingGlobalCallback:!0},I={},H={},F="name",R="function",x="object",q="__zone_symbol__",B=/^__zone_symbol__(\w+)(true|false)$/,N=Object[w("defineProperty")]=Object.defineProperty,A=Object[w("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,X=Object.create,W=w("unconfigurables"),U=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","transitioncancel","transitionend","waiting","wheel"],G=["afterscriptexecute","beforescriptexecute","DOMContentLoaded","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange"],V=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplyconnected","vrdisplaydisconnected","vrdisplaypresentchange"],K=["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],J=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],Q=["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"],$=["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],Y=["autocomplete","autocompleteerror"],ee=["toggle"],te=["load"],ne=["blur","error","focus","load","resize","scroll"],re=["bounce","finish","start"],oe=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],ae=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],ie=["close","error","open","message"],se=U.concat($,Y,ee,G,V,K,Q),ce=w("unbound");
Zone.__load_patch("timers",function(e,t,n){var r="set",o="clear";p(e,r,o,"Timeout"),p(e,r,o,"Interval"),p(e,r,o,"Immediate"),p(e,"request","cancel","AnimationFrame"),p(e,"mozRequest","mozCancel","AnimationFrame"),p(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",function(e,t,n){for(var r=["alert","prompt","confirm"],o=0;o<r.length;o++){var i=r[o];a(e,i,function(n,r,o){return function(r,a){return t.current.run(n,e,a,o)}})}}),Zone.__load_patch("EventTarget",function(e,t,n){_(e,n);var r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,[r.prototype]),o("MutationObserver"),o("WebKitMutationObserver"),o("FileReader")}),Zone.__load_patch("on_property",function(e,t,n){k(n,e),f(),T(e)}),Zone.__load_patch("canvas",function(e,t,n){var r=e.HTMLCanvasElement;"undefined"!=typeof r&&r.prototype&&r.prototype.toBlob&&i(r.prototype,"toBlob",function(e,t){return{name:"HTMLCanvasElement.toBlob",target:e,callbackIndex:0,args:t}})}),Zone.__load_patch("XHR",function(e,t,n){function r(e){function n(e){var t=e[o];return t}function r(e){XMLHttpRequest[c]=!1;var t=e.data,n=t.target[s],r=t.target[w("addEventListener")],a=t.target[w("removeEventListener")];n&&a.apply(t.target,["readystatechange",n]);var i=t.target[s]=function(){t.target.readyState===t.target.DONE&&!t.aborted&&XMLHttpRequest[c]&&"scheduled"===e.state&&e.invoke()};r.apply(t.target,["readystatechange",i]);var u=t.target[o];return u||(t.target[o]=e),f.apply(t.target,t.args),XMLHttpRequest[c]=!0,e}function u(){}function l(e){var t=e.data;return t.aborted=!0,h.apply(t.target,t.args)}var p=a(e.XMLHttpRequest.prototype,"open",function(){return function(e,t){return e[i]=0==t[2],p.apply(e,t)}}),f=a(e.XMLHttpRequest.prototype,"send",function(){return function(e,n){var o=t.current;if(e[i])return f.apply(e,n);var a={target:e,isPeriodic:!1,delay:null,args:n,aborted:!1};return o.scheduleMacroTask("XMLHttpRequest.send",u,a,r,l)}}),h=a(e.XMLHttpRequest.prototype,"abort",function(e){return function(e,t){var r=n(e);if(r&&"string"==typeof r.type){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}}})}r(e);var o=w("xhrTask"),i=w("xhrSync"),s=w("xhrListener"),c=w("xhrScheduled")}),Zone.__load_patch("geolocation",function(e,n,r){e.navigator&&e.navigator.geolocation&&t(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",function(e,t,n){function r(t){return function(n){var r=l(e,t);r.forEach(function(r){var o=e.PromiseRejectionEvent;if(o){var a=new o(t,{promise:n.promise,reason:n.rejection});r.invoke(a)}})}}e.PromiseRejectionEvent&&(t[w("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[w("rejectionHandledHandler")]=r("rejectionhandled"))}),Zone.__load_patch("util",function(e,t,n){n.patchOnProperties=r,n.patchMethod=a})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(this,function(){"use strict";function e(e,t){for(var n=e.length-1;n>=0;n--)typeof e[n]===S&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,r){for(var o=t.constructor.name,a=function(a){var i=r[a],s=t[i];if(s){var u=Object.getOwnPropertyDescriptor(t,i);if(!n(u))return"continue";t[i]=function(t){var n=function(){return t.apply(this,e(arguments,o+"."+i))};return c(n,t),n}(s)}},i=0;i<r.length;i++)a(i)}function n(e){return!e||e.writable!==!1&&(typeof e.get!==S||typeof e.set!==P)}function r(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);if(!r&&n){var o=Object.getOwnPropertyDescriptor(n,t);o&&(r={enumerable:!0,configurable:!0})}if(r&&r.configurable){delete r.writable,delete r.value;var a=r.get,i=t.substr(2),s=I[i];s||(s=I[i]=O("ON_PROPERTY"+i)),r.set=function(t){var n=this;if(n||e!==Z||(n=Z),n){var r=n[s];r&&n.removeEventListener(i,H),"function"==typeof t?(n[s]=t,n.addEventListener(i,H,!1)):n[s]=null}},r.get=function(){var n=this;if(n||e!==Z||(n=Z),!n)return null;if(n[s])return H;if(a){var o=a&&a.apply(this);if(o)return r.set.apply(this,[o]),typeof n[z]===S&&n.removeAttribute(t),o}return null},Object.defineProperty(e,t,r)}}function o(e,t,n){if(t)for(var o=0;o<t.length;o++)r(e,"on"+t[o],n);else{var a=[];for(var i in e)"on"==i.substr(0,2)&&a.push(i);for(var s=0;s<a.length;s++)r(e,a[s],n)}}function a(t){var n=Z[t];if(n){Z[O(t)]=n,Z[t]=function(){var r=e(arguments,t);switch(r.length){case 0:this[R]=new n;break;case 1:this[R]=new n(r[0]);break;case 2:this[R]=new n(r[0],r[1]);break;case 3:this[R]=new n(r[0],r[1],r[2]);break;case 4:this[R]=new n(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}},c(Z[t],n);var r,o=new n(function(){});for(r in o)"XMLHttpRequest"===t&&"responseBlob"===r||!function(e){"function"==typeof o[e]?Z[t].prototype[e]=function(){return this[R][e].apply(this[R],arguments)}:Object.defineProperty(Z[t].prototype,e,{set:function(n){"function"==typeof n?(this[R][e]=Zone.current.wrap(n,t+"."+e),c(this[R][e],n)):this[R][e]=n},get:function(){return this[R][e]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(Z[t][r]=n[r])}}function i(e,t,r){for(var o=e;o&&!o.hasOwnProperty(t);)o=Object.getPrototypeOf(o);!o&&e[t]&&(o=e);var a,i=O(t);if(o&&!(a=o[i])){a=o[i]=o[t];var s=o&&Object.getOwnPropertyDescriptor(o,t);if(n(s)){var u=r(a,i,t);o[t]=function(){return u(this,arguments)},c(o[t],a)}}return a}function s(e,t,n){function r(e){var t=e.data;return t.args[t.callbackIndex]=function(){e.invoke.apply(this,arguments)},o.apply(t.target,t.args),e}var o=null;o=i(e,t,function(e){return function(t,o){var a=n(t,o);if(a.callbackIndex>=0&&"function"==typeof o[a.callbackIndex]){var i=Zone.current.scheduleMacroTask(a.name,o[a.callbackIndex],a,r,null);return i}return e.apply(t,o)}})}function c(e,t){e[O("OriginalDelegate")]=t}function u(){if(F)return x;F=!0;try{var e=window.navigator.userAgent;e.indexOf("MSIE ");return e.indexOf("MSIE ")===-1&&e.indexOf("Trident/")===-1&&e.indexOf("Edge/")===-1||(x=!0),x}catch(t){}}function l(e,t,n){function r(t,n){if(!t)return!1;var r=!0;n&&void 0!==n.useGlobalCallback&&(r=n.useGlobalCallback);var d=n&&n.validateHandler,y=!0;n&&void 0!==n.checkDuplicate&&(y=n.checkDuplicate);var k=!1;n&&void 0!==n.returnTarget&&(k=n.returnTarget);for(var m=t;m&&!m.hasOwnProperty(o);)m=Object.getPrototypeOf(m);if(!m&&t[o]&&(m=t),!m)return!1;if(m[u])return!1;var _,b={},T=m[u]=m[o],w=m[O(a)]=m[a],E=m[O(i)]=m[i],D=m[O(s)]=m[s];n&&n.prependEventListenerFnName&&(_=m[O(n.prependEventListenerFnName)]=m[n.prependEventListenerFnName]);var Z=function(e){if(!b.isExisting)return T.apply(b.target,[b.eventName,b.capture?g:v,b.options])},S=function(e){if(!e.isRemoved){var t=A[e.eventName],n=void 0;t&&(n=t[e.capture?q:N]);var r=n&&e.target[n];if(r)for(var o=0;o<r.length;o++){var a=r[o];if(a===e){r.splice(o,1),e.isRemoved=!0,0===r.length&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return w.apply(e.target,[e.eventName,e.capture?g:v,e.options])},P=function(e){return T.apply(b.target,[b.eventName,e.invoke,b.options])},z=function(e){return _.apply(b.target,[b.eventName,e.invoke,b.options])},j=function(e){return w.apply(e.target,[e.eventName,e.invoke,e.options])},C=r?Z:P,L=r?S:j,M=function(e,t){var n=typeof t;return n===U&&e.callback===t||n===G&&e.originalDelegate===t},I=n&&n.compareTaskCallbackVsDelegate?n.compareTaskCallbackVsDelegate:M,H=function(t,n,o,a,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),function(){var c=this||e,u=(Zone.current,arguments[1]);if(!u)return t.apply(this,arguments);var l=!1;if(typeof u!==U){if(!u.handleEvent)return t.apply(this,arguments);l=!0}if(!d||d(t,u,c,arguments)){var p,f=arguments[0],h=arguments[2],v=!1;void 0===h?p=!1:h===!0?p=!0:h===!1?p=!1:(p=!!h&&!!h.capture,v=!!h&&!!h.once);var g,k=Zone.current,m=A[f];if(m)g=m[p?q:N];else{var _=f+N,T=f+q,w=V+_,E=V+T;A[f]={},A[f][N]=w,A[f][q]=E,g=p?E:w}var D=c[g],O=!1;if(D){if(O=!0,y)for(var Z=0;Z<D.length;Z++)if(I(D[Z],u))return}else D=c[g]=[];var S,P=c.constructor[W],z=X[P];z&&(S=z[f]),S||(S=P+n+f),b.options=h,v&&(b.options.once=!1),b.target=c,b.capture=p,b.eventName=f,b.isExisting=O;var j=r?B:null,C=k.scheduleEventTask(S,u,j,o,a);return v&&(h.once=!0),C.options=h,C.target=c,C.capture=p,C.eventName=f,l&&(C.originalDelegate=u),s?D.unshift(C):D.push(C),i?c:void 0}}};return m[o]=H(T,l,C,L,k),_&&(m[f]=H(_,h,z,L,k,!0)),m[a]=function(){var t,n=this||e,r=arguments[0],o=arguments[2];t=void 0!==o&&(o===!0||o!==!1&&(!!o&&!!o.capture));var a=arguments[1];if(!a)return w.apply(this,arguments);if(!d||d(w,a,n,arguments)){var i,s=A[r];s&&(i=s[t?q:N]);var c=i&&n[i];if(c)for(var u=0;u<c.length;u++){var l=c[u];if(I(l,a))return c.splice(u,1),l.isRemoved=!0,0===c.length&&(l.allRemoved=!0,n[i]=null),void l.zone.cancelTask(l)}}},m[i]=function(){for(var t=this||e,n=arguments[0],r=[],o=p(t,n),a=0;a<o.length;a++){var i=o[a],s=i.originalDelegate?i.originalDelegate:i.callback;r.push(s)}return r},m[s]=function(){var t=this||e,n=arguments[0];if(n){var r=A[n];if(r){var o=r[N],i=r[q],c=t[o],u=t[i];if(c)for(var l=c.slice(),p=0;p<l.length;p++){var f=l[p],h=f.originalDelegate?f.originalDelegate:f.callback;this[a].apply(this,[n,h,f.options])}if(u)for(var l=u.slice(),p=0;p<l.length;p++){var f=l[p],h=f.originalDelegate?f.originalDelegate:f.callback;this[a].apply(this,[n,h,f.options])}}}else{for(var d=Object.keys(t),p=0;p<d.length;p++){var v=d[p],g=K.exec(v),y=g&&g[1];y&&"removeListener"!==y&&this[s].apply(this,[y])}this[s].apply(this,["removeListener"])}},c(m[o],T),c(m[a],w),D&&c(m[s],D),E&&c(m[i],E),!0}for(var o=n&&n.addEventListenerFnName||"addEventListener",a=n&&n.removeEventListenerFnName||"removeEventListener",i=n&&n.listenersFnName||"eventListeners",s=n&&n.removeAllFnName||"removeAllListeners",u=O(o),l="."+o+":",f="prependListener",h="."+f+":",d=function(e,t,n){if(!e.isRemoved){var r=e.callback;typeof r===G&&r.handleEvent&&(e.callback=function(e){return r.handleEvent(e)},e.originalDelegate=r),e.invoke(e,t,[n]);var o=e.options;if(o&&"object"==typeof o&&o.once){var i=e.originalDelegate?e.originalDelegate:e.callback;t[a].apply(t,[n.type,i,o])}}},v=function(t){var n=this||e,r=n[A[t.type][N]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length;a++)d(o[a],n,t)},g=function(t){var n=this||e,r=n[A[t.type][q]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length;a++)d(o[a],n,t)},y=[],k=0;k<t.length;k++)y[k]=r(t[k],n);return y}function p(e,t){var n=[];for(var r in e){var o=K.exec(r),a=o&&o[1];if(a&&(!t||a===t)){var i=e[r];if(i)for(var s=0;s<i.length;s++)n.push(i[s])}}return n}function f(e,t,n,r){function o(t){function n(){try{t.invoke.apply(this,arguments)}finally{typeof r.handleId===l&&delete u[r.handleId]}}var r=t.data;return r.args[0]=n,r.handleId=s.apply(e,r.args),typeof r.handleId===l&&(u[r.handleId]=t),t}function a(e){return typeof e.data.handleId===l&&delete u[e.data.handleId],c(e.data.handleId)}var s=null,c=null;t+=r,n+=r;var u={},l="number",p="string",f="function",h="Interval",d="Timeout",v="notScheduled";s=i(e,t,function(n){return function(i,s){if(typeof s[0]===f){var c=Zone.current,u={handleId:null,isPeriodic:r===h,delay:r===d||r===h?s[1]||0:null,args:s},l=c.scheduleMacroTask(t,s[0],u,o,a);if(!l)return l;var p=l.data.handleId;return p&&p.ref&&p.unref&&typeof p.ref===f&&typeof p.unref===f&&(l.ref=p.ref.bind(p),l.unref=p.unref.bind(p)),l}return n.apply(e,s)}}),c=i(e,n,function(t){return function(n,r){var o=typeof r[0]===l?u[r[0]]:r[0];o&&typeof o.type===p?o.state!==v&&(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&o.zone.cancelTask(o):t.apply(e,r)}})}function h(){Object.defineProperty=function(e,t,n){if(v(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return t!==ee&&(n=g(e,t,n)),y(e,t,n,r)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(n){Object.defineProperty(e,n,t[n])}),e},Object.create=function(e,t){return typeof t!==te||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=g(e,n,t[n])}),Q(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=J(e,t);return v(e,t)&&(n.configurable=!1),n}}function d(e,t,n){var r=n.configurable;return n=g(e,t,n),y(e,t,n,r)}function v(e,t){return e&&e[$]&&e[$][t]}function g(e,t,n){return n.configurable=!0,n.configurable||(e[$]||Y(e,$,{writable:!0,value:{}}),e[$][t]=!0),n}function y(e,t,n,r){try{return Y(e,t,n)}catch(o){if(!n.configurable)throw o;typeof r==ne?delete n.configurable:n.configurable=r;try{return Y(e,t,n)}catch(o){var a=null;try{a=JSON.stringify(n)}catch(o){a=a.toString()}console.log("Attempting to configure '"+t+"' with descriptor '"+a+"' on object '"+e+"' and got error, giving up: "+o)}}}function k(e,t){var n=t.WebSocket;t.EventTarget||l(t,[n.prototype]),t.WebSocket=function(e,t){var r,a,i=arguments.length>1?new n(e,t):new n(e),s=Object.getOwnPropertyDescriptor(i,"onmessage");return s&&s.configurable===!1?(r=Object.create(i),a=i,["addEventListener","removeEventListener","send","close"].forEach(function(e){r[e]=function(){var t=Array.prototype.slice.call(arguments);if("addEventListener"===e||"removeEventListener"===e){var n=t.length>0?t[0]:void 0;if(n){var o=Zone.__symbol__("ON_PROPERTY"+n);i[o]=r[o]}}return i[e].apply(i,t)}})):r=i,o(r,["close","error","message","open"],a),r};var r=t.WebSocket;for(var a in n)r[a]=n[a]}function m(e,t,n){if(!n)return t;var r=n.filter(function(t){return t.target===e});if(!r||0===r.length)return t;var o=r[0].ignoreProperties;return t.filter(function(e){return o.indexOf(e)===-1})}function _(e,t,n,r){var a=m(e,t,n);o(e,a,r)}function b(e,t){if(!C||M){var n="undefined"!=typeof WebSocket;if(T()){var r=t.__Zone_ignore_on_properties;if(L){_(window,ke.concat(["messageerror"]),r,Object.getPrototypeOf(window)),_(Document.prototype,ke,r),"undefined"!=typeof window.SVGElement&&_(window.SVGElement.prototype,ke,r),_(Element.prototype,ke,r),_(HTMLElement.prototype,ke,r),_(HTMLMediaElement.prototype,se,r),_(HTMLFrameSetElement.prototype,ae.concat(he),r),_(HTMLBodyElement.prototype,ae.concat(he),r),_(HTMLFrameElement.prototype,fe,r),_(HTMLIFrameElement.prototype,fe,r);var o=window.HTMLMarqueeElement;o&&_(o.prototype,de,r)}_(XMLHttpRequest.prototype,ve,r);var i=t.XMLHttpRequestEventTarget;i&&_(i&&i.prototype,ve,r),"undefined"!=typeof IDBIndex&&(_(IDBIndex.prototype,ge,r),_(IDBRequest.prototype,ge,r),_(IDBOpenDBRequest.prototype,ge,r),_(IDBDatabase.prototype,ge,r),_(IDBTransaction.prototype,ge,r),_(IDBCursor.prototype,ge,r)),n&&_(WebSocket.prototype,ye,r)}else w(),a("XMLHttpRequest"),n&&k(e,t)}}function T(){if((L||M)&&!Object.getOwnPropertyDescriptor(HTMLElement.prototype,"onclick")&&"undefined"!=typeof Element){var e=Object.getOwnPropertyDescriptor(Element.prototype,"onclick");if(e&&!e.configurable)return!1}var t=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"onreadystatechange");if(t){Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{enumerable:!0,configurable:!0,get:function(){return!0}});var n=new XMLHttpRequest,r=!!n.onreadystatechange;return Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",t||{}),r}var o=O("fakeonreadystatechange");Object.defineProperty(XMLHttpRequest.prototype,"onreadystatechange",{enumerable:!0,configurable:!0,get:function(){return this[o]},set:function(e){this[o]=e}});var n=new XMLHttpRequest,a=function(){};n.onreadystatechange=a;var r=n[o]===a;return n.onreadystatechange=null,r}function w(){for(var e=function(e){var t=ke[e],n="on"+t;self.addEventListener(t,function(e){var t,r,o=e.target;for(r=o?o.constructor.name+"."+n:"unknown."+n;o;)o[n]&&!o[n][me]&&(t=Zone.current.wrap(o[n],r),t[me]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<ke.length;t++)e(t)}function E(e,t){var n="Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video",r="ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex,WebSocket".split(","),o="EventTarget",a=[],i=e.wtf,s=n.split(",");i?a=s.map(function(e){return"HTML"+e+"Element"}).concat(r):e[o]?a.push(o):a=r;for(var c=e.__Zone_disable_IE_check||!1,p=e.__Zone_enable_cross_context_check||!1,f=u(),h=".addEventListener:",d="[object FunctionWrapper]",v="function __BROWSERTOOLS_CONSOLE_SAFEFUNC() { [native code] }",g=0;g<ke.length;g++){var y=ke[g],k=y+N,m=y+q,_=V+k,b=V+m;A[y]={},A[y][N]=_,A[y][q]=b}for(var g=0;g<n.length;g++)for(var T=s[g],w=X[T]={},E=0;E<ke.length;E++){var y=ke[E];w[y]=T+h+y}for(var D=function(e,t,n,r){if(!c&&f)if(p)try{var o=t.toString();if(o===d||o==v)return e.apply(n,r),!1}catch(a){return e.apply(n,r),!1}else{var o=t.toString();if(o===d||o==v)return e.apply(n,r),!1}else if(p)try{t.toString()}catch(a){return e.apply(n,r),!1}return!0},O=[],g=0;g<a.length;g++){var Z=e[a[g]];O.push(Z&&Z.prototype)}return l(e,O,{validateHandler:D}),t.patchEventTarget=l,!0}function D(e){if((L||M)&&"registerElement"in e.document){var t=document.registerElement,n=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"];document.registerElement=function(e,r){return r&&r.prototype&&n.forEach(function(e){var t="Document.registerElement::"+e;if(r.prototype.hasOwnProperty(e)){var n=Object.getOwnPropertyDescriptor(r.prototype,e);n&&n.value?(n.value=Zone.current.wrap(n.value,t),d(r.prototype,e,n)):r.prototype[e]=Zone.current.wrap(r.prototype[e],t)}else r.prototype[e]&&(r.prototype[e]=Zone.current.wrap(r.prototype[e],t))}),t.apply(document,[e,r])},c(document.registerElement,t)}}(function(e){function t(e){c&&c.mark&&c.mark(e)}function n(e,t){c&&c.measure&&c.measure(e,t)}function r(t){0===L&&0===y.length&&(l||e[v]&&(l=e[v].resolve(0)),l?l[g](o):e[d](o,0)),t&&y.push(t)}function o(){if(!k){for(k=!0;y.length;){var e=y;y=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){z.onUnhandledError(r)}}}!u[i("ignoreConsoleErrorUncaughtError")];z.microtaskDrainDone(),k=!1}}function a(){}function i(e){return"__zone_symbol__"+e}var s="function",c=e.performance;if(t("Zone"),e.Zone)throw new Error("Zone already loaded.");var u=function(){function r(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new f(this,this._parent&&this._parent._zoneDelegate,t)}return r.assertZonePatched=function(){if(e.Promise!==P.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(r,"root",{get:function(){for(var e=r.current;e.parent;)e=e.parent;return e},enumerable:!0,configurable:!0}),Object.defineProperty(r,"current",{get:function(){return j.zone},enumerable:!0,configurable:!0}),Object.defineProperty(r,"currentTask",{get:function(){return C},enumerable:!0,configurable:!0}),r.__load_patch=function(o,a){if(P.hasOwnProperty(o))throw Error("Already loaded patch: "+o);if(!e["__Zone_disable_"+o]){var i="Zone:"+o;t(i),P[o]=a(e,r,z),n(i,i)}},Object.defineProperty(r.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),r.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},r.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},r.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},r.prototype.wrap=function(e,t){if(typeof e!==s)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},r.prototype.run=function(e,t,n,r){void 0===t&&(t=void 0),void 0===n&&(n=null),void 0===r&&(r=null),j={parent:j,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{j=j.parent}},r.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),j={parent:j,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{j=j.parent}},r.prototype.runTask=function(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");var r=e.state===_;if(!r||e.type!==S){var o=e.state!=w;o&&e._transitionTo(w,T),e.runCount++;var a=C;C=e,j={parent:j,zone:this};try{e.type==Z&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(i){if(this._zoneDelegate.handleError(this,i))throw i}}finally{e.state!==_&&e.state!==D&&(e.type==S||e.data&&e.data.isPeriodic?o&&e._transitionTo(T,w):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(_,w,_))),j=j.parent,C=a}}},r.prototype.scheduleTask=function(e){if(e.zone&&e.zone!==this)for(var t=this;t;){if(t===e.zone)throw Error("can not reschedule task to "+this.name+" which is descendants of the original zone "+e.zone.name);t=t.parent}e._transitionTo(b,_);var n=[];e._zoneDelegates=n,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(r){throw e._transitionTo(D,b,_),this._zoneDelegate.handleError(this,r),r}return e._zoneDelegates===n&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(T,b),e},r.prototype.scheduleMicroTask=function(e,t,n,r){return this.scheduleTask(new h(O,e,t,n,r,null))},r.prototype.scheduleMacroTask=function(e,t,n,r,o){return this.scheduleTask(new h(Z,e,t,n,r,o))},r.prototype.scheduleEventTask=function(e,t,n,r,o){return this.scheduleTask(new h(S,e,t,n,r,o))},r.prototype.cancelTask=function(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");e._transitionTo(E,T,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(D,E),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(_,E),e.runCount=0,e},r.prototype._updateTaskCount=function(e,t){var n=e._zoneDelegates;t==-1&&(e._zoneDelegates=null);for(var r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)},r}();u.__symbol__=i;var l,p={name:"",onHasTask:function(e,t,n,r){return e.hasTask(n,r)},onScheduleTask:function(e,t,n,r){return e.scheduleTask(n,r)},onInvokeTask:function(e,t,n,r,o,a){return e.invokeTask(n,r,o,a)},onCancelTask:function(e,t,n,r){return e.cancelTask(n,r)}},f=function(){function e(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t.zone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t.zone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t.zone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t.zone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t.zone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t.zone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t.zone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;var r=n&&n.onHasTask,o=t&&t._hasTaskZS;(r||o)&&(this._hasTaskZS=r?n:p,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=p,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=p,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=p,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}return e.prototype.fork=function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new u(e,t)},e.prototype.intercept=function(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t},e.prototype.invoke=function(e,t,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,o):t.apply(n,r)},e.prototype.handleError=function(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)},e.prototype.scheduleTask=function(e,t){var n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=O)throw new Error("Task is missing scheduleFn.");r(t)}return n},e.prototype.invokeTask=function(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)},e.prototype.cancelTask=function(e,t){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n},e.prototype.hasTask=function(e,t){try{return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}},e.prototype._updateTaskCount=function(e,t){var n=this._taskCounts,r=n[e],o=n[e]=r+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){var a={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this.zone,a)}},e}(),h=function(){function t(n,r,o,a,i,s){this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=n,this.source=r,this.data=a,this.scheduleFn=i,this.cancelFn=s,this.callback=o;var c=this;n===S&&a&&a.isUsingGlobalCallback?this.invoke=t.invokeTask:this.invoke=function(){return t.invokeTask.apply(e,[c,this,arguments])}}return t.invokeTask=function(e,t,n){e||(e=this),L++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==L&&o(),L--}},Object.defineProperty(t.prototype,"zone",{get:function(){return this._zone},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),t.prototype.cancelScheduleRequest=function(){this._transitionTo(_,b)},t.prototype._transitionTo=function(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(this.type+" '"+this.source+"': can not transition to '"+e+"', expecting state '"+t+"'"+(n?" or '"+n+"'":"")+", was '"+this._state+"'.");this._state=e,e==_&&(this._zoneDelegates=null)},t.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},t.prototype.toJSON=function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,invoke:this.invoke,scheduleFn:this.scheduleFn,cancelFn:this.cancelFn,runCount:this.runCount,callback:this.callback}},t}(),d=i("setTimeout"),v=i("Promise"),g=i("then"),y=[],k=!1,m={name:"NO ZONE"},_="notScheduled",b="scheduling",T="scheduled",w="running",E="canceling",D="unknown",O="microTask",Z="macroTask",S="eventTask",P={},z={symbol:i,currentZoneFrame:function(){return j},onUnhandledError:a,microtaskDrainDone:a,scheduleMicroTask:r,showUncaughtError:function(){return!u[i("ignoreConsoleErrorUncaughtError")]},patchEventTarget:function(){return[]},patchOnProperties:a,patchMethod:function(){return a}},j={parent:null,zone:new u(null,null)},C=null,L=0;return n("Zone","Zone"),e.Zone=u})("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global);Zone.__load_patch("ZoneAwarePromise",function(e,t,n){function r(e){n.onUnhandledError(e);try{var r=t[y];r&&"function"==typeof r&&r.apply(this,[e])}catch(o){}}function o(e){return e&&e.then}function a(e){return e}function i(e){return C.reject(e)}function s(e,t){return function(n){try{c(e,t,n)}catch(r){c(e,!1,r)}}}function c(e,r,o){var a=D();if(e===o)throw new TypeError(O);if(e[k]===b){var i=null;try{typeof o!==Z&&typeof o!==S||(i=o&&o.then)}catch(p){return a(function(){c(e,!1,p)})(),e}if(r!==w&&o instanceof C&&o.hasOwnProperty(k)&&o.hasOwnProperty(m)&&o[k]!==b)u(o),c(e,o[k],o[m]);else if(r!==w&&typeof i===S)try{i.apply(o,[a(s(e,r)),a(s(e,!1))])}catch(p){a(function(){c(e,!1,p)})()}else{e[k]=r;var f=e[m];e[m]=o,r===w&&o instanceof Error&&(o[P]=t.currentTask);for(var h=0;h<f.length;)l(e,f[h++],f[h++],f[h++],f[h++]);if(0==f.length&&r==w){e[k]=E;try{throw new Error("Uncaught (in promise): "+o+(o&&o.stack?"\n"+o.stack:""))}catch(p){var v=p;v.rejection=o,v.promise=e,v.zone=t.current,v.task=t.currentTask,d.push(v),n.scheduleMicroTask()}}}}return e}function u(e){if(e[k]===E){try{var n=t[z];n&&typeof n===S&&n.apply(this,[{rejection:e[m],promise:e}])}catch(r){}e[k]=w;for(var o=0;o<d.length;o++)e===d[o].promise&&d.splice(o,1)}}function l(e,t,n,r,o){u(e);var s=e[k]?typeof r===S?r:a:typeof o===S?o:i;t.scheduleMicroTask(_,function(){try{c(n,!0,t.run(s,void 0,[e[m]]))}catch(r){c(n,!1,r)}})}function p(e){var t=e.prototype,n=t.then;t[g]=n;var r=Object.getOwnPropertyDescriptor(e.prototype,"then");r&&r.writable===!1&&r.configurable&&Object.defineProperty(e.prototype,"then",{writable:!0}),e.prototype.then=function(e,t){var r=this,o=new C(function(e,t){n.call(r,e,t)});return o.then(e,t)},e[M]=!0}function f(e){return function(){var t=e.apply(this,arguments);if(t instanceof C)return t;var n=t.constructor;return n[M]||p(n),t}}var h=n.symbol,d=[],v=h("Promise"),g=h("then");n.onUnhandledError=function(e){if(n.showUncaughtError()){var t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=function(){for(;d.length;)for(var e=function(){var e=d.shift();try{e.zone.runGuarded(function(){throw e})}catch(t){r(t)}};d.length;)e()};var y=h("unhandledPromiseRejectionHandler"),k=h("state"),m=h("value"),_="Promise.then",b=null,T=!0,w=!1,E=0,D=function(){var e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},O="Promise resolved with itself",Z="object",S="function",P=h("currentTask"),z=h("rejectionHandledHandler"),j="function ZoneAwarePromise() { [native code] }",C=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[k]=b,n[m]=[];try{t&&t(s(n,T),s(n,w))}catch(r){c(n,!1,r)}}return e.toString=function(){return j},e.resolve=function(e){return c(new this(null),T,e)},e.reject=function(e){return c(new this(null),w,e)},e.race=function(e){function t(e){i&&(i=r(e))}function n(e){i&&(i=a(e))}for(var r,a,i=new this(function(e,t){n=[e,t],r=n[0],a=n[1];var n}),s=0,c=e;s<c.length;s++){var u=c[s];o(u)||(u=this.resolve(u)),u.then(t,n)}return i},e.all=function(e){for(var t,n,r=new this(function(e,r){t=e,n=r}),a=0,i=[],s=0,c=e;s<c.length;s++){var u=c[s];o(u)||(u=this.resolve(u)),u.then(function(e){return function(n){i[e]=n,a--,a||t(i)}}(a),n),a++}return a||t(i),r},e.prototype.then=function(e,n){var r=new this.constructor(null),o=t.current;return this[k]==b?this[m].push(o,r,e,n):l(this,o,r,e,n),r},e.prototype["catch"]=function(e){return this.then(null,e)},e}();C.resolve=C.resolve,C.reject=C.reject,C.race=C.race,C.all=C.all;var L=e[v]=e.Promise;e.Promise=C;var M=h("thenPatched");if(L){p(L);var I=e.fetch;typeof I==S&&(e.fetch=f(I))}return Promise[t.__symbol__("uncaughtPromiseErrors")]=d,C});var O=Zone.__symbol__,Z="object"==typeof window&&window||"object"==typeof self&&self||global,S="function",P="undefined",z="removeAttribute",j="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,C=!("nw"in Z)&&"undefined"!=typeof Z.process&&"[object process]"==={}.toString.call(Z.process),L=!C&&!j&&!("undefined"==typeof window||!window.HTMLElement),M="undefined"!=typeof Z.process&&"[object process]"==={}.toString.call(Z.process)&&!j&&!("undefined"==typeof window||!window.HTMLElement),I=(O("onPropertyHandler"),{}),H=function(e){var t=I[e.type];t||(t=I[e.type]=O("ON_PROPERTY"+e.type));var n=this[t],r=n&&n.apply(this,arguments);return void 0==r||r||e.preventDefault(),r},R=O("originalInstance"),F=!1,x=!1;Zone.__load_patch("toString",function(e,t,n){var r=t.__zone_symbol__originalToString=Function.prototype.toString,o="function",a=O("OriginalDelegate"),i=O("Promise"),s=O("Error");Function.prototype.toString=function(){if(typeof this===o){var t=this[a];if(t)return typeof t===o?r.apply(this[a],arguments):Object.prototype.toString.call(t);if(this===Promise){var n=e[i];if(n)return r.apply(n,arguments)}if(this===Error){var c=e[s];if(c)return r.apply(c,arguments)}}return r.apply(this,arguments)};var c=Object.prototype.toString,u="[object Promise]";Object.prototype.toString=function(){return this instanceof Promise?u:c.apply(this,arguments)}});var q="true",N="false",B={isUsingGlobalCallback:!0},A={},X={},W="name",U="function",G="object",V="__zone_symbol__",K=/^__zone_symbol__(\w+)(true|false)$/,Y=Object[O("defineProperty")]=Object.defineProperty,J=Object[O("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,Q=Object.create,$=O("unconfigurables"),ee="prototype",te="object",ne="undefined",re=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","transitioncancel","transitionend","waiting","wheel"],oe=["afterscriptexecute","beforescriptexecute","DOMContentLoaded","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange"],ae=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplyconnected","vrdisplaydisconnected","vrdisplaypresentchange"],ie=["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],se=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],ce=["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"],ue=["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],le=["autocomplete","autocompleteerror"],pe=["toggle"],fe=["load"],he=["blur","error","focus","load","resize","scroll","messageerror"],de=["bounce","finish","start"],ve=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],ge=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],ye=["close","error","open","message"],ke=re.concat(ue,le,pe,oe,ae,ie,ce),me=O("unbound");
Zone.__load_patch("timers",function(e,t,n){var r="set",o="clear";f(e,r,o,"Timeout"),f(e,r,o,"Interval"),f(e,r,o,"Immediate")}),Zone.__load_patch("requestAnimationFrame",function(e,t,n){f(e,"request","cancel","AnimationFrame"),f(e,"mozRequest","mozCancel","AnimationFrame"),f(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",function(e,t,n){for(var r=["alert","prompt","confirm"],o=0;o<r.length;o++){var a=r[o];i(e,a,function(n,r,o){return function(r,a){return t.current.run(n,e,a,o)}})}}),Zone.__load_patch("EventTarget",function(e,t,n){E(e,n);var r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,[r.prototype]),a("MutationObserver"),a("WebKitMutationObserver"),a("IntersectionObserver"),a("FileReader")}),Zone.__load_patch("on_property",function(e,t,n){b(n,e),h(),D(e)}),Zone.__load_patch("canvas",function(e,t,n){var r=e.HTMLCanvasElement;"undefined"!=typeof r&&r.prototype&&r.prototype.toBlob&&s(r.prototype,"toBlob",function(e,t){return{name:"HTMLCanvasElement.toBlob",target:e,callbackIndex:0,args:t}})}),Zone.__load_patch("XHR",function(e,t,n){function r(e){function n(e){var t=e[o];return t}function r(e){XMLHttpRequest[c]=!1;var t=e.data,n=t.target,r=n[s];h||(h=n[p],d=n[f]),r&&d.apply(n,[g,r]);var a=n[s]=function(){n.readyState===n.DONE&&!t.aborted&&XMLHttpRequest[c]&&e.state===y&&e.invoke()};h.apply(n,[g,a]);var i=n[o];return i||(n[o]=e),_.apply(n,t.args),XMLHttpRequest[c]=!0,e}function u(){}function l(e){var t=e.data;return t.aborted=!0,T.apply(t.target,t.args)}var p=O("addEventListener"),f=O("removeEventListener"),h=XMLHttpRequest.prototype[p],d=XMLHttpRequest.prototype[f];if(!h){var v=e.XMLHttpRequestEventTarget;v&&(h=v.prototype[p],d=v.prototype[f])}var g="readystatechange",y="scheduled",k=i(e.XMLHttpRequest.prototype,"open",function(){return function(e,t){return e[a]=0==t[2],k.apply(e,t)}}),m="XMLHttpRequest.send",_=i(e.XMLHttpRequest.prototype,"send",function(){return function(e,n){var o=t.current;if(e[a])return _.apply(e,n);var i={target:e,isPeriodic:!1,delay:null,args:n,aborted:!1};return o.scheduleMacroTask(m,u,i,r,l)}}),b="string",T=i(e.XMLHttpRequest.prototype,"abort",function(e){return function(e,t){var r=n(e);if(r&&typeof r.type==b){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}}})}r(e);var o=O("xhrTask"),a=O("xhrSync"),s=O("xhrListener"),c=O("xhrScheduled")}),Zone.__load_patch("geolocation",function(e,n,r){e.navigator&&e.navigator.geolocation&&t(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",function(e,t,n){function r(t){return function(n){var r=p(e,t);r.forEach(function(r){var o=e.PromiseRejectionEvent;if(o){var a=new o(t,{promise:n.promise,reason:n.rejection});r.invoke(a)}})}}e.PromiseRejectionEvent&&(t[O("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[O("rejectionHandledHandler")]=r("rejectionhandled"))}),Zone.__load_patch("util",function(e,t,n){n.patchOnProperties=o,n.patchMethod=i})});

@@ -8,2 +8,6 @@ /**

*/
/**
* @fileoverview
* @suppress {missingRequire}
*/

@@ -25,2 +29,5 @@ import {findEventTasks} from '../common/events';

patchTimer(global, set, clear, 'Immediate');
});
Zone.__load_patch('requestAnimationFrame', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
patchTimer(global, 'request', 'cancel', 'AnimationFrame');

@@ -52,2 +59,3 @@ patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');

patchClass('WebKitMutationObserver');
patchClass('IntersectionObserver');
patchClass('FileReader');

@@ -93,19 +101,37 @@ });

const SYMBOL_ADDEVENTLISTENER = zoneSymbol('addEventListener');
const SYMBOL_REMOVEEVENTLISTENER = zoneSymbol('removeEventListener');
let oriAddListener = (XMLHttpRequest.prototype as any)[SYMBOL_ADDEVENTLISTENER];
let oriRemoveListener = (XMLHttpRequest.prototype as any)[SYMBOL_REMOVEEVENTLISTENER];
if (!oriAddListener) {
const XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];
if (XMLHttpRequestEventTarget) {
oriAddListener = XMLHttpRequestEventTarget.prototype[SYMBOL_ADDEVENTLISTENER];
oriRemoveListener = XMLHttpRequestEventTarget.prototype[SYMBOL_REMOVEEVENTLISTENER];
}
}
const READY_STATE_CHANGE = 'readystatechange';
const SCHEDULED = 'scheduled';
function scheduleTask(task: Task) {
(XMLHttpRequest as any)[XHR_SCHEDULED] = false;
const data = <XHROptions>task.data;
const target = data.target;
// remove existing event listener
const listener = data.target[XHR_LISTENER];
const oriAddListener = data.target[zoneSymbol('addEventListener')];
const oriRemoveListener = data.target[zoneSymbol('removeEventListener')];
const listener = target[XHR_LISTENER];
if (!oriAddListener) {
oriAddListener = target[SYMBOL_ADDEVENTLISTENER];
oriRemoveListener = target[SYMBOL_REMOVEEVENTLISTENER];
}
if (listener) {
oriRemoveListener.apply(data.target, ['readystatechange', listener]);
oriRemoveListener.apply(target, [READY_STATE_CHANGE, listener]);
}
const newListener = data.target[XHR_LISTENER] = () => {
if (data.target.readyState === data.target.DONE) {
const newListener = target[XHR_LISTENER] = () => {
if (target.readyState === target.DONE) {
// sometimes on some browsers XMLHttpRequest will fire onreadystatechange with
// readyState=4 multiple times, so we need to check task state here
if (!data.aborted && (XMLHttpRequest as any)[XHR_SCHEDULED] &&
task.state === 'scheduled') {
if (!data.aborted && (XMLHttpRequest as any)[XHR_SCHEDULED] && task.state === SCHEDULED) {
task.invoke();

@@ -115,9 +141,9 @@ }

};
oriAddListener.apply(data.target, ['readystatechange', newListener]);
oriAddListener.apply(target, [READY_STATE_CHANGE, newListener]);
const storedTask: Task = data.target[XHR_TASK];
const storedTask: Task = target[XHR_TASK];
if (!storedTask) {
data.target[XHR_TASK] = task;
target[XHR_TASK] = task;
}
sendNative.apply(data.target, data.args);
sendNative.apply(target, data.args);
(XMLHttpRequest as any)[XHR_SCHEDULED] = true;

@@ -143,2 +169,3 @@ return task;

const XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';
const sendNative: Function = patchMethod(

@@ -154,6 +181,8 @@ window.XMLHttpRequest.prototype, 'send', () => function(self: any, args: any[]) {

return zone.scheduleMacroTask(
'XMLHttpRequest.send', placeholderCallback, options, scheduleTask, clearTask);
XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);
}
});
const STRING_TYPE = 'string';
const abortNative = patchMethod(

@@ -163,3 +192,3 @@ window.XMLHttpRequest.prototype, 'abort',

const task: Task = findPendingTask(self);
if (task && typeof task.type == 'string') {
if (task && typeof task.type == STRING_TYPE) {
// If the XHR has already completed, do nothing.

@@ -214,6 +243,5 @@ // If the XHR has already been aborted, do nothing.

Zone.__load_patch('util', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
api.patchOnProperties = patchOnProperties;
api.patchMethod = patchMethod;
});
});

@@ -20,2 +20,5 @@ /**

const unconfigurablesKey = zoneSymbol('unconfigurables');
const PROTOTYPE = 'prototype';
const OBJECT = 'object';
const UNDEFINED = 'undefined';

@@ -28,3 +31,3 @@ export function propertyPatch() {

const originalConfigurableFlag = desc.configurable;
if (prop !== 'prototype') {
if (prop !== PROTOTYPE) {
desc = rewriteDescriptor(obj, prop, desc);

@@ -43,3 +46,3 @@ }

Object.create = <any>function(obj: any, proto: any) {
if (typeof proto === 'object' && !Object.isFrozen(proto)) {
if (typeof proto === OBJECT && !Object.isFrozen(proto)) {
Object.keys(proto).forEach(function(prop) {

@@ -89,3 +92,3 @@ proto[prop] = rewriteDescriptor(obj, prop, proto[prop]);

// retry with the original flag value
if (typeof originalConfigurableFlag == 'undefined') {
if (typeof originalConfigurableFlag == UNDEFINED) {
delete desc.configurable;

@@ -92,0 +95,0 @@ } else {

@@ -8,2 +8,6 @@ /**

*/
/**
* @fileoverview
* @suppress {globalThis}
*/

@@ -215,3 +219,3 @@ import {isBrowser, isMix, isNode, patchClass, patchOnProperties, zoneSymbol} from '../common/utils';

const frameEventNames = ['load'];
const frameSetEventNames = ['blur', 'error', 'focus', 'load', 'resize', 'scroll'];
const frameSetEventNames = ['blur', 'error', 'focus', 'load', 'resize', 'scroll', 'messageerror'];
const marqueeEventNames = ['bounce', 'finish', 'start'];

@@ -231,2 +235,28 @@

export interface IgnoreProperty {
target: any;
ignoreProperties: string[];
}
function filterProperties(
target: any, onProperties: string[], ignoreProperties: IgnoreProperty[]): string[] {
if (!ignoreProperties) {
return onProperties;
}
const tip: IgnoreProperty[] = ignoreProperties.filter(ip => ip.target === target);
if (!tip || tip.length === 0) {
return onProperties;
}
const targetIgnoreProperties: string[] = tip[0].ignoreProperties;
return onProperties.filter(op => targetIgnoreProperties.indexOf(op) === -1);
}
export function patchFilteredProperties(
target: any, onProperties: string[], ignoreProperties: IgnoreProperty[], prototype?: any) {
const filteredProperties: string[] = filterProperties(target, onProperties, ignoreProperties);
patchOnProperties(target, filteredProperties, prototype);
}
export function propertyDescriptorPatch(api: _ZonePrivate, _global: any) {

@@ -239,2 +269,3 @@ if (isNode && !isMix) {

if (canPatchViaPropertyDescriptor()) {
const ignoreProperties: IgnoreProperty[] = _global.__Zone_ignore_on_properties;
// for browsers that we can patch the descriptor: Chrome & Firefox

@@ -244,38 +275,44 @@ if (isBrowser) {

// so we need to pass WindowPrototype to check onProp exist or not
patchOnProperties(window, eventNames, Object.getPrototypeOf(window));
patchOnProperties(Document.prototype, eventNames);
patchFilteredProperties(
window, eventNames.concat(['messageerror']), ignoreProperties,
Object.getPrototypeOf(window));
patchFilteredProperties(Document.prototype, eventNames, ignoreProperties);
if (typeof(<any>window)['SVGElement'] !== 'undefined') {
patchOnProperties((<any>window)['SVGElement'].prototype, eventNames);
patchFilteredProperties(
(<any>window)['SVGElement'].prototype, eventNames, ignoreProperties);
}
patchOnProperties(Element.prototype, eventNames);
patchOnProperties(HTMLElement.prototype, eventNames);
patchOnProperties(HTMLMediaElement.prototype, mediaElementEventNames);
patchOnProperties(HTMLFrameSetElement.prototype, windowEventNames.concat(frameSetEventNames));
patchOnProperties(HTMLBodyElement.prototype, windowEventNames.concat(frameSetEventNames));
patchOnProperties(HTMLFrameElement.prototype, frameEventNames);
patchOnProperties(HTMLIFrameElement.prototype, frameEventNames);
patchFilteredProperties(Element.prototype, eventNames, ignoreProperties);
patchFilteredProperties(HTMLElement.prototype, eventNames, ignoreProperties);
patchFilteredProperties(HTMLMediaElement.prototype, mediaElementEventNames, ignoreProperties);
patchFilteredProperties(
HTMLFrameSetElement.prototype, windowEventNames.concat(frameSetEventNames),
ignoreProperties);
patchFilteredProperties(
HTMLBodyElement.prototype, windowEventNames.concat(frameSetEventNames), ignoreProperties);
patchFilteredProperties(HTMLFrameElement.prototype, frameEventNames, ignoreProperties);
patchFilteredProperties(HTMLIFrameElement.prototype, frameEventNames, ignoreProperties);
const HTMLMarqueeElement = (window as any)['HTMLMarqueeElement'];
if (HTMLMarqueeElement) {
patchOnProperties(HTMLMarqueeElement.prototype, marqueeEventNames);
patchFilteredProperties(HTMLMarqueeElement.prototype, marqueeEventNames, ignoreProperties);
}
}
patchOnProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames);
patchFilteredProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames, ignoreProperties);
const XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget'];
if (XMLHttpRequestEventTarget) {
patchOnProperties(
patchFilteredProperties(
XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype,
XMLHttpRequestEventNames);
XMLHttpRequestEventNames, ignoreProperties);
}
if (typeof IDBIndex !== 'undefined') {
patchOnProperties(IDBIndex.prototype, IDBIndexEventNames);
patchOnProperties(IDBRequest.prototype, IDBIndexEventNames);
patchOnProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames);
patchOnProperties(IDBDatabase.prototype, IDBIndexEventNames);
patchOnProperties(IDBTransaction.prototype, IDBIndexEventNames);
patchOnProperties(IDBCursor.prototype, IDBIndexEventNames);
patchFilteredProperties(IDBIndex.prototype, IDBIndexEventNames, ignoreProperties);
patchFilteredProperties(IDBRequest.prototype, IDBIndexEventNames, ignoreProperties);
patchFilteredProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames, ignoreProperties);
patchFilteredProperties(IDBDatabase.prototype, IDBIndexEventNames, ignoreProperties);
patchFilteredProperties(IDBTransaction.prototype, IDBIndexEventNames, ignoreProperties);
patchFilteredProperties(IDBCursor.prototype, IDBIndexEventNames, ignoreProperties);
}
if (supportsWebSocket) {
patchOnProperties(WebSocket.prototype, websocketEventNames);
patchFilteredProperties(WebSocket.prototype, websocketEventNames, ignoreProperties);
}

@@ -323,2 +360,3 @@ } else {

} else {
const SYMBOL_FAKE_ONREADYSTATECHANGE = zoneSymbol('fakeonreadystatechange');
Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {

@@ -328,6 +366,6 @@ enumerable: true,

get: function() {
return this[zoneSymbol('fakeonreadystatechange')];
return this[SYMBOL_FAKE_ONREADYSTATECHANGE];
},
set: function(value) {
this[zoneSymbol('fakeonreadystatechange')] = value;
this[SYMBOL_FAKE_ONREADYSTATECHANGE] = value;
}

@@ -338,3 +376,3 @@ });

req.onreadystatechange = detectFunc;
const result = (req as any)[zoneSymbol('fakeonreadystatechange')] === detectFunc;
const result = (req as any)[SYMBOL_FAKE_ONREADYSTATECHANGE] === detectFunc;
req.onreadystatechange = null;

@@ -341,0 +379,0 @@ return result;

@@ -18,3 +18,3 @@ /**

if (!(<any>_global).EventTarget) {
patchEventTarget(api, _global, [WS.prototype]);
patchEventTarget(_global, [WS.prototype]);
}

@@ -37,3 +37,11 @@ (<any>_global).WebSocket = function(a: any, b: any) {

proxySocket[propName] = function() {
return socket[propName].apply(socket, arguments);
const args = Array.prototype.slice.call(arguments);
if (propName === 'addEventListener' || propName === 'removeEventListener') {
const eventName = args.length > 0 ? args[0] : undefined;
if (eventName) {
const propertySymbol = Zone.__symbol__('ON_PROPERTY' + eventName);
socket[propertySymbol] = proxySocket[propertySymbol];
}
}
return socket[propName].apply(socket, args);
};

@@ -47,8 +55,9 @@ });

patchOnProperties(proxySocket, ['close', 'error', 'message', 'open'], proxySocketProto);
return proxySocket;
};
const globalWebSocket = _global['WebSocket'];
for (const prop in WS) {
_global['WebSocket'][prop] = WS[prop];
globalWebSocket[prop] = WS[prop];
}
}

@@ -8,2 +8,6 @@ /**

*/
/**
* @fileoverview
* @suppress {globalThis,undefinedVars}
*/

@@ -104,5 +108,6 @@ /**

Object.keys(error).concat('stack', 'message').forEach((key) => {
if ((error as any)[key] !== undefined) {
const value = (error as any)[key];
if (value !== undefined) {
try {
this[key] = (error as any)[key];
this[key] = value;
} catch (e) {

@@ -167,2 +172,3 @@ // ignore the assignment in case it is a setter and it throws.

const ZONE_CAPTURESTACKTRACE = 'zoneCaptureStackTrace';
Object.defineProperty(ZoneAwareError, 'prepareStackTrace', {

@@ -183,3 +189,3 @@ get: function() {

// remove the first function which name is zoneCaptureStackTrace
if (st.getFunctionName() === 'zoneCaptureStackTrace') {
if (st.getFunctionName() === ZONE_CAPTURESTACKTRACE) {
structuredStackTrace.splice(i, 1);

@@ -199,2 +205,11 @@ break;

// find the frames of interest.
const ZONE_AWARE_ERROR = 'ZoneAwareError';
const ERROR_DOT = 'Error.';
const EMPTY = '';
const RUN_GUARDED = 'runGuarded';
const RUN_TASK = 'runTask';
const RUN = 'run';
const BRACKETS = '(';
const AT = '@';
let detectZone: Zone = Zone.current.fork({

@@ -219,14 +234,14 @@ name: 'detect',

// Safari: run@http://localhost:9876/base/build/lib/zone.js:101:24
let fnName: string = frame.split('(')[0].split('@')[0];
let fnName: string = frame.split(BRACKETS)[0].split(AT)[0];
let frameType = FrameType.transition;
if (fnName.indexOf('ZoneAwareError') !== -1) {
if (fnName.indexOf(ZONE_AWARE_ERROR) !== -1) {
zoneAwareFrame1 = frame;
zoneAwareFrame2 = frame.replace('Error.', '');
zoneAwareFrame2 = frame.replace(ERROR_DOT, EMPTY);
blackListedStackFrames[zoneAwareFrame2] = FrameType.blackList;
}
if (fnName.indexOf('runGuarded') !== -1) {
if (fnName.indexOf(RUN_GUARDED) !== -1) {
runGuardedFrame = true;
} else if (fnName.indexOf('runTask') !== -1) {
} else if (fnName.indexOf(RUN_TASK) !== -1) {
runTaskFrame = true;
} else if (fnName.indexOf('run') !== -1) {
} else if (fnName.indexOf(RUN) !== -1) {
runFrame = true;

@@ -233,0 +248,0 @@ } else {

@@ -8,2 +8,6 @@ /**

*/
/**
* @fileoverview
* @suppress {missingRequire}
*/
import {attachOriginToPatched, zoneSymbol} from './utils';

@@ -10,0 +14,0 @@

@@ -51,6 +51,8 @@ /**

const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__('unhandledPromiseRejectionHandler');
function handleUnhandledRejection(e: any) {
api.onUnhandledError(e);
try {
const handler = (Zone as any)[__symbol__('unhandledPromiseRejectionHandler')];
const handler = (Zone as any)[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];
if (handler && typeof handler === 'function') {

@@ -108,2 +110,7 @@ handler.apply(this, [e]);

const TYPE_ERROR = 'Promise resolved with itself';
const OBJECT = 'object';
const FUNCTION = 'function';
const CURRENT_TASK_SYMBOL = __symbol__('currentTask');
// Promise Resolution

@@ -114,3 +121,3 @@ function resolvePromise(

if (promise === value) {
throw new TypeError('Promise resolved with itself');
throw new TypeError(TYPE_ERROR);
}

@@ -121,3 +128,3 @@ if ((promise as any)[symbolState] === UNRESOLVED) {

try {
if (typeof value === 'object' || typeof value === 'function') {
if (typeof value === OBJECT || typeof value === FUNCTION) {
then = value && value.then;

@@ -137,3 +144,3 @@ }

resolvePromise(promise, (value as any)[symbolState], (value as any)[symbolValue]);
} else if (state !== REJECTED && typeof then === 'function') {
} else if (state !== REJECTED && typeof then === FUNCTION) {
try {

@@ -156,3 +163,3 @@ then.apply(value, [

if (state === REJECTED && value instanceof Error) {
(value as any)[__symbol__('currentTask')] = Zone.currentTask;
(value as any)[CURRENT_TASK_SYMBOL] = Zone.currentTask;
}

@@ -185,2 +192,3 @@

const REJECTION_HANDLED_HANDLER = __symbol__('rejectionHandledHandler');
function clearRejectedNoCatch(promise: ZoneAwarePromise<any>): void {

@@ -194,4 +202,4 @@ if ((promise as any)[symbolState] === REJECTED_NO_CATCH) {

try {
const handler = (Zone as any)[__symbol__('rejectionHandledHandler')];
if (handler && typeof handler === 'function') {
const handler = (Zone as any)[REJECTION_HANDLED_HANDLER];
if (handler && typeof handler === FUNCTION) {
handler.apply(this, [{rejection: (promise as any)[symbolValue], promise: promise}]);

@@ -215,4 +223,4 @@ }

const delegate = (promise as any)[symbolState] ?
(typeof onFulfilled === 'function') ? onFulfilled : forwardResolution :
(typeof onRejected === 'function') ? onRejected : forwardRejection;
(typeof onFulfilled === FUNCTION) ? onFulfilled : forwardResolution :
(typeof onRejected === FUNCTION) ? onRejected : forwardRejection;
zone.scheduleMicroTask(source, () => {

@@ -228,5 +236,7 @@ try {

const ZONE_AWARE_PROMISE_TO_STRING = 'function ZoneAwarePromise() { [native code] }';
class ZoneAwarePromise<R> implements Promise<R> {
static toString() {
return 'function ZoneAwarePromise() { [native code] }';
return ZONE_AWARE_PROMISE_TO_STRING;
}

@@ -377,3 +387,3 @@

let fetch = global['fetch'];
if (typeof fetch == 'function') {
if (typeof fetch == FUNCTION) {
global['fetch'] = zoneify(fetch);

@@ -380,0 +390,0 @@ }

@@ -8,2 +8,6 @@ /**

*/
/**
* @fileoverview
* @suppress {missingRequire}
*/

@@ -24,2 +28,8 @@ import {patchMethod} from './utils';

const tasksByHandleId: {[id: number]: Task} = {};
const NUMBER = 'number';
const STRING = 'string';
const FUNCTION = 'function';
const INTERVAL = 'Interval';
const TIMEOUT = 'Timeout';
const NOT_SCHEDULED = 'notScheduled';

@@ -32,3 +42,3 @@ function scheduleTask(task: Task) {

} finally {
if (typeof data.handleId === 'number') {
if (typeof data.handleId === NUMBER) {
// Node returns complex objects as handleIds

@@ -41,3 +51,3 @@ delete tasksByHandleId[data.handleId];

data.handleId = setNative.apply(window, data.args);
if (typeof data.handleId === 'number') {
if (typeof data.handleId === NUMBER) {
// Node returns complex objects as handleIds -> no need to keep them around. Additionally,

@@ -52,3 +62,3 @@ // this throws an

function clearTask(task: Task) {
if (typeof(<TimerOptions>task.data).handleId === 'number') {
if (typeof(<TimerOptions>task.data).handleId === NUMBER) {
// Node returns complex objects as handleIds

@@ -62,8 +72,8 @@ delete tasksByHandleId[(<TimerOptions>task.data).handleId];

patchMethod(window, setName, (delegate: Function) => function(self: any, args: any[]) {
if (typeof args[0] === 'function') {
if (typeof args[0] === FUNCTION) {
const zone = Zone.current;
const options: TimerOptions = {
handleId: null,
isPeriodic: nameSuffix === 'Interval',
delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null,
isPeriodic: nameSuffix === INTERVAL,
delay: (nameSuffix === TIMEOUT || nameSuffix === INTERVAL) ? args[1] || 0 : null,
args: args

@@ -79,4 +89,4 @@ };

// may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame
if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' &&
typeof handle.unref === 'function') {
if (handle && handle.ref && handle.unref && typeof handle.ref === FUNCTION &&
typeof handle.unref === FUNCTION) {
(<any>task).ref = (<any>handle).ref.bind(handle);

@@ -94,5 +104,5 @@ (<any>task).unref = (<any>handle).unref.bind(handle);

patchMethod(window, cancelName, (delegate: Function) => function(self: any, args: any[]) {
const task: Task = typeof args[0] === 'number' ? tasksByHandleId[args[0]] : args[0];
if (task && typeof task.type === 'string') {
if (task.state !== 'notScheduled' &&
const task: Task = typeof args[0] === NUMBER ? tasksByHandleId[args[0]] : args[0];
if (task && typeof task.type === STRING) {
if (task.state !== NOT_SCHEDULED &&
(task.cancelFn && task.data.isPeriodic || task.runCount === 0)) {

@@ -99,0 +109,0 @@ // Do not cancel already canceled functions

@@ -16,8 +16,13 @@ /**

Function.prototype.toString;
const FUNCTION = 'function';
const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol('OriginalDelegate');
const PROMISE_SYMBOL = zoneSymbol('Promise');
const ERROR_SYMBOL = zoneSymbol('Error');
Function.prototype.toString = function() {
if (typeof this === 'function') {
const originalDelegate = this[zoneSymbol('OriginalDelegate')];
if (typeof this === FUNCTION) {
const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];
if (originalDelegate) {
if (typeof originalDelegate === 'function') {
return originalFunctionToString.apply(this[zoneSymbol('OriginalDelegate')], arguments);
if (typeof originalDelegate === FUNCTION) {
return originalFunctionToString.apply(this[ORIGINAL_DELEGATE_SYMBOL], arguments);
} else {

@@ -28,3 +33,3 @@ return Object.prototype.toString.call(originalDelegate);

if (this === Promise) {
const nativePromise = global[zoneSymbol('Promise')];
const nativePromise = global[PROMISE_SYMBOL];
if (nativePromise) {

@@ -35,3 +40,3 @@ return originalFunctionToString.apply(nativePromise, arguments);

if (this === Error) {
const nativeError = global[zoneSymbol('Error')];
const nativeError = global[ERROR_SYMBOL];
if (nativeError) {

@@ -48,5 +53,6 @@ return originalFunctionToString.apply(nativeError, arguments);

const originalObjectToString = Object.prototype.toString;
const PROMISE_OBJECT_TO_STRING = '[object Promise]';
Object.prototype.toString = function() {
if (this instanceof Promise) {
return '[object Promise]';
return PROMISE_OBJECT_TO_STRING;
}

@@ -53,0 +59,0 @@ return originalObjectToString.apply(this, arguments);

@@ -11,3 +11,3 @@ /**

* @fileoverview
* @suppress {undefinedVars,globalThis}
* @suppress {undefinedVars,globalThis,missingRequire}
*/

@@ -22,5 +22,9 @@

const FUNCTION = 'function';
const UNDEFINED = 'undefined';
const REMOVE_ATTRIBUTE = 'removeAttribute';
export function bindArguments(args: any[], source: string): any[] {
for (let i = args.length - 1; i >= 0; i--) {
if (typeof args[i] === 'function') {
if (typeof args[i] === FUNCTION) {
args[i] = Zone.current.wrap(args[i], source + '_' + i);

@@ -38,2 +42,6 @@ }

if (delegate) {
const prototypeDesc = Object.getOwnPropertyDescriptor(prototype, name);
if (!isPropertyWritable(prototypeDesc)) {
continue;
}
prototype[name] = ((delegate: Function) => {

@@ -50,2 +58,18 @@ const patched: any = function() {

export function isPropertyWritable(propertyDesc: any) {
if (!propertyDesc) {
return true;
}
if (propertyDesc.writable === false) {
return false;
}
if (typeof propertyDesc.get === FUNCTION && typeof propertyDesc.set === UNDEFINED) {
return false;
}
return true;
}
export const isWebWorker: boolean =

@@ -70,2 +94,18 @@ (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);

const ON_PROPERTY_HANDLER_SYMBOL = zoneSymbol('onPropertyHandler');
const zoneSymbolEventNames: {[eventName: string]: string} = {};
const wrapFn = function(event: Event) {
let eventNameSymbol = zoneSymbolEventNames[event.type];
if (!eventNameSymbol) {
eventNameSymbol = zoneSymbolEventNames[event.type] = zoneSymbol('ON_PROPERTY' + event.type);
}
const listener = this[eventNameSymbol];
let result = listener && listener.apply(this, arguments);
if (result != undefined && !result) {
event.preventDefault();
}
return result;
};
export function patchProperty(obj: any, prop: string, prototype?: any) {

@@ -97,4 +137,8 @@ let desc = Object.getOwnPropertyDescriptor(obj, prop);

const eventName = prop.substr(2);
const _prop = zoneSymbol('_' + prop);
let eventNameSymbol = zoneSymbolEventNames[eventName];
if (!eventNameSymbol) {
eventNameSymbol = zoneSymbolEventNames[eventName] = zoneSymbol('ON_PROPERTY' + eventName);
}
desc.set = function(newValue) {

@@ -110,21 +154,12 @@ // in some of windows's onproperty callback, this is undefined

}
let previousValue = target[_prop];
let previousValue = target[eventNameSymbol];
if (previousValue) {
target.removeEventListener(eventName, previousValue);
target.removeEventListener(eventName, wrapFn);
}
if (typeof newValue === 'function') {
const wrapFn = function(event: Event) {
let result = newValue.apply(this, arguments);
if (result != undefined && !result) {
event.preventDefault();
}
return result;
};
target[_prop] = wrapFn;
target[eventNameSymbol] = newValue;
target.addEventListener(eventName, wrapFn, false);
} else {
target[_prop] = null;
target[eventNameSymbol] = null;
}

@@ -145,4 +180,4 @@ };

}
if (target.hasOwnProperty(_prop)) {
return target[_prop];
if (target[eventNameSymbol]) {
return wrapFn;
} else if (originalDescGet) {

@@ -158,3 +193,3 @@ // result will be null when use inline event attribute,

desc.set.apply(this, [value]);
if (typeof target['removeAttribute'] === 'function') {
if (typeof target[REMOVE_ATTRIBUTE] === FUNCTION) {
target.removeAttribute(prop);

@@ -275,2 +310,3 @@ }

}
const delegateName = zoneSymbol(name);

@@ -280,7 +316,12 @@ let delegate: Function;

delegate = proto[delegateName] = proto[name];
const patchDelegate = patchFn(delegate, delegateName, name);
proto[name] = function() {
return patchDelegate(this, arguments as any);
};
attachOriginToPatched(proto[name], delegate);
// check whether proto[name] is writable
// some property is readonly in safari, such as HtmlCanvasElement.prototype.toBlob
const desc = proto && Object.getOwnPropertyDescriptor(proto, name);
if (isPropertyWritable(desc)) {
const patchDelegate = patchFn(delegate, delegateName, name);
proto[name] = function() {
return patchDelegate(this, arguments as any);
};
attachOriginToPatched(proto[name], delegate);
}
}

@@ -380,2 +421,2 @@ return delegate;

}
}
}

@@ -14,7 +14,8 @@ /**

// safe to just expose a method to patch Bluebird explicitly
(Zone as any)[Zone.__symbol__('bluebird')] = function patchBluebird(Bluebird: any) {
const BLUEBIRD = 'bluebird';
(Zone as any)[Zone.__symbol__(BLUEBIRD)] = function patchBluebird(Bluebird: any) {
Bluebird.setScheduler((fn: Function) => {
Zone.current.scheduleMicroTask('bluebird', fn);
Zone.current.scheduleMicroTask(BLUEBIRD, fn);
});
};
});

@@ -10,9 +10,12 @@ /**

if (global.cordova) {
const SUCCESS_SOURCE = 'cordova.exec.success';
const ERROR_SOURCE = 'cordova.exec.error';
const FUNCTION = 'function';
const nativeExec: Function = api.patchMethod(
global.cordova, 'exec', (delegate: Function) => function(self: any, args: any[]) {
if (args.length > 0 && typeof args[0] === 'function') {
args[0] = Zone.current.wrap(args[0], 'cordova.exec.success');
if (args.length > 0 && typeof args[0] === FUNCTION) {
args[0] = Zone.current.wrap(args[0], SUCCESS_SOURCE);
}
if (args.length > 1 && typeof args[1] === 'function') {
args[1] = Zone.current.wrap(args[1], 'cordova.exec.error');
if (args.length > 1 && typeof args[1] === FUNCTION) {
args[1] = Zone.current.wrap(args[1], ERROR_SOURCE);
}

@@ -22,2 +25,19 @@ return nativeExec.apply(self, args);

}
});
Zone.__load_patch('cordova.FileReader', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
if (global.cordova && typeof global['FileReader'] !== 'undefined') {
document.addEventListener('deviceReady', () => {
const FileReader = global['FileReader'];
['abort', 'error', 'load', 'loadstart', 'loadend', 'progress'].forEach(prop => {
const eventNameSymbol = Zone.__symbol__('ON_PROPERTY' + prop);
Object.defineProperty(FileReader.prototype, eventNameSymbol, {
configurable: true,
get: function() {
return this._realReader && this._realReader[eventNameSymbol];
}
});
});
});
}
});

@@ -36,3 +36,3 @@ /**

};
const detectTimeout = global.setTimeout(noop, 100);
const detectTimeout = global.setTimeout(() => {}, 100);
clearTimeout(detectTimeout);

@@ -39,0 +39,0 @@ timers.setTimeout = originSetTimeout;

@@ -9,4 +9,15 @@ /**

import * as Rx from 'rxjs/Rx';
import 'rxjs/add/observable/bindCallback';
import 'rxjs/add/observable/bindNodeCallback';
import 'rxjs/add/observable/defer';
import 'rxjs/add/observable/forkJoin';
import 'rxjs/add/observable/fromEventPattern';
import 'rxjs/add/operator/multicast';
import {Observable} from 'rxjs/Observable';
import {asap} from 'rxjs/scheduler/asap';
import {Subscriber} from 'rxjs/Subscriber';
import {Subscription} from 'rxjs/Subscription';
import {rxSubscriber} from 'rxjs/symbol/rxSubscriber';
(Zone as any).__load_patch('rxjs', (global: any, Zone: ZoneType, api: any) => {

@@ -21,141 +32,136 @@ const symbol: (symbolString: string) => string = (Zone as any).__symbol__;

const patchObservableInstance = function(observable: any) {
observable._zone = Zone.current;
// patch inner function this._subscribe to check
// SubscriptionZone is same with ConstuctorZone or not
if (observable._subscribe && typeof observable._subscribe === 'function' &&
!observable._originalSubscribe) {
observable._originalSubscribe = observable._subscribe;
observable._subscribe = _patchedSubscribe;
}
const empty = {
closed: true,
next(value: any): void{},
error(err: any): void{throw err;},
complete(): void{}
};
const _patchedSubscribe = function() {
const currentZone = Zone.current;
const _zone = this._zone;
function toSubscriber<T>(
nextOrObserver?: any, error?: (error: any) => void, complete?: () => void): Subscriber<T> {
if (nextOrObserver) {
if (nextOrObserver instanceof Subscriber) {
return (<Subscriber<T>>nextOrObserver);
}
const args = Array.prototype.slice.call(arguments);
const subscriber = args.length > 0 ? args[0] : undefined;
// also keep currentZone in Subscriber
// for later Subscriber.next/error/complete method
if (subscriber && !subscriber._zone) {
subscriber._zone = currentZone;
if (nextOrObserver[rxSubscriber]) {
return nextOrObserver[rxSubscriber]();
}
}
// _subscribe should run in ConstructorZone
// but for performance concern, we should check
// whether ConsturctorZone === Zone.current here
const tearDownLogic = _zone !== Zone.current ?
_zone.run(this._originalSubscribe, this, args, subscribeSource) :
this._originalSubscribe.apply(this, args);
if (tearDownLogic && typeof tearDownLogic === 'function') {
const patchedTearDownLogic = function() {
// tearDownLogic should also run in ConstructorZone
// but for performance concern, we should check
// whether ConsturctorZone === Zone.current here
if (_zone && _zone !== Zone.current) {
return _zone.run(tearDownLogic, this, arguments, teardownSource);
} else {
return tearDownLogic.apply(this, arguments);
}
};
return patchedTearDownLogic;
}
return tearDownLogic;
};
const patchObservable = function(Rx: any, observableType: string) {
const symbolObservable = symbol(observableType);
const Observable = Rx[observableType];
if (!Observable || Observable[symbolObservable]) {
// the subclass of Observable not loaded or have been patched
return;
if (!nextOrObserver && !error && !complete) {
return new Subscriber(empty);
}
// monkey-patch Observable to save the
// current zone as ConstructorZone
const patchedObservable: any = Rx[observableType] = function() {
Observable.apply(this, arguments);
patchObservableInstance(this);
return this;
};
return new Subscriber(nextOrObserver, error, complete);
}
patchedObservable.prototype = Observable.prototype;
patchedObservable[symbolObservable] = Observable;
Object.keys(Observable).forEach(key => {
patchedObservable[key] = Observable[key];
});
const patchObservable = function() {
const ObservablePrototype: any = Observable.prototype;
const symbolSubscribe = symbol('subscribe');
const _symbolSubscribe = symbol('_subscribe');
const _subscribe = ObservablePrototype[_symbolSubscribe] = ObservablePrototype._subscribe;
const subscribe = ObservablePrototype[symbolSubscribe] = ObservablePrototype.subscribe;
if (!ObservablePrototype[symbolSubscribe]) {
const subscribe = ObservablePrototype[symbolSubscribe] = ObservablePrototype.subscribe;
// patch Observable.prototype.subscribe
// if SubscripitionZone is different with ConstructorZone
// we should run _subscribe in ConstructorZone and
// create sinke in SubscriptionZone,
// and tearDown should also run into ConstructorZone
Observable.prototype.subscribe = function() {
const _zone = this._zone;
const currentZone = Zone.current;
Object.defineProperties(Observable.prototype, {
_zone: {value: null, writable: true, configurable: true},
_zoneSource: {value: null, writable: true, configurable: true},
_zoneSubscribe: {value: null, writable: true, configurable: true},
source: {
configurable: true,
get: function(this: Observable<any>) {
return (this as any)._zoneSource;
},
set: function(this: Observable<any>, source: any) {
(this as any)._zone = Zone.current;
(this as any)._zoneSource = source;
}
},
_subscribe: {
configurable: true,
get: function(this: Observable<any>) {
if ((this as any)._zoneSubscribe) {
return (this as any)._zoneSubscribe;
} else if (this.constructor === Observable) {
return _subscribe;
}
const proto = Object.getPrototypeOf(this);
return proto && proto._subscribe;
},
set: function(this: Observable<any>, subscribe: any) {
(this as any)._zone = Zone.current;
(this as any)._zoneSubscribe = subscribe;
}
},
subscribe: {
writable: true,
configurable: true,
value: function(this: Observable<any>, observerOrNext: any, error: any, complete: any) {
// Only grab a zone if we Zone exists and it is different from the current zone.
const _zone = (this as any)._zone;
if (_zone && _zone !== Zone.current) {
// Current Zone is different from the intended zone.
// Restore the zone before invoking the subscribe callback.
return _zone.run(subscribe, this, [toSubscriber(observerOrNext, error, complete)]);
}
return subscribe.call(this, observerOrNext, error, complete);
}
}
});
};
// if operator is involved, we should also
// patch the call method to save the Subscription zone
if (this.operator && _zone && _zone !== currentZone) {
const call = this.operator.call;
this.operator.call = function() {
const args = Array.prototype.slice.call(arguments);
const subscriber = args.length > 0 ? args[0] : undefined;
if (!subscriber._zone) {
subscriber._zone = currentZone;
}
return _zone.run(call, this, args, subscribeSource);
};
const patchSubscription = function() {
const unsubscribeSymbol = symbol('unsubscribe');
const unsubscribe = (Subscription.prototype as any)[unsubscribeSymbol] =
Subscription.prototype.unsubscribe;
Object.defineProperties(Subscription.prototype, {
_zone: {value: null, writable: true, configurable: true},
_zoneUnsubscribe: {value: null, writable: true, configurable: true},
_unsubscribe: {
get: function(this: Subscription) {
if ((this as any)._zoneUnsubscribe) {
return (this as any)._zoneUnsubscribe;
}
const proto = Object.getPrototypeOf(this);
return proto && proto._unsubscribe;
},
set: function(this: Subscription, unsubscribe: any) {
(this as any)._zone = Zone.current;
(this as any)._zoneUnsubscribe = unsubscribe;
}
const result = subscribe.apply(this, arguments);
// the result is the subscriber sink,
// we save the current Zone here
if (!result._zone) {
result._zone = currentZone;
},
unsubscribe: {
writable: true,
configurable: true,
value: function(this: Subscription) {
// Only grab a zone if we Zone exists and it is different from the current zone.
const _zone: Zone = (this as any)._zone;
if (_zone && _zone !== Zone.current) {
// Current Zone is different from the intended zone.
// Restore the zone before invoking the subscribe callback.
_zone.run(unsubscribe, this);
} else {
unsubscribe.apply(this);
}
}
return result;
};
}
const symbolLift = symbol('lift');
if (!ObservablePrototype[symbolLift]) {
const lift = ObservablePrototype[symbolLift] = ObservablePrototype.lift;
// patch lift method to save ConstructorZone of Observable
Observable.prototype.lift = function() {
const observable = lift.apply(this, arguments);
patchObservableInstance(observable);
return observable;
};
}
const symbolCreate = symbol('create');
if (!patchedObservable[symbolCreate]) {
const create = patchedObservable[symbolCreate] = Observable.create;
// patch create method to save ConstructorZone of Observable
Rx.Observable.create = function() {
const observable = create.apply(this, arguments);
patchObservableInstance(observable);
return observable;
};
}
}
});
};
const patchSubscriber = function() {
const Subscriber = Rx.Subscriber;
const next = Subscriber.prototype.next;
const error = Subscriber.prototype.error;
const complete = Subscriber.prototype.complete;
const unsubscribe = Subscriber.prototype.unsubscribe;
Object.defineProperty(Subscriber.prototype, 'destination', {
configurable: true,
get: function(this: Subscriber<any>) {
return (this as any)._zoneDestination;
},
set: function(this: Subscriber<any>, destination: any) {
(this as any)._zone = Zone.current;
(this as any)._zoneDestination = destination;
}
});
// patch Subscriber.next to make sure it run

@@ -201,15 +207,6 @@ // into SubscriptionZone

};
};
Subscriber.prototype.unsubscribe = function() {
const currentZone = Zone.current;
const subscriptionZone = this._zone;
// for performance concern, check Zone.current
// equal with this._zone(SubscriptionZone) or not
if (subscriptionZone && subscriptionZone !== currentZone) {
return subscriptionZone.run(unsubscribe, this, arguments, unsubscribeSource);
} else {
return unsubscribe.apply(this, arguments);
}
};
const patchObservableInstance = function(observable: any) {
observable._zone = Zone.current;
};

@@ -223,2 +220,5 @@

const factoryCreator: any = obj[symbolFactory] = obj[factoryName];
if (!factoryCreator) {
return;
}
obj[factoryName] = function() {

@@ -234,6 +234,134 @@ const factory: any = factoryCreator.apply(this, arguments);

patchObservable(Rx, 'Observable');
const patchObservableFactory = function(obj: any, factoryName: string) {
const symbolFactory: string = symbol(factoryName);
if (obj[symbolFactory]) {
return;
}
const factory: any = obj[symbolFactory] = obj[factoryName];
if (!factory) {
return;
}
obj[factoryName] = function() {
const observable = factory.apply(this, arguments);
patchObservableInstance(observable);
return observable;
};
};
const patchObservableFactoryArgs = function(obj: any, factoryName: string) {
const symbolFactory: string = symbol(factoryName);
if (obj[symbolFactory]) {
return;
}
const factory: any = obj[symbolFactory] = obj[factoryName];
if (!factory) {
return;
}
obj[factoryName] = function() {
const initZone = Zone.current;
const args = Array.prototype.slice.call(arguments);
for (let i = 0; i < args.length; i++) {
const arg = args[i];
if (typeof arg === 'function') {
args[i] = function() {
const argArgs = Array.prototype.slice.call(arguments);
const runningZone = Zone.current;
if (initZone && runningZone && initZone !== runningZone) {
return initZone.run(arg, this, argArgs);
} else {
return arg.apply(this, argArgs);
}
};
}
}
const observable = factory.apply(this, args);
patchObservableInstance(observable);
return observable;
};
};
const patchMulticast = function() {
const obj: any = Observable.prototype;
const factoryName: string = 'multicast';
const symbolFactory: string = symbol(factoryName);
if (obj[symbolFactory]) {
return;
}
const factory: any = obj[symbolFactory] = obj[factoryName];
if (!factory) {
return;
}
obj[factoryName] = function() {
const _zone: any = Zone.current;
const args = Array.prototype.slice.call(arguments);
let subjectOrSubjectFactory: any = args.length > 0 ? args[0] : undefined;
if (typeof subjectOrSubjectFactory !== 'function') {
const originalFactory: any = subjectOrSubjectFactory;
subjectOrSubjectFactory = function() {
return originalFactory;
};
}
args[0] = function() {
let subject: any;
if (_zone && _zone !== Zone.current) {
subject = _zone.run(subjectOrSubjectFactory, this, arguments);
} else {
subject = subjectOrSubjectFactory.apply(this, arguments);
}
if (subject && _zone) {
subject._zone = _zone;
}
return subject;
};
const observable = factory.apply(this, args);
patchObservableInstance(observable);
return observable;
};
};
const patchImmediate = function(asap: any) {
if (!asap) {
return;
}
const scheduleSymbol = symbol('scheduleSymbol');
const flushSymbol = symbol('flushSymbol');
const zoneSymbol = symbol('zone');
if (asap[scheduleSymbol]) {
return;
}
const schedule = asap[scheduleSymbol] = asap.schedule;
asap.schedule = function() {
const args = Array.prototype.slice.call(arguments);
const work = args.length > 0 ? args[0] : undefined;
const delay = args.length > 1 ? args[1] : 0;
const state = (args.length > 2 ? args[2] : undefined) || {};
state[zoneSymbol] = Zone.current;
const patchedWork = function() {
const workArgs = Array.prototype.slice.call(arguments);
const action = workArgs.length > 0 ? workArgs[0] : undefined;
const scheduleZone = action && action[zoneSymbol];
if (scheduleZone && scheduleZone !== Zone.current) {
return scheduleZone.runGuarded(work, this, arguments);
} else {
return work.apply(this, arguments);
}
};
return schedule.apply(this, [patchedWork, delay, state]);
};
};
patchObservable();
patchSubscription();
patchSubscriber();
patchObservableFactoryCreator(Rx.Observable, 'bindCallback');
patchObservableFactoryCreator(Rx.Observable, 'bindNodeCallback');
patchObservableFactoryCreator(Observable, 'bindCallback');
patchObservableFactoryCreator(Observable, 'bindNodeCallback');
patchObservableFactory(Observable, 'defer');
patchObservableFactory(Observable, 'forkJoin');
patchObservableFactoryArgs(Observable, 'fromEventPattern');
patchMulticast();
patchImmediate(asap);
});

@@ -73,4 +73,9 @@ /**

tick(millis: number = 0): void {
tick(millis: number = 0, doTick?: (elapsed: number) => void): void {
let finalTime = this._currentTime + millis;
let lastCurrentTime = 0;
if (this._schedulerQueue.length === 0 && doTick) {
doTick(millis);
return;
}
while (this._schedulerQueue.length > 0) {

@@ -84,3 +89,7 @@ let current = this._schedulerQueue[0];

let current = this._schedulerQueue.shift();
lastCurrentTime = this._currentTime;
this._currentTime = current.endTime;
if (doTick) {
doTick(this._currentTime - lastCurrentTime);
}
let retval = current.func.apply(global, current.args);

@@ -96,6 +105,26 @@ if (!retval) {

flush(limit: number = 20, flushPeriodic = false): number {
flush(limit = 20, flushPeriodic = false, doTick?: (elapsed: number) => void): number {
if (flushPeriodic) {
return this.flushPeriodic(doTick);
} else {
return this.flushNonPeriodic(limit, doTick);
}
}
private flushPeriodic(doTick?: (elapsed: number) => void): number {
if (this._schedulerQueue.length === 0) {
return 0;
}
// Find the last task currently queued in the scheduler queue and tick
// till that time.
const startTime = this._currentTime;
const lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];
this.tick(lastTask.endTime - startTime, doTick);
return this._currentTime - startTime;
}
private flushNonPeriodic(limit: number, doTick?: (elapsed: number) => void): number {
const startTime = this._currentTime;
let lastCurrentTime = 0;
let count = 0;
let seenTimers: number[] = [];
while (this._schedulerQueue.length > 0) {

@@ -108,26 +137,18 @@ count++;

}
if (!flushPeriodic) {
// flush only non-periodic timers.
// If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing.
if (this._schedulerQueue.filter(task => !task.isPeriodic && !task.isRequestAnimationFrame)
.length === 0) {
break;
}
} else {
// flushPeriodic has been requested.
// Stop when all timer id-s have been seen at least once.
if (this._schedulerQueue
.filter(
task =>
seenTimers.indexOf(task.id) === -1 || this._currentTime === task.endTime)
.length === 0) {
break;
}
// flush only non-periodic timers.
// If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing.
if (this._schedulerQueue.filter(task => !task.isPeriodic && !task.isRequestAnimationFrame)
.length === 0) {
break;
}
let current = this._schedulerQueue.shift();
if (seenTimers.indexOf(current.id) === -1) {
seenTimers.push(current.id);
const current = this._schedulerQueue.shift();
lastCurrentTime = this._currentTime;
this._currentTime = current.endTime;
if (doTick) {
// Update any secondary schedulers like Jasmine mock Date.
doTick(this._currentTime - lastCurrentTime);
}
this._currentTime = current.endTime;
let retval = current.func.apply(global, current.args);
const retval = current.func.apply(global, current.args);
if (!retval) {

@@ -254,6 +275,6 @@ // Uncaught exception in the current scheduled function. Stop processing the queue.

tick(millis: number = 0): void {
tick(millis: number = 0, doTick?: (elapsed: number) => void): void {
FakeAsyncTestZoneSpec.assertInZone();
this.flushMicrotasks();
this._scheduler.tick(millis);
this._scheduler.tick(millis, doTick);
if (this._lastError !== null) {

@@ -279,6 +300,6 @@ this._resetLastErrorAndThrow();

flush(limit?: number, flushPeriodic?: boolean): number {
flush(limit?: number, flushPeriodic?: boolean, doTick?: (elapsed: number) => void): number {
FakeAsyncTestZoneSpec.assertInZone();
this.flushMicrotasks();
let elapsed = this._scheduler.flush(limit, flushPeriodic);
const elapsed = this._scheduler.flush(limit, flushPeriodic, doTick);
if (this._lastError !== null) {

@@ -285,0 +306,0 @@ this._resetLastErrorAndThrow();

@@ -8,2 +8,6 @@ /**

*/
/**
* @fileoverview
* @suppress {missingRequire}
*/

@@ -10,0 +14,0 @@ (function(global: any) {

@@ -627,2 +627,4 @@ /**

const Zone: ZoneType = (function(global: any) {
const FUNCTION = 'function';
const performance: {mark(name: string): void; measure(name: string, label: string): void;} =

@@ -724,3 +726,3 @@ global['performance'];

public wrap<T extends Function>(callback: T, source: string): T {
if (typeof callback !== 'function') {
if (typeof callback !== FUNCTION) {
throw new Error('Expecting function got: ' + callback);

@@ -1126,4 +1128,4 @@ }

const counts = this._taskCounts;
const prev = (counts as any)[type];
const next = (counts as any)[type] = prev + count;
const prev = counts[type];
const next = counts[type] = prev + count;
if (next < 0) {

@@ -1134,5 +1136,5 @@ throw new Error('More tasks executed then were scheduled.');

const isEmpty: HasTaskState = {
microTask: counts.microTask > 0,
macroTask: counts.macroTask > 0,
eventTask: counts.eventTask > 0,
microTask: counts['microTask'] > 0,
macroTask: counts['macroTask'] > 0,
eventTask: counts['eventTask'] > 0,
change: type

@@ -1256,2 +1258,3 @@ };

let _isDrainingMicrotaskQueue: boolean = false;
let nativeMicroTaskQueuePromise: any;

@@ -1263,4 +1266,9 @@ function scheduleMicroTask(task?: MicroTask) {

// We are not running in Task, so we need to kickstart the microtask queue.
if (global[symbolPromise]) {
global[symbolPromise].resolve(0)[symbolThen](drainMicroTaskQueue);
if (!nativeMicroTaskQueuePromise) {
if (global[symbolPromise]) {
nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0);
}
}
if (nativeMicroTaskQueuePromise) {
nativeMicroTaskQueuePromise[symbolThen](drainMicroTaskQueue);
} else {

@@ -1267,0 +1275,0 @@ global[symbolSetTimeout](drainMicroTaskQueue, 0);

{
"name": "zone.js",
"version": "0.8.16",
"version": "0.8.17",
"description": "Zones for JavaScript",

@@ -39,3 +39,3 @@ "main": "dist/zone-node.js",

"test:phantomjs": "npm run tsc && concurrently \"npm run tsc:w\" \"npm run ws-server\" \"npm run karma-jasmine:phantomjs\"",
"test:phantomjs-single": "concurrently \"npm run ws-server\" \"npm run karma-jasmine-phantomjs:autoclose\"",
"test:phantomjs-single": "npm run tsc && concurrently \"npm run ws-server\" \"npm run karma-jasmine-phantomjs:autoclose\"",
"test:single": "npm run tsc && concurrently \"npm run ws-server\" \"npm run karma-jasmine:autoclose\"",

@@ -42,0 +42,0 @@ "test-dist": "concurrently \"npm run tsc:w\" \"npm run ws-server\" \"karma start karma-dist-jasmine.conf.js\"",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc