npm-check-updates
Version:
Find newer versions of dependencies than what your package.json allows
48 lines • 1.2 MB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const ce=require("node:path"),g6=require("node:readline"),vt=require("node:events"),v2=require("node:child_process"),pt=require("node:fs"),ur=require("node:os"),$s=require("node:util"),Fe=require("node:fs/promises"),gt=require("node:url"),kf=require("node:http"),w2=require("node:https"),p1=require("node:assert"),Nf=require("node:buffer"),_2=require("node:zlib"),jt=require("node:stream"),Zr=require("node:string_decoder"),Mf=require("node:dns"),g1=require("node:crypto"),lc=require("node:net"),jf=require("node:tls"),S2=require("node:tty"),m6=require("node:timers/promises"),y6=require("node:querystring"),E6=require("node:stream/consumers"),D6=require("node:module");var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Me(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function b6(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var n=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return r[s]}})}),t}var A2={};let Im,C2,$2,F2,x2=!0;typeof process<"u"&&({FORCE_COLOR:Im,NODE_DISABLE_COLORS:C2,NO_COLOR:$2,TERM:F2}=process.env||{},x2=process.stdout&&process.stdout.isTTY);const Ue={enabled:!C2&&$2==null&&F2!=="dumb"&&(Im!=null&&Im!=="0"||x2),reset:Ve(0,0),bold:Ve(1,22),dim:Ve(2,22),italic:Ve(3,23),underline:Ve(4,24),inverse:Ve(7,27),hidden:Ve(8,28),strikethrough:Ve(9,29),black:Ve(30,39),red:Ve(31,39),green:Ve(32,39),yellow:Ve(33,39),blue:Ve(34,39),magenta:Ve(35,39),cyan:Ve(36,39),white:Ve(37,39),gray:Ve(90,39),grey:Ve(90,39),bgBlack:Ve(40,49),bgRed:Ve(41,49),bgGreen:Ve(42,49),bgYellow:Ve(43,49),bgBlue:Ve(44,49),bgMagenta:Ve(45,49),bgCyan:Ve(46,49),bgWhite:Ve(47,49)};function Db(r,e){let t=0,s,n="",o="";for(;t<r.length;t++)s=r[t],n+=s.open,o+=s.close,~e.indexOf(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return n+e+o}function v6(r,e){let t={has:r,keys:e};return t.reset=Ue.reset.bind(t),t.bold=Ue.bold.bind(t),t.dim=Ue.dim.bind(t),t.italic=Ue.italic.bind(t),t.underline=Ue.underline.bind(t),t.inverse=Ue.inverse.bind(t),t.hidden=Ue.hidden.bind(t),t.strikethrough=Ue.strikethrough.bind(t),t.black=Ue.black.bind(t),t.red=Ue.red.bind(t),t.green=Ue.green.bind(t),t.yellow=Ue.yellow.bind(t),t.blue=Ue.blue.bind(t),t.magenta=Ue.magenta.bind(t),t.cyan=Ue.cyan.bind(t),t.white=Ue.white.bind(t),t.gray=Ue.gray.bind(t),t.grey=Ue.grey.bind(t),t.bgBlack=Ue.bgBlack.bind(t),t.bgRed=Ue.bgRed.bind(t),t.bgGreen=Ue.bgGreen.bind(t),t.bgYellow=Ue.bgYellow.bind(t),t.bgBlue=Ue.bgBlue.bind(t),t.bgMagenta=Ue.bgMagenta.bind(t),t.bgCyan=Ue.bgCyan.bind(t),t.bgWhite=Ue.bgWhite.bind(t),t}function Ve(r,e){let t={open:`\x1B[${r}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(r)||(this.has.push(r),this.keys.push(t)),s===void 0?this:Ue.enabled?Db(this.keys,s+""):s+""):s===void 0?v6([r],[t]):Ue.enabled?Db([t],s+""):s+""}}var Jr=Ue,w6=(r,e)=>{if(!(r.meta&&r.name!=="escape")){if(r.ctrl){if(r.name==="a")return"first";if(r.name==="c"||r.name==="d")return"abort";if(r.name==="e")return"last";if(r.name==="g")return"reset"}if(e){if(r.name==="j")return"down";if(r.name==="k")return"up"}return r.name==="return"||r.name==="enter"?"submit":r.name==="backspace"?"delete":r.name==="delete"?"deleteForward":r.name==="abort"?"abort":r.name==="escape"?"exit":r.name==="tab"?"next":r.name==="pagedown"?"nextPage":r.name==="pageup"?"prevPage":r.name==="home"?"home":r.name==="end"?"end":r.name==="up"?"up":r.name==="down"?"down":r.name==="right"?"right":r.name==="left"?"left":!1}},m1=r=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof r=="string"?r.replace(t,""):r};const Pm="\x1B",tt=`${Pm}[`,_6="\x07",Lm={to(r,e){return e?`${tt}${e+1};${r+1}H`:`${tt}${r+1}G`},move(r,e){let t="";return r<0?t+=`${tt}${-r}D`:r>0&&(t+=`${tt}${r}C`),e<0?t+=`${tt}${-e}A`:e>0&&(t+=`${tt}${e}B`),t},up:(r=1)=>`${tt}${r}A`,down:(r=1)=>`${tt}${r}B`,forward:(r=1)=>`${tt}${r}C`,backward:(r=1)=>`${tt}${r}D`,nextLine:(r=1)=>`${tt}E`.repeat(r),prevLine:(r=1)=>`${tt}F`.repeat(r),left:`${tt}G`,hide:`${tt}?25l`,show:`${tt}?25h`,save:`${Pm}7`,restore:`${Pm}8`},S6={up:(r=1)=>`${tt}S`.repeat(r),down:(r=1)=>`${tt}T`.repeat(r)},A6={screen:`${tt}2J`,up:(r=1)=>`${tt}1J`.repeat(r),down:(r=1)=>`${tt}J`.repeat(r),line:`${tt}2K`,lineEnd:`${tt}K`,lineStart:`${tt}1K`,lines(r){let e="";for(let t=0;t<r;t++)e+=this.line+(t<r-1?Lm.up():"");return r&&(e+=Lm.left),e}};var Qr={cursor:Lm,scroll:S6,erase:A6,beep:_6};const C6=m1,{erase:bb,cursor:$6}=Qr,F6=r=>[...C6(r)].length;var x6=function(r,e){if(!e)return bb.line+$6.to(0);let t=0;const s=r.split(/\r?\n/);for(let n of s)t+=1+Math.floor(Math.max(F6(n)-1,0)/e);return bb.lines(t)};const $u={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},R6={arrowUp:$u.arrowUp,arrowDown:$u.arrowDown,arrowLeft:$u.arrowLeft,arrowRight:$u.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},O6=process.platform==="win32"?R6:$u;var R2=O6;const xo=Jr,Hn=R2,km=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"😃".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),T6=r=>km[r]||km.default,Fu=Object.freeze({aborted:xo.red(Hn.cross),done:xo.green(Hn.tick),exited:xo.yellow(Hn.cross),default:xo.cyan("?")}),B6=(r,e,t)=>e?Fu.aborted:t?Fu.exited:r?Fu.done:Fu.default,I6=r=>xo.gray(r?Hn.ellipsis:Hn.pointerSmall),P6=(r,e)=>xo.gray(r?e?Hn.pointerSmall:"+":Hn.line);var L6={styles:km,render:T6,symbols:Fu,symbol:B6,delimiter:I6,item:P6};const k6=m1;var N6=function(r,e){let t=String(k6(r)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,n)=>s+n):t.length},M6=(r,e={})=>{const t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(r||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,a)=>(a.length+t.length>=s||o[o.length-1].length+a.length+1<s?o[o.length-1]+=` ${a}`:o.push(`${t}${a}`),o),[t]).join(`
`)).join(`
`)},j6=(r,e,t)=>{t=t||e;let s=Math.min(e-t,r-Math.floor(t/2));s<0&&(s=0);let n=Math.min(s+t,e);return{startIndex:s,endIndex:n}},vi={action:w6,clear:x6,style:L6,strip:m1,figures:R2,lines:N6,wrap:M6,entriesToDisplay:j6};const vb=g6,{action:U6}=vi,H6=vt,{beep:z6,cursor:G6}=Qr,W6=Jr;let q6=class extends H6{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);const t=vb.createInterface({input:this.in,escapeCodeTimeout:50});vb.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);const s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,a)=>{let u=U6(a,s);u===!1?this._&&this._(o,a):typeof this[u]=="function"?this[u](a):this.bell()};this.close=()=>{this.out.write(G6.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(z6)}render(){this.onRender(W6),this.firstRender&&(this.firstRender=!1)}};var hn=q6;const Jc=Jr,V6=hn,{erase:Y6,cursor:wa}=Qr,{style:ip,clear:sp,lines:K6,figures:X6}=vi;class Z6 extends V6{constructor(e={}){super(e),this.transform=ip.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=sp("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Jc.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${s}${e}${n}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(wa.down(K6(this.outputError,this.out.columns)-1)+sp(this.outputError,this.out.columns)),this.out.write(sp(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ip.symbol(this.done,this.aborted),Jc.bold(this.msg),ip.delimiter(this.done),this.red?Jc.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,t,s)=>e+`
${s?" ":X6.pointerSmall} ${Jc.red().italic(t)}`,"")),this.out.write(Y6.line+wa.to(0)+this.outputText+wa.save+this.outputError+wa.restore+wa.move(this.cursorOffset,0)))}}var J6=Z6;const Ci=Jr,Q6=hn,{style:wb,clear:_b,figures:Qc,wrap:eB,entriesToDisplay:tB}=vi,{cursor:rB}=Qr;class iB extends Q6{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=_b("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(rB.hide):this.out.write(_b(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=tB(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[wb.symbol(this.done,this.aborted),Ci.bold(this.msg),wb.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Ci.yellow(this.warn):Ci.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let s=e;s<t;s++){let n,o,a="",u=this.choices[s];s===e&&e>0?o=Qc.arrowUp:s===t-1&&t<this.choices.length?o=Qc.arrowDown:o=" ",u.disabled?(n=this.cursor===s?Ci.gray().underline(u.title):Ci.strikethrough().gray(u.title),o=(this.cursor===s?Ci.bold().gray(Qc.pointer)+" ":" ")+o):(n=this.cursor===s?Ci.cyan().underline(u.title):u.title,o=(this.cursor===s?Ci.cyan(Qc.pointer)+" ":" ")+o,u.description&&this.cursor===s&&(a=` - ${u.description}`,(o.length+n.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
`+eB(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${Ci.gray(a)}
`}}this.out.write(this.outputText)}}var sB=iB;const el=Jr,nB=hn,{style:Sb,clear:oB}=vi,{cursor:Ab,erase:aB}=Qr;class uB extends nB{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Ab.hide):this.out.write(oB(this.outputText,this.out.columns)),super.render(),this.outputText=[Sb.symbol(this.done,this.aborted),el.bold(this.msg),Sb.delimiter(this.done),this.value?this.inactive:el.cyan().underline(this.inactive),el.gray("/"),this.value?el.cyan().underline(this.active):this.active].join(" "),this.out.write(aB.line+Ab.to(0)+this.outputText))}}var cB=uB;let lB=class Nm{constructor({token:e,date:t,parts:s,locales:n}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=n||{}}up(){}down(){}next(){const e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof Nm)}setTo(e){}prev(){let e=[].concat(this.parts).reverse();const t=e.indexOf(this);return e.find((s,n)=>n>t&&s instanceof Nm)}toString(){return String(this.date)}};var Fs=lB;const hB=Fs;let fB=class extends hB{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};var dB=fB;const pB=Fs,gB=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th");let mB=class extends pB{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+gB(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};var yB=mB;const EB=Fs;let DB=class extends EB{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};var bB=DB;const vB=Fs;let wB=class extends vB{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};var _B=wB;const SB=Fs;let AB=class extends SB{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};var CB=AB;const $B=Fs;let FB=class extends $B{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};var xB=FB;const RB=Fs;let OB=class extends RB{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};var TB=OB;const BB=Fs;let IB=class extends BB{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};var PB=IB,LB={DatePart:Fs,Meridiem:dB,Day:yB,Hours:bB,Milliseconds:_B,Minutes:CB,Month:xB,Seconds:TB,Year:PB};const np=Jr,kB=hn,{style:Cb,clear:$b,figures:NB}=vi,{erase:MB,cursor:Fb}=Qr,{DatePart:xb,Meridiem:jB,Day:UB,Hours:HB,Milliseconds:zB,Minutes:GB,Month:WB,Seconds:qB,Year:VB}=LB,YB=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Rb={1:({token:r})=>r.replace(/\\(.)/g,"$1"),2:r=>new UB(r),3:r=>new WB(r),4:r=>new VB(r),5:r=>new jB(r),6:r=>new HB(r),7:r=>new GB(r),8:r=>new qB(r),9:r=>new zB(r)},KB={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class XB extends kB{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(KB,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=$b("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=YB.exec(e);){let n=t.shift(),o=t.findIndex(a=>a!=null);this.parts.push(o in Rb?Rb[o]({token:t[o]||n,date:this.date,parts:this.parts,locales:this.locales}):t[o]||n)}let s=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof xb)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof xb)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Fb.hide):this.out.write($b(this.outputText,this.out.columns)),super.render(),this.outputText=[Cb.symbol(this.done,this.aborted),np.bold(this.msg),Cb.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?np.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((e,t,s)=>e+`
${s?" ":NB.pointerSmall} ${np.red().italic(t)}`,"")),this.out.write(MB.line+Fb.to(0)+this.outputText))}}var ZB=XB;const tl=Jr,JB=hn,{cursor:rl,erase:QB}=Qr,{style:op,figures:eI,clear:Ob,lines:tI}=vi,rI=/[0-9]/,ap=r=>r!==void 0,Tb=(r,e)=>{let t=Math.pow(10,e);return Math.round(r*t)/t};class iI extends JB{constructor(e={}){super(e),this.transform=op.render(e.style),this.msg=e.message,this.initial=ap(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ap(e.min)?e.min:-1/0,this.max=ap(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=tl.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Tb(e,this.round)}`),this._value=Tb(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||rI.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();const s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(rl.down(tI(this.outputError,this.out.columns)-1)+Ob(this.outputError,this.out.columns)),this.out.write(Ob(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[op.symbol(this.done,this.aborted),tl.bold(this.msg),op.delimiter(this.done),!this.done||!this.done&&!this.placeholder?tl[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,t,s)=>e+`
${s?" ":eI.pointerSmall} ${tl.red().italic(t)}`,"")),this.out.write(QB.line+rl.to(0)+this.outputText+rl.save+this.outputError+rl.restore))}}var sI=iI;const ri=Jr,{cursor:nI}=Qr,oI=hn,{clear:Bb,figures:Os,style:Ib,wrap:aI,entriesToDisplay:uI}=vi;let cI=class extends oI{constructor(e={}){super(e),this.msg=e.message,this.cursorStart=e.choices.findIndex(t=>!t.heading),this.cursor=e.cursor||this.cursorStart,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled,heading:t&&t.heading})),this.clear=Bb("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=this.cursorStart,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){const e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=this.cursorStart,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.value[this.cursor].heading&&this.next(),this.render()}up(){this.cursor===this.cursorStart?this.cursor=this.value.length-1:(this.cursor--,this.value[this.cursor].heading&&this.up()),this.render()}down(){this.cursor===this.value.length-1?this.cursor=this.cursorStart:(this.cursor++,this.value[this.cursor].heading&&this.down()),this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled&&!t.heading).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${Os.arrowUp}/${Os.arrowDown}: Highlight option
${Os.arrowLeft}/${Os.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer":""}renderOption(e,t,s,n){const o=(e===s?"❯ ":" ")+(t.selected?ri.green(Os.radioOn):Os.radioOff)+" ";let a,u;if(t.disabled)a=e===s?ri.gray(t.title):ri.strikethrough().gray(t.title);else{if(t.heading)return a=t.title,a+ri.gray(u||"");a=t.title,e===s&&t.description&&(u=` - ${t.description}`,(o.length+a.length+u.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(u=`
`+aI(t.description,{margin:o.length,width:this.out.columns})))}return o+a+ri.gray(u||"")}paginateOptions(e){if(e.length===0)return ri.red("No matches for this query.");let{startIndex:t,endIndex:s}=uI(this.cursor,e.length,this.optionsPerPage),n,o=[];for(let a=t;a<s;a++)a===t&&t>0?n=Os.arrowUp:a===s-1&&s<e.length?n=Os.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[a],a,n));return`
`+o.join(`
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return"";const e=[ri.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(ri.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(nI.hide),super.render();let e=[Ib.symbol(this.done,this.aborted),ri.bold(this.msg),Ib.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ri.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Bb(e,this.out.columns)}};var O2=cI;const _a=Jr,lI=hn,{erase:hI,cursor:Pb}=Qr,{style:up,clear:Lb,figures:cp,wrap:fI,entriesToDisplay:dI}=vi,kb=(r,e)=>r[e]&&(r[e].value||r[e].title||r[e]),pI=(r,e)=>r[e]&&(r[e].title||r[e].value||r[e]),gI=(r,e)=>{const t=r.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0};class mI extends lI{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:gI(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=up.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Lb("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=kb(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){const t=this.completing=this.suggest(this.input,this.choices),s=await t;if(this.completing!==t)return;this.suggestions=s.map((o,a,u)=>({title:pI(u,a),value:kb(u,a),description:o.description})),this.completing=!1;const n=Math.max(s.length-1,0);this.moveSelect(Math.min(n,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${s}${e}${n}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,s,n){let o,a=s?cp.arrowUp:n?cp.arrowDown:" ",u=t?_a.cyan().underline(e.title):e.title;return a=(t?_a.cyan(cp.pointer)+" ":" ")+a,e.description&&(o=` - ${e.description}`,(a.length+u.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
`+fI(e.description,{margin:3,width:this.out.columns}))),a+" "+u+_a.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Pb.hide):this.out.write(Lb(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=dI(this.select,this.choices.length,this.limit);if(this.outputText=[up.symbol(this.done,this.aborted,this.exited),_a.bold(this.msg),up.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const s=this.suggestions.slice(e,t).map((n,o)=>this.renderOption(n,this.select===o+e,o===0&&e>0,o+e===t-1&&t<this.choices.length)).join(`
`);this.outputText+=`
`+(s||_a.gray(this.fallback.title))}this.out.write(hI.line+Pb.to(0)+this.outputText)}}var yI=mI;const $i=Jr,{cursor:EI}=Qr,DI=O2,{clear:Nb,style:Mb,figures:to}=vi;class bI extends DI{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Nb("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){const e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${to.arrowUp}/${to.arrowDown}: Highlight option
${to.arrowLeft}/${to.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:$i.gray("Enter something to filter")}
`}renderOption(e,t,s,n){const o=(t.selected?$i.green(to.radioOn):to.radioOff)+" "+n+" ";let a;return t.disabled?a=e===s?$i.gray().underline(t.title):$i.strikethrough().gray(t.title):a=e===s?$i.cyan().underline(t.title):t.title,o+a}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");const e=[$i.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($i.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(EI.hide),super.render();let e=[Mb.symbol(this.done,this.aborted),$i.bold(this.msg),Mb.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$i.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Nb(e,this.out.columns)}}var vI=bI;const jb=Jr,wI=hn,{style:Ub,clear:_I}=vi,{erase:SI,cursor:Hb}=Qr;class AI extends wI{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){if(this.closed)return;this.firstRender?this.out.write(Hb.hide):this.out.write(_I(this.outputText,this.out.columns)),super.render();const e=this.aborted||this.done&&!this.value;this.outputText=[Ub.symbol(this.done,e),jb.bold(this.msg),Ub.delimiter(this.done),this.done?this.value&&!this.aborted?this.yesMsg:this.noMsg:jb.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(SI.line+Hb.to(0)+this.outputText)}}var CI=AI,$I={TextPrompt:J6,SelectPrompt:sB,TogglePrompt:cB,DatePrompt:ZB,NumberPrompt:sI,MultiselectPrompt:O2,AutocompletePrompt:yI,AutocompleteMultiselectPrompt:vI,ConfirmPrompt:CI};(function(r){const e=r,t=$I,s=a=>a;function n(a,u,c={}){return new Promise((l,h)=>{const d=new t[a](u),f=c.onAbort||s,p=c.onSubmit||s,m=c.onExit||s;d.on("state",u.onState||s),d.on("submit",g=>l(p(g))),d.on("exit",g=>l(m(g))),d.on("abort",g=>h(f(g)))})}e.text=a=>n("TextPrompt",a),e.password=a=>(a.style="password",e.text(a)),e.invisible=a=>(a.style="invisible",e.text(a)),e.number=a=>n("NumberPrompt",a),e.date=a=>n("DatePrompt",a),e.confirm=a=>n("ConfirmPrompt",a),e.list=a=>{const u=a.separator||",";return n("TextPrompt",a,{onSubmit:c=>c.split(u).map(l=>l.trim())})},e.toggle=a=>n("TogglePrompt",a),e.select=a=>n("SelectPrompt",a),e.multiselect=a=>{a.choices=[].concat(a.choices||[]);const u=c=>c.filter(l=>l.selected).map(l=>l.value);return n("MultiselectPrompt",a,{onAbort:u,onSubmit:u})},e.autocompleteMultiselect=a=>{a.choices=[].concat(a.choices||[]);const u=c=>c.filter(l=>l.selected).map(l=>l.value);return n("AutocompleteMultiselectPrompt",a,{onAbort:u,onSubmit:u})};const o=(a,u)=>Promise.resolve(u.filter(c=>c.title.slice(0,a.length).toLowerCase()===a.toLowerCase()));e.autocomplete=a=>(a.suggest=a.suggest||o,a.choices=[].concat(a.choices||[]),n("AutocompletePrompt",a))})(A2);const Mm=A2,FI=["suggest","format","onState","validate","onRender","type"],zb=()=>{};async function Js(r=[],{onSubmit:e=zb,onCancel:t=zb}={}){const s={},n=Js._override||{};r=[].concat(r);let o,a,u,c,l,h;const d=async(f,p,m=!1)=>{if(!(!m&&f.validate&&f.validate(p)!==!0))return f.format?await f.format(p,s):p};for(a of r)if({name:c,type:l}=a,typeof l=="function"&&(l=await l(o,{...s},a),a.type=l),!!l){for(let f in a){if(FI.includes(f))continue;let p=a[f];a[f]=typeof p=="function"?await p(o,{...s},h):p}if(h=a,typeof a.message!="string")throw new Error("prompt message is required");if({name:c,type:l}=a,Mm[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(n[a.name]!==void 0&&(o=await d(a,n[a.name]),o!==void 0)){s[c]=o;continue}try{o=Js._injected?xI(Js._injected,a.initial):await Mm[l](a),s[c]=o=await d(a,o,!0),u=await e(a,o,s)}catch{u=!await t(a,s)}if(u)return s}return s}function xI(r,e){const t=r.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function RI(r){Js._injected=(Js._injected||[]).concat(r)}function OI(r){Js._override=Object.assign({},r)}var TI=Object.assign(Js,{prompt:Js,prompts:Mm,inject:RI,override:OI}),BI=TI;const rf=Me(BI);var Xo={exports:{}},lp,Gb;function II(){if(Gb)return lp;Gb=1,lp=s,s.sync=n;var r=pt;function e(o,a){var u=a.pathExt!==void 0?a.pathExt:process.env.PATHEXT;if(!u||(u=u.split(";"),u.indexOf("")!==-1))return!0;for(var c=0;c<u.length;c++){var l=u[c].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}function t(o,a,u){return!o.isSymbolicLink()&&!o.isFile()?!1:e(a,u)}function s(o,a,u){r.stat(o,function(c,l){u(c,c?!1:t(l,o,a))})}function n(o,a){return t(r.statSync(o),o,a)}return lp}var hp,Wb;function PI(){if(Wb)return hp;Wb=1,hp=e,e.sync=t;var r=pt;function e(o,a,u){r.stat(o,function(c,l){u(c,c?!1:s(l,a))})}function t(o,a){return s(r.statSync(o),a)}function s(o,a){return o.isFile()&&n(o,a)}function n(o,a){var u=o.mode,c=o.uid,l=o.gid,h=a.uid!==void 0?a.uid:process.getuid&&process.getuid(),d=a.gid!==void 0?a.gid:process.getgid&&process.getgid(),f=parseInt("100",8),p=parseInt("010",8),m=parseInt("001",8),g=f|p,E=u&m||u&p&&l===d||u&f&&c===h||u&g&&h===0;return E}return hp}var sf;process.platform==="win32"||fe.TESTING_WINDOWS?sf=II():sf=PI();var LI=y1;y1.sync=kI;function y1(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,n){y1(r,e||{},function(o,a){o?n(o):s(a)})})}sf(r,e||{},function(s,n){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,n=!1),t(s,n)})}function kI(r,e){try{return sf.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}const fo=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",T2=ce,NI=fo?";":":",B2=LI,I2=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),P2=(r,e)=>{const t=e.colon||NI,s=r.match(/\//)||fo&&r.match(/\\/)?[""]:[...fo?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=fo?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=fo?n.split(t):[""];return fo&&r.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:s,pathExt:o,pathExtExe:n}},L2=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});const{pathEnv:s,pathExt:n,pathExtExe:o}=P2(r,e),a=[],u=l=>new Promise((h,d)=>{if(l===s.length)return e.all&&a.length?h(a):d(I2(r));const f=s[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=T2.join(p,r),g=!p&&/^\.[\\\/]/.test(r)?r.slice(0,2)+m:m;h(c(g,l,0))}),c=(l,h,d)=>new Promise((f,p)=>{if(d===n.length)return f(u(h+1));const m=n[d];B2(l+m,{pathExt:o},(g,E)=>{if(!g&&E)if(e.all)a.push(l+m);else return f(l+m);return f(c(l,h,d+1))})});return t?u(0).then(l=>t(null,l),t):u(0)},MI=(r,e)=>{e=e||{};const{pathEnv:t,pathExt:s,pathExtExe:n}=P2(r,e),o=[];for(let a=0;a<t.length;a++){const u=t[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=T2.join(c,r),h=!c&&/^\.[\\\/]/.test(r)?r.slice(0,2)+l:l;for(let d=0;d<s.length;d++){const f=h+s[d];try{if(B2.sync(f,{pathExt:n}))if(e.all)o.push(f);else return f}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw I2(r)};var jI=L2;L2.sync=MI;var E1={exports:{}};const k2=(r={})=>{const e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};E1.exports=k2;E1.exports.default=k2;var UI=E1.exports;const qb=ce,HI=jI,zI=UI;function Vb(r,e){const t=r.options.env||process.env,s=process.cwd(),n=r.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(r.options.cwd)}catch{}let a;try{a=HI.sync(r.command,{path:t[zI({env:t})],pathExt:e?qb.delimiter:void 0})}catch{}finally{o&&process.chdir(s)}return a&&(a=qb.resolve(n?r.options.cwd:"",a)),a}function GI(r){return Vb(r)||Vb(r,!0)}var WI=GI,D1={};const jm=/([()\][%!^"`<>&|;, *?])/g;function qI(r){return r=r.replace(jm,"^$1"),r}function VI(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(jm,"^$1"),e&&(r=r.replace(jm,"^$1")),r}D1.command=qI;D1.argument=VI;var YI=/^#!(.*)/;const KI=YI;var XI=(r="")=>{const e=r.match(KI);if(!e)return null;const[t,s]=e[0].replace(/#! ?/,"").split(" "),n=t.split("/").pop();return n==="env"?s:s?`${n} ${s}`:n};const fp=pt,ZI=XI;function JI(r){const t=Buffer.alloc(150);let s;try{s=fp.openSync(r,"r"),fp.readSync(s,t,0,150,0),fp.closeSync(s)}catch{}return ZI(t.toString())}var QI=JI;const eP=ce,Yb=WI,Kb=D1,tP=QI,rP=process.platform==="win32",iP=/\.(?:com|exe)$/i,sP=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function nP(r){r.file=Yb(r);const e=r.file&&tP(r.file);return e?(r.args.unshift(r.file),r.command=e,Yb(r)):r.file}function oP(r){if(!rP)return r;const e=nP(r),t=!iP.test(e);if(r.options.forceShell||t){const s=sP.test(e);r.command=eP.normalize(r.command),r.command=Kb.command(r.command),r.args=r.args.map(o=>Kb.argument(o,s));const n=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${n}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function aP(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);const s={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?s:oP(s)}var uP=aP;const b1=process.platform==="win32";function v1(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function cP(r,e){if(!b1)return;const t=r.emit;r.emit=function(s,n){if(s==="exit"){const o=N2(n,e);if(o)return t.call(r,"error",o)}return t.apply(r,arguments)}}function N2(r,e){return b1&&r===1&&!e.file?v1(e.original,"spawn"):null}function lP(r,e){return b1&&r===1&&!e.file?v1(e.original,"spawnSync"):null}var hP={hookChildProcess:cP,verifyENOENT:N2,verifyENOENTSync:lP,notFoundError:v1};const M2=v2,w1=uP,_1=hP;function j2(r,e,t){const s=w1(r,e,t),n=M2.spawn(s.command,s.args,s.options);return _1.hookChildProcess(n,s),n}function fP(r,e,t){const s=w1(r,e,t),n=M2.spawnSync(s.command,s.args,s.options);return n.error=n.error||_1.verifyENOENTSync(n.status,s),n}Xo.exports=j2;Xo.exports.spawn=j2;Xo.exports.sync=fP;Xo.exports._parse=w1;Xo.exports._enoent=_1;var dP=Xo.exports;const pP=dP,gP=(r,e,t={},s={})=>{t.rejectOnError===void 0&&(t.rejectOnError=!0);let n="",o="";const a=pP(r,e,s);return new Promise((u,c)=>{t.stdin!==void 0&&t.stdin!=null&&a.stdin.write(t.stdin),a.stdin.end(),a.stdout.on("data",l=>{n+=l,t.stdout&&t.stdout(l)}),a.stderr.on("data",l=>{o+=l,t.stderr&&t.stderr(l)}),t.rejectOnError&&a.addListener("error",c),a.on("close",l=>{l!==0&&t.rejectOnError?c(o):u({stdout:n,stderr:o})})})};var mP=gP;const Kr=Me(mP);function yP(r,e){for(var t=-1,s=e.length,n=r.length;++t<s;)r[n+t]=e[t];return r}var S1=yP,EP=typeof fe=="object"&&fe&&fe.Object===Object&&fe,U2=EP,DP=U2,bP=typeof self=="object"&&self&&self.Object===Object&&self,vP=DP||bP||Function("return this")(),_r=vP,wP=_r,_P=wP.Symbol,Zo=_P,Xb=Zo,H2=Object.prototype,SP=H2.hasOwnProperty,AP=H2.toString,Sa=Xb?Xb.toStringTag:void 0;function CP(r){var e=SP.call(r,Sa),t=r[Sa];try{r[Sa]=void 0;var s=!0}catch{}var n=AP.call(r);return s&&(e?r[Sa]=t:delete r[Sa]),n}var $P=CP,FP=Object.prototype,xP=FP.toString;function RP(r){return xP.call(r)}var OP=RP,Zb=Zo,TP=$P,BP=OP,IP="[object Null]",PP="[object Undefined]",Jb=Zb?Zb.toStringTag:void 0;function LP(r){return r==null?r===void 0?PP:IP:Jb&&Jb in Object(r)?TP(r):BP(r)}var hc=LP;function kP(r){return r!=null&&typeof r=="object"}var fn=kP,NP=hc,MP=fn,jP="[object Arguments]";function UP(r){return MP(r)&&NP(r)==jP}var HP=UP,Qb=HP,zP=fn,z2=Object.prototype,GP=z2.hasOwnProperty,WP=z2.propertyIsEnumerable,qP=Qb(function(){return arguments}())?Qb:function(r){return zP(r)&&GP.call(r,"callee")&&!WP.call(r,"callee")},A1=qP,VP=Array.isArray,Or=VP,ev=Zo,YP=A1,KP=Or,tv=ev?ev.isConcatSpreadable:void 0;function XP(r){return KP(r)||YP(r)||!!(tv&&r&&r[tv])}var ZP=XP,JP=S1,QP=ZP;function G2(r,e,t,s,n){var o=-1,a=r.length;for(t||(t=QP),n||(n=[]);++o<a;){var u=r[o];e>0&&t(u)?e>1?G2(u,e-1,t,s,n):JP(n,u):s||(n[n.length]=u)}return n}var W2=G2;function e5(r,e){for(var t=-1,s=r==null?0:r.length,n=Array(s);++t<s;)n[t]=e(r[t],t,r);return n}var fc=e5,t5=hc,r5=fn,i5="[object Symbol]";function s5(r){return typeof r=="symbol"||r5(r)&&t5(r)==i5}var dc=s5,n5=Or,o5=dc,a5=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u5=/^\w*$/;function c5(r,e){if(n5(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||o5(r)?!0:u5.test(r)||!a5.test(r)||e!=null&&r in Object(e)}var C1=c5;function l5(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var wi=l5,h5=hc,f5=wi,d5="[object AsyncFunction]",p5="[object Function]",g5="[object GeneratorFunction]",m5="[object Proxy]";function y5(r){if(!f5(r))return!1;var e=h5(r);return e==p5||e==g5||e==d5||e==m5}var q2=y5,E5=_r,D5=E5["__core-js_shared__"],b5=D5,dp=b5,rv=function(){var r=/[^.]+$/.exec(dp&&dp.keys&&dp.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function v5(r){retu