mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
19 KiB
9 lines
19 KiB
'use strict';
|
|
/**
|
|
* @license Angular
|
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
* License: MIT
|
|
*/(function(g,f){if(typeof define=="function"&&define.amd){define(f)}else if(typeof exports=="object" && typeof module<"u"){module.exports=f()}else{var m=f();for(var i in m) g[i]=m[i]}}(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : this,function(){var exports={};var __exports=exports;var module={exports};
|
|
"use strict";var q=exports&&exports.__generator||function(v,T){var h={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},m,p,a,k=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return k.next=P(0),k.throw=P(1),k.return=P(2),typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function P(o){return function(w){return F([o,w])}}function F(o){if(m)throw new TypeError("Generator is already executing.");for(;k&&(k=0,o[0]&&(h=0)),h;)try{if(m=1,p&&(a=o[0]&2?p.return:o[0]?p.throw||((a=p.return)&&a.call(p),0):p.next)&&!(a=a.call(p,o[1])).done)return a;switch(p=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return h.label++,{value:o[1],done:!1};case 5:h.label++,p=o[1],o=[0];continue;case 7:o=h.ops.pop(),h.trys.pop();continue;default:if(a=h.trys,!(a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){h=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){h.label=o[1];break}if(o[0]===6&&h.label<a[1]){h.label=a[1],a=o;break}if(a&&h.label<a[2]){h.label=a[2],h.ops.push(o);break}a[2]&&h.ops.pop(),h.trys.pop();continue}o=T.call(v,h)}catch(w){o=[6,w],p=0}finally{m=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},$=exports&&exports.__spreadArray||function(v,T,h){if(h||arguments.length===2)for(var m=0,p=T.length,a;m<p;m++)(a||!(m in T))&&(a||(a=Array.prototype.slice.call(T,0,m)),a[m]=T[m]);return v.concat(a||Array.prototype.slice.call(T))};(function(v,T){if(typeof define=="function"&&define.amd)define(T);else if(typeof exports=="object"&&typeof module<"u")module.exports=T();else{var h=T();for(var m in h)v[m]=h[m]}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:exports,function(){var v={},T=v,h={exports:v},m=Object.defineProperty,p=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,P=function(t,e,r){return e in t?m(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},F=function(t,e){for(var r in e||(e={}))a.call(e,r)&&P(t,r,e[r]);if(p)for(var i=0,n=p(e);i<n.length;i++){var r=n[i];k.call(e,r)&&P(t,r,e[r])}return t},o=function(t,e,r){return P(t,typeof e!="symbol"?e+"":e,r),r},w=function(t,e,r){return new Promise(function(i,n){var s=function(c){try{f(r.next(c))}catch(y){n(y)}},u=function(c){try{f(r.throw(c))}catch(y){n(y)}},f=function(c){return c.done?i(c.value):Promise.resolve(c.value).then(s,u)};f((r=r.apply(t,e)).next())})};function L(){var t=typeof jest!="undefined"&&jest.__zone_patch__;throw t?new Error("Only globals are patched with zone-testing. If you import `it`, `describe`, etc. directly, you cannot use `fakeAsync` or `waitForAsync`."):new Error("ProxyZoneSpec is needed for the fakeAsync and waitForAsync test helpers but could not be found. Make sure that your environment includes zone-testing.js")}var l=typeof window=="object"&&window||typeof self=="object"&&self||globalThis.global,Q=l.setImmediate,C=l.setTimeout,_=l.Date;function b(){if(arguments.length===0){var t=new _;return t.setTime(b.now()),t}else{var e=Array.prototype.slice.call(arguments);return new(_.bind.apply(_,$([void 0],e,!1)))}}b.now=function(){var t=Zone.current.get("FakeAsyncTestZoneSpec");return t?t.getFakeSystemTime():_.now.apply(this,arguments)},b.UTC=_.UTC,b.parse=_.parse;var g,z=function(){},D=function(){function t(){o(this,"_schedulerQueue",[]),o(this,"_currentTickTime",0),o(this,"_currentFakeBaseSystemTime",_.now()),o(this,"_currentTickRequeuePeriodicEntries",[])}return t.getNextId=function(){var e=g.nativeSetTimeout.call(l,z,0);return g.nativeClearTimeout.call(l,e),typeof e=="number"?e:t.nextNodeJSId++},t.prototype.getCurrentTickTime=function(){return this._currentTickTime},t.prototype.getFakeSystemTime=function(){return this._currentFakeBaseSystemTime+this._currentTickTime},t.prototype.setFakeBaseSystemTime=function(e){this._currentFakeBaseSystemTime=e},t.prototype.getRealSystemTime=function(){return _.now()},t.prototype.scheduleFunction=function(e,r,i){i=F(F({},{args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1}),i);var n=i.id<0?t.nextId:i.id;t.nextId=t.getNextId();var s=this._currentTickTime+r,u={endTime:s,id:n,func:e,args:i.args,delay:r,isPeriodic:i.isPeriodic,isRequestAnimationFrame:i.isRequestAnimationFrame};i.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(u);for(var f=0;f<this._schedulerQueue.length;f++){var c=this._schedulerQueue[f];if(u.endTime<c.endTime)break}return this._schedulerQueue.splice(f,0,u),n},t.prototype.removeScheduledFunctionWithId=function(e){for(var r=0;r<this._schedulerQueue.length;r++)if(this._schedulerQueue[r].id==e){this._schedulerQueue.splice(r,1);break}},t.prototype.removeAll=function(){this._schedulerQueue=[]},t.prototype.getTimerCount=function(){return this._schedulerQueue.length},t.prototype.tickToNext=function(e,r,i){if(e===void 0&&(e=1),!(this._schedulerQueue.length<e)){var n=this._currentTickTime,s=this._schedulerQueue[e-1];this.tick(s.endTime-n,r,i)}},t.prototype.tick=function(e,r,i){e===void 0&&(e=0);var n=this._currentTickTime+e,s=0;i=Object.assign({processNewMacroTasksSynchronously:!0},i);var u=i.processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(u.length===0&&r){r(e);return}for(;u.length>0;){this._currentTickRequeuePeriodicEntries=[];var f=u[0];if(n<f.endTime)break;var c=u.shift();if(!i.processNewMacroTasksSynchronously){var y=this._schedulerQueue.indexOf(c);y>=0&&this._schedulerQueue.splice(y,1)}s=this._currentTickTime,this._currentTickTime=c.endTime,r&&r(this._currentTickTime-s);var A=c.func.apply(l,c.isRequestAnimationFrame?[this._currentTickTime]:c.args);if(!A)break;i.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach(function(S){for(var M=0;M<u.length;M++){var Y=u[M];if(S.endTime<Y.endTime)break}u.splice(M,0,S)})}s=this._currentTickTime,this._currentTickTime=n,r&&r(this._currentTickTime-s)},t.prototype.executeNextTask=function(e){var r=this._schedulerQueue.shift();r!==void 0&&(e==null||e(r.endTime-this._currentTickTime),this._currentTickTime=r.endTime,r.func.apply(l,r.isRequestAnimationFrame?[this._currentTickTime]:r.args))},t.prototype.flushOnlyPendingTimers=function(e){if(this._schedulerQueue.length===0)return 0;var r=this._currentTickTime,i=this._schedulerQueue[this._schedulerQueue.length-1];return this.tick(i.endTime-r,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-r},t.prototype.flush=function(e,r,i){return e===void 0&&(e=20),r===void 0&&(r=!1),r?this.flushPeriodic(i):this.flushNonPeriodic(e,i)},t.prototype.flushPeriodic=function(e){if(this._schedulerQueue.length===0)return 0;var r=this._currentTickTime,i=this._schedulerQueue[this._schedulerQueue.length-1];return this.tick(i.endTime-r,e),this._currentTickTime-r},t.prototype.flushNonPeriodic=function(e,r){for(var i=this._currentTickTime,n=0,s=0;this._schedulerQueue.length>0;){if(s++,s>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(this._schedulerQueue.filter(function(c){return!c.isPeriodic&&!c.isRequestAnimationFrame}).length===0)break;var u=this._schedulerQueue.shift();n=this._currentTickTime,this._currentTickTime=u.endTime,r&&r(this._currentTickTime-n);var f=u.func.apply(l,u.args);if(!f)break}return this._currentTickTime-i},t}();o(D,"nextNodeJSId",1),o(D,"nextId",-1);var I=D,B=function(){function t(e,r,i){r===void 0&&(r=!1),o(this,"trackPendingRequestAnimationFrame"),o(this,"macroTaskOptions"),o(this,"_scheduler",new I),o(this,"_microtasks",[]),o(this,"_lastError",null),o(this,"_uncaughtPromiseErrors",Promise[Zone.__symbol__("uncaughtPromiseErrors")]),o(this,"pendingPeriodicTimers",[]),o(this,"pendingTimers",[]),o(this,"patchDateLocked",!1),o(this,"tickMode",{counter:0,mode:"manual"}),o(this,"name"),o(this,"properties",{FakeAsyncTestZoneSpec:this}),this.trackPendingRequestAnimationFrame=r,this.macroTaskOptions=i,this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=l[Zone.__symbol__("FakeAsyncTestMacroTask")])}return t.assertInZone=function(){if(Zone.current.get("FakeAsyncTestZoneSpec")==null)throw new Error("The code should be running in the fakeAsync zone to call this function")},t.prototype._fnAndFlush=function(e,r){var i=this;return function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];return e.apply(l,n),i._lastError===null?(r.onSuccess!=null&&r.onSuccess.apply(l),i.flushMicrotasks()):r.onError!=null&&r.onError.apply(l),i._lastError===null}},t._removeTimer=function(e,r){var i=e.indexOf(r);i>-1&&e.splice(i,1)},t.prototype._dequeueTimer=function(e){var r=this;return function(){t._removeTimer(r.pendingTimers,e)}},t.prototype._requeuePeriodicTimer=function(e,r,i,n){var s=this;return function(){s.pendingPeriodicTimers.indexOf(n)!==-1&&s._scheduler.scheduleFunction(e,r,{args:i,isPeriodic:!0,id:n,isRequeuePeriodic:!0})}},t.prototype._dequeuePeriodicTimer=function(e){var r=this;return function(){t._removeTimer(r.pendingPeriodicTimers,e)}},t.prototype._setTimeout=function(e,r,i,n){n===void 0&&(n=!0);var s=this._dequeueTimer(I.nextId),u=this._fnAndFlush(e,{onSuccess:s,onError:s}),f=this._scheduler.scheduleFunction(u,r,{args:i,isRequestAnimationFrame:!n});return n&&this.pendingTimers.push(f),f},t.prototype._clearTimeout=function(e){t._removeTimer(this.pendingTimers,e),this._scheduler.removeScheduledFunctionWithId(e)},t.prototype._setInterval=function(e,r,i){var n=I.nextId,s={onSuccess:null,onError:this._dequeuePeriodicTimer(n)},u=this._fnAndFlush(e,s);return s.onSuccess=this._requeuePeriodicTimer(u,r,i,n),this._scheduler.scheduleFunction(u,r,{args:i,isPeriodic:!0}),this.pendingPeriodicTimers.push(n),n},t.prototype._clearInterval=function(e){t._removeTimer(this.pendingPeriodicTimers,e),this._scheduler.removeScheduledFunctionWithId(e)},t.prototype._resetLastErrorAndThrow=function(){var e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e},t.prototype.getCurrentTickTime=function(){return this._scheduler.getCurrentTickTime()},t.prototype.getFakeSystemTime=function(){return this._scheduler.getFakeSystemTime()},t.prototype.setFakeBaseSystemTime=function(e){this._scheduler.setFakeBaseSystemTime(e)},t.prototype.getRealSystemTime=function(){return this._scheduler.getRealSystemTime()},t.patchDate=function(){l[Zone.__symbol__("disableDatePatching")]||l.Date!==b&&(l.Date=b,b.prototype=_.prototype,t.checkTimerPatch())},t.resetDate=function(){l.Date===b&&(l.Date=_)},t.checkTimerPatch=function(){if(!g)throw new Error("Expected timers to have been patched.");l.setTimeout!==g.setTimeout&&(l.setTimeout=g.setTimeout,l.clearTimeout=g.clearTimeout),l.setInterval!==g.setInterval&&(l.setInterval=g.setInterval,l.clearInterval=g.clearInterval)},t.prototype.lockDatePatch=function(){this.patchDateLocked=!0,t.patchDate()},t.prototype.unlockDatePatch=function(){this.patchDateLocked=!1,t.resetDate()},t.prototype.setTickMode=function(e,r){e!==this.tickMode.mode&&(this.tickMode.counter++,this.tickMode.mode=e,e==="automatic"&&this.advanceUntilModeChanges(r))},t.prototype.advanceUntilModeChanges=function(e){var r=this;t.assertInZone();var i=Zone.current,n=this.tickMode.counter;Zone.root.run(function(){return w(r,null,function(){var s=this;return q(this,function(u){switch(u.label){case 0:return[4,R(function(){return w(s,null,function(){var f=this;return q(this,function(c){switch(c.label){case 0:return[4,void 0];case 1:return c.sent(),i.run(function(){f.flushMicrotasks()}),[2]}})})})];case 1:if(u.sent(),this.tickMode.counter!==n)return[2];u.label=2;case 2:return[4,R(function(){return s.newMacrotask(i)})];case 3:return u.sent(),this.tickMode.counter!==n?[2]:[4,R(function(){return i.run(function(){s._scheduler.executeNextTask(e)})})];case 4:return u.sent(),[3,2];case 5:return[2]}})})})},t.prototype.newMacrotask=function(e){return w(this,null,function(){var r,i=this;return q(this,function(n){switch(n.label){case 0:return Q?[4,new Promise(function(s){Q(s)})]:[3,2];case 1:return n.sent(),[3,5];case 2:return r=new MessageChannel,[4,new Promise(function(s){r.port1.onmessage=s,r.port2.postMessage(void 0)})];case 3:return n.sent(),r.port1.close(),r.port2.close(),[4,new Promise(function(s){C(s)})];case 4:n.sent(),n.label=5;case 5:return e.run(function(){i.flushMicrotasks()}),[2]}})})},t.prototype.tickToNext=function(e,r,i){e===void 0&&(e=1),i===void 0&&(i={processNewMacroTasksSynchronously:!0}),!(e<=0)&&(t.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(e,r,i),this._lastError!==null&&this._resetLastErrorAndThrow())},t.prototype.tick=function(e,r,i){e===void 0&&(e=0),i===void 0&&(i={processNewMacroTasksSynchronously:!0}),t.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(e,r,i),this._lastError!==null&&this._resetLastErrorAndThrow()},t.prototype.flushMicrotasks=function(){var e=this;t.assertInZone();for(var r=function(){(e._lastError!==null||e._uncaughtPromiseErrors.length)&&e._resetLastErrorAndThrow()};this._microtasks.length>0;){var i=this._microtasks.shift();i.func.apply(i.target,i.args)}r()},t.prototype.flush=function(e,r,i){t.assertInZone(),this.flushMicrotasks();var n=this._scheduler.flush(e,r,i);return this._lastError!==null&&this._resetLastErrorAndThrow(),n},t.prototype.flushOnlyPendingTimers=function(e){t.assertInZone(),this.flushMicrotasks();var r=this._scheduler.flushOnlyPendingTimers(e);return this._lastError!==null&&this._resetLastErrorAndThrow(),r},t.prototype.removeAllTimers=function(){t.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]},t.prototype.getTimerCount=function(){return this._scheduler.getTimerCount()+this._microtasks.length},t.prototype.onScheduleTask=function(e,r,i,n){switch(n.type){case"microTask":var s=n.data&&n.data.args,u=void 0;if(s){var f=n.data.cbIdx;typeof s.length=="number"&&s.length>f+1&&(u=Array.prototype.slice.call(s,f+1))}this._microtasks.push({func:n.invoke,args:u,target:n.data&&n.data.target});break;case"macroTask":switch(n.source){case"setTimeout":n.data.handleId=this._setTimeout(n.invoke,n.data.delay,Array.prototype.slice.call(n.data.args,2));break;case"setImmediate":n.data.handleId=this._setTimeout(n.invoke,0,Array.prototype.slice.call(n.data.args,1));break;case"setInterval":n.data.handleId=this._setInterval(n.invoke,n.data.delay,Array.prototype.slice.call(n.data.args,2));break;case"XMLHttpRequest.send":if(this.tickMode.mode==="manual")throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+n.data.url);n=e.scheduleTask(i,n);break;case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":n.data.handleId=this._setTimeout(n.invoke,16,n.data.args,this.trackPendingRequestAnimationFrame);break;default:var c=this.findMacroTaskOption(n);if(c){var y=n.data&&n.data.args,A=y&&y.length>1?y[1]:0,S=c.callbackArgs?c.callbackArgs:y;c.isPeriodic?(n.data.handleId=this._setInterval(n.invoke,A,S),n.data.isPeriodic=!0):n.data.handleId=this._setTimeout(n.invoke,A,S);break}throw new Error("Unknown macroTask scheduled in fake async test: "+n.source)}break;case"eventTask":n=e.scheduleTask(i,n);break}return n},t.prototype.onCancelTask=function(e,r,i,n){switch(n.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(n.data.handleId);case"setInterval":return this._clearInterval(n.data.handleId);default:var s=this.findMacroTaskOption(n);if(s){var u=n.data.handleId;return s.isPeriodic?this._clearInterval(u):this._clearTimeout(u)}return e.cancelTask(i,n)}},t.prototype.onInvoke=function(e,r,i,n,s,u,f){try{return t.patchDate(),e.invoke(i,n,s,u,f)}finally{this.patchDateLocked||t.resetDate()}},t.prototype.findMacroTaskOption=function(e){if(!this.macroTaskOptions)return null;for(var r=0;r<this.macroTaskOptions.length;r++){var i=this.macroTaskOptions[r];if(i.source===e.source)return i}return null},t.prototype.onHandleError=function(e,r,i,n){return this._lastError=n,!1},t}(),d=null;function E(){return Zone&&Zone.ProxyZoneSpec}var Z=null,N=null;function O(){var t,e;d&&d.unlockDatePatch(),d=null,(e=(t=E())==null?void 0:t.get())==null||e.resetDelegate(),Z==null||Z.resetDelegate()}function U(t,e){e===void 0&&(e={});var r=e.flush,i=r===void 0?!0:r,n=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];var f=E();f||L();var c=f.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!d){var y=Zone&&Zone.FakeAsyncTestZoneSpec;if(c.getDelegate()instanceof y)throw new Error("fakeAsync() calls can not be nested");d=new y}var A=void 0,S=c.getDelegate();c.setDelegate(d),d.lockDatePatch();try{A=t.apply(this,s),i?d.flush(20,!0):j()}finally{c.setDelegate(S)}if(!i){if(d.pendingPeriodicTimers.length>0)throw new Error("".concat(d.pendingPeriodicTimers.length," periodic timer(s) still in the queue."));if(d.pendingTimers.length>0)throw new Error("".concat(d.pendingTimers.length," timer(s) still in the queue."))}return A}finally{O()}};return n.isFakeAsync=!0,n}function x(){if(d==null&&(d=Zone.current.get("FakeAsyncTestZoneSpec"),d==null))throw new Error("The code should be running in the fakeAsync zone to call this function");return d}function H(t,e){t===void 0&&(t=0),e===void 0&&(e=!1),x().tick(t,null,e)}function W(t){return x().flush(t)}function J(){var t=x(),e=t.pendingPeriodicTimers;t.pendingPeriodicTimers.length=0}function X(t){var e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var n=E();if(n===void 0)throw new Error("ProxyZoneSpec is needed for the withProxyZone() test helper but could not be found. Make sure that your environment includes zone-testing.js");var s=n.get()!==void 0?Zone.current:G();return s.run(t,this,r)};return e}function G(){var t=E();if(t===void 0)throw new Error("ProxyZoneSpec is needed for withProxyZone but could not be found. Make sure that your environment includes zone-testing.js");return Z===null&&(Z=new t),N=Zone.root.fork(Z),N}function j(){x().flushMicrotasks()}function V(t){t.FakeAsyncTestZoneSpec=B,t.__load_patch("fakeasync",function(e,r,i){r[i.symbol("fakeAsyncTest")]={resetFakeAsyncZone:O,flushMicrotasks:j,discardPeriodicTasks:J,tick:H,flush:W,fakeAsync:U,withProxyZone:X}},!0),g={setTimeout:l.setTimeout,setInterval:l.setInterval,clearTimeout:l.clearTimeout,clearInterval:l.clearInterval,nativeSetTimeout:l[t.__symbol__("setTimeout")],nativeClearTimeout:l[t.__symbol__("clearTimeout")]},I.nextId=I.getNextId()}function R(t){return w(this,null,function(){var e;return q(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t()];case 1:return[2,r.sent()];case 2:return e=r.sent(),K(e),[3,3];case 3:return[2]}})})}function K(t){Zone.root.run(function(){C(function(){throw t})})}return V(Zone),T!=v&&(h.exports=v),h.exports});
|
|
|
|
if(__exports != exports)module.exports = exports;return module.exports}));
|
|
|