create-farm-plugin
Version:
use create-farm-plugin to create farm plugin
28 lines • 83.1 kB
JavaScript
(function(_){var filename = ((function(){return import.meta.url})());for(var r in _){_[r].__farm_resource_pot__=filename;global['28d997dabae4ce50ab48ae4ea4490780'].__farm_module_system__.register(r,_[r])}})({"05b53ecb":function r(r,o,i,a){"use strict";let t={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},w={arrowUp:t.arrowUp,arrowDown:t.arrowDown,arrowLeft:t.arrowLeft,arrowRight:t.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},e="win32"===process.platform?w:t;r.exports=e;},"0630df84":function e(e,n,a,t){"use strict";e.exports=(e,n)=>{if(!e.meta||"escape"===e.name){if(e.ctrl){if("a"===e.name)return"first";if("c"===e.name||"d"===e.name)return"abort";if("e"===e.name)return"last";if("g"===e.name)return"reset";}if(n){if("j"===e.name)return"down";if("k"===e.name)return"up";}return"return"===e.name||"enter"===e.name?"submit":"backspace"===e.name?"delete":"delete"===e.name?"deleteForward":"abort"===e.name?"abort":"escape"===e.name?"exit":"tab"===e.name?"next":"pagedown"===e.name?"nextPage":"pageup"===e.name?"prevPage":"home"===e.name?"home":"end"===e.name?"end":"up"===e.name?"up":"down"===e.name?"down":"right"===e.name?"right":"left"===e.name&&"left";}};},"0da45094":function t(t,e,s,r){"use strict";let l=s("41ff2e9c",!0);t.exports=class extends l{constructor(t={}){super(t);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(t){this.date.setFullYear(t.substr(-4));}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?t.substr(-2):t;}};},"13f9aeb4":function n(n,e,t,r){"use strict";n.exports=(n,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",r=e.width;return(n||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((n,e)=>(e.length+t.length>=r||n[n.length-1].length+e.length+1<r?n[n.length-1]+=` ${e}`:n.push(`${t}${e}`),n),[t]).join("\n")).join("\n");};},"16fe9227":function t(t,e,r,d){"use strict";t.exports=t=>{let e=RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))","g");return"string"==typeof t?t.replace(e,""):t;};},"19692bd1":function t(t,e,i,n){"use strict";let a=i("cc395cb8",!0),o=["suggest","format","onState","validate","onRender","type"],r=()=>{};async function c(t=[],{onSubmit:e=r,onCancel:i=r}={}){let n,f,s,d,u,l;let p={},w=c._override||{};t=[].concat(t);let v=async(t,e,i=!1)=>{if(i||!t.validate||!0===t.validate(e))return t.format?await t.format(e,p):e;};for(f of t)if({name:d,type:u}=f,"function"==typeof u&&(u=await u(n,{...p},f),f.type=u),u){for(let t in f){if(o.includes(t))continue;let e=f[t];f[t]="function"==typeof e?await e(n,{...p},l):e;}if(l=f,"string"!=typeof f.message)throw Error("prompt message is required");if({name:d,type:u}=f,void 0===a[u])throw Error(`prompt type (${u}) is not defined`);if(void 0!==w[f.name]&&void 0!==(n=await v(f,w[f.name]))){p[d]=n;continue;}try{n=c._injected?function(t,e){let i=t.shift();if(i instanceof Error)throw i;return void 0===i?e:i;}(c._injected,f.initial):await a[u](f),p[d]=n=await v(f,n,!0),s=await e(f,n,p);}catch(t){s=!await i(f,p);}if(s)break;}return p;}t.exports=Object.assign(c,{prompt:c,prompts:a,inject:function(t){c._injected=(c._injected||[]).concat(t);},override:function(t){c._override=Object.assign({},t);}});},"1f7fb77c":function t(t,s,r,e){let i=r("8e88cd4b",!0),h=r("f81f4c91",!0),{erase:o,cursor:l}=r("2064f396",!0),{style:u,clear:a,lines:n,figures:d}=r("daee6af0",!0);t.exports=class extends h{constructor(t={}){super(t),this.transform=u.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=a("",this.out.columns),this.render();}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=i.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire();}get value(){return this._value;}reset(){this.value="",this.cursor=Number(!!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("\n"),this.close();}async validate(){let t=await this.validator(this.value);"string"==typeof t&&(this.errorMsg=t,t=!1),this.error=!t;}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("\n"),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t);}_(t,s){let r=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor);this.value=`${r}${t}${e}`,this.red=!1,this.cursor=this.placeholder?0:r.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),s=this.value.slice(this.cursor);this.value=`${t}${s}`,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 t=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor+1);this.value=`${t}${s}`,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 0===this.cursor||this.placeholder&&1===this.cursor;}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(l.down(n(this.outputError,this.out.columns)-1)+a(this.outputError,this.out.columns)),this.out.write(a(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[u.symbol(this.done,this.aborted),i.bold(this.msg),u.delimiter(this.done),this.red?i.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((t,s,r)=>t+`
${r?" ":d.pointerSmall} ${i.red().italic(s)}`,"")),this.out.write(o.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore+l.move(this.cursorOffset,0)));}};},"1f910308":function t(t,e,s,a){"use strict";let d=s("41ff2e9c",!0),i=t=>1==(t%=10)?"st":2===t?"nd":3===t?"rd":"th";t.exports=class extends d{constructor(t={}){super(t);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(t){this.date.setDate(parseInt(t.substr(-2)));}toString(){let t=this.date.getDate(),e=this.date.getDay();return"DD"===this.token?String(t).padStart(2,"0"):"Do"===this.token?t+i(t):"d"===this.token?e+1:"ddd"===this.token?this.locales.weekdaysShort[e]:"dddd"===this.token?this.locales.weekdays[e]:t;}};},"23daad89":function t(t,e,n,r){"use strict";t.exports=(t,e,n)=>{n=n||e;let r=Math.min(e-n,t-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,e);return{startIndex:r,endIndex:i};};},"244e4ece":function t(t,i,e,s){let h=e("8e88cd4b",!0),a=e("f81f4c91",!0),{style:r,clear:n}=e("daee6af0",!0),{cursor:l,erase:u}=e("2064f396",!0);t.exports=class extends a{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.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("\n"),this.close();}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close();}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render();}activate(){if(!0===this.value)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();}_(t,i){if(" "===t)this.value=!this.value;else if("1"===t)this.value=!0;else{if("0"!==t)return this.bell();this.value=!1;}this.render();}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(n(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),h.bold(this.msg),r.delimiter(this.done),this.value?this.inactive:h.cyan().underline(this.inactive),h.gray("/"),this.value?h.cyan().underline(this.active):this.active].join(" "),this.out.write(u.line+l.to(0)+this.outputText));}};},"306a04dd":function t(t,s,e,i){"use strict";class n{constructor({token:t,date:s,parts:e,locales:i}){this.token=t,this.date=s||new Date,this.parts=e||[this],this.locales=i||{};}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((s,e)=>e>t&&s instanceof n);}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),s=t.indexOf(this);return t.find((t,e)=>e>s&&t instanceof n);}toString(){return String(this.date);}}t.exports=n;},"348a3aa1":function n(n,e,t,r){"use strict";n.exports=(n,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",r=e.width;return(n||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((n,e)=>(e.length+t.length>=r||n[n.length-1].length+e.length+1<r?n[n.length-1]+=` ${e}`:n.push(`${t}${e}`),n),[t]).join("\n")).join("\n");};},"398588b4":function e(e,t,s,i){"use strict";let n=global.nodeRequire("readline",!0),o=s("b7e868a8",!0).action,r=global.nodeRequire("events",!0),h=s("2064f396",!0),d=h.beep,l=h.cursor,c=s("8e88cd4b",!0);e.exports=class extends r{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>void 0)).bind(this);let t=n.createInterface({input:this.in,escapeCodeTimeout:50});n.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(e,t)=>{let i=o(t,s);!1===i?this._&&this._(e,t):"function"==typeof this[i]?this[i](t):this.bell();};this.close=()=>{this.out.write(l.show),this.in.removeListener("keypress",i),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",i);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(d);}render(){this.onRender(c),this.firstRender&&(this.firstRender=!1);}};},"39cb7c8c":function t(t,s,i,e){"use strict";let r=i("8e88cd4b",!0),h=i("f81f4c91",!0),{style:o,clear:n,figures:u,wrap:c,entriesToDisplay:l}=i("daee6af0",!0),{cursor:d}=i("2064f396",!0);t.exports=class extends h{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((t,s)=>("string"==typeof t&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(void 0===t.value?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=n("",this.out.columns),this.render();}moveCursor(t){this.cursor=t,this.value=this.choices[t].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("\n"),this.close();}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){0===this.cursor?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();}_(t,s){if(" "===t)return this.submit();}get selection(){return this.choices[this.cursor];}render(){if(this.closed)return;this.firstRender?this.out.write(d.hide):this.out.write(n(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:s}=l(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[o.symbol(this.done,this.aborted),r.bold(this.msg),o.delimiter(!1),this.done?this.selection.title:this.selection.disabled?r.yellow(this.warn):r.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let i=t;i<s;i++){let e,h,o="",n=this.choices[i];h=i===t&&t>0?u.arrowUp:i===s-1&&s<this.choices.length?u.arrowDown:" ",n.disabled?(e=this.cursor===i?r.gray().underline(n.title):r.strikethrough().gray(n.title),h=(this.cursor===i?r.bold().gray(u.pointer)+" ":" ")+h):(e=this.cursor===i?r.cyan().underline(n.title):n.title,h=(this.cursor===i?r.cyan(u.pointer)+" ":" ")+h,n.description&&this.cursor===i&&(o=` - ${n.description}`,(h.length+e.length+o.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(o="\n"+c(n.description,{margin:3,width:this.out.columns})))),this.outputText+=`${h} ${e}${r.gray(o)}
`;}}this.out.write(this.outputText);}};},"403bfba1":function e(e,c,a,s){"use strict";e.exports={DatePart:a("41ff2e9c",!0),Meridiem:a("9c1ff042",!0),Day:a("1f910308",!0),Hours:a("6927cca9",!0),Milliseconds:a("a2c0c19e",!0),Minutes:a("8e207c9e",!0),Month:a("dd7f0039",!0),Seconds:a("c82cad2e",!0),Year:a("0da45094",!0)};},"40b7a33a":function r(r,o,i,a){"use strict";let t={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},w={arrowUp:t.arrowUp,arrowDown:t.arrowDown,arrowLeft:t.arrowLeft,arrowRight:t.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},e="win32"===process.platform?w:t;r.exports=e;},"41ff2e9c":function t(t,s,e,i){"use strict";class n{constructor({token:t,date:s,parts:e,locales:i}){this.token=t,this.date=s||new Date,this.parts=e||[this],this.locales=i||{};}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((s,e)=>e>t&&s instanceof n);}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),s=t.indexOf(this);return t.find((t,e)=>e>s&&t instanceof n);}toString(){return String(this.date);}}t.exports=n;},"451b9d12":function t(t,e,o,c){"use strict";t.exports={TextPrompt:o("1f7fb77c",!0),SelectPrompt:o("39cb7c8c",!0),TogglePrompt:o("244e4ece",!0),DatePrompt:o("976bedfe",!0),NumberPrompt:o("7a49f222",!0),MultiselectPrompt:o("7b2759e1",!0),AutocompletePrompt:o("67f23245",!0),AutocompleteMultiselectPrompt:o("7938530c",!0),ConfirmPrompt:o("becd19b3",!0)};},"461b4685":function t(t,e,s,r){"use strict";let a=s("306a04dd",!0);t.exports=class extends a{constructor(t={}){super(t);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(t){this.date.setFullYear(t.substr(-4));}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?t.substr(-2):t;}};},"4b3c18f1":function e(e,a,d,c){"use strict";e.exports={DatePart:d("306a04dd",!0),Meridiem:d("6d6060ce",!0),Day:d("a660f76b",!0),Hours:d("eaae666b",!0),Milliseconds:d("d57cf585",!0),Minutes:d("c50d6a87",!0),Month:d("e3d5c750",!0),Seconds:d("4cdf44af",!0),Year:d("461b4685",!0)};},"4cdf44af":function t(t,e,s,d){"use strict";let n=s("306a04dd",!0);t.exports=class extends n{constructor(t={}){super(t);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)));}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t;}};},"4d8e2daa":function t(t,i,s,e){"use strict";let h=s("8e88cd4b",!0),o=s("398588b4",!0),r=s("b7e868a8",!0),n=r.style,u=r.clear,l=s("2064f396",!0),a=l.erase,d=l.cursor;t.exports=class extends o{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.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("\n"),this.close();}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close();}_(t,i){return"y"===t.toLowerCase()?(this.value=!0,this.submit()):"n"===t.toLowerCase()?(this.value=!1,this.submit()):this.bell();}render(){this.closed||(this.firstRender?this.out.write(d.hide):this.out.write(u(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),h.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:h.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(a.line+d.to(0)+this.outputText));}};},"4db62a65":function t(t,e,n,r){"use strict";t.exports=(t,e,n)=>{n=n||e;let r=Math.min(e-n,t-Math.floor(n/2));r<0&&(r=0);let i=Math.min(r+n,e);return{startIndex:r,endIndex:i};};},"5f72e561":function t(t,s,i,e){"use strict";let r=i("8e88cd4b",!0),h=i("398588b4",!0),o=i("b7e868a8",!0),n=o.style,u=o.clear,c=o.figures,l=o.wrap,d=o.entriesToDisplay,a=i("2064f396",!0).cursor;t.exports=class extends h{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((t,s)=>("string"==typeof t&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(void 0===t.value?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=u("",this.out.columns),this.render();}moveCursor(t){this.cursor=t,this.value=this.choices[t].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("\n"),this.close();}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){0===this.cursor?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();}_(t,s){if(" "===t)return this.submit();}get selection(){return this.choices[this.cursor];}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(u(this.outputText,this.out.columns)),super.render();let t=d(this.cursor,this.choices.length,this.optionsPerPage),s=t.startIndex,i=t.endIndex;if(this.outputText=[n.symbol(this.done,this.aborted),r.bold(this.msg),n.delimiter(!1),this.done?this.selection.title:this.selection.disabled?r.yellow(this.warn):r.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let t=s;t<i;t++){let e,h,o="",n=this.choices[t];h=t===s&&s>0?c.arrowUp:t===i-1&&i<this.choices.length?c.arrowDown:" ",n.disabled?(e=this.cursor===t?r.gray().underline(n.title):r.strikethrough().gray(n.title),h=(this.cursor===t?r.bold().gray(c.pointer)+" ":" ")+h):(e=this.cursor===t?r.cyan().underline(n.title):n.title,h=(this.cursor===t?r.cyan(c.pointer)+" ":" ")+h,n.description&&this.cursor===t&&(o=` - ${n.description}`,(h.length+e.length+o.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(o="\n"+l(n.description,{margin:3,width:this.out.columns})))),this.outputText+=`${h} ${e}${r.gray(o)}
`;}}this.out.write(this.outputText);}};},"60605886":function t(t,i,e,r){"use strict";function s(t,i,e,r,s,h,n){try{var o=t[h](n),l=o.value;}catch(t){e(t);return;}o.done?i(l):Promise.resolve(l).then(r,s);}function h(t){return function(){var i=this,e=arguments;return new Promise(function(r,h){var n=t.apply(i,e);function o(t){s(n,r,h,o,l,"next",t);}function l(t){s(n,r,h,o,l,"throw",t);}o(void 0);});};}let n=e("8e88cd4b",!0),o=e("398588b4",!0),l=e("2064f396",!0),a=l.cursor,u=l.erase,d=e("b7e868a8",!0),c=d.style,v=d.figures,f=d.clear,m=d.lines,p=/[0-9]/,y=t=>void 0!==t,b=(t,i)=>{let e=Math.pow(10,i);return Math.round(t*e)/e;};t.exports=class extends o{constructor(t={}){super(t),this.transform=c.render(t.style),this.msg=t.message,this.initial=y(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=y(t.min)?t.min:-1/0,this.max=y(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(t){t||0===t?(this.placeholder=!1,this.rendered=this.transform.render(`${b(t,this.round)}`),this._value=b(t,this.round)):(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire();}get value(){return this._value;}parse(t){return this.float?parseFloat(t):parseInt(t);}valid(t){return"-"===t||"."===t&&this.float||p.test(t);}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let t=this.value;this.value=""!==t?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close();}validate(){var t=this;return h(function*(){let i=yield t.validator(t.value);"string"==typeof i&&(t.errorMsg=i,i=!1),t.error=!i;})();}submit(){var t=this;return h(function*(){if(yield t.validate(),t.error){t.color="red",t.fire(),t.render();return;}let i=t.value;t.value=""!==i?i:t.initial,t.done=!0,t.aborted=!1,t.error=!1,t.fire(),t.render(),t.out.write(`
`),t.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 t=this.value.toString();if(0===t.length)return this.bell();this.value=this.parse(t=t.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();}_(t,i){if(!this.valid(t))return this.bell();let e=Date.now();if(e-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=e,this.color="cyan","."===t)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(a.down(m(this.outputError,this.out.columns)-1)+f(this.outputError,this.out.columns)),this.out.write(f(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(this.done),this.done&&(this.done||this.placeholder)?this.rendered:n[this.color]().underline(this.rendered)].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((t,i,e)=>t+`
${e?" ":v.pointerSmall} ${n.red().italic(i)}`,"")),this.out.write(u.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore));}};},"6322de4c":function e(e,r,t,l){"use strict";let a=t("8e88cd4b",!0),d=t("40b7a33a",!0),i=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"😃".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),n=Object.freeze({aborted:a.red(d.cross),done:a.green(d.tick),exited:a.yellow(d.cross),default:a.cyan("?")});e.exports={styles:i,render:e=>i[e]||i.default,symbols:n,symbol:(e,r,t)=>r?n.aborted:t?n.exited:e?n.done:n.default,delimiter:e=>a.gray(e?d.ellipsis:d.pointerSmall),item:(e,r)=>a.gray(e?r?d.pointerSmall:"+":d.line)};},"644bca50":function e(e,t,s,i){"use strict";let r=s("8e88cd4b",!0),h=s("2064f396",!0).cursor,n=s("398588b4",!0),l=s("b7e868a8",!0),o=l.clear,d=l.figures,u=l.style,c=l.wrap,a=l.entriesToDisplay;e.exports=class extends n{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,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((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(void 0===e.value?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=o("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,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("\n"),this.close();}submit(){let e=this.value.filter(e=>e.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("\n"),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){0===this.cursor?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,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(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render();}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(t=>t.selected=e),this.render();}_(e,t){if(" "===e)this.handleSpaceToggle();else{if("a"!==e)return this.bell();this.toggleAll();}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`
Instructions:
${d.arrowUp}/${d.arrowDown}: Highlight option
${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection
`+(void 0===this.maxChoices?` a: Toggle all
`:"")+" enter/return: Complete answer":"";}renderOption(e,t,s,i){let h,n;let l=(t.selected?r.green(d.radioOn):d.radioOff)+" "+i+" ";return t.disabled?h=e===s?r.gray().underline(t.title):r.strikethrough().gray(t.title):(h=e===s?r.cyan().underline(t.title):t.title,e===s&&t.description&&(n=` - ${t.description}`,(l.length+h.length+n.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(n="\n"+c(t.description,{margin:l.length,width:this.out.columns})))),l+h+r.gray(n||"");}paginateOptions(e){if(0===e.length)return r.red("No matches for this query.");let t=a(this.cursor,e.length,this.optionsPerPage),s=t.startIndex,i=t.endIndex,h,n=[];for(let t=s;t<i;t++)h=t===s&&s>0?d.arrowUp:t===i-1&&i<e.length?d.arrowDown:" ",n.push(this.renderOption(this.cursor,e[t],t,h));return"\n"+n.join("\n");}renderOptions(e){return this.done?"":this.paginateOptions(e);}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let e=[r.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(r.yellow(this.warn)),e.join(" ");}render(){if(this.closed)return;this.firstRender&&this.out.write(h.hide),super.render();let e=[u.symbol(this.done,this.aborted),r.bold(this.msg),u.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=r.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=o(e,this.out.columns);}};},"67f23245":function t(t,e,i,s){"use strict";let h=i("8e88cd4b",!0),r=i("f81f4c91",!0),{erase:n,cursor:l}=i("2064f396",!0),{style:o,clear:c,figures:u,wrap:d,entriesToDisplay:a}=i("daee6af0",!0),g=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),m=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),p=(t,e)=>{let i=t.findIndex(t=>t.value===e||t.title===e);return i>-1?i:void 0;};t.exports=class extends r{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial="number"==typeof t.initial?t.initial:p(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=o.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=c("",this.out.columns),this.complete(this.render),this.render();}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t;}get fallback(){let t;return"number"==typeof this._fb?t=this.choices[this._fb]:"string"==typeof this._fb&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches};}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=g(this.suggestions,t):this.value=this.fallback.value,this.fire();}async complete(t){let e=this.completing=this.suggest(this.input,this.choices),i=await e;if(this.completing!==e)return;this.suggestions=i.map((t,e,i)=>({title:m(i,e),value:g(i,e),description:t.description})),this.completing=!1;let s=Math.max(i.length-1,0);this.moveSelect(Math.min(s,this.select)),t&&t();}reset(){this.input="",this.complete(()=>{this.moveSelect(void 0!==this.initial?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("\n"),this.close());}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close();}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close();}_(t,e){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${t}${s}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(0===this.cursor)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){0===this.select?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(t,e,i,s){let r;let n=i?u.arrowUp:s?u.arrowDown:" ",l=e?h.cyan().underline(t.title):t.title;return n=(e?h.cyan(u.pointer)+" ":" ")+n,t.description&&(r=` - ${t.description}`,(n.length+l.length+r.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(r="\n"+d(t.description,{margin:3,width:this.out.columns}))),n+" "+l+h.gray(r||"");}render(){if(this.closed)return;this.firstRender?this.out.write(l.hide):this.out.write(c(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=a(this.select,this.choices.length,this.limit);if(this.outputText=[o.symbol(this.done,this.aborted,this.exited),h.bold(this.msg),o.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(t,e).map((i,s)=>this.renderOption(i,this.select===s+t,0===s&&t>0,s+t===e-1&&e<this.choices.length)).join("\n");this.outputText+=`
`+(i||h.gray(this.fallback.title));}this.out.write(n.line+l.to(0)+this.outputText);}};},"6927cca9":function t(t,s,e,r){"use strict";let o=e("41ff2e9c",!0);t.exports=class extends o{constructor(t={}){super(t);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(t){this.date.setHours(parseInt(t.substr(-2)));}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t;}};},"6d6060ce":function t(t,s,e,r){"use strict";let o=e("306a04dd",!0);t.exports=class extends o{constructor(t={}){super(t);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t;}};},"710c95d4":function t(t,r,n,e){"use strict";function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var n=0,e=Array(r);n<r;n++)e[n]=t[n];return e;}let i=n("16fe9227",!0),a=n("2064f396",!0),u=a.erase,f=a.cursor,l=t=>[...i(t)].length;t.exports=function(t,r){if(!r)return u.line+f.to(0);let n=0;var e,i=function(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,r){if(t){if("string"==typeof t)return o(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,void 0);}}(t))){n&&(t=n);var e=0,i=function(){};return{s:i,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]};},e:function(t){throw t;},f:i};}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var a,u=!0,f=!1;return{s:function(){n=n.call(t);},n:function(){var t=n.next();return u=t.done,t;},e:function(t){f=!0,a=t;},f:function(){try{u||null==n.return||n.return();}finally{if(f)throw a;}}};}(t.split(/\r?\n/));try{for(i.s();!(e=i.n()).done;){let t=e.value;n+=1+Math.floor(Math.max(l(t)-1,0)/r);}}catch(t){i.e(t);}finally{i.f();}return u.lines(n);};},"7116f829":function t(t,r,e,s){"use strict";function i(t,r,e,s,i,h,o){try{var u=t[h](o),l=u.value;}catch(t){e(t);return;}u.done?r(l):Promise.resolve(l).then(s,i);}function h(t){return function(){var r=this,e=arguments;return new Promise(function(s,h){var o=t.apply(r,e);function u(t){i(o,s,h,u,l,"next",t);}function l(t){i(o,s,h,u,l,"throw",t);}u(void 0);});};}let o=e("8e88cd4b",!0),u=e("398588b4",!0),l=e("2064f396",!0),n=l.erase,a=l.cursor,d=e("b7e868a8",!0),c=d.style,f=d.clear,v=d.lines,p=d.figures;t.exports=class extends u{constructor(t={}){super(t),this.transform=c.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=f("",this.out.columns),this.render();}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=o.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire();}get value(){return this._value;}reset(){this.value="",this.cursor=Number(!!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("\n"),this.close();}validate(){var t=this;return h(function*(){let r=yield t.validator(t.value);"string"==typeof r&&(t.errorMsg=r,r=!1),t.error=!r;})();}submit(){var t=this;return h(function*(){if(t.value=t.value||t.initial,t.cursorOffset=0,t.cursor=t.rendered.length,yield t.validate(),t.error){t.red=!0,t.fire(),t.render();return;}t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write("\n"),t.close();})();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t);}_(t,r){let e=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${e}${t}${s}`,this.red=!1,this.cursor=this.placeholder?0:e.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${t}${r}`,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 t=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${t}${r}`,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 0===this.cursor||this.placeholder&&1===this.cursor;}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(a.down(v(this.outputError,this.out.columns)-1)+f(this.outputError,this.out.columns)),this.out.write(f(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((t,r,e)=>t+`
${e?" ":p.pointerSmall} ${o.red().italic(r)}`,"")),this.out.write(n.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore+a.move(this.cursorOffset,0)));}};},"76df13ee":function t(t,e,i,s){"use strict";function h(t,e,i,s,h,r,n){try{var l=t[r](n),o=l.value;}catch(t){i(t);return;}l.done?e(o):Promise.resolve(o).then(s,h);}let r=i("8e88cd4b",!0),n=i("398588b4",!0),l=i("2064f396",!0),o=l.erase,c=l.cursor,u=i("b7e868a8",!0),a=u.style,d=u.clear,g=u.figures,p=u.wrap,m=u.entriesToDisplay,f=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),b=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),v=(t,e)=>{let i=t.findIndex(t=>t.value===e||t.title===e);return i>-1?i:void 0;};t.exports=class extends n{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial="number"==typeof t.initial?t.initial:v(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=a.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=d("",this.out.columns),this.complete(this.render),this.render();}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t;}get fallback(){let t;return"number"==typeof this._fb?t=this.choices[this._fb]:"string"==typeof this._fb&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches};}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=f(this.suggestions,t):this.value=this.fallback.value,this.fire();}complete(t){var e,i=this;return(e=function*(){let e=i.completing=i.suggest(i.input,i.choices),s=yield e;if(i.completing!==e)return;i.suggestions=s.map((t,e,i)=>({title:b(i,e),value:f(i,e),description:t.description})),i.completing=!1;let h=Math.max(s.length-1,0);i.moveSelect(Math.min(h,i.select)),t&&t();},function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function l(t){h(n,s,r,l,o,"next",t);}function o(t){h(n,s,r,l,o,"throw",t);}l(void 0);});})();}reset(){this.input="",this.complete(()=>{this.moveSelect(void 0!==this.initial?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("\n"),this.close());}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close();}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close();}_(t,e){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${t}${s}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(0===this.cursor)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){0===this.select?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(t,e,i,s){let h;let n=i?g.arrowUp:s?g.arrowDown:" ",l=e?r.cyan().underline(t.title):t.title;return n=(e?r.cyan(g.pointer)+" ":" ")+n,t.description&&(h=` - ${t.description}`,(n.length+l.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h="\n"+p(t.description,{margin:3,width:this.out.columns}))),n+" "+l+r.gray(h||"");}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(d(this.outputText,this.out.columns)),super.render();let t=m(this.select,this.choices.length,this.limit),e=t.startIndex,i=t.endIndex;if(this.outputText=[a.symbol(this.done,this.aborted,this.exited),r.bold(this.msg),a.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let t=this.suggestions.slice(e,i).map((t,s)=>this.renderOption(t,this.select===s+e,0===s&&e>0,s+e===i-1&&i<this.choices.length)).join("\n");this.outputText+=`
`+(t||r.gray(this.fallback.title));}this.out.write(o.line+c.to(0)+this.outputText);}};},"7938530c":function t(t,e,i,s){"use strict";let r=i("8e88cd4b",!0),{cursor:n}=i("2064f396",!0),h=i("7b2759e1",!0),{clear:l,style:o,figures:u}=i("daee6af0",!0);t.exports=class extends h{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=l("",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(){0===this.cursor?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(t=>t.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(){let t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(t=>!this.inputValue||!!("string"==typeof t.title&&t.title.toLowerCase().includes(this.inputValue.toLowerCase())||"string"==typeof t.value&&t.value.toLowerCase().includes(this.inputValue.toLowerCase())));let e=this.filteredOptions.findIndex(e=>e===t);this.cursor=e<0?0:e,this.render();}handleSpaceToggle(){let t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render();}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions();}_(t,e){" "===t?this.handleSpaceToggle():this.handleInputChange(t);}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`
Instructions:
${u.arrowUp}/${u.arrowDown}: Highlight option
${u.arrowLeft}/${u.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:"";}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:r.gray("Enter something to filter")}
`;}renderOption(t,e,i){let s;return s=e.disabled?t===i?r.gray().underline(e.title):r.strikethrough().gray(e.title):t===i?r.cyan().underline(e.title):e.title,(e.selected?r.green(u.radioOn):u.radioOff)+" "+s;}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let t=[r.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(r.yellow(this.warn)),t.join(" ");}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let t=[o.symbol(this.done,this.aborted),r.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=r.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=l(t,this.out.columns);}};},"796d677c":function t(t,e,r,d){"use strict";t.exports=t=>{let e=RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))","g");return"string"==typeof t?t.replace(e,""):t;};},"7a49f222":function t(t,i,s,e){let r=s("8e88cd4b",!0),h=s("f81f4c91",!0),{cursor:a,erase:l}=s("2064f396",!0),{style:o,figures:n,clear:u,lines:d}=s("daee6af0",!0),v=/[0-9]/,c=t=>void 0!==t,m=(t,i)=>{let s=Math.pow(10,i);return Math.round(t*s)/s;};t.exports=class extends h{constructor(t={}){super(t),this.transform=o.render(t.style),this.msg=t.message,this.initial=c(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=c(t.min)?t.min:-1/0,this.max=c(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(t){t||0===t?(this.placeholder=!1,this.rendered=this.transform.render(`${m(t,this.round)}`),this._value=m(t,this.round)):(this.placeholder=!0,this.rendered=r.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire();}get value(){return this._value;}parse(t){return this.float?parseFloat(t):parseInt(t);}valid(t){return"-"===t||"."===t&&this.float||v.test(t);}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let t=this.value;this.value=""!==t?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close();}async validate(){let t=await this.validator(this.value);"string"==typeof t&&(this.errorMsg=t,t=!1),this.error=!t;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return;}let t=this.value;this.value=""!==t?t: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