blob: 07e1f890f0ee3f60738ebc25fed3b430f754f29b [file] [log] [blame]
"use strict";
/**
* @license Angular v12.0.0-next.0
* (c) 2010-2020 Google LLC. https://angular.io/
* License: MIT
*/!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
Zone.__load_patch("fetch",(function(t,n,o){var e=t.fetch;if("function"==typeof e){var r=t[o.symbol("fetch")];r&&(e=r);var c=t.Promise,l=o.symbol("thenPatched"),a=o.symbol("fetchTaskScheduling"),f=o.symbol("fetchTaskAborting"),i=t.AbortController,u="function"==typeof i,s=null;u&&(t.AbortController=function(){var t=new i;return t.signal.abortController=t,t},s=o.patchMethod(i.prototype,"abort",(function(t){return function(n,o){return n.task?n.task.zone.cancelTask(n.task):t.apply(n,o)}})));var h=function(){};t.fetch=function(){var t=this,r=Array.prototype.slice.call(arguments),i=r.length>1?r[1]:null,b=i&&i.signal;return new Promise((function(i,d){var p=n.current.scheduleMacroTask("fetch",h,{fetchArgs:r},(function(){var f,u=n.current;try{u[a]=!0,f=e.apply(t,r)}catch(t){return void d(t)}finally{u[a]=!1}if(!(f instanceof c)){var s=f.constructor;s[l]||o.patchThen(s)}f.then((function(t){"notScheduled"!==p.state&&p.invoke(),i(t)}),(function(t){"notScheduled"!==p.state&&p.invoke(),d(t)}))}),(function(){if(u)if(b&&b.abortController&&!b.aborted&&"function"==typeof b.abortController.abort&&s)try{n.current[f]=!0,s.call(b.abortController)}finally{n.current[f]=!1}else d("cancel fetch need a AbortController.signal");else d("No AbortController supported, can not cancel fetch")}));b&&b.abortController&&(b.abortController.task=p)}))}}}))}));