updates 15.2.0 → 15.3.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/README.md +1 -1
- package/bin/updates.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
|
|
47
47
|
### Config File Locations
|
|
48
48
|
|
|
49
|
-
The config file can be placed in these locations, relative to `package.json
|
|
49
|
+
The config file can be placed in these locations, relative to `package.json`:
|
|
50
50
|
|
|
51
51
|
- `updates.config.js`
|
|
52
52
|
- `updates.config.mjs`
|
package/bin/updates.js
CHANGED
|
@@ -25,7 +25,7 @@ Content-Type: ${a.type||"application/octet-stream"}\r
|
|
|
25
25
|
`}}return t.message=r+`
|
|
26
26
|
`,t}});var Sh=L((PE,Rh)=>{"use strict";Rh.exports=B_;var H_=bh(),D_=_h();function B_(t){global.Buffer&&global.Buffer.isBuffer(t)&&(t=t.toString("utf8"));let e=new H_;try{return e.parse(t),e.finish()}catch(r){throw D_(r,t)}}});function hi({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var bi=Fe(Va(),1);var Ya=bi.default.HttpProxyAgent,Qa=bi.default.HttpsProxyAgent;var kr=class extends Map{#t=0;#n=new Map;#e=new Map;#u;#A;#a;constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.#u=e.maxSize,this.#A=e.maxAge||Number.POSITIVE_INFINITY,this.#a=e.onEviction}get __oldCache(){return this.#e}#m(e){if(typeof this.#a=="function")for(let[r,s]of e)this.#a(r,s.value)}#s(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.#a=="function"&&this.#a(e,r.value),this.delete(e)):!1}#i(e,r){if(this.#s(e,r)===!1)return r.value}#r(e,r){return r.expiry?this.#i(e,r):r.value}#c(e,r){let s=r.get(e);return this.#r(e,s)}#d(e,r){this.#n.set(e,r),this.#t++,this.#t>=this.#u&&(this.#t=0,this.#m(this.#e),this.#e=this.#n,this.#n=new Map)}#f(e,r){this.#e.delete(e),this.#d(e,r)}*#l(){for(let e of this.#e){let[r,s]=e;this.#n.has(r)||this.#s(r,s)===!1&&(yield e)}for(let e of this.#n){let[r,s]=e;this.#s(r,s)===!1&&(yield e)}}get(e){if(this.#n.has(e)){let r=this.#n.get(e);return this.#r(e,r)}if(this.#e.has(e)){let r=this.#e.get(e);if(this.#s(e,r)===!1)return this.#f(e,r),r.value}}set(e,r,{maxAge:s=this.#A}={}){let i=typeof s=="number"&&s!==Number.POSITIVE_INFINITY?Date.now()+s:void 0;return this.#n.has(e)?this.#n.set(e,{value:r,expiry:i}):this.#d(e,{value:r,expiry:i}),this}has(e){return this.#n.has(e)?!this.#s(e,this.#n.get(e)):this.#e.has(e)?!this.#s(e,this.#e.get(e)):!1}peek(e){if(this.#n.has(e))return this.#c(e,this.#n);if(this.#e.has(e))return this.#c(e,this.#e)}delete(e){let r=this.#n.delete(e);return r&&this.#t--,this.#e.delete(e)||r}clear(){this.#n.clear(),this.#e.clear(),this.#t=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this.#l()],s=r.length-e;s<0?(this.#n=new Map(r),this.#e=new Map,this.#t=r.length):(s>0&&this.#m(r.slice(0,s)),this.#e=new Map(r.slice(s)),this.#n=new Map,this.#t=0),this.#u=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.#n){let[r,s]=e;this.#s(r,s)===!1&&(yield[r,s.value])}for(let e of this.#e){let[r,s]=e;this.#n.has(r)||this.#s(r,s)===!1&&(yield[r,s.value])}}*entriesDescending(){let e=[...this.#n];for(let r=e.length-1;r>=0;--r){let s=e[r],[i,a]=s;this.#s(i,a)===!1&&(yield[i,a.value])}e=[...this.#e];for(let r=e.length-1;r>=0;--r){let s=e[r],[i,a]=s;this.#n.has(i)||this.#s(i,a)===!1&&(yield[i,a.value])}}*entriesAscending(){for(let[e,r]of this.#l())yield[e,r.value]}get size(){if(!this.#t)return this.#e.size;let e=0;for(let r of this.#e.keys())this.#n.has(r)||e++;return Math.min(this.#t+e,this.#u)}get maxSize(){return this.#u}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[s,i]of this.entriesAscending())e.call(r,i,s,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}};var Ja=Fe(Xa(),1);import{Agent as jp}from"node:http";import{Agent as Gp}from"node:https";var Vp={agentCacheSize:512},Za={maxSockets:64,keepAlive:!1},yi=class t extends Error{constructor(e){super(e),this.name="TimeoutError",Error.captureStackTrace?.(this,t)}};function _i(t,e={}){if(!("undici"in e))throw new Error("The 'undici' option is required");let r={...Vp,...e},s=new kr({maxSize:r.agentCacheSize});async function i(l,h={}){let{origin:c,protocol:f}=new URL(l),p=h?.noProxy?null:(0,Ja.getProxyForUrl)(l),g=JSON.stringify({proxyUrl:p,origin:c,...h});if(s.has(g))return s.get(g);let m;if("noProxy"in h&&delete h.noProxy,e.undici){let{ProxyAgent:y,Agent:R}=await import("undici"),w={...h};"keepAlive"in w&&!("pipelining"in w)&&(w.pipelining=w.keepAlive?1:0),"keepAlive"in w&&delete w.keepAlive,"maxSockets"in w&&(w.connections=w.maxSockets,delete w.maxSockets),p?m=new y({...w,uri:p}):m=new R(w)}else{let y=f==="https:";p?m=new(y?Qa:Ya)({...h,proxy:p}):m=new(y?Gp:jp)(h)}return s.set(g,m),m}let a=(l,{timeout:h=0,agentOpts:c={},...f}={})=>new Promise(async(p,g)=>{if(!e.undici&&!("agent"in f)){let R=await i(l,{...Za,...c});R&&(f.agent=R)}else if(e.undici&&!("dispatcher"in f)){let R=await i(l,{...Za,...c});R&&(f.dispatcher=R)}let m,y;h&&(!("signal"in f)&&globalThis.AbortController&&(y=new AbortController,f.signal=y.signal),m=setTimeout(()=>{y?.abort?.();let R=new yi(`${f.method||"GET"} ${l} timed out after ${h}ms`);g(R)},h),m?.unref?.()),t(l,f).then(R=>{m&&clearTimeout(m),p(R)}).catch(R=>{if(m&&clearTimeout(m),R.name==="AbortError")return p(null);g(R)})});return a.clearCache=()=>{for(let l of s.values())"destroy"in l&&l.destroy();s.clear()},a}var Bh=Fe(Ri(),1);import Rm from"node:http";import Sm from"node:https";import mr from"node:zlib";import Nl,{PassThrough as Hl,pipeline as gr}from"node:stream";import{Buffer as Jn}from"node:buffer";function Qp(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),s="",i=!1,a=r[0]||"text/plain",l=a;for(let p=1;p<r.length;p++)r[p]==="base64"?i=!0:r[p]&&(l+=`;${r[p]}`,r[p].indexOf("charset=")===0&&(s=r[p].substring(8)));!r[0]&&!s.length&&(l+=";charset=US-ASCII",s="US-ASCII");let h=i?"base64":"ascii",c=unescape(t.substring(e+1)),f=Buffer.from(c,h);return f.type=a,f.typeFull=l,f.charset=s,f}var nl=Qp;zr();zn();import Ct,{PassThrough as Rl}from"node:stream";import{types as Sl,deprecate as Oi,promisify as fm}from"node:util";import{Buffer as Ue}from"node:buffer";var ct=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var $e=class extends ct{constructor(e,r,s){super(e,r),s&&(this.code=this.errno=s.code,this.erroredSysCall=s.syscall)}};var jn=Symbol.toStringTag,Ti=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[jn]==="URLSearchParams",Gr=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[jn]),hl=t=>typeof t=="object"&&(t[jn]==="AbortSignal"||t[jn]==="EventTarget"),dl=(t,e)=>{let r=new URL(e).hostname,s=new URL(t).hostname;return r===s||r.endsWith(`.${s}`)},pl=(t,e)=>{let r=new URL(e).protocol,s=new URL(t).protocol;return r===s};var hm=fm(Ct.pipeline),Ie=Symbol("Body internals"),Je=class{constructor(e,{size:r=0}={}){let s=null;e===null?e=null:Ti(e)?e=Ue.from(e.toString()):Gr(e)||Ue.isBuffer(e)||(Sl.isAnyArrayBuffer(e)?e=Ue.from(e):ArrayBuffer.isView(e)?e=Ue.from(e.buffer,e.byteOffset,e.byteLength):e instanceof Ct||(e instanceof Ut?(e=fl(e),s=e.type.split("=")[1]):e=Ue.from(String(e))));let i=e;Ue.isBuffer(e)?i=Ct.Readable.from(e):Gr(e)&&(i=Ct.Readable.from(e.stream())),this[Ie]={body:e,stream:i,boundary:s,disturbed:!1,error:null},this.size=r,e instanceof Ct&&e.on("error",a=>{let l=a instanceof ct?a:new $e(`Invalid response body while trying to fetch ${this.url}: ${a.message}`,"system",a);this[Ie].error=l})}get body(){return this[Ie].stream}get bodyUsed(){return this[Ie].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:s}=await vi(this);return e.slice(r,r+s)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let s=new Ut,i=new URLSearchParams(await this.text());for(let[a,l]of i)s.append(a,l);return s}let{toFormData:r}=await Promise.resolve().then(()=>(_l(),yl));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Ie].body&&this[Ie].body.type||"",r=await this.arrayBuffer();return new ut([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await vi(this);return new TextDecoder().decode(e)}buffer(){return vi(this)}};Je.prototype.buffer=Oi(Je.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Je.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:Oi(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function vi(t){if(t[Ie].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Ie].disturbed=!0,t[Ie].error)throw t[Ie].error;let{body:e}=t;if(e===null)return Ue.alloc(0);if(!(e instanceof Ct))return Ue.alloc(0);let r=[],s=0;try{for await(let i of e){if(t.size>0&&s+i.length>t.size){let a=new $e(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(a),a}s+=i.length,r.push(i)}}catch(i){throw i instanceof ct?i:new $e(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Ue.from(r.join("")):Ue.concat(r,s)}catch(i){throw new $e(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new $e(`Premature close of server response while trying to fetch ${t.url}`)}var dr=(t,e)=>{let r,s,{body:i}=t[Ie];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof Ct&&typeof i.getBoundary!="function"&&(r=new Rl({highWaterMark:e}),s=new Rl({highWaterMark:e}),i.pipe(r),i.pipe(s),t[Ie].stream=r,i=s),i},dm=Oi(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),Yn=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Ti(t)?"application/x-www-form-urlencoded;charset=UTF-8":Gr(t)?t.type||null:Ue.isBuffer(t)||Sl.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Ut?`multipart/form-data; boundary=${e[Ie].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${dm(t)}`:t instanceof Ct?null:"text/plain;charset=UTF-8",wl=t=>{let{body:e}=t[Ie];return e===null?0:Gr(e)?e.size:Ue.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},El=async(t,{body:e})=>{e===null?t.end():await hm(e,t)};import{types as Al}from"node:util";import Kn from"node:http";var Qn=typeof Kn.validateHeaderName=="function"?Kn.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},$i=typeof Kn.validateHeaderValue=="function"?Kn.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},He=class t extends URLSearchParams{constructor(e){let r=[];if(e instanceof t){let s=e.raw();for(let[i,a]of Object.entries(s))r.push(...a.map(l=>[i,l]))}else if(e!=null)if(typeof e=="object"&&!Al.isBoxedPrimitive(e)){let s=e[Symbol.iterator];if(s==null)r.push(...Object.entries(e));else{if(typeof s!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||Al.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([s,i])=>(Qn(s),$i(s,String(i)),[String(s).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(s,i,a){switch(i){case"append":case"set":return(l,h)=>(Qn(l),$i(l,String(h)),URLSearchParams.prototype[i].call(s,String(l).toLowerCase(),String(h)));case"delete":case"has":case"getAll":return l=>(Qn(l),URLSearchParams.prototype[i].call(s,String(l).toLowerCase()));case"keys":return()=>(s.sort(),new Set(URLSearchParams.prototype.keys.call(s)).keys());default:return Reflect.get(s,i,a)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let s=r.join(", ");return/^content-encoding$/i.test(e)&&(s=s.toLowerCase()),s}forEach(e,r=void 0){for(let s of this.keys())Reflect.apply(e,r,[this.get(s),s,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let s=this.getAll(r);return r==="host"?e[r]=s[0]:e[r]=s.length>1?s:s[0],e},{})}};Object.defineProperties(He.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));function Tl(t=[]){return new He(t.reduce((e,r,s,i)=>(s%2===0&&e.push(i.slice(s,s+2)),e),[]).filter(([e,r])=>{try{return Qn(e),$i(e,String(r)),!0}catch{return!1}}))}var pm=new Set([301,302,303,307,308]),Xn=t=>pm.has(t);var Ye=Symbol("Response internals"),Me=class t extends Je{constructor(e=null,r={}){super(e,r);let s=r.status!=null?r.status:200,i=new He(r.headers);if(e!==null&&!i.has("Content-Type")){let a=Yn(e,this);a&&i.append("Content-Type",a)}this[Ye]={type:"default",url:r.url,status:s,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Ye].type}get url(){return this[Ye].url||""}get status(){return this[Ye].status}get ok(){return this[Ye].status>=200&&this[Ye].status<300}get redirected(){return this[Ye].counter>0}get statusText(){return this[Ye].statusText}get headers(){return this[Ye].headers}get highWaterMark(){return this[Ye].highWaterMark}clone(){return new t(dr(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!Xn(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[Ye].type="error",e}static json(e=void 0,r={}){let s=JSON.stringify(e);if(s===void 0)throw new TypeError("data is not JSON serializable");let i=new He(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(s,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Me.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});import{format as bm}from"node:url";import{deprecate as ym}from"node:util";var Cl=t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""};import{isIP as mm}from"node:net";function xl(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}var vl=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Ol="strict-origin-when-cross-origin";function $l(t){if(!vl.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function gm(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=mm(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function pr(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:gm(t)}function Il(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let s=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,a=xl(i),l=xl(i,!0);a.toString().length>4096&&(a=l),e&&(a=e(a)),r&&(l=r(l));let h=new URL(t.url);switch(s){case"no-referrer":return"no-referrer";case"origin":return l;case"unsafe-url":return a;case"strict-origin":return pr(a)&&!pr(h)?"no-referrer":l.toString();case"strict-origin-when-cross-origin":return a.origin===h.origin?a:pr(a)&&!pr(h)?"no-referrer":l;case"same-origin":return a.origin===h.origin?a:"no-referrer";case"origin-when-cross-origin":return a.origin===h.origin?a:l;case"no-referrer-when-downgrade":return pr(a)&&!pr(h)?"no-referrer":a;default:throw new TypeError(`Invalid referrerPolicy: ${s}`)}}function Ll(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let s of e)s&&vl.has(s)&&(r=s);return r}var Re=Symbol("Request internals"),Yr=t=>typeof t=="object"&&typeof t[Re]=="object",_m=ym(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Wt=class t extends Je{constructor(e,r={}){let s;if(Yr(e)?s=new URL(e.url):(s=new URL(e),e={}),s.username!==""||s.password!=="")throw new TypeError(`${s} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!Yr(r)&&"data"in r&&_m(),(r.body!=null||Yr(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let a=r.body?r.body:Yr(e)&&e.body!==null?dr(e):null;super(a,{size:r.size||e.size||0});let l=new He(r.headers||e.headers||{});if(a!==null&&!l.has("Content-Type")){let f=Yn(a,this);f&&l.set("Content-Type",f)}let h=Yr(e)?e.signal:null;if("signal"in r&&(h=r.signal),h!=null&&!hl(h))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let c=r.referrer==null?e.referrer:r.referrer;if(c==="")c="no-referrer";else if(c){let f=new URL(c);c=/^about:(\/\/)?client$/.test(f)?"client":f}else c=void 0;this[Re]={method:i,redirect:r.redirect||e.redirect||"follow",headers:l,parsedURL:s,signal:h,referrer:c},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[Re].method}get url(){return bm(this[Re].parsedURL)}get headers(){return this[Re].headers}get redirect(){return this[Re].redirect}get signal(){return this[Re].signal}get referrer(){if(this[Re].referrer==="no-referrer")return"";if(this[Re].referrer==="client")return"about:client";if(this[Re].referrer)return this[Re].referrer.toString()}get referrerPolicy(){return this[Re].referrerPolicy}set referrerPolicy(e){this[Re].referrerPolicy=$l(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Wt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var Pl=t=>{let{parsedURL:e}=t[Re],r=new He(t[Re].headers);r.has("Accept")||r.set("Accept","*/*");let s=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(s="0"),t.body!==null){let h=wl(t);typeof h=="number"&&!Number.isNaN(h)&&(s=String(h))}s&&r.set("Content-Length",s),t.referrerPolicy===""&&(t.referrerPolicy=Ol),t.referrer&&t.referrer!=="no-referrer"?t[Re].referrer=Il(t):t[Re].referrer="no-referrer",t[Re].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let a=Cl(e),l={path:e.pathname+a,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:l}};var Zn=class extends ct{constructor(e,r="aborted"){super(e,r)}};zn();Ci();var wm=new Set(["data:","http:","https:"]);async function es(t,e){return new Promise((r,s)=>{let i=new Wt(t,e),{parsedURL:a,options:l}=Pl(i);if(!wm.has(a.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${a.protocol.replace(/:$/,"")}" is not supported.`);if(a.protocol==="data:"){let R=nl(i.url),w=new Me(R,{headers:{"Content-Type":R.typeFull}});r(w);return}let h=(a.protocol==="https:"?Sm:Rm).request,{signal:c}=i,f=null,p=()=>{let R=new Zn("The operation was aborted.");s(R),i.body&&i.body instanceof Nl.Readable&&i.body.destroy(R),!(!f||!f.body)&&f.body.emit("error",R)};if(c&&c.aborted){p();return}let g=()=>{p(),y()},m=h(a.toString(),l);c&&c.addEventListener("abort",g);let y=()=>{m.abort(),c&&c.removeEventListener("abort",g)};m.on("error",R=>{s(new $e(`request to ${i.url} failed, reason: ${R.message}`,"system",R)),y()}),Em(m,R=>{f&&f.body&&f.body.destroy(R)}),process.version<"v14"&&m.on("socket",R=>{let w;R.prependListener("end",()=>{w=R._eventsCount}),R.prependListener("close",O=>{if(f&&w<R._eventsCount&&!O){let x=new Error("Premature close");x.code="ERR_STREAM_PREMATURE_CLOSE",f.body.emit("error",x)}})}),m.on("response",R=>{m.setTimeout(0);let w=Tl(R.rawHeaders);if(Xn(R.statusCode)){let C=w.get("Location"),v=null;try{v=C===null?null:new URL(C,i.url)}catch{if(i.redirect!=="manual"){s(new $e(`uri requested responds with an invalid redirect URL: ${C}`,"invalid-redirect")),y();return}}switch(i.redirect){case"error":s(new $e(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),y();return;case"manual":break;case"follow":{if(v===null)break;if(i.counter>=i.follow){s(new $e(`maximum redirect reached at: ${i.url}`,"max-redirect")),y();return}let H={headers:new He(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:dr(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!dl(i.url,v)||!pl(i.url,v))for(let U of["authorization","www-authenticate","cookie","cookie2"])H.headers.delete(U);if(R.statusCode!==303&&i.body&&e.body instanceof Nl.Readable){s(new $e("Cannot follow redirect with body being a readable stream","unsupported-redirect")),y();return}(R.statusCode===303||(R.statusCode===301||R.statusCode===302)&&i.method==="POST")&&(H.method="GET",H.body=void 0,H.headers.delete("content-length"));let D=Ll(w);D&&(H.referrerPolicy=D),r(es(new Wt(v,H))),y();return}default:return s(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}c&&R.once("end",()=>{c.removeEventListener("abort",g)});let O=gr(R,new Hl,C=>{C&&s(C)});process.version<"v12.10"&&R.on("aborted",g);let x={url:i.url,status:R.statusCode,statusText:R.statusMessage,headers:w,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},$=w.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||$===null||R.statusCode===204||R.statusCode===304){f=new Me(O,x),r(f);return}let F={flush:mr.Z_SYNC_FLUSH,finishFlush:mr.Z_SYNC_FLUSH};if($==="gzip"||$==="x-gzip"){O=gr(O,mr.createGunzip(F),C=>{C&&s(C)}),f=new Me(O,x),r(f);return}if($==="deflate"||$==="x-deflate"){let C=gr(R,new Hl,v=>{v&&s(v)});C.once("data",v=>{(v[0]&15)===8?O=gr(O,mr.createInflate(),H=>{H&&s(H)}):O=gr(O,mr.createInflateRaw(),H=>{H&&s(H)}),f=new Me(O,x),r(f)}),C.once("end",()=>{f||(f=new Me(O,x),r(f))});return}if($==="br"){O=gr(O,mr.createBrotliDecompress(),C=>{C&&s(C)}),f=new Me(O,x),r(f);return}f=new Me(O,x),r(f)}),El(m,i).catch(s)})}function Em(t,e){let r=Jn.from(`0\r
|
|
27
27
|
\r
|
|
28
|
-
`),s=!1,i=!1,a;t.on("response",l=>{let{headers:h}=l;s=h["transfer-encoding"]==="chunked"&&!h["content-length"]}),t.on("socket",l=>{let h=()=>{if(s&&!i){let f=new Error("Premature close");f.code="ERR_STREAM_PREMATURE_CLOSE",e(f)}},c=f=>{i=Jn.compare(f.slice(-5),r)===0,!i&&a&&(i=Jn.compare(a.slice(-3),r.slice(0,3))===0&&Jn.compare(f.slice(-2),r.slice(3))===0),a=f};l.prependListener("close",h),l.on("data",c),t.on("close",()=>{l.removeListener("close",h),l.removeListener("data",c)})})}var qh=Fe(uu(),1),Fh=Fe(Ni(),1),oe=Fe(af(),1),Uh=Fe(hf(),1),Mh=Fe(Cf(),1);import{cwd as q_,stdout as F_,argv as U_,env as Os,exit as wh,versions as M_}from"node:process";import{join as Ho,dirname as Wh,basename as Co,resolve as $s}from"node:path";import{lstatSync as Eh,readFileSync as Ah,truncateSync as W_,writeFileSync as k_,accessSync as z_}from"node:fs";var zy=[[1e3,6e4,"sec"],[6e4,36e5,"min"],[36e5,864e5,"hour"],[864e5,6048e5,"day"],[6048e5,2628e6,"week"],[2628e6,31536e6,"month"],[31536e6,1/0,"year"]],jy={"1 day ago":"yesterday","1 week ago":"last week","1 month ago":"last month","1 year ago":"last year","in 1 day":"tomorrow","in 1 week":"next week","in 1 month":"next month","in 1 year":"next year"},Gy={sec:"second",min:"minute"};function _s(t,{now:e,noAffix:r=!1,times:s=zy,nowThreshold:i=2e3,nowString:a="now",aliases:l=!1,aliasesMap:h=jy,longUnits:c=!1}={}){if(t=typeof t=="number"?t:Date.parse(t),e=e?typeof e=="number"?e:Date.parse(e):new Date,Number.isNaN(t))return"unknown";let f=!1,p=e-t;if(p<0&&(f=!0,p=Math.abs(p)),p<i)return a;let g,m;for(let R=0,w=s.length;R<w;R++){let O=s[R];if(!(p>=O[1])){g=Math.floor(p/O[0]),m=(c&&Gy[O[2]]||O[2])+(g>1?"s":"");break}}let y=`${f&&!r?"in ":""}${g} ${m}${!f&&!r?" ago":""}`;return l?h[y]??y:y}import oo from"node:process";import Vy from"node:os";import xf from"node:tty";function ze(t,e=globalThis.Deno?globalThis.Deno.args:oo.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",s=e.indexOf(r+t),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:pe}=oo,Rs;ze("no-color")||ze("no-colors")||ze("color=false")||ze("color=never")?Rs=0:(ze("color")||ze("colors")||ze("color=true")||ze("color=always"))&&(Rs=1);function Yy(){if("FORCE_COLOR"in pe)return pe.FORCE_COLOR==="true"?1:pe.FORCE_COLOR==="false"?0:pe.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(pe.FORCE_COLOR,10),3)}function Qy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Ky(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let s=Yy();s!==void 0&&(Rs=s);let i=r?Rs:s;if(i===0)return 0;if(r){if(ze("color=16m")||ze("color=full")||ze("color=truecolor"))return 3;if(ze("color=256"))return 2}if("TF_BUILD"in pe&&"AGENT_NAME"in pe)return 1;if(t&&!e&&i===void 0)return 0;let a=i||0;if(pe.TERM==="dumb")return a;if(oo.platform==="win32"){let l=Vy.release().split(".");return Number(l[0])>=10&&Number(l[2])>=10586?Number(l[2])>=14931?3:2:1}if("CI"in pe)return"GITHUB_ACTIONS"in pe||"GITEA_ACTIONS"in pe?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(l=>l in pe)||pe.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in pe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(pe.TEAMCITY_VERSION)?1:0;if(pe.COLORTERM==="truecolor"||pe.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in pe){let l=Number.parseInt((pe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(pe.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(pe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(pe.TERM)||"COLORTERM"in pe?1:a}function vf(t,e={}){let r=Ky(t,{streamIsTTY:t&&t.isTTY,...e});return Qy(r)}var Xy={stdout:vf({isTTY:xf.isatty(1)}),stderr:vf({isTTY:xf.isatty(2)})},Of=Xy;var $f=!0;function If(){$f=!1}function ao(t,e,r){return $f?`\x1B[${e}m${t.join(" ")}\x1B[${r}m`:t.join(" ")}var lo=(...t)=>ao(t,31,39),Tr=(...t)=>ao(t,32,39);var Ss=(...t)=>ao(t,35,39);var Zy=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var uo=new Set(["__proto__","prototype","constructor"]),Jy=new Set("0123456789");function e_(t){let e=[],r="",s="start",i=!1;for(let a of t)switch(a){case"\\":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=a),s="property",i=!i;break}case".":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd"){s="property";break}if(i){i=!1,r+=a;break}if(uo.has(r))return[];e.push(r),r="",s="property";break}case"[":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd"){s="index";break}if(i){i=!1,r+=a;break}if(s==="property"){if(uo.has(r))return[];e.push(r),r=""}s="index";break}case"]":{if(s==="index"){e.push(Number.parseInt(r,10)),r="",s="indexEnd";break}if(s==="indexEnd")throw new Error("Invalid character after an index")}default:{if(s==="index"&&!Jy.has(a))throw new Error("Invalid character in an index");if(s==="indexEnd")throw new Error("Invalid character after an index");s==="start"&&(s="property"),i&&(i=!1,r+="\\"),r+=a}}switch(i&&(r+="\\"),s){case"property":{if(uo.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function t_(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function Lf(t,e,r){if(!Zy(t)||typeof e!="string")return r===void 0?t:r;let s=e_(e);if(s.length===0)return r;for(let i=0;i<s.length;i++){let a=s[i];if(t_(t,a)?t=i===s.length-1?void 0:null:t=t[a],t==null){if(i!==s.length-1)return r;break}}return t===void 0?r:t}var co=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Pf=t=>globalThis.DOMException===void 0?new co(t):new DOMException(t),Nf=t=>{let e=t.reason===void 0?Pf("This operation was aborted."):t.reason;return e instanceof Error?e:Pf(e)};async function fo(t,e,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:s=!0,signal:i}={}){return new Promise((a,l)=>{if(t[Symbol.iterator]===void 0&&t[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let h=[],c=[],f=new Map,p=!1,g=!1,m=!1,y=0,R=0,w=t[Symbol.iterator]===void 0?t[Symbol.asyncIterator]():t[Symbol.iterator](),O=$=>{p=!0,g=!0,l($)};i&&(i.aborted&&O(Nf(i)),i.addEventListener("abort",()=>{O(Nf(i))}));let x=async()=>{if(g)return;let $=await w.next(),F=R;if(R++,$.done){if(m=!0,y===0&&!g){if(!s&&c.length>0){O(new AggregateError(c));return}if(g=!0,f.size===0){a(h);return}let C=[];for(let[v,H]of h.entries())f.get(v)!==Hf&&C.push(H);a(C)}return}y++,(async()=>{try{let C=await $.value;if(g)return;let v=await e(C,F);v===Hf&&f.set(F,v),h[F]=v,y--,await x()}catch(C){if(s)O(C);else{c.push(C),y--;try{await x()}catch(v){O(v)}}}})()};(async()=>{for(let $=0;$<r;$++){try{await x()}catch(F){O(F);break}if(m||p)break}})()})}var Hf=Symbol("skip");async function ho(t,e){return fo(t,r=>r(),e)}function Cr(t,e){var r=0,s,i;e=e||{};function a(){var l=s,h=arguments.length,c,f;e:for(;l;){if(l.args.length!==arguments.length){l=l.next;continue}for(f=0;f<h;f++)if(l.args[f]!==arguments[f]){l=l.next;continue e}return l!==s&&(l===i&&(i=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=s,l.prev=null,s.prev=l,s=l),l.val}for(c=new Array(h),f=0;f<h;f++)c[f]=arguments[f];return l={args:c,val:t.apply(null,c)},s?(s.prev=l,l.next=s):i=l,r===e.maxSize?(i=i.prev,i.next=null):r++,s=l,l.val}return a.clear=function(){s=null,i=null,r=0},a}var Lo=Fe(sh(),1),Ir;globalThis.fetch&&!M_?.node?Ir=globalThis.fetch:Ir=_i(es,{undici:!1});var kh=96,pt="\0",j_=/^.*?:\/\/(.*?@)?(github\.com[:/])/i,G_=/^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i,Po=/^[0-9a-f]{7,}$/i,Th=/[0-9]+(\.[0-9]+)?(\.[0-9]+)?/g,Is=t=>t.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&"),V_=Cr(Mh.default.fromUrl),xo=Cr(qh.default),Ls=Cr(t=>t.endsWith("/")?t.substring(0,t.length-1):t),Y_=new Set(["patch"]),Q_=new Set(["patch","minor"]),K_=new Set(["patch","minor","major"]),zh="15.2.0",te=(0,Bh.default)(U_.slice(2),{boolean:["E","error-on-outdated","U","error-on-unchanged","h","help","j","json","n","no-color","u","update","v","version","V","verbose"],string:["d","allow-downgrade","f","file","g","greatest","m","minor","P","patch","p","prerelease","R","release","r","registry","t","types","githubapi","pypiapi"],alias:{d:"allow-downgrade",E:"error-on-outdated",U:"error-on-unchanged",e:"exclude",f:"file",g:"greatest",h:"help",i:"include",j:"json",m:"minor",n:"no-color",P:"patch",p:"prerelease",r:"registry",R:"release",s:"semver",S:"sockets",t:"types",u:"update",v:"version",V:"verbose"}});(te["no-color"]||!Of.stdout)&&If();var Or=hn(Xt(te.greatest)),vo=hn(Xt(te.prerelease)),Oo=hn(Xt(te.release)),Ch=hn(Xt(te.patch)),xh=hn(Xt(te.minor)),vh=Xt(te["allow-downgrade"]),rt=(0,Fh.default)("npm",{registry:"https://registry.npmjs.org"}),$o={npmrc:rt,recursive:!0},Oh=te.githubapi?Ls(te.githubapi):"https://api.github.com",X_=te.pypiapi?Ls(te.pypiapi):"https://pypi.org",jh=typeof te.sockets=="number"?parseInt(te.sockets):kh;function Kt(t,e){for(let r of e instanceof Set?e:[])if(r.test(t))return!0;return!1}var Z_=Cr((t,e)=>{let r=e[`${t}:registry`]||e.registry;return r.endsWith("/")?r:`${r}/`});function Gh(t,e,r){let s=Ho(e,t);try{return z_(s),s}catch{}let i=Wh(e);return r&&s===r||i===e?null:Gh(t,i,r)}function J_(t,e){if(t.startsWith("@")){let r=(/@[a-z0-9][\w-.]+/.exec(t)||[])[0],s=Ls(Z_(r,rt));if(s!==e)try{let i=xo(s,$o);if(i?.token)return[i,s]}catch{}return[xo(e,$o),e]}else return[xo(e,$o),e]}var Vh=Cr((t,e,r)=>({...Object.keys(t).length&&{agentOpts:t},headers:{"user-agent":`updates/${zh}`,...r&&{Authorization:`${e} ${r}`}}}));async function eR(t,e,r,s){let[i,a]=J_(t,r),h=(e==="resolutions"?hR(t):t).replace(/\//g,"%2f"),c=`${a}/${h}`;te.verbose&&console.error(`${Ss("fetch")} ${c}`);let f=await Ir(c,Vh(s,i?.type,i?.token));if(f?.ok)return te.verbose&&console.error(`${Tr("done")} ${c}`),[await f.json(),e,a,t];throw f?.status&&f?.statusText?new Error(`Received ${f.status} ${f.statusText} for ${t} from ${a}`):new Error(`Unable to fetch ${t} from ${a}`)}async function tR(t,e,r){let s=`${X_}/pypi/${t}/json`;te.verbose&&console.error(`${Ss("fetch")} ${s}`);let i=await Ir(s,Vh(r));if(i?.ok)return te.verbose&&console.error(`${Tr("done")} ${s}`),[await i.json(),e,null,t];throw i?.status&&i?.statusText?new Error(`Received ${i.status} ${i.statusText} for ${t} from PyPi`):new Error(`Unable to fetch ${t} from PyPi`)}function $h({repository:t,homepage:e,info:r},s,i){r&&(t=r.project_urls.repository||r.project_urls.Repository||r.project_urls.repo||r.project_urls.Repo||r.project_urls.source||r.project_urls.Source||r.project_urls["source code"]||r.project_urls["Source Code"]||r.project_urls.homepage||r.project_urls.Homepage||`https://pypi.org/project/${i}/`);let a;if(s==="https://npm.pkg.github.com")return`https://github.com/${i.replace(/^@/,"")}`;if(t){let l=typeof t=="string"?t:t.url,h=V_(l),c=h?.browse?.();c&&(a=c),a&&t.directory&&h.treepath&&(a=`${a}/${h.treepath}/HEAD/${t.directory}`),!a&&t?.url&&/^https?:/.test(t.url)&&(a=t.url),!a&&l&&(a=l)}return a||e||""}function Ih(t){te.json?console.info(JSON.stringify({message:t})):console.info(t),$r()}function $r(t){if(t){let e=t.stack||t.message;te.json?console.info(JSON.stringify({error:e})):console.info(lo(e))}process.exit(t?1:0)}function rR(t={}){for(let r of Object.keys(t))for(let s of Object.values(t[r]))"oldPrint"in s&&(s.old=s.oldPrint,delete s.oldPrint),"newPrint"in s&&(s.new=s.newPrint,delete s.newPrint),"oldOriginal"in s&&(s.old=s.oldOriginal,delete s.oldOriginal);let e=0;for(let r of Object.keys(t))e+=Object.keys(t[r]).length;if(te.json){let r={results:{}};for(let s of Object.keys(t))for(let[i,a]of Object.entries(t[s])){let[l,h]=i.split(pt);r.results[s]||(r.results[s]={}),r.results[s][l]||(r.results[s][l]={}),r.results[s][l][h]=a}console.info(JSON.stringify(r))}else e&&console.info(sR(t));return te["error-on-outdated"]?e?2:0:te["error-on-unchanged"]?e?0:2:0}async function nR(t,e){let{platform:r}=await import("node:os"),s=r()==="win32";s&&W_(t,0),k_(t,e,s?{flag:"r+"}:void 0)}function Lh(t,e,r){if(t===e)return t;let s=t.split(/\./),i=e.split(/\./),a=/^[0-9a-zA-Z-.]+$/,l="";for(let h=0;h<s.length;h++)if(s[h]!==i[h]){a.test(s[h])?l+=r(s.slice(h).join(".")):l+=s[h].split("").map(c=>a.test(c)?r(c):c).join("")+r(`.${s.slice(h+1).join(".")}`);break}else l+=`${s[h]}.`;return l}function sR(t){let e=[["NAME","OLD","NEW","AGE","INFO"]],r=new Set;for(let s of Object.keys(t))for(let[i,a]of Object.entries(t[s])){let l=i.split(pt)[1],h=`${s}|${l}`;r.has(h)||(r.add(h),e.push([l,Lh(a.old,a.new,lo),Lh(a.new,a.old,Tr),a.age||"",a.info]))}return(0,Uh.default)(e,{hsep:" ",stringLength:s=>s.replace(hi(),"").length})}function iR(t,e){let r=t;for(let s of Object.keys(e)){let i=s.split(pt)[1],a=e[s].oldOriginal||e[s].old,l=new RegExp(`"${Is(i)}": *"${Is(a)}"`,"g");r=r.replace(l,`"${i}": "${e[s].new}"`)}return r}function oR(t,e){let r=t;for(let s of Object.keys(e)){let i=s.split(pt)[1],a=e[s].oldOriginal||e[s].old,l=new RegExp(`${Is(i)} *= *"${Is(a)}"`,"g");r=r.replace(l,`${i} = "${e[s].new}"`)}return r}function aR(t,e){return t.replace(/[0-9]+\.[0-9]+\.[0-9]+(-.+)?/g,e)}function Io(t){let e=(0,oe.parse)(t);return e?!!e.prerelease.length:!1}function Yh(t){return/[0-9]+\.[0-9]+\.[0-9]+-.+/.test(t)}function lR(t){try{return(0,oe.coerce)(t).version}catch{return null}}function uR(t,e,{range:r,semvers:s,usePre:i,useRel:a,useGreatest:l}={}){let h=lR(r),c=0;s=new Set(s),i=Yh(r)||i,i&&(s.add("prerelease"),s.has("patch")&&s.add("prepatch"),s.has("minor")&&s.add("preminor"),s.has("major")&&s.add("premajor"));for(let f of e){let p=(0,oe.parse)(f);if(p.prerelease.length&&(!i||a))continue;let g=(0,oe.diff)(h,p.version);if(!(!g||!s.has(g)))if(l||!("time"in t))(0,oe.gte)((0,oe.coerce)(p.version).version,h)&&(h=p.version);else{let m=new Date(t.time[f]).getTime();m>=0&&m>c&&(h=p.version,c=m)}}return h||null}function cR(t,{mode:e,range:r,useGreatest:s,useRel:i,usePre:a,semvers:l}={}){if(r==="*"||r.includes("||"))return null;let h=Object.keys(e==="pypi"?t.releases:t.versions).filter(f=>(0,oe.valid)(f)),c=uR(t,h,{range:r,semvers:l,usePre:a,useRel:i,useGreatest:s});if(s)return c;{let f,p;e==="pypi"?(p=t.info.version,f=(0,oe.coerce)(t.info.version).version):f=t["dist-tags"].latest;let g=(0,oe.coerce)(r).version,m=Yh(r),y=Io(c),R=Io(f),w=(0,oe.gt)(c,g);if(!i&&a||m&&y||i&&!w&&m&&!y||m&&!y&&w)return c;if(m&&!y&&!w)return null;let O=(0,oe.diff)(g,f);return O&&O!=="prerelease"&&!l.has(O.replace(/^pre/,""))||i&&Io(f)?c:(0,oe.lt)(f,g)&&!R?vh===!0||Kt(t.name,vh)?f:null:p??f}}async function fR([t,e],{useGreatest:r}={}){let s=e.old.replace(j_,""),[i,a,l,h]=G_.exec(s)||[];if(!(!a||!l||!h))if(Po.test(h)){let c={maxSockets:jh},f=Os.UPDATES_GITHUB_API_TOKEN||Os.GITHUB_API_TOKEN||Os.GH_TOKEN||Os.HOMEBREW_GITHUB_API_TOKEN;f&&(c.headers={Authorization:`Bearer ${f}`});let p=`${Oh}/repos/${a}/${l}/commits`;te.verbose&&console.error(`${Ss("fetch")} ${p}`);let g=await Ir(p,c);if(te.verbose&&g?.ok&&console.error(`${Tr("done")} ${p}`),!g||!g.ok)return;let m=await g.json(),{sha:y,commit:R}=m[0];if(!y||!y.length)return;let w=R?.committer?.date??R?.author?.date;if(y=y.substring(0,h.length),h!==y){let O=e.old.replace(h,y);return{key:t,newRange:O,user:a,repo:l,oldRef:h,newRef:y,newDate:w}}}else{let c=await Ir(`${Oh}/repos/${a}/${l}/git/refs/tags`);if(!c||!c.ok)return;let p=(await c.json()).map(m=>m.ref.replace(/^refs\/tags\//,"")),g=h.replace(/^v/,"");if(!(0,oe.valid)(g))return;if(r){let m=h,y=h.replace(/^v/,"");for(let R of p){let w=R.replace(/^v/,"");(0,oe.valid)(w)&&(!m||(0,oe.gt)(w,y))&&(m=R,y=w)}if((0,oe.neq)(g,y))return{key:t,newRange:m,user:a,repo:l,oldRef:h,newRef:m}}else{let m=p[p.length-1],y=m.replace(/^v/,"");if(!(0,oe.valid)(y))return;if((0,oe.neq)(g,y))return{key:t,newRange:m,user:a,repo:l,oldRef:h,newRef:m}}}}function hR(t){let e=t.match(/(@[^/]+\/)?([^/]+)/g)||[];return e[e.length-1]}function dR(t){let e=t.match(Th);return e?.length!==1?t:t.replace(Th,(0,oe.coerce)(e[0]))}function Xt(t){return t===void 0?!1:t===""?!0:typeof t=="string"?t.includes(",")?new Set(t.split(",")):new Set([t]):Array.isArray(t)?new Set(t):!1}function Ph(t){return Array.from(t.matchAll(/(----BEGIN CERT[^]+?IFICATE----)/g),e=>e[0])}async function Nh(t=[]){return[...(await import("node:tls")).rootCertificates,...t]}function No(t,e){return e?/\/.+\//.test(t)?new RegExp(t.slice(1,-1)):Lo.default.makeRe(t):t instanceof RegExp?t:Lo.default.makeRe(t)}function hn(t){if(t instanceof Set){let e=new Set;for(let r of t)e.add(No(r,!0));return e}return t}function Hh(t,e){let r=new Set;for(let s of t||[])r.add(No(s,!0));for(let s of e||[])r.add(No(s,!1));return r}function Dh(t,e,{include:r,exclude:s}){if(e==="pypi"&&t==="python")return!1;if(!r.size&&!s.size)return!0;for(let i of s)if(i.test(t))return!1;for(let i of r)if(i.test(t))return!0;return!r.size}function pR(t){let e=new Set;if(t)for(let r of t){let s;try{s=Eh(r)}catch(i){throw new Error(`Unable to open ${r}: ${i.message}`)}if(s?.isFile())e.add($s(r));else if(s?.isDirectory())for(let i of["package.json","pyproject.toml"]){let a=Ho(r,i),l;try{l=Eh(a)}catch{}l?.isFile()&&e.add($s(a))}else throw new Error(`${r} is neither a file nor directory`)}else for(let r of["package.json","pyproject.toml"]){let s=q_(),i=Gh(r,s);i&&e.add($s(i))}return e}async function mR(){for(let m of[process.stdout,process.stderr])m?._handle?.setBlocking?.(!0);let{help:t,version:e,file:r,types:s,update:i}=te;t&&(F_.write(`usage: updates [options]
|
|
28
|
+
`),s=!1,i=!1,a;t.on("response",l=>{let{headers:h}=l;s=h["transfer-encoding"]==="chunked"&&!h["content-length"]}),t.on("socket",l=>{let h=()=>{if(s&&!i){let f=new Error("Premature close");f.code="ERR_STREAM_PREMATURE_CLOSE",e(f)}},c=f=>{i=Jn.compare(f.slice(-5),r)===0,!i&&a&&(i=Jn.compare(a.slice(-3),r.slice(0,3))===0&&Jn.compare(f.slice(-2),r.slice(3))===0),a=f};l.prependListener("close",h),l.on("data",c),t.on("close",()=>{l.removeListener("close",h),l.removeListener("data",c)})})}var qh=Fe(uu(),1),Fh=Fe(Ni(),1),oe=Fe(af(),1),Uh=Fe(hf(),1),Mh=Fe(Cf(),1);import{cwd as q_,stdout as F_,argv as U_,env as Os,exit as wh,versions as M_}from"node:process";import{join as Ho,dirname as Wh,basename as Co,resolve as $s}from"node:path";import{lstatSync as Eh,readFileSync as Ah,truncateSync as W_,writeFileSync as k_,accessSync as z_}from"node:fs";var zy=[[1e3,6e4,"sec"],[6e4,36e5,"min"],[36e5,864e5,"hour"],[864e5,6048e5,"day"],[6048e5,2628e6,"week"],[2628e6,31536e6,"month"],[31536e6,1/0,"year"]],jy={"1 day ago":"yesterday","1 week ago":"last week","1 month ago":"last month","1 year ago":"last year","in 1 day":"tomorrow","in 1 week":"next week","in 1 month":"next month","in 1 year":"next year"},Gy={sec:"second",min:"minute"};function _s(t,{now:e,noAffix:r=!1,times:s=zy,nowThreshold:i=2e3,nowString:a="now",aliases:l=!1,aliasesMap:h=jy,longUnits:c=!1}={}){if(t=typeof t=="number"?t:Date.parse(t),e=e?typeof e=="number"?e:Date.parse(e):new Date,Number.isNaN(t))return"unknown";let f=!1,p=e-t;if(p<0&&(f=!0,p=Math.abs(p)),p<i)return a;let g,m;for(let R=0,w=s.length;R<w;R++){let O=s[R];if(!(p>=O[1])){g=Math.floor(p/O[0]),m=(c&&Gy[O[2]]||O[2])+(g>1?"s":"");break}}let y=`${f&&!r?"in ":""}${g} ${m}${!f&&!r?" ago":""}`;return l?h[y]??y:y}import oo from"node:process";import Vy from"node:os";import xf from"node:tty";function ze(t,e=globalThis.Deno?globalThis.Deno.args:oo.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",s=e.indexOf(r+t),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:pe}=oo,Rs;ze("no-color")||ze("no-colors")||ze("color=false")||ze("color=never")?Rs=0:(ze("color")||ze("colors")||ze("color=true")||ze("color=always"))&&(Rs=1);function Yy(){if("FORCE_COLOR"in pe)return pe.FORCE_COLOR==="true"?1:pe.FORCE_COLOR==="false"?0:pe.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(pe.FORCE_COLOR,10),3)}function Qy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Ky(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let s=Yy();s!==void 0&&(Rs=s);let i=r?Rs:s;if(i===0)return 0;if(r){if(ze("color=16m")||ze("color=full")||ze("color=truecolor"))return 3;if(ze("color=256"))return 2}if("TF_BUILD"in pe&&"AGENT_NAME"in pe)return 1;if(t&&!e&&i===void 0)return 0;let a=i||0;if(pe.TERM==="dumb")return a;if(oo.platform==="win32"){let l=Vy.release().split(".");return Number(l[0])>=10&&Number(l[2])>=10586?Number(l[2])>=14931?3:2:1}if("CI"in pe)return"GITHUB_ACTIONS"in pe||"GITEA_ACTIONS"in pe?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(l=>l in pe)||pe.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in pe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(pe.TEAMCITY_VERSION)?1:0;if(pe.COLORTERM==="truecolor"||pe.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in pe){let l=Number.parseInt((pe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(pe.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(pe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(pe.TERM)||"COLORTERM"in pe?1:a}function vf(t,e={}){let r=Ky(t,{streamIsTTY:t&&t.isTTY,...e});return Qy(r)}var Xy={stdout:vf({isTTY:xf.isatty(1)}),stderr:vf({isTTY:xf.isatty(2)})},Of=Xy;var $f=!0;function If(){$f=!1}function ao(t,e,r){return $f?`\x1B[${e}m${t.join(" ")}\x1B[${r}m`:t.join(" ")}var lo=(...t)=>ao(t,31,39),Tr=(...t)=>ao(t,32,39);var Ss=(...t)=>ao(t,35,39);var Zy=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var uo=new Set(["__proto__","prototype","constructor"]),Jy=new Set("0123456789");function e_(t){let e=[],r="",s="start",i=!1;for(let a of t)switch(a){case"\\":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=a),s="property",i=!i;break}case".":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd"){s="property";break}if(i){i=!1,r+=a;break}if(uo.has(r))return[];e.push(r),r="",s="property";break}case"[":{if(s==="index")throw new Error("Invalid character in an index");if(s==="indexEnd"){s="index";break}if(i){i=!1,r+=a;break}if(s==="property"){if(uo.has(r))return[];e.push(r),r=""}s="index";break}case"]":{if(s==="index"){e.push(Number.parseInt(r,10)),r="",s="indexEnd";break}if(s==="indexEnd")throw new Error("Invalid character after an index")}default:{if(s==="index"&&!Jy.has(a))throw new Error("Invalid character in an index");if(s==="indexEnd")throw new Error("Invalid character after an index");s==="start"&&(s="property"),i&&(i=!1,r+="\\"),r+=a}}switch(i&&(r+="\\"),s){case"property":{if(uo.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function t_(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function Lf(t,e,r){if(!Zy(t)||typeof e!="string")return r===void 0?t:r;let s=e_(e);if(s.length===0)return r;for(let i=0;i<s.length;i++){let a=s[i];if(t_(t,a)?t=i===s.length-1?void 0:null:t=t[a],t==null){if(i!==s.length-1)return r;break}}return t===void 0?r:t}var co=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Pf=t=>globalThis.DOMException===void 0?new co(t):new DOMException(t),Nf=t=>{let e=t.reason===void 0?Pf("This operation was aborted."):t.reason;return e instanceof Error?e:Pf(e)};async function fo(t,e,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:s=!0,signal:i}={}){return new Promise((a,l)=>{if(t[Symbol.iterator]===void 0&&t[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let h=[],c=[],f=new Map,p=!1,g=!1,m=!1,y=0,R=0,w=t[Symbol.iterator]===void 0?t[Symbol.asyncIterator]():t[Symbol.iterator](),O=$=>{p=!0,g=!0,l($)};i&&(i.aborted&&O(Nf(i)),i.addEventListener("abort",()=>{O(Nf(i))}));let x=async()=>{if(g)return;let $=await w.next(),F=R;if(R++,$.done){if(m=!0,y===0&&!g){if(!s&&c.length>0){O(new AggregateError(c));return}if(g=!0,f.size===0){a(h);return}let C=[];for(let[v,H]of h.entries())f.get(v)!==Hf&&C.push(H);a(C)}return}y++,(async()=>{try{let C=await $.value;if(g)return;let v=await e(C,F);v===Hf&&f.set(F,v),h[F]=v,y--,await x()}catch(C){if(s)O(C);else{c.push(C),y--;try{await x()}catch(v){O(v)}}}})()};(async()=>{for(let $=0;$<r;$++){try{await x()}catch(F){O(F);break}if(m||p)break}})()})}var Hf=Symbol("skip");async function ho(t,e){return fo(t,r=>r(),e)}function Cr(t,e){var r=0,s,i;e=e||{};function a(){var l=s,h=arguments.length,c,f;e:for(;l;){if(l.args.length!==arguments.length){l=l.next;continue}for(f=0;f<h;f++)if(l.args[f]!==arguments[f]){l=l.next;continue e}return l!==s&&(l===i&&(i=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=s,l.prev=null,s.prev=l,s=l),l.val}for(c=new Array(h),f=0;f<h;f++)c[f]=arguments[f];return l={args:c,val:t.apply(null,c)},s?(s.prev=l,l.next=s):i=l,r===e.maxSize?(i=i.prev,i.next=null):r++,s=l,l.val}return a.clear=function(){s=null,i=null,r=0},a}var Lo=Fe(sh(),1),Ir;globalThis.fetch&&!M_?.node?Ir=globalThis.fetch:Ir=_i(es,{undici:!1});var kh=96,pt="\0",j_=/^.*?:\/\/(.*?@)?(github\.com[:/])/i,G_=/^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i,Po=/^[0-9a-f]{7,}$/i,Th=/[0-9]+(\.[0-9]+)?(\.[0-9]+)?/g,Is=t=>t.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&"),V_=Cr(Mh.default.fromUrl),xo=Cr(qh.default),Ls=Cr(t=>t.endsWith("/")?t.substring(0,t.length-1):t),Y_=new Set(["patch"]),Q_=new Set(["patch","minor"]),K_=new Set(["patch","minor","major"]),zh="15.3.1",te=(0,Bh.default)(U_.slice(2),{boolean:["E","error-on-outdated","U","error-on-unchanged","h","help","j","json","n","no-color","u","update","v","version","V","verbose"],string:["d","allow-downgrade","f","file","g","greatest","m","minor","P","patch","p","prerelease","R","release","r","registry","t","types","githubapi","pypiapi"],alias:{d:"allow-downgrade",E:"error-on-outdated",U:"error-on-unchanged",e:"exclude",f:"file",g:"greatest",h:"help",i:"include",j:"json",m:"minor",n:"no-color",P:"patch",p:"prerelease",r:"registry",R:"release",s:"semver",S:"sockets",t:"types",u:"update",v:"version",V:"verbose"}});(te["no-color"]||!Of.stdout)&&If();var Or=hn(Xt(te.greatest)),vo=hn(Xt(te.prerelease)),Oo=hn(Xt(te.release)),Ch=hn(Xt(te.patch)),xh=hn(Xt(te.minor)),vh=Xt(te["allow-downgrade"]),rt=(0,Fh.default)("npm",{registry:"https://registry.npmjs.org"}),$o={npmrc:rt,recursive:!0},Oh=te.githubapi?Ls(te.githubapi):"https://api.github.com",X_=te.pypiapi?Ls(te.pypiapi):"https://pypi.org",jh=typeof te.sockets=="number"?parseInt(te.sockets):kh;function Kt(t,e){for(let r of e instanceof Set?e:[])if(r.test(t))return!0;return!1}var Z_=Cr((t,e)=>{let r=e[`${t}:registry`]||e.registry;return r.endsWith("/")?r:`${r}/`});function Gh(t,e,r){let s=Ho(e,t);try{return z_(s),s}catch{}let i=Wh(e);return r&&s===r||i===e?null:Gh(t,i,r)}function J_(t,e){if(t.startsWith("@")){let r=(/@[a-z0-9][\w-.]+/.exec(t)||[])[0],s=Ls(Z_(r,rt));if(s!==e)try{let i=xo(s,$o);if(i?.token)return[i,s]}catch{}return[xo(e,$o),e]}else return[xo(e,$o),e]}var Vh=Cr((t,e,r)=>({...Object.keys(t).length&&{agentOpts:t},headers:{"user-agent":`updates/${zh}`,...r&&{Authorization:`${e} ${r}`}}}));async function eR(t,e,r,s){let[i,a]=J_(t,r),h=(e==="resolutions"?hR(t):t).replace(/\//g,"%2f"),c=`${a}/${h}`;te.verbose&&console.error(`${Ss("fetch")} ${c}`);let f=await Ir(c,Vh(s,i?.type,i?.token));if(f?.ok)return te.verbose&&console.error(`${Tr("done")} ${c}`),[await f.json(),e,a,t];throw f?.status&&f?.statusText?new Error(`Received ${f.status} ${f.statusText} for ${t} from ${a}`):new Error(`Unable to fetch ${t} from ${a}`)}async function tR(t,e,r){let s=`${X_}/pypi/${t}/json`;te.verbose&&console.error(`${Ss("fetch")} ${s}`);let i=await Ir(s,Vh(r));if(i?.ok)return te.verbose&&console.error(`${Tr("done")} ${s}`),[await i.json(),e,null,t];throw i?.status&&i?.statusText?new Error(`Received ${i.status} ${i.statusText} for ${t} from PyPi`):new Error(`Unable to fetch ${t} from PyPi`)}function $h({repository:t,homepage:e,info:r},s,i){r&&(t=r.project_urls.repository||r.project_urls.Repository||r.project_urls.repo||r.project_urls.Repo||r.project_urls.source||r.project_urls.Source||r.project_urls["source code"]||r.project_urls["Source Code"]||r.project_urls.homepage||r.project_urls.Homepage||`https://pypi.org/project/${i}/`);let a;if(s==="https://npm.pkg.github.com")return`https://github.com/${i.replace(/^@/,"")}`;if(t){let l=typeof t=="string"?t:t.url,h=V_(l),c=h?.browse?.();c&&(a=c),a&&t.directory&&h.treepath&&(a=`${a}/${h.treepath}/HEAD/${t.directory}`),!a&&t?.url&&/^https?:/.test(t.url)&&(a=t.url),!a&&l&&(a=l)}return a||e||""}function Ih(t){te.json?console.info(JSON.stringify({message:t})):console.info(t),$r()}function $r(t){if(t){let e=t.stack||t.message;te.json?console.info(JSON.stringify({error:e})):console.info(lo(e))}process.exit(t?1:0)}function rR(t={}){for(let r of Object.keys(t))for(let s of Object.values(t[r]))"oldPrint"in s&&(s.old=s.oldPrint,delete s.oldPrint),"newPrint"in s&&(s.new=s.newPrint,delete s.newPrint),"oldOriginal"in s&&(s.old=s.oldOriginal,delete s.oldOriginal);let e=0;for(let r of Object.keys(t))e+=Object.keys(t[r]).length;if(te.json){let r={results:{}};for(let s of Object.keys(t))for(let[i,a]of Object.entries(t[s])){let[l,h]=i.split(pt);r.results[s]||(r.results[s]={}),r.results[s][l]||(r.results[s][l]={}),r.results[s][l][h]=a}console.info(JSON.stringify(r))}else e&&console.info(sR(t));return te["error-on-outdated"]?e?2:0:te["error-on-unchanged"]?e?0:2:0}async function nR(t,e){let{platform:r}=await import("node:os"),s=r()==="win32";s&&W_(t,0),k_(t,e,s?{flag:"r+"}:void 0)}function Lh(t,e,r){if(t===e)return t;let s=t.split(/\./),i=e.split(/\./),a=/^[0-9a-zA-Z-.]+$/,l="";for(let h=0;h<s.length;h++)if(s[h]!==i[h]){a.test(s[h])?l+=r(s.slice(h).join(".")):l+=s[h].split("").map(c=>a.test(c)?r(c):c).join("")+r(`.${s.slice(h+1).join(".")}`);break}else l+=`${s[h]}.`;return l}function sR(t){let e=[["NAME","OLD","NEW","AGE","INFO"]],r=new Set;for(let s of Object.keys(t))for(let[i,a]of Object.entries(t[s])){let l=i.split(pt)[1],h=`${s}|${l}`;r.has(h)||(r.add(h),e.push([l,Lh(a.old,a.new,lo),Lh(a.new,a.old,Tr),a.age||"",a.info]))}return(0,Uh.default)(e,{hsep:" ",stringLength:s=>s.replace(hi(),"").length})}function iR(t,e){let r=t;for(let s of Object.keys(e)){let i=s.split(pt)[1],a=e[s].oldOriginal||e[s].old,l=new RegExp(`"${Is(i)}": *"${Is(a)}"`,"g");r=r.replace(l,`"${i}": "${e[s].new}"`)}return r}function oR(t,e){let r=t;for(let s of Object.keys(e)){let i=s.split(pt)[1],a=e[s].oldOriginal||e[s].old,l=new RegExp(`${Is(i)} *= *"${Is(a)}"`,"g");r=r.replace(l,`${i} = "${e[s].new}"`)}return r}function aR(t,e){return t.replace(/[0-9]+\.[0-9]+\.[0-9]+(-.+)?/g,e)}function Io(t){let e=(0,oe.parse)(t);return e?!!e.prerelease.length:!1}function Yh(t){return/[0-9]+\.[0-9]+\.[0-9]+-.+/.test(t)}function lR(t){try{return(0,oe.coerce)(t).version}catch{return null}}function uR(t,e,{range:r,semvers:s,usePre:i,useRel:a,useGreatest:l}={}){let h=lR(r),c=0;s=new Set(s),i=Yh(r)||i,i&&(s.add("prerelease"),s.has("patch")&&s.add("prepatch"),s.has("minor")&&s.add("preminor"),s.has("major")&&s.add("premajor"));for(let f of e){let p=(0,oe.parse)(f);if(p.prerelease.length&&(!i||a))continue;let g=(0,oe.diff)(h,p.version);if(!(!g||!s.has(g)))if(l||!("time"in t))(0,oe.gte)((0,oe.coerce)(p.version).version,h)&&(h=p.version);else{let m=new Date(t.time[f]).getTime();m>=0&&m>c&&(h=p.version,c=m)}}return h||null}function cR(t,{mode:e,range:r,useGreatest:s,useRel:i,usePre:a,semvers:l}={}){if(r==="*"||r.includes("||"))return null;let h=Object.keys(e==="pypi"?t.releases:t.versions).filter(f=>(0,oe.valid)(f)),c=uR(t,h,{range:r,semvers:l,usePre:a,useRel:i,useGreatest:s});if(s)return c;{let f,p;e==="pypi"?(p=t.info.version,f=(0,oe.coerce)(t.info.version).version):f=t["dist-tags"].latest;let g=(0,oe.coerce)(r).version,m=Yh(r),y=Io(c),R=Io(f),w=(0,oe.gt)(c,g);if(!i&&a||m&&y||i&&!w&&m&&!y||m&&!y&&w)return c;if(m&&!y&&!w)return null;let O=(0,oe.diff)(g,f);return O&&O!=="prerelease"&&!l.has(O.replace(/^pre/,""))||i&&Io(f)?c:(0,oe.lt)(f,g)&&!R?vh===!0||Kt(t.name,vh)?f:null:p??f}}async function fR([t,e],{useGreatest:r}={}){let s=e.old.replace(j_,""),[i,a,l,h]=G_.exec(s)||[];if(!(!a||!l||!h))if(Po.test(h)){let c={maxSockets:jh},f=Os.UPDATES_GITHUB_API_TOKEN||Os.GITHUB_API_TOKEN||Os.GH_TOKEN||Os.HOMEBREW_GITHUB_API_TOKEN;f&&(c.headers={Authorization:`Bearer ${f}`});let p=`${Oh}/repos/${a}/${l}/commits`;te.verbose&&console.error(`${Ss("fetch")} ${p}`);let g=await Ir(p,c);if(te.verbose&&g?.ok&&console.error(`${Tr("done")} ${p}`),!g||!g.ok)return;let m=await g.json(),{sha:y,commit:R}=m[0];if(!y||!y.length)return;let w=R?.committer?.date??R?.author?.date;if(y=y.substring(0,h.length),h!==y){let O=e.old.replace(h,y);return{key:t,newRange:O,user:a,repo:l,oldRef:h,newRef:y,newDate:w}}}else{let c=await Ir(`${Oh}/repos/${a}/${l}/git/refs/tags`);if(!c||!c.ok)return;let p=(await c.json()).map(m=>m.ref.replace(/^refs\/tags\//,"")),g=h.replace(/^v/,"");if(!(0,oe.valid)(g))return;if(r){let m=h,y=h.replace(/^v/,"");for(let R of p){let w=R.replace(/^v/,"");(0,oe.valid)(w)&&(!m||(0,oe.gt)(w,y))&&(m=R,y=w)}if((0,oe.neq)(g,y))return{key:t,newRange:m,user:a,repo:l,oldRef:h,newRef:m}}else{let m=p[p.length-1],y=m.replace(/^v/,"");if(!(0,oe.valid)(y))return;if((0,oe.neq)(g,y))return{key:t,newRange:m,user:a,repo:l,oldRef:h,newRef:m}}}}function hR(t){let e=t.match(/(@[^/]+\/)?([^/]+)/g)||[];return e[e.length-1]}function dR(t){let e=t.match(Th);return e?.length!==1?t:t.replace(Th,(0,oe.coerce)(e[0]))}function Xt(t){return t===void 0?!1:t===""?!0:typeof t=="string"?t.includes(",")?new Set(t.split(",")):new Set([t]):Array.isArray(t)?new Set(t):!1}function Ph(t){return Array.from(t.matchAll(/(----BEGIN CERT[^]+?IFICATE----)/g),e=>e[0])}async function Nh(t=[]){return[...(await import("node:tls")).rootCertificates,...t]}function No(t,e){return e?/\/.+\//.test(t)?new RegExp(t.slice(1,-1)):Lo.default.makeRe(t):t instanceof RegExp?t:Lo.default.makeRe(t)}function hn(t){if(t instanceof Set){let e=new Set;for(let r of t)e.add(No(r,!0));return e}return t}function Hh(t,e){let r=new Set;for(let s of t||[])r.add(No(s,!0));for(let s of e||[])r.add(No(s,!1));return r}function Dh(t,e,{include:r,exclude:s}){if(e==="pypi"&&t==="python")return!1;if(!r.size&&!s.size)return!0;for(let i of s)if(i.test(t))return!1;for(let i of r)if(i.test(t))return!0;return!r.size}function pR(t){let e=new Set;if(t)for(let r of t){let s;try{s=Eh(r)}catch(i){throw new Error(`Unable to open ${r}: ${i.message}`)}if(s?.isFile())e.add($s(r));else if(s?.isDirectory())for(let i of["package.json","pyproject.toml"]){let a=Ho(r,i),l;try{l=Eh(a)}catch{}l?.isFile()&&e.add($s(a))}else throw new Error(`${r} is neither a file nor directory`)}else for(let r of["package.json","pyproject.toml"]){let s=q_(),i=Gh(r,s);i&&e.add($s(i))}return e}async function mR(){for(let m of[process.stdout,process.stderr])m?._handle?.setBlocking?.(!0);let{help:t,version:e,file:r,types:s,update:i}=te;t&&(F_.write(`usage: updates [options]
|
|
29
29
|
|
|
30
30
|
Options:
|
|
31
31
|
-u, --update Update versions and write package file
|