${Ts(e)}`,{request:e})),i.push(d)),s([null,!1]))};try{n(e,r,u,c)}catch(d){c(d)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine:Responsehasnoerrororresultforrequest:
${Ts(e)}`,{request:e});if(!n)throw new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine:Nothingendedrequest:
${Ts(e)}`,{request:e})}}Hr.JsonRpcEngine=_t;function Ts(t){return JSON.stringify(t,null,2)}var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.mergeMiddleware=void 0;const U1=Hr;function V1(t){const e=new U1.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}Jn.mergeMiddleware=V1;(function(t){var e=T&&T.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=T&&T.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Vn,t),r(Wn,t),r(zn,t),r(Fr,t),r(Hr,t),r(Jn,t)})(mi);var Ic={},bi={};const _i=Hs(xc);var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});var Vo=_i,W1=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Vo.__awaiter(this,void 0,void 0,function(){var r,n,i;return Vo.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();Gn.default=W1;Object.defineProperty(bi,"__esModule",{value:!0});var Wo=_i,z1=Gn,q1=function(){function t(){this._semaphore=new z1.default(1)}return t.prototype.acquire=function(){return Wo.__awaiter(this,void 0,void 0,function(){var e,r;return Wo.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();bi.default=q1;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.withTimeout=void 0;var en=_i;function J1(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return en.__awaiter(n,void 0,void 0,function(){var c,u,d;return en.__generator(this,function(h){switch(h.label){case 0:return c=!1,setTimeout(function(){c=!0,s(r)},e),[4,t.acquire()];case 1:return u=h.sent(),c?(d=Array.isArray(u)?u[1]:u,d()):i(u),[2]}})})})},runExclusive:function(i){return en.__awaiter(this,void 0,void 0,function(){var s,c;return en.__generator(this,function(u){switch(u.label){case 0:s=function(){},u.label=1;case 1:return u.trys.push([1,,7,8]),[4,this.acquire()];case 2:return c=u.sent(),Array.isArray(c)?(s=c[1],[4,i(c[0])]):[3,4];case 3:return[2,u.sent()];case 4:return s=c,[4,i()];case 5:return[2,u.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}Zn.withTimeout=J1;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=bi;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=Gn;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Zn;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Ic);var G1=Q1,Z1=Object.prototype.hasOwnProperty;function