{"ast":null,"code":"'use strict';\n/**\n * @license Angular v12.0.0-next.0\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (factory) {\n  typeof define === 'function' && define.amd ? define(factory) : factory();\n})(function () {\n  'use strict';\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n  var Zone$1 = function (global) {\n    var performance = global['performance'];\n\n    function mark(name) {\n      performance && performance['mark'] && performance['mark'](name);\n    }\n\n    function performanceMeasure(name, label) {\n      performance && performance['measure'] && performance['measure'](name, label);\n    }\n\n    mark('Zone'); // Initialize before it's accessed below.\n    // __Zone_symbol_prefix global can be used to override the default zone\n    // symbol prefix with a custom one if needed.\n\n    var symbolPrefix = global['__Zone_symbol_prefix'] || '__zone_symbol__';\n\n    function __symbol__(name) {\n      return symbolPrefix + name;\n    }\n\n    var checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true;\n\n    if (global['Zone']) {\n      // if global['Zone'] already exists (maybe zone.js was already loaded or\n      // some other lib also registered a global object named Zone), we may need\n      // to throw an error, but sometimes user may not want this error.\n      // For example,\n      // we have two web pages, page1 includes zone.js, page2 doesn't.\n      // and the 1st time user load page1 and page2, everything work fine,\n      // but when user load page2 again, error occurs because global['Zone'] already exists.\n      // so we add a flag to let user choose whether to throw this error or not.\n      // By default, if existing Zone is from zone.js, we will not throw the error.\n      if (checkDuplicate || typeof global['Zone'].__symbol__ !== 'function') {\n        throw new Error('Zone already loaded.');\n      } else {\n        return global['Zone'];\n      }\n    }\n\n    var Zone =\n    /** @class */\n    function () {\n      function Zone(parent, zoneSpec) {\n        this._parent = parent;\n        this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '<root>';\n        this._properties = zoneSpec && zoneSpec.properties || {};\n        this._zoneDelegate = new ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n      }\n\n      Zone.assertZonePatched = function () {\n        if (global['Promise'] !== patches['ZoneAwarePromise']) {\n          throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' + 'has been overwritten.\\n' + 'Most 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.)');\n        }\n      };\n\n      Object.defineProperty(Zone, \"root\", {\n        get: function () {\n          var zone = Zone.current;\n\n          while (zone.parent) {\n            zone = zone.parent;\n          }\n\n          return zone;\n        },\n        enumerable: false,\n        configurable: true\n      });\n      Object.defineProperty(Zone, \"current\", {\n        get: function () {\n          return _currentZoneFrame.zone;\n        },\n        enumerable: false,\n        configurable: true\n      });\n      Object.defineProperty(Zone, \"currentTask\", {\n        get: function () {\n          return _currentTask;\n        },\n        enumerable: false,\n        configurable: true\n      }); // tslint:disable-next-line:require-internal-with-underscore\n\n      Zone.__load_patch = function (name, fn, ignoreDuplicate) {\n        if (ignoreDuplicate === void 0) {\n          ignoreDuplicate = false;\n        }\n\n        if (patches.hasOwnProperty(name)) {\n          // `checkDuplicate` option is defined from global variable\n          // so it works for all modules.\n          // `ignoreDuplicate` can work for the specified module\n          if (!ignoreDuplicate && checkDuplicate) {\n            throw Error('Already loaded patch: ' + name);\n          }\n        } else if (!global['__Zone_disable_' + name]) {\n          var perfName = 'Zone:' + name;\n          mark(perfName);\n          patches[name] = fn(global, Zone, _api);\n          performanceMeasure(perfName, perfName);\n        }\n      };\n\n      Object.defineProperty(Zone.prototype, \"parent\", {\n        get: function () {\n          return this._parent;\n        },\n        enumerable: false,\n        configurable: true\n      });\n      Object.defineProperty(Zone.prototype, \"name\", {\n        get: function () {\n          return this._name;\n        },\n        enumerable: false,\n        configurable: true\n      });\n\n      Zone.prototype.get = function (key) {\n        var zone = this.getZoneWith(key);\n        if (zone) return zone._properties[key];\n      };\n\n      Zone.prototype.getZoneWith = function (key) {\n        var current = this;\n\n        while (current) {\n          if (current._properties.hasOwnProperty(key)) {\n            return current;\n          }\n\n          current = current._parent;\n        }\n\n        return null;\n      };\n\n      Zone.prototype.fork = function (zoneSpec) {\n        if (!zoneSpec) throw new Error('ZoneSpec required!');\n        return this._zoneDelegate.fork(this, zoneSpec);\n      };\n\n      Zone.prototype.wrap = function (callback, source) {\n        if (typeof callback !== 'function') {\n          throw new Error('Expecting function got: ' + callback);\n        }\n\n        var _callback = this._zoneDelegate.intercept(this, callback, source);\n\n        var zone = this;\n        return function () {\n          return zone.runGuarded(_callback, this, arguments, source);\n        };\n      };\n\n      Zone.prototype.run = function (callback, applyThis, applyArgs, source) {\n        _currentZoneFrame = {\n          parent: _currentZoneFrame,\n          zone: this\n        };\n\n        try {\n          return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n        } finally {\n          _currentZoneFrame = _currentZoneFrame.parent;\n        }\n      };\n\n      Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) {\n        if (applyThis === void 0) {\n          applyThis = null;\n        }\n\n        _currentZoneFrame = {\n          parent: _currentZoneFrame,\n          zone: this\n        };\n\n        try {\n          try {\n            return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n          } catch (error) {\n            if (this._zoneDelegate.handleError(this, error)) {\n              throw error;\n            }\n          }\n        } finally {\n          _currentZoneFrame = _currentZoneFrame.parent;\n        }\n      };\n\n      Zone.prototype.runTask = function (task, applyThis, applyArgs) {\n        if (task.zone != this) {\n          throw new Error('A task can only be run in the zone of creation! (Creation: ' + (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n        } // https://github.com/angular/zone.js/issues/778, sometimes eventTask\n        // will run in notScheduled(canceled) state, we should not try to\n        // run such kind of task but just return\n\n\n        if (task.state === notScheduled && (task.type === eventTask || task.type === macroTask)) {\n          return;\n        }\n\n        var reEntryGuard = task.state != running;\n        reEntryGuard && task._transitionTo(running, scheduled);\n        task.runCount++;\n        var previousTask = _currentTask;\n        _currentTask = task;\n        _currentZoneFrame = {\n          parent: _currentZoneFrame,\n          zone: this\n        };\n\n        try {\n          if (task.type == macroTask && task.data && !task.data.isPeriodic) {\n            task.cancelFn = undefined;\n          }\n\n          try {\n            return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);\n          } catch (error) {\n            if (this._zoneDelegate.handleError(this, error)) {\n              throw error;\n            }\n          }\n        } finally {\n          // if the task's state is notScheduled or unknown, then it has already been cancelled\n          // we should not reset the state to scheduled\n          if (task.state !== notScheduled && task.state !== unknown) {\n            if (task.type == eventTask || task.data && task.data.isPeriodic) {\n              reEntryGuard && task._transitionTo(scheduled, running);\n            } else {\n              task.runCount = 0;\n\n              this._updateTaskCount(task, -1);\n\n              reEntryGuard && task._transitionTo(notScheduled, running, notScheduled);\n            }\n          }\n\n          _currentZoneFrame = _currentZoneFrame.parent;\n          _currentTask = previousTask;\n        }\n      };\n\n      Zone.prototype.scheduleTask = function (task) {\n        if (task.zone && task.zone !== this) {\n          // check if the task was rescheduled, the newZone\n          // should not be the children of the original zone\n          var newZone = this;\n\n          while (newZone) {\n            if (newZone === task.zone) {\n              throw Error(\"can not reschedule task to \" + this.name + \" which is descendants of the original zone \" + task.zone.name);\n            }\n\n            newZone = newZone.parent;\n          }\n        }\n\n        task._transitionTo(scheduling, notScheduled);\n\n        var zoneDelegates = [];\n        task._zoneDelegates = zoneDelegates;\n        task._zone = this;\n\n        try {\n          task = this._zoneDelegate.scheduleTask(this, task);\n        } catch (err) {\n          // should set task's state to unknown when scheduleTask throw error\n          // because the err may from reschedule, so the fromState maybe notScheduled\n          task._transitionTo(unknown, scheduling, notScheduled); // TODO: @JiaLiPassion, should we check the result from handleError?\n\n\n          this._zoneDelegate.handleError(this, err);\n\n          throw err;\n        }\n\n        if (task._zoneDelegates === zoneDelegates) {\n          // we have to check because internally the delegate can reschedule the task.\n          this._updateTaskCount(task, 1);\n        }\n\n        if (task.state == scheduling) {\n          task._transitionTo(scheduled, scheduling);\n        }\n\n        return task;\n      };\n\n      Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) {\n        return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined));\n      };\n\n      Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) {\n        return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n      };\n\n      Zone.prototype.scheduleEventTask = function (source, callback, data, customSchedule, customCancel) {\n        return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n      };\n\n      Zone.prototype.cancelTask = function (task) {\n        if (task.zone != this) throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' + (task.zone || NO_ZONE).name + '; Execution: ' + this.name + ')');\n\n        task._transitionTo(canceling, scheduled, running);\n\n        try {\n          this._zoneDelegate.cancelTask(this, task);\n        } catch (err) {\n          // if error occurs when cancelTask, transit the state to unknown\n          task._transitionTo(unknown, canceling);\n\n          this._zoneDelegate.handleError(this, err);\n\n          throw err;\n        }\n\n        this._updateTaskCount(task, -1);\n\n        task._transitionTo(notScheduled, canceling);\n\n        task.runCount = 0;\n        return task;\n      };\n\n      Zone.prototype._updateTaskCount = function (task, count) {\n        var zoneDelegates = task._zoneDelegates;\n\n        if (count == -1) {\n          task._zoneDelegates = null;\n        }\n\n        for (var i = 0; i < zoneDelegates.length; i++) {\n          zoneDelegates[i]._updateTaskCount(task.type, count);\n        }\n      };\n\n      return Zone;\n    }(); // tslint:disable-next-line:require-internal-with-underscore\n\n\n    Zone.__symbol__ = __symbol__;\n    var DELEGATE_ZS = {\n      name: '',\n      onHasTask: function (delegate, _, target, hasTaskState) {\n        return delegate.hasTask(target, hasTaskState);\n      },\n      onScheduleTask: function (delegate, _, target, task) {\n        return delegate.scheduleTask(target, task);\n      },\n      onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) {\n        return delegate.invokeTask(target, task, applyThis, applyArgs);\n      },\n      onCancelTask: function (delegate, _, target, task) {\n        return delegate.cancelTask(target, task);\n      }\n    };\n\n    var ZoneDelegate =\n    /** @class */\n    function () {\n      function ZoneDelegate(zone, parentDelegate, zoneSpec) {\n        this._taskCounts = {\n          'microTask': 0,\n          'macroTask': 0,\n          'eventTask': 0\n        };\n        this.zone = zone;\n        this._parentDelegate = parentDelegate;\n        this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n        this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n        this._forkCurrZone = zoneSpec && (zoneSpec.onFork ? this.zone : parentDelegate._forkCurrZone);\n        this._interceptZS = zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n        this._interceptDlgt = zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n        this._interceptCurrZone = zoneSpec && (zoneSpec.onIntercept ? this.zone : parentDelegate._interceptCurrZone);\n        this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n        this._invokeDlgt = zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n        this._invokeCurrZone = zoneSpec && (zoneSpec.onInvoke ? this.zone : parentDelegate._invokeCurrZone);\n        this._handleErrorZS = zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n        this._handleErrorDlgt = zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n        this._handleErrorCurrZone = zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate._handleErrorCurrZone);\n        this._scheduleTaskZS = zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n        this._scheduleTaskDlgt = zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n        this._scheduleTaskCurrZone = zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate._scheduleTaskCurrZone);\n        this._invokeTaskZS = zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n        this._invokeTaskDlgt = zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n        this._invokeTaskCurrZone = zoneSpec && (zoneSpec.onInvokeTask ? this.zone : parentDelegate._invokeTaskCurrZone);\n        this._cancelTaskZS = zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n        this._cancelTaskDlgt = zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n        this._cancelTaskCurrZone = zoneSpec && (zoneSpec.onCancelTask ? this.zone : parentDelegate._cancelTaskCurrZone);\n        this._hasTaskZS = null;\n        this._hasTaskDlgt = null;\n        this._hasTaskDlgtOwner = null;\n        this._hasTaskCurrZone = null;\n        var zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n        var parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n\n        if (zoneSpecHasTask || parentHasTask) {\n          // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such\n          // a case all task related interceptors must go through this ZD. We can't short circuit it.\n          this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n          this._hasTaskDlgt = parentDelegate;\n          this._hasTaskDlgtOwner = this;\n          this._hasTaskCurrZone = zone;\n\n          if (!zoneSpec.onScheduleTask) {\n            this._scheduleTaskZS = DELEGATE_ZS;\n            this._scheduleTaskDlgt = parentDelegate;\n            this._scheduleTaskCurrZone = this.zone;\n          }\n\n          if (!zoneSpec.onInvokeTask) {\n            this._invokeTaskZS = DELEGATE_ZS;\n            this._invokeTaskDlgt = parentDelegate;\n            this._invokeTaskCurrZone = this.zone;\n          }\n\n          if (!zoneSpec.onCancelTask) {\n            this._cancelTaskZS = DELEGATE_ZS;\n            this._cancelTaskDlgt = parentDelegate;\n            this._cancelTaskCurrZone = this.zone;\n          }\n        }\n      }\n\n      ZoneDelegate.prototype.fork = function (targetZone, zoneSpec) {\n        return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) : new Zone(targetZone, zoneSpec);\n      };\n\n      ZoneDelegate.prototype.intercept = function (targetZone, callback, source) {\n        return this._interceptZS ? this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) : callback;\n      };\n\n      ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) {\n        return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) : callback.apply(applyThis, applyArgs);\n      };\n\n      ZoneDelegate.prototype.handleError = function (targetZone, error) {\n        return this._handleErrorZS ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) : true;\n      };\n\n      ZoneDelegate.prototype.scheduleTask = function (targetZone, task) {\n        var returnTask = task;\n\n        if (this._scheduleTaskZS) {\n          if (this._hasTaskZS) {\n            returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n          } // clang-format off\n\n\n          returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task); // clang-format on\n\n          if (!returnTask) returnTask = task;\n        } else {\n          if (task.scheduleFn) {\n            task.scheduleFn(task);\n          } else if (task.type == microTask) {\n            scheduleMicroTask(task);\n          } else {\n            throw new Error('Task is missing scheduleFn.');\n          }\n        }\n\n        return returnTask;\n      };\n\n      ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) {\n        return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) : task.callback.apply(applyThis, applyArgs);\n      };\n\n      ZoneDelegate.prototype.cancelTask = function (targetZone, task) {\n        var value;\n\n        if (this._cancelTaskZS) {\n          value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n        } else {\n          if (!task.cancelFn) {\n            throw Error('Task is not cancelable');\n          }\n\n          value = task.cancelFn(task);\n        }\n\n        return value;\n      };\n\n      ZoneDelegate.prototype.hasTask = function (targetZone, isEmpty) {\n        // hasTask should not throw error so other ZoneDelegate\n        // can still trigger hasTask callback\n        try {\n          this._hasTaskZS && this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n        } catch (err) {\n          this.handleError(targetZone, err);\n        }\n      }; // tslint:disable-next-line:require-internal-with-underscore\n\n\n      ZoneDelegate.prototype._updateTaskCount = function (type, count) {\n        var counts = this._taskCounts;\n        var prev = counts[type];\n        var next = counts[type] = prev + count;\n\n        if (next < 0) {\n          throw new Error('More tasks executed then were scheduled.');\n        }\n\n        if (prev == 0 || next == 0) {\n          var isEmpty = {\n            microTask: counts['microTask'] > 0,\n            macroTask: counts['macroTask'] > 0,\n            eventTask: counts['eventTask'] > 0,\n            change: type\n          };\n          this.hasTask(this.zone, isEmpty);\n        }\n      };\n\n      return ZoneDelegate;\n    }();\n\n    var ZoneTask =\n    /** @class */\n    function () {\n      function ZoneTask(type, source, callback, options, scheduleFn, cancelFn) {\n        // tslint:disable-next-line:require-internal-with-underscore\n        this._zone = null;\n        this.runCount = 0; // tslint:disable-next-line:require-internal-with-underscore\n\n        this._zoneDelegates = null; // tslint:disable-next-line:require-internal-with-underscore\n\n        this._state = 'notScheduled';\n        this.type = type;\n        this.source = source;\n        this.data = options;\n        this.scheduleFn = scheduleFn;\n        this.cancelFn = cancelFn;\n\n        if (!callback) {\n          throw new Error('callback is not defined');\n        }\n\n        this.callback = callback;\n        var self = this; // TODO: @JiaLiPassion options should have interface\n\n        if (type === eventTask && options && options.useG) {\n          this.invoke = ZoneTask.invokeTask;\n        } else {\n          this.invoke = function () {\n            return ZoneTask.invokeTask.call(global, self, this, arguments);\n          };\n        }\n      }\n\n      ZoneTask.invokeTask = function (task, target, args) {\n        if (!task) {\n          task = this;\n        }\n\n        _numberOfNestedTaskFrames++;\n\n        try {\n          task.runCount++;\n          return task.zone.runTask(task, target, args);\n        } finally {\n          if (_numberOfNestedTaskFrames == 1) {\n            drainMicroTaskQueue();\n          }\n\n          _numberOfNestedTaskFrames--;\n        }\n      };\n\n      Object.defineProperty(ZoneTask.prototype, \"zone\", {\n        get: function () {\n          return this._zone;\n        },\n        enumerable: false,\n        configurable: true\n      });\n      Object.defineProperty(ZoneTask.prototype, \"state\", {\n        get: function () {\n          return this._state;\n        },\n        enumerable: false,\n        configurable: true\n      });\n\n      ZoneTask.prototype.cancelScheduleRequest = function () {\n        this._transitionTo(notScheduled, scheduling);\n      }; // tslint:disable-next-line:require-internal-with-underscore\n\n\n      ZoneTask.prototype._transitionTo = function (toState, fromState1, fromState2) {\n        if (this._state === fromState1 || this._state === fromState2) {\n          this._state = toState;\n\n          if (toState == notScheduled) {\n            this._zoneDelegates = null;\n          }\n        } else {\n          throw new Error(this.type + \" '\" + this.source + \"': can not transition to '\" + toState + \"', expecting state '\" + fromState1 + \"'\" + (fromState2 ? ' or \\'' + fromState2 + '\\'' : '') + \", was '\" + this._state + \"'.\");\n        }\n      };\n\n      ZoneTask.prototype.toString = function () {\n        if (this.data && typeof this.data.handleId !== 'undefined') {\n          return this.data.handleId.toString();\n        } else {\n          return Object.prototype.toString.call(this);\n        }\n      }; // add toJSON method to prevent cyclic error when\n      // call JSON.stringify(zoneTask)\n\n\n      ZoneTask.prototype.toJSON = function () {\n        return {\n          type: this.type,\n          state: this.state,\n          source: this.source,\n          zone: this.zone.name,\n          runCount: this.runCount\n        };\n      };\n\n      return ZoneTask;\n    }(); //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    ///  MICROTASK QUEUE\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n\n\n    var symbolSetTimeout = __symbol__('setTimeout');\n\n    var symbolPromise = __symbol__('Promise');\n\n    var symbolThen = __symbol__('then');\n\n    var _microTaskQueue = [];\n    var _isDrainingMicrotaskQueue = false;\n    var nativeMicroTaskQueuePromise;\n\n    function scheduleMicroTask(task) {\n      // if we are not running in any task, and there has not been anything scheduled\n      // we must bootstrap the initial task creation by manually scheduling the drain\n      if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) {\n        // We are not running in Task, so we need to kickstart the microtask queue.\n        if (!nativeMicroTaskQueuePromise) {\n          if (global[symbolPromise]) {\n            nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0);\n          }\n        }\n\n        if (nativeMicroTaskQueuePromise) {\n          var nativeThen = nativeMicroTaskQueuePromise[symbolThen];\n\n          if (!nativeThen) {\n            // native Promise is not patchable, we need to use `then` directly\n            // issue 1078\n            nativeThen = nativeMicroTaskQueuePromise['then'];\n          }\n\n          nativeThen.call(nativeMicroTaskQueuePromise, drainMicroTaskQueue);\n        } else {\n          global[symbolSetTimeout](drainMicroTaskQueue, 0);\n        }\n      }\n\n      task && _microTaskQueue.push(task);\n    }\n\n    function drainMicroTaskQueue() {\n      if (!_isDrainingMicrotaskQueue) {\n        _isDrainingMicrotaskQueue = true;\n\n        while (_microTaskQueue.length) {\n          var queue = _microTaskQueue;\n          _microTaskQueue = [];\n\n          for (var i = 0; i < queue.length; i++) {\n            var task = queue[i];\n\n            try {\n              task.zone.runTask(task, null, null);\n            } catch (error) {\n              _api.onUnhandledError(error);\n            }\n          }\n        }\n\n        _api.microtaskDrainDone();\n\n        _isDrainingMicrotaskQueue = false;\n      }\n    } //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n    ///  BOOTSTRAP\n    //////////////////////////////////////////////////////\n    //////////////////////////////////////////////////////\n\n\n    var NO_ZONE = {\n      name: 'NO ZONE'\n    };\n    var notScheduled = 'notScheduled',\n        scheduling = 'scheduling',\n        scheduled = 'scheduled',\n        running = 'running',\n        canceling = 'canceling',\n        unknown = 'unknown';\n    var microTask = 'microTask',\n        macroTask = 'macroTask',\n        eventTask = 'eventTask';\n    var patches = {};\n    var _api = {\n      symbol: __symbol__,\n      currentZoneFrame: function () {\n        return _currentZoneFrame;\n      },\n      onUnhandledError: noop,\n      microtaskDrainDone: noop,\n      scheduleMicroTask: scheduleMicroTask,\n      showUncaughtError: function () {\n        return !Zone[__symbol__('ignoreConsoleErrorUncaughtError')];\n      },\n      patchEventTarget: function () {\n        return [];\n      },\n      patchOnProperties: noop,\n      patchMethod: function () {\n        return noop;\n      },\n      bindArguments: function () {\n        return [];\n      },\n      patchThen: function () {\n        return noop;\n      },\n      patchMacroTask: function () {\n        return noop;\n      },\n      patchEventPrototype: function () {\n        return noop;\n      },\n      isIEOrEdge: function () {\n        return false;\n      },\n      getGlobalObjects: function () {\n        return undefined;\n      },\n      ObjectDefineProperty: function () {\n        return noop;\n      },\n      ObjectGetOwnPropertyDescriptor: function () {\n        return undefined;\n      },\n      ObjectCreate: function () {\n        return undefined;\n      },\n      ArraySlice: function () {\n        return [];\n      },\n      patchClass: function () {\n        return noop;\n      },\n      wrapWithCurrentZone: function () {\n        return noop;\n      },\n      filterProperties: function () {\n        return [];\n      },\n      attachOriginToPatched: function () {\n        return noop;\n      },\n      _redefineProperty: function () {\n        return noop;\n      },\n      patchCallbacks: function () {\n        return noop;\n      }\n    };\n    var _currentZoneFrame = {\n      parent: null,\n      zone: new Zone(null, null)\n    };\n    var _currentTask = null;\n    var _numberOfNestedTaskFrames = 0;\n\n    function noop() {}\n\n    performanceMeasure('Zone', 'Zone');\n    return global['Zone'] = Zone;\n  }(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n  /**\n   * Suppress closure compiler errors about unknown 'Zone' variable\n   * @fileoverview\n   * @suppress {undefinedVars,globalThis,missingRequire}\n   */\n  /// <reference types=\"node\"/>\n  // issue #989, to reduce bundle size, use short name\n\n  /** Object.getOwnPropertyDescriptor */\n\n\n  var ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n  /** Object.defineProperty */\n\n  var ObjectDefineProperty = Object.defineProperty;\n  /** Object.getPrototypeOf */\n\n  var ObjectGetPrototypeOf = Object.getPrototypeOf;\n  /** Object.create */\n\n  var ObjectCreate = Object.create;\n  /** Array.prototype.slice */\n\n  var ArraySlice = Array.prototype.slice;\n  /** addEventListener string const */\n\n  var ADD_EVENT_LISTENER_STR = 'addEventListener';\n  /** removeEventListener string const */\n\n  var REMOVE_EVENT_LISTENER_STR = 'removeEventListener';\n  /** zoneSymbol addEventListener */\n\n  var ZONE_SYMBOL_ADD_EVENT_LISTENER = Zone.__symbol__(ADD_EVENT_LISTENER_STR);\n  /** zoneSymbol removeEventListener */\n\n\n  var ZONE_SYMBOL_REMOVE_EVENT_LISTENER = Zone.__symbol__(REMOVE_EVENT_LISTENER_STR);\n  /** true string const */\n\n\n  var TRUE_STR = 'true';\n  /** false string const */\n\n  var FALSE_STR = 'false';\n  /** Zone symbol prefix string const. */\n\n  var ZONE_SYMBOL_PREFIX = Zone.__symbol__('');\n\n  function wrapWithCurrentZone(callback, source) {\n    return Zone.current.wrap(callback, source);\n  }\n\n  function scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule, customCancel) {\n    return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel);\n  }\n\n  var zoneSymbol = Zone.__symbol__;\n  var isWindowExists = typeof window !== 'undefined';\n  var internalWindow = isWindowExists ? window : undefined;\n\n  var _global = isWindowExists && internalWindow || typeof self === 'object' && self || global;\n\n  var REMOVE_ATTRIBUTE = 'removeAttribute';\n  var NULL_ON_PROP_VALUE = [null];\n\n  function bindArguments(args, source) {\n    for (var i = args.length - 1; i >= 0; i--) {\n      if (typeof args[i] === 'function') {\n        args[i] = wrapWithCurrentZone(args[i], source + '_' + i);\n      }\n    }\n\n    return args;\n  }\n\n  function patchPrototype(prototype, fnNames) {\n    var source = prototype.constructor['name'];\n\n    var _loop_1 = function (i) {\n      var name_1 = fnNames[i];\n      var delegate = prototype[name_1];\n\n      if (delegate) {\n        var prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name_1);\n\n        if (!isPropertyWritable(prototypeDesc)) {\n          return \"continue\";\n        }\n\n        prototype[name_1] = function (delegate) {\n          var patched = function () {\n            return delegate.apply(this, bindArguments(arguments, source + '.' + name_1));\n          };\n\n          attachOriginToPatched(patched, delegate);\n          return patched;\n        }(delegate);\n      }\n    };\n\n    for (var i = 0; i < fnNames.length; i++) {\n      _loop_1(i);\n    }\n  }\n\n  function isPropertyWritable(propertyDesc) {\n    if (!propertyDesc) {\n      return true;\n    }\n\n    if (propertyDesc.writable === false) {\n      return false;\n    }\n\n    return !(typeof propertyDesc.get === 'function' && typeof propertyDesc.set === 'undefined');\n  }\n\n  var isWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope; // Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n  // this code.\n\n  var isNode = !('nw' in _global) && typeof _global.process !== 'undefined' && {}.toString.call(_global.process) === '[object process]';\n  var isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']); // we are in electron of nw, so we are both browser and nodejs\n  // Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n  // this code.\n\n  var isMix = typeof _global.process !== 'undefined' && {}.toString.call(_global.process) === '[object process]' && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']);\n  var zoneSymbolEventNames = {};\n\n  var wrapFn = function (event) {\n    // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n    // event will be undefined, so we need to use window.event\n    event = event || _global.event;\n\n    if (!event) {\n      return;\n    }\n\n    var eventNameSymbol = zoneSymbolEventNames[event.type];\n\n    if (!eventNameSymbol) {\n      eventNameSymbol = zoneSymbolEventNames[event.type] = zoneSymbol('ON_PROPERTY' + event.type);\n    }\n\n    var target = this || event.target || _global;\n    var listener = target[eventNameSymbol];\n    var result;\n\n    if (isBrowser && target === internalWindow && event.type === 'error') {\n      // window.onerror have different signiture\n      // https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror\n      // and onerror callback will prevent default when callback return true\n      var errorEvent = event;\n      result = listener && listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);\n\n      if (result === true) {\n        event.preventDefault();\n      }\n    } else {\n      result = listener && listener.apply(this, arguments);\n\n      if (result != undefined && !result) {\n        event.preventDefault();\n      }\n    }\n\n    return result;\n  };\n\n  function patchProperty(obj, prop, prototype) {\n    var desc = ObjectGetOwnPropertyDescriptor(obj, prop);\n\n    if (!desc && prototype) {\n      // when patch window object, use prototype to check prop exist or not\n      var prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop);\n\n      if (prototypeDesc) {\n        desc = {\n          enumerable: true,\n          configurable: true\n        };\n      }\n    } // if the descriptor not exists or is not configurable\n    // just return\n\n\n    if (!desc || !desc.configurable) {\n      return;\n    }\n\n    var onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');\n\n    if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {\n      return;\n    } // A property descriptor cannot have getter/setter and be writable\n    // deleting the writable and value properties avoids this error:\n    //\n    // TypeError: property descriptors must not specify a value or be writable when a\n    // getter or setter has been specified\n\n\n    delete desc.writable;\n    delete desc.value;\n    var originalDescGet = desc.get;\n    var originalDescSet = desc.set; // substr(2) cuz 'onclick' -> 'click', etc\n\n    var eventName = prop.substr(2);\n    var eventNameSymbol = zoneSymbolEventNames[eventName];\n\n    if (!eventNameSymbol) {\n      eventNameSymbol = zoneSymbolEventNames[eventName] = zoneSymbol('ON_PROPERTY' + eventName);\n    }\n\n    desc.set = function (newValue) {\n      // in some of windows's onproperty callback, this is undefined\n      // so we need to check it\n      var target = this;\n\n      if (!target && obj === _global) {\n        target = _global;\n      }\n\n      if (!target) {\n        return;\n      }\n\n      var previousValue = target[eventNameSymbol];\n\n      if (previousValue) {\n        target.removeEventListener(eventName, wrapFn);\n      } // issue #978, when onload handler was added before loading zone.js\n      // we should remove it with originalDescSet\n\n\n      if (originalDescSet) {\n        originalDescSet.apply(target, NULL_ON_PROP_VALUE);\n      }\n\n      if (typeof newValue === 'function') {\n        target[eventNameSymbol] = newValue;\n        target.addEventListener(eventName, wrapFn, false);\n      } else {\n        target[eventNameSymbol] = null;\n      }\n    }; // The getter would return undefined for unassigned properties but the default value of an\n    // unassigned property is null\n\n\n    desc.get = function () {\n      // in some of windows's onproperty callback, this is undefined\n      // so we need to check it\n      var target = this;\n\n      if (!target && obj === _global) {\n        target = _global;\n      }\n\n      if (!target) {\n        return null;\n      }\n\n      var listener = target[eventNameSymbol];\n\n      if (listener) {\n        return listener;\n      } else if (originalDescGet) {\n        // result will be null when use inline event attribute,\n        // such as <button onclick=\"func();\">OK</button>\n        // because the onclick function is internal raw uncompiled handler\n        // the onclick will be evaluated when first time event was triggered or\n        // the property is accessed, https://github.com/angular/zone.js/issues/525\n        // so we should use original native get to retrieve the handler\n        var value = originalDescGet && originalDescGet.call(this);\n\n        if (value) {\n          desc.set.call(this, value);\n\n          if (typeof target[REMOVE_ATTRIBUTE] === 'function') {\n            target.removeAttribute(prop);\n          }\n\n          return value;\n        }\n      }\n\n      return null;\n    };\n\n    ObjectDefineProperty(obj, prop, desc);\n    obj[onPropPatchedSymbol] = true;\n  }\n\n  function patchOnProperties(obj, properties, prototype) {\n    if (properties) {\n      for (var i = 0; i < properties.length; i++) {\n        patchProperty(obj, 'on' + properties[i], prototype);\n      }\n    } else {\n      var onProperties = [];\n\n      for (var prop in obj) {\n        if (prop.substr(0, 2) == 'on') {\n          onProperties.push(prop);\n        }\n      }\n\n      for (var j = 0; j < onProperties.length; j++) {\n        patchProperty(obj, onProperties[j], prototype);\n      }\n    }\n  }\n\n  var originalInstanceKey = zoneSymbol('originalInstance'); // wrap some native API on `window`\n\n  function patchClass(className) {\n    var OriginalClass = _global[className];\n    if (!OriginalClass) return; // keep original class in global\n\n    _global[zoneSymbol(className)] = OriginalClass;\n\n    _global[className] = function () {\n      var a = bindArguments(arguments, className);\n\n      switch (a.length) {\n        case 0:\n          this[originalInstanceKey] = new OriginalClass();\n          break;\n\n        case 1:\n          this[originalInstanceKey] = new OriginalClass(a[0]);\n          break;\n\n        case 2:\n          this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n          break;\n\n        case 3:\n          this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n          break;\n\n        case 4:\n          this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n          break;\n\n        default:\n          throw new Error('Arg list too long.');\n      }\n    }; // attach original delegate to patched function\n\n\n    attachOriginToPatched(_global[className], OriginalClass);\n    var instance = new OriginalClass(function () {});\n    var prop;\n\n    for (prop in instance) {\n      // https://bugs.webkit.org/show_bug.cgi?id=44721\n      if (className === 'XMLHttpRequest' && prop === 'responseBlob') continue;\n\n      (function (prop) {\n        if (typeof instance[prop] === 'function') {\n          _global[className].prototype[prop] = function () {\n            return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n          };\n        } else {\n          ObjectDefineProperty(_global[className].prototype, prop, {\n            set: function (fn) {\n              if (typeof fn === 'function') {\n                this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop); // keep callback in wrapped function so we can\n                // use it in Function.prototype.toString to return\n                // the native one.\n\n                attachOriginToPatched(this[originalInstanceKey][prop], fn);\n              } else {\n                this[originalInstanceKey][prop] = fn;\n              }\n            },\n            get: function () {\n              return this[originalInstanceKey][prop];\n            }\n          });\n        }\n      })(prop);\n    }\n\n    for (prop in OriginalClass) {\n      if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n        _global[className][prop] = OriginalClass[prop];\n      }\n    }\n  }\n\n  function patchMethod(target, name, patchFn) {\n    var proto = target;\n\n    while (proto && !proto.hasOwnProperty(name)) {\n      proto = ObjectGetPrototypeOf(proto);\n    }\n\n    if (!proto && target[name]) {\n      // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n      proto = target;\n    }\n\n    var delegateName = zoneSymbol(name);\n    var delegate = null;\n\n    if (proto && (!(delegate = proto[delegateName]) || !proto.hasOwnProperty(delegateName))) {\n      delegate = proto[delegateName] = proto[name]; // check whether proto[name] is writable\n      // some property is readonly in safari, such as HtmlCanvasElement.prototype.toBlob\n\n      var desc = proto && ObjectGetOwnPropertyDescriptor(proto, name);\n\n      if (isPropertyWritable(desc)) {\n        var patchDelegate_1 = patchFn(delegate, delegateName, name);\n\n        proto[name] = function () {\n          return patchDelegate_1(this, arguments);\n        };\n\n        attachOriginToPatched(proto[name], delegate);\n      }\n    }\n\n    return delegate;\n  } // TODO: @JiaLiPassion, support cancel task later if necessary\n\n\n  function patchMacroTask(obj, funcName, metaCreator) {\n    var setNative = null;\n\n    function scheduleTask(task) {\n      var data = task.data;\n\n      data.args[data.cbIdx] = function () {\n        task.invoke.apply(this, arguments);\n      };\n\n      setNative.apply(data.target, data.args);\n      return task;\n    }\n\n    setNative = patchMethod(obj, funcName, function (delegate) {\n      return function (self, args) {\n        var meta = metaCreator(self, args);\n\n        if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {\n          return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);\n        } else {\n          // cause an error by calling it directly.\n          return delegate.apply(self, args);\n        }\n      };\n    });\n  }\n\n  function attachOriginToPatched(patched, original) {\n    patched[zoneSymbol('OriginalDelegate')] = original;\n  }\n\n  var isDetectedIEOrEdge = false;\n  var ieOrEdge = false;\n\n  function isIE() {\n    try {\n      var ua = internalWindow.navigator.userAgent;\n\n      if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1) {\n        return true;\n      }\n    } catch (error) {}\n\n    return false;\n  }\n\n  function isIEOrEdge() {\n    if (isDetectedIEOrEdge) {\n      return ieOrEdge;\n    }\n\n    isDetectedIEOrEdge = true;\n\n    try {\n      var ua = internalWindow.navigator.userAgent;\n\n      if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1 || ua.indexOf('Edge/') !== -1) {\n        ieOrEdge = true;\n      }\n    } catch (error) {}\n\n    return ieOrEdge;\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {\n    var ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n    var ObjectDefineProperty = Object.defineProperty;\n\n    function readableObjectToString(obj) {\n      if (obj && obj.toString === Object.prototype.toString) {\n        var className = obj.constructor && obj.constructor.name;\n        return (className ? className : '') + ': ' + JSON.stringify(obj);\n      }\n\n      return obj ? obj.toString() : Object.prototype.toString.call(obj);\n    }\n\n    var __symbol__ = api.symbol;\n    var _uncaughtPromiseErrors = [];\n    var isDisableWrappingUncaughtPromiseRejection = global[__symbol__('DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION')] === true;\n\n    var symbolPromise = __symbol__('Promise');\n\n    var symbolThen = __symbol__('then');\n\n    var creationTrace = '__creationTrace__';\n\n    api.onUnhandledError = function (e) {\n      if (api.showUncaughtError()) {\n        var rejection = e && e.rejection;\n\n        if (rejection) {\n          console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined);\n        } else {\n          console.error(e);\n        }\n      }\n    };\n\n    api.microtaskDrainDone = function () {\n      var _loop_2 = function () {\n        var uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n\n        try {\n          uncaughtPromiseError.zone.runGuarded(function () {\n            if (uncaughtPromiseError.throwOriginal) {\n              throw uncaughtPromiseError.rejection;\n            }\n\n            throw uncaughtPromiseError;\n          });\n        } catch (error) {\n          handleUnhandledRejection(error);\n        }\n      };\n\n      while (_uncaughtPromiseErrors.length) {\n        _loop_2();\n      }\n    };\n\n    var UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__('unhandledPromiseRejectionHandler');\n\n    function handleUnhandledRejection(e) {\n      api.onUnhandledError(e);\n\n      try {\n        var handler = Zone[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];\n\n        if (typeof handler === 'function') {\n          handler.call(this, e);\n        }\n      } catch (err) {}\n    }\n\n    function isThenable(value) {\n      return value && value.then;\n    }\n\n    function forwardResolution(value) {\n      return value;\n    }\n\n    function forwardRejection(rejection) {\n      return ZoneAwarePromise.reject(rejection);\n    }\n\n    var symbolState = __symbol__('state');\n\n    var symbolValue = __symbol__('value');\n\n    var symbolFinally = __symbol__('finally');\n\n    var symbolParentPromiseValue = __symbol__('parentPromiseValue');\n\n    var symbolParentPromiseState = __symbol__('parentPromiseState');\n\n    var source = 'Promise.then';\n    var UNRESOLVED = null;\n    var RESOLVED = true;\n    var REJECTED = false;\n    var REJECTED_NO_CATCH = 0;\n\n    function makeResolver(promise, state) {\n      return function (v) {\n        try {\n          resolvePromise(promise, state, v);\n        } catch (err) {\n          resolvePromise(promise, false, err);\n        } // Do not return value or you will break the Promise spec.\n\n      };\n    }\n\n    var once = function () {\n      var wasCalled = false;\n      return function wrapper(wrappedFunction) {\n        return function () {\n          if (wasCalled) {\n            return;\n          }\n\n          wasCalled = true;\n          wrappedFunction.apply(null, arguments);\n        };\n      };\n    };\n\n    var TYPE_ERROR = 'Promise resolved with itself';\n\n    var CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace'); // Promise Resolution\n\n\n    function resolvePromise(promise, state, value) {\n      var onceWrapper = once();\n\n      if (promise === value) {\n        throw new TypeError(TYPE_ERROR);\n      }\n\n      if (promise[symbolState] === UNRESOLVED) {\n        // should only get value.then once based on promise spec.\n        var then = null;\n\n        try {\n          if (typeof value === 'object' || typeof value === 'function') {\n            then = value && value.then;\n          }\n        } catch (err) {\n          onceWrapper(function () {\n            resolvePromise(promise, false, err);\n          })();\n          return promise;\n        } // if (value instanceof ZoneAwarePromise) {\n\n\n        if (state !== REJECTED && value instanceof ZoneAwarePromise && value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) && value[symbolState] !== UNRESOLVED) {\n          clearRejectedNoCatch(value);\n          resolvePromise(promise, value[symbolState], value[symbolValue]);\n        } else if (state !== REJECTED && typeof then === 'function') {\n          try {\n            then.call(value, onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)));\n          } catch (err) {\n            onceWrapper(function () {\n              resolvePromise(promise, false, err);\n            })();\n          }\n        } else {\n          promise[symbolState] = state;\n          var queue = promise[symbolValue];\n          promise[symbolValue] = value;\n\n          if (promise[symbolFinally] === symbolFinally) {\n            // the promise is generated by Promise.prototype.finally\n            if (state === RESOLVED) {\n              // the state is resolved, should ignore the value\n              // and use parent promise value\n              promise[symbolState] = promise[symbolParentPromiseState];\n              promise[symbolValue] = promise[symbolParentPromiseValue];\n            }\n          } // record task information in value when error occurs, so we can\n          // do some additional work such as render longStackTrace\n\n\n          if (state === REJECTED && value instanceof Error) {\n            // check if longStackTraceZone is here\n            var trace = Zone.currentTask && Zone.currentTask.data && Zone.currentTask.data[creationTrace];\n\n            if (trace) {\n              // only keep the long stack trace into error when in longStackTraceZone\n              ObjectDefineProperty(value, CURRENT_TASK_TRACE_SYMBOL, {\n                configurable: true,\n                enumerable: false,\n                writable: true,\n                value: trace\n              });\n            }\n          }\n\n          for (var i = 0; i < queue.length;) {\n            scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n          }\n\n          if (queue.length == 0 && state == REJECTED) {\n            promise[symbolState] = REJECTED_NO_CATCH;\n            var uncaughtPromiseError = value;\n\n            try {\n              // Here we throws a new Error to print more readable error log\n              // and if the value is not an error, zone.js builds an `Error`\n              // Object here to attach the stack information.\n              throw new Error('Uncaught (in promise): ' + readableObjectToString(value) + (value && value.stack ? '\\n' + value.stack : ''));\n            } catch (err) {\n              uncaughtPromiseError = err;\n            }\n\n            if (isDisableWrappingUncaughtPromiseRejection) {\n              // If disable wrapping uncaught promise reject\n              // use the value instead of wrapping it.\n              uncaughtPromiseError.throwOriginal = true;\n            }\n\n            uncaughtPromiseError.rejection = value;\n            uncaughtPromiseError.promise = promise;\n            uncaughtPromiseError.zone = Zone.current;\n            uncaughtPromiseError.task = Zone.currentTask;\n\n            _uncaughtPromiseErrors.push(uncaughtPromiseError);\n\n            api.scheduleMicroTask(); // to make sure that it is running\n          }\n        }\n      } // Resolving an already resolved promise is a noop.\n\n\n      return promise;\n    }\n\n    var REJECTION_HANDLED_HANDLER = __symbol__('rejectionHandledHandler');\n\n    function clearRejectedNoCatch(promise) {\n      if (promise[symbolState] === REJECTED_NO_CATCH) {\n        // if the promise is rejected no catch status\n        // and queue.length > 0, means there is a error handler\n        // here to handle the rejected promise, we should trigger\n        // windows.rejectionhandled eventHandler or nodejs rejectionHandled\n        // eventHandler\n        try {\n          var handler = Zone[REJECTION_HANDLED_HANDLER];\n\n          if (handler && typeof handler === 'function') {\n            handler.call(this, {\n              rejection: promise[symbolValue],\n              promise: promise\n            });\n          }\n        } catch (err) {}\n\n        promise[symbolState] = REJECTED;\n\n        for (var i = 0; i < _uncaughtPromiseErrors.length; i++) {\n          if (promise === _uncaughtPromiseErrors[i].promise) {\n            _uncaughtPromiseErrors.splice(i, 1);\n          }\n        }\n      }\n    }\n\n    function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n      clearRejectedNoCatch(promise);\n      var promiseState = promise[symbolState];\n      var delegate = promiseState ? typeof onFulfilled === 'function' ? onFulfilled : forwardResolution : typeof onRejected === 'function' ? onRejected : forwardRejection;\n      zone.scheduleMicroTask(source, function () {\n        try {\n          var parentPromiseValue = promise[symbolValue];\n          var isFinallyPromise = !!chainPromise && symbolFinally === chainPromise[symbolFinally];\n\n          if (isFinallyPromise) {\n            // if the promise is generated from finally call, keep parent promise's state and value\n            chainPromise[symbolParentPromiseValue] = parentPromiseValue;\n            chainPromise[symbolParentPromiseState] = promiseState;\n          } // should not pass value to finally callback\n\n\n          var value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ? [] : [parentPromiseValue]);\n          resolvePromise(chainPromise, true, value);\n        } catch (error) {\n          // if error occurs, should always return this error\n          resolvePromise(chainPromise, false, error);\n        }\n      }, chainPromise);\n    }\n\n    var ZONE_AWARE_PROMISE_TO_STRING = 'function ZoneAwarePromise() { [native code] }';\n\n    var noop = function () {};\n\n    var ZoneAwarePromise =\n    /** @class */\n    function () {\n      function ZoneAwarePromise(executor) {\n        var promise = this;\n\n        if (!(promise instanceof ZoneAwarePromise)) {\n          throw new Error('Must be an instanceof Promise.');\n        }\n\n        promise[symbolState] = UNRESOLVED;\n        promise[symbolValue] = []; // queue;\n\n        try {\n          executor && executor(makeResolver(promise, RESOLVED), makeResolver(promise, REJECTED));\n        } catch (error) {\n          resolvePromise(promise, false, error);\n        }\n      }\n\n      ZoneAwarePromise.toString = function () {\n        return ZONE_AWARE_PROMISE_TO_STRING;\n      };\n\n      ZoneAwarePromise.resolve = function (value) {\n        return resolvePromise(new this(null), RESOLVED, value);\n      };\n\n      ZoneAwarePromise.reject = function (error) {\n        return resolvePromise(new this(null), REJECTED, error);\n      };\n\n      ZoneAwarePromise.race = function (values) {\n        var resolve;\n        var reject;\n        var promise = new this(function (res, rej) {\n          resolve = res;\n          reject = rej;\n        });\n\n        function onResolve(value) {\n          resolve(value);\n        }\n\n        function onReject(error) {\n          reject(error);\n        }\n\n        for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n          var value = values_1[_i];\n\n          if (!isThenable(value)) {\n            value = this.resolve(value);\n          }\n\n          value.then(onResolve, onReject);\n        }\n\n        return promise;\n      };\n\n      ZoneAwarePromise.all = function (values) {\n        return ZoneAwarePromise.allWithCallback(values);\n      };\n\n      ZoneAwarePromise.allSettled = function (values) {\n        var P = this && this.prototype instanceof ZoneAwarePromise ? this : ZoneAwarePromise;\n        return P.allWithCallback(values, {\n          thenCallback: function (value) {\n            return {\n              status: 'fulfilled',\n              value: value\n            };\n          },\n          errorCallback: function (err) {\n            return {\n              status: 'rejected',\n              reason: err\n            };\n          }\n        });\n      };\n\n      ZoneAwarePromise.allWithCallback = function (values, callback) {\n        var resolve;\n        var reject;\n        var promise = new this(function (res, rej) {\n          resolve = res;\n          reject = rej;\n        }); // Start at 2 to prevent prematurely resolving if .then is called immediately.\n\n        var unresolvedCount = 2;\n        var valueIndex = 0;\n        var resolvedValues = [];\n\n        var _loop_3 = function (value) {\n          if (!isThenable(value)) {\n            value = this_1.resolve(value);\n          }\n\n          var curValueIndex = valueIndex;\n\n          try {\n            value.then(function (value) {\n              resolvedValues[curValueIndex] = callback ? callback.thenCallback(value) : value;\n              unresolvedCount--;\n\n              if (unresolvedCount === 0) {\n                resolve(resolvedValues);\n              }\n            }, function (err) {\n              if (!callback) {\n                reject(err);\n              } else {\n                resolvedValues[curValueIndex] = callback.errorCallback(err);\n                unresolvedCount--;\n\n                if (unresolvedCount === 0) {\n                  resolve(resolvedValues);\n                }\n              }\n            });\n          } catch (thenErr) {\n            reject(thenErr);\n          }\n\n          unresolvedCount++;\n          valueIndex++;\n        };\n\n        var this_1 = this;\n\n        for (var _i = 0, values_2 = values; _i < values_2.length; _i++) {\n          var value = values_2[_i];\n\n          _loop_3(value);\n        } // Make the unresolvedCount zero-based again.\n\n\n        unresolvedCount -= 2;\n\n        if (unresolvedCount === 0) {\n          resolve(resolvedValues);\n        }\n\n        return promise;\n      };\n\n      Object.defineProperty(ZoneAwarePromise.prototype, Symbol.toStringTag, {\n        get: function () {\n          return 'Promise';\n        },\n        enumerable: false,\n        configurable: true\n      });\n      Object.defineProperty(ZoneAwarePromise.prototype, Symbol.species, {\n        get: function () {\n          return ZoneAwarePromise;\n        },\n        enumerable: false,\n        configurable: true\n      });\n\n      ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) {\n        var C = this.constructor[Symbol.species];\n\n        if (!C || typeof C !== 'function') {\n          C = this.constructor || ZoneAwarePromise;\n        }\n\n        var chainPromise = new C(noop);\n        var zone = Zone.current;\n\n        if (this[symbolState] == UNRESOLVED) {\n          this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n        } else {\n          scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n        }\n\n        return chainPromise;\n      };\n\n      ZoneAwarePromise.prototype.catch = function (onRejected) {\n        return this.then(null, onRejected);\n      };\n\n      ZoneAwarePromise.prototype.finally = function (onFinally) {\n        var C = this.constructor[Symbol.species];\n\n        if (!C || typeof C !== 'function') {\n          C = ZoneAwarePromise;\n        }\n\n        var chainPromise = new C(noop);\n        chainPromise[symbolFinally] = symbolFinally;\n        var zone = Zone.current;\n\n        if (this[symbolState] == UNRESOLVED) {\n          this[symbolValue].push(zone, chainPromise, onFinally, onFinally);\n        } else {\n          scheduleResolveOrReject(this, zone, chainPromise, onFinally, onFinally);\n        }\n\n        return chainPromise;\n      };\n\n      return ZoneAwarePromise;\n    }(); // Protect against aggressive optimizers dropping seemingly unused properties.\n    // E.g. Closure Compiler in advanced mode.\n\n\n    ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve;\n    ZoneAwarePromise['reject'] = ZoneAwarePromise.reject;\n    ZoneAwarePromise['race'] = ZoneAwarePromise.race;\n    ZoneAwarePromise['all'] = ZoneAwarePromise.all;\n    var NativePromise = global[symbolPromise] = global['Promise'];\n    global['Promise'] = ZoneAwarePromise;\n\n    var symbolThenPatched = __symbol__('thenPatched');\n\n    function patchThen(Ctor) {\n      var proto = Ctor.prototype;\n      var prop = ObjectGetOwnPropertyDescriptor(proto, 'then');\n\n      if (prop && (prop.writable === false || !prop.configurable)) {\n        // check Ctor.prototype.then propertyDescriptor is writable or not\n        // in meteor env, writable is false, we should ignore such case\n        return;\n      }\n\n      var originalThen = proto.then; // Keep a reference to the original method.\n\n      proto[symbolThen] = originalThen;\n\n      Ctor.prototype.then = function (onResolve, onReject) {\n        var _this = this;\n\n        var wrapped = new ZoneAwarePromise(function (resolve, reject) {\n          originalThen.call(_this, resolve, reject);\n        });\n        return wrapped.then(onResolve, onReject);\n      };\n\n      Ctor[symbolThenPatched] = true;\n    }\n\n    api.patchThen = patchThen;\n\n    function zoneify(fn) {\n      return function (self, args) {\n        var resultPromise = fn.apply(self, args);\n\n        if (resultPromise instanceof ZoneAwarePromise) {\n          return resultPromise;\n        }\n\n        var ctor = resultPromise.constructor;\n\n        if (!ctor[symbolThenPatched]) {\n          patchThen(ctor);\n        }\n\n        return resultPromise;\n      };\n    }\n\n    if (NativePromise) {\n      patchThen(NativePromise);\n      patchMethod(global, 'fetch', function (delegate) {\n        return zoneify(delegate);\n      });\n    } // This is not part of public API, but it is useful for tests, so we expose it.\n\n\n    Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;\n    return ZoneAwarePromise;\n  });\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n  // override Function.prototype.toString to make zone.js patched function\n  // look like native function\n\n\n  Zone.__load_patch('toString', function (global) {\n    // patch Func.prototype.toString to let them look like native\n    var originalFunctionToString = Function.prototype.toString;\n    var ORIGINAL_DELEGATE_SYMBOL = zoneSymbol('OriginalDelegate');\n    var PROMISE_SYMBOL = zoneSymbol('Promise');\n    var ERROR_SYMBOL = zoneSymbol('Error');\n\n    var newFunctionToString = function toString() {\n      if (typeof this === 'function') {\n        var originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];\n\n        if (originalDelegate) {\n          if (typeof originalDelegate === 'function') {\n            return originalFunctionToString.call(originalDelegate);\n          } else {\n            return Object.prototype.toString.call(originalDelegate);\n          }\n        }\n\n        if (this === Promise) {\n          var nativePromise = global[PROMISE_SYMBOL];\n\n          if (nativePromise) {\n            return originalFunctionToString.call(nativePromise);\n          }\n        }\n\n        if (this === Error) {\n          var nativeError = global[ERROR_SYMBOL];\n\n          if (nativeError) {\n            return originalFunctionToString.call(nativeError);\n          }\n        }\n      }\n\n      return originalFunctionToString.call(this);\n    };\n\n    newFunctionToString[ORIGINAL_DELEGATE_SYMBOL] = originalFunctionToString;\n    Function.prototype.toString = newFunctionToString; // patch Object.prototype.toString to let them look like native\n\n    var originalObjectToString = Object.prototype.toString;\n    var PROMISE_OBJECT_TO_STRING = '[object Promise]';\n\n    Object.prototype.toString = function () {\n      if (typeof Promise === 'function' && this instanceof Promise) {\n        return PROMISE_OBJECT_TO_STRING;\n      }\n\n      return originalObjectToString.call(this);\n    };\n  });\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  var passiveSupported = false;\n\n  if (typeof window !== 'undefined') {\n    try {\n      var options = Object.defineProperty({}, 'passive', {\n        get: function () {\n          passiveSupported = true;\n        }\n      });\n      window.addEventListener('test', options, options);\n      window.removeEventListener('test', options, options);\n    } catch (err) {\n      passiveSupported = false;\n    }\n  } // an identifier to tell ZoneTask do not create a new invoke closure\n\n\n  var OPTIMIZED_ZONE_EVENT_TASK_DATA = {\n    useG: true\n  };\n  var zoneSymbolEventNames$1 = {};\n  var globalSources = {};\n  var EVENT_NAME_SYMBOL_REGX = new RegExp('^' + ZONE_SYMBOL_PREFIX + '(\\\\w+)(true|false)$');\n  var IMMEDIATE_PROPAGATION_SYMBOL = zoneSymbol('propagationStopped');\n\n  function prepareEventNames(eventName, eventNameToString) {\n    var falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;\n    var trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;\n    var symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n    var symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n    zoneSymbolEventNames$1[eventName] = {};\n    zoneSymbolEventNames$1[eventName][FALSE_STR] = symbol;\n    zoneSymbolEventNames$1[eventName][TRUE_STR] = symbolCapture;\n  }\n\n  function patchEventTarget(_global, apis, patchOptions) {\n    var ADD_EVENT_LISTENER = patchOptions && patchOptions.add || ADD_EVENT_LISTENER_STR;\n    var REMOVE_EVENT_LISTENER = patchOptions && patchOptions.rm || REMOVE_EVENT_LISTENER_STR;\n    var LISTENERS_EVENT_LISTENER = patchOptions && patchOptions.listeners || 'eventListeners';\n    var REMOVE_ALL_LISTENERS_EVENT_LISTENER = patchOptions && patchOptions.rmAll || 'removeAllListeners';\n    var zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER);\n    var ADD_EVENT_LISTENER_SOURCE = '.' + ADD_EVENT_LISTENER + ':';\n    var PREPEND_EVENT_LISTENER = 'prependListener';\n    var PREPEND_EVENT_LISTENER_SOURCE = '.' + PREPEND_EVENT_LISTENER + ':';\n\n    var invokeTask = function (task, target, event) {\n      // for better performance, check isRemoved which is set\n      // by removeEventListener\n      if (task.isRemoved) {\n        return;\n      }\n\n      var delegate = task.callback;\n\n      if (typeof delegate === 'object' && delegate.handleEvent) {\n        // create the bind version of handleEvent when invoke\n        task.callback = function (event) {\n          return delegate.handleEvent(event);\n        };\n\n        task.originalDelegate = delegate;\n      } // invoke static task.invoke\n\n\n      task.invoke(task, target, [event]);\n      var options = task.options;\n\n      if (options && typeof options === 'object' && options.once) {\n        // if options.once is true, after invoke once remove listener here\n        // only browser need to do this, nodejs eventEmitter will cal removeListener\n        // inside EventEmitter.once\n        var delegate_1 = task.originalDelegate ? task.originalDelegate : task.callback;\n        target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate_1, options);\n      }\n    }; // global shared zoneAwareCallback to handle all event callback with capture = false\n\n\n    var globalZoneAwareCallback = function (event) {\n      // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n      // event will be undefined, so we need to use window.event\n      event = event || _global.event;\n\n      if (!event) {\n        return;\n      } // event.target is needed for Samsung TV and SourceBuffer\n      // || global is needed https://github.com/angular/zone.js/issues/190\n\n\n      var target = this || event.target || _global;\n      var tasks = target[zoneSymbolEventNames$1[event.type][FALSE_STR]];\n\n      if (tasks) {\n        // invoke all tasks which attached to current target with given event.type and capture = false\n        // for performance concern, if task.length === 1, just invoke\n        if (tasks.length === 1) {\n          invokeTask(tasks[0], target, event);\n        } else {\n          // https://github.com/angular/zone.js/issues/836\n          // copy the tasks array before invoke, to avoid\n          // the callback will remove itself or other listener\n          var copyTasks = tasks.slice();\n\n          for (var i = 0; i < copyTasks.length; i++) {\n            if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n              break;\n            }\n\n            invokeTask(copyTasks[i], target, event);\n          }\n        }\n      }\n    }; // global shared zoneAwareCallback to handle all event callback with capture = true\n\n\n    var globalZoneAwareCaptureCallback = function (event) {\n      // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n      // event will be undefined, so we need to use window.event\n      event = event || _global.event;\n\n      if (!event) {\n        return;\n      } // event.target is needed for Samsung TV and SourceBuffer\n      // || global is needed https://github.com/angular/zone.js/issues/190\n\n\n      var target = this || event.target || _global;\n      var tasks = target[zoneSymbolEventNames$1[event.type][TRUE_STR]];\n\n      if (tasks) {\n        // invoke all tasks which attached to current target with given event.type and capture = false\n        // for performance concern, if task.length === 1, just invoke\n        if (tasks.length === 1) {\n          invokeTask(tasks[0], target, event);\n        } else {\n          // https://github.com/angular/zone.js/issues/836\n          // copy the tasks array before invoke, to avoid\n          // the callback will remove itself or other listener\n          var copyTasks = tasks.slice();\n\n          for (var i = 0; i < copyTasks.length; i++) {\n            if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n              break;\n            }\n\n            invokeTask(copyTasks[i], target, event);\n          }\n        }\n      }\n    };\n\n    function patchEventTargetMethods(obj, patchOptions) {\n      if (!obj) {\n        return false;\n      }\n\n      var useGlobalCallback = true;\n\n      if (patchOptions && patchOptions.useG !== undefined) {\n        useGlobalCallback = patchOptions.useG;\n      }\n\n      var validateHandler = patchOptions && patchOptions.vh;\n      var checkDuplicate = true;\n\n      if (patchOptions && patchOptions.chkDup !== undefined) {\n        checkDuplicate = patchOptions.chkDup;\n      }\n\n      var returnTarget = false;\n\n      if (patchOptions && patchOptions.rt !== undefined) {\n        returnTarget = patchOptions.rt;\n      }\n\n      var proto = obj;\n\n      while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) {\n        proto = ObjectGetPrototypeOf(proto);\n      }\n\n      if (!proto && obj[ADD_EVENT_LISTENER]) {\n        // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n        proto = obj;\n      }\n\n      if (!proto) {\n        return false;\n      }\n\n      if (proto[zoneSymbolAddEventListener]) {\n        return false;\n      }\n\n      var eventNameToString = patchOptions && patchOptions.eventNameToString; // a shared global taskData to pass data for scheduleEventTask\n      // so we do not need to create a new object just for pass some data\n\n      var taskData = {};\n      var nativeAddEventListener = proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER];\n      var nativeRemoveEventListener = proto[zoneSymbol(REMOVE_EVENT_LISTENER)] = proto[REMOVE_EVENT_LISTENER];\n      var nativeListeners = proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] = proto[LISTENERS_EVENT_LISTENER];\n      var nativeRemoveAllListeners = proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] = proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER];\n      var nativePrependEventListener;\n\n      if (patchOptions && patchOptions.prepend) {\n        nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] = proto[patchOptions.prepend];\n      }\n      /**\n       * This util function will build an option object with passive option\n       * to handle all possible input from the user.\n       */\n\n\n      function buildEventListenerOptions(options, passive) {\n        if (!passiveSupported && typeof options === 'object' && options) {\n          // doesn't support passive but user want to pass an object as options.\n          // this will not work on some old browser, so we just pass a boolean\n          // as useCapture parameter\n          return !!options.capture;\n        }\n\n        if (!passiveSupported || !passive) {\n          return options;\n        }\n\n        if (typeof options === 'boolean') {\n          return {\n            capture: options,\n            passive: true\n          };\n        }\n\n        if (!options) {\n          return {\n            passive: true\n          };\n        }\n\n        if (typeof options === 'object' && options.passive !== false) {\n          return Object.assign(Object.assign({}, options), {\n            passive: true\n          });\n        }\n\n        return options;\n      }\n\n      var customScheduleGlobal = function (task) {\n        // if there is already a task for the eventName + capture,\n        // just return, because we use the shared globalZoneAwareCallback here.\n        if (taskData.isExisting) {\n          return;\n        }\n\n        return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);\n      };\n\n      var customCancelGlobal = function (task) {\n        // if task is not marked as isRemoved, this call is directly\n        // from Zone.prototype.cancelTask, we should remove the task\n        // from tasksList of target first\n        if (!task.isRemoved) {\n          var symbolEventNames = zoneSymbolEventNames$1[task.eventName];\n          var symbolEventName = void 0;\n\n          if (symbolEventNames) {\n            symbolEventName = symbolEventNames[task.capture ? TRUE_STR : FALSE_STR];\n          }\n\n          var existingTasks = symbolEventName && task.target[symbolEventName];\n\n          if (existingTasks) {\n            for (var i = 0; i < existingTasks.length; i++) {\n              var existingTask = existingTasks[i];\n\n              if (existingTask === task) {\n                existingTasks.splice(i, 1); // set isRemoved to data for faster invokeTask check\n\n                task.isRemoved = true;\n\n                if (existingTasks.length === 0) {\n                  // all tasks for the eventName + capture have gone,\n                  // remove globalZoneAwareCallback and remove the task cache from target\n                  task.allRemoved = true;\n                  task.target[symbolEventName] = null;\n                }\n\n                break;\n              }\n            }\n          }\n        } // if all tasks for the eventName + capture have gone,\n        // we will really remove the global event callback,\n        // if not, return\n\n\n        if (!task.allRemoved) {\n          return;\n        }\n\n        return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);\n      };\n\n      var customScheduleNonGlobal = function (task) {\n        return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n      };\n\n      var customSchedulePrepend = function (task) {\n        return nativePrependEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n      };\n\n      var customCancelNonGlobal = function (task) {\n        return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options);\n      };\n\n      var customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal;\n      var customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal;\n\n      var compareTaskCallbackVsDelegate = function (task, delegate) {\n        var typeOfDelegate = typeof delegate;\n        return typeOfDelegate === 'function' && task.callback === delegate || typeOfDelegate === 'object' && task.originalDelegate === delegate;\n      };\n\n      var compare = patchOptions && patchOptions.diff ? patchOptions.diff : compareTaskCallbackVsDelegate;\n      var unpatchedEvents = Zone[zoneSymbol('UNPATCHED_EVENTS')];\n\n      var passiveEvents = _global[zoneSymbol('PASSIVE_EVENTS')];\n\n      var makeAddListener = function (nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget, prepend) {\n        if (returnTarget === void 0) {\n          returnTarget = false;\n        }\n\n        if (prepend === void 0) {\n          prepend = false;\n        }\n\n        return function () {\n          var target = this || _global;\n          var eventName = arguments[0];\n\n          if (patchOptions && patchOptions.transferEventName) {\n            eventName = patchOptions.transferEventName(eventName);\n          }\n\n          var delegate = arguments[1];\n\n          if (!delegate) {\n            return nativeListener.apply(this, arguments);\n          }\n\n          if (isNode && eventName === 'uncaughtException') {\n            // don't patch uncaughtException of nodejs to prevent endless loop\n            return nativeListener.apply(this, arguments);\n          } // don't create the bind delegate function for handleEvent\n          // case here to improve addEventListener performance\n          // we will create the bind delegate when invoke\n\n\n          var isHandleEvent = false;\n\n          if (typeof delegate !== 'function') {\n            if (!delegate.handleEvent) {\n              return nativeListener.apply(this, arguments);\n            }\n\n            isHandleEvent = true;\n          }\n\n          if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {\n            return;\n          }\n\n          var passive = passiveSupported && !!passiveEvents && passiveEvents.indexOf(eventName) !== -1;\n          var options = buildEventListenerOptions(arguments[2], passive);\n\n          if (unpatchedEvents) {\n            // check upatched list\n            for (var i = 0; i < unpatchedEvents.length; i++) {\n              if (eventName === unpatchedEvents[i]) {\n                if (passive) {\n                  return nativeListener.call(target, eventName, delegate, options);\n                } else {\n                  return nativeListener.apply(this, arguments);\n                }\n              }\n            }\n          }\n\n          var capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n          var once = options && typeof options === 'object' ? options.once : false;\n          var zone = Zone.current;\n          var symbolEventNames = zoneSymbolEventNames$1[eventName];\n\n          if (!symbolEventNames) {\n            prepareEventNames(eventName, eventNameToString);\n            symbolEventNames = zoneSymbolEventNames$1[eventName];\n          }\n\n          var symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n          var existingTasks = target[symbolEventName];\n          var isExisting = false;\n\n          if (existingTasks) {\n            // already have task registered\n            isExisting = true;\n\n            if (checkDuplicate) {\n              for (var i = 0; i < existingTasks.length; i++) {\n                if (compare(existingTasks[i], delegate)) {\n                  // same callback, same capture, same event name, just return\n                  return;\n                }\n              }\n            }\n          } else {\n            existingTasks = target[symbolEventName] = [];\n          }\n\n          var source;\n          var constructorName = target.constructor['name'];\n          var targetSource = globalSources[constructorName];\n\n          if (targetSource) {\n            source = targetSource[eventName];\n          }\n\n          if (!source) {\n            source = constructorName + addSource + (eventNameToString ? eventNameToString(eventName) : eventName);\n          } // do not create a new object as task.data to pass those things\n          // just use the global shared one\n\n\n          taskData.options = options;\n\n          if (once) {\n            // if addEventListener with once options, we don't pass it to\n            // native addEventListener, instead we keep the once setting\n            // and handle ourselves.\n            taskData.options.once = false;\n          }\n\n          taskData.target = target;\n          taskData.capture = capture;\n          taskData.eventName = eventName;\n          taskData.isExisting = isExisting;\n          var data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined; // keep taskData into data to allow onScheduleEventTask to access the task information\n\n          if (data) {\n            data.taskData = taskData;\n          }\n\n          var task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn); // should clear taskData.target to avoid memory leak\n          // issue, https://github.com/angular/angular/issues/20442\n\n          taskData.target = null; // need to clear up taskData because it is a global object\n\n          if (data) {\n            data.taskData = null;\n          } // have to save those information to task in case\n          // application may call task.zone.cancelTask() directly\n\n\n          if (once) {\n            options.once = true;\n          }\n\n          if (!(!passiveSupported && typeof task.options === 'boolean')) {\n            // if not support passive, and we pass an option object\n            // to addEventListener, we should save the options to task\n            task.options = options;\n          }\n\n          task.target = target;\n          task.capture = capture;\n          task.eventName = eventName;\n\n          if (isHandleEvent) {\n            // save original delegate for compare to check duplicate\n            task.originalDelegate = delegate;\n          }\n\n          if (!prepend) {\n            existingTasks.push(task);\n          } else {\n            existingTasks.unshift(task);\n          }\n\n          if (returnTarget) {\n            return target;\n          }\n        };\n      };\n\n      proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget);\n\n      if (nativePrependEventListener) {\n        proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true);\n      }\n\n      proto[REMOVE_EVENT_LISTENER] = function () {\n        var target = this || _global;\n        var eventName = arguments[0];\n\n        if (patchOptions && patchOptions.transferEventName) {\n          eventName = patchOptions.transferEventName(eventName);\n        }\n\n        var options = arguments[2];\n        var capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n        var delegate = arguments[1];\n\n        if (!delegate) {\n          return nativeRemoveEventListener.apply(this, arguments);\n        }\n\n        if (validateHandler && !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) {\n          return;\n        }\n\n        var symbolEventNames = zoneSymbolEventNames$1[eventName];\n        var symbolEventName;\n\n        if (symbolEventNames) {\n          symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n        }\n\n        var existingTasks = symbolEventName && target[symbolEventName];\n\n        if (existingTasks) {\n          for (var i = 0; i < existingTasks.length; i++) {\n            var existingTask = existingTasks[i];\n\n            if (compare(existingTask, delegate)) {\n              existingTasks.splice(i, 1); // set isRemoved to data for faster invokeTask check\n\n              existingTask.isRemoved = true;\n\n              if (existingTasks.length === 0) {\n                // all tasks for the eventName + capture have gone,\n                // remove globalZoneAwareCallback and remove the task cache from target\n                existingTask.allRemoved = true;\n                target[symbolEventName] = null; // in the target, we have an event listener which is added by on_property\n                // such as target.onclick = function() {}, so we need to clear this internal\n                // property too if all delegates all removed\n\n                if (typeof eventName === 'string') {\n                  var onPropertySymbol = ZONE_SYMBOL_PREFIX + 'ON_PROPERTY' + eventName;\n                  target[onPropertySymbol] = null;\n                }\n              }\n\n              existingTask.zone.cancelTask(existingTask);\n\n              if (returnTarget) {\n                return target;\n              }\n\n              return;\n            }\n          }\n        } // issue 930, didn't find the event name or callback\n        // from zone kept existingTasks, the callback maybe\n        // added outside of zone, we need to call native removeEventListener\n        // to try to remove it.\n\n\n        return nativeRemoveEventListener.apply(this, arguments);\n      };\n\n      proto[LISTENERS_EVENT_LISTENER] = function () {\n        var target = this || _global;\n        var eventName = arguments[0];\n\n        if (patchOptions && patchOptions.transferEventName) {\n          eventName = patchOptions.transferEventName(eventName);\n        }\n\n        var listeners = [];\n        var tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);\n\n        for (var i = 0; i < tasks.length; i++) {\n          var task = tasks[i];\n          var delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n          listeners.push(delegate);\n        }\n\n        return listeners;\n      };\n\n      proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function () {\n        var target = this || _global;\n        var eventName = arguments[0];\n\n        if (!eventName) {\n          var keys = Object.keys(target);\n\n          for (var i = 0; i < keys.length; i++) {\n            var prop = keys[i];\n            var match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n            var evtName = match && match[1]; // in nodejs EventEmitter, removeListener event is\n            // used for monitoring the removeListener call,\n            // so just keep removeListener eventListener until\n            // all other eventListeners are removed\n\n            if (evtName && evtName !== 'removeListener') {\n              this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName);\n            }\n          } // remove removeListener listener finally\n\n\n          this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, 'removeListener');\n        } else {\n          if (patchOptions && patchOptions.transferEventName) {\n            eventName = patchOptions.transferEventName(eventName);\n          }\n\n          var symbolEventNames = zoneSymbolEventNames$1[eventName];\n\n          if (symbolEventNames) {\n            var symbolEventName = symbolEventNames[FALSE_STR];\n            var symbolCaptureEventName = symbolEventNames[TRUE_STR];\n            var tasks = target[symbolEventName];\n            var captureTasks = target[symbolCaptureEventName];\n\n            if (tasks) {\n              var removeTasks = tasks.slice();\n\n              for (var i = 0; i < removeTasks.length; i++) {\n                var task = removeTasks[i];\n                var delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n                this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n              }\n            }\n\n            if (captureTasks) {\n              var removeTasks = captureTasks.slice();\n\n              for (var i = 0; i < removeTasks.length; i++) {\n                var task = removeTasks[i];\n                var delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n                this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n              }\n            }\n          }\n        }\n\n        if (returnTarget) {\n          return this;\n        }\n      }; // for native toString patch\n\n\n      attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener);\n      attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener);\n\n      if (nativeRemoveAllListeners) {\n        attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners);\n      }\n\n      if (nativeListeners) {\n        attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners);\n      }\n\n      return true;\n    }\n\n    var results = [];\n\n    for (var i = 0; i < apis.length; i++) {\n      results[i] = patchEventTargetMethods(apis[i], patchOptions);\n    }\n\n    return results;\n  }\n\n  function findEventTasks(target, eventName) {\n    if (!eventName) {\n      var foundTasks = [];\n\n      for (var prop in target) {\n        var match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n        var evtName = match && match[1];\n\n        if (evtName && (!eventName || evtName === eventName)) {\n          var tasks = target[prop];\n\n          if (tasks) {\n            for (var i = 0; i < tasks.length; i++) {\n              foundTasks.push(tasks[i]);\n            }\n          }\n        }\n      }\n\n      return foundTasks;\n    }\n\n    var symbolEventName = zoneSymbolEventNames$1[eventName];\n\n    if (!symbolEventName) {\n      prepareEventNames(eventName);\n      symbolEventName = zoneSymbolEventNames$1[eventName];\n    }\n\n    var captureFalseTasks = target[symbolEventName[FALSE_STR]];\n    var captureTrueTasks = target[symbolEventName[TRUE_STR]];\n\n    if (!captureFalseTasks) {\n      return captureTrueTasks ? captureTrueTasks.slice() : [];\n    } else {\n      return captureTrueTasks ? captureFalseTasks.concat(captureTrueTasks) : captureFalseTasks.slice();\n    }\n  }\n\n  function patchEventPrototype(global, api) {\n    var Event = global['Event'];\n\n    if (Event && Event.prototype) {\n      api.patchMethod(Event.prototype, 'stopImmediatePropagation', function (delegate) {\n        return function (self, args) {\n          self[IMMEDIATE_PROPAGATION_SYMBOL] = true; // we need to call the native stopImmediatePropagation\n          // in case in some hybrid application, some part of\n          // application will be controlled by zone, some are not\n\n          delegate && delegate.apply(self, args);\n        };\n      });\n    }\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  function patchCallbacks(api, target, targetName, method, callbacks) {\n    var symbol = Zone.__symbol__(method);\n\n    if (target[symbol]) {\n      return;\n    }\n\n    var nativeDelegate = target[symbol] = target[method];\n\n    target[method] = function (name, opts, options) {\n      if (opts && opts.prototype) {\n        callbacks.forEach(function (callback) {\n          var source = targetName + \".\" + method + \"::\" + callback;\n          var prototype = opts.prototype;\n\n          if (prototype.hasOwnProperty(callback)) {\n            var descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback);\n\n            if (descriptor && descriptor.value) {\n              descriptor.value = api.wrapWithCurrentZone(descriptor.value, source);\n\n              api._redefineProperty(opts.prototype, callback, descriptor);\n            } else if (prototype[callback]) {\n              prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n            }\n          } else if (prototype[callback]) {\n            prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n          }\n        });\n      }\n\n      return nativeDelegate.call(target, name, opts, options);\n    };\n\n    api.attachOriginToPatched(target[method], nativeDelegate);\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  var globalEventHandlersEventNames = ['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'];\n  var documentEventNames = ['afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'freeze', 'fullscreenchange', 'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror', 'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange', 'visibilitychange', 'resume'];\n  var windowEventNames = ['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', 'vrdisplayconnected', 'vrdisplaydisconnected', 'vrdisplaypresentchange'];\n  var htmlElementEventNames = ['beforecopy', 'beforecut', 'beforepaste', 'copy', 'cut', 'paste', 'dragstart', 'loadend', 'animationstart', 'search', 'transitionrun', 'transitionstart', 'webkitanimationend', 'webkitanimationiteration', 'webkitanimationstart', 'webkittransitionend'];\n  var mediaElementEventNames = ['encrypted', 'waitingforkey', 'msneedkey', 'mozinterruptbegin', 'mozinterruptend'];\n  var ieElementEventNames = ['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'];\n  var webglEventNames = ['webglcontextrestored', 'webglcontextlost', 'webglcontextcreationerror'];\n  var formEventNames = ['autocomplete', 'autocompleteerror'];\n  var detailEventNames = ['toggle'];\n  var frameEventNames = ['load'];\n  var frameSetEventNames = ['blur', 'error', 'focus', 'load', 'resize', 'scroll', 'messageerror'];\n  var marqueeEventNames = ['bounce', 'finish', 'start'];\n  var XMLHttpRequestEventNames = ['loadstart', 'progress', 'abort', 'error', 'load', 'progress', 'timeout', 'loadend', 'readystatechange'];\n  var IDBIndexEventNames = ['upgradeneeded', 'complete', 'abort', 'success', 'error', 'blocked', 'versionchange', 'close'];\n  var websocketEventNames = ['close', 'error', 'open', 'message'];\n  var workerEventNames = ['error', 'message'];\n  var eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames);\n\n  function filterProperties(target, onProperties, ignoreProperties) {\n    if (!ignoreProperties || ignoreProperties.length === 0) {\n      return onProperties;\n    }\n\n    var tip = ignoreProperties.filter(function (ip) {\n      return ip.target === target;\n    });\n\n    if (!tip || tip.length === 0) {\n      return onProperties;\n    }\n\n    var targetIgnoreProperties = tip[0].ignoreProperties;\n    return onProperties.filter(function (op) {\n      return targetIgnoreProperties.indexOf(op) === -1;\n    });\n  }\n\n  function patchFilteredProperties(target, onProperties, ignoreProperties, prototype) {\n    // check whether target is available, sometimes target will be undefined\n    // because different browser or some 3rd party plugin.\n    if (!target) {\n      return;\n    }\n\n    var filteredProperties = filterProperties(target, onProperties, ignoreProperties);\n    patchOnProperties(target, filteredProperties, prototype);\n  }\n\n  function propertyDescriptorPatch(api, _global) {\n    if (isNode && !isMix) {\n      return;\n    }\n\n    if (Zone[api.symbol('patchEvents')]) {\n      // events are already been patched by legacy patch.\n      return;\n    }\n\n    var supportsWebSocket = typeof WebSocket !== 'undefined';\n    var ignoreProperties = _global['__Zone_ignore_on_properties']; // for browsers that we can patch the descriptor:  Chrome & Firefox\n\n    if (isBrowser) {\n      var internalWindow_1 = window;\n      var ignoreErrorProperties = isIE() ? [{\n        target: internalWindow_1,\n        ignoreProperties: ['error']\n      }] : []; // in IE/Edge, onProp not exist in window object, but in WindowPrototype\n      // so we need to pass WindowPrototype to check onProp exist or not\n\n      patchFilteredProperties(internalWindow_1, eventNames.concat(['messageerror']), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow_1));\n      patchFilteredProperties(Document.prototype, eventNames, ignoreProperties);\n\n      if (typeof internalWindow_1['SVGElement'] !== 'undefined') {\n        patchFilteredProperties(internalWindow_1['SVGElement'].prototype, eventNames, ignoreProperties);\n      }\n\n      patchFilteredProperties(Element.prototype, eventNames, ignoreProperties);\n      patchFilteredProperties(HTMLElement.prototype, eventNames, ignoreProperties);\n      patchFilteredProperties(HTMLMediaElement.prototype, mediaElementEventNames, ignoreProperties);\n      patchFilteredProperties(HTMLFrameSetElement.prototype, windowEventNames.concat(frameSetEventNames), ignoreProperties);\n      patchFilteredProperties(HTMLBodyElement.prototype, windowEventNames.concat(frameSetEventNames), ignoreProperties);\n      patchFilteredProperties(HTMLFrameElement.prototype, frameEventNames, ignoreProperties);\n      patchFilteredProperties(HTMLIFrameElement.prototype, frameEventNames, ignoreProperties);\n      var HTMLMarqueeElement_1 = internalWindow_1['HTMLMarqueeElement'];\n\n      if (HTMLMarqueeElement_1) {\n        patchFilteredProperties(HTMLMarqueeElement_1.prototype, marqueeEventNames, ignoreProperties);\n      }\n\n      var Worker_1 = internalWindow_1['Worker'];\n\n      if (Worker_1) {\n        patchFilteredProperties(Worker_1.prototype, workerEventNames, ignoreProperties);\n      }\n    }\n\n    var XMLHttpRequest = _global['XMLHttpRequest'];\n\n    if (XMLHttpRequest) {\n      // XMLHttpRequest is not available in ServiceWorker, so we need to check here\n      patchFilteredProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames, ignoreProperties);\n    }\n\n    var XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget'];\n\n    if (XMLHttpRequestEventTarget) {\n      patchFilteredProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames, ignoreProperties);\n    }\n\n    if (typeof IDBIndex !== 'undefined') {\n      patchFilteredProperties(IDBIndex.prototype, IDBIndexEventNames, ignoreProperties);\n      patchFilteredProperties(IDBRequest.prototype, IDBIndexEventNames, ignoreProperties);\n      patchFilteredProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames, ignoreProperties);\n      patchFilteredProperties(IDBDatabase.prototype, IDBIndexEventNames, ignoreProperties);\n      patchFilteredProperties(IDBTransaction.prototype, IDBIndexEventNames, ignoreProperties);\n      patchFilteredProperties(IDBCursor.prototype, IDBIndexEventNames, ignoreProperties);\n    }\n\n    if (supportsWebSocket) {\n      patchFilteredProperties(WebSocket.prototype, websocketEventNames, ignoreProperties);\n    }\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  Zone.__load_patch('util', function (global, Zone, api) {\n    api.patchOnProperties = patchOnProperties;\n    api.patchMethod = patchMethod;\n    api.bindArguments = bindArguments;\n    api.patchMacroTask = patchMacroTask; // In earlier version of zone.js (<0.9.0), we use env name `__zone_symbol__BLACK_LISTED_EVENTS` to\n    // define which events will not be patched by `Zone.js`.\n    // In newer version (>=0.9.0), we change the env name to `__zone_symbol__UNPATCHED_EVENTS` to keep\n    // the name consistent with angular repo.\n    // The  `__zone_symbol__BLACK_LISTED_EVENTS` is deprecated, but it is still be supported for\n    // backwards compatibility.\n\n    var SYMBOL_BLACK_LISTED_EVENTS = Zone.__symbol__('BLACK_LISTED_EVENTS');\n\n    var SYMBOL_UNPATCHED_EVENTS = Zone.__symbol__('UNPATCHED_EVENTS');\n\n    if (global[SYMBOL_UNPATCHED_EVENTS]) {\n      global[SYMBOL_BLACK_LISTED_EVENTS] = global[SYMBOL_UNPATCHED_EVENTS];\n    }\n\n    if (global[SYMBOL_BLACK_LISTED_EVENTS]) {\n      Zone[SYMBOL_BLACK_LISTED_EVENTS] = Zone[SYMBOL_UNPATCHED_EVENTS] = global[SYMBOL_BLACK_LISTED_EVENTS];\n    }\n\n    api.patchEventPrototype = patchEventPrototype;\n    api.patchEventTarget = patchEventTarget;\n    api.isIEOrEdge = isIEOrEdge;\n    api.ObjectDefineProperty = ObjectDefineProperty;\n    api.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;\n    api.ObjectCreate = ObjectCreate;\n    api.ArraySlice = ArraySlice;\n    api.patchClass = patchClass;\n    api.wrapWithCurrentZone = wrapWithCurrentZone;\n    api.filterProperties = filterProperties;\n    api.attachOriginToPatched = attachOriginToPatched;\n    api._redefineProperty = Object.defineProperty;\n    api.patchCallbacks = patchCallbacks;\n\n    api.getGlobalObjects = function () {\n      return {\n        globalSources: globalSources,\n        zoneSymbolEventNames: zoneSymbolEventNames$1,\n        eventNames: eventNames,\n        isBrowser: isBrowser,\n        isMix: isMix,\n        isNode: isNode,\n        TRUE_STR: TRUE_STR,\n        FALSE_STR: FALSE_STR,\n        ZONE_SYMBOL_PREFIX: ZONE_SYMBOL_PREFIX,\n        ADD_EVENT_LISTENER_STR: ADD_EVENT_LISTENER_STR,\n        REMOVE_EVENT_LISTENER_STR: REMOVE_EVENT_LISTENER_STR\n      };\n    };\n  });\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n  /*\n   * This is necessary for Chrome and Chrome mobile, to enable\n   * things like redefining `createdCallback` on an element.\n   */\n\n\n  var zoneSymbol$1;\n\n  var _defineProperty;\n\n  var _getOwnPropertyDescriptor;\n\n  var _create;\n\n  var unconfigurablesKey;\n\n  function propertyPatch() {\n    zoneSymbol$1 = Zone.__symbol__;\n    _defineProperty = Object[zoneSymbol$1('defineProperty')] = Object.defineProperty;\n    _getOwnPropertyDescriptor = Object[zoneSymbol$1('getOwnPropertyDescriptor')] = Object.getOwnPropertyDescriptor;\n    _create = Object.create;\n    unconfigurablesKey = zoneSymbol$1('unconfigurables');\n\n    Object.defineProperty = function (obj, prop, desc) {\n      if (isUnconfigurable(obj, prop)) {\n        throw new TypeError('Cannot assign to read only property \\'' + prop + '\\' of ' + obj);\n      }\n\n      var originalConfigurableFlag = desc.configurable;\n\n      if (prop !== 'prototype') {\n        desc = rewriteDescriptor(obj, prop, desc);\n      }\n\n      return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);\n    };\n\n    Object.defineProperties = function (obj, props) {\n      Object.keys(props).forEach(function (prop) {\n        Object.defineProperty(obj, prop, props[prop]);\n      });\n      return obj;\n    };\n\n    Object.create = function (obj, proto) {\n      if (typeof proto === 'object' && !Object.isFrozen(proto)) {\n        Object.keys(proto).forEach(function (prop) {\n          proto[prop] = rewriteDescriptor(obj, prop, proto[prop]);\n        });\n      }\n\n      return _create(obj, proto);\n    };\n\n    Object.getOwnPropertyDescriptor = function (obj, prop) {\n      var desc = _getOwnPropertyDescriptor(obj, prop);\n\n      if (desc && isUnconfigurable(obj, prop)) {\n        desc.configurable = false;\n      }\n\n      return desc;\n    };\n  }\n\n  function _redefineProperty(obj, prop, desc) {\n    var originalConfigurableFlag = desc.configurable;\n    desc = rewriteDescriptor(obj, prop, desc);\n    return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag);\n  }\n\n  function isUnconfigurable(obj, prop) {\n    return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop];\n  }\n\n  function rewriteDescriptor(obj, prop, desc) {\n    // issue-927, if the desc is frozen, don't try to change the desc\n    if (!Object.isFrozen(desc)) {\n      desc.configurable = true;\n    }\n\n    if (!desc.configurable) {\n      // issue-927, if the obj is frozen, don't try to set the desc to obj\n      if (!obj[unconfigurablesKey] && !Object.isFrozen(obj)) {\n        _defineProperty(obj, unconfigurablesKey, {\n          writable: true,\n          value: {}\n        });\n      }\n\n      if (obj[unconfigurablesKey]) {\n        obj[unconfigurablesKey][prop] = true;\n      }\n    }\n\n    return desc;\n  }\n\n  function _tryDefineProperty(obj, prop, desc, originalConfigurableFlag) {\n    try {\n      return _defineProperty(obj, prop, desc);\n    } catch (error) {\n      if (desc.configurable) {\n        // In case of errors, when the configurable flag was likely set by rewriteDescriptor(), let's\n        // retry with the original flag value\n        if (typeof originalConfigurableFlag == 'undefined') {\n          delete desc.configurable;\n        } else {\n          desc.configurable = originalConfigurableFlag;\n        }\n\n        try {\n          return _defineProperty(obj, prop, desc);\n        } catch (error) {\n          var swallowError = false;\n\n          if (prop === 'createdCallback' || prop === 'attachedCallback' || prop === 'detachedCallback' || prop === 'attributeChangedCallback') {\n            // We only swallow the error in registerElement patch\n            // this is the work around since some applications\n            // fail if we throw the error\n            swallowError = true;\n          }\n\n          if (!swallowError) {\n            throw error;\n          } // TODO: @JiaLiPassion, Some application such as `registerElement` patch\n          // still need to swallow the error, in the future after these applications\n          // are updated, the following logic can be removed.\n\n\n          var descJson = null;\n\n          try {\n            descJson = JSON.stringify(desc);\n          } catch (error) {\n            descJson = desc.toString();\n          }\n\n          console.log(\"Attempting to configure '\" + prop + \"' with descriptor '\" + descJson + \"' on object '\" + obj + \"' and got error, giving up: \" + error);\n        }\n      } else {\n        throw error;\n      }\n    }\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  function eventTargetLegacyPatch(_global, api) {\n    var _a = api.getGlobalObjects(),\n        eventNames = _a.eventNames,\n        globalSources = _a.globalSources,\n        zoneSymbolEventNames = _a.zoneSymbolEventNames,\n        TRUE_STR = _a.TRUE_STR,\n        FALSE_STR = _a.FALSE_STR,\n        ZONE_SYMBOL_PREFIX = _a.ZONE_SYMBOL_PREFIX;\n\n    var WTF_ISSUE_555 = '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';\n    var NO_EVENT_TARGET = '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(',');\n    var EVENT_TARGET = 'EventTarget';\n    var apis = [];\n    var isWtf = _global['wtf'];\n    var WTF_ISSUE_555_ARRAY = WTF_ISSUE_555.split(',');\n\n    if (isWtf) {\n      // Workaround for: https://github.com/google/tracing-framework/issues/555\n      apis = WTF_ISSUE_555_ARRAY.map(function (v) {\n        return 'HTML' + v + 'Element';\n      }).concat(NO_EVENT_TARGET);\n    } else if (_global[EVENT_TARGET]) {\n      apis.push(EVENT_TARGET);\n    } else {\n      // Note: EventTarget is not available in all browsers,\n      // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget\n      apis = NO_EVENT_TARGET;\n    }\n\n    var isDisableIECheck = _global['__Zone_disable_IE_check'] || false;\n    var isEnableCrossContextCheck = _global['__Zone_enable_cross_context_check'] || false;\n    var ieOrEdge = api.isIEOrEdge();\n    var ADD_EVENT_LISTENER_SOURCE = '.addEventListener:';\n    var FUNCTION_WRAPPER = '[object FunctionWrapper]';\n    var BROWSER_TOOLS = 'function __BROWSERTOOLS_CONSOLE_SAFEFUNC() { [native code] }';\n    var pointerEventsMap = {\n      'MSPointerCancel': 'pointercancel',\n      'MSPointerDown': 'pointerdown',\n      'MSPointerEnter': 'pointerenter',\n      'MSPointerHover': 'pointerhover',\n      'MSPointerLeave': 'pointerleave',\n      'MSPointerMove': 'pointermove',\n      'MSPointerOut': 'pointerout',\n      'MSPointerOver': 'pointerover',\n      'MSPointerUp': 'pointerup'\n    }; //  predefine all __zone_symbol__ + eventName + true/false string\n\n    for (var i = 0; i < eventNames.length; i++) {\n      var eventName = eventNames[i];\n      var falseEventName = eventName + FALSE_STR;\n      var trueEventName = eventName + TRUE_STR;\n      var symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n      var symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n      zoneSymbolEventNames[eventName] = {};\n      zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n      zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n    } //  predefine all task.source string\n\n\n    for (var i = 0; i < WTF_ISSUE_555_ARRAY.length; i++) {\n      var target = WTF_ISSUE_555_ARRAY[i];\n      var targets = globalSources[target] = {};\n\n      for (var j = 0; j < eventNames.length; j++) {\n        var eventName = eventNames[j];\n        targets[eventName] = target + ADD_EVENT_LISTENER_SOURCE + eventName;\n      }\n    }\n\n    var checkIEAndCrossContext = function (nativeDelegate, delegate, target, args) {\n      if (!isDisableIECheck && ieOrEdge) {\n        if (isEnableCrossContextCheck) {\n          try {\n            var testString = delegate.toString();\n\n            if (testString === FUNCTION_WRAPPER || testString == BROWSER_TOOLS) {\n              nativeDelegate.apply(target, args);\n              return false;\n            }\n          } catch (error) {\n            nativeDelegate.apply(target, args);\n            return false;\n          }\n        } else {\n          var testString = delegate.toString();\n\n          if (testString === FUNCTION_WRAPPER || testString == BROWSER_TOOLS) {\n            nativeDelegate.apply(target, args);\n            return false;\n          }\n        }\n      } else if (isEnableCrossContextCheck) {\n        try {\n          delegate.toString();\n        } catch (error) {\n          nativeDelegate.apply(target, args);\n          return false;\n        }\n      }\n\n      return true;\n    };\n\n    var apiTypes = [];\n\n    for (var i = 0; i < apis.length; i++) {\n      var type = _global[apis[i]];\n      apiTypes.push(type && type.prototype);\n    } // vh is validateHandler to check event handler\n    // is valid or not(for security check)\n\n\n    api.patchEventTarget(_global, apiTypes, {\n      vh: checkIEAndCrossContext,\n      transferEventName: function (eventName) {\n        var pointerEventName = pointerEventsMap[eventName];\n        return pointerEventName || eventName;\n      }\n    });\n    Zone[api.symbol('patchEventTarget')] = !!_global[EVENT_TARGET];\n    return true;\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n  // we have to patch the instance since the proto is non-configurable\n\n\n  function apply(api, _global) {\n    var _a = api.getGlobalObjects(),\n        ADD_EVENT_LISTENER_STR = _a.ADD_EVENT_LISTENER_STR,\n        REMOVE_EVENT_LISTENER_STR = _a.REMOVE_EVENT_LISTENER_STR;\n\n    var WS = _global.WebSocket; // On Safari window.EventTarget doesn't exist so need to patch WS add/removeEventListener\n    // On older Chrome, no need since EventTarget was already patched\n\n    if (!_global.EventTarget) {\n      api.patchEventTarget(_global, [WS.prototype]);\n    }\n\n    _global.WebSocket = function (x, y) {\n      var socket = arguments.length > 1 ? new WS(x, y) : new WS(x);\n      var proxySocket;\n      var proxySocketProto; // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance\n\n      var onmessageDesc = api.ObjectGetOwnPropertyDescriptor(socket, 'onmessage');\n\n      if (onmessageDesc && onmessageDesc.configurable === false) {\n        proxySocket = api.ObjectCreate(socket); // socket have own property descriptor 'onopen', 'onmessage', 'onclose', 'onerror'\n        // but proxySocket not, so we will keep socket as prototype and pass it to\n        // patchOnProperties method\n\n        proxySocketProto = socket;\n        [ADD_EVENT_LISTENER_STR, REMOVE_EVENT_LISTENER_STR, 'send', 'close'].forEach(function (propName) {\n          proxySocket[propName] = function () {\n            var args = api.ArraySlice.call(arguments);\n\n            if (propName === ADD_EVENT_LISTENER_STR || propName === REMOVE_EVENT_LISTENER_STR) {\n              var eventName = args.length > 0 ? args[0] : undefined;\n\n              if (eventName) {\n                var propertySymbol = Zone.__symbol__('ON_PROPERTY' + eventName);\n\n                socket[propertySymbol] = proxySocket[propertySymbol];\n              }\n            }\n\n            return socket[propName].apply(socket, args);\n          };\n        });\n      } else {\n        // we can patch the real socket\n        proxySocket = socket;\n      }\n\n      api.patchOnProperties(proxySocket, ['close', 'error', 'message', 'open'], proxySocketProto);\n      return proxySocket;\n    };\n\n    var globalWebSocket = _global['WebSocket'];\n\n    for (var prop in WS) {\n      globalWebSocket[prop] = WS[prop];\n    }\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  function propertyDescriptorLegacyPatch(api, _global) {\n    var _a = api.getGlobalObjects(),\n        isNode = _a.isNode,\n        isMix = _a.isMix;\n\n    if (isNode && !isMix) {\n      return;\n    }\n\n    if (!canPatchViaPropertyDescriptor(api, _global)) {\n      var supportsWebSocket = typeof WebSocket !== 'undefined'; // Safari, Android browsers (Jelly Bean)\n\n      patchViaCapturingAllTheEvents(api);\n      api.patchClass('XMLHttpRequest');\n\n      if (supportsWebSocket) {\n        apply(api, _global);\n      }\n\n      Zone[api.symbol('patchEvents')] = true;\n    }\n  }\n\n  function canPatchViaPropertyDescriptor(api, _global) {\n    var _a = api.getGlobalObjects(),\n        isBrowser = _a.isBrowser,\n        isMix = _a.isMix;\n\n    if ((isBrowser || isMix) && !api.ObjectGetOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') && typeof Element !== 'undefined') {\n      // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364\n      // IDL interface attributes are not configurable\n      var desc = api.ObjectGetOwnPropertyDescriptor(Element.prototype, 'onclick');\n      if (desc && !desc.configurable) return false; // try to use onclick to detect whether we can patch via propertyDescriptor\n      // because XMLHttpRequest is not available in service worker\n\n      if (desc) {\n        api.ObjectDefineProperty(Element.prototype, 'onclick', {\n          enumerable: true,\n          configurable: true,\n          get: function () {\n            return true;\n          }\n        });\n        var div = document.createElement('div');\n        var result = !!div.onclick;\n        api.ObjectDefineProperty(Element.prototype, 'onclick', desc);\n        return result;\n      }\n    }\n\n    var XMLHttpRequest = _global['XMLHttpRequest'];\n\n    if (!XMLHttpRequest) {\n      // XMLHttpRequest is not available in service worker\n      return false;\n    }\n\n    var ON_READY_STATE_CHANGE = 'onreadystatechange';\n    var XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n    var xhrDesc = api.ObjectGetOwnPropertyDescriptor(XMLHttpRequestPrototype, ON_READY_STATE_CHANGE); // add enumerable and configurable here because in opera\n    // by default XMLHttpRequest.prototype.onreadystatechange is undefined\n    // without adding enumerable and configurable will cause onreadystatechange\n    // non-configurable\n    // and if XMLHttpRequest.prototype.onreadystatechange is undefined,\n    // we should set a real desc instead a fake one\n\n    if (xhrDesc) {\n      api.ObjectDefineProperty(XMLHttpRequestPrototype, ON_READY_STATE_CHANGE, {\n        enumerable: true,\n        configurable: true,\n        get: function () {\n          return true;\n        }\n      });\n      var req = new XMLHttpRequest();\n      var result = !!req.onreadystatechange; // restore original desc\n\n      api.ObjectDefineProperty(XMLHttpRequestPrototype, ON_READY_STATE_CHANGE, xhrDesc || {});\n      return result;\n    } else {\n      var SYMBOL_FAKE_ONREADYSTATECHANGE_1 = api.symbol('fake');\n      api.ObjectDefineProperty(XMLHttpRequestPrototype, ON_READY_STATE_CHANGE, {\n        enumerable: true,\n        configurable: true,\n        get: function () {\n          return this[SYMBOL_FAKE_ONREADYSTATECHANGE_1];\n        },\n        set: function (value) {\n          this[SYMBOL_FAKE_ONREADYSTATECHANGE_1] = value;\n        }\n      });\n      var req = new XMLHttpRequest();\n\n      var detectFunc = function () {};\n\n      req.onreadystatechange = detectFunc;\n      var result = req[SYMBOL_FAKE_ONREADYSTATECHANGE_1] === detectFunc;\n      req.onreadystatechange = null;\n      return result;\n    }\n  } // Whenever any eventListener fires, we check the eventListener target and all parents\n  // for `onwhatever` properties and replace them with zone-bound functions\n  // - Chrome (for now)\n\n\n  function patchViaCapturingAllTheEvents(api) {\n    var eventNames = api.getGlobalObjects().eventNames;\n    var unboundKey = api.symbol('unbound');\n\n    var _loop_4 = function (i) {\n      var property = eventNames[i];\n      var onproperty = 'on' + property;\n      self.addEventListener(property, function (event) {\n        var elt = event.target,\n            bound,\n            source;\n\n        if (elt) {\n          source = elt.constructor['name'] + '.' + onproperty;\n        } else {\n          source = 'unknown.' + onproperty;\n        }\n\n        while (elt) {\n          if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n            bound = api.wrapWithCurrentZone(elt[onproperty], source);\n            bound[unboundKey] = elt[onproperty];\n            elt[onproperty] = bound;\n          }\n\n          elt = elt.parentElement;\n        }\n      }, true);\n    };\n\n    for (var i = 0; i < eventNames.length; i++) {\n      _loop_4(i);\n    }\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  function registerElementPatch(_global, api) {\n    var _a = api.getGlobalObjects(),\n        isBrowser = _a.isBrowser,\n        isMix = _a.isMix;\n\n    if (!isBrowser && !isMix || !('registerElement' in _global.document)) {\n      return;\n    }\n\n    var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];\n    api.patchCallbacks(api, document, 'Document', 'registerElement', callbacks);\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  (function (_global) {\n    var symbolPrefix = _global['__Zone_symbol_prefix'] || '__zone_symbol__';\n\n    function __symbol__(name) {\n      return symbolPrefix + name;\n    }\n\n    _global[__symbol__('legacyPatch')] = function () {\n      var Zone = _global['Zone'];\n\n      Zone.__load_patch('defineProperty', function (global, Zone, api) {\n        api._redefineProperty = _redefineProperty;\n        propertyPatch();\n      });\n\n      Zone.__load_patch('registerElement', function (global, Zone, api) {\n        registerElementPatch(global, api);\n      });\n\n      Zone.__load_patch('EventTargetLegacy', function (global, Zone, api) {\n        eventTargetLegacyPatch(global, api);\n        propertyDescriptorLegacyPatch(api, global);\n      });\n    };\n  })(typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {});\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  var taskSymbol = zoneSymbol('zoneTask');\n\n  function patchTimer(window, setName, cancelName, nameSuffix) {\n    var setNative = null;\n    var clearNative = null;\n    setName += nameSuffix;\n    cancelName += nameSuffix;\n    var tasksByHandleId = {};\n\n    function scheduleTask(task) {\n      var data = task.data;\n\n      data.args[0] = function () {\n        return task.invoke.apply(this, arguments);\n      };\n\n      data.handleId = setNative.apply(window, data.args);\n      return task;\n    }\n\n    function clearTask(task) {\n      return clearNative.call(window, task.data.handleId);\n    }\n\n    setNative = patchMethod(window, setName, function (delegate) {\n      return function (self, args) {\n        if (typeof args[0] === 'function') {\n          var options_1 = {\n            isPeriodic: nameSuffix === 'Interval',\n            delay: nameSuffix === 'Timeout' || nameSuffix === 'Interval' ? args[1] || 0 : undefined,\n            args: args\n          };\n          var callback_1 = args[0];\n\n          args[0] = function timer() {\n            try {\n              return callback_1.apply(this, arguments);\n            } finally {\n              // issue-934, task will be cancelled\n              // even it is a periodic task such as\n              // setInterval\n              // https://github.com/angular/angular/issues/40387\n              // Cleanup tasksByHandleId should be handled before scheduleTask\n              // Since some zoneSpec may intercept and doesn't trigger\n              // scheduleFn(scheduleTask) provided here.\n              if (!options_1.isPeriodic) {\n                if (typeof options_1.handleId === 'number') {\n                  // in non-nodejs env, we remove timerId\n                  // from local cache\n                  delete tasksByHandleId[options_1.handleId];\n                } else if (options_1.handleId) {\n                  // Node returns complex objects as handleIds\n                  // we remove task reference from timer object\n                  options_1.handleId[taskSymbol] = null;\n                }\n              }\n            }\n          };\n\n          var task = scheduleMacroTaskWithCurrentZone(setName, args[0], options_1, scheduleTask, clearTask);\n\n          if (!task) {\n            return task;\n          } // Node.js must additionally support the ref and unref functions.\n\n\n          var handle = task.data.handleId;\n\n          if (typeof handle === 'number') {\n            // for non nodejs env, we save handleId: task\n            // mapping in local cache for clearTimeout\n            tasksByHandleId[handle] = task;\n          } else if (handle) {\n            // for nodejs env, we save task\n            // reference in timerId Object for clearTimeout\n            handle[taskSymbol] = task;\n          } // check whether handle is null, because some polyfill or browser\n          // may return undefined from setTimeout/setInterval/setImmediate/requestAnimationFrame\n\n\n          if (handle && handle.ref && handle.unref && typeof handle.ref === 'function' && typeof handle.unref === 'function') {\n            task.ref = handle.ref.bind(handle);\n            task.unref = handle.unref.bind(handle);\n          }\n\n          if (typeof handle === 'number' || handle) {\n            return handle;\n          }\n\n          return task;\n        } else {\n          // cause an error by calling it directly.\n          return delegate.apply(window, args);\n        }\n      };\n    });\n    clearNative = patchMethod(window, cancelName, function (delegate) {\n      return function (self, args) {\n        var id = args[0];\n        var task;\n\n        if (typeof id === 'number') {\n          // non nodejs env.\n          task = tasksByHandleId[id];\n        } else {\n          // nodejs env.\n          task = id && id[taskSymbol]; // other environments.\n\n          if (!task) {\n            task = id;\n          }\n        }\n\n        if (task && typeof task.type === 'string') {\n          if (task.state !== 'notScheduled' && (task.cancelFn && task.data.isPeriodic || task.runCount === 0)) {\n            if (typeof id === 'number') {\n              delete tasksByHandleId[id];\n            } else if (id) {\n              id[taskSymbol] = null;\n            } // Do not cancel already canceled functions\n\n\n            task.zone.cancelTask(task);\n          }\n        } else {\n          // cause an error by calling it directly.\n          delegate.apply(window, args);\n        }\n      };\n    });\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  function patchCustomElements(_global, api) {\n    var _a = api.getGlobalObjects(),\n        isBrowser = _a.isBrowser,\n        isMix = _a.isMix;\n\n    if (!isBrowser && !isMix || !_global['customElements'] || !('customElements' in _global)) {\n      return;\n    }\n\n    var callbacks = ['connectedCallback', 'disconnectedCallback', 'adoptedCallback', 'attributeChangedCallback'];\n    api.patchCallbacks(api, _global.customElements, 'customElements', 'define', callbacks);\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  function eventTargetPatch(_global, api) {\n    if (Zone[api.symbol('patchEventTarget')]) {\n      // EventTarget is already patched.\n      return;\n    }\n\n    var _a = api.getGlobalObjects(),\n        eventNames = _a.eventNames,\n        zoneSymbolEventNames = _a.zoneSymbolEventNames,\n        TRUE_STR = _a.TRUE_STR,\n        FALSE_STR = _a.FALSE_STR,\n        ZONE_SYMBOL_PREFIX = _a.ZONE_SYMBOL_PREFIX; //  predefine all __zone_symbol__ + eventName + true/false string\n\n\n    for (var i = 0; i < eventNames.length; i++) {\n      var eventName = eventNames[i];\n      var falseEventName = eventName + FALSE_STR;\n      var trueEventName = eventName + TRUE_STR;\n      var symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n      var symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n      zoneSymbolEventNames[eventName] = {};\n      zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n      zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n    }\n\n    var EVENT_TARGET = _global['EventTarget'];\n\n    if (!EVENT_TARGET || !EVENT_TARGET.prototype) {\n      return;\n    }\n\n    api.patchEventTarget(_global, [EVENT_TARGET && EVENT_TARGET.prototype]);\n    return true;\n  }\n\n  function patchEvent(global, api) {\n    api.patchEventPrototype(global, api);\n  }\n  /**\n   * @license\n   * Copyright Google LLC All Rights Reserved.\n   *\n   * Use of this source code is governed by an MIT-style license that can be\n   * found in the LICENSE file at https://angular.io/license\n   */\n\n\n  Zone.__load_patch('legacy', function (global) {\n    var legacyPatch = global[Zone.__symbol__('legacyPatch')];\n\n    if (legacyPatch) {\n      legacyPatch();\n    }\n  });\n\n  Zone.__load_patch('queueMicrotask', function (global, Zone, api) {\n    api.patchMethod(global, 'queueMicrotask', function (delegate) {\n      return function (self, args) {\n        Zone.current.scheduleMicroTask('queueMicrotask', args[0]);\n      };\n    });\n  });\n\n  Zone.__load_patch('timers', function (global) {\n    var set = 'set';\n    var clear = 'clear';\n    patchTimer(global, set, clear, 'Timeout');\n    patchTimer(global, set, clear, 'Interval');\n    patchTimer(global, set, clear, 'Immediate');\n  });\n\n  Zone.__load_patch('requestAnimationFrame', function (global) {\n    patchTimer(global, 'request', 'cancel', 'AnimationFrame');\n    patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');\n    patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');\n  });\n\n  Zone.__load_patch('blocking', function (global, Zone) {\n    var blockingMethods = ['alert', 'prompt', 'confirm'];\n\n    for (var i = 0; i < blockingMethods.length; i++) {\n      var name_2 = blockingMethods[i];\n      patchMethod(global, name_2, function (delegate, symbol, name) {\n        return function (s, args) {\n          return Zone.current.run(delegate, global, args, name);\n        };\n      });\n    }\n  });\n\n  Zone.__load_patch('EventTarget', function (global, Zone, api) {\n    patchEvent(global, api);\n    eventTargetPatch(global, api); // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener\n\n    var XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget'];\n\n    if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n      api.patchEventTarget(global, [XMLHttpRequestEventTarget.prototype]);\n    }\n  });\n\n  Zone.__load_patch('MutationObserver', function (global, Zone, api) {\n    patchClass('MutationObserver');\n    patchClass('WebKitMutationObserver');\n  });\n\n  Zone.__load_patch('IntersectionObserver', function (global, Zone, api) {\n    patchClass('IntersectionObserver');\n  });\n\n  Zone.__load_patch('FileReader', function (global, Zone, api) {\n    patchClass('FileReader');\n  });\n\n  Zone.__load_patch('on_property', function (global, Zone, api) {\n    propertyDescriptorPatch(api, global);\n  });\n\n  Zone.__load_patch('customElements', function (global, Zone, api) {\n    patchCustomElements(global, api);\n  });\n\n  Zone.__load_patch('XHR', function (global, Zone) {\n    // Treat XMLHttpRequest as a macrotask.\n    patchXHR(global);\n    var XHR_TASK = zoneSymbol('xhrTask');\n    var XHR_SYNC = zoneSymbol('xhrSync');\n    var XHR_LISTENER = zoneSymbol('xhrListener');\n    var XHR_SCHEDULED = zoneSymbol('xhrScheduled');\n    var XHR_URL = zoneSymbol('xhrURL');\n    var XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled');\n\n    function patchXHR(window) {\n      var XMLHttpRequest = window['XMLHttpRequest'];\n\n      if (!XMLHttpRequest) {\n        // XMLHttpRequest is not available in service worker\n        return;\n      }\n\n      var XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n\n      function findPendingTask(target) {\n        return target[XHR_TASK];\n      }\n\n      var oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n      var oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n\n      if (!oriAddListener) {\n        var XMLHttpRequestEventTarget_1 = window['XMLHttpRequestEventTarget'];\n\n        if (XMLHttpRequestEventTarget_1) {\n          var XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget_1.prototype;\n          oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n          oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n        }\n      }\n\n      var READY_STATE_CHANGE = 'readystatechange';\n      var SCHEDULED = 'scheduled';\n\n      function scheduleTask(task) {\n        var data = task.data;\n        var target = data.target;\n        target[XHR_SCHEDULED] = false;\n        target[XHR_ERROR_BEFORE_SCHEDULED] = false; // remove existing event listener\n\n        var listener = target[XHR_LISTENER];\n\n        if (!oriAddListener) {\n          oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n          oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n        }\n\n        if (listener) {\n          oriRemoveListener.call(target, READY_STATE_CHANGE, listener);\n        }\n\n        var newListener = target[XHR_LISTENER] = function () {\n          if (target.readyState === target.DONE) {\n            // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with\n            // readyState=4 multiple times, so we need to check task state here\n            if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {\n              // check whether the xhr has registered onload listener\n              // if that is the case, the task should invoke after all\n              // onload listeners finish.\n              // Also if the request failed without response (status = 0), the load event handler\n              // will not be triggered, in that case, we should also invoke the placeholder callback\n              // to close the XMLHttpRequest::send macroTask.\n              // https://github.com/angular/angular/issues/38795\n              var loadTasks = target[Zone.__symbol__('loadfalse')];\n\n              if (target.status !== 0 && loadTasks && loadTasks.length > 0) {\n                var oriInvoke_1 = task.invoke;\n\n                task.invoke = function () {\n                  // need to load the tasks again, because in other\n                  // load listener, they may remove themselves\n                  var loadTasks = target[Zone.__symbol__('loadfalse')];\n\n                  for (var i = 0; i < loadTasks.length; i++) {\n                    if (loadTasks[i] === task) {\n                      loadTasks.splice(i, 1);\n                    }\n                  }\n\n                  if (!data.aborted && task.state === SCHEDULED) {\n                    oriInvoke_1.call(task);\n                  }\n                };\n\n                loadTasks.push(task);\n              } else {\n                task.invoke();\n              }\n            } else if (!data.aborted && target[XHR_SCHEDULED] === false) {\n              // error occurs when xhr.send()\n              target[XHR_ERROR_BEFORE_SCHEDULED] = true;\n            }\n          }\n        };\n\n        oriAddListener.call(target, READY_STATE_CHANGE, newListener);\n        var storedTask = target[XHR_TASK];\n\n        if (!storedTask) {\n          target[XHR_TASK] = task;\n        }\n\n        sendNative.apply(target, data.args);\n        target[XHR_SCHEDULED] = true;\n        return task;\n      }\n\n      function placeholderCallback() {}\n\n      function clearTask(task) {\n        var data = task.data; // Note - ideally, we would call data.target.removeEventListener here, but it's too late\n        // to prevent it from firing. So instead, we store info for the event listener.\n\n        data.aborted = true;\n        return abortNative.apply(data.target, data.args);\n      }\n\n      var openNative = patchMethod(XMLHttpRequestPrototype, 'open', function () {\n        return function (self, args) {\n          self[XHR_SYNC] = args[2] == false;\n          self[XHR_URL] = args[1];\n          return openNative.apply(self, args);\n        };\n      });\n      var XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';\n      var fetchTaskAborting = zoneSymbol('fetchTaskAborting');\n      var fetchTaskScheduling = zoneSymbol('fetchTaskScheduling');\n      var sendNative = patchMethod(XMLHttpRequestPrototype, 'send', function () {\n        return function (self, args) {\n          if (Zone.current[fetchTaskScheduling] === true) {\n            // a fetch is scheduling, so we are using xhr to polyfill fetch\n            // and because we already schedule macroTask for fetch, we should\n            // not schedule a macroTask for xhr again\n            return sendNative.apply(self, args);\n          }\n\n          if (self[XHR_SYNC]) {\n            // if the XHR is sync there is no task to schedule, just execute the code.\n            return sendNative.apply(self, args);\n          } else {\n            var options = {\n              target: self,\n              url: self[XHR_URL],\n              isPeriodic: false,\n              args: args,\n              aborted: false\n            };\n            var task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);\n\n            if (self && self[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted && task.state === SCHEDULED) {\n              // xhr request throw error when send\n              // we should invoke task instead of leaving a scheduled\n              // pending macroTask\n              task.invoke();\n            }\n          }\n        };\n      });\n      var abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', function () {\n        return function (self, args) {\n          var task = findPendingTask(self);\n\n          if (task && typeof task.type == 'string') {\n            // If the XHR has already completed, do nothing.\n            // If the XHR has already been aborted, do nothing.\n            // Fix #569, call abort multiple times before done will cause\n            // macroTask task count be negative number\n            if (task.cancelFn == null || task.data && task.data.aborted) {\n              return;\n            }\n\n            task.zone.cancelTask(task);\n          } else if (Zone.current[fetchTaskAborting] === true) {\n            // the abort is called from fetch polyfill, we need to call native abort of XHR.\n            return abortNative.apply(self, args);\n          } // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no\n          // task\n          // to cancel. Do nothing.\n\n        };\n      });\n    }\n  });\n\n  Zone.__load_patch('geolocation', function (global) {\n    /// GEO_LOCATION\n    if (global['navigator'] && global['navigator'].geolocation) {\n      patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']);\n    }\n  });\n\n  Zone.__load_patch('PromiseRejectionEvent', function (global, Zone) {\n    // handle unhandled promise rejection\n    function findPromiseRejectionHandler(evtName) {\n      return function (e) {\n        var eventTasks = findEventTasks(global, evtName);\n        eventTasks.forEach(function (eventTask) {\n          // windows has added unhandledrejection event listener\n          // trigger the event listener\n          var PromiseRejectionEvent = global['PromiseRejectionEvent'];\n\n          if (PromiseRejectionEvent) {\n            var evt = new PromiseRejectionEvent(evtName, {\n              promise: e.promise,\n              reason: e.rejection\n            });\n            eventTask.invoke(evt);\n          }\n        });\n      };\n    }\n\n    if (global['PromiseRejectionEvent']) {\n      Zone[zoneSymbol('unhandledPromiseRejectionHandler')] = findPromiseRejectionHandler('unhandledrejection');\n      Zone[zoneSymbol('rejectionHandledHandler')] = findPromiseRejectionHandler('rejectionhandled');\n    }\n  });\n});","map":null,"metadata":{},"sourceType":"script"}