"use strict"; /** * @license Angular v * (c) 2010-2022 Google LLC. https://angular.io/ * License: MIT */const NEWLINE="\n",IGNORE_FRAMES={},creationTrace="__creationTrace__",ERROR_TAG="STACKTRACE TRACKING",SEP_TAG="__SEP_TAG__";let sepTemplate=SEP_TAG+"@[native]";class LongStackTrace{constructor(){this.error=getStacktrace(),this.timestamp=new Date}}function getStacktraceWithUncaughtError(){return new Error(ERROR_TAG)}function getStacktraceWithCaughtError(){try{throw getStacktraceWithUncaughtError()}catch(t){return t}}const error=getStacktraceWithUncaughtError(),caughtError=getStacktraceWithCaughtError(),getStacktrace=error.stack?getStacktraceWithUncaughtError:caughtError.stack?getStacktraceWithCaughtError:getStacktraceWithUncaughtError;function getFrames(t){return t.stack?t.stack.split(NEWLINE):[]}function addErrorStack(t,r){let e=getFrames(r);for(let r=0;r0}function captureStackTraces(t,r){r>0&&(t.push(getFrames((new LongStackTrace).error)),captureStackTraces(t,r-1))}function computeIgnoreFrames(){if(!stackTracesEnabled())return;const t=[];captureStackTraces(t,2);const r=t[0],e=t[1];for(let t=0;tthis.longStackTraceLimit&&(r.length=this.longStackTraceLimit),a.data||(a.data={}),"eventTask"===a.type&&(a.data={...a.data}),a.data[creationTrace]=r}return t.scheduleTask(e,a)},onHandleError:function(t,r,e,a){if(stackTracesEnabled()){const t=Zone.currentTask||a.task;if(a instanceof Error&&t){const r=renderLongStackTrace(t.data&&t.data[creationTrace],a.stack);try{a.stack=a.longStack=r}catch(t){}}}return t.handleError(e,a)}},computeIgnoreFrames();