UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

14 lines 1.19 MB
"use strict";var Gc=Object.create,hC=Object.defineProperty,mc=Object.getOwnPropertyDescriptor,Nc=Object.getOwnPropertyNames,Uc=Object.getPrototypeOf,Lc=Object.prototype.hasOwnProperty,Jc=(I,A)=>()=>(I&&(A=I(I=0)),A),M=(I,A)=>()=>(A||I((A={exports:{}}).exports,A),A.exports),lE=(I,A)=>{for(var e in A)hC(I,e,{get:A[e],enumerable:!0})},wE=(I,A,e,g)=>{if(A&&typeof A=="object"||typeof A=="function")for(let C of Nc(A))!Lc.call(I,C)&&C!==e&&hC(I,C,{get:()=>A[C],enumerable:!(g=mc(A,C))||g.enumerable});return I},Kc=(I,A,e)=>(e=I!=null?Gc(Uc(I)):{},wE(A||!I||!I.__esModule?hC(e,"default",{value:I,enumerable:!0}):e,I)),LA=I=>wE(hC({},"__esModule",{value:!0}),I),pE=M((qS,FE)=>{"use strict";var NI=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Hc=typeof AbortController=="function",lC=Hc?AbortController:class{constructor(){this.signal=new fE}abort(A=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||A,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},Yc=typeof AbortSignal=="function",xc=typeof lC.AbortSignal=="function",fE=Yc?AbortSignal:xc?lC.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(A){A.type==="abort"&&(this.aborted=!0,this.onabort(A),this._listeners.forEach(e=>e(A),this))}onabort(){}addEventListener(A,e){A==="abort"&&this._listeners.push(e)}removeEventListener(A,e){A==="abort"&&(this._listeners=this._listeners.filter(g=>g!==e))}},uB=new Set,sB=(I,A)=>{let e=`LRU_CACHE_OPTION_${I}`;wC(e)&&cB(e,`${I} option`,`options.${A}`,xg)},oB=(I,A)=>{let e=`LRU_CACHE_METHOD_${I}`;if(wC(e)){let{prototype:g}=xg,{get:C}=Object.getOwnPropertyDescriptor(g,I);cB(e,`${I} method`,`cache.${A}()`,C)}},vc=(I,A)=>{let e=`LRU_CACHE_PROPERTY_${I}`;if(wC(e)){let{prototype:g}=xg,{get:C}=Object.getOwnPropertyDescriptor(g,I);cB(e,`${I} property`,`cache.${A}`,C)}},yE=(...I)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...I):console.error(...I)},wC=I=>!uB.has(I),cB=(I,A,e,g)=>{uB.add(I);let C=`The ${A} is deprecated. Please use ${e} instead.`;yE(C,"DeprecationWarning",I,g)},Qg=I=>I&&I===Math.floor(I)&&I>0&&isFinite(I),dE=I=>Qg(I)?I<=Math.pow(2,8)?Uint8Array:I<=Math.pow(2,16)?Uint16Array:I<=Math.pow(2,32)?Uint32Array:I<=Number.MAX_SAFE_INTEGER?Yg:null:null,Yg=class extends Array{constructor(A){super(A),this.fill(0)}},aB=class{constructor(A){if(A===0)return[];let e=dE(A);this.heap=new e(A),this.length=0}push(A){this.heap[this.length++]=A}pop(){return this.heap[--this.length]}},xg=class I{constructor(A={}){let{max:e=0,ttl:g,ttlResolution:C=1,ttlAutopurge:t,updateAgeOnGet:i,updateAgeOnHas:a,allowStale:c,dispose:D,disposeAfter:s,noDisposeOnSet:u,noUpdateTTL:r,maxSize:B=0,maxEntrySize:Q=0,sizeCalculation:E,fetchMethod:n,fetchContext:h,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:d,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:S,ignoreFetchAbort:k}=A,{length:G,maxAge:v,stale:J}=A instanceof I?{}:A;if(e!==0&&!Qg(e))throw new TypeError("max option must be a nonnegative integer");let W=e?dE(e):Array;if(!W)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=B,this.maxEntrySize=Q||this.maxSize,this.sizeCalculation=E||G,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=n||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=h,!this.fetchMethod&&h!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(e).fill(null),this.valList=new Array(e).fill(null),this.next=new W(e),this.prev=new W(e),this.head=0,this.tail=0,this.free=new aB(e),this.initialFill=1,this.size=0,typeof D=="function"&&(this.dispose=D),typeof s=="function"?(this.disposeAfter=s,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!r,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!F,this.allowStaleOnFetchAbort=!!S,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(this.maxSize!==0&&!Qg(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!Qg(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!c||!!J,this.noDeleteOnStaleGet=!!d,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!a,this.ttlResolution=Qg(C)||C===0?C:1,this.ttlAutopurge=!!t,this.ttl=g||v||0,this.ttl){if(!Qg(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let T="LRU_CACHE_UNBOUNDED";wC(T)&&(uB.add(T),yE("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",T,I))}J&&sB("stale","allowStale"),v&&sB("maxAge","ttl"),G&&sB("length","sizeCalculation")}getRemainingTTL(A){return this.has(A,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Yg(this.max),this.starts=new Yg(this.max),this.setItemTTL=(g,C,t=NI.now())=>{if(this.starts[g]=C!==0?t:0,this.ttls[g]=C,C!==0&&this.ttlAutopurge){let i=setTimeout(()=>{this.isStale(g)&&this.delete(this.keyList[g])},C+1);i.unref&&i.unref()}},this.updateItemAge=g=>{this.starts[g]=this.ttls[g]!==0?NI.now():0},this.statusTTL=(g,C)=>{g&&(g.ttl=this.ttls[C],g.start=this.starts[C],g.now=A||e(),g.remainingTTL=g.now+g.ttl-g.start)};let A=0,e=()=>{let g=NI.now();if(this.ttlResolution>0){A=g;let C=setTimeout(()=>A=0,this.ttlResolution);C.unref&&C.unref()}return g};this.getRemainingTTL=g=>{let C=this.keyMap.get(g);return C===void 0?0:this.ttls[C]===0||this.starts[C]===0?1/0:this.starts[C]+this.ttls[C]-(A||e())},this.isStale=g=>this.ttls[g]!==0&&this.starts[g]!==0&&(A||e())-this.starts[g]>this.ttls[g]}updateItemAge(A){}statusTTL(A,e){}setItemTTL(A,e,g){}isStale(A){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new Yg(this.max),this.removeItemSize=A=>{this.calculatedSize-=this.sizes[A],this.sizes[A]=0},this.requireSize=(A,e,g,C)=>{if(this.isBackgroundFetch(e))return 0;if(!Qg(g))if(C){if(typeof C!="function")throw new TypeError("sizeCalculation must be a function");if(g=C(e,A),!Qg(g))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return g},this.addItemSize=(A,e,g)=>{if(this.sizes[A]=e,this.maxSize){let C=this.maxSize-this.sizes[A];for(;this.calculatedSize>C;)this.evict(!0)}this.calculatedSize+=this.sizes[A],g&&(g.entrySize=e,g.totalCalculatedSize=this.calculatedSize)}}removeItemSize(A){}addItemSize(A,e){}requireSize(A,e,g,C){if(g||C)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:A=this.allowStale}={}){if(this.size)for(let e=this.tail;!(!this.isValidIndex(e)||((A||!this.isStale(e))&&(yield e),e===this.head));)e=this.prev[e]}*rindexes({allowStale:A=this.allowStale}={}){if(this.size)for(let e=this.head;!(!this.isValidIndex(e)||((A||!this.isStale(e))&&(yield e),e===this.tail));)e=this.next[e]}isValidIndex(A){return A!==void 0&&this.keyMap.get(this.keyList[A])===A}*entries(){for(let A of this.indexes())this.valList[A]!==void 0&&this.keyList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield[this.keyList[A],this.valList[A]])}*rentries(){for(let A of this.rindexes())this.valList[A]!==void 0&&this.keyList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield[this.keyList[A],this.valList[A]])}*keys(){for(let A of this.indexes())this.keyList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield this.keyList[A])}*rkeys(){for(let A of this.rindexes())this.keyList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield this.keyList[A])}*values(){for(let A of this.indexes())this.valList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield this.valList[A])}*rvalues(){for(let A of this.rindexes())this.valList[A]!==void 0&&!this.isBackgroundFetch(this.valList[A])&&(yield this.valList[A])}[Symbol.iterator](){return this.entries()}find(A,e){for(let g of this.indexes()){let C=this.valList[g],t=this.isBackgroundFetch(C)?C.__staleWhileFetching:C;if(t!==void 0&&A(t,this.keyList[g],this))return this.get(this.keyList[g],e)}}forEach(A,e=this){for(let g of this.indexes()){let C=this.valList[g],t=this.isBackgroundFetch(C)?C.__staleWhileFetching:C;t!==void 0&&A.call(e,t,this.keyList[g],this)}}rforEach(A,e=this){for(let g of this.rindexes()){let C=this.valList[g],t=this.isBackgroundFetch(C)?C.__staleWhileFetching:C;t!==void 0&&A.call(e,t,this.keyList[g],this)}}get prune(){return oB("prune","purgeStale"),this.purgeStale}purgeStale(){let A=!1;for(let e of this.rindexes({allowStale:!0}))this.isStale(e)&&(this.delete(this.keyList[e]),A=!0);return A}dump(){let A=[];for(let e of this.indexes({allowStale:!0})){let g=this.keyList[e],C=this.valList[e],t=this.isBackgroundFetch(C)?C.__staleWhileFetching:C;if(t===void 0)continue;let i={value:t};if(this.ttls){i.ttl=this.ttls[e];let a=NI.now()-this.starts[e];i.start=Math.floor(Date.now()-a)}this.sizes&&(i.size=this.sizes[e]),A.unshift([g,i])}return A}load(A){this.clear();for(let[e,g]of A){if(g.start){let C=Date.now()-g.start;g.start=NI.now()-C}this.set(e,g.value,g)}}dispose(A,e,g){}set(A,e,{ttl:g=this.ttl,start:C,noDisposeOnSet:t=this.noDisposeOnSet,size:i=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,status:D}={}){if(i=this.requireSize(A,e,i,a),this.maxEntrySize&&i>this.maxEntrySize)return D&&(D.set="miss",D.maxEntrySizeExceeded=!0),this.delete(A),this;let s=this.size===0?void 0:this.keyMap.get(A);if(s===void 0)s=this.newIndex(),this.keyList[s]=A,this.valList[s]=e,this.keyMap.set(A,s),this.next[this.tail]=s,this.prev[s]=this.tail,this.tail=s,this.size++,this.addItemSize(s,i,D),D&&(D.set="add"),c=!1;else{this.moveToTail(s);let u=this.valList[s];if(e!==u){if(this.isBackgroundFetch(u)?u.__abortController.abort(new Error("replaced")):t||(this.dispose(u,A,"set"),this.disposeAfter&&this.disposed.push([u,A,"set"])),this.removeItemSize(s),this.valList[s]=e,this.addItemSize(s,i,D),D){D.set="replace";let r=u&&this.isBackgroundFetch(u)?u.__staleWhileFetching:u;r!==void 0&&(D.oldValue=r)}}else D&&(D.set="update")}if(g!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),c||this.setItemTTL(s,g,C),this.statusTTL(D,s),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let A=this.valList[this.head];return this.evict(!0),A}}evict(A){let e=this.head,g=this.keyList[e],C=this.valList[e];return this.isBackgroundFetch(C)?C.__abortController.abort(new Error("evicted")):(this.dispose(C,g,"evict"),this.disposeAfter&&this.disposed.push([C,g,"evict"])),this.removeItemSize(e),A&&(this.keyList[e]=null,this.valList[e]=null,this.free.push(e)),this.head=this.next[e],this.keyMap.delete(g),this.size--,e}has(A,{updateAgeOnHas:e=this.updateAgeOnHas,status:g}={}){let C=this.keyMap.get(A);if(C!==void 0)if(this.isStale(C))g&&(g.has="stale",this.statusTTL(g,C));else return e&&this.updateItemAge(C),g&&(g.has="hit"),this.statusTTL(g,C),!0;else g&&(g.has="miss");return!1}peek(A,{allowStale:e=this.allowStale}={}){let g=this.keyMap.get(A);if(g!==void 0&&(e||!this.isStale(g))){let C=this.valList[g];return this.isBackgroundFetch(C)?C.__staleWhileFetching:C}}backgroundFetch(A,e,g,C){let t=e===void 0?void 0:this.valList[e];if(this.isBackgroundFetch(t))return t;let i=new lC;g.signal&&g.signal.addEventListener("abort",()=>i.abort(g.signal.reason));let a={signal:i.signal,options:g,context:C},c=(B,Q=!1)=>{let{aborted:E}=i.signal,n=g.ignoreFetchAbort&&B!==void 0;return g.status&&(E&&!Q?(g.status.fetchAborted=!0,g.status.fetchError=i.signal.reason,n&&(g.status.fetchAbortIgnored=!0)):g.status.fetchResolved=!0),E&&!n&&!Q?s(i.signal.reason):(this.valList[e]===r&&(B===void 0?r.__staleWhileFetching?this.valList[e]=r.__staleWhileFetching:this.delete(A):(g.status&&(g.status.fetchUpdated=!0),this.set(A,B,a.options))),B)},D=B=>(g.status&&(g.status.fetchRejected=!0,g.status.fetchError=B),s(B)),s=B=>{let{aborted:Q}=i.signal,E=Q&&g.allowStaleOnFetchAbort,n=E||g.allowStaleOnFetchRejection,h=n||g.noDeleteOnFetchRejection;if(this.valList[e]===r&&(!h||r.__staleWhileFetching===void 0?this.delete(A):E||(this.valList[e]=r.__staleWhileFetching)),n)return g.status&&r.__staleWhileFetching!==void 0&&(g.status.returnedStale=!0),r.__staleWhileFetching;if(r.__returned===r)throw B},u=(B,Q)=>{this.fetchMethod(A,t,a).then(E=>B(E),Q),i.signal.addEventListener("abort",()=>{(!g.ignoreFetchAbort||g.allowStaleOnFetchAbort)&&(B(),g.allowStaleOnFetchAbort&&(B=E=>c(E,!0)))})};g.status&&(g.status.fetchDispatched=!0);let r=new Promise(u).then(c,D);return r.__abortController=i,r.__staleWhileFetching=t,r.__returned=null,e===void 0?(this.set(A,r,{...a.options,status:void 0}),e=this.keyMap.get(A)):this.valList[e]=r,r}isBackgroundFetch(A){return A&&typeof A=="object"&&typeof A.then=="function"&&Object.prototype.hasOwnProperty.call(A,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(A,"__returned")&&(A.__returned===A||A.__returned===null)}async fetch(A,{allowStale:e=this.allowStale,updateAgeOnGet:g=this.updateAgeOnGet,noDeleteOnStaleGet:C=this.noDeleteOnStaleGet,ttl:t=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:D=this.noUpdateTTL,noDeleteOnFetchRejection:s=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:r=this.ignoreFetchAbort,allowStaleOnFetchAbort:B=this.allowStaleOnFetchAbort,fetchContext:Q=this.fetchContext,forceRefresh:E=!1,status:n,signal:h}={}){if(!this.fetchMethod)return n&&(n.fetch="get"),this.get(A,{allowStale:e,updateAgeOnGet:g,noDeleteOnStaleGet:C,status:n});let w={allowStale:e,updateAgeOnGet:g,noDeleteOnStaleGet:C,ttl:t,noDisposeOnSet:i,size:a,sizeCalculation:c,noUpdateTTL:D,noDeleteOnFetchRejection:s,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:B,ignoreFetchAbort:r,status:n,signal:h},d=this.keyMap.get(A);if(d===void 0){n&&(n.fetch="miss");let F=this.backgroundFetch(A,d,w,Q);return F.__returned=F}else{let F=this.valList[d];if(this.isBackgroundFetch(F)){let J=e&&F.__staleWhileFetching!==void 0;return n&&(n.fetch="inflight",J&&(n.returnedStale=!0)),J?F.__staleWhileFetching:F.__returned=F}let S=this.isStale(d);if(!E&&!S)return n&&(n.fetch="hit"),this.moveToTail(d),g&&this.updateItemAge(d),this.statusTTL(n,d),F;let k=this.backgroundFetch(A,d,w,Q),G=k.__staleWhileFetching!==void 0,v=G&&e;return n&&(n.fetch=G&&S?"stale":"refresh",v&&S&&(n.returnedStale=!0)),v?k.__staleWhileFetching:k.__returned=k}}get(A,{allowStale:e=this.allowStale,updateAgeOnGet:g=this.updateAgeOnGet,noDeleteOnStaleGet:C=this.noDeleteOnStaleGet,status:t}={}){let i=this.keyMap.get(A);if(i!==void 0){let a=this.valList[i],c=this.isBackgroundFetch(a);return this.statusTTL(t,i),this.isStale(i)?(t&&(t.get="stale"),c?(t&&(t.returnedStale=e&&a.__staleWhileFetching!==void 0),e?a.__staleWhileFetching:void 0):(C||this.delete(A),t&&(t.returnedStale=e),e?a:void 0)):(t&&(t.get="hit"),c?a.__staleWhileFetching:(this.moveToTail(i),g&&this.updateItemAge(i),a))}else t&&(t.get="miss")}connect(A,e){this.prev[e]=A,this.next[A]=e}moveToTail(A){A!==this.tail&&(A===this.head?this.head=this.next[A]:this.connect(this.prev[A],this.next[A]),this.connect(this.tail,A),this.tail=A)}get del(){return oB("del","delete"),this.delete}delete(A){let e=!1;if(this.size!==0){let g=this.keyMap.get(A);if(g!==void 0)if(e=!0,this.size===1)this.clear();else{this.removeItemSize(g);let C=this.valList[g];this.isBackgroundFetch(C)?C.__abortController.abort(new Error("deleted")):(this.dispose(C,A,"delete"),this.disposeAfter&&this.disposed.push([C,A,"delete"])),this.keyMap.delete(A),this.keyList[g]=null,this.valList[g]=null,g===this.tail?this.tail=this.prev[g]:g===this.head?this.head=this.next[g]:(this.next[this.prev[g]]=this.next[g],this.prev[this.next[g]]=this.prev[g]),this.size--,this.free.push(g)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return e}clear(){for(let A of this.rindexes({allowStale:!0})){let e=this.valList[A];if(this.isBackgroundFetch(e))e.__abortController.abort(new Error("deleted"));else{let g=this.keyList[A];this.dispose(e,g,"delete"),this.disposeAfter&&this.disposed.push([e,g,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return oB("reset","clear"),this.clear}get length(){return vc("length","size"),this.size}static get AbortController(){return lC}static get AbortSignal(){return fE}};FE.exports=xg}),kE=M(ne=>{"use strict";var bc=ne&&ne.__createBinding||(Object.create?function(I,A,e,g){g===void 0&&(g=e);var C=Object.getOwnPropertyDescriptor(A,e);(!C||("get"in C?!A.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(I,g,C)}:function(I,A,e,g){g===void 0&&(g=e),I[g]=A[e]}),Tc=ne&&ne.__setModuleDefault||(Object.create?function(I,A){Object.defineProperty(I,"default",{enumerable:!0,value:A})}:function(I,A){I.default=A}),SE=ne&&ne.__importStar||function(I){if(I&&I.__esModule)return I;var A={};if(I!=null)for(var e in I)e!=="default"&&Object.prototype.hasOwnProperty.call(I,e)&&bc(A,I,e);return Tc(A,I),A};Object.defineProperty(ne,"__esModule",{value:!0}),ne.req=ne.json=ne.toBuffer=void 0;var Pc=SE(require("http")),qc=SE(require("https"));async function RE(I){let A=0,e=[];for await(let g of I)A+=g.length,e.push(g);return Buffer.concat(e,A)}ne.toBuffer=RE;async function Oc(I){let e=(await RE(I)).toString("utf8");try{return JSON.parse(e)}catch(g){let C=g;throw C.message+=` (input: ${e})`,C}}ne.json=Oc;function Vc(I,A={}){let g=((typeof I=="string"?I:I.href).startsWith("https:")?qc:Pc).request(I,A),C=new Promise((t,i)=>{g.once("response",t).once("error",i).end()});return g.then=C.then.bind(C),g}ne.req=Vc}),Ag=M(ue=>{"use strict";var GE=ue&&ue.__createBinding||(Object.create?function(I,A,e,g){g===void 0&&(g=e);var C=Object.getOwnPropertyDescriptor(A,e);(!C||("get"in C?!A.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(I,g,C)}:function(I,A,e,g){g===void 0&&(g=e),I[g]=A[e]}),Wc=ue&&ue.__setModuleDefault||(Object.create?function(I,A){Object.defineProperty(I,"default",{enumerable:!0,value:A})}:function(I,A){I.default=A}),Zc=ue&&ue.__importStar||function(I){if(I&&I.__esModule)return I;var A={};if(I!=null)for(var e in I)e!=="default"&&Object.prototype.hasOwnProperty.call(I,e)&&GE(A,I,e);return Wc(A,I),A},Xc=ue&&ue.__exportStar||function(I,A){for(var e in I)e!=="default"&&!Object.prototype.hasOwnProperty.call(A,e)&&GE(A,I,e)};Object.defineProperty(ue,"__esModule",{value:!0}),ue.Agent=void 0;var ME=Zc(require("http"));Xc(kE(),ue);var Pe=Symbol("AgentBaseInternalState"),DB=class extends ME.Agent{constructor(A){super(A),this[Pe]={}}isSecureEndpoint(A){if(A){if(typeof A.secureEndpoint=="boolean")return A.secureEndpoint;if(typeof A.protocol=="string")return A.protocol==="https:"}let{stack:e}=new Error;return typeof e!="string"?!1:e.split(` `).some(g=>g.indexOf("(https.js:")!==-1||g.indexOf("node:https:")!==-1)}createSocket(A,e,g){let C={...e,secureEndpoint:this.isSecureEndpoint(e)};Promise.resolve().then(()=>this.connect(A,C)).then(t=>{if(t instanceof ME.Agent)return t.addRequest(A,C);this[Pe].currentSocket=t,super.createSocket(A,e,g)},g)}createConnection(){let A=this[Pe].currentSocket;if(this[Pe].currentSocket=void 0,!A)throw new Error("No socket was returned in the `connect()` function");return A}get defaultPort(){return this[Pe].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(A){this[Pe]&&(this[Pe].defaultPort=A)}get protocol(){return this[Pe].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(A){this[Pe]&&(this[Pe].protocol=A)}};ue.Agent=DB}),NE=M((WS,mE)=>{"use strict";var vg=1e3,bg=vg*60,Tg=bg*60,dg=Tg*24,_c=dg*7,jc=dg*365.25;mE.exports=function(I,A){A=A||{};var e=typeof I;if(e==="string"&&I.length>0)return zc(I);if(e==="number"&&isFinite(I))return A.long?AD(I):$c(I);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(I))};function zc(I){if(I=String(I),!(I.length>100)){var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(I);if(A){var e=parseFloat(A[1]),g=(A[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return e*jc;case"weeks":case"week":case"w":return e*_c;case"days":case"day":case"d":return e*dg;case"hours":case"hour":case"hrs":case"hr":case"h":return e*Tg;case"minutes":case"minute":case"mins":case"min":case"m":return e*bg;case"seconds":case"second":case"secs":case"sec":case"s":return e*vg;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function $c(I){var A=Math.abs(I);return A>=dg?Math.round(I/dg)+"d":A>=Tg?Math.round(I/Tg)+"h":A>=bg?Math.round(I/bg)+"m":A>=vg?Math.round(I/vg)+"s":I+"ms"}function AD(I){var A=Math.abs(I);return A>=dg?fC(I,A,dg,"day"):A>=Tg?fC(I,A,Tg,"hour"):A>=bg?fC(I,A,bg,"minute"):A>=vg?fC(I,A,vg,"second"):I+" ms"}function fC(I,A,e,g){var C=A>=e*1.5;return Math.round(I/e)+" "+g+(C?"s":"")}}),hB=M((ZS,UE)=>{"use strict";function eD(I){e.debug=e,e.default=e,e.coerce=c,e.disable=t,e.enable=C,e.enabled=i,e.humanize=NE(),e.destroy=D,Object.keys(I).forEach(s=>{e[s]=I[s]}),e.names=[],e.skips=[],e.formatters={};function A(s){let u=0;for(let r=0;r<s.length;r++)u=(u<<5)-u+s.charCodeAt(r),u|=0;return e.colors[Math.abs(u)%e.colors.length]}e.selectColor=A;function e(s){let u,r=null,B,Q;function E(...n){if(!E.enabled)return;let h=E,w=Number(new Date),d=w-(u||w);h.diff=d,h.prev=u,h.curr=w,u=w,n[0]=e.coerce(n[0]),typeof n[0]!="string"&&n.unshift("%O");let F=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(k,G)=>{if(k==="%%")return"%";F++;let v=e.formatters[G];if(typeof v=="function"){let J=n[F];k=v.call(h,J),n.splice(F,1),F--}return k}),e.formatArgs.call(h,n),(h.log||e.log).apply(h,n)}return E.namespace=s,E.useColors=e.useColors(),E.color=e.selectColor(s),E.extend=g,E.destroy=e.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>r!==null?r:(B!==e.namespaces&&(B=e.namespaces,Q=e.enabled(s)),Q),set:n=>{r=n}}),typeof e.init=="function"&&e.init(E),E}function g(s,u){let r=e(this.namespace+(typeof u>"u"?":":u)+s);return r.log=this.log,r}function C(s){e.save(s),e.namespaces=s,e.names=[],e.skips=[];let u,r=(typeof s=="string"?s:"").split(/[\s,]+/),B=r.length;for(u=0;u<B;u++)r[u]&&(s=r[u].replace(/\*/g,".*?"),s[0]==="-"?e.skips.push(new RegExp("^"+s.slice(1)+"$")):e.names.push(new RegExp("^"+s+"$")))}function t(){let s=[...e.names.map(a),...e.skips.map(a).map(u=>"-"+u)].join(",");return e.enable(""),s}function i(s){if(s[s.length-1]==="*")return!0;let u,r;for(u=0,r=e.skips.length;u<r;u++)if(e.skips[u].test(s))return!1;for(u=0,r=e.names.length;u<r;u++)if(e.names[u].test(s))return!0;return!1}function a(s){return s.toString().substring(2,s.toString().length-2).replace(/\.\*\?$/,"*")}function c(s){return s instanceof Error?s.stack||s.message:s}function D(){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 e.enable(e.load()),e}UE.exports=eD}),LE=M((ce,yC)=>{"use strict";ce.formatArgs=ID,ce.save=CD,ce.load=tD,ce.useColors=gD,ce.storage=BD(),ce.destroy=(()=>{let I=!1;return()=>{I||(I=!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`."))}})(),ce.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 gD(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1: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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ID(I){if(I[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+I[0]+(this.useColors?"%c ":" ")+"+"+yC.exports.humanize(this.diff),!this.useColors)return;let A="color: "+this.color;I.splice(1,0,A,"color: inherit");let e=0,g=0;I[0].replace(/%[a-zA-Z%]/g,C=>{C!=="%%"&&(e++,C==="%c"&&(g=e))}),I.splice(g,0,A)}ce.log=console.debug||console.log||(()=>{});function CD(I){try{I?ce.storage.setItem("debug",I):ce.storage.removeItem("debug")}catch{}}function tD(){let I;try{I=ce.storage.getItem("debug")}catch{}return!I&&typeof process<"u"&&"env"in process&&(I=process.env.DEBUG),I}function BD(){try{return localStorage}catch{}}yC.exports=hB()(ce);var{formatters:iD}=yC.exports;iD.j=function(I){try{return JSON.stringify(I)}catch(A){return"[UnexpectedJSONParseError]: "+A.message}}}),KE=M((XS,JE)=>{"use strict";JE.exports=(I,A=process.argv)=>{let e=I.startsWith("-")?"":I.length===1?"-":"--",g=A.indexOf(e+I),C=A.indexOf("--");return g!==-1&&(C===-1||g<C)}}),xE=M((_S,YE)=>{"use strict";var QD=require("os"),HE=require("tty"),fe=KE(),{env:OA}=process,Eg;fe("no-color")||fe("no-colors")||fe("color=false")||fe("color=never")?Eg=0:(fe("color")||fe("colors")||fe("color=true")||fe("color=always"))&&(Eg=1),"FORCE_COLOR"in OA&&(OA.FORCE_COLOR==="true"?Eg=1:OA.FORCE_COLOR==="false"?Eg=0:Eg=OA.FORCE_COLOR.length===0?1:Math.min(parseInt(OA.FORCE_COLOR,10),3));function lB(I){return I===0?!1:{level:I,hasBasic:!0,has256:I>=2,has16m:I>=3}}function wB(I,A){if(Eg===0)return 0;if(fe("color=16m")||fe("color=full")||fe("color=truecolor"))return 3;if(fe("color=256"))return 2;if(I&&!A&&Eg===void 0)return 0;let e=Eg||0;if(OA.TERM==="dumb")return e;if(process.platform==="win32"){let g=QD.release().split(".");return Number(g[0])>=10&&Number(g[2])>=10586?Number(g[2])>=14931?3:2:1}if("CI"in OA)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(g=>g in OA)||OA.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in OA)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(OA.TEAMCITY_VERSION)?1:0;if(OA.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in OA){let g=parseInt((OA.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(OA.TERM_PROGRAM){case"iTerm.app":return g>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(OA.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(OA.TERM)||"COLORTERM"in OA?1:e}function ED(I){let A=wB(I,I&&I.isTTY);return lB(A)}YE.exports={supportsColor:ED,stdout:lB(wB(!0,HE.isatty(1))),stderr:lB(wB(!0,HE.isatty(2)))}}),bE=M((ZA,FC)=>{"use strict";var rD=require("tty"),dC=require("util");ZA.init=DD,ZA.log=aD,ZA.formatArgs=sD,ZA.save=uD,ZA.load=cD,ZA.useColors=nD,ZA.destroy=dC.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),ZA.colors=[6,2,3,4,5,1];try{let I=xE();I&&(I.stderr||I).level>=2&&(ZA.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{}ZA.inspectOpts=Object.keys(process.env).filter(I=>/^debug_/i.test(I)).reduce((I,A)=>{let e=A.substring(6).toLowerCase().replace(/_([a-z])/g,(C,t)=>t.toUpperCase()),g=process.env[A];return/^(yes|on|true|enabled)$/i.test(g)?g=!0:/^(no|off|false|disabled)$/i.test(g)?g=!1:g==="null"?g=null:g=Number(g),I[e]=g,I},{});function nD(){return"colors"in ZA.inspectOpts?!!ZA.inspectOpts.colors:rD.isatty(process.stderr.fd)}function sD(I){let{namespace:A,useColors:e}=this;if(e){let g=this.color,C="\x1B[3"+(g<8?g:"8;5;"+g),t=` ${C};1m${A} \x1B[0m`;I[0]=t+I[0].split(` `).join(` `+t),I.push(C+"m+"+FC.exports.humanize(this.diff)+"\x1B[0m")}else I[0]=oD()+A+" "+I[0]}function oD(){return ZA.inspectOpts.hideDate?"":new Date().toISOString()+" "}function aD(...I){return process.stderr.write(dC.format(...I)+` `)}function uD(I){I?process.env.DEBUG=I:delete process.env.DEBUG}function cD(){return process.env.DEBUG}function DD(I){I.inspectOpts={};let A=Object.keys(ZA.inspectOpts);for(let e=0;e<A.length;e++)I.inspectOpts[A[e]]=ZA.inspectOpts[A[e]]}FC.exports=hB()(ZA);var{formatters:vE}=FC.exports;vE.o=function(I){return this.inspectOpts.colors=this.useColors,dC.inspect(I,this.inspectOpts).split(` `).map(A=>A.trim()).join(" ")},vE.O=function(I){return this.inspectOpts.colors=this.useColors,dC.inspect(I,this.inspectOpts)}}),zA=M((jS,fB)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?fB.exports=LE():fB.exports=bE()}),PE=M(TE=>{"use strict";var hD=require("url").parse,lD={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},wD=String.prototype.endsWith||function(I){return I.length<=this.length&&this.indexOf(I,this.length-I.length)!==-1};function fD(I){var A=typeof I=="string"?hD(I):I||{},e=A.protocol,g=A.host,C=A.port;if(typeof g!="string"||!g||typeof e!="string"||(e=e.split(":",1)[0],g=g.replace(/:\d*$/,""),C=parseInt(C)||lD[e]||0,!yD(g,C)))return"";var t=Pg("npm_config_"+e+"_proxy")||Pg(e+"_proxy")||Pg("npm_config_proxy")||Pg("all_proxy");return t&&t.indexOf("://")===-1&&(t=e+"://"+t),t}function yD(I,A){var e=(Pg("npm_config_no_proxy")||Pg("no_proxy")).toLowerCase();return e?e==="*"?!1:e.split(/[,\s]/).every(function(g){if(!g)return!0;var C=g.match(/^(.+):(\d+)$/),t=C?C[1]:g,i=C?parseInt(C[2]):0;return i&&i!==A?!0:/^[.*]/.test(t)?(t.charAt(0)==="*"&&(t=t.slice(1)),!wD.call(I,t)):I!==t}):!0}function Pg(I){return process.env[I.toLowerCase()]||process.env[I.toUpperCase()]||""}TE.getProxyForUrl=fD}),OE=M(ye=>{"use strict";var dD=ye&&ye.__createBinding||(Object.create?function(I,A,e,g){g===void 0&&(g=e);var C=Object.getOwnPropertyDescriptor(A,e);(!C||("get"in C?!A.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(I,g,C)}:function(I,A,e,g){g===void 0&&(g=e),I[g]=A[e]}),FD=ye&&ye.__setModuleDefault||(Object.create?function(I,A){Object.defineProperty(I,"default",{enumerable:!0,value:A})}:function(I,A){I.default=A}),qE=ye&&ye.__importStar||function(I){if(I&&I.__esModule)return I;var A={};if(I!=null)for(var e in I)e!=="default"&&Object.prototype.hasOwnProperty.call(I,e)&&dD(A,I,e);return FD(A,I),A},pD=ye&&ye.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(ye,"__esModule",{value:!0}),ye.HttpProxyAgent=void 0;var SD=qE(require("net")),RD=qE(require("tls")),kD=pD(zA()),MD=require("events"),GD=Ag(),qg=(0,kD.default)("http-proxy-agent"),pC=class extends GD.Agent{constructor(A,e){super(e),this.proxy=typeof A=="string"?new URL(A):A,this.proxyHeaders=e?.headers??{},qg("Creating new HttpProxyAgent instance: %o",this.proxy.href);let g=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),C=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...e?mD(e,"headers"):null,host:g,port:C}}addRequest(A,e){A._header=null,this.setRequestProps(A,e),super.addRequest(A,e)}setRequestProps(A,e){let{proxy:g}=this,C=e.secureEndpoint?"https:":"http:",t=A.getHeader("host")||"localhost",i=`${C}//${t}`,a=new URL(A.path,i);e.port!==80&&(a.port=String(e.port)),A.path=String(a);let c=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(g.username||g.password){let D=`${decodeURIComponent(g.username)}:${decodeURIComponent(g.password)}`;c["Proxy-Authorization"]=`Basic ${Buffer.from(D).toString("base64")}`}c["Proxy-Connection"]||(c["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let D of Object.keys(c)){let s=c[D];s&&A.setHeader(D,s)}}async connect(A,e){A._header=null,A.path.includes("://")||this.setRequestProps(A,e);let g,C;qg("Regenerating stored HTTP header string for request"),A._implicitHeader(),A.outputData&&A.outputData.length>0&&(qg("Patching connection write() output buffer with updated header"),g=A.outputData[0].data,C=g.indexOf(`\r \r `)+4,A.outputData[0].data=A._header+g.substring(C),qg("Output buffer: %o",A.outputData[0].data));let t;return this.proxy.protocol==="https:"?(qg("Creating `tls.Socket`: %o",this.connectOpts),t=RD.connect(this.connectOpts)):(qg("Creating `net.Socket`: %o",this.connectOpts),t=SD.connect(this.connectOpts)),await(0,MD.once)(t,"connect"),t}};pC.protocols=["http","https"],ye.HttpProxyAgent=pC;function mD(I,...A){let e={},g;for(g in I)A.includes(g)||(e[g]=I[g]);return e}}),VE=M(Og=>{"use strict";var ND=Og&&Og.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(Og,"__esModule",{value:!0}),Og.parseProxyResponse=void 0;var UD=ND(zA()),SC=(0,UD.default)("https-proxy-agent:parse-proxy-response");function LD(I){return new Promise((A,e)=>{let g=0,C=[];function t(){let s=I.read();s?D(s):I.once("readable",t)}function i(){I.removeListener("end",a),I.removeListener("error",c),I.removeListener("readable",t)}function a(){i(),SC("onend"),e(new Error("Proxy connection ended before receiving CONNECT response"))}function c(s){i(),SC("onerror %o",s),e(s)}function D(s){C.push(s),g+=s.length;let u=Buffer.concat(C,g),r=u.indexOf(`\r \r `);if(r===-1){SC("have not received end of HTTP headers yet..."),t();return}let B=u.slice(0,r).toString("ascii").split(`\r `),Q=B.shift();if(!Q)return I.destroy(),e(new Error("No header received from proxy CONNECT response"));let E=Q.split(" "),n=+E[1],h=E.slice(2).join(" "),w={};for(let d of B){if(!d)continue;let F=d.indexOf(":");if(F===-1)return I.destroy(),e(new Error(`Invalid header from proxy CONNECT response: "${d}"`));let S=d.slice(0,F).toLowerCase(),k=d.slice(F+1).trimStart(),G=w[S];typeof G=="string"?w[S]=[G,k]:Array.isArray(G)?G.push(k):w[S]=k}SC("got proxy server response: %o %o",Q,w),i(),A({connect:{statusCode:n,statusText:h,headers:w},buffered:u})}I.on("error",c),I.on("end",a),t()})}Og.parseProxyResponse=LD}),jE=M(de=>{"use strict";var JD=de&&de.__createBinding||(Object.create?function(I,A,e,g){g===void 0&&(g=e);var C=Object.getOwnPropertyDescriptor(A,e);(!C||("get"in C?!A.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return A[e]}}),Object.defineProperty(I,g,C)}:function(I,A,e,g){g===void 0&&(g=e),I[g]=A[e]}),KD=de&&de.__setModuleDefault||(Object.create?function(I,A){Object.defineProperty(I,"default",{enumerable:!0,value:A})}:function(I,A){I.default=A}),XE=de&&de.__importStar||function(I){if(I&&I.__esModule)return I;var A={};if(I!=null)for(var e in I)e!=="default"&&Object.prototype.hasOwnProperty.call(I,e)&&JD(A,I,e);return KD(A,I),A},_E=de&&de.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(de,"__esModule",{value:!0}),de.HttpsProxyAgent=void 0;var UI=XE(require("net")),WE=XE(require("tls")),HD=_E(require("assert")),YD=_E(zA()),xD=Ag(),vD=VE(),LI=(0,YD.default)("https-proxy-agent"),RC=class extends xD.Agent{constructor(A,e){super(e),this.options={path:void 0},this.proxy=typeof A=="string"?new URL(A):A,this.proxyHeaders=e?.headers??{},LI("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let g=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),C=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...e?ZE(e,"headers"):null,host:g,port:C}}async connect(A,e){let{proxy:g}=this;if(!e.host)throw new TypeError('No "host" provided');let C;if(g.protocol==="https:"){LI("Creating `tls.Socket`: %o",this.connectOpts);let r=this.connectOpts.servername||this.connectOpts.host;C=WE.connect({...this.connectOpts,servername:r&&UI.isIP(r)?void 0:r})}else LI("Creating `net.Socket`: %o",this.connectOpts),C=UI.connect(this.connectOpts);let t=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=UI.isIPv6(e.host)?`[${e.host}]`:e.host,a=`CONNECT ${i}:${e.port} HTTP/1.1\r `;if(g.username||g.password){let r=`${decodeURIComponent(g.username)}:${decodeURIComponent(g.password)}`;t["Proxy-Authorization"]=`Basic ${Buffer.from(r).toString("base64")}`}t.Host=`${i}:${e.port}`,t["Proxy-Connection"]||(t["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let r of Object.keys(t))a+=`${r}: ${t[r]}\r `;let c=(0,vD.parseProxyResponse)(C);C.write(`${a}\r `);let{connect:D,buffered:s}=await c;if(A.emit("proxyConnect",D),this.emit("proxyConnect",D,A),D.statusCode===200){if(A.once("socket",bD),e.secureEndpoint){LI("Upgrading socket connection to TLS");let r=e.servername||e.host;return WE.connect({...ZE(e,"host","path","port"),socket:C,servername:UI.isIP(r)?void 0:r})}return C}C.destroy();let u=new UI.Socket({writable:!1});return u.readable=!0,A.once("socket",r=>{LI("Replaying proxy buffer for failed request"),(0,HD.default)(r.listenerCount("data")>0),r.push(s),r.push(null)}),u}};RC.protocols=["http","https"],de.HttpsProxyAgent=RC;function bD(I){I.resume()}function ZE(I,...A){let e={},g;for(g in I)A.includes(g)||(e[g]=I[g]);return e}}),$E=M(zE=>{"use strict";var tA=zE,{Buffer:kC}=require("buffer"),TD=require("os");tA.toBuffer=function(I,A,e){e=~~e;let g;if(this.isV4Format(I))g=A||kC.alloc(e+4),I.split(/\./g).map(C=>{g[e++]=parseInt(C,10)&255});else if(this.isV6Format(I)){let C=I.split(":",8),t;for(t=0;t<C.length;t++){let i=this.isV4Format(C[t]),a;i&&(a=this.toBuffer(C[t]),C[t]=a.slice(0,2).toString("hex")),a&&++t<8&&C.splice(t,0,a.slice(2,4).toString("hex"))}if(C[0]==="")for(;C.length<8;)C.unshift("0");else if(C[C.length-1]==="")for(;C.length<8;)C.push("0");else if(C.length<8){for(t=0;t<C.length&&C[t]!=="";t++);let i=[t,1];for(t=9-C.length;t>0;t--)i.push("0");C.splice(...i)}for(g=A||kC.alloc(e+16),t=0;t<C.length;t++){let i=parseInt(C[t],16);g[e++]=i>>8&255,g[e++]=i&255}}if(!g)throw Error(`Invalid ip address: ${I}`);return g},tA.toString=function(I,A,e){A=~~A,e=e||I.length-A;let g=[];if(e===4){for(let C=0;C<e;C++)g.push(I[A+C]);g=g.join(".")}else if(e===16){for(let C=0;C<e;C+=2)g.push(I.readUInt16BE(A+C).toString(16));g=g.join(":"),g=g.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3"),g=g.replace(/:{3,4}/,"::")}return g};var PD=/^(\d{1,3}\.){3,3}\d{1,3}$/,qD=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;tA.isV4Format=function(I){return PD.test(I)},tA.isV6Format=function(I){return qD.test(I)};function JI(I){return I===4?"ipv4":I===6?"ipv6":I?I.toLowerCase():"ipv4"}tA.fromPrefixLen=function(I,A){I>32?A="ipv6":A=JI(A);let e=4;A==="ipv6"&&(e=16);let g=kC.alloc(e);for(let C=0,t=g.length;C<t;++C){let i=8;I<8&&(i=I),I-=i,g[C]=~(255>>i)&255}return tA.toString(g)},tA.mask=function(I,A){I=tA.toBuffer(I),A=tA.toBuffer(A);let e=kC.alloc(Math.max(I.length,A.length)),g;if(I.length===A.length)for(g=0;g<I.length;g++)e[g]=I[g]&A[g];else if(A.length===4)for(g=0;g<A.length;g++)e[g]=I[I.length-4+g]&A[g];else{for(g=0;g<e.length-6;g++)e[g]=0;for(e[10]=255,e[11]=255,g=0;g<I.length;g++)e[g+12]=I[g]&A[g+12];g+=12}for(;g<e.length;g++)e[g]=0;return tA.toString(e)},tA.cidr=function(I){let A=I.split("/"),e=A[0];if(A.length!==2)throw new Error(`invalid CIDR subnet: ${e}`);let g=tA.fromPrefixLen(parseInt(A[1],10));return tA.mask(e,g)},tA.subnet=function(I,A){let e=tA.toLong(tA.mask(I,A)),g=tA.toBuffer(A),C=0;for(let i=0;i<g.length;i++)if(g[i]===255)C+=8;else{let a=g[i]&255;for(;a;)a=a<<1&255,C++}let t=2**(32-C);return{networkAddress:tA.fromLong(e),firstAddress:t<=2?tA.fromLong(e):tA.fromLong(e+1),lastAddress:t<=2?tA.fromLong(e+t-1):tA.fromLong(e+t-2),broadcastAddress:tA.fromLong(e+t-1),subnetMask:A,subnetMaskLength:C,numHosts:t<=2?t:t-2,length:t,contains(i){return e===tA.toLong(tA.mask(i,A))}}},tA.cidrSubnet=function(I){let A=I.split("/"),e=A[0];if(A.length!==2)throw new Error(`invalid CIDR subnet: ${e}`);let g=tA.fromPrefixLen(parseInt(A[1],10));return tA.subnet(e,g)},tA.not=function(I){let A=tA.toBuffer(I);for(let e=0;e<A.length;e++)A[e]=255^A[e];return tA.toString(A)},tA.or=function(I,A){if(I=tA.toBuffer(I),A=tA.toBuffer(A),I.length===A.length){for(let t=0;t<I.length;++t)I[t]|=A[t];return tA.toString(I)}let e=I,g=A;A.length>I.length&&(e=A,g=I);let C=e.length-g.length;for(let t=C;t<e.length;++t)e[t]|=g[t-C];return tA.toString(e)},tA.isEqual=function(I,A){if(I=tA.toBuffer(I),A=tA.toBuffer(A),I.length===A.length){for(let g=0;g<I.length;g++)if(I[g]!==A[g])return!1;return!0}if(A.length===4){let g=A;A=I,I=g}for(let g=0;g<10;g++)if(A[g]!==0)return!1;let e=A.readUInt16BE(10);if(e!==0&&e!==65535)return!1;for(let g=0;g<4;g++)if(I[g]!==A[g+12])return!1;return!0},tA.isPrivate=function(I){return/^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(I)||/^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(I)||/^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(I)||/^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(I)||/^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(I)||/^f[cd][0-9a-f]{2}:/i.test(I)||/^fe80:/i.test(I)||/^::1$/.test(I)||/^::$/.test(I)},tA.isPublic=function(I){return!tA.isPrivate(I)},tA.isLoopback=function(I){return/^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(I)||/^fe80::1$/.test(I)||/^::1$/.test(I)||/^::$/.test(I)},tA.loopback=function(I){if(I=JI(I),I!=="ipv4"&&I!=="ipv6")throw new Error("family must be ipv4 or ipv6");return I==="ipv4"?"127.0.0.1":"fe80::1"},tA.address=function(I,A){let e=TD.networkInterfaces();if(A=JI(A),I&&I!=="private"&&I!=="public"){let C=e[I].filter(t=>JI(t.family)===A);return C.length===0?void 0:C[0].address}let g=Object.keys(e).map(C=>{let t=e[C].filter(i=>(i.family=JI(i.family),i.family!==A||tA.isLoopback(i.address)?!1:I?I==="public"?tA.isPrivate(i.address):tA.isPublic(i.address):!0));return t.length?t[0].address:void 0}).filter(Boolean);return g.length?g[0]:tA.loopback(A)},tA.toLong=function(I){let A=0;return I.split(".").forEach(e=>{A<<=8,A+=parseInt(e)}),A>>>0},tA.fromLong=function(I){return`${I>>>24}.${I>>16&255}.${I>>8&255}.${I&255}`}}),Ir=M(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});var Ar=require("buffer"),Fg={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};eg.ERRORS=Fg;function OD(I){if(!Ar.Buffer.isEncoding(I))throw new Error(Fg.INVALID_ENCODING)}eg.checkEncoding=OD;function er(I){return typeof I=="number"&&isFinite(I)&&XD(I)}eg.isFiniteInteger=er;function gr(I,A){if(typeof I=="number"){if(!er(I)||I<0)throw new Error(A?Fg.INVALID_OFFSET:Fg.INVALID_LENGTH)}else throw new Error(A?Fg.INVALID_OFFSET_NON_NUMBER:Fg.INVALID_LENGTH_NON_NUMBER)}function VD(I){gr(I,!1)}eg.checkLengthValue=VD;function WD(I){gr(I,!0)}eg.checkOffsetValue=WD;function ZD(I,A){if(I<0||I>A.length)throw new Error(Fg.INVALID_TARGET_OFFSET)}eg.checkTargetOffset=ZD;function XD(I){return typeof I=="number"&&isFinite(I)&&Math.floor(I)===I}function _D(I){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof Ar.Buffer.prototype[I]>"u")throw new Error(`Platform does not support Buffer.prototype.${I}.`)}eg.bigIntAndBufferInt64Check=_D}),tr=M(dB=>{"use strict";Object.defineProperty(dB,"__esModule",{value:!0});var oA=Ir(),Cr=4096,jD="utf8",yB=class I{constructor(A){if(this.length=0,this._encoding=jD,this._writeOffset=0,this._readOffset=0,I.isSmartBufferOptions(A))if(A.encoding&&(oA.checkEncoding(A.encoding),this._encoding=A.encoding),A.size)if(oA.isFiniteInteger(A.size)&&A.size>0)this._buff=Buffer.allocUnsafe(A.size);else throw new Error(oA.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(A.buff)if(Buffer.isBuffer(A.buff))this._buff=A.buff,this.length=A.buff.length;else throw new Error(oA.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(Cr);else{if(typeof A<"u")throw new Error(oA.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(Cr)}}static fromSize(A,e){return new this({size:A,encoding:e})}static fromBuffer(A,e){return new this({buff:A,encoding:e})}static fromOptions(A){return new this(A)}static isSmartBufferOptions(A){let e=A;return e&&(e.encoding!==void 0||e.size!==void 0||e.buff!==void 0)}readInt8(A){return this._readNumberValue(Buffer.prototype.readInt8,1,A)}readInt16BE(A){return this._readNumberValue(Buffer.prototype.readInt16BE,2,A)}readInt16LE(A){return this._readNumberValue(Buffer.prototype.readInt16LE,2,A)}readInt32BE(A){return this._readNumberValue(Buffer.prototype.readInt32BE,4,A)}readInt32LE(A){return this._readNumberValue(Buffer.prototype.readInt32LE,4,A)}readBigInt64BE(A){return oA.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,A)}readBigInt64LE(A){return oA.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,A)}writeInt8(A,e){return this._writeNumberValue(Buffer.prototype.writeInt8,1,A,e),this}insertInt8(A,e){return this._insertNumberValue(Buffer.prototype.writeInt8,1,A,e)}writeInt16BE(A,e){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,A,e)}insertInt16BE(A,e){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,A,e)}writeInt16LE(A,e){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,A,e)}insertInt16LE(A,e){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,A,e)}writeInt32BE(A,e){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,A,e)}insertInt32BE(A,e){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,A,e)}writeInt32LE(A,e){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,A,e)}insertInt32LE(A,e){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,A,e)}writeBigInt64BE(A,e){return oA.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,A,e)}insertBigInt64BE(A,e){return oA.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,A,e)}writeBigInt64LE(A,e){return oA.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,A,e)}insertBigInt64LE(A,e){return oA.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,A,e)}readUInt8(A){return this._readNumberValue(Buffer.prototype.readUInt8,1,A)}readUInt16BE(A){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,A)}readUInt16LE(A){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,A)}readUInt32BE(A){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,A)}readUInt32LE(A){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,A)}readBigUInt64BE(A){return oA.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,A)}readBigUInt64LE(A){return oA.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,A)}writeUInt8(A,e){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,A,e)}insertUInt8(A,e){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,A,e)}writeUInt16BE(A,e){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,A,e)}insertUInt16BE(A,e){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,A,e)}writeUInt16LE(A,e){return this._writ