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AAQkS,EAAG,EAEvC,CAiqBAqjB,CAAa1M","names":["window","global","global$2","globalThis","__symbol__","name","__Zone_symbol_prefix","__global","self","AsyncTestZoneSpec","symbolParentUnresolved","constructor","finishCallback","failCallback","namePrefix","this","_pendingMicroTasks","_pendingMacroTasks","_alreadyErrored","_isSync","_existingFinishTimer","entryFunction","runZone","Zone","current","unresolvedChainedPromiseCount","supportWaitUnresolvedChainedPromise","properties","isUnresolvedChainedPromisePending","_finishCallbackIfDone","clearTimeout","run","setTimeout","patchPromiseForTest","Promise","unPatchPromiseForTest","onScheduleTask","delegate","target","task","type","data","scheduleTask","onInvokeTask","applyThis","applyArgs","invokeTask","onCancelTask","cancelTask","onInvoke","parentZoneDelegate","currentZone","targetZone","source","invoke","onHandleError","error","handleError","onHasTask","hasTaskState","hasTask","change","microTask","macroTask","global$1","OriginalDate","Date","FakeDate","arguments","length","d","setTime","now","args","Array","prototype","slice","call","patchedTimers","fakeAsyncTestZoneSpec","get","getFakeSystemTime","apply","UTC","parse","timeoutCallback","Scheduler","_Scheduler","_schedulerQueue","_currentTickTime","_currentFakeBaseSystemTime","_currentTickRequeuePeriodicEntries","getNextId","id","nativeSetTimeout","nativeClearTimeout","nextNodeJSId","getCurrentTickTime","setFakeBaseSystemTime","fakeBaseSystemTime","getRealSystemTime","scheduleFunction","cb","delay","options","currentId","isPeriodic","isRequestAnimationFrame","isRequeuePeriodic","nextId","newEntry","endTime","func","push","i","splice","removeScheduledFunctionWithId","removeAll","getTimerCount","tickToNext","step","doTick","tickOptions","tick","millis","finalTime","lastCurrentTime","schedulerQueue","Object","assign","processNewMacroTasksSynchronously","shift","idx","indexOf","forEach","flushOnlyPendingTimers","startTime","flush","limit","flushPeriodic","flushNonPeriodic","count","Error","filter","FakeAsyncTestZoneSpec","assertInZone","trackPendingRequestAnimationFrame","macroTaskOptions","_scheduler","_microtasks","_lastError","_uncaughtPromiseErrors","pendingPeriodicTimers","pendingTimers","patchDateLocked","_fnAndFlush","fn","completers","onSuccess","flushMicrotasks","onError","_removeTimer","timers","index","_dequeueTimer","_requeuePeriodicTimer","interval","_dequeuePeriodicTimer","_setTimeout","isTimer","removeTimerFn","_clearTimeout","_setInterval","_clearInterval","_resetLastErrorAndThrow","realTime","patchDate","checkTimerPatch","resetDate","setInterval","clearInterval","lockDatePatch","unlockDatePatch","steps","microtask","flushErrors","elapsed","removeAllTimers","additionalArgs","callbackIndex","cbIdx","handleId","url","macroTaskOption","findMacroTaskOption","callbackArgs","callback","_fakeAsyncTestZoneSpec","getProxyZoneSpec","ProxyZoneSpec","resetFakeAsyncZone","assertPresent","resetDelegate","fakeAsync","fakeAsyncFn","proxyZoneSpec","getDelegate","res","lastProxyZoneSpec","setDelegate","isFakeAsync","_getFakeAsyncZoneSpec","ignoreNestedTimeout","maxTurns","discardPeriodicTasks","patchLongStackTrace","NEWLINE","IGNORE_FRAMES","creationTrace","ERROR_TAG","SEP_TAG","sepTemplate","LongStackTrace","getStacktrace","timestamp","getStacktraceWithUncaughtError","getStacktraceWithCaughtError","err","caughtError","stack","getFrames","split","addErrorStack","lines","trace","hasOwnProperty","renderLongStackTrace","frames","longTrace","trim","getTime","traceFrames","lastTime","separator","replace","join","stackTracesEnabled","stackTraceLimit","captureStackTraces","stackTraces","longStackTraceZoneSpec","longStackTraceLimit","getLongStackTrace","currentTask","concat","parentTask","longStack","computeIgnoreFrames","frames1","frames2","frame1","match","isLoaded","defaultSpecDelegate","_delegateSpec","propertyKeys","lastTaskState","isNeedToTriggerHasTask","tasks","delegateSpec","isNewDelegate","key","keys","k","tryTriggerHasTask","removeFromTasks","getAndClearPendingTasksInfo","pendingTasksInfo","map","dataInfo","onFork","zoneSpec","fork","onIntercept","intercept","rollupTesting","patchProxyZoneSpec","patchSyncTest","SyncTestZoneSpec","patchJasmine","__load_patch","api","jest","jasmine","__zone_patch__","ambientZone","symbol","disablePatchingJasmineClock","enableAutoFakeAsyncWhenClockPatched","globalErrors","GlobalErrors","instance","originalInstall","install","isNode","process","on","originalHandlers","listeners","eventListeners","result","removeAllListeners","handler","addEventListener","jasmineEnv","getEnv","methodName","originalJasmineFn","description","specDefinitions","wrapDescribeInZone","describeBody","timeout","wrapTestInZone","originalClockFn","clock","originalTick","fakeAsyncZoneSpec","originalMockDate","mockDate","dateTime","originalCreateSpyObj","createSpyObj","spyObj","defineProperty","obj","p","attributes","configurable","enumerable","runInTestZone","testBody","queueRunner","done","isClockInstalled","testProxyZone","fakeAsyncModule","QueueRunner","_super","ZoneQueueRunner","attrs","onComplete","testProxyZoneSpec","scheduleMicroTask","UserContext","userContext","onException","message","b","__","create","__extends","execute","zone","isChildOfAmbientZone","parent","patchJest","context","rootZone","syncZone","proxyZone","isTestFunc","wrappedFunc","writable","originalJestFn","each","wrapDescribeFactoryInZone","tableArgs","originalDescribeFn","describe","only","fdescribe","skip","xdescribe","wrapTestFactoryInZone","todo","it","fit","xit","test","patchJestObject","Timer","isModern","isPatchingFakeTimer","isInTestFunc","patchMethod","patchMocha","Mocha","testZone","suiteZone","mochaOriginal","after","afterEach","before","beforeEach","modifyArguments","syncTest","asyncTest","arg","toString","wrapSuiteInZone","originalRunTest","originalRun","suite","specify","xspecify","suiteTeardown","teardown","suiteSetup","setup","Runner","runTest","e","patchAsyncTest","undefined","getZoneWith","previousDelegate","testZoneSpec","runGuarded","fail","patchFakeAsyncTest","patchPromiseTesting","symbolState","oriThen","then","chained","asyncTestZoneSpec","ObjectGetOwnPropertyDescriptor","getOwnPropertyDescriptor","ObjectDefineProperty","ObjectGetPrototypeOf","getPrototypeOf","ObjectCreate","ArraySlice","ADD_EVENT_LISTENER_STR","REMOVE_EVENT_LISTENER_STR","ZONE_SYMBOL_ADD_EVENT_LISTENER","ZONE_SYMBOL_REMOVE_EVENT_LISTENER","TRUE_STR","FALSE_STR","ZONE_SYMBOL_PREFIX","wrapWithCurrentZone","wrap","scheduleMacroTaskWithCurrentZone","customSchedule","customCancel","scheduleMacroTask","zoneSymbol","isWindowExists","internalWindow","_global","REMOVE_ATTRIBUTE","bindArguments","isPropertyWritable","propertyDesc","set","isWebWorker","WorkerGlobalScope","isBrowser","HTMLElement","isMix","zoneSymbolEventNames$1","enableBeforeunloadSymbol","wrapFn","event","eventNameSymbol","listener","filename","lineno","colno","preventDefault","returnValue","patchProperty","prop","desc","onPropPatchedSymbol","value","originalDescGet","originalDescSet","eventName","newValue","removeEventListener","removeAttribute","patchOnProperties","onProperties","j","originalInstanceKey","patchClass","className","OriginalClass","a","attachOriginToPatched","patchFn","proto","delegateName","patchDelegate","patchMacroTask","funcName","metaCreator","setNative","meta","patched","original","isDetectedIEOrEdge","ieOrEdge","isIEOrEdge","ua","navigator","userAgent","isFunction","isNumber","passiveSupported","OPTIMIZED_ZONE_EVENT_TASK_DATA","useG","zoneSymbolEventNames","globalSources","EVENT_NAME_SYMBOL_REGX","RegExp","IMMEDIATE_PROPAGATION_SYMBOL","prepareEventNames","eventNameToString","falseEventName","trueEventName","symbolCapture","patchEventTarget","apis","patchOptions","ADD_EVENT_LISTENER","add","REMOVE_EVENT_LISTENER","rm","LISTENERS_EVENT_LISTENER","REMOVE_ALL_LISTENERS_EVENT_LISTENER","rmAll","zoneSymbolAddEventListener","ADD_EVENT_LISTENER_SOURCE","PREPEND_EVENT_LISTENER","PREPEND_EVENT_LISTENER_SOURCE","isRemoved","handleEvent","originalDelegate","once","globalCallback","isCapture","errors","copyTasks","nativeScheduleMicroTask","globalZoneAwareCallback","globalZoneAwareCaptureCallback","patchEventTargetMethods","useGlobalCallback","validateHandler","vh","checkDuplicate","chkDup","returnTarget","rt","taskData","nativeAddEventListener","nativeRemoveEventListener","nativeListeners","nativeRemoveAllListeners","nativePrependEventListener","prepend","isExisting","capture","symbolEventNames","symbolEventName","existingTasks","removeAbortListener","allRemoved","compare","diff","typeOfDelegate","unpatchedEvents","passiveEvents","makeAddListener","nativeListener","addSource","customScheduleFn","customCancelFn","transferEventName","isHandleEvent","passive","copyEventListenerOptions","newOptions","signal","buildEventListenerOptions","aborted","constructorName","targetSource","scheduleEventTask","onAbort","unshift","existingTask","findEventTasks","captureTasks","removeTasks","exec","evtName","results","foundTasks","captureFalseTasks","captureTrueTasks","patchEventPrototype","Event","taskSymbol","patchTimer","setName","cancelName","nameSuffix","clearNative","tasksByHandleId","handleOrId","handle","isRefreshable","refresh","clearTask","_ref","originalRefresh","state","_state","_updateTaskCount","_task","cancelFn","filterProperties","ignoreProperties","tip","ip","targetIgnoreProperties","op","patchFilteredProperties","getOnEventNames","getOwnPropertyNames","startsWith","substring","patchCallbacks","targetName","method","callbacks","nativeDelegate","opts","descriptor","_redefineProperty","Zone$1","loadZone","_global$_Zone","initZone","performance","mark","performanceMeasure","label","measure","ZoneImpl","assertZonePatched","patches","ZoneAwarePromise","root","_currentZoneFrame","_currentTask","ignoreDuplicate","perfName","_api","_parent","_name","_properties","_zoneDelegate","_ZoneDelegate","_callback","runTask","NO_ZONE","zoneTask","notScheduled","eventTask","reEntryGuard","running","_transitionTo","scheduled","previousTask","unknown","scheduling","zoneDelegates","_zoneDelegates","newZone","_zone","ZoneTask","canceling","runCount","_ZoneImpl","DELEGATE_ZS","_","parentDelegate","_taskCounts","_parentDelegate","_forkZS","_forkDlgt","_forkCurrZone","_interceptZS","_interceptDlgt","_interceptCurrZone","_invokeZS","_invokeDlgt","_invokeCurrZone","_handleErrorZS","_handleErrorDlgt","_handleErrorCurrZone","_scheduleTaskZS","_scheduleTaskDlgt","_scheduleTaskCurrZone","_invokeTaskZS","_invokeTaskDlgt","_invokeTaskCurrZone","_cancelTaskZS","_cancelTaskDlgt","_cancelTaskCurrZone","_hasTaskZS","_hasTaskDlgt","_hasTaskDlgtOwner","_hasTaskCurrZone","zoneSpecHasTask","returnTask","scheduleFn","isEmpty","counts","prev","next","_numberOfNestedTaskFrames","drainMicroTaskQueue","cancelScheduleRequest","toState","fromState1","fromState2","toJSON","symbolSetTimeout","symbolPromise","symbolThen","nativeMicroTaskQueuePromise","_microTaskQueue","_isDrainingMicrotaskQueue","resolve","nativeThen","queue","onUnhandledError","microtaskDrainDone","currentZoneFrame","noop","showUncaughtError","patchThen","getGlobalObjects","patchCommon","patchPromise","isDisableWrappingUncaughtPromiseRejection","rejection","console","uncaughtPromiseError","throwOriginal","handleUnhandledRejection","UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL","isThenable","forwardResolution","forwardRejection","reject","symbolValue","symbolFinally","symbolParentPromiseValue","symbolParentPromiseState","UNRESOLVED","RESOLVED","REJECTED","REJECTED_NO_CATCH","makeResolver","promise","v","resolvePromise","wasCalled","wrappedFunction","TYPE_ERROR","CURRENT_TASK_TRACE_SYMBOL","onceWrapper","TypeError","clearRejectedNoCatch","scheduleResolveOrReject","readableObjectToString","JSON","stringify","REJECTION_HANDLED_HANDLER","chainPromise","onFulfilled","onRejected","promiseState","parentPromiseValue","isFinallyPromise","AggregateError","withResolvers","rej","any","values","Symbol","iterator","promises","finished","race","onResolve","onReject","all","allWithCallback","allSettled","thenCallback","status","errorCallback","reason","unresolvedCount","valueIndex","resolvedValues","curValueIndex","thenErr","executor","toStringTag","species","_this$constructor","C","catch","finally","onFinally","_this$constructor2","NativePromise","symbolThenPatched","Ctor","originalThen","zoneify","resultPromise","ctor","patchToString","originalFunctionToString","Function","ORIGINAL_DELEGATE_SYMBOL","PROMISE_SYMBOL","ERROR_SYMBOL","newFunctionToString","nativePromise","nativeError","originalObjectToString","patchUtil","eventNames","SYMBOL_BLACK_LISTED_EVENTS","SYMBOL_UNPATCHED_EVENTS","patchBrowser","legacyPatch","clear","blockingMethods","s","patchEvent","eventTargetPatch","EVENT_TARGET","EventTarget","XMLHttpRequestEventTarget","propertyDescriptorPatch","__Zone_ignore_on_properties","patchTargets","ignoreErrorProperties","isIE","patchCustomElements","customElements","patchXHR","XMLHttpRequest","XMLHttpRequestPrototype","oriAddListener","oriRemoveListener","XMLHttpRequestEventTargetPrototype","READY_STATE_CHANGE","SCHEDULED","XHR_SCHEDULED","XHR_ERROR_BEFORE_SCHEDULED","XHR_LISTENER","newListener","readyState","DONE","loadTasks","oriInvoke","XHR_TASK","sendNative","placeholderCallback","abortNative","openNative","XHR_SYNC","XHR_URL","fetchTaskAborting","fetchTaskScheduling","findPendingTask","geolocation","patchPrototype","fnNames","findPromiseRejectionHandler","PromiseRejectionEvent","evt","patchQueueMicrotask"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/polyfills.ts","./node_modules/zone.js/fesm2015/zone-testing.js","./node_modules/zone.js/fesm2015/zone.js"],"sourcesContent":["/**\n * This file includes polyfills needed by Angular and is loaded before the app.\n * You can add your own extra polyfills to this file.\n *\n * This file is divided into 2 sections:\n * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.\n * 2. Application imports. Files imported after ZoneJS that should be loaded before your main\n * file.\n *\n * The current setup is for so-called \"evergreen\" browsers; the last versions of browsers that\n * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),\n * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.\n *\n * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html\n */\n\n/***************************************************************************************************\n * BROWSER POLYFILLS\n */\n\n/** IE9, IE10 and IE11 requires all of the following polyfills. **/\n// import 'core-js/es6/symbol';\n// import 'core-js/es6/object';\n// import 'core-js/es6/function';\n// import 'core-js/es6/parse-int';\n// import 'core-js/es6/parse-float';\n// import 'core-js/es6/number';\n// import 'core-js/es6/math';\n// import 'core-js/es6/string';\n// import 'core-js/es6/date';\n// import 'core-js/es6/array';\n// import 'core-js/es6/regexp';\n// import 'core-js/es6/map';\n// import 'core-js/es6/weak-map';\n// import 'core-js/es6/set';\n\n/** IE10 and IE11 requires the following for NgClass support on SVG elements */\n// import 'classlist.js'; // Run `npm install --save classlist.js`.\n\n/** IE10 and IE11 requires the following for the Reflect API. */\n// import 'core-js/es6/reflect';\n\n\n/** Evergreen browsers require these. **/\n// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.\n// import 'core-js/es7/reflect';\n(window as any).global = window;\n\n\n/**\n * Web Animations `@angular/platform-browser/animations`\n * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.\n * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).\n **/\n// import 'web-animations-js'; // Run `npm install --save web-animations-js`.\n\n/**\n * By default, zone.js will patch all possible macroTask and DomEvents\n * user can disable parts of macroTask/DomEvents patch by setting following flags\n */\n\n// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame\n// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick\n// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames\n\n/*\n* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js\n* with the following flag, it will bypass `zone.js` patch for IE/Edge\n*/\n// (window as any).__Zone_enable_cross_context_check = true;\n\n/***************************************************************************************************\n * Zone JS is required by default for Angular itself.\n */\nimport 'zone.js';\nimport 'zone.js/testing';\n\n\n\n/***************************************************************************************************\n * APPLICATION IMPORTS\n */\n","'use strict';\n/**\n * @license Angular v\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\nfunction patchJasmine(Zone) {\n Zone.__load_patch('jasmine', (global, Zone, api) => {\n const __extends = function (d, b) {\n for (const p in b)\n if (b.hasOwnProperty(p))\n d[p] = b[p];\n function __() {\n this.constructor = d;\n }\n d.prototype =\n 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 const SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n const ProxyZoneSpec = Zone['ProxyZoneSpec'];\n if (!SyncTestZoneSpec)\n throw new Error('Missing: SyncTestZoneSpec');\n if (!ProxyZoneSpec)\n throw new Error('Missing: ProxyZoneSpec');\n const ambientZone = Zone.current;\n const symbol = Zone.__symbol__;\n // whether patch jasmine clock when in fakeAsync\n const 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\n // also automatically disable the auto jump into fakeAsync feature\n const enableAutoFakeAsyncWhenClockPatched = !disablePatchingJasmineClock &&\n (global[symbol('fakeAsyncPatchLock')] === true ||\n global[symbol('fakeAsyncAutoFakeAsyncWhenClockPatched')] === true);\n const ignoreUnhandledRejection = global[symbol('ignoreUnhandledRejection')] === true;\n if (!ignoreUnhandledRejection) {\n const globalErrors = jasmine.GlobalErrors;\n if (globalErrors && !jasmine[symbol('GlobalErrors')]) {\n jasmine[symbol('GlobalErrors')] = globalErrors;\n jasmine.GlobalErrors = function () {\n const instance = new globalErrors();\n const originalInstall = instance.install;\n if (originalInstall && !instance[symbol('install')]) {\n instance[symbol('install')] = originalInstall;\n instance.install = function () {\n const isNode = typeof process !== 'undefined' && !!process.on;\n // Note: Jasmine checks internally if `process` and `process.on` is defined.\n // Otherwise, it installs the browser rejection handler through the\n // `global.addEventListener`. This code may be run in the browser environment where\n // `process` is not defined, and this will lead to a runtime exception since Webpack 5\n // removed automatic Node.js polyfills. Note, that events are named differently, it's\n // `unhandledRejection` in Node.js and `unhandledrejection` in the browser.\n const originalHandlers = isNode\n ? process.listeners('unhandledRejection')\n : global.eventListeners('unhandledrejection');\n const result = originalInstall.apply(this, arguments);\n isNode\n ? process.removeAllListeners('unhandledRejection')\n : global.removeAllListeners('unhandledrejection');\n if (originalHandlers) {\n originalHandlers.forEach((handler) => {\n if (isNode) {\n process.on('unhandledRejection', handler);\n }\n else {\n global.addEventListener('unhandledrejection', handler);\n }\n });\n }\n return result;\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 const jasmineEnv = jasmine.getEnv();\n ['describe', 'xdescribe', 'fdescribe'].forEach((methodName) => {\n let originalJasmineFn = jasmineEnv[methodName];\n jasmineEnv[methodName] = function (description, specDefinitions) {\n return originalJasmineFn.call(this, description, wrapDescribeInZone(description, specDefinitions));\n };\n });\n ['it', 'xit', 'fit'].forEach((methodName) => {\n let 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((methodName) => {\n let 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 const originalClockFn = (jasmine[symbol('clock')] = jasmine['clock']);\n jasmine['clock'] = function () {\n const clock = originalClockFn.apply(this, arguments);\n if (!clock[symbol('patched')]) {\n clock[symbol('patched')] = symbol('patched');\n const originalTick = (clock[symbol('tick')] = clock.tick);\n clock.tick = function () {\n const fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n return fakeAsyncZoneSpec.tick.apply(fakeAsyncZoneSpec, arguments);\n }\n return originalTick.apply(this, arguments);\n };\n const originalMockDate = (clock[symbol('mockDate')] = clock.mockDate);\n clock.mockDate = function () {\n const fakeAsyncZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncZoneSpec) {\n const dateTime = arguments.length > 0 ? arguments[0] : new Date();\n return fakeAsyncZoneSpec.setFakeBaseSystemTime.apply(fakeAsyncZoneSpec, dateTime && typeof dateTime.getTime === 'function'\n ? [dateTime.getTime()]\n : arguments);\n }\n return originalMockDate.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((methodName) => {\n const originalClockFn = (clock[symbol(methodName)] = clock[methodName]);\n clock[methodName] = function () {\n const 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 const originalCreateSpyObj = jasmine.createSpyObj;\n jasmine[Zone.__symbol__('createSpyObj')] = originalCreateSpyObj;\n jasmine.createSpyObj = function () {\n const args = Array.prototype.slice.call(arguments);\n const propertyNames = args.length >= 3 ? args[2] : null;\n let spyObj;\n if (propertyNames) {\n const defineProperty = Object.defineProperty;\n Object.defineProperty = function (obj, p, attributes) {\n return defineProperty.call(this, obj, p, {\n ...attributes,\n configurable: true,\n enumerable: true,\n });\n };\n try {\n spyObj = originalCreateSpyObj.apply(this, args);\n }\n finally {\n Object.defineProperty = defineProperty;\n }\n }\n else {\n spyObj = originalCreateSpyObj.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(description, describeBody) {\n return function () {\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`.\n const syncZone = ambientZone.fork(new SyncTestZoneSpec(`jasmine.describe#${description}`));\n return syncZone.run(describeBody, this, arguments);\n };\n }\n function runInTestZone(testBody, applyThis, queueRunner, done) {\n const isClockInstalled = !!jasmine[symbol('clockInstalled')];\n queueRunner.testProxyZoneSpec;\n const testProxyZone = queueRunner.testProxyZone;\n if (isClockInstalled && enableAutoFakeAsyncWhenClockPatched) {\n // auto run a fakeAsync\n const 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 &&\n (testBody.length\n ? function (done) {\n return runInTestZone(testBody, this, this.queueRunner, done);\n }\n : function () {\n return runInTestZone(testBody, this, this.queueRunner);\n }));\n }\n const QueueRunner = jasmine.QueueRunner;\n jasmine.QueueRunner = (function (_super) {\n __extends(ZoneQueueRunner, _super);\n function ZoneQueueRunner(attrs) {\n if (attrs.onComplete) {\n attrs.onComplete = ((fn) => () => {\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 const nativeSetTimeout = global[Zone.__symbol__('setTimeout')];\n const 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 const 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 const proxyZoneSpec = this && this.testProxyZoneSpec;\n if (proxyZoneSpec) {\n const 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 if (onException) {\n onException.call(this, error);\n }\n };\n _super.call(this, attrs);\n }\n ZoneQueueRunner.prototype.execute = function () {\n let zone = Zone.current;\n let 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', () => QueueRunner.prototype.execute.call(this));\n }\n else {\n _super.prototype.execute.call(this);\n }\n };\n return ZoneQueueRunner;\n })(QueueRunner);\n });\n}\n\nfunction patchJest(Zone) {\n Zone.__load_patch('jest', (context, Zone, api) => {\n if (typeof jest === 'undefined' || jest['__zone_patch__']) {\n return;\n }\n // From jest 29 and jest-preset-angular v13, the module transform logic\n // changed, and now jest-preset-angular use the use the tsconfig target\n // other than the hardcoded one, https://github.com/thymikee/jest-preset-angular/issues/2010\n // But jest-angular-preset doesn't introduce the @babel/plugin-transform-async-to-generator\n // which is needed by angular since `async/await` still need to be transformed\n // to promise for ES2017+ target.\n // So for now, we disable to output the uncaught error console log for a temp solution,\n // until jest-preset-angular find a proper solution.\n Zone[api.symbol('ignoreConsoleErrorUncaughtError')] = true;\n jest['__zone_patch__'] = true;\n const ProxyZoneSpec = Zone['ProxyZoneSpec'];\n const SyncTestZoneSpec = Zone['SyncTestZoneSpec'];\n if (!ProxyZoneSpec) {\n throw new Error('Missing ProxyZoneSpec');\n }\n const rootZone = Zone.current;\n const syncZone = rootZone.fork(new SyncTestZoneSpec('jest.describe'));\n const proxyZoneSpec = new ProxyZoneSpec();\n const proxyZone = rootZone.fork(proxyZoneSpec);\n function wrapDescribeFactoryInZone(originalJestFn) {\n return function (...tableArgs) {\n const originalDescribeFn = originalJestFn.apply(this, tableArgs);\n return function (...args) {\n args[1] = wrapDescribeInZone(args[1]);\n return originalDescribeFn.apply(this, args);\n };\n };\n }\n function wrapTestFactoryInZone(originalJestFn) {\n return function (...tableArgs) {\n return function (...args) {\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 (...args) {\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 = false) {\n if (typeof testBody !== 'function') {\n return testBody;\n }\n const wrappedFunc = function () {\n if (Zone[api.symbol('useFakeTimersCalled')] === true &&\n testBody &&\n !testBody.isFakeAsync) {\n // jest.useFakeTimers is called, run into fakeAsyncTest automatically.\n const 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((methodName) => {\n let originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function (...args) {\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((methodName) => {\n let originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function (...args) {\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((methodName) => {\n let originalJestFn = context[methodName];\n if (context[Zone.__symbol__(methodName)]) {\n return;\n }\n context[Zone.__symbol__(methodName)] = originalJestFn;\n context[methodName] = function (...args) {\n args[0] = wrapTestInZone(args[0]);\n return originalJestFn.apply(this, args);\n };\n });\n Zone.patchJestObject = function patchJestObject(Timer, isModern = false) {\n // check whether currently the test is inside fakeAsync()\n function isPatchingFakeTimer() {\n const 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 const 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', (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', (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', (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', (delegate) => {\n return function (self, args) {\n const 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', (delegate) => {\n return function (self, args) {\n const 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', (delegate) => {\n return function (self, args) {\n const 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', (delegate) => {\n return function (self, args) {\n const 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', (delegate) => {\n return function (self, args) {\n const 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', (delegate) => {\n return function (self, args) {\n const 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', (delegate) => {\n return function (self, args) {\n const 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', (delegate) => {\n return function (self, args) {\n const 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', (delegate) => {\n return function (self, args) {\n const 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\nfunction patchMocha(Zone) {\n Zone.__load_patch('mocha', (global, Zone) => {\n const 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 const ProxyZoneSpec = Zone['ProxyZoneSpec'];\n const 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 const rootZone = Zone.current;\n const syncZone = rootZone.fork(new SyncTestZoneSpec('Mocha.describe'));\n let testZone = null;\n const suiteZone = rootZone.fork(new ProxyZoneSpec());\n const mochaOriginal = {\n after: global.after,\n afterEach: global.afterEach,\n before: global.before,\n beforeEach: global.beforeEach,\n describe: global.describe,\n it: global.it,\n };\n function modifyArguments(args, syncTest, asyncTest) {\n for (let i = 0; i < args.length; i++) {\n let 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 return args;\n }\n function wrapDescribeInZone(args) {\n const 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 const asyncTest = function (fn) {\n return function (done) {\n return testZone.run(fn, this, [done]);\n };\n };\n const 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 const asyncTest = function (fn) {\n return function (done) {\n return suiteZone.run(fn, this, [done]);\n };\n };\n const 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 = function () {\n return mochaOriginal.describe.apply(this, wrapDescribeInZone(arguments));\n };\n global.xdescribe =\n global.suite.skip =\n global.describe.skip =\n function () {\n return mochaOriginal.describe.skip.apply(this, wrapDescribeInZone(arguments));\n };\n global.describe.only = global.suite.only = function () {\n return mochaOriginal.describe.only.apply(this, wrapDescribeInZone(arguments));\n };\n global.it =\n global.specify =\n global.test =\n function () {\n return mochaOriginal.it.apply(this, wrapTestInZone(arguments));\n };\n global.xit =\n global.xspecify =\n global.it.skip =\n function () {\n return mochaOriginal.it.skip.apply(this, wrapTestInZone(arguments));\n };\n global.it.only = global.test.only = function () {\n return mochaOriginal.it.only.apply(this, wrapTestInZone(arguments));\n };\n global.after = global.suiteTeardown = function () {\n return mochaOriginal.after.apply(this, wrapSuiteInZone(arguments));\n };\n global.afterEach = global.teardown = function () {\n return mochaOriginal.afterEach.apply(this, wrapTestInZone(arguments));\n };\n global.before = global.suiteSetup = function () {\n return mochaOriginal.before.apply(this, wrapSuiteInZone(arguments));\n };\n global.beforeEach = global.setup = function () {\n return mochaOriginal.beforeEach.apply(this, wrapTestInZone(arguments));\n };\n ((originalRunTest, originalRun) => {\n Mocha.Runner.prototype.runTest = function (fn) {\n Zone.current.scheduleMicroTask('mocha.forceTask', () => {\n originalRunTest.call(this, fn);\n });\n };\n Mocha.Runner.prototype.run = function (fn) {\n this.on('test', (e) => {\n testZone = rootZone.fork(new ProxyZoneSpec());\n });\n this.on('fail', (test, err) => {\n const 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 return originalRun.call(this, fn);\n };\n })(Mocha.Runner.prototype.runTest, Mocha.Runner.prototype.run);\n });\n}\n\nconst global$2 = globalThis;\n// __Zone_symbol_prefix global can be used to override the default zone\n// symbol prefix with a custom one if needed.\nfunction __symbol__(name) {\n const symbolPrefix = global$2['__Zone_symbol_prefix'] || '__zone_symbol__';\n return symbolPrefix + name;\n}\n\nconst __global = (typeof window !== 'undefined' && window) || (typeof self !== 'undefined' && self) || global;\nclass AsyncTestZoneSpec {\n // Needs to be a getter and not a plain property in order run this just-in-time. Otherwise\n // `__symbol__` would be evaluated during top-level execution prior to the Zone prefix being\n // changed for tests.\n static get symbolParentUnresolved() {\n return __symbol__('parentUnresolved');\n }\n constructor(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._existingFinishTimer = null;\n this.entryFunction = null;\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[__symbol__('supportWaitUnResolvedChainedPromise')] === true;\n }\n isUnresolvedChainedPromisePending() {\n return this.unresolvedChainedPromiseCount > 0;\n }\n _finishCallbackIfDone() {\n // NOTE: Technically the `onHasTask` could fire together with the initial synchronous\n // completion in `onInvoke`. `onHasTask` might call this method when it captured e.g.\n // microtasks in the proxy zone that now complete as part of this async zone run.\n // Consider the following scenario:\n // 1. A test `beforeEach` schedules a microtask in the ProxyZone.\n // 2. An actual empty `it` spec executes in the AsyncTestZone` (using e.g. `waitForAsync`).\n // 3. The `onInvoke` invokes `_finishCallbackIfDone` because the spec runs synchronously.\n // 4. We wait the scheduled timeout (see below) to account for unhandled promises.\n // 5. The microtask from (1) finishes and `onHasTask` is invoked.\n // --> We register a second `_finishCallbackIfDone` even though we have scheduled a timeout.\n // If the finish timeout from below is already scheduled, terminate the existing scheduled\n // finish invocation, avoiding calling `jasmine` `done` multiple times. *Note* that we would\n // want to schedule a new finish callback in case the task state changes again.\n if (this._existingFinishTimer !== null) {\n clearTimeout(this._existingFinishTimer);\n this._existingFinishTimer = null;\n }\n if (!(this._pendingMicroTasks ||\n this._pendingMacroTasks ||\n (this.supportWaitUnresolvedChainedPromise && this.isUnresolvedChainedPromisePending()))) {\n // We wait until the next tick because we would like to catch unhandled promises which could\n // cause test logic to be executed. In such cases we cannot finish with tasks pending then.\n this.runZone.run(() => {\n this._existingFinishTimer = setTimeout(() => {\n if (!this._alreadyErrored && !(this._pendingMicroTasks || this._pendingMacroTasks)) {\n this.finishCallback();\n }\n }, 0);\n });\n }\n }\n patchPromiseForTest() {\n if (!this.supportWaitUnresolvedChainedPromise) {\n return;\n }\n const patchPromiseForTest = Promise[Zone.__symbol__('patchPromiseForTest')];\n if (patchPromiseForTest) {\n patchPromiseForTest();\n }\n }\n unPatchPromiseForTest() {\n if (!this.supportWaitUnresolvedChainedPromise) {\n return;\n }\n const unPatchPromiseForTest = Promise[Zone.__symbol__('unPatchPromiseForTest')];\n if (unPatchPromiseForTest) {\n unPatchPromiseForTest();\n }\n }\n onScheduleTask(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 onInvokeTask(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 onCancelTask(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 onInvoke(parentZoneDelegate, currentZone, targetZone, delegate, applyThis, applyArgs, source) {\n if (!this.entryFunction) {\n this.entryFunction = delegate;\n }\n try {\n this._isSync = true;\n return parentZoneDelegate.invoke(targetZone, delegate, applyThis, applyArgs, source);\n }\n finally {\n // We need to check the delegate is the same as entryFunction or not.\n // Consider the following case.\n //\n // asyncTestZone.run(() => { // Here the delegate will be the entryFunction\n // Zone.current.run(() => { // Here the delegate will not be the entryFunction\n // });\n // });\n //\n // We only want to check whether there are async tasks scheduled\n // for the entry function.\n if (this._isSync && this.entryFunction === delegate) {\n this._finishCallbackIfDone();\n }\n }\n }\n onHandleError(parentZoneDelegate, currentZone, targetZone, error) {\n // Let the parent try to handle the error.\n const result = parentZoneDelegate.handleError(targetZone, error);\n if (result) {\n this.failCallback(error);\n this._alreadyErrored = true;\n }\n return false;\n }\n onHasTask(delegate, current, target, hasTaskState) {\n delegate.hasTask(target, hasTaskState);\n // We should only trigger finishCallback when the target zone is the AsyncTestZone\n // Consider the following cases.\n //\n // const childZone = asyncTestZone.fork({\n // name: 'child',\n // onHasTask: ...\n // });\n //\n // So we have nested zones declared the onHasTask hook, in this case,\n // the onHasTask will be triggered twice, and cause the finishCallbackIfDone()\n // is also be invoked twice. So we need to only trigger the finishCallbackIfDone()\n // when the current zone is the same as the target zone.\n if (current !== target) {\n return;\n }\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}\nfunction patchAsyncTest(Zone) {\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['AsyncTestZoneSpec'] = AsyncTestZoneSpec;\n Zone.__load_patch('asynctest', (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, (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 return new Promise((finishCallback, failCallback) => {\n runInTestZone(fn, this, finishCallback, failCallback);\n });\n };\n };\n function runInTestZone(fn, context, finishCallback, failCallback) {\n const currentZone = Zone.current;\n const 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/plugins/async-test');\n }\n const 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/plugins/proxy');\n }\n const 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 const proxyZone = Zone.current.getZoneWith('ProxyZoneSpec');\n const previousDelegate = proxyZoneSpec.getDelegate();\n proxyZone.parent.run(() => {\n const testZoneSpec = new AsyncTestZoneSpec(() => {\n // Need to restore the original zone.\n if (proxyZoneSpec.getDelegate() == testZoneSpec) {\n // Only reset the zone spec if it's\n // still this one. Otherwise, assume\n // it's OK.\n proxyZoneSpec.setDelegate(previousDelegate);\n }\n testZoneSpec.unPatchPromiseForTest();\n currentZone.run(() => {\n finishCallback();\n });\n }, (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(() => {\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\nconst global$1 = (typeof window === 'object' && window) || (typeof self === 'object' && self) || globalThis.global;\nconst OriginalDate = global$1.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.\nfunction FakeDate() {\n if (arguments.length === 0) {\n const d = new OriginalDate();\n d.setTime(FakeDate.now());\n return d;\n }\n else {\n const args = Array.prototype.slice.call(arguments);\n return new OriginalDate(...args);\n }\n}\nFakeDate.now = function () {\n const fakeAsyncTestZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec');\n if (fakeAsyncTestZoneSpec) {\n return fakeAsyncTestZoneSpec.getFakeSystemTime();\n }\n return OriginalDate.now.apply(this, arguments);\n};\nFakeDate.UTC = OriginalDate.UTC;\nFakeDate.parse = OriginalDate.parse;\n// keep a reference for zone patched timer function\nlet patchedTimers;\nconst timeoutCallback = function () { };\nclass Scheduler {\n // Next scheduler id.\n static { this.nextNodeJSId = 1; }\n static { this.nextId = -1; }\n constructor() {\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 static getNextId() {\n const id = patchedTimers.nativeSetTimeout.call(global$1, timeoutCallback, 0);\n patchedTimers.nativeClearTimeout.call(global$1, id);\n if (typeof id === 'number') {\n return id;\n }\n // in NodeJS, we just use a number for fakeAsync, since it will not\n // conflict with native TimeoutId\n return Scheduler.nextNodeJSId++;\n }\n getCurrentTickTime() {\n return this._currentTickTime;\n }\n getFakeSystemTime() {\n return this._currentFakeBaseSystemTime + this._currentTickTime;\n }\n setFakeBaseSystemTime(fakeBaseSystemTime) {\n this._currentFakeBaseSystemTime = fakeBaseSystemTime;\n }\n getRealSystemTime() {\n return OriginalDate.now();\n }\n scheduleFunction(cb, delay, options) {\n options = {\n ...{\n args: [],\n isPeriodic: false,\n isRequestAnimationFrame: false,\n id: -1,\n isRequeuePeriodic: false,\n },\n ...options,\n };\n let currentId = options.id < 0 ? Scheduler.nextId : options.id;\n Scheduler.nextId = Scheduler.getNextId();\n let endTime = this._currentTickTime + delay;\n // Insert so that scheduler queue remains sorted by end time.\n let 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 let i = 0;\n for (; i < this._schedulerQueue.length; i++) {\n let 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 removeScheduledFunctionWithId(id) {\n for (let 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 removeAll() {\n this._schedulerQueue = [];\n }\n getTimerCount() {\n return this._schedulerQueue.length;\n }\n tickToNext(step = 1, doTick, tickOptions) {\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 const startTime = this._currentTickTime;\n const targetTask = this._schedulerQueue[step - 1];\n this.tick(targetTask.endTime - startTime, doTick, tickOptions);\n }\n tick(millis = 0, doTick, tickOptions) {\n let finalTime = this._currentTickTime + millis;\n let 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 const 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 let 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 let current = schedulerQueue.shift();\n if (!tickOptions.processNewMacroTasksSynchronously) {\n const idx = this._schedulerQueue.indexOf(current);\n if (idx >= 0) {\n this._schedulerQueue.splice(idx, 1);\n }\n }\n lastCurrentTime = this._currentTickTime;\n this._currentTickTime = current.endTime;\n if (doTick) {\n doTick(this._currentTickTime - lastCurrentTime);\n }\n let retval = current.func.apply(global$1, current.isRequestAnimationFrame ? [this._currentTickTime] : current.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((newEntry) => {\n let i = 0;\n for (; i < schedulerQueue.length; i++) {\n const 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 flushOnlyPendingTimers(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 const startTime = this._currentTickTime;\n const lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];\n this.tick(lastTask.endTime - startTime, doTick, { processNewMacroTasksSynchronously: false });\n return this._currentTickTime - startTime;\n }\n flush(limit = 20, flushPeriodic = false, doTick) {\n if (flushPeriodic) {\n return this.flushPeriodic(doTick);\n }\n else {\n return this.flushNonPeriodic(limit, doTick);\n }\n }\n flushPeriodic(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 const startTime = this._currentTickTime;\n const lastTask = this._schedulerQueue[this._schedulerQueue.length - 1];\n this.tick(lastTask.endTime - startTime, doTick);\n return this._currentTickTime - startTime;\n }\n flushNonPeriodic(limit, doTick) {\n const startTime = this._currentTickTime;\n let lastCurrentTime = 0;\n let 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 ' +\n 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((task) => !task.isPeriodic && !task.isRequestAnimationFrame)\n .length === 0) {\n break;\n }\n const 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 const retval = current.func.apply(global$1, 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}\nclass FakeAsyncTestZoneSpec {\n static assertInZone() {\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 constructor(namePrefix, trackPendingRequestAnimationFrame = false, macroTaskOptions) {\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$1[Zone.__symbol__('FakeAsyncTestMacroTask')];\n }\n }\n _fnAndFlush(fn, completers) {\n return (...args) => {\n fn.apply(global$1, args);\n if (this._lastError === null) {\n // Success\n if (completers.onSuccess != null) {\n completers.onSuccess.apply(global$1);\n }\n // Flush microtasks only on success.\n this.flushMicrotasks();\n }\n else {\n // Failure\n if (completers.onError != null) {\n completers.onError.apply(global$1);\n }\n }\n // Return true if there were no errors, false otherwise.\n return this._lastError === null;\n };\n }\n static _removeTimer(timers, id) {\n let index = timers.indexOf(id);\n if (index > -1) {\n timers.splice(index, 1);\n }\n }\n _dequeueTimer(id) {\n return () => {\n FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers, id);\n };\n }\n _requeuePeriodicTimer(fn, interval, args, id) {\n return () => {\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,\n isPeriodic: true,\n id,\n isRequeuePeriodic: true,\n });\n }\n };\n }\n _dequeuePeriodicTimer(id) {\n return () => {\n FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers, id);\n };\n }\n _setTimeout(fn, delay, args, isTimer = true) {\n let removeTimerFn = this._dequeueTimer(Scheduler.nextId);\n // Queue the callback and dequeue the timer on success and error.\n let cb = this._fnAndFlush(fn, { onSuccess: removeTimerFn, onError: removeTimerFn });\n let id = this._scheduler.scheduleFunction(cb, delay, { args, isRequestAnimationFrame: !isTimer });\n if (isTimer) {\n this.pendingTimers.push(id);\n }\n return id;\n }\n _clearTimeout(id) {\n FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers, id);\n this._scheduler.removeScheduledFunctionWithId(id);\n }\n _setInterval(fn, interval, args) {\n let id = Scheduler.nextId;\n let completers = { onSuccess: null, onError: this._dequeuePeriodicTimer(id) };\n let 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, isPeriodic: true });\n this.pendingPeriodicTimers.push(id);\n return id;\n }\n _clearInterval(id) {\n FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers, id);\n this._scheduler.removeScheduledFunctionWithId(id);\n }\n _resetLastErrorAndThrow() {\n let error = this._lastError || this._uncaughtPromiseErrors[0];\n this._uncaughtPromiseErrors.length = 0;\n this._lastError = null;\n throw error;\n }\n getCurrentTickTime() {\n return this._scheduler.getCurrentTickTime();\n }\n getFakeSystemTime() {\n return this._scheduler.getFakeSystemTime();\n }\n setFakeBaseSystemTime(realTime) {\n this._scheduler.setFakeBaseSystemTime(realTime);\n }\n getRealSystemTime() {\n return this._scheduler.getRealSystemTime();\n }\n static patchDate() {\n if (!!global$1[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$1['Date'] === FakeDate) {\n // already patched\n return;\n }\n global$1['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 static resetDate() {\n if (global$1['Date'] === FakeDate) {\n global$1['Date'] = OriginalDate;\n }\n }\n static checkTimerPatch() {\n if (!patchedTimers) {\n throw new Error('Expected timers to have been patched.');\n }\n if (global$1.setTimeout !== patchedTimers.setTimeout) {\n global$1.setTimeout = patchedTimers.setTimeout;\n global$1.clearTimeout = patchedTimers.clearTimeout;\n }\n if (global$1.setInterval !== patchedTimers.setInterval) {\n global$1.setInterval = patchedTimers.setInterval;\n global$1.clearInterval = patchedTimers.clearInterval;\n }\n }\n lockDatePatch() {\n this.patchDateLocked = true;\n FakeAsyncTestZoneSpec.patchDate();\n }\n unlockDatePatch() {\n this.patchDateLocked = false;\n FakeAsyncTestZoneSpec.resetDate();\n }\n tickToNext(steps = 1, doTick, 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 tick(millis = 0, doTick, 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 flushMicrotasks() {\n FakeAsyncTestZoneSpec.assertInZone();\n const flushErrors = () => {\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 let microtask = this._microtasks.shift();\n microtask.func.apply(microtask.target, microtask.args);\n }\n flushErrors();\n }\n flush(limit, flushPeriodic, doTick) {\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n const elapsed = this._scheduler.flush(limit, flushPeriodic, doTick);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n return elapsed;\n }\n flushOnlyPendingTimers(doTick) {\n FakeAsyncTestZoneSpec.assertInZone();\n this.flushMicrotasks();\n const elapsed = this._scheduler.flushOnlyPendingTimers(doTick);\n if (this._lastError !== null) {\n this._resetLastErrorAndThrow();\n }\n return elapsed;\n }\n removeAllTimers() {\n FakeAsyncTestZoneSpec.assertInZone();\n this._scheduler.removeAll();\n this.pendingPeriodicTimers = [];\n this.pendingTimers = [];\n }\n getTimerCount() {\n return this._scheduler.getTimerCount() + this._microtasks.length;\n }\n onScheduleTask(delegate, current, target, task) {\n switch (task.type) {\n case 'microTask':\n let 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 let additionalArgs;\n if (args) {\n let 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 const macroTaskOption = this.findMacroTaskOption(task);\n if (macroTaskOption) {\n const args = task.data && task.data['args'];\n const delay = args && args.length > 1 ? args[1] : 0;\n let callbackArgs = macroTaskOption.callbackArgs ? macroTaskOption.callbackArgs : args;\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 onCancelTask(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 const macroTaskOption = this.findMacroTaskOption(task);\n if (macroTaskOption) {\n const handleId = task.data['handleId'];\n return macroTaskOption.isPeriodic\n ? this._clearInterval(handleId)\n : this._clearTimeout(handleId);\n }\n return delegate.cancelTask(target, task);\n }\n }\n onInvoke(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 findMacroTaskOption(task) {\n if (!this.macroTaskOptions) {\n return null;\n }\n for (let i = 0; i < this.macroTaskOptions.length; i++) {\n const macroTaskOption = this.macroTaskOptions[i];\n if (macroTaskOption.source === task.source) {\n return macroTaskOption;\n }\n }\n return null;\n }\n onHandleError(parentZoneDelegate, currentZone, targetZone, error) {\n this._lastError = error;\n return false; // Don't propagate error to parent zone.\n }\n}\nlet _fakeAsyncTestZoneSpec = null;\nfunction getProxyZoneSpec() {\n return Zone && Zone['ProxyZoneSpec'];\n}\n/**\n * Clears out the shared fake async zone for a test.\n * To be called in a global `beforeEach`.\n *\n * @experimental\n */\nfunction 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 * When flush is `false`, if there are any pending timers at the end of the function,\n * 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 * @param options\n * flush: when true, will drain the macrotask queue after the test function completes.\n * @returns The function wrapped to be executed in the fakeAsync zone\n *\n * @experimental\n */\nfunction fakeAsync(fn, options = {}) {\n const { flush = false } = options;\n // Not using an arrow function to preserve context passed from call site\n const fakeAsyncFn = function (...args) {\n const 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/plugins/proxy');\n }\n const 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 const FakeAsyncTestZoneSpec = Zone && Zone['FakeAsyncTestZoneSpec'];\n if (proxyZoneSpec.getDelegate() instanceof FakeAsyncTestZoneSpec) {\n throw new Error('fakeAsync() calls can not be nested');\n }\n _fakeAsyncTestZoneSpec = new FakeAsyncTestZoneSpec();\n }\n let res;\n const lastProxyZoneSpec = proxyZoneSpec.getDelegate();\n proxyZoneSpec.setDelegate(_fakeAsyncTestZoneSpec);\n _fakeAsyncTestZoneSpec.lockDatePatch();\n try {\n res = fn.apply(this, args);\n if (flush) {\n _fakeAsyncTestZoneSpec.flush(20, true);\n }\n else {\n flushMicrotasks();\n }\n }\n finally {\n proxyZoneSpec.setDelegate(lastProxyZoneSpec);\n }\n if (!flush) {\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 }\n return res;\n }\n finally {\n resetFakeAsyncZone();\n }\n };\n fakeAsyncFn.isFakeAsync = true;\n return fakeAsyncFn;\n}\nfunction _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\n * callback has been executed.\n *\n * ## Example\n *\n * {@example core/testing/ts/fake_async.ts region='basic'}\n *\n * @experimental\n */\nfunction tick(millis = 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 */\nfunction flush(maxTurns) {\n return _getFakeAsyncZoneSpec().flush(maxTurns);\n}\n/**\n * Discard all remaining periodic tasks.\n *\n * @experimental\n */\nfunction discardPeriodicTasks() {\n const zoneSpec = _getFakeAsyncZoneSpec();\n zoneSpec.pendingPeriodicTimers;\n zoneSpec.pendingPeriodicTimers.length = 0;\n}\n/**\n * Flush any pending microtasks.\n *\n * @experimental\n */\nfunction flushMicrotasks() {\n _getFakeAsyncZoneSpec().flushMicrotasks();\n}\nfunction patchFakeAsyncTest(Zone) {\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['FakeAsyncTestZoneSpec'] = FakeAsyncTestZoneSpec;\n Zone.__load_patch('fakeasync', (global, Zone, api) => {\n Zone[api.symbol('fakeAsyncTest')] = {\n resetFakeAsyncZone,\n flushMicrotasks,\n discardPeriodicTasks,\n tick,\n flush,\n fakeAsync,\n };\n }, true);\n patchedTimers = {\n setTimeout: global$1.setTimeout,\n setInterval: global$1.setInterval,\n clearTimeout: global$1.clearTimeout,\n clearInterval: global$1.clearInterval,\n nativeSetTimeout: global$1[Zone.__symbol__('setTimeout')],\n nativeClearTimeout: global$1[Zone.__symbol__('clearTimeout')],\n };\n Scheduler.nextId = Scheduler.getNextId();\n}\n\n/**\n * @fileoverview\n * @suppress {globalThis}\n */\nfunction patchLongStackTrace(Zone) {\n const NEWLINE = '\\n';\n const IGNORE_FRAMES = {};\n const creationTrace = '__creationTrace__';\n const ERROR_TAG = 'STACKTRACE TRACKING';\n const SEP_TAG = '__SEP_TAG__';\n let sepTemplate = SEP_TAG + '@[native]';\n class LongStackTrace {\n constructor() {\n this.error = getStacktrace();\n this.timestamp = new Date();\n }\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 const error = getStacktraceWithUncaughtError();\n const caughtError = getStacktraceWithCaughtError();\n const getStacktrace = error.stack\n ? getStacktraceWithUncaughtError\n : caughtError.stack\n ? getStacktraceWithCaughtError\n : getStacktraceWithUncaughtError;\n function getFrames(error) {\n return error.stack ? error.stack.split(NEWLINE) : [];\n }\n function addErrorStack(lines, error) {\n let trace = getFrames(error);\n for (let i = 0; i < trace.length; i++) {\n const 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 const longTrace = [stack ? stack.trim() : ''];\n if (frames) {\n let timestamp = new Date().getTime();\n for (let i = 0; i < frames.length; i++) {\n const traceFrames = frames[i];\n const lastTime = traceFrames.timestamp;\n let 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, // Max number of task to keep the stack trace for.\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 const 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 const currentTask = Zone.currentTask;\n let 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 = { ...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 const parentTask = Zone.currentTask || error.task;\n if (error instanceof Error && parentTask) {\n const longStack = renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], error.stack);\n try {\n error.stack = error.longStack = longStack;\n }\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 const frames = [];\n captureStackTraces(frames, 2);\n const frames1 = frames[0];\n const frames2 = frames[1];\n for (let i = 0; i < frames1.length; i++) {\n const frame1 = frames1[i];\n if (frame1.indexOf(ERROR_TAG) == -1) {\n let match = frame1.match(/^\\s*at\\s+/);\n if (match) {\n sepTemplate = match[0] + SEP_TAG + ' (http://localhost)';\n break;\n }\n }\n }\n for (let i = 0; i < frames1.length; i++) {\n const frame1 = frames1[i];\n const frame2 = frames2[i];\n if (frame1 === frame2) {\n IGNORE_FRAMES[frame1] = true;\n }\n else {\n break;\n }\n }\n }\n computeIgnoreFrames();\n}\n\nclass ProxyZoneSpec {\n static get() {\n return Zone.current.get('ProxyZoneSpec');\n }\n static isLoaded() {\n return ProxyZoneSpec.get() instanceof ProxyZoneSpec;\n }\n static assertPresent() {\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 constructor(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 setDelegate(delegateSpec) {\n const isNewDelegate = this._delegateSpec !== delegateSpec;\n this._delegateSpec = delegateSpec;\n this.propertyKeys && this.propertyKeys.forEach((key) => delete this.properties[key]);\n this.propertyKeys = null;\n if (delegateSpec && delegateSpec.properties) {\n this.propertyKeys = Object.keys(delegateSpec.properties);\n this.propertyKeys.forEach((k) => (this.properties[k] = delegateSpec.properties[k]));\n }\n // if a new delegateSpec was set, check if we need to trigger hasTask\n if (isNewDelegate &&\n this.lastTaskState &&\n (this.lastTaskState.macroTask || this.lastTaskState.microTask)) {\n this.isNeedToTriggerHasTask = true;\n }\n }\n getDelegate() {\n return this._delegateSpec;\n }\n resetDelegate() {\n this.getDelegate();\n this.setDelegate(this.defaultSpecDelegate);\n }\n tryTriggerHasTask(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 removeFromTasks(task) {\n if (!this.tasks) {\n return;\n }\n for (let 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 getAndClearPendingTasksInfo() {\n if (this.tasks.length === 0) {\n return '';\n }\n const taskInfo = this.tasks.map((task) => {\n const dataInfo = task.data &&\n Object.keys(task.data)\n .map((key) => {\n return key + ':' + task.data[key];\n })\n .join(',');\n return `type: ${task.type}, source: ${task.source}, args: {${dataInfo}}`;\n });\n const pendingTasksInfo = '--Pending async tasks are: [' + taskInfo + ']';\n // clear tasks\n this.tasks = [];\n return pendingTasksInfo;\n }\n onFork(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 onIntercept(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 onInvoke(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 onHandleError(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 onScheduleTask(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 onInvokeTask(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 onCancelTask(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 onHasTask(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}\nfunction patchProxyZoneSpec(Zone) {\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['ProxyZoneSpec'] = ProxyZoneSpec;\n}\n\nfunction patchSyncTest(Zone) {\n class SyncTestZoneSpec {\n constructor(namePrefix) {\n this.runZone = Zone.current;\n this.name = 'syncTestZone for ' + namePrefix;\n }\n onScheduleTask(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 (${this.name}).`);\n case 'eventTask':\n task = delegate.scheduleTask(target, task);\n break;\n }\n return task;\n }\n }\n // Export the class so that new instances can be created with proper\n // constructor params.\n Zone['SyncTestZoneSpec'] = SyncTestZoneSpec;\n}\n\nfunction patchPromiseTesting(Zone) {\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', (global, Zone, api) => {\n const symbolState = api.symbol('state');\n const UNRESOLVED = null;\n const 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 let 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 const chained = oriThen.apply(this, arguments);\n if (this[symbolState] === UNRESOLVED) {\n // parent promise is unresolved.\n const 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 const oriThen = Promise[Zone.__symbol__('ZonePromiseThen')];\n if (oriThen) {\n Promise.prototype.then = oriThen;\n Promise[Zone.__symbol__('ZonePromiseThen')] = undefined;\n }\n };\n });\n}\n\nfunction rollupTesting(Zone) {\n patchLongStackTrace(Zone);\n patchProxyZoneSpec(Zone);\n patchSyncTest(Zone);\n patchJasmine(Zone);\n patchJest(Zone);\n patchMocha(Zone);\n patchAsyncTest(Zone);\n patchFakeAsyncTest(Zone);\n patchPromiseTesting(Zone);\n}\n\nrollupTesting(Zone);\n","'use strict';\n/**\n * @license Angular v\n * (c) 2010-2024 Google LLC. https://angular.io/\n * License: MIT\n */\nconst global = globalThis;\n// __Zone_symbol_prefix global can be used to override the default zone\n// symbol prefix with a custom one if needed.\nfunction __symbol__(name) {\n const symbolPrefix = global['__Zone_symbol_prefix'] || '__zone_symbol__';\n return symbolPrefix + name;\n}\nfunction initZone() {\n const performance = global['performance'];\n function mark(name) {\n performance && performance['mark'] && performance['mark'](name);\n }\n function performanceMeasure(name, label) {\n performance && performance['measure'] && performance['measure'](name, label);\n }\n mark('Zone');\n class ZoneImpl {\n // tslint:disable-next-line:require-internal-with-underscore\n static { this.__symbol__ = __symbol__; }\n static assertZonePatched() {\n if (global['Promise'] !== patches['ZoneAwarePromise']) {\n throw new Error('Zone.js has detected that ZoneAwarePromise `(window|global).Promise` ' +\n 'has been overwritten.\\n' +\n 'Most likely cause is that a Promise polyfill has been loaded ' +\n 'after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. ' +\n 'If you must load one, do so before loading zone.js.)');\n }\n }\n static get root() {\n let zone = ZoneImpl.current;\n while (zone.parent) {\n zone = zone.parent;\n }\n return zone;\n }\n static get current() {\n return _currentZoneFrame.zone;\n }\n static get currentTask() {\n return _currentTask;\n }\n // tslint:disable-next-line:require-internal-with-underscore\n static __load_patch(name, fn, ignoreDuplicate = false) {\n if (patches.hasOwnProperty(name)) {\n // `checkDuplicate` option is defined from global variable\n // so it works for all modules.\n // `ignoreDuplicate` can work for the specified module\n const checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true;\n if (!ignoreDuplicate && checkDuplicate) {\n throw Error('Already loaded patch: ' + name);\n }\n }\n else if (!global['__Zone_disable_' + name]) {\n const perfName = 'Zone:' + name;\n mark(perfName);\n patches[name] = fn(global, ZoneImpl, _api);\n performanceMeasure(perfName, perfName);\n }\n }\n get parent() {\n return this._parent;\n }\n get name() {\n return this._name;\n }\n constructor(parent, zoneSpec) {\n this._parent = parent;\n this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '';\n this._properties = (zoneSpec && zoneSpec.properties) || {};\n this._zoneDelegate = new _ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n }\n get(key) {\n const zone = this.getZoneWith(key);\n if (zone)\n return zone._properties[key];\n }\n getZoneWith(key) {\n let current = this;\n while (current) {\n if (current._properties.hasOwnProperty(key)) {\n return current;\n }\n current = current._parent;\n }\n return null;\n }\n fork(zoneSpec) {\n if (!zoneSpec)\n throw new Error('ZoneSpec required!');\n return this._zoneDelegate.fork(this, zoneSpec);\n }\n wrap(callback, source) {\n if (typeof callback !== 'function') {\n throw new Error('Expecting function got: ' + callback);\n }\n const _callback = this._zoneDelegate.intercept(this, callback, source);\n const zone = this;\n return function () {\n return zone.runGuarded(_callback, this, arguments, source);\n };\n }\n run(callback, applyThis, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n }\n finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runGuarded(callback, applyThis = null, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n }\n catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n }\n finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runTask(task, applyThis, applyArgs) {\n if (task.zone != this) {\n throw new Error('A task can only be run in the zone of creation! (Creation: ' +\n (task.zone || NO_ZONE).name +\n '; Execution: ' +\n this.name +\n ')');\n }\n const zoneTask = task;\n // https://github.com/angular/zone.js/issues/778, sometimes eventTask\n // will run in notScheduled(canceled) state, we should not try to\n // run such kind of task but just return\n const { type, data: { isPeriodic = false, isRefreshable = false } = {} } = task;\n if (task.state === notScheduled && (type === eventTask || type === macroTask)) {\n return;\n }\n const reEntryGuard = task.state != running;\n reEntryGuard && zoneTask._transitionTo(running, scheduled);\n const previousTask = _currentTask;\n _currentTask = zoneTask;\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n if (type == macroTask && task.data && !isPeriodic && !isRefreshable) {\n task.cancelFn = undefined;\n }\n try {\n return this._zoneDelegate.invokeTask(this, zoneTask, applyThis, applyArgs);\n }\n catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n }\n finally {\n // if the task's state is notScheduled or unknown, then it has already been cancelled\n // we should not reset the state to scheduled\n const state = task.state;\n if (state !== notScheduled && state !== unknown) {\n if (type == eventTask || isPeriodic || (isRefreshable && state === scheduling)) {\n reEntryGuard && zoneTask._transitionTo(scheduled, running, scheduling);\n }\n else {\n const zoneDelegates = zoneTask._zoneDelegates;\n this._updateTaskCount(zoneTask, -1);\n reEntryGuard && zoneTask._transitionTo(notScheduled, running, notScheduled);\n if (isRefreshable) {\n zoneTask._zoneDelegates = zoneDelegates;\n }\n }\n }\n _currentZoneFrame = _currentZoneFrame.parent;\n _currentTask = previousTask;\n }\n }\n scheduleTask(task) {\n if (task.zone && task.zone !== this) {\n // check if the task was rescheduled, the newZone\n // should not be the children of the original zone\n let newZone = this;\n while (newZone) {\n if (newZone === task.zone) {\n throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${task.zone.name}`);\n }\n newZone = newZone.parent;\n }\n }\n task._transitionTo(scheduling, notScheduled);\n const zoneDelegates = [];\n task._zoneDelegates = zoneDelegates;\n task._zone = this;\n try {\n task = this._zoneDelegate.scheduleTask(this, task);\n }\n catch (err) {\n // should set task's state to unknown when scheduleTask throw error\n // because the err may from reschedule, so the fromState maybe notScheduled\n task._transitionTo(unknown, scheduling, notScheduled);\n // TODO: @JiaLiPassion, should we check the result from handleError?\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n if (task._zoneDelegates === zoneDelegates) {\n // we have to check because internally the delegate can reschedule the task.\n this._updateTaskCount(task, 1);\n }\n if (task.state == scheduling) {\n task._transitionTo(scheduled, scheduling);\n }\n return task;\n }\n scheduleMicroTask(source, callback, data, customSchedule) {\n return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined));\n }\n scheduleMacroTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n }\n scheduleEventTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n }\n cancelTask(task) {\n if (task.zone != this)\n throw new Error('A task can only be cancelled in the zone of creation! (Creation: ' +\n (task.zone || NO_ZONE).name +\n '; Execution: ' +\n this.name +\n ')');\n if (task.state !== scheduled && task.state !== running) {\n return;\n }\n task._transitionTo(canceling, scheduled, running);\n try {\n this._zoneDelegate.cancelTask(this, task);\n }\n catch (err) {\n // if error occurs when cancelTask, transit the state to unknown\n task._transitionTo(unknown, canceling);\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n this._updateTaskCount(task, -1);\n task._transitionTo(notScheduled, canceling);\n task.runCount = -1;\n return task;\n }\n _updateTaskCount(task, count) {\n const zoneDelegates = task._zoneDelegates;\n if (count == -1) {\n task._zoneDelegates = null;\n }\n for (let i = 0; i < zoneDelegates.length; i++) {\n zoneDelegates[i]._updateTaskCount(task.type, count);\n }\n }\n }\n const DELEGATE_ZS = {\n name: '',\n onHasTask: (delegate, _, target, hasTaskState) => delegate.hasTask(target, hasTaskState),\n onScheduleTask: (delegate, _, target, task) => delegate.scheduleTask(target, task),\n onInvokeTask: (delegate, _, target, task, applyThis, applyArgs) => delegate.invokeTask(target, task, applyThis, applyArgs),\n onCancelTask: (delegate, _, target, task) => delegate.cancelTask(target, task),\n };\n class _ZoneDelegate {\n get zone() {\n return this._zone;\n }\n constructor(zone, parentDelegate, zoneSpec) {\n this._taskCounts = {\n 'microTask': 0,\n 'macroTask': 0,\n 'eventTask': 0,\n };\n this._zone = zone;\n this._parentDelegate = parentDelegate;\n this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n this._forkCurrZone =\n zoneSpec && (zoneSpec.onFork ? this._zone : parentDelegate._forkCurrZone);\n this._interceptZS =\n zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n this._interceptDlgt =\n zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n this._interceptCurrZone =\n zoneSpec && (zoneSpec.onIntercept ? this._zone : parentDelegate._interceptCurrZone);\n this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n this._invokeDlgt =\n zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n this._invokeCurrZone =\n zoneSpec && (zoneSpec.onInvoke ? this._zone : parentDelegate._invokeCurrZone);\n this._handleErrorZS =\n zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n this._handleErrorDlgt =\n zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n this._handleErrorCurrZone =\n zoneSpec && (zoneSpec.onHandleError ? this._zone : parentDelegate._handleErrorCurrZone);\n this._scheduleTaskZS =\n zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n this._scheduleTaskDlgt =\n zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n this._scheduleTaskCurrZone =\n zoneSpec && (zoneSpec.onScheduleTask ? this._zone : parentDelegate._scheduleTaskCurrZone);\n this._invokeTaskZS =\n zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n this._invokeTaskDlgt =\n zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n this._invokeTaskCurrZone =\n zoneSpec && (zoneSpec.onInvokeTask ? this._zone : parentDelegate._invokeTaskCurrZone);\n this._cancelTaskZS =\n zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n this._cancelTaskDlgt =\n zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n this._cancelTaskCurrZone =\n zoneSpec && (zoneSpec.onCancelTask ? this._zone : parentDelegate._cancelTaskCurrZone);\n this._hasTaskZS = null;\n this._hasTaskDlgt = null;\n this._hasTaskDlgtOwner = null;\n this._hasTaskCurrZone = null;\n const zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n const parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n if (zoneSpecHasTask || parentHasTask) {\n // If we need to report hasTask, than this ZS needs to do ref counting on tasks. In such\n // a case all task related interceptors must go through this ZD. We can't short circuit it.\n this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n this._hasTaskDlgt = parentDelegate;\n this._hasTaskDlgtOwner = this;\n this._hasTaskCurrZone = this._zone;\n if (!zoneSpec.onScheduleTask) {\n this._scheduleTaskZS = DELEGATE_ZS;\n this._scheduleTaskDlgt = parentDelegate;\n this._scheduleTaskCurrZone = this._zone;\n }\n if (!zoneSpec.onInvokeTask) {\n this._invokeTaskZS = DELEGATE_ZS;\n this._invokeTaskDlgt = parentDelegate;\n this._invokeTaskCurrZone = this._zone;\n }\n if (!zoneSpec.onCancelTask) {\n this._cancelTaskZS = DELEGATE_ZS;\n this._cancelTaskDlgt = parentDelegate;\n this._cancelTaskCurrZone = this._zone;\n }\n }\n }\n fork(targetZone, zoneSpec) {\n return this._forkZS\n ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec)\n : new ZoneImpl(targetZone, zoneSpec);\n }\n intercept(targetZone, callback, source) {\n return this._interceptZS\n ? this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source)\n : callback;\n }\n invoke(targetZone, callback, applyThis, applyArgs, source) {\n return this._invokeZS\n ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source)\n : callback.apply(applyThis, applyArgs);\n }\n handleError(targetZone, error) {\n return this._handleErrorZS\n ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error)\n : true;\n }\n scheduleTask(targetZone, task) {\n let returnTask = task;\n if (this._scheduleTaskZS) {\n if (this._hasTaskZS) {\n returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n }\n returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task);\n if (!returnTask)\n returnTask = task;\n }\n else {\n if (task.scheduleFn) {\n task.scheduleFn(task);\n }\n else if (task.type == microTask) {\n scheduleMicroTask(task);\n }\n else {\n throw new Error('Task is missing scheduleFn.');\n }\n }\n return returnTask;\n }\n invokeTask(targetZone, task, applyThis, applyArgs) {\n return this._invokeTaskZS\n ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs)\n : task.callback.apply(applyThis, applyArgs);\n }\n cancelTask(targetZone, task) {\n let value;\n if (this._cancelTaskZS) {\n value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n }\n else {\n if (!task.cancelFn) {\n throw Error('Task is not cancelable');\n }\n value = task.cancelFn(task);\n }\n return value;\n }\n hasTask(targetZone, isEmpty) {\n // hasTask should not throw error so other ZoneDelegate\n // can still trigger hasTask callback\n try {\n this._hasTaskZS &&\n this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n }\n catch (err) {\n this.handleError(targetZone, err);\n }\n }\n // tslint:disable-next-line:require-internal-with-underscore\n _updateTaskCount(type, count) {\n const counts = this._taskCounts;\n const prev = counts[type];\n const next = (counts[type] = prev + count);\n if (next < 0) {\n throw new Error('More tasks executed then were scheduled.');\n }\n if (prev == 0 || next == 0) {\n const isEmpty = {\n microTask: counts['microTask'] > 0,\n macroTask: counts['macroTask'] > 0,\n eventTask: counts['eventTask'] > 0,\n change: type,\n };\n this.hasTask(this._zone, isEmpty);\n }\n }\n }\n class ZoneTask {\n constructor(type, source, callback, options, scheduleFn, cancelFn) {\n // tslint:disable-next-line:require-internal-with-underscore\n this._zone = null;\n this.runCount = 0;\n // tslint:disable-next-line:require-internal-with-underscore\n this._zoneDelegates = null;\n // tslint:disable-next-line:require-internal-with-underscore\n this._state = 'notScheduled';\n this.type = type;\n this.source = source;\n this.data = options;\n this.scheduleFn = scheduleFn;\n this.cancelFn = cancelFn;\n if (!callback) {\n throw new Error('callback is not defined');\n }\n this.callback = callback;\n const self = this;\n // TODO: @JiaLiPassion options should have interface\n if (type === eventTask && options && options.useG) {\n this.invoke = ZoneTask.invokeTask;\n }\n else {\n this.invoke = function () {\n return ZoneTask.invokeTask.call(global, self, this, arguments);\n };\n }\n }\n static invokeTask(task, target, args) {\n if (!task) {\n task = this;\n }\n _numberOfNestedTaskFrames++;\n try {\n task.runCount++;\n return task.zone.runTask(task, target, args);\n }\n finally {\n if (_numberOfNestedTaskFrames == 1) {\n drainMicroTaskQueue();\n }\n _numberOfNestedTaskFrames--;\n }\n }\n get zone() {\n return this._zone;\n }\n get state() {\n return this._state;\n }\n cancelScheduleRequest() {\n this._transitionTo(notScheduled, scheduling);\n }\n // tslint:disable-next-line:require-internal-with-underscore\n _transitionTo(toState, fromState1, fromState2) {\n if (this._state === fromState1 || this._state === fromState2) {\n this._state = toState;\n if (toState == notScheduled) {\n this._zoneDelegates = null;\n }\n }\n else {\n throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? \" or '\" + fromState2 + \"'\" : ''}, was '${this._state}'.`);\n }\n }\n toString() {\n if (this.data && typeof this.data.handleId !== 'undefined') {\n return this.data.handleId.toString();\n }\n else {\n return Object.prototype.toString.call(this);\n }\n }\n // add toJSON method to prevent cyclic error when\n // call JSON.stringify(zoneTask)\n toJSON() {\n return {\n type: this.type,\n state: this.state,\n source: this.source,\n zone: this.zone.name,\n runCount: this.runCount,\n };\n }\n }\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n /// MICROTASK QUEUE\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n const symbolSetTimeout = __symbol__('setTimeout');\n const symbolPromise = __symbol__('Promise');\n const symbolThen = __symbol__('then');\n let _microTaskQueue = [];\n let _isDrainingMicrotaskQueue = false;\n let nativeMicroTaskQueuePromise;\n function nativeScheduleMicroTask(func) {\n if (!nativeMicroTaskQueuePromise) {\n if (global[symbolPromise]) {\n nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0);\n }\n }\n if (nativeMicroTaskQueuePromise) {\n let nativeThen = nativeMicroTaskQueuePromise[symbolThen];\n if (!nativeThen) {\n // native Promise is not patchable, we need to use `then` directly\n // issue 1078\n nativeThen = nativeMicroTaskQueuePromise['then'];\n }\n nativeThen.call(nativeMicroTaskQueuePromise, func);\n }\n else {\n global[symbolSetTimeout](func, 0);\n }\n }\n function scheduleMicroTask(task) {\n // if we are not running in any task, and there has not been anything scheduled\n // we must bootstrap the initial task creation by manually scheduling the drain\n if (_numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0) {\n // We are not running in Task, so we need to kickstart the microtask queue.\n nativeScheduleMicroTask(drainMicroTaskQueue);\n }\n task && _microTaskQueue.push(task);\n }\n function drainMicroTaskQueue() {\n if (!_isDrainingMicrotaskQueue) {\n _isDrainingMicrotaskQueue = true;\n while (_microTaskQueue.length) {\n const queue = _microTaskQueue;\n _microTaskQueue = [];\n for (let i = 0; i < queue.length; i++) {\n const task = queue[i];\n try {\n task.zone.runTask(task, null, null);\n }\n catch (error) {\n _api.onUnhandledError(error);\n }\n }\n }\n _api.microtaskDrainDone();\n _isDrainingMicrotaskQueue = false;\n }\n }\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n /// BOOTSTRAP\n //////////////////////////////////////////////////////\n //////////////////////////////////////////////////////\n const NO_ZONE = { name: 'NO ZONE' };\n const notScheduled = 'notScheduled', scheduling = 'scheduling', scheduled = 'scheduled', running = 'running', canceling = 'canceling', unknown = 'unknown';\n const microTask = 'microTask', macroTask = 'macroTask', eventTask = 'eventTask';\n const patches = {};\n const _api = {\n symbol: __symbol__,\n currentZoneFrame: () => _currentZoneFrame,\n onUnhandledError: noop,\n microtaskDrainDone: noop,\n scheduleMicroTask: scheduleMicroTask,\n showUncaughtError: () => !ZoneImpl[__symbol__('ignoreConsoleErrorUncaughtError')],\n patchEventTarget: () => [],\n patchOnProperties: noop,\n patchMethod: () => noop,\n bindArguments: () => [],\n patchThen: () => noop,\n patchMacroTask: () => noop,\n patchEventPrototype: () => noop,\n isIEOrEdge: () => false,\n getGlobalObjects: () => undefined,\n ObjectDefineProperty: () => noop,\n ObjectGetOwnPropertyDescriptor: () => undefined,\n ObjectCreate: () => undefined,\n ArraySlice: () => [],\n patchClass: () => noop,\n wrapWithCurrentZone: () => noop,\n filterProperties: () => [],\n attachOriginToPatched: () => noop,\n _redefineProperty: () => noop,\n patchCallbacks: () => noop,\n nativeScheduleMicroTask: nativeScheduleMicroTask,\n };\n let _currentZoneFrame = { parent: null, zone: new ZoneImpl(null, null) };\n let _currentTask = null;\n let _numberOfNestedTaskFrames = 0;\n function noop() { }\n performanceMeasure('Zone', 'Zone');\n return ZoneImpl;\n}\n\nfunction loadZone() {\n // if global['Zone'] already exists (maybe zone.js was already loaded or\n // some other lib also registered a global object named Zone), we may need\n // to throw an error, but sometimes user may not want this error.\n // For example,\n // we have two web pages, page1 includes zone.js, page2 doesn't.\n // and the 1st time user load page1 and page2, everything work fine,\n // but when user load page2 again, error occurs because global['Zone'] already exists.\n // so we add a flag to let user choose whether to throw this error or not.\n // By default, if existing Zone is from zone.js, we will not throw the error.\n const global = globalThis;\n const checkDuplicate = global[__symbol__('forceDuplicateZoneCheck')] === true;\n if (global['Zone'] && (checkDuplicate || typeof global['Zone'].__symbol__ !== 'function')) {\n throw new Error('Zone already loaded.');\n }\n // Initialize global `Zone` constant.\n global['Zone'] ??= initZone();\n return global['Zone'];\n}\n\n/**\n * Suppress closure compiler errors about unknown 'Zone' variable\n * @fileoverview\n * @suppress {undefinedVars,globalThis,missingRequire}\n */\n// issue #989, to reduce bundle size, use short name\n/** Object.getOwnPropertyDescriptor */\nconst ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n/** Object.defineProperty */\nconst ObjectDefineProperty = Object.defineProperty;\n/** Object.getPrototypeOf */\nconst ObjectGetPrototypeOf = Object.getPrototypeOf;\n/** Object.create */\nconst ObjectCreate = Object.create;\n/** Array.prototype.slice */\nconst ArraySlice = Array.prototype.slice;\n/** addEventListener string const */\nconst ADD_EVENT_LISTENER_STR = 'addEventListener';\n/** removeEventListener string const */\nconst REMOVE_EVENT_LISTENER_STR = 'removeEventListener';\n/** zoneSymbol addEventListener */\nconst ZONE_SYMBOL_ADD_EVENT_LISTENER = __symbol__(ADD_EVENT_LISTENER_STR);\n/** zoneSymbol removeEventListener */\nconst ZONE_SYMBOL_REMOVE_EVENT_LISTENER = __symbol__(REMOVE_EVENT_LISTENER_STR);\n/** true string const */\nconst TRUE_STR = 'true';\n/** false string const */\nconst FALSE_STR = 'false';\n/** Zone symbol prefix string const. */\nconst ZONE_SYMBOL_PREFIX = __symbol__('');\nfunction wrapWithCurrentZone(callback, source) {\n return Zone.current.wrap(callback, source);\n}\nfunction scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule, customCancel) {\n return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel);\n}\nconst zoneSymbol = __symbol__;\nconst isWindowExists = typeof window !== 'undefined';\nconst internalWindow = isWindowExists ? window : undefined;\nconst _global = (isWindowExists && internalWindow) || globalThis;\nconst REMOVE_ATTRIBUTE = 'removeAttribute';\nfunction bindArguments(args, source) {\n for (let i = args.length - 1; i >= 0; i--) {\n if (typeof args[i] === 'function') {\n args[i] = wrapWithCurrentZone(args[i], source + '_' + i);\n }\n }\n return args;\n}\nfunction patchPrototype(prototype, fnNames) {\n const source = prototype.constructor['name'];\n for (let i = 0; i < fnNames.length; i++) {\n const name = fnNames[i];\n const delegate = prototype[name];\n if (delegate) {\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name);\n if (!isPropertyWritable(prototypeDesc)) {\n continue;\n }\n prototype[name] = ((delegate) => {\n const patched = function () {\n return delegate.apply(this, bindArguments(arguments, source + '.' + name));\n };\n attachOriginToPatched(patched, delegate);\n return patched;\n })(delegate);\n }\n }\n}\nfunction isPropertyWritable(propertyDesc) {\n if (!propertyDesc) {\n return true;\n }\n if (propertyDesc.writable === false) {\n return false;\n }\n return !(typeof propertyDesc.get === 'function' && typeof propertyDesc.set === 'undefined');\n}\nconst isWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;\n// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n// this code.\nconst isNode = !('nw' in _global) &&\n typeof _global.process !== 'undefined' &&\n _global.process.toString() === '[object process]';\nconst isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow['HTMLElement']);\n// we are in electron of nw, so we are both browser and nodejs\n// Make sure to access `process` through `_global` so that WebPack does not accidentally browserify\n// this code.\nconst isMix = typeof _global.process !== 'undefined' &&\n _global.process.toString() === '[object process]' &&\n !isWebWorker &&\n !!(isWindowExists && internalWindow['HTMLElement']);\nconst zoneSymbolEventNames$1 = {};\nconst enableBeforeunloadSymbol = zoneSymbol('enable_beforeunload');\nconst wrapFn = function (event) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n let eventNameSymbol = zoneSymbolEventNames$1[event.type];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames$1[event.type] = zoneSymbol('ON_PROPERTY' + event.type);\n }\n const target = this || event.target || _global;\n const listener = target[eventNameSymbol];\n let result;\n if (isBrowser && target === internalWindow && event.type === 'error') {\n // window.onerror have different signature\n // https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror\n // and onerror callback will prevent default when callback return true\n const errorEvent = event;\n result =\n listener &&\n listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);\n if (result === true) {\n event.preventDefault();\n }\n }\n else {\n result = listener && listener.apply(this, arguments);\n if (\n // https://github.com/angular/angular/issues/47579\n // https://www.w3.org/TR/2011/WD-html5-20110525/history.html#beforeunloadevent\n // This is the only specific case we should check for. The spec defines that the\n // `returnValue` attribute represents the message to show the user. When the event\n // is created, this attribute must be set to the empty string.\n event.type === 'beforeunload' &&\n // To prevent any breaking changes resulting from this change, given that\n // it was already causing a significant number of failures in G3, we have hidden\n // that behavior behind a global configuration flag. Consumers can enable this\n // flag explicitly if they want the `beforeunload` event to be handled as defined\n // in the specification.\n _global[enableBeforeunloadSymbol] &&\n // The IDL event definition is `attribute DOMString returnValue`, so we check whether\n // `typeof result` is a string.\n typeof result === 'string') {\n event.returnValue = result;\n }\n else if (result != undefined && !result) {\n event.preventDefault();\n }\n }\n return result;\n};\nfunction patchProperty(obj, prop, prototype) {\n let desc = ObjectGetOwnPropertyDescriptor(obj, prop);\n if (!desc && prototype) {\n // when patch window object, use prototype to check prop exist or not\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop);\n if (prototypeDesc) {\n desc = { enumerable: true, configurable: true };\n }\n }\n // if the descriptor not exists or is not configurable\n // just return\n if (!desc || !desc.configurable) {\n return;\n }\n const onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');\n if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {\n return;\n }\n // A property descriptor cannot have getter/setter and be writable\n // deleting the writable and value properties avoids this error:\n //\n // TypeError: property descriptors must not specify a value or be writable when a\n // getter or setter has been specified\n delete desc.writable;\n delete desc.value;\n const originalDescGet = desc.get;\n const originalDescSet = desc.set;\n // slice(2) cuz 'onclick' -> 'click', etc\n const eventName = prop.slice(2);\n let eventNameSymbol = zoneSymbolEventNames$1[eventName];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames$1[eventName] = zoneSymbol('ON_PROPERTY' + eventName);\n }\n desc.set = function (newValue) {\n // in some of windows's onproperty callback, this is undefined\n // so we need to check it\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return;\n }\n const previousValue = target[eventNameSymbol];\n if (typeof previousValue === 'function') {\n target.removeEventListener(eventName, wrapFn);\n }\n // issue #978, when onload handler was added before loading zone.js\n // we should remove it with originalDescSet\n originalDescSet && originalDescSet.call(target, null);\n target[eventNameSymbol] = newValue;\n if (typeof newValue === 'function') {\n target.addEventListener(eventName, wrapFn, false);\n }\n };\n // The getter would return undefined for unassigned properties but the default value of an\n // unassigned property is null\n desc.get = function () {\n // in some of windows's onproperty callback, this is undefined\n // so we need to check it\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return null;\n }\n const listener = target[eventNameSymbol];\n if (listener) {\n return listener;\n }\n else if (originalDescGet) {\n // result will be null when use inline event attribute,\n // such as \n // because the onclick function is internal raw uncompiled handler\n // the onclick will be evaluated when first time event was triggered or\n // the property is accessed, https://github.com/angular/zone.js/issues/525\n // so we should use original native get to retrieve the handler\n let value = originalDescGet.call(this);\n if (value) {\n desc.set.call(this, value);\n if (typeof target[REMOVE_ATTRIBUTE] === 'function') {\n target.removeAttribute(prop);\n }\n return value;\n }\n }\n return null;\n };\n ObjectDefineProperty(obj, prop, desc);\n obj[onPropPatchedSymbol] = true;\n}\nfunction patchOnProperties(obj, properties, prototype) {\n if (properties) {\n for (let i = 0; i < properties.length; i++) {\n patchProperty(obj, 'on' + properties[i], prototype);\n }\n }\n else {\n const onProperties = [];\n for (const prop in obj) {\n if (prop.slice(0, 2) == 'on') {\n onProperties.push(prop);\n }\n }\n for (let j = 0; j < onProperties.length; j++) {\n patchProperty(obj, onProperties[j], prototype);\n }\n }\n}\nconst originalInstanceKey = zoneSymbol('originalInstance');\n// wrap some native API on `window`\nfunction patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n // keep original class in global\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function () {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error('Arg list too long.');\n }\n };\n // attach original delegate to patched function\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function () { });\n let prop;\n for (prop in instance) {\n // https://bugs.webkit.org/show_bug.cgi?id=44721\n if (className === 'XMLHttpRequest' && prop === 'responseBlob')\n continue;\n (function (prop) {\n if (typeof instance[prop] === 'function') {\n _global[className].prototype[prop] = function () {\n return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);\n };\n }\n else {\n ObjectDefineProperty(_global[className].prototype, prop, {\n set: function (fn) {\n if (typeof fn === 'function') {\n this[originalInstanceKey][prop] = wrapWithCurrentZone(fn, className + '.' + prop);\n // keep callback in wrapped function so we can\n // use it in Function.prototype.toString to return\n // the native one.\n attachOriginToPatched(this[originalInstanceKey][prop], fn);\n }\n else {\n this[originalInstanceKey][prop] = fn;\n }\n },\n get: function () {\n return this[originalInstanceKey][prop];\n },\n });\n }\n })(prop);\n }\n for (prop in OriginalClass) {\n if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}\nfunction patchMethod(target, name, patchFn) {\n let proto = target;\n while (proto && !proto.hasOwnProperty(name)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && target[name]) {\n // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n proto = target;\n }\n const delegateName = zoneSymbol(name);\n let delegate = null;\n if (proto && (!(delegate = proto[delegateName]) || !proto.hasOwnProperty(delegateName))) {\n delegate = proto[delegateName] = proto[name];\n // check whether proto[name] is writable\n // some property is readonly in safari, such as HtmlCanvasElement.prototype.toBlob\n const desc = proto && ObjectGetOwnPropertyDescriptor(proto, name);\n if (isPropertyWritable(desc)) {\n const patchDelegate = patchFn(delegate, delegateName, name);\n proto[name] = function () {\n return patchDelegate(this, arguments);\n };\n attachOriginToPatched(proto[name], delegate);\n }\n }\n return delegate;\n}\n// TODO: @JiaLiPassion, support cancel task later if necessary\nfunction patchMacroTask(obj, funcName, metaCreator) {\n let setNative = null;\n function scheduleTask(task) {\n const data = task.data;\n data.args[data.cbIdx] = function () {\n task.invoke.apply(this, arguments);\n };\n setNative.apply(data.target, data.args);\n return task;\n }\n setNative = patchMethod(obj, funcName, (delegate) => function (self, args) {\n const meta = metaCreator(self, args);\n if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {\n return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);\n }\n else {\n // cause an error by calling it directly.\n return delegate.apply(self, args);\n }\n });\n}\nfunction attachOriginToPatched(patched, original) {\n patched[zoneSymbol('OriginalDelegate')] = original;\n}\nlet isDetectedIEOrEdge = false;\nlet ieOrEdge = false;\nfunction isIE() {\n try {\n const ua = internalWindow.navigator.userAgent;\n if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction isIEOrEdge() {\n if (isDetectedIEOrEdge) {\n return ieOrEdge;\n }\n isDetectedIEOrEdge = true;\n try {\n const ua = internalWindow.navigator.userAgent;\n if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1 || ua.indexOf('Edge/') !== -1) {\n ieOrEdge = true;\n }\n }\n catch (error) { }\n return ieOrEdge;\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n\n/**\n * @fileoverview\n * @suppress {missingRequire}\n */\n// Note that passive event listeners are now supported by most modern browsers,\n// including Chrome, Firefox, Safari, and Edge. There's a pending change that\n// would remove support for legacy browsers by zone.js. Removing `passiveSupported`\n// from the codebase will reduce the final code size for existing apps that still use zone.js.\nlet passiveSupported = false;\nif (typeof window !== 'undefined') {\n try {\n const options = Object.defineProperty({}, 'passive', {\n get: function () {\n passiveSupported = true;\n },\n });\n // Note: We pass the `options` object as the event handler too. This is not compatible with the\n // signature of `addEventListener` or `removeEventListener` but enables us to remove the handler\n // without an actual handler.\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n }\n catch (err) {\n passiveSupported = false;\n }\n}\n// an identifier to tell ZoneTask do not create a new invoke closure\nconst OPTIMIZED_ZONE_EVENT_TASK_DATA = {\n useG: true,\n};\nconst zoneSymbolEventNames = {};\nconst globalSources = {};\nconst EVENT_NAME_SYMBOL_REGX = new RegExp('^' + ZONE_SYMBOL_PREFIX + '(\\\\w+)(true|false)$');\nconst IMMEDIATE_PROPAGATION_SYMBOL = zoneSymbol('propagationStopped');\nfunction prepareEventNames(eventName, eventNameToString) {\n const falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;\n const trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames[eventName] = {};\n zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n}\nfunction patchEventTarget(_global, api, apis, patchOptions) {\n const ADD_EVENT_LISTENER = (patchOptions && patchOptions.add) || ADD_EVENT_LISTENER_STR;\n const REMOVE_EVENT_LISTENER = (patchOptions && patchOptions.rm) || REMOVE_EVENT_LISTENER_STR;\n const LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.listeners) || 'eventListeners';\n const REMOVE_ALL_LISTENERS_EVENT_LISTENER = (patchOptions && patchOptions.rmAll) || 'removeAllListeners';\n const zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER);\n const ADD_EVENT_LISTENER_SOURCE = '.' + ADD_EVENT_LISTENER + ':';\n const PREPEND_EVENT_LISTENER = 'prependListener';\n const PREPEND_EVENT_LISTENER_SOURCE = '.' + PREPEND_EVENT_LISTENER + ':';\n const invokeTask = function (task, target, event) {\n // for better performance, check isRemoved which is set\n // by removeEventListener\n if (task.isRemoved) {\n return;\n }\n const delegate = task.callback;\n if (typeof delegate === 'object' && delegate.handleEvent) {\n // create the bind version of handleEvent when invoke\n task.callback = (event) => delegate.handleEvent(event);\n task.originalDelegate = delegate;\n }\n // invoke static task.invoke\n // need to try/catch error here, otherwise, the error in one event listener\n // will break the executions of the other event listeners. Also error will\n // not remove the event listener when `once` options is true.\n let error;\n try {\n task.invoke(task, target, [event]);\n }\n catch (err) {\n error = err;\n }\n const options = task.options;\n if (options && typeof options === 'object' && options.once) {\n // if options.once is true, after invoke once remove listener here\n // only browser need to do this, nodejs eventEmitter will cal removeListener\n // inside EventEmitter.once\n const delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate, options);\n }\n return error;\n };\n function globalCallback(context, event, isCapture) {\n // https://github.com/angular/zone.js/issues/911, in IE, sometimes\n // event will be undefined, so we need to use window.event\n event = event || _global.event;\n if (!event) {\n return;\n }\n // event.target is needed for Samsung TV and SourceBuffer\n // || global is needed https://github.com/angular/zone.js/issues/190\n const target = context || event.target || _global;\n const tasks = target[zoneSymbolEventNames[event.type][isCapture ? TRUE_STR : FALSE_STR]];\n if (tasks) {\n const errors = [];\n // invoke all tasks which attached to current target with given event.type and capture = false\n // for performance concern, if task.length === 1, just invoke\n if (tasks.length === 1) {\n const err = invokeTask(tasks[0], target, event);\n err && errors.push(err);\n }\n else {\n // https://github.com/angular/zone.js/issues/836\n // copy the tasks array before invoke, to avoid\n // the callback will remove itself or other listener\n const copyTasks = tasks.slice();\n for (let i = 0; i < copyTasks.length; i++) {\n if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n break;\n }\n const err = invokeTask(copyTasks[i], target, event);\n err && errors.push(err);\n }\n }\n // Since there is only one error, we don't need to schedule microTask\n // to throw the error.\n if (errors.length === 1) {\n throw errors[0];\n }\n else {\n for (let i = 0; i < errors.length; i++) {\n const err = errors[i];\n api.nativeScheduleMicroTask(() => {\n throw err;\n });\n }\n }\n }\n }\n // global shared zoneAwareCallback to handle all event callback with capture = false\n const globalZoneAwareCallback = function (event) {\n return globalCallback(this, event, false);\n };\n // global shared zoneAwareCallback to handle all event callback with capture = true\n const globalZoneAwareCaptureCallback = function (event) {\n return globalCallback(this, event, true);\n };\n function patchEventTargetMethods(obj, patchOptions) {\n if (!obj) {\n return false;\n }\n let useGlobalCallback = true;\n if (patchOptions && patchOptions.useG !== undefined) {\n useGlobalCallback = patchOptions.useG;\n }\n const validateHandler = patchOptions && patchOptions.vh;\n let checkDuplicate = true;\n if (patchOptions && patchOptions.chkDup !== undefined) {\n checkDuplicate = patchOptions.chkDup;\n }\n let returnTarget = false;\n if (patchOptions && patchOptions.rt !== undefined) {\n returnTarget = patchOptions.rt;\n }\n let proto = obj;\n while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && obj[ADD_EVENT_LISTENER]) {\n // somehow we did not find it, but we can see it. This happens on IE for Window properties.\n proto = obj;\n }\n if (!proto) {\n return false;\n }\n if (proto[zoneSymbolAddEventListener]) {\n return false;\n }\n const eventNameToString = patchOptions && patchOptions.eventNameToString;\n // We use a shared global `taskData` to pass data for `scheduleEventTask`,\n // eliminating the need to create a new object solely for passing data.\n // WARNING: This object has a static lifetime, meaning it is not created\n // each time `addEventListener` is called. It is instantiated only once\n // and captured by reference inside the `addEventListener` and\n // `removeEventListener` functions. Do not add any new properties to this\n // object, as doing so would necessitate maintaining the information\n // between `addEventListener` calls.\n const taskData = {};\n const nativeAddEventListener = (proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER]);\n const nativeRemoveEventListener = (proto[zoneSymbol(REMOVE_EVENT_LISTENER)] =\n proto[REMOVE_EVENT_LISTENER]);\n const nativeListeners = (proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] =\n proto[LISTENERS_EVENT_LISTENER]);\n const nativeRemoveAllListeners = (proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] =\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER]);\n let nativePrependEventListener;\n if (patchOptions && patchOptions.prepend) {\n nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] =\n proto[patchOptions.prepend];\n }\n /**\n * This util function will build an option object with passive option\n * to handle all possible input from the user.\n */\n function buildEventListenerOptions(options, passive) {\n if (!passiveSupported && typeof options === 'object' && options) {\n // doesn't support passive but user want to pass an object as options.\n // this will not work on some old browser, so we just pass a boolean\n // as useCapture parameter\n return !!options.capture;\n }\n if (!passiveSupported || !passive) {\n return options;\n }\n if (typeof options === 'boolean') {\n return { capture: options, passive: true };\n }\n if (!options) {\n return { passive: true };\n }\n if (typeof options === 'object' && options.passive !== false) {\n return { ...options, passive: true };\n }\n return options;\n }\n const customScheduleGlobal = function (task) {\n // if there is already a task for the eventName + capture,\n // just return, because we use the shared globalZoneAwareCallback here.\n if (taskData.isExisting) {\n return;\n }\n return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);\n };\n /**\n * In the context of events and listeners, this function will be\n * called at the end by `cancelTask`, which, in turn, calls `task.cancelFn`.\n * Cancelling a task is primarily used to remove event listeners from\n * the task target.\n */\n const customCancelGlobal = function (task) {\n // if task is not marked as isRemoved, this call is directly\n // from Zone.prototype.cancelTask, we should remove the task\n // from tasksList of target first\n if (!task.isRemoved) {\n const symbolEventNames = zoneSymbolEventNames[task.eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[task.capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && task.target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (existingTask === task) {\n existingTasks.splice(i, 1);\n // set isRemoved to data for faster invokeTask check\n task.isRemoved = true;\n if (task.removeAbortListener) {\n task.removeAbortListener();\n task.removeAbortListener = null;\n }\n if (existingTasks.length === 0) {\n // all tasks for the eventName + capture have gone,\n // remove globalZoneAwareCallback and remove the task cache from target\n task.allRemoved = true;\n task.target[symbolEventName] = null;\n }\n break;\n }\n }\n }\n }\n // if all tasks for the eventName + capture have gone,\n // we will really remove the global event callback,\n // if not, return\n if (!task.allRemoved) {\n return;\n }\n return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);\n };\n const customScheduleNonGlobal = function (task) {\n return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customSchedulePrepend = function (task) {\n return nativePrependEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customCancelNonGlobal = function (task) {\n return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options);\n };\n const customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal;\n const customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal;\n const compareTaskCallbackVsDelegate = function (task, delegate) {\n const typeOfDelegate = typeof delegate;\n return ((typeOfDelegate === 'function' && task.callback === delegate) ||\n (typeOfDelegate === 'object' && task.originalDelegate === delegate));\n };\n const compare = patchOptions && patchOptions.diff ? patchOptions.diff : compareTaskCallbackVsDelegate;\n const unpatchedEvents = Zone[zoneSymbol('UNPATCHED_EVENTS')];\n const passiveEvents = _global[zoneSymbol('PASSIVE_EVENTS')];\n function copyEventListenerOptions(options) {\n if (typeof options === 'object' && options !== null) {\n // We need to destructure the target `options` object since it may\n // be frozen or sealed (possibly provided implicitly by a third-party\n // library), or its properties may be readonly.\n const newOptions = { ...options };\n // The `signal` option was recently introduced, which caused regressions in\n // third-party scenarios where `AbortController` was directly provided to\n // `addEventListener` as options. For instance, in cases like\n // `document.addEventListener('keydown', callback, abortControllerInstance)`,\n // which is valid because `AbortController` includes a `signal` getter, spreading\n // `{...options}` wouldn't copy the `signal`. Additionally, using `Object.create`\n // isn't feasible since `AbortController` is a built-in object type, and attempting\n // to create a new object directly with it as the prototype might result in\n // unexpected behavior.\n if (options.signal) {\n newOptions.signal = options.signal;\n }\n return newOptions;\n }\n return options;\n }\n const makeAddListener = function (nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget = false, prepend = false) {\n return function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n let delegate = arguments[1];\n if (!delegate) {\n return nativeListener.apply(this, arguments);\n }\n if (isNode && eventName === 'uncaughtException') {\n // don't patch uncaughtException of nodejs to prevent endless loop\n return nativeListener.apply(this, arguments);\n }\n // don't create the bind delegate function for handleEvent\n // case here to improve addEventListener performance\n // we will create the bind delegate when invoke\n let isHandleEvent = false;\n if (typeof delegate !== 'function') {\n if (!delegate.handleEvent) {\n return nativeListener.apply(this, arguments);\n }\n isHandleEvent = true;\n }\n if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {\n return;\n }\n const passive = passiveSupported && !!passiveEvents && passiveEvents.indexOf(eventName) !== -1;\n const options = copyEventListenerOptions(buildEventListenerOptions(arguments[2], passive));\n const signal = options?.signal;\n if (signal?.aborted) {\n // the signal is an aborted one, just return without attaching the event listener.\n return;\n }\n if (unpatchedEvents) {\n // check unpatched list\n for (let i = 0; i < unpatchedEvents.length; i++) {\n if (eventName === unpatchedEvents[i]) {\n if (passive) {\n return nativeListener.call(target, eventName, delegate, options);\n }\n else {\n return nativeListener.apply(this, arguments);\n }\n }\n }\n }\n const capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n const once = options && typeof options === 'object' ? options.once : false;\n const zone = Zone.current;\n let symbolEventNames = zoneSymbolEventNames[eventName];\n if (!symbolEventNames) {\n prepareEventNames(eventName, eventNameToString);\n symbolEventNames = zoneSymbolEventNames[eventName];\n }\n const symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n let existingTasks = target[symbolEventName];\n let isExisting = false;\n if (existingTasks) {\n // already have task registered\n isExisting = true;\n if (checkDuplicate) {\n for (let i = 0; i < existingTasks.length; i++) {\n if (compare(existingTasks[i], delegate)) {\n // same callback, same capture, same event name, just return\n return;\n }\n }\n }\n }\n else {\n existingTasks = target[symbolEventName] = [];\n }\n let source;\n const constructorName = target.constructor['name'];\n const targetSource = globalSources[constructorName];\n if (targetSource) {\n source = targetSource[eventName];\n }\n if (!source) {\n source =\n constructorName +\n addSource +\n (eventNameToString ? eventNameToString(eventName) : eventName);\n }\n // In the code below, `options` should no longer be reassigned; instead, it\n // should only be mutated. This is because we pass that object to the native\n // `addEventListener`.\n // It's generally recommended to use the same object reference for options.\n // This ensures consistency and avoids potential issues.\n taskData.options = options;\n if (once) {\n // When using `addEventListener` with the `once` option, we don't pass\n // the `once` option directly to the native `addEventListener` method.\n // Instead, we keep the `once` setting and handle it ourselves.\n taskData.options.once = false;\n }\n taskData.target = target;\n taskData.capture = capture;\n taskData.eventName = eventName;\n taskData.isExisting = isExisting;\n const data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined;\n // keep taskData into data to allow onScheduleEventTask to access the task information\n if (data) {\n data.taskData = taskData;\n }\n if (signal) {\n // When using `addEventListener` with the `signal` option, we don't pass\n // the `signal` option directly to the native `addEventListener` method.\n // Instead, we keep the `signal` setting and handle it ourselves.\n taskData.options.signal = undefined;\n }\n // The `scheduleEventTask` function will ultimately call `customScheduleGlobal`,\n // which in turn calls the native `addEventListener`. This is why `taskData.options`\n // is updated before scheduling the task, as `customScheduleGlobal` uses\n // `taskData.options` to pass it to the native `addEventListener`.\n const task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn);\n if (signal) {\n // after task is scheduled, we need to store the signal back to task.options\n taskData.options.signal = signal;\n // Wrapping `task` in a weak reference would not prevent memory leaks. Weak references are\n // primarily used for preventing strong references cycles. `onAbort` is always reachable\n // as it's an event listener, so its closure retains a strong reference to the `task`.\n const onAbort = () => task.zone.cancelTask(task);\n nativeListener.call(signal, 'abort', onAbort, { once: true });\n // We need to remove the `abort` listener when the event listener is going to be removed,\n // as it creates a closure that captures `task`. This closure retains a reference to the\n // `task` object even after it goes out of scope, preventing `task` from being garbage\n // collected.\n task.removeAbortListener = () => signal.removeEventListener('abort', onAbort);\n }\n // should clear taskData.target to avoid memory leak\n // issue, https://github.com/angular/angular/issues/20442\n taskData.target = null;\n // need to clear up taskData because it is a global object\n if (data) {\n data.taskData = null;\n }\n // have to save those information to task in case\n // application may call task.zone.cancelTask() directly\n if (once) {\n taskData.options.once = true;\n }\n if (!(!passiveSupported && typeof task.options === 'boolean')) {\n // if not support passive, and we pass an option object\n // to addEventListener, we should save the options to task\n task.options = options;\n }\n task.target = target;\n task.capture = capture;\n task.eventName = eventName;\n if (isHandleEvent) {\n // save original delegate for compare to check duplicate\n task.originalDelegate = delegate;\n }\n if (!prepend) {\n existingTasks.push(task);\n }\n else {\n existingTasks.unshift(task);\n }\n if (returnTarget) {\n return target;\n }\n };\n };\n proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget);\n if (nativePrependEventListener) {\n proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true);\n }\n proto[REMOVE_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const options = arguments[2];\n const capture = !options ? false : typeof options === 'boolean' ? true : options.capture;\n const delegate = arguments[1];\n if (!delegate) {\n return nativeRemoveEventListener.apply(this, arguments);\n }\n if (validateHandler &&\n !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) {\n return;\n }\n const symbolEventNames = zoneSymbolEventNames[eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && target[symbolEventName];\n // `existingTasks` may not exist if the `addEventListener` was called before\n // it was patched by zone.js. Please refer to the attached issue for\n // clarification, particularly after the `if` condition, before calling\n // the native `removeEventListener`.\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (compare(existingTask, delegate)) {\n existingTasks.splice(i, 1);\n // set isRemoved to data for faster invokeTask check\n existingTask.isRemoved = true;\n if (existingTasks.length === 0) {\n // all tasks for the eventName + capture have gone,\n // remove globalZoneAwareCallback and remove the task cache from target\n existingTask.allRemoved = true;\n target[symbolEventName] = null;\n // in the target, we have an event listener which is added by on_property\n // such as target.onclick = function() {}, so we need to clear this internal\n // property too if all delegates with capture=false were removed\n // https:// github.com/angular/angular/issues/31643\n // https://github.com/angular/angular/issues/54581\n if (!capture && typeof eventName === 'string') {\n const onPropertySymbol = ZONE_SYMBOL_PREFIX + 'ON_PROPERTY' + eventName;\n target[onPropertySymbol] = null;\n }\n }\n // In all other conditions, when `addEventListener` is called after being\n // patched by zone.js, we would always find an event task on the `EventTarget`.\n // This will trigger `cancelFn` on the `existingTask`, leading to `customCancelGlobal`,\n // which ultimately removes an event listener and cleans up the abort listener\n // (if an `AbortSignal` was provided when scheduling a task).\n existingTask.zone.cancelTask(existingTask);\n if (returnTarget) {\n return target;\n }\n return;\n }\n }\n }\n // https://github.com/angular/zone.js/issues/930\n // We may encounter a situation where the `addEventListener` was\n // called on the event target before zone.js is loaded, resulting\n // in no task being stored on the event target due to its invocation\n // of the native implementation. In this scenario, we simply need to\n // invoke the native `removeEventListener`.\n return nativeRemoveEventListener.apply(this, arguments);\n };\n proto[LISTENERS_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const listeners = [];\n const tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n listeners.push(delegate);\n }\n return listeners;\n };\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function () {\n const target = this || _global;\n let eventName = arguments[0];\n if (!eventName) {\n const keys = Object.keys(target);\n for (let i = 0; i < keys.length; i++) {\n const prop = keys[i];\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n // in nodejs EventEmitter, removeListener event is\n // used for monitoring the removeListener call,\n // so just keep removeListener eventListener until\n // all other eventListeners are removed\n if (evtName && evtName !== 'removeListener') {\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName);\n }\n }\n // remove removeListener listener finally\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, 'removeListener');\n }\n else {\n if (patchOptions && patchOptions.transferEventName) {\n eventName = patchOptions.transferEventName(eventName);\n }\n const symbolEventNames = zoneSymbolEventNames[eventName];\n if (symbolEventNames) {\n const symbolEventName = symbolEventNames[FALSE_STR];\n const symbolCaptureEventName = symbolEventNames[TRUE_STR];\n const tasks = target[symbolEventName];\n const captureTasks = target[symbolCaptureEventName];\n if (tasks) {\n const removeTasks = tasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n if (captureTasks) {\n const removeTasks = captureTasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n }\n }\n if (returnTarget) {\n return this;\n }\n };\n // for native toString patch\n attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener);\n attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener);\n if (nativeRemoveAllListeners) {\n attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners);\n }\n if (nativeListeners) {\n attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners);\n }\n return true;\n }\n let results = [];\n for (let i = 0; i < apis.length; i++) {\n results[i] = patchEventTargetMethods(apis[i], patchOptions);\n }\n return results;\n}\nfunction findEventTasks(target, eventName) {\n if (!eventName) {\n const foundTasks = [];\n for (let prop in target) {\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n if (evtName && (!eventName || evtName === eventName)) {\n const tasks = target[prop];\n if (tasks) {\n for (let i = 0; i < tasks.length; i++) {\n foundTasks.push(tasks[i]);\n }\n }\n }\n }\n return foundTasks;\n }\n let symbolEventName = zoneSymbolEventNames[eventName];\n if (!symbolEventName) {\n prepareEventNames(eventName);\n symbolEventName = zoneSymbolEventNames[eventName];\n }\n const captureFalseTasks = target[symbolEventName[FALSE_STR]];\n const captureTrueTasks = target[symbolEventName[TRUE_STR]];\n if (!captureFalseTasks) {\n return captureTrueTasks ? captureTrueTasks.slice() : [];\n }\n else {\n return captureTrueTasks\n ? captureFalseTasks.concat(captureTrueTasks)\n : captureFalseTasks.slice();\n }\n}\nfunction patchEventPrototype(global, api) {\n const Event = global['Event'];\n if (Event && Event.prototype) {\n api.patchMethod(Event.prototype, 'stopImmediatePropagation', (delegate) => function (self, args) {\n self[IMMEDIATE_PROPAGATION_SYMBOL] = true;\n // we need to call the native stopImmediatePropagation\n // in case in some hybrid application, some part of\n // application will be controlled by zone, some are not\n delegate && delegate.apply(self, args);\n });\n }\n}\n\n/**\n * @fileoverview\n * @suppress {missingRequire}\n */\nfunction patchQueueMicrotask(global, api) {\n api.patchMethod(global, 'queueMicrotask', (delegate) => {\n return function (self, args) {\n Zone.current.scheduleMicroTask('queueMicrotask', args[0]);\n };\n });\n}\n\n/**\n * @fileoverview\n * @suppress {missingRequire}\n */\nconst taskSymbol = zoneSymbol('zoneTask');\nfunction patchTimer(window, setName, cancelName, nameSuffix) {\n let setNative = null;\n let clearNative = null;\n setName += nameSuffix;\n cancelName += nameSuffix;\n const tasksByHandleId = {};\n function scheduleTask(task) {\n const data = task.data;\n data.args[0] = function () {\n return task.invoke.apply(this, arguments);\n };\n const handleOrId = setNative.apply(window, data.args);\n // Whlist on Node.js when get can the ID by using `[Symbol.toPrimitive]()` we do\n // to this so that we do not cause potentally leaks when using `setTimeout`\n // since this can be periodic when using `.refresh`.\n if (isNumber(handleOrId)) {\n data.handleId = handleOrId;\n }\n else {\n data.handle = handleOrId;\n // On Node.js a timeout and interval can be restarted over and over again by using the `.refresh` method.\n data.isRefreshable = isFunction(handleOrId.refresh);\n }\n return task;\n }\n function clearTask(task) {\n const { handle, handleId } = task.data;\n return clearNative.call(window, handle ?? handleId);\n }\n setNative = patchMethod(window, setName, (delegate) => function (self, args) {\n if (isFunction(args[0])) {\n const options = {\n isRefreshable: false,\n isPeriodic: nameSuffix === 'Interval',\n delay: nameSuffix === 'Timeout' || nameSuffix === 'Interval' ? args[1] || 0 : undefined,\n args: args,\n };\n const callback = args[0];\n args[0] = function timer() {\n try {\n return callback.apply(this, arguments);\n }\n finally {\n // issue-934, task will be cancelled\n // even it is a periodic task such as\n // setInterval\n // https://github.com/angular/angular/issues/40387\n // Cleanup tasksByHandleId should be handled before scheduleTask\n // Since some zoneSpec may intercept and doesn't trigger\n // scheduleFn(scheduleTask) provided here.\n const { handle, handleId, isPeriodic, isRefreshable } = options;\n if (!isPeriodic && !isRefreshable) {\n if (handleId) {\n // in non-nodejs env, we remove timerId\n // from local cache\n delete tasksByHandleId[handleId];\n }\n else if (handle) {\n // Node returns complex objects as handleIds\n // we remove task reference from timer object\n handle[taskSymbol] = null;\n }\n }\n }\n };\n const task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);\n if (!task) {\n return task;\n }\n // Node.js must additionally support the ref and unref functions.\n const { handleId, handle, isRefreshable, isPeriodic } = task.data;\n if (handleId) {\n // for non nodejs env, we save handleId: task\n // mapping in local cache for clearTimeout\n tasksByHandleId[handleId] = task;\n }\n else if (handle) {\n // for nodejs env, we save task\n // reference in timerId Object for clearTimeout\n handle[taskSymbol] = task;\n if (isRefreshable && !isPeriodic) {\n const originalRefresh = handle.refresh;\n handle.refresh = function () {\n const { zone, state } = task;\n if (state === 'notScheduled') {\n task._state = 'scheduled';\n zone._updateTaskCount(task, 1);\n }\n else if (state === 'running') {\n task._state = 'scheduling';\n }\n return originalRefresh.call(this);\n };\n }\n }\n return handle ?? handleId ?? task;\n }\n else {\n // cause an error by calling it directly.\n return delegate.apply(window, args);\n }\n });\n clearNative = patchMethod(window, cancelName, (delegate) => function (self, args) {\n const id = args[0];\n let task;\n if (isNumber(id)) {\n // non nodejs env.\n task = tasksByHandleId[id];\n delete tasksByHandleId[id];\n }\n else {\n // nodejs env ?? other environments.\n task = id?.[taskSymbol];\n if (task) {\n id[taskSymbol] = null;\n }\n else {\n task = id;\n }\n }\n if (task?.type) {\n if (task.cancelFn) {\n // Do not cancel already canceled functions\n task.zone.cancelTask(task);\n }\n }\n else {\n // cause an error by calling it directly.\n delegate.apply(window, args);\n }\n });\n}\n\nfunction patchCustomElements(_global, api) {\n const { isBrowser, isMix } = api.getGlobalObjects();\n if ((!isBrowser && !isMix) || !_global['customElements'] || !('customElements' in _global)) {\n return;\n }\n // https://html.spec.whatwg.org/multipage/custom-elements.html#concept-custom-element-definition-lifecycle-callbacks\n const callbacks = [\n 'connectedCallback',\n 'disconnectedCallback',\n 'adoptedCallback',\n 'attributeChangedCallback',\n 'formAssociatedCallback',\n 'formDisabledCallback',\n 'formResetCallback',\n 'formStateRestoreCallback',\n ];\n api.patchCallbacks(api, _global.customElements, 'customElements', 'define', callbacks);\n}\n\nfunction eventTargetPatch(_global, api) {\n if (Zone[api.symbol('patchEventTarget')]) {\n // EventTarget is already patched.\n return;\n }\n const { eventNames, zoneSymbolEventNames, TRUE_STR, FALSE_STR, ZONE_SYMBOL_PREFIX } = api.getGlobalObjects();\n // predefine all __zone_symbol__ + eventName + true/false string\n for (let i = 0; i < eventNames.length; i++) {\n const eventName = eventNames[i];\n const falseEventName = eventName + FALSE_STR;\n const trueEventName = eventName + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames[eventName] = {};\n zoneSymbolEventNames[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;\n }\n const EVENT_TARGET = _global['EventTarget'];\n if (!EVENT_TARGET || !EVENT_TARGET.prototype) {\n return;\n }\n api.patchEventTarget(_global, api, [EVENT_TARGET && EVENT_TARGET.prototype]);\n return true;\n}\nfunction patchEvent(global, api) {\n api.patchEventPrototype(global, api);\n}\n\n/**\n * @fileoverview\n * @suppress {globalThis}\n */\nfunction filterProperties(target, onProperties, ignoreProperties) {\n if (!ignoreProperties || ignoreProperties.length === 0) {\n return onProperties;\n }\n const tip = ignoreProperties.filter((ip) => ip.target === target);\n if (!tip || tip.length === 0) {\n return onProperties;\n }\n const targetIgnoreProperties = tip[0].ignoreProperties;\n return onProperties.filter((op) => targetIgnoreProperties.indexOf(op) === -1);\n}\nfunction patchFilteredProperties(target, onProperties, ignoreProperties, prototype) {\n // check whether target is available, sometimes target will be undefined\n // because different browser or some 3rd party plugin.\n if (!target) {\n return;\n }\n const filteredProperties = filterProperties(target, onProperties, ignoreProperties);\n patchOnProperties(target, filteredProperties, prototype);\n}\n/**\n * Get all event name properties which the event name startsWith `on`\n * from the target object itself, inherited properties are not considered.\n */\nfunction getOnEventNames(target) {\n return Object.getOwnPropertyNames(target)\n .filter((name) => name.startsWith('on') && name.length > 2)\n .map((name) => name.substring(2));\n}\nfunction propertyDescriptorPatch(api, _global) {\n if (isNode && !isMix) {\n return;\n }\n if (Zone[api.symbol('patchEvents')]) {\n // events are already been patched by legacy patch.\n return;\n }\n const ignoreProperties = _global['__Zone_ignore_on_properties'];\n // for browsers that we can patch the descriptor: Chrome & Firefox\n let patchTargets = [];\n if (isBrowser) {\n const internalWindow = window;\n patchTargets = patchTargets.concat([\n 'Document',\n 'SVGElement',\n 'Element',\n 'HTMLElement',\n 'HTMLBodyElement',\n 'HTMLMediaElement',\n 'HTMLFrameSetElement',\n 'HTMLFrameElement',\n 'HTMLIFrameElement',\n 'HTMLMarqueeElement',\n 'Worker',\n ]);\n const ignoreErrorProperties = isIE()\n ? [{ target: internalWindow, ignoreProperties: ['error'] }]\n : [];\n // in IE/Edge, onProp not exist in window object, but in WindowPrototype\n // so we need to pass WindowPrototype to check onProp exist or not\n patchFilteredProperties(internalWindow, getOnEventNames(internalWindow), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow));\n }\n patchTargets = patchTargets.concat([\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'IDBIndex',\n 'IDBRequest',\n 'IDBOpenDBRequest',\n 'IDBDatabase',\n 'IDBTransaction',\n 'IDBCursor',\n 'WebSocket',\n ]);\n for (let i = 0; i < patchTargets.length; i++) {\n const target = _global[patchTargets[i]];\n target &&\n target.prototype &&\n patchFilteredProperties(target.prototype, getOnEventNames(target.prototype), ignoreProperties);\n }\n}\n\n/**\n * @fileoverview\n * @suppress {missingRequire}\n */\nfunction patchBrowser(Zone) {\n Zone.__load_patch('legacy', (global) => {\n const legacyPatch = global[Zone.__symbol__('legacyPatch')];\n if (legacyPatch) {\n legacyPatch();\n }\n });\n Zone.__load_patch('timers', (global) => {\n const set = 'set';\n const clear = 'clear';\n patchTimer(global, set, clear, 'Timeout');\n patchTimer(global, set, clear, 'Interval');\n patchTimer(global, set, clear, 'Immediate');\n });\n Zone.__load_patch('requestAnimationFrame', (global) => {\n patchTimer(global, 'request', 'cancel', 'AnimationFrame');\n patchTimer(global, 'mozRequest', 'mozCancel', 'AnimationFrame');\n patchTimer(global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');\n });\n Zone.__load_patch('blocking', (global, Zone) => {\n const blockingMethods = ['alert', 'prompt', 'confirm'];\n for (let i = 0; i < blockingMethods.length; i++) {\n const name = blockingMethods[i];\n patchMethod(global, name, (delegate, symbol, name) => {\n return function (s, args) {\n return Zone.current.run(delegate, global, args, name);\n };\n });\n }\n });\n Zone.__load_patch('EventTarget', (global, Zone, api) => {\n patchEvent(global, api);\n eventTargetPatch(global, api);\n // patch XMLHttpRequestEventTarget's addEventListener/removeEventListener\n const XMLHttpRequestEventTarget = global['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n api.patchEventTarget(global, api, [XMLHttpRequestEventTarget.prototype]);\n }\n });\n Zone.__load_patch('MutationObserver', (global, Zone, api) => {\n patchClass('MutationObserver');\n patchClass('WebKitMutationObserver');\n });\n Zone.__load_patch('IntersectionObserver', (global, Zone, api) => {\n patchClass('IntersectionObserver');\n });\n Zone.__load_patch('FileReader', (global, Zone, api) => {\n patchClass('FileReader');\n });\n Zone.__load_patch('on_property', (global, Zone, api) => {\n propertyDescriptorPatch(api, global);\n });\n Zone.__load_patch('customElements', (global, Zone, api) => {\n patchCustomElements(global, api);\n });\n Zone.__load_patch('XHR', (global, Zone) => {\n // Treat XMLHttpRequest as a macrotask.\n patchXHR(global);\n const XHR_TASK = zoneSymbol('xhrTask');\n const XHR_SYNC = zoneSymbol('xhrSync');\n const XHR_LISTENER = zoneSymbol('xhrListener');\n const XHR_SCHEDULED = zoneSymbol('xhrScheduled');\n const XHR_URL = zoneSymbol('xhrURL');\n const XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled');\n function patchXHR(window) {\n const XMLHttpRequest = window['XMLHttpRequest'];\n if (!XMLHttpRequest) {\n // XMLHttpRequest is not available in service worker\n return;\n }\n const XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n function findPendingTask(target) {\n return target[XHR_TASK];\n }\n let oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n let oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n if (!oriAddListener) {\n const XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];\n if (XMLHttpRequestEventTarget) {\n const XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;\n oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n }\n const READY_STATE_CHANGE = 'readystatechange';\n const SCHEDULED = 'scheduled';\n function scheduleTask(task) {\n const data = task.data;\n const target = data.target;\n target[XHR_SCHEDULED] = false;\n target[XHR_ERROR_BEFORE_SCHEDULED] = false;\n // remove existing event listener\n const listener = target[XHR_LISTENER];\n if (!oriAddListener) {\n oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n if (listener) {\n oriRemoveListener.call(target, READY_STATE_CHANGE, listener);\n }\n const newListener = (target[XHR_LISTENER] = () => {\n if (target.readyState === target.DONE) {\n // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with\n // readyState=4 multiple times, so we need to check task state here\n if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {\n // check whether the xhr has registered onload listener\n // if that is the case, the task should invoke after all\n // onload listeners finish.\n // Also if the request failed without response (status = 0), the load event handler\n // will not be triggered, in that case, we should also invoke the placeholder callback\n // to close the XMLHttpRequest::send macroTask.\n // https://github.com/angular/angular/issues/38795\n const loadTasks = target[Zone.__symbol__('loadfalse')];\n if (target.status !== 0 && loadTasks && loadTasks.length > 0) {\n const oriInvoke = task.invoke;\n task.invoke = function () {\n // need to load the tasks again, because in other\n // load listener, they may remove themselves\n const loadTasks = target[Zone.__symbol__('loadfalse')];\n for (let i = 0; i < loadTasks.length; i++) {\n if (loadTasks[i] === task) {\n loadTasks.splice(i, 1);\n }\n }\n if (!data.aborted && task.state === SCHEDULED) {\n oriInvoke.call(task);\n }\n };\n loadTasks.push(task);\n }\n else {\n task.invoke();\n }\n }\n else if (!data.aborted && target[XHR_SCHEDULED] === false) {\n // error occurs when xhr.send()\n target[XHR_ERROR_BEFORE_SCHEDULED] = true;\n }\n }\n });\n oriAddListener.call(target, READY_STATE_CHANGE, newListener);\n const storedTask = target[XHR_TASK];\n if (!storedTask) {\n target[XHR_TASK] = task;\n }\n sendNative.apply(target, data.args);\n target[XHR_SCHEDULED] = true;\n return task;\n }\n function placeholderCallback() { }\n function clearTask(task) {\n const data = task.data;\n // Note - ideally, we would call data.target.removeEventListener here, but it's too late\n // to prevent it from firing. So instead, we store info for the event listener.\n data.aborted = true;\n return abortNative.apply(data.target, data.args);\n }\n const openNative = patchMethod(XMLHttpRequestPrototype, 'open', () => function (self, args) {\n self[XHR_SYNC] = args[2] == false;\n self[XHR_URL] = args[1];\n return openNative.apply(self, args);\n });\n const XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';\n const fetchTaskAborting = zoneSymbol('fetchTaskAborting');\n const fetchTaskScheduling = zoneSymbol('fetchTaskScheduling');\n const sendNative = patchMethod(XMLHttpRequestPrototype, 'send', () => function (self, args) {\n if (Zone.current[fetchTaskScheduling] === true) {\n // a fetch is scheduling, so we are using xhr to polyfill fetch\n // and because we already schedule macroTask for fetch, we should\n // not schedule a macroTask for xhr again\n return sendNative.apply(self, args);\n }\n if (self[XHR_SYNC]) {\n // if the XHR is sync there is no task to schedule, just execute the code.\n return sendNative.apply(self, args);\n }\n else {\n const options = {\n target: self,\n url: self[XHR_URL],\n isPeriodic: false,\n args: args,\n aborted: false,\n };\n const task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);\n if (self &&\n self[XHR_ERROR_BEFORE_SCHEDULED] === true &&\n !options.aborted &&\n task.state === SCHEDULED) {\n // xhr request throw error when send\n // we should invoke task instead of leaving a scheduled\n // pending macroTask\n task.invoke();\n }\n }\n });\n const abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', () => function (self, args) {\n const task = findPendingTask(self);\n if (task && typeof task.type == 'string') {\n // If the XHR has already completed, do nothing.\n // If the XHR has already been aborted, do nothing.\n // Fix #569, call abort multiple times before done will cause\n // macroTask task count be negative number\n if (task.cancelFn == null || (task.data && task.data.aborted)) {\n return;\n }\n task.zone.cancelTask(task);\n }\n else if (Zone.current[fetchTaskAborting] === true) {\n // the abort is called from fetch polyfill, we need to call native abort of XHR.\n return abortNative.apply(self, args);\n }\n // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no\n // task\n // to cancel. Do nothing.\n });\n }\n });\n Zone.__load_patch('geolocation', (global) => {\n /// GEO_LOCATION\n if (global['navigator'] && global['navigator'].geolocation) {\n patchPrototype(global['navigator'].geolocation, ['getCurrentPosition', 'watchPosition']);\n }\n });\n Zone.__load_patch('PromiseRejectionEvent', (global, Zone) => {\n // handle unhandled promise rejection\n function findPromiseRejectionHandler(evtName) {\n return function (e) {\n const eventTasks = findEventTasks(global, evtName);\n eventTasks.forEach((eventTask) => {\n // windows has added unhandledrejection event listener\n // trigger the event listener\n const PromiseRejectionEvent = global['PromiseRejectionEvent'];\n if (PromiseRejectionEvent) {\n const evt = new PromiseRejectionEvent(evtName, {\n promise: e.promise,\n reason: e.rejection,\n });\n eventTask.invoke(evt);\n }\n });\n };\n }\n if (global['PromiseRejectionEvent']) {\n Zone[zoneSymbol('unhandledPromiseRejectionHandler')] =\n findPromiseRejectionHandler('unhandledrejection');\n Zone[zoneSymbol('rejectionHandledHandler')] =\n findPromiseRejectionHandler('rejectionhandled');\n }\n });\n Zone.__load_patch('queueMicrotask', (global, Zone, api) => {\n patchQueueMicrotask(global, api);\n });\n}\n\nfunction patchPromise(Zone) {\n Zone.__load_patch('ZoneAwarePromise', (global, Zone, api) => {\n const ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n const ObjectDefineProperty = Object.defineProperty;\n function readableObjectToString(obj) {\n if (obj && obj.toString === Object.prototype.toString) {\n const className = obj.constructor && obj.constructor.name;\n return (className ? className : '') + ': ' + JSON.stringify(obj);\n }\n return obj ? obj.toString() : Object.prototype.toString.call(obj);\n }\n const __symbol__ = api.symbol;\n const _uncaughtPromiseErrors = [];\n const isDisableWrappingUncaughtPromiseRejection = global[__symbol__('DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION')] !== false;\n const symbolPromise = __symbol__('Promise');\n const symbolThen = __symbol__('then');\n const creationTrace = '__creationTrace__';\n api.onUnhandledError = (e) => {\n if (api.showUncaughtError()) {\n const rejection = e && e.rejection;\n if (rejection) {\n console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined);\n }\n else {\n console.error(e);\n }\n }\n };\n api.microtaskDrainDone = () => {\n while (_uncaughtPromiseErrors.length) {\n const uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n try {\n uncaughtPromiseError.zone.runGuarded(() => {\n if (uncaughtPromiseError.throwOriginal) {\n throw uncaughtPromiseError.rejection;\n }\n throw uncaughtPromiseError;\n });\n }\n catch (error) {\n handleUnhandledRejection(error);\n }\n }\n };\n const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__('unhandledPromiseRejectionHandler');\n function handleUnhandledRejection(e) {\n api.onUnhandledError(e);\n try {\n const handler = Zone[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];\n if (typeof handler === 'function') {\n handler.call(this, e);\n }\n }\n catch (err) { }\n }\n function isThenable(value) {\n return value && value.then;\n }\n function forwardResolution(value) {\n return value;\n }\n function forwardRejection(rejection) {\n return ZoneAwarePromise.reject(rejection);\n }\n const symbolState = __symbol__('state');\n const symbolValue = __symbol__('value');\n const symbolFinally = __symbol__('finally');\n const symbolParentPromiseValue = __symbol__('parentPromiseValue');\n const symbolParentPromiseState = __symbol__('parentPromiseState');\n const source = 'Promise.then';\n const UNRESOLVED = null;\n const RESOLVED = true;\n const REJECTED = false;\n const REJECTED_NO_CATCH = 0;\n function makeResolver(promise, state) {\n return (v) => {\n try {\n resolvePromise(promise, state, v);\n }\n catch (err) {\n resolvePromise(promise, false, err);\n }\n // Do not return value or you will break the Promise spec.\n };\n }\n const once = function () {\n let wasCalled = false;\n return function wrapper(wrappedFunction) {\n return function () {\n if (wasCalled) {\n return;\n }\n wasCalled = true;\n wrappedFunction.apply(null, arguments);\n };\n };\n };\n const TYPE_ERROR = 'Promise resolved with itself';\n const CURRENT_TASK_TRACE_SYMBOL = __symbol__('currentTaskTrace');\n // Promise Resolution\n function resolvePromise(promise, state, value) {\n const onceWrapper = once();\n if (promise === value) {\n throw new TypeError(TYPE_ERROR);\n }\n if (promise[symbolState] === UNRESOLVED) {\n // should only get value.then once based on promise spec.\n let then = null;\n try {\n if (typeof value === 'object' || typeof value === 'function') {\n then = value && value.then;\n }\n }\n catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n return promise;\n }\n // if (value instanceof ZoneAwarePromise) {\n if (state !== REJECTED &&\n value instanceof ZoneAwarePromise &&\n value.hasOwnProperty(symbolState) &&\n value.hasOwnProperty(symbolValue) &&\n value[symbolState] !== UNRESOLVED) {\n clearRejectedNoCatch(value);\n resolvePromise(promise, value[symbolState], value[symbolValue]);\n }\n else if (state !== REJECTED && typeof then === 'function') {\n try {\n then.call(value, onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)));\n }\n catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n }\n }\n else {\n promise[symbolState] = state;\n const queue = promise[symbolValue];\n promise[symbolValue] = value;\n if (promise[symbolFinally] === symbolFinally) {\n // the promise is generated by Promise.prototype.finally\n if (state === RESOLVED) {\n // the state is resolved, should ignore the value\n // and use parent promise value\n promise[symbolState] = promise[symbolParentPromiseState];\n promise[symbolValue] = promise[symbolParentPromiseValue];\n }\n }\n // record task information in value when error occurs, so we can\n // do some additional work such as render longStackTrace\n if (state === REJECTED && value instanceof Error) {\n // check if longStackTraceZone is here\n const trace = Zone.currentTask &&\n Zone.currentTask.data &&\n Zone.currentTask.data[creationTrace];\n if (trace) {\n // only keep the long stack trace into error when in longStackTraceZone\n ObjectDefineProperty(value, CURRENT_TASK_TRACE_SYMBOL, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: trace,\n });\n }\n }\n for (let i = 0; i < queue.length;) {\n scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n }\n if (queue.length == 0 && state == REJECTED) {\n promise[symbolState] = REJECTED_NO_CATCH;\n let uncaughtPromiseError = value;\n try {\n // Here we throws a new Error to print more readable error log\n // and if the value is not an error, zone.js builds an `Error`\n // Object here to attach the stack information.\n throw new Error('Uncaught (in promise): ' +\n readableObjectToString(value) +\n (value && value.stack ? '\\n' + value.stack : ''));\n }\n catch (err) {\n uncaughtPromiseError = err;\n }\n if (isDisableWrappingUncaughtPromiseRejection) {\n // If disable wrapping uncaught promise reject\n // use the value instead of wrapping it.\n uncaughtPromiseError.throwOriginal = true;\n }\n uncaughtPromiseError.rejection = value;\n uncaughtPromiseError.promise = promise;\n uncaughtPromiseError.zone = Zone.current;\n uncaughtPromiseError.task = Zone.currentTask;\n _uncaughtPromiseErrors.push(uncaughtPromiseError);\n api.scheduleMicroTask(); // to make sure that it is running\n }\n }\n }\n // Resolving an already resolved promise is a noop.\n return promise;\n }\n const REJECTION_HANDLED_HANDLER = __symbol__('rejectionHandledHandler');\n function clearRejectedNoCatch(promise) {\n if (promise[symbolState] === REJECTED_NO_CATCH) {\n // if the promise is rejected no catch status\n // and queue.length > 0, means there is a error handler\n // here to handle the rejected promise, we should trigger\n // windows.rejectionhandled eventHandler or nodejs rejectionHandled\n // eventHandler\n try {\n const handler = Zone[REJECTION_HANDLED_HANDLER];\n if (handler && typeof handler === 'function') {\n handler.call(this, { rejection: promise[symbolValue], promise: promise });\n }\n }\n catch (err) { }\n promise[symbolState] = REJECTED;\n for (let i = 0; i < _uncaughtPromiseErrors.length; i++) {\n if (promise === _uncaughtPromiseErrors[i].promise) {\n _uncaughtPromiseErrors.splice(i, 1);\n }\n }\n }\n }\n function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n clearRejectedNoCatch(promise);\n const promiseState = promise[symbolState];\n const delegate = promiseState\n ? typeof onFulfilled === 'function'\n ? onFulfilled\n : forwardResolution\n : typeof onRejected === 'function'\n ? onRejected\n : forwardRejection;\n zone.scheduleMicroTask(source, () => {\n try {\n const parentPromiseValue = promise[symbolValue];\n const isFinallyPromise = !!chainPromise && symbolFinally === chainPromise[symbolFinally];\n if (isFinallyPromise) {\n // if the promise is generated from finally call, keep parent promise's state and value\n chainPromise[symbolParentPromiseValue] = parentPromiseValue;\n chainPromise[symbolParentPromiseState] = promiseState;\n }\n // should not pass value to finally callback\n const value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution\n ? []\n : [parentPromiseValue]);\n resolvePromise(chainPromise, true, value);\n }\n catch (error) {\n // if error occurs, should always return this error\n resolvePromise(chainPromise, false, error);\n }\n }, chainPromise);\n }\n const ZONE_AWARE_PROMISE_TO_STRING = 'function ZoneAwarePromise() { [native code] }';\n const noop = function () { };\n const AggregateError = global.AggregateError;\n class ZoneAwarePromise {\n static toString() {\n return ZONE_AWARE_PROMISE_TO_STRING;\n }\n static resolve(value) {\n if (value instanceof ZoneAwarePromise) {\n return value;\n }\n return resolvePromise(new this(null), RESOLVED, value);\n }\n static reject(error) {\n return resolvePromise(new this(null), REJECTED, error);\n }\n static withResolvers() {\n const result = {};\n result.promise = new ZoneAwarePromise((res, rej) => {\n result.resolve = res;\n result.reject = rej;\n });\n return result;\n }\n static any(values) {\n if (!values || typeof values[Symbol.iterator] !== 'function') {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n const promises = [];\n let count = 0;\n try {\n for (let v of values) {\n count++;\n promises.push(ZoneAwarePromise.resolve(v));\n }\n }\n catch (err) {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n if (count === 0) {\n return Promise.reject(new AggregateError([], 'All promises were rejected'));\n }\n let finished = false;\n const errors = [];\n return new ZoneAwarePromise((resolve, reject) => {\n for (let i = 0; i < promises.length; i++) {\n promises[i].then((v) => {\n if (finished) {\n return;\n }\n finished = true;\n resolve(v);\n }, (err) => {\n errors.push(err);\n count--;\n if (count === 0) {\n finished = true;\n reject(new AggregateError(errors, 'All promises were rejected'));\n }\n });\n }\n });\n }\n static race(values) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n function onResolve(value) {\n resolve(value);\n }\n function onReject(error) {\n reject(error);\n }\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n value.then(onResolve, onReject);\n }\n return promise;\n }\n static all(values) {\n return ZoneAwarePromise.allWithCallback(values);\n }\n static allSettled(values) {\n const P = this && this.prototype instanceof ZoneAwarePromise ? this : ZoneAwarePromise;\n return P.allWithCallback(values, {\n thenCallback: (value) => ({ status: 'fulfilled', value }),\n errorCallback: (err) => ({ status: 'rejected', reason: err }),\n });\n }\n static allWithCallback(values, callback) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n // Start at 2 to prevent prematurely resolving if .then is called immediately.\n let unresolvedCount = 2;\n let valueIndex = 0;\n const resolvedValues = [];\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n const curValueIndex = valueIndex;\n try {\n value.then((value) => {\n resolvedValues[curValueIndex] = callback ? callback.thenCallback(value) : value;\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }, (err) => {\n if (!callback) {\n reject(err);\n }\n else {\n resolvedValues[curValueIndex] = callback.errorCallback(err);\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }\n });\n }\n catch (thenErr) {\n reject(thenErr);\n }\n unresolvedCount++;\n valueIndex++;\n }\n // Make the unresolvedCount zero-based again.\n unresolvedCount -= 2;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n return promise;\n }\n constructor(executor) {\n const promise = this;\n if (!(promise instanceof ZoneAwarePromise)) {\n throw new Error('Must be an instanceof Promise.');\n }\n promise[symbolState] = UNRESOLVED;\n promise[symbolValue] = []; // queue;\n try {\n const onceWrapper = once();\n executor &&\n executor(onceWrapper(makeResolver(promise, RESOLVED)), onceWrapper(makeResolver(promise, REJECTED)));\n }\n catch (error) {\n resolvePromise(promise, false, error);\n }\n }\n get [Symbol.toStringTag]() {\n return 'Promise';\n }\n get [Symbol.species]() {\n return ZoneAwarePromise;\n }\n then(onFulfilled, onRejected) {\n // We must read `Symbol.species` safely because `this` may be anything. For instance, `this`\n // may be an object without a prototype (created through `Object.create(null)`); thus\n // `this.constructor` will be undefined. One of the use cases is SystemJS creating\n // prototype-less objects (modules) via `Object.create(null)`. The SystemJS creates an empty\n // object and copies promise properties into that object (within the `getOrCreateLoad`\n // function). The zone.js then checks if the resolved value has the `then` method and\n // invokes it with the `value` context. Otherwise, this will throw an error: `TypeError:\n // Cannot read properties of undefined (reading 'Symbol(Symbol.species)')`.\n let C = this.constructor?.[Symbol.species];\n if (!C || typeof C !== 'function') {\n C = this.constructor || ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n const zone = Zone.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n }\n else {\n scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n }\n return chainPromise;\n }\n catch(onRejected) {\n return this.then(null, onRejected);\n }\n finally(onFinally) {\n // See comment on the call to `then` about why thee `Symbol.species` is safely accessed.\n let C = this.constructor?.[Symbol.species];\n if (!C || typeof C !== 'function') {\n C = ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n chainPromise[symbolFinally] = symbolFinally;\n const zone = Zone.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFinally, onFinally);\n }\n else {\n scheduleResolveOrReject(this, zone, chainPromise, onFinally, onFinally);\n }\n return chainPromise;\n }\n }\n // Protect against aggressive optimizers dropping seemingly unused properties.\n // E.g. Closure Compiler in advanced mode.\n ZoneAwarePromise['resolve'] = ZoneAwarePromise.resolve;\n ZoneAwarePromise['reject'] = ZoneAwarePromise.reject;\n ZoneAwarePromise['race'] = ZoneAwarePromise.race;\n ZoneAwarePromise['all'] = ZoneAwarePromise.all;\n const NativePromise = (global[symbolPromise] = global['Promise']);\n global['Promise'] = ZoneAwarePromise;\n const symbolThenPatched = __symbol__('thenPatched');\n function patchThen(Ctor) {\n const proto = Ctor.prototype;\n const prop = ObjectGetOwnPropertyDescriptor(proto, 'then');\n if (prop && (prop.writable === false || !prop.configurable)) {\n // check Ctor.prototype.then propertyDescriptor is writable or not\n // in meteor env, writable is false, we should ignore such case\n return;\n }\n const originalThen = proto.then;\n // Keep a reference to the original method.\n proto[symbolThen] = originalThen;\n Ctor.prototype.then = function (onResolve, onReject) {\n const wrapped = new ZoneAwarePromise((resolve, reject) => {\n originalThen.call(this, resolve, reject);\n });\n return wrapped.then(onResolve, onReject);\n };\n Ctor[symbolThenPatched] = true;\n }\n api.patchThen = patchThen;\n function zoneify(fn) {\n return function (self, args) {\n let resultPromise = fn.apply(self, args);\n if (resultPromise instanceof ZoneAwarePromise) {\n return resultPromise;\n }\n let ctor = resultPromise.constructor;\n if (!ctor[symbolThenPatched]) {\n patchThen(ctor);\n }\n return resultPromise;\n };\n }\n if (NativePromise) {\n patchThen(NativePromise);\n patchMethod(global, 'fetch', (delegate) => zoneify(delegate));\n }\n // This is not part of public API, but it is useful for tests, so we expose it.\n Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;\n return ZoneAwarePromise;\n });\n}\n\nfunction patchToString(Zone) {\n // override Function.prototype.toString to make zone.js patched function\n // look like native function\n Zone.__load_patch('toString', (global) => {\n // patch Func.prototype.toString to let them look like native\n const originalFunctionToString = Function.prototype.toString;\n const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol('OriginalDelegate');\n const PROMISE_SYMBOL = zoneSymbol('Promise');\n const ERROR_SYMBOL = zoneSymbol('Error');\n const newFunctionToString = function toString() {\n if (typeof this === 'function') {\n const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];\n if (originalDelegate) {\n if (typeof originalDelegate === 'function') {\n return originalFunctionToString.call(originalDelegate);\n }\n else {\n return Object.prototype.toString.call(originalDelegate);\n }\n }\n if (this === Promise) {\n const nativePromise = global[PROMISE_SYMBOL];\n if (nativePromise) {\n return originalFunctionToString.call(nativePromise);\n }\n }\n if (this === Error) {\n const nativeError = global[ERROR_SYMBOL];\n if (nativeError) {\n return originalFunctionToString.call(nativeError);\n }\n }\n }\n return originalFunctionToString.call(this);\n };\n newFunctionToString[ORIGINAL_DELEGATE_SYMBOL] = originalFunctionToString;\n Function.prototype.toString = newFunctionToString;\n // patch Object.prototype.toString to let them look like native\n const originalObjectToString = Object.prototype.toString;\n const PROMISE_OBJECT_TO_STRING = '[object Promise]';\n Object.prototype.toString = function () {\n if (typeof Promise === 'function' && this instanceof Promise) {\n return PROMISE_OBJECT_TO_STRING;\n }\n return originalObjectToString.call(this);\n };\n });\n}\n\nfunction patchCallbacks(api, target, targetName, method, callbacks) {\n const symbol = Zone.__symbol__(method);\n if (target[symbol]) {\n return;\n }\n const nativeDelegate = (target[symbol] = target[method]);\n target[method] = function (name, opts, options) {\n if (opts && opts.prototype) {\n callbacks.forEach(function (callback) {\n const source = `${targetName}.${method}::` + callback;\n const prototype = opts.prototype;\n // Note: the `patchCallbacks` is used for patching the `document.registerElement` and\n // `customElements.define`. We explicitly wrap the patching code into try-catch since\n // callbacks may be already patched by other web components frameworks (e.g. LWC), and they\n // make those properties non-writable. This means that patching callback will throw an error\n // `cannot assign to read-only property`. See this code as an example:\n // https://github.com/salesforce/lwc/blob/master/packages/@lwc/engine-core/src/framework/base-bridge-element.ts#L180-L186\n // We don't want to stop the application rendering if we couldn't patch some\n // callback, e.g. `attributeChangedCallback`.\n try {\n if (prototype.hasOwnProperty(callback)) {\n const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback);\n if (descriptor && descriptor.value) {\n descriptor.value = api.wrapWithCurrentZone(descriptor.value, source);\n api._redefineProperty(opts.prototype, callback, descriptor);\n }\n else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n }\n else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n }\n catch {\n // Note: we leave the catch block empty since there's no way to handle the error related\n // to non-writable property.\n }\n });\n }\n return nativeDelegate.call(target, name, opts, options);\n };\n api.attachOriginToPatched(target[method], nativeDelegate);\n}\n\nfunction patchUtil(Zone) {\n Zone.__load_patch('util', (global, Zone, api) => {\n // Collect native event names by looking at properties\n // on the global namespace, e.g. 'onclick'.\n const eventNames = getOnEventNames(global);\n api.patchOnProperties = patchOnProperties;\n api.patchMethod = patchMethod;\n api.bindArguments = bindArguments;\n api.patchMacroTask = patchMacroTask;\n // In earlier version of zone.js (<0.9.0), we use env name `__zone_symbol__BLACK_LISTED_EVENTS`\n // to define which events will not be patched by `Zone.js`. In newer version (>=0.9.0), we\n // change the env name to `__zone_symbol__UNPATCHED_EVENTS` to keep the name consistent with\n // angular repo. The `__zone_symbol__BLACK_LISTED_EVENTS` is deprecated, but it is still be\n // supported for backwards compatibility.\n const SYMBOL_BLACK_LISTED_EVENTS = Zone.__symbol__('BLACK_LISTED_EVENTS');\n const SYMBOL_UNPATCHED_EVENTS = Zone.__symbol__('UNPATCHED_EVENTS');\n if (global[SYMBOL_UNPATCHED_EVENTS]) {\n global[SYMBOL_BLACK_LISTED_EVENTS] = global[SYMBOL_UNPATCHED_EVENTS];\n }\n if (global[SYMBOL_BLACK_LISTED_EVENTS]) {\n Zone[SYMBOL_BLACK_LISTED_EVENTS] = Zone[SYMBOL_UNPATCHED_EVENTS] =\n global[SYMBOL_BLACK_LISTED_EVENTS];\n }\n api.patchEventPrototype = patchEventPrototype;\n api.patchEventTarget = patchEventTarget;\n api.isIEOrEdge = isIEOrEdge;\n api.ObjectDefineProperty = ObjectDefineProperty;\n api.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;\n api.ObjectCreate = ObjectCreate;\n api.ArraySlice = ArraySlice;\n api.patchClass = patchClass;\n api.wrapWithCurrentZone = wrapWithCurrentZone;\n api.filterProperties = filterProperties;\n api.attachOriginToPatched = attachOriginToPatched;\n api._redefineProperty = Object.defineProperty;\n api.patchCallbacks = patchCallbacks;\n api.getGlobalObjects = () => ({\n globalSources,\n zoneSymbolEventNames,\n eventNames,\n isBrowser,\n isMix,\n isNode,\n TRUE_STR,\n FALSE_STR,\n ZONE_SYMBOL_PREFIX,\n ADD_EVENT_LISTENER_STR,\n REMOVE_EVENT_LISTENER_STR,\n });\n });\n}\n\nfunction patchCommon(Zone) {\n patchPromise(Zone);\n patchToString(Zone);\n patchUtil(Zone);\n}\n\nconst Zone$1 = loadZone();\npatchCommon(Zone$1);\npatchBrowser(Zone$1);\n"],"x_google_ignoreList":[1,2]}