@legit-sdk/core 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -139,7 +139,7 @@ gpgsig`+TS(i)+`
139
139
  `)&&(t=t.replace(Ame,"%0A")),t.includes("\r")&&(t=t.replace(Rme,"%0D")),t.includes(" ")&&(t=t.replace(Tme,"%09")),n.pathname=t,n}function Wme(e){if(typeof e=="string")e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(e.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Q2?qme(e):Hme(e)}function qme(e){let t=e.hostname,r=e.pathname;for(let n=0;n<r.length;n++)if(r[n]==="%"){let a=r.codePointAt(n+2)||32;if(r[n+1]==="2"&&a===102||r[n+1]==="5"&&a===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(Nme,"\\"),r=decodeURIComponent(r),t!=="")return`\\\\${t}${r}`;{let n=r.codePointAt(1)|32,a=r[2];if(n<Cme||n>Lme||a!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function Hme(e){if(e.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let r=0;r<t.length;r++)if(t[r]==="%"){let n=t.codePointAt(r+2)||32;if(t[r+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}function zme(e){let t=Qj.resolve(e),r=e.charCodeAt(e.length-1);(r===Bme||Q2&&r===kme)&&t[t.length-1]!==Qj.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(Dme,"%25")),!Q2&&t.includes("\\")&&(t=t.replace($me,"%5C")),t.includes(`
140
140
  `)&&(t=t.replace(Ume,"%0A")),t.includes("\r")&&(t=t.replace(Mme,"%0D")),t.includes(" ")&&(t=t.replace(jme,"%09")),n.pathname=t,n}function s6(){if(fW)return ii;fW=!0,ii.fetch=n(Xl.fetch)&&n(Xl.ReadableStream),ii.writableStream=n(Xl.WritableStream),ii.abortController=n(Xl.AbortController);var e;function t(){if(e!==void 0)return e;if(Xl.XMLHttpRequest){e=new Xl.XMLHttpRequest;try{e.open("GET",Xl.XDomainRequest?"/":"https://example.com")}catch{e=null}}else e=null;return e}o(t,"getXHR");function r(a){var s=t();if(!s)return!1;try{return s.responseType=a,s.responseType===a}catch{}return!1}o(r,"checkTypeSupport"),ii.arraybuffer=ii.fetch||r("arraybuffer"),ii.msstream=!ii.fetch&&r("ms-stream"),ii.mozchunkedarraybuffer=!ii.fetch&&r("moz-chunked-arraybuffer"),ii.overrideMimeType=ii.fetch||(t()?n(t().overrideMimeType):!1);function n(a){return typeof a=="function"}return o(n,"isFunction"),e=null,ii}function l6(){if(uW)return Fw;uW=!0;var e=Ls.Buffer,t=At,r=s6(),n=rf(),a=i6(),s=Fw.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=Fw.IncomingMessage=function(u,h,c,d){var y=this||kw;if(a.Readable.call(y),y._mode=c,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){t.nextTick(function(){y.emit("close")})}),c==="fetch"){let E=o(function(){g.read().then(function(S){if(!y._destroyed){if(d(S.done),S.done){y.push(null);return}y.push(e.from(S.value)),E()}}).catch(function(S){d(!0),y._destroyed||y.emit("error",S)})},"read");if(y._fetchResponse=h,y.url=h.url,y.statusCode=h.status,y.statusMessage=h.statusText,h.headers.forEach(function(S,T){y.headers[T.toLowerCase()]=S,y.rawHeaders.push(T,S)}),r.writableStream){var m=new WritableStream({write:o(function(S){return d(!1),new Promise(function(T,x){y._destroyed?x():y.push(e.from(S))?T():y._resumeFetch=T})},"write"),close:o(function(){d(!0),y._destroyed||y.push(null)},"close"),abort:o(function(S){d(!0),y._destroyed||y.emit("error",S)},"abort")});try{h.body.pipeTo(m).catch(function(S){d(!0),y._destroyed||y.emit("error",S)});return}catch{}}var g=h.body.getReader();E()}else{y._xhr=u,y._pos=0,y.url=u.responseURL,y.statusCode=u.status,y.statusMessage=u.statusText;var v=u.getAllResponseHeaders().split(/\r?\n/);if(v.forEach(function(E){var S=E.match(/^([^:]+):\s*(.*)/);if(S){var T=S[1].toLowerCase();T==="set-cookie"?(y.headers[T]===void 0&&(y.headers[T]=[]),y.headers[T].push(S[2])):y.headers[T]!==void 0?y.headers[T]+=", "+S[2]:y.headers[T]=S[2],y.rawHeaders.push(S[1],S[2])}}),y._charset="x-user-defined",!r.overrideMimeType){var _=y.rawHeaders["mime-type"];if(_){var b=_.match(/;\s*charset=([^;])(;|$)/);b&&(y._charset=b[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};return n(i,a.Readable),i.prototype._read=function(){var u=this||kw,h=u._resumeFetch;h&&(u._resumeFetch=null,h())},i.prototype._onXHRProgress=function(u){var h=this||kw,c=h._xhr,d=null;switch(h._mode){case"text":if(d=c.responseText,d.length>h._pos){var y=d.substr(h._pos);if(h._charset==="x-user-defined"){for(var m=e.alloc(y.length),g=0;g<y.length;g++)m[g]=y.charCodeAt(g)&255;h.push(m)}else h.push(y,h._charset);h._pos=d.length}break;case"arraybuffer":if(c.readyState!==s.DONE||!c.response)break;d=c.response,h.push(e.from(new Uint8Array(d)));break;case"moz-chunked-arraybuffer":if(d=c.response,c.readyState!==s.LOADING||!d)break;h.push(e.from(new Uint8Array(d)));break;case"ms-stream":if(d=c.response,c.readyState!==s.LOADING)break;var v=new kw.MSStreamReader;v.onprogress=function(){v.result.byteLength>h._pos&&(h.push(e.from(new Uint8Array(v.result.slice(h._pos)))),h._pos=v.result.byteLength)},v.onload=function(){u(!0),h.push(null)},v.readAsArrayBuffer(d);break}h._xhr.readyState===s.DONE&&h._mode!=="ms-stream"&&(u(!0),h.push(null))},Fw}function Vme(){if(cW)return $2;cW=!0;var e=Ls.Buffer,t=At,r=s6(),n=rf(),a=l6(),s=i6(),i=a.IncomingMessage,u=a.readyStates;function h(m,g){return r.fetch&&g?"fetch":r.mozchunkedarraybuffer?"moz-chunked-arraybuffer":r.msstream?"ms-stream":r.arraybuffer&&m?"arraybuffer":"text"}o(h,"decideMode");var c=$2=o(function(m){var g=this||Wr;s.Writable.call(g),g._opts=m,g._body=[],g._headers={},m.auth&&g.setHeader("Authorization","Basic "+e.from(m.auth).toString("base64")),Object.keys(m.headers).forEach(function(b){g.setHeader(b,m.headers[b])});var v,_=!0;if(m.mode==="disable-fetch"||"requestTimeout"in m&&!r.abortController)_=!1,v=!0;else if(m.mode==="prefer-streaming")v=!1;else if(m.mode==="allow-wrong-content-type")v=!r.overrideMimeType;else if(!m.mode||m.mode==="default"||m.mode==="prefer-fast")v=!0;else throw new Error("Invalid value for opts.mode");g._mode=h(v,_),g._fetchTimer=null,g._socketTimeout=null,g._socketTimer=null,g.on("finish",function(){g._onFinish()})},"exports$42");n(c,s.Writable),c.prototype.setHeader=function(m,g){var v=this||Wr,_=m.toLowerCase();y.indexOf(_)===-1&&(v._headers[_]={name:m,value:g})},c.prototype.getHeader=function(m){var g=(this||Wr)._headers[m.toLowerCase()];return g?g.value:null},c.prototype.removeHeader=function(m){var g=this||Wr;delete g._headers[m.toLowerCase()]},c.prototype._onFinish=function(){var m=this||Wr;if(!m._destroyed){var g=m._opts;"timeout"in g&&g.timeout!==0&&m.setTimeout(g.timeout);var v=m._headers,_=null;g.method!=="GET"&&g.method!=="HEAD"&&(_=new Blob(m._body,{type:(v["content-type"]||{}).value||""}));var b=[];if(Object.keys(v).forEach(function(x){var A=v[x].name,B=v[x].value;Array.isArray(B)?B.forEach(function(P){b.push([A,P])}):b.push([A,B])}),m._mode==="fetch"){var E=null;if(r.abortController){var S=new AbortController;E=S.signal,m._fetchAbortController=S,"requestTimeout"in g&&g.requestTimeout!==0&&(m._fetchTimer=Wr.setTimeout(function(){m.emit("requestTimeout"),m._fetchAbortController&&m._fetchAbortController.abort()},g.requestTimeout))}Wr.fetch(m._opts.url,{method:m._opts.method,headers:b,body:_||void 0,mode:"cors",credentials:g.withCredentials?"include":"same-origin",signal:E}).then(function(x){m._fetchResponse=x,m._resetTimers(!1),m._connect()},function(x){m._resetTimers(!0),m._destroyed||m.emit("error",x)})}else{var T=m._xhr=new Wr.XMLHttpRequest;try{T.open(m._opts.method,m._opts.url,!0)}catch(x){t.nextTick(function(){m.emit("error",x)});return}"responseType"in T&&(T.responseType=m._mode),"withCredentials"in T&&(T.withCredentials=!!g.withCredentials),m._mode==="text"&&"overrideMimeType"in T&&T.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in g&&(T.timeout=g.requestTimeout,T.ontimeout=function(){m.emit("requestTimeout")}),b.forEach(function(x){T.setRequestHeader(x[0],x[1])}),m._response=null,T.onreadystatechange=function(){switch(T.readyState){case u.LOADING:case u.DONE:m._onXHRProgress();break}},m._mode==="moz-chunked-arraybuffer"&&(T.onprogress=function(){m._onXHRProgress()}),T.onerror=function(){m._destroyed||(m._resetTimers(!0),m.emit("error",new Error("XHR error")))};try{T.send(_)}catch(x){t.nextTick(function(){m.emit("error",x)});return}}}};function d(m){try{var g=m.status;return g!==null&&g!==0}catch{return!1}}o(d,"statusValid"),c.prototype._onXHRProgress=function(){var m=this||Wr;m._resetTimers(!1),!(!d(m._xhr)||m._destroyed)&&(m._response||m._connect(),m._response._onXHRProgress(m._resetTimers.bind(m)))},c.prototype._connect=function(){var m=this||Wr;m._destroyed||(m._response=new i(m._xhr,m._fetchResponse,m._mode,m._resetTimers.bind(m)),m._response.on("error",function(g){m.emit("error",g)}),m.emit("response",m._response))},c.prototype._write=function(m,g,v){var _=this||Wr;_._body.push(m),v()},c.prototype._resetTimers=function(m){var g=this||Wr;Wr.clearTimeout(g._socketTimer),g._socketTimer=null,m?(Wr.clearTimeout(g._fetchTimer),g._fetchTimer=null):g._socketTimeout&&(g._socketTimer=Wr.setTimeout(function(){g.emit("timeout")},g._socketTimeout))},c.prototype.abort=c.prototype.destroy=function(m){var g=this||Wr;g._destroyed=!0,g._resetTimers(!0),g._response&&(g._response._destroyed=!0),g._xhr?g._xhr.abort():g._fetchAbortController&&g._fetchAbortController.abort(),m&&g.emit("error",m)},c.prototype.end=function(m,g,v){var _=this||Wr;typeof m=="function"&&(v=m,m=void 0),s.Writable.prototype.end.call(_,m,g,v)},c.prototype.setTimeout=function(m,g){var v=this||Wr;g&&v.once("timeout",g),v._socketTimeout=m,v._resetTimers(!1)},c.prototype.flushHeaders=function(){},c.prototype.setNoDelay=function(){},c.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return $2}function Gme(){if(hW)return U2;hW=!0,U2=t;var e=Object.prototype.hasOwnProperty;function t(){for(var r={},n=0;n<arguments.length;n++){var a=arguments[n];for(var s in a)e.call(a,s)&&(r[s]=a[s])}return r}return o(t,"extend"),U2}function Kme(){return dW||(dW=!0,M2={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),M2}function Zme(){if(pW)return j2;pW=!0;var e=Vme(),t=l6(),r=Gme(),n=Kme(),a=kt,s=j2;return s.request=function(i,u){typeof i=="string"?i=a.parse(i):i=r(i);var h=Yme.location.protocol.search(/^https?:$/)===-1?"http:":"",c=i.protocol||h,d=i.hostname||i.host,y=i.port,m=i.path||"/";d&&d.indexOf(":")!==-1&&(d="["+d+"]"),i.url=(d?c+"//"+d:"")+(y?":"+y:"")+m,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var g=new e(i);return u&&g.on("response",u),g},s.get=o(function(u,h){var c=s.request(u,h);return c.end(),c},"get2"),s.ClientRequest=e,s.IncomingMessage=t.IncomingMessage,s.Agent=function(){},s.Agent.defaultMaxSockets=4,s.globalAgent=new s.Agent,s.STATUS_CODES=n,s.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],j2}function Xme(){if(yW)return W2;yW=!0;var e=Ta,t=kt,r=W2;for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);r.request=function(s,i){return s=a(s),e.request.call(this||mW,s,i)},r.get=function(s,i){return s=a(s),e.get.call(this||mW,s,i)};function a(s){if(typeof s=="string"&&(s=t.parse(s)),s.protocol||(s.protocol="https:"),s.protocol!=="https:")throw new Error('Protocol "'+s.protocol+'" not supported. Expected "https:"');return s}return o(a,"validateParams"),W2}var gW,wW,hc,tj,rj,nj,Ao,_W,va,ba,yc,br,Ql,_a,dc,Cw,or,Gpe,z2,Hw,AW,Kpe,Ype,Zpe,Xpe,Jpe,RW,TW,fj,Qpe,eye,tye,xW,ut,rye,nye,iye,OW,eR,ai,Mn,oye,ir,sye,lye,fye,Wd,je,Eo,vj,hye,Tw,MW,xw,yye,Vl,_Ne,p2,bj,fc,At,HW,Gi,oi,_j,Ow,Gl,Ej,bye,Ra,V2,cc,Aj,kye,Bye,Nw,Dw,bo,Cye,Y2,Z2,Fj,Ud,kj,Iw,Bj,Zl,Cj,Ls,Pw,Lj,g2,Nj,w2,Dj,v2,$j,b2,Uj,_2,Mj,E2,jj,S2,A2,Wj,Gye,R2,qj,T2,Hj,x2,zj,O2,Vj,I2,Gj,Zye,P2,Kj,F2,Yj,k2,Zj,Un,Xj,B2,Jj,Qj,pc,eme,tme,rme,nme,So,C2,tW,a6,rW,nW,ime,ame,Md,sme,Aa,kt,lme,_o,fme,ume,cme,hme,X2,iW,oW,aW,dme,pme,L2,uc,N2,D2,sW,lW,mme,gme,wme,vme,bme,J2,_me,Eme,Sme,Ame,Rme,Tme,Fme,kme,Bme,Cme,Lme,Q2,Nme,Dme,$me,Ume,Mme,jme,ii,fW,Xl,Fw,uW,kw,$2,cW,Wr,U2,hW,M2,dW,j2,pW,Yme,Ta,W2,yW,mW,Ns,Jme,Qme,ege,tge,rge,nge,ige,oge,f6=Qt(()=>{hc=typeof Reflect=="object"?Reflect:null,tj=hc&&typeof hc.apply=="function"?hc.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};wW=hc&&typeof hc.ownKeys=="function"?hc.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};rj=Number.isNaN||function(e){return e!=e};o(Ft,"o");gW=Ft,Ft.EventEmitter=Ft,Ft.prototype._events=void 0,Ft.prototype._eventsCount=0,Ft.prototype._maxListeners=void 0;nj=10;o(Bw,"u");o(vW,"f");o(ij,"v");o(zpe,"a");o(oj,"l");o(aj,"h");o(sj,"p");o(bW,"c");Object.defineProperty(Ft,"defaultMaxListeners",{enumerable:!0,get:o(function(){return nj},"get"),set:o(function(e){if(typeof e!="number"||e<0||rj(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");nj=e},"set")}),Ft.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ft.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||rj(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},Ft.prototype.getMaxListeners=function(){return vW(this)},Ft.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n=e==="error",a=this._events;if(a!==void 0)n=n&&a.error===void 0;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var i=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw i.context=s,i}var u=a[e];if(u===void 0)return!1;if(typeof u=="function")tj(u,this,t);else{var h=u.length,c=bW(u,h);for(r=0;r<h;++r)tj(c[r],this,t)}return!0},Ft.prototype.addListener=function(e,t){return ij(this,e,t,!1)},Ft.prototype.on=Ft.prototype.addListener,Ft.prototype.prependListener=function(e,t){return ij(this,e,t,!0)},Ft.prototype.once=function(e,t){return Bw(t),this.on(e,oj(this,e,t)),this},Ft.prototype.prependOnceListener=function(e,t){return Bw(t),this.prependListener(e,oj(this,e,t)),this},Ft.prototype.removeListener=function(e,t){var r,n,a,s,i;if(Bw(t),(n=this._events)===void 0)return this;if((r=n[e])===void 0)return this;if(r===t||r.listener===t)--this._eventsCount==0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(a=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){i=r[s].listener,a=s;break}if(a<0)return this;a===0?r.shift():function(u,h){for(;h+1<u.length;h++)u[h]=u[h+1];u.pop()}(r,a),r.length===1&&(n[e]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",e,i||t)}return this},Ft.prototype.off=Ft.prototype.removeListener,Ft.prototype.removeAllListeners=function(e){var t,r,n;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var a,s=Object.keys(r);for(n=0;n<s.length;++n)(a=s[n])!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(t=r[e])=="function")this.removeListener(e,t);else if(t!==void 0)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},Ft.prototype.listeners=function(e){return aj(this,e,!0)},Ft.prototype.rawListeners=function(e){return aj(this,e,!1)},Ft.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):sj.call(e,t)},Ft.prototype.listenerCount=sj,Ft.prototype.eventNames=function(){return this._eventsCount>0?wW(this._events):[]};Ao=gW;Ao.EventEmitter;Ao.defaultMaxListeners;Ao.init;Ao.listenerCount;Ao.EventEmitter;Ao.defaultMaxListeners;Ao.init;Ao.listenerCount;yc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis,br=_W={};o(q2,"i$2");o(H2,"u$2");o(EW,"c$2");(function(){try{va=typeof setTimeout=="function"?setTimeout:q2}catch{va=q2}try{ba=typeof clearTimeout=="function"?clearTimeout:H2}catch{ba=H2}})();_a=[],dc=!1,Cw=-1;o(Vpe,"h$1");o(SW,"d$1");o(lj,"m$1");o(wa,"p$1");br.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];_a.push(new lj(e,t)),_a.length!==1||dc||EW(SW)},lj.prototype.run=function(){(this||yc).fun.apply(null,(this||yc).array)},br.title="browser",br.browser=!0,br.env={},br.argv=[],br.version="",br.versions={},br.on=wa,br.addListener=wa,br.once=wa,br.off=wa,br.removeListener=wa,br.removeAllListeners=wa,br.emit=wa,br.prependListener=wa,br.prependOnceListener=wa,br.listeners=function(e){return[]},br.binding=function(e){throw new Error("process.binding is not supported")},br.cwd=function(){return"/"},br.chdir=function(e){throw new Error("process.chdir is not supported")},br.umask=function(){return 0};or=_W;or.addListener;or.argv;or.binding;or.browser;or.chdir;or.cwd;or.emit;or.env;or.listeners;or.nextTick;or.off;or.on;or.once;or.prependListener;or.prependOnceListener;or.removeAllListeners;or.removeListener;or.title;or.umask;or.version;or.versions;Gpe=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",z2=Object.prototype.toString,Hw=o(function(e){return!(Gpe&&e&&typeof e=="object"&&Symbol.toStringTag in e)&&z2.call(e)==="[object Arguments]"},"o2"),AW=o(function(e){return!!Hw(e)||e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&z2.call(e)!=="[object Array]"&&z2.call(e.callee)==="[object Function]"},"n2"),Kpe=function(){return Hw(arguments)}();Hw.isLegacyArguments=AW;Ype=Kpe?Hw:AW,Zpe=Object.prototype.toString,Xpe=Function.prototype.toString,Jpe=/^\s*(?:function)?\*/,RW=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",TW=Object.getPrototypeOf,fj=function(){if(!RW)return!1;try{return Function("return function*() {}")()}catch{}}(),Qpe=fj?TW(fj):{},eye=o(function(e){return typeof e=="function"&&(!!Jpe.test(Xpe.call(e))||(RW?TW(e)===Qpe:Zpe.call(e)==="[object GeneratorFunction]"))},"i2"),tye=typeof Object.create=="function"?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var r=o(function(){},"o5");r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},xW=o(function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},"i$1"),ut={},rye=xW,nye=Ype,iye=eye;o(tf,"c$1");OW=typeof BigInt<"u",eR=typeof Symbol<"u",ai=eR&&Symbol.toStringTag!==void 0,Mn=typeof Uint8Array<"u",oye=typeof ArrayBuffer<"u";if(Mn&&ai)var aye=Object.getPrototypeOf(Uint8Array.prototype),Ii=tf(Object.getOwnPropertyDescriptor(aye,Symbol.toStringTag).get);ir=tf(Object.prototype.toString),sye=tf(Number.prototype.valueOf),lye=tf(String.prototype.valueOf),fye=tf(Boolean.prototype.valueOf);if(OW)var uye=tf(BigInt.prototype.valueOf);if(eR)var cye=tf(Symbol.prototype.valueOf);o(zd,"O");o(uj,"S");o(IW,"B");o(PW,"k");o(FW,"E");o(kW,"D");o(BW,"U");o(CW,"P");o(LW,"x");o(NW,"I");o(DW,"M");o($W,"z");o(UW,"F");o(Sw,"T");o(Aw,"N");o(Rw,"W");o(u2,"$");o($w,"C");o(cj,"V");o(Uw,"G");o(hj,"R");o(Mw,"J");o(dj,"_");o(pj,"H");o(yj,"Z");o(mj,"q");o(gj,"K");o(wj,"L");ut.isArgumentsObject=nye,ut.isGeneratorFunction=iye,ut.isPromise=function(e){return typeof Promise<"u"&&e instanceof Promise||e!==null&&typeof e=="object"&&typeof e.then=="function"&&typeof e.catch=="function"},ut.isArrayBufferView=function(e){return oye&&ArrayBuffer.isView?ArrayBuffer.isView(e):uj(e)||hj(e)},ut.isTypedArray=uj,ut.isUint8Array=IW,ut.isUint8ClampedArray=PW,ut.isUint16Array=FW,ut.isUint32Array=kW,ut.isInt8Array=BW,ut.isInt16Array=CW,ut.isInt32Array=LW,ut.isFloat32Array=NW,ut.isFloat64Array=DW,ut.isBigInt64Array=$W,ut.isBigUint64Array=UW,Sw.working=typeof Map<"u"&&Sw(new Map),ut.isMap=function(e){return typeof Map<"u"&&(Sw.working?Sw(e):e instanceof Map)},Aw.working=typeof Set<"u"&&Aw(new Set),ut.isSet=function(e){return typeof Set<"u"&&(Aw.working?Aw(e):e instanceof Set)},Rw.working=typeof WeakMap<"u"&&Rw(new WeakMap),ut.isWeakMap=function(e){return typeof WeakMap<"u"&&(Rw.working?Rw(e):e instanceof WeakMap)},u2.working=typeof WeakSet<"u"&&u2(new WeakSet),ut.isWeakSet=function(e){return u2(e)},$w.working=typeof ArrayBuffer<"u"&&$w(new ArrayBuffer),ut.isArrayBuffer=cj,Uw.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Uw(new DataView(new ArrayBuffer(1),0,1)),ut.isDataView=hj,Mw.working=typeof SharedArrayBuffer<"u"&&Mw(new SharedArrayBuffer),ut.isSharedArrayBuffer=dj,ut.isAsyncFunction=function(e){return ir(e)==="[object AsyncFunction]"},ut.isMapIterator=function(e){return ir(e)==="[object Map Iterator]"},ut.isSetIterator=function(e){return ir(e)==="[object Set Iterator]"},ut.isGeneratorObject=function(e){return ir(e)==="[object Generator]"},ut.isWebAssemblyCompiledModule=function(e){return ir(e)==="[object WebAssembly.Module]"},ut.isNumberObject=pj,ut.isStringObject=yj,ut.isBooleanObject=mj,ut.isBigIntObject=gj,ut.isSymbolObject=wj,ut.isBoxedPrimitive=function(e){return pj(e)||yj(e)||mj(e)||gj(e)||wj(e)},ut.isAnyArrayBuffer=function(e){return Mn&&(cj(e)||dj(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(ut,e,{enumerable:!1,value:o(function(){throw new Error(e+" is not supported in userland")},"value")})});Wd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis,je={},Eo=or,vj=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},hye=/%[sdj%]/g;je.format=function(e){if(!Ww(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(Cs(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,a=n.length,s=String(e).replace(hye,function(u){if(u==="%%")return"%";if(r>=a)return u;switch(u){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return u}}),i=n[r];r<a;i=n[++r])zw(i)||!gc(i)?s+=" "+i:s+=" "+Cs(i);return s},je.deprecate=function(e,t){if(Eo!==void 0&&Eo.noDeprecation===!0)return e;if(Eo===void 0)return function(){return je.deprecate(e,t).apply(this||Wd,arguments)};var r=!1;return function(){if(!r){if(Eo.throwDeprecation)throw new Error(t);Eo.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this||Wd,arguments)}};Tw={},MW=/^$/;Eo.env.NODE_DEBUG&&(xw=Eo.env.NODE_DEBUG,xw=xw.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),MW=new RegExp("^"+xw+"$","i"));o(Cs,"oe");o(dye,"ue");o(pye,"fe");o(jw,"ae");o(c2,"ce");o(h2,"se");o(jW,"pe");o(tR,"ye");o(zw,"le");o(WW,"de");o(Ww,"ge");o(ef,"be");o(qd,"me");o(gc,"he");o(qw,"je");o(Hd,"Ae");o(Lw,"we");o(rR,"ve");o(d2,"Oe");je.debuglog=function(e){if(e=e.toUpperCase(),!Tw[e])if(MW.test(e)){var t=Eo.pid;Tw[e]=function(){var r=je.format.apply(je,arguments);console.error("%s %d: %s",e,t,r)}}else Tw[e]=function(){};return Tw[e]},je.inspect=Cs,Cs.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Cs.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},je.types=ut,je.isArray=jW,je.isBoolean=tR,je.isNull=zw,je.isNullOrUndefined=function(e){return e==null},je.isNumber=WW,je.isString=Ww,je.isSymbol=function(e){return typeof e=="symbol"},je.isUndefined=ef,je.isRegExp=qd,je.types.isRegExp=qd,je.isObject=gc,je.isDate=qw,je.types.isDate=qw,je.isError=Hd,je.types.isNativeError=Hd,je.isFunction=Lw,je.isPrimitive=function(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||e===void 0},je.isBuffer=xW;yye=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];o(mye,"Be");o(qW,"ke");je.log=function(){console.log("%s - %s",mye(),je.format.apply(je,arguments))},je.inherits=tye,je._extend=function(e,t){if(!t||!gc(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};Vl=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;o(gye,"De");je.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(Vl&&e[Vl]){var t;if(typeof(t=e[Vl])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,Vl,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var r,n,a=new Promise(function(u,h){r=u,n=h}),s=[],i=0;i<arguments.length;i++)s.push(arguments[i]);s.push(function(u,h){u?n(u):r(h)});try{e.apply(this||Wd,s)}catch(u){n(u)}return a}return o(t,"t5"),Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Vl&&Object.defineProperty(t,Vl,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,vj(e))},je.promisify.custom=Vl,je.callbackify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');function t(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var a=r.pop();if(typeof a!="function")throw new TypeError("The last argument must be of type Function");var s=this||Wd,i=o(function(){return a.apply(s,arguments)},"o5");e.apply(this||Wd,r).then(function(u){Eo.nextTick(i.bind(null,null,u))},function(u){Eo.nextTick(gye.bind(null,u,i))})}return o(t,"t5"),Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,vj(e)),t};je._extend;je.callbackify;je.debuglog;je.deprecate;je.format;je.inherits;je.inspect;je.isArray;je.isBoolean;je.isBuffer;je.isDate;je.isError;je.isFunction;je.isNull;je.isNullOrUndefined;je.isNumber;je.isObject;je.isPrimitive;je.isRegExp;je.isString;je.isSymbol;je.isUndefined;je.log;je.promisify;je._extend;je.callbackify;je.debuglog;je.deprecate;je.format;je.inherits;je.inspect;je.isArray;je.isBoolean;je.isBuffer;je.isDate;je.isError;je.isFunction;je.isNull;je.isNullOrUndefined;je.isNumber;je.isObject;je.isPrimitive;je.isRegExp;je.isString;je.isSymbol;je.isUndefined;je.log;_Ne=je.promisify;je.types;p2={},bj=!1,fc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(wye,"dew");At=wye();At.platform="browser";At.addListener;At.argv;At.binding;At.browser;At.chdir;At.cwd;At.emit;At.env;At.listeners;At.nextTick;At.off;At.on;At.once;At.prependListener;At.prependOnceListener;At.removeAllListeners;At.removeListener;At.title;At.umask;At.version;At.versions;for(HW={byteLength:o(function(e){var t=Sj(e),r=t[0],n=t[1];return 3*(r+n)/4-n},"byteLength"),toByteArray:o(function(e){var t,r,n=Sj(e),a=n[0],s=n[1],i=new _j(function(c,d,y){return 3*(d+y)/4-y}(0,a,s)),u=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)t=oi[e.charCodeAt(r)]<<18|oi[e.charCodeAt(r+1)]<<12|oi[e.charCodeAt(r+2)]<<6|oi[e.charCodeAt(r+3)],i[u++]=t>>16&255,i[u++]=t>>8&255,i[u++]=255&t;return s===2&&(t=oi[e.charCodeAt(r)]<<2|oi[e.charCodeAt(r+1)]>>4,i[u++]=255&t),s===1&&(t=oi[e.charCodeAt(r)]<<10|oi[e.charCodeAt(r+1)]<<4|oi[e.charCodeAt(r+2)]>>2,i[u++]=t>>8&255,i[u++]=255&t),i},"toByteArray"),fromByteArray:o(function(e){for(var t,r=e.length,n=r%3,a=[],s=0,i=r-n;s<i;s+=16383)a.push(vye(e,s,s+16383>i?i:s+16383));return n===1?(t=e[r-1],a.push(Gi[t>>2]+Gi[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],a.push(Gi[t>>10]+Gi[t>>4&63]+Gi[t<<2&63]+"=")),a.join("")},"fromByteArray")},Gi=[],oi=[],_j=typeof Uint8Array<"u"?Uint8Array:Array,Ow="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gl=0,Ej=Ow.length;Gl<Ej;++Gl)Gi[Gl]=Ow[Gl],oi[Ow.charCodeAt(Gl)]=Gl;o(Sj,"u$22");o(vye,"c$12");oi[45]=62,oi[95]=63;bye={read:o(function(e,t,r,n,a){var s,i,u=8*a-n-1,h=(1<<u)-1,c=h>>1,d=-7,y=r?a-1:0,m=r?-1:1,g=e[t+y];for(y+=m,s=g&(1<<-d)-1,g>>=-d,d+=u;d>0;s=256*s+e[t+y],y+=m,d-=8);for(i=s&(1<<-d)-1,s>>=-d,d+=n;d>0;i=256*i+e[t+y],y+=m,d-=8);if(s===0)s=1-c;else{if(s===h)return i?NaN:1/0*(g?-1:1);i+=Math.pow(2,n),s-=c}return(g?-1:1)*i*Math.pow(2,s-n)},"read"),write:o(function(e,t,r,n,a,s){var i,u,h,c=8*s-a-1,d=(1<<c)-1,y=d>>1,m=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,v=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,i=d):(i=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-i))<1&&(i--,h*=2),(t+=i+y>=1?m/h:m*Math.pow(2,1-y))*h>=2&&(i++,h/=2),i+y>=d?(u=0,i=d):i+y>=1?(u=(t*h-1)*Math.pow(2,a),i+=y):(u=t*Math.pow(2,y-1)*Math.pow(2,a),i=0));a>=8;e[r+g]=255&u,g+=v,u/=256,a-=8);for(i=i<<a|u,c+=a;c>0;e[r+g]=255&i,g+=v,i/=256,c-=8);e[r+g-v]|=128*_},"write")},Ra={},V2=HW,cc=bye,Aj=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ra.Buffer=De,Ra.SlowBuffer=function(e){return+e!=e&&(e=0),De.alloc(+e)},Ra.INSPECT_MAX_BYTES=50;o(Ea,"f$2");o(De,"u$1$1");o(zW,"s$12");o(VW,"h$1$1");o(G2,"a$2");o(y2,"p3");o(Rj,"c$1$1");o(nR,"l$12");o(GW,"y3");o(_ye,"g2");o(Kl,"w2");o(Tj,"d2");o(xj,"v3");o(Eye,"b2");o(Sye,"m2");o(KW,"E2");o(Aye,"B2");o(Rye,"A2");o(Tye,"U2");o(xye,"T2");o(YW,"I2");Ra.kMaxLength=2147483647,De.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:o(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}(),De.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(De.prototype,"parent",{enumerable:!0,get:o(function(){if(De.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(De.prototype,"offset",{enumerable:!0,get:o(function(){if(De.isBuffer(this))return this.byteOffset},"get")}),De.poolSize=8192,De.from=function(e,t,r){return zW(e,t,r)},Object.setPrototypeOf(De.prototype,Uint8Array.prototype),Object.setPrototypeOf(De,Uint8Array),De.alloc=function(e,t,r){return function(n,a,s){return VW(n),n<=0?Ea(n):a!==void 0?typeof s=="string"?Ea(n).fill(a,s):Ea(n).fill(a):Ea(n)}(e,t,r)},De.allocUnsafe=function(e){return G2(e)},De.allocUnsafeSlow=function(e){return G2(e)},De.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==De.prototype},De.compare=function(e,t){if(Sa(e,Uint8Array)&&(e=De.from(e,e.offset,e.byteLength)),Sa(t,Uint8Array)&&(t=De.from(t,t.offset,t.byteLength)),!De.isBuffer(e)||!De.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,a=0,s=Math.min(r,n);a<s;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},De.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},De.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return De.alloc(0);var r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=De.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var s=e[r];if(Sa(s,Uint8Array)&&(s=De.from(s)),!De.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,a),a+=s.length}return n},De.byteLength=GW,De.prototype._isBuffer=!0,De.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Kl(this,t,t+1);return this},De.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Kl(this,t,t+3),Kl(this,t+1,t+2);return this},De.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Kl(this,t,t+7),Kl(this,t+1,t+6),Kl(this,t+2,t+5),Kl(this,t+3,t+4);return this},De.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?YW(this,0,e):_ye.apply(this,arguments)},De.prototype.toLocaleString=De.prototype.toString,De.prototype.equals=function(e){if(!De.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||De.compare(this,e)===0},De.prototype.inspect=function(){var e="",t=Ra.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},Aj&&(De.prototype[Aj]=De.prototype.inspect),De.prototype.compare=function(e,t,r,n,a){if(Sa(e,Uint8Array)&&(e=De.from(e,e.offset,e.byteLength)),!De.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),a===void 0&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(a>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),u=Math.min(s,i),h=this.slice(n,a),c=e.slice(t,r),d=0;d<u;++d)if(h[d]!==c[d]){s=h[d],i=c[d];break}return s<i?-1:i<s?1:0},De.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},De.prototype.indexOf=function(e,t,r){return Tj(this,e,t,r,!0)},De.prototype.lastIndexOf=function(e,t,r){return Tj(this,e,t,r,!1)},De.prototype.write=function(e,t,r,n){if(t===void 0)n="utf8",r=this.length,t=0;else if(r===void 0&&typeof t=="string")n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,n===void 0&&(n="utf8")):(n=r,r=void 0)}var a=this.length-t;if((r===void 0||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return Eye(this,e,t,r);case"utf8":case"utf-8":return Sye(this,e,t,r);case"ascii":return KW(this,e,t,r);case"latin1":case"binary":return Aye(this,e,t,r);case"base64":return Rye(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tye(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},De.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};o(Oye,"S2");o(Iye,"R2");o(Pye,"O2");o(Fye,"L2");o(jr,"x2");o($n,"C2");o(ZW,"P2");o(Oj,"k2");o(Ij,"M2");De.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=t===void 0?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,De.prototype),n},De.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||jr(e,t,this.length);for(var n=this[e],a=1,s=0;++s<t&&(a*=256);)n+=this[e+s]*a;return n},De.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||jr(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},De.prototype.readUInt8=function(e,t){return e>>>=0,t||jr(e,1,this.length),this[e]},De.prototype.readUInt16LE=function(e,t){return e>>>=0,t||jr(e,2,this.length),this[e]|this[e+1]<<8},De.prototype.readUInt16BE=function(e,t){return e>>>=0,t||jr(e,2,this.length),this[e]<<8|this[e+1]},De.prototype.readUInt32LE=function(e,t){return e>>>=0,t||jr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},De.prototype.readUInt32BE=function(e,t){return e>>>=0,t||jr(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},De.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||jr(e,t,this.length);for(var n=this[e],a=1,s=0;++s<t&&(a*=256);)n+=this[e+s]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},De.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||jr(e,t,this.length);for(var n=t,a=1,s=this[e+--n];n>0&&(a*=256);)s+=this[e+--n]*a;return s>=(a*=128)&&(s-=Math.pow(2,8*t)),s},De.prototype.readInt8=function(e,t){return e>>>=0,t||jr(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},De.prototype.readInt16LE=function(e,t){e>>>=0,t||jr(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},De.prototype.readInt16BE=function(e,t){e>>>=0,t||jr(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},De.prototype.readInt32LE=function(e,t){return e>>>=0,t||jr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},De.prototype.readInt32BE=function(e,t){return e>>>=0,t||jr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},De.prototype.readFloatLE=function(e,t){return e>>>=0,t||jr(e,4,this.length),cc.read(this,e,!0,23,4)},De.prototype.readFloatBE=function(e,t){return e>>>=0,t||jr(e,4,this.length),cc.read(this,e,!1,23,4)},De.prototype.readDoubleLE=function(e,t){return e>>>=0,t||jr(e,8,this.length),cc.read(this,e,!0,52,8)},De.prototype.readDoubleBE=function(e,t){return e>>>=0,t||jr(e,8,this.length),cc.read(this,e,!1,52,8)},De.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||$n(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,s=0;for(this[t]=255&e;++s<r&&(a*=256);)this[t+s]=e/a&255;return t+r},De.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||$n(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+r},De.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,1,255,0),this[t]=255&e,t+1},De.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},De.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},De.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},De.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},De.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);$n(this,e,t,r,a-1,-a)}var s=0,i=1,u=0;for(this[t]=255&e;++s<r&&(i*=256);)e<0&&u===0&&this[t+s-1]!==0&&(u=1),this[t+s]=(e/i>>0)-u&255;return t+r},De.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var a=Math.pow(2,8*r-1);$n(this,e,t,r,a-1,-a)}var s=r-1,i=1,u=0;for(this[t+s]=255&e;--s>=0&&(i*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/i>>0)-u&255;return t+r},De.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},De.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},De.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},De.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},De.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||$n(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},De.prototype.writeFloatLE=function(e,t,r){return Oj(this,e,t,!0,r)},De.prototype.writeFloatBE=function(e,t,r){return Oj(this,e,t,!1,r)},De.prototype.writeDoubleLE=function(e,t,r){return Ij(this,e,t,!0,r)},De.prototype.writeDoubleBE=function(e,t,r){return Ij(this,e,t,!1,r)},De.prototype.copy=function(e,t,r,n){if(!De.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||n===0||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a=n-r;if(this===e&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=a-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return a},De.prototype.fill=function(e,t,r,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,r=this.length):typeof r=="string"&&(n=r,r=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!De.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){var a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e&=255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var s;if(t>>>=0,r=r===void 0?this.length:r>>>0,e||(e=0),typeof e=="number")for(s=t;s<r;++s)this[s]=e;else{var i=De.isBuffer(e)?e:De.from(e,n),u=i.length;if(u===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=i[s%u]}return this};kye=/[^+/0-9A-Za-z-_]/g;o(K2,"_2");o(XW,"z2");o(Vw,"D2");o(Sa,"F2");o(iR,"N2");Bye=function(){for(var e=new Array(256),t=0;t<16;++t)for(var r=16*t,n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n];return e}();Ra.Buffer;Ra.INSPECT_MAX_BYTES;Ra.kMaxLength;Nw={},Dw=Ra,bo=Dw.Buffer;o(Pj,"t3");o(Yl,"f3");bo.from&&bo.alloc&&bo.allocUnsafe&&bo.allocUnsafeSlow?Nw=Dw:(Pj(Dw,Nw),Nw.Buffer=Yl),Yl.prototype=Object.create(bo.prototype),Pj(bo,Yl),Yl.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return bo(e,t,r)},Yl.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=bo(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n},Yl.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return bo(e)},Yl.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Dw.SlowBuffer(e)};Cye=Nw,Y2={},Z2=Cye.Buffer,Fj=Z2.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};o($d,"a3");o(m2,"r3");o(Lye,"n$12");o(Nye,"h3");o(Dye,"l3");o($ye,"u$12");o(Uye,"o$12");o(Mye,"f$12");o(jye,"c3");Y2.StringDecoder=$d,$d.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if((t=this.fillLast(e))===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},$d.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t},$d.prototype.text=function(e,t){var r=function(a,s,i){var u=s.length-1;if(u<i)return 0;var h=m2(s[u]);return h>=0?(h>0&&(a.lastNeed=h-1),h):--u<i||h===-2?0:(h=m2(s[u]))>=0?(h>0&&(a.lastNeed=h-2),h):--u<i||h===-2?0:(h=m2(s[u]))>=0?(h>0&&(h===2?h=0:a.lastNeed=h-3),h):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},$d.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};Ud={},kj=!1;o(Wye,"dew$2$1");Iw={},Bj=!1;o(qye,"dew$1$1");Zl={},Cj=!1;o(Hye,"dew$g");Ls=Hye();Ls.Buffer;Ls.INSPECT_MAX_BYTES;Ls.kMaxLength;Pw={},Lj=!1;o(rf,"dew$f");g2={},Nj=!1;o(JW,"dew$e");w2={},Dj=!1;o(zye,"dew$d");v2={},$j=!1;o(QW,"dew$c");b2={},Uj=!1;o(wc,"dew$b");_2={},Mj=!1;o(e6,"dew$a");E2={},jj=!1,S2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(Vye,"dew$9");A2={},Wj=!1,Gye=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(t6,"dew$8");R2={},qj=!1;o(mc,"dew$7");T2={},Hj=!1;o(oR,"dew$6");x2={},zj=!1;o(Kye,"dew$5");O2={},Vj=!1;o(Yye,"dew$4");I2={},Gj=!1,Zye=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(r6,"dew$3");P2={},Kj=!1;o(n6,"dew$2");F2={},Yj=!1;o(Xye,"dew$1");k2={},Zj=!1;o(Jye,"dew2");Un={},Xj=!1;o(i6,"dew3");B2={},Jj=!1;o(Qye,"dew$12");Qj=Qye(),pc=2147483647,eme=/^xn--/,tme=/[^\0-\x7E]/,rme=/[\x2E\u3002\uFF0E\uFF61]/g,nme={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},So=Math.floor,C2=String.fromCharCode;o(Jl,"i$13");o(eW,"f$13");o(o6,"l$13");tW=o(function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},"u$13"),a6=o(function(e,t,r){let n=0;for(e=r?So(e/700):e>>1,e+=So(e/t);e>455;n+=36)e=So(e/35);return So(n+36*e/(e+38))},"a$12"),rW=o(function(e){let t=[],r=e.length,n=0,a=128,s=72,i=e.lastIndexOf("-");i<0&&(i=0);for(let h=0;h<i;++h)e.charCodeAt(h)>=128&&Jl("not-basic"),t.push(e.charCodeAt(h));for(let h=i>0?i+1:0;h<r;){let c=n;for(let y=1,m=36;;m+=36){h>=r&&Jl("invalid-input");let g=(u=e.charCodeAt(h++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:36;(g>=36||g>So((pc-n)/y))&&Jl("overflow"),n+=g*y;let v=m<=s?1:m>=s+26?26:m-s;if(g<v)break;let _=36-v;y>So(pc/_)&&Jl("overflow"),y*=_}let d=t.length+1;s=a6(n-c,d,c==0),So(n/d)>pc-a&&Jl("overflow"),a+=So(n/d),n%=d,t.splice(n++,0,a)}var u;return String.fromCodePoint(...t)},"d3"),nW=o(function(e){let t=[],r=(e=o6(e)).length,n=128,a=0,s=72;for(let h of e)h<128&&t.push(C2(h));let i=t.length,u=i;for(i&&t.push("-");u<r;){let h=pc;for(let d of e)d>=n&&d<h&&(h=d);let c=u+1;h-n>So((pc-a)/c)&&Jl("overflow"),a+=(h-n)*c,n=h;for(let d of e)if(d<n&&++a>pc&&Jl("overflow"),d==n){let y=a;for(let m=36;;m+=36){let g=m<=s?1:m>=s+26?26:m-s;if(y<g)break;let v=y-g,_=36-g;t.push(C2(tW(g+v%_,0))),y=So(v/_)}t.push(C2(tW(y,0))),s=a6(a,c,u==i),a=0,++u}++a,++n}return t.join("")},"h$12"),ime={version:"2.1.0",ucs2:{decode:o6,encode:o(e=>String.fromCodePoint(...e),"encode")},decode:rW,encode:nW,toASCII:o(function(e){return eW(e,function(t){return tme.test(t)?"xn--"+nW(t):t})},"toASCII"),toUnicode:o(function(e){return eW(e,function(t){return eme.test(t)?rW(t.slice(4).toLowerCase()):t})},"toUnicode")};o(ome,"e$13");ame=o(function(e,t,r,n){t=t||"&",r=r||"=";var a={};if(typeof e!="string"||e.length===0)return a;var s=/\+/g;e=e.split(t);var i=1e3;n&&typeof n.maxKeys=="number"&&(i=n.maxKeys);var u=e.length;i>0&&u>i&&(u=i);for(var h=0;h<u;++h){var c,d,y,m,g=e[h].replace(s,"%20"),v=g.indexOf(r);v>=0?(c=g.substr(0,v),d=g.substr(v+1)):(c=g,d=""),y=decodeURIComponent(c),m=decodeURIComponent(d),ome(a,y)?Array.isArray(a[y])?a[y].push(m):a[y]=[a[y],m]:a[y]=m}return a},"n$13"),Md=o(function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},"r$12"),sme=o(function(e,t,r,n){return t=t||"&",r=r||"=",e===null&&(e=void 0),typeof e=="object"?Object.keys(e).map(function(a){var s=encodeURIComponent(Md(a))+r;return Array.isArray(e[a])?e[a].map(function(i){return s+encodeURIComponent(Md(i))}).join(t):s+encodeURIComponent(Md(e[a]))}).join(t):n?encodeURIComponent(Md(n))+r+encodeURIComponent(Md(e)):""},"t4"),Aa={};Aa.decode=Aa.parse=ame,Aa.encode=Aa.stringify=sme;Aa.decode;Aa.encode;Aa.parse;Aa.stringify;kt={},lme=ime,_o={isString:o(function(e){return typeof e=="string"},"isString"),isObject:o(function(e){return typeof e=="object"&&e!==null},"isObject"),isNull:o(function(e){return e===null},"isNull"),isNullOrUndefined:o(function(e){return e==null},"isNullOrUndefined")};o(Oi,"r4");kt.parse=jd,kt.resolve=function(e,t){return jd(e,!1,!0).resolve(t)},kt.resolveObject=function(e,t){return e?jd(e,!1,!0).resolveObject(t):t},kt.format=function(e){return _o.isString(e)&&(e=jd(e)),e instanceof Oi?e.format():Oi.prototype.format.call(e)},kt.Url=Oi;fme=/^([a-z0-9.+-]+:)/i,ume=/:[0-9]*$/,cme=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,hme=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
141
141
  `," "]),X2=["'"].concat(hme),iW=["%","/","?",";","#"].concat(X2),oW=["/","?","#"],aW=/^[+a-z0-9A-Z_-]{0,63}$/,dme=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pme={javascript:!0,"javascript:":!0},L2={javascript:!0,"javascript:":!0},uc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},N2=Aa;o(jd,"O3");Oi.prototype.parse=function(e,t,r){if(!_o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),a=n!==-1&&n<e.indexOf("#")?"?":"#",s=e.split(a);s[0]=s[0].replace(/\\/g,"/");var i=e=s.join(a);if(i=i.trim(),!r&&e.split("#").length===1){var u=cme.exec(i);if(u)return this.path=i,this.href=i,this.pathname=u[1],u[2]?(this.search=u[2],this.query=t?N2.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=fme.exec(i);if(h){var c=(h=h[0]).toLowerCase();this.protocol=c,i=i.substr(h.length)}if(r||h||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var d=i.substr(0,2)==="//";!d||h&&L2[h]||(i=i.substr(2),this.slashes=!0)}if(!L2[h]&&(d||h&&!uc[h])){for(var y,m,g=-1,v=0;v<oW.length;v++)(_=i.indexOf(oW[v]))!==-1&&(g===-1||_<g)&&(g=_);for((m=g===-1?i.lastIndexOf("@"):i.lastIndexOf("@",g))!==-1&&(y=i.slice(0,m),i=i.slice(m+1),this.auth=decodeURIComponent(y)),g=-1,v=0;v<iW.length;v++){var _;(_=i.indexOf(iW[v]))!==-1&&(g===-1||_<g)&&(g=_)}g===-1&&(g=i.length),this.host=i.slice(0,g),i=i.slice(g),this.parseHost(),this.hostname=this.hostname||"";var b=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!b)for(var E=this.hostname.split(/\./),S=(v=0,E.length);v<S;v++){var T=E[v];if(T&&!T.match(aW)){for(var x="",A=0,B=T.length;A<B;A++)T.charCodeAt(A)>127?x+="x":x+=T[A];if(!x.match(aW)){var P=E.slice(0,v),N=E.slice(v+1),L=T.match(dme);L&&(P.push(L[1]),N.unshift(L[2])),N.length&&(i="/"+N.join(".")+i),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),b||(this.hostname=lme.toASCII(this.hostname));var C=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+C,this.href+=this.host,b&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!pme[c])for(v=0,S=X2.length;v<S;v++){var V=X2[v];if(i.indexOf(V)!==-1){var Q=encodeURIComponent(V);Q===V&&(Q=escape(V)),i=i.split(V).join(Q)}}var X=i.indexOf("#");X!==-1&&(this.hash=i.substr(X),i=i.slice(0,X));var ue=i.indexOf("?");if(ue!==-1?(this.search=i.substr(ue),this.query=i.substr(ue+1),t&&(this.query=N2.parse(this.query)),i=i.slice(0,ue)):t&&(this.search="",this.query={}),i&&(this.pathname=i),uc[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){C=this.pathname||"";var ge=this.search||"";this.path=C+ge}return this.href=this.format(),this},Oi.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",a=!1,s="";this.host?a=e+this.host:this.hostname&&(a=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&_o.isObject(this.query)&&Object.keys(this.query).length&&(s=N2.stringify(this.query));var i=this.search||s&&"?"+s||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||uc[t])&&a!==!1?(a="//"+(a||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):a||(a=""),n&&n.charAt(0)!=="#"&&(n="#"+n),i&&i.charAt(0)!=="?"&&(i="?"+i),t+a+(r=r.replace(/[?#]/g,function(u){return encodeURIComponent(u)}))+(i=i.replace("#","%23"))+n},Oi.prototype.resolve=function(e){return this.resolveObject(jd(e,!1,!0)).format()},Oi.prototype.resolveObject=function(e){if(_o.isString(e)){var t=new Oi;t.parse(e,!1,!0),e=t}for(var r=new Oi,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,e.href==="")return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var i=Object.keys(e),u=0;u<i.length;u++){var h=i[u];h!=="protocol"&&(r[h]=e[h])}return uc[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!uc[e.protocol]){for(var c=Object.keys(e),d=0;d<c.length;d++){var y=c[d];r[y]=e[y]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||L2[e.protocol])r.pathname=e.pathname;else{for(var m=(e.pathname||"").split("/");m.length&&!(e.host=m.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),m[0]!==""&&m.unshift(""),m.length<2&&m.unshift(""),r.pathname=m.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",v=r.search||"";r.path=g+v}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var _=r.pathname&&r.pathname.charAt(0)==="/",b=e.host||e.pathname&&e.pathname.charAt(0)==="/",E=b||_||r.host&&e.pathname,S=E,T=r.pathname&&r.pathname.split("/")||[],x=(m=e.pathname&&e.pathname.split("/")||[],r.protocol&&!uc[r.protocol]);if(x&&(r.hostname="",r.port=null,r.host&&(T[0]===""?T[0]=r.host:T.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(m[0]===""?m[0]=e.host:m.unshift(e.host)),e.host=null),E=E&&(m[0]===""||T[0]==="")),b)r.host=e.host||e.host===""?e.host:r.host,r.hostname=e.hostname||e.hostname===""?e.hostname:r.hostname,r.search=e.search,r.query=e.query,T=m;else if(m.length)T||(T=[]),T.pop(),T=T.concat(m),r.search=e.search,r.query=e.query;else if(!_o.isNullOrUndefined(e.search))return x&&(r.hostname=r.host=T.shift(),(L=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=L.shift(),r.host=r.hostname=L.shift())),r.search=e.search,r.query=e.query,_o.isNull(r.pathname)&&_o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=T.slice(-1)[0],B=(r.host||e.host||T.length>1)&&(A==="."||A==="..")||A==="",P=0,N=T.length;N>=0;N--)(A=T[N])==="."?T.splice(N,1):A===".."?(T.splice(N,1),P++):P&&(T.splice(N,1),P--);if(!E&&!S)for(;P--;P)T.unshift("..");!E||T[0]===""||T[0]&&T[0].charAt(0)==="/"||T.unshift(""),B&&T.join("/").substr(-1)!=="/"&&T.push("");var L,C=T[0]===""||T[0]&&T[0].charAt(0)==="/";return x&&(r.hostname=r.host=C?"":T.length?T.shift():"",(L=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=L.shift(),r.host=r.hostname=L.shift())),(E=E||r.host&&T.length)&&!C&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),_o.isNull(r.pathname)&&_o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},Oi.prototype.parseHost=function(){var e=this.host,t=ume.exec(e);t&&((t=t[0])!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};kt.Url;kt.format;kt.resolve;kt.resolveObject;D2={},sW=!1;o(yme,"dew4");lW=yme(),mme=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;kt.URL=typeof URL<"u"?URL:null;kt.pathToFileURL=Pme;kt.fileURLToPath=xme;kt.Url;kt.format;kt.resolve;kt.resolveObject;kt.URL;gme=92,wme=47,vme=97,bme=122,J2=mme==="win32",_me=/\//g,Eme=/%/g,Sme=/\\/g,Ame=/\n/g,Rme=/\r/g,Tme=/\t/g;o(xme,"fileURLToPath$1");o(Ome,"getPathFromURLWin$1");o(Ime,"getPathFromURLPosix$1");o(Pme,"pathToFileURL$1");Fme=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;kt.URL=typeof URL<"u"?URL:null;kt.pathToFileURL=zme;kt.fileURLToPath=Wme;kt.Url;kt.format;kt.resolve;kt.resolveObject;kt.parse;kt.URL;kme=92,Bme=47,Cme=97,Lme=122,Q2=Fme==="win32",Nme=/\//g,Dme=/%/g,$me=/\\/g,Ume=/\n/g,Mme=/\r/g,jme=/\t/g;o(Wme,"fileURLToPath");o(qme,"getPathFromURLWin");o(Hme,"getPathFromURLPosix");o(zme,"pathToFileURL");ii={},fW=!1,Xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(s6,"dew$52");Fw={},uW=!1,kw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(l6,"dew$42");$2={},cW=!1,Wr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(Vme,"dew$32");U2={},hW=!1;o(Gme,"dew$22");M2={},dW=!1;o(Kme,"dew$13");j2={},pW=!1,Yme=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(Zme,"dew$62");Ta=Zme();Ta.Agent;Ta.ClientRequest;Ta.IncomingMessage;Ta.METHODS;Ta.STATUS_CODES;Ta.get;Ta.globalAgent;Ta.request;W2={},yW=!1,mW=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;o(Xme,"dew5");Ns=Xme(),Jme=Ns.Agent,Qme=Ns.ClientRequest,ege=Ns.IncomingMessage,tge=Ns.METHODS,rge=Ns.STATUS_CODES,nge=Ns.get,ige=Ns.globalAgent,oge=Ns.request;});var u6={};Kn(u6,{Agent:()=>Jme,ClientRequest:()=>Qme,IncomingMessage:()=>ege,METHODS:()=>tge,STATUS_CODES:()=>rge,get:()=>nge,globalAgent:()=>ige,request:()=>oge});var c6=Qt(()=>{f6()});var p6=Oe((RNe,d6)=>{d6.exports=h6;function h6(e,t){if(e&&t)return h6(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),a=0;a<n.length;a++)n[a]=arguments[a];var s=e.apply(this,n),i=n[n.length-1];return typeof s=="function"&&s!==i&&Object.keys(i).forEach(function(u){s[u]=i[u]}),s}o(r,"wrapper")}o(h6,"wrappy")});var g6=Oe((xNe,aR)=>{var y6=p6();aR.exports=y6(Gw);aR.exports.strict=y6(m6);Gw.proto=Gw(function(){Object.defineProperty(Function.prototype,"once",{value:o(function(){return Gw(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:o(function(){return m6(this)},"value"),configurable:!0})});function Gw(e){var t=o(function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))},"f");return t.called=!1,t}o(Gw,"once");function m6(e){var t=o(function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},"f"),r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}o(m6,"onceStrict")});function age(){if(w6)return sR;w6=!0;function e(t,r){return Object.prototype.hasOwnProperty.call(t,r)}return o(e,"hasOwnProperty"),sR=o(function(t,r,n,a){r=r||"&",n=n||"=";var s={};if(typeof t!="string"||t.length===0)return s;var i=/\+/g;t=t.split(r);var u=1e3;a&&typeof a.maxKeys=="number"&&(u=a.maxKeys);var h=t.length;u>0&&h>u&&(h=u);for(var c=0;c<h;++c){var d=t[c].replace(i,"%20"),y=d.indexOf(n),m,g,v,_;y>=0?(m=d.substr(0,y),g=d.substr(y+1)):(m=d,g=""),v=decodeURIComponent(m),_=decodeURIComponent(g),e(s,v)?Array.isArray(s[v])?s[v].push(_):s[v]=[s[v],_]:s[v]=_}return s},"exports$3"),sR}function sge(){if(v6)return lR;v6=!0;var e=o(function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},"stringifyPrimitive");return lR=o(function(t,r,n,a){return r=r||"&",n=n||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(s){var i=encodeURIComponent(e(s))+n;return Array.isArray(t[s])?t[s].map(function(u){return i+encodeURIComponent(e(u))}).join(r):i+encodeURIComponent(e(t[s]))}).filter(Boolean).join(r):a?encodeURIComponent(e(a))+n+encodeURIComponent(e(t)):""},"exports$2"),lR}function lge(){return b6||(b6=!0,vc.decode=vc.parse=age(),vc.encode=vc.stringify=sge()),vc}var sR,w6,lR,v6,vc,b6,Ds,fge,uge,cge,hge,_6=Qt(()=>{sR={},w6=!1;o(age,"dew$2");lR={},v6=!1;o(sge,"dew$1");vc={},b6=!1;o(lge,"dew");Ds=lge();Ds.decode;Ds.parse;Ds.encode;Ds.stringify;fge=Ds.decode,uge=Ds.encode,cge=Ds.parse,hge=Ds.stringify});var E6={};Kn(E6,{decode:()=>fge,encode:()=>uge,parse:()=>cge,stringify:()=>hge});var S6=Qt(()=>{_6()});var x6=Oe((kNe,T6)=>{T6.exports=bc;var dge=nM(),A6=iM(),pge=(ej(),Kt(Q4)),yge=(c6(),Kt(u6)),mge=g6(),gge=(S6(),Kt(E6)),R6=(S_(),Kt(E_)),fR=o(e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function","isStream");function bc(e,t){if(e=Object.assign({maxRedirects:10},typeof e=="string"?{url:e}:e),t=mge(t),e.url){let{hostname:u,port:h,protocol:c,auth:d,path:y}=R6.parse(e.url);delete e.url,!u&&!h&&!c&&!d?e.path=y:Object.assign(e,{hostname:u,port:h,protocol:c,auth:d,path:y})}let r={"accept-encoding":"gzip, deflate"};e.headers&&Object.keys(e.headers).forEach(u=>r[u.toLowerCase()]=e.headers[u]),e.headers=r;let n;e.body?n=e.json&&!fR(e.body)?JSON.stringify(e.body):e.body:e.form&&(n=typeof e.form=="string"?e.form:gge.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),n&&(e.method||(e.method="POST"),fR(n)||(e.headers["content-length"]=Buffer.byteLength(n)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());let a=e.hostname,i=(e.protocol==="https:"?yge:pge).request(e,u=>{if(e.followRedirects!==!1&&u.statusCode>=300&&u.statusCode<400&&u.headers.location){e.url=u.headers.location,delete e.headers.host,u.resume();let c=R6.parse(e.url).hostname;return c!==null&&c!==a&&(delete e.headers.cookie,delete e.headers.authorization),e.method==="POST"&&[301,302].includes(u.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),e.maxRedirects--===0?t(new Error("too many redirects")):bc(e,t)}let h=typeof A6=="function"&&e.method!=="HEAD";t(null,h?A6(u):u)});return i.on("timeout",()=>{i.abort(),t(new Error("Request timed out"))}),i.on("error",t),fR(n)?n.on("error",t).pipe(i):i.end(n),i}o(bc,"simpleGet");bc.concat=(e,t)=>bc(e,(r,n)=>{if(r)return t(r);dge(n,(a,s)=>{if(a)return t(a);if(e.json)try{s=JSON.parse(s.toString())}catch(i){return t(i,n,s)}t(null,n,s)})});["get","post","put","patch","head","delete"].forEach(e=>{bc[e]=(t,r)=>(typeof t=="string"&&(t={url:t}),bc(Object.assign({method:e.toUpperCase()},t),r))})});var Zt=Oe((CNe,O6)=>{"use strict";var cR=class cR extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let n=0;n<t.length;n++)r+=` ${t[n].stack}
142
- `;super(r),this.name="AggregateError",this.errors=t}};o(cR,"AggregateError");var uR=cR;O6.exports={AggregateError:uR,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var hR=Oe((NNe,I6)=>{"use strict";I6.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){let a=t.shift();return n==="f"?a.toFixed(6):n==="j"?JSON.stringify(a):n==="s"&&typeof a=="object"?`${a.constructor!==Object?a.constructor.name:""} {}`.trim():a.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var un=Oe((DNe,k6)=>{"use strict";var{format:wge,inspect:Kw}=hR(),{AggregateError:vge}=Zt(),bge=globalThis.AggregateError||vge,_ge=Symbol("kIsNodeError"),Ege=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Sge=/^([A-Z][a-z0-9]*)+$/,Age="__node_internal_",Yw={};function nf(e,t){if(!e)throw new Yw.ERR_INTERNAL_ASSERTION(t)}o(nf,"assert");function P6(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}o(P6,"addNumericalSeparator");function Rge(e,t,r){if(typeof t=="function")return nf(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let n=(t.match(/%[dfijoOs]/g)||[]).length;return nf(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:wge(t,...r)}o(Rge,"getMessage");function Zr(e,t,r){r||(r=Error);let a=class a extends r{constructor(...i){super(Rge(e,t,i))}toString(){return`${this.name} [${e}]: ${this.message}`}};o(a,"NodeError");let n=a;Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[_ge]=!0,Yw[e]=n}o(Zr,"E");function F6(e){let t=Age+e.name;return Object.defineProperty(e,"name",{value:t}),e}o(F6,"hideStackFrames");function Tge(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new bge([t,e],t.message);return r.code=t.code,r}return e||t}o(Tge,"aggregateTwoErrors");var pR=class pR extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Yw.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};o(pR,"AbortError");var dR=pR;Zr("ERR_ASSERTION","%s",Error);Zr("ERR_INVALID_ARG_TYPE",(e,t,r)=>{nf(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let a=[],s=[],i=[];for(let h of t)nf(typeof h=="string","All expected entries have to be of type string"),Ege.includes(h)?a.push(h.toLowerCase()):Sge.test(h)?s.push(h):(nf(h!=="object",'The value "object" should be written as "Object"'),i.push(h));if(s.length>0){let h=a.indexOf("object");h!==-1&&(a.splice(a,h,1),s.push("Object"))}if(a.length>0){switch(a.length){case 1:n+=`of type ${a[0]}`;break;case 2:n+=`one of type ${a[0]} or ${a[1]}`;break;default:{let h=a.pop();n+=`one of type ${a.join(", ")}, or ${h}`}}(s.length>0||i.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let h=s.pop();n+=`an instance of ${s.join(", ")}, or ${h}`}}i.length>0&&(n+=" or ")}switch(i.length){case 0:break;case 1:i[0].toLowerCase()!==i[0]&&(n+="an "),n+=`${i[0]}`;break;case 2:n+=`one of ${i[0]} or ${i[1]}`;break;default:{let h=i.pop();n+=`one of ${i.join(", ")}, or ${h}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var u;if((u=r.constructor)!==null&&u!==void 0&&u.name)n+=`. Received an instance of ${r.constructor.name}`;else{let h=Kw(r,{depth:-1});n+=`. Received ${h}`}}else{let h=Kw(r,{colors:!1});h.length>25&&(h=`${h.slice(0,25)}...`),n+=`. Received type ${typeof r} (${h})`}return n},TypeError);Zr("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=Kw(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);Zr("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;let a=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${a}.`},TypeError);Zr("ERR_MISSING_ARGS",(...e)=>{nf(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);Zr("ERR_OUT_OF_RANGE",(e,t,r)=>{nf(t,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=P6(String(r));else if(typeof r=="bigint"){n=String(r);let a=BigInt(2)**BigInt(32);(r>a||r<-a)&&(n=P6(n)),n+="n"}else n=Kw(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);Zr("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Zr("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Zr("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Zr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Zr("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Zr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Zr("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Zr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Zr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Zr("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Zr("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);k6.exports={AbortError:dR,aggregateTwoErrors:F6(Tge),hideStackFrames:F6,codes:Yw}});var _c=Oe((UNe,Zw)=>{"use strict";var{AbortController:B6,AbortSignal:xge}=typeof self<"u"?self:typeof window<"u"?window:void 0;Zw.exports=B6;Zw.exports.AbortSignal=xge;Zw.exports.default=B6});function Oge(){if(C6)return Xw;C6=!0;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:o(function(A,B,P){return Function.prototype.apply.call(A,B,P)},"ReflectApply2"),r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=o(function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))},"ReflectOwnKeys2"):r=o(function(A){return Object.getOwnPropertyNames(A)},"ReflectOwnKeys2");function n(x){console&&console.warn&&console.warn(x)}o(n,"ProcessEmitWarning");var a=Number.isNaN||o(function(A){return A!==A},"NumberIsNaN2");function s(){s.init.call(this)}o(s,"EventEmitter2"),Xw=s,Xw.once=E,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var i=10;function u(x){if(typeof x!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof x)}o(u,"checkListener"),Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:o(function(){return i},"get"),set:o(function(x){if(typeof x!="number"||x<0||a(x))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+x+".");i=x},"set")}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=o(function(A){if(typeof A!="number"||A<0||a(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this},"setMaxListeners");function h(x){return x._maxListeners===void 0?s.defaultMaxListeners:x._maxListeners}o(h,"_getMaxListeners"),s.prototype.getMaxListeners=o(function(){return h(this)},"getMaxListeners"),s.prototype.emit=o(function(A){for(var B=[],P=1;P<arguments.length;P++)B.push(arguments[P]);var N=A==="error",L=this._events;if(L!==void 0)N=N&&L.error===void 0;else if(!N)return!1;if(N){var C;if(B.length>0&&(C=B[0]),C instanceof Error)throw C;var z=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw z.context=C,z}var V=L[A];if(V===void 0)return!1;if(typeof V=="function")t(V,this,B);else for(var Q=V.length,X=v(V,Q),P=0;P<Q;++P)t(X[P],this,B);return!0},"emit");function c(x,A,B,P){var N,L,C;if(u(B),L=x._events,L===void 0?(L=x._events=Object.create(null),x._eventsCount=0):(L.newListener!==void 0&&(x.emit("newListener",A,B.listener?B.listener:B),L=x._events),C=L[A]),C===void 0)C=L[A]=B,++x._eventsCount;else if(typeof C=="function"?C=L[A]=P?[B,C]:[C,B]:P?C.unshift(B):C.push(B),N=h(x),N>0&&C.length>N&&!C.warned){C.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=x,z.type=A,z.count=C.length,n(z)}return x}o(c,"_addListener"),s.prototype.addListener=o(function(A,B){return c(this,A,B,!1)},"addListener"),s.prototype.on=s.prototype.addListener,s.prototype.prependListener=o(function(A,B){return c(this,A,B,!0)},"prependListener");function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}o(d,"onceWrapper");function y(x,A,B){var P={fired:!1,wrapFn:void 0,target:x,type:A,listener:B},N=d.bind(P);return N.listener=B,P.wrapFn=N,N}o(y,"_onceWrap"),s.prototype.once=o(function(A,B){return u(B),this.on(A,y(this,A,B)),this},"once3"),s.prototype.prependOnceListener=o(function(A,B){return u(B),this.prependListener(A,y(this,A,B)),this},"prependOnceListener"),s.prototype.removeListener=o(function(A,B){var P,N,L,C,z;if(u(B),N=this._events,N===void 0)return this;if(P=N[A],P===void 0)return this;if(P===B||P.listener===B)--this._eventsCount===0?this._events=Object.create(null):(delete N[A],N.removeListener&&this.emit("removeListener",A,P.listener||B));else if(typeof P!="function"){for(L=-1,C=P.length-1;C>=0;C--)if(P[C]===B||P[C].listener===B){z=P[C].listener,L=C;break}if(L<0)return this;L===0?P.shift():_(P,L),P.length===1&&(N[A]=P[0]),N.removeListener!==void 0&&this.emit("removeListener",A,z||B)}return this},"removeListener"),s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=o(function(A){var B,P,N;if(P=this._events,P===void 0)return this;if(P.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):P[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete P[A]),this;if(arguments.length===0){var L=Object.keys(P),C;for(N=0;N<L.length;++N)C=L[N],C!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(B=P[A],typeof B=="function")this.removeListener(A,B);else if(B!==void 0)for(N=B.length-1;N>=0;N--)this.removeListener(A,B[N]);return this},"removeAllListeners");function m(x,A,B){var P=x._events;if(P===void 0)return[];var N=P[A];return N===void 0?[]:typeof N=="function"?B?[N.listener||N]:[N]:B?b(N):v(N,N.length)}o(m,"_listeners"),s.prototype.listeners=o(function(A){return m(this,A,!0)},"listeners"),s.prototype.rawListeners=o(function(A){return m(this,A,!1)},"rawListeners"),s.listenerCount=function(x,A){return typeof x.listenerCount=="function"?x.listenerCount(A):g.call(x,A)},s.prototype.listenerCount=g;function g(x){var A=this._events;if(A!==void 0){var B=A[x];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}o(g,"listenerCount2"),s.prototype.eventNames=o(function(){return this._eventsCount>0?r(this._events):[]},"eventNames");function v(x,A){for(var B=new Array(A),P=0;P<A;++P)B[P]=x[P];return B}o(v,"arrayClone");function _(x,A){for(;A+1<x.length;A++)x[A]=x[A+1];x.pop()}o(_,"spliceOne");function b(x){for(var A=new Array(x.length),B=0;B<A.length;++B)A[B]=x[B].listener||x[B];return A}o(b,"unwrapListeners");function E(x,A){return new Promise(function(B,P){function N(C){x.removeListener(A,L),P(C)}o(N,"errorListener");function L(){typeof x.removeListener=="function"&&x.removeListener("error",N),B([].slice.call(arguments))}o(L,"resolver"),T(x,A,L,{once:!0}),A!=="error"&&S(x,N,{once:!0})})}o(E,"once2");function S(x,A,B){typeof x.on=="function"&&T(x,"error",A,B)}o(S,"addErrorHandlerIfEventEmitter");function T(x,A,B,P){if(typeof x.on=="function")P.once?x.once(A,B):x.on(A,B);else if(typeof x.addEventListener=="function")x.addEventListener(A,o(function N(L){P.once&&x.removeEventListener(A,N),B(L)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof x)}return o(T,"eventTargetAgnosticAddListener"),Xw}var Xw,C6,Jw,Ige,Pge,Fge,kge,Bge,Cge,L6=Qt(()=>{Xw={},C6=!1;o(Oge,"dew");Jw=Oge();Jw.once;Jw.once=function(e,t){return new Promise((r,n)=>{function a(...i){s!==void 0&&e.removeListener("error",s),r(i)}o(a,"eventListener");let s;t!=="error"&&(s=o(i=>{e.removeListener(name,a),n(i)},"errorListener"),e.once("error",s)),e.once(t,a)})};Jw.on=function(e,t){let r=[],n=[],a=null,s=!1,i={async next(){let c=r.shift();if(c)return createIterResult(c,!1);if(a){let d=Promise.reject(a);return a=null,d}return s?createIterResult(void 0,!0):new Promise((d,y)=>n.push({resolve:d,reject:y}))},async return(){e.removeListener(t,u),e.removeListener("error",h),s=!0;for(let c of n)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){a=c,e.removeListener(t,u),e.removeListener("error",h)},[Symbol.asyncIterator](){return this}};return e.on(t,u),e.on("error",h),i;function u(...c){let d=n.shift();d?d.resolve(createIterResult(c,!1)):r.push(c)}o(u,"eventHandler");function h(c){s=!0;let d=n.shift();d?d.reject(c):a=c,i.return()}o(h,"errorHandler")};({EventEmitter:Ige,defaultMaxListeners:Pge,init:Fge,listenerCount:kge,on:Bge,once:Cge}=Jw)});var Vd={};Kn(Vd,{EventEmitter:()=>Ige,defaultMaxListeners:()=>Pge,init:()=>Fge,listenerCount:()=>kge,on:()=>Bge,once:()=>Cge});var Gd=Qt(()=>{L6()});var _n=Oe((qNe,mR)=>{"use strict";var Lge=(na(),Kt(ra)),{format:Nge,inspect:Dge}=hR(),{codes:{ERR_INVALID_ARG_TYPE:yR}}=un(),{kResistStopPropagation:$ge,AggregateError:Uge,SymbolDispose:Mge}=Zt(),jge=globalThis.AbortSignal||_c().AbortSignal,Wge=globalThis.AbortController||_c().AbortController,qge=Object.getPrototypeOf(async function(){}).constructor,N6=globalThis.Blob||Lge.Blob,Hge=o(typeof N6<"u"?function(t){return t instanceof N6}:function(t){return!1},"isBlob"),D6=o((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new yR(t,"AbortSignal",e)},"validateAbortSignal"),zge=o((e,t)=>{if(typeof e!="function")throw new yR(t,"Function",e)},"validateFunction");mR.exports={AggregateError:Uge,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:o(function(){let e,t;return{promise:new Promise((n,a)=>{e=n,t=a}),resolve:e,reject:t}},"createDeferredPromise"),promisify(e){return new Promise((t,r)=>{e((n,...a)=>n?r(n):t(...a))})},debuglog(){return function(){}},format:Nge,inspect:Dge,types:{isAsyncFunction(e){return e instanceof qge},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:Hge,deprecate(e,t){return e},addAbortListener:(Gd(),Kt(Vd)).addAbortListener||o(function(t,r){if(t===void 0)throw new yR("signal","AbortSignal",t);D6(t,"signal"),zge(r,"listener");let n;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[$ge]:!0}),n=o(()=>{t.removeEventListener("abort",r)},"removeEventListener")),{__proto__:null,[Mge](){var a;(a=n)===null||a===void 0||a()}}},"addAbortListener"),AbortSignalAny:jge.any||o(function(t){if(t.length===1)return t[0];let r=new Wge,n=o(()=>r.abort(),"abort");return t.forEach(a=>{D6(a,"signals"),a.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(a=>a.removeEventListener("abort",n))},{once:!0}),r.signal},"AbortSignalAny")};mR.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Sc=Oe((zNe,G6)=>{"use strict";var{ArrayIsArray:wR,ArrayPrototypeIncludes:j6,ArrayPrototypeJoin:W6,ArrayPrototypeMap:Vge,NumberIsInteger:vR,NumberIsNaN:Gge,NumberMAX_SAFE_INTEGER:Kge,NumberMIN_SAFE_INTEGER:Yge,NumberParseInt:Zge,ObjectPrototypeHasOwnProperty:Xge,RegExpPrototypeExec:q6,String:Jge,StringPrototypeToUpperCase:Qge,StringPrototypeTrim:ewe}=Zt(),{hideStackFrames:Pi,codes:{ERR_SOCKET_BAD_PORT:twe,ERR_INVALID_ARG_TYPE:cn,ERR_INVALID_ARG_VALUE:Ec,ERR_OUT_OF_RANGE:of,ERR_UNKNOWN_SIGNAL:$6}}=un(),{normalizeEncoding:rwe}=_n(),{isAsyncFunction:nwe,isArrayBufferView:iwe}=_n().types,U6={};function owe(e){return e===(e|0)}o(owe,"isInt32");function awe(e){return e===e>>>0}o(awe,"isUint32");var swe=/^[0-7]+$/,lwe="must be a 32-bit unsigned integer or an octal string";function fwe(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(q6(swe,e)===null)throw new Ec(t,e,lwe);e=Zge(e,8)}return H6(e,t),e}o(fwe,"parseFileMode");var uwe=Pi((e,t,r=Yge,n=Kge)=>{if(typeof e!="number")throw new cn(t,"number",e);if(!vR(e))throw new of(t,"an integer",e);if(e<r||e>n)throw new of(t,`>= ${r} && <= ${n}`,e)}),cwe=Pi((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new cn(t,"number",e);if(!vR(e))throw new of(t,"an integer",e);if(e<r||e>n)throw new of(t,`>= ${r} && <= ${n}`,e)}),H6=Pi((e,t,r=!1)=>{if(typeof e!="number")throw new cn(t,"number",e);if(!vR(e))throw new of(t,"an integer",e);let n=r?1:0,a=4294967295;if(e<n||e>a)throw new of(t,`>= ${n} && <= ${a}`,e)});function bR(e,t){if(typeof e!="string")throw new cn(t,"string",e)}o(bR,"validateString");function hwe(e,t,r=void 0,n){if(typeof e!="number")throw new cn(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&Gge(e))throw new of(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}o(hwe,"validateNumber");var dwe=Pi((e,t,r)=>{if(!j6(r,e)){let a="must be one of: "+W6(Vge(r,s=>typeof s=="string"?`'${s}'`:Jge(s)),", ");throw new Ec(t,e,a)}});function z6(e,t){if(typeof e!="boolean")throw new cn(t,"boolean",e)}o(z6,"validateBoolean");function gR(e,t,r){return e==null||!Xge(e,t)?r:e[t]}o(gR,"getOwnPropertyValueOrDefault");var pwe=Pi((e,t,r=null)=>{let n=gR(r,"allowArray",!1),a=gR(r,"allowFunction",!1);if(!gR(r,"nullable",!1)&&e===null||!n&&wR(e)||typeof e!="object"&&(!a||typeof e!="function"))throw new cn(t,"Object",e)}),ywe=Pi((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new cn(t,"a dictionary",e)}),Qw=Pi((e,t,r=0)=>{if(!wR(e))throw new cn(t,"Array",e);if(e.length<r){let n=`must be longer than ${r}`;throw new Ec(t,e,n)}});function mwe(e,t){Qw(e,t);for(let r=0;r<e.length;r++)bR(e[r],`${t}[${r}]`)}o(mwe,"validateStringArray");function gwe(e,t){Qw(e,t);for(let r=0;r<e.length;r++)z6(e[r],`${t}[${r}]`)}o(gwe,"validateBooleanArray");function wwe(e,t){Qw(e,t);for(let r=0;r<e.length;r++){let n=e[r],a=`${t}[${r}]`;if(n==null)throw new cn(a,"AbortSignal",n);V6(n,a)}}o(wwe,"validateAbortSignalArray");function vwe(e,t="signal"){if(bR(e,t),U6[e]===void 0)throw U6[Qge(e)]!==void 0?new $6(e+" (signals must use all capital letters)"):new $6(e)}o(vwe,"validateSignalName");var bwe=Pi((e,t="buffer")=>{if(!iwe(e))throw new cn(t,["Buffer","TypedArray","DataView"],e)});function _we(e,t){let r=rwe(t),n=e.length;if(r==="hex"&&n%2!==0)throw new Ec("encoding",t,`is invalid for data of length ${n}`)}o(_we,"validateEncoding");function Ewe(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&ewe(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new twe(t,e,r);return e|0}o(Ewe,"validatePort");var V6=Pi((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new cn(t,"AbortSignal",e)}),Swe=Pi((e,t)=>{if(typeof e!="function")throw new cn(t,"Function",e)}),Awe=Pi((e,t)=>{if(typeof e!="function"||nwe(e))throw new cn(t,"Function",e)}),Rwe=Pi((e,t)=>{if(e!==void 0)throw new cn(t,"undefined",e)});function Twe(e,t,r){if(!j6(r,e))throw new cn(t,`('${W6(r,"|")}')`,e)}o(Twe,"validateUnion");var xwe=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function M6(e,t){if(typeof e>"u"||!q6(xwe,e))throw new Ec(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(M6,"validateLinkHeaderFormat");function Owe(e){if(typeof e=="string")return M6(e,"hints"),e;if(wR(e)){let t=e.length,r="";if(t===0)return r;for(let n=0;n<t;n++){let a=e[n];M6(a,"hints"),r+=a,n!==t-1&&(r+=", ")}return r}throw new Ec("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(Owe,"validateLinkHeaderValue");G6.exports={isInt32:owe,isUint32:awe,parseFileMode:fwe,validateArray:Qw,validateStringArray:mwe,validateBooleanArray:gwe,validateAbortSignalArray:wwe,validateBoolean:z6,validateBuffer:bwe,validateDictionary:ywe,validateEncoding:_we,validateFunction:Swe,validateInt32:cwe,validateInteger:uwe,validateNumber:hwe,validateObject:pwe,validateOneOf:dwe,validatePlainFunction:Awe,validatePort:Ewe,validateSignalName:vwe,validateString:bR,validateUint32:H6,validateUndefined:Rwe,validateUnion:Twe,validateAbortSignal:V6,validateLinkHeaderValue:Owe}});var $s=Oe((GNe,X6)=>{var _r=X6.exports={},Ro,To;function _R(){throw new Error("setTimeout has not been defined")}o(_R,"defaultSetTimout");function ER(){throw new Error("clearTimeout has not been defined")}o(ER,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ro=setTimeout:Ro=_R}catch{Ro=_R}try{typeof clearTimeout=="function"?To=clearTimeout:To=ER}catch{To=ER}})();function K6(e){if(Ro===setTimeout)return setTimeout(e,0);if((Ro===_R||!Ro)&&setTimeout)return Ro=setTimeout,setTimeout(e,0);try{return Ro(e,0)}catch{try{return Ro.call(null,e,0)}catch{return Ro.call(this,e,0)}}}o(K6,"runTimeout");function Iwe(e){if(To===clearTimeout)return clearTimeout(e);if((To===ER||!To)&&clearTimeout)return To=clearTimeout,clearTimeout(e);try{return To(e)}catch{try{return To.call(null,e)}catch{return To.call(this,e)}}}o(Iwe,"runClearTimeout");var xa=[],Ac=!1,af,e0=-1;function Pwe(){!Ac||!af||(Ac=!1,af.length?xa=af.concat(xa):e0=-1,xa.length&&Y6())}o(Pwe,"cleanUpNextTick");function Y6(){if(!Ac){var e=K6(Pwe);Ac=!0;for(var t=xa.length;t;){for(af=xa,xa=[];++e0<t;)af&&af[e0].run();e0=-1,t=xa.length}af=null,Ac=!1,Iwe(e)}}o(Y6,"drainQueue");_r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];xa.push(new Z6(e,t)),xa.length===1&&!Ac&&K6(Y6)};function Z6(e,t){this.fun=e,this.array=t}o(Z6,"Item");Z6.prototype.run=function(){this.fun.apply(null,this.array)};_r.title="browser";_r.browser=!0;_r.env={};_r.argv=[];_r.version="";_r.versions={};function Oa(){}o(Oa,"noop");_r.on=Oa;_r.addListener=Oa;_r.once=Oa;_r.off=Oa;_r.removeListener=Oa;_r.removeAllListeners=Oa;_r.emit=Oa;_r.prependListener=Oa;_r.prependOnceListener=Oa;_r.listeners=function(e){return[]};_r.binding=function(e){throw new Error("process.binding is not supported")};_r.cwd=function(){return"/"};_r.chdir=function(e){throw new Error("process.chdir is not supported")};_r.umask=function(){return 0}});var Oo=Oe((YNe,hq)=>{"use strict";var{SymbolAsyncIterator:J6,SymbolIterator:Q6,SymbolFor:sf}=Zt(),eq=sf("nodejs.stream.destroyed"),tq=sf("nodejs.stream.errored"),SR=sf("nodejs.stream.readable"),AR=sf("nodejs.stream.writable"),rq=sf("nodejs.stream.disturbed"),Fwe=sf("nodejs.webstream.isClosedPromise"),kwe=sf("nodejs.webstream.controllerErrorFunction");function t0(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}o(t0,"isReadableNodeStream");function r0(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}o(r0,"isWritableNodeStream");function Bwe(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}o(Bwe,"isDuplexNodeStream");function xo(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}o(xo,"isNodeStream");function nq(e){return!!(e&&!xo(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}o(nq,"isReadableStream");function iq(e){return!!(e&&!xo(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}o(iq,"isWritableStream");function oq(e){return!!(e&&!xo(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}o(oq,"isTransformStream");function Cwe(e){return nq(e)||iq(e)||oq(e)}o(Cwe,"isWebStream");function Lwe(e,t){return e==null?!1:t===!0?typeof e[J6]=="function":t===!1?typeof e[Q6]=="function":typeof e[J6]=="function"||typeof e[Q6]=="function"}o(Lwe,"isIterable");function n0(e){if(!xo(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[eq]||n!=null&&n.destroyed)}o(n0,"isDestroyed");function aq(e){if(!r0(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}o(aq,"isWritableEnded");function Nwe(e,t){if(!r0(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}o(Nwe,"isWritableFinished");function Dwe(e){if(!t0(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}o(Dwe,"isReadableEnded");function sq(e,t){if(!t0(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}o(sq,"isReadableFinished");function lq(e){return e&&e[SR]!=null?e[SR]:typeof e?.readable!="boolean"?null:n0(e)?!1:t0(e)&&e.readable&&!sq(e)}o(lq,"isReadable");function fq(e){return e&&e[AR]!=null?e[AR]:typeof e?.writable!="boolean"?null:n0(e)?!1:r0(e)&&e.writable&&!aq(e)}o(fq,"isWritable");function $we(e,t){return xo(e)?n0(e)?!0:!(t?.readable!==!1&&lq(e)||t?.writable!==!1&&fq(e)):null}o($we,"isFinished");function Uwe(e){var t,r;return xo(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}o(Uwe,"isWritableErrored");function Mwe(e){var t,r;return xo(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}o(Mwe,"isReadableErrored");function jwe(e){if(!xo(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof t?.closed=="boolean"||typeof r?.closed=="boolean"?t?.closed||r?.closed:typeof e._closed=="boolean"&&uq(e)?e._closed:null}o(jwe,"isClosed");function uq(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}o(uq,"isOutgoingMessage");function cq(e){return typeof e._sent100=="boolean"&&uq(e)}o(cq,"isServerResponse");function Wwe(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}o(Wwe,"isServerRequest");function qwe(e){if(!xo(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&cq(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}o(qwe,"willEmitClose");function Hwe(e){var t;return!!(e&&((t=e[rq])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}o(Hwe,"isDisturbed");function zwe(e){var t,r,n,a,s,i,u,h,c,d;return!!(e&&((t=(r=(n=(a=(s=(i=e[tq])!==null&&i!==void 0?i:e.readableErrored)!==null&&s!==void 0?s:e.writableErrored)!==null&&a!==void 0?a:(u=e._readableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&n!==void 0?n:(h=e._writableState)===null||h===void 0?void 0:h.errorEmitted)!==null&&r!==void 0?r:(c=e._readableState)===null||c===void 0?void 0:c.errored)!==null&&t!==void 0?t:!((d=e._writableState)===null||d===void 0)&&d.errored))}o(zwe,"isErrored");hq.exports={isDestroyed:n0,kIsDestroyed:eq,isDisturbed:Hwe,kIsDisturbed:rq,isErrored:zwe,kIsErrored:tq,isReadable:lq,kIsReadable:SR,kIsClosedPromise:Fwe,kControllerErrorFunction:kwe,kIsWritable:AR,isClosed:jwe,isDuplexNodeStream:Bwe,isFinished:$we,isIterable:Lwe,isReadableNodeStream:t0,isReadableStream:nq,isReadableEnded:Dwe,isReadableFinished:sq,isReadableErrored:Mwe,isNodeStream:xo,isWebStream:Cwe,isWritable:fq,isWritableNodeStream:r0,isWritableStream:iq,isWritableEnded:aq,isWritableFinished:Nwe,isWritableErrored:Uwe,isServerRequest:Wwe,isServerResponse:cq,willEmitClose:qwe,isTransformStream:oq}});var Ia=Oe((XNe,IR)=>{"use strict";var Us=$s(),{AbortError:_q,codes:Vwe}=un(),{ERR_INVALID_ARG_TYPE:Gwe,ERR_STREAM_PREMATURE_CLOSE:dq}=Vwe,{kEmptyObject:TR,once:xR}=_n(),{validateAbortSignal:Kwe,validateFunction:Ywe,validateObject:Zwe,validateBoolean:Xwe}=Sc(),{Promise:Jwe,PromisePrototypeThen:Qwe,SymbolDispose:Eq}=Zt(),{isClosed:e0e,isReadable:pq,isReadableNodeStream:RR,isReadableStream:t0e,isReadableFinished:yq,isReadableErrored:mq,isWritable:gq,isWritableNodeStream:wq,isWritableStream:r0e,isWritableFinished:vq,isWritableErrored:bq,isNodeStream:n0e,willEmitClose:i0e,kIsClosedPromise:o0e}=Oo(),Rc;function a0e(e){return e.setHeader&&typeof e.abort=="function"}o(a0e,"isRequest");var OR=o(()=>{},"nop");function Sq(e,t,r){var n,a;if(arguments.length===2?(r=t,t=TR):t==null?t=TR:Zwe(t,"options"),Ywe(r,"callback"),Kwe(t.signal,"options.signal"),r=xR(r),t0e(e)||r0e(e))return s0e(e,t,r);if(!n0e(e))throw new Gwe("stream",["ReadableStream","WritableStream","Stream"],e);let s=(n=t.readable)!==null&&n!==void 0?n:RR(e),i=(a=t.writable)!==null&&a!==void 0?a:wq(e),u=e._writableState,h=e._readableState,c=o(()=>{e.writable||m()},"onlegacyfinish"),d=i0e(e)&&RR(e)===s&&wq(e)===i,y=vq(e,!1),m=o(()=>{y=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||s))&&(!s||g)&&r.call(e)},"onfinish"),g=yq(e,!1),v=o(()=>{g=!0,e.destroyed&&(d=!1),!(d&&(!e.writable||i))&&(!i||y)&&r.call(e)},"onend"),_=o(A=>{r.call(e,A)},"onerror"),b=e0e(e),E=o(()=>{b=!0;let A=bq(e)||mq(e);if(A&&typeof A!="boolean")return r.call(e,A);if(s&&!g&&RR(e,!0)&&!yq(e,!1))return r.call(e,new dq);if(i&&!y&&!vq(e,!1))return r.call(e,new dq);r.call(e)},"onclose"),S=o(()=>{b=!0;let A=bq(e)||mq(e);if(A&&typeof A!="boolean")return r.call(e,A);r.call(e)},"onclosed"),T=o(()=>{e.req.on("finish",m)},"onrequest");a0e(e)?(e.on("complete",m),d||e.on("abort",E),e.req?T():e.on("request",T)):i&&!u&&(e.on("end",c),e.on("close",c)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",E),e.on("end",v),e.on("finish",m),t.error!==!1&&e.on("error",_),e.on("close",E),b?Us.nextTick(E):u!=null&&u.errorEmitted||h!=null&&h.errorEmitted?d||Us.nextTick(S):(!s&&(!d||pq(e))&&(y||gq(e)===!1)||!i&&(!d||gq(e))&&(g||pq(e)===!1)||h&&e.req&&e.aborted)&&Us.nextTick(S);let x=o(()=>{r=OR,e.removeListener("aborted",E),e.removeListener("complete",m),e.removeListener("abort",E),e.removeListener("request",T),e.req&&e.req.removeListener("finish",m),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",m),e.removeListener("end",v),e.removeListener("error",_),e.removeListener("close",E)},"cleanup");if(t.signal&&!b){let A=o(()=>{let B=r;x(),B.call(e,new _q(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)Us.nextTick(A);else{Rc=Rc||_n().addAbortListener;let B=Rc(t.signal,A),P=r;r=xR((...N)=>{B[Eq](),P.apply(e,N)})}}return x}o(Sq,"eos");function s0e(e,t,r){let n=!1,a=OR;if(t.signal)if(a=o(()=>{n=!0,r.call(e,new _q(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)Us.nextTick(a);else{Rc=Rc||_n().addAbortListener;let i=Rc(t.signal,a),u=r;r=xR((...h)=>{i[Eq](),u.apply(e,h)})}let s=o((...i)=>{n||Us.nextTick(()=>r.apply(e,i))},"resolverFn");return Qwe(e[o0e].promise,s,s),OR}o(s0e,"eosWeb");function l0e(e,t){var r;let n=!1;return t===null&&(t=TR),(r=t)!==null&&r!==void 0&&r.cleanup&&(Xwe(t.cleanup,"cleanup"),n=t.cleanup),new Jwe((a,s)=>{let i=Sq(e,t,u=>{n&&i(),u?s(u):a()})})}o(l0e,"finished");IR.exports=Sq;IR.exports.finished=l0e});var lf=Oe((QNe,Fq)=>{"use strict";var Io=$s(),{aggregateTwoErrors:f0e,codes:{ERR_MULTIPLE_CALLBACK:u0e},AbortError:c0e}=un(),{Symbol:Tq}=Zt(),{kIsDestroyed:h0e,isDestroyed:d0e,isFinished:p0e,isServerRequest:y0e}=Oo(),xq=Tq("kDestroy"),PR=Tq("kConstruct");function Oq(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}o(Oq,"checkError");function m0e(e,t){let r=this._readableState,n=this._writableState,a=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(Oq(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),a.constructed?Aq(this,e,t):this.once(xq,function(s){Aq(this,f0e(s,e),t)}),this)}o(m0e,"destroy");function Aq(e,t,r){let n=!1;function a(s){if(n)return;n=!0;let i=e._readableState,u=e._writableState;Oq(s,u,i),u&&(u.closed=!0),i&&(i.closed=!0),typeof r=="function"&&r(s),s?Io.nextTick(g0e,e,s):Io.nextTick(Iq,e)}o(a,"onDestroy");try{e._destroy(t||null,a)}catch(s){a(s)}}o(Aq,"_destroy");function g0e(e,t){FR(e,t),Iq(e)}o(g0e,"emitErrorCloseNT");function Iq(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}o(Iq,"emitCloseNT");function FR(e,t){let r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}o(FR,"emitErrorNT");function w0e(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}o(w0e,"undestroy");function kR(e,t,r){let n=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),n&&!n.errored&&(n.errored=t),r?Io.nextTick(FR,e,t):FR(e,t))}o(kR,"errorOrDestroy");function v0e(e,t){if(typeof e._construct!="function")return;let r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(PR,t),!(e.listenerCount(PR)>1)&&Io.nextTick(b0e,e)}o(v0e,"construct");function b0e(e){let t=!1;function r(n){if(t){kR(e,n??new u0e);return}t=!0;let a=e._readableState,s=e._writableState,i=s||a;a&&(a.constructed=!0),s&&(s.constructed=!0),i.destroyed?e.emit(xq,n):n?kR(e,n,!0):Io.nextTick(_0e,e)}o(r,"onConstruct");try{e._construct(n=>{Io.nextTick(r,n)})}catch(n){Io.nextTick(r,n)}}o(b0e,"constructNT");function _0e(e){e.emit(PR)}o(_0e,"emitConstructNT");function Rq(e){return e?.setHeader&&typeof e.abort=="function"}o(Rq,"isRequest");function Pq(e){e.emit("close")}o(Pq,"emitCloseLegacy");function E0e(e,t){e.emit("error",t),Io.nextTick(Pq,e)}o(E0e,"emitErrorCloseLegacy");function S0e(e,t){!e||d0e(e)||(!t&&!p0e(e)&&(t=new c0e),y0e(e)?(e.socket=null,e.destroy(t)):Rq(e)?e.abort():Rq(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Io.nextTick(E0e,e,t):Io.nextTick(Pq,e),e.destroyed||(e[h0e]=!0))}o(S0e,"destroyer");Fq.exports={construct:v0e,destroyer:S0e,destroy:m0e,undestroy:w0e,errorOrDestroy:kR}});var a0=Oe((tDe,Bq)=>{"use strict";var{ArrayIsArray:A0e,ObjectSetPrototypeOf:kq}=Zt(),{EventEmitter:i0}=(Gd(),Kt(Vd));function o0(e){i0.call(this,e)}o(o0,"Stream");kq(o0.prototype,i0.prototype);kq(o0,i0);o0.prototype.pipe=function(e,t){let r=this;function n(d){e.writable&&e.write(d)===!1&&r.pause&&r.pause()}o(n,"ondata"),r.on("data",n);function a(){r.readable&&r.resume&&r.resume()}o(a,"ondrain"),e.on("drain",a),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",i),r.on("close",u));let s=!1;function i(){s||(s=!0,e.end())}o(i,"onend");function u(){s||(s=!0,typeof e.destroy=="function"&&e.destroy())}o(u,"onclose");function h(d){c(),i0.listenerCount(this,"error")===0&&this.emit("error",d)}o(h,"onerror"),BR(r,"error",h),BR(e,"error",h);function c(){r.removeListener("data",n),e.removeListener("drain",a),r.removeListener("end",i),r.removeListener("close",u),r.removeListener("error",h),e.removeListener("error",h),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return o(c,"cleanup"),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e};function BR(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):A0e(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}o(BR,"prependListener");Bq.exports={Stream:o0,prependListener:BR}});var Kd=Oe((nDe,s0)=>{"use strict";var{SymbolDispose:R0e}=Zt(),{AbortError:Cq,codes:T0e}=un(),{isNodeStream:Lq,isWebStream:x0e,kControllerErrorFunction:O0e}=Oo(),I0e=Ia(),{ERR_INVALID_ARG_TYPE:Nq}=T0e,CR,P0e=o((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new Nq(t,"AbortSignal",e)},"validateAbortSignal");s0.exports.addAbortSignal=o(function(t,r){if(P0e(t,"signal"),!Lq(r)&&!x0e(r))throw new Nq("stream",["ReadableStream","WritableStream","Stream"],r);return s0.exports.addAbortSignalNoValidate(t,r)},"addAbortSignal");s0.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=Lq(t)?()=>{t.destroy(new Cq(void 0,{cause:e.reason}))}:()=>{t[O0e](new Cq(void 0,{cause:e.reason}))};if(e.aborted)r();else{CR=CR||_n().addAbortListener;let n=CR(e,r);I0e(t,n[R0e])}return t}});var Uq=Oe((oDe,$q)=>{"use strict";var{StringPrototypeSlice:Dq,SymbolIterator:F0e,TypedArrayPrototypeSet:l0,Uint8Array:k0e}=Zt(),{Buffer:LR}=(na(),Kt(ra)),{inspect:B0e}=_n(),Tc;$q.exports=(Tc=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return LR.alloc(0);let r=LR.allocUnsafe(t>>>0),n=this.head,a=0;for(;n;)l0(r,n.data,a),a+=n.data.length,n=n.next;return r}consume(t,r){let n=this.head.data;if(t<n.length){let a=n.slice(0,t);return this.head.data=n.slice(t),a}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[F0e](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,a=0;do{let s=n.data;if(t>s.length)r+=s,t-=s.length;else{t===s.length?(r+=s,++a,n.next?this.head=n.next:this.head=this.tail=null):(r+=Dq(s,0,t),this.head=n,n.data=Dq(s,t));break}++a}while((n=n.next)!==null);return this.length-=a,r}_getBuffer(t){let r=LR.allocUnsafe(t),n=t,a=this.head,s=0;do{let i=a.data;if(t>i.length)l0(r,i,n-t),t-=i.length;else{t===i.length?(l0(r,i,n-t),++s,a.next?this.head=a.next:this.head=this.tail=null):(l0(r,new k0e(i.buffer,i.byteOffset,t),n-t),this.head=a,a.data=i.slice(t));break}++s}while((a=a.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return B0e(this,{...r,depth:0,customInspect:!1})}},o(Tc,"BufferList"),Tc)});var Yd=Oe((sDe,qq)=>{"use strict";var{MathFloor:C0e,NumberIsInteger:L0e}=Zt(),{validateInteger:N0e}=Sc(),{ERR_INVALID_ARG_VALUE:D0e}=un().codes,Mq=16*1024,jq=16;function $0e(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}o($0e,"highWaterMarkFrom");function Wq(e){return e?jq:Mq}o(Wq,"getDefaultHighWaterMark");function U0e(e,t){N0e(t,"value",0),e?jq=t:Mq=t}o(U0e,"setDefaultHighWaterMark");function M0e(e,t,r,n){let a=$0e(t,n,r);if(a!=null){if(!L0e(a)||a<0){let s=n?`options.${r}`:"options.highWaterMark";throw new D0e(s,a)}return C0e(a)}return Wq(e.objectMode)}o(M0e,"getHighWaterMark");qq.exports={getHighWaterMark:M0e,getDefaultHighWaterMark:Wq,setDefaultHighWaterMark:U0e}});var Vq=Oe(zq=>{"use strict";var DR=Dh().Buffer,Hq=DR.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function j0e(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}o(j0e,"_normalizeEncoding");function W0e(e){var t=j0e(e);if(typeof t!="string"&&(DR.isEncoding===Hq||!Hq(e)))throw new Error("Unknown encoding: "+e);return t||e}o(W0e,"normalizeEncoding");zq.StringDecoder=Zd;function Zd(e){this.encoding=W0e(e);var t;switch(this.encoding){case"utf16le":this.text=K0e,this.end=Y0e,t=4;break;case"utf8":this.fillLast=z0e,t=4;break;case"base64":this.text=Z0e,this.end=X0e,t=3;break;default:this.write=J0e,this.end=Q0e;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=DR.allocUnsafe(t)}o(Zd,"StringDecoder");Zd.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Zd.prototype.end=G0e;Zd.prototype.text=V0e;Zd.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function NR(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}o(NR,"utf8CheckByte");function q0e(e,t,r){var n=t.length-1;if(n<r)return 0;var a=NR(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||a===-2?0:(a=NR(t[n]),a>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||a===-2?0:(a=NR(t[n]),a>=0?(a>0&&(a===2?a=0:e.lastNeed=a-3),a):0))}o(q0e,"utf8CheckIncomplete");function H0e(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}o(H0e,"utf8CheckExtraBytes");function z0e(e){var t=this.lastTotal-this.lastNeed,r=H0e(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}o(z0e,"utf8FillLast");function V0e(e,t){var r=q0e(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}o(V0e,"utf8Text");function G0e(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}o(G0e,"utf8End");function K0e(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}o(K0e,"utf16Text");function Y0e(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}o(Y0e,"utf16End");function Z0e(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}o(Z0e,"base64Text");function X0e(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}o(X0e,"base64End");function J0e(e){return e.toString(this.encoding)}o(J0e,"simpleWrite");function Q0e(e){return e&&e.length?this.write(e):""}o(Q0e,"simpleEnd")});var $R=Oe((cDe,Zq)=>{"use strict";var Gq=$s(),{PromisePrototypeThen:eve,SymbolAsyncIterator:Kq,SymbolIterator:Yq}=Zt(),{Buffer:tve}=(na(),Kt(ra)),{ERR_INVALID_ARG_TYPE:rve,ERR_STREAM_NULL_VALUES:nve}=un().codes;function ive(e,t,r){let n;if(typeof t=="string"||t instanceof tve)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let a;if(t&&t[Kq])a=!0,n=t[Kq]();else if(t&&t[Yq])a=!1,n=t[Yq]();else throw new rve("iterable",["Iterable"],t);let s=new e({objectMode:!0,highWaterMark:1,...r}),i=!1;s._read=function(){i||(i=!0,h())},s._destroy=function(c,d){eve(u(c),()=>Gq.nextTick(d,c),y=>Gq.nextTick(d,y||c))};async function u(c){let d=c!=null,y=typeof n.throw=="function";if(d&&y){let{value:m,done:g}=await n.throw(c);if(await m,g)return}if(typeof n.return=="function"){let{value:m}=await n.return();await m}}o(u,"close");async function h(){for(;;){try{let{value:c,done:d}=a?await n.next():n.next();if(d)s.push(null);else{let y=c&&typeof c.then=="function"?await c:c;if(y===null)throw i=!1,new nve;if(s.push(y))continue;i=!1}}catch(c){s.destroy(c)}break}}return o(h,"next"),s}o(ive,"from");Zq.exports=ive});var Jd=Oe((dDe,pH)=>{"use strict";var Ki=$s(),{ArrayPrototypeIndexOf:ove,NumberIsInteger:ave,NumberIsNaN:sve,NumberParseInt:lve,ObjectDefineProperties:VR,ObjectKeys:fve,ObjectSetPrototypeOf:Qq,Promise:eH,SafeSet:uve,SymbolAsyncDispose:cve,SymbolAsyncIterator:hve,Symbol:dve}=Zt();pH.exports=ot;ot.ReadableState=h0;var{EventEmitter:pve}=(Gd(),Kt(Vd)),{Stream:Ms,prependListener:yve}=a0(),{Buffer:UR}=(na(),Kt(ra)),{addAbortSignal:mve}=Kd(),tH=Ia(),dt=_n().debuglog("stream",e=>{dt=e}),gve=Uq(),Ic=lf(),{getHighWaterMark:wve,getDefaultHighWaterMark:vve}=Yd(),{aggregateTwoErrors:Xq,codes:{ERR_INVALID_ARG_TYPE:bve,ERR_METHOD_NOT_IMPLEMENTED:_ve,ERR_OUT_OF_RANGE:Eve,ERR_STREAM_PUSH_AFTER_EOF:Sve,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Ave},AbortError:Rve}=un(),{validateObject:Tve}=Sc(),ff=dve("kPaused"),{StringDecoder:rH}=Vq(),xve=$R();Qq(ot.prototype,Ms.prototype);Qq(ot,Ms);var MR=o(()=>{},"nop"),{errorOrDestroy:xc}=Ic,Oc=1,Ove=2,nH=4,Xd=8,iH=16,f0=32,u0=64,oH=128,Ive=256,Pve=512,Fve=1024,HR=2048,zR=4096,kve=8192,Bve=16384,Cve=32768,aH=65536,Lve=1<<17,Nve=1<<18;function kr(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}o(kr,"makeBitMapDescriptor");VR(h0.prototype,{objectMode:kr(Oc),ended:kr(Ove),endEmitted:kr(nH),reading:kr(Xd),constructed:kr(iH),sync:kr(f0),needReadable:kr(u0),emittedReadable:kr(oH),readableListening:kr(Ive),resumeScheduled:kr(Pve),errorEmitted:kr(Fve),emitClose:kr(HR),autoDestroy:kr(zR),destroyed:kr(kve),closed:kr(Bve),closeEmitted:kr(Cve),multiAwaitDrain:kr(aH),readingMore:kr(Lve),dataEmitted:kr(Nve)});function h0(e,t,r){typeof r!="boolean"&&(r=t instanceof Po()),this.state=HR|zR|iH|f0,e&&e.objectMode&&(this.state|=Oc),r&&e&&e.readableObjectMode&&(this.state|=Oc),this.highWaterMark=e?wve(this,e,"readableHighWaterMark",r):vve(!1),this.buffer=new gve,this.length=0,this.pipes=[],this.flowing=null,this[ff]=null,e&&e.emitClose===!1&&(this.state&=~HR),e&&e.autoDestroy===!1&&(this.state&=~zR),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new rH(e.encoding),this.encoding=e.encoding)}o(h0,"ReadableState");function ot(e){if(!(this instanceof ot))return new ot(e);let t=this instanceof Po();this._readableState=new h0(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&mve(e.signal,this)),Ms.call(this,e),Ic.construct(this,()=>{this._readableState.needReadable&&c0(this,this._readableState)})}o(ot,"Readable");ot.prototype.destroy=Ic.destroy;ot.prototype._undestroy=Ic.undestroy;ot.prototype._destroy=function(e,t){t(e)};ot.prototype[pve.captureRejectionSymbol]=function(e){this.destroy(e)};ot.prototype[cve]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new Rve,this.destroy(e)),new eH((t,r)=>tH(this,n=>n&&n!==e?r(n):t(null)))};ot.prototype.push=function(e,t){return sH(this,e,t,!1)};ot.prototype.unshift=function(e,t){return sH(this,e,t,!0)};function sH(e,t,r,n){dt("readableAddChunk",t);let a=e._readableState,s;if(a.state&Oc||(typeof t=="string"?(r=r||a.defaultEncoding,a.encoding!==r&&(n&&a.encoding?t=UR.from(t,r).toString(a.encoding):(t=UR.from(t,r),r=""))):t instanceof UR?r="":Ms._isUint8Array(t)?(t=Ms._uint8ArrayToBuffer(t),r=""):t!=null&&(s=new bve("chunk",["string","Buffer","Uint8Array"],t))),s)xc(e,s);else if(t===null)a.state&=~Xd,Uve(e,a);else if(a.state&Oc||t&&t.length>0)if(n)if(a.state&nH)xc(e,new Ave);else{if(a.destroyed||a.errored)return!1;jR(e,a,t,!0)}else if(a.ended)xc(e,new Sve);else{if(a.destroyed||a.errored)return!1;a.state&=~Xd,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?jR(e,a,t,!1):c0(e,a)):jR(e,a,t,!1)}else n||(a.state&=~Xd,c0(e,a));return!a.ended&&(a.length<a.highWaterMark||a.length===0)}o(sH,"readableAddChunk");function jR(e,t,r,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&aH?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.state&u0&&d0(e)),c0(e,t)}o(jR,"addChunk");ot.prototype.isPaused=function(){let e=this._readableState;return e[ff]===!0||e.flowing===!1};ot.prototype.setEncoding=function(e){let t=new rH(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let a of r)n+=t.write(a);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var Dve=1073741824;function $ve(e){if(e>Dve)throw new Eve("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}o($ve,"computeNewHighWaterMark");function Jq(e,t){return e<=0||t.length===0&&t.ended?0:t.state&Oc?1:sve(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}o(Jq,"howMuchToRead");ot.prototype.read=function(e){dt("read",e),e===void 0?e=NaN:ave(e)||(e=lve(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=$ve(e)),e!==0&&(t.state&=~oH),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return dt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?WR(this):d0(this),null;if(e=Jq(e,t),e===0&&t.ended)return t.length===0&&WR(this),null;let n=(t.state&u0)!==0;if(dt("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,dt("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,dt("reading, ended or constructing",n);else if(n){dt("do read"),t.state|=Xd|f0,t.length===0&&(t.state|=u0);try{this._read(t.highWaterMark)}catch(s){xc(this,s)}t.state&=~f0,t.reading||(e=Jq(r,t))}let a;return e>0?a=hH(e,t):a=null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&WR(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",a)),a};function Uve(e,t){if(dt("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?d0(e):(t.needReadable=!1,t.emittedReadable=!0,lH(e))}}o(Uve,"onEofChunk");function d0(e){let t=e._readableState;dt("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(dt("emitReadable",t.flowing),t.emittedReadable=!0,Ki.nextTick(lH,e))}o(d0,"emitReadable");function lH(e){let t=e._readableState;dt("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,uH(e)}o(lH,"emitReadable_");function c0(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Ki.nextTick(Mve,e,t))}o(c0,"maybeReadMore");function Mve(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(dt("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}o(Mve,"maybeReadMore_");ot.prototype._read=function(e){throw new _ve("_read()")};ot.prototype.pipe=function(e,t){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new uve(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),dt("pipe count=%d opts=%j",n.pipes.length,t);let s=(!t||t.end!==!1)&&e!==Ki.stdout&&e!==Ki.stderr?u:b;n.endEmitted?Ki.nextTick(s):r.once("end",s),e.on("unpipe",i);function i(E,S){dt("onunpipe"),E===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,d())}o(i,"onunpipe");function u(){dt("onend"),e.end()}o(u,"onend");let h,c=!1;function d(){dt("cleanup"),e.removeListener("close",v),e.removeListener("finish",_),h&&e.removeListener("drain",h),e.removeListener("error",g),e.removeListener("unpipe",i),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",m),c=!0,h&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&h()}o(d,"cleanup");function y(){c||(n.pipes.length===1&&n.pipes[0]===e?(dt("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(dt("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),h||(h=jve(r,e),e.on("drain",h))}o(y,"pause"),r.on("data",m);function m(E){dt("ondata");let S=e.write(E);dt("dest.write",S),S===!1&&y()}o(m,"ondata");function g(E){if(dt("onerror",E),b(),e.removeListener("error",g),e.listenerCount("error")===0){let S=e._writableState||e._readableState;S&&!S.errorEmitted?xc(e,E):e.emit("error",E)}}o(g,"onerror"),yve(e,"error",g);function v(){e.removeListener("finish",_),b()}o(v,"onclose"),e.once("close",v);function _(){dt("onfinish"),e.removeListener("close",v),b()}o(_,"onfinish"),e.once("finish",_);function b(){dt("unpipe"),r.unpipe(e)}return o(b,"unpipe"),e.emit("pipe",r),e.writableNeedDrain===!0?y():n.flowing||(dt("pipe resume"),r.resume()),e};function jve(e,t){return o(function(){let n=e._readableState;n.awaitDrainWriters===t?(dt("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(dt("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()},"pipeOnDrainFunctionResult")}o(jve,"pipeOnDrain");ot.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let a=t.pipes;t.pipes=[],this.pause();for(let s=0;s<a.length;s++)a[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=ove(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};ot.prototype.on=function(e,t){let r=Ms.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,dt("on readable",n.length,n.reading),n.length?d0(this):n.reading||Ki.nextTick(Wve,this)),r};ot.prototype.addListener=ot.prototype.on;ot.prototype.removeListener=function(e,t){let r=Ms.prototype.removeListener.call(this,e,t);return e==="readable"&&Ki.nextTick(fH,this),r};ot.prototype.off=ot.prototype.removeListener;ot.prototype.removeAllListeners=function(e){let t=Ms.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Ki.nextTick(fH,this),t};function fH(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[ff]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}o(fH,"updateReadableListening");function Wve(e){dt("readable nexttick read 0"),e.read(0)}o(Wve,"nReadingNextTick");ot.prototype.resume=function(){let e=this._readableState;return e.flowing||(dt("resume"),e.flowing=!e.readableListening,qve(this,e)),e[ff]=!1,this};function qve(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Ki.nextTick(Hve,e,t))}o(qve,"resume");function Hve(e,t){dt("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),uH(e),t.flowing&&!t.reading&&e.read(0)}o(Hve,"resume_");ot.prototype.pause=function(){return dt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(dt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ff]=!0,this};function uH(e){let t=e._readableState;for(dt("flow",t.flowing);t.flowing&&e.read()!==null;);}o(uH,"flow");ot.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{xc(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=fve(e);for(let n=1;n<r.length;n++){let a=r[n];this[a]===void 0&&typeof e[a]=="function"&&(this[a]=e[a].bind(e))}return this};ot.prototype[hve]=function(){return cH(this)};ot.prototype.iterator=function(e){return e!==void 0&&Tve(e,"options"),cH(this,e)};function cH(e,t){typeof e.read!="function"&&(e=ot.wrap(e,{objectMode:!0}));let r=zve(e,t);return r.stream=e,r}o(cH,"streamToAsyncIterator");async function*zve(e,t){let r=MR;function n(i){this===e?(r(),r=MR):r=i}o(n,"next"),e.on("readable",n);let a,s=tH(e,{writable:!1},i=>{a=i?Xq(a,i):null,r(),r=MR});try{for(;;){let i=e.destroyed?null:e.read();if(i!==null)yield i;else{if(a)throw a;if(a===null)return;await new eH(n)}}}catch(i){throw a=Xq(a,i),a}finally{(a||t?.destroyOnReturn!==!1)&&(a===void 0||e._readableState.autoDestroy)?Ic.destroyer(e,null):(e.off("readable",n),s())}}o(zve,"createAsyncIterator");VR(ot.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:o(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.flowing},"get"),set:o(function(e){this._readableState&&(this._readableState.flowing=e)},"set")},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});VR(h0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ff]!==!1},set(e){this[ff]=!!e}}});ot._fromList=hH;function hH(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}o(hH,"fromList");function WR(e){let t=e._readableState;dt("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Ki.nextTick(Vve,t,e))}o(WR,"endReadable");function Vve(e,t){if(dt("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Ki.nextTick(Gve,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}o(Vve,"endReadableNT");function Gve(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}o(Gve,"endWritableNT");ot.from=function(e,t){return xve(ot,e,t)};var qR;function dH(){return qR===void 0&&(qR={}),qR}o(dH,"lazyWebStreams");ot.fromWeb=function(e,t){return dH().newStreamReadableFromReadableStream(e,t)};ot.toWeb=function(e,t){return dH().newReadableStreamFromStreamReadable(e,t)};ot.wrap=function(e,t){var r,n;return new ot({objectMode:(r=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(a,s){Ic.destroyer(e,a),s(a)}}).wrap(e)}});var w0=Oe((yDe,TH)=>{"use strict";var uf=$s(),{ArrayPrototypeSlice:gH,Error:Kve,FunctionPrototypeSymbolHasInstance:wH,ObjectDefineProperty:vH,ObjectDefineProperties:Yve,ObjectSetPrototypeOf:bH,StringPrototypeToLowerCase:Zve,Symbol:Xve,SymbolHasInstance:Jve}=Zt();TH.exports=ar;ar.WritableState=tp;var{EventEmitter:Qve}=(Gd(),Kt(Vd)),Qd=a0().Stream,{Buffer:p0}=(na(),Kt(ra)),g0=lf(),{addAbortSignal:ebe}=Kd(),{getHighWaterMark:tbe,getDefaultHighWaterMark:rbe}=Yd(),{ERR_INVALID_ARG_TYPE:nbe,ERR_METHOD_NOT_IMPLEMENTED:ibe,ERR_MULTIPLE_CALLBACK:_H,ERR_STREAM_CANNOT_PIPE:obe,ERR_STREAM_DESTROYED:ep,ERR_STREAM_ALREADY_FINISHED:abe,ERR_STREAM_NULL_VALUES:sbe,ERR_STREAM_WRITE_AFTER_END:lbe,ERR_UNKNOWN_ENCODING:EH}=un().codes,{errorOrDestroy:Pc}=g0;bH(ar.prototype,Qd.prototype);bH(ar,Qd);function YR(){}o(YR,"nop");var Fc=Xve("kOnFinished");function tp(e,t,r){typeof r!="boolean"&&(r=t instanceof Po()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?tbe(this,e,"writableHighWaterMark",r):rbe(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ube.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,m0(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Fc]=[]}o(tp,"WritableState");function m0(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}o(m0,"resetBuffer");tp.prototype.getBuffer=o(function(){return gH(this.buffered,this.bufferedIndex)},"getBuffer");vH(tp.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function ar(e){let t=this instanceof Po();if(!t&&!wH(ar,this))return new ar(e);this._writableState=new tp(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&ebe(e.signal,this)),Qd.call(this,e),g0.construct(this,()=>{let r=this._writableState;r.writing||XR(this,r),JR(this,r)})}o(ar,"Writable");vH(ar,Jve,{__proto__:null,value:o(function(e){return wH(this,e)?!0:this!==ar?!1:e&&e._writableState instanceof tp},"value")});ar.prototype.pipe=function(){Pc(this,new obe)};function SH(e,t,r,n){let a=e._writableState;if(typeof r=="function")n=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!=="buffer"&&!p0.isEncoding(r))throw new EH(r);typeof n!="function"&&(n=YR)}if(t===null)throw new sbe;if(!a.objectMode)if(typeof t=="string")a.decodeStrings!==!1&&(t=p0.from(t,r),r="buffer");else if(t instanceof p0)r="buffer";else if(Qd._isUint8Array(t))t=Qd._uint8ArrayToBuffer(t),r="buffer";else throw new nbe("chunk",["string","Buffer","Uint8Array"],t);let s;return a.ending?s=new lbe:a.destroyed&&(s=new ep("write")),s?(uf.nextTick(n,s),Pc(e,s,!0),s):(a.pendingcb++,fbe(e,a,t,r,n))}o(SH,"_write");ar.prototype.write=function(e,t,r){return SH(this,e,t,r)===!0};ar.prototype.cork=function(){this._writableState.corked++};ar.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||XR(this,e))};ar.prototype.setDefaultEncoding=o(function(t){if(typeof t=="string"&&(t=Zve(t)),!p0.isEncoding(t))throw new EH(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function fbe(e,t,r,n,a){let s=t.objectMode?1:r.length;t.length+=s;let i=t.length<t.highWaterMark;return i||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:a}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&a!==YR&&(t.allNoop=!1)):(t.writelen=s,t.writecb=a,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),i&&!t.errored&&!t.destroyed}o(fbe,"writeOrBuffer");function yH(e,t,r,n,a,s,i){t.writelen=n,t.writecb=i,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new ep("write")):r?e._writev(a,t.onwrite):e._write(a,s,t.onwrite),t.sync=!1}o(yH,"doWrite");function mH(e,t,r,n){--t.pendingcb,n(r),ZR(t),Pc(e,r)}o(mH,"onwriteError");function ube(e,t){let r=e._writableState,n=r.sync,a=r.writecb;if(typeof a!="function"){Pc(e,new _H);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?uf.nextTick(mH,e,r,t,a):mH(e,r,t,a)):(r.buffered.length>r.bufferedIndex&&XR(e,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},uf.nextTick(cbe,r.afterWriteTickInfo)):AH(e,r,1,a))}o(ube,"onwrite");function cbe({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,AH(e,t,r,n)}o(cbe,"afterWriteTick");function AH(e,t,r,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&ZR(t),JR(e,t)}o(AH,"afterWrite");function ZR(e){if(e.writing)return;for(let a=e.bufferedIndex;a<e.buffered.length;++a){var t;let{chunk:s,callback:i}=e.buffered[a],u=e.objectMode?1:s.length;e.length-=u,i((t=e.errored)!==null&&t!==void 0?t:new ep("write"))}let r=e[Fc].splice(0);for(let a=0;a<r.length;a++){var n;r[a]((n=e.errored)!==null&&n!==void 0?n:new ep("end"))}m0(e)}o(ZR,"errorBuffer");function XR(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:a}=t,s=r.length-n;if(!s)return;let i=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let u=t.allNoop?YR:c=>{for(let d=i;d<r.length;++d)r[d].callback(c)},h=t.allNoop&&i===0?r:gH(r,i);h.allBuffers=t.allBuffers,yH(e,t,!0,t.length,h,"",u),m0(t)}else{do{let{chunk:u,encoding:h,callback:c}=r[i];r[i++]=null;let d=a?1:u.length;yH(e,t,!1,d,u,h,c)}while(i<r.length&&!t.writing);i===r.length?m0(t):i>256?(r.splice(0,i),t.bufferedIndex=0):t.bufferedIndex=i}t.bufferProcessing=!1}o(XR,"clearBuffer");ar.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new ibe("_write()")};ar.prototype._writev=null;ar.prototype.end=function(e,t,r){let n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let a;if(e!=null){let s=SH(this,e,t);s instanceof Kve&&(a=s)}return n.corked&&(n.corked=1,this.uncork()),a||(!n.errored&&!n.ending?(n.ending=!0,JR(this,n,!0),n.ended=!0):n.finished?a=new abe("end"):n.destroyed&&(a=new ep("end"))),typeof r=="function"&&(a||n.finished?uf.nextTick(r,a):n[Fc].push(r)),this};function y0(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}o(y0,"needFinish");function hbe(e,t){let r=!1;function n(a){if(r){Pc(e,a??_H());return}if(r=!0,t.pendingcb--,a){let s=t[Fc].splice(0);for(let i=0;i<s.length;i++)s[i](a);Pc(e,a,t.sync)}else y0(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,uf.nextTick(KR,e,t))}o(n,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(n)}catch(a){n(a)}t.sync=!1}o(hbe,"callFinal");function dbe(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,hbe(e,t)):(t.prefinished=!0,e.emit("prefinish")))}o(dbe,"prefinish");function JR(e,t,r){y0(t)&&(dbe(e,t),t.pendingcb===0&&(r?(t.pendingcb++,uf.nextTick((n,a)=>{y0(a)?KR(n,a):a.pendingcb--},e,t)):y0(t)&&(t.pendingcb++,KR(e,t))))}o(JR,"finishMaybe");function KR(e,t){t.pendingcb--,t.finished=!0;let r=t[Fc].splice(0);for(let n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}o(KR,"finish");Yve(ar.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:o(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var pbe=g0.destroy;ar.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Fc].length)&&uf.nextTick(ZR,r),pbe.call(this,e,t),this};ar.prototype._undestroy=g0.undestroy;ar.prototype._destroy=function(e,t){t(e)};ar.prototype[Qve.captureRejectionSymbol]=function(e){this.destroy(e)};var GR;function RH(){return GR===void 0&&(GR={}),GR}o(RH,"lazyWebStreams");ar.fromWeb=function(e,t){return RH().newStreamWritableFromWritableStream(e,t)};ar.toWeb=function(e){return RH().newWritableStreamFromStreamWritable(e)}});var jH=Oe((gDe,MH)=>{var QR=$s(),ybe=(na(),Kt(ra)),{isReadable:mbe,isWritable:gbe,isIterable:xH,isNodeStream:wbe,isReadableNodeStream:OH,isWritableNodeStream:IH,isDuplexNodeStream:vbe,isReadableStream:PH,isWritableStream:FH}=Oo(),kH=Ia(),{AbortError:$H,codes:{ERR_INVALID_ARG_TYPE:bbe,ERR_INVALID_RETURN_VALUE:BH}}=un(),{destroyer:Bc}=lf(),_be=Po(),UH=Jd(),Ebe=w0(),{createDeferredPromise:CH}=_n(),LH=$R(),NH=globalThis.Blob||ybe.Blob,Sbe=o(typeof NH<"u"?function(t){return t instanceof NH}:function(t){return!1},"isBlob"),Abe=globalThis.AbortController||_c().AbortController,{FunctionPrototypeCall:DH}=Zt(),eT=class eT extends _be{constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};o(eT,"Duplexify");var js=eT;MH.exports=o(function e(t,r){if(vbe(t))return t;if(OH(t))return kc({readable:t});if(IH(t))return kc({writable:t});if(wbe(t))return kc({writable:!1,readable:!1});if(PH(t))return kc({readable:UH.fromWeb(t)});if(FH(t))return kc({writable:Ebe.fromWeb(t)});if(typeof t=="function"){let{value:a,write:s,final:i,destroy:u}=Rbe(t);if(xH(a))return LH(js,a,{objectMode:!0,write:s,final:i,destroy:u});let h=a?.then;if(typeof h=="function"){let c,d=DH(h,a,y=>{if(y!=null)throw new BH("nully","body",y)},y=>{Bc(c,y)});return c=new js({objectMode:!0,readable:!1,write:s,final(y){i(async()=>{try{await d,QR.nextTick(y,null)}catch(m){QR.nextTick(y,m)}})},destroy:u})}throw new BH("Iterable, AsyncIterable or AsyncFunction",r,a)}if(Sbe(t))return e(t.arrayBuffer());if(xH(t))return LH(js,t,{objectMode:!0,writable:!1});if(PH(t?.readable)&&FH(t?.writable))return js.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let a=t!=null&&t.readable?OH(t?.readable)?t?.readable:e(t.readable):void 0,s=t!=null&&t.writable?IH(t?.writable)?t?.writable:e(t.writable):void 0;return kc({readable:a,writable:s})}let n=t?.then;if(typeof n=="function"){let a;return DH(n,t,s=>{s!=null&&a.push(s),a.push(null)},s=>{Bc(a,s)}),a=new js({objectMode:!0,writable:!1,read(){}})}throw new bbe(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function Rbe(e){let{promise:t,resolve:r}=CH(),n=new Abe,a=n.signal;return{value:e(async function*(){for(;;){let i=t;t=null;let{chunk:u,done:h,cb:c}=await i;if(QR.nextTick(c),h)return;if(a.aborted)throw new $H(void 0,{cause:a.reason});({promise:t,resolve:r}=CH()),yield u}}(),{signal:a}),write(i,u,h){let c=r;r=null,c({chunk:i,done:!1,cb:h})},final(i){let u=r;r=null,u({done:!0,cb:i})},destroy(i,u){n.abort(),u(i)}}}o(Rbe,"fromAsyncGen");function kc(e){let t=e.readable&&typeof e.readable.read!="function"?UH.wrap(e.readable):e.readable,r=e.writable,n=!!mbe(t),a=!!gbe(r),s,i,u,h,c;function d(y){let m=h;h=null,m?m(y):y&&c.destroy(y)}return o(d,"onfinished"),c=new js({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:a}),a&&(kH(r,y=>{a=!1,y&&Bc(t,y),d(y)}),c._write=function(y,m,g){r.write(y,m)?g():s=g},c._final=function(y){r.end(),i=y},r.on("drain",function(){if(s){let y=s;s=null,y()}}),r.on("finish",function(){if(i){let y=i;i=null,y()}})),n&&(kH(t,y=>{n=!1,y&&Bc(t,y),d(y)}),t.on("readable",function(){if(u){let y=u;u=null,y()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){let y=t.read();if(y===null){u=c._read;return}if(!c.push(y))return}}),c._destroy=function(y,m){!y&&h!==null&&(y=new $H),u=null,s=null,i=null,h===null?m(y):(h=m,Bc(r,y),Bc(t,y))},c}o(kc,"_duplexify")});var Po=Oe((vDe,HH)=>{"use strict";var{ObjectDefineProperties:Tbe,ObjectGetOwnPropertyDescriptor:Pa,ObjectKeys:xbe,ObjectSetPrototypeOf:WH}=Zt();HH.exports=Yi;var nT=Jd(),Fi=w0();WH(Yi.prototype,nT.prototype);WH(Yi,nT);{let e=xbe(Fi.prototype);for(let t=0;t<e.length;t++){let r=e[t];Yi.prototype[r]||(Yi.prototype[r]=Fi.prototype[r])}}function Yi(e){if(!(this instanceof Yi))return new Yi(e);nT.call(this,e),Fi.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}o(Yi,"Duplex");Tbe(Yi.prototype,{writable:{__proto__:null,...Pa(Fi.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Pa(Fi.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Pa(Fi.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Pa(Fi.prototype,"writableBuffer")},writableLength:{__proto__:null,...Pa(Fi.prototype,"writableLength")},writableFinished:{__proto__:null,...Pa(Fi.prototype,"writableFinished")},writableCorked:{__proto__:null,...Pa(Fi.prototype,"writableCorked")},writableEnded:{__proto__:null,...Pa(Fi.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Pa(Fi.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var tT;function qH(){return tT===void 0&&(tT={}),tT}o(qH,"lazyWebStreams");Yi.fromWeb=function(e,t){return qH().newStreamDuplexFromReadableWritablePair(e,t)};Yi.toWeb=function(e){return qH().newReadableWritablePairFromDuplex(e)};var rT;Yi.from=function(e){return rT||(rT=jH()),rT(e,"body")}});var aT=Oe((_De,VH)=>{"use strict";var{ObjectSetPrototypeOf:zH,Symbol:Obe}=Zt();VH.exports=Fa;var{ERR_METHOD_NOT_IMPLEMENTED:Ibe}=un().codes,oT=Po(),{getHighWaterMark:Pbe}=Yd();zH(Fa.prototype,oT.prototype);zH(Fa,oT);var rp=Obe("kCallback");function Fa(e){if(!(this instanceof Fa))return new Fa(e);let t=e?Pbe(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),oT.call(this,e),this._readableState.sync=!1,this[rp]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Fbe)}o(Fa,"Transform");function iT(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}o(iT,"final");function Fbe(){this._final!==iT&&iT.call(this)}o(Fbe,"prefinish");Fa.prototype._final=iT;Fa.prototype._transform=function(e,t,r){throw new Ibe("_transform()")};Fa.prototype._write=function(e,t,r){let n=this._readableState,a=this._writableState,s=n.length;this._transform(e,t,(i,u)=>{if(i){r(i);return}u!=null&&this.push(u),a.ended||s===n.length||n.length<n.highWaterMark?r():this[rp]=r})};Fa.prototype._read=function(){if(this[rp]){let e=this[rp];this[rp]=null,e()}}});var lT=Oe((SDe,KH)=>{"use strict";var{ObjectSetPrototypeOf:GH}=Zt();KH.exports=Cc;var sT=aT();GH(Cc.prototype,sT.prototype);GH(Cc,sT);function Cc(e){if(!(this instanceof Cc))return new Cc(e);sT.call(this,e)}o(Cc,"PassThrough");Cc.prototype._transform=function(e,t,r){r(null,e)}});var E0=Oe((RDe,QH)=>{var np=$s(),{ArrayIsArray:kbe,Promise:Bbe,SymbolAsyncIterator:Cbe,SymbolDispose:Lbe}=Zt(),_0=Ia(),{once:Nbe}=_n(),Dbe=lf(),YH=Po(),{aggregateTwoErrors:$be,codes:{ERR_INVALID_ARG_TYPE:gT,ERR_INVALID_RETURN_VALUE:fT,ERR_MISSING_ARGS:Ube,ERR_STREAM_DESTROYED:Mbe,ERR_STREAM_PREMATURE_CLOSE:jbe},AbortError:Wbe}=un(),{validateFunction:qbe,validateAbortSignal:Hbe}=Sc(),{isIterable:cf,isReadable:uT,isReadableNodeStream:b0,isNodeStream:ZH,isTransformStream:Lc,isWebStream:zbe,isReadableStream:cT,isReadableFinished:Vbe}=Oo(),Gbe=globalThis.AbortController||_c().AbortController,hT,dT,pT;function XH(e,t,r){let n=!1;e.on("close",()=>{n=!0});let a=_0(e,{readable:t,writable:r},s=>{n=!s});return{destroy:o(s=>{n||(n=!0,Dbe.destroyer(e,s||new Mbe("pipe")))},"destroy"),cleanup:a}}o(XH,"destroyer");function Kbe(e){return qbe(e[e.length-1],"streams[stream.length - 1]"),e.pop()}o(Kbe,"popCallback");function yT(e){if(cf(e))return e;if(b0(e))return Ybe(e);throw new gT("val",["Readable","Iterable","AsyncIterable"],e)}o(yT,"makeAsyncIterable");async function*Ybe(e){dT||(dT=Jd()),yield*dT.prototype[Cbe].call(e)}o(Ybe,"fromReadable");async function v0(e,t,r,{end:n}){let a,s=null,i=o(c=>{if(c&&(a=c),s){let d=s;s=null,d()}},"resume"),u=o(()=>new Bbe((c,d)=>{a?d(a):s=o(()=>{a?d(a):c()},"onresolve")}),"wait");t.on("drain",i);let h=_0(t,{readable:!1},i);try{t.writableNeedDrain&&await u();for await(let c of e)t.write(c)||await u();n&&(t.end(),await u()),r()}catch(c){r(a!==c?$be(a,c):c)}finally{h(),t.off("drain",i)}}o(v0,"pumpToNode");async function mT(e,t,r,{end:n}){Lc(t)&&(t=t.writable);let a=t.getWriter();try{for await(let s of e)await a.ready,a.write(s).catch(()=>{});await a.ready,n&&await a.close(),r()}catch(s){try{await a.abort(s),r(s)}catch(i){r(i)}}}o(mT,"pumpToWeb");function Zbe(...e){return JH(e,Nbe(Kbe(e)))}o(Zbe,"pipeline");function JH(e,t,r){if(e.length===1&&kbe(e[0])&&(e=e[0]),e.length<2)throw new Ube("streams");let n=new Gbe,a=n.signal,s=r?.signal,i=[];Hbe(s,"options.signal");function u(){v(new Wbe)}o(u,"abort"),pT=pT||_n().addAbortListener;let h;s&&(h=pT(s,u));let c,d,y=[],m=0;function g(T){v(T,--m===0)}o(g,"finish");function v(T,x){var A;if(T&&(!c||c.code==="ERR_STREAM_PREMATURE_CLOSE")&&(c=T),!(!c&&!x)){for(;y.length;)y.shift()(c);(A=h)===null||A===void 0||A[Lbe](),n.abort(),x&&(c||i.forEach(B=>B()),np.nextTick(t,c,d))}}o(v,"finishImpl");let _;for(let T=0;T<e.length;T++){let x=e[T],A=T<e.length-1,B=T>0,P=A||r?.end!==!1,N=T===e.length-1;if(ZH(x)){let L=function(C){C&&C.name!=="AbortError"&&C.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(C)};var S=L;if(o(L,"onError"),P){let{destroy:C,cleanup:z}=XH(x,A,B);y.push(C),uT(x)&&N&&i.push(z)}x.on("error",L),uT(x)&&N&&i.push(()=>{x.removeListener("error",L)})}if(T===0)if(typeof x=="function"){if(_=x({signal:a}),!cf(_))throw new fT("Iterable, AsyncIterable or Stream","source",_)}else cf(x)||b0(x)||Lc(x)?_=x:_=YH.from(x);else if(typeof x=="function"){if(Lc(_)){var b;_=yT((b=_)===null||b===void 0?void 0:b.readable)}else _=yT(_);if(_=x(_,{signal:a}),A){if(!cf(_,!0))throw new fT("AsyncIterable",`transform[${T-1}]`,_)}else{var E;hT||(hT=lT());let L=new hT({objectMode:!0}),C=(E=_)===null||E===void 0?void 0:E.then;if(typeof C=="function")m++,C.call(_,Q=>{d=Q,Q!=null&&L.write(Q),P&&L.end(),np.nextTick(g)},Q=>{L.destroy(Q),np.nextTick(g,Q)});else if(cf(_,!0))m++,v0(_,L,g,{end:P});else if(cT(_)||Lc(_)){let Q=_.readable||_;m++,v0(Q,L,g,{end:P})}else throw new fT("AsyncIterable or Promise","destination",_);_=L;let{destroy:z,cleanup:V}=XH(_,!1,!0);y.push(z),N&&i.push(V)}}else if(ZH(x)){if(b0(_)){m+=2;let L=Xbe(_,x,g,{end:P});uT(x)&&N&&i.push(L)}else if(Lc(_)||cT(_)){let L=_.readable||_;m++,v0(L,x,g,{end:P})}else if(cf(_))m++,v0(_,x,g,{end:P});else throw new gT("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=x}else if(zbe(x)){if(b0(_))m++,mT(yT(_),x,g,{end:P});else if(cT(_)||cf(_))m++,mT(_,x,g,{end:P});else if(Lc(_))m++,mT(_.readable,x,g,{end:P});else throw new gT("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=x}else _=YH.from(x)}return(a!=null&&a.aborted||s!=null&&s.aborted)&&np.nextTick(u),_}o(JH,"pipelineImpl");function Xbe(e,t,r,{end:n}){let a=!1;if(t.on("close",()=>{a||r(new jbe)}),e.pipe(t,{end:!1}),n){let i=function(){a=!0,t.end()};var s=i;o(i,"endFn"),Vbe(e)?np.nextTick(i):e.once("end",i)}else r();return _0(e,{readable:!0,writable:!1},i=>{let u=e._readableState;i&&i.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?e.once("end",r).once("error",r):r(i)}),_0(t,{readable:!1,writable:!0},r)}o(Xbe,"pipe");QH.exports={pipelineImpl:JH,pipeline:Zbe}});var vT=Oe((xDe,o9)=>{"use strict";var{pipeline:Jbe}=E0(),S0=Po(),{destroyer:Qbe}=lf(),{isNodeStream:A0,isReadable:e9,isWritable:t9,isWebStream:wT,isTransformStream:hf,isWritableStream:r9,isReadableStream:n9}=Oo(),{AbortError:e_e,codes:{ERR_INVALID_ARG_VALUE:i9,ERR_MISSING_ARGS:t_e}}=un(),r_e=Ia();o9.exports=o(function(...t){if(t.length===0)throw new t_e("streams");if(t.length===1)return S0.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=S0.from(t[0])),typeof t[t.length-1]=="function"){let g=t.length-1;t[g]=S0.from(t[g])}for(let g=0;g<t.length;++g)if(!(!A0(t[g])&&!wT(t[g]))){if(g<t.length-1&&!(e9(t[g])||n9(t[g])||hf(t[g])))throw new i9(`streams[${g}]`,r[g],"must be readable");if(g>0&&!(t9(t[g])||r9(t[g])||hf(t[g])))throw new i9(`streams[${g}]`,r[g],"must be writable")}let n,a,s,i,u;function h(g){let v=i;i=null,v?v(g):g?u.destroy(g):!m&&!y&&u.destroy()}o(h,"onfinished");let c=t[0],d=Jbe(t,h),y=!!(t9(c)||r9(c)||hf(c)),m=!!(e9(d)||n9(d)||hf(d));if(u=new S0({writableObjectMode:!!(c!=null&&c.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:y,readable:m}),y){if(A0(c))u._write=function(v,_,b){c.write(v,_)?b():n=b},u._final=function(v){c.end(),a=v},c.on("drain",function(){if(n){let v=n;n=null,v()}});else if(wT(c)){let _=(hf(c)?c.writable:c).getWriter();u._write=async function(b,E,S){try{await _.ready,_.write(b).catch(()=>{}),S()}catch(T){S(T)}},u._final=async function(b){try{await _.ready,_.close().catch(()=>{}),a=b}catch(E){b(E)}}}let g=hf(d)?d.readable:d;r_e(g,()=>{if(a){let v=a;a=null,v()}})}if(m){if(A0(d))d.on("readable",function(){if(s){let g=s;s=null,g()}}),d.on("end",function(){u.push(null)}),u._read=function(){for(;;){let g=d.read();if(g===null){s=u._read;return}if(!u.push(g))return}};else if(wT(d)){let v=(hf(d)?d.readable:d).getReader();u._read=async function(){for(;;)try{let{value:_,done:b}=await v.read();if(!u.push(_))return;if(b){u.push(null);return}}catch{return}}}}return u._destroy=function(g,v){!g&&i!==null&&(g=new e_e),s=null,n=null,a=null,i===null?v(g):(i=v,A0(d)&&Qbe(d,g))},u},"compose")});var y9=Oe((IDe,ET)=>{"use strict";var n_e=globalThis.AbortController||_c().AbortController,{codes:{ERR_INVALID_ARG_VALUE:i_e,ERR_INVALID_ARG_TYPE:ip,ERR_MISSING_ARGS:o_e,ERR_OUT_OF_RANGE:a_e},AbortError:Fo}=un(),{validateAbortSignal:df,validateInteger:a9,validateObject:pf}=Sc(),s_e=Zt().Symbol("kWeak"),l_e=Zt().Symbol("kResistStopPropagation"),{finished:f_e}=Ia(),u_e=vT(),{addAbortSignalNoValidate:c_e}=Kd(),{isWritable:h_e,isNodeStream:d_e}=Oo(),{deprecate:p_e}=_n(),{ArrayPrototypePush:y_e,Boolean:m_e,MathFloor:s9,Number:g_e,NumberIsNaN:w_e,Promise:l9,PromiseReject:f9,PromiseResolve:v_e,PromisePrototypeThen:u9,Symbol:h9}=Zt(),R0=h9("kEmpty"),c9=h9("kEof");function b_e(e,t){if(t!=null&&pf(t,"options"),t?.signal!=null&&df(t.signal,"options.signal"),d_e(e)&&!h_e(e))throw new i_e("stream",e,"must be writable");let r=u_e(this,e);return t!=null&&t.signal&&c_e(t.signal,r),r}o(b_e,"compose");function T0(e,t){if(typeof e!="function")throw new ip("fn",["Function","AsyncFunction"],e);t!=null&&pf(t,"options"),t?.signal!=null&&df(t.signal,"options.signal");let r=1;t?.concurrency!=null&&(r=s9(t.concurrency));let n=r-1;return t?.highWaterMark!=null&&(n=s9(t.highWaterMark)),a9(r,"options.concurrency",1),a9(n,"options.highWaterMark",0),n+=r,o(async function*(){let s=_n().AbortSignalAny([t?.signal].filter(m_e)),i=this,u=[],h={signal:s},c,d,y=!1,m=0;function g(){y=!0,v()}o(g,"onCatch");function v(){m-=1,_()}o(v,"afterItemProcessed");function _(){d&&!y&&m<r&&u.length<n&&(d(),d=null)}o(_,"maybeResume");async function b(){try{for await(let E of i){if(y)return;if(s.aborted)throw new Fo;try{if(E=e(E,h),E===R0)continue;E=v_e(E)}catch(S){E=f9(S)}m+=1,u9(E,v,g),u.push(E),c&&(c(),c=null),!y&&(u.length>=n||m>=r)&&await new l9(S=>{d=S})}u.push(c9)}catch(E){let S=f9(E);u9(S,v,g),u.push(S)}finally{y=!0,c&&(c(),c=null)}}o(b,"pump"),b();try{for(;;){for(;u.length>0;){let E=await u[0];if(E===c9)return;if(s.aborted)throw new Fo;E!==R0&&(yield E),u.shift(),_()}await new l9(E=>{c=E})}}finally{y=!0,d&&(d(),d=null)}},"map").call(this)}o(T0,"map");function __e(e=void 0){return e!=null&&pf(e,"options"),e?.signal!=null&&df(e.signal,"options.signal"),o(async function*(){let r=0;for await(let a of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Fo({cause:e.signal.reason});yield[r++,a]}},"asIndexedPairs").call(this)}o(__e,"asIndexedPairs");async function d9(e,t=void 0){for await(let r of _T.call(this,e,t))return!0;return!1}o(d9,"some");async function E_e(e,t=void 0){if(typeof e!="function")throw new ip("fn",["Function","AsyncFunction"],e);return!await d9.call(this,async(...r)=>!await e(...r),t)}o(E_e,"every");async function S_e(e,t){for await(let r of _T.call(this,e,t))return r}o(S_e,"find");async function A_e(e,t){if(typeof e!="function")throw new ip("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a),R0}o(r,"forEachFn");for await(let n of T0.call(this,r,t));}o(A_e,"forEach");function _T(e,t){if(typeof e!="function")throw new ip("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a)?n:R0}return o(r,"filterFn"),T0.call(this,r,t)}o(_T,"filter");var ST=class ST extends o_e{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};o(ST,"ReduceAwareErrMissingArgs");var bT=ST;async function R_e(e,t,r){var n;if(typeof e!="function")throw new ip("reducer",["Function","AsyncFunction"],e);r!=null&&pf(r,"options"),r?.signal!=null&&df(r.signal,"options.signal");let a=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let c=new Fo(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await f_e(this.destroy(c)),c}let s=new n_e,i=s.signal;if(r!=null&&r.signal){let c={once:!0,[s_e]:this,[l_e]:!0};r.signal.addEventListener("abort",()=>s.abort(),c)}let u=!1;try{for await(let c of this){var h;if(u=!0,r!=null&&(h=r.signal)!==null&&h!==void 0&&h.aborted)throw new Fo;a?t=await e(t,c,{signal:i}):(t=c,a=!0)}if(!u&&!a)throw new bT}finally{s.abort()}return t}o(R_e,"reduce");async function T_e(e){e!=null&&pf(e,"options"),e?.signal!=null&&df(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Fo(void 0,{cause:e.signal.reason});y_e(t,n)}return t}o(T_e,"toArray");function x_e(e,t){let r=T0.call(this,e,t);return o(async function*(){for await(let a of r)yield*a},"flatMap").call(this)}o(x_e,"flatMap");function p9(e){if(e=g_e(e),w_e(e))return 0;if(e<0)throw new a_e("number",">= 0",e);return e}o(p9,"toIntegerOrInfinity");function O_e(e,t=void 0){return t!=null&&pf(t,"options"),t?.signal!=null&&df(t.signal,"options.signal"),e=p9(e),o(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Fo;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new Fo;e--<=0&&(yield s)}},"drop").call(this)}o(O_e,"drop");function I_e(e,t=void 0){return t!=null&&pf(t,"options"),t?.signal!=null&&df(t.signal,"options.signal"),e=p9(e),o(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Fo;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new Fo;if(e-- >0&&(yield s),e<=0)return}},"take").call(this)}o(I_e,"take");ET.exports.streamReturningOperators={asIndexedPairs:p_e(__e,"readable.asIndexedPairs will be removed in a future version."),drop:O_e,filter:_T,flatMap:x_e,map:T0,take:I_e,compose:b_e};ET.exports.promiseReturningOperators={every:E_e,forEach:A_e,reduce:R_e,toArray:T_e,some:d9,find:S_e}});var AT=Oe((FDe,m9)=>{"use strict";var{ArrayPrototypePop:P_e,Promise:F_e}=Zt(),{isIterable:k_e,isNodeStream:B_e,isWebStream:C_e}=Oo(),{pipelineImpl:L_e}=E0(),{finished:N_e}=Ia();RT();function D_e(...e){return new F_e((t,r)=>{let n,a,s=e[e.length-1];if(s&&typeof s=="object"&&!B_e(s)&&!k_e(s)&&!C_e(s)){let i=P_e(e);n=i.signal,a=i.end}L_e(e,(i,u)=>{i?r(i):t(u)},{signal:n,end:a})})}o(D_e,"pipeline");m9.exports={finished:N_e,pipeline:D_e}});var RT=Oe((BDe,R9)=>{"use strict";var{Buffer:$_e}=(na(),Kt(ra)),{ObjectDefineProperty:ka,ObjectKeys:v9,ReflectApply:b9}=Zt(),{promisify:{custom:_9}}=_n(),{streamReturningOperators:g9,promiseReturningOperators:w9}=y9(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:E9}}=un(),U_e=vT(),{setDefaultHighWaterMark:M_e,getDefaultHighWaterMark:j_e}=Yd(),{pipeline:S9}=E0(),{destroyer:W_e}=lf(),A9=Ia(),TT=AT(),op=Oo(),zt=R9.exports=a0().Stream;zt.isDestroyed=op.isDestroyed;zt.isDisturbed=op.isDisturbed;zt.isErrored=op.isErrored;zt.isReadable=op.isReadable;zt.isWritable=op.isWritable;zt.Readable=Jd();for(let e of v9(g9)){let r=function(...n){if(new.target)throw E9();return zt.Readable.from(b9(t,this,n))};o(r,"fn");let t=g9[e];ka(r,"name",{__proto__:null,value:t.name}),ka(r,"length",{__proto__:null,value:t.length}),ka(zt.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of v9(w9)){let r=function(...n){if(new.target)throw E9();return b9(t,this,n)};o(r,"fn");let t=w9[e];ka(r,"name",{__proto__:null,value:t.name}),ka(r,"length",{__proto__:null,value:t.length}),ka(zt.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}zt.Writable=w0();zt.Duplex=Po();zt.Transform=aT();zt.PassThrough=lT();zt.pipeline=S9;var{addAbortSignal:q_e}=Kd();zt.addAbortSignal=q_e;zt.finished=A9;zt.destroy=W_e;zt.compose=U_e;zt.setDefaultHighWaterMark=M_e;zt.getDefaultHighWaterMark=j_e;ka(zt,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return TT}});ka(S9,_9,{__proto__:null,enumerable:!0,get(){return TT.pipeline}});ka(A9,_9,{__proto__:null,enumerable:!0,get(){return TT.finished}});zt.Stream=zt;zt._isUint8Array=o(function(t){return t instanceof Uint8Array},"isUint8Array");zt._uint8ArrayToBuffer=o(function(t){return $_e.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var T9=Oe((LDe,Er)=>{"use strict";var Br=RT(),H_e=AT(),z_e=Br.Readable.destroy;Er.exports=Br.Readable;Er.exports._uint8ArrayToBuffer=Br._uint8ArrayToBuffer;Er.exports._isUint8Array=Br._isUint8Array;Er.exports.isDisturbed=Br.isDisturbed;Er.exports.isErrored=Br.isErrored;Er.exports.isReadable=Br.isReadable;Er.exports.Readable=Br.Readable;Er.exports.Writable=Br.Writable;Er.exports.Duplex=Br.Duplex;Er.exports.Transform=Br.Transform;Er.exports.PassThrough=Br.PassThrough;Er.exports.addAbortSignal=Br.addAbortSignal;Er.exports.finished=Br.finished;Er.exports.destroy=Br.destroy;Er.exports.destroy=z_e;Er.exports.pipeline=Br.pipeline;Er.exports.compose=Br.compose;Object.defineProperty(Br,"promises",{configurable:!0,enumerable:!0,get(){return H_e}});Er.exports.Stream=Br.Stream;Er.exports.default=Er.exports});Vp();typeof globalThis<"u"&&!globalThis.Buffer&&(globalThis.Buffer=nl);typeof window<"u"&&!window.Buffer&&(window.Buffer=nl);Vp();function mI(e){let t=e.name||"untitled";return{kind:"file",name:t,async getFile(){let n=(await e.stat()).size;console.log("reading data into buffer of size"+n);let a=nl.alloc(n);await e.read(a,0,n,0);let s=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);console.log("buffer read",s);let i=s;return new File([i],t||"untitled")},async createWritable(){return{async write(r){console.log("writing data to handle",e);let n;if(typeof r=="string")n=nl.from(r,"utf-8");else if(r instanceof Blob){let a=await r.arrayBuffer();n=new Uint8Array(a)}else if(ArrayBuffer.isView(r))n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);else throw console.log("data",r),new Error("Unsupported data type for write");await e.write(n),await e.sync(),console.log("write completed")},async close(){await e.close()}}}}}o(mI,"fileHandleToFileSystemFileHandle");async function UY(e){let t=await e.getFile();return t.handle=e,t}o(UY,"fileSystemFileHandleToFileWithHandle");async function jIe(e){return{openFile:o(async t=>{let r=await e.promises.open(t,"w");return r.name=t,await UY(mI(r))},"openFile"),fileSave:o(async(t,r,n,a,s)=>{if(n)console.log("using existing handle",n);else{let h=window.prompt("Save as",r?.fileName??"untitled");if(console.log("result of prompt",h),!h)throw new Error("no file choosen");try{let c=await e.promises.open(`${h}`,"w");n=mI(c)}catch(c){throw console.error("Failed to open file in legitFs",c),new Error("Failed to open file in legitFs")}}let i=t instanceof Blob?t:await t;return await(await n.createWritable()).write(i),n},"fileSave")}}o(jIe,"getLegitFsAccess");var kv=class kv{constructor(t,r){Ye(this,"entries",[]);Ye(this,"currentIndex",0);Ye(this,"closed",!1);Ye(this,"compositFs");Ye(this,"dirPath");Ye(this,"initialized",!1);this.compositFs=t,this.dirPath=r}async initialize(){if(this.initialized)return;let t=new Set;for(let r of[...this.compositFs.filterLayers].reverse())if(r.readDirFiltering)t=new Set(await r.readDirFiltering(this.dirPath,Array.from(t)));else{let n=await r.readdir(this.dirPath);for(let a of n)t.add(a)}this.initialized=!0}async*[Symbol.asyncIterator](){for(await this.initialize();this.currentIndex<this.entries.length&&!this.closed;){let t=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(t.path);yield{name:t.name,isFile:o(()=>r.isFile(),"isFile"),isDirectory:o(()=>r.isDirectory(),"isDirectory"),isBlockDevice:o(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:o(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:o(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:o(()=>r.isFIFO(),"isFIFO"),isSocket:o(()=>r.isSocket(),"isSocket")}}catch(r){console.debug(`Failed to stat ${t.path}:`,r)}}}async read(){if(this.closed)throw new Error("Directory handle is closed");if(await this.initialize(),this.currentIndex>=this.entries.length)return null;let t=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(t.path);return{name:t.name,isFile:o(()=>r.isFile(),"isFile"),isDirectory:o(()=>r.isDirectory(),"isDirectory"),isBlockDevice:o(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:o(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:o(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:o(()=>r.isFIFO(),"isFIFO"),isSocket:o(()=>r.isSocket(),"isSocket")}}catch{return this.read()}}async close(){this.closed=!0,this.entries=[]}get path(){return this.dirPath}};o(kv,"CompositeFsDir");var Ka=kv;function MY(e){let t=e.split("/").filter(Boolean),r=[],n=[],a=!1,s;for(let i of t)if(i.startsWith("[[")&&i.endsWith("]]")){let u=i.slice(2,-2).replace(/^\.\.\./,"");if(r.push(u),i.startsWith("[[..."))a=!0,n.push("(/.*)*"),s=u;else throw new Error("Optional single-segment parameters [[param]] are not supported. Use [[...param]] for catch-all or [param] for required single segment.")}else if(i.startsWith("[")&&i.endsWith("]")){if(i.startsWith("[..."))throw new Error("Required catch-all parameters [...param] are not supported. Use [[...param]] instead.");{let u=i.slice(1,-1);r.push(u),n.push("/([^\\/]+)")}}else i==="."?a=!0:n.push("/"+i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"));return{regexStr:n.join("")+"$",paramNames:r,folderRoute:a,pathParameter:s}}o(MY,"compilePattern");function Bv(e){if(e===".")return 1;let t=e.split("/").filter(Boolean),r=Math.pow(2,t.length);for(let n=0;n<t.length;n++){let a=t[n],s;a.startsWith("[[...")?s=10:a.startsWith("[[")?s=50:a.startsWith("[")?s=100:s=1e3+a.length;let i=Math.pow(.9,n);r+=s*i}return r}o(Bv,"calculatePriority");function jY(e){if(typeof e.name!="string")return"folder";let t=e;return t.fsType==="folder"?"folder":t.fsType==="file"?"file":"readdir"in t&&typeof t.readdir=="function"?"folder":"file"}o(jY,"getNodeType");function WY(e){let t=[];function r(n,a){if(typeof n.name=="string"){t.push({pattern:a||".",handler:n,priority:Bv(a||"."),staticBaseChildren:[]});return}let s=n,i=[],u=Object.keys(s).filter(h=>h.startsWith("[[")||h===".");if(u.length>1)throw new Error(`Expected exactly one folder handler for ${a||"/"} expected but multuple found: ${u.join(", ")}`);if(u.length===0)throw new Error(`No folder handler for ${a||"/"} founds`);for(let[h,c]of Object.entries(s)){let d=a?`${a}/${h}`:h;if(h==="."){if(typeof c.name!="string")throw new Error(`Folder root '.' at path '${a}' must be a handler, not a folder`);if(c.fsType!=="folder"&&c.fsType!=="fs")throw new Error(`Folder root handler '.' at path '${a}' must be of type 'folder' or 'fs'`);t.push({pattern:a+"/.",handler:c,priority:Bv(a),staticBaseChildren:i})}else if(h.startsWith("[["))if(h.startsWith("[[..."))if(typeof c.name=="string"){if(t.push({pattern:d,handler:c,priority:Bv(d),staticBaseChildren:i}),c.fsType!=="folder"&&c.fsType!=="fs")throw new Error(`Folder root handler '.' at path '${a}' must be of type 'folder' or 'fs'`)}else r(c,d);else r(c,d);else if(h.startsWith("[")){if(h.startsWith("[..."))throw new Error(`Required catch-all '${h}' is not supported. Use '[[...${h.slice(5,-1)}]]' instead`);r(c,d)}else i.push({segment:h,type:jY(c)}),r(c,d)}}return o(r,"walk"),r(e,""),t}o(WY,"flattenRoutes");var Cv=class Cv{constructor(t,r){this.routes=t;this.rootPath=r;Ye(this,"compiledRoutes");let n=WY(t);this.compiledRoutes=n.map(a=>{let{regexStr:s,paramNames:i,folderRoute:u,pathParameter:h}=MY(a.pattern);return{regex:new RegExp(s),paramNames:i,staticBaseChildren:a.staticBaseChildren,handler:a.handler,priority:a.priority,pattern:a.pattern,folderRoute:u,pathParameter:h}})}match(t){let r=t;r.startsWith(this.rootPath+"/")?r=r.slice(this.rootPath.length+1):r.startsWith(this.rootPath)&&(r=r.slice(this.rootPath.length)),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1));let n,a={},s=-1,i=this.compiledRoutes,u=[];for(let c of i){let d=r.match(c.regex);if(d)u.push(c);else continue;if(!(!d||c.priority<=s)){a={};for(let y=0;y<c.paramNames.length;y++){let m=d[y+1]||"";m.startsWith("/")&&(m=m.slice(1)),a[c.paramNames[y]]=m}s=c.priority,n=c}}if(!n||n.handler===void 0)return;let h=[];return n.folderRoute&&(n.pathParameter?a[n.pathParameter]===""&&(h=n.staticBaseChildren.map(c=>({segment:c.segment,type:c.type}))):h=n.staticBaseChildren.map(c=>({segment:c.segment,type:c.type}))),{handler:n.handler,matchingPattern:n.pattern,params:a,staticSiblings:h}}};o(Cv,"PathRouter");var Gp=Cv;function Wt(e){return typeof e=="string"?e:Buffer.isBuffer(e)?e.toString():String(e)}o(Wt,"pathToString");var Lv=class Lv{constructor({name:t,rootPath:r}){Ye(this,"compositeFs");Ye(this,"context");Ye(this,"newContext");Ye(this,"fsType","fs");Ye(this,"rootInstanceId");Ye(this,"name");Ye(this,"rootPath");this.name=t,this.rootPath=r,this.rootInstanceId=`${t}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}attach(t){this.compositeFs=t}withContext(t){let r=Object.create(Object.getPrototypeOf(this));return Object.assign(r,this),r.context=t,r}async open(t,r,n){throw new Error(`open not implemented for: ${Wt(t)}`)}async access(t,r){throw new Error(`access not implemented for: ${Wt(t)}`)}async stat(t,r){throw new Error(`lstat not implemented for: ${Wt(t)}`)}async lstat(t,r){throw new Error(`lstat not implemented for: ${Wt(t)}`)}async opendir(t,r){throw new Error(`opendir not implemented for: ${Wt(t)}`)}async link(t,r){throw new Error(`link not implemented for: ${Wt(t)}`)}async mkdir(t,r){throw new Error(`mkdir not implemented for: ${Wt(t)}`)}async readdir(t,r){throw new Error(`readdir not implemented for: ${Wt(t)}`)}async readlink(t,...r){throw new Error(`readlink not implemented for: ${Wt(t)}`)}async unlink(t){throw new Error(`unlink not implemented for: ${Wt(t)}`)}async rename(t,r){throw new Error(`rename not implemented for: ${Wt(t)}`)}async rmdir(t,...r){throw new Error(`rmdir not implemented for: ${Wt(t)}`)}async symlink(t,r,n){throw new Error(`symlink not implemented for: ${Wt(r)}`)}async lookup(t){throw new Error(`lookup not implemented for: ${Wt(t)}`)}resolvePath(t){throw new Error(`resolvePath not implemented for fd: ${t}`)}async close(t){this.compositeFs.close(t)}async dataSync(t){throw new Error(`dataSync not implemented for: ${t.subFsFileDescriptor}`)}async read(t,r,n,a,s){throw new Error(`read not implemented for: ${t.subFsFileDescriptor}`)}async appendFile(t,r,n){throw new Error(`appendFile not implemented for: ${t.subFsFileDescriptor}`)}async fchmod(t,r){throw new Error(`fchmod not implemented for: ${t.subFsFileDescriptor}`)}async fchown(t,r,n){throw new Error(`fchown not implemented for: ${t.subFsFileDescriptor}`)}async ftruncate(t,r){throw new Error(`ftruncate not implemented for: ${t.subFsFileDescriptor}`)}async fstat(t,r){throw new Error(`fstat not implemented for: ${t.subFsFileDescriptor}`)}async futimes(t,r,n){throw new Error(`futimes not implemented for: ${t.subFsFileDescriptor}`)}async write(t,r,n,a,s){throw new Error(`write not implemented for: ${t.subFsFileDescriptor}`)}async writev(t,r,n){throw new Error(`writev not implemented for: ${t.subFsFileDescriptor}`)}async readv(t,r,n){throw new Error(`readv not implemented for: ${t.subFsFileDescriptor}`)}async readFile(t,r){throw new Error(`readFile not implemented for: ${t}`)}async writeFile(t,r,n){throw new Error(`writeFile not implemented for: ${t}`)}};o(Lv,"BaseCompositeSubFs");var Jr=Lv;var Nv=class Nv{constructor({name:t,filterLayers:r,routes:n,rootPath:a}){Ye(this,"promises");Ye(this,"filterLayers",[]);Ye(this,"router");Ye(this,"parentFs");Ye(this,"name");Ye(this,"rootPath");Ye(this,"pathToFileDescriptors",new Map);Ye(this,"openFileHandles",new Map);Ye(this,"logOperation");this.name=t,this.rootPath=a;for(let s of r)this.filterLayers.push(s),s.attach(this);this.router=new Gp(n,this.rootPath),this.promises={access:this.access.bind(this),opendir:this.opendir.bind(this),mkdir:this.mkdir.bind(this),readdir:this.readdir.bind(this),open:this.open.bind(this),stat:this.stat.bind(this),lstat:this.lstat.bind(this),link:this.link.bind(this),readlink:this.readlink.bind(this),unlink:this.unlink.bind(this),rename:this.rename.bind(this),rmdir:this.rmdir.bind(this),symlink:this.symlink.bind(this),readFile:this.readFile.bind(this),writeFile:this.writeFile.bind(this),getFilehandle:this.getFilehandle.bind(this)}}getNextFileDescriptor(){let t=Array.from(this.openFileHandles.keys());return t.length===0?1:Math.max(...t)+1}setLoggger(t){this.logOperation=t}async logOperationOnFileDescsriptor(t,r,n){if(!this.logOperation)return;let a=[];for(let[s,i]of this.pathToFileDescriptors.entries())i.includes(t.fd)&&a.push(s);if(a.length!==0)return this.logOperation?.({fsName:t.delegate.name,fd:t,path:a[0],operation:r,operationArgs:n})}getFilehandle(t){return this.openFileHandles.get(t)}async getResponsibleFs(t){let r=t.toString();for(let s of this.filterLayers)if(await s.responsible(r)){if(s.withContext!==void 0)return s.withContext({fullPath:r,params:{},staticSiblings:[]});throw new Error(`Filter layer filesystem ${s.name} is not a BaseCompositeSubFs`)}let n=this.router.match(r);if(!n)throw new Error(`No route match for: ${r}`);let a=n.handler;return a.attach(this),a.withContext({fullPath:r,params:n.params,staticSiblings:n.staticSiblings})}async access(t,r){let n=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:n.name,path:t,operation:"access",operationArgs:{mode:r}}),n.access(t,r)}async stat(t,r){let n=t.toString(),a=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:a.name,path:n,operation:"stat",operationArgs:{opts:r}}),a.stat(t)}async lstat(t,r){let n=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:n.name,path:t.toString(),operation:"lstat",operationArgs:{opts:r}}),n.lstat(t,r)}async unlink(t){let r=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:r.name,path:t.toString(),operation:"unlink",operationArgs:{}}),r.unlink(t)}async mkdir(t,r){let n=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:n.name,path:t.toString(),operation:"mkdir",operationArgs:{options:r}}),n.mkdir(t,r)}async rmdir(t,r){let n=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:n.name,path:t.toString(),operation:"rmdir",operationArgs:{dirPath:t,options:r}}),n.rmdir(t,r)}async opendir(t,r){await this.logOperation?.({fsName:this.name,path:t.toString(),operation:"opendir",operationArgs:{options:r}});let n=t.toString();return new Ka(this,n)}async readdir(t,r){await this.logOperation?.({fsName:this.name,path:t.toString(),operation:"readdir",operationArgs:{options:r}});let n=new Set,a=this.router.match(t.toString());if(a?.handler instanceof Jr){let s=a?.handler.withContext({fullPath:t.toString(),params:a.params,staticSiblings:a.staticSiblings});s.attach(this),n=new Set(await s.readdir(t,r))}for(let s of[...this.filterLayers].reverse())if(s.readDirFiltering)n=new Set(await s.readDirFiltering(t,Array.from(n)));else{let i=await s.readdir(t,r);for(let u of i)n.add(u)}return Array.from(n)}async open(t,r,n){let a=await this.getResponsibleFs(t);await this.logOperation?.({fsName:a.name,path:t,operation:"open",operationArgs:{flags:r,mode:n}});let s=await a.open(t,r,n),i=this.getNextFileDescriptor();return s.realize(i),this.openFileHandles.set(i,s),this.pathToFileDescriptors.get(t)||this.pathToFileDescriptors.set(t,[]),this.pathToFileDescriptors.get(t).push(i),s}async close(t){try{await t.delegate.close(t)}catch(r){throw r}finally{for(let[r,n]of this.pathToFileDescriptors.entries()){let a=n.indexOf(t.fd);if(a!==-1){n.splice(a,1),n.length===0&&this.pathToFileDescriptors.delete(r);break}}this.openFileHandles.delete(t.fd)}}async link(t,r){throw new Error("not implemented")}async readlink(t,r){throw new Error("not implemented")}async rename(t,r){let n=await this.getResponsibleFs(t),a=await this.getResponsibleFs(r);if(n.rootInstanceId===a.rootInstanceId)return await this.logOperation?.({fsName:n.name,path:t.toString(),operation:"rename",operationArgs:{oldPath:t,newPath:r}}),n.newContext=a.context,n.rename(t,r);let s=await n.open(t.toString(),"r");try{let i=await n.fstat(s),u=Buffer.alloc(i.size);await n.read(s,u,0,i.size,0),await n.close(s),await a.writeFile(r.toString(),u,"utf8"),await n.unlink(t)}catch(i){try{await n.close(s)}catch{}throw i}}async symlink(t,r,n){throw new Error("not implemented")}async readFile(t,r){await this.logOperation?.({fsName:this.name,path:t.toString(),operation:"readFile",operationArgs:{path:t,options:r}});let n=!0,a;if(typeof t=="number"){n=!1;let s=this.getFilehandle(t);if(!s)throw new Error("Invalid file descriptor");a=s}else if(typeof t=="string")a=await this.open(t,"r");else throw new Error("only filehandle and path are supported atm");try{let i=(await a.stat()).size;if(typeof i=="bigint"){if(i>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("File too large to read into buffer");i=Number(i)}let u=Buffer.alloc(i),{bytesRead:h}=await a.read(u,0,i,0);if(r&&typeof r.encoding=="string")return u.slice(0,h).toString(r.encoding);if(typeof r=="string"){if(r==="utf8"||r==="utf-8")return u.slice(0,h).toString(r);throw new Error("Unsupported encoding: "+r)}return u.slice(0,h)}finally{a&&n&&await a.close()}}async writeFile(t,r,n){await this.logOperation?.({fsName:this.name,path:t.toString(),operation:"writeFile",operationArgs:{data:r,options:n}});let a=typeof t!="number",s,i,u,h="w";if(typeof n=="string"?i=n:n&&typeof n=="object"&&(i=n.encoding,u=n.mode,h=n.flag||"w"),typeof t=="number"){let c=this.getFilehandle(t);if(!c)throw new Error("Invalid file descriptor");s=c}else if(typeof t=="string")s=await this.open(t,h,u);else throw new Error("only filehandle and path are supported atm");try{let c;if(typeof r=="string")c=Buffer.from(r,i||"utf8");else if(r instanceof Buffer)c=r;else if(r instanceof Uint8Array)c=Buffer.from(r);else throw new Error("Invalid data type for writeFile");let d=0;for(;d<c.length;){let{bytesWritten:y}=await s.write(c,d,c.length-d,d);d+=y}}finally{s&&a&&await s.close()}}};o(Nv,"CompositeFs");var ch=Nv;var RI=Lt(Xp(),1);var Vv=class Vv extends Jr{constructor({name:r,hiddenFiles:n,rootPath:a}){super({name:r,rootPath:a});Ye(this,"ig");this.ig=(0,RI.default)(),this.ig.add(n)}async responsible(r){let n=r.replace(/\\/g,"/"),a=n;if(this.rootPath){let s=this.rootPath;n.startsWith(s+"/")?a=n.slice(s.length+1):n.startsWith(s)&&(a=n.slice(s.length))}return a=a.startsWith("./")?a.slice(2):a,a=a.startsWith("/")?a.slice(1):a,a===""||a==="."?!1:this.ig.ignores(a)}fileType(){return 255}error(r){return new Error(`Access to hidden file is not allowed: ${Wt(r)}`)}async open(r,n,a){throw this.error(r)}async access(r){throw this.error(r)}async stat(r){throw this.error(r)}async lstat(r){throw this.error(r)}async opendir(r){throw this.error(r)}async link(r){throw this.error(r)}async mkdir(r){throw this.error(r)}async readDirFiltering(r,n){let a=[];for(let s of n){let i=Wt(r)!=="/"?Wt(r)+"/"+s:"/"+s;await this.responsible(i)||a.push(s)}return a}async readdir(r){throw this.error(r)}async readlink(r){throw this.error(r)}async unlink(r){throw this.error(r)}async rename(r){throw this.error(r)}async rmdir(r){throw this.error(r)}async symlink(r,n){throw this.error(n)}async lookup(r){throw this.error(r)}resolvePath(r){throw new Error(`Access to hidden file is not allowed: resolvePath(${r})`)}async close(r){throw new Error("Access to hidden file is not allowed: close: "+r.subFsFileDescriptor)}async dataSync(r){throw new Error("Access to hidden file is not allowed: dataSync: "+r.subFsFileDescriptor)}async read(r,n,a,s,i){throw new Error("Access to hidden file is not allowed: readFileHandle: "+r.subFsFileDescriptor)}};o(Vv,"HiddenFileSubFs");var Jp=Vv;var Gv=class Gv{constructor(t){Ye(this,"delegate");Ye(this,"compositeFs");Ye(this,"_subFsFileDescriptor");Ye(this,"handleType","file");Ye(this,"_compositFsFileDescriptor",-1);this.delegate=t.fs,this._subFsFileDescriptor=t.subFsFileDescriptor,this._compositFsFileDescriptor=-1,this.compositeFs=t.compositeFs;let r=this._subFsFileDescriptor}get fsType(){return this.delegate.fileType()}get subFsFileDescriptor(){return this._subFsFileDescriptor}get fd(){return this._compositFsFileDescriptor}realize(t){if(this._compositFsFileDescriptor!==-1)throw new Error("was already realized");this._compositFsFileDescriptor=t}readableWebStream(t){throw new Error("Method not implemented.")}async appendFile(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"appendFile",{data:t,options:r}),await this.delegate.appendFile(this,t,r)}async chmod(t){return await this.compositeFs.logOperationOnFileDescsriptor(this,"chmod",{mode:t}),this.delegate.fchmod(this,t)}async chown(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"chown",{uid:t,gid:r}),this.delegate.fchown(this,t,r)}async close(){return await this.compositeFs.logOperationOnFileDescsriptor(this,"close",{}),this.compositeFs.close(this)}async datasync(){return await this.compositeFs.logOperationOnFileDescsriptor(this,"datasync",{}),this.delegate.dataSync(this)}async read(t,r,n,a){return await this.compositeFs.logOperationOnFileDescsriptor(this,"read",{targetBufferLength:t.length,offset:r,length:n,position:a}),await this.delegate.read(this,t,r,n,a)}async readv(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"readv",{buffers:t,position:r}),this.delegate.readv(this,t,r)}async stat(t){return await this.compositeFs.logOperationOnFileDescsriptor(this,"stat",{options:t}),this.delegate.fstat(this,t)}async truncate(t){return await this.compositeFs.logOperationOnFileDescsriptor(this,"truncate",{len:t}),this.delegate.ftruncate(this,t)}async utimes(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"utimes",{atime:t,mtime:r}),this.delegate.futimes(this,t,r)}async write(t,r,n,a){return await this.compositeFs.logOperationOnFileDescsriptor(this,"write",{buffer:t,offset:r,length:n,position:a}),this.delegate.write(this,t,r,n,a)}async writev(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"writev",{buffers:t,position:r}),this.delegate.writev(this,t,r)}async sync(){return await this.compositeFs.logOperationOnFileDescsriptor(this,"sync",{}),this.delegate.dataSync(this)}};o(Gv,"CompositFsFileHandle");var xn=Gv;function Jv(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}o(Jv,"unimplemented");var qo=[],Kf=!1,il,Qp=-1;function fZ(){!Kf||!il||(Kf=!1,il.length?qo=il.concat(qo):Qp=-1,qo.length&&xI())}o(fZ,"cleanUpNextTick");function xI(){if(!Kf){var e=setTimeout(fZ,0);Kf=!0;for(var t=qo.length;t;){for(il=qo,qo=[];++Qp<t;)il&&il[Qp].run();Qp=-1,t=qo.length}il=null,Kf=!1,clearTimeout(e)}}o(xI,"drainQueue");function uZ(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];qo.push(new OI(e,t)),qo.length===1&&!Kf&&setTimeout(xI,0)}o(uZ,"nextTick");function OI(e,t){this.fun=e,this.array=t}o(OI,"Item");OI.prototype.run=function(){this.fun.apply(null,this.array)};var cZ="browser",hZ="x64",dZ="browser",pZ={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},yZ=["/usr/bin/node"],mZ=[],gZ="v16.8.0",wZ={},vZ=o(function(e,t){console.warn((t?t+": ":"")+e)},"emitWarning"),bZ=o(function(e){Jv("binding")},"binding"),_Z=o(function(e){return 0},"umask"),EZ=o(function(){return"/"},"cwd"),SZ=o(function(e){},"chdir"),AZ={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};function Qr(){}o(Qr,"noop");var RZ=Qr,TZ=[];function xZ(e){Jv("_linkedBinding")}o(xZ,"_linkedBinding");var OZ={},IZ=!1,PZ={};function FZ(e){Jv("dlopen")}o(FZ,"dlopen");function kZ(){return[]}o(kZ,"_getActiveRequests");function BZ(){return[]}o(BZ,"_getActiveHandles");var CZ=Qr,LZ=Qr,Qv=o(function(){return{}},"cpuUsage"),NZ=Qv,DZ=Qv,$Z=Qr,UZ=Qr,MZ=Qr,jZ={};function WZ(e,t){if(!e)throw new Error(t||"assertion error")}o(WZ,"assert");var qZ={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},HZ=Qr,zZ=Qr;function VZ(){return!1}o(VZ,"hasUncaughtExceptionCaptureCallback");var GZ=Qr,KZ=Qr,YZ=Qr,ZZ=Qr,XZ=Qr,JZ=void 0,QZ=void 0,eX=void 0,tX=Qr,rX=2,nX=1,iX="/bin/usr/node",oX=9229,aX="node",sX=[],lX=Qr,Ya={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Ya.now===void 0&&(Kv=Date.now(),Ya.timing&&Ya.timing.navigationStart&&(Kv=Ya.timing.navigationStart),Ya.now=()=>Date.now()-Kv);var Kv;function fX(){return Ya.now()/1e3}o(fX,"uptime");var Zv=1e9;function Xv(e){var t=Math.floor((Date.now()-Ya.now())*.001),r=Ya.now()*.001,n=Math.floor(r)+t,a=Math.floor(r%1*1e9);return e&&(n=n-e[0],a=a-e[1],a<0&&(n--,a+=Zv)),[n,a]}o(Xv,"hrtime");Xv.bigint=function(e){var t=Xv(e);return typeof BigInt>"u"?t[0]*Zv+t[1]:BigInt(t[0]*Zv)+BigInt(t[1])};var uX=10,cX={},hX=0;function Za(){return II}o(Za,"on");var dX=Za,pX=Za,yX=Za,mX=Za,gX=Za,wX=Qr,vX=Za,bX=Za;function _X(e){return[]}o(_X,"listeners");var II={version:gZ,versions:wZ,arch:hZ,platform:dZ,release:AZ,_rawDebug:RZ,moduleLoadList:TZ,binding:bZ,_linkedBinding:xZ,_events:cX,_eventsCount:hX,_maxListeners:uX,on:Za,addListener:dX,once:pX,off:yX,removeListener:mX,removeAllListeners:gX,emit:wX,prependListener:vX,prependOnceListener:bX,listeners:_X,domain:OZ,_exiting:IZ,config:PZ,dlopen:FZ,uptime:fX,_getActiveRequests:kZ,_getActiveHandles:BZ,reallyExit:CZ,_kill:LZ,cpuUsage:Qv,resourceUsage:NZ,memoryUsage:DZ,kill:$Z,exit:UZ,openStdin:MZ,allowedNodeEnvironmentFlags:jZ,assert:WZ,features:qZ,_fatalExceptions:HZ,setUncaughtExceptionCaptureCallback:zZ,hasUncaughtExceptionCaptureCallback:VZ,emitWarning:vZ,nextTick:uZ,_tickCallback:GZ,_debugProcess:KZ,_debugEnd:YZ,_startProfilerIdleNotifier:ZZ,_stopProfilerIdleNotifier:XZ,stdout:JZ,stdin:eX,stderr:QZ,abort:tX,umask:_Z,chdir:SZ,cwd:EZ,env:pZ,title:cZ,argv:yZ,execArgv:mZ,pid:rX,ppid:nX,execPath:iX,debugPort:oX,hrtime:Xv,argv0:aX,_preload_modules:sX,setSourceMapsEnabled:lX},Yv={},TI=!1;function EX(){if(TI)return Yv;TI=!0;var e=II;function t(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}o(t,"assertPath");function r(s,i){for(var u="",h=0,c=-1,d=0,y,m=0;m<=s.length;++m){if(m<s.length)y=s.charCodeAt(m);else{if(y===47)break;y=47}if(y===47){if(!(c===m-1||d===1))if(c!==m-1&&d===2){if(u.length<2||h!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var g=u.lastIndexOf("/");if(g!==u.length-1){g===-1?(u="",h=0):(u=u.slice(0,g),h=u.length-1-u.lastIndexOf("/")),c=m,d=0;continue}}else if(u.length===2||u.length===1){u="",h=0,c=m,d=0;continue}}i&&(u.length>0?u+="/..":u="..",h=2)}else u.length>0?u+="/"+s.slice(c+1,m):u=s.slice(c+1,m),h=m-c-1;c=m,d=0}else y===46&&d!==-1?++d:d=-1}return u}o(r,"normalizeStringPosix");function n(s,i){var u=i.dir||i.root,h=i.base||(i.name||"")+(i.ext||"");return u?u===i.root?u+h:u+s+h:h}o(n,"_format");var a={resolve:o(function(){for(var i="",u=!1,h,c=arguments.length-1;c>=-1&&!u;c--){var d;c>=0?d=arguments[c]:(h===void 0&&(h=e.cwd()),d=h),t(d),d.length!==0&&(i=d+"/"+i,u=d.charCodeAt(0)===47)}return i=r(i,!u),u?i.length>0?"/"+i:"/":i.length>0?i:"."},"resolve2"),normalize:o(function(i){if(t(i),i.length===0)return".";var u=i.charCodeAt(0)===47,h=i.charCodeAt(i.length-1)===47;return i=r(i,!u),i.length===0&&!u&&(i="."),i.length>0&&h&&(i+="/"),u?"/"+i:i},"normalize2"),isAbsolute:o(function(i){return t(i),i.length>0&&i.charCodeAt(0)===47},"isAbsolute2"),join:o(function(){if(arguments.length===0)return".";for(var i,u=0;u<arguments.length;++u){var h=arguments[u];t(h),h.length>0&&(i===void 0?i=h:i+="/"+h)}return i===void 0?".":a.normalize(i)},"join2"),relative:o(function(i,u){if(t(i),t(u),i===u||(i=a.resolve(i),u=a.resolve(u),i===u))return"";for(var h=1;h<i.length&&i.charCodeAt(h)===47;++h);for(var c=i.length,d=c-h,y=1;y<u.length&&u.charCodeAt(y)===47;++y);for(var m=u.length,g=m-y,v=d<g?d:g,_=-1,b=0;b<=v;++b){if(b===v){if(g>v){if(u.charCodeAt(y+b)===47)return u.slice(y+b+1);if(b===0)return u.slice(y+b)}else d>v&&(i.charCodeAt(h+b)===47?_=b:b===0&&(_=0));break}var E=i.charCodeAt(h+b),S=u.charCodeAt(y+b);if(E!==S)break;E===47&&(_=b)}var T="";for(b=h+_+1;b<=c;++b)(b===c||i.charCodeAt(b)===47)&&(T.length===0?T+="..":T+="/..");return T.length>0?T+u.slice(y+_):(y+=_,u.charCodeAt(y)===47&&++y,u.slice(y))},"relative2"),_makeLong:o(function(i){return i},"_makeLong2"),dirname:o(function(i){if(t(i),i.length===0)return".";for(var u=i.charCodeAt(0),h=u===47,c=-1,d=!0,y=i.length-1;y>=1;--y)if(u=i.charCodeAt(y),u===47){if(!d){c=y;break}}else d=!1;return c===-1?h?"/":".":h&&c===1?"//":i.slice(0,c)},"dirname2"),basename:o(function(i,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');t(i);var h=0,c=-1,d=!0,y;if(u!==void 0&&u.length>0&&u.length<=i.length){if(u.length===i.length&&u===i)return"";var m=u.length-1,g=-1;for(y=i.length-1;y>=0;--y){var v=i.charCodeAt(y);if(v===47){if(!d){h=y+1;break}}else g===-1&&(d=!1,g=y+1),m>=0&&(v===u.charCodeAt(m)?--m===-1&&(c=y):(m=-1,c=g))}return h===c?c=g:c===-1&&(c=i.length),i.slice(h,c)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!d){h=y+1;break}}else c===-1&&(d=!1,c=y+1);return c===-1?"":i.slice(h,c)}},"basename2"),extname:o(function(i){t(i);for(var u=-1,h=0,c=-1,d=!0,y=0,m=i.length-1;m>=0;--m){var g=i.charCodeAt(m);if(g===47){if(!d){h=m+1;break}continue}c===-1&&(d=!1,c=m+1),g===46?u===-1?u=m:y!==1&&(y=1):u!==-1&&(y=-1)}return u===-1||c===-1||y===0||y===1&&u===c-1&&u===h+1?"":i.slice(u,c)},"extname2"),format:o(function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return n("/",i)},"format2"),parse:o(function(i){t(i);var u={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return u;var h=i.charCodeAt(0),c=h===47,d;c?(u.root="/",d=1):d=0;for(var y=-1,m=0,g=-1,v=!0,_=i.length-1,b=0;_>=d;--_){if(h=i.charCodeAt(_),h===47){if(!v){m=_+1;break}continue}g===-1&&(v=!1,g=_+1),h===46?y===-1?y=_:b!==1&&(b=1):y!==-1&&(b=-1)}return y===-1||g===-1||b===0||b===1&&y===g-1&&y===m+1?g!==-1&&(m===0&&c?u.base=u.name=i.slice(1,g):u.base=u.name=i.slice(m,g)):(m===0&&c?(u.name=i.slice(1,y),u.base=i.slice(1,g)):(u.name=i.slice(m,y),u.base=i.slice(m,g)),u.ext=i.slice(y,g)),m>0?u.dir=i.slice(0,m-1):c&&(u.dir="/"),u},"parse2"),sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,Yv=a,Yv}o(EX,"dew");var pn=EX(),dPe=pn._makeLong,pPe=pn.basename,yPe=pn.delimiter,Gr=pn.dirname,mPe=pn.extname,gPe=pn.format,wPe=pn.isAbsolute,PI=pn.join,vPe=pn.normalize,bPe=pn.parse,_Pe=pn.posix,EPe=pn.relative,SPe=pn.resolve,APe=pn.sep,RPe=pn.win32;var gm=Lt(Lh(),1);var aL=Lt(Xp(),1);var aE=class aE extends Jr{constructor({name:r,rootPath:n,ephemeralPatterns:a}){super({name:r,rootPath:n});Ye(this,"openFh",new Map);Ye(this,"memFs",(0,gm.createFsFromVolume)(new gm.Volume));Ye(this,"ig");Ye(this,"patterns");this.ig=(0,aL.default)(),this.ig.add(a),this.patterns=a}normalizePath(r){let n=typeof r=="string"?r:r.toString();return n.startsWith("/")?n:"/"+n}async responsible(r){let n=r.replace(/\\/g,"/"),a=n;return this.rootPath&&(n.startsWith(this.rootPath+"/")?a=n.slice(this.rootPath.length+1):n.startsWith(this.rootPath)&&(a=n.slice(this.rootPath.length))),a=a.startsWith("./")?a.slice(2):a,a=a.startsWith("/")?a.slice(1):a,a===""||a==="."?!1:this.ig.ignores(a)}fileType(){return 5}async open(r,n,a){let s=this.normalizePath(r),i=Gr(s);i&&i!=="/"&&i!=="."&&await this.memFs.promises.mkdir(i,{recursive:!0});let u=await this.memFs.promises.open(s,n,a);return this.openFh.set(u.fd,u),new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:u.fd,parentFsFileDescriptors:[u.fd]})}async access(r,n){let a=this.normalizePath(r);return await this.memFs.promises.access(a,n)}async stat(r,n){let a=this.normalizePath(r);return this.memFs.promises.stat(a,{bigint:!1})}async lstat(r,n){let a=this.normalizePath(r);return this.memFs.promises.lstat(a,{bigint:!1})}async opendir(r,n){let a=this.normalizePath(r);return await this.memFs.promises.opendir(a,n)}async link(r,n){let a=this.normalizePath(r),s=this.normalizePath(n);return await this.memFs.promises.link(a,s)}async mkdir(r,n){let a=this.normalizePath(r);if(!(typeof n=="object"&&n&&"recursive"in n&&n.recursive)){let i=Gr(a);if(i&&i!=="/"&&i!==".")try{await this.memFs.promises.stat(i)}catch{await this.memFs.promises.mkdir(i,{recursive:!0})}}await this.memFs.promises.mkdir(a,n)}async readdir(r,...n){let a=this.normalizePath(r),s=await this.memFs.promises.readdir(a,...n);return console.log("EPHEMERAL: READDIR: ",s),s}async readlink(r){throw new Error("readlink is not implemented for EphemeralFileSubFs")}async unlink(r){let n=this.normalizePath(r);return await this.memFs.promises.unlink(n)}async rename(r,n){let a=this.normalizePath(r),s=this.normalizePath(n);return await this.memFs.promises.rename(a,s)}async rmdir(r,n){let a=this.normalizePath(r);return await this.memFs.promises.rmdir(a,n)}async symlink(r,n,a){let s=this.normalizePath(r),i=this.normalizePath(n);return await this.memFs.promises.symlink(s,i,a)}async lookup(r){throw new Error(`lookup is not implemented for: ${Wt(r)}`)}async close(r){let n=this.openFh.get(r.subFsFileDescriptor);n&&(await n.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.datasync()}async read(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.read(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.chmod(n)}async fchown(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.chown(n,a)}async write(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.write(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.truncate(n)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.stat(n);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.utimes(n,a)}async writev(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.writev(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.readv(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,n){if(typeof r=="string"||Buffer.isBuffer(r)){let a=this.normalizePath(r);return this.memFs.promises.readFile(a,n)}return super.readFile(r,n)}async writeFile(r,n,a){let s=this.normalizePath(r),i=Gr(s);return i&&i!=="/"&&i!=="."&&await this.memFs.promises.mkdir(i,{recursive:!0}),this.memFs.promises.writeFile(s,n,a)}};o(aE,"EphemeralSubFs");var oL=aE;var sL=Lt(Xp(),1);var sE=class sE extends Jr{constructor({name:r,sourceFs:n,copyToFs:a,copyToRootPath:s,rootPath:i,patterns:u}){super({rootPath:i,name:r});Ye(this,"openFh",new Map);Ye(this,"sourceFs");Ye(this,"copyToFs");Ye(this,"copyPath");Ye(this,"ig");Ye(this,"patterns");this.sourceFs=n,this.copyToFs=a,this.copyPath=s,this.patterns=u,this.ig=(0,sL.default)(),this.ig.add(u)}normalizeCopyPath(r){let n=typeof r=="string"?r:r.toString(),a=n.startsWith("/")?n:"/"+n;return PI(this.copyPath,a)}normalizePath(r){let n=typeof r=="string"?r:r.toString();return n.startsWith("/")?n:"/"+n}async responsible(r){let n=r.replace(/\\/g,"/"),a=n;if(this.compositeFs.rootPath){let s=this.compositeFs.rootPath;n.startsWith(s+"/")?a=n.slice(s.length+1):n.startsWith(s)&&(a=n.slice(s.length))}return a=a.startsWith("./")?a.slice(2):a,a=a.startsWith("/")?a.slice(1):a,a===""||a==="."?!1:this.ig.ignores(a)}fileType(){return 6}async isCopied(r){let n=this.normalizeCopyPath(r);try{return await this.copyToFs.promises.access(n),!0}catch{return!1}}async copyFromSource(r){let n=this.normalizeCopyPath(r),a=this.normalizePath(r),s=Gr(n);s&&s!=="/"&&s!=="."&&await this.copyToFs.promises.mkdir(s,{recursive:!0});try{let i=await this.sourceFs.promises.readFile(a);await this.copyToFs.promises.writeFile(n,i)}catch(i){if(i.code!=="ENOENT")throw i}}async open(r,n,a){let s=this.normalizePath(r),i=this.normalizeCopyPath(r);if(n.includes("w")||n.includes("a")||n.includes("+")){let h=Gr(i);if(h&&h!=="/"&&h!=="."&&await this.copyToFs.promises.mkdir(h,{recursive:!0}),!await this.isCopied(r))try{await this.sourceFs.promises.access(s),await this.copyFromSource(r)}catch{}let d=await this.copyToFs.promises.open(i,n,a);return this.openFh.set(d.fd,d),new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:d.fd,parentFsFileDescriptors:[d.fd]})}else{let h=await this.isCopied(r),c=h?this.copyToFs:this.sourceFs,d=h?i:s,y=await c.promises.open(d,n,a);return this.openFh.set(y.fd,y),new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:y.fd,parentFsFileDescriptors:[y.fd]})}}async access(r,n){let a=this.normalizePath(r),s=this.normalizeCopyPath(r);try{await this.copyToFs.promises.access(s,n);return}catch{return await this.sourceFs.promises.access(a,n)}}async stat(r,n){let a=this.normalizePath(r),s=this.normalizeCopyPath(r);try{return await this.copyToFs.promises.stat(s,{bigint:n?.bigint??!1})}catch{return this.sourceFs.promises.stat(a,{bigint:n?.bigint??!1})}}async lstat(r,n){let a=this.normalizePath(r),s=this.normalizeCopyPath(r);try{return await this.copyToFs.promises.lstat(s,{bigint:n?.bigint??!1})}catch{return this.sourceFs.promises.lstat(a,{bigint:n?.bigint??!1})}}async opendir(r,n){let a=this.normalizePath(r);return new Ka(this.compositeFs,a)}async link(r,n){let a=this.normalizeCopyPath(r),s=this.normalizeCopyPath(n);return await this.copyToFs.promises.link(a,s)}async mkdir(r,n){let a=this.normalizeCopyPath(r);if(!(typeof n=="object"&&n&&"recursive"in n&&n.recursive)){let i=Gr(a);if(i&&i!=="/"&&i!==".")try{await this.copyToFs.promises.stat(i)}catch{await this.copyToFs.promises.mkdir(i,{recursive:!0})}}await this.copyToFs.promises.mkdir(a,n)}async readdir(r,...n){let a=this.normalizePath(r),s=this.normalizeCopyPath(r),i=new Set,u=new Set;try{let c=await this.sourceFs.promises.readdir(a,...n);Array.isArray(c)&&c.forEach(d=>i.add(typeof d=="string"?d:d.name))}catch(c){if(c.code!=="ENOENT")throw c}try{let c=await this.copyToFs.promises.readdir(s,...n);Array.isArray(c)&&c.forEach(d=>u.add(typeof d=="string"?d:d.name))}catch(c){if(c.code!=="ENOENT")throw c}return Array.from(new Set([...i,...u]))}async readlink(r){throw new Error("readlink is not implemented for CopyOnWriteSubFs")}async unlink(r){let n=this.normalizeCopyPath(r);return await this.copyToFs.promises.unlink(n)}async rename(r,n){let a=this.normalizeCopyPath(r),s=this.normalizeCopyPath(n);return await this.copyToFs.promises.rename(a,s)}async rmdir(r,n){let a=this.normalizeCopyPath(r);return await this.copyToFs.promises.rmdir(a,n)}async symlink(r,n,a){let s=this.normalizeCopyPath(r),i=this.normalizeCopyPath(n);return await this.copyToFs.promises.symlink(s,i,a)}async lookup(r){throw new Error(`lookup is not implemented for: ${Wt(r)}`)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async close(r){let n=this.openFh.get(r.subFsFileDescriptor);n&&(await n.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.datasync()}async read(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.read(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.chmod(n)}async fchown(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.chown(n,a)}async write(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.write(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.truncate(n)}async fstat(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.stat(n);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.utimes(n,a)}async writev(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.writev(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.readv(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,n){if(typeof r!="string"&&!Buffer.isBuffer(r))return super.readFile(r,n);let a=this.normalizePath(r),s=this.normalizeCopyPath(r);try{return await this.copyToFs.promises.readFile(s,n)}catch{return this.sourceFs.promises.readFile(a,n)}}async writeFile(r,n,a){let s=this.normalizeCopyPath(r);await this.isCopied(r)||await this.copyFromSource(r);let u=Gr(s);u&&u!=="/"&&u!=="."&&await this.copyToFs.promises.mkdir(u,{recursive:!0}),await this.copyToFs.promises.writeFile(s,n,a)}};o(sE,"CopyOnWriteSubFs");var Nh=sE;var yA=Lt(Or(),1);var Jg=Lt(Lh(),1);function bn(e){return{name:e.name,isFile:o(()=>!e.isDir,"isFile"),isDirectory:o(()=>e.isDir,"isDirectory"),isBlockDevice:o(()=>!0,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isFIFO:o(()=>!1,"isFIFO"),isSocket:o(()=>!1,"isSocket"),parentPath:e.parent,path:e.parent}}o(bn,"toDirEntry");var mA=class mA extends Jr{constructor({name:r,gitStorageFs:n,gitRoot:a,handler:s,rootPath:i}){super({name:r,rootPath:i});Ye(this,"memFs");Ye(this,"openFh",{});Ye(this,"storageFs");Ye(this,"gitRoot");Ye(this,"handler");this.handler=s,this.gitRoot=a,this.storageFs=n,this.memFs=(0,Jg.createFsFromVolume)(new Jg.Volume)}async getAuthor(){if(this.storageFs===void 0||this.storageFs===null)return{};let r=await yA.default.getConfig({fs:this.storageFs,dir:this.gitRoot,path:"user.name"}),n=await yA.default.getConfig({fs:this.storageFs,dir:this.gitRoot,path:"user.email"}),a=Math.floor(Date.now()/1e3),s=new Date().getTimezoneOffset();return{name:r,email:n,date:a,timezoneOffset:s}}async responsible(r){return!0}getRouteParams(){return this.context?.params||{}}getStaticSiblings(){return this.context?.staticSiblings||[]}async open(r,n,a){if(!(this.handler.writeFile!==void 0)&&(n.includes("w")||n.includes("a")))throw new Error(`Write operations not allowed for ${this.handler.type}`);if(n.includes("x")&&this.handler.type!=="gitBranchFileVirtualFile"&&this.handler.type!=="claudeVirtualSessionFileVirtualFile")throw new Error(`Exclusive operations not allowed for ${this.handler.type}`);let i=await this.getAuthor(),u=this.getRouteParams(),h=await this.handler.getFile({cacheFs:this.memFs,filePath:r,userSpaceFs:this.compositeFs,pathParams:u,author:i}),c=!1;for(let v of Object.values(this.openFh))v.path===r&&(c=!0);if((h||c)&&n.includes("x"))throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r});if(!h&&!c&&!(n.includes("w")||n.includes("a")))throw Object.assign(new Error(`ENOENT: no such file or directory, open '${r}'`),{code:"ENOENT",errno:-2,syscall:"open",path:r});let d=Gr(r);if(await this.memFs.promises.mkdir(d,{recursive:!0}),h===void 0&&!n.includes("x")||h&&h.type==="file")try{let v=await this.memFs.promises.access(r)}catch{await this.memFs.promises.writeFile(r,"")}let y=await this.memFs.promises.open(r,n,a),m=y.fd,g=new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:m,parentFsFileDescriptors:[]});return this.openFh[m]={path:r,mode:n,fh:y,openSha:h?.oid,readSha:void 0,unflushed:[]},(n.includes("x")||n.includes("w"))&&this.openFh[m].unflushed.push({length:0,start:0}),g}async mkdir(r,n){let a=r.toString(),s=this.getRouteParams(),i=n?{options:n}:{};try{let u=await this.getAuthor();await this.handler.mkdir({cacheFs:this.memFs,filePath:r.toString(),userSpaceFs:this.compositeFs,pathParams:s,...i,author:u});let h=typeof n=="object"?{...n,recursive:!0}:{recursive:!0};await this.memFs.promises.mkdir(r,h);let c=a.split("/"),d="";for(let y=1;y<=c.length;y++){d=c.slice(0,y).join("/");try{if((await this.memFs.promises.stat(d)).isDirectory()){let g=await this.memFs.promises.open(d,"r");this.openFh[g.fd]={path:d,mode:"r",fh:g,openSha:void 0,readSha:void 0,unflushed:[]}}}catch{}}}catch(u){throw u}}async access(r,n){await this.stat(r)}async futimes(r,n,a){let s=this.openFh[r.subFsFileDescriptor];if(!s)throw new Error("Invalid file handle");return await s.fh.utimes(n,a)}async fstat(r,n){let a=this.openFh[r.subFsFileDescriptor];if(!a)throw new Error("Invalid file handle");return this.stat(a.path,n)}async ftruncate(r,n){let a=this.openFh[r.subFsFileDescriptor];if(!a)throw new Error("Invalid file handle");return a.unflushed.push({length:0,start:0}),await a.fh.truncate(n)}async stat(r,n){let a=r.toString(),s=Object.values(this.openFh).find(c=>c.path===a&&c.unflushed.length>0);if(s&&s.unflushed.length>0)return await s.fh.stat(n);let i=this.getRouteParams(),u=await this.getAuthor();return await this.handler.getStats({cacheFs:this.memFs,filePath:a,userSpaceFs:this.compositeFs,pathParams:i,author:u})}async lstat(r,n){return this.stat(r,n)}async readdir(r,n){let a=r.toString(),s=this.getRouteParams(),i=this.getStaticSiblings(),u=await this.getAuthor(),h=await this.handler.getFile({cacheFs:this.memFs,filePath:a,userSpaceFs:this.compositeFs,pathParams:s,author:u});if(h){if(h.type!=="directory")throw new Error("not a folder");let c=Array.from(new Set([...h.content,...i.map(d=>bn({name:d.segment,parent:a,isDir:d.type==="folder"}))])).sort((d,y)=>d.name.localeCompare(y.name,void 0,{numeric:!0,sensitivity:"base"}));return n?.withFileTypes?c:c.map(d=>d.name)}return[]}async read(r,n,a,s,i){let u=r.subFsFileDescriptor,h=this.openFh[u];if(!h)throw new Error("Invalid file handle");if(h.unflushed.length===0){let c=this.getRouteParams(),d=await this.getAuthor(),y=await this.handler.getFile({cacheFs:this.memFs,filePath:h.path,userSpaceFs:this.compositeFs,pathParams:c,author:d});if(!y?.content)throw new Error("couldnt access content");if(y.type!=="file")throw new Error("not a file");let m=typeof y.content=="string"?Buffer.from(y.content):y.content,g=typeof i=="number"?i:0,v=Math.min(g+s,m.length),_=Math.max(0,v-g);return m.copy(n,a,g,g+_),{bytesRead:_,buffer:n}}return await h.fh.read(n,a,s,i)}async write(r,n,a,s,i){let u=this.openFh[r.subFsFileDescriptor];if(!u)throw new Error("Invalid file handle");let h=u.mode;if(!h.includes("w")&&!h.includes("a")&&!h.includes("+"))throw Object.assign(new Error("EBADF: bad file descriptor, write"),{code:"EBADF",errno:-9,syscall:"write"});if(u.unflushed.length===0){let m=this.getRouteParams(),g=await this.getAuthor(),v=await this.handler.getFile({cacheFs:this.memFs,filePath:u.path,userSpaceFs:this.compositeFs,pathParams:m,author:g});v&&v.oid&&(await this.memFs.promises.writeFile(u.path,v.content),u.readSha=v.oid)}let c=await u.fh.write(n,a,s,i),d=a??0,y=i??0;return u.unflushed.push({start:y,length:s||n.byteLength-d+y}),c}async close(r){let n=r.subFsFileDescriptor,a=this.openFh[n];if(!a)throw new Error("Invalid file handle");try{await this.dataSync(r),await a.fh.close()}finally{delete this.openFh[n]}}async dataSync(r){let n=r.subFsFileDescriptor,a=this.openFh[n];if(!a)throw new Error("Invalid file handle");if(a.unflushed.length>0){if(this.handler.writeFile){let s=await this.memFs.promises.readFile(a.path),i=this.getRouteParams(),u=await this.getAuthor();await this.handler.writeFile({cacheFs:this.memFs,filePath:a.path,userSpaceFs:this.compositeFs,content:s,pathParams:i,author:u})}a.unflushed=[]}}async readFile(r,n){let a=typeof r=="string"?r:Buffer.isBuffer(r)?r.toString():r.fd?`FileHandle(${r.fd})`:r.toString(),s=null;typeof n=="string"?s=n:n&&typeof n=="object"&&n.encoding&&(s=n.encoding);let i=await this.open(a,"r");try{let h=(await this.fstat(i)).size,c=Buffer.alloc(h);return await this.read(i,c,0,h,0),await this.close(i),s?c.toString(s):c}catch(u){try{await this.close(i)}catch{}throw u}}async writeFile(r,n,a){let s="w",i="utf8",u;typeof a=="string"?i=a:a&&typeof a=="object"&&(a.flag&&(s=String(a.flag)),a.encoding&&(i=a.encoding),a.mode&&(u=typeof a.mode=="string"?parseInt(a.mode,8):a.mode));let h=await this.open(r,s,u);try{let c;typeof n=="string"?c=Buffer.from(n,i):Buffer.isBuffer(n)?c=n:n instanceof Uint8Array?c=Buffer.from(n):ArrayBuffer.isView(n)?c=Buffer.from(n.buffer,n.byteOffset,n.byteLength):c=Buffer.from(n),await this.write(h,c,0,c.length,0)}finally{await this.close(h)}}async rename(r,n){let a=r.toString(),s=n.toString();if(!this.handler.rename)throw new Error(`Rename not supported for ${this.handler.type} files`);let i=await this.memFs.promises.access(s).then(()=>!0).catch(()=>!1),u=await this.stat(s).then(()=>!0).catch(()=>!1),h=await this.stat(a).then(()=>!0).catch(()=>!1);if(await this.memFs.promises.access(a).then(()=>!0).catch(()=>!1)){let m=Gr(s);try{await this.memFs.promises.access(m)}catch{await this.memFs.promises.mkdir(m,{recursive:!0})}await this.memFs.promises.rename(r,n)}let d=this.getRouteParams(),y=await this.getAuthor();await this.handler.rename({cacheFs:this.memFs,filePath:a,userSpaceFs:this.compositeFs,newPath:s,pathParams:d,newPathParams:this.newContext?.params||{},author:y})}async fchmod(r,n){}async unlink(r){let n=r.toString();if(!this.handler.unlink)throw new Error(`Cannot unlink ${this.handler.type} files`);try{let a=this.getRouteParams(),s=await this.getAuthor();await this.handler.unlink({cacheFs:this.memFs,filePath:n,userSpaceFs:this.compositeFs,pathParams:a,author:s})}catch(a){let s=!1;for(let[i,u]of Object.entries(this.openFh))u.path===n&&u.unflushed.length>0&&(s=!0);if(!s)throw a}finally{let a=!1;for(let[s,i]of Object.entries(this.openFh))i.path===n&&(a=!0,await i.fh.close(),delete this.openFh[Number(s)]);a&&await this.memFs.promises.unlink(n)}}async rmdir(r,...n){let a=r.toString();if(!this.handler.rmdir)throw new Error(`Cannot rmdir ${this.handler.type} directories`);let s=this.getRouteParams(),i=await this.getAuthor();await this.handler.rmdir({cacheFs:this.memFs,filePath:a,userSpaceFs:this.compositeFs,pathParams:s,author:i});let u=!1;for(let[h,c]of Object.entries(this.openFh))c.path===a&&(u=!0,await c.fh.close(),delete this.openFh[Number(h)]);u&&await this.memFs.promises.rmdir(a,{recursive:!0})}fileType(){return 10}};o(mA,"CompositeSubFsAdapter");var It=mA;function XU({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"legit-virtual-file",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"legitVirtualFile",rootType:"folder",getStats:o(async a=>{let s=t+"/.git";try{return await e.promises.stat(s)}catch{throw new Error(`ENOENT: no such file or directory, stat '${s}'`)}},"getStats"),getFile:o(async a=>({type:"directory",content:[],mode:493,size:0}),"getFile"),rename(a){throw new Error("not implemented")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(XU,"createLegitVirtualFileAdapter");var ew=Lt(Or(),1);var JU=Lt(Or(),1);function yo(e){return e.replace(/\./g,"%2E").replace(/\//g,".")}o(yo,"encodeBranchNameForVfs");function Ht(e){return e.replace(/\./g,"/").replace(/%2E/g,".")}o(Ht,"decodeBranchNameFromVfs");var gA="-operation";async function Vi(e,t,r){let a=(await JU.default.listBranches({fs:e,dir:t})).filter(s=>s.endsWith(Ht(r)+gA))[0];return a?yo(a):void 0}o(Vi,"resolveOperationBranchName");var Qg=Lt(Or(),1);async function Et(e,t){try{let r=await Qg.default.getConfig({fs:t,dir:e,path:"user.legit-current-branch"});if(r)return yo(r)}catch{}try{let r=await Qg.default.getConfig({fs:t,dir:e,path:"init.defaultBranch"});return yo(r)||"main"}catch{return"main"}}o(Et,"getCurrentBranch");async function QU(e,t,r){await Qg.default.setConfig({fs:t,dir:e,path:"user.legit-current-branch",value:Ht(r)})}o(QU,"setCurrentBranch");var mo=Lt(Or(),1);async function it(e,t,r){try{return await mo.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${Ht(r)}`})}catch{return}}o(it,"tryResolveRef");async function ca({dir:e,fs:t,treeOid:r,deletePathParts:n,addPathParts:a,addObj:s,addKeepIfEmpty:i,deleteKeepIfNotEmpty:u,keepFilename:h=".keep",gitCache:c}){let[d,...y]=a??[],[m,...g]=n??[],v=[];if(r){let{tree:_}=await mo.default.readTree({fs:t,dir:e,oid:r,cache:c||{}});v=[..._]}if(d===m){let _=d;if(_===void 0)throw new Error("illegal arguement - called with out a path part");if(y.length===0)throw new Error("can not move into it self");if(g.length===0)throw new Error("can not move from it self");let b=v.findIndex(A=>A.path===_),S=(b!==-1?v[b]:void 0)?.oid,T=await ca({dir:e,fs:t,treeOid:S,addPathParts:y,deletePathParts:g,addObj:s,addKeepIfEmpty:i,deleteKeepIfNotEmpty:u});if(T===void 0)throw new Error("on the same path we expect an update - respectivly a newly created subTreeOid");let x=!1;if(T!==S){x=!0;let A={mode:"040000",path:_,oid:T,type:"tree"};b!==-1?v[b]=A:v.push(A)}if(r==null&&!x)throw new Error("Illegal state - if the currentOid is undefined - a new tree should have been created (an update should have happened)");if(x)return await mo.default.writeTree({fs:t,dir:e,tree:v});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}else{let _=!1,b;if(m){let E=v.findIndex(T=>T.path===m),S=E!==-1?v[E]:void 0;if(S===void 0)throw new Error("Element doesnt exist in tree");if(g.length>0){if(S&&S.type!=="tree")throw new Error("SubPart of the path for the obj to delete is not a tree");let T=await ca({dir:e,fs:t,treeOid:S.oid,addPathParts:void 0,deletePathParts:g,addObj:s,addKeepIfEmpty:i,deleteKeepIfNotEmpty:u});if(T===S.oid)throw new Error("in case of a delete we expect a different subtree oid");_=!0,T===void 0?v.splice(E,1):v[E]={mode:"040000",path:m,oid:T,type:"tree"}}else if(_=!0,v.splice(E,1),v.length===0&&i){let T=new Uint8Array(0),x=await mo.default.writeBlob({fs:t,dir:e,blob:T});v.push({mode:"100644",oid:x,path:h,type:"blob"})}b=S}if(d){let E=v.findIndex(T=>T.path===d),S=E!==-1?v[E]:void 0;if(y.length>0){if(S&&S.type!=="tree")throw new Error("SubPart of the path for the obj to add is not a tree");let T=await ca({dir:e,fs:t,treeOid:S?.oid,addPathParts:y,deletePathParts:void 0,addObj:s,addKeepIfEmpty:i,deleteKeepIfNotEmpty:u});if(T===void 0)throw new Error("in case we add, we expect an update - respectivly a newly created subTreeOid");if(T!==S?.oid){_=!0;let x={mode:"040000",path:d,oid:T,type:"tree"};if(E!==-1)v[E]=x;else if(v.push(x),u&&v.length>1){let A=v.findIndex(B=>B.path===h);A!==-1&&v.splice(A,1)}}}else{if(_=!0,s){let T={mode:s.type==="tree"?"040000":"100644",path:d,oid:s.oid,type:s.type};if(E!==-1)v[E]=T;else{if(u&&v.length>0){let x=v.findIndex(A=>A.path===h);x!==-1&&v.splice(x,1)}v.push(T)}}if(i&&v.length===0){let T=new Uint8Array(0),x=await mo.default.writeBlob({fs:t,dir:e,blob:T});v.push({mode:"100644",oid:x,path:h,type:"blob"})}}}if(v.length===0)return;if(_)return await mo.default.writeTree({fs:t,dir:e,tree:v});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}}o(ca,"buildUpdatedTree");async function eM(e,t,r,n,a=0,s={}){let{tree:i}=await mo.default.readTree({fs:e,dir:t,oid:r,cache:s});if(n.length===a)return{type:"tree",entries:i.map(c=>bn({parent:n.join("/"),name:c.path,isDir:c.type==="tree"})),oid:r};let u=n[a],h=i.find(c=>c.path===u);if(h){if(n.length===a+1){if(h.type==="blob")return{type:"blob",oid:h.oid};if(h.type==="tree"){let c=await mo.default.readTree({fs:e,dir:t,oid:h.oid,cache:s});return{type:"tree",entries:c.tree.map(d=>bn({parent:n.join("/"),name:d.path,isDir:d.type==="tree"})),oid:c.oid}}}else if(h.type==="tree")return await eM(e,t,h.oid,n,a+1,s)}}o(eM,"findGitObjectAtPath");async function Nl({filePath:e,gitRoot:t,nodeFs:r,commitSha:n,pathParams:a,gitCache:s}){let i=s||{};if(!a.filePath){let c=await mo.default.readTree({fs:r,dir:t,oid:n,cache:i});return{type:"tree",entries:c.tree.map(y=>bn({parent:e,name:y.path,isDir:y.type==="tree"})),oid:c.oid}}let u=a.filePath?a.filePath.split("/"):[];return await eM(r,t,n,u,0,i)}o(Nl,"resolveGitObjAtPath");function tM({gitStorageFs:e,gitRoot:t,rootPath:r}){let n={type:"gitBranchOperationsVirtualFile",rootType:"file",getStats:o(async s=>{let{pathParams:i}=s;i.branchName===void 0&&(i.branchName=await Et(t,e));let u=await Vi(e,t,i.branchName),h=await ew.default.listBranches({fs:e,dir:t}),c,d=!1;if(u){if(c=await it(e,t,u),c===void 0)throw new Error(`Base Branch ${i.branchName} for operations does not exis`);d=c!==void 0}else if(c=await it(e,t,i.branchName),c===void 0)throw new Error(`Base Branch ${i.branchName} for operations does not exis`);let y=await ew.default.readCommit({fs:e,dir:t,oid:c}),{commit:m}=y,g=m.committer.timestamp*1e3;try{return{mode:420,size:(d?await a.handler.getFile(s):void 0)?.content?.length??0,atimeMs:g,mtimeMs:g,ctimeMs:g,birthtimeMs:g,atime:new Date(g),mtime:new Date(g),ctime:new Date(g),birthtime:new Date(g),isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:o(async s=>{let{pathParams:i}=s;i.branchName===void 0&&(i.branchName=await Et(t,e));let u=await Vi(e,t,i.branchName),h=[];if(u){let y=await it(e,t,u);if(y!==void 0){let m=!1,g=y;for(;g&&!m;){let v=await ew.default.readCommit({fs:e,dir:t,oid:g});h.push({oid:v.oid,parentOids:v.commit.parent,message:v.commit.message,originBranchOid:"unset"}),g=v.commit.parent&&v.commit.parent.length>0?v.commit.parent[0]:null,v.commit.parent.length===2&&v.commit.parent[0]===v.commit.parent[1]&&(m=!0)}}}let c;for(let y=h.length-1;y>=0;y--){let m=h[y];if(c===void 0){if(m.parentOids.length!==2&&m.parentOids[0]!==m.parentOids[1])throw new Error(`Operation commit ${m.oid} does not have two parents as expected`);c=m.parentOids[1]}m.parentOids.length===2&&(c=m.parentOids[1]),m.originBranchOid=c}let d=Buffer.from(JSON.stringify(h,null,2),"utf-8");return{type:"file",content:d,mode:420,size:d.length}},"getFile"),rename:o(async function(s){throw new Error("not implemented")},"rename"),mkdir:o(async function(s){throw new Error("not implemented")},"mkdir")},a=new It({name:"branch-operations",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:n});return a}o(tM,"createBranchOperationsAdapter");var En=Lt(Or(),1);var x9=Lt(x6(),1);function V_e(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}o(V_e,"fromValue");function G_e(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:V_e(e)}o(G_e,"getIterator");async function O9(e,t){let r=G_e(e);for(;;){let{value:n,done:a}=await r.next();if(n&&await t(n),a)break}r.return&&r.return()}o(O9,"forAwait");function K_e(e){let{PassThrough:t}=T9(),r=new t;return setTimeout(async()=>{await O9(e,n=>r.write(n)),r.end()},1),r}o(K_e,"asyncIteratorToStream");async function Y_e(e){let t=0,r=[];await O9(e,s=>{r.push(s),t+=s.byteLength});let n=new Uint8Array(t),a=0;for(let s of r)n.set(s,a),a+=s.byteLength;return n}o(Y_e,"collect");function Z_e(e){let t=Object.getOwnPropertyDescriptor(e,Symbol.asyncIterator);if(t&&t.enumerable)return e;let r=!1,n=[],a={};return e.on("data",s=>{n.push(s),a.resolve&&(a.resolve({value:n.shift(),done:!1}),a={})}),e.on("error",s=>{a.reject&&(a.reject(s),a={})}),e.on("end",()=>{r=!0,a.resolve&&(a.resolve({done:!0}),a={})}),{next(){return new Promise((s,i)=>{if(n.length===0&&r)return s({done:!0});if(n.length>0)return s({value:n.shift(),done:!1});n.length===0&&!r&&(a={resolve:s,reject:i})})},return(){e.removeAllListeners(),e.destroy&&e.destroy()},[Symbol.asyncIterator](){return this}}}o(Z_e,"fromNodeStream");async function X_e({onProgress:e,url:t,method:r="GET",headers:n={},agent:a,body:s}){return s&&Array.isArray(s)?s=Buffer.from(await Y_e(s)):s&&(s=K_e(s)),new Promise((i,u)=>{(0,x9.default)({url:t,method:r,headers:n,agent:a,body:s},(h,c)=>{if(h)return u(h);try{let d=Z_e(c);i({url:c.url,method:c.method,statusCode:c.statusCode,statusMessage:c.statusMessage,body:d,headers:c.headers})}catch(d){u(d)}})})}o(X_e,"request");var J_e={request:X_e},x0=J_e;var Ws="legit",I9=o(({fs:e,gitRepoPath:t,serverUrl:r="https://hub.legitcontrol.com",auth:n,anonymousBranch:a,authHeaderPrefix:s="Bearer "})=>{let i=!1;async function u(b){let E=await n.getMaxAccessTokenForBranch(b);if(!E)throw new Error(`No access token for branch ${b}`);await En.default.fetch({fs:e,http:x0,dir:t,singleBranch:!0,ref:`${b}`,remote:Ws,url:r,headers:{Authorization:`${s}${E}`}});let S=await En.default.resolveRef({fs:e,dir:t,ref:`${Ws}/${b}`});await En.default.writeRef({fs:e,dir:t,ref:`refs/heads/${b}`,value:S})}o(u,"loadBranch");let h=[];async function c(){let b=await n.getMaxAccessTokenForBranch("todo");await En.default.fetch({fs:e,http:x0,dir:t,remote:Ws,url:r,headers:{Authorization:`${s}${b}`}});let E=await En.default.listBranches({fs:e,dir:t});for(let S of E){if(S===a)continue;let T=`${Ws}/${S}`,x,A;try{x=await En.default.resolveRef({fs:e,dir:t,ref:S})}catch(B){console.log(`Could not resolve local ref ${S}:`,B)}try{A=await En.default.resolveRef({fs:e,dir:t,ref:T})}catch{A=void 0}if(x&&A){if(x!==A){let B=await En.default.findMergeBase({fs:e,dir:t,oids:[x,A]});if(B[0]!==x&&B[0]!==A){let P=await En.default.merge({fs:e,dir:t,ours:x,theirs:A,fastForwardOnly:!1,abortOnConflict:!1,author:{name:"Your Name",email:"your.email@example.com"},mergeDriver:o(async({branches:N,contents:L,path:C})=>{let[z,V,Q]=L;return console.log(`Merging ${N[0]} with ${N[1]}...`),console.log("merged:"),console.log(L),{cleanMerge:!0,mergedText:Q===void 0?V:Q}},"mergeDriver")});await En.default.writeRef({fs:e,dir:t,ref:`refs/heads/${S}`,value:P.oid,force:!0})}B[0]===x?(console.log(`branch ${S} differs - remote ahaed, not behind`),await En.default.writeRef({fs:e,dir:t,ref:`refs/heads/${S}`,value:A,force:!0})):B[0]===A?(console.log(`branch ${S} differs - local ahead, not behind`),h.push(S)):(console.log(`branch ${S} differs - both changed`),h.push(S))}}else x&&!A&&h.push(S)}}o(c,"pull");async function d(b){if((await n.getUser()).type!=="local")for(let E of b){let S=await n.getMaxAccessTokenForBranch(E);await En.default.push({fs:e,http:x0,dir:t,remote:Ws,url:r,ref:E,headers:{Authorization:`Bearer ${S}`}})}}o(d,"push");let y=Promise.resolve();async function m(b){y=y.then(()=>d(b)),await y}o(m,"sequentialPush");async function g(){await En.default.getConfig({fs:e,dir:t,path:`remote.${Ws}.fetch`})||await En.default.setConfig({fs:e,dir:t,path:`remote.${Ws}.fetch`,value:`+refs/heads/*:refs/remotes/${Ws}/*`});try{await c();let E=[...new Set(h)].filter(S=>S.indexOf(a)===-1);await m(E),h=[]}catch(E){console.error("Error monitoring changes:",E)}finally{i&&setTimeout(g,1e3)}}o(g,"pullPushTick");function v(){i=!0,g()}o(v,"startSync");function _(){i=!1}return o(_,"stopSync"),{start:o(()=>{i||(v(),i=!0)},"start"),stop:o(()=>{_()},"stop"),isRunning:o(()=>i,"isRunning"),loadBranch:u,sequentialPush:m}},"createLegitSyncService");var Lr=Lt(Or(),1);function jc(e){let t=e.length;for(;--t>=0;)e[t]=0}o(jc,"zero$1");var Q_e=0,p7=1,e1e=2,t1e=3,r1e=258,ZT=29,bp=256,hp=bp+1+ZT,$c=30,XT=19,y7=2*hp+1,yf=15,xT=16,n1e=7,JT=256,m7=16,g7=17,w7=18,jT=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),B0=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i1e=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),v7=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o1e=512,Ca=new Array((hp+2)*2);jc(Ca);var fp=new Array($c*2);jc(fp);var dp=new Array(o1e);jc(dp);var pp=new Array(r1e-t1e+1);jc(pp);var QT=new Array(ZT);jc(QT);var C0=new Array($c);jc(C0);function OT(e,t,r,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=e&&e.length}o(OT,"StaticTreeDesc");var b7,_7,E7;function IT(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}o(IT,"TreeDesc");var S7=o(e=>e<256?dp[e]:dp[256+(e>>>7)],"d_code"),yp=o((e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},"put_short"),jn=o((e,t,r)=>{e.bi_valid>xT-r?(e.bi_buf|=t<<e.bi_valid&65535,yp(e,e.bi_buf),e.bi_buf=t>>xT-e.bi_valid,e.bi_valid+=r-xT):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},"send_bits"),Bo=o((e,t,r)=>{jn(e,r[t*2],r[t*2+1])},"send_code"),A7=o((e,t)=>{let r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1},"bi_reverse"),a1e=o(e=>{e.bi_valid===16?(yp(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},"bi_flush"),s1e=o((e,t)=>{let r=t.dyn_tree,n=t.max_code,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,u=t.stat_desc.extra_base,h=t.stat_desc.max_length,c,d,y,m,g,v,_=0;for(m=0;m<=yf;m++)e.bl_count[m]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<y7;c++)d=e.heap[c],m=r[r[d*2+1]*2+1]+1,m>h&&(m=h,_++),r[d*2+1]=m,!(d>n)&&(e.bl_count[m]++,g=0,d>=u&&(g=i[d-u]),v=r[d*2],e.opt_len+=v*(m+g),s&&(e.static_len+=v*(a[d*2+1]+g)));if(_!==0){do{for(m=h-1;e.bl_count[m]===0;)m--;e.bl_count[m]--,e.bl_count[m+1]+=2,e.bl_count[h]--,_-=2}while(_>0);for(m=h;m!==0;m--)for(d=e.bl_count[m];d!==0;)y=e.heap[--c],!(y>n)&&(r[y*2+1]!==m&&(e.opt_len+=(m-r[y*2+1])*r[y*2],r[y*2+1]=m),d--)}},"gen_bitlen"),R7=o((e,t,r)=>{let n=new Array(yf+1),a=0,s,i;for(s=1;s<=yf;s++)a=a+r[s-1]<<1,n[s]=a;for(i=0;i<=t;i++){let u=e[i*2+1];u!==0&&(e[i*2]=A7(n[u]++,u))}},"gen_codes"),l1e=o(()=>{let e,t,r,n,a,s=new Array(yf+1);for(r=0,n=0;n<ZT-1;n++)for(QT[n]=r,e=0;e<1<<jT[n];e++)pp[r++]=n;for(pp[r-1]=n,a=0,n=0;n<16;n++)for(C0[n]=a,e=0;e<1<<B0[n];e++)dp[a++]=n;for(a>>=7;n<$c;n++)for(C0[n]=a<<7,e=0;e<1<<B0[n]-7;e++)dp[256+a++]=n;for(t=0;t<=yf;t++)s[t]=0;for(e=0;e<=143;)Ca[e*2+1]=8,e++,s[8]++;for(;e<=255;)Ca[e*2+1]=9,e++,s[9]++;for(;e<=279;)Ca[e*2+1]=7,e++,s[7]++;for(;e<=287;)Ca[e*2+1]=8,e++,s[8]++;for(R7(Ca,hp+1,s),e=0;e<$c;e++)fp[e*2+1]=5,fp[e*2]=A7(e,5);b7=new OT(Ca,jT,bp+1,hp,yf),_7=new OT(fp,B0,0,$c,yf),E7=new OT(new Array(0),i1e,0,XT,n1e)},"tr_static_init"),T7=o(e=>{let t;for(t=0;t<hp;t++)e.dyn_ltree[t*2]=0;for(t=0;t<$c;t++)e.dyn_dtree[t*2]=0;for(t=0;t<XT;t++)e.bl_tree[t*2]=0;e.dyn_ltree[JT*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},"init_block"),x7=o(e=>{e.bi_valid>8?yp(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},"bi_windup"),P9=o((e,t,r,n)=>{let a=t*2,s=r*2;return e[a]<e[s]||e[a]===e[s]&&n[t]<=n[r]},"smaller"),PT=o((e,t,r)=>{let n=e.heap[r],a=r<<1;for(;a<=e.heap_len&&(a<e.heap_len&&P9(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!P9(t,n,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=n},"pqdownheap"),F9=o((e,t,r)=>{let n,a,s=0,i,u;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+s++]&255,n+=(e.pending_buf[e.sym_buf+s++]&255)<<8,a=e.pending_buf[e.sym_buf+s++],n===0?Bo(e,a,t):(i=pp[a],Bo(e,i+bp+1,t),u=jT[i],u!==0&&(a-=QT[i],jn(e,a,u)),n--,i=S7(n),Bo(e,i,r),u=B0[i],u!==0&&(n-=C0[i],jn(e,n,u)));while(s<e.sym_next);Bo(e,JT,t)},"compress_block"),WT=o((e,t)=>{let r=t.dyn_tree,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.elems,i,u,h=-1,c;for(e.heap_len=0,e.heap_max=y7,i=0;i<s;i++)r[i*2]!==0?(e.heap[++e.heap_len]=h=i,e.depth[i]=0):r[i*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=h<2?++h:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,a&&(e.static_len-=n[c*2+1]);for(t.max_code=h,i=e.heap_len>>1;i>=1;i--)PT(e,r,i);c=s;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],PT(e,r,1),u=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=u,r[c*2]=r[i*2]+r[u*2],e.depth[c]=(e.depth[i]>=e.depth[u]?e.depth[i]:e.depth[u])+1,r[i*2+1]=r[u*2+1]=c,e.heap[1]=c++,PT(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],s1e(e,t),R7(r,h,e.bl_count)},"build_tree"),k9=o((e,t,r)=>{let n,a=-1,s,i=t[0*2+1],u=0,h=7,c=4;for(i===0&&(h=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=t[(n+1)*2+1],!(++u<h&&s===i)&&(u<c?e.bl_tree[s*2]+=u:s!==0?(s!==a&&e.bl_tree[s*2]++,e.bl_tree[m7*2]++):u<=10?e.bl_tree[g7*2]++:e.bl_tree[w7*2]++,u=0,a=s,i===0?(h=138,c=3):s===i?(h=6,c=3):(h=7,c=4))},"scan_tree"),B9=o((e,t,r)=>{let n,a=-1,s,i=t[0*2+1],u=0,h=7,c=4;for(i===0&&(h=138,c=3),n=0;n<=r;n++)if(s=i,i=t[(n+1)*2+1],!(++u<h&&s===i)){if(u<c)do Bo(e,s,e.bl_tree);while(--u!==0);else s!==0?(s!==a&&(Bo(e,s,e.bl_tree),u--),Bo(e,m7,e.bl_tree),jn(e,u-3,2)):u<=10?(Bo(e,g7,e.bl_tree),jn(e,u-3,3)):(Bo(e,w7,e.bl_tree),jn(e,u-11,7));u=0,a=s,i===0?(h=138,c=3):s===i?(h=6,c=3):(h=7,c=4)}},"send_tree"),f1e=o(e=>{let t;for(k9(e,e.dyn_ltree,e.l_desc.max_code),k9(e,e.dyn_dtree,e.d_desc.max_code),WT(e,e.bl_desc),t=XT-1;t>=3&&e.bl_tree[v7[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},"build_bl_tree"),u1e=o((e,t,r,n)=>{let a;for(jn(e,t-257,5),jn(e,r-1,5),jn(e,n-4,4),a=0;a<n;a++)jn(e,e.bl_tree[v7[a]*2+1],3);B9(e,e.dyn_ltree,t-1),B9(e,e.dyn_dtree,r-1)},"send_all_trees"),c1e=o(e=>{let t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return 0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return 1;for(r=32;r<bp;r++)if(e.dyn_ltree[r*2]!==0)return 1;return 0},"detect_data_type"),C9=!1,h1e=o(e=>{C9||(l1e(),C9=!0),e.l_desc=new IT(e.dyn_ltree,b7),e.d_desc=new IT(e.dyn_dtree,_7),e.bl_desc=new IT(e.bl_tree,E7),e.bi_buf=0,e.bi_valid=0,T7(e)},"_tr_init$1"),O7=o((e,t,r,n)=>{jn(e,(Q_e<<1)+(n?1:0),3),x7(e),yp(e,r),yp(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},"_tr_stored_block$1"),d1e=o(e=>{jn(e,p7<<1,3),Bo(e,JT,Ca),a1e(e)},"_tr_align$1"),p1e=o((e,t,r,n)=>{let a,s,i=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=c1e(e)),WT(e,e.l_desc),WT(e,e.d_desc),i=f1e(e),a=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=a&&(a=s)):a=s=r+5,r+4<=a&&t!==-1?O7(e,t,r,n):e.strategy===4||s===a?(jn(e,(p7<<1)+(n?1:0),3),F9(e,Ca,fp)):(jn(e,(e1e<<1)+(n?1:0),3),u1e(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),F9(e,e.dyn_ltree,e.dyn_dtree)),T7(e),n&&x7(e)},"_tr_flush_block$1"),y1e=o((e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(pp[r]+bp+1)*2]++,e.dyn_dtree[S7(t)*2]++),e.sym_next===e.sym_end),"_tr_tally$1"),m1e=h1e,g1e=O7,w1e=p1e,v1e=y1e,b1e=d1e,_1e={_tr_init:m1e,_tr_stored_block:g1e,_tr_flush_block:w1e,_tr_tally:v1e,_tr_align:b1e},E1e=o((e,t,r,n)=>{let a=e&65535|0,s=e>>>16&65535|0,i=0;for(;r!==0;){i=r>2e3?2e3:r,r-=i;do a=a+t[n++]|0,s=s+a|0;while(--i);a%=65521,s%=65521}return a|s<<16|0},"adler32"),mp=E1e,S1e=o(()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},"makeTable"),A1e=new Uint32Array(S1e()),R1e=o((e,t,r,n)=>{let a=A1e,s=n+r;e^=-1;for(let i=n;i<s;i++)e=e>>>8^a[(e^t[i])&255];return e^-1},"crc32"),qr=R1e,wf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Wc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:T1e,_tr_stored_block:qT,_tr_flush_block:x1e,_tr_tally:zs,_tr_align:O1e}=_1e,{Z_NO_FLUSH:Vs,Z_PARTIAL_FLUSH:I1e,Z_FULL_FLUSH:P1e,Z_FINISH:ki,Z_BLOCK:L9,Z_OK:Xr,Z_STREAM_END:N9,Z_STREAM_ERROR:Co,Z_DATA_ERROR:F1e,Z_BUF_ERROR:FT,Z_DEFAULT_COMPRESSION:k1e,Z_FILTERED:B1e,Z_HUFFMAN_ONLY:O0,Z_RLE:C1e,Z_FIXED:L1e,Z_DEFAULT_STRATEGY:N1e,Z_UNKNOWN:D1e,Z_DEFLATED:D0}=Wc,$1e=9,U1e=15,M1e=8,j1e=29,W1e=256,HT=W1e+1+j1e,q1e=30,H1e=19,z1e=2*HT+1,V1e=15,yt=3,Hs=258,Lo=Hs+yt+1,G1e=32,Uc=42,ex=57,zT=69,VT=73,GT=91,KT=103,mf=113,sp=666,Sn=1,qc=2,vf=3,Hc=4,K1e=3,gf=o((e,t)=>(e.msg=wf[t],t),"err"),D9=o(e=>e*2-(e>4?9:0),"rank"),qs=o(e=>{let t=e.length;for(;--t>=0;)e[t]=0},"zero"),Y1e=o(e=>{let t,r,n,a=e.w_size;t=e.hash_size,n=t;do r=e.head[--n],e.head[n]=r>=a?r-a:0;while(--t);t=a,n=t;do r=e.prev[--n],e.prev[n]=r>=a?r-a:0;while(--t)},"slide_hash"),Z1e=o((e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask,"HASH_ZLIB"),Gs=Z1e,si=o(e=>{let t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))},"flush_pending"),li=o((e,t)=>{x1e(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,si(e.strm)},"flush_block_only"),St=o((e,t)=>{e.pending_buf[e.pending++]=t},"put_byte"),ap=o((e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},"putShortMSB"),YT=o((e,t,r,n)=>{let a=e.avail_in;return a>n&&(a=n),a===0?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),r),e.state.wrap===1?e.adler=mp(e.adler,t,a,r):e.state.wrap===2&&(e.adler=qr(e.adler,t,a,r)),e.next_in+=a,e.total_in+=a,a)},"read_buf"),I7=o((e,t)=>{let r=e.max_chain_length,n=e.strstart,a,s,i=e.prev_length,u=e.nice_match,h=e.strstart>e.w_size-Lo?e.strstart-(e.w_size-Lo):0,c=e.window,d=e.w_mask,y=e.prev,m=e.strstart+Hs,g=c[n+i-1],v=c[n+i];e.prev_length>=e.good_match&&(r>>=2),u>e.lookahead&&(u=e.lookahead);do if(a=t,!(c[a+i]!==v||c[a+i-1]!==g||c[a]!==c[n]||c[++a]!==c[n+1])){n+=2,a++;do;while(c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&n<m);if(s=Hs-(m-n),n=m-Hs,s>i){if(e.match_start=t,i=s,s>=u)break;g=c[n+i-1],v=c[n+i]}}while((t=y[t&d])>h&&--r!==0);return i<=e.lookahead?i:e.lookahead},"longest_match"),Mc=o(e=>{let t=e.w_size,r,n,a;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Lo)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Y1e(e),n+=t),e.strm.avail_in===0)break;if(r=YT(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=yt)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=Gs(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=Gs(e,e.ins_h,e.window[a+yt-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<yt)););}while(e.lookahead<Lo&&e.strm.avail_in!==0)},"fill_window"),P7=o((e,t)=>{let r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,a,s,i=0,u=e.strm.avail_in;do{if(n=65535,s=e.bi_valid+42>>3,e.strm.avail_out<s||(s=e.strm.avail_out-s,a=e.strstart-e.block_start,n>a+e.strm.avail_in&&(n=a+e.strm.avail_in),n>s&&(n=s),n<r&&(n===0&&t!==ki||t===Vs||n!==a+e.strm.avail_in)))break;i=t===ki&&n===a+e.strm.avail_in?1:0,qT(e,0,0,i),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,si(e.strm),a&&(a>n&&(a=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,n-=a),n&&(YT(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(i===0);return u-=e.strm.avail_in,u&&(u>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=u&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-u,e.strm.next_in),e.strstart),e.strstart+=u,e.insert+=u>e.w_size-e.insert?e.w_size-e.insert:u),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),i?Hc:t!==Vs&&t!==ki&&e.strm.avail_in===0&&e.strstart===e.block_start?qc:(s=e.window_size-e.strstart,e.strm.avail_in>s&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(YT(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water<e.strstart&&(e.high_water=e.strstart),s=e.bi_valid+42>>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,r=s>e.w_size?e.w_size:s,a=e.strstart-e.block_start,(a>=r||(a||t===ki)&&t!==Vs&&e.strm.avail_in===0&&a<=s)&&(n=a>s?s:a,i=t===ki&&e.strm.avail_in===0&&n===a?1:0,qT(e,e.block_start,n,i),e.block_start+=n,si(e.strm)),i?vf:Sn)},"deflate_stored"),kT=o((e,t)=>{let r,n;for(;;){if(e.lookahead<Lo){if(Mc(e),e.lookahead<Lo&&t===Vs)return Sn;if(e.lookahead===0)break}if(r=0,e.lookahead>=yt&&(e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+yt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-Lo&&(e.match_length=I7(e,r)),e.match_length>=yt)if(n=zs(e,e.strstart-e.match_start,e.match_length-yt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=yt){e.match_length--;do e.strstart++,e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+yt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+1]);else n=zs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(li(e,!1),e.strm.avail_out===0))return Sn}return e.insert=e.strstart<yt-1?e.strstart:yt-1,t===ki?(li(e,!0),e.strm.avail_out===0?vf:Hc):e.sym_next&&(li(e,!1),e.strm.avail_out===0)?Sn:qc},"deflate_fast"),Nc=o((e,t)=>{let r,n,a;for(;;){if(e.lookahead<Lo){if(Mc(e),e.lookahead<Lo&&t===Vs)return Sn;if(e.lookahead===0)break}if(r=0,e.lookahead>=yt&&(e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+yt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=yt-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Lo&&(e.match_length=I7(e,r),e.match_length<=5&&(e.strategy===B1e||e.match_length===yt&&e.strstart-e.match_start>4096)&&(e.match_length=yt-1)),e.prev_length>=yt&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-yt,n=zs(e,e.strstart-1-e.prev_match,e.prev_length-yt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+yt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=yt-1,e.strstart++,n&&(li(e,!1),e.strm.avail_out===0))return Sn}else if(e.match_available){if(n=zs(e,0,e.window[e.strstart-1]),n&&li(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Sn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=zs(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<yt-1?e.strstart:yt-1,t===ki?(li(e,!0),e.strm.avail_out===0?vf:Hc):e.sym_next&&(li(e,!1),e.strm.avail_out===0)?Sn:qc},"deflate_slow"),X1e=o((e,t)=>{let r,n,a,s,i=e.window;for(;;){if(e.lookahead<=Hs){if(Mc(e),e.lookahead<=Hs&&t===Vs)return Sn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=yt&&e.strstart>0&&(a=e.strstart-1,n=i[a],n===i[++a]&&n===i[++a]&&n===i[++a])){s=e.strstart+Hs;do;while(n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&a<s);e.match_length=Hs-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=yt?(r=zs(e,1,e.match_length-yt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=zs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(li(e,!1),e.strm.avail_out===0))return Sn}return e.insert=0,t===ki?(li(e,!0),e.strm.avail_out===0?vf:Hc):e.sym_next&&(li(e,!1),e.strm.avail_out===0)?Sn:qc},"deflate_rle"),J1e=o((e,t)=>{let r;for(;;){if(e.lookahead===0&&(Mc(e),e.lookahead===0)){if(t===Vs)return Sn;break}if(e.match_length=0,r=zs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(li(e,!1),e.strm.avail_out===0))return Sn}return e.insert=0,t===ki?(li(e,!0),e.strm.avail_out===0?vf:Hc):e.sym_next&&(li(e,!1),e.strm.avail_out===0)?Sn:qc},"deflate_huff");function ko(e,t,r,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=a}o(ko,"Config");var lp=[new ko(0,0,0,0,P7),new ko(4,4,8,4,kT),new ko(4,5,16,8,kT),new ko(4,6,32,32,kT),new ko(4,4,16,16,Nc),new ko(8,16,32,32,Nc),new ko(8,16,128,128,Nc),new ko(8,32,128,256,Nc),new ko(32,128,258,1024,Nc),new ko(32,258,258,4096,Nc)],Q1e=o(e=>{e.window_size=2*e.w_size,qs(e.head),e.max_lazy_match=lp[e.level].max_lazy,e.good_match=lp[e.level].good_length,e.nice_match=lp[e.level].nice_length,e.max_chain_length=lp[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=yt-1,e.match_available=0,e.ins_h=0},"lm_init");function eEe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=D0,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(z1e*2),this.dyn_dtree=new Uint16Array((2*q1e+1)*2),this.bl_tree=new Uint16Array((2*H1e+1)*2),qs(this.dyn_ltree),qs(this.dyn_dtree),qs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(V1e+1),this.heap=new Uint16Array(2*HT+1),qs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*HT+1),qs(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}o(eEe,"DeflateState");var _p=o(e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==Uc&&t.status!==ex&&t.status!==zT&&t.status!==VT&&t.status!==GT&&t.status!==KT&&t.status!==mf&&t.status!==sp?1:0},"deflateStateCheck"),F7=o(e=>{if(_p(e))return gf(e,Co);e.total_in=e.total_out=0,e.data_type=D1e;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?ex:t.wrap?Uc:mf,e.adler=t.wrap===2?0:1,t.last_flush=-2,T1e(t),Xr},"deflateResetKeep"),k7=o(e=>{let t=F7(e);return t===Xr&&Q1e(e.state),t},"deflateReset"),tEe=o((e,t)=>_p(e)||e.state.wrap!==2?Co:(e.state.gzhead=t,Xr),"deflateSetHeader"),B7=o((e,t,r,n,a,s)=>{if(!e)return Co;let i=1;if(t===k1e&&(t=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),a<1||a>$1e||r!==D0||n<8||n>15||t<0||t>9||s<0||s>L1e||n===8&&i!==1)return gf(e,Co);n===8&&(n=9);let u=new eEe;return e.state=u,u.strm=e,u.status=Uc,u.wrap=i,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=a+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+yt-1)/yt),u.window=new Uint8Array(u.w_size*2),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<a+6,u.pending_buf_size=u.lit_bufsize*4,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=t,u.strategy=s,u.method=r,k7(e)},"deflateInit2"),rEe=o((e,t)=>B7(e,t,D0,U1e,M1e,N1e),"deflateInit"),nEe=o((e,t)=>{if(_p(e)||t>L9||t<0)return e?gf(e,Co):Co;let r=e.state;if(!e.output||e.avail_in!==0&&!e.input||r.status===sp&&t!==ki)return gf(e,e.avail_out===0?FT:Co);let n=r.last_flush;if(r.last_flush=t,r.pending!==0){if(si(e),e.avail_out===0)return r.last_flush=-1,Xr}else if(e.avail_in===0&&D9(t)<=D9(n)&&t!==ki)return gf(e,FT);if(r.status===sp&&e.avail_in!==0)return gf(e,FT);if(r.status===Uc&&r.wrap===0&&(r.status=mf),r.status===Uc){let a=D0+(r.w_bits-8<<4)<<8,s=-1;if(r.strategy>=O0||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,a|=s<<6,r.strstart!==0&&(a|=G1e),a+=31-a%31,ap(r,a),r.strstart!==0&&(ap(r,e.adler>>>16),ap(r,e.adler&65535)),e.adler=1,r.status=mf,si(e),r.pending!==0)return r.last_flush=-1,Xr}if(r.status===ex){if(e.adler=0,St(r,31),St(r,139),St(r,8),r.gzhead)St(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),St(r,r.gzhead.time&255),St(r,r.gzhead.time>>8&255),St(r,r.gzhead.time>>16&255),St(r,r.gzhead.time>>24&255),St(r,r.level===9?2:r.strategy>=O0||r.level<2?4:0),St(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(St(r,r.gzhead.extra.length&255),St(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=qr(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=zT;else if(St(r,0),St(r,0),St(r,0),St(r,0),St(r,0),St(r,r.level===9?2:r.strategy>=O0||r.level<2?4:0),St(r,K1e),r.status=mf,si(e),r.pending!==0)return r.last_flush=-1,Xr}if(r.status===zT){if(r.gzhead.extra){let a=r.pending,s=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+s>r.pending_buf_size;){let u=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+u),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex+=u,si(e),r.pending!==0)return r.last_flush=-1,Xr;a=0,s-=u}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending+=s,r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=VT}if(r.status===VT){if(r.gzhead.name){let a=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),si(e),r.pending!==0)return r.last_flush=-1,Xr;a=0}r.gzindex<r.gzhead.name.length?s=r.gzhead.name.charCodeAt(r.gzindex++)&255:s=0,St(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=GT}if(r.status===GT){if(r.gzhead.comment){let a=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),si(e),r.pending!==0)return r.last_flush=-1,Xr;a=0}r.gzindex<r.gzhead.comment.length?s=r.gzhead.comment.charCodeAt(r.gzindex++)&255:s=0,St(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a))}r.status=KT}if(r.status===KT){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(si(e),r.pending!==0))return r.last_flush=-1,Xr;St(r,e.adler&255),St(r,e.adler>>8&255),e.adler=0}if(r.status=mf,si(e),r.pending!==0)return r.last_flush=-1,Xr}if(e.avail_in!==0||r.lookahead!==0||t!==Vs&&r.status!==sp){let a=r.level===0?P7(r,t):r.strategy===O0?J1e(r,t):r.strategy===C1e?X1e(r,t):lp[r.level].func(r,t);if((a===vf||a===Hc)&&(r.status=sp),a===Sn||a===vf)return e.avail_out===0&&(r.last_flush=-1),Xr;if(a===qc&&(t===I1e?O1e(r):t!==L9&&(qT(r,0,0,!1),t===P1e&&(qs(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),si(e),e.avail_out===0))return r.last_flush=-1,Xr}return t!==ki?Xr:r.wrap<=0?N9:(r.wrap===2?(St(r,e.adler&255),St(r,e.adler>>8&255),St(r,e.adler>>16&255),St(r,e.adler>>24&255),St(r,e.total_in&255),St(r,e.total_in>>8&255),St(r,e.total_in>>16&255),St(r,e.total_in>>24&255)):(ap(r,e.adler>>>16),ap(r,e.adler&65535)),si(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Xr:N9)},"deflate$2"),iEe=o(e=>{if(_p(e))return Co;let t=e.state.status;return e.state=null,t===mf?gf(e,F1e):Xr},"deflateEnd"),oEe=o((e,t)=>{let r=t.length;if(_p(e))return Co;let n=e.state,a=n.wrap;if(a===2||a===1&&n.status!==Uc||n.lookahead)return Co;if(a===1&&(e.adler=mp(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){a===0&&(qs(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(t.subarray(r-n.w_size,r),0),t=h,r=n.w_size}let s=e.avail_in,i=e.next_in,u=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Mc(n);n.lookahead>=yt;){let h=n.strstart,c=n.lookahead-(yt-1);do n.ins_h=Gs(n,n.ins_h,n.window[h+yt-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--c);n.strstart=h,n.lookahead=yt-1,Mc(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=yt-1,n.match_available=0,e.next_in=i,e.input=u,e.avail_in=s,n.wrap=a,Xr},"deflateSetDictionary"),aEe=rEe,sEe=B7,lEe=k7,fEe=F7,uEe=tEe,cEe=nEe,hEe=iEe,dEe=oEe,pEe="pako deflate (from Nodeca project)",up={deflateInit:aEe,deflateInit2:sEe,deflateReset:lEe,deflateResetKeep:fEe,deflateSetHeader:uEe,deflate:cEe,deflateEnd:hEe,deflateSetDictionary:dEe,deflateInfo:pEe},yEe=o((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"_has"),mEe=o(function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)yEe(r,n)&&(e[n]=r[n])}}return e},"assign"),gEe=o(e=>{let t=0;for(let n=0,a=e.length;n<a;n++)t+=e[n].length;let r=new Uint8Array(t);for(let n=0,a=0,s=e.length;n<s;n++){let i=e[n];r.set(i,a),a+=i.length}return r},"flattenChunks"),$0={assign:mEe,flattenChunks:gEe},C7=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{C7=!1}var gp=new Uint8Array(256);for(let e=0;e<256;e++)gp[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;gp[254]=gp[254]=1;var wEe=o(e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,a,s,i=e.length,u=0;for(a=0;a<i;a++)r=e.charCodeAt(a),(r&64512)===55296&&a+1<i&&(n=e.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(u),s=0,a=0;s<u;a++)r=e.charCodeAt(a),(r&64512)===55296&&a+1<i&&(n=e.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|r&63):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|r&63):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|r&63);return t},"string2buf"),vEe=o((e,t)=>{if(t<65534&&e.subarray&&C7)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r},"buf2binstring"),bEe=o((e,t)=>{let r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,a,s=new Array(r*2);for(a=0,n=0;n<r;){let i=e[n++];if(i<128){s[a++]=i;continue}let u=gp[i];if(u>4){s[a++]=65533,n+=u-1;continue}for(i&=u===2?31:u===3?15:7;u>1&&n<r;)i=i<<6|e[n++]&63,u--;if(u>1){s[a++]=65533;continue}i<65536?s[a++]=i:(i-=65536,s[a++]=55296|i>>10&1023,s[a++]=56320|i&1023)}return vEe(s,a)},"buf2string"),_Ee=o((e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+gp[e[r]]>t?r:t},"utf8border"),wp={string2buf:wEe,buf2string:bEe,utf8border:_Ee};function EEe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}o(EEe,"ZStream");var L7=EEe,N7=Object.prototype.toString,{Z_NO_FLUSH:SEe,Z_SYNC_FLUSH:AEe,Z_FULL_FLUSH:REe,Z_FINISH:TEe,Z_OK:L0,Z_STREAM_END:xEe,Z_DEFAULT_COMPRESSION:OEe,Z_DEFAULT_STRATEGY:IEe,Z_DEFLATED:PEe}=Wc;function Ep(e){this.options=$0.assign({level:OEe,method:PEe,chunkSize:16384,windowBits:15,memLevel:8,strategy:IEe},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new L7,this.strm.avail_out=0;let r=up.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==L0)throw new Error(wf[r]);if(t.header&&up.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=wp.string2buf(t.dictionary):N7.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=up.deflateSetDictionary(this.strm,n),r!==L0)throw new Error(wf[r]);this._dict_set=!0}}o(Ep,"Deflate$1");Ep.prototype.push=function(e,t){let r=this.strm,n=this.options.chunkSize,a,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?TEe:SEe,typeof e=="string"?r.input=wp.string2buf(e):N7.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===AEe||s===REe)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(a=up.deflate(r,s),a===xEe)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=up.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===L0;if(r.avail_out===0){this.onData(r.output);continue}if(s>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Ep.prototype.onData=function(e){this.chunks.push(e)};Ep.prototype.onEnd=function(e){e===L0&&(this.result=$0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function tx(e,t){let r=new Ep(t);if(r.push(e,!0),r.err)throw r.msg||wf[r.err];return r.result}o(tx,"deflate$1");function FEe(e,t){return t=t||{},t.raw=!0,tx(e,t)}o(FEe,"deflateRaw$1");function kEe(e,t){return t=t||{},t.gzip=!0,tx(e,t)}o(kEe,"gzip$1");var BEe=Ep,CEe=tx,LEe=FEe,NEe=kEe,DEe=Wc,$Ee={Deflate:BEe,deflate:CEe,deflateRaw:LEe,gzip:NEe,constants:DEe},I0=16209,UEe=16191,MEe=o(function(t,r){let n,a,s,i,u,h,c,d,y,m,g,v,_,b,E,S,T,x,A,B,P,N,L,C,z=t.state;n=t.next_in,L=t.input,a=n+(t.avail_in-5),s=t.next_out,C=t.output,i=s-(r-t.avail_out),u=s+(t.avail_out-257),h=z.dmax,c=z.wsize,d=z.whave,y=z.wnext,m=z.window,g=z.hold,v=z.bits,_=z.lencode,b=z.distcode,E=(1<<z.lenbits)-1,S=(1<<z.distbits)-1;e:do{v<15&&(g+=L[n++]<<v,v+=8,g+=L[n++]<<v,v+=8),T=_[g&E];t:for(;;){if(x=T>>>24,g>>>=x,v-=x,x=T>>>16&255,x===0)C[s++]=T&65535;else if(x&16){A=T&65535,x&=15,x&&(v<x&&(g+=L[n++]<<v,v+=8),A+=g&(1<<x)-1,g>>>=x,v-=x),v<15&&(g+=L[n++]<<v,v+=8,g+=L[n++]<<v,v+=8),T=b[g&S];r:for(;;){if(x=T>>>24,g>>>=x,v-=x,x=T>>>16&255,x&16){if(B=T&65535,x&=15,v<x&&(g+=L[n++]<<v,v+=8,v<x&&(g+=L[n++]<<v,v+=8)),B+=g&(1<<x)-1,B>h){t.msg="invalid distance too far back",z.mode=I0;break e}if(g>>>=x,v-=x,x=s-i,B>x){if(x=B-x,x>d&&z.sane){t.msg="invalid distance too far back",z.mode=I0;break e}if(P=0,N=m,y===0){if(P+=c-x,x<A){A-=x;do C[s++]=m[P++];while(--x);P=s-B,N=C}}else if(y<x){if(P+=c+y-x,x-=y,x<A){A-=x;do C[s++]=m[P++];while(--x);if(P=0,y<A){x=y,A-=x;do C[s++]=m[P++];while(--x);P=s-B,N=C}}}else if(P+=y-x,x<A){A-=x;do C[s++]=m[P++];while(--x);P=s-B,N=C}for(;A>2;)C[s++]=N[P++],C[s++]=N[P++],C[s++]=N[P++],A-=3;A&&(C[s++]=N[P++],A>1&&(C[s++]=N[P++]))}else{P=s-B;do C[s++]=C[P++],C[s++]=C[P++],C[s++]=C[P++],A-=3;while(A>2);A&&(C[s++]=C[P++],A>1&&(C[s++]=C[P++]))}}else if(x&64){t.msg="invalid distance code",z.mode=I0;break e}else{T=b[(T&65535)+(g&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){z.mode=UEe;break e}else{t.msg="invalid literal/length code",z.mode=I0;break e}else{T=_[(T&65535)+(g&(1<<x)-1)];continue t}break}}while(n<a&&s<u);A=v>>3,n-=A,v-=A<<3,g&=(1<<v)-1,t.next_in=n,t.next_out=s,t.avail_in=n<a?5+(a-n):5-(n-a),t.avail_out=s<u?257+(u-s):257-(s-u),z.hold=g,z.bits=v},"inflate_fast"),Dc=15,$9=852,U9=592,M9=0,BT=1,j9=2,jEe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),WEe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),qEe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),HEe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),zEe=o((e,t,r,n,a,s,i,u)=>{let h=u.bits,c=0,d=0,y=0,m=0,g=0,v=0,_=0,b=0,E=0,S=0,T,x,A,B,P,N=null,L,C=new Uint16Array(Dc+1),z=new Uint16Array(Dc+1),V=null,Q,X,ue;for(c=0;c<=Dc;c++)C[c]=0;for(d=0;d<n;d++)C[t[r+d]]++;for(g=h,m=Dc;m>=1&&C[m]===0;m--);if(g>m&&(g=m),m===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,u.bits=1,0;for(y=1;y<m&&C[y]===0;y++);for(g<y&&(g=y),b=1,c=1;c<=Dc;c++)if(b<<=1,b-=C[c],b<0)return-1;if(b>0&&(e===M9||m!==1))return-1;for(z[1]=0,c=1;c<Dc;c++)z[c+1]=z[c]+C[c];for(d=0;d<n;d++)t[r+d]!==0&&(i[z[t[r+d]]++]=d);if(e===M9?(N=V=i,L=20):e===BT?(N=jEe,V=WEe,L=257):(N=qEe,V=HEe,L=0),S=0,d=0,c=y,P=s,v=g,_=0,A=-1,E=1<<g,B=E-1,e===BT&&E>$9||e===j9&&E>U9)return 1;for(;;){Q=c-_,i[d]+1<L?(X=0,ue=i[d]):i[d]>=L?(X=V[i[d]-L],ue=N[i[d]-L]):(X=96,ue=0),T=1<<c-_,x=1<<v,y=x;do x-=T,a[P+(S>>_)+x]=Q<<24|X<<16|ue|0;while(x!==0);for(T=1<<c-1;S&T;)T>>=1;if(T!==0?(S&=T-1,S+=T):S=0,d++,--C[c]===0){if(c===m)break;c=t[r+i[d]]}if(c>g&&(S&B)!==A){for(_===0&&(_=g),P+=y,v=c-_,b=1<<v;v+_<m&&(b-=C[v+_],!(b<=0));)v++,b<<=1;if(E+=1<<v,e===BT&&E>$9||e===j9&&E>U9)return 1;A=S&B,a[A]=g<<24|v<<16|P-s|0}}return S!==0&&(a[P+S]=c-_<<24|64<<16|0),u.bits=g,0},"inflate_table"),cp=zEe,VEe=0,D7=1,$7=2,{Z_FINISH:W9,Z_BLOCK:GEe,Z_TREES:P0,Z_OK:bf,Z_STREAM_END:KEe,Z_NEED_DICT:YEe,Z_STREAM_ERROR:Bi,Z_DATA_ERROR:U7,Z_MEM_ERROR:M7,Z_BUF_ERROR:ZEe,Z_DEFLATED:q9}=Wc,U0=16180,H9=16181,z9=16182,V9=16183,G9=16184,K9=16185,Y9=16186,Z9=16187,X9=16188,J9=16189,N0=16190,Ba=16191,CT=16192,Q9=16193,LT=16194,e7=16195,t7=16196,r7=16197,n7=16198,F0=16199,k0=16200,i7=16201,o7=16202,a7=16203,s7=16204,l7=16205,NT=16206,f7=16207,u7=16208,Xt=16209,j7=16210,W7=16211,XEe=852,JEe=592,QEe=15,eSe=QEe,c7=o(e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),"zswap32");function tSe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}o(tSe,"InflateState");var _f=o(e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<U0||t.mode>W7?1:0},"inflateStateCheck"),q7=o(e=>{if(_f(e))return Bi;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=U0,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(XEe),t.distcode=t.distdyn=new Int32Array(JEe),t.sane=1,t.back=-1,bf},"inflateResetKeep"),H7=o(e=>{if(_f(e))return Bi;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,q7(e)},"inflateReset"),z7=o((e,t)=>{let r;if(_f(e))return Bi;let n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Bi:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,H7(e))},"inflateReset2"),V7=o((e,t)=>{if(!e)return Bi;let r=new tSe;e.state=r,r.strm=e,r.window=null,r.mode=U0;let n=z7(e,t);return n!==bf&&(e.state=null),n},"inflateInit2"),rSe=o(e=>V7(e,eSe),"inflateInit"),h7=!0,DT,$T,nSe=o(e=>{if(h7){DT=new Int32Array(512),$T=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(cp(D7,e.lens,0,288,DT,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;cp($7,e.lens,0,32,$T,0,e.work,{bits:5}),h7=!1}e.lencode=DT,e.lenbits=9,e.distcode=$T,e.distbits=5},"fixedtables"),G7=o((e,t,r,n)=>{let a,s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(t.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(a=s.wsize-s.wnext,a>n&&(a=n),s.window.set(t.subarray(r-n,r-n+a),s.wnext),n-=a,n?(s.window.set(t.subarray(r-n,r),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0},"updatewindow"),iSe=o((e,t)=>{let r,n,a,s,i,u,h,c,d,y,m,g,v,_,b=0,E,S,T,x,A,B,P,N,L=new Uint8Array(4),C,z,V=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_f(e)||!e.output||!e.input&&e.avail_in!==0)return Bi;r=e.state,r.mode===Ba&&(r.mode=CT),i=e.next_out,a=e.output,h=e.avail_out,s=e.next_in,n=e.input,u=e.avail_in,c=r.hold,d=r.bits,y=u,m=h,N=bf;e:for(;;)switch(r.mode){case U0:if(r.wrap===0){r.mode=CT;break}for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,L[0]=c&255,L[1]=c>>>8&255,r.check=qr(r.check,L,2,0),c=0,d=0,r.mode=H9;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=Xt;break}if((c&15)!==q9){e.msg="unknown compression method",r.mode=Xt;break}if(c>>>=4,d-=4,P=(c&15)+8,r.wbits===0&&(r.wbits=P),P>15||P>r.wbits){e.msg="invalid window size",r.mode=Xt;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=c&512?J9:Ba,c=0,d=0;break;case H9:for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.flags=c,(r.flags&255)!==q9){e.msg="unknown compression method",r.mode=Xt;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Xt;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=qr(r.check,L,2,0)),c=0,d=0,r.mode=z9;case z9:for(;d<32;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,L[2]=c>>>16&255,L[3]=c>>>24&255,r.check=qr(r.check,L,4,0)),c=0,d=0,r.mode=V9;case V9:for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=qr(r.check,L,2,0)),c=0,d=0,r.mode=G9;case G9:if(r.flags&1024){for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=qr(r.check,L,2,0)),c=0,d=0}else r.head&&(r.head.extra=null);r.mode=K9;case K9:if(r.flags&1024&&(g=r.length,g>u&&(g=u),g&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(s,s+g),P)),r.flags&512&&r.wrap&4&&(r.check=qr(r.check,n,g,s)),u-=g,s+=g,r.length-=g),r.length))break e;r.length=0,r.mode=Y9;case Y9:if(r.flags&2048){if(u===0)break e;g=0;do P=n[s+g++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P));while(P&&g<u);if(r.flags&512&&r.wrap&4&&(r.check=qr(r.check,n,g,s)),u-=g,s+=g,P)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Z9;case Z9:if(r.flags&4096){if(u===0)break e;g=0;do P=n[s+g++],r.head&&P&&r.length<65536&&(r.head.comment+=String.fromCharCode(P));while(P&&g<u);if(r.flags&512&&r.wrap&4&&(r.check=qr(r.check,n,g,s)),u-=g,s+=g,P)break e}else r.head&&(r.head.comment=null);r.mode=X9;case X9:if(r.flags&512){for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.wrap&4&&c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Xt;break}c=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Ba;break;case J9:for(;d<32;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}e.adler=r.check=c7(c),c=0,d=0,r.mode=N0;case N0:if(r.havedict===0)return e.next_out=i,e.avail_out=h,e.next_in=s,e.avail_in=u,r.hold=c,r.bits=d,YEe;e.adler=r.check=1,r.mode=Ba;case Ba:if(t===GEe||t===P0)break e;case CT:if(r.last){c>>>=d&7,d-=d&7,r.mode=NT;break}for(;d<3;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}switch(r.last=c&1,c>>>=1,d-=1,c&3){case 0:r.mode=Q9;break;case 1:if(nSe(r),r.mode=F0,t===P0){c>>>=2,d-=2;break e}break;case 2:r.mode=t7;break;case 3:e.msg="invalid block type",r.mode=Xt}c>>>=2,d-=2;break;case Q9:for(c>>>=d&7,d-=d&7;d<32;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Xt;break}if(r.length=c&65535,c=0,d=0,r.mode=LT,t===P0)break e;case LT:r.mode=e7;case e7:if(g=r.length,g){if(g>u&&(g=u),g>h&&(g=h),g===0)break e;a.set(n.subarray(s,s+g),i),u-=g,s+=g,h-=g,i+=g,r.length-=g;break}r.mode=Ba;break;case t7:for(;d<14;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.nlen=(c&31)+257,c>>>=5,d-=5,r.ndist=(c&31)+1,c>>>=5,d-=5,r.ncode=(c&15)+4,c>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Xt;break}r.have=0,r.mode=r7;case r7:for(;r.have<r.ncode;){for(;d<3;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.lens[V[r.have++]]=c&7,c>>>=3,d-=3}for(;r.have<19;)r.lens[V[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},N=cp(VEe,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,N){e.msg="invalid code lengths set",r.mode=Xt;break}r.have=0,r.mode=n7;case n7:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],E=b>>>24,S=b>>>16&255,T=b&65535,!(E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(T<16)c>>>=E,d-=E,r.lens[r.have++]=T;else{if(T===16){for(z=E+2;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(c>>>=E,d-=E,r.have===0){e.msg="invalid bit length repeat",r.mode=Xt;break}P=r.lens[r.have-1],g=3+(c&3),c>>>=2,d-=2}else if(T===17){for(z=E+3;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}c>>>=E,d-=E,P=0,g=3+(c&7),c>>>=3,d-=3}else{for(z=E+7;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}c>>>=E,d-=E,P=0,g=11+(c&127),c>>>=7,d-=7}if(r.have+g>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Xt;break}for(;g--;)r.lens[r.have++]=P}}if(r.mode===Xt)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Xt;break}if(r.lenbits=9,C={bits:r.lenbits},N=cp(D7,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,N){e.msg="invalid literal/lengths set",r.mode=Xt;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},N=cp($7,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,N){e.msg="invalid distances set",r.mode=Xt;break}if(r.mode=F0,t===P0)break e;case F0:r.mode=k0;case k0:if(u>=6&&h>=258){e.next_out=i,e.avail_out=h,e.next_in=s,e.avail_in=u,r.hold=c,r.bits=d,MEe(e,m),i=e.next_out,a=e.output,h=e.avail_out,s=e.next_in,n=e.input,u=e.avail_in,c=r.hold,d=r.bits,r.mode===Ba&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],E=b>>>24,S=b>>>16&255,T=b&65535,!(E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(S&&!(S&240)){for(x=E,A=S,B=T;b=r.lencode[B+((c&(1<<x+A)-1)>>x)],E=b>>>24,S=b>>>16&255,T=b&65535,!(x+E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}c>>>=x,d-=x,r.back+=x}if(c>>>=E,d-=E,r.back+=E,r.length=T,S===0){r.mode=l7;break}if(S&32){r.back=-1,r.mode=Ba;break}if(S&64){e.msg="invalid literal/length code",r.mode=Xt;break}r.extra=S&15,r.mode=i7;case i7:if(r.extra){for(z=r.extra;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=o7;case o7:for(;b=r.distcode[c&(1<<r.distbits)-1],E=b>>>24,S=b>>>16&255,T=b&65535,!(E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(!(S&240)){for(x=E,A=S,B=T;b=r.distcode[B+((c&(1<<x+A)-1)>>x)],E=b>>>24,S=b>>>16&255,T=b&65535,!(x+E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}c>>>=x,d-=x,r.back+=x}if(c>>>=E,d-=E,r.back+=E,S&64){e.msg="invalid distance code",r.mode=Xt;break}r.offset=T,r.extra=S&15,r.mode=a7;case a7:if(r.extra){for(z=r.extra;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Xt;break}r.mode=s7;case s7:if(h===0)break e;if(g=m-h,r.offset>g){if(g=r.offset-g,g>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Xt;break}g>r.wnext?(g-=r.wnext,v=r.wsize-g):v=r.wnext-g,g>r.length&&(g=r.length),_=r.window}else _=a,v=i-r.offset,g=r.length;g>h&&(g=h),h-=g,r.length-=g;do a[i++]=_[v++];while(--g);r.length===0&&(r.mode=k0);break;case l7:if(h===0)break e;a[i++]=r.length,h--,r.mode=k0;break;case NT:if(r.wrap){for(;d<32;){if(u===0)break e;u--,c|=n[s++]<<d,d+=8}if(m-=h,e.total_out+=m,r.total+=m,r.wrap&4&&m&&(e.adler=r.check=r.flags?qr(r.check,a,m,i-m):mp(r.check,a,m,i-m)),m=h,r.wrap&4&&(r.flags?c:c7(c))!==r.check){e.msg="incorrect data check",r.mode=Xt;break}c=0,d=0}r.mode=f7;case f7:if(r.wrap&&r.flags){for(;d<32;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.wrap&4&&c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Xt;break}c=0,d=0}r.mode=u7;case u7:N=KEe;break e;case Xt:N=U7;break e;case j7:return M7;case W7:default:return Bi}return e.next_out=i,e.avail_out=h,e.next_in=s,e.avail_in=u,r.hold=c,r.bits=d,(r.wsize||m!==e.avail_out&&r.mode<Xt&&(r.mode<NT||t!==W9))&&G7(e,e.output,e.next_out,m-e.avail_out),y-=e.avail_in,m-=e.avail_out,e.total_in+=y,e.total_out+=m,r.total+=m,r.wrap&4&&m&&(e.adler=r.check=r.flags?qr(r.check,a,m,e.next_out-m):mp(r.check,a,m,e.next_out-m)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Ba?128:0)+(r.mode===F0||r.mode===LT?256:0),(y===0&&m===0||t===W9)&&N===bf&&(N=ZEe),N},"inflate$2"),oSe=o(e=>{if(_f(e))return Bi;let t=e.state;return t.window&&(t.window=null),e.state=null,bf},"inflateEnd"),aSe=o((e,t)=>{if(_f(e))return Bi;let r=e.state;return r.wrap&2?(r.head=t,t.done=!1,bf):Bi},"inflateGetHeader"),sSe=o((e,t)=>{let r=t.length,n,a,s;return _f(e)||(n=e.state,n.wrap!==0&&n.mode!==N0)?Bi:n.mode===N0&&(a=1,a=mp(a,t,r,0),a!==n.check)?U7:(s=G7(e,t,r,r),s?(n.mode=j7,M7):(n.havedict=1,bf))},"inflateSetDictionary"),lSe=H7,fSe=z7,uSe=q7,cSe=rSe,hSe=V7,dSe=iSe,pSe=oSe,ySe=aSe,mSe=sSe,gSe="pako inflate (from Nodeca project)",La={inflateReset:lSe,inflateReset2:fSe,inflateResetKeep:uSe,inflateInit:cSe,inflateInit2:hSe,inflate:dSe,inflateEnd:pSe,inflateGetHeader:ySe,inflateSetDictionary:mSe,inflateInfo:gSe};function wSe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}o(wSe,"GZheader");var vSe=wSe,K7=Object.prototype.toString,{Z_NO_FLUSH:bSe,Z_FINISH:_Se,Z_OK:vp,Z_STREAM_END:UT,Z_NEED_DICT:MT,Z_STREAM_ERROR:ESe,Z_DATA_ERROR:d7,Z_MEM_ERROR:SSe}=Wc;function Sp(e){this.options=$0.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new L7,this.strm.avail_out=0;let r=La.inflateInit2(this.strm,t.windowBits);if(r!==vp)throw new Error(wf[r]);if(this.header=new vSe,La.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wp.string2buf(t.dictionary):K7.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=La.inflateSetDictionary(this.strm,t.dictionary),r!==vp)))throw new Error(wf[r])}o(Sp,"Inflate$1");Sp.prototype.push=function(e,t){let r=this.strm,n=this.options.chunkSize,a=this.options.dictionary,s,i,u;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?_Se:bSe,K7.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),s=La.inflate(r,i),s===MT&&a&&(s=La.inflateSetDictionary(r,a),s===vp?s=La.inflate(r,i):s===d7&&(s=MT));r.avail_in>0&&s===UT&&r.state.wrap>0&&e[r.next_in]!==0;)La.inflateReset(r),s=La.inflate(r,i);switch(s){case ESe:case d7:case MT:case SSe:return this.onEnd(s),this.ended=!0,!1}if(u=r.avail_out,r.next_out&&(r.avail_out===0||s===UT))if(this.options.to==="string"){let h=wp.utf8border(r.output,r.next_out),c=r.next_out-h,d=wp.buf2string(r.output,h);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(h,h+c),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(s===vp&&u===0)){if(s===UT)return s=La.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Sp.prototype.onData=function(e){this.chunks.push(e)};Sp.prototype.onEnd=function(e){e===vp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=$0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function rx(e,t){let r=new Sp(t);if(r.push(e),r.err)throw r.msg||wf[r.err];return r.result}o(rx,"inflate$1");function ASe(e,t){return t=t||{},t.raw=!0,rx(e,t)}o(ASe,"inflateRaw$1");var RSe=Sp,TSe=rx,xSe=ASe,OSe=rx,ISe=Wc,PSe={Inflate:RSe,inflate:TSe,inflateRaw:xSe,ungzip:OSe,constants:ISe},{Deflate:WDe,deflate:FSe,deflateRaw:qDe,gzip:HDe}=$Ee,{Inflate:zDe,inflate:kSe,inflateRaw:VDe,ungzip:GDe}=PSe;var Y7=FSe;var Z7=kSe;var Js=Lt(Lh(),1);var X7=o((e,t)=>{let r={type:"local",id:"local",name:"Local User",email:"local@legitcontrol.com"};return{getUser:o(async()=>r,"getUser"),signInAnonymously:o(async()=>{r.type="anonymous",r.id=crypto.randomUUID(),r.email=`anonymous-sha1-${r.id}-@legitcontrol.com`},"signInAnonymously"),addAccessToken:o(async n=>{let a=await e.getUserTokens(r.id);a.accessTokens.push(n),await e.setUserTokens(r.id,a)},"addAccessToken"),getMaxAccessTokenForBranch:o(async n=>{let a=await e.getUserTokens(r.id);if(!(a.accessTokens===void 0||a.accessTokens.length===0))return a.accessTokens[0]},"getMaxAccessTokenForBranch")}},"createSessionManager");var nx=Lt(Or(),1);function J7(e){let t=JSON.stringify(e),r=new TextEncoder().encode(t),n="";return typeof btoa=="function"?n=btoa(String.fromCharCode(...r)):n=Buffer.from(r).toString("base64"),n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}o(J7,"encodeConfigJson");function Q7(e){let t=e.replace(/-/g,"+").replace(/_/g,"/")+"===".slice((e.length+3)%4),r;typeof atob=="function"?r=atob(t):r=Buffer.from(t,"base64").toString("binary");let n=Uint8Array.from(r,s=>s.charCodeAt(0)),a=new TextDecoder().decode(n);return JSON.parse(a)}o(Q7,"decodeConfigJson");var ez="user.legit-tokens";function tz({storageFs:e,gitRoot:t}){return{getUserTokens:o(async r=>{let n=await nx.default.getConfig({fs:e,dir:t,path:ez});return n?Q7(n):{accessTokens:[]}},"getUserTokens"),setUserTokens:o(async(r,n)=>await nx.default.setConfig({fs:e,dir:t,path:ez,value:J7(n)}),"setUserTokens")}}o(tz,"createGitConfigTokenStore");var Rt=Lt(Or(),1);var M0=class M0 extends Error{constructor(r,n){super(r);Ye(this,"code","ENOENT");Ye(this,"path");this.name="ENOENTError",this.path=n,Object.setPrototypeOf(this,M0.prototype)}};o(M0,"ENOENTError");var Ef=M0;function j0(e){return e&&e.gitCache!==void 0?e.gitCache:e&&e.parentFs?j0(e.parentFs):{}}o(j0,"getGitCacheFromFs");function rz({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branch-file",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchFileVirtualFile",rootType:"folder",getStats:o(async a=>{let{filePath:s,pathParams:i,userSpaceFs:u}=a;i.branchName===void 0&&(i.branchName=await Et(t,e));let h=await it(e,t,i.branchName);if(!h)throw new Ef(`ENOENT: no such file or directory, stat '${s}'`,s);let c=await Nl({filePath:s,gitRoot:t,nodeFs:e,commitSha:h,pathParams:i,gitCache:j0(u)});if(!c)throw new Ef(`ENOENT: no such file or directory, stat '${s}'`,s);let d=await Rt.default.readCommit({fs:e,dir:t,oid:h}),{commit:y}=d,m=await Rt.default.log({fs:e,dir:t,ref:h,filepath:i.filePath,depth:1}),g=y.committer.timestamp*1e3,v=m.length>0?m[0].commit.committer.timestamp*1e3:g;if(c.type==="tree")return{mode:420,size:0,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!0,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:v,mtimeMs:v,ctimeMs:v,birthtimeMs:g,atime:new Date(v),mtime:new Date(v),ctime:new Date(v),birthtime:new Date(v)};{let{blob:_}=await Rt.default.readBlob({fs:e,dir:t,oid:c.oid});return{mode:420,size:_.length,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(_.length/4096),atimeMs:v,mtimeMs:v,ctimeMs:v,birthtimeMs:v,atime:new Date(v),mtime:new Date(v),ctime:new Date(v),birthtime:new Date(v)}}},"getStats"),getFile:o(async a=>{let{filePath:s,cacheFs:i,pathParams:u,userSpaceFs:h}=a;u.branchName===void 0&&(u.branchName=await Et(t,e));try{let c=await it(e,t,u.branchName);if(!c){let y=await Rt.default.resolveRef({fs:e,dir:t,ref:"HEAD"});if(await Rt.default.branch({fs:e,dir:t,ref:u.branchName,object:y}),c=await it(e,t,u.branchName),!c)throw new Error("Could not create branch for getFile")}let d=await Nl({filePath:s,gitRoot:t,nodeFs:e,commitSha:c,pathParams:u,gitCache:j0(h)});if(!d)return;if(d.type==="blob"){let{blob:y}=await Rt.default.readBlob({fs:e,dir:t,oid:d.oid});return{type:"file",content:Buffer.from(y),mode:420,size:y.length,oid:d.oid}}else{let y=[];try{let g=await i.promises.stat(s);if(g&&g.isDirectory()){let v=await i.promises.readdir(s,{withFileTypes:!0});y.push(...v)}}catch{}return{type:"directory",content:Array.from(new Set([...y,...d.entries])).map(g=>({...g,name:g.name.toString(),path:`${s}`,parentPath:`${s}`})),mode:493}}}catch{return}},"getFile"),unlink:o(async a=>{let{pathParams:s,author:i}=a;if(s.branchName===void 0&&(s.branchName=await Et(t,e)),!s.filePath)throw new Error("filePath should be in pathParams");let u=await it(e,t,s.branchName);if(!u)throw new Error("Invalid branch file path - branch must exist");let h=await Rt.default.readTree({fs:e,dir:t,oid:u}),c=await ca({dir:t,fs:e,treeOid:h.oid,deletePathParts:s.filePath.split("/"),addPathParts:void 0,addObj:void 0,deleteKeepIfNotEmpty:!1,addKeepIfEmpty:!0,keepFilename:".keep"});if(c!==h.oid){let d=await Rt.default.commit({fs:e,dir:t,message:`Delete ${s.filePath}`,tree:c,noUpdateBranch:!0,parent:[u],author:i});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(s.branchName)}`,value:d,force:!0})}},"unlink"),writeFile:o(async a=>{let{filePath:s,content:i,cacheFs:u,pathParams:h,author:c}=a;if(h.branchName===void 0&&(h.branchName=await Et(t,e)),h.filePath===void 0)throw new Error("filePath should be in pathParams");let d;typeof i=="string"?d=new TextEncoder().encode(i):d=new Uint8Array(i);let y=await Rt.default.writeBlob({fs:e,dir:t,blob:d}),m=await it(e,t,h.branchName);if(!m){let _=await Rt.default.resolveRef({fs:e,dir:t,ref:"HEAD"});if(await Rt.default.branch({fs:e,dir:t,ref:Ht(h.branchName),object:_}),m=await it(e,t,h.branchName),!m)throw new Error("Could not create branch for writeFile")}let g=await Rt.default.readTree({fs:e,dir:t,oid:m}),v=await ca({dir:t,fs:e,treeOid:g.oid,deletePathParts:void 0,addPathParts:h.filePath.split("/"),addObj:{type:"blob",oid:y},deleteKeepIfNotEmpty:!0,addKeepIfEmpty:!1,keepFilename:".keep"});if(v!==g.oid){let _=await Rt.default.commit({fs:e,dir:t,message:`\u{1F4BE} Change '${h.filePath}'`,tree:v,noUpdateBranch:!0,parent:[m],author:c});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(h.branchName)}`,value:_,force:!0});let b=await it(e,t,h.branchName);if(_!==b)throw new Error("Failed to update branch after file deletion")}},"writeFile"),rename:o(async function(a){let{filePath:s,newPath:i,pathParams:u,newPathParams:h,author:c,userSpaceFs:d}=a;if(u.branchName===void 0&&(u.branchName=await Et(t,e)),u.filePath===void 0)throw new Error("filePath should be in pathParams");if(h.branchName===void 0&&(h.branchName=await Et(t,e)),h.filePath===void 0)throw new Error("filePath should be in newPathParams");let y=await it(e,t,u.branchName);if(!y)throw new Error("Invalid branch file path - source branch must exist");let m=await it(e,t,h.branchName);if(!m){let b=await Rt.default.resolveRef({fs:e,dir:t,ref:"HEAD"});if(await Rt.default.branch({fs:e,dir:t,ref:Ht(h.branchName),object:b}),m=await it(e,t,h.branchName),m===void 0)throw new Error("Could not create branch for rename operation")}if(h.branchName!==u.branchName)throw new Error("cross branch move not implemented yet");let g=await Nl({gitRoot:t,nodeFs:e,commitSha:y,filePath:s,pathParams:u,gitCache:j0(d)});if(g===void 0)throw new Error("no obj at path exists");let v=await ca({dir:t,fs:e,deletePathParts:u.filePath.split("/"),addPathParts:h.filePath.split("/"),addObj:g.type==="blob"?{type:"blob",oid:g.oid}:{type:"tree",oid:g.oid,entries:g.entries.map(b=>b.name.toString())},treeOid:m,addKeepIfEmpty:!0,deleteKeepIfNotEmpty:!0}),_=await Rt.default.readTree({fs:e,dir:t,oid:y});if(v!==_.oid){let b=await Rt.default.commit({fs:e,dir:t,message:`\u{1F500} Rename '${u.filePath}' to '${h.filePath}'`,tree:v,noUpdateBranch:!0,parent:[m],author:c});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(h.branchName)}`,value:b,force:!0})}},"rename"),mkdir:o(async function(a){a.pathParams.branchName===void 0&&(a.pathParams.branchName=await Et(t,e));let s=await it(e,t,a.pathParams.branchName);if(a.pathParams.filePath===""&&(a.pathParams.filePath="/",s!==void 0))throw new Error("Folder exists");try{throw await this.getStats(a),new Error("Folder exists")}catch{}if(a.filePath.endsWith("/")&&(a.filePath=a.filePath.replace(/\/+$/,"")),a.pathParams&&typeof a.pathParams.filePath=="string"&&(a.pathParams.filePath=a.pathParams.filePath.replace(/\/+$/,"")),!s){let d=await Rt.default.resolveRef({fs:e,dir:t,ref:"HEAD"});if(await Rt.default.branch({fs:e,dir:t,ref:Ht(a.pathParams.branchName),object:d}),s=await it(e,t,a.pathParams.branchName),s===void 0)throw new Error("Could not create branch for mkdir operation")}let i=await Rt.default.readTree({fs:e,dir:t,oid:s}),u=new Uint8Array(0),h=await Rt.default.writeBlob({fs:e,dir:t,blob:u}),c=await ca({dir:t,fs:e,treeOid:i.oid,deletePathParts:void 0,addPathParts:[...a.pathParams.filePath.split("/"),".keep"],addObj:{type:"blob",oid:h},deleteKeepIfNotEmpty:!0,addKeepIfEmpty:!0,keepFilename:".keep"});if(c!==i.oid){let d=await Rt.default.commit({fs:e,dir:t,message:`\u{1F4BE} Change '${a.pathParams.filePath}'`,tree:c,noUpdateBranch:!0,parent:[s],author:a.author});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(a.pathParams.branchName)}`,value:d,force:!0})}},"mkdir"),rmdir:o(async a=>{let{pathParams:s,author:i}=a;if(s.branchName===void 0&&(s.branchName=await Et(t,e)),!s.filePath)throw new Error("filePath should be in pathParams");let u=await it(e,t,s.branchName);if(!u)throw new Error("Invalid branch file path - branch must exist");let h=await Rt.default.readTree({fs:e,dir:t,oid:u}),c=await ca({dir:t,fs:e,treeOid:h.oid,deletePathParts:s.filePath.split("/"),addPathParts:void 0,addObj:void 0,deleteKeepIfNotEmpty:!1,addKeepIfEmpty:!0,keepFilename:".keep"});if(c!==h.oid){let d=await Rt.default.commit({fs:e,dir:t,message:`Delete ${s.filePath}`,tree:c,noUpdateBranch:!0,parent:[u],author:i});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(s.branchName)}`,value:d,force:!0})}},"rmdir")}})}o(rz,"createBranchFileAdapter");var nz=Lt(Or(),1);function iz({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branches-list",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchesListVirtualFile",rootType:"folder",getStats:o(async()=>{let a=t+"/.git";try{return await e.promises.stat(a)}catch{throw new Error(`ENOENT: no such file or directory, stat '${a}'`)}},"getStats"),getFile:o(async({filePath:a})=>{try{let i=(await nz.default.listBranches({fs:e,dir:t})).map(u=>bn({parent:a,name:yo(u),isDir:!0}));return{type:"directory",content:i,mode:493,size:i}}catch(s){throw s}},"getFile"),rename:o(async a=>{throw new Error("not implemented")},"rename"),mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(iz,"createBranchesListAdapter");var zc=Lt(Or(),1);function ix(e){return e&&e.gitCache!==void 0?e.gitCache:e&&e.parentFs?ix(e.parentFs):{}}o(ix,"getGitCacheFromFs");function oz({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branch-head",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchHeadVirtualFile",rootType:"file",getStats:o(async({pathParams:a,userSpaceFs:s})=>{a.branchName===void 0&&(a.branchName=await Et(t,e));let i=await it(e,t,a.branchName);if(!i)throw new Error(`Branch ${a.branchName} does not exist in the repository`);let u=await zc.default.readCommit({fs:e,dir:t,oid:i,cache:ix(s)}),{commit:h}=u,c=h.committer.timestamp*1e3;return{mode:420,size:40,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(.009765625),atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c)}},"getStats"),getFile:o(async({pathParams:a,userSpaceFs:s})=>{a.branchName===void 0&&(a.branchName=await Et(t,e));try{let i;try{i=await zc.default.resolveRef({fs:e,dir:t,ref:a.branchName})}catch{i=await zc.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${a.branchName}`})}return{type:"file",content:i+`
142
+ `;super(r),this.name="AggregateError",this.errors=t}};o(cR,"AggregateError");var uR=cR;O6.exports={AggregateError:uR,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array}});var hR=Oe((NNe,I6)=>{"use strict";I6.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){let a=t.shift();return n==="f"?a.toFixed(6):n==="j"?JSON.stringify(a):n==="s"&&typeof a=="object"?`${a.constructor!==Object?a.constructor.name:""} {}`.trim():a.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}});var un=Oe((DNe,k6)=>{"use strict";var{format:wge,inspect:Kw}=hR(),{AggregateError:vge}=Zt(),bge=globalThis.AggregateError||vge,_ge=Symbol("kIsNodeError"),Ege=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Sge=/^([A-Z][a-z0-9]*)+$/,Age="__node_internal_",Yw={};function nf(e,t){if(!e)throw new Yw.ERR_INTERNAL_ASSERTION(t)}o(nf,"assert");function P6(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}o(P6,"addNumericalSeparator");function Rge(e,t,r){if(typeof t=="function")return nf(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let n=(t.match(/%[dfijoOs]/g)||[]).length;return nf(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:wge(t,...r)}o(Rge,"getMessage");function Zr(e,t,r){r||(r=Error);let a=class a extends r{constructor(...i){super(Rge(e,t,i))}toString(){return`${this.name} [${e}]: ${this.message}`}};o(a,"NodeError");let n=a;Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[_ge]=!0,Yw[e]=n}o(Zr,"E");function F6(e){let t=Age+e.name;return Object.defineProperty(e,"name",{value:t}),e}o(F6,"hideStackFrames");function Tge(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new bge([t,e],t.message);return r.code=t.code,r}return e||t}o(Tge,"aggregateTwoErrors");var pR=class pR extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Yw.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};o(pR,"AbortError");var dR=pR;Zr("ERR_ASSERTION","%s",Error);Zr("ERR_INVALID_ARG_TYPE",(e,t,r)=>{nf(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let a=[],s=[],i=[];for(let h of t)nf(typeof h=="string","All expected entries have to be of type string"),Ege.includes(h)?a.push(h.toLowerCase()):Sge.test(h)?s.push(h):(nf(h!=="object",'The value "object" should be written as "Object"'),i.push(h));if(s.length>0){let h=a.indexOf("object");h!==-1&&(a.splice(a,h,1),s.push("Object"))}if(a.length>0){switch(a.length){case 1:n+=`of type ${a[0]}`;break;case 2:n+=`one of type ${a[0]} or ${a[1]}`;break;default:{let h=a.pop();n+=`one of type ${a.join(", ")}, or ${h}`}}(s.length>0||i.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let h=s.pop();n+=`an instance of ${s.join(", ")}, or ${h}`}}i.length>0&&(n+=" or ")}switch(i.length){case 0:break;case 1:i[0].toLowerCase()!==i[0]&&(n+="an "),n+=`${i[0]}`;break;case 2:n+=`one of ${i[0]} or ${i[1]}`;break;default:{let h=i.pop();n+=`one of ${i.join(", ")}, or ${h}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var u;if((u=r.constructor)!==null&&u!==void 0&&u.name)n+=`. Received an instance of ${r.constructor.name}`;else{let h=Kw(r,{depth:-1});n+=`. Received ${h}`}}else{let h=Kw(r,{colors:!1});h.length>25&&(h=`${h.slice(0,25)}...`),n+=`. Received type ${typeof r} (${h})`}return n},TypeError);Zr("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=Kw(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);Zr("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;let a=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${a}.`},TypeError);Zr("ERR_MISSING_ARGS",(...e)=>{nf(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);Zr("ERR_OUT_OF_RANGE",(e,t,r)=>{nf(t,'Missing "range" argument');let n;if(Number.isInteger(r)&&Math.abs(r)>2**32)n=P6(String(r));else if(typeof r=="bigint"){n=String(r);let a=BigInt(2)**BigInt(32);(r>a||r<-a)&&(n=P6(n)),n+="n"}else n=Kw(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);Zr("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Zr("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Zr("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Zr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Zr("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Zr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Zr("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Zr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Zr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Zr("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Zr("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);k6.exports={AbortError:dR,aggregateTwoErrors:F6(Tge),hideStackFrames:F6,codes:Yw}});var _c=Oe((UNe,Zw)=>{"use strict";var{AbortController:B6,AbortSignal:xge}=typeof self<"u"?self:typeof window<"u"?window:void 0;Zw.exports=B6;Zw.exports.AbortSignal=xge;Zw.exports.default=B6});function Oge(){if(C6)return Xw;C6=!0;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:o(function(A,B,P){return Function.prototype.apply.call(A,B,P)},"ReflectApply2"),r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=o(function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))},"ReflectOwnKeys2"):r=o(function(A){return Object.getOwnPropertyNames(A)},"ReflectOwnKeys2");function n(x){console&&console.warn&&console.warn(x)}o(n,"ProcessEmitWarning");var a=Number.isNaN||o(function(A){return A!==A},"NumberIsNaN2");function s(){s.init.call(this)}o(s,"EventEmitter2"),Xw=s,Xw.once=E,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var i=10;function u(x){if(typeof x!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof x)}o(u,"checkListener"),Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:o(function(){return i},"get"),set:o(function(x){if(typeof x!="number"||x<0||a(x))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+x+".");i=x},"set")}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=o(function(A){if(typeof A!="number"||A<0||a(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this},"setMaxListeners");function h(x){return x._maxListeners===void 0?s.defaultMaxListeners:x._maxListeners}o(h,"_getMaxListeners"),s.prototype.getMaxListeners=o(function(){return h(this)},"getMaxListeners"),s.prototype.emit=o(function(A){for(var B=[],P=1;P<arguments.length;P++)B.push(arguments[P]);var N=A==="error",L=this._events;if(L!==void 0)N=N&&L.error===void 0;else if(!N)return!1;if(N){var C;if(B.length>0&&(C=B[0]),C instanceof Error)throw C;var z=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw z.context=C,z}var V=L[A];if(V===void 0)return!1;if(typeof V=="function")t(V,this,B);else for(var Q=V.length,X=v(V,Q),P=0;P<Q;++P)t(X[P],this,B);return!0},"emit");function c(x,A,B,P){var N,L,C;if(u(B),L=x._events,L===void 0?(L=x._events=Object.create(null),x._eventsCount=0):(L.newListener!==void 0&&(x.emit("newListener",A,B.listener?B.listener:B),L=x._events),C=L[A]),C===void 0)C=L[A]=B,++x._eventsCount;else if(typeof C=="function"?C=L[A]=P?[B,C]:[C,B]:P?C.unshift(B):C.push(B),N=h(x),N>0&&C.length>N&&!C.warned){C.warned=!0;var z=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");z.name="MaxListenersExceededWarning",z.emitter=x,z.type=A,z.count=C.length,n(z)}return x}o(c,"_addListener"),s.prototype.addListener=o(function(A,B){return c(this,A,B,!1)},"addListener"),s.prototype.on=s.prototype.addListener,s.prototype.prependListener=o(function(A,B){return c(this,A,B,!0)},"prependListener");function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}o(d,"onceWrapper");function y(x,A,B){var P={fired:!1,wrapFn:void 0,target:x,type:A,listener:B},N=d.bind(P);return N.listener=B,P.wrapFn=N,N}o(y,"_onceWrap"),s.prototype.once=o(function(A,B){return u(B),this.on(A,y(this,A,B)),this},"once3"),s.prototype.prependOnceListener=o(function(A,B){return u(B),this.prependListener(A,y(this,A,B)),this},"prependOnceListener"),s.prototype.removeListener=o(function(A,B){var P,N,L,C,z;if(u(B),N=this._events,N===void 0)return this;if(P=N[A],P===void 0)return this;if(P===B||P.listener===B)--this._eventsCount===0?this._events=Object.create(null):(delete N[A],N.removeListener&&this.emit("removeListener",A,P.listener||B));else if(typeof P!="function"){for(L=-1,C=P.length-1;C>=0;C--)if(P[C]===B||P[C].listener===B){z=P[C].listener,L=C;break}if(L<0)return this;L===0?P.shift():_(P,L),P.length===1&&(N[A]=P[0]),N.removeListener!==void 0&&this.emit("removeListener",A,z||B)}return this},"removeListener"),s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=o(function(A){var B,P,N;if(P=this._events,P===void 0)return this;if(P.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):P[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete P[A]),this;if(arguments.length===0){var L=Object.keys(P),C;for(N=0;N<L.length;++N)C=L[N],C!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(B=P[A],typeof B=="function")this.removeListener(A,B);else if(B!==void 0)for(N=B.length-1;N>=0;N--)this.removeListener(A,B[N]);return this},"removeAllListeners");function m(x,A,B){var P=x._events;if(P===void 0)return[];var N=P[A];return N===void 0?[]:typeof N=="function"?B?[N.listener||N]:[N]:B?b(N):v(N,N.length)}o(m,"_listeners"),s.prototype.listeners=o(function(A){return m(this,A,!0)},"listeners"),s.prototype.rawListeners=o(function(A){return m(this,A,!1)},"rawListeners"),s.listenerCount=function(x,A){return typeof x.listenerCount=="function"?x.listenerCount(A):g.call(x,A)},s.prototype.listenerCount=g;function g(x){var A=this._events;if(A!==void 0){var B=A[x];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}o(g,"listenerCount2"),s.prototype.eventNames=o(function(){return this._eventsCount>0?r(this._events):[]},"eventNames");function v(x,A){for(var B=new Array(A),P=0;P<A;++P)B[P]=x[P];return B}o(v,"arrayClone");function _(x,A){for(;A+1<x.length;A++)x[A]=x[A+1];x.pop()}o(_,"spliceOne");function b(x){for(var A=new Array(x.length),B=0;B<A.length;++B)A[B]=x[B].listener||x[B];return A}o(b,"unwrapListeners");function E(x,A){return new Promise(function(B,P){function N(C){x.removeListener(A,L),P(C)}o(N,"errorListener");function L(){typeof x.removeListener=="function"&&x.removeListener("error",N),B([].slice.call(arguments))}o(L,"resolver"),T(x,A,L,{once:!0}),A!=="error"&&S(x,N,{once:!0})})}o(E,"once2");function S(x,A,B){typeof x.on=="function"&&T(x,"error",A,B)}o(S,"addErrorHandlerIfEventEmitter");function T(x,A,B,P){if(typeof x.on=="function")P.once?x.once(A,B):x.on(A,B);else if(typeof x.addEventListener=="function")x.addEventListener(A,o(function N(L){P.once&&x.removeEventListener(A,N),B(L)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof x)}return o(T,"eventTargetAgnosticAddListener"),Xw}var Xw,C6,Jw,Ige,Pge,Fge,kge,Bge,Cge,L6=Qt(()=>{Xw={},C6=!1;o(Oge,"dew");Jw=Oge();Jw.once;Jw.once=function(e,t){return new Promise((r,n)=>{function a(...i){s!==void 0&&e.removeListener("error",s),r(i)}o(a,"eventListener");let s;t!=="error"&&(s=o(i=>{e.removeListener(name,a),n(i)},"errorListener"),e.once("error",s)),e.once(t,a)})};Jw.on=function(e,t){let r=[],n=[],a=null,s=!1,i={async next(){let c=r.shift();if(c)return createIterResult(c,!1);if(a){let d=Promise.reject(a);return a=null,d}return s?createIterResult(void 0,!0):new Promise((d,y)=>n.push({resolve:d,reject:y}))},async return(){e.removeListener(t,u),e.removeListener("error",h),s=!0;for(let c of n)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){a=c,e.removeListener(t,u),e.removeListener("error",h)},[Symbol.asyncIterator](){return this}};return e.on(t,u),e.on("error",h),i;function u(...c){let d=n.shift();d?d.resolve(createIterResult(c,!1)):r.push(c)}o(u,"eventHandler");function h(c){s=!0;let d=n.shift();d?d.reject(c):a=c,i.return()}o(h,"errorHandler")};({EventEmitter:Ige,defaultMaxListeners:Pge,init:Fge,listenerCount:kge,on:Bge,once:Cge}=Jw)});var Vd={};Kn(Vd,{EventEmitter:()=>Ige,defaultMaxListeners:()=>Pge,init:()=>Fge,listenerCount:()=>kge,on:()=>Bge,once:()=>Cge});var Gd=Qt(()=>{L6()});var _n=Oe((qNe,mR)=>{"use strict";var Lge=(na(),Kt(ra)),{format:Nge,inspect:Dge}=hR(),{codes:{ERR_INVALID_ARG_TYPE:yR}}=un(),{kResistStopPropagation:$ge,AggregateError:Uge,SymbolDispose:Mge}=Zt(),jge=globalThis.AbortSignal||_c().AbortSignal,Wge=globalThis.AbortController||_c().AbortController,qge=Object.getPrototypeOf(async function(){}).constructor,N6=globalThis.Blob||Lge.Blob,Hge=o(typeof N6<"u"?function(t){return t instanceof N6}:function(t){return!1},"isBlob"),D6=o((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new yR(t,"AbortSignal",e)},"validateAbortSignal"),zge=o((e,t)=>{if(typeof e!="function")throw new yR(t,"Function",e)},"validateFunction");mR.exports={AggregateError:Uge,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:o(function(){let e,t;return{promise:new Promise((n,a)=>{e=n,t=a}),resolve:e,reject:t}},"createDeferredPromise"),promisify(e){return new Promise((t,r)=>{e((n,...a)=>n?r(n):t(...a))})},debuglog(){return function(){}},format:Nge,inspect:Dge,types:{isAsyncFunction(e){return e instanceof qge},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:Hge,deprecate(e,t){return e},addAbortListener:(Gd(),Kt(Vd)).addAbortListener||o(function(t,r){if(t===void 0)throw new yR("signal","AbortSignal",t);D6(t,"signal"),zge(r,"listener");let n;return t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[$ge]:!0}),n=o(()=>{t.removeEventListener("abort",r)},"removeEventListener")),{__proto__:null,[Mge](){var a;(a=n)===null||a===void 0||a()}}},"addAbortListener"),AbortSignalAny:jge.any||o(function(t){if(t.length===1)return t[0];let r=new Wge,n=o(()=>r.abort(),"abort");return t.forEach(a=>{D6(a,"signals"),a.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(a=>a.removeEventListener("abort",n))},{once:!0}),r.signal},"AbortSignalAny")};mR.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Sc=Oe((zNe,G6)=>{"use strict";var{ArrayIsArray:wR,ArrayPrototypeIncludes:j6,ArrayPrototypeJoin:W6,ArrayPrototypeMap:Vge,NumberIsInteger:vR,NumberIsNaN:Gge,NumberMAX_SAFE_INTEGER:Kge,NumberMIN_SAFE_INTEGER:Yge,NumberParseInt:Zge,ObjectPrototypeHasOwnProperty:Xge,RegExpPrototypeExec:q6,String:Jge,StringPrototypeToUpperCase:Qge,StringPrototypeTrim:ewe}=Zt(),{hideStackFrames:Pi,codes:{ERR_SOCKET_BAD_PORT:twe,ERR_INVALID_ARG_TYPE:cn,ERR_INVALID_ARG_VALUE:Ec,ERR_OUT_OF_RANGE:of,ERR_UNKNOWN_SIGNAL:$6}}=un(),{normalizeEncoding:rwe}=_n(),{isAsyncFunction:nwe,isArrayBufferView:iwe}=_n().types,U6={};function owe(e){return e===(e|0)}o(owe,"isInt32");function awe(e){return e===e>>>0}o(awe,"isUint32");var swe=/^[0-7]+$/,lwe="must be a 32-bit unsigned integer or an octal string";function fwe(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(q6(swe,e)===null)throw new Ec(t,e,lwe);e=Zge(e,8)}return H6(e,t),e}o(fwe,"parseFileMode");var uwe=Pi((e,t,r=Yge,n=Kge)=>{if(typeof e!="number")throw new cn(t,"number",e);if(!vR(e))throw new of(t,"an integer",e);if(e<r||e>n)throw new of(t,`>= ${r} && <= ${n}`,e)}),cwe=Pi((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new cn(t,"number",e);if(!vR(e))throw new of(t,"an integer",e);if(e<r||e>n)throw new of(t,`>= ${r} && <= ${n}`,e)}),H6=Pi((e,t,r=!1)=>{if(typeof e!="number")throw new cn(t,"number",e);if(!vR(e))throw new of(t,"an integer",e);let n=r?1:0,a=4294967295;if(e<n||e>a)throw new of(t,`>= ${n} && <= ${a}`,e)});function bR(e,t){if(typeof e!="string")throw new cn(t,"string",e)}o(bR,"validateString");function hwe(e,t,r=void 0,n){if(typeof e!="number")throw new cn(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&Gge(e))throw new of(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}o(hwe,"validateNumber");var dwe=Pi((e,t,r)=>{if(!j6(r,e)){let a="must be one of: "+W6(Vge(r,s=>typeof s=="string"?`'${s}'`:Jge(s)),", ");throw new Ec(t,e,a)}});function z6(e,t){if(typeof e!="boolean")throw new cn(t,"boolean",e)}o(z6,"validateBoolean");function gR(e,t,r){return e==null||!Xge(e,t)?r:e[t]}o(gR,"getOwnPropertyValueOrDefault");var pwe=Pi((e,t,r=null)=>{let n=gR(r,"allowArray",!1),a=gR(r,"allowFunction",!1);if(!gR(r,"nullable",!1)&&e===null||!n&&wR(e)||typeof e!="object"&&(!a||typeof e!="function"))throw new cn(t,"Object",e)}),ywe=Pi((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new cn(t,"a dictionary",e)}),Qw=Pi((e,t,r=0)=>{if(!wR(e))throw new cn(t,"Array",e);if(e.length<r){let n=`must be longer than ${r}`;throw new Ec(t,e,n)}});function mwe(e,t){Qw(e,t);for(let r=0;r<e.length;r++)bR(e[r],`${t}[${r}]`)}o(mwe,"validateStringArray");function gwe(e,t){Qw(e,t);for(let r=0;r<e.length;r++)z6(e[r],`${t}[${r}]`)}o(gwe,"validateBooleanArray");function wwe(e,t){Qw(e,t);for(let r=0;r<e.length;r++){let n=e[r],a=`${t}[${r}]`;if(n==null)throw new cn(a,"AbortSignal",n);V6(n,a)}}o(wwe,"validateAbortSignalArray");function vwe(e,t="signal"){if(bR(e,t),U6[e]===void 0)throw U6[Qge(e)]!==void 0?new $6(e+" (signals must use all capital letters)"):new $6(e)}o(vwe,"validateSignalName");var bwe=Pi((e,t="buffer")=>{if(!iwe(e))throw new cn(t,["Buffer","TypedArray","DataView"],e)});function _we(e,t){let r=rwe(t),n=e.length;if(r==="hex"&&n%2!==0)throw new Ec("encoding",t,`is invalid for data of length ${n}`)}o(_we,"validateEncoding");function Ewe(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&ewe(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new twe(t,e,r);return e|0}o(Ewe,"validatePort");var V6=Pi((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new cn(t,"AbortSignal",e)}),Swe=Pi((e,t)=>{if(typeof e!="function")throw new cn(t,"Function",e)}),Awe=Pi((e,t)=>{if(typeof e!="function"||nwe(e))throw new cn(t,"Function",e)}),Rwe=Pi((e,t)=>{if(e!==void 0)throw new cn(t,"undefined",e)});function Twe(e,t,r){if(!j6(r,e))throw new cn(t,`('${W6(r,"|")}')`,e)}o(Twe,"validateUnion");var xwe=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function M6(e,t){if(typeof e>"u"||!q6(xwe,e))throw new Ec(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(M6,"validateLinkHeaderFormat");function Owe(e){if(typeof e=="string")return M6(e,"hints"),e;if(wR(e)){let t=e.length,r="";if(t===0)return r;for(let n=0;n<t;n++){let a=e[n];M6(a,"hints"),r+=a,n!==t-1&&(r+=", ")}return r}throw new Ec("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o(Owe,"validateLinkHeaderValue");G6.exports={isInt32:owe,isUint32:awe,parseFileMode:fwe,validateArray:Qw,validateStringArray:mwe,validateBooleanArray:gwe,validateAbortSignalArray:wwe,validateBoolean:z6,validateBuffer:bwe,validateDictionary:ywe,validateEncoding:_we,validateFunction:Swe,validateInt32:cwe,validateInteger:uwe,validateNumber:hwe,validateObject:pwe,validateOneOf:dwe,validatePlainFunction:Awe,validatePort:Ewe,validateSignalName:vwe,validateString:bR,validateUint32:H6,validateUndefined:Rwe,validateUnion:Twe,validateAbortSignal:V6,validateLinkHeaderValue:Owe}});var $s=Oe((GNe,X6)=>{var _r=X6.exports={},Ro,To;function _R(){throw new Error("setTimeout has not been defined")}o(_R,"defaultSetTimout");function ER(){throw new Error("clearTimeout has not been defined")}o(ER,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ro=setTimeout:Ro=_R}catch{Ro=_R}try{typeof clearTimeout=="function"?To=clearTimeout:To=ER}catch{To=ER}})();function K6(e){if(Ro===setTimeout)return setTimeout(e,0);if((Ro===_R||!Ro)&&setTimeout)return Ro=setTimeout,setTimeout(e,0);try{return Ro(e,0)}catch{try{return Ro.call(null,e,0)}catch{return Ro.call(this,e,0)}}}o(K6,"runTimeout");function Iwe(e){if(To===clearTimeout)return clearTimeout(e);if((To===ER||!To)&&clearTimeout)return To=clearTimeout,clearTimeout(e);try{return To(e)}catch{try{return To.call(null,e)}catch{return To.call(this,e)}}}o(Iwe,"runClearTimeout");var xa=[],Ac=!1,af,e0=-1;function Pwe(){!Ac||!af||(Ac=!1,af.length?xa=af.concat(xa):e0=-1,xa.length&&Y6())}o(Pwe,"cleanUpNextTick");function Y6(){if(!Ac){var e=K6(Pwe);Ac=!0;for(var t=xa.length;t;){for(af=xa,xa=[];++e0<t;)af&&af[e0].run();e0=-1,t=xa.length}af=null,Ac=!1,Iwe(e)}}o(Y6,"drainQueue");_r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];xa.push(new Z6(e,t)),xa.length===1&&!Ac&&K6(Y6)};function Z6(e,t){this.fun=e,this.array=t}o(Z6,"Item");Z6.prototype.run=function(){this.fun.apply(null,this.array)};_r.title="browser";_r.browser=!0;_r.env={};_r.argv=[];_r.version="";_r.versions={};function Oa(){}o(Oa,"noop");_r.on=Oa;_r.addListener=Oa;_r.once=Oa;_r.off=Oa;_r.removeListener=Oa;_r.removeAllListeners=Oa;_r.emit=Oa;_r.prependListener=Oa;_r.prependOnceListener=Oa;_r.listeners=function(e){return[]};_r.binding=function(e){throw new Error("process.binding is not supported")};_r.cwd=function(){return"/"};_r.chdir=function(e){throw new Error("process.chdir is not supported")};_r.umask=function(){return 0}});var Oo=Oe((YNe,hq)=>{"use strict";var{SymbolAsyncIterator:J6,SymbolIterator:Q6,SymbolFor:sf}=Zt(),eq=sf("nodejs.stream.destroyed"),tq=sf("nodejs.stream.errored"),SR=sf("nodejs.stream.readable"),AR=sf("nodejs.stream.writable"),rq=sf("nodejs.stream.disturbed"),Fwe=sf("nodejs.webstream.isClosedPromise"),kwe=sf("nodejs.webstream.controllerErrorFunction");function t0(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}o(t0,"isReadableNodeStream");function r0(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}o(r0,"isWritableNodeStream");function Bwe(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}o(Bwe,"isDuplexNodeStream");function xo(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}o(xo,"isNodeStream");function nq(e){return!!(e&&!xo(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}o(nq,"isReadableStream");function iq(e){return!!(e&&!xo(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}o(iq,"isWritableStream");function oq(e){return!!(e&&!xo(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}o(oq,"isTransformStream");function Cwe(e){return nq(e)||iq(e)||oq(e)}o(Cwe,"isWebStream");function Lwe(e,t){return e==null?!1:t===!0?typeof e[J6]=="function":t===!1?typeof e[Q6]=="function":typeof e[J6]=="function"||typeof e[Q6]=="function"}o(Lwe,"isIterable");function n0(e){if(!xo(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[eq]||n!=null&&n.destroyed)}o(n0,"isDestroyed");function aq(e){if(!r0(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}o(aq,"isWritableEnded");function Nwe(e,t){if(!r0(e))return null;if(e.writableFinished===!0)return!0;let r=e._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}o(Nwe,"isWritableFinished");function Dwe(e){if(!t0(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}o(Dwe,"isReadableEnded");function sq(e,t){if(!t0(e))return null;let r=e._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}o(sq,"isReadableFinished");function lq(e){return e&&e[SR]!=null?e[SR]:typeof e?.readable!="boolean"?null:n0(e)?!1:t0(e)&&e.readable&&!sq(e)}o(lq,"isReadable");function fq(e){return e&&e[AR]!=null?e[AR]:typeof e?.writable!="boolean"?null:n0(e)?!1:r0(e)&&e.writable&&!aq(e)}o(fq,"isWritable");function $we(e,t){return xo(e)?n0(e)?!0:!(t?.readable!==!1&&lq(e)||t?.writable!==!1&&fq(e)):null}o($we,"isFinished");function Uwe(e){var t,r;return xo(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}o(Uwe,"isWritableErrored");function Mwe(e){var t,r;return xo(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}o(Mwe,"isReadableErrored");function jwe(e){if(!xo(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,r=e._readableState;return typeof t?.closed=="boolean"||typeof r?.closed=="boolean"?t?.closed||r?.closed:typeof e._closed=="boolean"&&uq(e)?e._closed:null}o(jwe,"isClosed");function uq(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}o(uq,"isOutgoingMessage");function cq(e){return typeof e._sent100=="boolean"&&uq(e)}o(cq,"isServerResponse");function Wwe(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}o(Wwe,"isServerRequest");function qwe(e){if(!xo(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&cq(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}o(qwe,"willEmitClose");function Hwe(e){var t;return!!(e&&((t=e[rq])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}o(Hwe,"isDisturbed");function zwe(e){var t,r,n,a,s,i,u,h,c,d;return!!(e&&((t=(r=(n=(a=(s=(i=e[tq])!==null&&i!==void 0?i:e.readableErrored)!==null&&s!==void 0?s:e.writableErrored)!==null&&a!==void 0?a:(u=e._readableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&n!==void 0?n:(h=e._writableState)===null||h===void 0?void 0:h.errorEmitted)!==null&&r!==void 0?r:(c=e._readableState)===null||c===void 0?void 0:c.errored)!==null&&t!==void 0?t:!((d=e._writableState)===null||d===void 0)&&d.errored))}o(zwe,"isErrored");hq.exports={isDestroyed:n0,kIsDestroyed:eq,isDisturbed:Hwe,kIsDisturbed:rq,isErrored:zwe,kIsErrored:tq,isReadable:lq,kIsReadable:SR,kIsClosedPromise:Fwe,kControllerErrorFunction:kwe,kIsWritable:AR,isClosed:jwe,isDuplexNodeStream:Bwe,isFinished:$we,isIterable:Lwe,isReadableNodeStream:t0,isReadableStream:nq,isReadableEnded:Dwe,isReadableFinished:sq,isReadableErrored:Mwe,isNodeStream:xo,isWebStream:Cwe,isWritable:fq,isWritableNodeStream:r0,isWritableStream:iq,isWritableEnded:aq,isWritableFinished:Nwe,isWritableErrored:Uwe,isServerRequest:Wwe,isServerResponse:cq,willEmitClose:qwe,isTransformStream:oq}});var Ia=Oe((XNe,IR)=>{"use strict";var Us=$s(),{AbortError:_q,codes:Vwe}=un(),{ERR_INVALID_ARG_TYPE:Gwe,ERR_STREAM_PREMATURE_CLOSE:dq}=Vwe,{kEmptyObject:TR,once:xR}=_n(),{validateAbortSignal:Kwe,validateFunction:Ywe,validateObject:Zwe,validateBoolean:Xwe}=Sc(),{Promise:Jwe,PromisePrototypeThen:Qwe,SymbolDispose:Eq}=Zt(),{isClosed:e0e,isReadable:pq,isReadableNodeStream:RR,isReadableStream:t0e,isReadableFinished:yq,isReadableErrored:mq,isWritable:gq,isWritableNodeStream:wq,isWritableStream:r0e,isWritableFinished:vq,isWritableErrored:bq,isNodeStream:n0e,willEmitClose:i0e,kIsClosedPromise:o0e}=Oo(),Rc;function a0e(e){return e.setHeader&&typeof e.abort=="function"}o(a0e,"isRequest");var OR=o(()=>{},"nop");function Sq(e,t,r){var n,a;if(arguments.length===2?(r=t,t=TR):t==null?t=TR:Zwe(t,"options"),Ywe(r,"callback"),Kwe(t.signal,"options.signal"),r=xR(r),t0e(e)||r0e(e))return s0e(e,t,r);if(!n0e(e))throw new Gwe("stream",["ReadableStream","WritableStream","Stream"],e);let s=(n=t.readable)!==null&&n!==void 0?n:RR(e),i=(a=t.writable)!==null&&a!==void 0?a:wq(e),u=e._writableState,h=e._readableState,c=o(()=>{e.writable||m()},"onlegacyfinish"),d=i0e(e)&&RR(e)===s&&wq(e)===i,y=vq(e,!1),m=o(()=>{y=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||s))&&(!s||g)&&r.call(e)},"onfinish"),g=yq(e,!1),v=o(()=>{g=!0,e.destroyed&&(d=!1),!(d&&(!e.writable||i))&&(!i||y)&&r.call(e)},"onend"),_=o(A=>{r.call(e,A)},"onerror"),b=e0e(e),E=o(()=>{b=!0;let A=bq(e)||mq(e);if(A&&typeof A!="boolean")return r.call(e,A);if(s&&!g&&RR(e,!0)&&!yq(e,!1))return r.call(e,new dq);if(i&&!y&&!vq(e,!1))return r.call(e,new dq);r.call(e)},"onclose"),S=o(()=>{b=!0;let A=bq(e)||mq(e);if(A&&typeof A!="boolean")return r.call(e,A);r.call(e)},"onclosed"),T=o(()=>{e.req.on("finish",m)},"onrequest");a0e(e)?(e.on("complete",m),d||e.on("abort",E),e.req?T():e.on("request",T)):i&&!u&&(e.on("end",c),e.on("close",c)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",E),e.on("end",v),e.on("finish",m),t.error!==!1&&e.on("error",_),e.on("close",E),b?Us.nextTick(E):u!=null&&u.errorEmitted||h!=null&&h.errorEmitted?d||Us.nextTick(S):(!s&&(!d||pq(e))&&(y||gq(e)===!1)||!i&&(!d||gq(e))&&(g||pq(e)===!1)||h&&e.req&&e.aborted)&&Us.nextTick(S);let x=o(()=>{r=OR,e.removeListener("aborted",E),e.removeListener("complete",m),e.removeListener("abort",E),e.removeListener("request",T),e.req&&e.req.removeListener("finish",m),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",m),e.removeListener("end",v),e.removeListener("error",_),e.removeListener("close",E)},"cleanup");if(t.signal&&!b){let A=o(()=>{let B=r;x(),B.call(e,new _q(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)Us.nextTick(A);else{Rc=Rc||_n().addAbortListener;let B=Rc(t.signal,A),P=r;r=xR((...N)=>{B[Eq](),P.apply(e,N)})}}return x}o(Sq,"eos");function s0e(e,t,r){let n=!1,a=OR;if(t.signal)if(a=o(()=>{n=!0,r.call(e,new _q(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)Us.nextTick(a);else{Rc=Rc||_n().addAbortListener;let i=Rc(t.signal,a),u=r;r=xR((...h)=>{i[Eq](),u.apply(e,h)})}let s=o((...i)=>{n||Us.nextTick(()=>r.apply(e,i))},"resolverFn");return Qwe(e[o0e].promise,s,s),OR}o(s0e,"eosWeb");function l0e(e,t){var r;let n=!1;return t===null&&(t=TR),(r=t)!==null&&r!==void 0&&r.cleanup&&(Xwe(t.cleanup,"cleanup"),n=t.cleanup),new Jwe((a,s)=>{let i=Sq(e,t,u=>{n&&i(),u?s(u):a()})})}o(l0e,"finished");IR.exports=Sq;IR.exports.finished=l0e});var lf=Oe((QNe,Fq)=>{"use strict";var Io=$s(),{aggregateTwoErrors:f0e,codes:{ERR_MULTIPLE_CALLBACK:u0e},AbortError:c0e}=un(),{Symbol:Tq}=Zt(),{kIsDestroyed:h0e,isDestroyed:d0e,isFinished:p0e,isServerRequest:y0e}=Oo(),xq=Tq("kDestroy"),PR=Tq("kConstruct");function Oq(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}o(Oq,"checkError");function m0e(e,t){let r=this._readableState,n=this._writableState,a=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(Oq(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),a.constructed?Aq(this,e,t):this.once(xq,function(s){Aq(this,f0e(s,e),t)}),this)}o(m0e,"destroy");function Aq(e,t,r){let n=!1;function a(s){if(n)return;n=!0;let i=e._readableState,u=e._writableState;Oq(s,u,i),u&&(u.closed=!0),i&&(i.closed=!0),typeof r=="function"&&r(s),s?Io.nextTick(g0e,e,s):Io.nextTick(Iq,e)}o(a,"onDestroy");try{e._destroy(t||null,a)}catch(s){a(s)}}o(Aq,"_destroy");function g0e(e,t){FR(e,t),Iq(e)}o(g0e,"emitErrorCloseNT");function Iq(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}o(Iq,"emitCloseNT");function FR(e,t){let r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}o(FR,"emitErrorNT");function w0e(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}o(w0e,"undestroy");function kR(e,t,r){let n=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),n&&!n.errored&&(n.errored=t),r?Io.nextTick(FR,e,t):FR(e,t))}o(kR,"errorOrDestroy");function v0e(e,t){if(typeof e._construct!="function")return;let r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(PR,t),!(e.listenerCount(PR)>1)&&Io.nextTick(b0e,e)}o(v0e,"construct");function b0e(e){let t=!1;function r(n){if(t){kR(e,n??new u0e);return}t=!0;let a=e._readableState,s=e._writableState,i=s||a;a&&(a.constructed=!0),s&&(s.constructed=!0),i.destroyed?e.emit(xq,n):n?kR(e,n,!0):Io.nextTick(_0e,e)}o(r,"onConstruct");try{e._construct(n=>{Io.nextTick(r,n)})}catch(n){Io.nextTick(r,n)}}o(b0e,"constructNT");function _0e(e){e.emit(PR)}o(_0e,"emitConstructNT");function Rq(e){return e?.setHeader&&typeof e.abort=="function"}o(Rq,"isRequest");function Pq(e){e.emit("close")}o(Pq,"emitCloseLegacy");function E0e(e,t){e.emit("error",t),Io.nextTick(Pq,e)}o(E0e,"emitErrorCloseLegacy");function S0e(e,t){!e||d0e(e)||(!t&&!p0e(e)&&(t=new c0e),y0e(e)?(e.socket=null,e.destroy(t)):Rq(e)?e.abort():Rq(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Io.nextTick(E0e,e,t):Io.nextTick(Pq,e),e.destroyed||(e[h0e]=!0))}o(S0e,"destroyer");Fq.exports={construct:v0e,destroyer:S0e,destroy:m0e,undestroy:w0e,errorOrDestroy:kR}});var a0=Oe((tDe,Bq)=>{"use strict";var{ArrayIsArray:A0e,ObjectSetPrototypeOf:kq}=Zt(),{EventEmitter:i0}=(Gd(),Kt(Vd));function o0(e){i0.call(this,e)}o(o0,"Stream");kq(o0.prototype,i0.prototype);kq(o0,i0);o0.prototype.pipe=function(e,t){let r=this;function n(d){e.writable&&e.write(d)===!1&&r.pause&&r.pause()}o(n,"ondata"),r.on("data",n);function a(){r.readable&&r.resume&&r.resume()}o(a,"ondrain"),e.on("drain",a),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",i),r.on("close",u));let s=!1;function i(){s||(s=!0,e.end())}o(i,"onend");function u(){s||(s=!0,typeof e.destroy=="function"&&e.destroy())}o(u,"onclose");function h(d){c(),i0.listenerCount(this,"error")===0&&this.emit("error",d)}o(h,"onerror"),BR(r,"error",h),BR(e,"error",h);function c(){r.removeListener("data",n),e.removeListener("drain",a),r.removeListener("end",i),r.removeListener("close",u),r.removeListener("error",h),e.removeListener("error",h),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return o(c,"cleanup"),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e};function BR(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):A0e(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}o(BR,"prependListener");Bq.exports={Stream:o0,prependListener:BR}});var Kd=Oe((nDe,s0)=>{"use strict";var{SymbolDispose:R0e}=Zt(),{AbortError:Cq,codes:T0e}=un(),{isNodeStream:Lq,isWebStream:x0e,kControllerErrorFunction:O0e}=Oo(),I0e=Ia(),{ERR_INVALID_ARG_TYPE:Nq}=T0e,CR,P0e=o((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new Nq(t,"AbortSignal",e)},"validateAbortSignal");s0.exports.addAbortSignal=o(function(t,r){if(P0e(t,"signal"),!Lq(r)&&!x0e(r))throw new Nq("stream",["ReadableStream","WritableStream","Stream"],r);return s0.exports.addAbortSignalNoValidate(t,r)},"addAbortSignal");s0.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let r=Lq(t)?()=>{t.destroy(new Cq(void 0,{cause:e.reason}))}:()=>{t[O0e](new Cq(void 0,{cause:e.reason}))};if(e.aborted)r();else{CR=CR||_n().addAbortListener;let n=CR(e,r);I0e(t,n[R0e])}return t}});var Uq=Oe((oDe,$q)=>{"use strict";var{StringPrototypeSlice:Dq,SymbolIterator:F0e,TypedArrayPrototypeSet:l0,Uint8Array:k0e}=Zt(),{Buffer:LR}=(na(),Kt(ra)),{inspect:B0e}=_n(),Tc;$q.exports=(Tc=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return LR.alloc(0);let r=LR.allocUnsafe(t>>>0),n=this.head,a=0;for(;n;)l0(r,n.data,a),a+=n.data.length,n=n.next;return r}consume(t,r){let n=this.head.data;if(t<n.length){let a=n.slice(0,t);return this.head.data=n.slice(t),a}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[F0e](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,a=0;do{let s=n.data;if(t>s.length)r+=s,t-=s.length;else{t===s.length?(r+=s,++a,n.next?this.head=n.next:this.head=this.tail=null):(r+=Dq(s,0,t),this.head=n,n.data=Dq(s,t));break}++a}while((n=n.next)!==null);return this.length-=a,r}_getBuffer(t){let r=LR.allocUnsafe(t),n=t,a=this.head,s=0;do{let i=a.data;if(t>i.length)l0(r,i,n-t),t-=i.length;else{t===i.length?(l0(r,i,n-t),++s,a.next?this.head=a.next:this.head=this.tail=null):(l0(r,new k0e(i.buffer,i.byteOffset,t),n-t),this.head=a,a.data=i.slice(t));break}++s}while((a=a.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return B0e(this,{...r,depth:0,customInspect:!1})}},o(Tc,"BufferList"),Tc)});var Yd=Oe((sDe,qq)=>{"use strict";var{MathFloor:C0e,NumberIsInteger:L0e}=Zt(),{validateInteger:N0e}=Sc(),{ERR_INVALID_ARG_VALUE:D0e}=un().codes,Mq=16*1024,jq=16;function $0e(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}o($0e,"highWaterMarkFrom");function Wq(e){return e?jq:Mq}o(Wq,"getDefaultHighWaterMark");function U0e(e,t){N0e(t,"value",0),e?jq=t:Mq=t}o(U0e,"setDefaultHighWaterMark");function M0e(e,t,r,n){let a=$0e(t,n,r);if(a!=null){if(!L0e(a)||a<0){let s=n?`options.${r}`:"options.highWaterMark";throw new D0e(s,a)}return C0e(a)}return Wq(e.objectMode)}o(M0e,"getHighWaterMark");qq.exports={getHighWaterMark:M0e,getDefaultHighWaterMark:Wq,setDefaultHighWaterMark:U0e}});var Vq=Oe(zq=>{"use strict";var DR=Dh().Buffer,Hq=DR.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function j0e(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}o(j0e,"_normalizeEncoding");function W0e(e){var t=j0e(e);if(typeof t!="string"&&(DR.isEncoding===Hq||!Hq(e)))throw new Error("Unknown encoding: "+e);return t||e}o(W0e,"normalizeEncoding");zq.StringDecoder=Zd;function Zd(e){this.encoding=W0e(e);var t;switch(this.encoding){case"utf16le":this.text=K0e,this.end=Y0e,t=4;break;case"utf8":this.fillLast=z0e,t=4;break;case"base64":this.text=Z0e,this.end=X0e,t=3;break;default:this.write=J0e,this.end=Q0e;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=DR.allocUnsafe(t)}o(Zd,"StringDecoder");Zd.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Zd.prototype.end=G0e;Zd.prototype.text=V0e;Zd.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function NR(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}o(NR,"utf8CheckByte");function q0e(e,t,r){var n=t.length-1;if(n<r)return 0;var a=NR(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||a===-2?0:(a=NR(t[n]),a>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||a===-2?0:(a=NR(t[n]),a>=0?(a>0&&(a===2?a=0:e.lastNeed=a-3),a):0))}o(q0e,"utf8CheckIncomplete");function H0e(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}o(H0e,"utf8CheckExtraBytes");function z0e(e){var t=this.lastTotal-this.lastNeed,r=H0e(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}o(z0e,"utf8FillLast");function V0e(e,t){var r=q0e(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}o(V0e,"utf8Text");function G0e(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}o(G0e,"utf8End");function K0e(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}o(K0e,"utf16Text");function Y0e(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}o(Y0e,"utf16End");function Z0e(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}o(Z0e,"base64Text");function X0e(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}o(X0e,"base64End");function J0e(e){return e.toString(this.encoding)}o(J0e,"simpleWrite");function Q0e(e){return e&&e.length?this.write(e):""}o(Q0e,"simpleEnd")});var $R=Oe((cDe,Zq)=>{"use strict";var Gq=$s(),{PromisePrototypeThen:eve,SymbolAsyncIterator:Kq,SymbolIterator:Yq}=Zt(),{Buffer:tve}=(na(),Kt(ra)),{ERR_INVALID_ARG_TYPE:rve,ERR_STREAM_NULL_VALUES:nve}=un().codes;function ive(e,t,r){let n;if(typeof t=="string"||t instanceof tve)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let a;if(t&&t[Kq])a=!0,n=t[Kq]();else if(t&&t[Yq])a=!1,n=t[Yq]();else throw new rve("iterable",["Iterable"],t);let s=new e({objectMode:!0,highWaterMark:1,...r}),i=!1;s._read=function(){i||(i=!0,h())},s._destroy=function(c,d){eve(u(c),()=>Gq.nextTick(d,c),y=>Gq.nextTick(d,y||c))};async function u(c){let d=c!=null,y=typeof n.throw=="function";if(d&&y){let{value:m,done:g}=await n.throw(c);if(await m,g)return}if(typeof n.return=="function"){let{value:m}=await n.return();await m}}o(u,"close");async function h(){for(;;){try{let{value:c,done:d}=a?await n.next():n.next();if(d)s.push(null);else{let y=c&&typeof c.then=="function"?await c:c;if(y===null)throw i=!1,new nve;if(s.push(y))continue;i=!1}}catch(c){s.destroy(c)}break}}return o(h,"next"),s}o(ive,"from");Zq.exports=ive});var Jd=Oe((dDe,pH)=>{"use strict";var Ki=$s(),{ArrayPrototypeIndexOf:ove,NumberIsInteger:ave,NumberIsNaN:sve,NumberParseInt:lve,ObjectDefineProperties:VR,ObjectKeys:fve,ObjectSetPrototypeOf:Qq,Promise:eH,SafeSet:uve,SymbolAsyncDispose:cve,SymbolAsyncIterator:hve,Symbol:dve}=Zt();pH.exports=ot;ot.ReadableState=h0;var{EventEmitter:pve}=(Gd(),Kt(Vd)),{Stream:Ms,prependListener:yve}=a0(),{Buffer:UR}=(na(),Kt(ra)),{addAbortSignal:mve}=Kd(),tH=Ia(),dt=_n().debuglog("stream",e=>{dt=e}),gve=Uq(),Ic=lf(),{getHighWaterMark:wve,getDefaultHighWaterMark:vve}=Yd(),{aggregateTwoErrors:Xq,codes:{ERR_INVALID_ARG_TYPE:bve,ERR_METHOD_NOT_IMPLEMENTED:_ve,ERR_OUT_OF_RANGE:Eve,ERR_STREAM_PUSH_AFTER_EOF:Sve,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Ave},AbortError:Rve}=un(),{validateObject:Tve}=Sc(),ff=dve("kPaused"),{StringDecoder:rH}=Vq(),xve=$R();Qq(ot.prototype,Ms.prototype);Qq(ot,Ms);var MR=o(()=>{},"nop"),{errorOrDestroy:xc}=Ic,Oc=1,Ove=2,nH=4,Xd=8,iH=16,f0=32,u0=64,oH=128,Ive=256,Pve=512,Fve=1024,HR=2048,zR=4096,kve=8192,Bve=16384,Cve=32768,aH=65536,Lve=1<<17,Nve=1<<18;function kr(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}o(kr,"makeBitMapDescriptor");VR(h0.prototype,{objectMode:kr(Oc),ended:kr(Ove),endEmitted:kr(nH),reading:kr(Xd),constructed:kr(iH),sync:kr(f0),needReadable:kr(u0),emittedReadable:kr(oH),readableListening:kr(Ive),resumeScheduled:kr(Pve),errorEmitted:kr(Fve),emitClose:kr(HR),autoDestroy:kr(zR),destroyed:kr(kve),closed:kr(Bve),closeEmitted:kr(Cve),multiAwaitDrain:kr(aH),readingMore:kr(Lve),dataEmitted:kr(Nve)});function h0(e,t,r){typeof r!="boolean"&&(r=t instanceof Po()),this.state=HR|zR|iH|f0,e&&e.objectMode&&(this.state|=Oc),r&&e&&e.readableObjectMode&&(this.state|=Oc),this.highWaterMark=e?wve(this,e,"readableHighWaterMark",r):vve(!1),this.buffer=new gve,this.length=0,this.pipes=[],this.flowing=null,this[ff]=null,e&&e.emitClose===!1&&(this.state&=~HR),e&&e.autoDestroy===!1&&(this.state&=~zR),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new rH(e.encoding),this.encoding=e.encoding)}o(h0,"ReadableState");function ot(e){if(!(this instanceof ot))return new ot(e);let t=this instanceof Po();this._readableState=new h0(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&mve(e.signal,this)),Ms.call(this,e),Ic.construct(this,()=>{this._readableState.needReadable&&c0(this,this._readableState)})}o(ot,"Readable");ot.prototype.destroy=Ic.destroy;ot.prototype._undestroy=Ic.undestroy;ot.prototype._destroy=function(e,t){t(e)};ot.prototype[pve.captureRejectionSymbol]=function(e){this.destroy(e)};ot.prototype[cve]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new Rve,this.destroy(e)),new eH((t,r)=>tH(this,n=>n&&n!==e?r(n):t(null)))};ot.prototype.push=function(e,t){return sH(this,e,t,!1)};ot.prototype.unshift=function(e,t){return sH(this,e,t,!0)};function sH(e,t,r,n){dt("readableAddChunk",t);let a=e._readableState,s;if(a.state&Oc||(typeof t=="string"?(r=r||a.defaultEncoding,a.encoding!==r&&(n&&a.encoding?t=UR.from(t,r).toString(a.encoding):(t=UR.from(t,r),r=""))):t instanceof UR?r="":Ms._isUint8Array(t)?(t=Ms._uint8ArrayToBuffer(t),r=""):t!=null&&(s=new bve("chunk",["string","Buffer","Uint8Array"],t))),s)xc(e,s);else if(t===null)a.state&=~Xd,Uve(e,a);else if(a.state&Oc||t&&t.length>0)if(n)if(a.state&nH)xc(e,new Ave);else{if(a.destroyed||a.errored)return!1;jR(e,a,t,!0)}else if(a.ended)xc(e,new Sve);else{if(a.destroyed||a.errored)return!1;a.state&=~Xd,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?jR(e,a,t,!1):c0(e,a)):jR(e,a,t,!1)}else n||(a.state&=~Xd,c0(e,a));return!a.ended&&(a.length<a.highWaterMark||a.length===0)}o(sH,"readableAddChunk");function jR(e,t,r,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&aH?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.state&u0&&d0(e)),c0(e,t)}o(jR,"addChunk");ot.prototype.isPaused=function(){let e=this._readableState;return e[ff]===!0||e.flowing===!1};ot.prototype.setEncoding=function(e){let t=new rH(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let a of r)n+=t.write(a);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var Dve=1073741824;function $ve(e){if(e>Dve)throw new Eve("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}o($ve,"computeNewHighWaterMark");function Jq(e,t){return e<=0||t.length===0&&t.ended?0:t.state&Oc?1:sve(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}o(Jq,"howMuchToRead");ot.prototype.read=function(e){dt("read",e),e===void 0?e=NaN:ave(e)||(e=lve(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=$ve(e)),e!==0&&(t.state&=~oH),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return dt("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?WR(this):d0(this),null;if(e=Jq(e,t),e===0&&t.ended)return t.length===0&&WR(this),null;let n=(t.state&u0)!==0;if(dt("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,dt("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,dt("reading, ended or constructing",n);else if(n){dt("do read"),t.state|=Xd|f0,t.length===0&&(t.state|=u0);try{this._read(t.highWaterMark)}catch(s){xc(this,s)}t.state&=~f0,t.reading||(e=Jq(r,t))}let a;return e>0?a=hH(e,t):a=null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&WR(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",a)),a};function Uve(e,t){if(dt("onEofChunk"),!t.ended){if(t.decoder){let r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?d0(e):(t.needReadable=!1,t.emittedReadable=!0,lH(e))}}o(Uve,"onEofChunk");function d0(e){let t=e._readableState;dt("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(dt("emitReadable",t.flowing),t.emittedReadable=!0,Ki.nextTick(lH,e))}o(d0,"emitReadable");function lH(e){let t=e._readableState;dt("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,uH(e)}o(lH,"emitReadable_");function c0(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Ki.nextTick(Mve,e,t))}o(c0,"maybeReadMore");function Mve(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let r=t.length;if(dt("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}o(Mve,"maybeReadMore_");ot.prototype._read=function(e){throw new _ve("_read()")};ot.prototype.pipe=function(e,t){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new uve(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),dt("pipe count=%d opts=%j",n.pipes.length,t);let s=(!t||t.end!==!1)&&e!==Ki.stdout&&e!==Ki.stderr?u:b;n.endEmitted?Ki.nextTick(s):r.once("end",s),e.on("unpipe",i);function i(E,S){dt("onunpipe"),E===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,d())}o(i,"onunpipe");function u(){dt("onend"),e.end()}o(u,"onend");let h,c=!1;function d(){dt("cleanup"),e.removeListener("close",v),e.removeListener("finish",_),h&&e.removeListener("drain",h),e.removeListener("error",g),e.removeListener("unpipe",i),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",m),c=!0,h&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&h()}o(d,"cleanup");function y(){c||(n.pipes.length===1&&n.pipes[0]===e?(dt("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(dt("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),r.pause()),h||(h=jve(r,e),e.on("drain",h))}o(y,"pause"),r.on("data",m);function m(E){dt("ondata");let S=e.write(E);dt("dest.write",S),S===!1&&y()}o(m,"ondata");function g(E){if(dt("onerror",E),b(),e.removeListener("error",g),e.listenerCount("error")===0){let S=e._writableState||e._readableState;S&&!S.errorEmitted?xc(e,E):e.emit("error",E)}}o(g,"onerror"),yve(e,"error",g);function v(){e.removeListener("finish",_),b()}o(v,"onclose"),e.once("close",v);function _(){dt("onfinish"),e.removeListener("close",v),b()}o(_,"onfinish"),e.once("finish",_);function b(){dt("unpipe"),r.unpipe(e)}return o(b,"unpipe"),e.emit("pipe",r),e.writableNeedDrain===!0?y():n.flowing||(dt("pipe resume"),r.resume()),e};function jve(e,t){return o(function(){let n=e._readableState;n.awaitDrainWriters===t?(dt("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(dt("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()},"pipeOnDrainFunctionResult")}o(jve,"pipeOnDrain");ot.prototype.unpipe=function(e){let t=this._readableState,r={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let a=t.pipes;t.pipes=[],this.pause();for(let s=0;s<a.length;s++)a[s].emit("unpipe",this,{hasUnpiped:!1});return this}let n=ove(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,r),this)};ot.prototype.on=function(e,t){let r=Ms.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,dt("on readable",n.length,n.reading),n.length?d0(this):n.reading||Ki.nextTick(Wve,this)),r};ot.prototype.addListener=ot.prototype.on;ot.prototype.removeListener=function(e,t){let r=Ms.prototype.removeListener.call(this,e,t);return e==="readable"&&Ki.nextTick(fH,this),r};ot.prototype.off=ot.prototype.removeListener;ot.prototype.removeAllListeners=function(e){let t=Ms.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Ki.nextTick(fH,this),t};function fH(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[ff]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}o(fH,"updateReadableListening");function Wve(e){dt("readable nexttick read 0"),e.read(0)}o(Wve,"nReadingNextTick");ot.prototype.resume=function(){let e=this._readableState;return e.flowing||(dt("resume"),e.flowing=!e.readableListening,qve(this,e)),e[ff]=!1,this};function qve(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Ki.nextTick(Hve,e,t))}o(qve,"resume");function Hve(e,t){dt("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),uH(e),t.flowing&&!t.reading&&e.read(0)}o(Hve,"resume_");ot.prototype.pause=function(){return dt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(dt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ff]=!0,this};function uH(e){let t=e._readableState;for(dt("flow",t.flowing);t.flowing&&e.read()!==null;);}o(uH,"flow");ot.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{xc(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=fve(e);for(let n=1;n<r.length;n++){let a=r[n];this[a]===void 0&&typeof e[a]=="function"&&(this[a]=e[a].bind(e))}return this};ot.prototype[hve]=function(){return cH(this)};ot.prototype.iterator=function(e){return e!==void 0&&Tve(e,"options"),cH(this,e)};function cH(e,t){typeof e.read!="function"&&(e=ot.wrap(e,{objectMode:!0}));let r=zve(e,t);return r.stream=e,r}o(cH,"streamToAsyncIterator");async function*zve(e,t){let r=MR;function n(i){this===e?(r(),r=MR):r=i}o(n,"next"),e.on("readable",n);let a,s=tH(e,{writable:!1},i=>{a=i?Xq(a,i):null,r(),r=MR});try{for(;;){let i=e.destroyed?null:e.read();if(i!==null)yield i;else{if(a)throw a;if(a===null)return;await new eH(n)}}}catch(i){throw a=Xq(a,i),a}finally{(a||t?.destroyOnReturn!==!1)&&(a===void 0||e._readableState.autoDestroy)?Ic.destroyer(e,null):(e.off("readable",n),s())}}o(zve,"createAsyncIterator");VR(ot.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:o(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:o(function(){return this._readableState.flowing},"get"),set:o(function(e){this._readableState&&(this._readableState.flowing=e)},"set")},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});VR(h0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ff]!==!1},set(e){this[ff]=!!e}}});ot._fromList=hH;function hH(e,t){if(t.length===0)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}o(hH,"fromList");function WR(e){let t=e._readableState;dt("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Ki.nextTick(Vve,t,e))}o(WR,"endReadable");function Vve(e,t){if(dt("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Ki.nextTick(Gve,t);else if(e.autoDestroy){let r=t._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&t.destroy()}}}o(Vve,"endReadableNT");function Gve(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}o(Gve,"endWritableNT");ot.from=function(e,t){return xve(ot,e,t)};var qR;function dH(){return qR===void 0&&(qR={}),qR}o(dH,"lazyWebStreams");ot.fromWeb=function(e,t){return dH().newStreamReadableFromReadableStream(e,t)};ot.toWeb=function(e,t){return dH().newReadableStreamFromStreamReadable(e,t)};ot.wrap=function(e,t){var r,n;return new ot({objectMode:(r=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&r!==void 0?r:!0,...t,destroy(a,s){Ic.destroyer(e,a),s(a)}}).wrap(e)}});var w0=Oe((yDe,TH)=>{"use strict";var uf=$s(),{ArrayPrototypeSlice:gH,Error:Kve,FunctionPrototypeSymbolHasInstance:wH,ObjectDefineProperty:vH,ObjectDefineProperties:Yve,ObjectSetPrototypeOf:bH,StringPrototypeToLowerCase:Zve,Symbol:Xve,SymbolHasInstance:Jve}=Zt();TH.exports=ar;ar.WritableState=tp;var{EventEmitter:Qve}=(Gd(),Kt(Vd)),Qd=a0().Stream,{Buffer:p0}=(na(),Kt(ra)),g0=lf(),{addAbortSignal:ebe}=Kd(),{getHighWaterMark:tbe,getDefaultHighWaterMark:rbe}=Yd(),{ERR_INVALID_ARG_TYPE:nbe,ERR_METHOD_NOT_IMPLEMENTED:ibe,ERR_MULTIPLE_CALLBACK:_H,ERR_STREAM_CANNOT_PIPE:obe,ERR_STREAM_DESTROYED:ep,ERR_STREAM_ALREADY_FINISHED:abe,ERR_STREAM_NULL_VALUES:sbe,ERR_STREAM_WRITE_AFTER_END:lbe,ERR_UNKNOWN_ENCODING:EH}=un().codes,{errorOrDestroy:Pc}=g0;bH(ar.prototype,Qd.prototype);bH(ar,Qd);function YR(){}o(YR,"nop");var Fc=Xve("kOnFinished");function tp(e,t,r){typeof r!="boolean"&&(r=t instanceof Po()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?tbe(this,e,"writableHighWaterMark",r):rbe(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ube.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,m0(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Fc]=[]}o(tp,"WritableState");function m0(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}o(m0,"resetBuffer");tp.prototype.getBuffer=o(function(){return gH(this.buffered,this.bufferedIndex)},"getBuffer");vH(tp.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function ar(e){let t=this instanceof Po();if(!t&&!wH(ar,this))return new ar(e);this._writableState=new tp(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&ebe(e.signal,this)),Qd.call(this,e),g0.construct(this,()=>{let r=this._writableState;r.writing||XR(this,r),JR(this,r)})}o(ar,"Writable");vH(ar,Jve,{__proto__:null,value:o(function(e){return wH(this,e)?!0:this!==ar?!1:e&&e._writableState instanceof tp},"value")});ar.prototype.pipe=function(){Pc(this,new obe)};function SH(e,t,r,n){let a=e._writableState;if(typeof r=="function")n=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!=="buffer"&&!p0.isEncoding(r))throw new EH(r);typeof n!="function"&&(n=YR)}if(t===null)throw new sbe;if(!a.objectMode)if(typeof t=="string")a.decodeStrings!==!1&&(t=p0.from(t,r),r="buffer");else if(t instanceof p0)r="buffer";else if(Qd._isUint8Array(t))t=Qd._uint8ArrayToBuffer(t),r="buffer";else throw new nbe("chunk",["string","Buffer","Uint8Array"],t);let s;return a.ending?s=new lbe:a.destroyed&&(s=new ep("write")),s?(uf.nextTick(n,s),Pc(e,s,!0),s):(a.pendingcb++,fbe(e,a,t,r,n))}o(SH,"_write");ar.prototype.write=function(e,t,r){return SH(this,e,t,r)===!0};ar.prototype.cork=function(){this._writableState.corked++};ar.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||XR(this,e))};ar.prototype.setDefaultEncoding=o(function(t){if(typeof t=="string"&&(t=Zve(t)),!p0.isEncoding(t))throw new EH(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function fbe(e,t,r,n,a){let s=t.objectMode?1:r.length;t.length+=s;let i=t.length<t.highWaterMark;return i||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:a}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&a!==YR&&(t.allNoop=!1)):(t.writelen=s,t.writecb=a,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),i&&!t.errored&&!t.destroyed}o(fbe,"writeOrBuffer");function yH(e,t,r,n,a,s,i){t.writelen=n,t.writecb=i,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new ep("write")):r?e._writev(a,t.onwrite):e._write(a,s,t.onwrite),t.sync=!1}o(yH,"doWrite");function mH(e,t,r,n){--t.pendingcb,n(r),ZR(t),Pc(e,r)}o(mH,"onwriteError");function ube(e,t){let r=e._writableState,n=r.sync,a=r.writecb;if(typeof a!="function"){Pc(e,new _H);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?uf.nextTick(mH,e,r,t,a):mH(e,r,t,a)):(r.buffered.length>r.bufferedIndex&&XR(e,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},uf.nextTick(cbe,r.afterWriteTickInfo)):AH(e,r,1,a))}o(ube,"onwrite");function cbe({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,AH(e,t,r,n)}o(cbe,"afterWriteTick");function AH(e,t,r,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&ZR(t),JR(e,t)}o(AH,"afterWrite");function ZR(e){if(e.writing)return;for(let a=e.bufferedIndex;a<e.buffered.length;++a){var t;let{chunk:s,callback:i}=e.buffered[a],u=e.objectMode?1:s.length;e.length-=u,i((t=e.errored)!==null&&t!==void 0?t:new ep("write"))}let r=e[Fc].splice(0);for(let a=0;a<r.length;a++){var n;r[a]((n=e.errored)!==null&&n!==void 0?n:new ep("end"))}m0(e)}o(ZR,"errorBuffer");function XR(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:a}=t,s=r.length-n;if(!s)return;let i=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let u=t.allNoop?YR:c=>{for(let d=i;d<r.length;++d)r[d].callback(c)},h=t.allNoop&&i===0?r:gH(r,i);h.allBuffers=t.allBuffers,yH(e,t,!0,t.length,h,"",u),m0(t)}else{do{let{chunk:u,encoding:h,callback:c}=r[i];r[i++]=null;let d=a?1:u.length;yH(e,t,!1,d,u,h,c)}while(i<r.length&&!t.writing);i===r.length?m0(t):i>256?(r.splice(0,i),t.bufferedIndex=0):t.bufferedIndex=i}t.bufferProcessing=!1}o(XR,"clearBuffer");ar.prototype._write=function(e,t,r){if(this._writev)this._writev([{chunk:e,encoding:t}],r);else throw new ibe("_write()")};ar.prototype._writev=null;ar.prototype.end=function(e,t,r){let n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null);let a;if(e!=null){let s=SH(this,e,t);s instanceof Kve&&(a=s)}return n.corked&&(n.corked=1,this.uncork()),a||(!n.errored&&!n.ending?(n.ending=!0,JR(this,n,!0),n.ended=!0):n.finished?a=new abe("end"):n.destroyed&&(a=new ep("end"))),typeof r=="function"&&(a||n.finished?uf.nextTick(r,a):n[Fc].push(r)),this};function y0(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}o(y0,"needFinish");function hbe(e,t){let r=!1;function n(a){if(r){Pc(e,a??_H());return}if(r=!0,t.pendingcb--,a){let s=t[Fc].splice(0);for(let i=0;i<s.length;i++)s[i](a);Pc(e,a,t.sync)}else y0(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,uf.nextTick(KR,e,t))}o(n,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(n)}catch(a){n(a)}t.sync=!1}o(hbe,"callFinal");function dbe(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,hbe(e,t)):(t.prefinished=!0,e.emit("prefinish")))}o(dbe,"prefinish");function JR(e,t,r){y0(t)&&(dbe(e,t),t.pendingcb===0&&(r?(t.pendingcb++,uf.nextTick((n,a)=>{y0(a)?KR(n,a):a.pendingcb--},e,t)):y0(t)&&(t.pendingcb++,KR(e,t))))}o(JR,"finishMaybe");function KR(e,t){t.pendingcb--,t.finished=!0;let r=t[Fc].splice(0);for(let n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}o(KR,"finish");Yve(ar.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:o(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var pbe=g0.destroy;ar.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Fc].length)&&uf.nextTick(ZR,r),pbe.call(this,e,t),this};ar.prototype._undestroy=g0.undestroy;ar.prototype._destroy=function(e,t){t(e)};ar.prototype[Qve.captureRejectionSymbol]=function(e){this.destroy(e)};var GR;function RH(){return GR===void 0&&(GR={}),GR}o(RH,"lazyWebStreams");ar.fromWeb=function(e,t){return RH().newStreamWritableFromWritableStream(e,t)};ar.toWeb=function(e){return RH().newWritableStreamFromStreamWritable(e)}});var jH=Oe((gDe,MH)=>{var QR=$s(),ybe=(na(),Kt(ra)),{isReadable:mbe,isWritable:gbe,isIterable:xH,isNodeStream:wbe,isReadableNodeStream:OH,isWritableNodeStream:IH,isDuplexNodeStream:vbe,isReadableStream:PH,isWritableStream:FH}=Oo(),kH=Ia(),{AbortError:$H,codes:{ERR_INVALID_ARG_TYPE:bbe,ERR_INVALID_RETURN_VALUE:BH}}=un(),{destroyer:Bc}=lf(),_be=Po(),UH=Jd(),Ebe=w0(),{createDeferredPromise:CH}=_n(),LH=$R(),NH=globalThis.Blob||ybe.Blob,Sbe=o(typeof NH<"u"?function(t){return t instanceof NH}:function(t){return!1},"isBlob"),Abe=globalThis.AbortController||_c().AbortController,{FunctionPrototypeCall:DH}=Zt(),eT=class eT extends _be{constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};o(eT,"Duplexify");var js=eT;MH.exports=o(function e(t,r){if(vbe(t))return t;if(OH(t))return kc({readable:t});if(IH(t))return kc({writable:t});if(wbe(t))return kc({writable:!1,readable:!1});if(PH(t))return kc({readable:UH.fromWeb(t)});if(FH(t))return kc({writable:Ebe.fromWeb(t)});if(typeof t=="function"){let{value:a,write:s,final:i,destroy:u}=Rbe(t);if(xH(a))return LH(js,a,{objectMode:!0,write:s,final:i,destroy:u});let h=a?.then;if(typeof h=="function"){let c,d=DH(h,a,y=>{if(y!=null)throw new BH("nully","body",y)},y=>{Bc(c,y)});return c=new js({objectMode:!0,readable:!1,write:s,final(y){i(async()=>{try{await d,QR.nextTick(y,null)}catch(m){QR.nextTick(y,m)}})},destroy:u})}throw new BH("Iterable, AsyncIterable or AsyncFunction",r,a)}if(Sbe(t))return e(t.arrayBuffer());if(xH(t))return LH(js,t,{objectMode:!0,writable:!1});if(PH(t?.readable)&&FH(t?.writable))return js.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let a=t!=null&&t.readable?OH(t?.readable)?t?.readable:e(t.readable):void 0,s=t!=null&&t.writable?IH(t?.writable)?t?.writable:e(t.writable):void 0;return kc({readable:a,writable:s})}let n=t?.then;if(typeof n=="function"){let a;return DH(n,t,s=>{s!=null&&a.push(s),a.push(null)},s=>{Bc(a,s)}),a=new js({objectMode:!0,writable:!1,read(){}})}throw new bbe(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function Rbe(e){let{promise:t,resolve:r}=CH(),n=new Abe,a=n.signal;return{value:e(async function*(){for(;;){let i=t;t=null;let{chunk:u,done:h,cb:c}=await i;if(QR.nextTick(c),h)return;if(a.aborted)throw new $H(void 0,{cause:a.reason});({promise:t,resolve:r}=CH()),yield u}}(),{signal:a}),write(i,u,h){let c=r;r=null,c({chunk:i,done:!1,cb:h})},final(i){let u=r;r=null,u({done:!0,cb:i})},destroy(i,u){n.abort(),u(i)}}}o(Rbe,"fromAsyncGen");function kc(e){let t=e.readable&&typeof e.readable.read!="function"?UH.wrap(e.readable):e.readable,r=e.writable,n=!!mbe(t),a=!!gbe(r),s,i,u,h,c;function d(y){let m=h;h=null,m?m(y):y&&c.destroy(y)}return o(d,"onfinished"),c=new js({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:a}),a&&(kH(r,y=>{a=!1,y&&Bc(t,y),d(y)}),c._write=function(y,m,g){r.write(y,m)?g():s=g},c._final=function(y){r.end(),i=y},r.on("drain",function(){if(s){let y=s;s=null,y()}}),r.on("finish",function(){if(i){let y=i;i=null,y()}})),n&&(kH(t,y=>{n=!1,y&&Bc(t,y),d(y)}),t.on("readable",function(){if(u){let y=u;u=null,y()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){let y=t.read();if(y===null){u=c._read;return}if(!c.push(y))return}}),c._destroy=function(y,m){!y&&h!==null&&(y=new $H),u=null,s=null,i=null,h===null?m(y):(h=m,Bc(r,y),Bc(t,y))},c}o(kc,"_duplexify")});var Po=Oe((vDe,HH)=>{"use strict";var{ObjectDefineProperties:Tbe,ObjectGetOwnPropertyDescriptor:Pa,ObjectKeys:xbe,ObjectSetPrototypeOf:WH}=Zt();HH.exports=Yi;var nT=Jd(),Fi=w0();WH(Yi.prototype,nT.prototype);WH(Yi,nT);{let e=xbe(Fi.prototype);for(let t=0;t<e.length;t++){let r=e[t];Yi.prototype[r]||(Yi.prototype[r]=Fi.prototype[r])}}function Yi(e){if(!(this instanceof Yi))return new Yi(e);nT.call(this,e),Fi.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}o(Yi,"Duplex");Tbe(Yi.prototype,{writable:{__proto__:null,...Pa(Fi.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Pa(Fi.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Pa(Fi.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Pa(Fi.prototype,"writableBuffer")},writableLength:{__proto__:null,...Pa(Fi.prototype,"writableLength")},writableFinished:{__proto__:null,...Pa(Fi.prototype,"writableFinished")},writableCorked:{__proto__:null,...Pa(Fi.prototype,"writableCorked")},writableEnded:{__proto__:null,...Pa(Fi.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Pa(Fi.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var tT;function qH(){return tT===void 0&&(tT={}),tT}o(qH,"lazyWebStreams");Yi.fromWeb=function(e,t){return qH().newStreamDuplexFromReadableWritablePair(e,t)};Yi.toWeb=function(e){return qH().newReadableWritablePairFromDuplex(e)};var rT;Yi.from=function(e){return rT||(rT=jH()),rT(e,"body")}});var aT=Oe((_De,VH)=>{"use strict";var{ObjectSetPrototypeOf:zH,Symbol:Obe}=Zt();VH.exports=Fa;var{ERR_METHOD_NOT_IMPLEMENTED:Ibe}=un().codes,oT=Po(),{getHighWaterMark:Pbe}=Yd();zH(Fa.prototype,oT.prototype);zH(Fa,oT);var rp=Obe("kCallback");function Fa(e){if(!(this instanceof Fa))return new Fa(e);let t=e?Pbe(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),oT.call(this,e),this._readableState.sync=!1,this[rp]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Fbe)}o(Fa,"Transform");function iT(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}o(iT,"final");function Fbe(){this._final!==iT&&iT.call(this)}o(Fbe,"prefinish");Fa.prototype._final=iT;Fa.prototype._transform=function(e,t,r){throw new Ibe("_transform()")};Fa.prototype._write=function(e,t,r){let n=this._readableState,a=this._writableState,s=n.length;this._transform(e,t,(i,u)=>{if(i){r(i);return}u!=null&&this.push(u),a.ended||s===n.length||n.length<n.highWaterMark?r():this[rp]=r})};Fa.prototype._read=function(){if(this[rp]){let e=this[rp];this[rp]=null,e()}}});var lT=Oe((SDe,KH)=>{"use strict";var{ObjectSetPrototypeOf:GH}=Zt();KH.exports=Cc;var sT=aT();GH(Cc.prototype,sT.prototype);GH(Cc,sT);function Cc(e){if(!(this instanceof Cc))return new Cc(e);sT.call(this,e)}o(Cc,"PassThrough");Cc.prototype._transform=function(e,t,r){r(null,e)}});var E0=Oe((RDe,QH)=>{var np=$s(),{ArrayIsArray:kbe,Promise:Bbe,SymbolAsyncIterator:Cbe,SymbolDispose:Lbe}=Zt(),_0=Ia(),{once:Nbe}=_n(),Dbe=lf(),YH=Po(),{aggregateTwoErrors:$be,codes:{ERR_INVALID_ARG_TYPE:gT,ERR_INVALID_RETURN_VALUE:fT,ERR_MISSING_ARGS:Ube,ERR_STREAM_DESTROYED:Mbe,ERR_STREAM_PREMATURE_CLOSE:jbe},AbortError:Wbe}=un(),{validateFunction:qbe,validateAbortSignal:Hbe}=Sc(),{isIterable:cf,isReadable:uT,isReadableNodeStream:b0,isNodeStream:ZH,isTransformStream:Lc,isWebStream:zbe,isReadableStream:cT,isReadableFinished:Vbe}=Oo(),Gbe=globalThis.AbortController||_c().AbortController,hT,dT,pT;function XH(e,t,r){let n=!1;e.on("close",()=>{n=!0});let a=_0(e,{readable:t,writable:r},s=>{n=!s});return{destroy:o(s=>{n||(n=!0,Dbe.destroyer(e,s||new Mbe("pipe")))},"destroy"),cleanup:a}}o(XH,"destroyer");function Kbe(e){return qbe(e[e.length-1],"streams[stream.length - 1]"),e.pop()}o(Kbe,"popCallback");function yT(e){if(cf(e))return e;if(b0(e))return Ybe(e);throw new gT("val",["Readable","Iterable","AsyncIterable"],e)}o(yT,"makeAsyncIterable");async function*Ybe(e){dT||(dT=Jd()),yield*dT.prototype[Cbe].call(e)}o(Ybe,"fromReadable");async function v0(e,t,r,{end:n}){let a,s=null,i=o(c=>{if(c&&(a=c),s){let d=s;s=null,d()}},"resume"),u=o(()=>new Bbe((c,d)=>{a?d(a):s=o(()=>{a?d(a):c()},"onresolve")}),"wait");t.on("drain",i);let h=_0(t,{readable:!1},i);try{t.writableNeedDrain&&await u();for await(let c of e)t.write(c)||await u();n&&(t.end(),await u()),r()}catch(c){r(a!==c?$be(a,c):c)}finally{h(),t.off("drain",i)}}o(v0,"pumpToNode");async function mT(e,t,r,{end:n}){Lc(t)&&(t=t.writable);let a=t.getWriter();try{for await(let s of e)await a.ready,a.write(s).catch(()=>{});await a.ready,n&&await a.close(),r()}catch(s){try{await a.abort(s),r(s)}catch(i){r(i)}}}o(mT,"pumpToWeb");function Zbe(...e){return JH(e,Nbe(Kbe(e)))}o(Zbe,"pipeline");function JH(e,t,r){if(e.length===1&&kbe(e[0])&&(e=e[0]),e.length<2)throw new Ube("streams");let n=new Gbe,a=n.signal,s=r?.signal,i=[];Hbe(s,"options.signal");function u(){v(new Wbe)}o(u,"abort"),pT=pT||_n().addAbortListener;let h;s&&(h=pT(s,u));let c,d,y=[],m=0;function g(T){v(T,--m===0)}o(g,"finish");function v(T,x){var A;if(T&&(!c||c.code==="ERR_STREAM_PREMATURE_CLOSE")&&(c=T),!(!c&&!x)){for(;y.length;)y.shift()(c);(A=h)===null||A===void 0||A[Lbe](),n.abort(),x&&(c||i.forEach(B=>B()),np.nextTick(t,c,d))}}o(v,"finishImpl");let _;for(let T=0;T<e.length;T++){let x=e[T],A=T<e.length-1,B=T>0,P=A||r?.end!==!1,N=T===e.length-1;if(ZH(x)){let L=function(C){C&&C.name!=="AbortError"&&C.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(C)};var S=L;if(o(L,"onError"),P){let{destroy:C,cleanup:z}=XH(x,A,B);y.push(C),uT(x)&&N&&i.push(z)}x.on("error",L),uT(x)&&N&&i.push(()=>{x.removeListener("error",L)})}if(T===0)if(typeof x=="function"){if(_=x({signal:a}),!cf(_))throw new fT("Iterable, AsyncIterable or Stream","source",_)}else cf(x)||b0(x)||Lc(x)?_=x:_=YH.from(x);else if(typeof x=="function"){if(Lc(_)){var b;_=yT((b=_)===null||b===void 0?void 0:b.readable)}else _=yT(_);if(_=x(_,{signal:a}),A){if(!cf(_,!0))throw new fT("AsyncIterable",`transform[${T-1}]`,_)}else{var E;hT||(hT=lT());let L=new hT({objectMode:!0}),C=(E=_)===null||E===void 0?void 0:E.then;if(typeof C=="function")m++,C.call(_,Q=>{d=Q,Q!=null&&L.write(Q),P&&L.end(),np.nextTick(g)},Q=>{L.destroy(Q),np.nextTick(g,Q)});else if(cf(_,!0))m++,v0(_,L,g,{end:P});else if(cT(_)||Lc(_)){let Q=_.readable||_;m++,v0(Q,L,g,{end:P})}else throw new fT("AsyncIterable or Promise","destination",_);_=L;let{destroy:z,cleanup:V}=XH(_,!1,!0);y.push(z),N&&i.push(V)}}else if(ZH(x)){if(b0(_)){m+=2;let L=Xbe(_,x,g,{end:P});uT(x)&&N&&i.push(L)}else if(Lc(_)||cT(_)){let L=_.readable||_;m++,v0(L,x,g,{end:P})}else if(cf(_))m++,v0(_,x,g,{end:P});else throw new gT("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=x}else if(zbe(x)){if(b0(_))m++,mT(yT(_),x,g,{end:P});else if(cT(_)||cf(_))m++,mT(_,x,g,{end:P});else if(Lc(_))m++,mT(_.readable,x,g,{end:P});else throw new gT("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=x}else _=YH.from(x)}return(a!=null&&a.aborted||s!=null&&s.aborted)&&np.nextTick(u),_}o(JH,"pipelineImpl");function Xbe(e,t,r,{end:n}){let a=!1;if(t.on("close",()=>{a||r(new jbe)}),e.pipe(t,{end:!1}),n){let i=function(){a=!0,t.end()};var s=i;o(i,"endFn"),Vbe(e)?np.nextTick(i):e.once("end",i)}else r();return _0(e,{readable:!0,writable:!1},i=>{let u=e._readableState;i&&i.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?e.once("end",r).once("error",r):r(i)}),_0(t,{readable:!1,writable:!0},r)}o(Xbe,"pipe");QH.exports={pipelineImpl:JH,pipeline:Zbe}});var vT=Oe((xDe,o9)=>{"use strict";var{pipeline:Jbe}=E0(),S0=Po(),{destroyer:Qbe}=lf(),{isNodeStream:A0,isReadable:e9,isWritable:t9,isWebStream:wT,isTransformStream:hf,isWritableStream:r9,isReadableStream:n9}=Oo(),{AbortError:e_e,codes:{ERR_INVALID_ARG_VALUE:i9,ERR_MISSING_ARGS:t_e}}=un(),r_e=Ia();o9.exports=o(function(...t){if(t.length===0)throw new t_e("streams");if(t.length===1)return S0.from(t[0]);let r=[...t];if(typeof t[0]=="function"&&(t[0]=S0.from(t[0])),typeof t[t.length-1]=="function"){let g=t.length-1;t[g]=S0.from(t[g])}for(let g=0;g<t.length;++g)if(!(!A0(t[g])&&!wT(t[g]))){if(g<t.length-1&&!(e9(t[g])||n9(t[g])||hf(t[g])))throw new i9(`streams[${g}]`,r[g],"must be readable");if(g>0&&!(t9(t[g])||r9(t[g])||hf(t[g])))throw new i9(`streams[${g}]`,r[g],"must be writable")}let n,a,s,i,u;function h(g){let v=i;i=null,v?v(g):g?u.destroy(g):!m&&!y&&u.destroy()}o(h,"onfinished");let c=t[0],d=Jbe(t,h),y=!!(t9(c)||r9(c)||hf(c)),m=!!(e9(d)||n9(d)||hf(d));if(u=new S0({writableObjectMode:!!(c!=null&&c.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:y,readable:m}),y){if(A0(c))u._write=function(v,_,b){c.write(v,_)?b():n=b},u._final=function(v){c.end(),a=v},c.on("drain",function(){if(n){let v=n;n=null,v()}});else if(wT(c)){let _=(hf(c)?c.writable:c).getWriter();u._write=async function(b,E,S){try{await _.ready,_.write(b).catch(()=>{}),S()}catch(T){S(T)}},u._final=async function(b){try{await _.ready,_.close().catch(()=>{}),a=b}catch(E){b(E)}}}let g=hf(d)?d.readable:d;r_e(g,()=>{if(a){let v=a;a=null,v()}})}if(m){if(A0(d))d.on("readable",function(){if(s){let g=s;s=null,g()}}),d.on("end",function(){u.push(null)}),u._read=function(){for(;;){let g=d.read();if(g===null){s=u._read;return}if(!u.push(g))return}};else if(wT(d)){let v=(hf(d)?d.readable:d).getReader();u._read=async function(){for(;;)try{let{value:_,done:b}=await v.read();if(!u.push(_))return;if(b){u.push(null);return}}catch{return}}}}return u._destroy=function(g,v){!g&&i!==null&&(g=new e_e),s=null,n=null,a=null,i===null?v(g):(i=v,A0(d)&&Qbe(d,g))},u},"compose")});var y9=Oe((IDe,ET)=>{"use strict";var n_e=globalThis.AbortController||_c().AbortController,{codes:{ERR_INVALID_ARG_VALUE:i_e,ERR_INVALID_ARG_TYPE:ip,ERR_MISSING_ARGS:o_e,ERR_OUT_OF_RANGE:a_e},AbortError:Fo}=un(),{validateAbortSignal:df,validateInteger:a9,validateObject:pf}=Sc(),s_e=Zt().Symbol("kWeak"),l_e=Zt().Symbol("kResistStopPropagation"),{finished:f_e}=Ia(),u_e=vT(),{addAbortSignalNoValidate:c_e}=Kd(),{isWritable:h_e,isNodeStream:d_e}=Oo(),{deprecate:p_e}=_n(),{ArrayPrototypePush:y_e,Boolean:m_e,MathFloor:s9,Number:g_e,NumberIsNaN:w_e,Promise:l9,PromiseReject:f9,PromiseResolve:v_e,PromisePrototypeThen:u9,Symbol:h9}=Zt(),R0=h9("kEmpty"),c9=h9("kEof");function b_e(e,t){if(t!=null&&pf(t,"options"),t?.signal!=null&&df(t.signal,"options.signal"),d_e(e)&&!h_e(e))throw new i_e("stream",e,"must be writable");let r=u_e(this,e);return t!=null&&t.signal&&c_e(t.signal,r),r}o(b_e,"compose");function T0(e,t){if(typeof e!="function")throw new ip("fn",["Function","AsyncFunction"],e);t!=null&&pf(t,"options"),t?.signal!=null&&df(t.signal,"options.signal");let r=1;t?.concurrency!=null&&(r=s9(t.concurrency));let n=r-1;return t?.highWaterMark!=null&&(n=s9(t.highWaterMark)),a9(r,"options.concurrency",1),a9(n,"options.highWaterMark",0),n+=r,o(async function*(){let s=_n().AbortSignalAny([t?.signal].filter(m_e)),i=this,u=[],h={signal:s},c,d,y=!1,m=0;function g(){y=!0,v()}o(g,"onCatch");function v(){m-=1,_()}o(v,"afterItemProcessed");function _(){d&&!y&&m<r&&u.length<n&&(d(),d=null)}o(_,"maybeResume");async function b(){try{for await(let E of i){if(y)return;if(s.aborted)throw new Fo;try{if(E=e(E,h),E===R0)continue;E=v_e(E)}catch(S){E=f9(S)}m+=1,u9(E,v,g),u.push(E),c&&(c(),c=null),!y&&(u.length>=n||m>=r)&&await new l9(S=>{d=S})}u.push(c9)}catch(E){let S=f9(E);u9(S,v,g),u.push(S)}finally{y=!0,c&&(c(),c=null)}}o(b,"pump"),b();try{for(;;){for(;u.length>0;){let E=await u[0];if(E===c9)return;if(s.aborted)throw new Fo;E!==R0&&(yield E),u.shift(),_()}await new l9(E=>{c=E})}}finally{y=!0,d&&(d(),d=null)}},"map").call(this)}o(T0,"map");function __e(e=void 0){return e!=null&&pf(e,"options"),e?.signal!=null&&df(e.signal,"options.signal"),o(async function*(){let r=0;for await(let a of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Fo({cause:e.signal.reason});yield[r++,a]}},"asIndexedPairs").call(this)}o(__e,"asIndexedPairs");async function d9(e,t=void 0){for await(let r of _T.call(this,e,t))return!0;return!1}o(d9,"some");async function E_e(e,t=void 0){if(typeof e!="function")throw new ip("fn",["Function","AsyncFunction"],e);return!await d9.call(this,async(...r)=>!await e(...r),t)}o(E_e,"every");async function S_e(e,t){for await(let r of _T.call(this,e,t))return r}o(S_e,"find");async function A_e(e,t){if(typeof e!="function")throw new ip("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a),R0}o(r,"forEachFn");for await(let n of T0.call(this,r,t));}o(A_e,"forEach");function _T(e,t){if(typeof e!="function")throw new ip("fn",["Function","AsyncFunction"],e);async function r(n,a){return await e(n,a)?n:R0}return o(r,"filterFn"),T0.call(this,r,t)}o(_T,"filter");var ST=class ST extends o_e{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};o(ST,"ReduceAwareErrMissingArgs");var bT=ST;async function R_e(e,t,r){var n;if(typeof e!="function")throw new ip("reducer",["Function","AsyncFunction"],e);r!=null&&pf(r,"options"),r?.signal!=null&&df(r.signal,"options.signal");let a=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let c=new Fo(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await f_e(this.destroy(c)),c}let s=new n_e,i=s.signal;if(r!=null&&r.signal){let c={once:!0,[s_e]:this,[l_e]:!0};r.signal.addEventListener("abort",()=>s.abort(),c)}let u=!1;try{for await(let c of this){var h;if(u=!0,r!=null&&(h=r.signal)!==null&&h!==void 0&&h.aborted)throw new Fo;a?t=await e(t,c,{signal:i}):(t=c,a=!0)}if(!u&&!a)throw new bT}finally{s.abort()}return t}o(R_e,"reduce");async function T_e(e){e!=null&&pf(e,"options"),e?.signal!=null&&df(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Fo(void 0,{cause:e.signal.reason});y_e(t,n)}return t}o(T_e,"toArray");function x_e(e,t){let r=T0.call(this,e,t);return o(async function*(){for await(let a of r)yield*a},"flatMap").call(this)}o(x_e,"flatMap");function p9(e){if(e=g_e(e),w_e(e))return 0;if(e<0)throw new a_e("number",">= 0",e);return e}o(p9,"toIntegerOrInfinity");function O_e(e,t=void 0){return t!=null&&pf(t,"options"),t?.signal!=null&&df(t.signal,"options.signal"),e=p9(e),o(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Fo;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new Fo;e--<=0&&(yield s)}},"drop").call(this)}o(O_e,"drop");function I_e(e,t=void 0){return t!=null&&pf(t,"options"),t?.signal!=null&&df(t.signal,"options.signal"),e=p9(e),o(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Fo;for await(let s of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new Fo;if(e-- >0&&(yield s),e<=0)return}},"take").call(this)}o(I_e,"take");ET.exports.streamReturningOperators={asIndexedPairs:p_e(__e,"readable.asIndexedPairs will be removed in a future version."),drop:O_e,filter:_T,flatMap:x_e,map:T0,take:I_e,compose:b_e};ET.exports.promiseReturningOperators={every:E_e,forEach:A_e,reduce:R_e,toArray:T_e,some:d9,find:S_e}});var AT=Oe((FDe,m9)=>{"use strict";var{ArrayPrototypePop:P_e,Promise:F_e}=Zt(),{isIterable:k_e,isNodeStream:B_e,isWebStream:C_e}=Oo(),{pipelineImpl:L_e}=E0(),{finished:N_e}=Ia();RT();function D_e(...e){return new F_e((t,r)=>{let n,a,s=e[e.length-1];if(s&&typeof s=="object"&&!B_e(s)&&!k_e(s)&&!C_e(s)){let i=P_e(e);n=i.signal,a=i.end}L_e(e,(i,u)=>{i?r(i):t(u)},{signal:n,end:a})})}o(D_e,"pipeline");m9.exports={finished:N_e,pipeline:D_e}});var RT=Oe((BDe,R9)=>{"use strict";var{Buffer:$_e}=(na(),Kt(ra)),{ObjectDefineProperty:ka,ObjectKeys:v9,ReflectApply:b9}=Zt(),{promisify:{custom:_9}}=_n(),{streamReturningOperators:g9,promiseReturningOperators:w9}=y9(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:E9}}=un(),U_e=vT(),{setDefaultHighWaterMark:M_e,getDefaultHighWaterMark:j_e}=Yd(),{pipeline:S9}=E0(),{destroyer:W_e}=lf(),A9=Ia(),TT=AT(),op=Oo(),zt=R9.exports=a0().Stream;zt.isDestroyed=op.isDestroyed;zt.isDisturbed=op.isDisturbed;zt.isErrored=op.isErrored;zt.isReadable=op.isReadable;zt.isWritable=op.isWritable;zt.Readable=Jd();for(let e of v9(g9)){let r=function(...n){if(new.target)throw E9();return zt.Readable.from(b9(t,this,n))};o(r,"fn");let t=g9[e];ka(r,"name",{__proto__:null,value:t.name}),ka(r,"length",{__proto__:null,value:t.length}),ka(zt.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let e of v9(w9)){let r=function(...n){if(new.target)throw E9();return b9(t,this,n)};o(r,"fn");let t=w9[e];ka(r,"name",{__proto__:null,value:t.name}),ka(r,"length",{__proto__:null,value:t.length}),ka(zt.Readable.prototype,e,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}zt.Writable=w0();zt.Duplex=Po();zt.Transform=aT();zt.PassThrough=lT();zt.pipeline=S9;var{addAbortSignal:q_e}=Kd();zt.addAbortSignal=q_e;zt.finished=A9;zt.destroy=W_e;zt.compose=U_e;zt.setDefaultHighWaterMark=M_e;zt.getDefaultHighWaterMark=j_e;ka(zt,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return TT}});ka(S9,_9,{__proto__:null,enumerable:!0,get(){return TT.pipeline}});ka(A9,_9,{__proto__:null,enumerable:!0,get(){return TT.finished}});zt.Stream=zt;zt._isUint8Array=o(function(t){return t instanceof Uint8Array},"isUint8Array");zt._uint8ArrayToBuffer=o(function(t){return $_e.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var T9=Oe((LDe,Er)=>{"use strict";var Br=RT(),H_e=AT(),z_e=Br.Readable.destroy;Er.exports=Br.Readable;Er.exports._uint8ArrayToBuffer=Br._uint8ArrayToBuffer;Er.exports._isUint8Array=Br._isUint8Array;Er.exports.isDisturbed=Br.isDisturbed;Er.exports.isErrored=Br.isErrored;Er.exports.isReadable=Br.isReadable;Er.exports.Readable=Br.Readable;Er.exports.Writable=Br.Writable;Er.exports.Duplex=Br.Duplex;Er.exports.Transform=Br.Transform;Er.exports.PassThrough=Br.PassThrough;Er.exports.addAbortSignal=Br.addAbortSignal;Er.exports.finished=Br.finished;Er.exports.destroy=Br.destroy;Er.exports.destroy=z_e;Er.exports.pipeline=Br.pipeline;Er.exports.compose=Br.compose;Object.defineProperty(Br,"promises",{configurable:!0,enumerable:!0,get(){return H_e}});Er.exports.Stream=Br.Stream;Er.exports.default=Er.exports});Vp();typeof globalThis<"u"&&!globalThis.Buffer&&(globalThis.Buffer=nl);typeof window<"u"&&!window.Buffer&&(window.Buffer=nl);Vp();function mI(e){let t=e.name||"untitled";return{kind:"file",name:t,async getFile(){let n=(await e.stat()).size;console.log("reading data into buffer of size"+n);let a=nl.alloc(n);await e.read(a,0,n,0);let s=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);console.log("buffer read",s);let i=s;return new File([i],t||"untitled")},async createWritable(){return{async write(r){console.log("writing data to handle",e);let n;if(typeof r=="string")n=nl.from(r,"utf-8");else if(r instanceof Blob){let a=await r.arrayBuffer();n=new Uint8Array(a)}else if(ArrayBuffer.isView(r))n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);else throw console.log("data",r),new Error("Unsupported data type for write");await e.write(n),await e.sync(),console.log("write completed")},async close(){await e.close()}}}}}o(mI,"fileHandleToFileSystemFileHandle");async function UY(e){let t=await e.getFile();return t.handle=e,t}o(UY,"fileSystemFileHandleToFileWithHandle");async function jIe(e){return{openFile:o(async t=>{let r=await e.promises.open(t,"w");return r.name=t,await UY(mI(r))},"openFile"),fileSave:o(async(t,r,n,a,s)=>{if(n)console.log("using existing handle",n);else{let h=window.prompt("Save as",r?.fileName??"untitled");if(console.log("result of prompt",h),!h)throw new Error("no file choosen");try{let c=await e.promises.open(`${h}`,"w");n=mI(c)}catch(c){throw console.error("Failed to open file in legitFs",c),new Error("Failed to open file in legitFs")}}let i=t instanceof Blob?t:await t;return await(await n.createWritable()).write(i),n},"fileSave")}}o(jIe,"getLegitFsAccess");var kv=class kv{constructor(t,r){Ye(this,"entries",[]);Ye(this,"currentIndex",0);Ye(this,"closed",!1);Ye(this,"compositFs");Ye(this,"dirPath");Ye(this,"initialized",!1);this.compositFs=t,this.dirPath=r}async initialize(){if(this.initialized)return;let t=new Set;for(let r of[...this.compositFs.filterLayers].reverse())if(r.readDirFiltering)t=new Set(await r.readDirFiltering(this.dirPath,Array.from(t)));else{let n=await r.readdir(this.dirPath);for(let a of n)t.add(a)}this.initialized=!0}async*[Symbol.asyncIterator](){for(await this.initialize();this.currentIndex<this.entries.length&&!this.closed;){let t=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(t.path);yield{name:t.name,isFile:o(()=>r.isFile(),"isFile"),isDirectory:o(()=>r.isDirectory(),"isDirectory"),isBlockDevice:o(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:o(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:o(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:o(()=>r.isFIFO(),"isFIFO"),isSocket:o(()=>r.isSocket(),"isSocket")}}catch(r){console.debug(`Failed to stat ${t.path}:`,r)}}}async read(){if(this.closed)throw new Error("Directory handle is closed");if(await this.initialize(),this.currentIndex>=this.entries.length)return null;let t=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(t.path);return{name:t.name,isFile:o(()=>r.isFile(),"isFile"),isDirectory:o(()=>r.isDirectory(),"isDirectory"),isBlockDevice:o(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:o(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:o(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:o(()=>r.isFIFO(),"isFIFO"),isSocket:o(()=>r.isSocket(),"isSocket")}}catch{return this.read()}}async close(){this.closed=!0,this.entries=[]}get path(){return this.dirPath}};o(kv,"CompositeFsDir");var Ka=kv;function MY(e){let t=e.split("/").filter(Boolean),r=[],n=[],a=!1,s;for(let i of t)if(i.startsWith("[[")&&i.endsWith("]]")){let u=i.slice(2,-2).replace(/^\.\.\./,"");if(r.push(u),i.startsWith("[[..."))a=!0,n.push("(/.*)*"),s=u;else throw new Error("Optional single-segment parameters [[param]] are not supported. Use [[...param]] for catch-all or [param] for required single segment.")}else if(i.startsWith("[")&&i.endsWith("]")){if(i.startsWith("[..."))throw new Error("Required catch-all parameters [...param] are not supported. Use [[...param]] instead.");{let u=i.slice(1,-1);r.push(u),n.push("/([^\\/]+)")}}else i==="."?a=!0:n.push("/"+i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"));return{regexStr:n.join("")+"$",paramNames:r,folderRoute:a,pathParameter:s}}o(MY,"compilePattern");function Bv(e){if(e===".")return 1;let t=e.split("/").filter(Boolean),r=Math.pow(2,t.length);for(let n=0;n<t.length;n++){let a=t[n],s;a.startsWith("[[...")?s=10:a.startsWith("[[")?s=50:a.startsWith("[")?s=100:s=1e3+a.length;let i=Math.pow(.9,n);r+=s*i}return r}o(Bv,"calculatePriority");function jY(e){if(typeof e.name!="string")return"folder";let t=e;return t.fsType==="folder"?"folder":t.fsType==="file"?"file":"readdir"in t&&typeof t.readdir=="function"?"folder":"file"}o(jY,"getNodeType");function WY(e){let t=[];function r(n,a){if(typeof n.name=="string"){t.push({pattern:a||".",handler:n,priority:Bv(a||"."),staticBaseChildren:[]});return}let s=n,i=[],u=Object.keys(s).filter(h=>h.startsWith("[[")||h===".");if(u.length>1)throw new Error(`Expected exactly one folder handler for ${a||"/"} expected but multuple found: ${u.join(", ")}`);if(u.length===0)throw new Error(`No folder handler for ${a||"/"} founds`);for(let[h,c]of Object.entries(s)){let d=a?`${a}/${h}`:h;if(h==="."){if(typeof c.name!="string")throw new Error(`Folder root '.' at path '${a}' must be a handler, not a folder`);if(c.fsType!=="folder"&&c.fsType!=="fs")throw new Error(`Folder root handler '.' at path '${a}' must be of type 'folder' or 'fs'`);t.push({pattern:a+"/.",handler:c,priority:Bv(a),staticBaseChildren:i})}else if(h.startsWith("[["))if(h.startsWith("[[..."))if(typeof c.name=="string"){if(t.push({pattern:d,handler:c,priority:Bv(d),staticBaseChildren:i}),c.fsType!=="folder"&&c.fsType!=="fs")throw new Error(`Folder root handler '.' at path '${a}' must be of type 'folder' or 'fs'`)}else r(c,d);else r(c,d);else if(h.startsWith("[")){if(h.startsWith("[..."))throw new Error(`Required catch-all '${h}' is not supported. Use '[[...${h.slice(5,-1)}]]' instead`);r(c,d)}else i.push({segment:h,type:jY(c)}),r(c,d)}}return o(r,"walk"),r(e,""),t}o(WY,"flattenRoutes");var Cv=class Cv{constructor(t,r){this.routes=t;this.rootPath=r;Ye(this,"compiledRoutes");let n=WY(t);this.compiledRoutes=n.map(a=>{let{regexStr:s,paramNames:i,folderRoute:u,pathParameter:h}=MY(a.pattern);return{regex:new RegExp(s),paramNames:i,staticBaseChildren:a.staticBaseChildren,handler:a.handler,priority:a.priority,pattern:a.pattern,folderRoute:u,pathParameter:h}})}match(t){let r=t;r.startsWith(this.rootPath+"/")?r=r.slice(this.rootPath.length+1):r.startsWith(this.rootPath)&&(r=r.slice(this.rootPath.length)),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1));let n,a={},s=-1,i=this.compiledRoutes,u=[];for(let c of i){let d=r.match(c.regex);if(d)u.push(c);else continue;if(!(!d||c.priority<=s)){a={};for(let y=0;y<c.paramNames.length;y++){let m=d[y+1]||"";m.startsWith("/")&&(m=m.slice(1)),a[c.paramNames[y]]=m}s=c.priority,n=c}}if(!n||n.handler===void 0)return;let h=[];return n.folderRoute&&(n.pathParameter?a[n.pathParameter]===""&&(h=n.staticBaseChildren.map(c=>({segment:c.segment,type:c.type}))):h=n.staticBaseChildren.map(c=>({segment:c.segment,type:c.type}))),{handler:n.handler,matchingPattern:n.pattern,params:a,staticSiblings:h}}};o(Cv,"PathRouter");var Gp=Cv;function Wt(e){return typeof e=="string"?e:Buffer.isBuffer(e)?e.toString():String(e)}o(Wt,"pathToString");var Lv=class Lv{constructor({name:t,rootPath:r}){Ye(this,"compositeFs");Ye(this,"context");Ye(this,"newContext");Ye(this,"fsType","fs");Ye(this,"rootInstanceId");Ye(this,"name");Ye(this,"rootPath");this.name=t,this.rootPath=r,this.rootInstanceId=`${t}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}attach(t){this.compositeFs=t}withContext(t){let r=Object.create(Object.getPrototypeOf(this));return Object.assign(r,this),r.context=t,r}async open(t,r,n){throw new Error(`open not implemented for: ${Wt(t)}`)}async access(t,r){throw new Error(`access not implemented for: ${Wt(t)}`)}async stat(t,r){throw new Error(`lstat not implemented for: ${Wt(t)}`)}async lstat(t,r){throw new Error(`lstat not implemented for: ${Wt(t)}`)}async opendir(t,r){throw new Error(`opendir not implemented for: ${Wt(t)}`)}async link(t,r){throw new Error(`link not implemented for: ${Wt(t)}`)}async mkdir(t,r){throw new Error(`mkdir not implemented for: ${Wt(t)}`)}async readdir(t,r){throw new Error(`readdir not implemented for: ${Wt(t)}`)}async readlink(t,...r){throw new Error(`readlink not implemented for: ${Wt(t)}`)}async unlink(t){throw new Error(`unlink not implemented for: ${Wt(t)}`)}async rename(t,r){throw new Error(`rename not implemented for: ${Wt(t)}`)}async rmdir(t,...r){throw new Error(`rmdir not implemented for: ${Wt(t)}`)}async symlink(t,r,n){throw new Error(`symlink not implemented for: ${Wt(r)}`)}async lookup(t){throw new Error(`lookup not implemented for: ${Wt(t)}`)}resolvePath(t){throw new Error(`resolvePath not implemented for fd: ${t}`)}async close(t){this.compositeFs.close(t)}async dataSync(t){throw new Error(`dataSync not implemented for: ${t.subFsFileDescriptor}`)}async read(t,r,n,a,s){throw new Error(`read not implemented for: ${t.subFsFileDescriptor}`)}async appendFile(t,r,n){throw new Error(`appendFile not implemented for: ${t.subFsFileDescriptor}`)}async fchmod(t,r){throw new Error(`fchmod not implemented for: ${t.subFsFileDescriptor}`)}async fchown(t,r,n){throw new Error(`fchown not implemented for: ${t.subFsFileDescriptor}`)}async ftruncate(t,r){throw new Error(`ftruncate not implemented for: ${t.subFsFileDescriptor}`)}async fstat(t,r){throw new Error(`fstat not implemented for: ${t.subFsFileDescriptor}`)}async futimes(t,r,n){throw new Error(`futimes not implemented for: ${t.subFsFileDescriptor}`)}async write(t,r,n,a,s){throw new Error(`write not implemented for: ${t.subFsFileDescriptor}`)}async writev(t,r,n){throw new Error(`writev not implemented for: ${t.subFsFileDescriptor}`)}async readv(t,r,n){throw new Error(`readv not implemented for: ${t.subFsFileDescriptor}`)}async readFile(t,r){throw new Error(`readFile not implemented for: ${t}`)}async writeFile(t,r,n){throw new Error(`writeFile not implemented for: ${t}`)}};o(Lv,"BaseCompositeSubFs");var Jr=Lv;var Nv=class Nv{constructor({name:t,filterLayers:r,routes:n,rootPath:a}){Ye(this,"promises");Ye(this,"filterLayers",[]);Ye(this,"router");Ye(this,"parentFs");Ye(this,"name");Ye(this,"rootPath");Ye(this,"pathToFileDescriptors",new Map);Ye(this,"openFileHandles",new Map);Ye(this,"logOperation");this.name=t,this.rootPath=a;for(let s of r)this.filterLayers.push(s),s.attach(this);this.router=new Gp(n,this.rootPath),this.promises={access:this.access.bind(this),opendir:this.opendir.bind(this),mkdir:this.mkdir.bind(this),readdir:this.readdir.bind(this),open:this.open.bind(this),stat:this.stat.bind(this),lstat:this.lstat.bind(this),link:this.link.bind(this),readlink:this.readlink.bind(this),unlink:this.unlink.bind(this),rename:this.rename.bind(this),rmdir:this.rmdir.bind(this),symlink:this.symlink.bind(this),readFile:this.readFile.bind(this),writeFile:this.writeFile.bind(this),getFilehandle:this.getFilehandle.bind(this)}}getNextFileDescriptor(){let t=Array.from(this.openFileHandles.keys());return t.length===0?1:Math.max(...t)+1}setLoggger(t){this.logOperation=t}async logOperationOnFileDescsriptor(t,r,n){if(!this.logOperation)return;let a=[];for(let[s,i]of this.pathToFileDescriptors.entries())i.includes(t.fd)&&a.push(s);if(a.length!==0)return this.logOperation?.({fsName:t.delegate.name,fd:t,path:a[0],operation:r,operationArgs:n})}getFilehandle(t){return this.openFileHandles.get(t)}async getResponsibleFs(t){let r=t.toString();for(let s of this.filterLayers)if(await s.responsible(r)){if(s.withContext!==void 0)return s.withContext({fullPath:r,params:{},staticSiblings:[]});throw new Error(`Filter layer filesystem ${s.name} is not a BaseCompositeSubFs`)}let n=this.router.match(r);if(!n)throw new Error(`No route match for: ${r}`);let a=n.handler;return a.attach(this),a.withContext({fullPath:r,params:n.params,staticSiblings:n.staticSiblings})}async access(t,r){let n=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:n.name,path:t,operation:"access",operationArgs:{mode:r}}),n.access(t,r)}async stat(t,r){let n=t.toString(),a=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:a.name,path:n,operation:"stat",operationArgs:{opts:r}}),a.stat(t)}async lstat(t,r){let n=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:n.name,path:t.toString(),operation:"lstat",operationArgs:{opts:r}}),n.lstat(t,r)}async unlink(t){let r=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:r.name,path:t.toString(),operation:"unlink",operationArgs:{}}),r.unlink(t)}async mkdir(t,r){let n=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:n.name,path:t.toString(),operation:"mkdir",operationArgs:{options:r}}),n.mkdir(t,r)}async rmdir(t,r){let n=await this.getResponsibleFs(t);return await this.logOperation?.({fsName:n.name,path:t.toString(),operation:"rmdir",operationArgs:{dirPath:t,options:r}}),n.rmdir(t,r)}async opendir(t,r){await this.logOperation?.({fsName:this.name,path:t.toString(),operation:"opendir",operationArgs:{options:r}});let n=t.toString();return new Ka(this,n)}async readdir(t,r){await this.logOperation?.({fsName:this.name,path:t.toString(),operation:"readdir",operationArgs:{options:r}});let n=new Set,a=this.router.match(t.toString());if(a?.handler instanceof Jr){let s=a?.handler.withContext({fullPath:t.toString(),params:a.params,staticSiblings:a.staticSiblings});s.attach(this),n=new Set(await s.readdir(t,r))}for(let s of[...this.filterLayers].reverse())if(s.readDirFiltering)n=new Set(await s.readDirFiltering(t,Array.from(n)));else{let i=await s.readdir(t,r);for(let u of i)n.add(u)}return Array.from(n)}async open(t,r,n){let a=await this.getResponsibleFs(t);await this.logOperation?.({fsName:a.name,path:t,operation:"open",operationArgs:{flags:r,mode:n}});let s=await a.open(t,r,n),i=this.getNextFileDescriptor();return s.realize(i),this.openFileHandles.set(i,s),this.pathToFileDescriptors.get(t)||this.pathToFileDescriptors.set(t,[]),this.pathToFileDescriptors.get(t).push(i),s}async close(t){try{await t.delegate.close(t)}catch(r){throw r}finally{for(let[r,n]of this.pathToFileDescriptors.entries()){let a=n.indexOf(t.fd);if(a!==-1){n.splice(a,1),n.length===0&&this.pathToFileDescriptors.delete(r);break}}this.openFileHandles.delete(t.fd)}}async link(t,r){throw new Error("not implemented")}async readlink(t,r){throw new Error("not implemented")}async rename(t,r){let n=await this.getResponsibleFs(t),a=await this.getResponsibleFs(r);if(n.rootInstanceId===a.rootInstanceId)return await this.logOperation?.({fsName:n.name,path:t.toString(),operation:"rename",operationArgs:{oldPath:t,newPath:r}}),n.newContext=a.context,n.rename(t,r);let s=await n.open(t.toString(),"r");try{let i=await n.fstat(s),u=Buffer.alloc(i.size);await n.read(s,u,0,i.size,0),await n.close(s),await a.writeFile(r.toString(),u,"utf8"),await n.unlink(t)}catch(i){try{await n.close(s)}catch{}throw i}}async symlink(t,r,n){throw new Error("not implemented")}async readFile(t,r){await this.logOperation?.({fsName:this.name,path:t.toString(),operation:"readFile",operationArgs:{path:t,options:r}});let n=!0,a;if(typeof t=="number"){n=!1;let s=this.getFilehandle(t);if(!s)throw new Error("Invalid file descriptor");a=s}else if(typeof t=="string")a=await this.open(t,"r");else throw new Error("only filehandle and path are supported atm");try{let i=(await a.stat()).size;if(typeof i=="bigint"){if(i>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("File too large to read into buffer");i=Number(i)}let u=Buffer.alloc(i),{bytesRead:h}=await a.read(u,0,i,0);if(r&&typeof r.encoding=="string")return u.slice(0,h).toString(r.encoding);if(typeof r=="string"){if(r==="utf8"||r==="utf-8")return u.slice(0,h).toString(r);throw new Error("Unsupported encoding: "+r)}return u.slice(0,h)}finally{a&&n&&await a.close()}}async writeFile(t,r,n){await this.logOperation?.({fsName:this.name,path:t.toString(),operation:"writeFile",operationArgs:{data:r,options:n}});let a=typeof t!="number",s,i,u,h="w";if(typeof n=="string"?i=n:n&&typeof n=="object"&&(i=n.encoding,u=n.mode,h=n.flag||"w"),typeof t=="number"){let c=this.getFilehandle(t);if(!c)throw new Error("Invalid file descriptor");s=c}else if(typeof t=="string")s=await this.open(t,h,u);else throw new Error("only filehandle and path are supported atm");try{let c;if(typeof r=="string")c=Buffer.from(r,i||"utf8");else if(r instanceof Buffer)c=r;else if(r instanceof Uint8Array)c=Buffer.from(r);else throw new Error("Invalid data type for writeFile");let d=0;for(;d<c.length;){let{bytesWritten:y}=await s.write(c,d,c.length-d,d);d+=y}}finally{s&&a&&await s.close()}}};o(Nv,"CompositeFs");var ch=Nv;var RI=Lt(Xp(),1);var Vv=class Vv extends Jr{constructor({name:r,hiddenFiles:n,rootPath:a}){super({name:r,rootPath:a});Ye(this,"ig");this.ig=(0,RI.default)(),this.ig.add(n)}async responsible(r){let n=r.replace(/\\/g,"/"),a=n;if(this.rootPath){let s=this.rootPath;n.startsWith(s+"/")?a=n.slice(s.length+1):n.startsWith(s)&&(a=n.slice(s.length))}return a=a.startsWith("./")?a.slice(2):a,a=a.startsWith("/")?a.slice(1):a,a===""||a==="."?!1:this.ig.ignores(a)}fileType(){return 255}error(r){return new Error(`Access to hidden file is not allowed: ${Wt(r)}`)}async open(r,n,a){throw this.error(r)}async access(r){throw this.error(r)}async stat(r){throw this.error(r)}async lstat(r){throw this.error(r)}async opendir(r){throw this.error(r)}async link(r){throw this.error(r)}async mkdir(r){throw this.error(r)}async readDirFiltering(r,n){let a=[];for(let s of n){let i=Wt(r)!=="/"?Wt(r)+"/"+s:"/"+s;await this.responsible(i)||a.push(s)}return a}async readdir(r){throw this.error(r)}async readlink(r){throw this.error(r)}async unlink(r){throw this.error(r)}async rename(r){throw this.error(r)}async rmdir(r){throw this.error(r)}async symlink(r,n){throw this.error(n)}async lookup(r){throw this.error(r)}resolvePath(r){throw new Error(`Access to hidden file is not allowed: resolvePath(${r})`)}async close(r){throw new Error("Access to hidden file is not allowed: close: "+r.subFsFileDescriptor)}async dataSync(r){throw new Error("Access to hidden file is not allowed: dataSync: "+r.subFsFileDescriptor)}async read(r,n,a,s,i){throw new Error("Access to hidden file is not allowed: readFileHandle: "+r.subFsFileDescriptor)}};o(Vv,"HiddenFileSubFs");var Jp=Vv;var Gv=class Gv{constructor(t){Ye(this,"delegate");Ye(this,"compositeFs");Ye(this,"_subFsFileDescriptor");Ye(this,"handleType","file");Ye(this,"_compositFsFileDescriptor",-1);this.delegate=t.fs,this._subFsFileDescriptor=t.subFsFileDescriptor,this._compositFsFileDescriptor=-1,this.compositeFs=t.compositeFs;let r=this._subFsFileDescriptor}get fsType(){return this.delegate.fileType()}get subFsFileDescriptor(){return this._subFsFileDescriptor}get fd(){return this._compositFsFileDescriptor}realize(t){if(this._compositFsFileDescriptor!==-1)throw new Error("was already realized");this._compositFsFileDescriptor=t}readableWebStream(t){throw new Error("Method not implemented.")}async appendFile(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"appendFile",{data:t,options:r}),await this.delegate.appendFile(this,t,r)}async chmod(t){return await this.compositeFs.logOperationOnFileDescsriptor(this,"chmod",{mode:t}),this.delegate.fchmod(this,t)}async chown(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"chown",{uid:t,gid:r}),this.delegate.fchown(this,t,r)}async close(){return await this.compositeFs.logOperationOnFileDescsriptor(this,"close",{}),this.compositeFs.close(this)}async datasync(){return await this.compositeFs.logOperationOnFileDescsriptor(this,"datasync",{}),this.delegate.dataSync(this)}async read(t,r,n,a){return await this.compositeFs.logOperationOnFileDescsriptor(this,"read",{targetBufferLength:t.length,offset:r,length:n,position:a}),await this.delegate.read(this,t,r,n,a)}async readv(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"readv",{buffers:t,position:r}),this.delegate.readv(this,t,r)}async stat(t){return await this.compositeFs.logOperationOnFileDescsriptor(this,"stat",{options:t}),this.delegate.fstat(this,t)}async truncate(t){return await this.compositeFs.logOperationOnFileDescsriptor(this,"truncate",{len:t}),this.delegate.ftruncate(this,t)}async utimes(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"utimes",{atime:t,mtime:r}),this.delegate.futimes(this,t,r)}async write(t,r,n,a){return await this.compositeFs.logOperationOnFileDescsriptor(this,"write",{buffer:t,offset:r,length:n,position:a}),this.delegate.write(this,t,r,n,a)}async writev(t,r){return await this.compositeFs.logOperationOnFileDescsriptor(this,"writev",{buffers:t,position:r}),this.delegate.writev(this,t,r)}async sync(){return await this.compositeFs.logOperationOnFileDescsriptor(this,"sync",{}),this.delegate.dataSync(this)}};o(Gv,"CompositFsFileHandle");var xn=Gv;function Jv(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}o(Jv,"unimplemented");var qo=[],Kf=!1,il,Qp=-1;function fZ(){!Kf||!il||(Kf=!1,il.length?qo=il.concat(qo):Qp=-1,qo.length&&xI())}o(fZ,"cleanUpNextTick");function xI(){if(!Kf){var e=setTimeout(fZ,0);Kf=!0;for(var t=qo.length;t;){for(il=qo,qo=[];++Qp<t;)il&&il[Qp].run();Qp=-1,t=qo.length}il=null,Kf=!1,clearTimeout(e)}}o(xI,"drainQueue");function uZ(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];qo.push(new OI(e,t)),qo.length===1&&!Kf&&setTimeout(xI,0)}o(uZ,"nextTick");function OI(e,t){this.fun=e,this.array=t}o(OI,"Item");OI.prototype.run=function(){this.fun.apply(null,this.array)};var cZ="browser",hZ="x64",dZ="browser",pZ={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},yZ=["/usr/bin/node"],mZ=[],gZ="v16.8.0",wZ={},vZ=o(function(e,t){console.warn((t?t+": ":"")+e)},"emitWarning"),bZ=o(function(e){Jv("binding")},"binding"),_Z=o(function(e){return 0},"umask"),EZ=o(function(){return"/"},"cwd"),SZ=o(function(e){},"chdir"),AZ={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};function Qr(){}o(Qr,"noop");var RZ=Qr,TZ=[];function xZ(e){Jv("_linkedBinding")}o(xZ,"_linkedBinding");var OZ={},IZ=!1,PZ={};function FZ(e){Jv("dlopen")}o(FZ,"dlopen");function kZ(){return[]}o(kZ,"_getActiveRequests");function BZ(){return[]}o(BZ,"_getActiveHandles");var CZ=Qr,LZ=Qr,Qv=o(function(){return{}},"cpuUsage"),NZ=Qv,DZ=Qv,$Z=Qr,UZ=Qr,MZ=Qr,jZ={};function WZ(e,t){if(!e)throw new Error(t||"assertion error")}o(WZ,"assert");var qZ={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},HZ=Qr,zZ=Qr;function VZ(){return!1}o(VZ,"hasUncaughtExceptionCaptureCallback");var GZ=Qr,KZ=Qr,YZ=Qr,ZZ=Qr,XZ=Qr,JZ=void 0,QZ=void 0,eX=void 0,tX=Qr,rX=2,nX=1,iX="/bin/usr/node",oX=9229,aX="node",sX=[],lX=Qr,Ya={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Ya.now===void 0&&(Kv=Date.now(),Ya.timing&&Ya.timing.navigationStart&&(Kv=Ya.timing.navigationStart),Ya.now=()=>Date.now()-Kv);var Kv;function fX(){return Ya.now()/1e3}o(fX,"uptime");var Zv=1e9;function Xv(e){var t=Math.floor((Date.now()-Ya.now())*.001),r=Ya.now()*.001,n=Math.floor(r)+t,a=Math.floor(r%1*1e9);return e&&(n=n-e[0],a=a-e[1],a<0&&(n--,a+=Zv)),[n,a]}o(Xv,"hrtime");Xv.bigint=function(e){var t=Xv(e);return typeof BigInt>"u"?t[0]*Zv+t[1]:BigInt(t[0]*Zv)+BigInt(t[1])};var uX=10,cX={},hX=0;function Za(){return II}o(Za,"on");var dX=Za,pX=Za,yX=Za,mX=Za,gX=Za,wX=Qr,vX=Za,bX=Za;function _X(e){return[]}o(_X,"listeners");var II={version:gZ,versions:wZ,arch:hZ,platform:dZ,release:AZ,_rawDebug:RZ,moduleLoadList:TZ,binding:bZ,_linkedBinding:xZ,_events:cX,_eventsCount:hX,_maxListeners:uX,on:Za,addListener:dX,once:pX,off:yX,removeListener:mX,removeAllListeners:gX,emit:wX,prependListener:vX,prependOnceListener:bX,listeners:_X,domain:OZ,_exiting:IZ,config:PZ,dlopen:FZ,uptime:fX,_getActiveRequests:kZ,_getActiveHandles:BZ,reallyExit:CZ,_kill:LZ,cpuUsage:Qv,resourceUsage:NZ,memoryUsage:DZ,kill:$Z,exit:UZ,openStdin:MZ,allowedNodeEnvironmentFlags:jZ,assert:WZ,features:qZ,_fatalExceptions:HZ,setUncaughtExceptionCaptureCallback:zZ,hasUncaughtExceptionCaptureCallback:VZ,emitWarning:vZ,nextTick:uZ,_tickCallback:GZ,_debugProcess:KZ,_debugEnd:YZ,_startProfilerIdleNotifier:ZZ,_stopProfilerIdleNotifier:XZ,stdout:JZ,stdin:eX,stderr:QZ,abort:tX,umask:_Z,chdir:SZ,cwd:EZ,env:pZ,title:cZ,argv:yZ,execArgv:mZ,pid:rX,ppid:nX,execPath:iX,debugPort:oX,hrtime:Xv,argv0:aX,_preload_modules:sX,setSourceMapsEnabled:lX},Yv={},TI=!1;function EX(){if(TI)return Yv;TI=!0;var e=II;function t(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}o(t,"assertPath");function r(s,i){for(var u="",h=0,c=-1,d=0,y,m=0;m<=s.length;++m){if(m<s.length)y=s.charCodeAt(m);else{if(y===47)break;y=47}if(y===47){if(!(c===m-1||d===1))if(c!==m-1&&d===2){if(u.length<2||h!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var g=u.lastIndexOf("/");if(g!==u.length-1){g===-1?(u="",h=0):(u=u.slice(0,g),h=u.length-1-u.lastIndexOf("/")),c=m,d=0;continue}}else if(u.length===2||u.length===1){u="",h=0,c=m,d=0;continue}}i&&(u.length>0?u+="/..":u="..",h=2)}else u.length>0?u+="/"+s.slice(c+1,m):u=s.slice(c+1,m),h=m-c-1;c=m,d=0}else y===46&&d!==-1?++d:d=-1}return u}o(r,"normalizeStringPosix");function n(s,i){var u=i.dir||i.root,h=i.base||(i.name||"")+(i.ext||"");return u?u===i.root?u+h:u+s+h:h}o(n,"_format");var a={resolve:o(function(){for(var i="",u=!1,h,c=arguments.length-1;c>=-1&&!u;c--){var d;c>=0?d=arguments[c]:(h===void 0&&(h=e.cwd()),d=h),t(d),d.length!==0&&(i=d+"/"+i,u=d.charCodeAt(0)===47)}return i=r(i,!u),u?i.length>0?"/"+i:"/":i.length>0?i:"."},"resolve2"),normalize:o(function(i){if(t(i),i.length===0)return".";var u=i.charCodeAt(0)===47,h=i.charCodeAt(i.length-1)===47;return i=r(i,!u),i.length===0&&!u&&(i="."),i.length>0&&h&&(i+="/"),u?"/"+i:i},"normalize2"),isAbsolute:o(function(i){return t(i),i.length>0&&i.charCodeAt(0)===47},"isAbsolute2"),join:o(function(){if(arguments.length===0)return".";for(var i,u=0;u<arguments.length;++u){var h=arguments[u];t(h),h.length>0&&(i===void 0?i=h:i+="/"+h)}return i===void 0?".":a.normalize(i)},"join2"),relative:o(function(i,u){if(t(i),t(u),i===u||(i=a.resolve(i),u=a.resolve(u),i===u))return"";for(var h=1;h<i.length&&i.charCodeAt(h)===47;++h);for(var c=i.length,d=c-h,y=1;y<u.length&&u.charCodeAt(y)===47;++y);for(var m=u.length,g=m-y,v=d<g?d:g,_=-1,b=0;b<=v;++b){if(b===v){if(g>v){if(u.charCodeAt(y+b)===47)return u.slice(y+b+1);if(b===0)return u.slice(y+b)}else d>v&&(i.charCodeAt(h+b)===47?_=b:b===0&&(_=0));break}var E=i.charCodeAt(h+b),S=u.charCodeAt(y+b);if(E!==S)break;E===47&&(_=b)}var T="";for(b=h+_+1;b<=c;++b)(b===c||i.charCodeAt(b)===47)&&(T.length===0?T+="..":T+="/..");return T.length>0?T+u.slice(y+_):(y+=_,u.charCodeAt(y)===47&&++y,u.slice(y))},"relative2"),_makeLong:o(function(i){return i},"_makeLong2"),dirname:o(function(i){if(t(i),i.length===0)return".";for(var u=i.charCodeAt(0),h=u===47,c=-1,d=!0,y=i.length-1;y>=1;--y)if(u=i.charCodeAt(y),u===47){if(!d){c=y;break}}else d=!1;return c===-1?h?"/":".":h&&c===1?"//":i.slice(0,c)},"dirname2"),basename:o(function(i,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');t(i);var h=0,c=-1,d=!0,y;if(u!==void 0&&u.length>0&&u.length<=i.length){if(u.length===i.length&&u===i)return"";var m=u.length-1,g=-1;for(y=i.length-1;y>=0;--y){var v=i.charCodeAt(y);if(v===47){if(!d){h=y+1;break}}else g===-1&&(d=!1,g=y+1),m>=0&&(v===u.charCodeAt(m)?--m===-1&&(c=y):(m=-1,c=g))}return h===c?c=g:c===-1&&(c=i.length),i.slice(h,c)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!d){h=y+1;break}}else c===-1&&(d=!1,c=y+1);return c===-1?"":i.slice(h,c)}},"basename2"),extname:o(function(i){t(i);for(var u=-1,h=0,c=-1,d=!0,y=0,m=i.length-1;m>=0;--m){var g=i.charCodeAt(m);if(g===47){if(!d){h=m+1;break}continue}c===-1&&(d=!1,c=m+1),g===46?u===-1?u=m:y!==1&&(y=1):u!==-1&&(y=-1)}return u===-1||c===-1||y===0||y===1&&u===c-1&&u===h+1?"":i.slice(u,c)},"extname2"),format:o(function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return n("/",i)},"format2"),parse:o(function(i){t(i);var u={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return u;var h=i.charCodeAt(0),c=h===47,d;c?(u.root="/",d=1):d=0;for(var y=-1,m=0,g=-1,v=!0,_=i.length-1,b=0;_>=d;--_){if(h=i.charCodeAt(_),h===47){if(!v){m=_+1;break}continue}g===-1&&(v=!1,g=_+1),h===46?y===-1?y=_:b!==1&&(b=1):y!==-1&&(b=-1)}return y===-1||g===-1||b===0||b===1&&y===g-1&&y===m+1?g!==-1&&(m===0&&c?u.base=u.name=i.slice(1,g):u.base=u.name=i.slice(m,g)):(m===0&&c?(u.name=i.slice(1,y),u.base=i.slice(1,g)):(u.name=i.slice(m,y),u.base=i.slice(m,g)),u.ext=i.slice(y,g)),m>0?u.dir=i.slice(0,m-1):c&&(u.dir="/"),u},"parse2"),sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,Yv=a,Yv}o(EX,"dew");var pn=EX(),dPe=pn._makeLong,pPe=pn.basename,yPe=pn.delimiter,Gr=pn.dirname,mPe=pn.extname,gPe=pn.format,wPe=pn.isAbsolute,PI=pn.join,vPe=pn.normalize,bPe=pn.parse,_Pe=pn.posix,EPe=pn.relative,SPe=pn.resolve,APe=pn.sep,RPe=pn.win32;var gm=Lt(Lh(),1);var aL=Lt(Xp(),1);var aE=class aE extends Jr{constructor({name:r,rootPath:n,ephemeralPatterns:a}){super({name:r,rootPath:n});Ye(this,"openFh",new Map);Ye(this,"memFs",(0,gm.createFsFromVolume)(new gm.Volume));Ye(this,"ig");Ye(this,"patterns");this.ig=(0,aL.default)(),this.ig.add(a),this.patterns=a}normalizePath(r){let n=typeof r=="string"?r:r.toString();return n.startsWith("/")?n:"/"+n}async responsible(r){let n=r.replace(/\\/g,"/"),a=n;return this.rootPath&&(n.startsWith(this.rootPath+"/")?a=n.slice(this.rootPath.length+1):n.startsWith(this.rootPath)&&(a=n.slice(this.rootPath.length))),a=a.startsWith("./")?a.slice(2):a,a=a.startsWith("/")?a.slice(1):a,a===""||a==="."?!1:this.ig.ignores(a)}fileType(){return 5}async open(r,n,a){let s=this.normalizePath(r),i=Gr(s);i&&i!=="/"&&i!=="."&&await this.memFs.promises.mkdir(i,{recursive:!0});let u=await this.memFs.promises.open(s,n,a);return this.openFh.set(u.fd,u),new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:u.fd,parentFsFileDescriptors:[u.fd]})}async access(r,n){let a=this.normalizePath(r);return await this.memFs.promises.access(a,n)}async stat(r,n){let a=this.normalizePath(r);return this.memFs.promises.stat(a,{bigint:!1})}async lstat(r,n){let a=this.normalizePath(r);return this.memFs.promises.lstat(a,{bigint:!1})}async opendir(r,n){let a=this.normalizePath(r);return await this.memFs.promises.opendir(a,n)}async link(r,n){let a=this.normalizePath(r),s=this.normalizePath(n);return await this.memFs.promises.link(a,s)}async mkdir(r,n){let a=this.normalizePath(r);if(!(typeof n=="object"&&n&&"recursive"in n&&n.recursive)){let i=Gr(a);if(i&&i!=="/"&&i!==".")try{await this.memFs.promises.stat(i)}catch{await this.memFs.promises.mkdir(i,{recursive:!0})}}await this.memFs.promises.mkdir(a,n)}async readdir(r,...n){let a=this.normalizePath(r),s=await this.memFs.promises.readdir(a,...n);return console.log("EPHEMERAL: READDIR: ",s),s}async readlink(r){throw new Error("readlink is not implemented for EphemeralFileSubFs")}async unlink(r){let n=this.normalizePath(r);return await this.memFs.promises.unlink(n)}async rename(r,n){let a=this.normalizePath(r),s=this.normalizePath(n);return await this.memFs.promises.rename(a,s)}async rmdir(r,n){let a=this.normalizePath(r);return await this.memFs.promises.rmdir(a,n)}async symlink(r,n,a){let s=this.normalizePath(r),i=this.normalizePath(n);return await this.memFs.promises.symlink(s,i,a)}async lookup(r){throw new Error(`lookup is not implemented for: ${Wt(r)}`)}async close(r){let n=this.openFh.get(r.subFsFileDescriptor);n&&(await n.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.datasync()}async read(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.read(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.chmod(n)}async fchown(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.chown(n,a)}async write(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.write(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.truncate(n)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.stat(n);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.utimes(n,a)}async writev(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.writev(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.readv(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,n){if(typeof r=="string"||Buffer.isBuffer(r)){let a=this.normalizePath(r);return this.memFs.promises.readFile(a,n)}return super.readFile(r,n)}async writeFile(r,n,a){let s=this.normalizePath(r),i=Gr(s);return i&&i!=="/"&&i!=="."&&await this.memFs.promises.mkdir(i,{recursive:!0}),this.memFs.promises.writeFile(s,n,a)}};o(aE,"EphemeralSubFs");var oL=aE;var sL=Lt(Xp(),1);var sE=class sE extends Jr{constructor({name:r,sourceFs:n,copyToFs:a,copyToRootPath:s,rootPath:i,patterns:u}){super({rootPath:i,name:r});Ye(this,"openFh",new Map);Ye(this,"sourceFs");Ye(this,"copyToFs");Ye(this,"copyPath");Ye(this,"ig");Ye(this,"patterns");this.sourceFs=n,this.copyToFs=a,this.copyPath=s,this.patterns=u,this.ig=(0,sL.default)(),this.ig.add(u)}normalizeCopyPath(r){let n=typeof r=="string"?r:r.toString(),a=n.startsWith("/")?n:"/"+n;return PI(this.copyPath,a)}normalizePath(r){let n=typeof r=="string"?r:r.toString();return n.startsWith("/")?n:"/"+n}async responsible(r){let n=r.replace(/\\/g,"/"),a=n;if(this.compositeFs.rootPath){let s=this.compositeFs.rootPath;n.startsWith(s+"/")?a=n.slice(s.length+1):n.startsWith(s)&&(a=n.slice(s.length))}return a=a.startsWith("./")?a.slice(2):a,a=a.startsWith("/")?a.slice(1):a,a===""||a==="."?!1:this.ig.ignores(a)}fileType(){return 6}async isCopied(r){let n=this.normalizeCopyPath(r);try{return await this.copyToFs.promises.access(n),!0}catch{return!1}}async copyFromSource(r){let n=this.normalizeCopyPath(r),a=this.normalizePath(r),s=Gr(n);s&&s!=="/"&&s!=="."&&await this.copyToFs.promises.mkdir(s,{recursive:!0});try{let i=await this.sourceFs.promises.readFile(a);await this.copyToFs.promises.writeFile(n,i)}catch(i){if(i.code!=="ENOENT")throw i}}async open(r,n,a){let s=this.normalizePath(r),i=this.normalizeCopyPath(r);if(n.includes("w")||n.includes("a")||n.includes("+")){let h=Gr(i);if(h&&h!=="/"&&h!=="."&&await this.copyToFs.promises.mkdir(h,{recursive:!0}),!await this.isCopied(r))try{await this.sourceFs.promises.access(s),await this.copyFromSource(r)}catch{}let d=await this.copyToFs.promises.open(i,n,a);return this.openFh.set(d.fd,d),new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:d.fd,parentFsFileDescriptors:[d.fd]})}else{let h=await this.isCopied(r),c=h?this.copyToFs:this.sourceFs,d=h?i:s,y=await c.promises.open(d,n,a);return this.openFh.set(y.fd,y),new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:y.fd,parentFsFileDescriptors:[y.fd]})}}async access(r,n){let a=this.normalizePath(r),s=this.normalizeCopyPath(r);try{await this.copyToFs.promises.access(s,n);return}catch{return await this.sourceFs.promises.access(a,n)}}async stat(r,n){let a=this.normalizePath(r),s=this.normalizeCopyPath(r);try{return await this.copyToFs.promises.stat(s,{bigint:n?.bigint??!1})}catch{return this.sourceFs.promises.stat(a,{bigint:n?.bigint??!1})}}async lstat(r,n){let a=this.normalizePath(r),s=this.normalizeCopyPath(r);try{return await this.copyToFs.promises.lstat(s,{bigint:n?.bigint??!1})}catch{return this.sourceFs.promises.lstat(a,{bigint:n?.bigint??!1})}}async opendir(r,n){let a=this.normalizePath(r);return new Ka(this.compositeFs,a)}async link(r,n){let a=this.normalizeCopyPath(r),s=this.normalizeCopyPath(n);return await this.copyToFs.promises.link(a,s)}async mkdir(r,n){let a=this.normalizeCopyPath(r);if(!(typeof n=="object"&&n&&"recursive"in n&&n.recursive)){let i=Gr(a);if(i&&i!=="/"&&i!==".")try{await this.copyToFs.promises.stat(i)}catch{await this.copyToFs.promises.mkdir(i,{recursive:!0})}}await this.copyToFs.promises.mkdir(a,n)}async readdir(r,...n){let a=this.normalizePath(r),s=this.normalizeCopyPath(r),i=new Set,u=new Set;try{let c=await this.sourceFs.promises.readdir(a,...n);Array.isArray(c)&&c.forEach(d=>i.add(typeof d=="string"?d:d.name))}catch(c){if(c.code!=="ENOENT")throw c}try{let c=await this.copyToFs.promises.readdir(s,...n);Array.isArray(c)&&c.forEach(d=>u.add(typeof d=="string"?d:d.name))}catch(c){if(c.code!=="ENOENT")throw c}return Array.from(new Set([...i,...u]))}async readlink(r){throw new Error("readlink is not implemented for CopyOnWriteSubFs")}async unlink(r){let n=this.normalizeCopyPath(r);return await this.copyToFs.promises.unlink(n)}async rename(r,n){let a=this.normalizeCopyPath(r),s=this.normalizeCopyPath(n);return await this.copyToFs.promises.rename(a,s)}async rmdir(r,n){let a=this.normalizeCopyPath(r);return await this.copyToFs.promises.rmdir(a,n)}async symlink(r,n,a){let s=this.normalizeCopyPath(r),i=this.normalizeCopyPath(n);return await this.copyToFs.promises.symlink(s,i,a)}async lookup(r){throw new Error(`lookup is not implemented for: ${Wt(r)}`)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async close(r){let n=this.openFh.get(r.subFsFileDescriptor);n&&(await n.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.datasync()}async read(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.read(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.chmod(n)}async fchown(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.chown(n,a)}async write(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.write(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.truncate(n)}async fstat(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.stat(n);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.utimes(n,a)}async writev(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.writev(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.readv(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,n){if(typeof r!="string"&&!Buffer.isBuffer(r))return super.readFile(r,n);let a=this.normalizePath(r),s=this.normalizeCopyPath(r);try{return await this.copyToFs.promises.readFile(s,n)}catch{return this.sourceFs.promises.readFile(a,n)}}async writeFile(r,n,a){let s=this.normalizeCopyPath(r);await this.isCopied(r)||await this.copyFromSource(r);let u=Gr(s);u&&u!=="/"&&u!=="."&&await this.copyToFs.promises.mkdir(u,{recursive:!0}),await this.copyToFs.promises.writeFile(s,n,a)}};o(sE,"CopyOnWriteSubFs");var Nh=sE;var yA=Lt(Or(),1);var Jg=Lt(Lh(),1);function bn(e){return{name:e.name,isFile:o(()=>!e.isDir,"isFile"),isDirectory:o(()=>e.isDir,"isDirectory"),isBlockDevice:o(()=>!0,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isFIFO:o(()=>!1,"isFIFO"),isSocket:o(()=>!1,"isSocket"),parentPath:e.parent,path:e.parent}}o(bn,"toDirEntry");var mA=class mA extends Jr{constructor({name:r,gitStorageFs:n,gitRoot:a,handler:s,rootPath:i}){super({name:r,rootPath:i});Ye(this,"memFs");Ye(this,"openFh",{});Ye(this,"storageFs");Ye(this,"gitRoot");Ye(this,"handler");this.handler=s,this.gitRoot=a,this.storageFs=n,this.memFs=(0,Jg.createFsFromVolume)(new Jg.Volume)}async getAuthor(){if(this.storageFs===void 0||this.storageFs===null)return{};let r=await yA.default.getConfig({fs:this.storageFs,dir:this.gitRoot,path:"user.name"}),n=await yA.default.getConfig({fs:this.storageFs,dir:this.gitRoot,path:"user.email"}),a=Math.floor(Date.now()/1e3),s=new Date().getTimezoneOffset();return{name:r,email:n,date:a,timezoneOffset:s}}async responsible(r){return!0}getRouteParams(){return this.context?.params||{}}getStaticSiblings(){return this.context?.staticSiblings||[]}async open(r,n,a){if(!(this.handler.writeFile!==void 0)&&(n.includes("w")||n.includes("a")))throw new Error(`Write operations not allowed for ${this.handler.type}`);if(n.includes("x")&&this.handler.type!=="gitBranchFileVirtualFile"&&this.handler.type!=="claudeVirtualSessionFileVirtualFile")throw new Error(`Exclusive operations not allowed for ${this.handler.type}`);let i=await this.getAuthor(),u=this.getRouteParams(),h=await this.handler.getFile({cacheFs:this.memFs,filePath:r,userSpaceFs:this.compositeFs,pathParams:u,author:i}),c=!1;for(let v of Object.values(this.openFh))v.path===r&&(c=!0);if((h||c)&&n.includes("x"))throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r});if(!h&&!c&&!(n.includes("w")||n.includes("a")))throw Object.assign(new Error(`ENOENT: no such file or directory, open '${r}'`),{code:"ENOENT",errno:-2,syscall:"open",path:r});let d=Gr(r);if(await this.memFs.promises.mkdir(d,{recursive:!0}),h===void 0&&!n.includes("x")||h&&h.type==="file")try{let v=await this.memFs.promises.access(r)}catch{await this.memFs.promises.writeFile(r,"")}let y=await this.memFs.promises.open(r,n,a),m=y.fd,g=new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:m,parentFsFileDescriptors:[]});return this.openFh[m]={path:r,mode:n,fh:y,openSha:h?.oid,readSha:void 0,unflushed:[]},(n.includes("x")||n.includes("w"))&&this.openFh[m].unflushed.push({length:0,start:0}),g}async mkdir(r,n){let a=r.toString(),s=this.getRouteParams(),i=n?{options:n}:{};try{let u=await this.getAuthor();await this.handler.mkdir({cacheFs:this.memFs,filePath:r.toString(),userSpaceFs:this.compositeFs,pathParams:s,...i,author:u});let h=typeof n=="object"?{...n,recursive:!0}:{recursive:!0};await this.memFs.promises.mkdir(r,h);let c=a.split("/"),d="";for(let y=1;y<=c.length;y++){d=c.slice(0,y).join("/");try{if((await this.memFs.promises.stat(d)).isDirectory()){let g=await this.memFs.promises.open(d,"r");this.openFh[g.fd]={path:d,mode:"r",fh:g,openSha:void 0,readSha:void 0,unflushed:[]}}}catch{}}}catch(u){throw u}}async access(r,n){await this.stat(r)}async futimes(r,n,a){let s=this.openFh[r.subFsFileDescriptor];if(!s)throw new Error("Invalid file handle");return await s.fh.utimes(n,a)}async fstat(r,n){let a=this.openFh[r.subFsFileDescriptor];if(!a)throw new Error("Invalid file handle");return this.stat(a.path,n)}async ftruncate(r,n){let a=this.openFh[r.subFsFileDescriptor];if(!a)throw new Error("Invalid file handle");return a.unflushed.push({length:0,start:0}),await a.fh.truncate(n)}async stat(r,n){let a=r.toString(),s=Object.values(this.openFh).find(c=>c.path===a&&c.unflushed.length>0);if(s&&s.unflushed.length>0)return await s.fh.stat(n);let i=this.getRouteParams(),u=await this.getAuthor();return await this.handler.getStats({cacheFs:this.memFs,filePath:a,userSpaceFs:this.compositeFs,pathParams:i,author:u})}async lstat(r,n){return this.stat(r,n)}async readdir(r,n){let a=r.toString(),s=this.getRouteParams(),i=this.getStaticSiblings(),u=await this.getAuthor(),h=await this.handler.getFile({cacheFs:this.memFs,filePath:a,userSpaceFs:this.compositeFs,pathParams:s,author:u});if(h){if(h.type!=="directory")throw new Error("not a folder");let c=Array.from(new Set([...h.content,...i.map(d=>bn({name:d.segment,parent:a,isDir:d.type==="folder"}))])).sort((d,y)=>d.name.localeCompare(y.name,void 0,{numeric:!0,sensitivity:"base"}));return n?.withFileTypes?c:c.map(d=>d.name)}return[]}async read(r,n,a,s,i){let u=r.subFsFileDescriptor,h=this.openFh[u];if(!h)throw new Error("Invalid file handle");if(h.unflushed.length===0){let c=this.getRouteParams(),d=await this.getAuthor(),y=await this.handler.getFile({cacheFs:this.memFs,filePath:h.path,userSpaceFs:this.compositeFs,pathParams:c,author:d});if(!y?.content)throw new Error("couldnt access content");if(y.type!=="file")throw new Error("not a file");let m=typeof y.content=="string"?Buffer.from(y.content):y.content,g=typeof i=="number"?i:0,v=Math.min(g+s,m.length),_=Math.max(0,v-g);return m.copy(n,a,g,g+_),{bytesRead:_,buffer:n}}return await h.fh.read(n,a,s,i)}async write(r,n,a,s,i){let u=this.openFh[r.subFsFileDescriptor];if(!u)throw new Error("Invalid file handle");let h=u.mode;if(!h.includes("w")&&!h.includes("a")&&!h.includes("+"))throw Object.assign(new Error("EBADF: bad file descriptor, write"),{code:"EBADF",errno:-9,syscall:"write"});if(u.unflushed.length===0){let m=this.getRouteParams(),g=await this.getAuthor(),v=await this.handler.getFile({cacheFs:this.memFs,filePath:u.path,userSpaceFs:this.compositeFs,pathParams:m,author:g});v&&v.oid&&(await this.memFs.promises.writeFile(u.path,v.content),u.readSha=v.oid)}let c=await u.fh.write(n,a,s,i),d=a??0,y=i??0;return u.unflushed.push({start:y,length:s||n.byteLength-d+y}),c}async close(r){let n=r.subFsFileDescriptor,a=this.openFh[n];if(!a)throw new Error("Invalid file handle");try{await this.dataSync(r),await a.fh.close(),await this.memFs.promises.unlink(a.path)}finally{delete this.openFh[n]}}async dataSync(r){let n=r.subFsFileDescriptor,a=this.openFh[n];if(!a)throw new Error("Invalid file handle");if(a.unflushed.length>0){if(this.handler.writeFile){let s=await this.memFs.promises.readFile(a.path),i=this.getRouteParams(),u=await this.getAuthor();await this.handler.writeFile({cacheFs:this.memFs,filePath:a.path,userSpaceFs:this.compositeFs,content:s,pathParams:i,author:u})}a.unflushed=[]}}async readFile(r,n){let a=typeof r=="string"?r:Buffer.isBuffer(r)?r.toString():r.fd?`FileHandle(${r.fd})`:r.toString(),s=null;typeof n=="string"?s=n:n&&typeof n=="object"&&n.encoding&&(s=n.encoding);let i=await this.open(a,"r");try{let h=(await this.fstat(i)).size,c=Buffer.alloc(h);return await this.read(i,c,0,h,0),await this.close(i),s?c.toString(s):c}catch(u){try{await this.close(i)}catch{}throw u}}async writeFile(r,n,a){let s="w",i="utf8",u;typeof a=="string"?i=a:a&&typeof a=="object"&&(a.flag&&(s=String(a.flag)),a.encoding&&(i=a.encoding),a.mode&&(u=typeof a.mode=="string"?parseInt(a.mode,8):a.mode));let h=await this.open(r,s,u);try{let c;typeof n=="string"?c=Buffer.from(n,i):Buffer.isBuffer(n)?c=n:n instanceof Uint8Array?c=Buffer.from(n):ArrayBuffer.isView(n)?c=Buffer.from(n.buffer,n.byteOffset,n.byteLength):c=Buffer.from(n),await this.write(h,c,0,c.length,0)}finally{await this.close(h)}}async rename(r,n){let a=r.toString(),s=n.toString();if(!this.handler.rename)throw new Error(`Rename not supported for ${this.handler.type} files`);let i=await this.memFs.promises.access(s).then(()=>!0).catch(()=>!1),u=await this.stat(s).then(()=>!0).catch(()=>!1),h=await this.stat(a).then(()=>!0).catch(()=>!1);if(await this.memFs.promises.access(a).then(()=>!0).catch(()=>!1)){let m=Gr(s);try{await this.memFs.promises.access(m)}catch{await this.memFs.promises.mkdir(m,{recursive:!0})}await this.memFs.promises.rename(r,n)}let d=this.getRouteParams(),y=await this.getAuthor();await this.handler.rename({cacheFs:this.memFs,filePath:a,userSpaceFs:this.compositeFs,newPath:s,pathParams:d,newPathParams:this.newContext?.params||{},author:y})}async fchmod(r,n){}async unlink(r){let n=r.toString();if(!this.handler.unlink)throw new Error(`Cannot unlink ${this.handler.type} files`);try{let a=this.getRouteParams(),s=await this.getAuthor();await this.handler.unlink({cacheFs:this.memFs,filePath:n,userSpaceFs:this.compositeFs,pathParams:a,author:s})}catch(a){let s=!1;for(let[i,u]of Object.entries(this.openFh))u.path===n&&u.unflushed.length>0&&(s=!0);if(!s)throw a}finally{let a=!1;for(let[s,i]of Object.entries(this.openFh))i.path===n&&(a=!0,await i.fh.close(),delete this.openFh[Number(s)]);a&&await this.memFs.promises.unlink(n)}}async rmdir(r,...n){let a=r.toString();if(!this.handler.rmdir)throw new Error(`Cannot rmdir ${this.handler.type} directories`);let s=this.getRouteParams(),i=await this.getAuthor();await this.handler.rmdir({cacheFs:this.memFs,filePath:a,userSpaceFs:this.compositeFs,pathParams:s,author:i});let u=!1;for(let[h,c]of Object.entries(this.openFh))c.path===a&&(u=!0,await c.fh.close(),delete this.openFh[Number(h)]);u&&await this.memFs.promises.rmdir(a,{recursive:!0})}fileType(){return 10}};o(mA,"CompositeSubFsAdapter");var It=mA;function XU({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"legit-virtual-file",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"legitVirtualFile",rootType:"folder",getStats:o(async a=>{let s=t+"/.git";try{return await e.promises.stat(s)}catch{throw new Error(`ENOENT: no such file or directory, stat '${s}'`)}},"getStats"),getFile:o(async a=>({type:"directory",content:[],mode:493,size:0}),"getFile"),rename(a){throw new Error("not implemented")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(XU,"createLegitVirtualFileAdapter");var ew=Lt(Or(),1);var JU=Lt(Or(),1);function yo(e){return e.replace(/\./g,"%2E").replace(/\//g,".")}o(yo,"encodeBranchNameForVfs");function Ht(e){return e.replace(/\./g,"/").replace(/%2E/g,".")}o(Ht,"decodeBranchNameFromVfs");var gA="-operation";async function Vi(e,t,r){let a=(await JU.default.listBranches({fs:e,dir:t})).filter(s=>s.endsWith(Ht(r)+gA))[0];return a?yo(a):void 0}o(Vi,"resolveOperationBranchName");var Qg=Lt(Or(),1);async function Et(e,t){try{let r=await Qg.default.getConfig({fs:t,dir:e,path:"user.legit-current-branch"});if(r)return yo(r)}catch{}try{let r=await Qg.default.getConfig({fs:t,dir:e,path:"init.defaultBranch"});return yo(r)||"main"}catch{return"main"}}o(Et,"getCurrentBranch");async function QU(e,t,r){await Qg.default.setConfig({fs:t,dir:e,path:"user.legit-current-branch",value:Ht(r)})}o(QU,"setCurrentBranch");var mo=Lt(Or(),1);async function it(e,t,r){try{return await mo.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${Ht(r)}`})}catch{return}}o(it,"tryResolveRef");async function ca({dir:e,fs:t,treeOid:r,deletePathParts:n,addPathParts:a,addObj:s,addKeepIfEmpty:i,deleteKeepIfNotEmpty:u,keepFilename:h=".keep",gitCache:c}){let[d,...y]=a??[],[m,...g]=n??[],v=[];if(r){let{tree:_}=await mo.default.readTree({fs:t,dir:e,oid:r,cache:c||{}});v=[..._]}if(d===m){let _=d;if(_===void 0)throw new Error("illegal arguement - called with out a path part");if(y.length===0)throw new Error("can not move into it self");if(g.length===0)throw new Error("can not move from it self");let b=v.findIndex(A=>A.path===_),S=(b!==-1?v[b]:void 0)?.oid,T=await ca({dir:e,fs:t,treeOid:S,addPathParts:y,deletePathParts:g,addObj:s,addKeepIfEmpty:i,deleteKeepIfNotEmpty:u});if(T===void 0)throw new Error("on the same path we expect an update - respectivly a newly created subTreeOid");let x=!1;if(T!==S){x=!0;let A={mode:"040000",path:_,oid:T,type:"tree"};b!==-1?v[b]=A:v.push(A)}if(r==null&&!x)throw new Error("Illegal state - if the currentOid is undefined - a new tree should have been created (an update should have happened)");if(x)return await mo.default.writeTree({fs:t,dir:e,tree:v});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}else{let _=!1,b;if(m){let E=v.findIndex(T=>T.path===m),S=E!==-1?v[E]:void 0;if(S===void 0)throw new Error("Element doesnt exist in tree");if(g.length>0){if(S&&S.type!=="tree")throw new Error("SubPart of the path for the obj to delete is not a tree");let T=await ca({dir:e,fs:t,treeOid:S.oid,addPathParts:void 0,deletePathParts:g,addObj:s,addKeepIfEmpty:i,deleteKeepIfNotEmpty:u});if(T===S.oid)throw new Error("in case of a delete we expect a different subtree oid");_=!0,T===void 0?v.splice(E,1):v[E]={mode:"040000",path:m,oid:T,type:"tree"}}else if(_=!0,v.splice(E,1),v.length===0&&i){let T=new Uint8Array(0),x=await mo.default.writeBlob({fs:t,dir:e,blob:T});v.push({mode:"100644",oid:x,path:h,type:"blob"})}b=S}if(d){let E=v.findIndex(T=>T.path===d),S=E!==-1?v[E]:void 0;if(y.length>0){if(S&&S.type!=="tree")throw new Error("SubPart of the path for the obj to add is not a tree");let T=await ca({dir:e,fs:t,treeOid:S?.oid,addPathParts:y,deletePathParts:void 0,addObj:s,addKeepIfEmpty:i,deleteKeepIfNotEmpty:u});if(T===void 0)throw new Error("in case we add, we expect an update - respectivly a newly created subTreeOid");if(T!==S?.oid){_=!0;let x={mode:"040000",path:d,oid:T,type:"tree"};if(E!==-1)v[E]=x;else if(v.push(x),u&&v.length>1){let A=v.findIndex(B=>B.path===h);A!==-1&&v.splice(A,1)}}}else{if(_=!0,s){let T={mode:s.type==="tree"?"040000":"100644",path:d,oid:s.oid,type:s.type};if(E!==-1)v[E]=T;else{if(u&&v.length>0){let x=v.findIndex(A=>A.path===h);x!==-1&&v.splice(x,1)}v.push(T)}}if(i&&v.length===0){let T=new Uint8Array(0),x=await mo.default.writeBlob({fs:t,dir:e,blob:T});v.push({mode:"100644",oid:x,path:h,type:"blob"})}}}if(v.length===0)return;if(_)return await mo.default.writeTree({fs:t,dir:e,tree:v});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}}o(ca,"buildUpdatedTree");async function eM(e,t,r,n,a=0,s={}){let{tree:i}=await mo.default.readTree({fs:e,dir:t,oid:r,cache:s});if(n.length===a)return{type:"tree",entries:i.map(c=>bn({parent:n.join("/"),name:c.path,isDir:c.type==="tree"})),oid:r};let u=n[a],h=i.find(c=>c.path===u);if(h){if(n.length===a+1){if(h.type==="blob")return{type:"blob",oid:h.oid};if(h.type==="tree"){let c=await mo.default.readTree({fs:e,dir:t,oid:h.oid,cache:s});return{type:"tree",entries:c.tree.map(d=>bn({parent:n.join("/"),name:d.path,isDir:d.type==="tree"})),oid:c.oid}}}else if(h.type==="tree")return await eM(e,t,h.oid,n,a+1,s)}}o(eM,"findGitObjectAtPath");async function Nl({filePath:e,gitRoot:t,nodeFs:r,commitSha:n,pathParams:a,gitCache:s}){let i=s||{};if(!a.filePath){let c=await mo.default.readTree({fs:r,dir:t,oid:n,cache:i});return{type:"tree",entries:c.tree.map(y=>bn({parent:e,name:y.path,isDir:y.type==="tree"})),oid:c.oid}}let u=a.filePath?a.filePath.split("/"):[];return await eM(r,t,n,u,0,i)}o(Nl,"resolveGitObjAtPath");function tM({gitStorageFs:e,gitRoot:t,rootPath:r}){let n={type:"gitBranchOperationsVirtualFile",rootType:"file",getStats:o(async s=>{let{pathParams:i}=s;i.branchName===void 0&&(i.branchName=await Et(t,e));let u=await Vi(e,t,i.branchName),h=await ew.default.listBranches({fs:e,dir:t}),c,d=!1;if(u){if(c=await it(e,t,u),c===void 0)throw new Error(`Base Branch ${i.branchName} for operations does not exis`);d=c!==void 0}else if(c=await it(e,t,i.branchName),c===void 0)throw new Error(`Base Branch ${i.branchName} for operations does not exis`);let y=await ew.default.readCommit({fs:e,dir:t,oid:c}),{commit:m}=y,g=m.committer.timestamp*1e3;try{return{mode:420,size:(d?await a.handler.getFile(s):void 0)?.content?.length??0,atimeMs:g,mtimeMs:g,ctimeMs:g,birthtimeMs:g,atime:new Date(g),mtime:new Date(g),ctime:new Date(g),birthtime:new Date(g),isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:o(async s=>{let{pathParams:i}=s;i.branchName===void 0&&(i.branchName=await Et(t,e));let u=await Vi(e,t,i.branchName),h=[];if(u){let y=await it(e,t,u);if(y!==void 0){let m=!1,g=y;for(;g&&!m;){let v=await ew.default.readCommit({fs:e,dir:t,oid:g});h.push({oid:v.oid,parentOids:v.commit.parent,message:v.commit.message,originBranchOid:"unset"}),g=v.commit.parent&&v.commit.parent.length>0?v.commit.parent[0]:null,v.commit.parent.length===2&&v.commit.parent[0]===v.commit.parent[1]&&(m=!0)}}}let c;for(let y=h.length-1;y>=0;y--){let m=h[y];if(c===void 0){if(m.parentOids.length!==2&&m.parentOids[0]!==m.parentOids[1])throw new Error(`Operation commit ${m.oid} does not have two parents as expected`);c=m.parentOids[1]}m.parentOids.length===2&&(c=m.parentOids[1]),m.originBranchOid=c}let d=Buffer.from(JSON.stringify(h,null,2),"utf-8");return{type:"file",content:d,mode:420,size:d.length}},"getFile"),rename:o(async function(s){throw new Error("not implemented")},"rename"),mkdir:o(async function(s){throw new Error("not implemented")},"mkdir")},a=new It({name:"branch-operations",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:n});return a}o(tM,"createBranchOperationsAdapter");var En=Lt(Or(),1);var x9=Lt(x6(),1);function V_e(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}o(V_e,"fromValue");function G_e(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:V_e(e)}o(G_e,"getIterator");async function O9(e,t){let r=G_e(e);for(;;){let{value:n,done:a}=await r.next();if(n&&await t(n),a)break}r.return&&r.return()}o(O9,"forAwait");function K_e(e){let{PassThrough:t}=T9(),r=new t;return setTimeout(async()=>{await O9(e,n=>r.write(n)),r.end()},1),r}o(K_e,"asyncIteratorToStream");async function Y_e(e){let t=0,r=[];await O9(e,s=>{r.push(s),t+=s.byteLength});let n=new Uint8Array(t),a=0;for(let s of r)n.set(s,a),a+=s.byteLength;return n}o(Y_e,"collect");function Z_e(e){let t=Object.getOwnPropertyDescriptor(e,Symbol.asyncIterator);if(t&&t.enumerable)return e;let r=!1,n=[],a={};return e.on("data",s=>{n.push(s),a.resolve&&(a.resolve({value:n.shift(),done:!1}),a={})}),e.on("error",s=>{a.reject&&(a.reject(s),a={})}),e.on("end",()=>{r=!0,a.resolve&&(a.resolve({done:!0}),a={})}),{next(){return new Promise((s,i)=>{if(n.length===0&&r)return s({done:!0});if(n.length>0)return s({value:n.shift(),done:!1});n.length===0&&!r&&(a={resolve:s,reject:i})})},return(){e.removeAllListeners(),e.destroy&&e.destroy()},[Symbol.asyncIterator](){return this}}}o(Z_e,"fromNodeStream");async function X_e({onProgress:e,url:t,method:r="GET",headers:n={},agent:a,body:s}){return s&&Array.isArray(s)?s=Buffer.from(await Y_e(s)):s&&(s=K_e(s)),new Promise((i,u)=>{(0,x9.default)({url:t,method:r,headers:n,agent:a,body:s},(h,c)=>{if(h)return u(h);try{let d=Z_e(c);i({url:c.url,method:c.method,statusCode:c.statusCode,statusMessage:c.statusMessage,body:d,headers:c.headers})}catch(d){u(d)}})})}o(X_e,"request");var J_e={request:X_e},x0=J_e;var Ws="legit",I9=o(({fs:e,gitRepoPath:t,serverUrl:r="https://hub.legitcontrol.com",auth:n,anonymousBranch:a,authHeaderPrefix:s="Bearer "})=>{let i=!1;async function u(b){let E=await n.getMaxAccessTokenForBranch(b);if(!E)throw new Error(`No access token for branch ${b}`);await En.default.fetch({fs:e,http:x0,dir:t,singleBranch:!0,ref:`${b}`,remote:Ws,url:r,headers:{Authorization:`${s}${E}`}});let S=await En.default.resolveRef({fs:e,dir:t,ref:`${Ws}/${b}`});await En.default.writeRef({fs:e,dir:t,ref:`refs/heads/${b}`,value:S})}o(u,"loadBranch");let h=[];async function c(){let b=await n.getMaxAccessTokenForBranch("todo");await En.default.fetch({fs:e,http:x0,dir:t,remote:Ws,url:r,headers:{Authorization:`${s}${b}`}});let E=await En.default.listBranches({fs:e,dir:t});for(let S of E){if(S===a)continue;let T=`${Ws}/${S}`,x,A;try{x=await En.default.resolveRef({fs:e,dir:t,ref:S})}catch(B){console.log(`Could not resolve local ref ${S}:`,B)}try{A=await En.default.resolveRef({fs:e,dir:t,ref:T})}catch{A=void 0}if(x&&A){if(x!==A){let B=await En.default.findMergeBase({fs:e,dir:t,oids:[x,A]});if(B[0]!==x&&B[0]!==A){let P=await En.default.merge({fs:e,dir:t,ours:x,theirs:A,fastForwardOnly:!1,abortOnConflict:!1,author:{name:"Your Name",email:"your.email@example.com"},mergeDriver:o(async({branches:N,contents:L,path:C})=>{let[z,V,Q]=L;return console.log(`Merging ${N[0]} with ${N[1]}...`),console.log("merged:"),console.log(L),{cleanMerge:!0,mergedText:Q===void 0?V:Q}},"mergeDriver")});await En.default.writeRef({fs:e,dir:t,ref:`refs/heads/${S}`,value:P.oid,force:!0})}B[0]===x?(console.log(`branch ${S} differs - remote ahaed, not behind`),await En.default.writeRef({fs:e,dir:t,ref:`refs/heads/${S}`,value:A,force:!0})):B[0]===A?(console.log(`branch ${S} differs - local ahead, not behind`),h.push(S)):(console.log(`branch ${S} differs - both changed`),h.push(S))}}else x&&!A&&h.push(S)}}o(c,"pull");async function d(b){if((await n.getUser()).type!=="local")for(let E of b){let S=await n.getMaxAccessTokenForBranch(E);await En.default.push({fs:e,http:x0,dir:t,remote:Ws,url:r,ref:E,headers:{Authorization:`Bearer ${S}`}})}}o(d,"push");let y=Promise.resolve();async function m(b){y=y.then(()=>d(b)),await y}o(m,"sequentialPush");async function g(){await En.default.getConfig({fs:e,dir:t,path:`remote.${Ws}.fetch`})||await En.default.setConfig({fs:e,dir:t,path:`remote.${Ws}.fetch`,value:`+refs/heads/*:refs/remotes/${Ws}/*`});try{await c();let E=[...new Set(h)].filter(S=>S.indexOf(a)===-1);await m(E),h=[]}catch(E){console.error("Error monitoring changes:",E)}finally{i&&setTimeout(g,1e3)}}o(g,"pullPushTick");function v(){i=!0,g()}o(v,"startSync");function _(){i=!1}return o(_,"stopSync"),{start:o(()=>{i||(v(),i=!0)},"start"),stop:o(()=>{_()},"stop"),isRunning:o(()=>i,"isRunning"),loadBranch:u,sequentialPush:m}},"createLegitSyncService");var Lr=Lt(Or(),1);function jc(e){let t=e.length;for(;--t>=0;)e[t]=0}o(jc,"zero$1");var Q_e=0,p7=1,e1e=2,t1e=3,r1e=258,ZT=29,bp=256,hp=bp+1+ZT,$c=30,XT=19,y7=2*hp+1,yf=15,xT=16,n1e=7,JT=256,m7=16,g7=17,w7=18,jT=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),B0=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i1e=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),v7=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o1e=512,Ca=new Array((hp+2)*2);jc(Ca);var fp=new Array($c*2);jc(fp);var dp=new Array(o1e);jc(dp);var pp=new Array(r1e-t1e+1);jc(pp);var QT=new Array(ZT);jc(QT);var C0=new Array($c);jc(C0);function OT(e,t,r,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=e&&e.length}o(OT,"StaticTreeDesc");var b7,_7,E7;function IT(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}o(IT,"TreeDesc");var S7=o(e=>e<256?dp[e]:dp[256+(e>>>7)],"d_code"),yp=o((e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},"put_short"),jn=o((e,t,r)=>{e.bi_valid>xT-r?(e.bi_buf|=t<<e.bi_valid&65535,yp(e,e.bi_buf),e.bi_buf=t>>xT-e.bi_valid,e.bi_valid+=r-xT):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},"send_bits"),Bo=o((e,t,r)=>{jn(e,r[t*2],r[t*2+1])},"send_code"),A7=o((e,t)=>{let r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1},"bi_reverse"),a1e=o(e=>{e.bi_valid===16?(yp(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},"bi_flush"),s1e=o((e,t)=>{let r=t.dyn_tree,n=t.max_code,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,u=t.stat_desc.extra_base,h=t.stat_desc.max_length,c,d,y,m,g,v,_=0;for(m=0;m<=yf;m++)e.bl_count[m]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<y7;c++)d=e.heap[c],m=r[r[d*2+1]*2+1]+1,m>h&&(m=h,_++),r[d*2+1]=m,!(d>n)&&(e.bl_count[m]++,g=0,d>=u&&(g=i[d-u]),v=r[d*2],e.opt_len+=v*(m+g),s&&(e.static_len+=v*(a[d*2+1]+g)));if(_!==0){do{for(m=h-1;e.bl_count[m]===0;)m--;e.bl_count[m]--,e.bl_count[m+1]+=2,e.bl_count[h]--,_-=2}while(_>0);for(m=h;m!==0;m--)for(d=e.bl_count[m];d!==0;)y=e.heap[--c],!(y>n)&&(r[y*2+1]!==m&&(e.opt_len+=(m-r[y*2+1])*r[y*2],r[y*2+1]=m),d--)}},"gen_bitlen"),R7=o((e,t,r)=>{let n=new Array(yf+1),a=0,s,i;for(s=1;s<=yf;s++)a=a+r[s-1]<<1,n[s]=a;for(i=0;i<=t;i++){let u=e[i*2+1];u!==0&&(e[i*2]=A7(n[u]++,u))}},"gen_codes"),l1e=o(()=>{let e,t,r,n,a,s=new Array(yf+1);for(r=0,n=0;n<ZT-1;n++)for(QT[n]=r,e=0;e<1<<jT[n];e++)pp[r++]=n;for(pp[r-1]=n,a=0,n=0;n<16;n++)for(C0[n]=a,e=0;e<1<<B0[n];e++)dp[a++]=n;for(a>>=7;n<$c;n++)for(C0[n]=a<<7,e=0;e<1<<B0[n]-7;e++)dp[256+a++]=n;for(t=0;t<=yf;t++)s[t]=0;for(e=0;e<=143;)Ca[e*2+1]=8,e++,s[8]++;for(;e<=255;)Ca[e*2+1]=9,e++,s[9]++;for(;e<=279;)Ca[e*2+1]=7,e++,s[7]++;for(;e<=287;)Ca[e*2+1]=8,e++,s[8]++;for(R7(Ca,hp+1,s),e=0;e<$c;e++)fp[e*2+1]=5,fp[e*2]=A7(e,5);b7=new OT(Ca,jT,bp+1,hp,yf),_7=new OT(fp,B0,0,$c,yf),E7=new OT(new Array(0),i1e,0,XT,n1e)},"tr_static_init"),T7=o(e=>{let t;for(t=0;t<hp;t++)e.dyn_ltree[t*2]=0;for(t=0;t<$c;t++)e.dyn_dtree[t*2]=0;for(t=0;t<XT;t++)e.bl_tree[t*2]=0;e.dyn_ltree[JT*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},"init_block"),x7=o(e=>{e.bi_valid>8?yp(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},"bi_windup"),P9=o((e,t,r,n)=>{let a=t*2,s=r*2;return e[a]<e[s]||e[a]===e[s]&&n[t]<=n[r]},"smaller"),PT=o((e,t,r)=>{let n=e.heap[r],a=r<<1;for(;a<=e.heap_len&&(a<e.heap_len&&P9(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!P9(t,n,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=n},"pqdownheap"),F9=o((e,t,r)=>{let n,a,s=0,i,u;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+s++]&255,n+=(e.pending_buf[e.sym_buf+s++]&255)<<8,a=e.pending_buf[e.sym_buf+s++],n===0?Bo(e,a,t):(i=pp[a],Bo(e,i+bp+1,t),u=jT[i],u!==0&&(a-=QT[i],jn(e,a,u)),n--,i=S7(n),Bo(e,i,r),u=B0[i],u!==0&&(n-=C0[i],jn(e,n,u)));while(s<e.sym_next);Bo(e,JT,t)},"compress_block"),WT=o((e,t)=>{let r=t.dyn_tree,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.elems,i,u,h=-1,c;for(e.heap_len=0,e.heap_max=y7,i=0;i<s;i++)r[i*2]!==0?(e.heap[++e.heap_len]=h=i,e.depth[i]=0):r[i*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=h<2?++h:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,a&&(e.static_len-=n[c*2+1]);for(t.max_code=h,i=e.heap_len>>1;i>=1;i--)PT(e,r,i);c=s;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],PT(e,r,1),u=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=u,r[c*2]=r[i*2]+r[u*2],e.depth[c]=(e.depth[i]>=e.depth[u]?e.depth[i]:e.depth[u])+1,r[i*2+1]=r[u*2+1]=c,e.heap[1]=c++,PT(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],s1e(e,t),R7(r,h,e.bl_count)},"build_tree"),k9=o((e,t,r)=>{let n,a=-1,s,i=t[0*2+1],u=0,h=7,c=4;for(i===0&&(h=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=t[(n+1)*2+1],!(++u<h&&s===i)&&(u<c?e.bl_tree[s*2]+=u:s!==0?(s!==a&&e.bl_tree[s*2]++,e.bl_tree[m7*2]++):u<=10?e.bl_tree[g7*2]++:e.bl_tree[w7*2]++,u=0,a=s,i===0?(h=138,c=3):s===i?(h=6,c=3):(h=7,c=4))},"scan_tree"),B9=o((e,t,r)=>{let n,a=-1,s,i=t[0*2+1],u=0,h=7,c=4;for(i===0&&(h=138,c=3),n=0;n<=r;n++)if(s=i,i=t[(n+1)*2+1],!(++u<h&&s===i)){if(u<c)do Bo(e,s,e.bl_tree);while(--u!==0);else s!==0?(s!==a&&(Bo(e,s,e.bl_tree),u--),Bo(e,m7,e.bl_tree),jn(e,u-3,2)):u<=10?(Bo(e,g7,e.bl_tree),jn(e,u-3,3)):(Bo(e,w7,e.bl_tree),jn(e,u-11,7));u=0,a=s,i===0?(h=138,c=3):s===i?(h=6,c=3):(h=7,c=4)}},"send_tree"),f1e=o(e=>{let t;for(k9(e,e.dyn_ltree,e.l_desc.max_code),k9(e,e.dyn_dtree,e.d_desc.max_code),WT(e,e.bl_desc),t=XT-1;t>=3&&e.bl_tree[v7[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},"build_bl_tree"),u1e=o((e,t,r,n)=>{let a;for(jn(e,t-257,5),jn(e,r-1,5),jn(e,n-4,4),a=0;a<n;a++)jn(e,e.bl_tree[v7[a]*2+1],3);B9(e,e.dyn_ltree,t-1),B9(e,e.dyn_dtree,r-1)},"send_all_trees"),c1e=o(e=>{let t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return 0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return 1;for(r=32;r<bp;r++)if(e.dyn_ltree[r*2]!==0)return 1;return 0},"detect_data_type"),C9=!1,h1e=o(e=>{C9||(l1e(),C9=!0),e.l_desc=new IT(e.dyn_ltree,b7),e.d_desc=new IT(e.dyn_dtree,_7),e.bl_desc=new IT(e.bl_tree,E7),e.bi_buf=0,e.bi_valid=0,T7(e)},"_tr_init$1"),O7=o((e,t,r,n)=>{jn(e,(Q_e<<1)+(n?1:0),3),x7(e),yp(e,r),yp(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},"_tr_stored_block$1"),d1e=o(e=>{jn(e,p7<<1,3),Bo(e,JT,Ca),a1e(e)},"_tr_align$1"),p1e=o((e,t,r,n)=>{let a,s,i=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=c1e(e)),WT(e,e.l_desc),WT(e,e.d_desc),i=f1e(e),a=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=a&&(a=s)):a=s=r+5,r+4<=a&&t!==-1?O7(e,t,r,n):e.strategy===4||s===a?(jn(e,(p7<<1)+(n?1:0),3),F9(e,Ca,fp)):(jn(e,(e1e<<1)+(n?1:0),3),u1e(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),F9(e,e.dyn_ltree,e.dyn_dtree)),T7(e),n&&x7(e)},"_tr_flush_block$1"),y1e=o((e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(pp[r]+bp+1)*2]++,e.dyn_dtree[S7(t)*2]++),e.sym_next===e.sym_end),"_tr_tally$1"),m1e=h1e,g1e=O7,w1e=p1e,v1e=y1e,b1e=d1e,_1e={_tr_init:m1e,_tr_stored_block:g1e,_tr_flush_block:w1e,_tr_tally:v1e,_tr_align:b1e},E1e=o((e,t,r,n)=>{let a=e&65535|0,s=e>>>16&65535|0,i=0;for(;r!==0;){i=r>2e3?2e3:r,r-=i;do a=a+t[n++]|0,s=s+a|0;while(--i);a%=65521,s%=65521}return a|s<<16|0},"adler32"),mp=E1e,S1e=o(()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},"makeTable"),A1e=new Uint32Array(S1e()),R1e=o((e,t,r,n)=>{let a=A1e,s=n+r;e^=-1;for(let i=n;i<s;i++)e=e>>>8^a[(e^t[i])&255];return e^-1},"crc32"),qr=R1e,wf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Wc={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:T1e,_tr_stored_block:qT,_tr_flush_block:x1e,_tr_tally:zs,_tr_align:O1e}=_1e,{Z_NO_FLUSH:Vs,Z_PARTIAL_FLUSH:I1e,Z_FULL_FLUSH:P1e,Z_FINISH:ki,Z_BLOCK:L9,Z_OK:Xr,Z_STREAM_END:N9,Z_STREAM_ERROR:Co,Z_DATA_ERROR:F1e,Z_BUF_ERROR:FT,Z_DEFAULT_COMPRESSION:k1e,Z_FILTERED:B1e,Z_HUFFMAN_ONLY:O0,Z_RLE:C1e,Z_FIXED:L1e,Z_DEFAULT_STRATEGY:N1e,Z_UNKNOWN:D1e,Z_DEFLATED:D0}=Wc,$1e=9,U1e=15,M1e=8,j1e=29,W1e=256,HT=W1e+1+j1e,q1e=30,H1e=19,z1e=2*HT+1,V1e=15,yt=3,Hs=258,Lo=Hs+yt+1,G1e=32,Uc=42,ex=57,zT=69,VT=73,GT=91,KT=103,mf=113,sp=666,Sn=1,qc=2,vf=3,Hc=4,K1e=3,gf=o((e,t)=>(e.msg=wf[t],t),"err"),D9=o(e=>e*2-(e>4?9:0),"rank"),qs=o(e=>{let t=e.length;for(;--t>=0;)e[t]=0},"zero"),Y1e=o(e=>{let t,r,n,a=e.w_size;t=e.hash_size,n=t;do r=e.head[--n],e.head[n]=r>=a?r-a:0;while(--t);t=a,n=t;do r=e.prev[--n],e.prev[n]=r>=a?r-a:0;while(--t)},"slide_hash"),Z1e=o((e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask,"HASH_ZLIB"),Gs=Z1e,si=o(e=>{let t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))},"flush_pending"),li=o((e,t)=>{x1e(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,si(e.strm)},"flush_block_only"),St=o((e,t)=>{e.pending_buf[e.pending++]=t},"put_byte"),ap=o((e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},"putShortMSB"),YT=o((e,t,r,n)=>{let a=e.avail_in;return a>n&&(a=n),a===0?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),r),e.state.wrap===1?e.adler=mp(e.adler,t,a,r):e.state.wrap===2&&(e.adler=qr(e.adler,t,a,r)),e.next_in+=a,e.total_in+=a,a)},"read_buf"),I7=o((e,t)=>{let r=e.max_chain_length,n=e.strstart,a,s,i=e.prev_length,u=e.nice_match,h=e.strstart>e.w_size-Lo?e.strstart-(e.w_size-Lo):0,c=e.window,d=e.w_mask,y=e.prev,m=e.strstart+Hs,g=c[n+i-1],v=c[n+i];e.prev_length>=e.good_match&&(r>>=2),u>e.lookahead&&(u=e.lookahead);do if(a=t,!(c[a+i]!==v||c[a+i-1]!==g||c[a]!==c[n]||c[++a]!==c[n+1])){n+=2,a++;do;while(c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&c[++n]===c[++a]&&n<m);if(s=Hs-(m-n),n=m-Hs,s>i){if(e.match_start=t,i=s,s>=u)break;g=c[n+i-1],v=c[n+i]}}while((t=y[t&d])>h&&--r!==0);return i<=e.lookahead?i:e.lookahead},"longest_match"),Mc=o(e=>{let t=e.w_size,r,n,a;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Lo)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Y1e(e),n+=t),e.strm.avail_in===0)break;if(r=YT(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=yt)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=Gs(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=Gs(e,e.ins_h,e.window[a+yt-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<yt)););}while(e.lookahead<Lo&&e.strm.avail_in!==0)},"fill_window"),P7=o((e,t)=>{let r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,a,s,i=0,u=e.strm.avail_in;do{if(n=65535,s=e.bi_valid+42>>3,e.strm.avail_out<s||(s=e.strm.avail_out-s,a=e.strstart-e.block_start,n>a+e.strm.avail_in&&(n=a+e.strm.avail_in),n>s&&(n=s),n<r&&(n===0&&t!==ki||t===Vs||n!==a+e.strm.avail_in)))break;i=t===ki&&n===a+e.strm.avail_in?1:0,qT(e,0,0,i),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,si(e.strm),a&&(a>n&&(a=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,n-=a),n&&(YT(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(i===0);return u-=e.strm.avail_in,u&&(u>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=u&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-u,e.strm.next_in),e.strstart),e.strstart+=u,e.insert+=u>e.w_size-e.insert?e.w_size-e.insert:u),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),i?Hc:t!==Vs&&t!==ki&&e.strm.avail_in===0&&e.strstart===e.block_start?qc:(s=e.window_size-e.strstart,e.strm.avail_in>s&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(YT(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water<e.strstart&&(e.high_water=e.strstart),s=e.bi_valid+42>>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,r=s>e.w_size?e.w_size:s,a=e.strstart-e.block_start,(a>=r||(a||t===ki)&&t!==Vs&&e.strm.avail_in===0&&a<=s)&&(n=a>s?s:a,i=t===ki&&e.strm.avail_in===0&&n===a?1:0,qT(e,e.block_start,n,i),e.block_start+=n,si(e.strm)),i?vf:Sn)},"deflate_stored"),kT=o((e,t)=>{let r,n;for(;;){if(e.lookahead<Lo){if(Mc(e),e.lookahead<Lo&&t===Vs)return Sn;if(e.lookahead===0)break}if(r=0,e.lookahead>=yt&&(e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+yt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-Lo&&(e.match_length=I7(e,r)),e.match_length>=yt)if(n=zs(e,e.strstart-e.match_start,e.match_length-yt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=yt){e.match_length--;do e.strstart++,e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+yt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+1]);else n=zs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(li(e,!1),e.strm.avail_out===0))return Sn}return e.insert=e.strstart<yt-1?e.strstart:yt-1,t===ki?(li(e,!0),e.strm.avail_out===0?vf:Hc):e.sym_next&&(li(e,!1),e.strm.avail_out===0)?Sn:qc},"deflate_fast"),Nc=o((e,t)=>{let r,n,a;for(;;){if(e.lookahead<Lo){if(Mc(e),e.lookahead<Lo&&t===Vs)return Sn;if(e.lookahead===0)break}if(r=0,e.lookahead>=yt&&(e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+yt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=yt-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Lo&&(e.match_length=I7(e,r),e.match_length<=5&&(e.strategy===B1e||e.match_length===yt&&e.strstart-e.match_start>4096)&&(e.match_length=yt-1)),e.prev_length>=yt&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-yt,n=zs(e,e.strstart-1-e.prev_match,e.prev_length-yt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=Gs(e,e.ins_h,e.window[e.strstart+yt-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=yt-1,e.strstart++,n&&(li(e,!1),e.strm.avail_out===0))return Sn}else if(e.match_available){if(n=zs(e,0,e.window[e.strstart-1]),n&&li(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Sn}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=zs(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<yt-1?e.strstart:yt-1,t===ki?(li(e,!0),e.strm.avail_out===0?vf:Hc):e.sym_next&&(li(e,!1),e.strm.avail_out===0)?Sn:qc},"deflate_slow"),X1e=o((e,t)=>{let r,n,a,s,i=e.window;for(;;){if(e.lookahead<=Hs){if(Mc(e),e.lookahead<=Hs&&t===Vs)return Sn;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=yt&&e.strstart>0&&(a=e.strstart-1,n=i[a],n===i[++a]&&n===i[++a]&&n===i[++a])){s=e.strstart+Hs;do;while(n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&n===i[++a]&&a<s);e.match_length=Hs-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=yt?(r=zs(e,1,e.match_length-yt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=zs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(li(e,!1),e.strm.avail_out===0))return Sn}return e.insert=0,t===ki?(li(e,!0),e.strm.avail_out===0?vf:Hc):e.sym_next&&(li(e,!1),e.strm.avail_out===0)?Sn:qc},"deflate_rle"),J1e=o((e,t)=>{let r;for(;;){if(e.lookahead===0&&(Mc(e),e.lookahead===0)){if(t===Vs)return Sn;break}if(e.match_length=0,r=zs(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(li(e,!1),e.strm.avail_out===0))return Sn}return e.insert=0,t===ki?(li(e,!0),e.strm.avail_out===0?vf:Hc):e.sym_next&&(li(e,!1),e.strm.avail_out===0)?Sn:qc},"deflate_huff");function ko(e,t,r,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=a}o(ko,"Config");var lp=[new ko(0,0,0,0,P7),new ko(4,4,8,4,kT),new ko(4,5,16,8,kT),new ko(4,6,32,32,kT),new ko(4,4,16,16,Nc),new ko(8,16,32,32,Nc),new ko(8,16,128,128,Nc),new ko(8,32,128,256,Nc),new ko(32,128,258,1024,Nc),new ko(32,258,258,4096,Nc)],Q1e=o(e=>{e.window_size=2*e.w_size,qs(e.head),e.max_lazy_match=lp[e.level].max_lazy,e.good_match=lp[e.level].good_length,e.nice_match=lp[e.level].nice_length,e.max_chain_length=lp[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=yt-1,e.match_available=0,e.ins_h=0},"lm_init");function eEe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=D0,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(z1e*2),this.dyn_dtree=new Uint16Array((2*q1e+1)*2),this.bl_tree=new Uint16Array((2*H1e+1)*2),qs(this.dyn_ltree),qs(this.dyn_dtree),qs(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(V1e+1),this.heap=new Uint16Array(2*HT+1),qs(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*HT+1),qs(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}o(eEe,"DeflateState");var _p=o(e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==Uc&&t.status!==ex&&t.status!==zT&&t.status!==VT&&t.status!==GT&&t.status!==KT&&t.status!==mf&&t.status!==sp?1:0},"deflateStateCheck"),F7=o(e=>{if(_p(e))return gf(e,Co);e.total_in=e.total_out=0,e.data_type=D1e;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?ex:t.wrap?Uc:mf,e.adler=t.wrap===2?0:1,t.last_flush=-2,T1e(t),Xr},"deflateResetKeep"),k7=o(e=>{let t=F7(e);return t===Xr&&Q1e(e.state),t},"deflateReset"),tEe=o((e,t)=>_p(e)||e.state.wrap!==2?Co:(e.state.gzhead=t,Xr),"deflateSetHeader"),B7=o((e,t,r,n,a,s)=>{if(!e)return Co;let i=1;if(t===k1e&&(t=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),a<1||a>$1e||r!==D0||n<8||n>15||t<0||t>9||s<0||s>L1e||n===8&&i!==1)return gf(e,Co);n===8&&(n=9);let u=new eEe;return e.state=u,u.strm=e,u.status=Uc,u.wrap=i,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=a+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+yt-1)/yt),u.window=new Uint8Array(u.w_size*2),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<a+6,u.pending_buf_size=u.lit_bufsize*4,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=t,u.strategy=s,u.method=r,k7(e)},"deflateInit2"),rEe=o((e,t)=>B7(e,t,D0,U1e,M1e,N1e),"deflateInit"),nEe=o((e,t)=>{if(_p(e)||t>L9||t<0)return e?gf(e,Co):Co;let r=e.state;if(!e.output||e.avail_in!==0&&!e.input||r.status===sp&&t!==ki)return gf(e,e.avail_out===0?FT:Co);let n=r.last_flush;if(r.last_flush=t,r.pending!==0){if(si(e),e.avail_out===0)return r.last_flush=-1,Xr}else if(e.avail_in===0&&D9(t)<=D9(n)&&t!==ki)return gf(e,FT);if(r.status===sp&&e.avail_in!==0)return gf(e,FT);if(r.status===Uc&&r.wrap===0&&(r.status=mf),r.status===Uc){let a=D0+(r.w_bits-8<<4)<<8,s=-1;if(r.strategy>=O0||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,a|=s<<6,r.strstart!==0&&(a|=G1e),a+=31-a%31,ap(r,a),r.strstart!==0&&(ap(r,e.adler>>>16),ap(r,e.adler&65535)),e.adler=1,r.status=mf,si(e),r.pending!==0)return r.last_flush=-1,Xr}if(r.status===ex){if(e.adler=0,St(r,31),St(r,139),St(r,8),r.gzhead)St(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),St(r,r.gzhead.time&255),St(r,r.gzhead.time>>8&255),St(r,r.gzhead.time>>16&255),St(r,r.gzhead.time>>24&255),St(r,r.level===9?2:r.strategy>=O0||r.level<2?4:0),St(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(St(r,r.gzhead.extra.length&255),St(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=qr(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=zT;else if(St(r,0),St(r,0),St(r,0),St(r,0),St(r,0),St(r,r.level===9?2:r.strategy>=O0||r.level<2?4:0),St(r,K1e),r.status=mf,si(e),r.pending!==0)return r.last_flush=-1,Xr}if(r.status===zT){if(r.gzhead.extra){let a=r.pending,s=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+s>r.pending_buf_size;){let u=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+u),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex+=u,si(e),r.pending!==0)return r.last_flush=-1,Xr;a=0,s-=u}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending+=s,r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=VT}if(r.status===VT){if(r.gzhead.name){let a=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),si(e),r.pending!==0)return r.last_flush=-1,Xr;a=0}r.gzindex<r.gzhead.name.length?s=r.gzhead.name.charCodeAt(r.gzindex++)&255:s=0,St(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=GT}if(r.status===GT){if(r.gzhead.comment){let a=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a)),si(e),r.pending!==0)return r.last_flush=-1,Xr;a=0}r.gzindex<r.gzhead.comment.length?s=r.gzhead.comment.charCodeAt(r.gzindex++)&255:s=0,St(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>a&&(e.adler=qr(e.adler,r.pending_buf,r.pending-a,a))}r.status=KT}if(r.status===KT){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(si(e),r.pending!==0))return r.last_flush=-1,Xr;St(r,e.adler&255),St(r,e.adler>>8&255),e.adler=0}if(r.status=mf,si(e),r.pending!==0)return r.last_flush=-1,Xr}if(e.avail_in!==0||r.lookahead!==0||t!==Vs&&r.status!==sp){let a=r.level===0?P7(r,t):r.strategy===O0?J1e(r,t):r.strategy===C1e?X1e(r,t):lp[r.level].func(r,t);if((a===vf||a===Hc)&&(r.status=sp),a===Sn||a===vf)return e.avail_out===0&&(r.last_flush=-1),Xr;if(a===qc&&(t===I1e?O1e(r):t!==L9&&(qT(r,0,0,!1),t===P1e&&(qs(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),si(e),e.avail_out===0))return r.last_flush=-1,Xr}return t!==ki?Xr:r.wrap<=0?N9:(r.wrap===2?(St(r,e.adler&255),St(r,e.adler>>8&255),St(r,e.adler>>16&255),St(r,e.adler>>24&255),St(r,e.total_in&255),St(r,e.total_in>>8&255),St(r,e.total_in>>16&255),St(r,e.total_in>>24&255)):(ap(r,e.adler>>>16),ap(r,e.adler&65535)),si(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Xr:N9)},"deflate$2"),iEe=o(e=>{if(_p(e))return Co;let t=e.state.status;return e.state=null,t===mf?gf(e,F1e):Xr},"deflateEnd"),oEe=o((e,t)=>{let r=t.length;if(_p(e))return Co;let n=e.state,a=n.wrap;if(a===2||a===1&&n.status!==Uc||n.lookahead)return Co;if(a===1&&(e.adler=mp(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){a===0&&(qs(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(t.subarray(r-n.w_size,r),0),t=h,r=n.w_size}let s=e.avail_in,i=e.next_in,u=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Mc(n);n.lookahead>=yt;){let h=n.strstart,c=n.lookahead-(yt-1);do n.ins_h=Gs(n,n.ins_h,n.window[h+yt-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--c);n.strstart=h,n.lookahead=yt-1,Mc(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=yt-1,n.match_available=0,e.next_in=i,e.input=u,e.avail_in=s,n.wrap=a,Xr},"deflateSetDictionary"),aEe=rEe,sEe=B7,lEe=k7,fEe=F7,uEe=tEe,cEe=nEe,hEe=iEe,dEe=oEe,pEe="pako deflate (from Nodeca project)",up={deflateInit:aEe,deflateInit2:sEe,deflateReset:lEe,deflateResetKeep:fEe,deflateSetHeader:uEe,deflate:cEe,deflateEnd:hEe,deflateSetDictionary:dEe,deflateInfo:pEe},yEe=o((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"_has"),mEe=o(function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)yEe(r,n)&&(e[n]=r[n])}}return e},"assign"),gEe=o(e=>{let t=0;for(let n=0,a=e.length;n<a;n++)t+=e[n].length;let r=new Uint8Array(t);for(let n=0,a=0,s=e.length;n<s;n++){let i=e[n];r.set(i,a),a+=i.length}return r},"flattenChunks"),$0={assign:mEe,flattenChunks:gEe},C7=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{C7=!1}var gp=new Uint8Array(256);for(let e=0;e<256;e++)gp[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;gp[254]=gp[254]=1;var wEe=o(e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,a,s,i=e.length,u=0;for(a=0;a<i;a++)r=e.charCodeAt(a),(r&64512)===55296&&a+1<i&&(n=e.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(u),s=0,a=0;s<u;a++)r=e.charCodeAt(a),(r&64512)===55296&&a+1<i&&(n=e.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|r&63):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|r&63):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|r&63);return t},"string2buf"),vEe=o((e,t)=>{if(t<65534&&e.subarray&&C7)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r},"buf2binstring"),bEe=o((e,t)=>{let r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,a,s=new Array(r*2);for(a=0,n=0;n<r;){let i=e[n++];if(i<128){s[a++]=i;continue}let u=gp[i];if(u>4){s[a++]=65533,n+=u-1;continue}for(i&=u===2?31:u===3?15:7;u>1&&n<r;)i=i<<6|e[n++]&63,u--;if(u>1){s[a++]=65533;continue}i<65536?s[a++]=i:(i-=65536,s[a++]=55296|i>>10&1023,s[a++]=56320|i&1023)}return vEe(s,a)},"buf2string"),_Ee=o((e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+gp[e[r]]>t?r:t},"utf8border"),wp={string2buf:wEe,buf2string:bEe,utf8border:_Ee};function EEe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}o(EEe,"ZStream");var L7=EEe,N7=Object.prototype.toString,{Z_NO_FLUSH:SEe,Z_SYNC_FLUSH:AEe,Z_FULL_FLUSH:REe,Z_FINISH:TEe,Z_OK:L0,Z_STREAM_END:xEe,Z_DEFAULT_COMPRESSION:OEe,Z_DEFAULT_STRATEGY:IEe,Z_DEFLATED:PEe}=Wc;function Ep(e){this.options=$0.assign({level:OEe,method:PEe,chunkSize:16384,windowBits:15,memLevel:8,strategy:IEe},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new L7,this.strm.avail_out=0;let r=up.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==L0)throw new Error(wf[r]);if(t.header&&up.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=wp.string2buf(t.dictionary):N7.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=up.deflateSetDictionary(this.strm,n),r!==L0)throw new Error(wf[r]);this._dict_set=!0}}o(Ep,"Deflate$1");Ep.prototype.push=function(e,t){let r=this.strm,n=this.options.chunkSize,a,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?TEe:SEe,typeof e=="string"?r.input=wp.string2buf(e):N7.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===AEe||s===REe)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(a=up.deflate(r,s),a===xEe)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=up.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===L0;if(r.avail_out===0){this.onData(r.output);continue}if(s>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Ep.prototype.onData=function(e){this.chunks.push(e)};Ep.prototype.onEnd=function(e){e===L0&&(this.result=$0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function tx(e,t){let r=new Ep(t);if(r.push(e,!0),r.err)throw r.msg||wf[r.err];return r.result}o(tx,"deflate$1");function FEe(e,t){return t=t||{},t.raw=!0,tx(e,t)}o(FEe,"deflateRaw$1");function kEe(e,t){return t=t||{},t.gzip=!0,tx(e,t)}o(kEe,"gzip$1");var BEe=Ep,CEe=tx,LEe=FEe,NEe=kEe,DEe=Wc,$Ee={Deflate:BEe,deflate:CEe,deflateRaw:LEe,gzip:NEe,constants:DEe},I0=16209,UEe=16191,MEe=o(function(t,r){let n,a,s,i,u,h,c,d,y,m,g,v,_,b,E,S,T,x,A,B,P,N,L,C,z=t.state;n=t.next_in,L=t.input,a=n+(t.avail_in-5),s=t.next_out,C=t.output,i=s-(r-t.avail_out),u=s+(t.avail_out-257),h=z.dmax,c=z.wsize,d=z.whave,y=z.wnext,m=z.window,g=z.hold,v=z.bits,_=z.lencode,b=z.distcode,E=(1<<z.lenbits)-1,S=(1<<z.distbits)-1;e:do{v<15&&(g+=L[n++]<<v,v+=8,g+=L[n++]<<v,v+=8),T=_[g&E];t:for(;;){if(x=T>>>24,g>>>=x,v-=x,x=T>>>16&255,x===0)C[s++]=T&65535;else if(x&16){A=T&65535,x&=15,x&&(v<x&&(g+=L[n++]<<v,v+=8),A+=g&(1<<x)-1,g>>>=x,v-=x),v<15&&(g+=L[n++]<<v,v+=8,g+=L[n++]<<v,v+=8),T=b[g&S];r:for(;;){if(x=T>>>24,g>>>=x,v-=x,x=T>>>16&255,x&16){if(B=T&65535,x&=15,v<x&&(g+=L[n++]<<v,v+=8,v<x&&(g+=L[n++]<<v,v+=8)),B+=g&(1<<x)-1,B>h){t.msg="invalid distance too far back",z.mode=I0;break e}if(g>>>=x,v-=x,x=s-i,B>x){if(x=B-x,x>d&&z.sane){t.msg="invalid distance too far back",z.mode=I0;break e}if(P=0,N=m,y===0){if(P+=c-x,x<A){A-=x;do C[s++]=m[P++];while(--x);P=s-B,N=C}}else if(y<x){if(P+=c+y-x,x-=y,x<A){A-=x;do C[s++]=m[P++];while(--x);if(P=0,y<A){x=y,A-=x;do C[s++]=m[P++];while(--x);P=s-B,N=C}}}else if(P+=y-x,x<A){A-=x;do C[s++]=m[P++];while(--x);P=s-B,N=C}for(;A>2;)C[s++]=N[P++],C[s++]=N[P++],C[s++]=N[P++],A-=3;A&&(C[s++]=N[P++],A>1&&(C[s++]=N[P++]))}else{P=s-B;do C[s++]=C[P++],C[s++]=C[P++],C[s++]=C[P++],A-=3;while(A>2);A&&(C[s++]=C[P++],A>1&&(C[s++]=C[P++]))}}else if(x&64){t.msg="invalid distance code",z.mode=I0;break e}else{T=b[(T&65535)+(g&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){z.mode=UEe;break e}else{t.msg="invalid literal/length code",z.mode=I0;break e}else{T=_[(T&65535)+(g&(1<<x)-1)];continue t}break}}while(n<a&&s<u);A=v>>3,n-=A,v-=A<<3,g&=(1<<v)-1,t.next_in=n,t.next_out=s,t.avail_in=n<a?5+(a-n):5-(n-a),t.avail_out=s<u?257+(u-s):257-(s-u),z.hold=g,z.bits=v},"inflate_fast"),Dc=15,$9=852,U9=592,M9=0,BT=1,j9=2,jEe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),WEe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),qEe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),HEe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),zEe=o((e,t,r,n,a,s,i,u)=>{let h=u.bits,c=0,d=0,y=0,m=0,g=0,v=0,_=0,b=0,E=0,S=0,T,x,A,B,P,N=null,L,C=new Uint16Array(Dc+1),z=new Uint16Array(Dc+1),V=null,Q,X,ue;for(c=0;c<=Dc;c++)C[c]=0;for(d=0;d<n;d++)C[t[r+d]]++;for(g=h,m=Dc;m>=1&&C[m]===0;m--);if(g>m&&(g=m),m===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,u.bits=1,0;for(y=1;y<m&&C[y]===0;y++);for(g<y&&(g=y),b=1,c=1;c<=Dc;c++)if(b<<=1,b-=C[c],b<0)return-1;if(b>0&&(e===M9||m!==1))return-1;for(z[1]=0,c=1;c<Dc;c++)z[c+1]=z[c]+C[c];for(d=0;d<n;d++)t[r+d]!==0&&(i[z[t[r+d]]++]=d);if(e===M9?(N=V=i,L=20):e===BT?(N=jEe,V=WEe,L=257):(N=qEe,V=HEe,L=0),S=0,d=0,c=y,P=s,v=g,_=0,A=-1,E=1<<g,B=E-1,e===BT&&E>$9||e===j9&&E>U9)return 1;for(;;){Q=c-_,i[d]+1<L?(X=0,ue=i[d]):i[d]>=L?(X=V[i[d]-L],ue=N[i[d]-L]):(X=96,ue=0),T=1<<c-_,x=1<<v,y=x;do x-=T,a[P+(S>>_)+x]=Q<<24|X<<16|ue|0;while(x!==0);for(T=1<<c-1;S&T;)T>>=1;if(T!==0?(S&=T-1,S+=T):S=0,d++,--C[c]===0){if(c===m)break;c=t[r+i[d]]}if(c>g&&(S&B)!==A){for(_===0&&(_=g),P+=y,v=c-_,b=1<<v;v+_<m&&(b-=C[v+_],!(b<=0));)v++,b<<=1;if(E+=1<<v,e===BT&&E>$9||e===j9&&E>U9)return 1;A=S&B,a[A]=g<<24|v<<16|P-s|0}}return S!==0&&(a[P+S]=c-_<<24|64<<16|0),u.bits=g,0},"inflate_table"),cp=zEe,VEe=0,D7=1,$7=2,{Z_FINISH:W9,Z_BLOCK:GEe,Z_TREES:P0,Z_OK:bf,Z_STREAM_END:KEe,Z_NEED_DICT:YEe,Z_STREAM_ERROR:Bi,Z_DATA_ERROR:U7,Z_MEM_ERROR:M7,Z_BUF_ERROR:ZEe,Z_DEFLATED:q9}=Wc,U0=16180,H9=16181,z9=16182,V9=16183,G9=16184,K9=16185,Y9=16186,Z9=16187,X9=16188,J9=16189,N0=16190,Ba=16191,CT=16192,Q9=16193,LT=16194,e7=16195,t7=16196,r7=16197,n7=16198,F0=16199,k0=16200,i7=16201,o7=16202,a7=16203,s7=16204,l7=16205,NT=16206,f7=16207,u7=16208,Xt=16209,j7=16210,W7=16211,XEe=852,JEe=592,QEe=15,eSe=QEe,c7=o(e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),"zswap32");function tSe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}o(tSe,"InflateState");var _f=o(e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<U0||t.mode>W7?1:0},"inflateStateCheck"),q7=o(e=>{if(_f(e))return Bi;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=U0,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(XEe),t.distcode=t.distdyn=new Int32Array(JEe),t.sane=1,t.back=-1,bf},"inflateResetKeep"),H7=o(e=>{if(_f(e))return Bi;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,q7(e)},"inflateReset"),z7=o((e,t)=>{let r;if(_f(e))return Bi;let n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Bi:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,H7(e))},"inflateReset2"),V7=o((e,t)=>{if(!e)return Bi;let r=new tSe;e.state=r,r.strm=e,r.window=null,r.mode=U0;let n=z7(e,t);return n!==bf&&(e.state=null),n},"inflateInit2"),rSe=o(e=>V7(e,eSe),"inflateInit"),h7=!0,DT,$T,nSe=o(e=>{if(h7){DT=new Int32Array(512),$T=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(cp(D7,e.lens,0,288,DT,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;cp($7,e.lens,0,32,$T,0,e.work,{bits:5}),h7=!1}e.lencode=DT,e.lenbits=9,e.distcode=$T,e.distbits=5},"fixedtables"),G7=o((e,t,r,n)=>{let a,s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(t.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(a=s.wsize-s.wnext,a>n&&(a=n),s.window.set(t.subarray(r-n,r-n+a),s.wnext),n-=a,n?(s.window.set(t.subarray(r-n,r),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0},"updatewindow"),iSe=o((e,t)=>{let r,n,a,s,i,u,h,c,d,y,m,g,v,_,b=0,E,S,T,x,A,B,P,N,L=new Uint8Array(4),C,z,V=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_f(e)||!e.output||!e.input&&e.avail_in!==0)return Bi;r=e.state,r.mode===Ba&&(r.mode=CT),i=e.next_out,a=e.output,h=e.avail_out,s=e.next_in,n=e.input,u=e.avail_in,c=r.hold,d=r.bits,y=u,m=h,N=bf;e:for(;;)switch(r.mode){case U0:if(r.wrap===0){r.mode=CT;break}for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,L[0]=c&255,L[1]=c>>>8&255,r.check=qr(r.check,L,2,0),c=0,d=0,r.mode=H9;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=Xt;break}if((c&15)!==q9){e.msg="unknown compression method",r.mode=Xt;break}if(c>>>=4,d-=4,P=(c&15)+8,r.wbits===0&&(r.wbits=P),P>15||P>r.wbits){e.msg="invalid window size",r.mode=Xt;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=c&512?J9:Ba,c=0,d=0;break;case H9:for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.flags=c,(r.flags&255)!==q9){e.msg="unknown compression method",r.mode=Xt;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Xt;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=qr(r.check,L,2,0)),c=0,d=0,r.mode=z9;case z9:for(;d<32;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,L[2]=c>>>16&255,L[3]=c>>>24&255,r.check=qr(r.check,L,4,0)),c=0,d=0,r.mode=V9;case V9:for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=qr(r.check,L,2,0)),c=0,d=0,r.mode=G9;case G9:if(r.flags&1024){for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(L[0]=c&255,L[1]=c>>>8&255,r.check=qr(r.check,L,2,0)),c=0,d=0}else r.head&&(r.head.extra=null);r.mode=K9;case K9:if(r.flags&1024&&(g=r.length,g>u&&(g=u),g&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(s,s+g),P)),r.flags&512&&r.wrap&4&&(r.check=qr(r.check,n,g,s)),u-=g,s+=g,r.length-=g),r.length))break e;r.length=0,r.mode=Y9;case Y9:if(r.flags&2048){if(u===0)break e;g=0;do P=n[s+g++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P));while(P&&g<u);if(r.flags&512&&r.wrap&4&&(r.check=qr(r.check,n,g,s)),u-=g,s+=g,P)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Z9;case Z9:if(r.flags&4096){if(u===0)break e;g=0;do P=n[s+g++],r.head&&P&&r.length<65536&&(r.head.comment+=String.fromCharCode(P));while(P&&g<u);if(r.flags&512&&r.wrap&4&&(r.check=qr(r.check,n,g,s)),u-=g,s+=g,P)break e}else r.head&&(r.head.comment=null);r.mode=X9;case X9:if(r.flags&512){for(;d<16;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.wrap&4&&c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Xt;break}c=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Ba;break;case J9:for(;d<32;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}e.adler=r.check=c7(c),c=0,d=0,r.mode=N0;case N0:if(r.havedict===0)return e.next_out=i,e.avail_out=h,e.next_in=s,e.avail_in=u,r.hold=c,r.bits=d,YEe;e.adler=r.check=1,r.mode=Ba;case Ba:if(t===GEe||t===P0)break e;case CT:if(r.last){c>>>=d&7,d-=d&7,r.mode=NT;break}for(;d<3;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}switch(r.last=c&1,c>>>=1,d-=1,c&3){case 0:r.mode=Q9;break;case 1:if(nSe(r),r.mode=F0,t===P0){c>>>=2,d-=2;break e}break;case 2:r.mode=t7;break;case 3:e.msg="invalid block type",r.mode=Xt}c>>>=2,d-=2;break;case Q9:for(c>>>=d&7,d-=d&7;d<32;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Xt;break}if(r.length=c&65535,c=0,d=0,r.mode=LT,t===P0)break e;case LT:r.mode=e7;case e7:if(g=r.length,g){if(g>u&&(g=u),g>h&&(g=h),g===0)break e;a.set(n.subarray(s,s+g),i),u-=g,s+=g,h-=g,i+=g,r.length-=g;break}r.mode=Ba;break;case t7:for(;d<14;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.nlen=(c&31)+257,c>>>=5,d-=5,r.ndist=(c&31)+1,c>>>=5,d-=5,r.ncode=(c&15)+4,c>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Xt;break}r.have=0,r.mode=r7;case r7:for(;r.have<r.ncode;){for(;d<3;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.lens[V[r.have++]]=c&7,c>>>=3,d-=3}for(;r.have<19;)r.lens[V[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},N=cp(VEe,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,N){e.msg="invalid code lengths set",r.mode=Xt;break}r.have=0,r.mode=n7;case n7:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],E=b>>>24,S=b>>>16&255,T=b&65535,!(E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(T<16)c>>>=E,d-=E,r.lens[r.have++]=T;else{if(T===16){for(z=E+2;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(c>>>=E,d-=E,r.have===0){e.msg="invalid bit length repeat",r.mode=Xt;break}P=r.lens[r.have-1],g=3+(c&3),c>>>=2,d-=2}else if(T===17){for(z=E+3;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}c>>>=E,d-=E,P=0,g=3+(c&7),c>>>=3,d-=3}else{for(z=E+7;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}c>>>=E,d-=E,P=0,g=11+(c&127),c>>>=7,d-=7}if(r.have+g>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Xt;break}for(;g--;)r.lens[r.have++]=P}}if(r.mode===Xt)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Xt;break}if(r.lenbits=9,C={bits:r.lenbits},N=cp(D7,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,N){e.msg="invalid literal/lengths set",r.mode=Xt;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},N=cp($7,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,N){e.msg="invalid distances set",r.mode=Xt;break}if(r.mode=F0,t===P0)break e;case F0:r.mode=k0;case k0:if(u>=6&&h>=258){e.next_out=i,e.avail_out=h,e.next_in=s,e.avail_in=u,r.hold=c,r.bits=d,MEe(e,m),i=e.next_out,a=e.output,h=e.avail_out,s=e.next_in,n=e.input,u=e.avail_in,c=r.hold,d=r.bits,r.mode===Ba&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],E=b>>>24,S=b>>>16&255,T=b&65535,!(E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(S&&!(S&240)){for(x=E,A=S,B=T;b=r.lencode[B+((c&(1<<x+A)-1)>>x)],E=b>>>24,S=b>>>16&255,T=b&65535,!(x+E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}c>>>=x,d-=x,r.back+=x}if(c>>>=E,d-=E,r.back+=E,r.length=T,S===0){r.mode=l7;break}if(S&32){r.back=-1,r.mode=Ba;break}if(S&64){e.msg="invalid literal/length code",r.mode=Xt;break}r.extra=S&15,r.mode=i7;case i7:if(r.extra){for(z=r.extra;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=o7;case o7:for(;b=r.distcode[c&(1<<r.distbits)-1],E=b>>>24,S=b>>>16&255,T=b&65535,!(E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(!(S&240)){for(x=E,A=S,B=T;b=r.distcode[B+((c&(1<<x+A)-1)>>x)],E=b>>>24,S=b>>>16&255,T=b&65535,!(x+E<=d);){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}c>>>=x,d-=x,r.back+=x}if(c>>>=E,d-=E,r.back+=E,S&64){e.msg="invalid distance code",r.mode=Xt;break}r.offset=T,r.extra=S&15,r.mode=a7;case a7:if(r.extra){for(z=r.extra;d<z;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Xt;break}r.mode=s7;case s7:if(h===0)break e;if(g=m-h,r.offset>g){if(g=r.offset-g,g>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Xt;break}g>r.wnext?(g-=r.wnext,v=r.wsize-g):v=r.wnext-g,g>r.length&&(g=r.length),_=r.window}else _=a,v=i-r.offset,g=r.length;g>h&&(g=h),h-=g,r.length-=g;do a[i++]=_[v++];while(--g);r.length===0&&(r.mode=k0);break;case l7:if(h===0)break e;a[i++]=r.length,h--,r.mode=k0;break;case NT:if(r.wrap){for(;d<32;){if(u===0)break e;u--,c|=n[s++]<<d,d+=8}if(m-=h,e.total_out+=m,r.total+=m,r.wrap&4&&m&&(e.adler=r.check=r.flags?qr(r.check,a,m,i-m):mp(r.check,a,m,i-m)),m=h,r.wrap&4&&(r.flags?c:c7(c))!==r.check){e.msg="incorrect data check",r.mode=Xt;break}c=0,d=0}r.mode=f7;case f7:if(r.wrap&&r.flags){for(;d<32;){if(u===0)break e;u--,c+=n[s++]<<d,d+=8}if(r.wrap&4&&c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Xt;break}c=0,d=0}r.mode=u7;case u7:N=KEe;break e;case Xt:N=U7;break e;case j7:return M7;case W7:default:return Bi}return e.next_out=i,e.avail_out=h,e.next_in=s,e.avail_in=u,r.hold=c,r.bits=d,(r.wsize||m!==e.avail_out&&r.mode<Xt&&(r.mode<NT||t!==W9))&&G7(e,e.output,e.next_out,m-e.avail_out),y-=e.avail_in,m-=e.avail_out,e.total_in+=y,e.total_out+=m,r.total+=m,r.wrap&4&&m&&(e.adler=r.check=r.flags?qr(r.check,a,m,e.next_out-m):mp(r.check,a,m,e.next_out-m)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Ba?128:0)+(r.mode===F0||r.mode===LT?256:0),(y===0&&m===0||t===W9)&&N===bf&&(N=ZEe),N},"inflate$2"),oSe=o(e=>{if(_f(e))return Bi;let t=e.state;return t.window&&(t.window=null),e.state=null,bf},"inflateEnd"),aSe=o((e,t)=>{if(_f(e))return Bi;let r=e.state;return r.wrap&2?(r.head=t,t.done=!1,bf):Bi},"inflateGetHeader"),sSe=o((e,t)=>{let r=t.length,n,a,s;return _f(e)||(n=e.state,n.wrap!==0&&n.mode!==N0)?Bi:n.mode===N0&&(a=1,a=mp(a,t,r,0),a!==n.check)?U7:(s=G7(e,t,r,r),s?(n.mode=j7,M7):(n.havedict=1,bf))},"inflateSetDictionary"),lSe=H7,fSe=z7,uSe=q7,cSe=rSe,hSe=V7,dSe=iSe,pSe=oSe,ySe=aSe,mSe=sSe,gSe="pako inflate (from Nodeca project)",La={inflateReset:lSe,inflateReset2:fSe,inflateResetKeep:uSe,inflateInit:cSe,inflateInit2:hSe,inflate:dSe,inflateEnd:pSe,inflateGetHeader:ySe,inflateSetDictionary:mSe,inflateInfo:gSe};function wSe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}o(wSe,"GZheader");var vSe=wSe,K7=Object.prototype.toString,{Z_NO_FLUSH:bSe,Z_FINISH:_Se,Z_OK:vp,Z_STREAM_END:UT,Z_NEED_DICT:MT,Z_STREAM_ERROR:ESe,Z_DATA_ERROR:d7,Z_MEM_ERROR:SSe}=Wc;function Sp(e){this.options=$0.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new L7,this.strm.avail_out=0;let r=La.inflateInit2(this.strm,t.windowBits);if(r!==vp)throw new Error(wf[r]);if(this.header=new vSe,La.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wp.string2buf(t.dictionary):K7.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=La.inflateSetDictionary(this.strm,t.dictionary),r!==vp)))throw new Error(wf[r])}o(Sp,"Inflate$1");Sp.prototype.push=function(e,t){let r=this.strm,n=this.options.chunkSize,a=this.options.dictionary,s,i,u;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?_Se:bSe,K7.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),s=La.inflate(r,i),s===MT&&a&&(s=La.inflateSetDictionary(r,a),s===vp?s=La.inflate(r,i):s===d7&&(s=MT));r.avail_in>0&&s===UT&&r.state.wrap>0&&e[r.next_in]!==0;)La.inflateReset(r),s=La.inflate(r,i);switch(s){case ESe:case d7:case MT:case SSe:return this.onEnd(s),this.ended=!0,!1}if(u=r.avail_out,r.next_out&&(r.avail_out===0||s===UT))if(this.options.to==="string"){let h=wp.utf8border(r.output,r.next_out),c=r.next_out-h,d=wp.buf2string(r.output,h);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(h,h+c),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(s===vp&&u===0)){if(s===UT)return s=La.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Sp.prototype.onData=function(e){this.chunks.push(e)};Sp.prototype.onEnd=function(e){e===vp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=$0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function rx(e,t){let r=new Sp(t);if(r.push(e),r.err)throw r.msg||wf[r.err];return r.result}o(rx,"inflate$1");function ASe(e,t){return t=t||{},t.raw=!0,rx(e,t)}o(ASe,"inflateRaw$1");var RSe=Sp,TSe=rx,xSe=ASe,OSe=rx,ISe=Wc,PSe={Inflate:RSe,inflate:TSe,inflateRaw:xSe,ungzip:OSe,constants:ISe},{Deflate:WDe,deflate:FSe,deflateRaw:qDe,gzip:HDe}=$Ee,{Inflate:zDe,inflate:kSe,inflateRaw:VDe,ungzip:GDe}=PSe;var Y7=FSe;var Z7=kSe;var Js=Lt(Lh(),1);var X7=o((e,t)=>{let r={type:"local",id:"local",name:"Local User",email:"local@legitcontrol.com"};return{getUser:o(async()=>r,"getUser"),signInAnonymously:o(async()=>{r.type="anonymous",r.id=crypto.randomUUID(),r.email=`anonymous-sha1-${r.id}-@legitcontrol.com`},"signInAnonymously"),addAccessToken:o(async n=>{let a=await e.getUserTokens(r.id);a.accessTokens.push(n),await e.setUserTokens(r.id,a)},"addAccessToken"),getMaxAccessTokenForBranch:o(async n=>{let a=await e.getUserTokens(r.id);if(!(a.accessTokens===void 0||a.accessTokens.length===0))return a.accessTokens[0]},"getMaxAccessTokenForBranch")}},"createSessionManager");var nx=Lt(Or(),1);function J7(e){let t=JSON.stringify(e),r=new TextEncoder().encode(t),n="";return typeof btoa=="function"?n=btoa(String.fromCharCode(...r)):n=Buffer.from(r).toString("base64"),n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}o(J7,"encodeConfigJson");function Q7(e){let t=e.replace(/-/g,"+").replace(/_/g,"/")+"===".slice((e.length+3)%4),r;typeof atob=="function"?r=atob(t):r=Buffer.from(t,"base64").toString("binary");let n=Uint8Array.from(r,s=>s.charCodeAt(0)),a=new TextDecoder().decode(n);return JSON.parse(a)}o(Q7,"decodeConfigJson");var ez="user.legit-tokens";function tz({storageFs:e,gitRoot:t}){return{getUserTokens:o(async r=>{let n=await nx.default.getConfig({fs:e,dir:t,path:ez});return n?Q7(n):{accessTokens:[]}},"getUserTokens"),setUserTokens:o(async(r,n)=>await nx.default.setConfig({fs:e,dir:t,path:ez,value:J7(n)}),"setUserTokens")}}o(tz,"createGitConfigTokenStore");var Rt=Lt(Or(),1);var M0=class M0 extends Error{constructor(r,n){super(r);Ye(this,"code","ENOENT");Ye(this,"path");this.name="ENOENTError",this.path=n,Object.setPrototypeOf(this,M0.prototype)}};o(M0,"ENOENTError");var Ef=M0;function j0(e){return e&&e.gitCache!==void 0?e.gitCache:e&&e.parentFs?j0(e.parentFs):{}}o(j0,"getGitCacheFromFs");function rz({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branch-file",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchFileVirtualFile",rootType:"folder",getStats:o(async a=>{let{filePath:s,pathParams:i,userSpaceFs:u}=a;i.branchName===void 0&&(i.branchName=await Et(t,e));let h=await it(e,t,i.branchName);if(!h)throw new Ef(`ENOENT: no such file or directory, stat '${s}'`,s);let c=await Nl({filePath:s,gitRoot:t,nodeFs:e,commitSha:h,pathParams:i,gitCache:j0(u)});if(!c)throw new Ef(`ENOENT: no such file or directory, stat '${s}'`,s);let d=await Rt.default.readCommit({fs:e,dir:t,oid:h}),{commit:y}=d,m=await Rt.default.log({fs:e,dir:t,ref:h,filepath:i.filePath,depth:1}),g=y.committer.timestamp*1e3,v=m.length>0?m[0].commit.committer.timestamp*1e3:g;if(c.type==="tree")return{mode:420,size:0,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!0,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:v,mtimeMs:v,ctimeMs:v,birthtimeMs:g,atime:new Date(v),mtime:new Date(v),ctime:new Date(v),birthtime:new Date(v)};{let{blob:_}=await Rt.default.readBlob({fs:e,dir:t,oid:c.oid});return{mode:420,size:_.length,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(_.length/4096),atimeMs:v,mtimeMs:v,ctimeMs:v,birthtimeMs:v,atime:new Date(v),mtime:new Date(v),ctime:new Date(v),birthtime:new Date(v)}}},"getStats"),getFile:o(async a=>{let{filePath:s,cacheFs:i,pathParams:u,userSpaceFs:h}=a;u.branchName===void 0&&(u.branchName=await Et(t,e));try{let c=await it(e,t,u.branchName);if(!c){let y=await Rt.default.resolveRef({fs:e,dir:t,ref:"HEAD"});if(await Rt.default.branch({fs:e,dir:t,ref:u.branchName,object:y}),c=await it(e,t,u.branchName),!c)throw new Error("Could not create branch for getFile")}let d=await Nl({filePath:s,gitRoot:t,nodeFs:e,commitSha:c,pathParams:u,gitCache:j0(h)});if(!d)return;if(d.type==="blob"){let{blob:y}=await Rt.default.readBlob({fs:e,dir:t,oid:d.oid});return{type:"file",content:Buffer.from(y),mode:420,size:y.length,oid:d.oid}}else{let y=[];try{let g=await i.promises.stat(s);if(g&&g.isDirectory()){let v=await i.promises.readdir(s,{withFileTypes:!0});y.push(...v)}}catch{}return{type:"directory",content:Array.from(new Set([...y,...d.entries])).map(g=>({...g,name:g.name.toString(),path:`${s}`,parentPath:`${s}`})),mode:493}}}catch{return}},"getFile"),unlink:o(async a=>{let{pathParams:s,author:i}=a;if(s.branchName===void 0&&(s.branchName=await Et(t,e)),!s.filePath)throw new Error("filePath should be in pathParams");let u=await it(e,t,s.branchName);if(!u)throw new Error("Invalid branch file path - branch must exist");let h=await Rt.default.readTree({fs:e,dir:t,oid:u}),c=await ca({dir:t,fs:e,treeOid:h.oid,deletePathParts:s.filePath.split("/"),addPathParts:void 0,addObj:void 0,deleteKeepIfNotEmpty:!1,addKeepIfEmpty:!0,keepFilename:".keep"});if(c!==h.oid){let d=await Rt.default.commit({fs:e,dir:t,message:`Delete ${s.filePath}`,tree:c,noUpdateBranch:!0,parent:[u],author:i});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(s.branchName)}`,value:d,force:!0})}},"unlink"),writeFile:o(async a=>{let{filePath:s,content:i,cacheFs:u,pathParams:h,author:c}=a;if(h.branchName===void 0&&(h.branchName=await Et(t,e)),h.filePath===void 0)throw new Error("filePath should be in pathParams");let d;typeof i=="string"?d=new TextEncoder().encode(i):d=new Uint8Array(i);let y=await Rt.default.writeBlob({fs:e,dir:t,blob:d}),m=await it(e,t,h.branchName);if(!m){let _=await Rt.default.resolveRef({fs:e,dir:t,ref:"HEAD"});if(await Rt.default.branch({fs:e,dir:t,ref:Ht(h.branchName),object:_}),m=await it(e,t,h.branchName),!m)throw new Error("Could not create branch for writeFile")}let g=await Rt.default.readTree({fs:e,dir:t,oid:m}),v=await ca({dir:t,fs:e,treeOid:g.oid,deletePathParts:void 0,addPathParts:h.filePath.split("/"),addObj:{type:"blob",oid:y},deleteKeepIfNotEmpty:!0,addKeepIfEmpty:!1,keepFilename:".keep"});if(v!==g.oid){let _=await Rt.default.commit({fs:e,dir:t,message:`\u{1F4BE} Change '${h.filePath}'`,tree:v,noUpdateBranch:!0,parent:[m],author:c});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(h.branchName)}`,value:_,force:!0});let b=await it(e,t,h.branchName);if(_!==b)throw new Error("Failed to update branch after file deletion")}},"writeFile"),rename:o(async function(a){let{filePath:s,newPath:i,pathParams:u,newPathParams:h,author:c,userSpaceFs:d}=a;if(u.branchName===void 0&&(u.branchName=await Et(t,e)),u.filePath===void 0)throw new Error("filePath should be in pathParams");if(h.branchName===void 0&&(h.branchName=await Et(t,e)),h.filePath===void 0)throw new Error("filePath should be in newPathParams");let y=await it(e,t,u.branchName);if(!y)throw new Error("Invalid branch file path - source branch must exist");let m=await it(e,t,h.branchName);if(!m){let b=await Rt.default.resolveRef({fs:e,dir:t,ref:"HEAD"});if(await Rt.default.branch({fs:e,dir:t,ref:Ht(h.branchName),object:b}),m=await it(e,t,h.branchName),m===void 0)throw new Error("Could not create branch for rename operation")}if(h.branchName!==u.branchName)throw new Error("cross branch move not implemented yet");let g=await Nl({gitRoot:t,nodeFs:e,commitSha:y,filePath:s,pathParams:u,gitCache:j0(d)});if(g===void 0)throw new Error("no obj at path exists");let v=await ca({dir:t,fs:e,deletePathParts:u.filePath.split("/"),addPathParts:h.filePath.split("/"),addObj:g.type==="blob"?{type:"blob",oid:g.oid}:{type:"tree",oid:g.oid,entries:g.entries.map(b=>b.name.toString())},treeOid:m,addKeepIfEmpty:!0,deleteKeepIfNotEmpty:!0}),_=await Rt.default.readTree({fs:e,dir:t,oid:y});if(v!==_.oid){let b=await Rt.default.commit({fs:e,dir:t,message:`\u{1F500} Rename '${u.filePath}' to '${h.filePath}'`,tree:v,noUpdateBranch:!0,parent:[m],author:c});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(h.branchName)}`,value:b,force:!0})}},"rename"),mkdir:o(async function(a){a.pathParams.branchName===void 0&&(a.pathParams.branchName=await Et(t,e));let s=await it(e,t,a.pathParams.branchName);if(a.pathParams.filePath===""&&(a.pathParams.filePath="/",s!==void 0))throw new Error("Folder exists");try{throw await this.getStats(a),new Error("Folder exists")}catch{}if(a.filePath.endsWith("/")&&(a.filePath=a.filePath.replace(/\/+$/,"")),a.pathParams&&typeof a.pathParams.filePath=="string"&&(a.pathParams.filePath=a.pathParams.filePath.replace(/\/+$/,"")),!s){let d=await Rt.default.resolveRef({fs:e,dir:t,ref:"HEAD"});if(await Rt.default.branch({fs:e,dir:t,ref:Ht(a.pathParams.branchName),object:d}),s=await it(e,t,a.pathParams.branchName),s===void 0)throw new Error("Could not create branch for mkdir operation")}let i=await Rt.default.readTree({fs:e,dir:t,oid:s}),u=new Uint8Array(0),h=await Rt.default.writeBlob({fs:e,dir:t,blob:u}),c=await ca({dir:t,fs:e,treeOid:i.oid,deletePathParts:void 0,addPathParts:[...a.pathParams.filePath.split("/"),".keep"],addObj:{type:"blob",oid:h},deleteKeepIfNotEmpty:!0,addKeepIfEmpty:!0,keepFilename:".keep"});if(c!==i.oid){let d=await Rt.default.commit({fs:e,dir:t,message:`\u{1F4BE} Change '${a.pathParams.filePath}'`,tree:c,noUpdateBranch:!0,parent:[s],author:a.author});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(a.pathParams.branchName)}`,value:d,force:!0})}},"mkdir"),rmdir:o(async a=>{let{pathParams:s,author:i}=a;if(s.branchName===void 0&&(s.branchName=await Et(t,e)),!s.filePath)throw new Error("filePath should be in pathParams");let u=await it(e,t,s.branchName);if(!u)throw new Error("Invalid branch file path - branch must exist");let h=await Rt.default.readTree({fs:e,dir:t,oid:u}),c=await ca({dir:t,fs:e,treeOid:h.oid,deletePathParts:s.filePath.split("/"),addPathParts:void 0,addObj:void 0,deleteKeepIfNotEmpty:!1,addKeepIfEmpty:!0,keepFilename:".keep"});if(c!==h.oid){let d=await Rt.default.commit({fs:e,dir:t,message:`Delete ${s.filePath}`,tree:c,noUpdateBranch:!0,parent:[u],author:i});await Rt.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(s.branchName)}`,value:d,force:!0})}},"rmdir")}})}o(rz,"createBranchFileAdapter");var nz=Lt(Or(),1);function iz({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branches-list",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchesListVirtualFile",rootType:"folder",getStats:o(async()=>{let a=t+"/.git";try{return await e.promises.stat(a)}catch{throw new Error(`ENOENT: no such file or directory, stat '${a}'`)}},"getStats"),getFile:o(async({filePath:a})=>{try{let i=(await nz.default.listBranches({fs:e,dir:t})).map(u=>bn({parent:a,name:yo(u),isDir:!0}));return{type:"directory",content:i,mode:493,size:i}}catch(s){throw s}},"getFile"),rename:o(async a=>{throw new Error("not implemented")},"rename"),mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(iz,"createBranchesListAdapter");var zc=Lt(Or(),1);function ix(e){return e&&e.gitCache!==void 0?e.gitCache:e&&e.parentFs?ix(e.parentFs):{}}o(ix,"getGitCacheFromFs");function oz({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branch-head",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchHeadVirtualFile",rootType:"file",getStats:o(async({pathParams:a,userSpaceFs:s})=>{a.branchName===void 0&&(a.branchName=await Et(t,e));let i=await it(e,t,a.branchName);if(!i)throw new Error(`Branch ${a.branchName} does not exist in the repository`);let u=await zc.default.readCommit({fs:e,dir:t,oid:i,cache:ix(s)}),{commit:h}=u,c=h.committer.timestamp*1e3;return{mode:420,size:40,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(.009765625),atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c)}},"getStats"),getFile:o(async({pathParams:a,userSpaceFs:s})=>{a.branchName===void 0&&(a.branchName=await Et(t,e));try{let i;try{i=await zc.default.resolveRef({fs:e,dir:t,ref:a.branchName})}catch{i=await zc.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${a.branchName}`})}return{type:"file",content:i+`
143
143
  `,mode:420,size:i.length}}catch{return}},"getFile"),writeFile:o(async({content:a,pathParams:s,userSpaceFs:i})=>{s.branchName===void 0&&(s.branchName=await Et(t,e));let u=a.toString().trim();try{await zc.default.readCommit({fs:e,dir:t,oid:u,cache:ix(i)})}catch{throw new Error(`Commit ${u} does not exist in the repository`)}await zc.default.writeRef({fs:e,dir:t,ref:"refs/heads/"+s.branchName,value:u,force:!0})},"writeFile"),rename(a){throw new Error("not implementsd")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(oz,"createBranchHeadAdapter");var Rv=Lt(Or(),1);var Av={};Kn(Av,{Dir:()=>_Ie,Dirent:()=>EIe,F_OK:()=>OIe,FileReadStream:()=>RIe,FileWriteStream:()=>TIe,R_OK:()=>IIe,ReadStream:()=>SIe,Stats:()=>rI,W_OK:()=>PIe,WriteStream:()=>AIe,X_OK:()=>FIe,_toUnixTimestamp:()=>xIe,access:()=>Kxe,accessSync:()=>Yxe,appendFile:()=>Vxe,appendFileSync:()=>Gxe,chmod:()=>Jxe,chmodSync:()=>Qxe,chown:()=>Zxe,chownSync:()=>Xxe,close:()=>eOe,closeSync:()=>tOe,constants:()=>kIe,copyFile:()=>rOe,copyFileSync:()=>nOe,cp:()=>iOe,cpSync:()=>oOe,createReadStream:()=>aOe,createWriteStream:()=>sOe,default:()=>Vt,exists:()=>lOe,existsSync:()=>fY,fchmod:()=>cOe,fchmodSync:()=>hOe,fchown:()=>fOe,fchownSync:()=>uOe,fdatasync:()=>dOe,fdatasyncSync:()=>pOe,fstat:()=>yOe,fstatSync:()=>mOe,fsync:()=>gOe,fsyncSync:()=>wOe,ftruncate:()=>vOe,ftruncateSync:()=>bOe,futimes:()=>_Oe,futimesSync:()=>EOe,lchmod:()=>ROe,lchmodSync:()=>TOe,lchown:()=>SOe,lchownSync:()=>AOe,link:()=>xOe,linkSync:()=>OOe,lstat:()=>IOe,lstatSync:()=>POe,mkdir:()=>FOe,mkdirSync:()=>kOe,mkdtemp:()=>BOe,mkdtempSync:()=>COe,open:()=>LOe,openSync:()=>NOe,opendir:()=>DOe,opendirSync:()=>$Oe,promises:()=>BIe,read:()=>jOe,readFile:()=>zOe,readFileSync:()=>VOe,readSync:()=>WOe,readdir:()=>UOe,readdirSync:()=>MOe,readlink:()=>GOe,readlinkSync:()=>KOe,readv:()=>qOe,readvSync:()=>HOe,realpath:()=>YOe,realpathSync:()=>ZOe,rename:()=>XOe,renameSync:()=>JOe,rm:()=>QOe,rmSync:()=>eIe,rmdir:()=>tIe,rmdirSync:()=>rIe,stat:()=>nIe,statSync:()=>iIe,symlink:()=>oIe,symlinkSync:()=>aIe,truncate:()=>sIe,truncateSync:()=>lIe,unlink:()=>uIe,unlinkSync:()=>cIe,unwatchFile:()=>fIe,utimes:()=>hIe,utimesSync:()=>dIe,watch:()=>pIe,watchFile:()=>yIe,write:()=>gIe,writeFile:()=>mIe,writeFileSync:()=>uY,writeSync:()=>wIe,writev:()=>vIe,writevSync:()=>bIe});var Ap={},az=!1;function CSe(){if(az)return Ap;az=!0,Ap.byteLength=u,Ap.toByteArray=c,Ap.fromByteArray=m;for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=n.length;a<s;++a)e[a]=n[a],t[n.charCodeAt(a)]=a;t[45]=62,t[95]=63;function i(g){var v=g.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var _=g.indexOf("=");_===-1&&(_=v);var b=_===v?0:4-_%4;return[_,b]}o(i,"getLens");function u(g){var v=i(g),_=v[0],b=v[1];return(_+b)*3/4-b}o(u,"byteLength");function h(g,v,_){return(v+_)*3/4-_}o(h,"_byteLength");function c(g){var v,_=i(g),b=_[0],E=_[1],S=new r(h(g,b,E)),T=0,x=E>0?b-4:b,A;for(A=0;A<x;A+=4)v=t[g.charCodeAt(A)]<<18|t[g.charCodeAt(A+1)]<<12|t[g.charCodeAt(A+2)]<<6|t[g.charCodeAt(A+3)],S[T++]=v>>16&255,S[T++]=v>>8&255,S[T++]=v&255;return E===2&&(v=t[g.charCodeAt(A)]<<2|t[g.charCodeAt(A+1)]>>4,S[T++]=v&255),E===1&&(v=t[g.charCodeAt(A)]<<10|t[g.charCodeAt(A+1)]<<4|t[g.charCodeAt(A+2)]>>2,S[T++]=v>>8&255,S[T++]=v&255),S}o(c,"toByteArray");function d(g){return e[g>>18&63]+e[g>>12&63]+e[g>>6&63]+e[g&63]}o(d,"tripletToBase64");function y(g,v,_){for(var b,E=[],S=v;S<_;S+=3)b=(g[S]<<16&16711680)+(g[S+1]<<8&65280)+(g[S+2]&255),E.push(d(b));return E.join("")}o(y,"encodeChunk");function m(g){for(var v,_=g.length,b=_%3,E=[],S=16383,T=0,x=_-b;T<x;T+=S)E.push(y(g,T,T+S>x?x:T+S));return b===1?(v=g[_-1],E.push(e[v>>2]+e[v<<4&63]+"==")):b===2&&(v=(g[_-2]<<8)+g[_-1],E.push(e[v>>10]+e[v>>4&63]+e[v<<2&63]+"=")),E.join("")}return o(m,"fromByteArray"),Ap}o(CSe,"dew$2");var W0={},sz=!1;function LSe(){return sz||(sz=!0,W0.read=function(e,t,r,n,a){var s,i,u=a*8-n-1,h=(1<<u)-1,c=h>>1,d=-7,y=r?a-1:0,m=r?-1:1,g=e[t+y];for(y+=m,s=g&(1<<-d)-1,g>>=-d,d+=u;d>0;s=s*256+e[t+y],y+=m,d-=8);for(i=s&(1<<-d)-1,s>>=-d,d+=n;d>0;i=i*256+e[t+y],y+=m,d-=8);if(s===0)s=1-c;else{if(s===h)return i?NaN:(g?-1:1)*(1/0);i=i+Math.pow(2,n),s=s-c}return(g?-1:1)*i*Math.pow(2,s-n)},W0.write=function(e,t,r,n,a,s){var i,u,h,c=s*8-a-1,d=(1<<c)-1,y=d>>1,m=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,v=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,i=d):(i=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-i))<1&&(i--,h*=2),i+y>=1?t+=m/h:t+=m*Math.pow(2,1-y),t*h>=2&&(i++,h/=2),i+y>=d?(u=0,i=d):i+y>=1?(u=(t*h-1)*Math.pow(2,a),i=i+y):(u=t*Math.pow(2,y-1)*Math.pow(2,a),i=0));a>=8;e[r+g]=u&255,g+=v,u/=256,a-=8);for(i=i<<a|u,c+=a;c>0;e[r+g]=i&255,g+=v,i/=256,c-=8);e[r+g-v]|=_*128}),W0}o(LSe,"dew$1");var Sf={},lz=!1;function zG(){if(lz)return Sf;lz=!0;let e=CSe(),t=LSe(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Sf.Buffer=i,Sf.SlowBuffer=E,Sf.INSPECT_MAX_BYTES=50;let n=2147483647;Sf.kMaxLength=n,i.TYPED_ARRAY_SUPPORT=a(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let p=new Uint8Array(1),l={foo:o(function(){return 42},"foo")};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(p,l),p.foo()===42}catch{return!1}}o(a,"typedArraySupport"),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:o(function(){if(i.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:o(function(){if(i.isBuffer(this))return this.byteOffset},"get")});function s(p){if(p>n)throw new RangeError('The value "'+p+'" is invalid for option "size"');let l=new Uint8Array(p);return Object.setPrototypeOf(l,i.prototype),l}o(s,"createBuffer");function i(p,l,f){if(typeof p=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(p)}return u(p,l,f)}o(i,"Buffer2"),i.poolSize=8192;function u(p,l,f){if(typeof p=="string")return y(p,l);if(ArrayBuffer.isView(p))return g(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p);if(Ee(p,ArrayBuffer)||p&&Ee(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ee(p,SharedArrayBuffer)||p&&Ee(p.buffer,SharedArrayBuffer)))return v(p,l,f);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let w=p.valueOf&&p.valueOf();if(w!=null&&w!==p)return i.from(w,l,f);let R=_(p);if(R)return R;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return i.from(p[Symbol.toPrimitive]("string"),l,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof p)}o(u,"from"),i.from=function(p,l,f){return u(p,l,f)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function h(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}o(h,"assertSize");function c(p,l,f){return h(p),p<=0?s(p):l!==void 0?typeof f=="string"?s(p).fill(l,f):s(p).fill(l):s(p)}o(c,"alloc"),i.alloc=function(p,l,f){return c(p,l,f)};function d(p){return h(p),s(p<0?0:b(p)|0)}o(d,"allocUnsafe"),i.allocUnsafe=function(p){return d(p)},i.allocUnsafeSlow=function(p){return d(p)};function y(p,l){if((typeof l!="string"||l==="")&&(l="utf8"),!i.isEncoding(l))throw new TypeError("Unknown encoding: "+l);let f=S(p,l)|0,w=s(f),R=w.write(p,l);return R!==f&&(w=w.slice(0,R)),w}o(y,"fromString");function m(p){let l=p.length<0?0:b(p.length)|0,f=s(l);for(let w=0;w<l;w+=1)f[w]=p[w]&255;return f}o(m,"fromArrayLike");function g(p){if(Ee(p,Uint8Array)){let l=new Uint8Array(p);return v(l.buffer,l.byteOffset,l.byteLength)}return m(p)}o(g,"fromArrayView");function v(p,l,f){if(l<0||p.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<l+(f||0))throw new RangeError('"length" is outside of buffer bounds');let w;return l===void 0&&f===void 0?w=new Uint8Array(p):f===void 0?w=new Uint8Array(p,l):w=new Uint8Array(p,l,f),Object.setPrototypeOf(w,i.prototype),w}o(v,"fromArrayBuffer");function _(p){if(i.isBuffer(p)){let l=b(p.length)|0,f=s(l);return f.length===0||p.copy(f,0,0,l),f}if(p.length!==void 0)return typeof p.length!="number"||Te(p.length)?s(0):m(p);if(p.type==="Buffer"&&Array.isArray(p.data))return m(p.data)}o(_,"fromObject");function b(p){if(p>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return p|0}o(b,"checked");function E(p){return+p!=p&&(p=0),i.alloc(+p)}o(E,"SlowBuffer"),i.isBuffer=o(function(l){return l!=null&&l._isBuffer===!0&&l!==i.prototype},"isBuffer"),i.compare=o(function(l,f){if(Ee(l,Uint8Array)&&(l=i.from(l,l.offset,l.byteLength)),Ee(f,Uint8Array)&&(f=i.from(f,f.offset,f.byteLength)),!i.isBuffer(l)||!i.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===f)return 0;let w=l.length,R=f.length;for(let O=0,k=Math.min(w,R);O<k;++O)if(l[O]!==f[O]){w=l[O],R=f[O];break}return w<R?-1:R<w?1:0},"compare"),i.isEncoding=o(function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding"),i.concat=o(function(l,f){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return i.alloc(0);let w;if(f===void 0)for(f=0,w=0;w<l.length;++w)f+=l[w].length;let R=i.allocUnsafe(f),O=0;for(w=0;w<l.length;++w){let k=l[w];if(Ee(k,Uint8Array))O+k.length>R.length?(i.isBuffer(k)||(k=i.from(k)),k.copy(R,O)):Uint8Array.prototype.set.call(R,k,O);else if(i.isBuffer(k))k.copy(R,O);else throw new TypeError('"list" argument must be an Array of Buffers');O+=k.length}return R},"concat");function S(p,l){if(i.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||Ee(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof p);let f=p.length,w=arguments.length>2&&arguments[2]===!0;if(!w&&f===0)return 0;let R=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return be(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return de(p).length;default:if(R)return w?-1:be(p).length;l=(""+l).toLowerCase(),R=!0}}o(S,"byteLength"),i.byteLength=S;function T(p,l,f){let w=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,l>>>=0,f<=l))return"";for(p||(p="utf8");;)switch(p){case"hex":return W(this,l,f);case"utf8":case"utf-8":return Q(this,l,f);case"ascii":return ge(this,l,f);case"latin1":case"binary":return oe(this,l,f);case"base64":return V(this,l,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,l,f);default:if(w)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),w=!0}}o(T,"slowToString"),i.prototype._isBuffer=!0;function x(p,l,f){let w=p[l];p[l]=p[f],p[f]=w}o(x,"swap"),i.prototype.swap16=o(function(){let l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<l;f+=2)x(this,f,f+1);return this},"swap16"),i.prototype.swap32=o(function(){let l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<l;f+=4)x(this,f,f+3),x(this,f+1,f+2);return this},"swap32"),i.prototype.swap64=o(function(){let l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<l;f+=8)x(this,f,f+7),x(this,f+1,f+6),x(this,f+2,f+5),x(this,f+3,f+4);return this},"swap64"),i.prototype.toString=o(function(){let l=this.length;return l===0?"":arguments.length===0?Q(this,0,l):T.apply(this,arguments)},"toString"),i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=o(function(l){if(!i.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:i.compare(this,l)===0},"equals"),i.prototype.inspect=o(function(){let l="",f=Sf.INSPECT_MAX_BYTES;return l=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(l+=" ... "),"<Buffer "+l+">"},"inspect"),r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=o(function(l,f,w,R,O){if(Ee(l,Uint8Array)&&(l=i.from(l,l.offset,l.byteLength)),!i.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(f===void 0&&(f=0),w===void 0&&(w=l?l.length:0),R===void 0&&(R=0),O===void 0&&(O=this.length),f<0||w>l.length||R<0||O>this.length)throw new RangeError("out of range index");if(R>=O&&f>=w)return 0;if(R>=O)return-1;if(f>=w)return 1;if(f>>>=0,w>>>=0,R>>>=0,O>>>=0,this===l)return 0;let k=O-R,M=w-f,K=Math.min(k,M),me=this.slice(R,O),ve=l.slice(f,w);for(let ye=0;ye<K;++ye)if(me[ye]!==ve[ye]){k=me[ye],M=ve[ye];break}return k<M?-1:M<k?1:0},"compare");function A(p,l,f,w,R){if(p.length===0)return-1;if(typeof f=="string"?(w=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Te(f)&&(f=R?0:p.length-1),f<0&&(f=p.length+f),f>=p.length){if(R)return-1;f=p.length-1}else if(f<0)if(R)f=0;else return-1;if(typeof l=="string"&&(l=i.from(l,w)),i.isBuffer(l))return l.length===0?-1:B(p,l,f,w,R);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?R?Uint8Array.prototype.indexOf.call(p,l,f):Uint8Array.prototype.lastIndexOf.call(p,l,f):B(p,[l],f,w,R);throw new TypeError("val must be string, number or Buffer")}o(A,"bidirectionalIndexOf");function B(p,l,f,w,R){let O=1,k=p.length,M=l.length;if(w!==void 0&&(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le")){if(p.length<2||l.length<2)return-1;O=2,k/=2,M/=2,f/=2}function K(ve,ye){return O===1?ve[ye]:ve.readUInt16BE(ye*O)}o(K,"read2");let me;if(R){let ve=-1;for(me=f;me<k;me++)if(K(p,me)===K(l,ve===-1?0:me-ve)){if(ve===-1&&(ve=me),me-ve+1===M)return ve*O}else ve!==-1&&(me-=me-ve),ve=-1}else for(f+M>k&&(f=k-M),me=f;me>=0;me--){let ve=!0;for(let ye=0;ye<M;ye++)if(K(p,me+ye)!==K(l,ye)){ve=!1;break}if(ve)return me}return-1}o(B,"arrayIndexOf"),i.prototype.includes=o(function(l,f,w){return this.indexOf(l,f,w)!==-1},"includes"),i.prototype.indexOf=o(function(l,f,w){return A(this,l,f,w,!0)},"indexOf"),i.prototype.lastIndexOf=o(function(l,f,w){return A(this,l,f,w,!1)},"lastIndexOf");function P(p,l,f,w){f=Number(f)||0;let R=p.length-f;w?(w=Number(w),w>R&&(w=R)):w=R;let O=l.length;w>O/2&&(w=O/2);let k;for(k=0;k<w;++k){let M=parseInt(l.substr(k*2,2),16);if(Te(M))return k;p[f+k]=M}return k}o(P,"hexWrite");function N(p,l,f,w){return Re(be(l,p.length-f),p,f,w)}o(N,"utf8Write");function L(p,l,f,w){return Re(ce(l),p,f,w)}o(L,"asciiWrite");function C(p,l,f,w){return Re(de(l),p,f,w)}o(C,"base64Write");function z(p,l,f,w){return Re(se(l,p.length-f),p,f,w)}o(z,"ucs2Write"),i.prototype.write=o(function(l,f,w,R){if(f===void 0)R="utf8",w=this.length,f=0;else if(w===void 0&&typeof f=="string")R=f,w=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(w)?(w=w>>>0,R===void 0&&(R="utf8")):(R=w,w=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let O=this.length-f;if((w===void 0||w>O)&&(w=O),l.length>0&&(w<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");R||(R="utf8");let k=!1;for(;;)switch(R){case"hex":return P(this,l,f,w);case"utf8":case"utf-8":return N(this,l,f,w);case"ascii":case"latin1":case"binary":return L(this,l,f,w);case"base64":return C(this,l,f,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,l,f,w);default:if(k)throw new TypeError("Unknown encoding: "+R);R=(""+R).toLowerCase(),k=!0}},"write2"),i.prototype.toJSON=o(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function V(p,l,f){return l===0&&f===p.length?e.fromByteArray(p):e.fromByteArray(p.slice(l,f))}o(V,"base64Slice");function Q(p,l,f){f=Math.min(p.length,f);let w=[],R=l;for(;R<f;){let O=p[R],k=null,M=O>239?4:O>223?3:O>191?2:1;if(R+M<=f){let K,me,ve,ye;switch(M){case 1:O<128&&(k=O);break;case 2:K=p[R+1],(K&192)===128&&(ye=(O&31)<<6|K&63,ye>127&&(k=ye));break;case 3:K=p[R+1],me=p[R+2],(K&192)===128&&(me&192)===128&&(ye=(O&15)<<12|(K&63)<<6|me&63,ye>2047&&(ye<55296||ye>57343)&&(k=ye));break;case 4:K=p[R+1],me=p[R+2],ve=p[R+3],(K&192)===128&&(me&192)===128&&(ve&192)===128&&(ye=(O&15)<<18|(K&63)<<12|(me&63)<<6|ve&63,ye>65535&&ye<1114112&&(k=ye))}}k===null?(k=65533,M=1):k>65535&&(k-=65536,w.push(k>>>10&1023|55296),k=56320|k&1023),w.push(k),R+=M}return ue(w)}o(Q,"utf8Slice");let X=4096;function ue(p){let l=p.length;if(l<=X)return String.fromCharCode.apply(String,p);let f="",w=0;for(;w<l;)f+=String.fromCharCode.apply(String,p.slice(w,w+=X));return f}o(ue,"decodeCodePointsArray");function ge(p,l,f){let w="";f=Math.min(p.length,f);for(let R=l;R<f;++R)w+=String.fromCharCode(p[R]&127);return w}o(ge,"asciiSlice");function oe(p,l,f){let w="";f=Math.min(p.length,f);for(let R=l;R<f;++R)w+=String.fromCharCode(p[R]);return w}o(oe,"latin1Slice");function W(p,l,f){let w=p.length;(!l||l<0)&&(l=0),(!f||f<0||f>w)&&(f=w);let R="";for(let O=l;O<f;++O)R+=Ge[p[O]];return R}o(W,"hexSlice");function ae(p,l,f){let w=p.slice(l,f),R="";for(let O=0;O<w.length-1;O+=2)R+=String.fromCharCode(w[O]+w[O+1]*256);return R}o(ae,"utf16leSlice"),i.prototype.slice=o(function(l,f){let w=this.length;l=~~l,f=f===void 0?w:~~f,l<0?(l+=w,l<0&&(l=0)):l>w&&(l=w),f<0?(f+=w,f<0&&(f=0)):f>w&&(f=w),f<l&&(f=l);let R=this.subarray(l,f);return Object.setPrototypeOf(R,i.prototype),R},"slice");function U(p,l,f){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+l>f)throw new RangeError("Trying to access beyond buffer length")}o(U,"checkOffset"),i.prototype.readUintLE=i.prototype.readUIntLE=o(function(l,f,w){l=l>>>0,f=f>>>0,w||U(l,f,this.length);let R=this[l],O=1,k=0;for(;++k<f&&(O*=256);)R+=this[l+k]*O;return R},"readUIntLE"),i.prototype.readUintBE=i.prototype.readUIntBE=o(function(l,f,w){l=l>>>0,f=f>>>0,w||U(l,f,this.length);let R=this[l+--f],O=1;for(;f>0&&(O*=256);)R+=this[l+--f]*O;return R},"readUIntBE"),i.prototype.readUint8=i.prototype.readUInt8=o(function(l,f){return l=l>>>0,f||U(l,1,this.length),this[l]},"readUInt8"),i.prototype.readUint16LE=i.prototype.readUInt16LE=o(function(l,f){return l=l>>>0,f||U(l,2,this.length),this[l]|this[l+1]<<8},"readUInt16LE"),i.prototype.readUint16BE=i.prototype.readUInt16BE=o(function(l,f){return l=l>>>0,f||U(l,2,this.length),this[l]<<8|this[l+1]},"readUInt16BE"),i.prototype.readUint32LE=i.prototype.readUInt32LE=o(function(l,f){return l=l>>>0,f||U(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},"readUInt32LE"),i.prototype.readUint32BE=i.prototype.readUInt32BE=o(function(l,f){return l=l>>>0,f||U(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},"readUInt32BE"),i.prototype.readBigUInt64LE=Le(o(function(l){l=l>>>0,F(l,"offset");let f=this[l],w=this[l+7];(f===void 0||w===void 0)&&I(l,this.length-8);let R=f+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,O=this[++l]+this[++l]*2**8+this[++l]*2**16+w*2**24;return BigInt(R)+(BigInt(O)<<BigInt(32))},"readBigUInt64LE")),i.prototype.readBigUInt64BE=Le(o(function(l){l=l>>>0,F(l,"offset");let f=this[l],w=this[l+7];(f===void 0||w===void 0)&&I(l,this.length-8);let R=f*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],O=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+w;return(BigInt(R)<<BigInt(32))+BigInt(O)},"readBigUInt64BE")),i.prototype.readIntLE=o(function(l,f,w){l=l>>>0,f=f>>>0,w||U(l,f,this.length);let R=this[l],O=1,k=0;for(;++k<f&&(O*=256);)R+=this[l+k]*O;return O*=128,R>=O&&(R-=Math.pow(2,8*f)),R},"readIntLE"),i.prototype.readIntBE=o(function(l,f,w){l=l>>>0,f=f>>>0,w||U(l,f,this.length);let R=f,O=1,k=this[l+--R];for(;R>0&&(O*=256);)k+=this[l+--R]*O;return O*=128,k>=O&&(k-=Math.pow(2,8*f)),k},"readIntBE"),i.prototype.readInt8=o(function(l,f){return l=l>>>0,f||U(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},"readInt8"),i.prototype.readInt16LE=o(function(l,f){l=l>>>0,f||U(l,2,this.length);let w=this[l]|this[l+1]<<8;return w&32768?w|4294901760:w},"readInt16LE"),i.prototype.readInt16BE=o(function(l,f){l=l>>>0,f||U(l,2,this.length);let w=this[l+1]|this[l]<<8;return w&32768?w|4294901760:w},"readInt16BE"),i.prototype.readInt32LE=o(function(l,f){return l=l>>>0,f||U(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},"readInt32LE"),i.prototype.readInt32BE=o(function(l,f){return l=l>>>0,f||U(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},"readInt32BE"),i.prototype.readBigInt64LE=Le(o(function(l){l=l>>>0,F(l,"offset");let f=this[l],w=this[l+7];(f===void 0||w===void 0)&&I(l,this.length-8);let R=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(w<<24);return(BigInt(R)<<BigInt(32))+BigInt(f+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)},"readBigInt64LE")),i.prototype.readBigInt64BE=Le(o(function(l){l=l>>>0,F(l,"offset");let f=this[l],w=this[l+7];(f===void 0||w===void 0)&&I(l,this.length-8);let R=(f<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(R)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+w)},"readBigInt64BE")),i.prototype.readFloatLE=o(function(l,f){return l=l>>>0,f||U(l,4,this.length),t.read(this,l,!0,23,4)},"readFloatLE"),i.prototype.readFloatBE=o(function(l,f){return l=l>>>0,f||U(l,4,this.length),t.read(this,l,!1,23,4)},"readFloatBE"),i.prototype.readDoubleLE=o(function(l,f){return l=l>>>0,f||U(l,8,this.length),t.read(this,l,!0,52,8)},"readDoubleLE"),i.prototype.readDoubleBE=o(function(l,f){return l=l>>>0,f||U(l,8,this.length),t.read(this,l,!1,52,8)},"readDoubleBE");function Y(p,l,f,w,R,O){if(!i.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>R||l<O)throw new RangeError('"value" argument is out of bounds');if(f+w>p.length)throw new RangeError("Index out of range")}o(Y,"checkInt"),i.prototype.writeUintLE=i.prototype.writeUIntLE=o(function(l,f,w,R){if(l=+l,f=f>>>0,w=w>>>0,!R){let M=Math.pow(2,8*w)-1;Y(this,l,f,w,M,0)}let O=1,k=0;for(this[f]=l&255;++k<w&&(O*=256);)this[f+k]=l/O&255;return f+w},"writeUIntLE"),i.prototype.writeUintBE=i.prototype.writeUIntBE=o(function(l,f,w,R){if(l=+l,f=f>>>0,w=w>>>0,!R){let M=Math.pow(2,8*w)-1;Y(this,l,f,w,M,0)}let O=w-1,k=1;for(this[f+O]=l&255;--O>=0&&(k*=256);)this[f+O]=l/k&255;return f+w},"writeUIntBE"),i.prototype.writeUint8=i.prototype.writeUInt8=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,1,255,0),this[f]=l&255,f+1},"writeUInt8"),i.prototype.writeUint16LE=i.prototype.writeUInt16LE=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,2,65535,0),this[f]=l&255,this[f+1]=l>>>8,f+2},"writeUInt16LE"),i.prototype.writeUint16BE=i.prototype.writeUInt16BE=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,2,65535,0),this[f]=l>>>8,this[f+1]=l&255,f+2},"writeUInt16BE"),i.prototype.writeUint32LE=i.prototype.writeUInt32LE=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,4,4294967295,0),this[f+3]=l>>>24,this[f+2]=l>>>16,this[f+1]=l>>>8,this[f]=l&255,f+4},"writeUInt32LE"),i.prototype.writeUint32BE=i.prototype.writeUInt32BE=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,4,4294967295,0),this[f]=l>>>24,this[f+1]=l>>>16,this[f+2]=l>>>8,this[f+3]=l&255,f+4},"writeUInt32BE");function J(p,l,f,w,R){he(l,w,R,p,f,7);let O=Number(l&BigInt(4294967295));p[f++]=O,O=O>>8,p[f++]=O,O=O>>8,p[f++]=O,O=O>>8,p[f++]=O;let k=Number(l>>BigInt(32)&BigInt(4294967295));return p[f++]=k,k=k>>8,p[f++]=k,k=k>>8,p[f++]=k,k=k>>8,p[f++]=k,f}o(J,"wrtBigUInt64LE");function Z(p,l,f,w,R){he(l,w,R,p,f,7);let O=Number(l&BigInt(4294967295));p[f+7]=O,O=O>>8,p[f+6]=O,O=O>>8,p[f+5]=O,O=O>>8,p[f+4]=O;let k=Number(l>>BigInt(32)&BigInt(4294967295));return p[f+3]=k,k=k>>8,p[f+2]=k,k=k>>8,p[f+1]=k,k=k>>8,p[f]=k,f+8}o(Z,"wrtBigUInt64BE"),i.prototype.writeBigUInt64LE=Le(o(function(l,f=0){return J(this,l,f,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),i.prototype.writeBigUInt64BE=Le(o(function(l,f=0){return Z(this,l,f,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),i.prototype.writeIntLE=o(function(l,f,w,R){if(l=+l,f=f>>>0,!R){let K=Math.pow(2,8*w-1);Y(this,l,f,w,K-1,-K)}let O=0,k=1,M=0;for(this[f]=l&255;++O<w&&(k*=256);)l<0&&M===0&&this[f+O-1]!==0&&(M=1),this[f+O]=(l/k>>0)-M&255;return f+w},"writeIntLE"),i.prototype.writeIntBE=o(function(l,f,w,R){if(l=+l,f=f>>>0,!R){let K=Math.pow(2,8*w-1);Y(this,l,f,w,K-1,-K)}let O=w-1,k=1,M=0;for(this[f+O]=l&255;--O>=0&&(k*=256);)l<0&&M===0&&this[f+O+1]!==0&&(M=1),this[f+O]=(l/k>>0)-M&255;return f+w},"writeIntBE"),i.prototype.writeInt8=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,1,127,-128),l<0&&(l=255+l+1),this[f]=l&255,f+1},"writeInt8"),i.prototype.writeInt16LE=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,2,32767,-32768),this[f]=l&255,this[f+1]=l>>>8,f+2},"writeInt16LE"),i.prototype.writeInt16BE=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,2,32767,-32768),this[f]=l>>>8,this[f+1]=l&255,f+2},"writeInt16BE"),i.prototype.writeInt32LE=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,4,2147483647,-2147483648),this[f]=l&255,this[f+1]=l>>>8,this[f+2]=l>>>16,this[f+3]=l>>>24,f+4},"writeInt32LE"),i.prototype.writeInt32BE=o(function(l,f,w){return l=+l,f=f>>>0,w||Y(this,l,f,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[f]=l>>>24,this[f+1]=l>>>16,this[f+2]=l>>>8,this[f+3]=l&255,f+4},"writeInt32BE"),i.prototype.writeBigInt64LE=Le(o(function(l,f=0){return J(this,l,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),i.prototype.writeBigInt64BE=Le(o(function(l,f=0){return Z(this,l,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function re(p,l,f,w,R,O){if(f+w>p.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}o(re,"checkIEEE754");function we(p,l,f,w,R){return l=+l,f=f>>>0,R||re(p,l,f,4),t.write(p,l,f,w,23,4),f+4}o(we,"writeFloat"),i.prototype.writeFloatLE=o(function(l,f,w){return we(this,l,f,!0,w)},"writeFloatLE"),i.prototype.writeFloatBE=o(function(l,f,w){return we(this,l,f,!1,w)},"writeFloatBE");function Ae(p,l,f,w,R){return l=+l,f=f>>>0,R||re(p,l,f,8),t.write(p,l,f,w,52,8),f+8}o(Ae,"writeDouble"),i.prototype.writeDoubleLE=o(function(l,f,w){return Ae(this,l,f,!0,w)},"writeDoubleLE"),i.prototype.writeDoubleBE=o(function(l,f,w){return Ae(this,l,f,!1,w)},"writeDoubleBE"),i.prototype.copy=o(function(l,f,w,R){if(!i.isBuffer(l))throw new TypeError("argument should be a Buffer");if(w||(w=0),!R&&R!==0&&(R=this.length),f>=l.length&&(f=l.length),f||(f=0),R>0&&R<w&&(R=w),R===w||l.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(w<0||w>=this.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("sourceEnd out of bounds");R>this.length&&(R=this.length),l.length-f<R-w&&(R=l.length-f+w);let O=R-w;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,w,R):Uint8Array.prototype.set.call(l,this.subarray(w,R),f),O},"copy"),i.prototype.fill=o(function(l,f,w,R){if(typeof l=="string"){if(typeof f=="string"?(R=f,f=0,w=this.length):typeof w=="string"&&(R=w,w=this.length),R!==void 0&&typeof R!="string")throw new TypeError("encoding must be a string");if(typeof R=="string"&&!i.isEncoding(R))throw new TypeError("Unknown encoding: "+R);if(l.length===1){let k=l.charCodeAt(0);(R==="utf8"&&k<128||R==="latin1")&&(l=k)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(f<0||this.length<f||this.length<w)throw new RangeError("Out of range index");if(w<=f)return this;f=f>>>0,w=w===void 0?this.length:w>>>0,l||(l=0);let O;if(typeof l=="number")for(O=f;O<w;++O)this[O]=l;else{let k=i.isBuffer(l)?l:i.from(l,R),M=k.length;if(M===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(O=0;O<w-f;++O)this[O+f]=k[O%M]}return this},"fill");let D={};function $(p,l,f){var w;D[p]=(w=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${p}]`,this.stack,delete this.name}get code(){return p}set code(O){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:O,writable:!0})}toString(){return`${this.name} [${p}]: ${this.message}`}},o(w,"NodeError"),w)}o($,"E4"),$("ERR_BUFFER_OUT_OF_BOUNDS",function(p){return p?`${p} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),$("ERR_INVALID_ARG_TYPE",function(p,l){return`The "${p}" argument must be of type number. Received type ${typeof l}`},TypeError),$("ERR_OUT_OF_RANGE",function(p,l,f){let w=`The value of "${p}" is out of range.`,R=f;return Number.isInteger(f)&&Math.abs(f)>2**32?R=q(String(f)):typeof f=="bigint"&&(R=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(R=q(R)),R+="n"),w+=` It must be ${l}. Received ${R}`,w},RangeError);function q(p){let l="",f=p.length,w=p[0]==="-"?1:0;for(;f>=w+4;f-=3)l=`_${p.slice(f-3,f)}${l}`;return`${p.slice(0,f)}${l}`}o(q,"addNumericalSeparator");function ne(p,l,f){F(l,"offset"),(p[l]===void 0||p[l+f]===void 0)&&I(l,p.length-(f+1))}o(ne,"checkBounds");function he(p,l,f,w,R,O){if(p>f||p<l){let k=typeof l=="bigint"?"n":"",M;throw l===0||l===BigInt(0)?M=`>= 0${k} and < 2${k} ** ${(O+1)*8}${k}`:M=`>= -(2${k} ** ${(O+1)*8-1}${k}) and < 2 ** ${(O+1)*8-1}${k}`,new D.ERR_OUT_OF_RANGE("value",M,p)}ne(w,R,O)}o(he,"checkIntBI");function F(p,l){if(typeof p!="number")throw new D.ERR_INVALID_ARG_TYPE(l,"number",p)}o(F,"validateNumber");function I(p,l,f){throw Math.floor(p)!==p?(F(p,f),new D.ERR_OUT_OF_RANGE("offset","an integer",p)):l<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,p)}o(I,"boundsError");let j=/[^+/0-9A-Za-z-_]/g;function te(p){if(p=p.split("=")[0],p=p.trim().replace(j,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}o(te,"base64clean");function be(p,l){l=l||1/0;let f,w=p.length,R=null,O=[];for(let k=0;k<w;++k){if(f=p.charCodeAt(k),f>55295&&f<57344){if(!R){if(f>56319){(l-=3)>-1&&O.push(239,191,189);continue}else if(k+1===w){(l-=3)>-1&&O.push(239,191,189);continue}R=f;continue}if(f<56320){(l-=3)>-1&&O.push(239,191,189),R=f;continue}f=(R-55296<<10|f-56320)+65536}else R&&(l-=3)>-1&&O.push(239,191,189);if(R=null,f<128){if((l-=1)<0)break;O.push(f)}else if(f<2048){if((l-=2)<0)break;O.push(f>>6|192,f&63|128)}else if(f<65536){if((l-=3)<0)break;O.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((l-=4)<0)break;O.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return O}o(be,"utf8ToBytes");function ce(p){let l=[];for(let f=0;f<p.length;++f)l.push(p.charCodeAt(f)&255);return l}o(ce,"asciiToBytes");function se(p,l){let f,w,R,O=[];for(let k=0;k<p.length&&!((l-=2)<0);++k)f=p.charCodeAt(k),w=f>>8,R=f%256,O.push(R),O.push(w);return O}o(se,"utf16leToBytes");function de(p){return e.toByteArray(te(p))}o(de,"base64ToBytes");function Re(p,l,f,w){let R;for(R=0;R<w&&!(R+f>=l.length||R>=p.length);++R)l[R+f]=p[R];return R}o(Re,"blitBuffer");function Ee(p,l){return p instanceof l||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===l.name}o(Ee,"isInstance");function Te(p){return p!==p}o(Te,"numberIsNaN");let Ge=function(){let p="0123456789abcdef",l=new Array(256);for(let f=0;f<16;++f){let w=f*16;for(let R=0;R<16;++R)l[w+R]=p[f]+p[R]}return l}();function Le(p){return typeof BigInt>"u"?et:p}o(Le,"defineBigIntMethod");function et(){throw new Error("BigInt not supported")}return o(et,"BufferBigIntNotDefined"),Sf}o(zG,"dew");var VG,$a,Ua,rh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis,Sr=VG={};function bO(){throw new Error("setTimeout has not been defined")}o(bO,"i$2");function _O(){throw new Error("clearTimeout has not been defined")}o(_O,"u$2");function GG(e){if($a===setTimeout)return setTimeout(e,0);if(($a===bO||!$a)&&setTimeout)return $a=setTimeout,setTimeout(e,0);try{return $a(e,0)}catch{try{return $a.call(null,e,0)}catch{return $a.call(this||rh,e,0)}}}o(GG,"c$2");(function(){try{$a=typeof setTimeout=="function"?setTimeout:bO}catch{$a=bO}try{Ua=typeof clearTimeout=="function"?clearTimeout:_O}catch{Ua=_O}})();var Bf,Ma=[],Jc=!1,iv=-1;function NSe(){Jc&&Bf&&(Jc=!1,Bf.length?Ma=Bf.concat(Ma):iv=-1,Ma.length&&KG())}o(NSe,"h$1");function KG(){if(!Jc){var e=GG(NSe);Jc=!0;for(var t=Ma.length;t;){for(Bf=Ma,Ma=[];++iv<t;)Bf&&Bf[iv].run();iv=-1,t=Ma.length}Bf=null,Jc=!1,function(r){if(Ua===clearTimeout)return clearTimeout(r);if((Ua===_O||!Ua)&&clearTimeout)return Ua=clearTimeout,clearTimeout(r);try{Ua(r)}catch{try{return Ua.call(null,r)}catch{return Ua.call(this||rh,r)}}}(e)}}o(KG,"d$1");function fz(e,t){(this||rh).fun=e,(this||rh).array=t}o(fz,"m$1");function Na(){}o(Na,"p$1");Sr.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Ma.push(new fz(e,t)),Ma.length!==1||Jc||GG(KG)},fz.prototype.run=function(){(this||rh).fun.apply(null,(this||rh).array)},Sr.title="browser",Sr.browser=!0,Sr.env={},Sr.argv=[],Sr.version="",Sr.versions={},Sr.on=Na,Sr.addListener=Na,Sr.once=Na,Sr.off=Na,Sr.removeListener=Na,Sr.removeAllListeners=Na,Sr.emit=Na,Sr.prependListener=Na,Sr.prependOnceListener=Na,Sr.listeners=function(e){return[]},Sr.binding=function(e){throw new Error("process.binding is not supported")},Sr.cwd=function(){return"/"},Sr.chdir=function(e){throw new Error("process.chdir is not supported")},Sr.umask=function(){return 0};var Gt=VG;Gt.addListener;Gt.argv;Gt.binding;Gt.browser;Gt.chdir;Gt.cwd;Gt.emit;Gt.env;Gt.listeners;Gt.nextTick;Gt.off;Gt.on;Gt.once;Gt.prependListener;Gt.prependOnceListener;Gt.removeAllListeners;Gt.removeListener;Gt.title;Gt.umask;Gt.version;Gt.versions;var DSe=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",EO=Object.prototype.toString,bv=o(function(e){return!(DSe&&e&&typeof e=="object"&&Symbol.toStringTag in e)&&EO.call(e)==="[object Arguments]"},"o"),YG=o(function(e){return!!bv(e)||e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&EO.call(e)!=="[object Array]"&&EO.call(e.callee)==="[object Function]"},"n"),$Se=function(){return bv(arguments)}();bv.isLegacyArguments=YG;var USe=$Se?bv:YG,MSe=Object.prototype.toString,jSe=Function.prototype.toString,WSe=/^\s*(?:function)?\*/,ZG=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",XG=Object.getPrototypeOf,uz=function(){if(!ZG)return!1;try{return Function("return function*() {}")()}catch{}}(),qSe=uz?XG(uz):{},HSe=o(function(e){return typeof e=="function"&&(!!WSe.test(jSe.call(e))||(ZG?XG(e)===qSe:MSe.call(e)==="[object GeneratorFunction]"))},"i"),zSe=typeof Object.create=="function"?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var r=o(function(){},"o5");r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},JG=o(function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"},"i$1"),ct={},VSe=JG,GSe=USe,KSe=HSe;function Df(e){return e.call.bind(e)}o(Df,"c$1");var QG=typeof BigInt<"u",UO=typeof Symbol<"u",ui=UO&&Symbol.toStringTag!==void 0,Hn=typeof Uint8Array<"u",YSe=typeof ArrayBuffer<"u";if(Hn&&ui)var ZSe=Object.getPrototypeOf(Uint8Array.prototype),Ni=Df(Object.getOwnPropertyDescriptor(ZSe,Symbol.toStringTag).get);var sr=Df(Object.prototype.toString),XSe=Df(Number.prototype.valueOf),JSe=Df(String.prototype.valueOf),QSe=Df(Boolean.prototype.valueOf);if(QG)var eAe=Df(BigInt.prototype.valueOf);if(UO)var tAe=Df(Symbol.prototype.valueOf);function Mp(e,t){if(typeof e!="object")return!1;try{return t(e),!0}catch{return!1}}o(Mp,"O");function cz(e){return Hn&&ui?Ni(e)!==void 0:eK(e)||tK(e)||rK(e)||nK(e)||iK(e)||oK(e)||aK(e)||sK(e)||lK(e)||fK(e)||uK(e)}o(cz,"S");function eK(e){return Hn&&ui?Ni(e)==="Uint8Array":sr(e)==="[object Uint8Array]"||VSe(e)&&e.buffer!==void 0}o(eK,"B");function tK(e){return Hn&&ui?Ni(e)==="Uint8ClampedArray":sr(e)==="[object Uint8ClampedArray]"}o(tK,"k");function rK(e){return Hn&&ui?Ni(e)==="Uint16Array":sr(e)==="[object Uint16Array]"}o(rK,"E");function nK(e){return Hn&&ui?Ni(e)==="Uint32Array":sr(e)==="[object Uint32Array]"}o(nK,"D");function iK(e){return Hn&&ui?Ni(e)==="Int8Array":sr(e)==="[object Int8Array]"}o(iK,"U");function oK(e){return Hn&&ui?Ni(e)==="Int16Array":sr(e)==="[object Int16Array]"}o(oK,"P");function aK(e){return Hn&&ui?Ni(e)==="Int32Array":sr(e)==="[object Int32Array]"}o(aK,"x");function sK(e){return Hn&&ui?Ni(e)==="Float32Array":sr(e)==="[object Float32Array]"}o(sK,"I");function lK(e){return Hn&&ui?Ni(e)==="Float64Array":sr(e)==="[object Float64Array]"}o(lK,"M");function fK(e){return Hn&&ui?Ni(e)==="BigInt64Array":sr(e)==="[object BigInt64Array]"}o(fK,"z");function uK(e){return Hn&&ui?Ni(e)==="BigUint64Array":sr(e)==="[object BigUint64Array]"}o(uK,"F");function q0(e){return sr(e)==="[object Map]"}o(q0,"T");function H0(e){return sr(e)==="[object Set]"}o(H0,"N");function z0(e){return sr(e)==="[object WeakMap]"}o(z0,"W");function ox(e){return sr(e)==="[object WeakSet]"}o(ox,"$");function dv(e){return sr(e)==="[object ArrayBuffer]"}o(dv,"C");function hz(e){return typeof ArrayBuffer<"u"&&(dv.working?dv(e):e instanceof ArrayBuffer)}o(hz,"V");function pv(e){return sr(e)==="[object DataView]"}o(pv,"G");function dz(e){return typeof DataView<"u"&&(pv.working?pv(e):e instanceof DataView)}o(dz,"R");function yv(e){return sr(e)==="[object SharedArrayBuffer]"}o(yv,"J");function pz(e){return typeof SharedArrayBuffer<"u"&&(yv.working?yv(e):e instanceof SharedArrayBuffer)}o(pz,"_");function yz(e){return Mp(e,XSe)}o(yz,"H");function mz(e){return Mp(e,JSe)}o(mz,"Z");function gz(e){return Mp(e,QSe)}o(gz,"q");function wz(e){return QG&&Mp(e,eAe)}o(wz,"K");function vz(e){return UO&&Mp(e,tAe)}o(vz,"L");ct.isArgumentsObject=GSe,ct.isGeneratorFunction=KSe,ct.isPromise=function(e){return typeof Promise<"u"&&e instanceof Promise||e!==null&&typeof e=="object"&&typeof e.then=="function"&&typeof e.catch=="function"},ct.isArrayBufferView=function(e){return YSe&&ArrayBuffer.isView?ArrayBuffer.isView(e):cz(e)||dz(e)},ct.isTypedArray=cz,ct.isUint8Array=eK,ct.isUint8ClampedArray=tK,ct.isUint16Array=rK,ct.isUint32Array=nK,ct.isInt8Array=iK,ct.isInt16Array=oK,ct.isInt32Array=aK,ct.isFloat32Array=sK,ct.isFloat64Array=lK,ct.isBigInt64Array=fK,ct.isBigUint64Array=uK,q0.working=typeof Map<"u"&&q0(new Map),ct.isMap=function(e){return typeof Map<"u"&&(q0.working?q0(e):e instanceof Map)},H0.working=typeof Set<"u"&&H0(new Set),ct.isSet=function(e){return typeof Set<"u"&&(H0.working?H0(e):e instanceof Set)},z0.working=typeof WeakMap<"u"&&z0(new WeakMap),ct.isWeakMap=function(e){return typeof WeakMap<"u"&&(z0.working?z0(e):e instanceof WeakMap)},ox.working=typeof WeakSet<"u"&&ox(new WeakSet),ct.isWeakSet=function(e){return ox(e)},dv.working=typeof ArrayBuffer<"u"&&dv(new ArrayBuffer),ct.isArrayBuffer=hz,pv.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&pv(new DataView(new ArrayBuffer(1),0,1)),ct.isDataView=dz,yv.working=typeof SharedArrayBuffer<"u"&&yv(new SharedArrayBuffer),ct.isSharedArrayBuffer=pz,ct.isAsyncFunction=function(e){return sr(e)==="[object AsyncFunction]"},ct.isMapIterator=function(e){return sr(e)==="[object Map Iterator]"},ct.isSetIterator=function(e){return sr(e)==="[object Set Iterator]"},ct.isGeneratorObject=function(e){return sr(e)==="[object Generator]"},ct.isWebAssemblyCompiledModule=function(e){return sr(e)==="[object WebAssembly.Module]"},ct.isNumberObject=yz,ct.isStringObject=mz,ct.isBooleanObject=gz,ct.isBigIntObject=wz,ct.isSymbolObject=vz,ct.isBoxedPrimitive=function(e){return yz(e)||mz(e)||gz(e)||wz(e)||vz(e)},ct.isAnyArrayBuffer=function(e){return Hn&&(hz(e)||pz(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(ct,e,{enumerable:!1,value:o(function(){throw new Error(e+" is not supported in userland")},"value")})});var Np=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis,Fe={},Uo=Gt,bz=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},rAe=/%[sdj%]/g;Fe.format=function(e){if(!gv(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(Zs(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,a=n.length,s=String(e).replace(rAe,function(u){if(u==="%%")return"%";if(r>=a)return u;switch(u){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return u}}),i=n[r];r<a;i=n[++r])_v(i)||!oh(i)?s+=" "+i:s+=" "+Zs(i);return s},Fe.deprecate=function(e,t){if(Uo!==void 0&&Uo.noDeprecation===!0)return e;if(Uo===void 0)return function(){return Fe.deprecate(e,t).apply(this||Np,arguments)};var r=!1;return function(){if(!r){if(Uo.throwDeprecation)throw new Error(t);Uo.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this||Np,arguments)}};var V0={},cK=/^$/;Uo.env.NODE_DEBUG&&(G0=Uo.env.NODE_DEBUG,G0=G0.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),cK=new RegExp("^"+G0+"$","i"));var G0;function Zs(e,t){var r={seen:[],stylize:iAe};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),MO(t)?r.showHidden=t:t&&Fe._extend(r,t),Cf(r.showHidden)&&(r.showHidden=!1),Cf(r.depth)&&(r.depth=2),Cf(r.colors)&&(r.colors=!1),Cf(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=nAe),mv(r,e,r.depth)}o(Zs,"oe");function nAe(e,t){var r=Zs.styles[t];return r?"\x1B["+Zs.colors[r][0]+"m"+e+"\x1B["+Zs.colors[r][1]+"m":e}o(nAe,"ue");function iAe(e,t){return e}o(iAe,"fe");function mv(e,t,r){if(e.customInspect&&t&&ov(t.inspect)&&t.inspect!==Fe.inspect&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return gv(n)||(n=mv(e,n,r)),n}var a=function(m,g){if(Cf(g))return m.stylize("undefined","undefined");if(gv(g)){var v="'"+JSON.stringify(g).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return m.stylize(v,"string")}if(dK(g))return m.stylize(""+g,"number");if(MO(g))return m.stylize(""+g,"boolean");if(_v(g))return m.stylize("null","null")}(e,t);if(a)return a;var s=Object.keys(t),i=function(m){var g={};return m.forEach(function(v,_){g[v]=!0}),g}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),$p(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return ax(t);if(s.length===0){if(ov(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(Dp(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(wv(t))return e.stylize(Date.prototype.toString.call(t),"date");if($p(t))return ax(t)}var h,c="",d=!1,y=["{","}"];return hK(t)&&(d=!0,y=["[","]"]),ov(t)&&(c=" [Function"+(t.name?": "+t.name:"")+"]"),Dp(t)&&(c=" "+RegExp.prototype.toString.call(t)),wv(t)&&(c=" "+Date.prototype.toUTCString.call(t)),$p(t)&&(c=" "+ax(t)),s.length!==0||d&&t.length!=0?r<0?Dp(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),h=d?function(m,g,v,_,b){for(var E=[],S=0,T=g.length;S<T;++S)pK(g,String(S))?E.push(sx(m,g,v,_,String(S),!0)):E.push("");return b.forEach(function(x){x.match(/^\d+$/)||E.push(sx(m,g,v,_,x,!0))}),E}(e,t,r,i,s):s.map(function(m){return sx(e,t,r,i,m,d)}),e.seen.pop(),function(m,g,v){var _=0;return m.reduce(function(b,E){return _++,E.indexOf(`
144
144
  `)>=0&&_++,b+E.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?v[0]+(g===""?"":g+`
145
145
  `)+" "+m.join(`,
@@ -211,10 +211,10 @@ should equal
211
211
  `," "],i=["{","}","|","\\","^","`"].concat(s),u=["'"].concat(i),h=["%","/","?",";","#"].concat(u),c=["/","?","#"],d=255,y=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=mxe();function E(A,B,P){if(A&&typeof A=="object"&&A instanceof t)return A;var N=new t;return N.parse(A,B,P),N}o(E,"urlParse"),t.prototype.parse=function(A,B,P){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var N=A.indexOf("?"),L=N!==-1&&N<A.indexOf("#")?"?":"#",C=A.split(L),z=/\\/g;C[0]=C[0].replace(z,"/"),A=C.join(L);var V=A;if(V=V.trim(),!P&&A.split("#").length===1){var Q=a.exec(V);if(Q)return this.path=V,this.href=V,this.pathname=Q[1],Q[2]?(this.search=Q[2],B?this.query=b.parse(this.search.substr(1)):this.query=this.search.substr(1)):B&&(this.search="",this.query={}),this}var X=r.exec(V);if(X){X=X[0];var ue=X.toLowerCase();this.protocol=ue,V=V.substr(X.length)}if(P||X||V.match(/^\/\/[^@/]+@[^@/]+/)){var ge=V.substr(0,2)==="//";ge&&!(X&&v[X])&&(V=V.substr(2),this.slashes=!0)}if(!v[X]&&(ge||X&&!_[X])){for(var oe=-1,W=0;W<c.length;W++){var ae=V.indexOf(c[W]);ae!==-1&&(oe===-1||ae<oe)&&(oe=ae)}var U,Y;oe===-1?Y=V.lastIndexOf("@"):Y=V.lastIndexOf("@",oe),Y!==-1&&(U=V.slice(0,Y),V=V.slice(Y+1),this.auth=decodeURIComponent(U)),oe=-1;for(var W=0;W<h.length;W++){var ae=V.indexOf(h[W]);ae!==-1&&(oe===-1||ae<oe)&&(oe=ae)}oe===-1&&(oe=V.length),this.host=V.slice(0,oe),V=V.slice(oe),this.parseHost(),this.hostname=this.hostname||"";var J=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!J)for(var Z=this.hostname.split(/\./),W=0,re=Z.length;W<re;W++){var we=Z[W];if(we&&!we.match(y)){for(var Ae="",D=0,$=we.length;D<$;D++)we.charCodeAt(D)>127?Ae+="x":Ae+=we[D];if(!Ae.match(y)){var q=Z.slice(0,W),ne=Z.slice(W+1),he=we.match(m);he&&(q.push(he[1]),ne.unshift(he[2])),ne.length&&(V="/"+ne.join(".")+V),this.hostname=q.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),J||(this.hostname=e.toASCII(this.hostname));var F=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+F,this.href+=this.host,J&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),V[0]!=="/"&&(V="/"+V))}if(!g[ue])for(var W=0,re=u.length;W<re;W++){var j=u[W];if(V.indexOf(j)!==-1){var te=encodeURIComponent(j);te===j&&(te=escape(j)),V=V.split(j).join(te)}}var be=V.indexOf("#");be!==-1&&(this.hash=V.substr(be),V=V.slice(0,be));var ce=V.indexOf("?");if(ce!==-1?(this.search=V.substr(ce),this.query=V.substr(ce+1),B&&(this.query=b.parse(this.query)),V=V.slice(0,ce)):B&&(this.search="",this.query={}),V&&(this.pathname=V),_[ue]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var F=this.pathname||"",se=this.search||"";this.path=F+se}return this.href=this.format(),this};function S(A){return typeof A=="string"&&(A=E(A)),A instanceof t?A.format():t.prototype.format.call(A)}o(S,"urlFormat"),t.prototype.format=function(){var A=this.auth||"";A&&(A=encodeURIComponent(A),A=A.replace(/%3A/i,":"),A+="@");var B=this.protocol||"",P=this.pathname||"",N=this.hash||"",L=!1,C="";this.host?L=A+this.host:this.hostname&&(L=A+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(L+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(C=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var z=this.search||C&&"?"+C||"";return B&&B.substr(-1)!==":"&&(B+=":"),this.slashes||(!B||_[B])&&L!==!1?(L="//"+(L||""),P&&P.charAt(0)!=="/"&&(P="/"+P)):L||(L=""),N&&N.charAt(0)!=="#"&&(N="#"+N),z&&z.charAt(0)!=="?"&&(z="?"+z),P=P.replace(/[?#]/g,function(V){return encodeURIComponent(V)}),z=z.replace("#","%23"),B+L+P+z+N};function T(A,B){return E(A,!1,!0).resolve(B)}o(T,"urlResolve"),t.prototype.resolve=function(A){return this.resolveObject(E(A,!1,!0)).format()};function x(A,B){return A?E(A,!1,!0).resolveObject(B):B}return o(x,"urlResolveObject"),t.prototype.resolveObject=function(A){if(typeof A=="string"){var B=new t;B.parse(A,!1,!0),A=B}for(var P=new t,N=Object.keys(this),L=0;L<N.length;L++){var C=N[L];P[C]=this[C]}if(P.hash=A.hash,A.href==="")return P.href=P.format(),P;if(A.slashes&&!A.protocol){for(var z=Object.keys(A),V=0;V<z.length;V++){var Q=z[V];Q!=="protocol"&&(P[Q]=A[Q])}return _[P.protocol]&&P.hostname&&!P.pathname&&(P.pathname="/",P.path=P.pathname),P.href=P.format(),P}if(A.protocol&&A.protocol!==P.protocol){if(!_[A.protocol]){for(var X=Object.keys(A),ue=0;ue<X.length;ue++){var ge=X[ue];P[ge]=A[ge]}return P.href=P.format(),P}if(P.protocol=A.protocol,!A.host&&!v[A.protocol]){for(var re=(A.pathname||"").split("/");re.length&&!(A.host=re.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),re[0]!==""&&re.unshift(""),re.length<2&&re.unshift(""),P.pathname=re.join("/")}else P.pathname=A.pathname;if(P.search=A.search,P.query=A.query,P.host=A.host||"",P.auth=A.auth,P.hostname=A.hostname||A.host,P.port=A.port,P.pathname||P.search){var oe=P.pathname||"",W=P.search||"";P.path=oe+W}return P.slashes=P.slashes||A.slashes,P.href=P.format(),P}var ae=P.pathname&&P.pathname.charAt(0)==="/",U=A.host||A.pathname&&A.pathname.charAt(0)==="/",Y=U||ae||P.host&&A.pathname,J=Y,Z=P.pathname&&P.pathname.split("/")||[],re=A.pathname&&A.pathname.split("/")||[],we=P.protocol&&!_[P.protocol];if(we&&(P.hostname="",P.port=null,P.host&&(Z[0]===""?Z[0]=P.host:Z.unshift(P.host)),P.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(re[0]===""?re[0]=A.host:re.unshift(A.host)),A.host=null),Y=Y&&(re[0]===""||Z[0]==="")),U)P.host=A.host||A.host===""?A.host:P.host,P.hostname=A.hostname||A.hostname===""?A.hostname:P.hostname,P.search=A.search,P.query=A.query,Z=re;else if(re.length)Z||(Z=[]),Z.pop(),Z=Z.concat(re),P.search=A.search,P.query=A.query;else if(A.search!=null){if(we){P.host=Z.shift(),P.hostname=P.host;var Ae=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;Ae&&(P.auth=Ae.shift(),P.hostname=Ae.shift(),P.host=P.hostname)}return P.search=A.search,P.query=A.query,(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.href=P.format(),P}if(!Z.length)return P.pathname=null,P.search?P.path="/"+P.search:P.path=null,P.href=P.format(),P;for(var D=Z.slice(-1)[0],$=(P.host||A.host||Z.length>1)&&(D==="."||D==="..")||D==="",q=0,ne=Z.length;ne>=0;ne--)D=Z[ne],D==="."?Z.splice(ne,1):D===".."?(Z.splice(ne,1),q++):q&&(Z.splice(ne,1),q--);if(!Y&&!J)for(;q--;q)Z.unshift("..");Y&&Z[0]!==""&&(!Z[0]||Z[0].charAt(0)!=="/")&&Z.unshift(""),$&&Z.join("/").substr(-1)!=="/"&&Z.push("");var he=Z[0]===""||Z[0]&&Z[0].charAt(0)==="/";if(we){P.hostname=he?"":Z.length?Z.shift():"",P.host=P.hostname;var Ae=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;Ae&&(P.auth=Ae.shift(),P.hostname=Ae.shift(),P.host=P.hostname)}return Y=Y||P.host&&Z.length,Y&&!he&&Z.unshift(""),Z.length>0?P.pathname=Z.join("/"):(P.pathname=null,P.path=null),(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.auth=A.auth||P.auth,P.slashes=P.slashes||A.slashes,P.href=P.format(),P},t.prototype.parseHost=function(){var A=this.host,B=n.exec(A);B&&(B=B[0],B!==":"&&(this.port=B.substr(1)),A=A.substr(0,A.length-B.length)),A&&(this.hostname=A)},Pf.parse=E,Pf.resolve=T,Pf.resolveObject=x,Pf.format=S,Pf.Url=t,Pf}o(gxe,"dew9");var zn=gxe();zn.parse;zn.resolve;zn.resolveObject;zn.format;zn.Url;var wxe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;zn.URL=typeof URL<"u"?URL:null;zn.pathToFileURL=Fxe;zn.fileURLToPath=tY;var F8e=zn.Url,k8e=zn.format,B8e=zn.resolve,C8e=zn.resolveObject,L8e=zn.parse,N8e=zn.URL,vxe=92,bxe=47,_xe=97,Exe=122,$O=wxe==="win32",Sxe=/\//g,Axe=/%/g,Rxe=/\\/g,Txe=/\n/g,xxe=/\r/g,Oxe=/\t/g;function tY(e){if(typeof e=="string")e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(e.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return $O?Ixe(e):Pxe(e)}o(tY,"fileURLToPath2");function Ixe(e){let t=e.hostname,r=e.pathname;for(let n=0;n<r.length;n++)if(r[n]==="%"){let a=r.codePointAt(n+2)||32;if(r[n+1]==="2"&&a===102||r[n+1]==="5"&&a===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(Sxe,"\\"),r=decodeURIComponent(r),t!=="")return`\\\\${t}${r}`;{let n=r.codePointAt(1)|32,a=r[2];if(n<_xe||n>Exe||a!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}o(Ixe,"getPathFromURLWin2");function Pxe(e){if(e.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let r=0;r<t.length;r++)if(t[r]==="%"){let n=t.codePointAt(r+2)||32;if(t[r+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}o(Pxe,"getPathFromURLPosix2");function Fxe(e){let t=vG.resolve(e),r=e.charCodeAt(e.length-1);(r===bxe||$O&&r===vxe)&&t[t.length-1]!==vG.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(Axe,"%25")),!$O&&t.includes("\\")&&(t=t.replace(Rxe,"%5C")),t.includes(`
212
212
  `)&&(t=t.replace(Txe,"%0A")),t.includes("\r")&&(t=t.replace(xxe,"%0D")),t.includes(" ")&&(t=t.replace(Oxe,"%09")),n.pathname=t,n}o(Fxe,"pathToFileURL2");var kp={},OG=!1;function Wp(){return OG||(OG=!0,Object.defineProperty(kp,"__esModule",{value:!0}),kp.constants=void 0,kp.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),kp}o(Wp,"dew$f3");var tv={},IG=!1;function kxe(){return IG||(IG=!0,typeof BigInt=="function"?tv.default=BigInt:tv.default=o(function(){throw new Error("BigInt is not supported in this environment.")},"BigIntNotSupported")),tv}o(kxe,"dew$e3");var Kc={},PG=!1;function QO(){if(PG)return Kc;PG=!0,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.Stats=void 0;var e=Wp(),t=kxe(),r=e.constants.S_IFMT,n=e.constants.S_IFDIR,a=e.constants.S_IFREG,s=e.constants.S_IFBLK,i=e.constants.S_IFCHR,u=e.constants.S_IFLNK,h=e.constants.S_IFIFO,c=e.constants.S_IFSOCK,d=function(){function y(){}return o(y,"Stats3"),y.build=function(m,g){g===void 0&&(g=!1);var v=new y,_=m.uid,b=m.gid,E=m.atime,S=m.mtime,T=m.ctime,x=g?t.default:function(B){return B};v.uid=x(_),v.gid=x(b),v.rdev=x(0),v.blksize=x(4096),v.ino=x(m.ino),v.size=x(m.getSize()),v.blocks=x(1),v.atime=E,v.mtime=S,v.ctime=T,v.birthtime=T,v.atimeMs=x(E.getTime()),v.mtimeMs=x(S.getTime());var A=x(T.getTime());return v.ctimeMs=A,v.birthtimeMs=A,v.dev=x(0),v.mode=x(m.mode),v.nlink=x(m.nlink),v},y.prototype._checkModeProperty=function(m){return(Number(this.mode)&r)===m},y.prototype.isDirectory=function(){return this._checkModeProperty(n)},y.prototype.isFile=function(){return this._checkModeProperty(a)},y.prototype.isBlockDevice=function(){return this._checkModeProperty(s)},y.prototype.isCharacterDevice=function(){return this._checkModeProperty(i)},y.prototype.isSymbolicLink=function(){return this._checkModeProperty(u)},y.prototype.isFIFO=function(){return this._checkModeProperty(h)},y.prototype.isSocket=function(){return this._checkModeProperty(c)},y}();return Kc.Stats=d,Kc.default=d,Kc}o(QO,"dew$d3");var Zi={},FG=!1;function eI(){if(FG)return Zi;FG=!0;var e=Zi&&Zi.__spreadArray||function(s,i,u){if(u||arguments.length===2)for(var h=0,c=i.length,d;h<c;h++)(d||!(h in i))&&(d||(d=Array.prototype.slice.call(i,0,h)),d[h]=i[h]);return s.concat(d||Array.prototype.slice.call(i))};Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.bufferFrom=Zi.bufferAllocUnsafe=Zi.Buffer=void 0;var t=zG();Object.defineProperty(Zi,"Buffer",{enumerable:!0,get:o(function(){return t.Buffer},"get")});function r(s){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];return new(t.Buffer.bind.apply(t.Buffer,e([void 0,s],i,!1)))}o(r,"bufferV0P12Ponyfill");var n=t.Buffer.allocUnsafe||r;Zi.bufferAllocUnsafe=n;var a=t.Buffer.from||r;return Zi.bufferFrom=a,Zi}o(eI,"dew$c3");var Cr={},kG=!1,Bxe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;function rY(){if(kG)return Cr;kG=!0;var e=Cr&&Cr.__extends||function(){var v=o(function(_,b){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,S){E.__proto__=S}||function(E,S){for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(E[T]=S[T])},v(_,b)},"extendStatics");return function(_,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");v(_,b);function E(){this.constructor=_}o(E,"__"),_.prototype=b===null?Object.create(b):(E.prototype=b.prototype,new E)}}();Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.E=Cr.AssertionError=Cr.message=Cr.RangeError=Cr.TypeError=Cr.Error=void 0;var t=Qe,r=Fe,n=typeof Symbol>"u"?"_kCode":Symbol("code"),a={};function s(v){return function(_){e(b,_);function b(E){for(var S=[],T=1;T<arguments.length;T++)S[T-1]=arguments[T];var x=_.call(this,h(E,S))||this;return x.code=E,x[n]=E,x.name="".concat(_.prototype.name," [").concat(x[n],"]"),x}return o(b,"NodeError"),b}(v)}o(s,"makeNodeError");var i=typeof globalThis<"u"?globalThis:Bxe,u=function(v){e(_,v);function _(b){var E=this;if(typeof b!="object"||b===null)throw new Cr.TypeError("ERR_INVALID_ARG_TYPE","options","object");return b.message?E=v.call(this,b.message)||this:E=v.call(this,"".concat(r.inspect(b.actual).slice(0,128)," ")+"".concat(b.operator," ").concat(r.inspect(b.expected).slice(0,128)))||this,E.generatedMessage=!b.message,E.name="AssertionError [ERR_ASSERTION]",E.code="ERR_ASSERTION",E.actual=b.actual,E.expected=b.expected,E.operator=b.operator,Cr.Error.captureStackTrace(E,b.stackStartFunction),E}return o(_,"AssertionError2"),_}(i.Error);Cr.AssertionError=u;function h(v,_){t.strictEqual(typeof v,"string");var b=a[v];t(b,"An invalid error message key was used: ".concat(v,"."));var E;if(typeof b=="function")E=b;else{if(E=r.format,_===void 0||_.length===0)return b;_.unshift(b)}return String(E.apply(null,_))}o(h,"message"),Cr.message=h;function c(v,_){a[v]=typeof _=="function"?_:String(_)}o(c,"E4"),Cr.E=c,Cr.Error=s(i.Error),Cr.TypeError=s(i.TypeError),Cr.RangeError=s(i.RangeError),c("ERR_ARG_NOT_ITERABLE","%s must be iterable"),c("ERR_ASSERTION","%s"),c("ERR_BUFFER_OUT_OF_BOUNDS",g),c("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),c("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),c("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),c("ERR_DNS_SET_SERVERS_FAILED",function(v,_){return'c-ares failed to set servers: "'.concat(v,'" [').concat(_,"]")}),c("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),c("ERR_ENCODING_NOT_SUPPORTED",function(v){return'The "'.concat(v,'" encoding is not supported')}),c("ERR_ENCODING_INVALID_ENCODED_DATA",function(v){return"The encoded data was not valid for encoding ".concat(v)}),c("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),c("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),c("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),c("ERR_INDEX_OUT_OF_RANGE","Index out of range"),c("ERR_INVALID_ARG_TYPE",d),c("ERR_INVALID_ARRAY_LENGTH",function(v,_,b){return t.strictEqual(typeof b,"number"),'The array "'.concat(v,'" (length ').concat(b,") must be of length ").concat(_,".")}),c("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),c("ERR_INVALID_CALLBACK","Callback must be a function"),c("ERR_INVALID_CHAR","Invalid character in %s"),c("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),c("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),c("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),c("ERR_INVALID_FILE_URL_PATH","File URL path %s"),c("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),c("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),c("ERR_INVALID_OPT_VALUE",function(v,_){return'The value "'.concat(String(_),'" is invalid for option "').concat(v,'"')}),c("ERR_INVALID_OPT_VALUE_ENCODING",function(v){return'The value "'.concat(String(v),'" is invalid for option "encoding"')}),c("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),c("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),c("ERR_INVALID_THIS",'Value of "this" must be of type %s'),c("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),c("ERR_INVALID_URL","Invalid URL: %s"),c("ERR_INVALID_URL_SCHEME",function(v){return"The URL must be ".concat(m(v,"scheme"))}),c("ERR_IPC_CHANNEL_CLOSED","Channel closed"),c("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),c("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),c("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),c("ERR_MISSING_ARGS",y),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),c("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),c("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),c("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),c("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),c("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),c("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),c("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),c("ERR_SOCKET_CANNOT_SEND","Unable to send data"),c("ERR_SOCKET_CLOSED","Socket is closed"),c("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),c("ERR_STDERR_CLOSE","process.stderr cannot be closed"),c("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),c("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),c("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),c("ERR_TLS_DH_PARAM_SIZE",function(v){return"DH parameter size ".concat(v," is less than 2048")}),c("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),c("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),c("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),c("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),c("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),c("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),c("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),c("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),c("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),c("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),c("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function d(v,_,b){t(v,"name is required");var E;_.includes("not ")?(E="must not be",_=_.split("not ")[1]):E="must be";var S;if(Array.isArray(v)){var T=v.map(function(A){return'"'.concat(A,'"')}).join(", ");S="The ".concat(T," arguments ").concat(E," ").concat(m(_,"type"))}else if(v.includes(" argument"))S="The ".concat(v," ").concat(E," ").concat(m(_,"type"));else{var x=v.includes(".")?"property":"argument";S='The "'.concat(v,'" ').concat(x," ").concat(E," ").concat(m(_,"type"))}return arguments.length>=3&&(S+=". Received type ".concat(b!==null?typeof b:"null")),S}o(d,"invalidArgType");function y(){for(var v=[],_=0;_<arguments.length;_++)v[_]=arguments[_];t(v.length>0,"At least one arg needs to be specified");var b="The ",E=v.length;switch(v=v.map(function(S){return'"'.concat(S,'"')}),E){case 1:b+="".concat(v[0]," argument");break;case 2:b+="".concat(v[0]," and ").concat(v[1]," arguments");break;default:b+=v.slice(0,E-1).join(", "),b+=", and ".concat(v[E-1]," arguments");break}return"".concat(b," must be specified")}o(y,"missingArgs");function m(v,_){if(t(v,"expected is required"),t(typeof _=="string","thing is required"),Array.isArray(v)){var b=v.length;return t(b>0,"At least one expected value needs to be specified"),v=v.map(function(E){return String(E)}),b>2?"one of ".concat(_," ").concat(v.slice(0,b-1).join(", "),", or ")+v[b-1]:b===2?"one of ".concat(_," ").concat(v[0]," or ").concat(v[1]):"of ".concat(_," ").concat(v[0])}else return"of ".concat(_," ").concat(String(v))}o(m,"oneOf");function g(v,_){return _?"Attempt to write outside buffer bounds":'"'.concat(v,'" is outside of buffer bounds')}return o(g,"bufferOutOfBounds"),Cr}o(rY,"dew$b3");var No={},BG=!1;function nY(){if(BG)return No;BG=!0,Object.defineProperty(No,"__esModule",{value:!0}),No.strToEncoding=No.assertEncoding=No.ENCODING_UTF8=void 0;var e=eI(),t=rY();No.ENCODING_UTF8="utf8";function r(a){if(a&&!e.Buffer.isEncoding(a))throw new t.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",a)}o(r,"assertEncoding"),No.assertEncoding=r;function n(a,s){return!s||s===No.ENCODING_UTF8?a:s==="buffer"?new e.Buffer(a):new e.Buffer(a).toString(s)}return o(n,"strToEncoding"),No.strToEncoding=n,No}o(nY,"dew$a3");var Yc={},CG=!1;function iY(){if(CG)return Yc;CG=!0,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.Dirent=void 0;var e=Wp(),t=nY(),r=e.constants.S_IFMT,n=e.constants.S_IFDIR,a=e.constants.S_IFREG,s=e.constants.S_IFBLK,i=e.constants.S_IFCHR,u=e.constants.S_IFLNK,h=e.constants.S_IFIFO,c=e.constants.S_IFSOCK,d=function(){function y(){this.name="",this.mode=0}return o(y,"Dirent3"),y.build=function(m,g){var v=new y,_=m.getNode().mode;return v.name=(0,t.strToEncoding)(m.getName(),g),v.mode=_,v},y.prototype._checkModeProperty=function(m){return(this.mode&r)===m},y.prototype.isDirectory=function(){return this._checkModeProperty(n)},y.prototype.isFile=function(){return this._checkModeProperty(a)},y.prototype.isBlockDevice=function(){return this._checkModeProperty(s)},y.prototype.isCharacterDevice=function(){return this._checkModeProperty(i)},y.prototype.isSymbolicLink=function(){return this._checkModeProperty(u)},y.prototype.isFIFO=function(){return this._checkModeProperty(h)},y.prototype.isSocket=function(){return this._checkModeProperty(c)},y}();return Yc.Dirent=d,Yc.default=d,Yc}o(iY,"dew$93");Vr._makeLong;Vr.basename;Vr.delimiter;Vr.dirname;Vr.extname;Vr.format;Vr.isAbsolute;Vr.join;Vr.normalize;Vr.parse;Vr.posix;Vr.relative;Vr.resolve;Vr.sep;Vr.win32;var rv={},LG=!1,NG=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;function oY(){if(LG)return rv;LG=!0;var e=nh;Object.defineProperty(rv,"__esModule",{value:!0});var t;return typeof e.nextTick=="function"?t=e.nextTick.bind(typeof globalThis<"u"?globalThis:NG):t=setTimeout.bind(typeof globalThis<"u"?globalThis:NG),rv.default=t,rv}o(oY,"dew$83");var Zc={},DG=!1;function aY(){if(DG)return Zc;DG=!0;var e=nh;Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.createProcess=void 0;var t=o(function(){if(typeof e<"u")return e;try{return nh}catch{return}},"maybeReturnProcess");function r(){var n=t()||{};return n.cwd||(n.cwd=function(){return"/"}),n.nextTick||(n.nextTick=oY().default),n.emitWarning||(n.emitWarning=function(a,s){console.warn("".concat(s).concat(s?": ":"").concat(a))}),n.env||(n.env={}),n}return o(r,"createProcess"),Zc.createProcess=r,Zc.default=r(),Zc}o(aY,"dew$74");var qn={},$G=!1;function Cxe(){if($G)return qn;$G=!0;var e=qn&&qn.__extends||function(){var b=o(function(E,S){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,x){T.__proto__=x}||function(T,x){for(var A in x)Object.prototype.hasOwnProperty.call(x,A)&&(T[A]=x[A])},b(E,S)},"extendStatics");return function(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");b(E,S);function T(){this.constructor=E}o(T,"__"),E.prototype=S===null?Object.create(S):(T.prototype=S.prototype,new T)}}();Object.defineProperty(qn,"__esModule",{value:!0}),qn.File=qn.Link=qn.Node=qn.SEP=void 0;var t=aY(),r=eI(),n=Wp(),a=Rn,s=QO(),i=n.constants.S_IFMT,u=n.constants.S_IFDIR,h=n.constants.S_IFREG,c=n.constants.S_IFLNK,d=n.constants.O_APPEND,y=o(function(){var b,E;return(E=(b=t.default.getuid)===null||b===void 0?void 0:b.call(t.default))!==null&&E!==void 0?E:0},"getuid"),m=o(function(){var b,E;return(E=(b=t.default.getgid)===null||b===void 0?void 0:b.call(t.default))!==null&&E!==void 0?E:0},"getgid");qn.SEP="/";var g=function(b){e(E,b);function E(S,T){T===void 0&&(T=438);var x=b.call(this)||this;return x._uid=y(),x._gid=m(),x._atime=new Date,x._mtime=new Date,x._ctime=new Date,x._perm=438,x.mode=h,x._nlink=1,x._perm=T,x.mode|=T,x.ino=S,x}return o(E,"Node2"),Object.defineProperty(E.prototype,"ctime",{get:o(function(){return this._ctime},"get"),set:o(function(S){this._ctime=S},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"uid",{get:o(function(){return this._uid},"get"),set:o(function(S){this._uid=S,this.ctime=new Date},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"gid",{get:o(function(){return this._gid},"get"),set:o(function(S){this._gid=S,this.ctime=new Date},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"atime",{get:o(function(){return this._atime},"get"),set:o(function(S){this._atime=S,this.ctime=new Date},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"mtime",{get:o(function(){return this._mtime},"get"),set:o(function(S){this._mtime=S,this.ctime=new Date},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"perm",{get:o(function(){return this._perm},"get"),set:o(function(S){this._perm=S,this.ctime=new Date},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"nlink",{get:o(function(){return this._nlink},"get"),set:o(function(S){this._nlink=S,this.ctime=new Date},"set"),enumerable:!1,configurable:!0}),E.prototype.getString=function(S){return S===void 0&&(S="utf8"),this.atime=new Date,this.getBuffer().toString(S)},E.prototype.setString=function(S){this.buf=(0,r.bufferFrom)(S,"utf8"),this.touch()},E.prototype.getBuffer=function(){return this.atime=new Date,this.buf||this.setBuffer((0,r.bufferAllocUnsafe)(0)),(0,r.bufferFrom)(this.buf)},E.prototype.setBuffer=function(S){this.buf=(0,r.bufferFrom)(S),this.touch()},E.prototype.getSize=function(){return this.buf?this.buf.length:0},E.prototype.setModeProperty=function(S){this.mode=this.mode&~i|S},E.prototype.setIsFile=function(){this.setModeProperty(h)},E.prototype.setIsDirectory=function(){this.setModeProperty(u)},E.prototype.setIsSymlink=function(){this.setModeProperty(c)},E.prototype.isFile=function(){return(this.mode&i)===h},E.prototype.isDirectory=function(){return(this.mode&i)===u},E.prototype.isSymlink=function(){return(this.mode&i)===c},E.prototype.makeSymlink=function(S){this.symlink=S,this.setIsSymlink()},E.prototype.write=function(S,T,x,A){if(T===void 0&&(T=0),x===void 0&&(x=S.length),A===void 0&&(A=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),A+x>this.buf.length){var B=(0,r.bufferAllocUnsafe)(A+x);this.buf.copy(B,0,0,this.buf.length),this.buf=B}return S.copy(this.buf,A,T,T+x),this.touch(),x},E.prototype.read=function(S,T,x,A){T===void 0&&(T=0),x===void 0&&(x=S.byteLength),A===void 0&&(A=0),this.atime=new Date,this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0));var B=x;return B>S.byteLength&&(B=S.byteLength),B+A>this.buf.length&&(B=this.buf.length-A),this.buf.copy(S,T,A,A+B),B},E.prototype.truncate=function(S){if(S===void 0&&(S=0),!S)this.buf=(0,r.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),S<=this.buf.length)this.buf=this.buf.slice(0,S);else{var T=(0,r.bufferAllocUnsafe)(S);this.buf.copy(T),T.fill(0,this.buf.length),this.buf=T}this.touch()},E.prototype.chmod=function(S){this.perm=S,this.mode=this.mode&-512|S,this.touch()},E.prototype.chown=function(S,T){this.uid=S,this.gid=T,this.touch()},E.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},E.prototype.canRead=function(S,T){return S===void 0&&(S=y()),T===void 0&&(T=m()),!!(this.perm&4||T===this.gid&&this.perm&32||S===this.uid&&this.perm&256)},E.prototype.canWrite=function(S,T){return S===void 0&&(S=y()),T===void 0&&(T=m()),!!(this.perm&2||T===this.gid&&this.perm&16||S===this.uid&&this.perm&128)},E.prototype.del=function(){this.emit("delete",this)},E.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},E}(a.EventEmitter);qn.Node=g;var v=function(b){e(E,b);function E(S,T,x){var A=b.call(this)||this;return A.children={},A._steps=[],A.ino=0,A.length=0,A.vol=S,A.parent=T,A.name=x,A.syncSteps(),A}return o(E,"Link2"),Object.defineProperty(E.prototype,"steps",{get:o(function(){return this._steps},"get"),set:o(function(S){this._steps=S;for(var T=0,x=Object.entries(this.children);T<x.length;T++){var A=x[T],B=A[0],P=A[1];B==="."||B===".."||P?.syncSteps()}},"set"),enumerable:!1,configurable:!0}),E.prototype.setNode=function(S){this.node=S,this.ino=S.ino},E.prototype.getNode=function(){return this.node},E.prototype.createChild=function(S,T){T===void 0&&(T=this.vol.createNode());var x=new E(this.vol,this,S);return x.setNode(T),T.isDirectory()&&(x.children["."]=x,x.getNode().nlink++),this.setChild(S,x),x},E.prototype.setChild=function(S,T){T===void 0&&(T=new E(this.vol,this,S)),this.children[S]=T,T.parent=this,this.length++;var x=T.getNode();return x.isDirectory()&&(T.children[".."]=this,this.getNode().nlink++),this.getNode().mtime=new Date,this.emit("child:add",T,this),T},E.prototype.deleteChild=function(S){var T=S.getNode();T.isDirectory()&&(delete S.children[".."],this.getNode().nlink--),delete this.children[S.getName()],this.length--,this.getNode().mtime=new Date,this.emit("child:delete",S,this)},E.prototype.getChild=function(S){if(this.getNode().mtime=new Date,Object.hasOwnProperty.call(this.children,S))return this.children[S]},E.prototype.getPath=function(){return this.steps.join(qn.SEP)},E.prototype.getName=function(){return this.steps[this.steps.length-1]},E.prototype.walk=function(S,T,x){if(T===void 0&&(T=S.length),x===void 0&&(x=0),x>=S.length)return this;if(x>=T)return this;var A=S[x],B=this.getChild(A);return B?B.walk(S,T,x+1):null},E.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},E.prototype.syncSteps=function(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]},E}(a.EventEmitter);qn.Link=v;var _=function(){function b(E,S,T,x){this.position=0,this.link=E,this.node=S,this.flags=T,this.fd=x}return o(b,"File2"),b.prototype.getString=function(E){return this.node.getString()},b.prototype.setString=function(E){this.node.setString(E)},b.prototype.getBuffer=function(){return this.node.getBuffer()},b.prototype.setBuffer=function(E){this.node.setBuffer(E)},b.prototype.getSize=function(){return this.node.getSize()},b.prototype.truncate=function(E){this.node.truncate(E)},b.prototype.seekTo=function(E){this.position=E},b.prototype.stats=function(){return s.default.build(this.node)},b.prototype.write=function(E,S,T,x){S===void 0&&(S=0),T===void 0&&(T=E.length),typeof x!="number"&&(x=this.position),this.flags&d&&(x=this.getSize());var A=this.node.write(E,S,T,x);return this.position=x+A,A},b.prototype.read=function(E,S,T,x){S===void 0&&(S=0),T===void 0&&(T=E.byteLength),typeof x!="number"&&(x=this.position);var A=this.node.read(E,S,T,x);return this.position=x+A,A},b.prototype.chmod=function(E){this.node.chmod(E)},b.prototype.chown=function(E,S){this.node.chown(E,S)},b}();return qn.File=_,qn}o(Cxe,"dew$64");var nv={},UG=!1,Lxe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;function Nxe(){if(UG)return nv;UG=!0,Object.defineProperty(nv,"__esModule",{value:!0});function e(t,r,n){var a=setTimeout.apply(typeof globalThis<"u"?globalThis:Lxe,arguments);return a&&typeof a=="object"&&typeof a.unref=="function"&&a.unref(),a}return o(e,"setTimeoutUnref"),nv.default=e,nv}o(Nxe,"dew$54");var Ks={},MG=!1;function Dxe(){if(MG)return Ks;MG=!0;var e=Ks&&Ks.__spreadArray||function(a,s,i){if(i||arguments.length===2)for(var u=0,h=s.length,c;u<h;u++)(c||!(u in s))&&(c||(c=Array.prototype.slice.call(s,0,u)),c[u]=s[u]);return a.concat(c||Array.prototype.slice.call(s))};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.FileHandle=void 0;function t(a,s,i){return i===void 0&&(i=o(function(u){return u},"getResult")),function(){for(var u=[],h=0;h<arguments.length;h++)u[h]=arguments[h];return new Promise(function(c,d){a[s].bind(a).apply(void 0,e(e([],u,!1),[function(y,m){return y?d(y):c(i(m))}],!1))})}}o(t,"promisify3");var r=function(){function a(s,i){this.vol=s,this.fd=i}return o(a,"FileHandle2"),a.prototype.appendFile=function(s,i){return t(this.vol,"appendFile")(this.fd,s,i)},a.prototype.chmod=function(s){return t(this.vol,"fchmod")(this.fd,s)},a.prototype.chown=function(s,i){return t(this.vol,"fchown")(this.fd,s,i)},a.prototype.close=function(){return t(this.vol,"close")(this.fd)},a.prototype.datasync=function(){return t(this.vol,"fdatasync")(this.fd)},a.prototype.read=function(s,i,u,h){return t(this.vol,"read",function(c){return{bytesRead:c,buffer:s}})(this.fd,s,i,u,h)},a.prototype.readFile=function(s){return t(this.vol,"readFile")(this.fd,s)},a.prototype.stat=function(s){return t(this.vol,"fstat")(this.fd,s)},a.prototype.sync=function(){return t(this.vol,"fsync")(this.fd)},a.prototype.truncate=function(s){return t(this.vol,"ftruncate")(this.fd,s)},a.prototype.utimes=function(s,i){return t(this.vol,"futimes")(this.fd,s,i)},a.prototype.write=function(s,i,u,h){return t(this.vol,"write",function(c){return{bytesWritten:c,buffer:s}})(this.fd,s,i,u,h)},a.prototype.writeFile=function(s,i){return t(this.vol,"writeFile")(this.fd,s,i)},a}();Ks.FileHandle=r;function n(a){return typeof Promise>"u"?null:{FileHandle:r,access:o(function(s,i){return t(a,"access")(s,i)},"access"),appendFile:o(function(s,i,u){return t(a,"appendFile")(s instanceof r?s.fd:s,i,u)},"appendFile"),chmod:o(function(s,i){return t(a,"chmod")(s,i)},"chmod"),chown:o(function(s,i,u){return t(a,"chown")(s,i,u)},"chown"),copyFile:o(function(s,i,u){return t(a,"copyFile")(s,i,u)},"copyFile"),lchmod:o(function(s,i){return t(a,"lchmod")(s,i)},"lchmod"),lchown:o(function(s,i,u){return t(a,"lchown")(s,i,u)},"lchown"),link:o(function(s,i){return t(a,"link")(s,i)},"link"),lstat:o(function(s,i){return t(a,"lstat")(s,i)},"lstat"),mkdir:o(function(s,i){return t(a,"mkdir")(s,i)},"mkdir"),mkdtemp:o(function(s,i){return t(a,"mkdtemp")(s,i)},"mkdtemp"),open:o(function(s,i,u){return t(a,"open",function(h){return new r(a,h)})(s,i,u)},"open"),readdir:o(function(s,i){return t(a,"readdir")(s,i)},"readdir"),readFile:o(function(s,i){return t(a,"readFile")(s instanceof r?s.fd:s,i)},"readFile"),readlink:o(function(s,i){return t(a,"readlink")(s,i)},"readlink"),realpath:o(function(s,i){return t(a,"realpath")(s,i)},"realpath"),rename:o(function(s,i){return t(a,"rename")(s,i)},"rename"),rmdir:o(function(s){return t(a,"rmdir")(s)},"rmdir"),rm:o(function(s,i){return t(a,"rm")(s,i)},"rm"),stat:o(function(s,i){return t(a,"stat")(s,i)},"stat"),symlink:o(function(s,i,u){return t(a,"symlink")(s,i,u)},"symlink"),truncate:o(function(s,i){return t(a,"truncate")(s,i)},"truncate"),unlink:o(function(s){return t(a,"unlink")(s)},"unlink"),utimes:o(function(s,i,u){return t(a,"utimes")(s,i,u)},"utimes"),writeFile:o(function(s,i,u){return t(a,"writeFile")(s instanceof r?s.fd:s,i,u)},"writeFile")}}return o(n,"createPromisesApi"),Ks.default=n,Ks}o(Dxe,"dew$44");var Bp={},jG=!1;function $xe(){if(jG)return Bp;jG=!0;var e=nh;Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.correctPath=i,Bp.unixify=s;var t=e.platform==="win32";function r(u){var h=u.length-1;if(h<2)return u;for(;n(u,h);)h--;return u.substr(0,h+1)}o(r,"removeTrailingSeparator");function n(u,h){var c=u[h];return h>0&&(c==="/"||t&&c==="\\")}o(n,"isSeparator");function a(u,h){if(typeof u!="string")throw new TypeError("expected a string");return u=u.replace(/[\\\/]+/g,"/"),h!==!1&&(u=r(u)),u}o(a,"normalizePath");function s(u){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t?(u=a(u,h),u.replace(/^([a-zA-Z]+:|\.\/)/,"")):u}o(s,"unixify");function i(u){return s(u.replace(/^\\\\\?\\.:\\/,"\\"))}return o(i,"correctPath"),Bp}o($xe,"dew$34");var wt={},WG=!1,Uxe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:globalThis;function sY(){if(WG)return wt;WG=!0;var e=wt&&wt.__extends||function(){var ie=o(function(H,G){return ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ee,le){ee.__proto__=le}||function(ee,le){for(var _e in le)Object.prototype.hasOwnProperty.call(le,_e)&&(ee[_e]=le[_e])},ie(H,G)},"extendStatics");return function(H,G){if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");ie(H,G);function ee(){this.constructor=H}o(ee,"__"),H.prototype=G===null?Object.create(G):(ee.prototype=G.prototype,new ee)}}(),t=wt&&wt.__spreadArray||function(ie,H,G){if(G||arguments.length===2)for(var ee=0,le=H.length,_e;ee<le;ee++)(_e||!(ee in H))&&(_e||(_e=Array.prototype.slice.call(H,0,ee)),_e[ee]=H[ee]);return ie.concat(_e||Array.prototype.slice.call(H))};Object.defineProperty(wt,"__esModule",{value:!0}),wt.FSWatcher=wt.StatWatcher=wt.Volume=wt.toUnixTimestamp=wt.bufferToEncoding=wt.dataToBuffer=wt.dataToStr=wt.pathToSteps=wt.filenameToSteps=wt.pathToFilename=wt.flagsToNumber=wt.FLAGS=void 0;var r=Vr,n=Cxe(),a=QO(),s=iY(),i=eI(),u=oY(),h=aY(),c=Nxe(),d=Qi,y=Wp(),m=Rn,g=nY(),v=rY(),_=Fe,b=Dxe(),E=r.resolve,S=y.constants.O_RDONLY,T=y.constants.O_WRONLY,x=y.constants.O_RDWR,A=y.constants.O_CREAT,B=y.constants.O_EXCL,P=y.constants.O_TRUNC,N=y.constants.O_APPEND,L=y.constants.O_SYNC,C=y.constants.O_DIRECTORY,z=y.constants.F_OK,V=y.constants.COPYFILE_EXCL,Q=y.constants.COPYFILE_FICLONE_FORCE,X=r.posix?r.posix:r,ue=X.sep,ge=X.relative,oe=X.join,W=X.dirname,ae=h.default.platform==="win32",U=128,Y={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},J=o(function(ie){return"Expected options to be either an object or a string, but got ".concat(ie," instead")},"ERRSTR_OPTS"),Z="ENOENT",re="EBADF",we="EINVAL",Ae="EPERM",D="EPROTO",$="EEXIST",q="ENOTDIR",ne="EMFILE",he="EACCES",F="EISDIR",I="ENOTEMPTY",j="ENOSYS",te="ERR_FS_EISDIR";function be(ie,H,G,ee){H===void 0&&(H=""),G===void 0&&(G=""),ee===void 0&&(ee="");var le="";switch(G&&(le=" '".concat(G,"'")),ee&&(le+=" -> '".concat(ee,"'")),ie){case Z:return"ENOENT: no such file or directory, ".concat(H).concat(le);case re:return"EBADF: bad file descriptor, ".concat(H).concat(le);case we:return"EINVAL: invalid argument, ".concat(H).concat(le);case Ae:return"EPERM: operation not permitted, ".concat(H).concat(le);case D:return"EPROTO: protocol error, ".concat(H).concat(le);case $:return"EEXIST: file already exists, ".concat(H).concat(le);case q:return"ENOTDIR: not a directory, ".concat(H).concat(le);case F:return"EISDIR: illegal operation on a directory, ".concat(H).concat(le);case he:return"EACCES: permission denied, ".concat(H).concat(le);case I:return"ENOTEMPTY: directory not empty, ".concat(H).concat(le);case ne:return"EMFILE: too many open files, ".concat(H).concat(le);case j:return"ENOSYS: function not implemented, ".concat(H).concat(le);case te:return"[ERR_FS_EISDIR]: Path is a directory: ".concat(H," returned EISDIR (is a directory) ").concat(G);default:return"".concat(ie,": error occurred, ").concat(H).concat(le)}}o(be,"formatError");function ce(ie,H,G,ee,le){H===void 0&&(H=""),G===void 0&&(G=""),ee===void 0&&(ee=""),le===void 0&&(le=Error);var _e=new le(be(ie,H,G,ee));return _e.code=ie,G&&(_e.path=G),_e}o(ce,"createError");var se;(function(ie){ie[ie.r=S]="r",ie[ie["r+"]=x]="r+",ie[ie.rs=S|L]="rs",ie[ie.sr=ie.rs]="sr",ie[ie["rs+"]=x|L]="rs+",ie[ie["sr+"]=ie["rs+"]]="sr+",ie[ie.w=T|A|P]="w",ie[ie.wx=T|A|P|B]="wx",ie[ie.xw=ie.wx]="xw",ie[ie["w+"]=x|A|P]="w+",ie[ie["wx+"]=x|A|P|B]="wx+",ie[ie["xw+"]=ie["wx+"]]="xw+",ie[ie.a=T|N|A]="a",ie[ie.ax=T|N|A|B]="ax",ie[ie.xa=ie.ax]="xa",ie[ie["a+"]=x|N|A]="a+",ie[ie["ax+"]=x|N|A|B]="ax+",ie[ie["xa+"]=ie["ax+"]]="xa+"})(se=wt.FLAGS||(wt.FLAGS={}));function de(ie){if(typeof ie=="number")return ie;if(typeof ie=="string"){var H=se[ie];if(typeof H<"u")return H}throw new v.TypeError("ERR_INVALID_OPT_VALUE","flags",ie)}o(de,"flagsToNumber"),wt.flagsToNumber=de;function Re(ie,H){var G;if(H){var ee=typeof H;switch(ee){case"string":G=Object.assign({},ie,{encoding:H});break;case"object":G=Object.assign({},ie,H);break;default:throw TypeError(J(ee))}}else return ie;return G.encoding!=="buffer"&&(0,g.assertEncoding)(G.encoding),G}o(Re,"getOptions");function Ee(ie){return function(H){return Re(ie,H)}}o(Ee,"optsGenerator");function Te(ie){if(typeof ie!="function")throw TypeError(Y.CB);return ie}o(Te,"validateCallback");function Ge(ie){return function(H,G){return typeof H=="function"?[ie(),H]:[ie(H),Te(G)]}}o(Ge,"optsAndCbGenerator");var Le={encoding:"utf8"},et=Ee(Le),p=Ge(et),l={flag:"r"},f=Ee(l),w={encoding:"utf8",mode:438,flag:se[se.w]},R=Ee(w),O={encoding:"utf8",mode:438,flag:se[se.a]},k=Ee(O),M=Ge(k),K=Le,me=Ee(K),ve=Ge(me),ye={mode:511,recursive:!1},We=o(function(ie){return typeof ie=="number"?Object.assign({},ye,{mode:ie}):Object.assign({},ye,ie)},"getMkdirOptions"),lr={recursive:!1},Ar=o(function(ie){return Object.assign({},lr,ie)},"getRmdirOptions"),vt=Ee(Le),Jt=Ge(vt),Di={encoding:"utf8",withFileTypes:!1},Nr=Ee(Di),Tt=Ge(Nr),to={bigint:!1},fe=o(function(ie){return ie===void 0&&(ie={}),Object.assign({},to,ie)},"getStatOptions"),pe=o(function(ie,H){return typeof ie=="function"?[fe(),ie]:[fe(ie),Te(H)]},"getStatOptsAndCb");function Me(ie){if(ie.hostname!=="")throw new v.TypeError("ERR_INVALID_FILE_URL_HOST",h.default.platform);for(var H=ie.pathname,G=0;G<H.length;G++)if(H[G]==="%"){var ee=H.codePointAt(G+2)|32;if(H[G+1]==="2"&&ee===102)throw new v.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(H)}o(Me,"getPathFromURLPosix3");function Ie(ie){if(typeof ie!="string"&&!i.Buffer.isBuffer(ie)){try{if(!(ie instanceof Dt.URL))throw new TypeError(Y.PATH_STR)}catch{throw new TypeError(Y.PATH_STR)}ie=Me(ie)}var H=String(ie);return di(H),H}o(Ie,"pathToFilename"),wt.pathToFilename=Ie;var He=o(function(ie,H){return H===void 0&&(H=h.default.cwd()),E(H,ie)},"resolve2");if(ae){var $t=He,fr=$xe().unixify;He=o(function(ie,H){return fr($t(ie,H))},"resolve2")}function xt(ie,H){var G=He(ie,H),ee=G.substring(1);return ee?ee.split(ue):[]}o(xt,"filenameToSteps"),wt.filenameToSteps=xt;function dn(ie){return xt(Ie(ie))}o(dn,"pathToSteps"),wt.pathToSteps=dn;function hi(ie,H){return H===void 0&&(H=g.ENCODING_UTF8),i.Buffer.isBuffer(ie)?ie.toString(H):ie instanceof Uint8Array?(0,i.bufferFrom)(ie).toString(H):String(ie)}o(hi,"dataToStr"),wt.dataToStr=hi;function Vn(ie,H){return H===void 0&&(H=g.ENCODING_UTF8),i.Buffer.isBuffer(ie)?ie:ie instanceof Uint8Array?(0,i.bufferFrom)(ie):(0,i.bufferFrom)(String(ie),H)}o(Vn,"dataToBuffer"),wt.dataToBuffer=Vn;function Gn(ie,H){return!H||H==="buffer"?ie:ie.toString(H)}o(Gn,"bufferToEncoding"),wt.bufferToEncoding=Gn;function di(ie,H){if((""+ie).indexOf("\0")!==-1){var G=new Error("Path must be a string without null bytes");throw G.code=Z,G}return!0}o(di,"nullCheck");function jo(ie,H){if(typeof ie=="number")return ie;if(typeof ie=="string")return parseInt(ie,8);if(H)return Mt(H)}o(jo,"_modeToNumber");function Mt(ie,H){var G=jo(ie,H);if(typeof G!="number"||isNaN(G))throw new TypeError(Y.MODE_INT);return G}o(Mt,"modeToNumber");function jt(ie){return ie>>>0===ie}o(jt,"isFd");function pr(ie){if(!jt(ie))throw TypeError(Y.FD)}o(pr,"validateFd");function yr(ie){if(typeof ie=="string"&&+ie==ie)return+ie;if(ie instanceof Date)return ie.getTime()/1e3;if(isFinite(ie))return ie<0?Date.now()/1e3:ie;throw new Error("Cannot parse time: "+ie)}o(yr,"toUnixTimestamp"),wt.toUnixTimestamp=yr;function ur(ie){if(typeof ie!="number")throw TypeError(Y.UID)}o(ur,"validateUid");function Hf(ie){if(typeof ie!="number")throw TypeError(Y.GID)}o(Hf,"validateGid");function AY(ie){var H={};function G(ee,le){for(var _e in le){var xe=le[_e],Ne=oe(ee,_e);typeof xe=="string"?H[Ne]=xe:typeof xe=="object"&&xe!==null&&Object.keys(xe).length>0?G(Ne,xe):H[Ne]=null}}return o(G,"flatten"),G("",ie),H}o(AY,"flattenJSON");var RY=function(){function ie(H){H===void 0&&(H={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,b.default)(this),this.statWatchers={},this.props=Object.assign({Node:n.Node,Link:n.Link,File:n.File},H);var G=this.createLink();G.setNode(this.createNode(!0));var ee=this;this.StatWatcher=function(xe){e(Ne,xe);function Ne(){return xe.call(this,ee)||this}return o(Ne,"StatWatcher2"),Ne}(lI);var le=ro;this.ReadStream=function(xe){e(Ne,xe);function Ne(){for(var ze=[],Ke=0;Ke<arguments.length;Ke++)ze[Ke]=arguments[Ke];return xe.apply(this,t([ee],ze,!1))||this}return o(Ne,"class_1"),Ne}(le);var _e=yi;this.WriteStream=function(xe){e(Ne,xe);function Ne(){for(var ze=[],Ke=0;Ke<arguments.length;Ke++)ze[Ke]=arguments[Ke];return xe.apply(this,t([ee],ze,!1))||this}return o(Ne,"class_2"),Ne}(_e),this.FSWatcher=function(xe){e(Ne,xe);function Ne(){return xe.call(this,ee)||this}return o(Ne,"FSWatcher2"),Ne}(uI),G.setChild(".",G),G.getNode().nlink++,G.setChild("..",G),G.getNode().nlink++,this.root=G}return o(ie,"Volume2"),ie.fromJSON=function(H,G){var ee=new ie;return ee.fromJSON(H,G),ee},ie.fromNestedJSON=function(H,G){var ee=new ie;return ee.fromNestedJSON(H,G),ee},Object.defineProperty(ie.prototype,"promises",{get:o(function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},"get"),enumerable:!1,configurable:!0}),ie.prototype.createLink=function(H,G,ee,le){if(ee===void 0&&(ee=!1),!H)return new this.props.Link(this,null,"");if(!G)throw new Error("createLink: name cannot be empty");return H.createChild(G,this.createNode(ee,le))},ie.prototype.deleteLink=function(H){var G=H.parent;return G?(G.deleteChild(H),!0):!1},ie.prototype.newInoNumber=function(){var H=this.releasedInos.pop();return H||(this.ino=(this.ino+1)%4294967295,this.ino)},ie.prototype.newFdNumber=function(){var H=this.releasedFds.pop();return typeof H=="number"?H:ie.fd--},ie.prototype.createNode=function(H,G){H===void 0&&(H=!1);var ee=new this.props.Node(this.newInoNumber(),G);return H&&ee.setIsDirectory(),this.inodes[ee.ino]=ee,ee},ie.prototype.getNode=function(H){return this.inodes[H]},ie.prototype.deleteNode=function(H){H.del(),delete this.inodes[H.ino],this.releasedInos.push(H.ino)},ie.prototype.genRndStr=function(){var H=(Math.random()+1).toString(36).substring(2,8);return H.length===6?H:this.genRndStr()},ie.prototype.getLink=function(H){return this.root.walk(H)},ie.prototype.getLinkOrThrow=function(H,G){var ee=xt(H),le=this.getLink(ee);if(!le)throw ce(Z,G,H);return le},ie.prototype.getResolvedLink=function(H){for(var G=typeof H=="string"?xt(H):H,ee=this.root,le=0;le<G.length;){var _e=G[le];if(ee=ee.getChild(_e),!ee)return null;var xe=ee.getNode();if(xe.isSymlink()){G=xe.symlink.concat(G.slice(le+1)),ee=this.root,le=0;continue}le++}return ee},ie.prototype.getResolvedLinkOrThrow=function(H,G){var ee=this.getResolvedLink(H);if(!ee)throw ce(Z,G,H);return ee},ie.prototype.resolveSymlinks=function(H){return this.getResolvedLink(H.steps.slice(1))},ie.prototype.getLinkAsDirOrThrow=function(H,G){var ee=this.getLinkOrThrow(H,G);if(!ee.getNode().isDirectory())throw ce(q,G,H);return ee},ie.prototype.getLinkParent=function(H){return this.root.walk(H,H.length-1)},ie.prototype.getLinkParentAsDirOrThrow=function(H,G){var ee=H instanceof Array?H:xt(H),le=this.getLinkParent(ee);if(!le)throw ce(Z,G,ue+ee.join(ue));if(!le.getNode().isDirectory())throw ce(q,G,ue+ee.join(ue));return le},ie.prototype.getFileByFd=function(H){return this.fds[String(H)]},ie.prototype.getFileByFdOrThrow=function(H,G){if(!jt(H))throw TypeError(Y.FD);var ee=this.getFileByFd(H);if(!ee)throw ce(re,G);return ee},ie.prototype.wrapAsync=function(H,G,ee){var le=this;Te(ee),(0,u.default)(function(){var _e;try{_e=H.apply(le,G)}catch(xe){ee(xe);return}ee(null,_e)})},ie.prototype._toJSON=function(H,G,ee){var le;H===void 0&&(H=this.root),G===void 0&&(G={});var _e=!0,xe=H.children;H.getNode().isFile()&&(xe=(le={},le[H.getName()]=H.parent.getChild(H.getName()),le),H=H.parent);for(var Ne in xe)if(!(Ne==="."||Ne==="..")){_e=!1;var ze=H.getChild(Ne);if(!ze)throw new Error("_toJSON: unexpected undefined");var Ke=ze.getNode();if(Ke.isFile()){var tt=ze.getPath();ee&&(tt=ge(ee,tt)),G[tt]=Ke.getString()}else Ke.isDirectory()&&this._toJSON(ze,G,ee)}var ht=H.getPath();return ee&&(ht=ge(ee,ht)),ht&&_e&&(G[ht]=null),G},ie.prototype.toJSON=function(H,G,ee){G===void 0&&(G={}),ee===void 0&&(ee=!1);var le=[];if(H){H instanceof Array||(H=[H]);for(var _e=0,xe=H;_e<xe.length;_e++){var Ne=xe[_e],ze=Ie(Ne),Ke=this.getResolvedLink(ze);Ke&&le.push(Ke)}}else le.push(this.root);if(!le.length)return G;for(var tt=0,ht=le;tt<ht.length;tt++){var Ke=ht[tt];this._toJSON(Ke,G,ee?Ke.getPath():"")}return G},ie.prototype.fromJSON=function(H,G){G===void 0&&(G=h.default.cwd());for(var ee in H){var le=H[ee];if(ee=He(ee,G),typeof le=="string"){var _e=W(ee);this.mkdirpBase(_e,511),this.writeFileSync(ee,le)}else this.mkdirpBase(ee,511)}},ie.prototype.fromNestedJSON=function(H,G){this.fromJSON(AY(H),G)},ie.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},ie.prototype.mountSync=function(H,G){this.fromJSON(G,H)},ie.prototype.openLink=function(H,G,ee){if(ee===void 0&&(ee=!0),this.openFiles>=this.maxFiles)throw ce(ne,"open",H.getPath());var le=H;if(ee&&(le=this.resolveSymlinks(H)),!le)throw ce(Z,"open",H.getPath());var _e=le.getNode();if(_e.isDirectory()){if((G&(S|x|T))!==S)throw ce(F,"open",H.getPath())}else if(G&C)throw ce(q,"open",H.getPath());if(!(G&T)&&!_e.canRead())throw ce(he,"open",H.getPath());var xe=new this.props.File(H,_e,G,this.newFdNumber());return this.fds[xe.fd]=xe,this.openFiles++,G&P&&xe.truncate(),xe},ie.prototype.openFile=function(H,G,ee,le){le===void 0&&(le=!0);var _e=xt(H),xe=le?this.getResolvedLink(_e):this.getLink(_e);if(xe&&G&B)throw ce($,"open",H);if(!xe&&G&A){var Ne=this.getResolvedLink(_e.slice(0,_e.length-1));if(!Ne)throw ce(Z,"open",ue+_e.join(ue));G&A&&typeof ee=="number"&&(xe=this.createLink(Ne,_e[_e.length-1],!1,ee))}if(xe)return this.openLink(xe,G,le);throw ce(Z,"open",H)},ie.prototype.openBase=function(H,G,ee,le){le===void 0&&(le=!0);var _e=this.openFile(H,G,ee,le);if(!_e)throw ce(Z,"open",H);return _e.fd},ie.prototype.openSync=function(H,G,ee){ee===void 0&&(ee=438);var le=Mt(ee),_e=Ie(H),xe=de(G);return this.openBase(_e,xe,le)},ie.prototype.open=function(H,G,ee,le){var _e=ee,xe=le;typeof ee=="function"&&(_e=438,xe=ee),_e=_e||438;var Ne=Mt(_e),ze=Ie(H),Ke=de(G);this.wrapAsync(this.openBase,[ze,Ke,Ne],xe)},ie.prototype.closeFile=function(H){this.fds[H.fd]&&(this.openFiles--,delete this.fds[H.fd],this.releasedFds.push(H.fd))},ie.prototype.closeSync=function(H){pr(H);var G=this.getFileByFdOrThrow(H,"close");this.closeFile(G)},ie.prototype.close=function(H,G){pr(H),this.wrapAsync(this.closeSync,[H],G)},ie.prototype.openFileOrGetById=function(H,G,ee){if(typeof H=="number"){var le=this.fds[H];if(!le)throw ce(Z);return le}else return this.openFile(Ie(H),G,ee)},ie.prototype.readBase=function(H,G,ee,le,_e){var xe=this.getFileByFdOrThrow(H);return xe.read(G,Number(ee),Number(le),_e)},ie.prototype.readSync=function(H,G,ee,le,_e){return pr(H),this.readBase(H,G,ee,le,_e)},ie.prototype.read=function(H,G,ee,le,_e,xe){var Ne=this;if(Te(xe),le===0)return h.default.nextTick(function(){xe&&xe(null,0,G)});(0,u.default)(function(){try{var ze=Ne.readBase(H,G,ee,le,_e);xe(null,ze,G)}catch(Ke){xe(Ke)}})},ie.prototype.readFileBase=function(H,G,ee){var le,_e=typeof H=="number",xe=_e&&jt(H),Ne;if(xe)Ne=H;else{var ze=Ie(H),Ke=xt(ze),tt=this.getResolvedLink(Ke);if(tt){var ht=tt.getNode();if(ht.isDirectory())throw ce(F,"open",tt.getPath())}Ne=this.openSync(H,G)}try{le=Gn(this.getFileByFdOrThrow(Ne).getBuffer(),ee)}finally{xe||this.closeSync(Ne)}return le},ie.prototype.readFileSync=function(H,G){var ee=f(G),le=de(ee.flag);return this.readFileBase(H,le,ee.encoding)},ie.prototype.readFile=function(H,G,ee){var le=Ge(f)(G,ee),_e=le[0],xe=le[1],Ne=de(_e.flag);this.wrapAsync(this.readFileBase,[H,Ne,_e.encoding],xe)},ie.prototype.writeBase=function(H,G,ee,le,_e){var xe=this.getFileByFdOrThrow(H,"write");return xe.write(G,ee,le,_e)},ie.prototype.writeSync=function(H,G,ee,le,_e){pr(H);var xe,Ne,ze,Ke,tt=typeof G!="string";tt?(Ne=(ee||0)|0,ze=le,Ke=_e):(Ke=ee,xe=le);var ht=Vn(G,xe);return tt?typeof ze>"u"&&(ze=ht.length):(Ne=0,ze=ht.length),this.writeBase(H,ht,Ne,ze,Ke)},ie.prototype.write=function(H,G,ee,le,_e,xe){var Ne=this;pr(H);var ze,Ke,tt,ht,Ir,Qs=typeof G,no=typeof ee,Ga=typeof le,el=typeof _e;Qs!=="string"?no==="function"?Ir=ee:Ga==="function"?(ze=ee|0,Ir=le):el==="function"?(ze=ee|0,Ke=le,Ir=_e):(ze=ee|0,Ke=le,tt=_e,Ir=xe):no==="function"?Ir=ee:Ga==="function"?(tt=ee,Ir=le):el==="function"&&(tt=ee,ht=le,Ir=_e);var mr=Vn(G,ht);Qs!=="string"?typeof Ke>"u"&&(Ke=mr.length):(ze=0,Ke=mr.length);var mi=Te(Ir);(0,u.default)(function(){try{var $i=Ne.writeBase(H,mr,ze,Ke,tt);Qs!=="string"?mi(null,$i,mr):mi(null,$i,G)}catch(qp){mi(qp)}})},ie.prototype.writeFileBase=function(H,G,ee,le){var _e=typeof H=="number",xe;_e?xe=H:xe=this.openBase(Ie(H),ee,le);var Ne=0,ze=G.length,Ke=ee&N?void 0:0;try{for(;ze>0;){var tt=this.writeSync(xe,G,Ne,ze,Ke);Ne+=tt,ze-=tt,Ke!==void 0&&(Ke+=tt)}}finally{_e||this.closeSync(xe)}},ie.prototype.writeFileSync=function(H,G,ee){var le=R(ee),_e=de(le.flag),xe=Mt(le.mode),Ne=Vn(G,le.encoding);this.writeFileBase(H,Ne,_e,xe)},ie.prototype.writeFile=function(H,G,ee,le){var _e=ee,xe=le;typeof ee=="function"&&(_e=w,xe=ee);var Ne=Te(xe),ze=R(_e),Ke=de(ze.flag),tt=Mt(ze.mode),ht=Vn(G,ze.encoding);this.wrapAsync(this.writeFileBase,[H,ht,Ke,tt],Ne)},ie.prototype.linkBase=function(H,G){var ee=xt(H),le=this.getLink(ee);if(!le)throw ce(Z,"link",H,G);var _e=xt(G),xe=this.getLinkParent(_e);if(!xe)throw ce(Z,"link",H,G);var Ne=_e[_e.length-1];if(xe.getChild(Ne))throw ce($,"link",H,G);var ze=le.getNode();ze.nlink++,xe.createChild(Ne,ze)},ie.prototype.copyFileBase=function(H,G,ee){var le=this.readFileSync(H);if(ee&V&&this.existsSync(G))throw ce($,"copyFile",H,G);if(ee&Q)throw ce(j,"copyFile",H,G);this.writeFileBase(G,le,se.w,438)},ie.prototype.copyFileSync=function(H,G,ee){var le=Ie(H),_e=Ie(G);return this.copyFileBase(le,_e,(ee||0)|0)},ie.prototype.copyFile=function(H,G,ee,le){var _e=Ie(H),xe=Ie(G),Ne,ze;typeof ee=="function"?(Ne=0,ze=ee):(Ne=ee,ze=le),Te(ze),this.wrapAsync(this.copyFileBase,[_e,xe,Ne],ze)},ie.prototype.linkSync=function(H,G){var ee=Ie(H),le=Ie(G);this.linkBase(ee,le)},ie.prototype.link=function(H,G,ee){var le=Ie(H),_e=Ie(G);this.wrapAsync(this.linkBase,[le,_e],ee)},ie.prototype.unlinkBase=function(H){var G=xt(H),ee=this.getLink(G);if(!ee)throw ce(Z,"unlink",H);if(ee.length)throw Error("Dir not empty...");this.deleteLink(ee);var le=ee.getNode();le.nlink--,le.nlink<=0&&this.deleteNode(le)},ie.prototype.unlinkSync=function(H){var G=Ie(H);this.unlinkBase(G)},ie.prototype.unlink=function(H,G){var ee=Ie(H);this.wrapAsync(this.unlinkBase,[ee],G)},ie.prototype.symlinkBase=function(H,G){var ee=xt(G),le=this.getLinkParent(ee);if(!le)throw ce(Z,"symlink",H,G);var _e=ee[ee.length-1];if(le.getChild(_e))throw ce($,"symlink",H,G);var xe=le.createChild(_e);return xe.getNode().makeSymlink(xt(H)),xe},ie.prototype.symlinkSync=function(H,G,ee){var le=Ie(H),_e=Ie(G);this.symlinkBase(le,_e)},ie.prototype.symlink=function(H,G,ee,le){var _e=Te(typeof ee=="function"?ee:le),xe=Ie(H),Ne=Ie(G);this.wrapAsync(this.symlinkBase,[xe,Ne],_e)},ie.prototype.realpathBase=function(H,G){var ee=xt(H),le=this.getResolvedLink(ee);if(!le)throw ce(Z,"realpath",H);return(0,g.strToEncoding)(le.getPath()||"/",G)},ie.prototype.realpathSync=function(H,G){return this.realpathBase(Ie(H),me(G).encoding)},ie.prototype.realpath=function(H,G,ee){var le=ve(G,ee),_e=le[0],xe=le[1],Ne=Ie(H);this.wrapAsync(this.realpathBase,[Ne,_e.encoding],xe)},ie.prototype.lstatBase=function(H,G,ee){G===void 0&&(G=!1),ee===void 0&&(ee=!1);var le=this.getLink(xt(H));if(le)return a.default.build(le.getNode(),G);if(ee)throw ce(Z,"lstat",H)},ie.prototype.lstatSync=function(H,G){var ee=fe(G),le=ee.throwIfNoEntry,_e=le===void 0?!0:le,xe=ee.bigint,Ne=xe===void 0?!1:xe;return this.lstatBase(Ie(H),Ne,_e)},ie.prototype.lstat=function(H,G,ee){var le=pe(G,ee),_e=le[0],xe=_e.throwIfNoEntry,Ne=xe===void 0?!0:xe,ze=_e.bigint,Ke=ze===void 0?!1:ze,tt=le[1];this.wrapAsync(this.lstatBase,[Ie(H),Ke,Ne],tt)},ie.prototype.statBase=function(H,G,ee){G===void 0&&(G=!1),ee===void 0&&(ee=!0);var le=this.getResolvedLink(xt(H));if(le)return a.default.build(le.getNode(),G);if(ee)throw ce(Z,"stat",H)},ie.prototype.statSync=function(H,G){var ee=fe(G),le=ee.bigint,_e=le===void 0?!0:le,xe=ee.throwIfNoEntry,Ne=xe===void 0?!0:xe;return this.statBase(Ie(H),_e,Ne)},ie.prototype.stat=function(H,G,ee){var le=pe(G,ee),_e=le[0],xe=_e.bigint,Ne=xe===void 0?!1:xe,ze=_e.throwIfNoEntry,Ke=ze===void 0?!0:ze,tt=le[1];this.wrapAsync(this.statBase,[Ie(H),Ne,Ke],tt)},ie.prototype.fstatBase=function(H,G){G===void 0&&(G=!1);var ee=this.getFileByFd(H);if(!ee)throw ce(re,"fstat");return a.default.build(ee.node,G)},ie.prototype.fstatSync=function(H,G){return this.fstatBase(H,fe(G).bigint)},ie.prototype.fstat=function(H,G,ee){var le=pe(G,ee),_e=le[0],xe=le[1];this.wrapAsync(this.fstatBase,[H,_e.bigint],xe)},ie.prototype.renameBase=function(H,G){var ee=this.getLink(xt(H));if(!ee)throw ce(Z,"rename",H,G);var le=xt(G),_e=this.getLinkParent(le);if(!_e)throw ce(Z,"rename",H,G);var xe=ee.parent;xe&&xe.deleteChild(ee);var Ne=le[le.length-1];ee.name=Ne,ee.steps=t(t([],_e.steps,!0),[Ne],!1),_e.setChild(ee.getName(),ee)},ie.prototype.renameSync=function(H,G){var ee=Ie(H),le=Ie(G);this.renameBase(ee,le)},ie.prototype.rename=function(H,G,ee){var le=Ie(H),_e=Ie(G);this.wrapAsync(this.renameBase,[le,_e],ee)},ie.prototype.existsBase=function(H){return!!this.statBase(H)},ie.prototype.existsSync=function(H){try{return this.existsBase(Ie(H))}catch{return!1}},ie.prototype.exists=function(H,G){var ee=this,le=Ie(H);if(typeof G!="function")throw Error(Y.CB);(0,u.default)(function(){try{G(ee.existsBase(le))}catch{G(!1)}})},ie.prototype.accessBase=function(H,G){this.getLinkOrThrow(H,"access")},ie.prototype.accessSync=function(H,G){G===void 0&&(G=z);var ee=Ie(H);G=G|0,this.accessBase(ee,G)},ie.prototype.access=function(H,G,ee){var le=z,_e;typeof G!="function"?(le=G|0,_e=Te(ee)):_e=G;var xe=Ie(H);this.wrapAsync(this.accessBase,[xe,le],_e)},ie.prototype.appendFileSync=function(H,G,ee){ee===void 0&&(ee=O);var le=k(ee);(!le.flag||jt(H))&&(le.flag="a"),this.writeFileSync(H,G,le)},ie.prototype.appendFile=function(H,G,ee,le){var _e=M(ee,le),xe=_e[0],Ne=_e[1];(!xe.flag||jt(H))&&(xe.flag="a"),this.writeFile(H,G,xe,Ne)},ie.prototype.readdirBase=function(H,G){var ee=xt(H),le=this.getResolvedLink(ee);if(!le)throw ce(Z,"readdir",H);var _e=le.getNode();if(!_e.isDirectory())throw ce(q,"scandir",H);if(G.withFileTypes){var xe=[];for(var Ne in le.children){var ze=le.getChild(Ne);!ze||Ne==="."||Ne===".."||xe.push(s.default.build(ze,G.encoding))}return!ae&&G.encoding!=="buffer"&&xe.sort(function(ht,Ir){return ht.name<Ir.name?-1:ht.name>Ir.name?1:0}),xe}var Ke=[];for(var tt in le.children)tt==="."||tt===".."||Ke.push((0,g.strToEncoding)(tt,G.encoding));return!ae&&G.encoding!=="buffer"&&Ke.sort(),Ke},ie.prototype.readdirSync=function(H,G){var ee=Nr(G),le=Ie(H);return this.readdirBase(le,ee)},ie.prototype.readdir=function(H,G,ee){var le=Tt(G,ee),_e=le[0],xe=le[1],Ne=Ie(H);this.wrapAsync(this.readdirBase,[Ne,_e],xe)},ie.prototype.readlinkBase=function(H,G){var ee=this.getLinkOrThrow(H,"readlink"),le=ee.getNode();if(!le.isSymlink())throw ce(we,"readlink",H);var _e=ue+le.symlink.join(ue);return(0,g.strToEncoding)(_e,G)},ie.prototype.readlinkSync=function(H,G){var ee=et(G),le=Ie(H);return this.readlinkBase(le,ee.encoding)},ie.prototype.readlink=function(H,G,ee){var le=p(G,ee),_e=le[0],xe=le[1],Ne=Ie(H);this.wrapAsync(this.readlinkBase,[Ne,_e.encoding],xe)},ie.prototype.fsyncBase=function(H){this.getFileByFdOrThrow(H,"fsync")},ie.prototype.fsyncSync=function(H){this.fsyncBase(H)},ie.prototype.fsync=function(H,G){this.wrapAsync(this.fsyncBase,[H],G)},ie.prototype.fdatasyncBase=function(H){this.getFileByFdOrThrow(H,"fdatasync")},ie.prototype.fdatasyncSync=function(H){this.fdatasyncBase(H)},ie.prototype.fdatasync=function(H,G){this.wrapAsync(this.fdatasyncBase,[H],G)},ie.prototype.ftruncateBase=function(H,G){var ee=this.getFileByFdOrThrow(H,"ftruncate");ee.truncate(G)},ie.prototype.ftruncateSync=function(H,G){this.ftruncateBase(H,G)},ie.prototype.ftruncate=function(H,G,ee){var le=typeof G=="number"?G:0,_e=Te(typeof G=="number"?ee:G);this.wrapAsync(this.ftruncateBase,[H,le],_e)},ie.prototype.truncateBase=function(H,G){var ee=this.openSync(H,"r+");try{this.ftruncateSync(ee,G)}finally{this.closeSync(ee)}},ie.prototype.truncateSync=function(H,G){if(jt(H))return this.ftruncateSync(H,G);this.truncateBase(H,G)},ie.prototype.truncate=function(H,G,ee){var le=typeof G=="number"?G:0,_e=Te(typeof G=="number"?ee:G);if(jt(H))return this.ftruncate(H,le,_e);this.wrapAsync(this.truncateBase,[H,le],_e)},ie.prototype.futimesBase=function(H,G,ee){var le=this.getFileByFdOrThrow(H,"futimes"),_e=le.node;_e.atime=new Date(G*1e3),_e.mtime=new Date(ee*1e3)},ie.prototype.futimesSync=function(H,G,ee){this.futimesBase(H,yr(G),yr(ee))},ie.prototype.futimes=function(H,G,ee,le){this.wrapAsync(this.futimesBase,[H,yr(G),yr(ee)],le)},ie.prototype.utimesBase=function(H,G,ee){var le=this.openSync(H,"r");try{this.futimesBase(le,G,ee)}finally{this.closeSync(le)}},ie.prototype.utimesSync=function(H,G,ee){this.utimesBase(Ie(H),yr(G),yr(ee))},ie.prototype.utimes=function(H,G,ee,le){this.wrapAsync(this.utimesBase,[Ie(H),yr(G),yr(ee)],le)},ie.prototype.mkdirBase=function(H,G){var ee=xt(H);if(!ee.length)throw ce($,"mkdir",H);var le=this.getLinkParentAsDirOrThrow(H,"mkdir"),_e=ee[ee.length-1];if(le.getChild(_e))throw ce($,"mkdir",H);le.createChild(_e,this.createNode(!0,G))},ie.prototype.mkdirpBase=function(H,G){for(var ee=He(H),le=ee.substring(1),_e=le?le.split(ue):[],xe=this.root,Ne=!1,ze=0;ze<_e.length;ze++){var Ke=_e[ze];if(!xe.getNode().isDirectory())throw ce(q,"mkdir",xe.getPath());var tt=xe.getChild(Ke);if(tt)if(tt.getNode().isDirectory())xe=tt;else throw ce(q,"mkdir",tt.getPath());else xe=xe.createChild(Ke,this.createNode(!0,G)),Ne=!0}return Ne?ee:void 0},ie.prototype.mkdirSync=function(H,G){var ee=We(G),le=Mt(ee.mode,511),_e=Ie(H);if(ee.recursive)return this.mkdirpBase(_e,le);this.mkdirBase(_e,le)},ie.prototype.mkdir=function(H,G,ee){var le=We(G),_e=Te(typeof G=="function"?G:ee),xe=Mt(le.mode,511),Ne=Ie(H);le.recursive?this.wrapAsync(this.mkdirpBase,[Ne,xe],_e):this.wrapAsync(this.mkdirBase,[Ne,xe],_e)},ie.prototype.mkdirpSync=function(H,G){return this.mkdirSync(H,{mode:G,recursive:!0})},ie.prototype.mkdirp=function(H,G,ee){var le=typeof G=="function"?void 0:G,_e=Te(typeof G=="function"?G:ee);this.mkdir(H,{mode:le,recursive:!0},_e)},ie.prototype.mkdtempBase=function(H,G,ee){ee===void 0&&(ee=5);var le=H+this.genRndStr();try{return this.mkdirBase(le,511),(0,g.strToEncoding)(le,G)}catch(_e){if(_e.code===$){if(ee>1)return this.mkdtempBase(H,G,ee-1);throw Error("Could not create temp dir.")}else throw _e}},ie.prototype.mkdtempSync=function(H,G){var ee=et(G).encoding;if(!H||typeof H!="string")throw new TypeError("filename prefix is required");return di(H),this.mkdtempBase(H,ee)},ie.prototype.mkdtemp=function(H,G,ee){var le=p(G,ee),_e=le[0].encoding,xe=le[1];if(!H||typeof H!="string")throw new TypeError("filename prefix is required");di(H)&&this.wrapAsync(this.mkdtempBase,[H,_e],xe)},ie.prototype.rmdirBase=function(H,G){var ee=Ar(G),le=this.getLinkAsDirOrThrow(H,"rmdir");if(le.length&&!ee.recursive)throw ce(I,"rmdir",H);this.deleteLink(le)},ie.prototype.rmdirSync=function(H,G){this.rmdirBase(Ie(H),G)},ie.prototype.rmdir=function(H,G,ee){var le=Ar(G),_e=Te(typeof G=="function"?G:ee);this.wrapAsync(this.rmdirBase,[Ie(H),le],_e)},ie.prototype.rmBase=function(H,G){G===void 0&&(G={});var ee=this.getResolvedLink(H);if(!ee){if(!G.force)throw ce(Z,"stat",H);return}if(ee.getNode().isDirectory()&&!G.recursive)throw ce(te,"rm",H);this.deleteLink(ee)},ie.prototype.rmSync=function(H,G){this.rmBase(Ie(H),G)},ie.prototype.rm=function(H,G,ee){var le=Jt(G,ee),_e=le[0],xe=le[1];this.wrapAsync(this.rmBase,[Ie(H),_e],xe)},ie.prototype.fchmodBase=function(H,G){var ee=this.getFileByFdOrThrow(H,"fchmod");ee.chmod(G)},ie.prototype.fchmodSync=function(H,G){this.fchmodBase(H,Mt(G))},ie.prototype.fchmod=function(H,G,ee){this.wrapAsync(this.fchmodBase,[H,Mt(G)],ee)},ie.prototype.chmodBase=function(H,G){var ee=this.openSync(H,"r");try{this.fchmodBase(ee,G)}finally{this.closeSync(ee)}},ie.prototype.chmodSync=function(H,G){var ee=Mt(G),le=Ie(H);this.chmodBase(le,ee)},ie.prototype.chmod=function(H,G,ee){var le=Mt(G),_e=Ie(H);this.wrapAsync(this.chmodBase,[_e,le],ee)},ie.prototype.lchmodBase=function(H,G){var ee=this.openBase(H,x,0,!1);try{this.fchmodBase(ee,G)}finally{this.closeSync(ee)}},ie.prototype.lchmodSync=function(H,G){var ee=Mt(G),le=Ie(H);this.lchmodBase(le,ee)},ie.prototype.lchmod=function(H,G,ee){var le=Mt(G),_e=Ie(H);this.wrapAsync(this.lchmodBase,[_e,le],ee)},ie.prototype.fchownBase=function(H,G,ee){this.getFileByFdOrThrow(H,"fchown").chown(G,ee)},ie.prototype.fchownSync=function(H,G,ee){ur(G),Hf(ee),this.fchownBase(H,G,ee)},ie.prototype.fchown=function(H,G,ee,le){ur(G),Hf(ee),this.wrapAsync(this.fchownBase,[H,G,ee],le)},ie.prototype.chownBase=function(H,G,ee){var le=this.getResolvedLinkOrThrow(H,"chown"),_e=le.getNode();_e.chown(G,ee)},ie.prototype.chownSync=function(H,G,ee){ur(G),Hf(ee),this.chownBase(Ie(H),G,ee)},ie.prototype.chown=function(H,G,ee,le){ur(G),Hf(ee),this.wrapAsync(this.chownBase,[Ie(H),G,ee],le)},ie.prototype.lchownBase=function(H,G,ee){this.getLinkOrThrow(H,"lchown").getNode().chown(G,ee)},ie.prototype.lchownSync=function(H,G,ee){ur(G),Hf(ee),this.lchownBase(Ie(H),G,ee)},ie.prototype.lchown=function(H,G,ee,le){ur(G),Hf(ee),this.wrapAsync(this.lchownBase,[Ie(H),G,ee],le)},ie.prototype.watchFile=function(H,G,ee){var le=Ie(H),_e=G,xe=ee;if(typeof _e=="function"&&(xe=G,_e=null),typeof xe!="function")throw Error('"watchFile()" requires a listener function');var Ne=5007,ze=!0;_e&&typeof _e=="object"&&(typeof _e.interval=="number"&&(Ne=_e.interval),typeof _e.persistent=="boolean"&&(ze=_e.persistent));var Ke=this.statWatchers[le];return Ke||(Ke=new this.StatWatcher,Ke.start(le,ze,Ne),this.statWatchers[le]=Ke),Ke.addListener("change",xe),Ke},ie.prototype.unwatchFile=function(H,G){var ee=Ie(H),le=this.statWatchers[ee];le&&(typeof G=="function"?le.removeListener("change",G):le.removeAllListeners("change"),le.listenerCount("change")===0&&(le.stop(),delete this.statWatchers[ee]))},ie.prototype.createReadStream=function(H,G){return new this.ReadStream(H,G)},ie.prototype.createWriteStream=function(H,G){return new this.WriteStream(H,G)},ie.prototype.watch=function(H,G,ee){var le=Ie(H),_e=G;typeof G=="function"&&(ee=G,_e=null);var xe=et(_e),Ne=xe.persistent,ze=xe.recursive,Ke=xe.encoding;Ne===void 0&&(Ne=!0),ze===void 0&&(ze=!1);var tt=new this.FSWatcher;return tt.start(le,Ne,ze,Ke),ee&&tt.addListener("change",ee),tt},ie.fd=2147483647,ie}();wt.Volume=RY;function TY(ie){ie.emit("stop")}o(TY,"emitStop");var lI=function(ie){e(H,ie);function H(G){var ee=ie.call(this)||this;return ee.onInterval=function(){try{var le=ee.vol.statSync(ee.filename);ee.hasChanged(le)&&(ee.emit("change",le,ee.prev),ee.prev=le)}finally{ee.loop()}},ee.vol=G,ee}return o(H,"StatWatcher2"),H.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},H.prototype.hasChanged=function(G){return G.mtimeMs>this.prev.mtimeMs||G.nlink!==this.prev.nlink},H.prototype.start=function(G,ee,le){ee===void 0&&(ee=!0),le===void 0&&(le=5007),this.filename=Ie(G),this.setTimeout=ee?setTimeout.bind(typeof globalThis<"u"?globalThis:Uxe):c.default,this.interval=le,this.prev=this.vol.statSync(this.filename),this.loop()},H.prototype.stop=function(){clearTimeout(this.timeoutRef),h.default.nextTick(TY,this)},H}(m.EventEmitter);wt.StatWatcher=lI;var pi;function xY(ie){pi=(0,i.bufferAllocUnsafe)(ie),pi.used=0}o(xY,"allocNewPool"),_.inherits(ro,d.Readable),wt.ReadStream=ro;function ro(ie,H,G){if(!(this instanceof ro))return new ro(ie,H,G);if(this._vol=ie,G=Object.assign({},Re(G,{})),G.highWaterMark===void 0&&(G.highWaterMark=64*1024),d.Readable.call(this,G),this.path=Ie(H),this.fd=G.fd===void 0?null:G.fd,this.flags=G.flags===void 0?"r":G.flags,this.mode=G.mode===void 0?438:G.mode,this.start=G.start,this.end=G.end,this.autoClose=G.autoClose===void 0?!0:G.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}o(ro,"FsReadStream"),ro.prototype.open=function(){var ie=this;this._vol.open(this.path,this.flags,this.mode,function(H,G){if(H){ie.autoClose&&ie.destroy&&ie.destroy(),ie.emit("error",H);return}ie.fd=G,ie.emit("open",G),ie.read()})},ro.prototype._read=function(ie){if(typeof this.fd!="number")return this.once("open",function(){this._read(ie)});if(this.destroyed)return;(!pi||pi.length-pi.used<U)&&xY(this._readableState.highWaterMark);var H=pi,G=Math.min(pi.length-pi.used,ie),ee=pi.used;if(this.pos!==void 0&&(G=Math.min(this.end-this.pos+1,G)),G<=0)return this.push(null);var le=this;this._vol.read(this.fd,pi,pi.used,G,this.pos,_e),this.pos!==void 0&&(this.pos+=G),pi.used+=G;function _e(xe,Ne){if(xe)le.autoClose&&le.destroy&&le.destroy(),le.emit("error",xe);else{var ze=null;Ne>0&&(le.bytesRead+=Ne,ze=H.slice(ee,ee+Ne)),le.push(ze)}}o(_e,"onread")},ro.prototype._destroy=function(ie,H){this.close(function(G){H(ie||G)})},ro.prototype.close=function(ie){var H=this,G;if(ie&&this.once("close",ie),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",fI);return}return h.default.nextTick(function(){return H.emit("close")})}typeof((G=this._readableState)===null||G===void 0?void 0:G.closed)=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,function(ee){ee?H.emit("error",ee):H.emit("close")}),this.fd=null};function fI(ie){this.close()}o(fI,"closeOnOpen"),_.inherits(yi,d.Writable),wt.WriteStream=yi;function yi(ie,H,G){if(!(this instanceof yi))return new yi(ie,H,G);if(this._vol=ie,G=Object.assign({},Re(G,{})),d.Writable.call(this,G),this.path=Ie(H),this.fd=G.fd===void 0?null:G.fd,this.flags=G.flags===void 0?"w":G.flags,this.mode=G.mode===void 0?438:G.mode,this.start=G.start,this.autoClose=G.autoClose===void 0?!0:!!G.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}G.encoding&&this.setDefaultEncoding(G.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}o(yi,"FsWriteStream"),yi.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(ie,H){if(ie){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",ie);return}this.fd=H,this.emit("open",H)}.bind(this))},yi.prototype._write=function(ie,H,G){if(!(ie instanceof i.Buffer||ie instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(ie,H,G)});var ee=this;this._vol.write(this.fd,ie,0,ie.length,this.pos,function(le,_e){if(le)return ee.autoClose&&ee.destroy&&ee.destroy(),G(le);ee.bytesWritten+=_e,G()}),this.pos!==void 0&&(this.pos+=ie.length)},yi.prototype._writev=function(ie,H){if(typeof this.fd!="number")return this.once("open",function(){this._writev(ie,H)});for(var G=this,ee=ie.length,le=new Array(ee),_e=0,xe=0;xe<ee;xe++){var Ne=ie[xe].chunk;le[xe]=Ne,_e+=Ne.length}var ze=i.Buffer.concat(le);this._vol.write(this.fd,ze,0,ze.length,this.pos,function(Ke,tt){if(Ke)return G.destroy&&G.destroy(),H(Ke);G.bytesWritten+=tt,H()}),this.pos!==void 0&&(this.pos+=_e)},yi.prototype.close=function(ie){var H=this,G;if(ie&&this.once("close",ie),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",fI);return}return h.default.nextTick(function(){return H.emit("close")})}typeof((G=this._writableState)===null||G===void 0?void 0:G.closed)=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,function(ee){ee?H.emit("error",ee):H.emit("close")}),this.fd=null},yi.prototype._destroy=ro.prototype._destroy,yi.prototype.destroySoon=yi.prototype.end;var uI=function(ie){e(H,ie);function H(G){var ee=ie.call(this)||this;return ee._filename="",ee._filenameEncoded="",ee._recursive=!1,ee._encoding=g.ENCODING_UTF8,ee._listenerRemovers=new Map,ee._onParentChild=function(le){le.getName()===ee._getName()&&ee._emit("rename")},ee._emit=function(le){ee.emit("change",le,ee._filenameEncoded)},ee._persist=function(){ee._timer=setTimeout(ee._persist,1e6)},ee._vol=G,ee}return o(H,"FSWatcher2"),H.prototype._getName=function(){return this._steps[this._steps.length-1]},H.prototype.start=function(G,ee,le,_e){var xe=this;ee===void 0&&(ee=!0),le===void 0&&(le=!1),_e===void 0&&(_e=g.ENCODING_UTF8),this._filename=Ie(G),this._steps=xt(this._filename),this._filenameEncoded=(0,g.strToEncoding)(this._filename),this._recursive=le,this._encoding=_e;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(ht){var Ne=new Error("watch ".concat(this._filename," ").concat(ht.code));throw Ne.code=ht.code,Ne.errno=ht.code,Ne}var ze=o(function(ht){var Ir,Qs=ht.getPath(),no=ht.getNode(),Ga=o(function(){var mr=ge(xe._filename,Qs);return mr||(mr=xe._getName()),xe.emit("change","change",mr)},"onNodeChange");no.on("change",Ga);var el=(Ir=xe._listenerRemovers.get(no.ino))!==null&&Ir!==void 0?Ir:[];el.push(function(){return no.removeListener("change",Ga)}),xe._listenerRemovers.set(no.ino,el)},"watchLinkNodeChanged"),Ke=o(function(ht){var Ir,Qs=ht.getNode(),no=o(function(mr){xe.emit("change","rename",ge(xe._filename,mr.getPath())),setTimeout(function(){ze(mr),Ke(mr)})},"onLinkChildAdd"),Ga=o(function(mr){var mi=o(function($i){var qp=$i.getNode().ino,cI=xe._listenerRemovers.get(qp);cI&&(cI.forEach(function(Hp){return Hp()}),xe._listenerRemovers.delete(qp)),Object.values($i.children).forEach(function(Hp){Hp&&mi(Hp)})},"removeLinkNodeListeners");mi(mr),xe.emit("change","rename",ge(xe._filename,mr.getPath()))},"onLinkChildDelete");Object.entries(ht.children).forEach(function(mr){var mi=mr[0],$i=mr[1];$i&&mi!=="."&&mi!==".."&&ze($i)}),ht.on("child:add",no),ht.on("child:delete",Ga);var el=(Ir=xe._listenerRemovers.get(Qs.ino))!==null&&Ir!==void 0?Ir:[];el.push(function(){ht.removeListener("child:add",no),ht.removeListener("child:delete",Ga)}),le&&Object.entries(ht.children).forEach(function(mr){var mi=mr[0],$i=mr[1];$i&&mi!=="."&&mi!==".."&&Ke($i)})},"watchLinkChildrenChanged");ze(this._link),Ke(this._link);var tt=this._link.parent;tt&&(tt.setMaxListeners(tt.getMaxListeners()+1),tt.on("child:delete",this._onParentChild)),ee&&this._persist()},H.prototype.close=function(){clearTimeout(this._timer),this._listenerRemovers.forEach(function(ee){ee.forEach(function(le){return le()})}),this._listenerRemovers.clear();var G=this._link.parent;G&&G.removeListener("child:delete",this._onParentChild)},H}(m.EventEmitter);return wt.FSWatcher=uI,wt}o(sY,"dew$25");var Da={},qG=!1;function Mxe(){return qG||(qG=!0,Object.defineProperty(Da,"__esModule",{value:!0}),Da.fsSyncMethods=Da.fsProps=Da.fsAsyncMethods=void 0,Da.fsProps=["constants","F_OK","R_OK","W_OK","X_OK","Stats"],Da.fsSyncMethods=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","rmSync","createReadStream","createWriteStream"],Da.fsAsyncMethods=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","rm","watchFile","unwatchFile","watch"]),Da}o(Mxe,"dew$16");var zr={},HG=!1;function jxe(){if(HG)return zr;HG=!0;var e=zr&&zr.__assign||function(){return e=Object.assign||function(g){for(var v,_=1,b=arguments.length;_<b;_++){v=arguments[_];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(g[E]=v[E])}return g},e.apply(this,arguments)};Object.defineProperty(zr,"__esModule",{value:!0}),zr.fs=zr.createFsFromVolume=zr.vol=zr.Volume=void 0;var t=QO(),r=iY(),n=sY(),a=Mxe(),s=a.fsSyncMethods,i=a.fsAsyncMethods,u=Wp(),h=u.constants.F_OK,c=u.constants.R_OK,d=u.constants.W_OK,y=u.constants.X_OK;zr.Volume=n.Volume,zr.vol=new n.Volume;function m(g){for(var v={F_OK:h,R_OK:c,W_OK:d,X_OK:y,constants:u.constants,Stats:t.default,Dirent:r.default},_=0,b=s;_<b.length;_++){var E=b[_];typeof g[E]=="function"&&(v[E]=g[E].bind(g))}for(var S=0,T=i;S<T.length;S++){var E=T[S];typeof g[E]=="function"&&(v[E]=g[E].bind(g))}return v.StatWatcher=g.StatWatcher,v.FSWatcher=g.FSWatcher,v.WriteStream=g.WriteStream,v.ReadStream=g.ReadStream,v.promises=g.promises,v._toUnixTimestamp=n.toUnixTimestamp,v}return o(m,"createFsFromVolume2"),zr.createFsFromVolume=m,zr.fs=m(zr.vol),zr=e(e({},zr),zr.fs),zr.semantic=!0,zr}o(jxe,"dew10");var Mf=jxe();Mf.__esModule;Mf.fs;Mf.createFsFromVolume;Mf.vol;Mf.Volume;Mf.semantic;var Tn=sY();Tn.__esModule;Tn.FSWatcher;Tn.StatWatcher;Tn.Volume;Tn.toUnixTimestamp;Tn.bufferToEncoding;Tn.dataToBuffer;Tn.dataToStr;Tn.pathToSteps;Tn.filenameToSteps;Tn.pathToFilename;Tn.flagsToNumber;Tn.FLAGS;Tn.ReadStream;Tn.WriteStream;var{vol:Va,createFsFromVolume:Wxe}=Mf;function ci(e){throw new Error(`Node.js fs ${e} is not supported by JSPM core in the browser`)}o(ci,"unimplemented2");Va.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});Va.releasedFds=[2,1,0];Va.openSync("/dev/stdin","w");Va.openSync("/dev/stdout","r");Va.openSync("/dev/stderr","r");lY("/dev/stdout",1,console.log);lY("/dev/stderr",2,console.error);function lY(e,t,r){let n=0,a=new TextDecoder;Va.watch(e,"utf8",()=>{let{size:s}=Va.fstatSync(t),i=XK.alloc(s-n);Va.readSync(t,i,0,i.length,n),n=s,r(a.decode(i,{stream:!0}))})}o(lY,"watchStdo");var Vt=Wxe(Va);Vt.opendir=()=>ci("opendir");Vt.opendirSync=()=>ci("opendirSync");Vt.promises.opendir=()=>ci("promises.opendir");Vt.cp=()=>ci("cp");Vt.cpSync=()=>ci("cpSync");Vt.promises.cp=()=>ci("promises.cp");Vt.readv=()=>ci("readv");Vt.readvSync=()=>ci("readvSync");Vt.rm=()=>ci("rm");Vt.rmSync=()=>ci("rmSync");Vt.promises.rm=()=>ci("promises.rm");Vt.Dir=()=>ci("Dir");Vt.promises.watch=()=>ci("promises.watch");Vt.FileReadStream=Vt.ReadStream;Vt.FileWriteStream=Vt.WriteStream;function tI(e,t){if(e.protocol==="file:")return tY(e);if(e.protocol==="https:"||e.protocol==="http:"){let r="\\\\url\\"+e.href.replaceAll(/\//g,"\\\\");if(fY(r))return r;if(t)throw new Error(`Cannot sync request URL ${e} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let n=await fetch(e);if(!n.ok)throw new Error(`Unable to fetch ${e.href}, ${n.status}`);let a=await n.arrayBuffer();return uY(r,XK.from(a)),r})()}throw new Error("URL "+e+" not supported in JSPM FS implementation.")}o(tI,"handleFsUrl");function qxe(e){return function(t,...r){return t instanceof URL?e(tI(t,!0),...r):e(t,...r)}}o(qxe,"wrapFsSync");function Hxe(e){return async function(t,...r){return t instanceof URL?e(await tI(t),...r):e(t,...r)}}o(Hxe,"wrapFsPromise");function zxe(e){return function(t,...r){let n=r[r.length-1];t instanceof URL&&typeof n=="function"?tI(t).then(a=>{e(a,...r)},n):e(t,...r)}}o(zxe,"wrapFsCallback");Vt.promises.readFile=Hxe(Vt.promises.readFile);Vt.readFile=zxe(Vt.readFile);Vt.readFileSync=qxe(Vt.readFileSync);var{appendFile:Vxe,appendFileSync:Gxe,access:Kxe,accessSync:Yxe,chown:Zxe,chownSync:Xxe,chmod:Jxe,chmodSync:Qxe,close:eOe,closeSync:tOe,copyFile:rOe,copyFileSync:nOe,cp:iOe,cpSync:oOe,createReadStream:aOe,createWriteStream:sOe,exists:lOe,existsSync:fY,fchown:fOe,fchownSync:uOe,fchmod:cOe,fchmodSync:hOe,fdatasync:dOe,fdatasyncSync:pOe,fstat:yOe,fstatSync:mOe,fsync:gOe,fsyncSync:wOe,ftruncate:vOe,ftruncateSync:bOe,futimes:_Oe,futimesSync:EOe,lchown:SOe,lchownSync:AOe,lchmod:ROe,lchmodSync:TOe,link:xOe,linkSync:OOe,lstat:IOe,lstatSync:POe,mkdir:FOe,mkdirSync:kOe,mkdtemp:BOe,mkdtempSync:COe,open:LOe,openSync:NOe,opendir:DOe,opendirSync:$Oe,readdir:UOe,readdirSync:MOe,read:jOe,readSync:WOe,readv:qOe,readvSync:HOe,readFile:zOe,readFileSync:VOe,readlink:GOe,readlinkSync:KOe,realpath:YOe,realpathSync:ZOe,rename:XOe,renameSync:JOe,rm:QOe,rmSync:eIe,rmdir:tIe,rmdirSync:rIe,stat:nIe,statSync:iIe,symlink:oIe,symlinkSync:aIe,truncate:sIe,truncateSync:lIe,unwatchFile:fIe,unlink:uIe,unlinkSync:cIe,utimes:hIe,utimesSync:dIe,watch:pIe,watchFile:yIe,writeFile:mIe,writeFileSync:uY,write:gIe,writeSync:wIe,writev:vIe,writevSync:bIe,Dir:_Ie,Dirent:EIe,Stats:rI,ReadStream:SIe,WriteStream:AIe,FileReadStream:RIe,FileWriteStream:TIe,_toUnixTimestamp:xIe,constants:{F_OK:OIe,R_OK:IIe,W_OK:PIe,X_OK:FIe},constants:kIe,promises:BIe}=Vt;function Tv(e){return e&&e.gitCache!==void 0?e.gitCache:e&&e.parentFs?Tv(e.parentFs):{}}o(Tv,"getGitCacheFromFs");function cY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"commit-file",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitCommitFileVirtualFile",rootType:"file",getStats:o(async({filePath:a,pathParams:s,userSpaceFs:i})=>{if(!s.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!s.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let u=s.sha_1_1_2+s.sha1_3__40,h=await Nl({filePath:a,gitRoot:t,nodeFs:e,commitSha:u,pathParams:s,gitCache:Tv(i)});if(!h)throw new Ef(`ENOENT: no such file or directory, stat '${a}'`,a);let c=await Rv.default.readCommit({fs:Av,dir:t,oid:u}),{commit:d}=c,y=d.committer.timestamp*1e3;if(h.type==="tree")return{mode:420,size:0,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!0,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:y,mtimeMs:y,ctimeMs:y,birthtimeMs:y,atime:new Date(y),mtime:new Date(y),ctime:new Date(y),birthtime:new Date(y)};{let{blob:m}=await Rv.default.readBlob({fs:Av,dir:t,oid:h.oid});return{mode:420,size:m.length,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(m.length/4096),atimeMs:y,mtimeMs:y,ctimeMs:y,birthtimeMs:y,atime:new Date(y),mtime:new Date(y),ctime:new Date(y),birthtime:new Date(y)}}},"getStats"),getFile:o(async({filePath:a,pathParams:s,userSpaceFs:i})=>{if(!s.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!s.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let u=s.sha_1_1_2+s.sha1_3__40;try{let h=await Nl({filePath:a,gitRoot:t,nodeFs:e,commitSha:u,pathParams:s,gitCache:Tv(i)});if(!h)return;if(h.type==="blob"){let{blob:c}=await Rv.default.readBlob({fs:e,dir:t,oid:h.oid,cache:Tv(i)});return{type:"file",content:Buffer.from(c),mode:420,size:c.length,oid:h.oid}}else return{type:"directory",content:Array.from(new Set([...h.entries.filter(d=>d.name!==".keep")])).map(d=>({...d,name:d.name.toString(),path:`${a}`,parentPath:`${a}`})),mode:493}}catch{return}},"getFile"),rename(a){throw new Error("not implementsd")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(cY,"createCommitFileAdapter");var xv=Lt(Or(),1);function hY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"commit-folder",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitCommitVirtualFolder",rootType:"folder",getStats:o(async a=>{let s=t+"/.git";try{return await e.promises.stat(s)}catch{throw new Error(`ENOENT: no such file or directory, stat '${s}'`)}},"getStats"),getFile:o(async a=>{let{filePath:s,pathParams:i}=a,u=await xv.default.listBranches({fs:e,dir:t}),h=new Set,c=new Set;for(let m of u){let g=`refs/heads/${m}`;try{let v=await xv.default.resolveRef({fs:e,dir:t,ref:g});h.add(v)}catch{}}for(let m of h){let g=await xv.default.log({fs:e,dir:t,ref:m});for(let v of g)c.add(v.oid)}if(!i.sha_1_1_2){let m=new Set;for(let v of c)if(m.add(v.slice(0,2)),m.size>=256)break;let g=Array.from(m).sort().map(v=>bn({parent:s,name:v,isDir:!0}));return{type:"directory",content:g,mode:493,size:g}}let d=new Set;for(let m of c)m.startsWith(i.sha_1_1_2)&&d.add(m.slice(2,40));let y=Array.from(d).sort().map(m=>bn({parent:s,name:m,isDir:!0}));return{type:"directory",content:y,mode:493,size:y.length}},"getFile"),rename(a){throw new Error("not implementsd")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(hY,"createCommitFolderAdapter");var eo=Lt(Or(),1);function dY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branch-operation",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchOperationVirtualFile",rootType:"file",getStats:o(async a=>{let{pathParams:s}=a;s.branchName===void 0&&(s.branchName=await Et(t,e));let i=await it(e,t,s.branchName);if(!i)throw new Error(`Base Branch ${s.branchName} for operations does not exis`);let u=await Vi(e,t,s.branchName),h=!1;if(u)try{i=await eo.default.resolveRef({fs:e,dir:t,ref:u}),h=!0}catch{try{i=await eo.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${u}`}),h=!0}catch{}}let c=await eo.default.readCommit({fs:e,dir:t,oid:i}),{commit:d}=c,y=d.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:y,mtimeMs:y,ctimeMs:y,birthtimeMs:y,atime:new Date(y),mtime:new Date(y),ctime:new Date(y),birthtime:new Date(y),isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:o(async a=>{let{pathParams:s}=a;s.branchName===void 0&&(s.branchName=await Et(t,e));let i=await Vi(e,t,s.branchName),u,h=!1;if(i){if(u=await it(e,t,i),h=!0,!u)throw new Error(`Base Branch ${i} for operations does not exis`)}else if(u=await it(e,t,s.branchName),!u)throw new Error(`Base Branch ${s.branchName} for operations does not exis`);return{type:"file",content:Buffer.from(u),mode:420,size:u.length}},"getFile"),writeFile:o(async a=>{let{content:s,pathParams:i,author:u}=a;i.branchName===void 0&&(i.branchName=await Et(t,e));let h;typeof s=="string"?h=new TextEncoder().encode(s):h=new Uint8Array(s);let c=await eo.default.writeBlob({fs:e,dir:t,blob:h}),d=await it(e,t,i.branchName);if(!d)throw new Error("Invalid branch file path - branch doesn't exist");let y=await Vi(e,t,i.branchName),m=!1;if(!y){y=i.branchName+gA,await eo.default.branch({fs:e,dir:t,ref:Ht(y),object:d});let S=await eo.default.listBranches({fs:e,dir:t});m=!0}let g=await it(e,t,y),v=await eo.default.readTree({fs:e,dir:t,oid:d}),_;s instanceof ArrayBuffer?_=Buffer.from(s).toString("utf-8"):typeof s=="string"?_=s:s instanceof Uint8Array?_=Buffer.from(s).toString("utf-8"):_=String(s);let b=!1;if(!m){let S=await eo.default.findMergeBase({fs:e,dir:t,oids:b?[g]:[g,d]});S.length===1&&S[0]===d&&(b=!0)}let E=await eo.default.commit({fs:e,dir:t,message:_,tree:v.oid,noUpdateBranch:!0,author:u,parent:b?m?[d,d]:[g]:[g,d]});await eo.default.writeRef({fs:e,dir:t,ref:`refs/heads/${Ht(y)}`,value:E,force:!0})},"writeFile"),rename:o(async function(a){throw new Error("not implemented")},"rename"),mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(dY,"createBranchOperationAdapter");var nI=Lt(Or(),1);function pY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branch-history",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchHistory",rootType:"file",getStats:o(async({pathParams:a})=>{a.branchName===void 0&&(a.branchName=await Et(t,e));let s=await it(e,t,a.branchName);if(!s)throw new Error(`Branch ${a.branchName} does not exist`);let i=await nI.default.readCommit({fs:e,dir:t,oid:s}),{commit:u}=i,h=u.committer.timestamp*1e3;return{mode:420,size:1e5,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(.009765625),atimeMs:h,mtimeMs:h,ctimeMs:h,birthtimeMs:h,atime:new Date(h),mtime:new Date(h),ctime:new Date(h),birthtime:new Date(h)}},"getStats"),getFile:o(async a=>{let{pathParams:s}=a,i=s.branchName;i===void 0&&(i=await Et(t,e));let u=[];if(i){let c=await it(e,t,i),d=!1,y=c;for(;y&&!d;){let m=await nI.default.readCommit({fs:e,dir:t,oid:y});u.push({oid:m.oid,...m.commit}),y=m.commit.parent[0]}}let h=Buffer.from(JSON.stringify(u,null,2),"utf-8");return{type:"file",content:h,mode:420,size:h.length}},"getFile"),rename:o(async a=>{throw new Error("not implemented")},"rename"),mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(pY,"createBranchHistoryAdapter");var jf=Lt(Or(),1);function yY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"branch-operation-head",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitBranchOperationHeadVirtualFile",rootType:"file",getStats:o(async a=>{let{pathParams:s}=a;s.branchName===void 0&&(s.branchName=await Et(t,e));let i=await Vi(e,t,s.branchName);if(!i){let y=new Date(0);return{mode:420,size:0,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(.009765625),atimeMs:y.getTime(),mtimeMs:y.getTime(),ctimeMs:y.getTime(),birthtimeMs:y.getTime(),atime:y,mtime:y,ctime:y,birthtime:y}}let u=await it(e,t,i);if(!u)throw new Error(`Operation Branch ${i} for base branch ${s.branchName} does not exist`);let h=await jf.default.readCommit({fs:e,dir:t,oid:u}),{commit:c}=h,d=c.committer.timestamp*1e3;return{mode:420,size:40,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(.009765625),atimeMs:d,mtimeMs:d,ctimeMs:d,birthtimeMs:d,atime:new Date(d),mtime:new Date(d),ctime:new Date(d),birthtime:new Date(d)}},"getStats"),getFile:o(async a=>{let{pathParams:s}=a;s.branchName===void 0&&(s.branchName=await Et(t,e));let i=await Vi(e,t,s.branchName);if(!i)return{type:"file",content:"",mode:420,size:0};try{let u;try{u=await jf.default.resolveRef({fs:e,dir:t,ref:i})}catch{u=await jf.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}return{type:"file",content:u+`
213
213
  `,mode:420,size:u.length}}catch{return}},"getFile"),writeFile:o(async a=>{let{content:s,pathParams:i}=a;i.branchName===void 0&&(i.branchName=await Et(t,e));let u=await Vi(e,t,i.branchName);if(!u)throw new Error(`Operation branch name could not be resolved for branch ${i.branchName}`);let h=await it(e,t,u),c=s.toString().trim(),d,y,m=!1;if(!h)throw new Error(`Operation branch ref could not be resolved for branch ${u}`);let g=h;for(;g&&!m;){let v=await jf.default.readCommit({fs:e,dir:t,oid:g});if(v.oid===c&&(d=v.oid),g=v.commit.parent&&v.commit.parent.length>0?v.commit.parent[0]:null,v.commit.parent.length===2){if(v.commit.parent[0]===v.commit.parent[1])m=!0;else if(d!==void 0){y=v.commit.parent[1];break}}}if(d===void 0)throw new Error(`Cant rollback to ${c} couldn't find newOperationBranchHead ${d}`);if(y===void 0)throw new Error(`Cant rollback to ${c} couldn't find newBranchHead ${y}`);await jf.default.writeRef({fs:e,dir:t,ref:"refs/heads/"+u,value:d,force:!0}),await jf.default.writeRef({fs:e,dir:t,ref:"refs/heads/"+i.branchName,value:y,force:!0})},"writeFile"),rename(a){throw new Error("not implementsd")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(yY,"createBranchOperationHeadAdapter");var gY=Lt(Or(),1);var Ov=Lt(Or(),1);async function Wf(e,t){try{let r=await Ov.default.getConfig({fs:t,dir:e,path:"user.legit-reference-branch"});if(r)return yo(r)}catch{}try{let r=await Ov.default.getConfig({fs:t,dir:e,path:"init.defaultBranch"});return yo(r)||"main"}catch{return"main"}}o(Wf,"getReferenceBranch");async function mY(e,t,r){await Ov.default.setConfig({fs:t,dir:e,path:"user.legit-reference-branch",value:Ht(r)})}o(mY,"setReferenceBranch");function wY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"current-branch",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitCurrentBranchVirtualFile",rootType:"file",getStats:o(async a=>{let i=(await Et(t,e)).length;return{mode:420,size:i,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(i/4096),atimeMs:Date.now(),mtimeMs:Date.now(),ctimeMs:Date.now(),birthtimeMs:Date.now(),atime:new Date,mtime:new Date,ctime:new Date,birthtime:new Date}},"getStats"),getFile:o(async a=>{let s=await Et(t,e);return{type:"file",content:s+`
214
- `,mode:420,size:s.length+1}},"getFile"),writeFile:o(async a=>{let{content:s}=a,i=s.toString().trim();if(!await it(e,t,i)){let h=await Wf(t,e),c=await it(e,t,h);if(!c)throw new Error(`Ref branch ${h} does not exist in the repository`);await gY.default.branch({fs:e,dir:t,ref:Ht(i),object:c})}await QU(t,e,i)},"writeFile"),rename(a){throw new Error("not implemented")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(wY,"createCurrentBranchAdapter");var qf=Lt(Or(),1);function vY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"apply-changes",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitApplyCurrentChangesToVirtualFile",rootType:"file",getStats:o(async({pathParams:a,userSpaceFs:s})=>{let i=new Date(0);return{mode:420,size:40,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(.009765625),atimeMs:i,mtimeMs:i,ctimeMs:i,birthtimeMs:i,atime:i,mtime:i,ctime:i,birthtime:i}},"getStats"),getFile:o(async({pathParams:a,userSpaceFs:s})=>{try{return{type:"file",content:`
215
- `,mode:420,size:2}}catch{return}},"getFile"),writeFile:o(async a=>{let{content:s,userSpaceFs:i}=a,u=await Et(t,e),h=await Wf(t,e),c=s.toString().trim(),d=await it(e,t,u);if(!d)throw new Error(`Source branch ${u} does not exist`);let y=await it(e,t,h);if(!y)throw new Error(`Target branch ${h} does not exist`);let m=await qf.default.readTree({fs:e,dir:t,oid:d});if(await qf.default.readTree({fs:e,dir:t,oid:y})===m)return;let v=Math.floor(Date.now()/1e3),_=await qf.default.commit({fs:e,dir:t,message:c,tree:m.oid,noUpdateBranch:!0,author:{...a.author,timestamp:v},parent:[y]}),b=await qf.default.commit({fs:e,dir:t,message:"Changes from "+u+" applied to "+h,tree:m.oid,noUpdateBranch:!0,author:{...a.author,timestamp:v-3},parent:[d,_]});await qf.default.writeRef({fs:e,dir:t,ref:"refs/heads/"+Ht(h),value:_,force:!0}),await qf.default.writeRef({fs:e,dir:t,ref:"refs/heads/"+Ht(u),value:b,force:!0})},"writeFile"),rename(a){throw new Error("not implementsd")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(vY,"createApplyChangesAdapter");function bY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"reference-branch",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitReferenceBranchVirtualFile",rootType:"file",getStats:o(async a=>{let i=(await Wf(t,e)).length;return{mode:420,size:i,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(i/4096),atimeMs:Date.now(),mtimeMs:Date.now(),ctimeMs:Date.now(),birthtimeMs:Date.now(),atime:new Date,mtime:new Date,ctime:new Date,birthtime:new Date}},"getStats"),getFile:o(async a=>{let s=await Wf(t,e);return{type:"file",content:s+`
216
- `,mode:420,size:s.length+1}},"getFile"),writeFile:o(async a=>{let{content:s}=a,i=s.toString().trim();if(!await it(e,t,i))throw new Error(`Branch ${i} does not exist in the repository`);await mY(t,e,i)},"writeFile"),rename(a){throw new Error("not implemented")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(bY,"createReferenceBranchAdapter");var iI=class iI extends Jr{constructor({name:r,rootPath:n,passThroughFs:a}){super({name:r,rootPath:n});Ye(this,"openFh",new Map);Ye(this,"targetFs");this.targetFs=a}async responsible(r){return!0}fileType(){return 4}async open(r,n,a){let s=Gr(r),i=await this.targetFs.promises.open(r,n,a);return this.openFh.set(i.fd,i),new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:i.fd,parentFsFileDescriptors:[]})}async access(r,n){return await this.targetFs.promises.access(r,n)}async stat(r,...n){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,...n){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,n){let a=await this.targetFs.promises.opendir(r,n);return new Ka(this.compositeFs,r.toString())}async link(r,n){return await this.targetFs.promises.link(r,n)}async mkdir(r,n){await this.targetFs.promises.mkdir(r,n)}async readdir(r,...n){return this.targetFs.promises.readdir(r,...n)}async readlink(r,...n){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,n){return await this.targetFs.promises.rename(r,n)}async rmdir(r,n){return await this.targetFs.promises.rmdir(r,n)}async symlink(r,n,a){return await this.targetFs.promises.symlink(r,n,a)}async lookup(r){throw new Error(`lookup is not implemented for: ${Wt(r)}`)}async close(r){let n=this.openFh.get(r.subFsFileDescriptor);n&&(this.openFh.delete(r.subFsFileDescriptor),await n.close())}async dataSync(r){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.sync()}async read(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.read(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.chmod(n)}async fchown(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.chown(n,a)}async write(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.write(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.truncate(n)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.stat(n);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.utimes(n,a)}async writev(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.writev(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.readv(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,n){return this.targetFs.promises.readFile(r,n)}async writeFile(r,n,a){return this.targetFs.promises.writeFile(r,n,a)}};o(iI,"PassThroughToAsyncFsSubFs");var Iv=iI;function _Y(e){return typeof e=="object"&&e!==null&&e!==void 0&&!Array.isArray(e)}o(_Y,"isLegitRouteFolder");function EY(e,t){let r={...e};for(let n of Object.keys(t)){let a=e[n],s=t[n];a!==void 0&&_Y(a)&&_Y(s)?r[n]=EY(a,s):r[n]=s}return r}o(EY,"mergeLegitRouteFolders");function oI(e){return e&&e.gitCache!==void 0?e.gitCache:e&&e.parentFs?oI(e.parentFs):{}}o(oI,"getGitCache");async function u3e(e){let t=new Js.Volume,r=(0,Js.createFsFromVolume)(t);return CIe({...e,storageFs:e?.storageFs?e.storageFs:r,gitRoot:e?.gitRoot||"/"})}o(u3e,"openLegitFsWithMemoryFs");async function CIe({storageFs:e,gitRoot:t,anonymousBranch:r="anonymous",showKeepFiles:n=!1,initialAuthor:a={type:"local",id:"local",name:"Local User",email:"local@legitcontrol.com"},serverUrl:s="https://hub.legitcontrol.com",publicKey:i,ephemaralGitConfig:u=!1,additionalFilterLayers:h,routeOverrides:c}){await e.promises.readdir(t+"/.git").then(()=>!0).catch(()=>!1)||(await Lr.default.init({fs:e,dir:"/",defaultBranch:r}),await e.promises.writeFile(t+"/.gitignore",""),await e.promises.writeFile(t+"/.keep",""),await Lr.default.add({fs:e,dir:"/",filepath:".keep",cache:oI(e)}),await Lr.default.commit({fs:e,dir:"/",message:"Initial commit",author:{name:"Test",email:"test@example.com"},cache:oI(e)}),await Lr.default.setConfig({fs:e,dir:t,path:"init.defaultBranch",value:r})),await Lr.default.getConfig({fs:e,dir:t,path:"user.legit_user_id"})||await Lr.default.setConfig({fs:e,dir:t,path:"user.legit_user_id",value:a.name}),await Lr.default.getConfig({fs:e,dir:t,path:"user.name"})||await Lr.default.setConfig({fs:e,dir:t,path:"user.name",value:a.name}),await Lr.default.getConfig({fs:e,dir:t,path:"user.email"})||await Lr.default.setConfig({fs:e,dir:t,path:"user.email",value:a.email});let v=(0,Js.createFsFromVolume)(new Js.Volume),_=new Nh({name:"root-copy-on-write",sourceFs:e,copyToFs:v,copyToRootPath:"/copies",rootPath:t,patterns:u?["**/.git/config"]:[]}),b=new Iv({name:"root-passthrough",passThroughFs:e,rootPath:t}),E=new ch({name:"root",filterLayers:[_],rootPath:t,routes:{"[[...relativePath]]":b}}),S={gitStorageFs:E,gitRoot:t,rootPath:t},T=XU(S),x=dY(S),A=oz(S),B=yY(S),P=tM(S),N=pY(S),L=wY(S),C=bY(S),z=vY(S),V=iz(S),Q=rz(S),X=hY(S),ue=cY(S),ge=n?[".git"]:[".git",".keep"],oe=new Jp({name:"git-hidden-subfs",hiddenFiles:ge,rootPath:t}),W=[];try{let q=t+"/.gitignore";W=(await E.readFile(q,"utf8")).split(`
217
- `).filter(he=>he.trim()!==""&&!he.trim().startsWith("#")).map(he=>he.trim())}catch{}let ae=["**/._*","**/.DS_Store","**/.AppleDouble/","**/.AppleDB","**/.AppleDesktop","**/.Spotlight-V100","**/.TemporaryItems","**/.Trashes","**/.fseventsd","**/.VolumeIcon.icns","**/.ql_disablethumbnails","**/.~lock.*","**/lu[0-9a-zA-Z]*.tmp","**/.metaentries.json.tmp","**/**.tmp.**","**/**.sb-**",...W],U=(0,Js.createFsFromVolume)(new Js.Volume),Y=new Nh({name:"git-copy-on-write-subfs",sourceFs:E,copyToFs:U,copyToRootPath:"/user-copies",rootPath:t,patterns:ae}),J={".legit":{".":T,operation:x,head:A,operationHead:B,operationHistory:P,history:N,currentBranch:L,"reference-branch":C,"apply-changes":z,branches:{".":V,"[branchName]":{".legit":{".":T,operation:x,head:A,operationHead:B,operationHistory:P,history:N},"[[...filePath]]":Q}},commits:{".":X,"[sha_1_1_2]":{".":X,"[sha1_3__40]":{"[[...filePath]]":ue}}}},"[[...filePath]]":Q},Z=c?EY(J,c):J,re=new ch({name:"git",rootPath:t,filterLayers:[oe,Y,...h||[]],routes:Z}),we=tz({storageFs:E,gitRoot:t}),Ae=X7(we,i),D=I9({fs:e,gitRepoPath:t,serverUrl:s,auth:Ae,anonymousBranch:r}),$=Object.assign(re,{auth:Ae,sync:D,_storageFs:E,setLogger(q){re.setLoggger(q)},push:o(async q=>{},"push"),shareCurrentBranch:o(async()=>{if((await Ae.getUser()).type==="local")throw new Error("login first - for example anonymously using legitfs.auth.signInAnonymously()");let q=await $.getCurrentBranch();return q===r&&(q=(await Ae.getUser()).id,await Lr.default.renameBranch({fs:e,dir:t,oldref:r,ref:q})),await D.sequentialPush([q]),$.setCurrentBranch(q),q},"shareCurrentBranch"),setCurrentBranch:o(async q=>{(await Lr.default.listBranches({fs:e,dir:t})).includes(q)||await D?.loadBranch(q);let I=(await Lr.default.listBranches({fs:e,dir:t})).includes(q);if(console.log("branchExistsAfter",I),!I)throw new Error(`Branch ${q} does not exist`);await Lr.default.setConfig({fs:e,dir:t,path:"init.defaultBranch",value:q})},"setCurrentBranch"),getCurrentBranch:o(async()=>{let q=await Lr.default.getConfig({fs:e,dir:t,path:"init.defaultBranch"});if(!q)throw new Error("No current branch set");return q},"getCurrentBranch"),loadArchive:o(async({legitArchive:q,clearExisting:ne=!1})=>{let he=Z7(q),F=new TextDecoder().decode(he),I=JSON.parse(F),j=new Map;if(ne){let te=`${t}/.git`,be=await e.promises.readdir(te,{withFileTypes:!0});for(let ce of be){let se=`${te}/${ce.name}`;ce.isDirectory()?await e.promises.rm(se,{recursive:!0,force:!0}):ce.isFile()&&await e.promises.unlink(se)}}else try{let te=await Lr.default.listBranches({fs:e,dir:t});for(let be of te){let ce=await Lr.default.resolveRef({fs:e,dir:t,ref:be});j.set(be,ce)}}catch{}for(let[te,be]of Object.entries(I.files)){let ce=`${t}/.git/${te}`;if(te==="config")continue;let se=Buffer.from(be,"base64");if(te.startsWith("refs/heads/")||te.startsWith("refs/tags/")){let de=te.replace(/^refs\/(heads|tags)\//,"");if(!j.has(de))await e.promises.mkdir(ce.split("/").slice(0,-1).join("/"),{recursive:!0}),await e.promises.writeFile(ce,se);else{let Re=j.get(de),Ee=se.toString("utf-8").trim();try{if(await Lr.default.isDescendent({fs:e,dir:t,oid:Ee,ancestor:Re})||Re===Ee)await e.promises.writeFile(ce,se);else{let Ge=`${de}-conflict-${crypto.randomUUID()}`,Le=`${t}/.git/refs/heads/${Ge}`;await e.promises.mkdir(Le.split("/").slice(0,-1).join("/"),{recursive:!0}),await e.promises.writeFile(Le,se)}}catch{let Ge=`${de}-conflict-${crypto.randomUUID()}`,Le=`${t}/.git/refs/heads/${Ge}`;await e.promises.mkdir(Le.split("/").slice(0,-1).join("/"),{recursive:!0}),await e.promises.writeFile(Le,se)}}}else await e.promises.mkdir(ce.split("/").slice(0,-1).join("/"),{recursive:!0}),await e.promises.writeFile(ce,se)}},"loadArchive"),saveArchive:o(async()=>{let q={version:1,files:{}};async function ne(be,ce=""){let se=await e.promises.readdir(be,{withFileTypes:!0});for(let de of se){let Re=`${be}/${de.name}`,Ee=ce?`${ce}/${de.name}`:de.name;if(de.isDirectory())await ne(Re,Ee);else if(de.isFile()){let Te=await e.promises.readFile(Re);q.files[Ee]=Buffer.from(Te).toString("base64")}}}o(ne,"readDirectoryRecursive");let he=`${t}/.git`;try{await ne(he)}catch(be){console.warn("Failed to read .git folder:",be)}let F=JSON.stringify(q),j=new TextEncoder().encode(F);return Y7(j)},"saveArchive")});return $}o(CIe,"openLegitFs");var d3e=o(e=>async t=>{if(!t.path.includes(".legit/branches/")||(t.path.match(/\.legit/g)||[]).length>1)return;let[r,n]=t.path.split(".legit/branches/"),[a,...s]=n.split("/"),i=s.join("/"),u=r+".legit/branches/"+a+"/.legit/operation",h=JSON.stringify(t.operationArgs,(c,d)=>Buffer.isBuffer(d)?{__buffer__:d.toString("base64")}:d);console.log(u,`[${t.fsName}].${t.operation}(${t.fd?t.fd.fd+" - ":""}${t.path})
214
+ `,mode:420,size:s.length+1}},"getFile"),writeFile:o(async a=>{let{content:s}=a,i=s.toString().trim();if(i.length===0)return;if(!await it(e,t,i)){let h=await Wf(t,e),c=await it(e,t,h);if(!c)throw new Error(`Ref branch ${h} does not exist in the repository`);await gY.default.branch({fs:e,dir:t,ref:Ht(i),object:c})}await QU(t,e,i)},"writeFile"),rename(a){throw new Error("not implemented")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(wY,"createCurrentBranchAdapter");var qf=Lt(Or(),1);function vY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"apply-changes",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitApplyCurrentChangesToVirtualFile",rootType:"file",getStats:o(async({pathParams:a,userSpaceFs:s})=>{let i=new Date(0);return{mode:420,size:40,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(.009765625),atimeMs:i,mtimeMs:i,ctimeMs:i,birthtimeMs:i,atime:i,mtime:i,ctime:i,birthtime:i}},"getStats"),getFile:o(async({pathParams:a,userSpaceFs:s})=>{try{return{type:"file",content:`
215
+ `,mode:420,size:2}}catch{return}},"getFile"),writeFile:o(async a=>{let{content:s,userSpaceFs:i}=a,u=await Et(t,e),h=await Wf(t,e),c=s.toString().trim();if(c.length===0)return;let d=await it(e,t,u);if(!d)throw new Error(`Source branch ${u} does not exist`);let y=await it(e,t,h);if(!y)throw new Error(`Target branch ${h} does not exist`);let m=await qf.default.readTree({fs:e,dir:t,oid:d});if(await qf.default.readTree({fs:e,dir:t,oid:y})===m)return;let v=Math.floor(Date.now()/1e3),_=await qf.default.commit({fs:e,dir:t,message:c,tree:m.oid,noUpdateBranch:!0,author:{...a.author,timestamp:v},parent:[y]}),b=await qf.default.commit({fs:e,dir:t,message:"Changes from "+u+" applied to "+h,tree:m.oid,noUpdateBranch:!0,author:{...a.author,timestamp:v-3},parent:[d,_]});await qf.default.writeRef({fs:e,dir:t,ref:"refs/heads/"+Ht(h),value:_,force:!0}),await qf.default.writeRef({fs:e,dir:t,ref:"refs/heads/"+Ht(u),value:b,force:!0})},"writeFile"),rename(a){throw new Error("not implementsd")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(vY,"createApplyChangesAdapter");function bY({gitStorageFs:e,gitRoot:t,rootPath:r}){return new It({name:"reference-branch",gitStorageFs:e,gitRoot:t,rootPath:r||t,handler:{type:"gitReferenceBranchVirtualFile",rootType:"file",getStats:o(async a=>{let i=(await Wf(t,e)).length;return{mode:420,size:i,isFile:o(()=>!0,"isFile"),isDirectory:o(()=>!1,"isDirectory"),isSymbolicLink:o(()=>!1,"isSymbolicLink"),isBlockDevice:o(()=>!1,"isBlockDevice"),isCharacterDevice:o(()=>!1,"isCharacterDevice"),isSocket:o(()=>!1,"isSocket"),isFIFO:o(()=>!1,"isFIFO"),isFileSync:o(()=>!0,"isFileSync"),isDirectorySync:o(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(i/4096),atimeMs:Date.now(),mtimeMs:Date.now(),ctimeMs:Date.now(),birthtimeMs:Date.now(),atime:new Date,mtime:new Date,ctime:new Date,birthtime:new Date}},"getStats"),getFile:o(async a=>{let s=await Wf(t,e);return{type:"file",content:s+`
216
+ `,mode:420,size:s.length+1}},"getFile"),writeFile:o(async a=>{let{content:s}=a,i=s.toString().trim();if(i.length===0)return;if(!await it(e,t,i))throw new Error(`Branch ${i} does not exist in the repository`);await mY(t,e,i)},"writeFile"),rename(a){throw new Error("not implemented")},mkdir:o(async function(a){throw new Error("not implemented")},"mkdir")}})}o(bY,"createReferenceBranchAdapter");var iI=class iI extends Jr{constructor({name:r,rootPath:n,passThroughFs:a}){super({name:r,rootPath:n});Ye(this,"openFh",new Map);Ye(this,"targetFs");this.targetFs=a}async responsible(r){return!0}fileType(){return 4}async open(r,n,a){let s=Gr(r),i=await this.targetFs.promises.open(r,n,a);return this.openFh.set(i.fd,i),new xn({fs:this,compositeFs:this.compositeFs,subFsFileDescriptor:i.fd,parentFsFileDescriptors:[]})}async access(r,n){return await this.targetFs.promises.access(r,n)}async stat(r,...n){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,...n){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,n){let a=await this.targetFs.promises.opendir(r,n);return new Ka(this.compositeFs,r.toString())}async link(r,n){return await this.targetFs.promises.link(r,n)}async mkdir(r,n){await this.targetFs.promises.mkdir(r,n)}async readdir(r,...n){return this.targetFs.promises.readdir(r,...n)}async readlink(r,...n){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,n){return await this.targetFs.promises.rename(r,n)}async rmdir(r,n){return await this.targetFs.promises.rmdir(r,n)}async symlink(r,n,a){return await this.targetFs.promises.symlink(r,n,a)}async lookup(r){throw new Error(`lookup is not implemented for: ${Wt(r)}`)}async close(r){let n=this.openFh.get(r.subFsFileDescriptor);n&&(this.openFh.delete(r.subFsFileDescriptor),await n.close())}async dataSync(r){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.sync()}async read(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.read(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.chmod(n)}async fchown(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.chown(n,a)}async write(r,n,a,s,i){let u=this.openFh.get(r.subFsFileDescriptor);if(u)return await u.write(n,a,s,i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.truncate(n)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,n){let a=this.openFh.get(r.subFsFileDescriptor);if(a)return await a.stat(n);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.utimes(n,a)}async writev(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.writev(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,n,a){let s=this.openFh.get(r.subFsFileDescriptor);if(s)return await s.readv(n,a??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,n){return this.targetFs.promises.readFile(r,n)}async writeFile(r,n,a){return this.targetFs.promises.writeFile(r,n,a)}};o(iI,"PassThroughToAsyncFsSubFs");var Iv=iI;function _Y(e){return typeof e=="object"&&e!==null&&e!==void 0&&!Array.isArray(e)}o(_Y,"isLegitRouteFolder");function EY(e,t){let r={...e};for(let n of Object.keys(t)){let a=e[n],s=t[n];a!==void 0&&_Y(a)&&_Y(s)?r[n]=EY(a,s):r[n]=s}return r}o(EY,"mergeLegitRouteFolders");function oI(e){return e&&e.gitCache!==void 0?e.gitCache:e&&e.parentFs?oI(e.parentFs):{}}o(oI,"getGitCache");async function u3e(e){let t=new Js.Volume,r=(0,Js.createFsFromVolume)(t);return CIe({...e,storageFs:e?.storageFs?e.storageFs:r,gitRoot:e?.gitRoot||"/"})}o(u3e,"openLegitFsWithMemoryFs");async function CIe({storageFs:e,gitRoot:t,anonymousBranch:r="anonymous",showKeepFiles:n=!1,initialAuthor:a={type:"local",id:"local",name:"Local User",email:"local@legitcontrol.com"},serverUrl:s="https://hub.legitcontrol.com",publicKey:i,ephemaralGitConfig:u=!1,additionalFilterLayers:h,routeOverrides:c}){await e.promises.readdir(t+"/.git").then(()=>!0).catch(()=>!1)||(await Lr.default.init({fs:e,dir:"/",defaultBranch:r}),await e.promises.writeFile(t+"/.gitignore",""),await e.promises.writeFile(t+"/.keep",""),await Lr.default.add({fs:e,dir:"/",filepath:".keep",cache:oI(e)}),await Lr.default.commit({fs:e,dir:"/",message:"Initial commit",author:{name:"Test",email:"test@example.com"},cache:oI(e)}),await Lr.default.setConfig({fs:e,dir:t,path:"init.defaultBranch",value:r})),await Lr.default.getConfig({fs:e,dir:t,path:"user.legit_user_id"})||await Lr.default.setConfig({fs:e,dir:t,path:"user.legit_user_id",value:a.name}),await Lr.default.getConfig({fs:e,dir:t,path:"user.name"})||await Lr.default.setConfig({fs:e,dir:t,path:"user.name",value:a.name}),await Lr.default.getConfig({fs:e,dir:t,path:"user.email"})||await Lr.default.setConfig({fs:e,dir:t,path:"user.email",value:a.email});let v=(0,Js.createFsFromVolume)(new Js.Volume),_=new Nh({name:"root-copy-on-write",sourceFs:e,copyToFs:v,copyToRootPath:"/copies",rootPath:t,patterns:u?["**/.git/config"]:[]}),b=new Iv({name:"root-passthrough",passThroughFs:e,rootPath:t}),E=new ch({name:"root",filterLayers:[_],rootPath:t,routes:{"[[...relativePath]]":b}}),S={gitStorageFs:E,gitRoot:t,rootPath:t},T=XU(S),x=dY(S),A=oz(S),B=yY(S),P=tM(S),N=pY(S),L=wY(S),C=bY(S),z=vY(S),V=iz(S),Q=rz(S),X=hY(S),ue=cY(S),ge=n?[".git"]:[".git",".keep"],oe=new Jp({name:"git-hidden-subfs",hiddenFiles:ge,rootPath:t}),W=[];try{let q=t+"/.gitignore";W=(await E.readFile(q,"utf8")).split(`
217
+ `).filter(he=>he.trim()!==""&&!he.trim().startsWith("#")).map(he=>he.trim())}catch{}let ae=["**/._*","**/.DS_Store","**/.AppleDouble/","**/.AppleDB","**/.AppleDesktop","**/.Spotlight-V100","**/.TemporaryItems","**/.Trashes","**/.fseventsd","**/.VolumeIcon.icns","**/.ql_disablethumbnails","**/.~lock.*","**/lu[0-9a-zA-Z]*.tmp","**/.metaentries.json.tmp","**/**.tmp.**","**/**.sb-**",...W],U=(0,Js.createFsFromVolume)(new Js.Volume),Y=new Nh({name:"git-copy-on-write-subfs",sourceFs:E,copyToFs:U,copyToRootPath:"/user-copies",rootPath:t,patterns:ae}),J={".legit":{".":T,operation:x,head:A,operationHead:B,operationHistory:P,history:N,currentBranch:L,"reference-branch":C,"apply-changes":z,branches:{".":V,"[branchName]":{".legit":{".":T,operation:x,head:A,operationHead:B,operationHistory:P,history:N},"[[...filePath]]":Q}},commits:{".":X,"[sha_1_1_2]":{".":X,"[sha1_3__40]":{"[[...filePath]]":ue}}}},"[[...filePath]]":{".":Q}},Z=c?EY(J,c):J,re=new ch({name:"git",rootPath:t,filterLayers:[oe,Y,...h||[]],routes:Z}),we=tz({storageFs:E,gitRoot:t}),Ae=X7(we,i),D=I9({fs:e,gitRepoPath:t,serverUrl:s,auth:Ae,anonymousBranch:r}),$=Object.assign(re,{auth:Ae,sync:D,_storageFs:E,setLogger(q){re.setLoggger(q)},push:o(async q=>{},"push"),shareCurrentBranch:o(async()=>{if((await Ae.getUser()).type==="local")throw new Error("login first - for example anonymously using legitfs.auth.signInAnonymously()");let q=await $.getCurrentBranch();return q===r&&(q=(await Ae.getUser()).id,await Lr.default.renameBranch({fs:e,dir:t,oldref:r,ref:q})),await D.sequentialPush([q]),$.setCurrentBranch(q),q},"shareCurrentBranch"),setCurrentBranch:o(async q=>{(await Lr.default.listBranches({fs:e,dir:t})).includes(q)||await D?.loadBranch(q);let I=(await Lr.default.listBranches({fs:e,dir:t})).includes(q);if(console.log("branchExistsAfter",I),!I)throw new Error(`Branch ${q} does not exist`);await Lr.default.setConfig({fs:e,dir:t,path:"init.defaultBranch",value:q})},"setCurrentBranch"),getCurrentBranch:o(async()=>{let q=await Lr.default.getConfig({fs:e,dir:t,path:"init.defaultBranch"});if(!q)throw new Error("No current branch set");return q},"getCurrentBranch"),loadArchive:o(async({legitArchive:q,clearExisting:ne=!1})=>{let he=Z7(q),F=new TextDecoder().decode(he),I=JSON.parse(F),j=new Map;if(ne){let te=`${t}/.git`,be=await e.promises.readdir(te,{withFileTypes:!0});for(let ce of be){let se=`${te}/${ce.name}`;ce.isDirectory()?await e.promises.rm(se,{recursive:!0,force:!0}):ce.isFile()&&await e.promises.unlink(se)}}else try{let te=await Lr.default.listBranches({fs:e,dir:t});for(let be of te){let ce=await Lr.default.resolveRef({fs:e,dir:t,ref:be});j.set(be,ce)}}catch{}for(let[te,be]of Object.entries(I.files)){let ce=`${t}/.git/${te}`;if(te==="config")continue;let se=Buffer.from(be,"base64");if(te.startsWith("refs/heads/")||te.startsWith("refs/tags/")){let de=te.replace(/^refs\/(heads|tags)\//,"");if(!j.has(de))await e.promises.mkdir(ce.split("/").slice(0,-1).join("/"),{recursive:!0}),await e.promises.writeFile(ce,se);else{let Re=j.get(de),Ee=se.toString("utf-8").trim();try{if(await Lr.default.isDescendent({fs:e,dir:t,oid:Ee,ancestor:Re})||Re===Ee)await e.promises.writeFile(ce,se);else{let Ge=`${de}-conflict-${crypto.randomUUID()}`,Le=`${t}/.git/refs/heads/${Ge}`;await e.promises.mkdir(Le.split("/").slice(0,-1).join("/"),{recursive:!0}),await e.promises.writeFile(Le,se)}}catch{let Ge=`${de}-conflict-${crypto.randomUUID()}`,Le=`${t}/.git/refs/heads/${Ge}`;await e.promises.mkdir(Le.split("/").slice(0,-1).join("/"),{recursive:!0}),await e.promises.writeFile(Le,se)}}}else await e.promises.mkdir(ce.split("/").slice(0,-1).join("/"),{recursive:!0}),await e.promises.writeFile(ce,se)}},"loadArchive"),saveArchive:o(async()=>{let q={version:1,files:{}};async function ne(be,ce=""){let se=await e.promises.readdir(be,{withFileTypes:!0});for(let de of se){let Re=`${be}/${de.name}`,Ee=ce?`${ce}/${de.name}`:de.name;if(de.isDirectory())await ne(Re,Ee);else if(de.isFile()){let Te=await e.promises.readFile(Re);q.files[Ee]=Buffer.from(Te).toString("base64")}}}o(ne,"readDirectoryRecursive");let he=`${t}/.git`;try{await ne(he)}catch(be){console.warn("Failed to read .git folder:",be)}let F=JSON.stringify(q),j=new TextEncoder().encode(F);return Y7(j)},"saveArchive")});return $}o(CIe,"openLegitFs");var d3e=o(e=>async t=>{if(!t.path.includes(".legit/branches/")||(t.path.match(/\.legit/g)||[]).length>1)return;let[r,n]=t.path.split(".legit/branches/"),[a,...s]=n.split("/"),i=s.join("/"),u=r+".legit/branches/"+a+"/.legit/operation",h=JSON.stringify(t.operationArgs,(c,d)=>Buffer.isBuffer(d)?{__buffer__:d.toString("base64")}:d);console.log(u,`[${t.fsName}].${t.operation}(${t.fd?t.fd.fd+" - ":""}${t.path})
218
218
 
219
219
  ${h}
220
220