Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elastic-apm-js-zone

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elastic-apm-js-zone - npm Package Compare versions

Comparing version 0.8.18-tskdt to 0.8.19-tskdt

dist/zone-patch-electron.js

46

dist/fake-async-test.js

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

var FakeAsyncTestZoneSpec = (function () {
function FakeAsyncTestZoneSpec(namePrefix, trackPendingRequestAnimationFrame) {
function FakeAsyncTestZoneSpec(namePrefix, trackPendingRequestAnimationFrame, macroTaskOptions) {
if (trackPendingRequestAnimationFrame === void 0) { trackPendingRequestAnimationFrame = false; }
this.trackPendingRequestAnimationFrame = trackPendingRequestAnimationFrame;
this.macroTaskOptions = macroTaskOptions;
this._scheduler = new Scheduler();

@@ -164,2 +165,7 @@ this._microtasks = [];

this.name = 'fakeAsyncTestZone for ' + namePrefix;
// in case user can't access the construction of FakyAsyncTestSpec
// user can also define macroTaskOptions by define a global variable.
if (!this.macroTaskOptions) {
this.macroTaskOptions = global[Zone.__symbol__('FakeAsyncTestMacroTask')];
}
}

@@ -336,2 +342,20 @@ FakeAsyncTestZoneSpec.assertInZone = function () {

default:
// user can define which macroTask they want to support by passing
// macroTaskOptions
var macroTaskOption = this.findMacroTaskOption(task);
if (macroTaskOption) {
var args_1 = task.data && task.data['args'];
var delay = args_1 && args_1.length > 1 ? args_1[1] : 0;
var callbackArgs = macroTaskOption.callbackArgs ? macroTaskOption.callbackArgs : args_1;
if (!!macroTaskOption.isPeriodic) {
// periodic macroTask, use setInterval to simulate
task.data['handleId'] = this._setInterval(task.invoke, delay, callbackArgs);
task.data.isPeriodic = true;
}
else {
// not periodic, use setTimout to simulate
task.data['handleId'] = this._setTimeout(task.invoke, delay, callbackArgs);
}
break;
}
throw new Error('Unknown macroTask scheduled in fake async test: ' + task.source);

@@ -356,5 +380,25 @@ }

default:
// user can define which macroTask they want to support by passing
// macroTaskOptions
var macroTaskOption = this.findMacroTaskOption(task);
if (macroTaskOption) {
var handleId = task.data['handleId'];
return macroTaskOption.isPeriodic ? this._clearInterval(handleId) :
this._clearTimeout(handleId);
}
return delegate.cancelTask(target, task);
}
};
FakeAsyncTestZoneSpec.prototype.findMacroTaskOption = function (task) {
if (!this.macroTaskOptions) {
return null;
}
for (var i = 0; i < this.macroTaskOptions.length; i++) {
var macroTaskOption = this.macroTaskOptions[i];
if (macroTaskOption.source === task.source) {
return macroTaskOption;
}
}
return null;
};
FakeAsyncTestZoneSpec.prototype.onHandleError = function (parentZoneDelegate, currentZone, targetZone, error) {

@@ -361,0 +405,0 @@ this._lastError = error;

@@ -72,2 +72,3 @@ /**

var originalJasmineFn = jasmineEnv[methodName];
jasmineEnv[Zone.__symbol__(methodName)] = originalJasmineFn;
jasmineEnv[methodName] = function (description, specDefinitions, timeout) {

@@ -80,2 +81,3 @@ arguments[1] = wrapTestInZone(specDefinitions);

var originalJasmineFn = jasmineEnv[methodName];
jasmineEnv[Zone.__symbol__(methodName)] = originalJasmineFn;
jasmineEnv[methodName] = function (specDefinitions, timeout) {

@@ -82,0 +84,0 @@ arguments[0] = wrapTestInZone(specDefinitions);

2

dist/jasmine-patch.min.js

@@ -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";!function(){function e(e){return function(){return c.run(e,this,arguments)}}function n(e){return e&&(e.length?function(n){return u.run(e,this,[n])}:function(){return u.run(e,this)})}var r=function(e,n){function r(){this.constructor=e}for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)};if(!Zone)throw new Error("Missing: zone.js");if("undefined"==typeof jasmine)throw new Error("Missing: jasmine.js");if(jasmine.__zone_patch__)throw new Error("'jasmine' has already been patched with 'Zone'.");jasmine.__zone_patch__=!0;var t=Zone.SyncTestZoneSpec,o=Zone.ProxyZoneSpec;if(!t)throw new Error("Missing: SyncTestZoneSpec");if(!o)throw new Error("Missing: ProxyZoneSpec");var i=Zone.current,c=i.fork(new t("jasmine.describe")),u=null,s=jasmine.getEnv();["describe","xdescribe","fdescribe"].forEach(function(n){var r=s[n];s[n]=function(n,t){return r.call(this,n,e(t))}}),["it","xit","fit"].forEach(function(e){var r=s[e];s[e]=function(e,t,o){return arguments[1]=n(t),r.apply(this,arguments)}}),["beforeEach","afterEach"].forEach(function(e){var r=s[e];s[e]=function(e,t){return arguments[0]=n(e),r.apply(this,arguments)}});var f=jasmine.QueueRunner;jasmine.QueueRunner=function(e){function n(n){n.onComplete=function(e){return function(){u=null,i.scheduleMicroTask("jasmine.onComplete",e)}}(n.onComplete),e.call(this,n)}return r(n,e),n.prototype.execute=function(){var n=this;if(Zone.current!==i)throw new Error("Unexpected Zone: "+Zone.current.name);u=i.fork(new o),Zone.currentTask?e.prototype.execute.call(this):Zone.current.scheduleMicroTask("jasmine.execute().forceTask",function(){return f.prototype.execute.call(n)})},n}(f)}()});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(this,function(){"use strict";!function(){function e(e){return function(){return c.run(e,this,arguments)}}function n(e){return e&&(e.length?function(n){return u.run(e,this,[n])}:function(){return u.run(e,this)})}var r=function(e,n){function r(){this.constructor=e}for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)};if(!Zone)throw new Error("Missing: zone.js");if("undefined"==typeof jasmine)throw new Error("Missing: jasmine.js");if(jasmine.__zone_patch__)throw new Error("'jasmine' has already been patched with 'Zone'.");jasmine.__zone_patch__=!0;var t=Zone.SyncTestZoneSpec,o=Zone.ProxyZoneSpec;if(!t)throw new Error("Missing: SyncTestZoneSpec");if(!o)throw new Error("Missing: ProxyZoneSpec");var i=Zone.current,c=i.fork(new t("jasmine.describe")),u=null,s=jasmine.getEnv();["describe","xdescribe","fdescribe"].forEach(function(n){var r=s[n];s[n]=function(n,t){return r.call(this,n,e(t))}}),["it","xit","fit"].forEach(function(e){var r=s[e];s[Zone.__symbol__(e)]=r,s[e]=function(e,t,o){return arguments[1]=n(t),r.apply(this,arguments)}}),["beforeEach","afterEach"].forEach(function(e){var r=s[e];s[Zone.__symbol__(e)]=r,s[e]=function(e,t){return arguments[0]=n(e),r.apply(this,arguments)}});var f=jasmine.QueueRunner;jasmine.QueueRunner=function(e){function n(n){n.onComplete=function(e){return function(){u=null,i.scheduleMicroTask("jasmine.onComplete",e)}}(n.onComplete),e.call(this,n)}return r(n,e),n.prototype.execute=function(){var n=this;if(Zone.current!==i)throw new Error("Unexpected Zone: "+Zone.current.name);u=i.fork(new o),Zone.currentTask?e.prototype.execute.call(this):Zone.current.scheduleMicroTask("jasmine.execute().forceTask",function(){return f.prototype.execute.call(n)})},n}(f)}()});

@@ -94,4 +94,3 @@ /**

}
var task = error[Zone.__symbol__('currentTask')];
var trace = task && task.data && task.data[creationTrace];
var trace = error[Zone.__symbol__('currentTaskTrace')];
if (!trace) {

@@ -98,0 +97,0 @@ return error.stack;

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

!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r():"function"==typeof define&&define.amd?define(r):r()}(this,function(){"use strict";function t(){return new Error(u)}function r(){try{throw t()}catch(r){return r}}function a(t){return t.stack?t.stack.split(o):[]}function e(t,r){for(var e=a(r),n=0;n<e.length;n++){var c=e[n];s.hasOwnProperty(c)||t.push(e[n])}}function n(t,r){var a=[r?r.trim():""];if(t)for(var n=(new Date).getTime(),c=0;c<t.length;c++){var i=t[c],s=i.timestamp,f="____________________Elapsed "+(n-s.getTime())+" ms; At: "+s;f=f.replace(/[^\w\d]/g,"_"),a.push(k.replace(_,f)),e(a,i.error),n=s.getTime()}return a.join(o)}function c(t,r){r>0&&(t.push(a((new h).error)),c(t,r-1))}function i(){if(!(Error.stackTraceLimit<=0)){var t=[];c(t,2);for(var r=t[0],a=t[1],e=0;e<r.length;e++){var n=r[e];if(n.indexOf(u)==-1){var i=n.match(/^\s*at\s+/);if(i){k=i[0]+_+" (http://localhost)";break}}}for(var e=0;e<r.length;e++){var n=r[e],o=a[e];if(n!==o)break;s[n]=!0}}}var o="\n",s={},f="__creationTrace__",u="STACKTRACE TRACKING",_="__SEP_TAG__",k=_+"@[native]",h=function(){function t(){this.error=T(),this.timestamp=new Date}return t}(),l=t(),d=r(),T=l.stack?t:d.stack?r:t;Zone.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(t){if(t){var r=t[Zone.__symbol__("currentTask")],a=r&&r.data&&r.data[f];return a?n(a,t.stack):t.stack}},onScheduleTask:function(t,r,a,e){if(Error.stackTraceLimit>0){var n=Zone.currentTask,c=n&&n.data&&n.data[f]||[];c=[new h].concat(c),c.length>this.longStackTraceLimit&&(c.length=this.longStackTraceLimit),e.data||(e.data={}),e.data[f]=c}return t.scheduleTask(a,e)},onHandleError:function(t,r,a,e){if(Error.stackTraceLimit>0){var c=Zone.currentTask||e.task;if(e instanceof Error&&c){var i=n(c.data&&c.data[f],e.stack);try{e.stack=e.longStack=i}catch(o){}}}return t.handleError(a,e)}},i()});
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r():"function"==typeof define&&define.amd?define(r):r()}(this,function(){"use strict";function t(){return new Error(u)}function r(){try{throw t()}catch(r){return r}}function a(t){return t.stack?t.stack.split(o):[]}function e(t,r){for(var e=a(r),n=0;n<e.length;n++){var c=e[n];s.hasOwnProperty(c)||t.push(e[n])}}function n(t,r){var a=[r?r.trim():""];if(t)for(var n=(new Date).getTime(),c=0;c<t.length;c++){var i=t[c],s=i.timestamp,f="____________________Elapsed "+(n-s.getTime())+" ms; At: "+s;f=f.replace(/[^\w\d]/g,"_"),a.push(k.replace(_,f)),e(a,i.error),n=s.getTime()}return a.join(o)}function c(t,r){r>0&&(t.push(a((new h).error)),c(t,r-1))}function i(){if(!(Error.stackTraceLimit<=0)){var t=[];c(t,2);for(var r=t[0],a=t[1],e=0;e<r.length;e++){var n=r[e];if(n.indexOf(u)==-1){var i=n.match(/^\s*at\s+/);if(i){k=i[0]+_+" (http://localhost)";break}}}for(var e=0;e<r.length;e++){var n=r[e],o=a[e];if(n!==o)break;s[n]=!0}}}var o="\n",s={},f="__creationTrace__",u="STACKTRACE TRACKING",_="__SEP_TAG__",k=_+"@[native]",h=function(){function t(){this.error=d(),this.timestamp=new Date}return t}(),l=t(),T=r(),d=l.stack?t:T.stack?r:t;Zone.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(t){if(t){var r=t[Zone.__symbol__("currentTaskTrace")];return r?n(r,t.stack):t.stack}},onScheduleTask:function(t,r,a,e){if(Error.stackTraceLimit>0){var n=Zone.currentTask,c=n&&n.data&&n.data[f]||[];c=[new h].concat(c),c.length>this.longStackTraceLimit&&(c.length=this.longStackTraceLimit),e.data||(e.data={}),e.data[f]=c}return t.scheduleTask(a,e)},onHandleError:function(t,r,a,e){if(Error.stackTraceLimit>0){var c=Zone.currentTask||e.task;if(e instanceof Error&&c){var i=n(c.data&&c.data[f],e.stack);try{e.stack=e.longStack=i}catch(o){}}}return t.handleError(a,e)}},i()});

@@ -154,4 +154,4 @@ /**

})(Mocha.Runner.prototype.runTest, Mocha.Runner.prototype.run);
})(window);
})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);
})));

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

!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(this,function(){"use strict";!function(n){function e(n,e,t){for(var r=function(r){var o=n[r];"function"==typeof o&&(n[r]=0===o.length?e(o):t(o),n[r].toString=function(){return o.toString()})},o=0;o<n.length;o++)r(o);return n}function t(n){var t=function(n){return function(){return s.run(n,this,arguments)}};return e(n,t)}function r(n){var t=function(n){return function(e){return a.run(n,this,[e])}},r=function(n){return function(){return a.run(n,this)}};return e(n,r,t)}function o(n){var t=function(n){return function(e){return p.run(n,this,[e])}},r=function(n){return function(){return p.run(n,this)}};return e(n,r,t)}var i=n.Mocha;if("undefined"==typeof i)throw new Error("Missing Mocha.js");if("undefined"==typeof Zone)throw new Error("Missing Zone.js");var u=Zone.ProxyZoneSpec,c=Zone.SyncTestZoneSpec;if(!u)throw new Error("Missing ProxyZoneSpec");if(i.__zone_patch__)throw new Error('"Mocha" has already been patched with "Zone".');i.__zone_patch__=!0;var f=Zone.current,s=f.fork(new c("Mocha.describe")),a=null,p=f.fork(new u),h={after:i.after,afterEach:i.afterEach,before:i.before,beforeEach:i.beforeEach,describe:i.describe,it:i.it};n.describe=n.suite=i.describe=function(){return h.describe.apply(this,t(arguments))},n.xdescribe=n.suite.skip=i.describe.skip=function(){return h.describe.skip.apply(this,t(arguments))},n.describe.only=n.suite.only=i.describe.only=function(){return h.describe.only.apply(this,t(arguments))},n.it=n.specify=n.test=i.it=function(){return h.it.apply(this,r(arguments))},n.xit=n.xspecify=i.it.skip=function(){return h.it.skip.apply(this,r(arguments))},n.it.only=n.test.only=i.it.only=function(){return h.it.only.apply(this,r(arguments))},n.after=n.suiteTeardown=i.after=function(){return h.after.apply(this,o(arguments))},n.afterEach=n.teardown=i.afterEach=function(){return h.afterEach.apply(this,r(arguments))},n.before=n.suiteSetup=i.before=function(){return h.before.apply(this,o(arguments))},n.beforeEach=n.setup=i.beforeEach=function(){return h.beforeEach.apply(this,r(arguments))},function(n,e){i.Runner.prototype.runTest=function(e){var t=this;Zone.current.scheduleMicroTask("mocha.forceTask",function(){n.call(t,e)})},i.Runner.prototype.run=function(n){return this.on("test",function(n){if(Zone.current!==f)throw new Error("Unexpected zone: "+Zone.current.name);a=f.fork(new u)}),e.call(this,n)}}(i.Runner.prototype.runTest,i.Runner.prototype.run)}(window)});
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(this,function(){"use strict";!function(n){function e(n,e,t){for(var r=function(r){var o=n[r];"function"==typeof o&&(n[r]=0===o.length?e(o):t(o),n[r].toString=function(){return o.toString()})},o=0;o<n.length;o++)r(o);return n}function t(n){var t=function(n){return function(){return s.run(n,this,arguments)}};return e(n,t)}function r(n){var t=function(n){return function(e){return a.run(n,this,[e])}},r=function(n){return function(){return a.run(n,this)}};return e(n,r,t)}function o(n){var t=function(n){return function(e){return p.run(n,this,[e])}},r=function(n){return function(){return p.run(n,this)}};return e(n,r,t)}var i=n.Mocha;if("undefined"==typeof i)throw new Error("Missing Mocha.js");if("undefined"==typeof Zone)throw new Error("Missing Zone.js");var u=Zone.ProxyZoneSpec,f=Zone.SyncTestZoneSpec;if(!u)throw new Error("Missing ProxyZoneSpec");if(i.__zone_patch__)throw new Error('"Mocha" has already been patched with "Zone".');i.__zone_patch__=!0;var c=Zone.current,s=c.fork(new f("Mocha.describe")),a=null,p=c.fork(new u),h={after:i.after,afterEach:i.afterEach,before:i.before,beforeEach:i.beforeEach,describe:i.describe,it:i.it};n.describe=n.suite=i.describe=function(){return h.describe.apply(this,t(arguments))},n.xdescribe=n.suite.skip=i.describe.skip=function(){return h.describe.skip.apply(this,t(arguments))},n.describe.only=n.suite.only=i.describe.only=function(){return h.describe.only.apply(this,t(arguments))},n.it=n.specify=n.test=i.it=function(){return h.it.apply(this,r(arguments))},n.xit=n.xspecify=i.it.skip=function(){return h.it.skip.apply(this,r(arguments))},n.it.only=n.test.only=i.it.only=function(){return h.it.only.apply(this,r(arguments))},n.after=n.suiteTeardown=i.after=function(){return h.after.apply(this,o(arguments))},n.afterEach=n.teardown=i.afterEach=function(){return h.afterEach.apply(this,r(arguments))},n.before=n.suiteSetup=i.before=function(){return h.before.apply(this,o(arguments))},n.beforeEach=n.setup=i.beforeEach=function(){return h.beforeEach.apply(this,r(arguments))},function(n,e){i.Runner.prototype.runTest=function(e){var t=this;Zone.current.scheduleMicroTask("mocha.forceTask",function(){n.call(t,e)})},i.Runner.prototype.run=function(n){return this.on("test",function(n){if(Zone.current!==c)throw new Error("Unexpected zone: "+Zone.current.name);a=c.fork(new u)}),e.call(this,n)}}(i.Runner.prototype.runTest,i.Runner.prototype.run)}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global)});

@@ -91,3 +91,2 @@ /**

};
return WtfZoneSpec;

@@ -94,0 +93,0 @@ }());

@@ -9,2 +9,7 @@ /**

/**
* Suppress closure compiler errors about unknown 'global' variable
* @fileoverview
* @suppress {undefinedVars}
*/
/**
* Zone is a mechanism for intercepting and keeping track of asynchronous work.

@@ -11,0 +16,0 @@ *

@@ -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--)typeof e[n]===j&&(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!==j||typeof e.set!==C)}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=x[i];s||(s=x[i]=P("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,F),"function"==typeof t?(n[s]=t,n.addEventListener(i,F,!1)):n[s]=null}},r.get=function(){var n=this;if(n||e!==z||(n=z),!n)return null;var o=n[s];if(o)return o;if(a){var i=a&&a.apply(this);if(i)return r.set.apply(this,[i]),typeof n[L]===j&&n.removeAttribute(t),i}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[P(t)]=n,z[t]=function(){var r=e(arguments,t);switch(r.length){case 0:this[q]=new n;break;case 1:this[q]=new n(r[0]);break;case 2:this[q]=new n(r[0],r[1]);break;case 3:this[q]=new n(r[0],r[1],r[2]);break;case 4:this[q]=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[q][e].apply(this[q],arguments)}:Object.defineProperty(z[t].prototype,e,{set:function(n){"function"==typeof n?(this[q][e]=Zone.current.wrap(n,t+"."+e),c(this[q][e],n)):this[q][e]=n},get:function(){return this[q][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=P(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[P("OriginalDelegate")]=t}function u(){if(N)return A;N=!0;try{var e=window.navigator.userAgent;e.indexOf("MSIE ");return e.indexOf("MSIE ")===-1&&e.indexOf("Trident/")===-1&&e.indexOf("Edge/")===-1||(A=!0),A}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[P(a)]=m[a],E=m[P(i)]=m[i],D=m[P(s)]=m[s];n&&n.prependEventListenerFnName&&(_=m[P(n.prependEventListenerFnName)]=m[n.prependEventListenerFnName]);var O=function(e){if(!b.isExisting)return T.apply(b.target,[b.eventName,b.capture?g:v,b.options])},Z=function(e){if(!e.isRemoved){var t=U[e.eventName],n=void 0;t&&(n=t[e.capture?B:X]);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])},S=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?O:S,L=r?Z:j,M=function(e,t){var n=typeof t;return n===K&&e.callback===t||n===Y&&e.originalDelegate===t},I=n&&n.compareTaskCallbackVsDelegate?n.compareTaskCallbackVsDelegate:M,R=function(t,n,o,a,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),function(){var c=this||e,u=arguments[1];if(!u)return t.apply(this,arguments);var l=!1;if(typeof u!==K){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=U[f];if(m)g=m[p?B:X];else{var _=f+X,T=f+B,w=J+_,E=J+T;U[f]={},U[f][X]=w,U[f][B]=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[V],z=G[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?W:null;j&&(j.taskData=b);var C=k.scheduleEventTask(S,u,j,o,a);return j&&(j.taskData=null),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]=R(T,l,C,L,k),_&&(m[f]=R(_,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=U[r];s&&(i=s[t?B:X]);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=U[n];if(r){var o=r[X],i=r[B],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=Q.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=P(o),l="."+o+":",f="prependListener",h="."+f+":",d=function(e,t,n){if(!e.isRemoved){var r=e.callback;typeof r===Y&&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){if(t=t||e.event){var n=this||t.target||e,r=n[U[t.type][X]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length&&(!t||t[$]!==!0);a++)d(o[a],n,t)}},g=function(t){if(t=t||e.event){var n=this||t.target||e,r=n[U[t.type][B]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length&&(!t||t[$]!==!0);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=Q.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){var n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",function(e){return function(e,t){e[$]=!0}})}function h(e,t,n,r){function o(t){function n(){try{t.invoke.apply(this,arguments)}finally{typeof r.handleId===l?delete u[r.handleId]:r.handleId&&(r.handleId[ee]=null)}}var r=t.data;return r.args[0]=n,r.handleId=s.apply(e,r.args),t}function a(e){return 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,p={handleId:null,isPeriodic:r===h,delay:r===d||r===h?s[1]||0:null,args:s},v=c.scheduleMacroTask(t,s[0],p,o,a);if(!v)return v;var g=v.data.handleId;return typeof g===l?u[g]=v:g&&(g[ee]=v),g&&g.ref&&g.unref&&typeof g.ref===f&&typeof g.unref===f&&(v.ref=g.ref.bind(g),v.unref=g.unref.bind(g)),typeof g===l||g?g:v}return n.apply(e,s)}}),c=i(e,n,function(t){return function(n,r){var o,a=r[0];typeof a===l?o=u[a]:(o=a&&a[ee],o||(o=a)),o&&typeof o.type===p?o.state!==v&&(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&(typeof a===l?delete u[a]:a&&(a[ee]=null),o.zone.cancelTask(o)):t.apply(e,r)}})}function d(){Object.defineProperty=function(e,t,n){if(g(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return t!==ae&&(n=y(e,t,n)),k(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!==ie||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=y(e,n,t[n])}),re(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=ne(e,t);return g(e,t)&&(n.configurable=!1),n}}function v(e,t,n){var r=n.configurable;return n=y(e,t,n),k(e,t,n,r)}function g(e,t){return e&&e[oe]&&e[oe][t]}function y(e,t,n){return n.configurable=!0,n.configurable||(e[oe]||te(e,oe,{writable:!0,value:{}}),e[oe][t]=!0),n}function k(e,t,n,r){try{return te(e,t,n)}catch(o){if(!n.configurable)throw o;typeof r==se?delete n.configurable:n.configurable=r;try{return te(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 m(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 _(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 b(e,t,n,r){var a=_(e,t,n);o(e,a,r)}function T(e,t){if(!I||H){var n="undefined"!=typeof WebSocket;if(w()){var r=t.__Zone_ignore_on_properties;if(R){b(window,Ee.concat(["messageerror"]),r,Object.getPrototypeOf(window)),b(Document.prototype,Ee,r),"undefined"!=typeof window.SVGElement&&b(window.SVGElement.prototype,Ee,r),b(Element.prototype,Ee,r),b(HTMLElement.prototype,Ee,r),b(HTMLMediaElement.prototype,fe,r),b(HTMLFrameSetElement.prototype,le.concat(ke),r),b(HTMLBodyElement.prototype,le.concat(ke),r),b(HTMLFrameElement.prototype,ye,r),b(HTMLIFrameElement.prototype,ye,r);var o=window.HTMLMarqueeElement;o&&b(o.prototype,me,r);var i=window.Worker;i&&b(i.prototype,we,r)}b(XMLHttpRequest.prototype,_e,r);var s=t.XMLHttpRequestEventTarget;s&&b(s&&s.prototype,_e,r),"undefined"!=typeof IDBIndex&&(b(IDBIndex.prototype,be,r),b(IDBRequest.prototype,be,r),b(IDBOpenDBRequest.prototype,be,r),b(IDBDatabase.prototype,be,r),b(IDBTransaction.prototype,be,r),b(IDBCursor.prototype,be,r)),n&&b(WebSocket.prototype,Te,r)}else E(),a("XMLHttpRequest"),n&&m(e,t)}}function w(){if((R||H)&&!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=P("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 E(){for(var e=function(e){var t=Ee[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][De]&&(t=Zone.current.wrap(o[n],r),t[De]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<Ee.length;t++)e(t)}function D(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<Ee.length;g++){var y=Ee[g],k=y+X,m=y+B,_=J+k,b=J+m;U[y]={},U[y][X]=_,U[y][B]=b}for(var g=0;g<n.length;g++)for(var T=s[g],w=G[T]={},E=0;E<Ee.length;E++){var y=Ee[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 O(e,t){f(e,t)}function Z(e){if((R||H)&&"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),v(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)}}var S=(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===I&&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 L.zone},enumerable:!0,configurable:!0}),Object.defineProperty(r,"currentTask",{get:function(){return M},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),L={parent:L,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{L=L.parent}},r.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),L={parent:L,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{L=L.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=M;M=e,L={parent:L,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,_))),L=L.parent,M=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||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),I++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==I&&o(),I--}},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 L},onUnhandledError:a,microtaskDrainDone:a,scheduleMicroTask:r,showUncaughtError:function(){return!u[i("ignoreConsoleErrorUncaughtError")]},patchEventTarget:function(){return[]},patchOnProperties:a,patchMethod:function(){return a},setNativePromise:function(e){e&&typeof e.resolve===s&&(l=e.resolve(0))}},j="__rootZoneSpec__",C=new u(null,null);e[j]&&(C=C.fork(e[j]),delete e[j]);var L={parent:null,zone:C},M=null,I=0;return n("Zone","Zone"),e.Zone=u}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global),function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}});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 L.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!==P||(i=o&&o.then)}catch(p){return a(function(){c(e,!1,p)})(),e}if(r!==w&&o instanceof L&&o.hasOwnProperty(k)&&o.hasOwnProperty(m)&&o[k]!==b)u(o),c(e,o[k],o[m]);else if(r!==w&&typeof i===P)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[z]=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[j];n&&typeof n===P&&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===P?r:a:typeof o===P?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 L(function(e,t){n.call(r,e,t)});return o.then(e,t)},e[H]=!0}function f(e){return function(){var t=e.apply(this,arguments);if(t instanceof L)return t;var n=t.constructor;return n[H]||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",P="function",z=h("currentTask"),j=h("rejectionHandledHandler"),C="function ZoneAwarePromise() { [native code] }",L=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 C},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))}var r,a,i=new this(function(e,t){r=e,a=t});try{for(var s=S(e),c=s.next();!c.done;c=s.next()){var u=c.value;o(u)||(u=this.resolve(u)),u.then(t,n)}}catch(l){p={error:l}}finally{try{c&&!c.done&&(f=s["return"])&&f.call(s)}finally{if(p)throw p.error}}return i;var p,f},e.all=function(e){var t,n,r=new this(function(e,r){t=e,n=r}),a=0,i=[];try{for(var s=S(e),c=s.next();!c.done;c=s.next()){var u=c.value;o(u)||(u=this.resolve(u)),u.then(function(e){return function(n){i[e]=n,a--,a||t(i)}}(a),n),a++}}catch(l){p={error:l}}finally{try{c&&!c.done&&(f=s["return"])&&f.call(s)}finally{if(p)throw p.error}}return a||t(i),r;var p,f},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}();L.resolve=L.resolve,L.reject=L.reject,L.race=L.race,L.all=L.all;var M=e[v]=e.Promise,I=t.__symbol__("ZoneAwarePromise"),R=Object.getOwnPropertyDescriptor(e,"Promise");R&&!R.configurable||(R&&delete R.writable,R&&delete R.value,R||(R={configurable:!0,enumerable:!0}),R.get=function(){return e[I]?e[I]:e[v]},R.set=function(t){t===L?e[I]=t:(e[v]=t,t.prototype[g]||p(t),n.setNativePromise(t))},Object.defineProperty(e,"Promise",R)),e.Promise=L;var H=h("thenPatched");if(M){p(M);var x=e.fetch;typeof x==P&&(e.fetch=f(x))}return Promise[t.__symbol__("uncaughtPromiseErrors")]=d,L});var P=Zone.__symbol__,z="object"==typeof window&&window||"object"==typeof self&&self||global,j="function",C="undefined",L="removeAttribute",M="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,I=!("nw"in z)&&"undefined"!=typeof z.process&&"[object process]"==={}.toString.call(z.process),R=!I&&!M&&!("undefined"==typeof window||!window.HTMLElement),H="undefined"!=typeof z.process&&"[object process]"==={}.toString.call(z.process)&&!M&&!("undefined"==typeof window||!window.HTMLElement),x={},F=function(e){if(e=e||z.event){var t=x[e.type];t||(t=x[e.type]=P("ON_PROPERTY"+e.type));var n=this||e.target||z,r=n[t],o=r&&r.apply(this,arguments);return void 0==o||o||e.preventDefault(),o}},q=P("originalInstance"),N=!1,A=!1;Zone.__load_patch("toString",function(e,t,n){var r=t.__zone_symbol__originalToString=Function.prototype.toString,o="function",a=P("OriginalDelegate"),i=P("Promise"),s=P("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 B="true",X="false",W={isUsingGlobalCallback:!0},U={},G={},V="name",K="function",Y="object",J="__zone_symbol__",Q=/^__zone_symbol__(\w+)(true|false)$/,$="__zone_symbol__propagationStopped",ee=P("zoneTask"),te=Object[P("defineProperty")]=Object.defineProperty,ne=Object[P("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,re=Object.create,oe=P("unconfigurables"),ae="prototype",ie="object",se="undefined",ce=["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","orientationchange","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","touchend","transitioncancel","transitionend","waiting","wheel"],ue=["afterscriptexecute","beforescriptexecute","DOMContentLoaded","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange"],le=["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"],pe=["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],fe=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],he=["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"],de=["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],ve=["autocomplete","autocompleteerror"],ge=["toggle"],ye=["load"],ke=["blur","error","focus","load","resize","scroll","messageerror"],me=["bounce","finish","start"],_e=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],be=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],Te=["close","error","open","message"],we=["error","message"],Ee=ce.concat(de,ve,ge,ue,le,pe,he),De=P("unbound");Zone.__load_patch("util",function(e,t,n){n.patchOnProperties=o,n.patchMethod=i}),Zone.__load_patch("timers",function(e,t,n){var r="set",o="clear";h(e,r,o,"Timeout"),h(e,r,o,"Interval"),h(e,r,o,"Immediate")}),Zone.__load_patch("requestAnimationFrame",function(e,t,n){h(e,"request","cancel","AnimationFrame"),h(e,"mozRequest","mozCancel","AnimationFrame"),h(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){O(e,n),D(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){T(n,e),d(),Z(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];d||(d=n[f],v=n[h]),r&&v.apply(n,[y,r]);var a=n[s]=function(){n.readyState===n.DONE&&!t.aborted&&XMLHttpRequest[c]&&e.state===k&&e.invoke()};d.apply(n,[y,a]);var i=n[o];return i||(n[o]=e),b.apply(n,t.args),XMLHttpRequest[c]=!0,e}function l(){}function p(e){var t=e.data;return t.aborted=!0,w.apply(t.target,t.args)}var f=P("addEventListener"),h=P("removeEventListener"),d=XMLHttpRequest.prototype[f],v=XMLHttpRequest.prototype[h];if(!d){var g=e.XMLHttpRequestEventTarget;g&&(d=g.prototype[f],v=g.prototype[h])}var y="readystatechange",k="scheduled",m=i(e.XMLHttpRequest.prototype,"open",function(){return function(e,t){return e[a]=0==t[2],e[u]=t[1],m.apply(e,t)}}),_="XMLHttpRequest.send",b=i(e.XMLHttpRequest.prototype,"send",function(){return function(e,n){var o=t.current;if(e[a])return b.apply(e,n);var i={target:e,url:e[u],isPeriodic:!1,delay:null,args:n,aborted:!1};return o.scheduleMacroTask(_,l,i,r,p)}}),T="string",w=i(e.XMLHttpRequest.prototype,"abort",function(e){return function(e,t){var r=n(e);if(r&&typeof r.type==T){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}}})}r(e);var o=P("xhrTask"),a=P("xhrSync"),s=P("xhrListener"),c=P("xhrScheduled"),u=P("xhrURL")}),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[P("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[P("rejectionHandledHandler")]=r("rejectionhandled"))})});
!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]===C&&(e[n]=Zone.current.wrap(e[n],t+"_"+n));return e}function t(t,n){return function(){var r=Array.prototype.slice.call(arguments),o=e(r,n?n:t.name);return t.apply(this,o)}}function n(t,n,r){return c(t,n,function(t,n,o){return function(n,o){return t&&t.apply(n,e(o,r))}})}function r(t,n){for(var r=t.constructor.name,a=function(a){var i=n[a],s=t[i];if(s){var c=Object.getOwnPropertyDescriptor(t,i);if(!o(c))return"continue";t[i]=function(t){var n=function(){return t.apply(this,e(arguments,r+"."+i))};return l(n,t),n}(s)}},i=0;i<n.length;i++)a(i)}function o(e){return!e||e.writable!==!1&&(typeof e.get!==C||typeof e.set!==L)}function a(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=r.set,s=t.substr(2),c=q[s];c||(c=q[s]=z("ON_PROPERTY"+s)),r.set=function(t){var n=this;if(n||e!==j||(n=j),n){var r=n[c];r&&n.removeEventListener(s,N),i&&i.apply(n,I),"function"==typeof t?(n[c]=t,n.addEventListener(s,N,!1)):n[c]=null}},r.get=function(){var n=this;if(n||e!==j||(n=j),!n)return null;var o=n[c];if(o)return o;if(a){var i=a&&a.apply(this);if(i)return r.set.apply(this,[i]),typeof n[M]===C&&n.removeAttribute(t),i}return null},Object.defineProperty(e,t,r)}}function i(e,t,n){if(t)for(var r=0;r<t.length;r++)a(e,"on"+t[r],n);else{var o=[];for(var i in e)"on"==i.substr(0,2)&&o.push(i);for(var s=0;s<o.length;s++)a(e,o[s],n)}}function s(t){var n=j[t];if(n){j[z(t)]=n,j[t]=function(){var r=e(arguments,t);switch(r.length){case 0:this[A]=new n;break;case 1:this[A]=new n(r[0]);break;case 2:this[A]=new n(r[0],r[1]);break;case 3:this[A]=new n(r[0],r[1],r[2]);break;case 4:this[A]=new n(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}},l(j[t],n);var r,o=new n(function(){});for(r in o)"XMLHttpRequest"===t&&"responseBlob"===r||!function(e){"function"==typeof o[e]?j[t].prototype[e]=function(){return this[A][e].apply(this[A],arguments)}:Object.defineProperty(j[t].prototype,e,{set:function(n){"function"==typeof n?(this[A][e]=Zone.current.wrap(n,t+"."+e),l(this[A][e],n)):this[A][e]=n},get:function(){return this[A][e]}})}(r);for(r in n)"prototype"!==r&&n.hasOwnProperty(r)&&(j[t][r]=n[r])}}function c(e,t,n){for(var r=e;r&&!r.hasOwnProperty(t);)r=Object.getPrototypeOf(r);!r&&e[t]&&(r=e);var a,i=z(t);if(r&&!(a=r[i])){a=r[i]=r[t];var s=r&&Object.getOwnPropertyDescriptor(r,t);if(o(s)){var c=n(a,i,t);r[t]=function(){return c(this,arguments)},l(r[t],a)}}return a}function u(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=c(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 l(e,t){e[z("OriginalDelegate")]=t}function p(){if(B)return X;B=!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 f(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[c])return!1;var _,b={},T=m[c]=m[o],w=m[z(a)]=m[a],E=m[z(i)]=m[i],D=m[z(s)]=m[s];n&&n.prependEventListenerFnName&&(_=m[z(n.prependEventListenerFnName)]=m[n.prependEventListenerFnName]);var O=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=V[e.eventName],n=void 0;t&&(n=t[e.capture?U:W]);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])},Z=function(e){return T.apply(b.target,[b.eventName,e.invoke,b.options])},P=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?O:Z,L=r?S:j,M=function(e,t){var n=typeof t;return n===Y&&e.callback===t||n===Q&&e.originalDelegate===t},I=n&&n.compareTaskCallbackVsDelegate?n.compareTaskCallbackVsDelegate:M,R=Zone[Zone.__symbol__("BLACK_LISTED_EVENTS")],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=arguments[1];if(!u)return t.apply(this,arguments);var l=!1;if(typeof u!==Y){if(!u.handleEvent)return t.apply(this,arguments);l=!0}if(!d||d(t,u,c,arguments)){var p=arguments[0],f=arguments[2];if(R)for(var h=0;h<R.length;h++)if(p===R[h])return t.apply(this,arguments);var v,g=!1;void 0===f?v=!1:f===!0?v=!0:f===!1?v=!1:(v=!!f&&!!f.capture,g=!!f&&!!f.once);var k,m=Zone.current,_=V[p];if(_)k=_[v?U:W];else{var T=p+W,w=p+U,E=$+T,D=$+w;V[p]={},V[p][W]=E,V[p][U]=D,k=v?D:E}var O=c[k],S=!1;if(O){if(S=!0,y)for(var h=0;h<O.length;h++)if(I(O[h],u))return}else O=c[k]=[];var Z,P=c.constructor[J],z=K[P];z&&(Z=z[p]),Z||(Z=P+n+p),b.options=f,g&&(b.options.once=!1),b.target=c,b.capture=v,b.eventName=p,b.isExisting=S;var j=r?G:null;j&&(j.taskData=b);var C=m.scheduleEventTask(Z,u,j,o,a);return b.target=null,j&&(j.taskData=null),g&&(f.once=!0),C.options=f,C.target=c,C.capture=v,C.eventName=p,l&&(C.originalDelegate=u),s?O.unshift(C):O.push(C),i?c:void 0}}};return m[o]=H(T,u,C,L,k),_&&(m[p]=H(_,f,P,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=V[r];s&&(i=s[t?U:W]);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)}return w.apply(this,arguments)}},m[i]=function(){for(var t=this||e,n=arguments[0],r=[],o=h(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=V[n];if(r){var o=r[W],i=r[U],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=ee.exec(v),y=g&&g[1];y&&"removeListener"!==y&&this[s].apply(this,[y])}this[s].apply(this,["removeListener"])}},l(m[o],T),l(m[a],w),D&&l(m[s],D),E&&l(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",c=z(o),u="."+o+":",p="prependListener",f="."+p+":",d=function(e,t,n){if(!e.isRemoved){var r=e.callback;typeof r===Q&&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){if(t=t||e.event){var n=this||t.target||e,r=n[V[t.type][W]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length&&(!t||t[te]!==!0);a++)d(o[a],n,t)}},g=function(t){if(t=t||e.event){var n=this||t.target||e,r=n[V[t.type][U]];if(r)if(1===r.length)d(r[0],n,t);else for(var o=r.slice(),a=0;a<o.length&&(!t||t[te]!==!0);a++)d(o[a],n,t)}},y=[],k=0;k<t.length;k++)y[k]=r(t[k],n);return y}function h(e,t){var n=[];for(var r in e){var o=ee.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 d(e,t){var n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",function(e){return function(t,n){t[te]=!0,e&&e.apply(t,n)}})}function v(e,t,n,r){function o(t){function n(){try{t.invoke.apply(this,arguments)}finally{if(t.data&&t.data.isPeriodic)return;typeof r.handleId===l?delete u[r.handleId]:r.handleId&&(r.handleId[ne]=null)}}var r=t.data;return r.args[0]=n,r.handleId=i.apply(e,r.args),t}function a(e){return s(e.data.handleId)}var i=null,s=null;t+=r,n+=r;var u={},l="number",p="string",f="function",h="Interval",d="Timeout",v="notScheduled";i=c(e,t,function(n){return function(i,s){if(typeof s[0]===f){var c=Zone.current,p={handleId:null,isPeriodic:r===h,delay:r===d||r===h?s[1]||0:null,args:s},v=c.scheduleMacroTask(t,s[0],p,o,a);if(!v)return v;var g=v.data.handleId;return typeof g===l?u[g]=v:g&&(g[ne]=v),g&&g.ref&&g.unref&&typeof g.ref===f&&typeof g.unref===f&&(v.ref=g.ref.bind(g),v.unref=g.unref.bind(g)),typeof g===l||g?g:v}return n.apply(e,s)}}),s=c(e,n,function(t){return function(n,r){var o,a=r[0];typeof a===l?o=u[a]:(o=a&&a[ne],o||(o=a)),o&&typeof o.type===p?o.state!==v&&(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&(typeof a===l?delete u[a]:a&&(a[ne]=null),o.zone.cancelTask(o)):t.apply(e,r)}})}function g(){Object.defineProperty=function(e,t,n){if(k(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);var r=n.configurable;return t!==se&&(n=m(e,t,n)),_(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!==ce||Object.isFrozen(t)||Object.keys(t).forEach(function(n){t[n]=m(e,n,t[n])}),ae(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=oe(e,t);return k(e,t)&&(n.configurable=!1),n}}function y(e,t,n){var r=n.configurable;return n=m(e,t,n),_(e,t,n,r)}function k(e,t){return e&&e[ie]&&e[ie][t]}function m(e,t,n){return Object.isFrozen(n)||(n.configurable=!0),n.configurable||(e[ie]||Object.isFrozen(e)||re(e,ie,{writable:!0,value:{}}),e[ie]&&(e[ie][t]=!0)),n}function _(e,t,n,r){try{return re(e,t,n)}catch(o){if(!n.configurable)throw o;typeof r==ue?delete n.configurable:n.configurable=r;try{return re(e,t,n)}catch(o){var a=null;try{a=JSON.stringify(n)}catch(o){a=n.toString()}console.log("Attempting to configure '"+t+"' with descriptor '"+a+"' on object '"+e+"' and got error, giving up: "+o)}}}function b(e,t){var n=t.WebSocket;t.EventTarget||f(t,[n.prototype]),t.WebSocket=function(e,t){var r,o,a=arguments.length>1?new n(e,t):new n(e),s=Object.getOwnPropertyDescriptor(a,"onmessage");return s&&s.configurable===!1?(r=Object.create(a),o=a,["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);a[o]=r[o]}}return a[e].apply(a,t)}})):r=a,i(r,["close","error","message","open"],o),r};var r=t.WebSocket;for(var o in n)r[o]=n[o]}function T(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 w(e,t,n,r){var o=T(e,t,n);i(e,o,r)}function E(e,t){if(!H||x){var n="undefined"!=typeof WebSocket;if(D()){var r=t.__Zone_ignore_on_properties;if(F){w(window,Oe.concat(["messageerror"]),r,Object.getPrototypeOf(window)),w(Document.prototype,Oe,r),"undefined"!=typeof window.SVGElement&&w(window.SVGElement.prototype,Oe,r),w(Element.prototype,Oe,r),w(HTMLElement.prototype,Oe,r),w(HTMLMediaElement.prototype,de,r),w(HTMLFrameSetElement.prototype,fe.concat(_e),r),w(HTMLBodyElement.prototype,fe.concat(_e),r),w(HTMLFrameElement.prototype,me,r),w(HTMLIFrameElement.prototype,me,r);var o=window.HTMLMarqueeElement;o&&w(o.prototype,be,r);var a=window.Worker;a&&w(a.prototype,De,r)}w(XMLHttpRequest.prototype,Te,r);var i=t.XMLHttpRequestEventTarget;i&&w(i&&i.prototype,Te,r),"undefined"!=typeof IDBIndex&&(w(IDBIndex.prototype,we,r),w(IDBRequest.prototype,we,r),w(IDBOpenDBRequest.prototype,we,r),w(IDBDatabase.prototype,we,r),w(IDBTransaction.prototype,we,r),w(IDBCursor.prototype,we,r)),n&&w(WebSocket.prototype,Ee,r)}else O(),s("XMLHttpRequest"),n&&b(e,t)}}function D(){if((F||x)&&!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=z("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 O(){for(var e=function(e){var t=Oe[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][Se]&&(t=Zone.current.wrap(o[n],r),t[Se]=o[n],o[n]=t),o=o.parentElement},!0)},t=0;t<Oe.length;t++)e(t)}function S(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,u=e.__Zone_enable_cross_context_check||!1,l=p(),h=".addEventListener:",d="[object FunctionWrapper]",v="function __BROWSERTOOLS_CONSOLE_SAFEFUNC() { [native code] }",g=0;g<Oe.length;g++){var y=Oe[g],k=y+W,m=y+U,_=$+k,b=$+m;V[y]={},V[y][W]=_,V[y][U]=b}for(var g=0;g<n.length;g++)for(var T=s[g],w=K[T]={},E=0;E<Oe.length;E++){var y=Oe[E];w[y]=T+h+y}for(var D=function(e,t,n,r){if(!c&&l)if(u)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(u)try{t.toString()}catch(a){return e.apply(n,r),!1}return!0},O=[],g=0;g<a.length;g++){var S=e[a[g]];O.push(S&&S.prototype)}return f(e,O,{validateHandler:D}),t.patchEventTarget=f,!0}function Z(e,t){d(e,t)}function P(e){if((F||x)&&"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),y(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])},l(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===I&&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 L.zone},enumerable:!0,configurable:!0}),Object.defineProperty(r,"currentTask",{get:function(){return M},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),L={parent:L,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{L=L.parent}},r.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),L={parent:L,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(o){if(this._zoneDelegate.handleError(this,o))throw o}}finally{L=L.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!==Z){var o=e.state!=w;o&&e._transitionTo(w,T),e.runCount++;var a=M;M=e,L={parent:L,zone:this};try{e.type==S&&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==Z||e.data&&e.data.isPeriodic?o&&e._transitionTo(T,w):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(_,w,_))),L=L.parent,M=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(S,e,t,n,r,o))},r.prototype.scheduleEventTask=function(e,t,n,r,o){return this.scheduleTask(new h(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||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||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===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),I++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==I&&o(),I--}},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,runCount:this.runCount}},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",S="macroTask",Z="eventTask",P={},z={symbol:i,currentZoneFrame:function(){return L},onUnhandledError:a,microtaskDrainDone:a,scheduleMicroTask:r,showUncaughtError:function(){return!u[i("ignoreConsoleErrorUncaughtError")]},patchEventTarget:function(){return[]},patchOnProperties:a,patchMethod:function(){return a},patchArguments:function(){return a},setNativePromise:function(e){e&&typeof e.resolve===s&&(l=e.resolve(0))}},j="__rootZoneSpec__",C=new u(null,null);e[j]&&(C=C.fork(e[j]),delete e[j]);var L={parent:null,zone:C},M=null,I=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){if(e&&e.toString===Object.prototype.toString){var t=e.constructor&&e.constructor.name;return(t?t:"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}function o(e){n.onUnhandledError(e);try{var r=t[m];r&&"function"==typeof r&&r.apply(this,[e])}catch(o){}}function a(e){return e&&e.then}function i(e){return e}function s(e){return M.reject(e)}function c(e,t){return function(n){try{u(e,t,n)}catch(r){u(e,!1,r)}}}function u(e,o,a){var i=S();if(e===a)throw new TypeError(Z);if(e[_]===w){var s=null;try{typeof a!==P&&typeof a!==z||(s=a&&a.then)}catch(f){return i(function(){u(e,!1,f)})(),e}if(o!==D&&a instanceof M&&a.hasOwnProperty(_)&&a.hasOwnProperty(b)&&a[_]!==w)l(a),u(e,a[_],a[b]);else if(o!==D&&typeof s===z)try{s.apply(a,[i(c(e,o)),i(c(e,!1))])}catch(f){i(function(){u(e,!1,f)})()}else{e[_]=o;var h=e[b];if(e[b]=a,o===D&&a instanceof Error){var d=t.currentTask&&t.currentTask.data&&t.currentTask.data[k];d&&Object.defineProperty(a,j,{configurable:!0,enumerable:!1,writable:!0,value:d})}for(var g=0;g<h.length;)p(e,h[g++],h[g++],h[g++],h[g++]);if(0==h.length&&o==D){e[_]=O;try{throw new Error("Uncaught (in promise): "+r(a)+(a&&a.stack?"\n"+a.stack:""))}catch(f){var y=f;y.rejection=a,y.promise=e,y.zone=t.current,y.task=t.currentTask,v.push(y),n.scheduleMicroTask()}}}}return e}function l(e){if(e[_]===O){try{var n=t[C];n&&typeof n===z&&n.apply(this,[{rejection:e[b],promise:e}])}catch(r){}e[_]=D;for(var o=0;o<v.length;o++)e===v[o].promise&&v.splice(o,1)}}function p(e,t,n,r,o){l(e);var a=e[_]?typeof r===z?r:i:typeof o===z?o:s;t.scheduleMicroTask(T,function(){try{u(n,!0,t.run(a,void 0,[e[b]]))}catch(r){u(n,!1,r)}})}function f(e){var t=e.prototype,n=t.then;t[y]=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 M(function(e,t){n.call(r,e,t)});return o.then(e,t)},e[F]=!0}function h(e){return function(){var t=e.apply(this,arguments);if(t instanceof M)return t;var n=t.constructor;return n[F]||f(n),t}}var d=n.symbol,v=[],g=d("Promise"),y=d("then"),k="__creationTrace__";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(;v.length;)for(var e=function(){var e=v.shift();try{e.zone.runGuarded(function(){throw e})}catch(t){o(t)}};v.length;)e()};var m=d("unhandledPromiseRejectionHandler"),_=d("state"),b=d("value"),T="Promise.then",w=null,E=!0,D=!1,O=0,S=function(){var e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},Z="Promise resolved with itself",P="object",z="function",j=d("currentTaskTrace"),C=d("rejectionHandledHandler"),L="function ZoneAwarePromise() { [native code] }",M=function(){function e(t){var n=this;if(!(n instanceof e))throw new Error("Must be an instanceof Promise.");n[_]=w,n[b]=[];try{t&&t(c(n,E),c(n,D))}catch(r){u(n,!1,r)}}return e.toString=function(){return L},e.resolve=function(e){return u(new this(null),E,e)},e.reject=function(e){return u(new this(null),D,e)},e.race=function(e){function t(e){i&&(i=r(e))}function n(e){i&&(i=o(e))}for(var r,o,i=new this(function(e,t){r=e,o=t}),s=0,c=e;s<c.length;s++){var u=c[s];a(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}),o=0,i=[],s=0,c=e;s<c.length;s++){var u=c[s];a(u)||(u=this.resolve(u)),u.then(function(e){return function(n){i[e]=n,o--,o||t(i)}}(o),n),o++}return o||t(i),r},e.prototype.then=function(e,n){var r=new this.constructor(null),o=t.current;return this[_]==w?this[b].push(o,r,e,n):p(this,o,r,e,n),r},e.prototype["catch"]=function(e){return this.then(null,e)},e}();M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;var I=e[g]=e.Promise,R=t.__symbol__("ZoneAwarePromise"),H=Object.getOwnPropertyDescriptor(e,"Promise");H&&!H.configurable||(H&&delete H.writable,H&&delete H.value,H||(H={configurable:!0,enumerable:!0}),H.get=function(){return e[R]?e[R]:e[g]},H.set=function(t){t===M?e[R]=t:(e[g]=t,t.prototype[y]||f(t),n.setNativePromise(t))},Object.defineProperty(e,"Promise",H)),e.Promise=M;var F=d("thenPatched");if(I){f(I);var x=e.fetch;typeof x==z&&(e.fetch=h(x))}return Promise[t.__symbol__("uncaughtPromiseErrors")]=v,M});var z=Zone.__symbol__,j="object"==typeof window&&window||"object"==typeof self&&self||global,C="function",L="undefined",M="removeAttribute",I=[null],R="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,H=!("nw"in j)&&"undefined"!=typeof j.process&&"[object process]"==={}.toString.call(j.process),F=!H&&!R&&!("undefined"==typeof window||!window.HTMLElement),x="undefined"!=typeof j.process&&"[object process]"==={}.toString.call(j.process)&&!R&&!("undefined"==typeof window||!window.HTMLElement),q={},N=function(e){if(e=e||j.event){var t=q[e.type];t||(t=q[e.type]=z("ON_PROPERTY"+e.type));
var n=this||e.target||j,r=n[t],o=r&&r.apply(this,arguments);return void 0==o||o||e.preventDefault(),o}},A=z("originalInstance"),B=!1,X=!1;Zone.__load_patch("toString",function(e,t,n){var r=t.__zone_symbol__originalToString=Function.prototype.toString,o="function",a=z("OriginalDelegate"),i=z("Promise"),s=z("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 U="true",W="false",G={isUsingGlobalCallback:!0},V={},K={},J="name",Y="function",Q="object",$="__zone_symbol__",ee=/^__zone_symbol__(\w+)(true|false)$/,te="__zone_symbol__propagationStopped",ne=z("zoneTask"),re=Object[z("defineProperty")]=Object.defineProperty,oe=Object[z("getOwnPropertyDescriptor")]=Object.getOwnPropertyDescriptor,ae=Object.create,ie=z("unconfigurables"),se="prototype",ce="object",ue="undefined",le=["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","orientationchange","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","touchend","transitioncancel","transitionend","waiting","wheel"],pe=["afterscriptexecute","beforescriptexecute","DOMContentLoaded","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange"],fe=["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"],he=["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],de=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],ve=["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"],ge=["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],ye=["autocomplete","autocompleteerror"],ke=["toggle"],me=["load"],_e=["blur","error","focus","load","resize","scroll","messageerror"],be=["bounce","finish","start"],Te=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],we=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],Ee=["close","error","open","message"],De=["error","message"],Oe=le.concat(ge,ye,ke,pe,fe,he,ve),Se=z("unbound");Zone.__load_patch("util",function(e,t,r){r.patchOnProperties=i,r.patchMethod=c,r.patchArguments=n}),Zone.__load_patch("timers",function(e,t,n){var r="set",o="clear";v(e,r,o,"Timeout"),v(e,r,o,"Interval"),v(e,r,o,"Immediate")}),Zone.__load_patch("requestAnimationFrame",function(e,t,n){v(e,"request","cancel","AnimationFrame"),v(e,"mozRequest","mozCancel","AnimationFrame"),v(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];c(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){var r=t.__symbol__("BLACK_LISTED_EVENTS");e[r]&&(t[r]=e[r]),Z(e,n),S(e,n);var o=e.XMLHttpRequestEventTarget;o&&o.prototype&&n.patchEventTarget(e,[o.prototype]),s("MutationObserver"),s("WebKitMutationObserver"),s("IntersectionObserver"),s("FileReader")}),Zone.__load_patch("on_property",function(e,t,n){E(n,e),g(),P(e)}),Zone.__load_patch("canvas",function(e,t,n){var r=e.HTMLCanvasElement;"undefined"!=typeof r&&r.prototype&&r.prototype.toBlob&&u(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[s]=!1;var t=e.data,n=t.target,r=n[i];d||(d=n[f],v=n[h]),r&&v.apply(n,[y,r]);var a=n[i]=function(){n.readyState===n.DONE&&!t.aborted&&XMLHttpRequest[s]&&e.state===k&&e.invoke()};d.apply(n,[y,a]);var c=n[o];return c||(n[o]=e),b.apply(n,t.args),XMLHttpRequest[s]=!0,e}function l(){}function p(e){var t=e.data;return t.aborted=!0,w.apply(t.target,t.args)}var f=z("addEventListener"),h=z("removeEventListener"),d=XMLHttpRequest.prototype[f],v=XMLHttpRequest.prototype[h];if(!d){var g=e.XMLHttpRequestEventTarget;g&&(d=g.prototype[f],v=g.prototype[h])}var y="readystatechange",k="scheduled",m=c(e.XMLHttpRequest.prototype,"open",function(){return function(e,t){return e[a]=0==t[2],e[u]=t[1],m.apply(e,t)}}),_="XMLHttpRequest.send",b=c(e.XMLHttpRequest.prototype,"send",function(){return function(e,n){var o=t.current;if(e[a])return b.apply(e,n);var i={target:e,url:e[u],isPeriodic:!1,delay:null,args:n,aborted:!1};return o.scheduleMacroTask(_,l,i,r,p)}}),T="string",w=c(e.XMLHttpRequest.prototype,"abort",function(e){return function(e,t){var r=n(e);if(r&&typeof r.type==T){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}}})}r(e);var o=z("xhrTask"),a=z("xhrSync"),i=z("xhrListener"),s=z("xhrScheduled"),u=z("xhrURL")}),Zone.__load_patch("geolocation",function(e,t,n){e.navigator&&e.navigator.geolocation&&r(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("getUserMedia",function(e,n,r){var o=e.navigator;o&&o.getUserMedia&&(o.getUserMedia=t(o.getUserMedia))}),Zone.__load_patch("PromiseRejectionEvent",function(e,t,n){function r(t){return function(n){var r=h(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[z("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[z("rejectionHandledHandler")]=r("rejectionhandled"))})});

@@ -15,3 +15,3 @@ /**

import {patchTimer} from '../common/timers';
import {patchClass, patchMacroTask, patchMethod, patchOnProperties, patchPrototype, zoneSymbol} from '../common/utils';
import {patchArguments, patchClass, patchMacroTask, patchMethod, patchOnProperties, patchPrototype, wrapFunctionArgs, zoneSymbol} from '../common/utils';

@@ -26,2 +26,3 @@ import {propertyPatch} from './define-property';

api.patchMethod = patchMethod;
api.patchArguments = patchArguments;
});

@@ -56,2 +57,8 @@

Zone.__load_patch('EventTarget', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
// load blackListEvents from global
const SYMBOL_BLACK_LISTED_EVENTS = Zone.__symbol__('BLACK_LISTED_EVENTS');
if (global[SYMBOL_BLACK_LISTED_EVENTS]) {
(Zone as any)[SYMBOL_BLACK_LISTED_EVENTS] = global[SYMBOL_BLACK_LISTED_EVENTS];
}
patchEvent(global, api);

@@ -227,2 +234,9 @@ eventTargetPatch(global, api);

Zone.__load_patch('getUserMedia', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
let navigator = global['navigator'];
if (navigator && navigator.getUserMedia) {
navigator.getUserMedia = wrapFunctionArgs(navigator.getUserMedia);
}
});
Zone.__load_patch('PromiseRejectionEvent', (global: any, Zone: ZoneType, api: _ZonePrivate) => {

@@ -229,0 +243,0 @@ // handle unhandled promise rejection

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

function rewriteDescriptor(obj: any, prop: string, desc: any) {
desc.configurable = true;
// issue-927, if the desc is frozen, don't try to change the desc
if (!Object.isFrozen(desc)) {
desc.configurable = true;
}
if (!desc.configurable) {
if (!obj[unconfigurablesKey]) {
// issue-927, if the obj is frozen, don't try to set the desc to obj
if (!obj[unconfigurablesKey] && !Object.isFrozen(obj)) {
_defineProperty(obj, unconfigurablesKey, {writable: true, value: {}});
}
obj[unconfigurablesKey][prop] = true;
if (obj[unconfigurablesKey]) {
obj[unconfigurablesKey][prop] = true;
}
}

@@ -102,3 +108,3 @@ return desc;

} catch (error) {
descJson = descJson.toString();
descJson = desc.toString();
}

@@ -105,0 +111,0 @@ console.log(`Attempting to configure '${prop}' with descriptor '${descJson

@@ -381,3 +381,3 @@ /**

}
};
}

@@ -384,0 +384,0 @@ const unboundKey = zoneSymbol('unbound');

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

const blackListedEvents: string[] = (Zone as any)[Zone.__symbol__('BLACK_LISTED_EVENTS')];
const makeAddListener = function(

@@ -331,2 +333,11 @@ nativeListener: any, addSource: string, customScheduleFn: any, customCancelFn: any,

if (blackListedEvents) {
// check black list
for (let i = 0; i < blackListedEvents.length; i++) {
if (eventName === blackListedEvents[i]) {
return nativeListener.apply(this, arguments);
}
}
}
let capture;

@@ -410,2 +421,6 @@ let once = false;

// should clear taskData.target to avoid memory leak
// issue, https://github.com/angular/angular/issues/20442
taskData.target = null;
// need to clear up taskData because it is a global object

@@ -501,2 +516,7 @@ if (data) {

}
// issue 930, didn't find the event name or callback
// from zone kept existingTasks, the callback maybe
// added outside of zone, we need to call native removeEventListener
// to try to remove it.
return nativeRemoveEventListener.apply(this, arguments);
};

@@ -613,4 +633,8 @@

self[IMMEDIATE_PROPAGATION_SYMBOL] = true;
// we need to call the native stopImmediatePropagation
// in case in some hybrid application, some part of
// application will be controlled by zone, some are not
delegate && delegate.apply(self, args);
});
}
}

@@ -9,2 +9,11 @@ /**

Zone.__load_patch('ZoneAwarePromise', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
function readableObjectToString(obj: any) {
if (obj && obj.toString === Object.prototype.toString) {
const className = obj.constructor && obj.constructor.name;
return (className ? className : '') + ': ' + JSON.stringify(obj);
}
return obj ? obj.toString() : Object.prototype.toString.call(obj);
}
interface UncaughtPromiseError extends Error {

@@ -21,2 +30,3 @@ zone: AmbientZone;

const symbolThen = __symbol__('then');
const creationTrace = '__creationTrace__';

@@ -114,3 +124,3 @@ api.onUnhandledError = (e: any) => {

const FUNCTION = 'function';
const CURRENT_TASK_SYMBOL = __symbol__('currentTask');
const CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace');

@@ -161,3 +171,11 @@ // Promise Resolution

if (state === REJECTED && value instanceof Error) {
(value as any)[CURRENT_TASK_SYMBOL] = Zone.currentTask;
// check if longStackTraceZone is here
const trace = Zone.currentTask && Zone.currentTask.data &&
(Zone.currentTask.data as any)[creationTrace];
if (trace) {
// only keep the long stack trace into error when in longStackTraceZone
Object.defineProperty(
value, CURRENT_TASK_TRACE_SYMBOL,
{configurable: true, enumerable: false, writable: true, value: trace});
}
}

@@ -171,4 +189,5 @@

try {
// try to print more readable error log
throw new Error(
'Uncaught (in promise): ' + value +
'Uncaught (in promise): ' + readableObjectToString(value) +
(value && value.stack ? '\n' + value.stack : ''));

@@ -215,5 +234,5 @@ } catch (err) {

function scheduleResolveOrReject<R, U>(
function scheduleResolveOrReject<R, U1, U2>(
promise: ZoneAwarePromise<any>, zone: AmbientZone, chainPromise: ZoneAwarePromise<any>,
onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): void {
onFulfilled?: (value: R) => U1, onRejected?: (error: any) => U2): void {
clearRejectedNoCatch(promise);

@@ -274,3 +293,3 @@ const delegate = (promise as any)[symbolState] ?

let reject: (v: any) => void;
let promise = new this((res, rej) => {
let promise = new this<R>((res, rej) => {
resolve = res;

@@ -316,6 +335,8 @@ reject = rej;

then<R, U>(
onFulfilled?: (value: R) => U | PromiseLike<U>,
onRejected?: (error: any) => U | PromiseLike<U>): Promise<R> {
const chainPromise: Promise<R> = new (this.constructor as typeof ZoneAwarePromise)(null);
then<TResult1 = R, TResult2 = never>(
onFulfilled?: ((value: R) => TResult1 | PromiseLike<TResult1>)|undefined|null,
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>)|undefined|
null): Promise<TResult1|TResult2> {
const chainPromise: Promise<TResult1|TResult2> =
new (this.constructor as typeof ZoneAwarePromise)(null);
const zone = Zone.current;

@@ -330,3 +351,4 @@ if ((this as any)[symbolState] == UNRESOLVED) {

catch<U>(onRejected?: (error: any) => U | PromiseLike<U>): Promise<R> {
catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>)|undefined|
null): Promise<R|TResult> {
return this.then(null, onRejected);

@@ -333,0 +355,0 @@ }

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

} finally {
if (task.data && task.data.isPeriodic) {
// issue-934, task will be cancelled
// even it is a periodic task such as
// setInterval
return;
}
if (typeof data.handleId === NUMBER) {

@@ -44,0 +50,0 @@ // in non-nodejs env, we remove timerId

@@ -24,2 +24,3 @@ /**

const REMOVE_ATTRIBUTE = 'removeAttribute';
const NULL_ON_PROP_VALUE: any[] = [null];

@@ -35,2 +36,18 @@ export function bindArguments(args: any[], source: string): any[] {

export function wrapFunctionArgs(func: Function, source?: string): Function {
return function() {
const args = Array.prototype.slice.call(arguments);
const wrappedArgs = bindArguments(args, source ? source : (func as any).name);
return func.apply(this, wrappedArgs);
};
}
export function patchArguments(target: any, name: string, source: string): Function {
return patchMethod(
target, name,
(delegate: Function, delegateName: string, name: string) => (self: any, args: any[]) => {
return delegate && delegate.apply(self, bindArguments(args, source));
});
}
export function patchPrototype(prototype: any, fnNames: string[]) {

@@ -138,2 +155,3 @@ const source = prototype.constructor['name'];

const originalDescGet = desc.get;
const originalDescSet = desc.set;

@@ -163,2 +181,8 @@ // substr(2) cuz 'onclick' -> 'click', etc

// issue #978, when onload handler was added before loading zone.js
// we should remove it with originalDescSet
if (originalDescSet) {
originalDescSet.apply(target, NULL_ON_PROP_VALUE);
}
if (typeof newValue === 'function') {

@@ -165,0 +189,0 @@ target[eventNameSymbol] = newValue;

@@ -59,2 +59,3 @@ /**

let originalJasmineFn: Function = jasmineEnv[methodName];
jasmineEnv[Zone.__symbol__(methodName)] = originalJasmineFn;
jasmineEnv[methodName] = function(

@@ -68,2 +69,3 @@ description: string, specDefinitions: Function, timeout: number) {

let originalJasmineFn: Function = jasmineEnv[methodName];
jasmineEnv[Zone.__symbol__(methodName)] = originalJasmineFn;
jasmineEnv[methodName] = function(specDefinitions: Function, timeout: number) {

@@ -70,0 +72,0 @@ arguments[0] = wrapTestInZone(specDefinitions);

@@ -173,2 +173,2 @@ /**

})(window);
})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);

@@ -14,3 +14,3 @@ /**

import {patchTimer} from '../common/timers';
import {isMix, patchMacroTask, patchMicroTask} from '../common/utils';
import {isMix, patchArguments, patchMacroTask, patchMethod, patchMicroTask, patchOnProperties} from '../common/utils';

@@ -20,2 +20,8 @@ const set = 'set';

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

@@ -22,0 +28,0 @@ // Timers

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

interface MacroTaskOptions {
source: string;
isPeriodic?: boolean;
callbackArgs?: any;
}
class Scheduler {

@@ -176,4 +182,11 @@ // Next scheduler id.

constructor(namePrefix: string, private trackPendingRequestAnimationFrame = false) {
constructor(
namePrefix: string, private trackPendingRequestAnimationFrame = false,
private macroTaskOptions?: MacroTaskOptions[]) {
this.name = 'fakeAsyncTestZone for ' + namePrefix;
// in case user can't access the construction of FakyAsyncTestSpec
// user can also define macroTaskOptions by define a global variable.
if (!this.macroTaskOptions) {
this.macroTaskOptions = global[Zone.__symbol__('FakeAsyncTestMacroTask')];
}
}

@@ -357,2 +370,20 @@

default:
// user can define which macroTask they want to support by passing
// macroTaskOptions
const macroTaskOption = this.findMacroTaskOption(task);
if (macroTaskOption) {
const args = task.data && (task.data as any)['args'];
const delay = args && args.length > 1 ? args[1] : 0;
let callbackArgs =
macroTaskOption.callbackArgs ? macroTaskOption.callbackArgs : args;
if (!!macroTaskOption.isPeriodic) {
// periodic macroTask, use setInterval to simulate
task.data['handleId'] = this._setInterval(task.invoke, delay, callbackArgs);
task.data.isPeriodic = true;
} else {
// not periodic, use setTimout to simulate
task.data['handleId'] = this._setTimeout(task.invoke, delay, callbackArgs);
}
break;
}
throw new Error('Unknown macroTask scheduled in fake async test: ' + task.source);

@@ -378,2 +409,10 @@ }

default:
// user can define which macroTask they want to support by passing
// macroTaskOptions
const macroTaskOption = this.findMacroTaskOption(task);
if (macroTaskOption) {
const handleId = task.data['handleId'];
return macroTaskOption.isPeriodic ? this._clearInterval(handleId) :
this._clearTimeout(handleId);
}
return delegate.cancelTask(target, task);

@@ -383,2 +422,15 @@ }

findMacroTaskOption(task: Task) {
if (!this.macroTaskOptions) {
return null;
}
for (let i = 0; i < this.macroTaskOptions.length; i++) {
const macroTaskOption = this.macroTaskOptions[i];
if (macroTaskOption.source === task.source) {
return macroTaskOption;
}
}
return null;
}
onHandleError(

@@ -385,0 +437,0 @@ parentZoneDelegate: ZoneDelegate, currentZone: Zone, targetZone: Zone,

@@ -90,4 +90,3 @@ /**

}
const task = (error as any)[(Zone as any).__symbol__('currentTask')];
const trace = task && task.data && task.data[creationTrace];
const trace = (error as any)[(Zone as any).__symbol__('currentTaskTrace')];
if (!trace) {

@@ -94,0 +93,0 @@ return error.stack;

@@ -125,3 +125,3 @@ /**

return retValue;
};
}
}

@@ -128,0 +128,0 @@

@@ -9,3 +9,3 @@ /**

/*
/**
* Suppress closure compiler errors about unknown 'global' variable

@@ -331,2 +331,3 @@ * @fileoverview

(self: any, args: any[]) => any) => Function;
patchArguments: (target: any, name: string, source: string) => Function;
}

@@ -669,6 +670,7 @@

return _currentZoneFrame.zone;
};
}
static get currentTask(): Task {
return _currentTask;
};
}

@@ -688,6 +690,7 @@ static __load_patch(name: string, fn: _PatchFn): void {

return this._parent;
};
}
public get name(): string {
return this._name;
};
}

@@ -1240,7 +1243,3 @@

zone: this.zone.name,
invoke: this.invoke,
scheduleFn: this.scheduleFn,
cancelFn: this.cancelFn,
runCount: this.runCount,
callback: this.callback
runCount: this.runCount
};

@@ -1328,2 +1327,3 @@ }

patchMethod: () => noop,
patchArguments: () => noop,
setNativePromise: (NativePromise: any) => {

@@ -1330,0 +1330,0 @@ // sometimes NativePromise.resolve static function

{
"name": "elastic-apm-js-zone",
"version": "0.8.18-tskdt",
"version": "0.8.19-tskdt",
"description": "Zones for JavaScript",
"main": "dist/zone-node.js",
"browser": "dist/zone.js",
"unpkg": "dist/zone.js",
"typings": "dist/zone.js.d.ts",

@@ -37,2 +38,3 @@ "files": [

"tsc:w": "tsc -w -p .",
"tslint": "tslint -c tslint.json 'lib/**/*.ts'",
"test": "npm run tsc && concurrently \"npm run tsc:w\" \"npm run ws-server\" \"npm run karma-jasmine\"",

@@ -91,3 +93,3 @@ "test:phantomjs": "npm run tsc && concurrently \"npm run tsc:w\" \"npm run ws-server\" \"npm run karma-jasmine:phantomjs\"",

"pump": "^1.0.1",
"rxjs": "5.4.2",
"rxjs": "^5.5.3",
"selenium-webdriver": "^3.4.0",

@@ -98,3 +100,3 @@ "systemjs": "^0.19.37",

"tslint-eslint-rules": "^3.1.0",
"typescript": "2.3.4",
"typescript": "2.5.2",
"vrsource-tslint-rules": "^4.0.0",

@@ -101,0 +103,0 @@ "webdriver-manager": "^12.0.6",

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc