const XHR=XMLHttpRequest.prototype,open=XHR.open,send=XHR.send,setRequestHeader=XHR.setRequestHeader;XHR.open=function(){return this._requestHeaders={},open.apply(this,arguments)},XHR.setRequestHeader=function(e,s){return this._requestHeaders[e]=s,setRequestHeader.apply(this,arguments)},XHR.send=function(){return this.addEventListener("load",(function(){const e=this.responseURL,s=this.getAllResponseHeaders();try{if("blob"!=this.responseType){const t={url:e,headers:s,body:this.responseText||this.response};window.dispatchEvent(new CustomEvent("EB::response",{detail:t}))}}catch(e){console.debug("Error reading or processing response.",e)}})),send.apply(this,arguments)};