| 1 |
- {"ast":null,"code":"'use strict';\n\nvar __spreadArrays = this && this.__spreadArrays || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n};\n/**\n * @license Angular v12.0.0-next.0\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n(function (factory) {\n typeof define === 'function' && define.amd ? define(factory) : factory();\n})(function () {\n 'use strict';\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 * @fileoverview\n * @suppress {globalThis}\n */\n var NEWLINE = '\\n';\n var IGNORE_FRAMES = {};\n var creationTrace = '__creationTrace__';\n var ERROR_TAG = 'STACKTRACE TRACKING';\n var SEP_TAG = '__SEP_TAG__';\n var sepTemplate = SEP_TAG + '@[native]';\n var LongStackTrace = /** @class */function () {\n function LongStackTrace() {\n this.error = getStacktrace();\n this.timestamp = new Date();\n }\n return LongStackTrace;\n }();\n function getStacktraceWithUncaughtError() {\n return new Error(ERROR_TAG);\n }\n function getStacktraceWithCaughtError() {\n try {\n throw getStacktraceWithUncaughtError();\n } catch (err) {\n return err;\n }\n }\n // Some implementations of exception handling don't create a stack trace if the exception\n // isn't thrown, however it's faster not to actually throw the exception.\n var error = getStacktraceWithUncaughtError();\n var caughtError = getStacktraceWithCaughtError();\n var getStacktrace = error.stack ? getStacktraceWithUncaughtError : caughtError.stack ? getStacktraceWithCaughtError : getStacktraceWithUncaughtError;\n function getFrames(error) {\n return error.stack ? error.stack.split(NEWLINE) : [];\n }\n function addErrorStack(lines, error) {\n var trace = getFrames(error);\n for (var i = 0; i < trace.length; i++) {\n var frame = trace[i];\n // Filter out the Frames which are part of stack capturing.\n if (!IGNORE_FRAMES.hasOwnProperty(frame)) {\n lines.push(trace[i]);\n }\n }\n }\n function renderLongStackTrace(frames, stack) {\n var longTrace = [stack ? stack.trim() : ''];\n if (frames) {\n var timestamp = new Date().getTime();\n for (var i = 0; i < frames.length; i++) {\n var traceFrames = frames[i];\n var lastTime = traceFrames.timestamp;\n var separator = \"____________________Elapsed \" + (timestamp - lastTime.getTime()) + \" ms; At: \" + lastTime;\n separator = separator.replace(/[^\\w\\d]/g, '_');\n longTrace.push(sepTemplate.replace(SEP_TAG, separator));\n addErrorStack(longTrace, traceFrames.error);\n timestamp = lastTime.getTime();\n }\n }\n return longTrace.join(NEWLINE);\n }\n // if Error.stackTraceLimit is 0, means stack trace\n // is disabled, so we don't need to generate long stack trace\n // this will improve performance in some test(some test will\n // set stackTraceLimit to 0, https://github.com/angular/zone.js/issues/698\n function stackTracesEnabled() {\n // Cast through any since this property only exists on Error in the nodejs\n // typings.\n return Error.stackTraceLimit > 0;\n }\n Zone['longStackTraceZoneSpec'] = {\n name: 'long-stack-trace',\n longStackTraceLimit: 10,\n // add a getLongStackTrace method in spec to\n // handle handled reject promise error.\n getLongStackTrace: function (error) {\n if (!error) {\n return undefined;\n }\n var trace = error[Zone.__symbol__('currentTaskTrace')];\n if (!trace) {\n return error.stack;\n }\n return renderLongStackTrace(trace, error.stack);\n },\n onScheduleTask: function (parentZoneDelegate, currentZone, targetZone, task) {\n if (stackTracesEnabled()) {\n var currentTask = Zone.currentTask;\n var trace = currentTask && currentTask.data && currentTask.data[creationTrace] || [];\n trace = [new LongStackTrace()].concat(trace);\n if (trace.length > this.longStackTraceLimit) {\n trace.length = this.longStackTraceLimit;\n }\n if (!task.data) task.data = {};\n if (task.type === 'eventTask') {\n // Fix issue https://github.com/angular/zone.js/issues/1195,\n // For event task of browser, by default, all task will share a\n // singleton instance of data object, we should create a new one here\n // The cast to `any` is required to workaround a closure bug which wrongly applies\n // URL sanitization rules to .data access.\n task.data = Object.assign({}, task.data);\n }\n task.data[creationTrace] = trace;\n }\n return parentZoneDelegate.scheduleTask(targetZone, task);\n },\n onHandleError: function (parentZoneDelegate, currentZone, targetZone, error) {\n if (stackTracesEnabled()) {\n var parentTask = Zone.currentTask || error.task;\n if (error instanceof Error && parentTask) {\n var longStack = renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], error.stack);\n try {\n error.stack = error.longStack = longStack;\n } catch (err) {}\n }\n }\n return parentZoneDelegate.handleError(targetZone, error);\n }\n };\n function captureStackTraces(stackTraces, count) {\n if (count > 0) {\n stackTraces.push(getFrames(new LongStackTrace().error));\n captureStackTraces(stackTraces, count - 1);\n }\n }\n function computeIgnoreFrames() {\n if (!stackTracesEnabled()) {\n return;\n }\n var frames = [];\n captureStackTraces(frames, 2);\n var frames1 = frames[0];\n var frames2 = frames[1];\n for (var i = 0; i < frames1.length; i++) {\n var frame1 = frames1[i];\n if (frame1.indexOf(ERROR_TAG) == -1) {\n var match = frame1.match(/^\\s*at\\s+/);\n if (match) {\n sepTemplate = match[0] + SEP_TAG + ' (http://localhost)';\n break;\n }\n }\n }\n for (var i = 0; i < frames1.length; i++) {\n var frame1 = frames1[i];\n var frame2 = frames2[i];\n if (frame1 === frame2) {\n IGNORE_FRAMES[frame1] = true;\n } else {\n break;\n }\n }\n }\n computeIgnoreFrames();\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 var ProxyZoneSpec = /** @class */function () {\n function ProxyZoneSpec(defaultSpecDelegate) {\n if (defaultSpecDelegate === void 0) {\n defaultSpecDelegate = null;\n }\n this.defaultSpecDelegate = defaultSpecDelegate;\n this.name = 'ProxyZone';\n this._delegateSpec = null;\n this.properties = {\n 'ProxyZoneSpec': this\n };\n this.propertyKeys = null;\n this.lastTaskState = null;\n this.isNeedToTriggerHasTask = false;\n this.tasks = [];\n this.setDelegate(defaultSpecDelegate);\n }\n ProxyZoneSpec.get = function () {\n return Zone.current.get('ProxyZoneSpec');\n };\n ProxyZoneSpec.isLoaded = function () {\n return ProxyZoneSpec.get() instanceof ProxyZoneSpec;\n };\n ProxyZoneSpec.assertPresent = function () {\n if (!ProxyZoneSpec.isLoaded()) {\n throw new Error(\"Expected to be running in 'ProxyZone', but it was not found.\");\n }\n return ProxyZoneSpec.get();\n };\n ProxyZoneSpec.prototype.setDelegate = function (delegateSpec) {\n var _this = this;\n var isNewDelegate = this._delegateSpec !== delegateSpec;\n this._delegateSpec = delegateSpec;\n this.propertyKeys && this.propertyKeys.forEach(function (key) {\n return delete _this.properties[key];\n });\n this.propertyKeys = null;\n if (delegateSpec && delegateSpec.properties) {\n this.propertyKeys = Object.keys(delegateSpec.properties);\n this.propertyKeys.forEach(function (k) {\n return _this.properties[k] = delegateSpec.properties[k];\n });\n }\n // if a new delegateSpec was set, check if we need to trigger hasTask\n if (isNewDelegate && this.lastTaskState && (this.lastTaskState.macroTask || this.lastTaskState.microTask)) {\n this.isNeedToTriggerHasTask = true;\n }\n };\n ProxyZoneSpec.prototype.getDelegate = function () {\n return this._delegateSpec;\n };\n ProxyZoneSpec.prototype.resetDelegate = function () {\n var delegateSpec = this.getDelegate();\n this.setDelegate(this.defaultSpecDelegate);\n };\n ProxyZoneSpec.prototype.tryTriggerHasTask = function (parentZoneDelegate, currentZone, targetZone) {\n if (this.isNeedToTriggerHasTask && this.lastTaskState) {\n // last delegateSpec has microTask or macroTask\n // should call onHasTask in current delegateSpec\n this.isNeedToTriggerHasTask = false;\n this.onHasTask(parentZoneDelegate, currentZone, targetZone, this.lastTaskState);\n }\n };\n ProxyZoneSpec.prototype.removeFromTasks = function (task) {\n if (!this.tasks) {\n return;\n }\n for (var i = 0; i < this.tasks.length; i++) {\n if (this.tasks[i] === task) {\n this.tasks.splice(i, 1);\n return;\n }\n }\n };\n ProxyZoneSpec.prototype.getAndClearPendingTasksInfo = function () {\n if (this.tasks.length === 0) {\n return '';\n }\n var taskInfo = this.tasks.map(function (task) {\n var dataInfo = task.data && Object.keys(task.data).map(function (key) {\n return key + ':' + task.data[key];\n }).join(',');\n return \"type: \" + task.type + \", source: \" + task.source + \", args: {\" + dataInfo + \"}\";\n });\n var pendingTasksInfo = '--Pending async tasks are: [' + taskInfo + ']';\n // clear tasks\n this.tasks = [];\n return pendingTasksInfo;\n };\n ProxyZoneSpec.prototype.onFork = function (parentZoneDelegate, currentZone, targetZone, zoneSpec) {\n if (this._delegateSpec && this._delegateSpec.onFork) {\n return this._delegateSpec.onFork(parentZoneDelegate, currentZone, targetZone, zoneSpec);\n } else {\n return parentZoneDelegate.fork(targetZone, zoneSpec);\n }\n };\n ProxyZoneSpec.prototype.onIntercept = function (parentZoneDelegate, currentZone, targetZone, delegate, source) {\n if (this._delegateSpec && this._delegateSpec.onIntercept) {\n return this._delegateSpec.onIntercept(parentZoneDelegate, currentZone, targetZone, delegate, source);\n } else {\n return parentZoneDelegate.intercept(targetZone, delegate, source);\n }\n };\n ProxyZoneSpec.prototype.onInvoke = function (parentZoneDelegate, currentZone, targetZone, delegate, applyThis, applyArgs, source) {\n this.tryTriggerHasTask(parentZoneDelegate, currentZone, targetZone);\n if (this._delegateSpec && this._delegateSpec.onInvoke) {\n return this._delegateSpec.onInvoke(parentZoneDelegate, currentZone, targetZone, delegate, applyThis, applyArgs, source);\n } else {\n return parentZoneDelegate.invoke(targetZone, delegate, applyThis, applyArgs, source);\n }\n };\n ProxyZoneSpec.prototype.onHandleError = function (parentZoneDelegate, currentZone, targetZone, error) {\n if (this._delegateSpec && this._delegateSpec.onHandleError) {\n return this._delegateSpec.onHandleError(parentZoneDelegate, currentZone, targetZone, error);\n } else {\n return parentZoneDelegate.handleError(targetZone, error);\n }\n };\n ProxyZoneSpec.prototype.onScheduleTask = function (parentZoneDelegate, currentZone, targetZone, task) {\n if (task.type !== 'eventTask') {\n this.tasks.push(task);\n }\n if (this._delegateSpec && this._delegateSpec.onScheduleTask) {\n return this._delegateSpec.onScheduleTask(parentZoneDelegate, currentZone, targetZone, task);\n } else {\n return parentZoneDelegate.scheduleTask(targetZone, task);\n }\n };\n ProxyZoneSpec.prototype.onInvokeTask = function (parentZoneDelegate, currentZone, targetZone, task, applyThis, applyArgs) {\n if (task.type !== 'eventTask') {\n this.removeFromTasks(task);\n }\n this.tryTriggerHasTask(parentZoneDelegate, currentZone, targetZone);\n if (this._delegateSpec && this._delegateSpec.onInvokeTask) {\n return this._delegateSpec.onInvokeTask(parentZoneDelegate, currentZone, targetZone, task, applyThis, applyArgs);\n } else {\n return parentZoneDelegate.invokeTask(targetZone, task, applyThis, applyArgs);\n }\n };\n ProxyZoneSpec.prototype.onCancelTask = function (parentZoneDelegate, currentZone, targetZone, task) {\n if (task.type !== 'eventTask') {\n this.removeFromTasks(task);\n }\n this.tryTriggerHasTask(parentZoneDelegate, currentZone, targetZone);\n if (this._delegateSpec && this._delegateSpec.onCancelTask) {\n return this._delegateSpec.onCancelTask(parentZoneDelegate, currentZone, targetZone, task);\n } else {\n return parentZoneDelegate.cancelTask(targetZone, task);\n }\n };\n ProxyZoneSpec.prototype.onHasTask = function (delegate, current, target, hasTaskState) {\n this.lastTaskState = hasTaskState;\n if (this._delegateSpec && this._delegateSpec.onHasTask) {\n this._delegateSpec.onHasTask(delegate, current, target, hasTaskState);\n } else {\n delegate.hasTask(target, hasTaskState);\n }\n };\n return ProxyZoneSpec;\n }();\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['ProxyZoneSpec'] = ProxyZoneSpec;\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 var SyncTestZoneSpec = /** @class */function () {\n function SyncTestZoneSpec(namePrefix) {\n this.runZone = Zone.current;\n this.name = 'syncTestZone for ' + namePrefix;\n }\n SyncTestZoneSpec.prototype.onScheduleTask = function (delegate, current, target, task) {\n switch (task.type) {\n case 'microTask':\n case 'macroTask':\n throw new Error(\"Cannot call \" + task.source + \" from within a sync test.\");\n case 'eventTask':\n task = delegate.scheduleTask(target, task);\n break;\n }\n return task;\n };\n return SyncTestZoneSpec;\n }();\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['SyncTestZoneSpec'] = SyncTestZoneSpec;\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 Zone.__load_patch('jasmine', function (global, Zone, api) {\n var __extends = function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n // Patch jasmine's describe/it/beforeEach/afterEach functions so test code always runs\n // in a testZone (ProxyZone). (See: angular/zone.js#91 & angular/angular#10503)\n if (!Zone) throw new Error('Missing: zone.js');\n if (typeof jest !== 'undefined') {\n // return if jasmine is a light implementation inside jest\n // in this case, we are running inside jest not jasmine\n return;\n }\n if (typeof jasmine == 'undefined' || jasmine['__zone_patch__']) {\n return;\n }\n jasmine['__zone_patch__'] = true;\n var SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n if (!SyncTestZoneSpec) throw new Error('Missing: SyncTestZoneSpec');\n if (!ProxyZoneSpec) throw new Error('Missing: ProxyZoneSpec');\n var ambientZone = Zone.current;\n // Create a synchronous-only zone in which to run `describe` blocks in order to raise an\n // error if any asynchronous operations are attempted inside of a `describe` but outside of\n // a `beforeEach` or `it`.\n var syncZone = ambientZone.fork(new SyncTestZoneSpec('jasmine.describe'));\n var symbol = Zone.__symbol__;\n // whether patch jasmine clock when in fakeAsync\n var disablePatchingJasmineClock = global[symbol('fakeAsyncDisablePatchingClock')] === true;\n // the original variable name fakeAsyncPatchLock is not accurate, so the name will be\n // fakeAsyncAutoFakeAsyncWhenClockPatched and if this enablePatchingJasmineClock is false, we also\n // automatically disable the auto jump into fakeAsync feature\n var enableAutoFakeAsyncWhenClockPatched = !disablePatchingJasmineClock && (global[symbol('fakeAsyncPatchLock')] === true || global[symbol('fakeAsyncAutoFakeAsyncWhenClockPatched')] === true);\n var ignoreUnhandledRejection = global[symbol('ignoreUnhandledRejection')] === true;\n if (!ignoreUnhandledRejection) {\n var globalErrors_1 = jasmine.GlobalErrors;\n if (globalErrors_1 && !jasmine[symbol('GlobalErrors')]) {\n jasmine[symbol('GlobalErrors')] = globalErrors_1;\n jasmine.GlobalErrors = function () {\n var instance = new globalErrors_1();\n var originalInstall = instance.install;\n if (originalInstall && !instance[symbol('install')]) {\n instance[symbol('install')] = originalInstall;\n instance.install = function () {\n var originalHandlers = process.listeners('unhandledRejection');\n var r = originalInstall.apply(this, arguments);\n process.removeAllListeners('unhandledRejection');\n if (originalHandlers) {\n originalHandlers.forEach(function (h) {\n return process.on('unhandledRejection', h);\n });\n }\n return r;\n };\n }\n return instance;\n };\n }\n }\n // Monkey patch all of the jasmine DSL so that each function runs in appropriate zone.\n var jasmineEnv = jasmine.getEnv();\n ['describe', 'xdescribe', 'fdescribe'].forEach(function (methodName) {\n var originalJasmineFn = jasmineEnv[methodName];\n jasmineEnv[methodName] = function (description, specDefinitions) {\n return originalJasmineFn.call(this, description, wrapDescribeInZone(specDefinitions));\n };\n });\n ['it', 'xit', 'fit'].forEach(function (methodName) {\n var originalJasmineFn = jasmineEnv[methodName];\n jasmineEnv[symbol(methodName)] = originalJasmineFn;\n jasmineEnv[methodName] = function (description, specDefinitions, timeout) {\n arguments[1] = wrapTestInZone(specDefinitions);\n return originalJasmineFn.apply(this, arguments);\n };\n });\n ['beforeEach', 'afterEach', 'beforeAll', 'afterAll'].forEach(function (methodName) {\n var originalJasmineFn = jasmineEnv[methodName];\n jasmineEnv[symbol(methodName)] = originalJasmineFn;\n jasmineEnv[methodName] = function (specDefinitions, timeout) {\n arguments[0] = wrapTestInZone(specDefinitions);\n return originalJasmineFn.apply(this, arguments);\n };\n });\n if (!disablePatchingJasmineClock) {\n // need to patch jasmine.clock().mockDate and jasmine.clock().tick() so\n // they can work properly in FakeAsyncTest\n var originalClockFn_1 = jasmine[symbol('clock')] = jasmine['clock'];\n jasmine['clock'] = function () {\n var clock = originalClockFn_1.apply(this, arguments);\n if (!clock[symbol('patched')]) {\n clock[symbol('patched')] = symbol('patched');\n var originalTick_1 = clock[symbol('tick')] = clock.tick;\n clock.tick = function () {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n return fakeAsyncZoneSpec.tick.apply(fakeAsyncZoneSpec, arguments);\n }\n return originalTick_1.apply(this, arguments);\n };\n var originalMockDate_1 = clock[symbol('mockDate')] = clock.mockDate;\n clock.mockDate = function () {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n var dateTime = arguments.length > 0 ? arguments[0] : new Date();\n return fakeAsyncZoneSpec.setFakeBaseSystemTime.apply(fakeAsyncZoneSpec, dateTime && typeof dateTime.getTime === 'function' ? [dateTime.getTime()] : arguments);\n }\n return originalMockDate_1.apply(this, arguments);\n };\n // for auto go into fakeAsync feature, we need the flag to enable it\n if (enableAutoFakeAsyncWhenClockPatched) {\n ['install', 'uninstall'].forEach(function (methodName) {\n var originalClockFn = clock[symbol(methodName)] = clock[methodName];\n clock[methodName] = function () {\n var FakeAsyncTestZoneSpec = Zone['FakeAsyncTestZoneSpec'];\n if (FakeAsyncTestZoneSpec) {\n jasmine[symbol('clockInstalled')] = 'install' === methodName;\n return;\n }\n return originalClockFn.apply(this, arguments);\n };\n });\n }\n }\n return clock;\n };\n }\n // monkey patch createSpyObj to make properties enumerable to true\n if (!jasmine[Zone.__symbol__('createSpyObj')]) {\n var originalCreateSpyObj_1 = jasmine.createSpyObj;\n jasmine[Zone.__symbol__('createSpyObj')] = originalCreateSpyObj_1;\n jasmine.createSpyObj = function () {\n var args = Array.prototype.slice.call(arguments);\n var propertyNames = args.length >= 3 ? args[2] : null;\n var spyObj;\n if (propertyNames) {\n var defineProperty_1 = Object.defineProperty;\n Object.defineProperty = function (obj, p, attributes) {\n return defineProperty_1.call(this, obj, p, Object.assign(Object.assign({}, attributes), {\n configurable: true,\n enumerable: true\n }));\n };\n try {\n spyObj = originalCreateSpyObj_1.apply(this, args);\n } finally {\n Object.defineProperty = defineProperty_1;\n }\n } else {\n spyObj = originalCreateSpyObj_1.apply(this, args);\n }\n return spyObj;\n };\n }\n /**\n * Gets a function wrapping the body of a Jasmine `describe` block to execute in a\n * synchronous-only zone.\n */\n function wrapDescribeInZone(describeBody) {\n return function () {\n return syncZone.run(describeBody, this, arguments);\n };\n }\n function runInTestZone(testBody, applyThis, queueRunner, done) {\n var isClockInstalled = !!jasmine[symbol('clockInstalled')];\n var testProxyZoneSpec = queueRunner.testProxyZoneSpec;\n var testProxyZone = queueRunner.testProxyZone;\n if (isClockInstalled && enableAutoFakeAsyncWhenClockPatched) {\n // auto run a fakeAsync\n var fakeAsyncModule = Zone[Zone.__symbol__('fakeAsyncTest')];\n if (fakeAsyncModule && typeof fakeAsyncModule.fakeAsync === 'function') {\n testBody = fakeAsyncModule.fakeAsync(testBody);\n }\n }\n if (done) {\n return testProxyZone.run(testBody, applyThis, [done]);\n } else {\n return testProxyZone.run(testBody, applyThis);\n }\n }\n /**\n * Gets a function wrapping the body of a Jasmine `it/beforeEach/afterEach` block to\n * execute in a ProxyZone zone.\n * This will run in `testProxyZone`. The `testProxyZone` will be reset by the `ZoneQueueRunner`\n */\n function wrapTestInZone(testBody) {\n // The `done` callback is only passed through if the function expects at least one argument.\n // Note we have to make a function with correct number of arguments, otherwise jasmine will\n // think that all functions are sync or async.\n return testBody && (testBody.length ? function (done) {\n return runInTestZone(testBody, this, this.queueRunner, done);\n } : function () {\n return runInTestZone(testBody, this, this.queueRunner);\n });\n }\n var QueueRunner = jasmine.QueueRunner;\n jasmine.QueueRunner = function (_super) {\n __extends(ZoneQueueRunner, _super);\n function ZoneQueueRunner(attrs) {\n var _this = this;\n if (attrs.onComplete) {\n attrs.onComplete = function (fn) {\n return function () {\n // All functions are done, clear the test zone.\n _this.testProxyZone = null;\n _this.testProxyZoneSpec = null;\n ambientZone.scheduleMicroTask('jasmine.onComplete', fn);\n };\n }(attrs.onComplete);\n }\n var nativeSetTimeout = global[Zone.__symbol__('setTimeout')];\n var nativeClearTimeout = global[Zone.__symbol__('clearTimeout')];\n if (nativeSetTimeout) {\n // should run setTimeout inside jasmine outside of zone\n attrs.timeout = {\n setTimeout: nativeSetTimeout ? nativeSetTimeout : global.setTimeout,\n clearTimeout: nativeClearTimeout ? nativeClearTimeout : global.clearTimeout\n };\n }\n // create a userContext to hold the queueRunner itself\n // so we can access the testProxy in it/xit/beforeEach ...\n if (jasmine.UserContext) {\n if (!attrs.userContext) {\n attrs.userContext = new jasmine.UserContext();\n }\n attrs.userContext.queueRunner = this;\n } else {\n if (!attrs.userContext) {\n attrs.userContext = {};\n }\n attrs.userContext.queueRunner = this;\n }\n // patch attrs.onException\n var onException = attrs.onException;\n attrs.onException = function (error) {\n if (error && error.message === 'Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.') {\n // jasmine timeout, we can make the error message more\n // reasonable to tell what tasks are pending\n var proxyZoneSpec = this && this.testProxyZoneSpec;\n if (proxyZoneSpec) {\n var pendingTasksInfo = proxyZoneSpec.getAndClearPendingTasksInfo();\n try {\n // try catch here in case error.message is not writable\n error.message += pendingTasksInfo;\n } catch (err) {}\n }\n }\n if (onException) {\n onException.call(this, error);\n }\n };\n _super.call(this, attrs);\n }\n ZoneQueueRunner.prototype.execute = function () {\n var _this = this;\n var zone = Zone.current;\n var isChildOfAmbientZone = false;\n while (zone) {\n if (zone === ambientZone) {\n isChildOfAmbientZone = true;\n break;\n }\n zone = zone.parent;\n }\n if (!isChildOfAmbientZone) throw new Error('Unexpected Zone: ' + Zone.current.name);\n // This is the zone which will be used for running individual tests.\n // It will be a proxy zone, so that the tests function can retroactively install\n // different zones.\n // Example:\n // - In beforeEach() do childZone = Zone.current.fork(...);\n // - In it() try to do fakeAsync(). The issue is that because the beforeEach forked the\n // zone outside of fakeAsync it will be able to escape the fakeAsync rules.\n // - Because ProxyZone is parent fo `childZone` fakeAsync can retroactively add\n // fakeAsync behavior to the childZone.\n this.testProxyZoneSpec = new ProxyZoneSpec();\n this.testProxyZone = ambientZone.fork(this.testProxyZoneSpec);\n if (!Zone.currentTask) {\n // if we are not running in a task then if someone would register a\n // element.addEventListener and then calling element.click() the\n // addEventListener callback would think that it is the top most task and would\n // drain the microtask queue on element.click() which would be incorrect.\n // For this reason we always force a task when running jasmine tests.\n Zone.current.scheduleMicroTask('jasmine.execute().forceTask', function () {\n return QueueRunner.prototype.execute.call(_this);\n });\n } else {\n _super.prototype.execute.call(this);\n }\n };\n return ZoneQueueRunner;\n }(QueueRunner);\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 Zone.__load_patch('jest', function (context, Zone, api) {\n if (typeof jest === 'undefined' || jest['__zone_patch__']) {\n return;\n }\n jest['__zone_patch__'] = true;\n var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n var SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n if (!ProxyZoneSpec) {\n throw new Error('Missing ProxyZoneSpec');\n }\n var rootZone = Zone.current;\n var syncZone = rootZone.fork(new SyncTestZoneSpec('jest.describe'));\n var proxyZoneSpec = new ProxyZoneSpec();\n var proxyZone = rootZone.fork(proxyZoneSpec);\n function wrapDescribeFactoryInZone(originalJestFn) {\n return function () {\n var tableArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n tableArgs[_i] = arguments[_i];\n }\n var originalDescribeFn = originalJestFn.apply(this, tableArgs);\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[1] = wrapDescribeInZone(args[1]);\n return originalDescribeFn.apply(this, args);\n };\n };\n }\n function wrapTestFactoryInZone(originalJestFn) {\n return function () {\n var tableArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n tableArgs[_i] = arguments[_i];\n }\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[1] = wrapTestInZone(args[1]);\n return originalJestFn.apply(this, tableArgs).apply(this, args);\n };\n };\n }\n /**\n * Gets a function wrapping the body of a jest `describe` block to execute in a\n * synchronous-only zone.\n */\n function wrapDescribeInZone(describeBody) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return syncZone.run(describeBody, this, args);\n };\n }\n /**\n * Gets a function wrapping the body of a jest `it/beforeEach/afterEach` block to\n * execute in a ProxyZone zone.\n * This will run in the `proxyZone`.\n */\n function wrapTestInZone(testBody, isTestFunc) {\n if (isTestFunc === void 0) {\n isTestFunc = false;\n }\n if (typeof testBody !== 'function') {\n return testBody;\n }\n var wrappedFunc = function () {\n if (Zone[api.symbol('useFakeTimersCalled')] === true && testBody && !testBody.isFakeAsync) {\n // jest.useFakeTimers is called, run into fakeAsyncTest automatically.\n var fakeAsyncModule = Zone[Zone.__symbol__('fakeAsyncTest')];\n if (fakeAsyncModule && typeof fakeAsyncModule.fakeAsync === 'function') {\n testBody = fakeAsyncModule.fakeAsync(testBody);\n }\n }\n proxyZoneSpec.isTestFunc = isTestFunc;\n return proxyZone.run(testBody, null, arguments);\n };\n // Update the length of wrappedFunc to be the same as the length of the testBody\n // So jest core can handle whether the test function has `done()` or not correctly\n Object.defineProperty(wrappedFunc, 'length', {\n configurable: true,\n writable: true,\n enumerable: false\n });\n wrappedFunc.length = testBody.length;\n return wrappedFunc;\n }\n ['describe', 'xdescribe', 'fdescribe'].forEach(function (methodName) {\n var originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[1] = wrapDescribeInZone(args[1]);\n return originalJestFn.apply(this, args);\n };\n context[methodName].each = wrapDescribeFactoryInZone(originalJestFn.each);\n });\n context.describe.only = context.fdescribe;\n context.describe.skip = context.xdescribe;\n ['it', 'xit', 'fit', 'test', 'xtest'].forEach(function (methodName) {\n var originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[1] = wrapTestInZone(args[1], true);\n return originalJestFn.apply(this, args);\n };\n context[methodName].each = wrapTestFactoryInZone(originalJestFn.each);\n context[methodName].todo = originalJestFn.todo;\n });\n context.it.only = context.fit;\n context.it.skip = context.xit;\n context.test.only = context.fit;\n context.test.skip = context.xit;\n ['beforeEach', 'afterEach', 'beforeAll', 'afterAll'].forEach(function (methodName) {\n var originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[0] = wrapTestInZone(args[0]);\n return originalJestFn.apply(this, args);\n };\n });\n Zone.patchJestObject = function patchJestObject(Timer, isModern) {\n if (isModern === void 0) {\n isModern = false;\n }\n // check whether currently the test is inside fakeAsync()\n function isPatchingFakeTimer() {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n return !!fakeAsyncZoneSpec;\n }\n // check whether the current function is inside `test/it` or other methods\n // such as `describe/beforeEach`\n function isInTestFunc() {\n var proxyZoneSpec = Zone.current.get('ProxyZoneSpec');\n return proxyZoneSpec && proxyZoneSpec.isTestFunc;\n }\n if (Timer[api.symbol('fakeTimers')]) {\n return;\n }\n Timer[api.symbol('fakeTimers')] = true;\n // patch jest fakeTimer internal method to make sure no console.warn print out\n api.patchMethod(Timer, '_checkFakeTimers', function (delegate) {\n return function (self, args) {\n if (isPatchingFakeTimer()) {\n return true;\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch useFakeTimers(), set useFakeTimersCalled flag, and make test auto run into fakeAsync\n api.patchMethod(Timer, 'useFakeTimers', function (delegate) {\n return function (self, args) {\n Zone[api.symbol('useFakeTimersCalled')] = true;\n if (isModern || isInTestFunc()) {\n return delegate.apply(self, args);\n }\n return self;\n };\n });\n // patch useRealTimers(), unset useFakeTimers flag\n api.patchMethod(Timer, 'useRealTimers', function (delegate) {\n return function (self, args) {\n Zone[api.symbol('useFakeTimersCalled')] = false;\n if (isModern || isInTestFunc()) {\n return delegate.apply(self, args);\n }\n return self;\n };\n });\n // patch setSystemTime(), call setCurrentRealTime() in the fakeAsyncTest\n api.patchMethod(Timer, 'setSystemTime', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec && isPatchingFakeTimer()) {\n fakeAsyncZoneSpec.setFakeBaseSystemTime(args[0]);\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch getSystemTime(), call getCurrentRealTime() in the fakeAsyncTest\n api.patchMethod(Timer, 'getRealSystemTime', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec && isPatchingFakeTimer()) {\n return fakeAsyncZoneSpec.getRealSystemTime();\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch runAllTicks(), run all microTasks inside fakeAsync\n api.patchMethod(Timer, 'runAllTicks', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.flushMicrotasks();\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch runAllTimers(), run all macroTasks inside fakeAsync\n api.patchMethod(Timer, 'runAllTimers', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.flush(100, true);\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch advanceTimersByTime(), call tick() in the fakeAsyncTest\n api.patchMethod(Timer, 'advanceTimersByTime', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.tick(args[0]);\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch runOnlyPendingTimers(), call flushOnlyPendingTimers() in the fakeAsyncTest\n api.patchMethod(Timer, 'runOnlyPendingTimers', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.flushOnlyPendingTimers();\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch advanceTimersToNextTimer(), call tickToNext() in the fakeAsyncTest\n api.patchMethod(Timer, 'advanceTimersToNextTimer', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.tickToNext(args[0]);\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch clearAllTimers(), call removeAllTimers() in the fakeAsyncTest\n api.patchMethod(Timer, 'clearAllTimers', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.removeAllTimers();\n } else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch getTimerCount(), call getTimerCount() in the fakeAsyncTest\n api.patchMethod(Timer, 'getTimerCount', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n return fakeAsyncZoneSpec.getTimerCount();\n } else {\n return delegate.apply(self, args);\n }\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 Zone.__load_patch('mocha', function (global, Zone) {\n var Mocha = global.Mocha;\n if (typeof Mocha === 'undefined') {\n // return if Mocha is not available, because now zone-testing\n // will load mocha patch with jasmine/jest patch\n return;\n }\n if (typeof Zone === 'undefined') {\n throw new Error('Missing Zone.js');\n }\n var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n var SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n if (!ProxyZoneSpec) {\n throw new Error('Missing ProxyZoneSpec');\n }\n if (Mocha['__zone_patch__']) {\n throw new Error('\"Mocha\" has already been patched with \"Zone\".');\n }\n Mocha['__zone_patch__'] = true;\n var rootZone = Zone.current;\n var syncZone = rootZone.fork(new SyncTestZoneSpec('Mocha.describe'));\n var testZone = null;\n var suiteZone = rootZone.fork(new ProxyZoneSpec());\n var mochaOriginal = {\n after: Mocha.after,\n afterEach: Mocha.afterEach,\n before: Mocha.before,\n beforeEach: Mocha.beforeEach,\n describe: Mocha.describe,\n it: Mocha.it\n };\n function modifyArguments(args, syncTest, asyncTest) {\n var _loop_1 = function (i) {\n var arg = args[i];\n if (typeof arg === 'function') {\n // The `done` callback is only passed through if the function expects at\n // least one argument.\n // Note we have to make a function with correct number of arguments,\n // otherwise mocha will\n // think that all functions are sync or async.\n args[i] = arg.length === 0 ? syncTest(arg) : asyncTest(arg);\n // Mocha uses toString to view the test body in the result list, make sure we return the\n // correct function body\n args[i].toString = function () {\n return arg.toString();\n };\n }\n };\n for (var i = 0; i < args.length; i++) {\n _loop_1(i);\n }\n return args;\n }\n function wrapDescribeInZone(args) {\n var syncTest = function (fn) {\n return function () {\n return syncZone.run(fn, this, arguments);\n };\n };\n return modifyArguments(args, syncTest);\n }\n function wrapTestInZone(args) {\n var asyncTest = function (fn) {\n return function (done) {\n return testZone.run(fn, this, [done]);\n };\n };\n var syncTest = function (fn) {\n return function () {\n return testZone.run(fn, this);\n };\n };\n return modifyArguments(args, syncTest, asyncTest);\n }\n function wrapSuiteInZone(args) {\n var asyncTest = function (fn) {\n return function (done) {\n return suiteZone.run(fn, this, [done]);\n };\n };\n var syncTest = function (fn) {\n return function () {\n return suiteZone.run(fn, this);\n };\n };\n return modifyArguments(args, syncTest, asyncTest);\n }\n global.describe = global.suite = Mocha.describe = function () {\n return mochaOriginal.describe.apply(this, wrapDescribeInZone(arguments));\n };\n global.xdescribe = global.suite.skip = Mocha.describe.skip = function () {\n return mochaOriginal.describe.skip.apply(this, wrapDescribeInZone(arguments));\n };\n global.describe.only = global.suite.only = Mocha.describe.only = function () {\n return mochaOriginal.describe.only.apply(this, wrapDescribeInZone(arguments));\n };\n global.it = global.specify = global.test = Mocha.it = function () {\n return mochaOriginal.it.apply(this, wrapTestInZone(arguments));\n };\n global.xit = global.xspecify = Mocha.it.skip = function () {\n return mochaOriginal.it.skip.apply(this, wrapTestInZone(arguments));\n };\n global.it.only = global.test.only = Mocha.it.only = function () {\n return mochaOriginal.it.only.apply(this, wrapTestInZone(arguments));\n };\n global.after = global.suiteTeardown = Mocha.after = function () {\n return mochaOriginal.after.apply(this, wrapSuiteInZone(arguments));\n };\n global.afterEach = global.teardown = Mocha.afterEach = function () {\n return mochaOriginal.afterEach.apply(this, wrapTestInZone(arguments));\n };\n global.before = global.suiteSetup = Mocha.before = function () {\n return mochaOriginal.before.apply(this, wrapSuiteInZone(arguments));\n };\n global.beforeEach = global.setup = Mocha.beforeEach = function () {\n return mochaOriginal.beforeEach.apply(this, wrapTestInZone(arguments));\n };\n (function (originalRunTest, originalRun) {\n Mocha.Runner.prototype.runTest = function (fn) {\n var _this = this;\n Zone.current.scheduleMicroTask('mocha.forceTask', function () {\n originalRunTest.call(_this, fn);\n });\n };\n Mocha.Runner.prototype.run = function (fn) {\n this.on('test', function (e) {\n testZone = rootZone.fork(new ProxyZoneSpec());\n });\n this.on('fail', function (test, err) {\n var proxyZoneSpec = testZone && testZone.get('ProxyZoneSpec');\n if (proxyZoneSpec && err) {\n try {\n // try catch here in case err.message is not writable\n err.message += proxyZoneSpec.getAndClearPendingTasksInfo();\n } catch (error) {}\n }\n });\n return originalRun.call(this, fn);\n };\n })(Mocha.Runner.prototype.runTest, Mocha.Runner.prototype.run);\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 (function (_global) {\n var AsyncTestZoneSpec = /** @class */function () {\n function AsyncTestZoneSpec(finishCallback, failCallback, namePrefix) {\n this.finishCallback = finishCallback;\n this.failCallback = failCallback;\n this._pendingMicroTasks = false;\n this._pendingMacroTasks = false;\n this._alreadyErrored = false;\n this._isSync = false;\n this.runZone = Zone.current;\n this.unresolvedChainedPromiseCount = 0;\n this.supportWaitUnresolvedChainedPromise = false;\n this.name = 'asyncTestZone for ' + namePrefix;\n this.properties = {\n 'AsyncTestZoneSpec': this\n };\n this.supportWaitUnresolvedChainedPromise = _global[Zone.__symbol__('supportWaitUnResolvedChainedPromise')] === true;\n }\n AsyncTestZoneSpec.prototype.isUnresolvedChainedPromisePending = function () {\n return this.unresolvedChainedPromiseCount > 0;\n };\n AsyncTestZoneSpec.prototype._finishCallbackIfDone = function () {\n var _this = this;\n if (!(this._pendingMicroTasks || this._pendingMacroTasks || this.supportWaitUnresolvedChainedPromise && this.isUnresolvedChainedPromisePending())) {\n // We do this because we would like to catch unhandled rejected promises.\n this.runZone.run(function () {\n setTimeout(function () {\n if (!_this._alreadyErrored && !(_this._pendingMicroTasks || _this._pendingMacroTasks)) {\n _this.finishCallback();\n }\n }, 0);\n });\n }\n };\n AsyncTestZoneSpec.prototype.patchPromiseForTest = function () {\n if (!this.supportWaitUnresolvedChainedPromise) {\n return;\n }\n var patchPromiseForTest = Promise[Zone.__symbol__('patchPromiseForTest')];\n if (patchPromiseForTest) {\n patchPromiseForTest();\n }\n };\n AsyncTestZoneSpec.prototype.unPatchPromiseForTest = function () {\n if (!this.supportWaitUnresolvedChainedPromise) {\n return;\n }\n var unPatchPromiseForTest = Promise[Zone.__symbol__('unPatchPromiseForTest')];\n if (unPatchPromiseForTest) {\n unPatchPromiseForTest();\n }\n };\n AsyncTestZoneSpec.prototype.onScheduleTask = function (delegate, current, target, task) {\n if (task.type !== 'eventTask') {\n this._isSync = false;\n }\n if (task.type === 'microTask' && task.data && task.data instanceof Promise) {\n // check whether the promise is a chained promise\n if (task.data[AsyncTestZoneSpec.symbolParentUnresolved] === true) {\n // chained promise is being scheduled\n this.unresolvedChainedPromiseCount--;\n }\n }\n return delegate.scheduleTask(target, task);\n };\n AsyncTestZoneSpec.prototype.onInvokeTask = function (delegate, current, target, task, applyThis, applyArgs) {\n if (task.type !== 'eventTask') {\n this._isSync = false;\n }\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n };\n AsyncTestZoneSpec.prototype.onCancelTask = function (delegate, current, target, task) {\n if (task.type !== 'eventTask') {\n this._isSync = false;\n }\n return delegate.cancelTask(target, task);\n };\n // Note - we need to use onInvoke at the moment to call finish when a test is\n // fully synchronous. TODO(juliemr): remove this when the logic for\n // onHasTask changes and it calls whenever the task queues are dirty.\n // updated by(JiaLiPassion), only call finish callback when no task\n // was scheduled/invoked/canceled.\n AsyncTestZoneSpec.prototype.onInvoke = function (parentZoneDelegate, currentZone, targetZone, delegate, applyThis, applyArgs, source) {\n try {\n this._isSync = true;\n return parentZoneDelegate.invoke(targetZone, delegate, applyThis, applyArgs, source);\n } finally {\n var afterTaskCounts = parentZoneDelegate._taskCounts;\n if (this._isSync) {\n this._finishCallbackIfDone();\n }\n }\n };\n AsyncTestZoneSpec.prototype.onHandleError = function (parentZoneDelegate, currentZone, targetZone, error) {\n // Let the parent try to handle the error.\n var result = parentZoneDelegate.handleError(targetZone, error);\n if (result) {\n this.failCallback(error);\n this._alreadyErrored = true;\n }\n return false;\n };\n AsyncTestZoneSpec.prototype.onHasTask = function (delegate, current, target, hasTaskState) {\n delegate.hasTask(target, hasTaskState);\n if (hasTaskState.change == 'microTask') {\n this._pendingMicroTasks = hasTaskState.microTask;\n this._finishCallbackIfDone();\n } else if (hasTaskState.change == 'macroTask') {\n this._pendingMacroTasks = hasTaskState.macroTask;\n this._finishCallbackIfDone();\n }\n };\n return AsyncTestZoneSpec;\n }();\n AsyncTestZoneSpec.symbolParentUnresolved = Zone.__symbol__('parentUnresolved');\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['AsyncTestZoneSpec'] = AsyncTestZoneSpec;\n })(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);\n Zone.__load_patch('asynctest', function (global, Zone, api) {\n /**\n * Wraps a test function in an asynchronous test zone. The test will automatically\n * complete when all asynchronous calls within this zone are done.\n */\n Zone[api.symbol('asyncTest')] = function asyncTest(fn) {\n // If we're running using the Jasmine test framework, adapt to call the 'done'\n // function when asynchronous activity is finished.\n if (global.jasmine) {\n // Not using an arrow function to preserve context passed from call site\n return function (done) {\n if (!done) {\n // if we run beforeEach in @angular/core/testing/testing_internal then we get no done\n // fake it here and assume sync.\n done = function () {};\n done.fail = function (e) {\n throw e;\n };\n }\n runInTestZone(fn, this, done, function (err) {\n if (typeof err === 'string') {\n return done.fail(new Error(err));\n } else {\n done.fail(err);\n }\n });\n };\n }\n // Otherwise, return a promise which will resolve when asynchronous activity\n // is finished. This will be correctly consumed by the Mocha framework with\n // it('...', async(myFn)); or can be used in a custom framework.\n // Not using an arrow function to preserve context passed from call site\n return function () {\n var _this = this;\n return new Promise(function (finishCallback, failCallback) {\n runInTestZone(fn, _this, finishCallback, failCallback);\n });\n };\n };\n function runInTestZone(fn, context, finishCallback, failCallback) {\n var currentZone = Zone.current;\n var AsyncTestZoneSpec = Zone['AsyncTestZoneSpec'];\n if (AsyncTestZoneSpec === undefined) {\n throw new Error('AsyncTestZoneSpec is needed for the async() test helper but could not be found. ' + 'Please make sure that your environment includes zone.js/dist/async-test.js');\n }\n var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n if (!ProxyZoneSpec) {\n throw new Error('ProxyZoneSpec is needed for the async() test helper but could not be found. ' + 'Please make sure that your environment includes zone.js/dist/proxy.js');\n }\n var proxyZoneSpec = ProxyZoneSpec.get();\n ProxyZoneSpec.assertPresent();\n // We need to create the AsyncTestZoneSpec outside the ProxyZone.\n // If we do it in ProxyZone then we will get to infinite recursion.\n var proxyZone = Zone.current.getZoneWith('ProxyZoneSpec');\n var previousDelegate = proxyZoneSpec.getDelegate();\n proxyZone.parent.run(function () {\n var testZoneSpec = new AsyncTestZoneSpec(function () {\n // Need to restore the original zone.\n if (proxyZoneSpec.getDelegate() == testZoneSpec) {\n // Only reset the zone spec if it's\n // sill this one. Otherwise, assume\n // it's OK.\n proxyZoneSpec.setDelegate(previousDelegate);\n }\n testZoneSpec.unPatchPromiseForTest();\n currentZone.run(function () {\n finishCallback();\n });\n }, function (error) {\n // Need to restore the original zone.\n if (proxyZoneSpec.getDelegate() == testZoneSpec) {\n // Only reset the zone spec if it's sill this one. Otherwise, assume it's OK.\n proxyZoneSpec.setDelegate(previousDelegate);\n }\n testZoneSpec.unPatchPromiseForTest();\n currentZone.run(function () {\n failCallback(error);\n });\n }, 'test');\n proxyZoneSpec.setDelegate(testZoneSpec);\n testZoneSpec.patchPromiseForTest();\n });\n return Zone.current.runGuarded(fn, context);\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 (function (global) {\n var OriginalDate = global.Date;\n // Since when we compile this file to `es2015`, and if we define\n // this `FakeDate` as `class FakeDate`, and then set `FakeDate.prototype`\n // there will be an error which is `Cannot assign to read only property 'prototype'`\n // so we need to use function implementation here.\n function FakeDate() {\n if (arguments.length === 0) {\n var d = new OriginalDate();\n d.setTime(FakeDate.now());\n return d;\n } else {\n var args = Array.prototype.slice.call(arguments);\n return new (OriginalDate.bind.apply(OriginalDate, __spreadArrays([void 0], args)))();\n }\n }\n FakeDate.now = function () {\n var fakeAsyncTestZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncTestZoneSpec) {\n return fakeAsyncTestZoneSpec.getFakeSystemTime();\n }\n return OriginalDate.now.apply(this, arguments);\n };\n FakeDate.UTC = OriginalDate.UTC;\n FakeDate.parse = OriginalDate.parse;\n // keep a reference for zone patched timer function\n var timers = {\n setTimeout: global.setTimeout,\n setInterval: global.setInterval,\n clearTimeout: global.clearTimeout,\n clearInterval: global.clearInterval\n };\n var Scheduler = /** @class */function () {\n function Scheduler() {\n // Scheduler queue with the tuple of end time and callback function - sorted by end time.\n this._schedulerQueue = [];\n // Current simulated time in millis.\n this._currentTickTime = 0;\n // Current fake system base time in millis.\n this._currentFakeBaseSystemTime = OriginalDate.now();\n // track requeuePeriodicTimer\n this._currentTickRequeuePeriodicEntries = [];\n }\n Scheduler.prototype.getCurrentTickTime = function () {\n return this._currentTickTime;\n };\n Scheduler.prototype.getFakeSystemTime = function () {\n return this._currentFakeBaseSystemTime + this._currentTickTime;\n };\n Scheduler.prototype.setFakeBaseSystemTime = function (fakeBaseSystemTime) {\n this._currentFakeBaseSystemTime = fakeBaseSystemTime;\n };\n Scheduler.prototype.getRealSystemTime = function () {\n return OriginalDate.now();\n };\n Scheduler.prototype.scheduleFunction = function (cb, delay, options) {\n options = Object.assign({\n args: [],\n isPeriodic: false,\n isRequestAnimationFrame: false,\n id: -1,\n isRequeuePeriodic: false\n }, options);\n var currentId = options.id < 0 ? Scheduler.nextId++ : options.id;\n var endTime = this._currentTickTime + delay;\n // Insert so that scheduler queue remains sorted by end time.\n var newEntry = {\n endTime: endTime,\n id: currentId,\n func: cb,\n args: options.args,\n delay: delay,\n isPeriodic: options.isPeriodic,\n isRequestAnimationFrame: options.isRequestAnimationFrame\n };\n if (options.isRequeuePeriodic) {\n this._currentTickRequeuePeriodicEntries.push(newEntry);\n }\n var i = 0;\n for (; i < this._schedulerQueue.length; i++) {\n var currentEntry = this._schedulerQueue[i];\n if (newEntry.endTime < currentEntry.endTime) {\n break;\n }\n }\n this._schedulerQueue.splice(i, 0, newEntry);\n return currentId;\n };\n Scheduler.prototype.removeScheduledFunctionWithId = function (id) {\n for (var i = 0; i < this._schedulerQueue.length; i++) {\n if (this._schedulerQueue[i].id == id) {\n this._schedulerQueue.splice(i, 1);\n break;\n }\n }\n };\n Scheduler.prototype.removeAll = function () {\n this._schedulerQueue = [];\n };\n Scheduler.prototype.getTimerCount = function () {\n return this._schedulerQueue.length;\n };\n Scheduler.prototype.tickToNext = function (step, doTick, tickOptions) {\n if (step === void 0) {\n step = 1;\n }\n if (this._schedulerQueue.length < step) {\n return;\n }\n // Find the last task currently queued in the scheduler queue and tick\n // till that time.\n var startTime = this._currentTickTime;\n var targetTask = this._schedulerQueue[step - 1];\n this.tick(targetTask.endTime - startTime, doTick, tickOptions);\n };\n Scheduler.prototype.tick = function (millis, doTick, tickOptions) {\n if (millis === void 0) {\n millis = 0;\n }\n var finalTime = this._currentTickTime + millis;\n var lastCurrentTime = 0;\n tickOptions = Object.assign({\n processNewMacroTasksSynchronously: true\n }, tickOptions);\n // we need to copy the schedulerQueue so nested timeout\n // will not be wrongly called in the current tick\n // https://github.com/angular/angular/issues/33799\n var schedulerQueue = tickOptions.processNewMacroTasksSynchronously ? this._schedulerQueue : this._schedulerQueue.slice();\n if (schedulerQueue.length === 0 && doTick) {\n doTick(millis);\n return;\n }\n while (schedulerQueue.length > 0) {\n // clear requeueEntries before each loop\n this._currentTickRequeuePeriodicEntries = [];\n var current = schedulerQueue[0];\n if (finalTime < current.endTime) {\n // Done processing the queue since it's sorted by endTime.\n break;\n } else {\n // Time to run scheduled function. Remove it from the head of queue.\n var current_1 = schedulerQueue.shift();\n if (!tickOptions.processNewMacroTasksSynchronously) {\n var idx = this._schedulerQueue.indexOf(current_1);\n if (idx >= 0) {\n this._schedulerQueue.splice(idx, 1);\n }\n }\n lastCurrentTime = this._currentTickTime;\n this._currentTickTime = current_1.endTime;\n if (doTick) {\n doTick(this._currentTickTime - lastCurrentTime);\n }\n var retval = current_1.func.apply(global, current_1.isRequestAnimationFrame ? [this._currentTickTime] : current_1.args);\n if (!retval) {\n // Uncaught exception in the current scheduled function. Stop processing the queue.\n break;\n }\n // check is there any requeue periodic entry is added in\n // current loop, if there is, we need to add to current loop\n if (!tickOptions.processNewMacroTasksSynchronously) {\n this._currentTickRequeuePeriodicEntries.forEach(function (newEntry) {\n var i = 0;\n for (; i < schedulerQueue.length; i++) {\n var currentEntry = schedulerQueue[i];\n if (newEntry.endTime < currentEntry.endTime) {\n break;\n }\n }\n schedulerQueue.splice(i, 0, newEntry);\n });\n }\n }\n }\n lastCurrentTime = this._currentTickTime;\n this._currentTickTime = finalTime;\n if (doTick) {\n doTick(this._currentTickTime - lastCurrentTime);\n }\n };\n Scheduler.prototype.flushOnlyPendingTimers = function (doTick) {\n if (this._schedulerQueue.length === 0) {\n return 0;\n }\n // Find the last task currently queued in the scheduler queue and tick\n // till that time.\n var startTime = this._currentTickTime;\n var lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];\n this.tick(lastTask.endTime - startTime, doTick, {\n processNewMacroTasksSynchronously: false\n });\n return this._currentTickTime - startTime;\n };\n Scheduler.prototype.flush = function (limit, flushPeriodic, doTick) {\n if (limit === void 0) {\n limit = 20;\n }\n if (flushPeriodic === void 0) {\n flushPeriodic = false;\n }\n if (flushPeriodic) {\n return this.flushPeriodic(doTick);\n } else {\n return this.flushNonPeriodic(limit, doTick);\n }\n };\n Scheduler.prototype.flushPeriodic = function (doTick) {\n if (this._schedulerQueue.length === 0) {\n return 0;\n }\n // Find the last task currently queued in the scheduler queue and tick\n // till that time.\n var startTime = this._currentTickTime;\n var lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];\n this.tick(lastTask.endTime - startTime, doTick);\n return this._currentTickTime - startTime;\n };\n Scheduler.prototype.flushNonPeriodic = function (limit, doTick) {\n var startTime = this._currentTickTime;\n var lastCurrentTime = 0;\n var count = 0;\n while (this._schedulerQueue.length > 0) {\n count++;\n if (count > limit) {\n throw new Error('flush failed after reaching the limit of ' + limit + ' tasks. Does your code use a polling timeout?');\n }\n // flush only non-periodic timers.\n // If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing.\n if (this._schedulerQueue.filter(function (task) {\n return !task.isPeriodic && !task.isRequestAnimationFrame;\n }).length === 0) {\n break;\n }\n var current = this._schedulerQueue.shift();\n lastCurrentTime = this._currentTickTime;\n this._currentTickTime = current.endTime;\n if (doTick) {\n // Update any secondary schedulers like Jasmine mock Date.\n doTick(this._currentTickTime - lastCurrentTime);\n }\n var retval = current.func.apply(global, current.args);\n if (!retval) {\n // Uncaught exception in the current scheduled function. Stop processing the queue.\n break;\n }\n }\n return this._currentTickTime - startTime;\n };\n return Scheduler;\n }();\n // Next scheduler id.\n Scheduler.nextId = 1;\n var FakeAsyncTestZoneSpec = /** @class */function () {\n function FakeAsyncTestZoneSpec(namePrefix, trackPendingRequestAnimationFrame, macroTaskOptions) {\n if (trackPendingRequestAnimationFrame === void 0) {\n trackPendingRequestAnimationFrame = false;\n }\n this.trackPendingRequestAnimationFrame = trackPendingRequestAnimationFrame;\n this.macroTaskOptions = macroTaskOptions;\n this._scheduler = new Scheduler();\n this._microtasks = [];\n this._lastError = null;\n this._uncaughtPromiseErrors = Promise[Zone.__symbol__('uncaughtPromiseErrors')];\n this.pendingPeriodicTimers = [];\n this.pendingTimers = [];\n this.patchDateLocked = false;\n this.properties = {\n 'FakeAsyncTestZoneSpec': this\n };\n this.name = 'fakeAsyncTestZone for ' + namePrefix;\n // in case user can't access the construction of FakeAsyncTestSpec\n // user can also define macroTaskOptions by define a global variable.\n if (!this.macroTaskOptions) {\n this.macroTaskOptions = global[Zone.__symbol__('FakeAsyncTestMacroTask')];\n }\n }\n FakeAsyncTestZoneSpec.assertInZone = function () {\n if (Zone.current.get('FakeAsyncTestZoneSpec') == null) {\n throw new Error('The code should be running in the fakeAsync zone to call this function');\n }\n };\n FakeAsyncTestZoneSpec.prototype._fnAndFlush = function (fn, completers) {\n var _this = this;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n fn.apply(global, args);\n if (_this._lastError === null) {\n // Success\n if (completers.onSuccess != null) {\n completers.onSuccess.apply(global);\n }\n // Flush microtasks only on success.\n _this.flushMicrotasks();\n } else {\n // Failure\n if (completers.onError != null) {\n completers.onError.apply(global);\n }\n }\n // Return true if there were no errors, false otherwise.\n return _this._lastError === null;\n };\n };\n FakeAsyncTestZoneSpec._removeTimer = function (timers, id) {\n var index = timers.indexOf(id);\n if (index > -1) {\n timers.splice(index, 1);\n }\n };\n FakeAsyncTestZoneSpec.prototype._dequeueTimer = function (id) {\n var _this = this;\n return function () {\n FakeAsyncTestZoneSpec._removeTimer(_this.pendingTimers, id);\n };\n };\n FakeAsyncTestZoneSpec.prototype._requeuePeriodicTimer = function (fn, interval, args, id) {\n var _this = this;\n return function () {\n // Requeue the timer callback if it's not been canceled.\n if (_this.pendingPeriodicTimers.indexOf(id) !== -1) {\n _this._scheduler.scheduleFunction(fn, interval, {\n args: args,\n isPeriodic: true,\n id: id,\n isRequeuePeriodic: true\n });\n }\n };\n };\n FakeAsyncTestZoneSpec.prototype._dequeuePeriodicTimer = function (id) {\n var _this = this;\n return function () {\n FakeAsyncTestZoneSpec._removeTimer(_this.pendingPeriodicTimers, id);\n };\n };\n FakeAsyncTestZoneSpec.prototype._setTimeout = function (fn, delay, args, isTimer) {\n if (isTimer === void 0) {\n isTimer = true;\n }\n var removeTimerFn = this._dequeueTimer(Scheduler.nextId);\n // Queue the callback and dequeue the timer on success and error.\n var cb = this._fnAndFlush(fn, {\n onSuccess: removeTimerFn,\n onError: removeTimerFn\n });\n var id = this._scheduler.scheduleFunction(cb, delay, {\n args: args,\n isRequestAnimationFrame: !isTimer\n });\n if (isTimer) {\n this.pendingTimers.push(id);\n }\n return id;\n };\n FakeAsyncTestZoneSpec.prototype._clearTimeout = function (id) {\n FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers, id);\n this._scheduler.removeScheduledFunctionWithId(id);\n };\n FakeAsyncTestZoneSpec.prototype._setInterval = function (fn, interval, args) {\n var id = Scheduler.nextId;\n var completers = {\n onSuccess: null,\n onError: this._dequeuePeriodicTimer(id)\n };\n var cb = this._fnAndFlush(fn, completers);\n // Use the callback created above to requeue on success.\n completers.onSuccess = this._requeuePeriodicTimer(cb, interval, args, id);\n // Queue the callback and dequeue the periodic timer only on error.\n this._scheduler.scheduleFunction(cb, interval, {\n args: args,\n isPeriodic: true\n });\n this.pendingPeriodicTimers.push(id);\n return id;\n };\n FakeAsyncTestZoneSpec.prototype._clearInterval = function (id) {\n FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers, id);\n this._scheduler.removeScheduledFunctionWithId(id);\n };\n FakeAsyncTestZoneSpec.prototype._resetLastErrorAndThrow = function () {\n var error = this._lastError || this._uncaughtPromiseErrors[0];\n this._uncaughtPromiseErrors.length = 0;\n this._lastError = null;\n throw error;\n };\n FakeAsyncTestZoneSpec.prototype.getCurrentTickTime = function () {\n return this._scheduler.getCurrentTickTime();\n };\n FakeAsyncTestZoneSpec.prototype.getFakeSystemTime = function () {\n return this._scheduler.getFakeSystemTime();\n };\n FakeAsyncTestZoneSpec.prototype.setFakeBaseSystemTime = function (realTime) {\n this._scheduler.setFakeBaseSystemTime(realTime);\n };\n FakeAsyncTestZoneSpec.prototype.getRealSystemTime = function () {\n return this._scheduler.getRealSystemTime();\n };\n FakeAsyncTestZoneSpec.patchDate = function () {\n if (!!global[Zone.__symbol__('disableDatePatching')]) {\n // we don't want to patch global Date\n // because in some case, global Date\n // is already being patched, we need to provide\n // an option to let user still use their\n // own version of Date.\n return;\n }\n if (global['Date'] === FakeDate) {\n // already patched\n return;\n }\n global['Date'] = FakeDate;\n FakeDate.prototype = OriginalDate.prototype;\n // try check and reset timers\n // because jasmine.clock().install() may\n // have replaced the global timer\n FakeAsyncTestZoneSpec.checkTimerPatch();\n };\n FakeAsyncTestZoneSpec.resetDate = function () {\n if (global['Date'] === FakeDate) {\n global['Date'] = OriginalDate;\n }\n };\n FakeAsyncTestZoneSpec.checkTimerPatch = function () {\n if (global.setTimeout !== timers.setTimeout) {\n global.setTimeout = timers.setTimeout;\n global.clearTimeout = timers.clearTimeout;\n }\n if (global.setInterval !== timers.setInterval) {\n global.setInterval = timers.setInterval;\n global.clearInterval = timers.clearInterval;\n }\n };\n FakeAsyncTestZoneSpec.prototype.lockDatePatch = function () {\n this.patchDateLocked = true;\n FakeAsyncTestZoneSpec.patchDate();\n };\n FakeAsyncTestZoneSpec.prototype.unlockDatePatch = function () {\n this.patchDateLocked = false;\n FakeAsyncTestZoneSpec.resetDate();\n };\n FakeAsyncTestZoneSpec.prototype.tickToNext = function (steps, doTick, tickOptions) {\n if (steps === void 0) {\n steps = 1;\n }\n if (tickOptions === void 0) {\n tickOptions = {\n processNewMacroTasksSynchronously: true\n };\n }\n if (steps <= 0) {\n return;\n }\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n this._scheduler.tickToNext(steps, doTick, tickOptions);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n };\n FakeAsyncTestZoneSpec.prototype.tick = function (millis, doTick, tickOptions) {\n if (millis === void 0) {\n millis = 0;\n }\n if (tickOptions === void 0) {\n tickOptions = {\n processNewMacroTasksSynchronously: true\n };\n }\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n this._scheduler.tick(millis, doTick, tickOptions);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n };\n FakeAsyncTestZoneSpec.prototype.flushMicrotasks = function () {\n var _this = this;\n FakeAsyncTestZoneSpec.assertInZone();\n var flushErrors = function () {\n if (_this._lastError !== null || _this._uncaughtPromiseErrors.length) {\n // If there is an error stop processing the microtask queue and rethrow the error.\n _this._resetLastErrorAndThrow();\n }\n };\n while (this._microtasks.length > 0) {\n var microtask = this._microtasks.shift();\n microtask.func.apply(microtask.target, microtask.args);\n }\n flushErrors();\n };\n FakeAsyncTestZoneSpec.prototype.flush = function (limit, flushPeriodic, doTick) {\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n var elapsed = this._scheduler.flush(limit, flushPeriodic, doTick);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n return elapsed;\n };\n FakeAsyncTestZoneSpec.prototype.flushOnlyPendingTimers = function (doTick) {\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n var elapsed = this._scheduler.flushOnlyPendingTimers(doTick);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n return elapsed;\n };\n FakeAsyncTestZoneSpec.prototype.removeAllTimers = function () {\n FakeAsyncTestZoneSpec.assertInZone();\n this._scheduler.removeAll();\n this.pendingPeriodicTimers = [];\n this.pendingTimers = [];\n };\n FakeAsyncTestZoneSpec.prototype.getTimerCount = function () {\n return this._scheduler.getTimerCount() + this._microtasks.length;\n };\n FakeAsyncTestZoneSpec.prototype.onScheduleTask = function (delegate, current, target, task) {\n switch (task.type) {\n case 'microTask':\n var args = task.data && task.data.args;\n // should pass additional arguments to callback if have any\n // currently we know process.nextTick will have such additional\n // arguments\n var additionalArgs = void 0;\n if (args) {\n var callbackIndex = task.data.cbIdx;\n if (typeof args.length === 'number' && args.length > callbackIndex + 1) {\n additionalArgs = Array.prototype.slice.call(args, callbackIndex + 1);\n }\n }\n this._microtasks.push({\n func: task.invoke,\n args: additionalArgs,\n target: task.data && task.data.target\n });\n break;\n case 'macroTask':\n switch (task.source) {\n case 'setTimeout':\n task.data['handleId'] = this._setTimeout(task.invoke, task.data['delay'], Array.prototype.slice.call(task.data['args'], 2));\n break;\n case 'setImmediate':\n task.data['handleId'] = this._setTimeout(task.invoke, 0, Array.prototype.slice.call(task.data['args'], 1));\n break;\n case 'setInterval':\n task.data['handleId'] = this._setInterval(task.invoke, task.data['delay'], Array.prototype.slice.call(task.data['args'], 2));\n break;\n case 'XMLHttpRequest.send':\n throw new Error('Cannot make XHRs from within a fake async test. Request URL: ' + task.data['url']);\n case 'requestAnimationFrame':\n case 'webkitRequestAnimationFrame':\n case 'mozRequestAnimationFrame':\n // Simulate a requestAnimationFrame by using a setTimeout with 16 ms.\n // (60 frames per second)\n task.data['handleId'] = this._setTimeout(task.invoke, 16, task.data['args'], this.trackPendingRequestAnimationFrame);\n break;\n default:\n // user can define which macroTask they want to support by passing\n // macroTaskOptions\n var macroTaskOption = this.findMacroTaskOption(task);\n if (macroTaskOption) {\n var args_1 = task.data && task.data['args'];\n var delay = args_1 && args_1.length > 1 ? args_1[1] : 0;\n var callbackArgs = macroTaskOption.callbackArgs ? macroTaskOption.callbackArgs : args_1;\n if (!!macroTaskOption.isPeriodic) {\n // periodic macroTask, use setInterval to simulate\n task.data['handleId'] = this._setInterval(task.invoke, delay, callbackArgs);\n task.data.isPeriodic = true;\n } else {\n // not periodic, use setTimeout to simulate\n task.data['handleId'] = this._setTimeout(task.invoke, delay, callbackArgs);\n }\n break;\n }\n throw new Error('Unknown macroTask scheduled in fake async test: ' + task.source);\n }\n break;\n case 'eventTask':\n task = delegate.scheduleTask(target, task);\n break;\n }\n return task;\n };\n FakeAsyncTestZoneSpec.prototype.onCancelTask = function (delegate, current, target, task) {\n switch (task.source) {\n case 'setTimeout':\n case 'requestAnimationFrame':\n case 'webkitRequestAnimationFrame':\n case 'mozRequestAnimationFrame':\n return this._clearTimeout(task.data['handleId']);\n case 'setInterval':\n return this._clearInterval(task.data['handleId']);\n default:\n // user can define which macroTask they want to support by passing\n // macroTaskOptions\n var macroTaskOption = this.findMacroTaskOption(task);\n if (macroTaskOption) {\n var handleId = task.data['handleId'];\n return macroTaskOption.isPeriodic ? this._clearInterval(handleId) : this._clearTimeout(handleId);\n }\n return delegate.cancelTask(target, task);\n }\n };\n FakeAsyncTestZoneSpec.prototype.onInvoke = function (delegate, current, target, callback, applyThis, applyArgs, source) {\n try {\n FakeAsyncTestZoneSpec.patchDate();\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n if (!this.patchDateLocked) {\n FakeAsyncTestZoneSpec.resetDate();\n }\n }\n };\n FakeAsyncTestZoneSpec.prototype.findMacroTaskOption = function (task) {\n if (!this.macroTaskOptions) {\n return null;\n }\n for (var i = 0; i < this.macroTaskOptions.length; i++) {\n var macroTaskOption = this.macroTaskOptions[i];\n if (macroTaskOption.source === task.source) {\n return macroTaskOption;\n }\n }\n return null;\n };\n FakeAsyncTestZoneSpec.prototype.onHandleError = function (parentZoneDelegate, currentZone, targetZone, error) {\n this._lastError = error;\n return false; // Don't propagate error to parent zone.\n };\n\n return FakeAsyncTestZoneSpec;\n }();\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['FakeAsyncTestZoneSpec'] = FakeAsyncTestZoneSpec;\n })(typeof window === 'object' && window || typeof self === 'object' && self || global);\n Zone.__load_patch('fakeasync', function (global, Zone, api) {\n var FakeAsyncTestZoneSpec = Zone && Zone['FakeAsyncTestZoneSpec'];\n function getProxyZoneSpec() {\n return Zone && Zone['ProxyZoneSpec'];\n }\n var _fakeAsyncTestZoneSpec = null;\n /**\n * Clears out the shared fake async zone for a test.\n * To be called in a global `beforeEach`.\n *\n * @experimental\n */\n function resetFakeAsyncZone() {\n if (_fakeAsyncTestZoneSpec) {\n _fakeAsyncTestZoneSpec.unlockDatePatch();\n }\n _fakeAsyncTestZoneSpec = null;\n // in node.js testing we may not have ProxyZoneSpec in which case there is nothing to reset.\n getProxyZoneSpec() && getProxyZoneSpec().assertPresent().resetDelegate();\n }\n /**\n * Wraps a function to be executed in the fakeAsync zone:\n * - microtasks are manually executed by calling `flushMicrotasks()`,\n * - timers are synchronous, `tick()` simulates the asynchronous passage of time.\n *\n * If there are any pending timers at the end of the function, an exception will be thrown.\n *\n * Can be used to wrap inject() calls.\n *\n * ## Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @param fn\n * @returns The function wrapped to be executed in the fakeAsync zone\n *\n * @experimental\n */\n function fakeAsync(fn) {\n // Not using an arrow function to preserve context passed from call site\n var fakeAsyncFn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var ProxyZoneSpec = getProxyZoneSpec();\n if (!ProxyZoneSpec) {\n throw new Error('ProxyZoneSpec is needed for the async() test helper but could not be found. ' + 'Please make sure that your environment includes zone.js/dist/proxy.js');\n }\n var proxyZoneSpec = ProxyZoneSpec.assertPresent();\n if (Zone.current.get('FakeAsyncTestZoneSpec')) {\n throw new Error('fakeAsync() calls can not be nested');\n }\n try {\n // in case jasmine.clock init a fakeAsyncTestZoneSpec\n if (!_fakeAsyncTestZoneSpec) {\n if (proxyZoneSpec.getDelegate() instanceof FakeAsyncTestZoneSpec) {\n throw new Error('fakeAsync() calls can not be nested');\n }\n _fakeAsyncTestZoneSpec = new FakeAsyncTestZoneSpec();\n }\n var res = void 0;\n var lastProxyZoneSpec = proxyZoneSpec.getDelegate();\n proxyZoneSpec.setDelegate(_fakeAsyncTestZoneSpec);\n _fakeAsyncTestZoneSpec.lockDatePatch();\n try {\n res = fn.apply(this, args);\n flushMicrotasks();\n } finally {\n proxyZoneSpec.setDelegate(lastProxyZoneSpec);\n }\n if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {\n throw new Error(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length + \" \" + \"periodic timer(s) still in the queue.\");\n }\n if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {\n throw new Error(_fakeAsyncTestZoneSpec.pendingTimers.length + \" timer(s) still in the queue.\");\n }\n return res;\n } finally {\n resetFakeAsyncZone();\n }\n };\n fakeAsyncFn.isFakeAsync = true;\n return fakeAsyncFn;\n }\n function _getFakeAsyncZoneSpec() {\n if (_fakeAsyncTestZoneSpec == null) {\n _fakeAsyncTestZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (_fakeAsyncTestZoneSpec == null) {\n throw new Error('The code should be running in the fakeAsync zone to call this function');\n }\n }\n return _fakeAsyncTestZoneSpec;\n }\n /**\n * Simulates the asynchronous passage of time for the timers in the fakeAsync zone.\n *\n * The microtasks queue is drained at the very start of this function and after any timer callback\n * has been executed.\n *\n * ## Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @experimental\n */\n function tick(millis, ignoreNestedTimeout) {\n if (millis === void 0) {\n millis = 0;\n }\n if (ignoreNestedTimeout === void 0) {\n ignoreNestedTimeout = false;\n }\n _getFakeAsyncZoneSpec().tick(millis, null, ignoreNestedTimeout);\n }\n /**\n * Simulates the asynchronous passage of time for the timers in the fakeAsync zone by\n * draining the macrotask queue until it is empty. The returned value is the milliseconds\n * of time that would have been elapsed.\n *\n * @param maxTurns\n * @returns The simulated time elapsed, in millis.\n *\n * @experimental\n */\n function flush(maxTurns) {\n return _getFakeAsyncZoneSpec().flush(maxTurns);\n }\n /**\n * Discard all remaining periodic tasks.\n *\n * @experimental\n */\n function discardPeriodicTasks() {\n var zoneSpec = _getFakeAsyncZoneSpec();\n var pendingTimers = zoneSpec.pendingPeriodicTimers;\n zoneSpec.pendingPeriodicTimers.length = 0;\n }\n /**\n * Flush any pending microtasks.\n *\n * @experimental\n */\n function flushMicrotasks() {\n _getFakeAsyncZoneSpec().flushMicrotasks();\n }\n Zone[api.symbol('fakeAsyncTest')] = {\n resetFakeAsyncZone: resetFakeAsyncZone,\n flushMicrotasks: flushMicrotasks,\n discardPeriodicTasks: discardPeriodicTasks,\n tick: tick,\n flush: flush,\n fakeAsync: fakeAsync\n };\n }, true);\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 * Promise for async/fakeAsync zoneSpec test\n * can support async operation which not supported by zone.js\n * such as\n * it ('test jsonp in AsyncZone', async() => {\n * new Promise(res => {\n * jsonp(url, (data) => {\n * // success callback\n * res(data);\n * });\n * }).then((jsonpResult) => {\n * // get jsonp result.\n *\n * // user will expect AsyncZoneSpec wait for\n * // then, but because jsonp is not zone aware\n * // AsyncZone will finish before then is called.\n * });\n * });\n */\n Zone.__load_patch('promisefortest', function (global, Zone, api) {\n var symbolState = api.symbol('state');\n var UNRESOLVED = null;\n var symbolParentUnresolved = api.symbol('parentUnresolved');\n // patch Promise.prototype.then to keep an internal\n // number for tracking unresolved chained promise\n // we will decrease this number when the parent promise\n // being resolved/rejected and chained promise was\n // scheduled as a microTask.\n // so we can know such kind of chained promise still\n // not resolved in AsyncTestZone\n Promise[api.symbol('patchPromiseForTest')] = function patchPromiseForTest() {\n var oriThen = Promise[Zone.__symbol__('ZonePromiseThen')];\n if (oriThen) {\n return;\n }\n oriThen = Promise[Zone.__symbol__('ZonePromiseThen')] = Promise.prototype.then;\n Promise.prototype.then = function () {\n var chained = oriThen.apply(this, arguments);\n if (this[symbolState] === UNRESOLVED) {\n // parent promise is unresolved.\n var asyncTestZoneSpec = Zone.current.get('AsyncTestZoneSpec');\n if (asyncTestZoneSpec) {\n asyncTestZoneSpec.unresolvedChainedPromiseCount++;\n chained[symbolParentUnresolved] = true;\n }\n }\n return chained;\n };\n };\n Promise[api.symbol('unPatchPromiseForTest')] = function unpatchPromiseForTest() {\n // restore origin then\n var oriThen = Promise[Zone.__symbol__('ZonePromiseThen')];\n if (oriThen) {\n Promise.prototype.then = oriThen;\n Promise[Zone.__symbol__('ZonePromiseThen')] = undefined;\n }\n };\n });\n});","map":{"version":3,"names":["__spreadArrays","s","i","il","arguments","length","r","Array","k","a","j","jl","factory","define","amd","NEWLINE","IGNORE_FRAMES","creationTrace","ERROR_TAG","SEP_TAG","sepTemplate","LongStackTrace","error","getStacktrace","timestamp","Date","getStacktraceWithUncaughtError","Error","getStacktraceWithCaughtError","err","caughtError","stack","getFrames","split","addErrorStack","lines","trace","frame","hasOwnProperty","push","renderLongStackTrace","frames","longTrace","trim","getTime","traceFrames","lastTime","separator","replace","join","stackTracesEnabled","stackTraceLimit","Zone","name","longStackTraceLimit","getLongStackTrace","undefined","__symbol__","onScheduleTask","parentZoneDelegate","currentZone","targetZone","task","currentTask","data","concat","type","Object","assign","scheduleTask","onHandleError","parentTask","longStack","handleError","captureStackTraces","stackTraces","count","computeIgnoreFrames","frames1","frames2","frame1","indexOf","match","frame2","ProxyZoneSpec","defaultSpecDelegate","_delegateSpec","properties","propertyKeys","lastTaskState","isNeedToTriggerHasTask","tasks","setDelegate","get","current","isLoaded","assertPresent","prototype","delegateSpec","_this","isNewDelegate","forEach","key","keys","macroTask","microTask","getDelegate","resetDelegate","tryTriggerHasTask","onHasTask","removeFromTasks","splice","getAndClearPendingTasksInfo","taskInfo","map","dataInfo","source","pendingTasksInfo","onFork","zoneSpec","fork","onIntercept","delegate","intercept","onInvoke","applyThis","applyArgs","invoke","onInvokeTask","invokeTask","onCancelTask","cancelTask","target","hasTaskState","hasTask","SyncTestZoneSpec","namePrefix","runZone","__load_patch","global","api","__extends","d","b","p","__","constructor","create","jest","jasmine","ambientZone","syncZone","symbol","disablePatchingJasmineClock","enableAutoFakeAsyncWhenClockPatched","ignoreUnhandledRejection","globalErrors_1","GlobalErrors","instance","originalInstall","install","originalHandlers","process","listeners","apply","removeAllListeners","h","on","jasmineEnv","getEnv","methodName","originalJasmineFn","description","specDefinitions","call","wrapDescribeInZone","timeout","wrapTestInZone","originalClockFn_1","clock","originalTick_1","tick","fakeAsyncZoneSpec","originalMockDate_1","mockDate","dateTime","setFakeBaseSystemTime","originalClockFn","FakeAsyncTestZoneSpec","originalCreateSpyObj_1","createSpyObj","args","slice","propertyNames","spyObj","defineProperty_1","defineProperty","obj","attributes","configurable","enumerable","describeBody","run","runInTestZone","testBody","queueRunner","done","isClockInstalled","testProxyZoneSpec","testProxyZone","fakeAsyncModule","fakeAsync","QueueRunner","_super","ZoneQueueRunner","attrs","onComplete","fn","scheduleMicroTask","nativeSetTimeout","nativeClearTimeout","setTimeout","clearTimeout","UserContext","userContext","onException","message","proxyZoneSpec","execute","zone","isChildOfAmbientZone","parent","context","rootZone","proxyZone","wrapDescribeFactoryInZone","originalJestFn","tableArgs","_i","originalDescribeFn","wrapTestFactoryInZone","isTestFunc","wrappedFunc","isFakeAsync","writable","each","describe","only","fdescribe","skip","xdescribe","todo","it","fit","xit","test","patchJestObject","Timer","isModern","isPatchingFakeTimer","isInTestFunc","patchMethod","self","getRealSystemTime","flushMicrotasks","flush","flushOnlyPendingTimers","tickToNext","removeAllTimers","getTimerCount","Mocha","testZone","suiteZone","mochaOriginal","after","afterEach","before","beforeEach","modifyArguments","syncTest","asyncTest","_loop_1","arg","toString","wrapSuiteInZone","suite","specify","xspecify","suiteTeardown","teardown","suiteSetup","setup","originalRunTest","originalRun","Runner","runTest","e","_global","AsyncTestZoneSpec","finishCallback","failCallback","_pendingMicroTasks","_pendingMacroTasks","_alreadyErrored","_isSync","unresolvedChainedPromiseCount","supportWaitUnresolvedChainedPromise","isUnresolvedChainedPromisePending","_finishCallbackIfDone","patchPromiseForTest","Promise","unPatchPromiseForTest","symbolParentUnresolved","afterTaskCounts","_taskCounts","result","change","window","fail","getZoneWith","previousDelegate","testZoneSpec","runGuarded","OriginalDate","FakeDate","setTime","now","bind","fakeAsyncTestZoneSpec","getFakeSystemTime","UTC","parse","timers","setInterval","clearInterval","Scheduler","_schedulerQueue","_currentTickTime","_currentFakeBaseSystemTime","_currentTickRequeuePeriodicEntries","getCurrentTickTime","fakeBaseSystemTime","scheduleFunction","cb","delay","options","isPeriodic","isRequestAnimationFrame","id","isRequeuePeriodic","currentId","nextId","endTime","newEntry","func","currentEntry","removeScheduledFunctionWithId","removeAll","step","doTick","tickOptions","startTime","targetTask","millis","finalTime","lastCurrentTime","processNewMacroTasksSynchronously","schedulerQueue","current_1","shift","idx","retval","lastTask","limit","flushPeriodic","flushNonPeriodic","filter","trackPendingRequestAnimationFrame","macroTaskOptions","_scheduler","_microtasks","_lastError","_uncaughtPromiseErrors","pendingPeriodicTimers","pendingTimers","patchDateLocked","assertInZone","_fnAndFlush","completers","onSuccess","onError","_removeTimer","index","_dequeueTimer","_requeuePeriodicTimer","interval","_dequeuePeriodicTimer","_setTimeout","isTimer","removeTimerFn","_clearTimeout","_setInterval","_clearInterval","_resetLastErrorAndThrow","realTime","patchDate","checkTimerPatch","resetDate","lockDatePatch","unlockDatePatch","steps","flushErrors","microtask","elapsed","additionalArgs","callbackIndex","cbIdx","macroTaskOption","findMacroTaskOption","args_1","callbackArgs","handleId","callback","getProxyZoneSpec","_fakeAsyncTestZoneSpec","resetFakeAsyncZone","fakeAsyncFn","res","lastProxyZoneSpec","_getFakeAsyncZoneSpec","ignoreNestedTimeout","maxTurns","discardPeriodicTasks","symbolState","UNRESOLVED","oriThen","then","chained","asyncTestZoneSpec","unpatchPromiseForTest"],"sources":["C:/FatboarProject/angular-client/node_modules/zone.js/dist/zone-testing.js"],"sourcesContent":["'use strict';\nvar __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\n/**\n * @license Angular v12.0.0-next.0\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n(function (factory) {\n typeof define === 'function' && define.amd ? define(factory) :\n 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 * @fileoverview\n * @suppress {globalThis}\n */\n var NEWLINE = '\\n';\n var IGNORE_FRAMES = {};\n var creationTrace = '__creationTrace__';\n var ERROR_TAG = 'STACKTRACE TRACKING';\n var SEP_TAG = '__SEP_TAG__';\n var sepTemplate = SEP_TAG + '@[native]';\n var LongStackTrace = /** @class */ (function () {\n function LongStackTrace() {\n this.error = getStacktrace();\n this.timestamp = new Date();\n }\n return LongStackTrace;\n }());\n function getStacktraceWithUncaughtError() {\n return new Error(ERROR_TAG);\n }\n function getStacktraceWithCaughtError() {\n try {\n throw getStacktraceWithUncaughtError();\n }\n catch (err) {\n return err;\n }\n }\n // Some implementations of exception handling don't create a stack trace if the exception\n // isn't thrown, however it's faster not to actually throw the exception.\n var error = getStacktraceWithUncaughtError();\n var caughtError = getStacktraceWithCaughtError();\n var getStacktrace = error.stack ?\n getStacktraceWithUncaughtError :\n (caughtError.stack ? getStacktraceWithCaughtError : getStacktraceWithUncaughtError);\n function getFrames(error) {\n return error.stack ? error.stack.split(NEWLINE) : [];\n }\n function addErrorStack(lines, error) {\n var trace = getFrames(error);\n for (var i = 0; i < trace.length; i++) {\n var frame = trace[i];\n // Filter out the Frames which are part of stack capturing.\n if (!IGNORE_FRAMES.hasOwnProperty(frame)) {\n lines.push(trace[i]);\n }\n }\n }\n function renderLongStackTrace(frames, stack) {\n var longTrace = [stack ? stack.trim() : ''];\n if (frames) {\n var timestamp = new Date().getTime();\n for (var i = 0; i < frames.length; i++) {\n var traceFrames = frames[i];\n var lastTime = traceFrames.timestamp;\n var separator = \"____________________Elapsed \" + (timestamp - lastTime.getTime()) + \" ms; At: \" + lastTime;\n separator = separator.replace(/[^\\w\\d]/g, '_');\n longTrace.push(sepTemplate.replace(SEP_TAG, separator));\n addErrorStack(longTrace, traceFrames.error);\n timestamp = lastTime.getTime();\n }\n }\n return longTrace.join(NEWLINE);\n }\n // if Error.stackTraceLimit is 0, means stack trace\n // is disabled, so we don't need to generate long stack trace\n // this will improve performance in some test(some test will\n // set stackTraceLimit to 0, https://github.com/angular/zone.js/issues/698\n function stackTracesEnabled() {\n // Cast through any since this property only exists on Error in the nodejs\n // typings.\n return Error.stackTraceLimit > 0;\n }\n Zone['longStackTraceZoneSpec'] = {\n name: 'long-stack-trace',\n longStackTraceLimit: 10,\n // add a getLongStackTrace method in spec to\n // handle handled reject promise error.\n getLongStackTrace: function (error) {\n if (!error) {\n return undefined;\n }\n var trace = error[Zone.__symbol__('currentTaskTrace')];\n if (!trace) {\n return error.stack;\n }\n return renderLongStackTrace(trace, error.stack);\n },\n onScheduleTask: function (parentZoneDelegate, currentZone, targetZone, task) {\n if (stackTracesEnabled()) {\n var currentTask = Zone.currentTask;\n var trace = currentTask && currentTask.data && currentTask.data[creationTrace] || [];\n trace = [new LongStackTrace()].concat(trace);\n if (trace.length > this.longStackTraceLimit) {\n trace.length = this.longStackTraceLimit;\n }\n if (!task.data)\n task.data = {};\n if (task.type === 'eventTask') {\n // Fix issue https://github.com/angular/zone.js/issues/1195,\n // For event task of browser, by default, all task will share a\n // singleton instance of data object, we should create a new one here\n // The cast to `any` is required to workaround a closure bug which wrongly applies\n // URL sanitization rules to .data access.\n task.data = Object.assign({}, task.data);\n }\n task.data[creationTrace] = trace;\n }\n return parentZoneDelegate.scheduleTask(targetZone, task);\n },\n onHandleError: function (parentZoneDelegate, currentZone, targetZone, error) {\n if (stackTracesEnabled()) {\n var parentTask = Zone.currentTask || error.task;\n if (error instanceof Error && parentTask) {\n var longStack = renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], error.stack);\n try {\n error.stack = error.longStack = longStack;\n }\n catch (err) {\n }\n }\n }\n return parentZoneDelegate.handleError(targetZone, error);\n }\n };\n function captureStackTraces(stackTraces, count) {\n if (count > 0) {\n stackTraces.push(getFrames((new LongStackTrace()).error));\n captureStackTraces(stackTraces, count - 1);\n }\n }\n function computeIgnoreFrames() {\n if (!stackTracesEnabled()) {\n return;\n }\n var frames = [];\n captureStackTraces(frames, 2);\n var frames1 = frames[0];\n var frames2 = frames[1];\n for (var i = 0; i < frames1.length; i++) {\n var frame1 = frames1[i];\n if (frame1.indexOf(ERROR_TAG) == -1) {\n var match = frame1.match(/^\\s*at\\s+/);\n if (match) {\n sepTemplate = match[0] + SEP_TAG + ' (http://localhost)';\n break;\n }\n }\n }\n for (var i = 0; i < frames1.length; i++) {\n var frame1 = frames1[i];\n var frame2 = frames2[i];\n if (frame1 === frame2) {\n IGNORE_FRAMES[frame1] = true;\n }\n else {\n break;\n }\n }\n }\n computeIgnoreFrames();\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 var ProxyZoneSpec = /** @class */ (function () {\n function ProxyZoneSpec(defaultSpecDelegate) {\n if (defaultSpecDelegate === void 0) { defaultSpecDelegate = null; }\n this.defaultSpecDelegate = defaultSpecDelegate;\n this.name = 'ProxyZone';\n this._delegateSpec = null;\n this.properties = { 'ProxyZoneSpec': this };\n this.propertyKeys = null;\n this.lastTaskState = null;\n this.isNeedToTriggerHasTask = false;\n this.tasks = [];\n this.setDelegate(defaultSpecDelegate);\n }\n ProxyZoneSpec.get = function () {\n return Zone.current.get('ProxyZoneSpec');\n };\n ProxyZoneSpec.isLoaded = function () {\n return ProxyZoneSpec.get() instanceof ProxyZoneSpec;\n };\n ProxyZoneSpec.assertPresent = function () {\n if (!ProxyZoneSpec.isLoaded()) {\n throw new Error(\"Expected to be running in 'ProxyZone', but it was not found.\");\n }\n return ProxyZoneSpec.get();\n };\n ProxyZoneSpec.prototype.setDelegate = function (delegateSpec) {\n var _this = this;\n var isNewDelegate = this._delegateSpec !== delegateSpec;\n this._delegateSpec = delegateSpec;\n this.propertyKeys && this.propertyKeys.forEach(function (key) { return delete _this.properties[key]; });\n this.propertyKeys = null;\n if (delegateSpec && delegateSpec.properties) {\n this.propertyKeys = Object.keys(delegateSpec.properties);\n this.propertyKeys.forEach(function (k) { return _this.properties[k] = delegateSpec.properties[k]; });\n }\n // if a new delegateSpec was set, check if we need to trigger hasTask\n if (isNewDelegate && this.lastTaskState &&\n (this.lastTaskState.macroTask || this.lastTaskState.microTask)) {\n this.isNeedToTriggerHasTask = true;\n }\n };\n ProxyZoneSpec.prototype.getDelegate = function () {\n return this._delegateSpec;\n };\n ProxyZoneSpec.prototype.resetDelegate = function () {\n var delegateSpec = this.getDelegate();\n this.setDelegate(this.defaultSpecDelegate);\n };\n ProxyZoneSpec.prototype.tryTriggerHasTask = function (parentZoneDelegate, currentZone, targetZone) {\n if (this.isNeedToTriggerHasTask && this.lastTaskState) {\n // last delegateSpec has microTask or macroTask\n // should call onHasTask in current delegateSpec\n this.isNeedToTriggerHasTask = false;\n this.onHasTask(parentZoneDelegate, currentZone, targetZone, this.lastTaskState);\n }\n };\n ProxyZoneSpec.prototype.removeFromTasks = function (task) {\n if (!this.tasks) {\n return;\n }\n for (var i = 0; i < this.tasks.length; i++) {\n if (this.tasks[i] === task) {\n this.tasks.splice(i, 1);\n return;\n }\n }\n };\n ProxyZoneSpec.prototype.getAndClearPendingTasksInfo = function () {\n if (this.tasks.length === 0) {\n return '';\n }\n var taskInfo = this.tasks.map(function (task) {\n var dataInfo = task.data &&\n Object.keys(task.data)\n .map(function (key) {\n return key + ':' + task.data[key];\n })\n .join(',');\n return \"type: \" + task.type + \", source: \" + task.source + \", args: {\" + dataInfo + \"}\";\n });\n var pendingTasksInfo = '--Pending async tasks are: [' + taskInfo + ']';\n // clear tasks\n this.tasks = [];\n return pendingTasksInfo;\n };\n ProxyZoneSpec.prototype.onFork = function (parentZoneDelegate, currentZone, targetZone, zoneSpec) {\n if (this._delegateSpec && this._delegateSpec.onFork) {\n return this._delegateSpec.onFork(parentZoneDelegate, currentZone, targetZone, zoneSpec);\n }\n else {\n return parentZoneDelegate.fork(targetZone, zoneSpec);\n }\n };\n ProxyZoneSpec.prototype.onIntercept = function (parentZoneDelegate, currentZone, targetZone, delegate, source) {\n if (this._delegateSpec && this._delegateSpec.onIntercept) {\n return this._delegateSpec.onIntercept(parentZoneDelegate, currentZone, targetZone, delegate, source);\n }\n else {\n return parentZoneDelegate.intercept(targetZone, delegate, source);\n }\n };\n ProxyZoneSpec.prototype.onInvoke = function (parentZoneDelegate, currentZone, targetZone, delegate, applyThis, applyArgs, source) {\n this.tryTriggerHasTask(parentZoneDelegate, currentZone, targetZone);\n if (this._delegateSpec && this._delegateSpec.onInvoke) {\n return this._delegateSpec.onInvoke(parentZoneDelegate, currentZone, targetZone, delegate, applyThis, applyArgs, source);\n }\n else {\n return parentZoneDelegate.invoke(targetZone, delegate, applyThis, applyArgs, source);\n }\n };\n ProxyZoneSpec.prototype.onHandleError = function (parentZoneDelegate, currentZone, targetZone, error) {\n if (this._delegateSpec && this._delegateSpec.onHandleError) {\n return this._delegateSpec.onHandleError(parentZoneDelegate, currentZone, targetZone, error);\n }\n else {\n return parentZoneDelegate.handleError(targetZone, error);\n }\n };\n ProxyZoneSpec.prototype.onScheduleTask = function (parentZoneDelegate, currentZone, targetZone, task) {\n if (task.type !== 'eventTask') {\n this.tasks.push(task);\n }\n if (this._delegateSpec && this._delegateSpec.onScheduleTask) {\n return this._delegateSpec.onScheduleTask(parentZoneDelegate, currentZone, targetZone, task);\n }\n else {\n return parentZoneDelegate.scheduleTask(targetZone, task);\n }\n };\n ProxyZoneSpec.prototype.onInvokeTask = function (parentZoneDelegate, currentZone, targetZone, task, applyThis, applyArgs) {\n if (task.type !== 'eventTask') {\n this.removeFromTasks(task);\n }\n this.tryTriggerHasTask(parentZoneDelegate, currentZone, targetZone);\n if (this._delegateSpec && this._delegateSpec.onInvokeTask) {\n return this._delegateSpec.onInvokeTask(parentZoneDelegate, currentZone, targetZone, task, applyThis, applyArgs);\n }\n else {\n return parentZoneDelegate.invokeTask(targetZone, task, applyThis, applyArgs);\n }\n };\n ProxyZoneSpec.prototype.onCancelTask = function (parentZoneDelegate, currentZone, targetZone, task) {\n if (task.type !== 'eventTask') {\n this.removeFromTasks(task);\n }\n this.tryTriggerHasTask(parentZoneDelegate, currentZone, targetZone);\n if (this._delegateSpec && this._delegateSpec.onCancelTask) {\n return this._delegateSpec.onCancelTask(parentZoneDelegate, currentZone, targetZone, task);\n }\n else {\n return parentZoneDelegate.cancelTask(targetZone, task);\n }\n };\n ProxyZoneSpec.prototype.onHasTask = function (delegate, current, target, hasTaskState) {\n this.lastTaskState = hasTaskState;\n if (this._delegateSpec && this._delegateSpec.onHasTask) {\n this._delegateSpec.onHasTask(delegate, current, target, hasTaskState);\n }\n else {\n delegate.hasTask(target, hasTaskState);\n }\n };\n return ProxyZoneSpec;\n }());\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['ProxyZoneSpec'] = ProxyZoneSpec;\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 var SyncTestZoneSpec = /** @class */ (function () {\n function SyncTestZoneSpec(namePrefix) {\n this.runZone = Zone.current;\n this.name = 'syncTestZone for ' + namePrefix;\n }\n SyncTestZoneSpec.prototype.onScheduleTask = function (delegate, current, target, task) {\n switch (task.type) {\n case 'microTask':\n case 'macroTask':\n throw new Error(\"Cannot call \" + task.source + \" from within a sync test.\");\n case 'eventTask':\n task = delegate.scheduleTask(target, task);\n break;\n }\n return task;\n };\n return SyncTestZoneSpec;\n }());\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['SyncTestZoneSpec'] = SyncTestZoneSpec;\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 Zone.__load_patch('jasmine', function (global, Zone, api) {\n var __extends = function (d, b) {\n for (var p in b)\n if (b.hasOwnProperty(p))\n d[p] = b[p];\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());\n };\n // Patch jasmine's describe/it/beforeEach/afterEach functions so test code always runs\n // in a testZone (ProxyZone). (See: angular/zone.js#91 & angular/angular#10503)\n if (!Zone)\n throw new Error('Missing: zone.js');\n if (typeof jest !== 'undefined') {\n // return if jasmine is a light implementation inside jest\n // in this case, we are running inside jest not jasmine\n return;\n }\n if (typeof jasmine == 'undefined' || jasmine['__zone_patch__']) {\n return;\n }\n jasmine['__zone_patch__'] = true;\n var SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n if (!SyncTestZoneSpec)\n throw new Error('Missing: SyncTestZoneSpec');\n if (!ProxyZoneSpec)\n throw new Error('Missing: ProxyZoneSpec');\n var ambientZone = Zone.current;\n // Create a synchronous-only zone in which to run `describe` blocks in order to raise an\n // error if any asynchronous operations are attempted inside of a `describe` but outside of\n // a `beforeEach` or `it`.\n var syncZone = ambientZone.fork(new SyncTestZoneSpec('jasmine.describe'));\n var symbol = Zone.__symbol__;\n // whether patch jasmine clock when in fakeAsync\n var disablePatchingJasmineClock = global[symbol('fakeAsyncDisablePatchingClock')] === true;\n // the original variable name fakeAsyncPatchLock is not accurate, so the name will be\n // fakeAsyncAutoFakeAsyncWhenClockPatched and if this enablePatchingJasmineClock is false, we also\n // automatically disable the auto jump into fakeAsync feature\n var enableAutoFakeAsyncWhenClockPatched = !disablePatchingJasmineClock &&\n ((global[symbol('fakeAsyncPatchLock')] === true) ||\n (global[symbol('fakeAsyncAutoFakeAsyncWhenClockPatched')] === true));\n var ignoreUnhandledRejection = global[symbol('ignoreUnhandledRejection')] === true;\n if (!ignoreUnhandledRejection) {\n var globalErrors_1 = jasmine.GlobalErrors;\n if (globalErrors_1 && !jasmine[symbol('GlobalErrors')]) {\n jasmine[symbol('GlobalErrors')] = globalErrors_1;\n jasmine.GlobalErrors = function () {\n var instance = new globalErrors_1();\n var originalInstall = instance.install;\n if (originalInstall && !instance[symbol('install')]) {\n instance[symbol('install')] = originalInstall;\n instance.install = function () {\n var originalHandlers = process.listeners('unhandledRejection');\n var r = originalInstall.apply(this, arguments);\n process.removeAllListeners('unhandledRejection');\n if (originalHandlers) {\n originalHandlers.forEach(function (h) { return process.on('unhandledRejection', h); });\n }\n return r;\n };\n }\n return instance;\n };\n }\n }\n // Monkey patch all of the jasmine DSL so that each function runs in appropriate zone.\n var jasmineEnv = jasmine.getEnv();\n ['describe', 'xdescribe', 'fdescribe'].forEach(function (methodName) {\n var originalJasmineFn = jasmineEnv[methodName];\n jasmineEnv[methodName] = function (description, specDefinitions) {\n return originalJasmineFn.call(this, description, wrapDescribeInZone(specDefinitions));\n };\n });\n ['it', 'xit', 'fit'].forEach(function (methodName) {\n var originalJasmineFn = jasmineEnv[methodName];\n jasmineEnv[symbol(methodName)] = originalJasmineFn;\n jasmineEnv[methodName] = function (description, specDefinitions, timeout) {\n arguments[1] = wrapTestInZone(specDefinitions);\n return originalJasmineFn.apply(this, arguments);\n };\n });\n ['beforeEach', 'afterEach', 'beforeAll', 'afterAll'].forEach(function (methodName) {\n var originalJasmineFn = jasmineEnv[methodName];\n jasmineEnv[symbol(methodName)] = originalJasmineFn;\n jasmineEnv[methodName] = function (specDefinitions, timeout) {\n arguments[0] = wrapTestInZone(specDefinitions);\n return originalJasmineFn.apply(this, arguments);\n };\n });\n if (!disablePatchingJasmineClock) {\n // need to patch jasmine.clock().mockDate and jasmine.clock().tick() so\n // they can work properly in FakeAsyncTest\n var originalClockFn_1 = (jasmine[symbol('clock')] = jasmine['clock']);\n jasmine['clock'] = function () {\n var clock = originalClockFn_1.apply(this, arguments);\n if (!clock[symbol('patched')]) {\n clock[symbol('patched')] = symbol('patched');\n var originalTick_1 = (clock[symbol('tick')] = clock.tick);\n clock.tick = function () {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n return fakeAsyncZoneSpec.tick.apply(fakeAsyncZoneSpec, arguments);\n }\n return originalTick_1.apply(this, arguments);\n };\n var originalMockDate_1 = (clock[symbol('mockDate')] = clock.mockDate);\n clock.mockDate = function () {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n var dateTime = arguments.length > 0 ? arguments[0] : new Date();\n return fakeAsyncZoneSpec.setFakeBaseSystemTime.apply(fakeAsyncZoneSpec, dateTime && typeof dateTime.getTime === 'function' ? [dateTime.getTime()] :\n arguments);\n }\n return originalMockDate_1.apply(this, arguments);\n };\n // for auto go into fakeAsync feature, we need the flag to enable it\n if (enableAutoFakeAsyncWhenClockPatched) {\n ['install', 'uninstall'].forEach(function (methodName) {\n var originalClockFn = (clock[symbol(methodName)] = clock[methodName]);\n clock[methodName] = function () {\n var FakeAsyncTestZoneSpec = Zone['FakeAsyncTestZoneSpec'];\n if (FakeAsyncTestZoneSpec) {\n jasmine[symbol('clockInstalled')] = 'install' === methodName;\n return;\n }\n return originalClockFn.apply(this, arguments);\n };\n });\n }\n }\n return clock;\n };\n }\n // monkey patch createSpyObj to make properties enumerable to true\n if (!jasmine[Zone.__symbol__('createSpyObj')]) {\n var originalCreateSpyObj_1 = jasmine.createSpyObj;\n jasmine[Zone.__symbol__('createSpyObj')] = originalCreateSpyObj_1;\n jasmine.createSpyObj = function () {\n var args = Array.prototype.slice.call(arguments);\n var propertyNames = args.length >= 3 ? args[2] : null;\n var spyObj;\n if (propertyNames) {\n var defineProperty_1 = Object.defineProperty;\n Object.defineProperty = function (obj, p, attributes) {\n return defineProperty_1.call(this, obj, p, Object.assign(Object.assign({}, attributes), { configurable: true, enumerable: true }));\n };\n try {\n spyObj = originalCreateSpyObj_1.apply(this, args);\n }\n finally {\n Object.defineProperty = defineProperty_1;\n }\n }\n else {\n spyObj = originalCreateSpyObj_1.apply(this, args);\n }\n return spyObj;\n };\n }\n /**\n * Gets a function wrapping the body of a Jasmine `describe` block to execute in a\n * synchronous-only zone.\n */\n function wrapDescribeInZone(describeBody) {\n return function () {\n return syncZone.run(describeBody, this, arguments);\n };\n }\n function runInTestZone(testBody, applyThis, queueRunner, done) {\n var isClockInstalled = !!jasmine[symbol('clockInstalled')];\n var testProxyZoneSpec = queueRunner.testProxyZoneSpec;\n var testProxyZone = queueRunner.testProxyZone;\n if (isClockInstalled && enableAutoFakeAsyncWhenClockPatched) {\n // auto run a fakeAsync\n var fakeAsyncModule = Zone[Zone.__symbol__('fakeAsyncTest')];\n if (fakeAsyncModule && typeof fakeAsyncModule.fakeAsync === 'function') {\n testBody = fakeAsyncModule.fakeAsync(testBody);\n }\n }\n if (done) {\n return testProxyZone.run(testBody, applyThis, [done]);\n }\n else {\n return testProxyZone.run(testBody, applyThis);\n }\n }\n /**\n * Gets a function wrapping the body of a Jasmine `it/beforeEach/afterEach` block to\n * execute in a ProxyZone zone.\n * This will run in `testProxyZone`. The `testProxyZone` will be reset by the `ZoneQueueRunner`\n */\n function wrapTestInZone(testBody) {\n // The `done` callback is only passed through if the function expects at least one argument.\n // Note we have to make a function with correct number of arguments, otherwise jasmine will\n // think that all functions are sync or async.\n return (testBody && (testBody.length ? function (done) {\n return runInTestZone(testBody, this, this.queueRunner, done);\n } : function () {\n return runInTestZone(testBody, this, this.queueRunner);\n }));\n }\n var QueueRunner = jasmine.QueueRunner;\n jasmine.QueueRunner = (function (_super) {\n __extends(ZoneQueueRunner, _super);\n function ZoneQueueRunner(attrs) {\n var _this = this;\n if (attrs.onComplete) {\n attrs.onComplete = (function (fn) { return function () {\n // All functions are done, clear the test zone.\n _this.testProxyZone = null;\n _this.testProxyZoneSpec = null;\n ambientZone.scheduleMicroTask('jasmine.onComplete', fn);\n }; })(attrs.onComplete);\n }\n var nativeSetTimeout = global[Zone.__symbol__('setTimeout')];\n var nativeClearTimeout = global[Zone.__symbol__('clearTimeout')];\n if (nativeSetTimeout) {\n // should run setTimeout inside jasmine outside of zone\n attrs.timeout = {\n setTimeout: nativeSetTimeout ? nativeSetTimeout : global.setTimeout,\n clearTimeout: nativeClearTimeout ? nativeClearTimeout : global.clearTimeout\n };\n }\n // create a userContext to hold the queueRunner itself\n // so we can access the testProxy in it/xit/beforeEach ...\n if (jasmine.UserContext) {\n if (!attrs.userContext) {\n attrs.userContext = new jasmine.UserContext();\n }\n attrs.userContext.queueRunner = this;\n }\n else {\n if (!attrs.userContext) {\n attrs.userContext = {};\n }\n attrs.userContext.queueRunner = this;\n }\n // patch attrs.onException\n var onException = attrs.onException;\n attrs.onException = function (error) {\n if (error &&\n error.message ===\n 'Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.') {\n // jasmine timeout, we can make the error message more\n // reasonable to tell what tasks are pending\n var proxyZoneSpec = this && this.testProxyZoneSpec;\n if (proxyZoneSpec) {\n var pendingTasksInfo = proxyZoneSpec.getAndClearPendingTasksInfo();\n try {\n // try catch here in case error.message is not writable\n error.message += pendingTasksInfo;\n }\n catch (err) {\n }\n }\n }\n if (onException) {\n onException.call(this, error);\n }\n };\n _super.call(this, attrs);\n }\n ZoneQueueRunner.prototype.execute = function () {\n var _this = this;\n var zone = Zone.current;\n var isChildOfAmbientZone = false;\n while (zone) {\n if (zone === ambientZone) {\n isChildOfAmbientZone = true;\n break;\n }\n zone = zone.parent;\n }\n if (!isChildOfAmbientZone)\n throw new Error('Unexpected Zone: ' + Zone.current.name);\n // This is the zone which will be used for running individual tests.\n // It will be a proxy zone, so that the tests function can retroactively install\n // different zones.\n // Example:\n // - In beforeEach() do childZone = Zone.current.fork(...);\n // - In it() try to do fakeAsync(). The issue is that because the beforeEach forked the\n // zone outside of fakeAsync it will be able to escape the fakeAsync rules.\n // - Because ProxyZone is parent fo `childZone` fakeAsync can retroactively add\n // fakeAsync behavior to the childZone.\n this.testProxyZoneSpec = new ProxyZoneSpec();\n this.testProxyZone = ambientZone.fork(this.testProxyZoneSpec);\n if (!Zone.currentTask) {\n // if we are not running in a task then if someone would register a\n // element.addEventListener and then calling element.click() the\n // addEventListener callback would think that it is the top most task and would\n // drain the microtask queue on element.click() which would be incorrect.\n // For this reason we always force a task when running jasmine tests.\n Zone.current.scheduleMicroTask('jasmine.execute().forceTask', function () { return QueueRunner.prototype.execute.call(_this); });\n }\n else {\n _super.prototype.execute.call(this);\n }\n };\n return ZoneQueueRunner;\n })(QueueRunner);\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 Zone.__load_patch('jest', function (context, Zone, api) {\n if (typeof jest === 'undefined' || jest['__zone_patch__']) {\n return;\n }\n jest['__zone_patch__'] = true;\n var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n var SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n if (!ProxyZoneSpec) {\n throw new Error('Missing ProxyZoneSpec');\n }\n var rootZone = Zone.current;\n var syncZone = rootZone.fork(new SyncTestZoneSpec('jest.describe'));\n var proxyZoneSpec = new ProxyZoneSpec();\n var proxyZone = rootZone.fork(proxyZoneSpec);\n function wrapDescribeFactoryInZone(originalJestFn) {\n return function () {\n var tableArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n tableArgs[_i] = arguments[_i];\n }\n var originalDescribeFn = originalJestFn.apply(this, tableArgs);\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[1] = wrapDescribeInZone(args[1]);\n return originalDescribeFn.apply(this, args);\n };\n };\n }\n function wrapTestFactoryInZone(originalJestFn) {\n return function () {\n var tableArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n tableArgs[_i] = arguments[_i];\n }\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[1] = wrapTestInZone(args[1]);\n return originalJestFn.apply(this, tableArgs).apply(this, args);\n };\n };\n }\n /**\n * Gets a function wrapping the body of a jest `describe` block to execute in a\n * synchronous-only zone.\n */\n function wrapDescribeInZone(describeBody) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return syncZone.run(describeBody, this, args);\n };\n }\n /**\n * Gets a function wrapping the body of a jest `it/beforeEach/afterEach` block to\n * execute in a ProxyZone zone.\n * This will run in the `proxyZone`.\n */\n function wrapTestInZone(testBody, isTestFunc) {\n if (isTestFunc === void 0) { isTestFunc = false; }\n if (typeof testBody !== 'function') {\n return testBody;\n }\n var wrappedFunc = function () {\n if (Zone[api.symbol('useFakeTimersCalled')] === true && testBody &&\n !testBody.isFakeAsync) {\n // jest.useFakeTimers is called, run into fakeAsyncTest automatically.\n var fakeAsyncModule = Zone[Zone.__symbol__('fakeAsyncTest')];\n if (fakeAsyncModule && typeof fakeAsyncModule.fakeAsync === 'function') {\n testBody = fakeAsyncModule.fakeAsync(testBody);\n }\n }\n proxyZoneSpec.isTestFunc = isTestFunc;\n return proxyZone.run(testBody, null, arguments);\n };\n // Update the length of wrappedFunc to be the same as the length of the testBody\n // So jest core can handle whether the test function has `done()` or not correctly\n Object.defineProperty(wrappedFunc, 'length', { configurable: true, writable: true, enumerable: false });\n wrappedFunc.length = testBody.length;\n return wrappedFunc;\n }\n ['describe', 'xdescribe', 'fdescribe'].forEach(function (methodName) {\n var originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[1] = wrapDescribeInZone(args[1]);\n return originalJestFn.apply(this, args);\n };\n context[methodName].each = wrapDescribeFactoryInZone(originalJestFn.each);\n });\n context.describe.only = context.fdescribe;\n context.describe.skip = context.xdescribe;\n ['it', 'xit', 'fit', 'test', 'xtest'].forEach(function (methodName) {\n var originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[1] = wrapTestInZone(args[1], true);\n return originalJestFn.apply(this, args);\n };\n context[methodName].each = wrapTestFactoryInZone(originalJestFn.each);\n context[methodName].todo = originalJestFn.todo;\n });\n context.it.only = context.fit;\n context.it.skip = context.xit;\n context.test.only = context.fit;\n context.test.skip = context.xit;\n ['beforeEach', 'afterEach', 'beforeAll', 'afterAll'].forEach(function (methodName) {\n var originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n args[0] = wrapTestInZone(args[0]);\n return originalJestFn.apply(this, args);\n };\n });\n Zone.patchJestObject = function patchJestObject(Timer, isModern) {\n if (isModern === void 0) { isModern = false; }\n // check whether currently the test is inside fakeAsync()\n function isPatchingFakeTimer() {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n return !!fakeAsyncZoneSpec;\n }\n // check whether the current function is inside `test/it` or other methods\n // such as `describe/beforeEach`\n function isInTestFunc() {\n var proxyZoneSpec = Zone.current.get('ProxyZoneSpec');\n return proxyZoneSpec && proxyZoneSpec.isTestFunc;\n }\n if (Timer[api.symbol('fakeTimers')]) {\n return;\n }\n Timer[api.symbol('fakeTimers')] = true;\n // patch jest fakeTimer internal method to make sure no console.warn print out\n api.patchMethod(Timer, '_checkFakeTimers', function (delegate) {\n return function (self, args) {\n if (isPatchingFakeTimer()) {\n return true;\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch useFakeTimers(), set useFakeTimersCalled flag, and make test auto run into fakeAsync\n api.patchMethod(Timer, 'useFakeTimers', function (delegate) {\n return function (self, args) {\n Zone[api.symbol('useFakeTimersCalled')] = true;\n if (isModern || isInTestFunc()) {\n return delegate.apply(self, args);\n }\n return self;\n };\n });\n // patch useRealTimers(), unset useFakeTimers flag\n api.patchMethod(Timer, 'useRealTimers', function (delegate) {\n return function (self, args) {\n Zone[api.symbol('useFakeTimersCalled')] = false;\n if (isModern || isInTestFunc()) {\n return delegate.apply(self, args);\n }\n return self;\n };\n });\n // patch setSystemTime(), call setCurrentRealTime() in the fakeAsyncTest\n api.patchMethod(Timer, 'setSystemTime', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec && isPatchingFakeTimer()) {\n fakeAsyncZoneSpec.setFakeBaseSystemTime(args[0]);\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch getSystemTime(), call getCurrentRealTime() in the fakeAsyncTest\n api.patchMethod(Timer, 'getRealSystemTime', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec && isPatchingFakeTimer()) {\n return fakeAsyncZoneSpec.getRealSystemTime();\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch runAllTicks(), run all microTasks inside fakeAsync\n api.patchMethod(Timer, 'runAllTicks', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.flushMicrotasks();\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch runAllTimers(), run all macroTasks inside fakeAsync\n api.patchMethod(Timer, 'runAllTimers', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.flush(100, true);\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch advanceTimersByTime(), call tick() in the fakeAsyncTest\n api.patchMethod(Timer, 'advanceTimersByTime', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.tick(args[0]);\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch runOnlyPendingTimers(), call flushOnlyPendingTimers() in the fakeAsyncTest\n api.patchMethod(Timer, 'runOnlyPendingTimers', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.flushOnlyPendingTimers();\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch advanceTimersToNextTimer(), call tickToNext() in the fakeAsyncTest\n api.patchMethod(Timer, 'advanceTimersToNextTimer', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.tickToNext(args[0]);\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch clearAllTimers(), call removeAllTimers() in the fakeAsyncTest\n api.patchMethod(Timer, 'clearAllTimers', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n fakeAsyncZoneSpec.removeAllTimers();\n }\n else {\n return delegate.apply(self, args);\n }\n };\n });\n // patch getTimerCount(), call getTimerCount() in the fakeAsyncTest\n api.patchMethod(Timer, 'getTimerCount', function (delegate) {\n return function (self, args) {\n var fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n return fakeAsyncZoneSpec.getTimerCount();\n }\n else {\n return delegate.apply(self, args);\n }\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 Zone.__load_patch('mocha', function (global, Zone) {\n var Mocha = global.Mocha;\n if (typeof Mocha === 'undefined') {\n // return if Mocha is not available, because now zone-testing\n // will load mocha patch with jasmine/jest patch\n return;\n }\n if (typeof Zone === 'undefined') {\n throw new Error('Missing Zone.js');\n }\n var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n var SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n if (!ProxyZoneSpec) {\n throw new Error('Missing ProxyZoneSpec');\n }\n if (Mocha['__zone_patch__']) {\n throw new Error('\"Mocha\" has already been patched with \"Zone\".');\n }\n Mocha['__zone_patch__'] = true;\n var rootZone = Zone.current;\n var syncZone = rootZone.fork(new SyncTestZoneSpec('Mocha.describe'));\n var testZone = null;\n var suiteZone = rootZone.fork(new ProxyZoneSpec());\n var mochaOriginal = {\n after: Mocha.after,\n afterEach: Mocha.afterEach,\n before: Mocha.before,\n beforeEach: Mocha.beforeEach,\n describe: Mocha.describe,\n it: Mocha.it\n };\n function modifyArguments(args, syncTest, asyncTest) {\n var _loop_1 = function (i) {\n var arg = args[i];\n if (typeof arg === 'function') {\n // The `done` callback is only passed through if the function expects at\n // least one argument.\n // Note we have to make a function with correct number of arguments,\n // otherwise mocha will\n // think that all functions are sync or async.\n args[i] = (arg.length === 0) ? syncTest(arg) : asyncTest(arg);\n // Mocha uses toString to view the test body in the result list, make sure we return the\n // correct function body\n args[i].toString = function () {\n return arg.toString();\n };\n }\n };\n for (var i = 0; i < args.length; i++) {\n _loop_1(i);\n }\n return args;\n }\n function wrapDescribeInZone(args) {\n var syncTest = function (fn) {\n return function () {\n return syncZone.run(fn, this, arguments);\n };\n };\n return modifyArguments(args, syncTest);\n }\n function wrapTestInZone(args) {\n var asyncTest = function (fn) {\n return function (done) {\n return testZone.run(fn, this, [done]);\n };\n };\n var syncTest = function (fn) {\n return function () {\n return testZone.run(fn, this);\n };\n };\n return modifyArguments(args, syncTest, asyncTest);\n }\n function wrapSuiteInZone(args) {\n var asyncTest = function (fn) {\n return function (done) {\n return suiteZone.run(fn, this, [done]);\n };\n };\n var syncTest = function (fn) {\n return function () {\n return suiteZone.run(fn, this);\n };\n };\n return modifyArguments(args, syncTest, asyncTest);\n }\n global.describe = global.suite = Mocha.describe = function () {\n return mochaOriginal.describe.apply(this, wrapDescribeInZone(arguments));\n };\n global.xdescribe = global.suite.skip = Mocha.describe.skip = function () {\n return mochaOriginal.describe.skip.apply(this, wrapDescribeInZone(arguments));\n };\n global.describe.only = global.suite.only = Mocha.describe.only = function () {\n return mochaOriginal.describe.only.apply(this, wrapDescribeInZone(arguments));\n };\n global.it = global.specify = global.test = Mocha.it = function () {\n return mochaOriginal.it.apply(this, wrapTestInZone(arguments));\n };\n global.xit = global.xspecify = Mocha.it.skip = function () {\n return mochaOriginal.it.skip.apply(this, wrapTestInZone(arguments));\n };\n global.it.only = global.test.only = Mocha.it.only = function () {\n return mochaOriginal.it.only.apply(this, wrapTestInZone(arguments));\n };\n global.after = global.suiteTeardown = Mocha.after = function () {\n return mochaOriginal.after.apply(this, wrapSuiteInZone(arguments));\n };\n global.afterEach = global.teardown = Mocha.afterEach = function () {\n return mochaOriginal.afterEach.apply(this, wrapTestInZone(arguments));\n };\n global.before = global.suiteSetup = Mocha.before = function () {\n return mochaOriginal.before.apply(this, wrapSuiteInZone(arguments));\n };\n global.beforeEach = global.setup = Mocha.beforeEach = function () {\n return mochaOriginal.beforeEach.apply(this, wrapTestInZone(arguments));\n };\n (function (originalRunTest, originalRun) {\n Mocha.Runner.prototype.runTest = function (fn) {\n var _this = this;\n Zone.current.scheduleMicroTask('mocha.forceTask', function () {\n originalRunTest.call(_this, fn);\n });\n };\n Mocha.Runner.prototype.run = function (fn) {\n this.on('test', function (e) {\n testZone = rootZone.fork(new ProxyZoneSpec());\n });\n this.on('fail', function (test, err) {\n var proxyZoneSpec = testZone && testZone.get('ProxyZoneSpec');\n if (proxyZoneSpec && err) {\n try {\n // try catch here in case err.message is not writable\n err.message += proxyZoneSpec.getAndClearPendingTasksInfo();\n }\n catch (error) {\n }\n }\n });\n return originalRun.call(this, fn);\n };\n })(Mocha.Runner.prototype.runTest, Mocha.Runner.prototype.run);\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 (function (_global) {\n var AsyncTestZoneSpec = /** @class */ (function () {\n function AsyncTestZoneSpec(finishCallback, failCallback, namePrefix) {\n this.finishCallback = finishCallback;\n this.failCallback = failCallback;\n this._pendingMicroTasks = false;\n this._pendingMacroTasks = false;\n this._alreadyErrored = false;\n this._isSync = false;\n this.runZone = Zone.current;\n this.unresolvedChainedPromiseCount = 0;\n this.supportWaitUnresolvedChainedPromise = false;\n this.name = 'asyncTestZone for ' + namePrefix;\n this.properties = { 'AsyncTestZoneSpec': this };\n this.supportWaitUnresolvedChainedPromise =\n _global[Zone.__symbol__('supportWaitUnResolvedChainedPromise')] === true;\n }\n AsyncTestZoneSpec.prototype.isUnresolvedChainedPromisePending = function () {\n return this.unresolvedChainedPromiseCount > 0;\n };\n AsyncTestZoneSpec.prototype._finishCallbackIfDone = function () {\n var _this = this;\n if (!(this._pendingMicroTasks || this._pendingMacroTasks ||\n (this.supportWaitUnresolvedChainedPromise && this.isUnresolvedChainedPromisePending()))) {\n // We do this because we would like to catch unhandled rejected promises.\n this.runZone.run(function () {\n setTimeout(function () {\n if (!_this._alreadyErrored && !(_this._pendingMicroTasks || _this._pendingMacroTasks)) {\n _this.finishCallback();\n }\n }, 0);\n });\n }\n };\n AsyncTestZoneSpec.prototype.patchPromiseForTest = function () {\n if (!this.supportWaitUnresolvedChainedPromise) {\n return;\n }\n var patchPromiseForTest = Promise[Zone.__symbol__('patchPromiseForTest')];\n if (patchPromiseForTest) {\n patchPromiseForTest();\n }\n };\n AsyncTestZoneSpec.prototype.unPatchPromiseForTest = function () {\n if (!this.supportWaitUnresolvedChainedPromise) {\n return;\n }\n var unPatchPromiseForTest = Promise[Zone.__symbol__('unPatchPromiseForTest')];\n if (unPatchPromiseForTest) {\n unPatchPromiseForTest();\n }\n };\n AsyncTestZoneSpec.prototype.onScheduleTask = function (delegate, current, target, task) {\n if (task.type !== 'eventTask') {\n this._isSync = false;\n }\n if (task.type === 'microTask' && task.data && task.data instanceof Promise) {\n // check whether the promise is a chained promise\n if (task.data[AsyncTestZoneSpec.symbolParentUnresolved] === true) {\n // chained promise is being scheduled\n this.unresolvedChainedPromiseCount--;\n }\n }\n return delegate.scheduleTask(target, task);\n };\n AsyncTestZoneSpec.prototype.onInvokeTask = function (delegate, current, target, task, applyThis, applyArgs) {\n if (task.type !== 'eventTask') {\n this._isSync = false;\n }\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n };\n AsyncTestZoneSpec.prototype.onCancelTask = function (delegate, current, target, task) {\n if (task.type !== 'eventTask') {\n this._isSync = false;\n }\n return delegate.cancelTask(target, task);\n };\n // Note - we need to use onInvoke at the moment to call finish when a test is\n // fully synchronous. TODO(juliemr): remove this when the logic for\n // onHasTask changes and it calls whenever the task queues are dirty.\n // updated by(JiaLiPassion), only call finish callback when no task\n // was scheduled/invoked/canceled.\n AsyncTestZoneSpec.prototype.onInvoke = function (parentZoneDelegate, currentZone, targetZone, delegate, applyThis, applyArgs, source) {\n try {\n this._isSync = true;\n return parentZoneDelegate.invoke(targetZone, delegate, applyThis, applyArgs, source);\n }\n finally {\n var afterTaskCounts = parentZoneDelegate._taskCounts;\n if (this._isSync) {\n this._finishCallbackIfDone();\n }\n }\n };\n AsyncTestZoneSpec.prototype.onHandleError = function (parentZoneDelegate, currentZone, targetZone, error) {\n // Let the parent try to handle the error.\n var result = parentZoneDelegate.handleError(targetZone, error);\n if (result) {\n this.failCallback(error);\n this._alreadyErrored = true;\n }\n return false;\n };\n AsyncTestZoneSpec.prototype.onHasTask = function (delegate, current, target, hasTaskState) {\n delegate.hasTask(target, hasTaskState);\n if (hasTaskState.change == 'microTask') {\n this._pendingMicroTasks = hasTaskState.microTask;\n this._finishCallbackIfDone();\n }\n else if (hasTaskState.change == 'macroTask') {\n this._pendingMacroTasks = hasTaskState.macroTask;\n this._finishCallbackIfDone();\n }\n };\n return AsyncTestZoneSpec;\n }());\n AsyncTestZoneSpec.symbolParentUnresolved = Zone.__symbol__('parentUnresolved');\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['AsyncTestZoneSpec'] = AsyncTestZoneSpec;\n })(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);\n Zone.__load_patch('asynctest', function (global, Zone, api) {\n /**\n * Wraps a test function in an asynchronous test zone. The test will automatically\n * complete when all asynchronous calls within this zone are done.\n */\n Zone[api.symbol('asyncTest')] = function asyncTest(fn) {\n // If we're running using the Jasmine test framework, adapt to call the 'done'\n // function when asynchronous activity is finished.\n if (global.jasmine) {\n // Not using an arrow function to preserve context passed from call site\n return function (done) {\n if (!done) {\n // if we run beforeEach in @angular/core/testing/testing_internal then we get no done\n // fake it here and assume sync.\n done = function () { };\n done.fail = function (e) {\n throw e;\n };\n }\n runInTestZone(fn, this, done, function (err) {\n if (typeof err === 'string') {\n return done.fail(new Error(err));\n }\n else {\n done.fail(err);\n }\n });\n };\n }\n // Otherwise, return a promise which will resolve when asynchronous activity\n // is finished. This will be correctly consumed by the Mocha framework with\n // it('...', async(myFn)); or can be used in a custom framework.\n // Not using an arrow function to preserve context passed from call site\n return function () {\n var _this = this;\n return new Promise(function (finishCallback, failCallback) {\n runInTestZone(fn, _this, finishCallback, failCallback);\n });\n };\n };\n function runInTestZone(fn, context, finishCallback, failCallback) {\n var currentZone = Zone.current;\n var AsyncTestZoneSpec = Zone['AsyncTestZoneSpec'];\n if (AsyncTestZoneSpec === undefined) {\n throw new Error('AsyncTestZoneSpec is needed for the async() test helper but could not be found. ' +\n 'Please make sure that your environment includes zone.js/dist/async-test.js');\n }\n var ProxyZoneSpec = Zone['ProxyZoneSpec'];\n if (!ProxyZoneSpec) {\n throw new Error('ProxyZoneSpec is needed for the async() test helper but could not be found. ' +\n 'Please make sure that your environment includes zone.js/dist/proxy.js');\n }\n var proxyZoneSpec = ProxyZoneSpec.get();\n ProxyZoneSpec.assertPresent();\n // We need to create the AsyncTestZoneSpec outside the ProxyZone.\n // If we do it in ProxyZone then we will get to infinite recursion.\n var proxyZone = Zone.current.getZoneWith('ProxyZoneSpec');\n var previousDelegate = proxyZoneSpec.getDelegate();\n proxyZone.parent.run(function () {\n var testZoneSpec = new AsyncTestZoneSpec(function () {\n // Need to restore the original zone.\n if (proxyZoneSpec.getDelegate() == testZoneSpec) {\n // Only reset the zone spec if it's\n // sill this one. Otherwise, assume\n // it's OK.\n proxyZoneSpec.setDelegate(previousDelegate);\n }\n testZoneSpec.unPatchPromiseForTest();\n currentZone.run(function () {\n finishCallback();\n });\n }, function (error) {\n // Need to restore the original zone.\n if (proxyZoneSpec.getDelegate() == testZoneSpec) {\n // Only reset the zone spec if it's sill this one. Otherwise, assume it's OK.\n proxyZoneSpec.setDelegate(previousDelegate);\n }\n testZoneSpec.unPatchPromiseForTest();\n currentZone.run(function () {\n failCallback(error);\n });\n }, 'test');\n proxyZoneSpec.setDelegate(testZoneSpec);\n testZoneSpec.patchPromiseForTest();\n });\n return Zone.current.runGuarded(fn, context);\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 (function (global) {\n var OriginalDate = global.Date;\n // Since when we compile this file to `es2015`, and if we define\n // this `FakeDate` as `class FakeDate`, and then set `FakeDate.prototype`\n // there will be an error which is `Cannot assign to read only property 'prototype'`\n // so we need to use function implementation here.\n function FakeDate() {\n if (arguments.length === 0) {\n var d = new OriginalDate();\n d.setTime(FakeDate.now());\n return d;\n }\n else {\n var args = Array.prototype.slice.call(arguments);\n return new (OriginalDate.bind.apply(OriginalDate, __spreadArrays([void 0], args)))();\n }\n }\n FakeDate.now = function () {\n var fakeAsyncTestZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncTestZoneSpec) {\n return fakeAsyncTestZoneSpec.getFakeSystemTime();\n }\n return OriginalDate.now.apply(this, arguments);\n };\n FakeDate.UTC = OriginalDate.UTC;\n FakeDate.parse = OriginalDate.parse;\n // keep a reference for zone patched timer function\n var timers = {\n setTimeout: global.setTimeout,\n setInterval: global.setInterval,\n clearTimeout: global.clearTimeout,\n clearInterval: global.clearInterval\n };\n var Scheduler = /** @class */ (function () {\n function Scheduler() {\n // Scheduler queue with the tuple of end time and callback function - sorted by end time.\n this._schedulerQueue = [];\n // Current simulated time in millis.\n this._currentTickTime = 0;\n // Current fake system base time in millis.\n this._currentFakeBaseSystemTime = OriginalDate.now();\n // track requeuePeriodicTimer\n this._currentTickRequeuePeriodicEntries = [];\n }\n Scheduler.prototype.getCurrentTickTime = function () {\n return this._currentTickTime;\n };\n Scheduler.prototype.getFakeSystemTime = function () {\n return this._currentFakeBaseSystemTime + this._currentTickTime;\n };\n Scheduler.prototype.setFakeBaseSystemTime = function (fakeBaseSystemTime) {\n this._currentFakeBaseSystemTime = fakeBaseSystemTime;\n };\n Scheduler.prototype.getRealSystemTime = function () {\n return OriginalDate.now();\n };\n Scheduler.prototype.scheduleFunction = function (cb, delay, options) {\n options = Object.assign({\n args: [],\n isPeriodic: false,\n isRequestAnimationFrame: false,\n id: -1,\n isRequeuePeriodic: false\n }, options);\n var currentId = options.id < 0 ? Scheduler.nextId++ : options.id;\n var endTime = this._currentTickTime + delay;\n // Insert so that scheduler queue remains sorted by end time.\n var newEntry = {\n endTime: endTime,\n id: currentId,\n func: cb,\n args: options.args,\n delay: delay,\n isPeriodic: options.isPeriodic,\n isRequestAnimationFrame: options.isRequestAnimationFrame\n };\n if (options.isRequeuePeriodic) {\n this._currentTickRequeuePeriodicEntries.push(newEntry);\n }\n var i = 0;\n for (; i < this._schedulerQueue.length; i++) {\n var currentEntry = this._schedulerQueue[i];\n if (newEntry.endTime < currentEntry.endTime) {\n break;\n }\n }\n this._schedulerQueue.splice(i, 0, newEntry);\n return currentId;\n };\n Scheduler.prototype.removeScheduledFunctionWithId = function (id) {\n for (var i = 0; i < this._schedulerQueue.length; i++) {\n if (this._schedulerQueue[i].id == id) {\n this._schedulerQueue.splice(i, 1);\n break;\n }\n }\n };\n Scheduler.prototype.removeAll = function () {\n this._schedulerQueue = [];\n };\n Scheduler.prototype.getTimerCount = function () {\n return this._schedulerQueue.length;\n };\n Scheduler.prototype.tickToNext = function (step, doTick, tickOptions) {\n if (step === void 0) { step = 1; }\n if (this._schedulerQueue.length < step) {\n return;\n }\n // Find the last task currently queued in the scheduler queue and tick\n // till that time.\n var startTime = this._currentTickTime;\n var targetTask = this._schedulerQueue[step - 1];\n this.tick(targetTask.endTime - startTime, doTick, tickOptions);\n };\n Scheduler.prototype.tick = function (millis, doTick, tickOptions) {\n if (millis === void 0) { millis = 0; }\n var finalTime = this._currentTickTime + millis;\n var lastCurrentTime = 0;\n tickOptions = Object.assign({ processNewMacroTasksSynchronously: true }, tickOptions);\n // we need to copy the schedulerQueue so nested timeout\n // will not be wrongly called in the current tick\n // https://github.com/angular/angular/issues/33799\n var schedulerQueue = tickOptions.processNewMacroTasksSynchronously ?\n this._schedulerQueue :\n this._schedulerQueue.slice();\n if (schedulerQueue.length === 0 && doTick) {\n doTick(millis);\n return;\n }\n while (schedulerQueue.length > 0) {\n // clear requeueEntries before each loop\n this._currentTickRequeuePeriodicEntries = [];\n var current = schedulerQueue[0];\n if (finalTime < current.endTime) {\n // Done processing the queue since it's sorted by endTime.\n break;\n }\n else {\n // Time to run scheduled function. Remove it from the head of queue.\n var current_1 = schedulerQueue.shift();\n if (!tickOptions.processNewMacroTasksSynchronously) {\n var idx = this._schedulerQueue.indexOf(current_1);\n if (idx >= 0) {\n this._schedulerQueue.splice(idx, 1);\n }\n }\n lastCurrentTime = this._currentTickTime;\n this._currentTickTime = current_1.endTime;\n if (doTick) {\n doTick(this._currentTickTime - lastCurrentTime);\n }\n var retval = current_1.func.apply(global, current_1.isRequestAnimationFrame ? [this._currentTickTime] : current_1.args);\n if (!retval) {\n // Uncaught exception in the current scheduled function. Stop processing the queue.\n break;\n }\n // check is there any requeue periodic entry is added in\n // current loop, if there is, we need to add to current loop\n if (!tickOptions.processNewMacroTasksSynchronously) {\n this._currentTickRequeuePeriodicEntries.forEach(function (newEntry) {\n var i = 0;\n for (; i < schedulerQueue.length; i++) {\n var currentEntry = schedulerQueue[i];\n if (newEntry.endTime < currentEntry.endTime) {\n break;\n }\n }\n schedulerQueue.splice(i, 0, newEntry);\n });\n }\n }\n }\n lastCurrentTime = this._currentTickTime;\n this._currentTickTime = finalTime;\n if (doTick) {\n doTick(this._currentTickTime - lastCurrentTime);\n }\n };\n Scheduler.prototype.flushOnlyPendingTimers = function (doTick) {\n if (this._schedulerQueue.length === 0) {\n return 0;\n }\n // Find the last task currently queued in the scheduler queue and tick\n // till that time.\n var startTime = this._currentTickTime;\n var lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];\n this.tick(lastTask.endTime - startTime, doTick, { processNewMacroTasksSynchronously: false });\n return this._currentTickTime - startTime;\n };\n Scheduler.prototype.flush = function (limit, flushPeriodic, doTick) {\n if (limit === void 0) { limit = 20; }\n if (flushPeriodic === void 0) { flushPeriodic = false; }\n if (flushPeriodic) {\n return this.flushPeriodic(doTick);\n }\n else {\n return this.flushNonPeriodic(limit, doTick);\n }\n };\n Scheduler.prototype.flushPeriodic = function (doTick) {\n if (this._schedulerQueue.length === 0) {\n return 0;\n }\n // Find the last task currently queued in the scheduler queue and tick\n // till that time.\n var startTime = this._currentTickTime;\n var lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];\n this.tick(lastTask.endTime - startTime, doTick);\n return this._currentTickTime - startTime;\n };\n Scheduler.prototype.flushNonPeriodic = function (limit, doTick) {\n var startTime = this._currentTickTime;\n var lastCurrentTime = 0;\n var count = 0;\n while (this._schedulerQueue.length > 0) {\n count++;\n if (count > limit) {\n throw new Error('flush failed after reaching the limit of ' + limit +\n ' tasks. Does your code use a polling timeout?');\n }\n // flush only non-periodic timers.\n // If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing.\n if (this._schedulerQueue.filter(function (task) { return !task.isPeriodic && !task.isRequestAnimationFrame; })\n .length === 0) {\n break;\n }\n var current = this._schedulerQueue.shift();\n lastCurrentTime = this._currentTickTime;\n this._currentTickTime = current.endTime;\n if (doTick) {\n // Update any secondary schedulers like Jasmine mock Date.\n doTick(this._currentTickTime - lastCurrentTime);\n }\n var retval = current.func.apply(global, current.args);\n if (!retval) {\n // Uncaught exception in the current scheduled function. Stop processing the queue.\n break;\n }\n }\n return this._currentTickTime - startTime;\n };\n return Scheduler;\n }());\n // Next scheduler id.\n Scheduler.nextId = 1;\n var FakeAsyncTestZoneSpec = /** @class */ (function () {\n function FakeAsyncTestZoneSpec(namePrefix, trackPendingRequestAnimationFrame, macroTaskOptions) {\n if (trackPendingRequestAnimationFrame === void 0) { trackPendingRequestAnimationFrame = false; }\n this.trackPendingRequestAnimationFrame = trackPendingRequestAnimationFrame;\n this.macroTaskOptions = macroTaskOptions;\n this._scheduler = new Scheduler();\n this._microtasks = [];\n this._lastError = null;\n this._uncaughtPromiseErrors = Promise[Zone.__symbol__('uncaughtPromiseErrors')];\n this.pendingPeriodicTimers = [];\n this.pendingTimers = [];\n this.patchDateLocked = false;\n this.properties = { 'FakeAsyncTestZoneSpec': this };\n this.name = 'fakeAsyncTestZone for ' + namePrefix;\n // in case user can't access the construction of FakeAsyncTestSpec\n // user can also define macroTaskOptions by define a global variable.\n if (!this.macroTaskOptions) {\n this.macroTaskOptions = global[Zone.__symbol__('FakeAsyncTestMacroTask')];\n }\n }\n FakeAsyncTestZoneSpec.assertInZone = function () {\n if (Zone.current.get('FakeAsyncTestZoneSpec') == null) {\n throw new Error('The code should be running in the fakeAsync zone to call this function');\n }\n };\n FakeAsyncTestZoneSpec.prototype._fnAndFlush = function (fn, completers) {\n var _this = this;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n fn.apply(global, args);\n if (_this._lastError === null) { // Success\n if (completers.onSuccess != null) {\n completers.onSuccess.apply(global);\n }\n // Flush microtasks only on success.\n _this.flushMicrotasks();\n }\n else { // Failure\n if (completers.onError != null) {\n completers.onError.apply(global);\n }\n }\n // Return true if there were no errors, false otherwise.\n return _this._lastError === null;\n };\n };\n FakeAsyncTestZoneSpec._removeTimer = function (timers, id) {\n var index = timers.indexOf(id);\n if (index > -1) {\n timers.splice(index, 1);\n }\n };\n FakeAsyncTestZoneSpec.prototype._dequeueTimer = function (id) {\n var _this = this;\n return function () {\n FakeAsyncTestZoneSpec._removeTimer(_this.pendingTimers, id);\n };\n };\n FakeAsyncTestZoneSpec.prototype._requeuePeriodicTimer = function (fn, interval, args, id) {\n var _this = this;\n return function () {\n // Requeue the timer callback if it's not been canceled.\n if (_this.pendingPeriodicTimers.indexOf(id) !== -1) {\n _this._scheduler.scheduleFunction(fn, interval, { args: args, isPeriodic: true, id: id, isRequeuePeriodic: true });\n }\n };\n };\n FakeAsyncTestZoneSpec.prototype._dequeuePeriodicTimer = function (id) {\n var _this = this;\n return function () {\n FakeAsyncTestZoneSpec._removeTimer(_this.pendingPeriodicTimers, id);\n };\n };\n FakeAsyncTestZoneSpec.prototype._setTimeout = function (fn, delay, args, isTimer) {\n if (isTimer === void 0) { isTimer = true; }\n var removeTimerFn = this._dequeueTimer(Scheduler.nextId);\n // Queue the callback and dequeue the timer on success and error.\n var cb = this._fnAndFlush(fn, { onSuccess: removeTimerFn, onError: removeTimerFn });\n var id = this._scheduler.scheduleFunction(cb, delay, { args: args, isRequestAnimationFrame: !isTimer });\n if (isTimer) {\n this.pendingTimers.push(id);\n }\n return id;\n };\n FakeAsyncTestZoneSpec.prototype._clearTimeout = function (id) {\n FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers, id);\n this._scheduler.removeScheduledFunctionWithId(id);\n };\n FakeAsyncTestZoneSpec.prototype._setInterval = function (fn, interval, args) {\n var id = Scheduler.nextId;\n var completers = { onSuccess: null, onError: this._dequeuePeriodicTimer(id) };\n var cb = this._fnAndFlush(fn, completers);\n // Use the callback created above to requeue on success.\n completers.onSuccess = this._requeuePeriodicTimer(cb, interval, args, id);\n // Queue the callback and dequeue the periodic timer only on error.\n this._scheduler.scheduleFunction(cb, interval, { args: args, isPeriodic: true });\n this.pendingPeriodicTimers.push(id);\n return id;\n };\n FakeAsyncTestZoneSpec.prototype._clearInterval = function (id) {\n FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers, id);\n this._scheduler.removeScheduledFunctionWithId(id);\n };\n FakeAsyncTestZoneSpec.prototype._resetLastErrorAndThrow = function () {\n var error = this._lastError || this._uncaughtPromiseErrors[0];\n this._uncaughtPromiseErrors.length = 0;\n this._lastError = null;\n throw error;\n };\n FakeAsyncTestZoneSpec.prototype.getCurrentTickTime = function () {\n return this._scheduler.getCurrentTickTime();\n };\n FakeAsyncTestZoneSpec.prototype.getFakeSystemTime = function () {\n return this._scheduler.getFakeSystemTime();\n };\n FakeAsyncTestZoneSpec.prototype.setFakeBaseSystemTime = function (realTime) {\n this._scheduler.setFakeBaseSystemTime(realTime);\n };\n FakeAsyncTestZoneSpec.prototype.getRealSystemTime = function () {\n return this._scheduler.getRealSystemTime();\n };\n FakeAsyncTestZoneSpec.patchDate = function () {\n if (!!global[Zone.__symbol__('disableDatePatching')]) {\n // we don't want to patch global Date\n // because in some case, global Date\n // is already being patched, we need to provide\n // an option to let user still use their\n // own version of Date.\n return;\n }\n if (global['Date'] === FakeDate) {\n // already patched\n return;\n }\n global['Date'] = FakeDate;\n FakeDate.prototype = OriginalDate.prototype;\n // try check and reset timers\n // because jasmine.clock().install() may\n // have replaced the global timer\n FakeAsyncTestZoneSpec.checkTimerPatch();\n };\n FakeAsyncTestZoneSpec.resetDate = function () {\n if (global['Date'] === FakeDate) {\n global['Date'] = OriginalDate;\n }\n };\n FakeAsyncTestZoneSpec.checkTimerPatch = function () {\n if (global.setTimeout !== timers.setTimeout) {\n global.setTimeout = timers.setTimeout;\n global.clearTimeout = timers.clearTimeout;\n }\n if (global.setInterval !== timers.setInterval) {\n global.setInterval = timers.setInterval;\n global.clearInterval = timers.clearInterval;\n }\n };\n FakeAsyncTestZoneSpec.prototype.lockDatePatch = function () {\n this.patchDateLocked = true;\n FakeAsyncTestZoneSpec.patchDate();\n };\n FakeAsyncTestZoneSpec.prototype.unlockDatePatch = function () {\n this.patchDateLocked = false;\n FakeAsyncTestZoneSpec.resetDate();\n };\n FakeAsyncTestZoneSpec.prototype.tickToNext = function (steps, doTick, tickOptions) {\n if (steps === void 0) { steps = 1; }\n if (tickOptions === void 0) { tickOptions = { processNewMacroTasksSynchronously: true }; }\n if (steps <= 0) {\n return;\n }\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n this._scheduler.tickToNext(steps, doTick, tickOptions);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n };\n FakeAsyncTestZoneSpec.prototype.tick = function (millis, doTick, tickOptions) {\n if (millis === void 0) { millis = 0; }\n if (tickOptions === void 0) { tickOptions = { processNewMacroTasksSynchronously: true }; }\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n this._scheduler.tick(millis, doTick, tickOptions);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n };\n FakeAsyncTestZoneSpec.prototype.flushMicrotasks = function () {\n var _this = this;\n FakeAsyncTestZoneSpec.assertInZone();\n var flushErrors = function () {\n if (_this._lastError !== null || _this._uncaughtPromiseErrors.length) {\n // If there is an error stop processing the microtask queue and rethrow the error.\n _this._resetLastErrorAndThrow();\n }\n };\n while (this._microtasks.length > 0) {\n var microtask = this._microtasks.shift();\n microtask.func.apply(microtask.target, microtask.args);\n }\n flushErrors();\n };\n FakeAsyncTestZoneSpec.prototype.flush = function (limit, flushPeriodic, doTick) {\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n var elapsed = this._scheduler.flush(limit, flushPeriodic, doTick);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n return elapsed;\n };\n FakeAsyncTestZoneSpec.prototype.flushOnlyPendingTimers = function (doTick) {\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n var elapsed = this._scheduler.flushOnlyPendingTimers(doTick);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n return elapsed;\n };\n FakeAsyncTestZoneSpec.prototype.removeAllTimers = function () {\n FakeAsyncTestZoneSpec.assertInZone();\n this._scheduler.removeAll();\n this.pendingPeriodicTimers = [];\n this.pendingTimers = [];\n };\n FakeAsyncTestZoneSpec.prototype.getTimerCount = function () {\n return this._scheduler.getTimerCount() + this._microtasks.length;\n };\n FakeAsyncTestZoneSpec.prototype.onScheduleTask = function (delegate, current, target, task) {\n switch (task.type) {\n case 'microTask':\n var args = task.data && task.data.args;\n // should pass additional arguments to callback if have any\n // currently we know process.nextTick will have such additional\n // arguments\n var additionalArgs = void 0;\n if (args) {\n var callbackIndex = task.data.cbIdx;\n if (typeof args.length === 'number' && args.length > callbackIndex + 1) {\n additionalArgs = Array.prototype.slice.call(args, callbackIndex + 1);\n }\n }\n this._microtasks.push({\n func: task.invoke,\n args: additionalArgs,\n target: task.data && task.data.target\n });\n break;\n case 'macroTask':\n switch (task.source) {\n case 'setTimeout':\n task.data['handleId'] = this._setTimeout(task.invoke, task.data['delay'], Array.prototype.slice.call(task.data['args'], 2));\n break;\n case 'setImmediate':\n task.data['handleId'] = this._setTimeout(task.invoke, 0, Array.prototype.slice.call(task.data['args'], 1));\n break;\n case 'setInterval':\n task.data['handleId'] = this._setInterval(task.invoke, task.data['delay'], Array.prototype.slice.call(task.data['args'], 2));\n break;\n case 'XMLHttpRequest.send':\n throw new Error('Cannot make XHRs from within a fake async test. Request URL: ' +\n task.data['url']);\n case 'requestAnimationFrame':\n case 'webkitRequestAnimationFrame':\n case 'mozRequestAnimationFrame':\n // Simulate a requestAnimationFrame by using a setTimeout with 16 ms.\n // (60 frames per second)\n task.data['handleId'] = this._setTimeout(task.invoke, 16, task.data['args'], this.trackPendingRequestAnimationFrame);\n break;\n default:\n // user can define which macroTask they want to support by passing\n // macroTaskOptions\n var macroTaskOption = this.findMacroTaskOption(task);\n if (macroTaskOption) {\n var args_1 = task.data && task.data['args'];\n var delay = args_1 && args_1.length > 1 ? args_1[1] : 0;\n var callbackArgs = macroTaskOption.callbackArgs ? macroTaskOption.callbackArgs : args_1;\n if (!!macroTaskOption.isPeriodic) {\n // periodic macroTask, use setInterval to simulate\n task.data['handleId'] = this._setInterval(task.invoke, delay, callbackArgs);\n task.data.isPeriodic = true;\n }\n else {\n // not periodic, use setTimeout to simulate\n task.data['handleId'] = this._setTimeout(task.invoke, delay, callbackArgs);\n }\n break;\n }\n throw new Error('Unknown macroTask scheduled in fake async test: ' + task.source);\n }\n break;\n case 'eventTask':\n task = delegate.scheduleTask(target, task);\n break;\n }\n return task;\n };\n FakeAsyncTestZoneSpec.prototype.onCancelTask = function (delegate, current, target, task) {\n switch (task.source) {\n case 'setTimeout':\n case 'requestAnimationFrame':\n case 'webkitRequestAnimationFrame':\n case 'mozRequestAnimationFrame':\n return this._clearTimeout(task.data['handleId']);\n case 'setInterval':\n return this._clearInterval(task.data['handleId']);\n default:\n // user can define which macroTask they want to support by passing\n // macroTaskOptions\n var macroTaskOption = this.findMacroTaskOption(task);\n if (macroTaskOption) {\n var handleId = task.data['handleId'];\n return macroTaskOption.isPeriodic ? this._clearInterval(handleId) :\n this._clearTimeout(handleId);\n }\n return delegate.cancelTask(target, task);\n }\n };\n FakeAsyncTestZoneSpec.prototype.onInvoke = function (delegate, current, target, callback, applyThis, applyArgs, source) {\n try {\n FakeAsyncTestZoneSpec.patchDate();\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n }\n finally {\n if (!this.patchDateLocked) {\n FakeAsyncTestZoneSpec.resetDate();\n }\n }\n };\n FakeAsyncTestZoneSpec.prototype.findMacroTaskOption = function (task) {\n if (!this.macroTaskOptions) {\n return null;\n }\n for (var i = 0; i < this.macroTaskOptions.length; i++) {\n var macroTaskOption = this.macroTaskOptions[i];\n if (macroTaskOption.source === task.source) {\n return macroTaskOption;\n }\n }\n return null;\n };\n FakeAsyncTestZoneSpec.prototype.onHandleError = function (parentZoneDelegate, currentZone, targetZone, error) {\n this._lastError = error;\n return false; // Don't propagate error to parent zone.\n };\n return FakeAsyncTestZoneSpec;\n }());\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['FakeAsyncTestZoneSpec'] = FakeAsyncTestZoneSpec;\n })(typeof window === 'object' && window || typeof self === 'object' && self || global);\n Zone.__load_patch('fakeasync', function (global, Zone, api) {\n var FakeAsyncTestZoneSpec = Zone && Zone['FakeAsyncTestZoneSpec'];\n function getProxyZoneSpec() {\n return Zone && Zone['ProxyZoneSpec'];\n }\n var _fakeAsyncTestZoneSpec = null;\n /**\n * Clears out the shared fake async zone for a test.\n * To be called in a global `beforeEach`.\n *\n * @experimental\n */\n function resetFakeAsyncZone() {\n if (_fakeAsyncTestZoneSpec) {\n _fakeAsyncTestZoneSpec.unlockDatePatch();\n }\n _fakeAsyncTestZoneSpec = null;\n // in node.js testing we may not have ProxyZoneSpec in which case there is nothing to reset.\n getProxyZoneSpec() && getProxyZoneSpec().assertPresent().resetDelegate();\n }\n /**\n * Wraps a function to be executed in the fakeAsync zone:\n * - microtasks are manually executed by calling `flushMicrotasks()`,\n * - timers are synchronous, `tick()` simulates the asynchronous passage of time.\n *\n * If there are any pending timers at the end of the function, an exception will be thrown.\n *\n * Can be used to wrap inject() calls.\n *\n * ## Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @param fn\n * @returns The function wrapped to be executed in the fakeAsync zone\n *\n * @experimental\n */\n function fakeAsync(fn) {\n // Not using an arrow function to preserve context passed from call site\n var fakeAsyncFn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var ProxyZoneSpec = getProxyZoneSpec();\n if (!ProxyZoneSpec) {\n throw new Error('ProxyZoneSpec is needed for the async() test helper but could not be found. ' +\n 'Please make sure that your environment includes zone.js/dist/proxy.js');\n }\n var proxyZoneSpec = ProxyZoneSpec.assertPresent();\n if (Zone.current.get('FakeAsyncTestZoneSpec')) {\n throw new Error('fakeAsync() calls can not be nested');\n }\n try {\n // in case jasmine.clock init a fakeAsyncTestZoneSpec\n if (!_fakeAsyncTestZoneSpec) {\n if (proxyZoneSpec.getDelegate() instanceof FakeAsyncTestZoneSpec) {\n throw new Error('fakeAsync() calls can not be nested');\n }\n _fakeAsyncTestZoneSpec = new FakeAsyncTestZoneSpec();\n }\n var res = void 0;\n var lastProxyZoneSpec = proxyZoneSpec.getDelegate();\n proxyZoneSpec.setDelegate(_fakeAsyncTestZoneSpec);\n _fakeAsyncTestZoneSpec.lockDatePatch();\n try {\n res = fn.apply(this, args);\n flushMicrotasks();\n }\n finally {\n proxyZoneSpec.setDelegate(lastProxyZoneSpec);\n }\n if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {\n throw new Error(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length + \" \" +\n \"periodic timer(s) still in the queue.\");\n }\n if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {\n throw new Error(_fakeAsyncTestZoneSpec.pendingTimers.length + \" timer(s) still in the queue.\");\n }\n return res;\n }\n finally {\n resetFakeAsyncZone();\n }\n };\n fakeAsyncFn.isFakeAsync = true;\n return fakeAsyncFn;\n }\n function _getFakeAsyncZoneSpec() {\n if (_fakeAsyncTestZoneSpec == null) {\n _fakeAsyncTestZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (_fakeAsyncTestZoneSpec == null) {\n throw new Error('The code should be running in the fakeAsync zone to call this function');\n }\n }\n return _fakeAsyncTestZoneSpec;\n }\n /**\n * Simulates the asynchronous passage of time for the timers in the fakeAsync zone.\n *\n * The microtasks queue is drained at the very start of this function and after any timer callback\n * has been executed.\n *\n * ## Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @experimental\n */\n function tick(millis, ignoreNestedTimeout) {\n if (millis === void 0) { millis = 0; }\n if (ignoreNestedTimeout === void 0) { ignoreNestedTimeout = false; }\n _getFakeAsyncZoneSpec().tick(millis, null, ignoreNestedTimeout);\n }\n /**\n * Simulates the asynchronous passage of time for the timers in the fakeAsync zone by\n * draining the macrotask queue until it is empty. The returned value is the milliseconds\n * of time that would have been elapsed.\n *\n * @param maxTurns\n * @returns The simulated time elapsed, in millis.\n *\n * @experimental\n */\n function flush(maxTurns) {\n return _getFakeAsyncZoneSpec().flush(maxTurns);\n }\n /**\n * Discard all remaining periodic tasks.\n *\n * @experimental\n */\n function discardPeriodicTasks() {\n var zoneSpec = _getFakeAsyncZoneSpec();\n var pendingTimers = zoneSpec.pendingPeriodicTimers;\n zoneSpec.pendingPeriodicTimers.length = 0;\n }\n /**\n * Flush any pending microtasks.\n *\n * @experimental\n */\n function flushMicrotasks() {\n _getFakeAsyncZoneSpec().flushMicrotasks();\n }\n Zone[api.symbol('fakeAsyncTest')] =\n { resetFakeAsyncZone: resetFakeAsyncZone, flushMicrotasks: flushMicrotasks, discardPeriodicTasks: discardPeriodicTasks, tick: tick, flush: flush, fakeAsync: fakeAsync };\n }, true);\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 * Promise for async/fakeAsync zoneSpec test\n * can support async operation which not supported by zone.js\n * such as\n * it ('test jsonp in AsyncZone', async() => {\n * new Promise(res => {\n * jsonp(url, (data) => {\n * // success callback\n * res(data);\n * });\n * }).then((jsonpResult) => {\n * // get jsonp result.\n *\n * // user will expect AsyncZoneSpec wait for\n * // then, but because jsonp is not zone aware\n * // AsyncZone will finish before then is called.\n * });\n * });\n */\n Zone.__load_patch('promisefortest', function (global, Zone, api) {\n var symbolState = api.symbol('state');\n var UNRESOLVED = null;\n var symbolParentUnresolved = api.symbol('parentUnresolved');\n // patch Promise.prototype.then to keep an internal\n // number for tracking unresolved chained promise\n // we will decrease this number when the parent promise\n // being resolved/rejected and chained promise was\n // scheduled as a microTask.\n // so we can know such kind of chained promise still\n // not resolved in AsyncTestZone\n Promise[api.symbol('patchPromiseForTest')] = function patchPromiseForTest() {\n var oriThen = Promise[Zone.__symbol__('ZonePromiseThen')];\n if (oriThen) {\n return;\n }\n oriThen = Promise[Zone.__symbol__('ZonePromiseThen')] = Promise.prototype.then;\n Promise.prototype.then = function () {\n var chained = oriThen.apply(this, arguments);\n if (this[symbolState] === UNRESOLVED) {\n // parent promise is unresolved.\n var asyncTestZoneSpec = Zone.current.get('AsyncTestZoneSpec');\n if (asyncTestZoneSpec) {\n asyncTestZoneSpec.unresolvedChainedPromiseCount++;\n chained[symbolParentUnresolved] = true;\n }\n }\n return chained;\n };\n };\n Promise[api.symbol('unPatchPromiseForTest')] = function unpatchPromiseForTest() {\n // restore origin then\n var oriThen = Promise[Zone.__symbol__('ZonePromiseThen')];\n if (oriThen) {\n Promise.prototype.then = oriThen;\n Promise[Zone.__symbol__('ZonePromiseThen')] = undefined;\n }\n };\n });\n})));\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,cAAc,GAAI,IAAI,IAAI,IAAI,CAACA,cAAc,IAAK,YAAY;EAC9D,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEC,EAAE,GAAGC,SAAS,CAACC,MAAM,EAAEH,CAAC,GAAGC,EAAE,EAAED,CAAC,EAAE,EAAED,CAAC,IAAIG,SAAS,CAACF,CAAC,CAAC,CAACG,MAAM;EACnF,KAAK,IAAIC,CAAC,GAAGC,KAAK,CAACN,CAAC,CAAC,EAAEO,CAAC,GAAG,CAAC,EAAEN,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGC,EAAE,EAAED,CAAC,EAAE,EAC5C,KAAK,IAAIO,CAAC,GAAGL,SAAS,CAACF,CAAC,CAAC,EAAEQ,CAAC,GAAG,CAAC,EAAEC,EAAE,GAAGF,CAAC,CAACJ,MAAM,EAAEK,CAAC,GAAGC,EAAE,EAAED,CAAC,EAAE,EAAEF,CAAC,EAAE,EAC7DF,CAAC,CAACE,CAAC,CAAC,GAAGC,CAAC,CAACC,CAAC,CAAC;EACnB,OAAOJ,CAAC;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACC,WAAUM,OAAO,EAAE;EAChB,OAAOC,MAAM,KAAK,UAAU,IAAIA,MAAM,CAACC,GAAG,GAAGD,MAAM,CAACD,OAAO,CAAC,GACxDA,OAAO,CAAC,CAAC;AACjB,CAAC,EAAE,YAAY;EACX,YAAY;;EACZ;AACJ;AACA;AACA;AACA;AACA;AACA;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