UNPKG

@negoziator/ai-commit

Version:

Writes your git commit messages for you with AI

13 lines (12 loc) 19.6 kB
var se=Object.defineProperty;var i=(y,u)=>se(y,"name",{value:u,configurable:!0});import H from"net";import ie from"tls";import ce from"assert";import U from"tty";import ue from"util";import ae from"os";import G from"http";import z from"https";import fe from"url";var x={},j={exports:{}},T={exports:{}},B,V;function le(){if(V)return B;V=1;var y=1e3,u=y*60,h=u*60,r=h*24,l=r*7,_=r*365.25;B=i(function(s,t){t=t||{};var e=typeof s;if(e==="string"&&s.length>0)return v(s);if(e==="number"&&isFinite(s))return t.long?n(s):O(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},"ms");function v(s){if(s=String(s),!(s.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(t){var e=parseFloat(t[1]),o=(t[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return e*_;case"weeks":case"week":case"w":return e*l;case"days":case"day":case"d":return e*r;case"hours":case"hour":case"hrs":case"hr":case"h":return e*h;case"minutes":case"minute":case"mins":case"min":case"m":return e*u;case"seconds":case"second":case"secs":case"sec":case"s":return e*y;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}i(v,"parse");function O(s){var t=Math.abs(s);return t>=r?Math.round(s/r)+"d":t>=h?Math.round(s/h)+"h":t>=u?Math.round(s/u)+"m":t>=y?Math.round(s/y)+"s":s+"ms"}i(O,"fmtShort");function n(s){var t=Math.abs(s);return t>=r?f(s,t,r,"day"):t>=h?f(s,t,h,"hour"):t>=u?f(s,t,u,"minute"):t>=y?f(s,t,y,"second"):s+" ms"}i(n,"fmtLong");function f(s,t,e,o){var c=t>=e*1.5;return Math.round(s/e)+" "+o+(c?"s":"")}return i(f,"plural"),B}i(le,"requireMs");var q,J;function W(){if(J)return q;J=1;function y(u){r.debug=r,r.default=r,r.coerce=f,r.disable=O,r.enable=_,r.enabled=n,r.humanize=le(),r.destroy=s,Object.keys(u).forEach(t=>{r[t]=u[t]}),r.names=[],r.skips=[],r.formatters={};function h(t){let e=0;for(let o=0;o<t.length;o++)e=(e<<5)-e+t.charCodeAt(o),e|=0;return r.colors[Math.abs(e)%r.colors.length]}i(h,"selectColor"),r.selectColor=h;function r(t){let e,o=null,c,p;function g(...a){if(!g.enabled)return;const d=g,C=Number(new Date),m=C-(e||C);d.diff=m,d.prev=e,d.curr=C,e=C,a[0]=r.coerce(a[0]),typeof a[0]!="string"&&a.unshift("%O");let b=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(S,P)=>{if(S==="%%")return"%";b++;const I=r.formatters[P];if(typeof I=="function"){const E=a[b];S=I.call(d,E),a.splice(b,1),b--}return S}),r.formatArgs.call(d,a),(d.log||r.log).apply(d,a)}return i(g,"debug"),g.namespace=t,g.useColors=r.useColors(),g.color=r.selectColor(t),g.extend=l,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:i(()=>o!==null?o:(c!==r.namespaces&&(c=r.namespaces,p=r.enabled(t)),p),"get"),set:i(a=>{o=a},"set")}),typeof r.init=="function"&&r.init(g),g}i(r,"createDebug");function l(t,e){const o=r(this.namespace+(typeof e>"u"?":":e)+t);return o.log=this.log,o}i(l,"extend");function _(t){r.save(t),r.namespaces=t,r.names=[],r.skips=[];const e=(typeof t=="string"?t:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const o of e)o[0]==="-"?r.skips.push(o.slice(1)):r.names.push(o)}i(_,"enable");function v(t,e){let o=0,c=0,p=-1,g=0;for(;o<t.length;)if(c<e.length&&(e[c]===t[o]||e[c]==="*"))e[c]==="*"?(p=c,g=o,c++):(o++,c++);else if(p!==-1)c=p+1,g++,o=g;else return!1;for(;c<e.length&&e[c]==="*";)c++;return c===e.length}i(v,"matchesTemplate");function O(){const t=[...r.names,...r.skips.map(e=>"-"+e)].join(",");return r.enable(""),t}i(O,"disable");function n(t){for(const e of r.skips)if(v(t,e))return!1;for(const e of r.names)if(v(t,e))return!0;return!1}i(n,"enabled");function f(t){return t instanceof Error?t.stack||t.message:t}i(f,"coerce");function s(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return i(s,"destroy"),r.enable(r.load()),r}return i(y,"setup"),q=y,q}i(W,"requireCommon");var Y;function de(){return Y||(Y=1,(function(y,u){u.formatArgs=r,u.save=l,u.load=_,u.useColors=h,u.storage=v(),u.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),u.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function h(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}i(h,"useColors");function r(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+y.exports.humanize(this.diff),!this.useColors)return;const f="color: "+this.color;n.splice(1,0,f,"color: inherit");let s=0,t=0;n[0].replace(/%[a-zA-Z%]/g,e=>{e!=="%%"&&(s++,e==="%c"&&(t=s))}),n.splice(t,0,f)}i(r,"formatArgs"),u.log=console.debug||console.log||(()=>{});function l(n){try{n?u.storage.setItem("debug",n):u.storage.removeItem("debug")}catch{}}i(l,"save");function _(){let n;try{n=u.storage.getItem("debug")||u.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=process.env.DEBUG),n}i(_,"load");function v(){try{return localStorage}catch{}}i(v,"localstorage"),y.exports=W()(u);const{formatters:O}=y.exports;O.j=function(n){try{return JSON.stringify(n)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}})(T,T.exports)),T.exports}i(de,"requireBrowser");var N={exports:{}},D,K;function pe(){return K||(K=1,D=i((y,u=process.argv)=>{const h=y.startsWith("-")?"":y.length===1?"-":"--",r=u.indexOf(h+y),l=u.indexOf("--");return r!==-1&&(l===-1||r<l)},"hasFlag")),D}i(pe,"requireHasFlag");var L,Z;function he(){if(Z)return L;Z=1;const y=ae,u=U,h=pe(),{env:r}=process;let l;h("no-color")||h("no-colors")||h("color=false")||h("color=never")?l=0:(h("color")||h("colors")||h("color=true")||h("color=always"))&&(l=1),"FORCE_COLOR"in r&&(r.FORCE_COLOR==="true"?l=1:r.FORCE_COLOR==="false"?l=0:l=r.FORCE_COLOR.length===0?1:Math.min(parseInt(r.FORCE_COLOR,10),3));function _(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}i(_,"translateLevel");function v(n,f){if(l===0)return 0;if(h("color=16m")||h("color=full")||h("color=truecolor"))return 3;if(h("color=256"))return 2;if(n&&!f&&l===void 0)return 0;const s=l||0;if(r.TERM==="dumb")return s;if(process.platform==="win32"){const t=y.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(t=>t in r)||r.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if(r.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in r){const t=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:s}i(v,"supportsColor");function O(n){const f=v(n,n&&n.isTTY);return _(f)}return i(O,"getSupportLevel"),L={supportsColor:O,stdout:_(v(!0,u.isatty(1))),stderr:_(v(!0,u.isatty(2)))},L}i(he,"requireSupportsColor");var Q;function Ce(){return Q||(Q=1,(function(y,u){const h=U,r=ue;u.init=s,u.log=O,u.formatArgs=_,u.save=n,u.load=f,u.useColors=l,u.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),u.colors=[6,2,3,4,5,1];try{const e=he();e&&(e.stderr||e).level>=2&&(u.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}u.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,o)=>{const c=o.substring(6).toLowerCase().replace(/_([a-z])/g,(g,a)=>a.toUpperCase());let p=process.env[o];return/^(yes|on|true|enabled)$/i.test(p)?p=!0:/^(no|off|false|disabled)$/i.test(p)?p=!1:p==="null"?p=null:p=Number(p),e[c]=p,e},{});function l(){return"colors"in u.inspectOpts?!!u.inspectOpts.colors:h.isatty(process.stderr.fd)}i(l,"useColors");function _(e){const{namespace:o,useColors:c}=this;if(c){const p=this.color,g="\x1B[3"+(p<8?p:"8;5;"+p),a=` ${g};1m${o} \x1B[0m`;e[0]=a+e[0].split(` `).join(` `+a),e.push(g+"m+"+y.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=v()+o+" "+e[0]}i(_,"formatArgs");function v(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}i(v,"getDate");function O(...e){return process.stderr.write(r.formatWithOptions(u.inspectOpts,...e)+` `)}i(O,"log");function n(e){e?process.env.DEBUG=e:delete process.env.DEBUG}i(n,"save");function f(){return process.env.DEBUG}i(f,"load");function s(e){e.inspectOpts={};const o=Object.keys(u.inspectOpts);for(let c=0;c<o.length;c++)e.inspectOpts[o[c]]=u.inspectOpts[o[c]]}i(s,"init"),y.exports=W()(u);const{formatters:t}=y.exports;t.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(` `).map(o=>o.trim()).join(" ")},t.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})(N,N.exports)),N.exports}i(Ce,"requireNode");var X;function ee(){return X||(X=1,typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?j.exports=de():j.exports=Ce()),j.exports}i(ee,"requireSrc");var R={},w={},te;function ye(){if(te)return w;te=1;var y=w&&w.__createBinding||(Object.create?(function(n,f,s,t){t===void 0&&(t=s);var e=Object.getOwnPropertyDescriptor(f,s);(!e||("get"in e?!f.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:i(function(){return f[s]},"get")}),Object.defineProperty(n,t,e)}):(function(n,f,s,t){t===void 0&&(t=s),n[t]=f[s]})),u=w&&w.__setModuleDefault||(Object.create?(function(n,f){Object.defineProperty(n,"default",{enumerable:!0,value:f})}):function(n,f){n.default=f}),h=w&&w.__importStar||function(n){if(n&&n.__esModule)return n;var f={};if(n!=null)for(var s in n)s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)&&y(f,n,s);return u(f,n),f};Object.defineProperty(w,"__esModule",{value:!0}),w.req=w.json=w.toBuffer=void 0;const r=h(G),l=h(z);async function _(n){let f=0;const s=[];for await(const t of n)f+=t.length,s.push(t);return Buffer.concat(s,f)}i(_,"toBuffer"),w.toBuffer=_;async function v(n){const s=(await _(n)).toString("utf8");try{return JSON.parse(s)}catch(t){const e=t;throw e.message+=` (input: ${s})`,e}}i(v,"json"),w.json=v;function O(n,f={}){const t=((typeof n=="string"?n:n.href).startsWith("https:")?l:r).request(n,f),e=new Promise((o,c)=>{t.once("response",o).once("error",c).end()});return t.then=e.then.bind(e),t}return i(O,"req"),w.req=O,w}i(ye,"requireHelpers");var re;function ge(){return re||(re=1,(function(y){var u=R&&R.__createBinding||(Object.create?(function(t,e,o,c){c===void 0&&(c=o);var p=Object.getOwnPropertyDescriptor(e,o);(!p||("get"in p?!e.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:i(function(){return e[o]},"get")}),Object.defineProperty(t,c,p)}):(function(t,e,o,c){c===void 0&&(c=o),t[c]=e[o]})),h=R&&R.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),r=R&&R.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var o in t)o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)&&u(e,t,o);return h(e,t),e},l=R&&R.__exportStar||function(t,e){for(var o in t)o!=="default"&&!Object.prototype.hasOwnProperty.call(e,o)&&u(e,t,o)};Object.defineProperty(y,"__esModule",{value:!0}),y.Agent=void 0;const _=r(H),v=r(G),O=z;l(ye(),y);const n=Symbol("AgentBaseInternalState"),s=class s extends v.Agent{constructor(e){super(e),this[n]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}const{stack:o}=new Error;return typeof o!="string"?!1:o.split(` `).some(c=>c.indexOf("(https.js:")!==-1||c.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);const o=new _.Socket({writable:!1});return this.sockets[e].push(o),this.totalSocketCount++,o}decrementSockets(e,o){if(!this.sockets[e]||o===null)return;const c=this.sockets[e],p=c.indexOf(o);p!==-1&&(c.splice(p,1),this.totalSocketCount--,c.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?O.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,o,c){const p={...o,secureEndpoint:this.isSecureEndpoint(o)},g=this.getName(p),a=this.incrementSockets(g);Promise.resolve().then(()=>this.connect(e,p)).then(d=>{if(this.decrementSockets(g,a),d instanceof v.Agent)try{return d.addRequest(e,p)}catch(C){return c(C)}this[n].currentSocket=d,super.createSocket(e,o,c)},d=>{this.decrementSockets(g,a),c(d)})}createConnection(){const e=this[n].currentSocket;if(this[n].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[n].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[n]&&(this[n].defaultPort=e)}get protocol(){return this[n].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[n]&&(this[n].protocol=e)}};i(s,"Agent");let f=s;y.Agent=f})(R)),R}i(ge,"requireDist$1");var A={},ne;function ve(){if(ne)return A;ne=1;var y=A&&A.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(A,"__esModule",{value:!0}),A.parseProxyResponse=void 0;const h=(0,y(ee()).default)("https-proxy-agent:parse-proxy-response");function r(l){return new Promise((_,v)=>{let O=0;const n=[];function f(){const c=l.read();c?o(c):l.once("readable",f)}i(f,"read");function s(){l.removeListener("end",t),l.removeListener("error",e),l.removeListener("readable",f)}i(s,"cleanup");function t(){s(),h("onend"),v(new Error("Proxy connection ended before receiving CONNECT response"))}i(t,"onend");function e(c){s(),h("onerror %o",c),v(c)}i(e,"onerror");function o(c){n.push(c),O+=c.length;const p=Buffer.concat(n,O),g=p.indexOf(`\r \r `);if(g===-1){h("have not received end of HTTP headers yet..."),f();return}const a=p.slice(0,g).toString("ascii").split(`\r `),d=a.shift();if(!d)return l.destroy(),v(new Error("No header received from proxy CONNECT response"));const C=d.split(" "),m=+C[1],b=C.slice(2).join(" "),F={};for(const S of a){if(!S)continue;const P=S.indexOf(":");if(P===-1)return l.destroy(),v(new Error(`Invalid header from proxy CONNECT response: "${S}"`));const I=S.slice(0,P).toLowerCase(),E=S.slice(P+1).trimStart(),$=F[I];typeof $=="string"?F[I]=[$,E]:Array.isArray($)?$.push(E):F[I]=E}h("got proxy server response: %o %o",d,F),s(),_({connect:{statusCode:m,statusText:b,headers:F},buffered:p})}i(o,"ondata"),l.on("error",e),l.on("end",t),f()})}return i(r,"parseProxyResponse$1"),A.parseProxyResponse=r,A}i(ve,"requireParseProxyResponse");var oe;function me(){if(oe)return x;oe=1;var y=x&&x.__createBinding||(Object.create?(function(a,d,C,m){m===void 0&&(m=C);var b=Object.getOwnPropertyDescriptor(d,C);(!b||("get"in b?!d.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:i(function(){return d[C]},"get")}),Object.defineProperty(a,m,b)}):(function(a,d,C,m){m===void 0&&(m=C),a[m]=d[C]})),u=x&&x.__setModuleDefault||(Object.create?(function(a,d){Object.defineProperty(a,"default",{enumerable:!0,value:d})}):function(a,d){a.default=d}),h=x&&x.__importStar||function(a){if(a&&a.__esModule)return a;var d={};if(a!=null)for(var C in a)C!=="default"&&Object.prototype.hasOwnProperty.call(a,C)&&y(d,a,C);return u(d,a),d},r=x&&x.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(x,"__esModule",{value:!0}),x.HttpsProxyAgent=void 0;const l=h(H),_=h(ie),v=r(ce),O=r(ee()),n=ge(),f=fe,s=ve(),t=(0,O.default)("https-proxy-agent"),e=i(a=>a.servername===void 0&&a.host&&!l.isIP(a.host)?{...a,servername:a.host}:a,"setServernameFromNonIpHost"),g=class g extends n.Agent{constructor(d,C){super(C),this.options={path:void 0},this.proxy=typeof d=="string"?new f.URL(d):d,this.proxyHeaders=C?.headers??{},t("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const m=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),b=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...C?p(C,"headers"):null,host:m,port:b}}async connect(d,C){const{proxy:m}=this;if(!C.host)throw new TypeError('No "host" provided');let b;m.protocol==="https:"?(t("Creating `tls.Socket`: %o",this.connectOpts),b=_.connect(e(this.connectOpts))):(t("Creating `net.Socket`: %o",this.connectOpts),b=l.connect(this.connectOpts));const F=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},S=l.isIPv6(C.host)?`[${C.host}]`:C.host;let P=`CONNECT ${S}:${C.port} HTTP/1.1\r `;if(m.username||m.password){const M=`${decodeURIComponent(m.username)}:${decodeURIComponent(m.password)}`;F["Proxy-Authorization"]=`Basic ${Buffer.from(M).toString("base64")}`}F.Host=`${S}:${C.port}`,F["Proxy-Connection"]||(F["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const M of Object.keys(F))P+=`${M}: ${F[M]}\r `;const I=(0,s.parseProxyResponse)(b);b.write(`${P}\r `);const{connect:E,buffered:$}=await I;if(d.emit("proxyConnect",E),this.emit("proxyConnect",E,d),E.statusCode===200)return d.once("socket",c),C.secureEndpoint?(t("Upgrading socket connection to TLS"),_.connect({...p(e(C),"host","path","port"),socket:b})):b;b.destroy();const k=new l.Socket({writable:!1});return k.readable=!0,d.once("socket",M=>{t("Replaying proxy buffer for failed request"),(0,v.default)(M.listenerCount("data")>0),M.push($),M.push(null)}),k}};i(g,"HttpsProxyAgent");let o=g;o.protocols=["http","https"],x.HttpsProxyAgent=o;function c(a){a.resume()}i(c,"resume");function p(a,...d){const C={};let m;for(m in a)d.includes(m)||(C[m]=a[m]);return C}return i(p,"omit"),x}i(me,"requireDist");var be=me();export{be as d};