create-enchilada 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,12 +15,12 @@
15
15
  ## Usage
16
16
  ### With npm
17
17
  ```
18
- npm create enchilada
18
+ npm create enchilada@latest
19
19
  ```
20
20
 
21
21
  ### With pnpm
22
22
  ```
23
- pnpm create enchilada
23
+ pnpm create enchilada@latest
24
24
  ```
25
25
 
26
26
  ### With yarn
@@ -28,7 +28,7 @@ pnpm create enchilada
28
28
  yarn create enchilada
29
29
  ```
30
30
 
31
- <img src="https://raw.githubusercontent.com/Sharmaz/enchilada/refs/heads/main/media/enchiladajs.gif" width="100%" alt="mk-app options"/>
31
+ <img src="https://raw.githubusercontent.com/Sharmaz/enchilada/refs/heads/main/media/enchiladajs@latest.gif" width="100%" alt="enchiladajs logo"/>
32
32
  </p>
33
33
 
34
34
  ## CLI Options
@@ -64,4 +64,5 @@ npm create enchilada -- --template vanilla-js my-app
64
64
  | **react-dev** | React + Vite + Tailwind CSS + ESlint + React Testing Library |
65
65
  | **react-dev-typescript** | React + Typescript + Vite + Tailwind CSS + ESlint + React Testing Library |
66
66
  | **react-dev-webpack** | React + Webpack + Tailwind CSS + ESlint + React Testing Library |
67
+ | **react-rspack** | React + Rspack |
67
68
  | **node-express** | NodeJS + Express + Sequelize + ESlint + Jest |
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
- import Pt from"readline";import Ct from"events";import{fileURLToPath as Dt}from"node:url";import J from"node:path";import oe,{argv as ai}from"node:process";import ci from"node:os";import Et from"node:tty";import{readFileSync as di,writeFileSync as fi,existsSync as _t,mkdirSync as pi}from"fs";import{readdirSync as mi,lstatSync as gi,mkdirSync as vi,copyFileSync as bi}from"node:fs";function qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var le={},he,At;function q(){if(At)return he;At=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:r,TERM:o}=process.env,t={enabled:!r&&o!=="dumb"&&e!=="0",reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function s(b,l){let a=0,n,m="",f="";for(;a<b.length;a++)n=b[a],m+=n.open,f+=n.close,l.includes(n.close)&&(l=l.replace(n.rgx,n.close+n.open));return m+l+f}function c(b,l){let a={has:b,keys:l};return a.reset=t.reset.bind(a),a.bold=t.bold.bind(a),a.dim=t.dim.bind(a),a.italic=t.italic.bind(a),a.underline=t.underline.bind(a),a.inverse=t.inverse.bind(a),a.hidden=t.hidden.bind(a),a.strikethrough=t.strikethrough.bind(a),a.black=t.black.bind(a),a.red=t.red.bind(a),a.green=t.green.bind(a),a.yellow=t.yellow.bind(a),a.blue=t.blue.bind(a),a.magenta=t.magenta.bind(a),a.cyan=t.cyan.bind(a),a.white=t.white.bind(a),a.gray=t.gray.bind(a),a.grey=t.grey.bind(a),a.bgBlack=t.bgBlack.bind(a),a.bgRed=t.bgRed.bind(a),a.bgGreen=t.bgGreen.bind(a),a.bgYellow=t.bgYellow.bind(a),a.bgBlue=t.bgBlue.bind(a),a.bgMagenta=t.bgMagenta.bind(a),a.bgCyan=t.bgCyan.bind(a),a.bgWhite=t.bgWhite.bind(a),a}function i(b,l){let a={open:`\x1B[${b}m`,close:`\x1B[${l}m`,rgx:new RegExp(`\\x1b\\[${l}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(b)||(this.has.push(b),this.keys.push(a)),n===void 0?this:t.enabled?s(this.keys,n+""):n+""):n===void 0?c([b],[a]):t.enabled?s([a],n+""):n+""}}return he=t,he}var ue,It;function yi(){return It||(It=1,ue=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),ue}var ae,jt;function ce(){return jt||(jt=1,ae=e=>{const r=["[\\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("|"),o=new RegExp(r,"g");return typeof e=="string"?e.replace(o,""):e}),ae}var de,Ft;function A(){if(Ft)return de;Ft=1;const e="\x1B",r=`${e}[`,o="\x07",t={to(i,b){return b?`${r}${b+1};${i+1}H`:`${r}${i+1}G`},move(i,b){let l="";return i<0?l+=`${r}${-i}D`:i>0&&(l+=`${r}${i}C`),b<0?l+=`${r}${-b}A`:b>0&&(l+=`${r}${b}B`),l},up:(i=1)=>`${r}${i}A`,down:(i=1)=>`${r}${i}B`,forward:(i=1)=>`${r}${i}C`,backward:(i=1)=>`${r}${i}D`,nextLine:(i=1)=>`${r}E`.repeat(i),prevLine:(i=1)=>`${r}F`.repeat(i),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${e}7`,restore:`${e}8`},s={up:(i=1)=>`${r}S`.repeat(i),down:(i=1)=>`${r}T`.repeat(i)},c={screen:`${r}2J`,up:(i=1)=>`${r}1J`.repeat(i),down:(i=1)=>`${r}J`.repeat(i),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(i){let b="";for(let l=0;l<i;l++)b+=this.line+(l<i-1?t.up():"");return i&&(b+=t.left),b}};return de={cursor:t,scroll:s,erase:c,beep:o},de}var fe,Nt;function wi(){if(Nt)return fe;Nt=1;function e(l,a){var n=typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(!n){if(Array.isArray(l)||(n=r(l))||a){n&&(l=n);var m=0,f=function(){};return{s:f,n:function(){return m>=l.length?{done:!0}:{done:!1,value:l[m++]}},e:function(d){throw d},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=!0,u=!1,v;return{s:function(){n=n.call(l)},n:function(){var d=n.next();return h=d.done,d},e:function(d){u=!0,v=d},f:function(){try{!h&&n.return!=null&&n.return()}finally{if(u)throw v}}}}function r(l,a){if(l){if(typeof l=="string")return o(l,a);var n=Object.prototype.toString.call(l).slice(8,-1);if(n==="Object"&&l.constructor&&(n=l.constructor.name),n==="Map"||n==="Set")return Array.from(l);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(l,a)}}function o(l,a){(a==null||a>l.length)&&(a=l.length);for(var n=0,m=new Array(a);n<a;n++)m[n]=l[n];return m}const t=ce(),s=A(),c=s.erase,i=s.cursor,b=l=>[...t(l)].length;return fe=function(l,a){if(!a)return c.line+i.to(0);let n=0;const m=l.split(/\r?\n/);var f=e(m),h;try{for(f.s();!(h=f.n()).done;){let u=h.value;n+=1+Math.floor(Math.max(b(u)-1,0)/a)}}catch(u){f.e(u)}finally{f.f()}return c.lines(n)},fe}var pe,Lt;function Yt(){if(Lt)return pe;Lt=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return pe=process.platform==="win32"?r:e,pe}var me,kt;function xi(){if(kt)return me;kt=1;const e=q(),r=Yt(),o=Object.freeze({password:{scale:1,render:l=>"*".repeat(l.length)},emoji:{scale:2,render:l=>"\u{1F603}".repeat(l.length)},invisible:{scale:0,render:l=>""},default:{scale:1,render:l=>`${l}`}}),t=l=>o[l]||o.default,s=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return me={styles:o,render:t,symbols:s,symbol:(l,a,n)=>a?s.aborted:n?s.exited:l?s.done:s.default,delimiter:l=>e.gray(l?r.ellipsis:r.pointerSmall),item:(l,a)=>e.gray(l?a?r.pointerSmall:"+":r.line)},me}var ge,Bt;function Si(){if(Bt)return ge;Bt=1;const e=ce();return ge=function(r,o){let t=String(e(r)||"").split(/\r?\n/);return o?t.map(s=>Math.ceil(s.length/o)).reduce((s,c)=>s+c):t.length},ge}var ve,Vt;function $i(){return Vt||(Vt=1,ve=(e,r={})=>{const o=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((c,i)=>(i.length+o.length>=t||c[c.length-1].length+i.length+1<t?c[c.length-1]+=` ${i}`:c.push(`${o}${i}`),c),[o]).join(`
1
+ import Pt from"readline";import Ct from"events";import{fileURLToPath as Dt}from"node:url";import z from"node:path";import oe,{argv as ai}from"node:process";import ci from"node:os";import Et from"node:tty";import{readFileSync as di,writeFileSync as fi,existsSync as _t,mkdirSync as pi}from"fs";import{readdirSync as mi,lstatSync as gi,mkdirSync as vi,copyFileSync as bi}from"node:fs";function qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var le={},he,At;function q(){if(At)return he;At=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:r,TERM:o}=process.env,t={enabled:!r&&o!=="dumb"&&e!=="0",reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function s(b,l){let a=0,n,m="",f="";for(;a<b.length;a++)n=b[a],m+=n.open,f+=n.close,l.includes(n.close)&&(l=l.replace(n.rgx,n.close+n.open));return m+l+f}function c(b,l){let a={has:b,keys:l};return a.reset=t.reset.bind(a),a.bold=t.bold.bind(a),a.dim=t.dim.bind(a),a.italic=t.italic.bind(a),a.underline=t.underline.bind(a),a.inverse=t.inverse.bind(a),a.hidden=t.hidden.bind(a),a.strikethrough=t.strikethrough.bind(a),a.black=t.black.bind(a),a.red=t.red.bind(a),a.green=t.green.bind(a),a.yellow=t.yellow.bind(a),a.blue=t.blue.bind(a),a.magenta=t.magenta.bind(a),a.cyan=t.cyan.bind(a),a.white=t.white.bind(a),a.gray=t.gray.bind(a),a.grey=t.grey.bind(a),a.bgBlack=t.bgBlack.bind(a),a.bgRed=t.bgRed.bind(a),a.bgGreen=t.bgGreen.bind(a),a.bgYellow=t.bgYellow.bind(a),a.bgBlue=t.bgBlue.bind(a),a.bgMagenta=t.bgMagenta.bind(a),a.bgCyan=t.bgCyan.bind(a),a.bgWhite=t.bgWhite.bind(a),a}function i(b,l){let a={open:`\x1B[${b}m`,close:`\x1B[${l}m`,rgx:new RegExp(`\\x1b\\[${l}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(b)||(this.has.push(b),this.keys.push(a)),n===void 0?this:t.enabled?s(this.keys,n+""):n+""):n===void 0?c([b],[a]):t.enabled?s([a],n+""):n+""}}return he=t,he}var ue,It;function yi(){return It||(It=1,ue=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),ue}var ae,jt;function ce(){return jt||(jt=1,ae=e=>{const r=["[\\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("|"),o=new RegExp(r,"g");return typeof e=="string"?e.replace(o,""):e}),ae}var de,Ft;function A(){if(Ft)return de;Ft=1;const e="\x1B",r=`${e}[`,o="\x07",t={to(i,b){return b?`${r}${b+1};${i+1}H`:`${r}${i+1}G`},move(i,b){let l="";return i<0?l+=`${r}${-i}D`:i>0&&(l+=`${r}${i}C`),b<0?l+=`${r}${-b}A`:b>0&&(l+=`${r}${b}B`),l},up:(i=1)=>`${r}${i}A`,down:(i=1)=>`${r}${i}B`,forward:(i=1)=>`${r}${i}C`,backward:(i=1)=>`${r}${i}D`,nextLine:(i=1)=>`${r}E`.repeat(i),prevLine:(i=1)=>`${r}F`.repeat(i),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${e}7`,restore:`${e}8`},s={up:(i=1)=>`${r}S`.repeat(i),down:(i=1)=>`${r}T`.repeat(i)},c={screen:`${r}2J`,up:(i=1)=>`${r}1J`.repeat(i),down:(i=1)=>`${r}J`.repeat(i),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(i){let b="";for(let l=0;l<i;l++)b+=this.line+(l<i-1?t.up():"");return i&&(b+=t.left),b}};return de={cursor:t,scroll:s,erase:c,beep:o},de}var fe,Nt;function wi(){if(Nt)return fe;Nt=1;function e(l,a){var n=typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(!n){if(Array.isArray(l)||(n=r(l))||a){n&&(l=n);var m=0,f=function(){};return{s:f,n:function(){return m>=l.length?{done:!0}:{done:!1,value:l[m++]}},e:function(d){throw d},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var h=!0,u=!1,v;return{s:function(){n=n.call(l)},n:function(){var d=n.next();return h=d.done,d},e:function(d){u=!0,v=d},f:function(){try{!h&&n.return!=null&&n.return()}finally{if(u)throw v}}}}function r(l,a){if(l){if(typeof l=="string")return o(l,a);var n=Object.prototype.toString.call(l).slice(8,-1);if(n==="Object"&&l.constructor&&(n=l.constructor.name),n==="Map"||n==="Set")return Array.from(l);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(l,a)}}function o(l,a){(a==null||a>l.length)&&(a=l.length);for(var n=0,m=new Array(a);n<a;n++)m[n]=l[n];return m}const t=ce(),s=A(),c=s.erase,i=s.cursor,b=l=>[...t(l)].length;return fe=function(l,a){if(!a)return c.line+i.to(0);let n=0;const m=l.split(/\r?\n/);var f=e(m),h;try{for(f.s();!(h=f.n()).done;){let u=h.value;n+=1+Math.floor(Math.max(b(u)-1,0)/a)}}catch(u){f.e(u)}finally{f.f()}return c.lines(n)},fe}var pe,kt;function Lt(){if(kt)return pe;kt=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return pe=process.platform==="win32"?r:e,pe}var me,Yt;function xi(){if(Yt)return me;Yt=1;const e=q(),r=Lt(),o=Object.freeze({password:{scale:1,render:l=>"*".repeat(l.length)},emoji:{scale:2,render:l=>"\u{1F603}".repeat(l.length)},invisible:{scale:0,render:l=>""},default:{scale:1,render:l=>`${l}`}}),t=l=>o[l]||o.default,s=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return me={styles:o,render:t,symbols:s,symbol:(l,a,n)=>a?s.aborted:n?s.exited:l?s.done:s.default,delimiter:l=>e.gray(l?r.ellipsis:r.pointerSmall),item:(l,a)=>e.gray(l?a?r.pointerSmall:"+":r.line)},me}var ge,Bt;function $i(){if(Bt)return ge;Bt=1;const e=ce();return ge=function(r,o){let t=String(e(r)||"").split(/\r?\n/);return o?t.map(s=>Math.ceil(s.length/o)).reduce((s,c)=>s+c):t.length},ge}var ve,Vt;function Si(){return Vt||(Vt=1,ve=(e,r={})=>{const o=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((c,i)=>(i.length+o.length>=t||c[c.length-1].length+i.length+1<t?c[c.length-1]+=` ${i}`:c.push(`${o}${i}`),c),[o]).join(`
3
3
  `)).join(`
4
- `)}),ve}var be,Ht;function Ti(){return Ht||(Ht=1,be=(e,r,o)=>{o=o||r;let t=Math.min(r-o,e-Math.floor(o/2));t<0&&(t=0);let s=Math.min(t+o,r);return{startIndex:t,endIndex:s}}),be}var ye,Ut;function k(){return Ut||(Ut=1,ye={action:yi(),clear:wi(),style:xi(),strip:ce(),figures:Yt(),lines:Si(),wrap:$i(),entriesToDisplay:Ti()}),ye}var we,Gt;function W(){if(Gt)return we;Gt=1;const e=Pt,r=k(),o=r.action,t=Ct,s=A(),c=s.beep,i=s.cursor,b=q();class l extends t{constructor(n={}){super(),this.firstRender=!0,this.in=n.stdin||process.stdin,this.out=n.stdout||process.stdout,this.onRender=(n.onRender||(()=>{})).bind(this);const m=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,m),this.in.isTTY&&this.in.setRawMode(!0);const f=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,h=(u,v)=>{let g=o(v,f);g===!1?this._&&this._(u,v):typeof this[g]=="function"?this[g](v):this.bell()};this.close=()=>{this.out.write(i.show),this.in.removeListener("keypress",h),this.in.isTTY&&this.in.setRawMode(!1),m.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",h)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(c)}render(){this.onRender(b),this.firstRender&&(this.firstRender=!1)}}return we=l,we}var xe,Jt;function Mi(){if(Jt)return xe;Jt=1;function e(h,u,v,g,d,p,y){try{var w=h[p](y),x=w.value}catch($){v($);return}w.done?u(x):Promise.resolve(x).then(g,d)}function r(h){return function(){var u=this,v=arguments;return new Promise(function(g,d){var p=h.apply(u,v);function y(x){e(p,g,d,y,w,"next",x)}function w(x){e(p,g,d,y,w,"throw",x)}y(void 0)})}}const o=q(),t=W(),s=A(),c=s.erase,i=s.cursor,b=k(),l=b.style,a=b.clear,n=b.lines,m=b.figures;class f extends t{constructor(u={}){super(u),this.transform=l.render(u.style),this.scale=this.transform.scale,this.msg=u.message,this.initial=u.initial||"",this.validator=u.validate||(()=>!0),this.value="",this.errorMsg=u.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=a("",this.out.columns),this.render()}set value(u){!u&&this.initial?(this.placeholder=!0,this.rendered=o.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(u)),this._value=u,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(`
4
+ `)}),ve}var be,Ht;function Ti(){return Ht||(Ht=1,be=(e,r,o)=>{o=o||r;let t=Math.min(r-o,e-Math.floor(o/2));t<0&&(t=0);let s=Math.min(t+o,r);return{startIndex:t,endIndex:s}}),be}var ye,Ut;function B(){return Ut||(Ut=1,ye={action:yi(),clear:wi(),style:xi(),strip:ce(),figures:Lt(),lines:$i(),wrap:Si(),entriesToDisplay:Ti()}),ye}var we,Gt;function K(){if(Gt)return we;Gt=1;const e=Pt,r=B(),o=r.action,t=Ct,s=A(),c=s.beep,i=s.cursor,b=q();class l extends t{constructor(n={}){super(),this.firstRender=!0,this.in=n.stdin||process.stdin,this.out=n.stdout||process.stdout,this.onRender=(n.onRender||(()=>{})).bind(this);const m=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,m),this.in.isTTY&&this.in.setRawMode(!0);const f=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,h=(u,v)=>{let g=o(v,f);g===!1?this._&&this._(u,v):typeof this[g]=="function"?this[g](v):this.bell()};this.close=()=>{this.out.write(i.show),this.in.removeListener("keypress",h),this.in.isTTY&&this.in.setRawMode(!1),m.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",h)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(c)}render(){this.onRender(b),this.firstRender&&(this.firstRender=!1)}}return we=l,we}var xe,Jt;function Mi(){if(Jt)return xe;Jt=1;function e(h,u,v,g,d,p,y){try{var w=h[p](y),x=w.value}catch(S){v(S);return}w.done?u(x):Promise.resolve(x).then(g,d)}function r(h){return function(){var u=this,v=arguments;return new Promise(function(g,d){var p=h.apply(u,v);function y(x){e(p,g,d,y,w,"next",x)}function w(x){e(p,g,d,y,w,"throw",x)}y(void 0)})}}const o=q(),t=K(),s=A(),c=s.erase,i=s.cursor,b=B(),l=b.style,a=b.clear,n=b.lines,m=b.figures;class f extends t{constructor(u={}){super(u),this.transform=l.render(u.style),this.scale=this.transform.scale,this.msg=u.message,this.initial=u.initial||"",this.validator=u.validate||(()=>!0),this.value="",this.errorMsg=u.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=a("",this.out.columns),this.render()}set value(u){!u&&this.initial?(this.placeholder=!0,this.rendered=o.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(u)),this._value=u,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(`
5
5
  `),this.close()}validate(){var u=this;return r(function*(){let v=yield u.validator(u.value);typeof v=="string"&&(u.errorMsg=v,v=!1),u.error=!v})()}submit(){var u=this;return r(function*(){if(u.value=u.value||u.initial,u.cursorOffset=0,u.cursor=u.rendered.length,yield u.validate(),u.error){u.red=!0,u.fire(),u.render();return}u.done=!0,u.aborted=!1,u.fire(),u.render(),u.out.write(`
6
6
  `),u.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(u){this.placeholder||(this.cursor=this.cursor+u,this.cursorOffset+=u)}_(u,v){let g=this.value.slice(0,this.cursor),d=this.value.slice(this.cursor);this.value=`${g}${u}${d}`,this.red=!1,this.cursor=this.placeholder?0:g.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let u=this.value.slice(0,this.cursor-1),v=this.value.slice(this.cursor);this.value=`${u}${v}`,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 u=this.value.slice(0,this.cursor),v=this.value.slice(this.cursor+1);this.value=`${u}${v}`,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(i.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=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
7
7
  `).reduce((u,v,g)=>u+`
8
- ${g?" ":m.pointerSmall} ${o.red().italic(v)}`,"")),this.out.write(c.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore+i.move(this.cursorOffset,0)))}}return xe=f,xe}var Se,Wt;function Oi(){if(Wt)return Se;Wt=1;const e=q(),r=W(),o=k(),t=o.style,s=o.clear,c=o.figures,i=o.wrap,b=o.entriesToDisplay,l=A(),a=l.cursor;class n extends r{constructor(f={}){super(f),this.msg=f.message,this.hint=f.hint||"- Use arrow-keys. Return to submit.",this.warn=f.warn||"- This option is disabled",this.cursor=f.initial||0,this.choices=f.choices.map((h,u)=>(typeof h=="string"&&(h={title:h,value:u}),{title:h&&(h.title||h.value||h),value:h&&(h.value===void 0?u:h.value),description:h&&h.description,selected:h&&h.selected,disabled:h&&h.disabled})),this.optionsPerPage=f.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=s("",this.out.columns),this.render()}moveCursor(f){this.cursor=f,this.value=this.choices[f].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(`
8
+ ${g?" ":m.pointerSmall} ${o.red().italic(v)}`,"")),this.out.write(c.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore+i.move(this.cursorOffset,0)))}}return xe=f,xe}var $e,Wt;function Oi(){if(Wt)return $e;Wt=1;const e=q(),r=K(),o=B(),t=o.style,s=o.clear,c=o.figures,i=o.wrap,b=o.entriesToDisplay,l=A(),a=l.cursor;class n extends r{constructor(f={}){super(f),this.msg=f.message,this.hint=f.hint||"- Use arrow-keys. Return to submit.",this.warn=f.warn||"- This option is disabled",this.cursor=f.initial||0,this.choices=f.choices.map((h,u)=>(typeof h=="string"&&(h={title:h,value:u}),{title:h&&(h.title||h.value||h),value:h&&(h.value===void 0?u:h.value),description:h&&h.description,selected:h&&h.selected,disabled:h&&h.disabled})),this.optionsPerPage=f.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=s("",this.out.columns),this.render()}moveCursor(f){this.cursor=f,this.value=this.choices[f].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(`
9
9
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
10
10
  `),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()}_(f,h){if(f===" ")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(s(this.outputText,this.out.columns)),super.render();let f=b(this.cursor,this.choices.length,this.optionsPerPage),h=f.startIndex,u=f.endIndex;if(this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
11
  `;for(let v=h;v<u;v++){let g,d,p="",y=this.choices[v];v===h&&h>0?d=c.arrowUp:v===u-1&&u<this.choices.length?d=c.arrowDown:d=" ",y.disabled?(g=this.cursor===v?e.gray().underline(y.title):e.strikethrough().gray(y.title),d=(this.cursor===v?e.bold().gray(c.pointer)+" ":" ")+d):(g=this.cursor===v?e.cyan().underline(y.title):y.title,d=(this.cursor===v?e.cyan(c.pointer)+" ":" ")+d,y.description&&this.cursor===v&&(p=` - ${y.description}`,(d.length+g.length+p.length>=this.out.columns||y.description.split(/\r?\n/).length>1)&&(p=`
12
12
  `+i(y.description,{margin:3,width:this.out.columns})))),this.outputText+=`${d} ${g}${e.gray(p)}
13
- `}}this.out.write(this.outputText)}}return Se=n,Se}var $e,zt;function Ri(){if(zt)return $e;zt=1;const e=q(),r=W(),o=k(),t=o.style,s=o.clear,c=A(),i=c.cursor,b=c.erase;class l extends r{constructor(n={}){super(n),this.msg=n.message,this.value=!!n.initial,this.active=n.active||"on",this.inactive=n.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(`
13
+ `}}this.out.write(this.outputText)}}return $e=n,$e}var Se,zt;function Ri(){if(zt)return Se;zt=1;const e=q(),r=K(),o=B(),t=o.style,s=o.clear,c=A(),i=c.cursor,b=c.erase;class l extends r{constructor(n={}){super(n),this.msg=n.message,this.value=!!n.initial,this.active=n.active||"on",this.inactive=n.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(`
14
14
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
15
- `),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()}_(n,m){if(n===" ")this.value=!this.value;else if(n==="1")this.value=!0;else if(n==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(b.line+i.to(0)+this.outputText))}}return $e=l,$e}var Te,Kt;function U(){if(Kt)return Te;Kt=1;class e{constructor({token:o,date:t,parts:s,locales:c}){this.token=o,this.date=t||new Date,this.parts=s||[this],this.locales=c||{}}up(){}down(){}next(){const o=this.parts.indexOf(this);return this.parts.find((t,s)=>s>o&&t instanceof e)}setTo(o){}prev(){let o=[].concat(this.parts).reverse();const t=o.indexOf(this);return o.find((s,c)=>c>t&&s instanceof e)}toString(){return String(this.date)}}return Te=e,Te}var Me,Zt;function Pi(){if(Zt)return Me;Zt=1;const e=U();class r extends e{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}}return Me=r,Me}var Oe,Xt;function Ci(){if(Xt)return Oe;Xt=1;const e=U(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class o extends e{constructor(s={}){super(s)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(s){this.date.setDate(parseInt(s.substr(-2)))}toString(){let s=this.date.getDate(),c=this.date.getDay();return this.token==="DD"?String(s).padStart(2,"0"):this.token==="Do"?s+r(s):this.token==="d"?c+1:this.token==="ddd"?this.locales.weekdaysShort[c]:this.token==="dddd"?this.locales.weekdays[c]:s}}return Oe=o,Oe}var Re,Qt;function Di(){if(Qt)return Re;Qt=1;const e=U();class r extends e{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}}return Re=r,Re}var Pe,er;function Ei(){if(er)return Pe;er=1;const e=U();class r extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return Pe=r,Pe}var Ce,tr;function _i(){if(tr)return Ce;tr=1;const e=U();class r extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return Ce=r,Ce}var De,rr;function qi(){if(rr)return De;rr=1;const e=U();class r extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),s=this.token.length;return s===2?String(t+1).padStart(2,"0"):s===3?this.locales.monthsShort[t]:s===4?this.locales.months[t]:String(t+1)}}return De=r,De}var Ee,ir;function Ai(){if(ir)return Ee;ir=1;const e=U();class r extends e{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}}return Ee=r,Ee}var _e,sr;function Ii(){if(sr)return _e;sr=1;const e=U();class r extends e{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 this.token.length===2?t.substr(-2):t}}return _e=r,_e}var qe,nr;function ji(){return nr||(nr=1,qe={DatePart:U(),Meridiem:Pi(),Day:Ci(),Hours:Di(),Milliseconds:Ei(),Minutes:_i(),Month:qi(),Seconds:Ai(),Year:Ii()}),qe}var Ae,or;function Fi(){if(or)return Ae;or=1;function e(M,S,R,D,C,j,Y){try{var N=M[j](Y),F=N.value}catch(X){R(X);return}N.done?S(F):Promise.resolve(F).then(D,C)}function r(M){return function(){var S=this,R=arguments;return new Promise(function(D,C){var j=M.apply(S,R);function Y(F){e(j,D,C,Y,N,"next",F)}function N(F){e(j,D,C,Y,N,"throw",F)}Y(void 0)})}}const o=q(),t=W(),s=k(),c=s.style,i=s.clear,b=s.figures,l=A(),a=l.erase,n=l.cursor,m=ji(),f=m.DatePart,h=m.Meridiem,u=m.Day,v=m.Hours,g=m.Milliseconds,d=m.Minutes,p=m.Month,y=m.Seconds,w=m.Year,x=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,$={1:({token:M})=>M.replace(/\\(.)/g,"$1"),2:M=>new u(M),3:M=>new p(M),4:M=>new w(M),5:M=>new h(M),6:M=>new v(M),7:M=>new d(M),8:M=>new y(M),9:M=>new g(M)},T={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 O extends t{constructor(S={}){super(S),this.msg=S.message,this.cursor=0,this.typed="",this.locales=Object.assign(T,S.locales),this._date=S.initial||new Date,this.errorMsg=S.error||"Please Enter A Valid Value",this.validator=S.validate||(()=>!0),this.mask=S.mask||"YYYY-MM-DD HH:mm:ss",this.clear=i("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(S){S&&this._date.setTime(S.getTime())}set mask(S){let R;for(this.parts=[];R=x.exec(S);){let C=R.shift(),j=R.findIndex(Y=>Y!=null);this.parts.push(j in $?$[j]({token:R[j]||C,date:this.date,parts:this.parts,locales:this.locales}):R[j]||C)}let D=this.parts.reduce((C,j)=>(typeof j=="string"&&typeof C[C.length-1]=="string"?C[C.length-1]+=j:C.push(j),C),[]);this.parts.splice(0),this.parts.push(...D),this.reset()}moveCursor(S){this.typed="",this.cursor=S,this.fire()}reset(){this.moveCursor(this.parts.findIndex(S=>S instanceof f)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
- `),this.close()}validate(){var S=this;return r(function*(){let R=yield S.validator(S.value);typeof R=="string"&&(S.errorMsg=R,R=!1),S.error=!R})()}submit(){var S=this;return r(function*(){if(yield S.validate(),S.error){S.color="red",S.fire(),S.render();return}S.done=!0,S.aborted=!1,S.fire(),S.render(),S.out.write(`
17
- `),S.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let S=this.parts[this.cursor].prev();if(S==null)return this.bell();this.moveCursor(this.parts.indexOf(S)),this.render()}right(){let S=this.parts[this.cursor].next();if(S==null)return this.bell();this.moveCursor(this.parts.indexOf(S)),this.render()}next(){let S=this.parts[this.cursor].next();this.moveCursor(S?this.parts.indexOf(S):this.parts.findIndex(R=>R instanceof f)),this.render()}_(S){/\d/.test(S)&&(this.typed+=S,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(n.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(!1),this.parts.reduce((S,R,D)=>S.concat(D===this.cursor&&!this.done?o.cyan().underline(R.toString()):R),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
- `).reduce((S,R,D)=>S+`
19
- ${D?" ":b.pointerSmall} ${o.red().italic(R)}`,"")),this.out.write(a.line+n.to(0)+this.outputText))}}return Ae=O,Ae}var Ie,lr;function Ni(){if(lr)return Ie;lr=1;function e(g,d,p,y,w,x,$){try{var T=g[x]($),O=T.value}catch(M){p(M);return}T.done?d(O):Promise.resolve(O).then(y,w)}function r(g){return function(){var d=this,p=arguments;return new Promise(function(y,w){var x=g.apply(d,p);function $(O){e(x,y,w,$,T,"next",O)}function T(O){e(x,y,w,$,T,"throw",O)}$(void 0)})}}const o=q(),t=W(),s=A(),c=s.cursor,i=s.erase,b=k(),l=b.style,a=b.figures,n=b.clear,m=b.lines,f=/[0-9]/,h=g=>g!==void 0,u=(g,d)=>{let p=Math.pow(10,d);return Math.round(g*p)/p};class v extends t{constructor(d={}){super(d),this.transform=l.render(d.style),this.msg=d.message,this.initial=h(d.initial)?d.initial:"",this.float=!!d.float,this.round=d.round||2,this.inc=d.increment||1,this.min=h(d.min)?d.min:-1/0,this.max=h(d.max)?d.max:1/0,this.errorMsg=d.error||"Please Enter A Valid Value",this.validator=d.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(d){!d&&d!==0?(this.placeholder=!0,this.rendered=o.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${u(d,this.round)}`),this._value=u(d,this.round)),this.fire()}get value(){return this._value}parse(d){return this.float?parseFloat(d):parseInt(d)}valid(d){return d==="-"||d==="."&&this.float||f.test(d)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let d=this.value;this.value=d!==""?d:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
15
+ `),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()}_(n,m){if(n===" ")this.value=!this.value;else if(n==="1")this.value=!0;else if(n==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(b.line+i.to(0)+this.outputText))}}return Se=l,Se}var Te,Kt;function U(){if(Kt)return Te;Kt=1;class e{constructor({token:o,date:t,parts:s,locales:c}){this.token=o,this.date=t||new Date,this.parts=s||[this],this.locales=c||{}}up(){}down(){}next(){const o=this.parts.indexOf(this);return this.parts.find((t,s)=>s>o&&t instanceof e)}setTo(o){}prev(){let o=[].concat(this.parts).reverse();const t=o.indexOf(this);return o.find((s,c)=>c>t&&s instanceof e)}toString(){return String(this.date)}}return Te=e,Te}var Me,Zt;function Pi(){if(Zt)return Me;Zt=1;const e=U();class r extends e{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}}return Me=r,Me}var Oe,Xt;function Ci(){if(Xt)return Oe;Xt=1;const e=U(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class o extends e{constructor(s={}){super(s)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(s){this.date.setDate(parseInt(s.substr(-2)))}toString(){let s=this.date.getDate(),c=this.date.getDay();return this.token==="DD"?String(s).padStart(2,"0"):this.token==="Do"?s+r(s):this.token==="d"?c+1:this.token==="ddd"?this.locales.weekdaysShort[c]:this.token==="dddd"?this.locales.weekdays[c]:s}}return Oe=o,Oe}var Re,Qt;function Di(){if(Qt)return Re;Qt=1;const e=U();class r extends e{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}}return Re=r,Re}var Pe,er;function Ei(){if(er)return Pe;er=1;const e=U();class r extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return Pe=r,Pe}var Ce,tr;function _i(){if(tr)return Ce;tr=1;const e=U();class r extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return Ce=r,Ce}var De,rr;function qi(){if(rr)return De;rr=1;const e=U();class r extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),s=this.token.length;return s===2?String(t+1).padStart(2,"0"):s===3?this.locales.monthsShort[t]:s===4?this.locales.months[t]:String(t+1)}}return De=r,De}var Ee,ir;function Ai(){if(ir)return Ee;ir=1;const e=U();class r extends e{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}}return Ee=r,Ee}var _e,sr;function Ii(){if(sr)return _e;sr=1;const e=U();class r extends e{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 this.token.length===2?t.substr(-2):t}}return _e=r,_e}var qe,nr;function ji(){return nr||(nr=1,qe={DatePart:U(),Meridiem:Pi(),Day:Ci(),Hours:Di(),Milliseconds:Ei(),Minutes:_i(),Month:qi(),Seconds:Ai(),Year:Ii()}),qe}var Ae,or;function Fi(){if(or)return Ae;or=1;function e(M,$,R,D,C,j,Y){try{var N=M[j](Y),F=N.value}catch(X){R(X);return}N.done?$(F):Promise.resolve(F).then(D,C)}function r(M){return function(){var $=this,R=arguments;return new Promise(function(D,C){var j=M.apply($,R);function Y(F){e(j,D,C,Y,N,"next",F)}function N(F){e(j,D,C,Y,N,"throw",F)}Y(void 0)})}}const o=q(),t=K(),s=B(),c=s.style,i=s.clear,b=s.figures,l=A(),a=l.erase,n=l.cursor,m=ji(),f=m.DatePart,h=m.Meridiem,u=m.Day,v=m.Hours,g=m.Milliseconds,d=m.Minutes,p=m.Month,y=m.Seconds,w=m.Year,x=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,S={1:({token:M})=>M.replace(/\\(.)/g,"$1"),2:M=>new u(M),3:M=>new p(M),4:M=>new w(M),5:M=>new h(M),6:M=>new v(M),7:M=>new d(M),8:M=>new y(M),9:M=>new g(M)},T={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 O extends t{constructor($={}){super($),this.msg=$.message,this.cursor=0,this.typed="",this.locales=Object.assign(T,$.locales),this._date=$.initial||new Date,this.errorMsg=$.error||"Please Enter A Valid Value",this.validator=$.validate||(()=>!0),this.mask=$.mask||"YYYY-MM-DD HH:mm:ss",this.clear=i("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date($){$&&this._date.setTime($.getTime())}set mask($){let R;for(this.parts=[];R=x.exec($);){let C=R.shift(),j=R.findIndex(Y=>Y!=null);this.parts.push(j in S?S[j]({token:R[j]||C,date:this.date,parts:this.parts,locales:this.locales}):R[j]||C)}let D=this.parts.reduce((C,j)=>(typeof j=="string"&&typeof C[C.length-1]=="string"?C[C.length-1]+=j:C.push(j),C),[]);this.parts.splice(0),this.parts.push(...D),this.reset()}moveCursor($){this.typed="",this.cursor=$,this.fire()}reset(){this.moveCursor(this.parts.findIndex($=>$ instanceof f)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
+ `),this.close()}validate(){var $=this;return r(function*(){let R=yield $.validator($.value);typeof R=="string"&&($.errorMsg=R,R=!1),$.error=!R})()}submit(){var $=this;return r(function*(){if(yield $.validate(),$.error){$.color="red",$.fire(),$.render();return}$.done=!0,$.aborted=!1,$.fire(),$.render(),$.out.write(`
17
+ `),$.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let $=this.parts[this.cursor].prev();if($==null)return this.bell();this.moveCursor(this.parts.indexOf($)),this.render()}right(){let $=this.parts[this.cursor].next();if($==null)return this.bell();this.moveCursor(this.parts.indexOf($)),this.render()}next(){let $=this.parts[this.cursor].next();this.moveCursor($?this.parts.indexOf($):this.parts.findIndex(R=>R instanceof f)),this.render()}_($){/\d/.test($)&&(this.typed+=$,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(n.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(!1),this.parts.reduce(($,R,D)=>$.concat(D===this.cursor&&!this.done?o.cyan().underline(R.toString()):R),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
+ `).reduce(($,R,D)=>$+`
19
+ ${D?" ":b.pointerSmall} ${o.red().italic(R)}`,"")),this.out.write(a.line+n.to(0)+this.outputText))}}return Ae=O,Ae}var Ie,lr;function Ni(){if(lr)return Ie;lr=1;function e(g,d,p,y,w,x,S){try{var T=g[x](S),O=T.value}catch(M){p(M);return}T.done?d(O):Promise.resolve(O).then(y,w)}function r(g){return function(){var d=this,p=arguments;return new Promise(function(y,w){var x=g.apply(d,p);function S(O){e(x,y,w,S,T,"next",O)}function T(O){e(x,y,w,S,T,"throw",O)}S(void 0)})}}const o=q(),t=K(),s=A(),c=s.cursor,i=s.erase,b=B(),l=b.style,a=b.figures,n=b.clear,m=b.lines,f=/[0-9]/,h=g=>g!==void 0,u=(g,d)=>{let p=Math.pow(10,d);return Math.round(g*p)/p};class v extends t{constructor(d={}){super(d),this.transform=l.render(d.style),this.msg=d.message,this.initial=h(d.initial)?d.initial:"",this.float=!!d.float,this.round=d.round||2,this.inc=d.increment||1,this.min=h(d.min)?d.min:-1/0,this.max=h(d.max)?d.max:1/0,this.errorMsg=d.error||"Please Enter A Valid Value",this.validator=d.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(d){!d&&d!==0?(this.placeholder=!0,this.rendered=o.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${u(d,this.round)}`),this._value=u(d,this.round)),this.fire()}get value(){return this._value}parse(d){return this.float?parseFloat(d):parseInt(d)}valid(d){return d==="-"||d==="."&&this.float||f.test(d)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let d=this.value;this.value=d!==""?d:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
20
20
  `),this.close()}validate(){var d=this;return r(function*(){let p=yield d.validator(d.value);typeof p=="string"&&(d.errorMsg=p,p=!1),d.error=!p})()}submit(){var d=this;return r(function*(){if(yield d.validate(),d.error){d.color="red",d.fire(),d.render();return}let p=d.value;d.value=p!==""?p:d.initial,d.done=!0,d.aborted=!1,d.error=!1,d.fire(),d.render(),d.out.write(`
21
21
  `),d.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 d=this.value.toString();if(d.length===0)return this.bell();this.value=this.parse(d=d.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()}_(d,p){if(!this.valid(d))return this.bell();const y=Date.now();if(y-this.lastHit>1e3&&(this.typed=""),this.typed+=d,this.lastHit=y,this.color="cyan",d===".")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(c.down(m(this.outputError,this.out.columns)-1)+n(this.outputError,this.out.columns)),this.out.write(n(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
22
22
  `).reduce((d,p,y)=>d+`
23
- ${y?" ":a.pointerSmall} ${o.red().italic(p)}`,"")),this.out.write(i.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore))}}return Ie=v,Ie}var je,hr;function ur(){if(hr)return je;hr=1;const e=q(),r=A(),o=r.cursor,t=W(),s=k(),c=s.clear,i=s.figures,b=s.style,l=s.wrap,a=s.entriesToDisplay;class n extends t{constructor(f={}){super(f),this.msg=f.message,this.cursor=f.cursor||0,this.scrollIndex=f.cursor||0,this.hint=f.hint||"",this.warn=f.warn||"- This option is disabled -",this.minSelected=f.min,this.showMinError=!1,this.maxChoices=f.max,this.instructions=f.instructions,this.optionsPerPage=f.optionsPerPage||10,this.value=f.choices.map((h,u)=>(typeof h=="string"&&(h={title:h,value:u}),{title:h&&(h.title||h.value||h),description:h&&h.description,value:h&&(h.value===void 0?u:h.value),selected:h&&h.selected,disabled:h&&h.disabled})),this.clear=c("",this.out.columns),f.overrideRender||this.render()}reset(){this.value.map(f=>!f.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(f=>f.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
23
+ ${y?" ":a.pointerSmall} ${o.red().italic(p)}`,"")),this.out.write(i.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore))}}return Ie=v,Ie}var je,hr;function ur(){if(hr)return je;hr=1;const e=q(),r=A(),o=r.cursor,t=K(),s=B(),c=s.clear,i=s.figures,b=s.style,l=s.wrap,a=s.entriesToDisplay;class n extends t{constructor(f={}){super(f),this.msg=f.message,this.cursor=f.cursor||0,this.scrollIndex=f.cursor||0,this.hint=f.hint||"",this.warn=f.warn||"- This option is disabled -",this.minSelected=f.min,this.showMinError=!1,this.maxChoices=f.max,this.instructions=f.instructions,this.optionsPerPage=f.optionsPerPage||10,this.value=f.choices.map((h,u)=>(typeof h=="string"&&(h={title:h,value:u}),{title:h&&(h.title||h.value||h),description:h&&h.description,value:h&&(h.value===void 0?u:h.value),selected:h&&h.selected,disabled:h&&h.disabled})),this.clear=c("",this.out.columns),f.overrideRender||this.render()}reset(){this.value.map(f=>!f.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(f=>f.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
24
24
  `),this.close()}submit(){const f=this.value.filter(h=>h.selected);this.minSelected&&f.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
25
25
  `),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(){this.cursor===0?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(f=>f.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const f=this.value[this.cursor];if(f.selected)f.selected=!1,this.render();else{if(f.disabled||this.value.filter(h=>h.selected).length>=this.maxChoices)return this.bell();f.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const f=!this.value[this.cursor].selected;this.value.filter(h=>!h.disabled).forEach(h=>h.selected=f),this.render()}_(f,h){if(f===" ")this.handleSpaceToggle();else if(f==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
26
26
  Instructions:
@@ -30,13 +30,13 @@ Instructions:
30
30
  `:"")+" enter/return: Complete answer":""}renderOption(f,h,u,v){const g=(h.selected?e.green(i.radioOn):i.radioOff)+" "+v+" ";let d,p;return h.disabled?d=f===u?e.gray().underline(h.title):e.strikethrough().gray(h.title):(d=f===u?e.cyan().underline(h.title):h.title,f===u&&h.description&&(p=` - ${h.description}`,(g.length+d.length+p.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(p=`
31
31
  `+l(h.description,{margin:g.length,width:this.out.columns})))),g+d+e.gray(p||"")}paginateOptions(f){if(f.length===0)return e.red("No matches for this query.");let h=a(this.cursor,f.length,this.optionsPerPage),u=h.startIndex,v=h.endIndex,g,d=[];for(let p=u;p<v;p++)p===u&&u>0?g=i.arrowUp:p===v-1&&v<f.length?g=i.arrowDown:g=" ",d.push(this.renderOption(this.cursor,f[p],p,g));return`
32
32
  `+d.join(`
33
- `)}renderOptions(f){return this.done?"":this.paginateOptions(f)}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");const f=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&f.push(e.yellow(this.warn)),f.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let f=[b.symbol(this.done,this.aborted),e.bold(this.msg),b.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(f+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),f+=this.renderOptions(this.value),this.out.write(this.clear+f),this.clear=c(f,this.out.columns)}}return je=n,je}var Fe,ar;function Li(){if(ar)return Fe;ar=1;function e(d,p,y,w,x,$,T){try{var O=d[$](T),M=O.value}catch(S){y(S);return}O.done?p(M):Promise.resolve(M).then(w,x)}function r(d){return function(){var p=this,y=arguments;return new Promise(function(w,x){var $=d.apply(p,y);function T(M){e($,w,x,T,O,"next",M)}function O(M){e($,w,x,T,O,"throw",M)}T(void 0)})}}const o=q(),t=W(),s=A(),c=s.erase,i=s.cursor,b=k(),l=b.style,a=b.clear,n=b.figures,m=b.wrap,f=b.entriesToDisplay,h=(d,p)=>d[p]&&(d[p].value||d[p].title||d[p]),u=(d,p)=>d[p]&&(d[p].title||d[p].value||d[p]),v=(d,p)=>{const y=d.findIndex(w=>w.value===p||w.title===p);return y>-1?y:void 0};class g extends t{constructor(p={}){super(p),this.msg=p.message,this.suggest=p.suggest,this.choices=p.choices,this.initial=typeof p.initial=="number"?p.initial:v(p.choices,p.initial),this.select=this.initial||p.cursor||0,this.i18n={noMatches:p.noMatches||"no matches found"},this.fallback=p.fallback||this.initial,this.clearFirst=p.clearFirst||!1,this.suggestions=[],this.input="",this.limit=p.limit||10,this.cursor=0,this.transform=l.render(p.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=a("",this.out.columns),this.complete(this.render),this.render()}set fallback(p){this._fb=Number.isSafeInteger(parseInt(p))?parseInt(p):p}get fallback(){let p;return typeof this._fb=="number"?p=this.choices[this._fb]:typeof this._fb=="string"&&(p={title:this._fb}),p||this._fb||{title:this.i18n.noMatches}}moveSelect(p){this.select=p,this.suggestions.length>0?this.value=h(this.suggestions,p):this.value=this.fallback.value,this.fire()}complete(p){var y=this;return r(function*(){const w=y.completing=y.suggest(y.input,y.choices),x=yield w;if(y.completing!==w)return;y.suggestions=x.map((T,O,M)=>({title:u(M,O),value:h(M,O),description:T.description})),y.completing=!1;const $=Math.max(x.length-1,0);y.moveSelect(Math.min($,y.select)),p&&p()})()}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(`
33
+ `)}renderOptions(f){return this.done?"":this.paginateOptions(f)}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");const f=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&f.push(e.yellow(this.warn)),f.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let f=[b.symbol(this.done,this.aborted),e.bold(this.msg),b.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(f+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),f+=this.renderOptions(this.value),this.out.write(this.clear+f),this.clear=c(f,this.out.columns)}}return je=n,je}var Fe,ar;function ki(){if(ar)return Fe;ar=1;function e(d,p,y,w,x,S,T){try{var O=d[S](T),M=O.value}catch($){y($);return}O.done?p(M):Promise.resolve(M).then(w,x)}function r(d){return function(){var p=this,y=arguments;return new Promise(function(w,x){var S=d.apply(p,y);function T(M){e(S,w,x,T,O,"next",M)}function O(M){e(S,w,x,T,O,"throw",M)}T(void 0)})}}const o=q(),t=K(),s=A(),c=s.erase,i=s.cursor,b=B(),l=b.style,a=b.clear,n=b.figures,m=b.wrap,f=b.entriesToDisplay,h=(d,p)=>d[p]&&(d[p].value||d[p].title||d[p]),u=(d,p)=>d[p]&&(d[p].title||d[p].value||d[p]),v=(d,p)=>{const y=d.findIndex(w=>w.value===p||w.title===p);return y>-1?y:void 0};class g extends t{constructor(p={}){super(p),this.msg=p.message,this.suggest=p.suggest,this.choices=p.choices,this.initial=typeof p.initial=="number"?p.initial:v(p.choices,p.initial),this.select=this.initial||p.cursor||0,this.i18n={noMatches:p.noMatches||"no matches found"},this.fallback=p.fallback||this.initial,this.clearFirst=p.clearFirst||!1,this.suggestions=[],this.input="",this.limit=p.limit||10,this.cursor=0,this.transform=l.render(p.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=a("",this.out.columns),this.complete(this.render),this.render()}set fallback(p){this._fb=Number.isSafeInteger(parseInt(p))?parseInt(p):p}get fallback(){let p;return typeof this._fb=="number"?p=this.choices[this._fb]:typeof this._fb=="string"&&(p={title:this._fb}),p||this._fb||{title:this.i18n.noMatches}}moveSelect(p){this.select=p,this.suggestions.length>0?this.value=h(this.suggestions,p):this.value=this.fallback.value,this.fire()}complete(p){var y=this;return r(function*(){const w=y.completing=y.suggest(y.input,y.choices),x=yield w;if(y.completing!==w)return;y.suggestions=x.map((T,O,M)=>({title:u(M,O),value:h(M,O),description:T.description})),y.completing=!1;const S=Math.max(x.length-1,0);y.moveSelect(Math.min(S,y.select)),p&&p()})()}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(`
34
34
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
35
35
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
36
- `),this.close()}_(p,y){let w=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${w}${p}${x}`,this.cursor=w.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let p=this.input.slice(0,this.cursor-1),y=this.input.slice(this.cursor);this.input=`${p}${y}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let p=this.input.slice(0,this.cursor),y=this.input.slice(this.cursor+1);this.input=`${p}${y}`,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(p,y,w,x){let $,T=w?n.arrowUp:x?n.arrowDown:" ",O=y?o.cyan().underline(p.title):p.title;return T=(y?o.cyan(n.pointer)+" ":" ")+T,p.description&&($=` - ${p.description}`,(T.length+O.length+$.length>=this.out.columns||p.description.split(/\r?\n/).length>1)&&($=`
37
- `+m(p.description,{margin:3,width:this.out.columns}))),T+" "+O+o.gray($||"")}render(){if(this.closed)return;this.firstRender?this.out.write(i.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let p=f(this.select,this.choices.length,this.limit),y=p.startIndex,w=p.endIndex;if(this.outputText=[l.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),l.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 x=this.suggestions.slice(y,w).map(($,T)=>this.renderOption($,this.select===T+y,T===0&&y>0,T+y===w-1&&w<this.choices.length)).join(`
36
+ `),this.close()}_(p,y){let w=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${w}${p}${x}`,this.cursor=w.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let p=this.input.slice(0,this.cursor-1),y=this.input.slice(this.cursor);this.input=`${p}${y}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let p=this.input.slice(0,this.cursor),y=this.input.slice(this.cursor+1);this.input=`${p}${y}`,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(p,y,w,x){let S,T=w?n.arrowUp:x?n.arrowDown:" ",O=y?o.cyan().underline(p.title):p.title;return T=(y?o.cyan(n.pointer)+" ":" ")+T,p.description&&(S=` - ${p.description}`,(T.length+O.length+S.length>=this.out.columns||p.description.split(/\r?\n/).length>1)&&(S=`
37
+ `+m(p.description,{margin:3,width:this.out.columns}))),T+" "+O+o.gray(S||"")}render(){if(this.closed)return;this.firstRender?this.out.write(i.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let p=f(this.select,this.choices.length,this.limit),y=p.startIndex,w=p.endIndex;if(this.outputText=[l.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),l.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 x=this.suggestions.slice(y,w).map((S,T)=>this.renderOption(S,this.select===T+y,T===0&&y>0,T+y===w-1&&w<this.choices.length)).join(`
38
38
  `);this.outputText+=`
39
- `+(x||o.gray(this.fallback.title))}this.out.write(c.line+i.to(0)+this.outputText)}}return Fe=g,Fe}var Ne,cr;function Yi(){if(cr)return Ne;cr=1;const e=q(),r=A(),o=r.cursor,t=ur(),s=k(),c=s.clear,i=s.style,b=s.figures;class l extends t{constructor(n={}){n.overrideRender=!0,super(n),this.inputValue="",this.clear=c("",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(n=>n.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 n=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(f=>this.inputValue?!!(typeof f.title=="string"&&f.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof f.value=="string"&&f.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const m=this.filteredOptions.findIndex(f=>f===n);this.cursor=m<0?0:m,this.render()}handleSpaceToggle(){const n=this.filteredOptions[this.cursor];if(n.selected)n.selected=!1,this.render();else{if(n.disabled||this.value.filter(m=>m.selected).length>=this.maxChoices)return this.bell();n.selected=!0,this.render()}}handleInputChange(n){this.inputValue=this.inputValue+n,this.updateFilteredOptions()}_(n,m){n===" "?this.handleSpaceToggle():this.handleInputChange(n)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
39
+ `+(x||o.gray(this.fallback.title))}this.out.write(c.line+i.to(0)+this.outputText)}}return Fe=g,Fe}var Ne,cr;function Li(){if(cr)return Ne;cr=1;const e=q(),r=A(),o=r.cursor,t=ur(),s=B(),c=s.clear,i=s.style,b=s.figures;class l extends t{constructor(n={}){n.overrideRender=!0,super(n),this.inputValue="",this.clear=c("",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(n=>n.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 n=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(f=>this.inputValue?!!(typeof f.title=="string"&&f.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof f.value=="string"&&f.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const m=this.filteredOptions.findIndex(f=>f===n);this.cursor=m<0?0:m,this.render()}handleSpaceToggle(){const n=this.filteredOptions[this.cursor];if(n.selected)n.selected=!1,this.render();else{if(n.disabled||this.value.filter(m=>m.selected).length>=this.maxChoices)return this.bell();n.selected=!0,this.render()}}handleInputChange(n){this.inputValue=this.inputValue+n,this.updateFilteredOptions()}_(n,m){n===" "?this.handleSpaceToggle():this.handleInputChange(n)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
40
40
  Instructions:
41
41
  ${b.arrowUp}/${b.arrowDown}: Highlight option
42
42
  ${b.arrowLeft}/${b.arrowRight}/[space]: Toggle selection
@@ -44,31 +44,31 @@ Instructions:
44
44
  enter/return: Complete answer
45
45
  `:""}renderCurrentInput(){return`
46
46
  Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
47
- `}renderOption(n,m,f){let h;return m.disabled?h=n===f?e.gray().underline(m.title):e.strikethrough().gray(m.title):h=n===f?e.cyan().underline(m.title):m.title,(m.selected?e.green(b.radioOn):b.radioOff)+" "+h}renderDoneOrInstructions(){if(this.done)return this.value.filter(m=>m.selected).map(m=>m.title).join(", ");const n=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&n.push(e.yellow(this.warn)),n.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let n=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+n),this.clear=c(n,this.out.columns)}}return Ne=l,Ne}var Le,dr;function ki(){if(dr)return Le;dr=1;const e=q(),r=W(),o=k(),t=o.style,s=o.clear,c=A(),i=c.erase,b=c.cursor;class l extends r{constructor(n={}){super(n),this.msg=n.message,this.value=n.initial,this.initialValue=!!n.initial,this.yesMsg=n.yes||"yes",this.yesOption=n.yesOption||"(Y/n)",this.noMsg=n.no||"no",this.noOption=n.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(`
47
+ `}renderOption(n,m,f){let h;return m.disabled?h=n===f?e.gray().underline(m.title):e.strikethrough().gray(m.title):h=n===f?e.cyan().underline(m.title):m.title,(m.selected?e.green(b.radioOn):b.radioOff)+" "+h}renderDoneOrInstructions(){if(this.done)return this.value.filter(m=>m.selected).map(m=>m.title).join(", ");const n=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&n.push(e.yellow(this.warn)),n.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let n=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+n),this.clear=c(n,this.out.columns)}}return Ne=l,Ne}var ke,dr;function Yi(){if(dr)return ke;dr=1;const e=q(),r=K(),o=B(),t=o.style,s=o.clear,c=A(),i=c.erase,b=c.cursor;class l extends r{constructor(n={}){super(n),this.msg=n.message,this.value=n.initial,this.initialValue=!!n.initial,this.yesMsg=n.yes||"yes",this.yesOption=n.yesOption||"(Y/n)",this.noMsg=n.no||"no",this.noOption=n.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(`
48
48
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
49
- `),this.close()}_(n,m){return n.toLowerCase()==="y"?(this.value=!0,this.submit()):n.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(b.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+b.to(0)+this.outputText))}}return Le=l,Le}var Ye,fr;function Bi(){return fr||(fr=1,Ye={TextPrompt:Mi(),SelectPrompt:Oi(),TogglePrompt:Ri(),DatePrompt:Fi(),NumberPrompt:Ni(),MultiselectPrompt:ur(),AutocompletePrompt:Li(),AutocompleteMultiselectPrompt:Yi(),ConfirmPrompt:ki()}),Ye}var pr;function Vi(){return pr||(pr=1,function(e){const r=e,o=Bi(),t=i=>i;function s(i,b,l={}){return new Promise((a,n)=>{const m=new o[i](b),f=l.onAbort||t,h=l.onSubmit||t,u=l.onExit||t;m.on("state",b.onState||t),m.on("submit",v=>a(h(v))),m.on("exit",v=>a(u(v))),m.on("abort",v=>n(f(v)))})}r.text=i=>s("TextPrompt",i),r.password=i=>(i.style="password",r.text(i)),r.invisible=i=>(i.style="invisible",r.text(i)),r.number=i=>s("NumberPrompt",i),r.date=i=>s("DatePrompt",i),r.confirm=i=>s("ConfirmPrompt",i),r.list=i=>{const b=i.separator||",";return s("TextPrompt",i,{onSubmit:l=>l.split(b).map(a=>a.trim())})},r.toggle=i=>s("TogglePrompt",i),r.select=i=>s("SelectPrompt",i),r.multiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("MultiselectPrompt",i,{onAbort:b,onSubmit:b})},r.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("AutocompleteMultiselectPrompt",i,{onAbort:b,onSubmit:b})};const c=(i,b)=>Promise.resolve(b.filter(l=>l.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));r.autocomplete=i=>(i.suggest=i.suggest||c,i.choices=[].concat(i.choices||[]),s("AutocompletePrompt",i))}(le)),le}var ke,mr;function Hi(){if(mr)return ke;mr=1;function e(g,d){var p=Object.keys(g);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(g);d&&(y=y.filter(function(w){return Object.getOwnPropertyDescriptor(g,w).enumerable})),p.push.apply(p,y)}return p}function r(g){for(var d=1;d<arguments.length;d++){var p=arguments[d]!=null?arguments[d]:{};d%2?e(Object(p),!0).forEach(function(y){o(g,y,p[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(p)):e(Object(p)).forEach(function(y){Object.defineProperty(g,y,Object.getOwnPropertyDescriptor(p,y))})}return g}function o(g,d,p){return d in g?Object.defineProperty(g,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):g[d]=p,g}function t(g,d){var p=typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(!p){if(Array.isArray(g)||(p=s(g))||d){p&&(g=p);var y=0,w=function(){};return{s:w,n:function(){return y>=g.length?{done:!0}:{done:!1,value:g[y++]}},e:function(M){throw M},f:w}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,$=!1,T;return{s:function(){p=p.call(g)},n:function(){var M=p.next();return x=M.done,M},e:function(M){$=!0,T=M},f:function(){try{!x&&p.return!=null&&p.return()}finally{if($)throw T}}}}function s(g,d){if(g){if(typeof g=="string")return c(g,d);var p=Object.prototype.toString.call(g).slice(8,-1);if(p==="Object"&&g.constructor&&(p=g.constructor.name),p==="Map"||p==="Set")return Array.from(g);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return c(g,d)}}function c(g,d){(d==null||d>g.length)&&(d=g.length);for(var p=0,y=new Array(d);p<d;p++)y[p]=g[p];return y}function i(g,d,p,y,w,x,$){try{var T=g[x]($),O=T.value}catch(M){p(M);return}T.done?d(O):Promise.resolve(O).then(y,w)}function b(g){return function(){var d=this,p=arguments;return new Promise(function(y,w){var x=g.apply(d,p);function $(O){i(x,y,w,$,T,"next",O)}function T(O){i(x,y,w,$,T,"throw",O)}$(void 0)})}}const l=Vi(),a=["suggest","format","onState","validate","onRender","type"],n=()=>{};function m(){return f.apply(this,arguments)}function f(){return f=b(function*(g=[],{onSubmit:d=n,onCancel:p=n}={}){const y={},w=m._override||{};g=[].concat(g);let x,$,T,O,M,S;const R=function(){var N=b(function*(F,X,Rt=!1){if(!(!Rt&&F.validate&&F.validate(X)!==!0))return F.format?yield F.format(X,y):X});return function(X,Rt){return N.apply(this,arguments)}}();var D=t(g),C;try{for(D.s();!(C=D.n()).done;){$=C.value;var j=$;if(O=j.name,M=j.type,typeof M=="function"&&(M=yield M(x,r({},y),$),$.type=M),!!M){for(let N in $){if(a.includes(N))continue;let F=$[N];$[N]=typeof F=="function"?yield F(x,r({},y),S):F}if(S=$,typeof $.message!="string")throw new Error("prompt message is required");var Y=$;if(O=Y.name,M=Y.type,l[M]===void 0)throw new Error(`prompt type (${M}) is not defined`);if(w[$.name]!==void 0&&(x=yield R($,w[$.name]),x!==void 0)){y[O]=x;continue}try{x=m._injected?h(m._injected,$.initial):yield l[M]($),y[O]=x=yield R($,x,!0),T=yield d($,x,y)}catch{T=!(yield p($,y))}if(T)return y}}}catch(N){D.e(N)}finally{D.f()}return y}),f.apply(this,arguments)}function h(g,d){const p=g.shift();if(p instanceof Error)throw p;return p===void 0?d:p}function u(g){m._injected=(m._injected||[]).concat(g)}function v(g){m._override=Object.assign({},g)}return ke=Object.assign(m,{prompt:m,prompts:l,inject:u,override:v}),ke}var Be={},Ve,gr;function Ui(){return gr||(gr=1,Ve=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),Ve}var He,vr;function Ue(){return vr||(vr=1,He=e=>{const r=["[\\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("|"),o=new RegExp(r,"g");return typeof e=="string"?e.replace(o,""):e}),He}var Ge,br;function Gi(){if(br)return Ge;br=1;const e=Ue(),{erase:r,cursor:o}=A(),t=s=>[...e(s)].length;return Ge=function(s,c){if(!c)return r.line+o.to(0);let i=0;const b=s.split(/\r?\n/);for(let l of b)i+=1+Math.floor(Math.max(t(l)-1,0)/c);return r.lines(i)},Ge}var Je,yr;function wr(){if(yr)return Je;yr=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Je=process.platform==="win32"?r:e,Je}var We,xr;function Ji(){if(xr)return We;xr=1;const e=q(),r=wr(),o=Object.freeze({password:{scale:1,render:l=>"*".repeat(l.length)},emoji:{scale:2,render:l=>"\u{1F603}".repeat(l.length)},invisible:{scale:0,render:l=>""},default:{scale:1,render:l=>`${l}`}}),t=l=>o[l]||o.default,s=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return We={styles:o,render:t,symbols:s,symbol:(l,a,n)=>a?s.aborted:n?s.exited:l?s.done:s.default,delimiter:l=>e.gray(l?r.ellipsis:r.pointerSmall),item:(l,a)=>e.gray(l?a?r.pointerSmall:"+":r.line)},We}var ze,Sr;function Wi(){if(Sr)return ze;Sr=1;const e=Ue();return ze=function(r,o){let t=String(e(r)||"").split(/\r?\n/);return o?t.map(s=>Math.ceil(s.length/o)).reduce((s,c)=>s+c):t.length},ze}var Ke,$r;function zi(){return $r||($r=1,Ke=(e,r={})=>{const o=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((c,i)=>(i.length+o.length>=t||c[c.length-1].length+i.length+1<t?c[c.length-1]+=` ${i}`:c.push(`${o}${i}`),c),[o]).join(`
49
+ `),this.close()}_(n,m){return n.toLowerCase()==="y"?(this.value=!0,this.submit()):n.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(b.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+b.to(0)+this.outputText))}}return ke=l,ke}var Le,fr;function Bi(){return fr||(fr=1,Le={TextPrompt:Mi(),SelectPrompt:Oi(),TogglePrompt:Ri(),DatePrompt:Fi(),NumberPrompt:Ni(),MultiselectPrompt:ur(),AutocompletePrompt:ki(),AutocompleteMultiselectPrompt:Li(),ConfirmPrompt:Yi()}),Le}var pr;function Vi(){return pr||(pr=1,function(e){const r=e,o=Bi(),t=i=>i;function s(i,b,l={}){return new Promise((a,n)=>{const m=new o[i](b),f=l.onAbort||t,h=l.onSubmit||t,u=l.onExit||t;m.on("state",b.onState||t),m.on("submit",v=>a(h(v))),m.on("exit",v=>a(u(v))),m.on("abort",v=>n(f(v)))})}r.text=i=>s("TextPrompt",i),r.password=i=>(i.style="password",r.text(i)),r.invisible=i=>(i.style="invisible",r.text(i)),r.number=i=>s("NumberPrompt",i),r.date=i=>s("DatePrompt",i),r.confirm=i=>s("ConfirmPrompt",i),r.list=i=>{const b=i.separator||",";return s("TextPrompt",i,{onSubmit:l=>l.split(b).map(a=>a.trim())})},r.toggle=i=>s("TogglePrompt",i),r.select=i=>s("SelectPrompt",i),r.multiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("MultiselectPrompt",i,{onAbort:b,onSubmit:b})},r.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("AutocompleteMultiselectPrompt",i,{onAbort:b,onSubmit:b})};const c=(i,b)=>Promise.resolve(b.filter(l=>l.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));r.autocomplete=i=>(i.suggest=i.suggest||c,i.choices=[].concat(i.choices||[]),s("AutocompletePrompt",i))}(le)),le}var Ye,mr;function Hi(){if(mr)return Ye;mr=1;function e(g,d){var p=Object.keys(g);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(g);d&&(y=y.filter(function(w){return Object.getOwnPropertyDescriptor(g,w).enumerable})),p.push.apply(p,y)}return p}function r(g){for(var d=1;d<arguments.length;d++){var p=arguments[d]!=null?arguments[d]:{};d%2?e(Object(p),!0).forEach(function(y){o(g,y,p[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(p)):e(Object(p)).forEach(function(y){Object.defineProperty(g,y,Object.getOwnPropertyDescriptor(p,y))})}return g}function o(g,d,p){return d in g?Object.defineProperty(g,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):g[d]=p,g}function t(g,d){var p=typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(!p){if(Array.isArray(g)||(p=s(g))||d){p&&(g=p);var y=0,w=function(){};return{s:w,n:function(){return y>=g.length?{done:!0}:{done:!1,value:g[y++]}},e:function(M){throw M},f:w}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,S=!1,T;return{s:function(){p=p.call(g)},n:function(){var M=p.next();return x=M.done,M},e:function(M){S=!0,T=M},f:function(){try{!x&&p.return!=null&&p.return()}finally{if(S)throw T}}}}function s(g,d){if(g){if(typeof g=="string")return c(g,d);var p=Object.prototype.toString.call(g).slice(8,-1);if(p==="Object"&&g.constructor&&(p=g.constructor.name),p==="Map"||p==="Set")return Array.from(g);if(p==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p))return c(g,d)}}function c(g,d){(d==null||d>g.length)&&(d=g.length);for(var p=0,y=new Array(d);p<d;p++)y[p]=g[p];return y}function i(g,d,p,y,w,x,S){try{var T=g[x](S),O=T.value}catch(M){p(M);return}T.done?d(O):Promise.resolve(O).then(y,w)}function b(g){return function(){var d=this,p=arguments;return new Promise(function(y,w){var x=g.apply(d,p);function S(O){i(x,y,w,S,T,"next",O)}function T(O){i(x,y,w,S,T,"throw",O)}S(void 0)})}}const l=Vi(),a=["suggest","format","onState","validate","onRender","type"],n=()=>{};function m(){return f.apply(this,arguments)}function f(){return f=b(function*(g=[],{onSubmit:d=n,onCancel:p=n}={}){const y={},w=m._override||{};g=[].concat(g);let x,S,T,O,M,$;const R=function(){var N=b(function*(F,X,Rt=!1){if(!(!Rt&&F.validate&&F.validate(X)!==!0))return F.format?yield F.format(X,y):X});return function(X,Rt){return N.apply(this,arguments)}}();var D=t(g),C;try{for(D.s();!(C=D.n()).done;){S=C.value;var j=S;if(O=j.name,M=j.type,typeof M=="function"&&(M=yield M(x,r({},y),S),S.type=M),!!M){for(let N in S){if(a.includes(N))continue;let F=S[N];S[N]=typeof F=="function"?yield F(x,r({},y),$):F}if($=S,typeof S.message!="string")throw new Error("prompt message is required");var Y=S;if(O=Y.name,M=Y.type,l[M]===void 0)throw new Error(`prompt type (${M}) is not defined`);if(w[S.name]!==void 0&&(x=yield R(S,w[S.name]),x!==void 0)){y[O]=x;continue}try{x=m._injected?h(m._injected,S.initial):yield l[M](S),y[O]=x=yield R(S,x,!0),T=yield d(S,x,y)}catch{T=!(yield p(S,y))}if(T)return y}}}catch(N){D.e(N)}finally{D.f()}return y}),f.apply(this,arguments)}function h(g,d){const p=g.shift();if(p instanceof Error)throw p;return p===void 0?d:p}function u(g){m._injected=(m._injected||[]).concat(g)}function v(g){m._override=Object.assign({},g)}return Ye=Object.assign(m,{prompt:m,prompts:l,inject:u,override:v}),Ye}var Be={},Ve,gr;function Ui(){return gr||(gr=1,Ve=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),Ve}var He,vr;function Ue(){return vr||(vr=1,He=e=>{const r=["[\\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("|"),o=new RegExp(r,"g");return typeof e=="string"?e.replace(o,""):e}),He}var Ge,br;function Gi(){if(br)return Ge;br=1;const e=Ue(),{erase:r,cursor:o}=A(),t=s=>[...e(s)].length;return Ge=function(s,c){if(!c)return r.line+o.to(0);let i=0;const b=s.split(/\r?\n/);for(let l of b)i+=1+Math.floor(Math.max(t(l)-1,0)/c);return r.lines(i)},Ge}var Je,yr;function wr(){if(yr)return Je;yr=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Je=process.platform==="win32"?r:e,Je}var We,xr;function Ji(){if(xr)return We;xr=1;const e=q(),r=wr(),o=Object.freeze({password:{scale:1,render:l=>"*".repeat(l.length)},emoji:{scale:2,render:l=>"\u{1F603}".repeat(l.length)},invisible:{scale:0,render:l=>""},default:{scale:1,render:l=>`${l}`}}),t=l=>o[l]||o.default,s=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return We={styles:o,render:t,symbols:s,symbol:(l,a,n)=>a?s.aborted:n?s.exited:l?s.done:s.default,delimiter:l=>e.gray(l?r.ellipsis:r.pointerSmall),item:(l,a)=>e.gray(l?a?r.pointerSmall:"+":r.line)},We}var ze,$r;function Wi(){if($r)return ze;$r=1;const e=Ue();return ze=function(r,o){let t=String(e(r)||"").split(/\r?\n/);return o?t.map(s=>Math.ceil(s.length/o)).reduce((s,c)=>s+c):t.length},ze}var Ke,Sr;function zi(){return Sr||(Sr=1,Ke=(e,r={})=>{const o=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((c,i)=>(i.length+o.length>=t||c[c.length-1].length+i.length+1<t?c[c.length-1]+=` ${i}`:c.push(`${o}${i}`),c),[o]).join(`
51
51
  `)).join(`
52
- `)}),Ke}var Ze,Tr;function Ki(){return Tr||(Tr=1,Ze=(e,r,o)=>{o=o||r;let t=Math.min(r-o,e-Math.floor(o/2));t<0&&(t=0);let s=Math.min(t+o,r);return{startIndex:t,endIndex:s}}),Ze}var Xe,Mr;function B(){return Mr||(Mr=1,Xe={action:Ui(),clear:Gi(),style:Ji(),strip:Ue(),figures:wr(),lines:Wi(),wrap:zi(),entriesToDisplay:Ki()}),Xe}var Qe,Or;function z(){if(Or)return Qe;Or=1;const e=Pt,{action:r}=B(),o=Ct,{beep:t,cursor:s}=A(),c=q();class i extends o{constructor(l={}){super(),this.firstRender=!0,this.in=l.stdin||process.stdin,this.out=l.stdout||process.stdout,this.onRender=(l.onRender||(()=>{})).bind(this);const a=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,a),this.in.isTTY&&this.in.setRawMode(!0);const n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,m=(f,h)=>{let u=r(h,n);u===!1?this._&&this._(f,h):typeof this[u]=="function"?this[u](h):this.bell()};this.close=()=>{this.out.write(s.show),this.in.removeListener("keypress",m),this.in.isTTY&&this.in.setRawMode(!1),a.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",m)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(t)}render(){this.onRender(c),this.firstRender&&(this.firstRender=!1)}}return Qe=i,Qe}var et,Rr;function Zi(){if(Rr)return et;Rr=1;const e=q(),r=z(),{erase:o,cursor:t}=A(),{style:s,clear:c,lines:i,figures:b}=B();class l extends r{constructor(n={}){super(n),this.transform=s.render(n.style),this.scale=this.transform.scale,this.msg=n.message,this.initial=n.initial||"",this.validator=n.validate||(()=>!0),this.value="",this.errorMsg=n.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=c("",this.out.columns),this.render()}set value(n){!n&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(n)),this._value=n,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(`
52
+ `)}),Ke}var Ze,Tr;function Ki(){return Tr||(Tr=1,Ze=(e,r,o)=>{o=o||r;let t=Math.min(r-o,e-Math.floor(o/2));t<0&&(t=0);let s=Math.min(t+o,r);return{startIndex:t,endIndex:s}}),Ze}var Xe,Mr;function V(){return Mr||(Mr=1,Xe={action:Ui(),clear:Gi(),style:Ji(),strip:Ue(),figures:wr(),lines:Wi(),wrap:zi(),entriesToDisplay:Ki()}),Xe}var Qe,Or;function Z(){if(Or)return Qe;Or=1;const e=Pt,{action:r}=V(),o=Ct,{beep:t,cursor:s}=A(),c=q();class i extends o{constructor(l={}){super(),this.firstRender=!0,this.in=l.stdin||process.stdin,this.out=l.stdout||process.stdout,this.onRender=(l.onRender||(()=>{})).bind(this);const a=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,a),this.in.isTTY&&this.in.setRawMode(!0);const n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,m=(f,h)=>{let u=r(h,n);u===!1?this._&&this._(f,h):typeof this[u]=="function"?this[u](h):this.bell()};this.close=()=>{this.out.write(s.show),this.in.removeListener("keypress",m),this.in.isTTY&&this.in.setRawMode(!1),a.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",m)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(t)}render(){this.onRender(c),this.firstRender&&(this.firstRender=!1)}}return Qe=i,Qe}var et,Rr;function Zi(){if(Rr)return et;Rr=1;const e=q(),r=Z(),{erase:o,cursor:t}=A(),{style:s,clear:c,lines:i,figures:b}=V();class l extends r{constructor(n={}){super(n),this.transform=s.render(n.style),this.scale=this.transform.scale,this.msg=n.message,this.initial=n.initial||"",this.validator=n.validate||(()=>!0),this.value="",this.errorMsg=n.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=c("",this.out.columns),this.render()}set value(n){!n&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(n)),this._value=n,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(`
53
53
  `),this.close()}async validate(){let n=await this.validator(this.value);typeof n=="string"&&(this.errorMsg=n,n=!1),this.error=!n}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(`
54
54
  `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(n){this.placeholder||(this.cursor=this.cursor+n,this.cursorOffset+=n)}_(n,m){let f=this.value.slice(0,this.cursor),h=this.value.slice(this.cursor);this.value=`${f}${n}${h}`,this.red=!1,this.cursor=this.placeholder?0:f.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let n=this.value.slice(0,this.cursor-1),m=this.value.slice(this.cursor);this.value=`${n}${m}`,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 n=this.value.slice(0,this.cursor),m=this.value.slice(this.cursor+1);this.value=`${n}${m}`,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(t.down(i(this.outputError,this.out.columns)-1)+c(this.outputError,this.out.columns)),this.out.write(c(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
55
55
  `).reduce((n,m,f)=>n+`
56
- ${f?" ":b.pointerSmall} ${e.red().italic(m)}`,"")),this.out.write(o.line+t.to(0)+this.outputText+t.save+this.outputError+t.restore+t.move(this.cursorOffset,0)))}}return et=l,et}var tt,Pr;function Xi(){if(Pr)return tt;Pr=1;const e=q(),r=z(),{style:o,clear:t,figures:s,wrap:c,entriesToDisplay:i}=B(),{cursor:b}=A();class l extends r{constructor(n={}){super(n),this.msg=n.message,this.hint=n.hint||"- Use arrow-keys. Return to submit.",this.warn=n.warn||"- This option is disabled",this.cursor=n.initial||0,this.choices=n.choices.map((m,f)=>(typeof m=="string"&&(m={title:m,value:f}),{title:m&&(m.title||m.value||m),value:m&&(m.value===void 0?f:m.value),description:m&&m.description,selected:m&&m.selected,disabled:m&&m.disabled})),this.optionsPerPage=n.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=t("",this.out.columns),this.render()}moveCursor(n){this.cursor=n,this.value=this.choices[n].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(`
56
+ ${f?" ":b.pointerSmall} ${e.red().italic(m)}`,"")),this.out.write(o.line+t.to(0)+this.outputText+t.save+this.outputError+t.restore+t.move(this.cursorOffset,0)))}}return et=l,et}var tt,Pr;function Xi(){if(Pr)return tt;Pr=1;const e=q(),r=Z(),{style:o,clear:t,figures:s,wrap:c,entriesToDisplay:i}=V(),{cursor:b}=A();class l extends r{constructor(n={}){super(n),this.msg=n.message,this.hint=n.hint||"- Use arrow-keys. Return to submit.",this.warn=n.warn||"- This option is disabled",this.cursor=n.initial||0,this.choices=n.choices.map((m,f)=>(typeof m=="string"&&(m={title:m,value:f}),{title:m&&(m.title||m.value||m),value:m&&(m.value===void 0?f:m.value),description:m&&m.description,selected:m&&m.selected,disabled:m&&m.disabled})),this.optionsPerPage=n.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=t("",this.out.columns),this.render()}moveCursor(n){this.cursor=n,this.value=this.choices[n].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(`
57
57
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
58
58
  `),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()}_(n,m){if(n===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(b.hide):this.out.write(t(this.outputText,this.out.columns)),super.render();let{startIndex:n,endIndex:m}=i(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
59
  `;for(let f=n;f<m;f++){let h,u,v="",g=this.choices[f];f===n&&n>0?u=s.arrowUp:f===m-1&&m<this.choices.length?u=s.arrowDown:u=" ",g.disabled?(h=this.cursor===f?e.gray().underline(g.title):e.strikethrough().gray(g.title),u=(this.cursor===f?e.bold().gray(s.pointer)+" ":" ")+u):(h=this.cursor===f?e.cyan().underline(g.title):g.title,u=(this.cursor===f?e.cyan(s.pointer)+" ":" ")+u,g.description&&this.cursor===f&&(v=` - ${g.description}`,(u.length+h.length+v.length>=this.out.columns||g.description.split(/\r?\n/).length>1)&&(v=`
60
60
  `+c(g.description,{margin:3,width:this.out.columns})))),this.outputText+=`${u} ${h}${e.gray(v)}
61
- `}}this.out.write(this.outputText)}}return tt=l,tt}var rt,Cr;function Qi(){if(Cr)return rt;Cr=1;const e=q(),r=z(),{style:o,clear:t}=B(),{cursor:s,erase:c}=A();class i extends r{constructor(l={}){super(l),this.msg=l.message,this.value=!!l.initial,this.active=l.active||"on",this.inactive=l.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(`
61
+ `}}this.out.write(this.outputText)}}return tt=l,tt}var rt,Cr;function Qi(){if(Cr)return rt;Cr=1;const e=q(),r=Z(),{style:o,clear:t}=V(),{cursor:s,erase:c}=A();class i extends r{constructor(l={}){super(l),this.msg=l.message,this.value=!!l.initial,this.active=l.active||"on",this.inactive=l.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(`
62
62
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
63
- `),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()}_(l,a){if(l===" ")this.value=!this.value;else if(l==="1")this.value=!0;else if(l==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(c.line+s.to(0)+this.outputText))}}return rt=i,rt}var it,Dr;function G(){if(Dr)return it;Dr=1;class e{constructor({token:o,date:t,parts:s,locales:c}){this.token=o,this.date=t||new Date,this.parts=s||[this],this.locales=c||{}}up(){}down(){}next(){const o=this.parts.indexOf(this);return this.parts.find((t,s)=>s>o&&t instanceof e)}setTo(o){}prev(){let o=[].concat(this.parts).reverse();const t=o.indexOf(this);return o.find((s,c)=>c>t&&s instanceof e)}toString(){return String(this.date)}}return it=e,it}var st,Er;function es(){if(Er)return st;Er=1;const e=G();class r extends e{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}}return st=r,st}var nt,_r;function ts(){if(_r)return nt;_r=1;const e=G(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class o extends e{constructor(s={}){super(s)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(s){this.date.setDate(parseInt(s.substr(-2)))}toString(){let s=this.date.getDate(),c=this.date.getDay();return this.token==="DD"?String(s).padStart(2,"0"):this.token==="Do"?s+r(s):this.token==="d"?c+1:this.token==="ddd"?this.locales.weekdaysShort[c]:this.token==="dddd"?this.locales.weekdays[c]:s}}return nt=o,nt}var ot,qr;function rs(){if(qr)return ot;qr=1;const e=G();class r extends e{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}}return ot=r,ot}var lt,Ar;function is(){if(Ar)return lt;Ar=1;const e=G();class r extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return lt=r,lt}var ht,Ir;function ss(){if(Ir)return ht;Ir=1;const e=G();class r extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return ht=r,ht}var ut,jr;function ns(){if(jr)return ut;jr=1;const e=G();class r extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),s=this.token.length;return s===2?String(t+1).padStart(2,"0"):s===3?this.locales.monthsShort[t]:s===4?this.locales.months[t]:String(t+1)}}return ut=r,ut}var at,Fr;function os(){if(Fr)return at;Fr=1;const e=G();class r extends e{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}}return at=r,at}var ct,Nr;function ls(){if(Nr)return ct;Nr=1;const e=G();class r extends e{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 this.token.length===2?t.substr(-2):t}}return ct=r,ct}var dt,Lr;function hs(){return Lr||(Lr=1,dt={DatePart:G(),Meridiem:es(),Day:ts(),Hours:rs(),Milliseconds:is(),Minutes:ss(),Month:ns(),Seconds:os(),Year:ls()}),dt}var ft,Yr;function us(){if(Yr)return ft;Yr=1;const e=q(),r=z(),{style:o,clear:t,figures:s}=B(),{erase:c,cursor:i}=A(),{DatePart:b,Meridiem:l,Day:a,Hours:n,Milliseconds:m,Minutes:f,Month:h,Seconds:u,Year:v}=hs(),g=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,d={1:({token:w})=>w.replace(/\\(.)/g,"$1"),2:w=>new a(w),3:w=>new h(w),4:w=>new v(w),5:w=>new l(w),6:w=>new n(w),7:w=>new f(w),8:w=>new u(w),9:w=>new m(w)},p={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 y extends r{constructor(x={}){super(x),this.msg=x.message,this.cursor=0,this.typed="",this.locales=Object.assign(p,x.locales),this._date=x.initial||new Date,this.errorMsg=x.error||"Please Enter A Valid Value",this.validator=x.validate||(()=>!0),this.mask=x.mask||"YYYY-MM-DD HH:mm:ss",this.clear=t("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(x){x&&this._date.setTime(x.getTime())}set mask(x){let $;for(this.parts=[];$=g.exec(x);){let O=$.shift(),M=$.findIndex(S=>S!=null);this.parts.push(M in d?d[M]({token:$[M]||O,date:this.date,parts:this.parts,locales:this.locales}):$[M]||O)}let T=this.parts.reduce((O,M)=>(typeof M=="string"&&typeof O[O.length-1]=="string"?O[O.length-1]+=M:O.push(M),O),[]);this.parts.splice(0),this.parts.push(...T),this.reset()}moveCursor(x){this.typed="",this.cursor=x,this.fire()}reset(){this.moveCursor(this.parts.findIndex(x=>x instanceof b)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
63
+ `),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()}_(l,a){if(l===" ")this.value=!this.value;else if(l==="1")this.value=!0;else if(l==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(c.line+s.to(0)+this.outputText))}}return rt=i,rt}var it,Dr;function G(){if(Dr)return it;Dr=1;class e{constructor({token:o,date:t,parts:s,locales:c}){this.token=o,this.date=t||new Date,this.parts=s||[this],this.locales=c||{}}up(){}down(){}next(){const o=this.parts.indexOf(this);return this.parts.find((t,s)=>s>o&&t instanceof e)}setTo(o){}prev(){let o=[].concat(this.parts).reverse();const t=o.indexOf(this);return o.find((s,c)=>c>t&&s instanceof e)}toString(){return String(this.date)}}return it=e,it}var st,Er;function es(){if(Er)return st;Er=1;const e=G();class r extends e{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}}return st=r,st}var nt,_r;function ts(){if(_r)return nt;_r=1;const e=G(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class o extends e{constructor(s={}){super(s)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(s){this.date.setDate(parseInt(s.substr(-2)))}toString(){let s=this.date.getDate(),c=this.date.getDay();return this.token==="DD"?String(s).padStart(2,"0"):this.token==="Do"?s+r(s):this.token==="d"?c+1:this.token==="ddd"?this.locales.weekdaysShort[c]:this.token==="dddd"?this.locales.weekdays[c]:s}}return nt=o,nt}var ot,qr;function rs(){if(qr)return ot;qr=1;const e=G();class r extends e{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}}return ot=r,ot}var lt,Ar;function is(){if(Ar)return lt;Ar=1;const e=G();class r extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return lt=r,lt}var ht,Ir;function ss(){if(Ir)return ht;Ir=1;const e=G();class r extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return ht=r,ht}var ut,jr;function ns(){if(jr)return ut;jr=1;const e=G();class r extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),s=this.token.length;return s===2?String(t+1).padStart(2,"0"):s===3?this.locales.monthsShort[t]:s===4?this.locales.months[t]:String(t+1)}}return ut=r,ut}var at,Fr;function os(){if(Fr)return at;Fr=1;const e=G();class r extends e{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}}return at=r,at}var ct,Nr;function ls(){if(Nr)return ct;Nr=1;const e=G();class r extends e{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 this.token.length===2?t.substr(-2):t}}return ct=r,ct}var dt,kr;function hs(){return kr||(kr=1,dt={DatePart:G(),Meridiem:es(),Day:ts(),Hours:rs(),Milliseconds:is(),Minutes:ss(),Month:ns(),Seconds:os(),Year:ls()}),dt}var ft,Lr;function us(){if(Lr)return ft;Lr=1;const e=q(),r=Z(),{style:o,clear:t,figures:s}=V(),{erase:c,cursor:i}=A(),{DatePart:b,Meridiem:l,Day:a,Hours:n,Milliseconds:m,Minutes:f,Month:h,Seconds:u,Year:v}=hs(),g=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,d={1:({token:w})=>w.replace(/\\(.)/g,"$1"),2:w=>new a(w),3:w=>new h(w),4:w=>new v(w),5:w=>new l(w),6:w=>new n(w),7:w=>new f(w),8:w=>new u(w),9:w=>new m(w)},p={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 y extends r{constructor(x={}){super(x),this.msg=x.message,this.cursor=0,this.typed="",this.locales=Object.assign(p,x.locales),this._date=x.initial||new Date,this.errorMsg=x.error||"Please Enter A Valid Value",this.validator=x.validate||(()=>!0),this.mask=x.mask||"YYYY-MM-DD HH:mm:ss",this.clear=t("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(x){x&&this._date.setTime(x.getTime())}set mask(x){let S;for(this.parts=[];S=g.exec(x);){let O=S.shift(),M=S.findIndex($=>$!=null);this.parts.push(M in d?d[M]({token:S[M]||O,date:this.date,parts:this.parts,locales:this.locales}):S[M]||O)}let T=this.parts.reduce((O,M)=>(typeof M=="string"&&typeof O[O.length-1]=="string"?O[O.length-1]+=M:O.push(M),O),[]);this.parts.splice(0),this.parts.push(...T),this.reset()}moveCursor(x){this.typed="",this.cursor=x,this.fire()}reset(){this.moveCursor(this.parts.findIndex(x=>x instanceof b)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
64
64
  `),this.close()}async validate(){let x=await this.validator(this.value);typeof x=="string"&&(this.errorMsg=x,x=!1),this.error=!x}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(`
65
- `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let x=this.parts[this.cursor].prev();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}right(){let x=this.parts[this.cursor].next();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}next(){let x=this.parts[this.cursor].next();this.moveCursor(x?this.parts.indexOf(x):this.parts.findIndex($=>$ instanceof b)),this.render()}_(x){/\d/.test(x)&&(this.typed+=x,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.parts.reduce((x,$,T)=>x.concat(T===this.cursor&&!this.done?e.cyan().underline($.toString()):$),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
- `).reduce((x,$,T)=>x+`
67
- ${T?" ":s.pointerSmall} ${e.red().italic($)}`,"")),this.out.write(c.line+i.to(0)+this.outputText))}}return ft=y,ft}var pt,kr;function as(){if(kr)return pt;kr=1;const e=q(),r=z(),{cursor:o,erase:t}=A(),{style:s,figures:c,clear:i,lines:b}=B(),l=/[0-9]/,a=f=>f!==void 0,n=(f,h)=>{let u=Math.pow(10,h);return Math.round(f*u)/u};class m extends r{constructor(h={}){super(h),this.transform=s.render(h.style),this.msg=h.message,this.initial=a(h.initial)?h.initial:"",this.float=!!h.float,this.round=h.round||2,this.inc=h.increment||1,this.min=a(h.min)?h.min:-1/0,this.max=a(h.max)?h.max:1/0,this.errorMsg=h.error||"Please Enter A Valid Value",this.validator=h.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(h){!h&&h!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${n(h,this.round)}`),this._value=n(h,this.round)),this.fire()}get value(){return this._value}parse(h){return this.float?parseFloat(h):parseInt(h)}valid(h){return h==="-"||h==="."&&this.float||l.test(h)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let h=this.value;this.value=h!==""?h:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
65
+ `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let x=this.parts[this.cursor].prev();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}right(){let x=this.parts[this.cursor].next();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}next(){let x=this.parts[this.cursor].next();this.moveCursor(x?this.parts.indexOf(x):this.parts.findIndex(S=>S instanceof b)),this.render()}_(x){/\d/.test(x)&&(this.typed+=x,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.parts.reduce((x,S,T)=>x.concat(T===this.cursor&&!this.done?e.cyan().underline(S.toString()):S),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
+ `).reduce((x,S,T)=>x+`
67
+ ${T?" ":s.pointerSmall} ${e.red().italic(S)}`,"")),this.out.write(c.line+i.to(0)+this.outputText))}}return ft=y,ft}var pt,Yr;function as(){if(Yr)return pt;Yr=1;const e=q(),r=Z(),{cursor:o,erase:t}=A(),{style:s,figures:c,clear:i,lines:b}=V(),l=/[0-9]/,a=f=>f!==void 0,n=(f,h)=>{let u=Math.pow(10,h);return Math.round(f*u)/u};class m extends r{constructor(h={}){super(h),this.transform=s.render(h.style),this.msg=h.message,this.initial=a(h.initial)?h.initial:"",this.float=!!h.float,this.round=h.round||2,this.inc=h.increment||1,this.min=a(h.min)?h.min:-1/0,this.max=a(h.max)?h.max:1/0,this.errorMsg=h.error||"Please Enter A Valid Value",this.validator=h.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(h){!h&&h!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${n(h,this.round)}`),this._value=n(h,this.round)),this.fire()}get value(){return this._value}parse(h){return this.float?parseFloat(h):parseInt(h)}valid(h){return h==="-"||h==="."&&this.float||l.test(h)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let h=this.value;this.value=h!==""?h:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
68
68
  `),this.close()}async validate(){let h=await this.validator(this.value);typeof h=="string"&&(this.errorMsg=h,h=!1),this.error=!h}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let h=this.value;this.value=h!==""?h:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
69
69
  `),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 h=this.value.toString();if(h.length===0)return this.bell();this.value=this.parse(h=h.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()}_(h,u){if(!this.valid(h))return this.bell();const v=Date.now();if(v-this.lastHit>1e3&&(this.typed=""),this.typed+=h,this.lastHit=v,this.color="cyan",h===".")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(o.down(b(this.outputError,this.out.columns)-1)+i(this.outputError,this.out.columns)),this.out.write(i(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(this.done),!this.done||!this.done&&!this.placeholder?e[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
70
  `).reduce((h,u,v)=>h+`
71
- ${v?" ":c.pointerSmall} ${e.red().italic(u)}`,"")),this.out.write(t.line+o.to(0)+this.outputText+o.save+this.outputError+o.restore))}}return pt=m,pt}var mt,Br;function Vr(){if(Br)return mt;Br=1;const e=q(),{cursor:r}=A(),o=z(),{clear:t,figures:s,style:c,wrap:i,entriesToDisplay:b}=B();class l extends o{constructor(n={}){super(n),this.msg=n.message,this.cursor=n.cursor||0,this.scrollIndex=n.cursor||0,this.hint=n.hint||"",this.warn=n.warn||"- This option is disabled -",this.minSelected=n.min,this.showMinError=!1,this.maxChoices=n.max,this.instructions=n.instructions,this.optionsPerPage=n.optionsPerPage||10,this.value=n.choices.map((m,f)=>(typeof m=="string"&&(m={title:m,value:f}),{title:m&&(m.title||m.value||m),description:m&&m.description,value:m&&(m.value===void 0?f:m.value),selected:m&&m.selected,disabled:m&&m.disabled})),this.clear=t("",this.out.columns),n.overrideRender||this.render()}reset(){this.value.map(n=>!n.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(n=>n.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
71
+ ${v?" ":c.pointerSmall} ${e.red().italic(u)}`,"")),this.out.write(t.line+o.to(0)+this.outputText+o.save+this.outputError+o.restore))}}return pt=m,pt}var mt,Br;function Vr(){if(Br)return mt;Br=1;const e=q(),{cursor:r}=A(),o=Z(),{clear:t,figures:s,style:c,wrap:i,entriesToDisplay:b}=V();class l extends o{constructor(n={}){super(n),this.msg=n.message,this.cursor=n.cursor||0,this.scrollIndex=n.cursor||0,this.hint=n.hint||"",this.warn=n.warn||"- This option is disabled -",this.minSelected=n.min,this.showMinError=!1,this.maxChoices=n.max,this.instructions=n.instructions,this.optionsPerPage=n.optionsPerPage||10,this.value=n.choices.map((m,f)=>(typeof m=="string"&&(m={title:m,value:f}),{title:m&&(m.title||m.value||m),description:m&&m.description,value:m&&(m.value===void 0?f:m.value),selected:m&&m.selected,disabled:m&&m.disabled})),this.clear=t("",this.out.columns),n.overrideRender||this.render()}reset(){this.value.map(n=>!n.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(n=>n.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
72
  `),this.close()}submit(){const n=this.value.filter(m=>m.selected);this.minSelected&&n.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
73
  `),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(){this.cursor===0?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(n=>n.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const n=this.value[this.cursor];if(n.selected)n.selected=!1,this.render();else{if(n.disabled||this.value.filter(m=>m.selected).length>=this.maxChoices)return this.bell();n.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const n=!this.value[this.cursor].selected;this.value.filter(m=>!m.disabled).forEach(m=>m.selected=n),this.render()}_(n,m){if(n===" ")this.handleSpaceToggle();else if(n==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
74
74
  Instructions:
@@ -78,13 +78,13 @@ Instructions:
78
78
  `:"")+" enter/return: Complete answer":""}renderOption(n,m,f,h){const u=(m.selected?e.green(s.radioOn):s.radioOff)+" "+h+" ";let v,g;return m.disabled?v=n===f?e.gray().underline(m.title):e.strikethrough().gray(m.title):(v=n===f?e.cyan().underline(m.title):m.title,n===f&&m.description&&(g=` - ${m.description}`,(u.length+v.length+g.length>=this.out.columns||m.description.split(/\r?\n/).length>1)&&(g=`
79
79
  `+i(m.description,{margin:u.length,width:this.out.columns})))),u+v+e.gray(g||"")}paginateOptions(n){if(n.length===0)return e.red("No matches for this query.");let{startIndex:m,endIndex:f}=b(this.cursor,n.length,this.optionsPerPage),h,u=[];for(let v=m;v<f;v++)v===m&&m>0?h=s.arrowUp:v===f-1&&f<n.length?h=s.arrowDown:h=" ",u.push(this.renderOption(this.cursor,n[v],v,h));return`
80
80
  `+u.join(`
81
- `)}renderOptions(n){return this.done?"":this.paginateOptions(n)}renderDoneOrInstructions(){if(this.done)return this.value.filter(m=>m.selected).map(m=>m.title).join(", ");const n=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&n.push(e.yellow(this.warn)),n.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let n=[c.symbol(this.done,this.aborted),e.bold(this.msg),c.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.value),this.out.write(this.clear+n),this.clear=t(n,this.out.columns)}}return mt=l,mt}var gt,Hr;function cs(){if(Hr)return gt;Hr=1;const e=q(),r=z(),{erase:o,cursor:t}=A(),{style:s,clear:c,figures:i,wrap:b,entriesToDisplay:l}=B(),a=(h,u)=>h[u]&&(h[u].value||h[u].title||h[u]),n=(h,u)=>h[u]&&(h[u].title||h[u].value||h[u]),m=(h,u)=>{const v=h.findIndex(g=>g.value===u||g.title===u);return v>-1?v:void 0};class f extends r{constructor(u={}){super(u),this.msg=u.message,this.suggest=u.suggest,this.choices=u.choices,this.initial=typeof u.initial=="number"?u.initial:m(u.choices,u.initial),this.select=this.initial||u.cursor||0,this.i18n={noMatches:u.noMatches||"no matches found"},this.fallback=u.fallback||this.initial,this.clearFirst=u.clearFirst||!1,this.suggestions=[],this.input="",this.limit=u.limit||10,this.cursor=0,this.transform=s.render(u.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(u){this._fb=Number.isSafeInteger(parseInt(u))?parseInt(u):u}get fallback(){let u;return typeof this._fb=="number"?u=this.choices[this._fb]:typeof this._fb=="string"&&(u={title:this._fb}),u||this._fb||{title:this.i18n.noMatches}}moveSelect(u){this.select=u,this.suggestions.length>0?this.value=a(this.suggestions,u):this.value=this.fallback.value,this.fire()}async complete(u){const v=this.completing=this.suggest(this.input,this.choices),g=await v;if(this.completing!==v)return;this.suggestions=g.map((p,y,w)=>({title:n(w,y),value:a(w,y),description:p.description})),this.completing=!1;const d=Math.max(g.length-1,0);this.moveSelect(Math.min(d,this.select)),u&&u()}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(`
81
+ `)}renderOptions(n){return this.done?"":this.paginateOptions(n)}renderDoneOrInstructions(){if(this.done)return this.value.filter(m=>m.selected).map(m=>m.title).join(", ");const n=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&n.push(e.yellow(this.warn)),n.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let n=[c.symbol(this.done,this.aborted),e.bold(this.msg),c.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.value),this.out.write(this.clear+n),this.clear=t(n,this.out.columns)}}return mt=l,mt}var gt,Hr;function cs(){if(Hr)return gt;Hr=1;const e=q(),r=Z(),{erase:o,cursor:t}=A(),{style:s,clear:c,figures:i,wrap:b,entriesToDisplay:l}=V(),a=(h,u)=>h[u]&&(h[u].value||h[u].title||h[u]),n=(h,u)=>h[u]&&(h[u].title||h[u].value||h[u]),m=(h,u)=>{const v=h.findIndex(g=>g.value===u||g.title===u);return v>-1?v:void 0};class f extends r{constructor(u={}){super(u),this.msg=u.message,this.suggest=u.suggest,this.choices=u.choices,this.initial=typeof u.initial=="number"?u.initial:m(u.choices,u.initial),this.select=this.initial||u.cursor||0,this.i18n={noMatches:u.noMatches||"no matches found"},this.fallback=u.fallback||this.initial,this.clearFirst=u.clearFirst||!1,this.suggestions=[],this.input="",this.limit=u.limit||10,this.cursor=0,this.transform=s.render(u.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(u){this._fb=Number.isSafeInteger(parseInt(u))?parseInt(u):u}get fallback(){let u;return typeof this._fb=="number"?u=this.choices[this._fb]:typeof this._fb=="string"&&(u={title:this._fb}),u||this._fb||{title:this.i18n.noMatches}}moveSelect(u){this.select=u,this.suggestions.length>0?this.value=a(this.suggestions,u):this.value=this.fallback.value,this.fire()}async complete(u){const v=this.completing=this.suggest(this.input,this.choices),g=await v;if(this.completing!==v)return;this.suggestions=g.map((p,y,w)=>({title:n(w,y),value:a(w,y),description:p.description})),this.completing=!1;const d=Math.max(g.length-1,0);this.moveSelect(Math.min(d,this.select)),u&&u()}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(`
82
82
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
83
83
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
84
84
  `),this.close()}_(u,v){let g=this.input.slice(0,this.cursor),d=this.input.slice(this.cursor);this.input=`${g}${u}${d}`,this.cursor=g.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let u=this.input.slice(0,this.cursor-1),v=this.input.slice(this.cursor);this.input=`${u}${v}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let u=this.input.slice(0,this.cursor),v=this.input.slice(this.cursor+1);this.input=`${u}${v}`,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(u,v,g,d){let p,y=g?i.arrowUp:d?i.arrowDown:" ",w=v?e.cyan().underline(u.title):u.title;return y=(v?e.cyan(i.pointer)+" ":" ")+y,u.description&&(p=` - ${u.description}`,(y.length+w.length+p.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(p=`
85
85
  `+b(u.description,{margin:3,width:this.out.columns}))),y+" "+w+e.gray(p||"")}render(){if(this.closed)return;this.firstRender?this.out.write(t.hide):this.out.write(c(this.outputText,this.out.columns)),super.render();let{startIndex:u,endIndex:v}=l(this.select,this.choices.length,this.limit);if(this.outputText=[s.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),s.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 g=this.suggestions.slice(u,v).map((d,p)=>this.renderOption(d,this.select===p+u,p===0&&u>0,p+u===v-1&&v<this.choices.length)).join(`
86
86
  `);this.outputText+=`
87
- `+(g||e.gray(this.fallback.title))}this.out.write(o.line+t.to(0)+this.outputText)}}return gt=f,gt}var vt,Ur;function ds(){if(Ur)return vt;Ur=1;const e=q(),{cursor:r}=A(),o=Vr(),{clear:t,style:s,figures:c}=B();class i extends o{constructor(l={}){l.overrideRender=!0,super(l),this.inputValue="",this.clear=t("",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(l=>l.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 l=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const a=this.filteredOptions.findIndex(n=>n===l);this.cursor=a<0?0:a,this.render()}handleSpaceToggle(){const l=this.filteredOptions[this.cursor];if(l.selected)l.selected=!1,this.render();else{if(l.disabled||this.value.filter(a=>a.selected).length>=this.maxChoices)return this.bell();l.selected=!0,this.render()}}handleInputChange(l){this.inputValue=this.inputValue+l,this.updateFilteredOptions()}_(l,a){l===" "?this.handleSpaceToggle():this.handleInputChange(l)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
87
+ `+(g||e.gray(this.fallback.title))}this.out.write(o.line+t.to(0)+this.outputText)}}return gt=f,gt}var vt,Ur;function ds(){if(Ur)return vt;Ur=1;const e=q(),{cursor:r}=A(),o=Vr(),{clear:t,style:s,figures:c}=V();class i extends o{constructor(l={}){l.overrideRender=!0,super(l),this.inputValue="",this.clear=t("",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(l=>l.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 l=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const a=this.filteredOptions.findIndex(n=>n===l);this.cursor=a<0?0:a,this.render()}handleSpaceToggle(){const l=this.filteredOptions[this.cursor];if(l.selected)l.selected=!1,this.render();else{if(l.disabled||this.value.filter(a=>a.selected).length>=this.maxChoices)return this.bell();l.selected=!0,this.render()}}handleInputChange(l){this.inputValue=this.inputValue+l,this.updateFilteredOptions()}_(l,a){l===" "?this.handleSpaceToggle():this.handleInputChange(l)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
88
88
  Instructions:
89
89
  ${c.arrowUp}/${c.arrowDown}: Highlight option
90
90
  ${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection
@@ -92,13 +92,13 @@ Instructions:
92
92
  enter/return: Complete answer
93
93
  `:""}renderCurrentInput(){return`
94
94
  Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
95
- `}renderOption(l,a,n){let m;return a.disabled?m=l===n?e.gray().underline(a.title):e.strikethrough().gray(a.title):m=l===n?e.cyan().underline(a.title):a.title,(a.selected?e.green(c.radioOn):c.radioOff)+" "+m}renderDoneOrInstructions(){if(this.done)return this.value.filter(a=>a.selected).map(a=>a.title).join(", ");const l=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&l.push(e.yellow(this.warn)),l.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let l=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(l+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),l+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+l),this.clear=t(l,this.out.columns)}}return vt=i,vt}var bt,Gr;function fs(){if(Gr)return bt;Gr=1;const e=q(),r=z(),{style:o,clear:t}=B(),{erase:s,cursor:c}=A();class i extends r{constructor(l={}){super(l),this.msg=l.message,this.value=l.initial,this.initialValue=!!l.initial,this.yesMsg=l.yes||"yes",this.yesOption=l.yesOption||"(Y/n)",this.noMsg=l.no||"no",this.noOption=l.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(`
95
+ `}renderOption(l,a,n){let m;return a.disabled?m=l===n?e.gray().underline(a.title):e.strikethrough().gray(a.title):m=l===n?e.cyan().underline(a.title):a.title,(a.selected?e.green(c.radioOn):c.radioOff)+" "+m}renderDoneOrInstructions(){if(this.done)return this.value.filter(a=>a.selected).map(a=>a.title).join(", ");const l=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&l.push(e.yellow(this.warn)),l.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let l=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(l+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),l+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+l),this.clear=t(l,this.out.columns)}}return vt=i,vt}var bt,Gr;function fs(){if(Gr)return bt;Gr=1;const e=q(),r=Z(),{style:o,clear:t}=V(),{erase:s,cursor:c}=A();class i extends r{constructor(l={}){super(l),this.msg=l.message,this.value=l.initial,this.initialValue=!!l.initial,this.yesMsg=l.yes||"yes",this.yesOption=l.yesOption||"(Y/n)",this.noMsg=l.no||"no",this.noOption=l.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(`
96
96
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
97
- `),this.close()}_(l,a){return l.toLowerCase()==="y"?(this.value=!0,this.submit()):l.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(c.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+c.to(0)+this.outputText))}}return bt=i,bt}var yt,Jr;function ps(){return Jr||(Jr=1,yt={TextPrompt:Zi(),SelectPrompt:Xi(),TogglePrompt:Qi(),DatePrompt:us(),NumberPrompt:as(),MultiselectPrompt:Vr(),AutocompletePrompt:cs(),AutocompleteMultiselectPrompt:ds(),ConfirmPrompt:fs()}),yt}var Wr;function ms(){return Wr||(Wr=1,function(e){const r=e,o=ps(),t=i=>i;function s(i,b,l={}){return new Promise((a,n)=>{const m=new o[i](b),f=l.onAbort||t,h=l.onSubmit||t,u=l.onExit||t;m.on("state",b.onState||t),m.on("submit",v=>a(h(v))),m.on("exit",v=>a(u(v))),m.on("abort",v=>n(f(v)))})}r.text=i=>s("TextPrompt",i),r.password=i=>(i.style="password",r.text(i)),r.invisible=i=>(i.style="invisible",r.text(i)),r.number=i=>s("NumberPrompt",i),r.date=i=>s("DatePrompt",i),r.confirm=i=>s("ConfirmPrompt",i),r.list=i=>{const b=i.separator||",";return s("TextPrompt",i,{onSubmit:l=>l.split(b).map(a=>a.trim())})},r.toggle=i=>s("TogglePrompt",i),r.select=i=>s("SelectPrompt",i),r.multiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("MultiselectPrompt",i,{onAbort:b,onSubmit:b})},r.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("AutocompleteMultiselectPrompt",i,{onAbort:b,onSubmit:b})};const c=(i,b)=>Promise.resolve(b.filter(l=>l.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));r.autocomplete=i=>(i.suggest=i.suggest||c,i.choices=[].concat(i.choices||[]),s("AutocompletePrompt",i))}(Be)),Be}var wt,zr;function gs(){if(zr)return wt;zr=1;const e=ms(),r=["suggest","format","onState","validate","onRender","type"],o=()=>{};async function t(b=[],{onSubmit:l=o,onCancel:a=o}={}){const n={},m=t._override||{};b=[].concat(b);let f,h,u,v,g,d;const p=async(y,w,x=!1)=>{if(!(!x&&y.validate&&y.validate(w)!==!0))return y.format?await y.format(w,n):w};for(h of b)if({name:v,type:g}=h,typeof g=="function"&&(g=await g(f,{...n},h),h.type=g),!!g){for(let y in h){if(r.includes(y))continue;let w=h[y];h[y]=typeof w=="function"?await w(f,{...n},d):w}if(d=h,typeof h.message!="string")throw new Error("prompt message is required");if({name:v,type:g}=h,e[g]===void 0)throw new Error(`prompt type (${g}) is not defined`);if(m[h.name]!==void 0&&(f=await p(h,m[h.name]),f!==void 0)){n[v]=f;continue}try{f=t._injected?s(t._injected,h.initial):await e[g](h),n[v]=f=await p(h,f,!0),u=await l(h,f,n)}catch{u=!await a(h,n)}if(u)return n}return n}function s(b,l){const a=b.shift();if(a instanceof Error)throw a;return a===void 0?l:a}function c(b){t._injected=(t._injected||[]).concat(b)}function i(b){t._override=Object.assign({},b)}return wt=Object.assign(t,{prompt:t,prompts:e,inject:c,override:i}),wt}var xt,Kr;function vs(){if(Kr)return xt;Kr=1;function e(r){r=(Array.isArray(r)?r:r.split(".")).map(Number);let o=0,t=process.versions.node.split(".").map(Number);for(;o<r.length;o++){if(t[o]>r[o])return!1;if(r[o]>t[o])return!0}return!1}return xt=e("8.6.0")?Hi():gs(),xt}var bs=vs(),ie=qt(bs),St,Zr;function ys(){if(Zr)return St;Zr=1;function e(t,s){var c=t;s.slice(0,-1).forEach(function(b){c=c[b]||{}});var i=s[s.length-1];return i in c}function r(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function o(t,s){return s==="constructor"&&typeof t[s]=="function"||s==="__proto__"}return St=function(t,s){s||(s={});var c={bools:{},strings:{},unknownFn:null};typeof s.unknown=="function"&&(c.unknownFn=s.unknown),typeof s.boolean=="boolean"&&s.boolean?c.allBools=!0:[].concat(s.boolean).filter(Boolean).forEach(function(T){c.bools[T]=!0});var i={};function b(T){return i[T].some(function(O){return c.bools[O]})}Object.keys(s.alias||{}).forEach(function(T){i[T]=[].concat(s.alias[T]),i[T].forEach(function(O){i[O]=[T].concat(i[T].filter(function(M){return O!==M}))})}),[].concat(s.string).filter(Boolean).forEach(function(T){c.strings[T]=!0,i[T]&&[].concat(i[T]).forEach(function(O){c.strings[O]=!0})});var l=s.default||{},a={_:[]};function n(T,O){return c.allBools&&/^--[^=]+$/.test(O)||c.strings[T]||c.bools[T]||i[T]}function m(T,O,M){for(var S=T,R=0;R<O.length-1;R++){var D=O[R];if(o(S,D))return;S[D]===void 0&&(S[D]={}),(S[D]===Object.prototype||S[D]===Number.prototype||S[D]===String.prototype)&&(S[D]={}),S[D]===Array.prototype&&(S[D]=[]),S=S[D]}var C=O[O.length-1];o(S,C)||((S===Object.prototype||S===Number.prototype||S===String.prototype)&&(S={}),S===Array.prototype&&(S=[]),S[C]===void 0||c.bools[C]||typeof S[C]=="boolean"?S[C]=M:Array.isArray(S[C])?S[C].push(M):S[C]=[S[C],M])}function f(T,O,M){if(!(M&&c.unknownFn&&!n(T,M)&&c.unknownFn(M)===!1)){var S=!c.strings[T]&&r(O)?Number(O):O;m(a,T.split("."),S),(i[T]||[]).forEach(function(R){m(a,R.split("."),S)})}}Object.keys(c.bools).forEach(function(T){f(T,l[T]===void 0?!1:l[T])});var h=[];t.indexOf("--")!==-1&&(h=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var u=0;u<t.length;u++){var v=t[u],g,d;if(/^--.+=/.test(v)){var p=v.match(/^--([^=]+)=([\s\S]*)$/);g=p[1];var y=p[2];c.bools[g]&&(y=y!=="false"),f(g,y,v)}else if(/^--no-.+/.test(v))g=v.match(/^--no-(.+)/)[1],f(g,!1,v);else if(/^--.+/.test(v))g=v.match(/^--(.+)/)[1],d=t[u+1],d!==void 0&&!/^(-|--)[^-]/.test(d)&&!c.bools[g]&&!c.allBools&&(!i[g]||!b(g))?(f(g,d,v),u+=1):/^(true|false)$/.test(d)?(f(g,d==="true",v),u+=1):f(g,c.strings[g]?"":!0,v);else if(/^-[^-]+/.test(v)){for(var w=v.slice(1,-1).split(""),x=!1,$=0;$<w.length;$++){if(d=v.slice($+2),d==="-"){f(w[$],d,v);continue}if(/[A-Za-z]/.test(w[$])&&d[0]==="="){f(w[$],d.slice(1),v),x=!0;break}if(/[A-Za-z]/.test(w[$])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){f(w[$],d,v),x=!0;break}if(w[$+1]&&w[$+1].match(/\W/)){f(w[$],v.slice($+2),v),x=!0;break}else f(w[$],c.strings[w[$]]?"":!0,v)}g=v.slice(-1)[0],!x&&g!=="-"&&(t[u+1]&&!/^(-|--)[^-]/.test(t[u+1])&&!c.bools[g]&&(!i[g]||!b(g))?(f(g,t[u+1],v),u+=1):t[u+1]&&/^(true|false)$/.test(t[u+1])?(f(g,t[u+1]==="true",v),u+=1):f(g,c.strings[g]?"":!0,v))}else if((!c.unknownFn||c.unknownFn(v)!==!1)&&a._.push(c.strings._||!r(v)?v:Number(v)),s.stopEarly){a._.push.apply(a._,t.slice(u+1));break}}return Object.keys(l).forEach(function(T){e(a,T.split("."))||(m(a,T.split("."),l[T]),(i[T]||[]).forEach(function(O){m(a,O.split("."),l[T])}))}),s["--"]?a["--"]=h.slice():h.forEach(function(T){a._.push(T)}),a},St}var ws=ys(),xs=qt(ws);const $t=10,Xr=(e=0)=>r=>`\x1B[${r+e}m`,Qr=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,ei=(e=0)=>(r,o,t)=>`\x1B[${38+e};2;${r};${o};${t}m`,E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(E.modifier);const Ss=Object.keys(E.color),$s=Object.keys(E.bgColor);[...Ss,...$s];function Ts(){const e=new Map;for(const[r,o]of Object.entries(E)){for(const[t,s]of Object.entries(o))E[t]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},o[t]=E[t],e.set(s[0],s[1]);Object.defineProperty(E,r,{value:o,enumerable:!1})}return Object.defineProperty(E,"codes",{value:e,enumerable:!1}),E.color.close="\x1B[39m",E.bgColor.close="\x1B[49m",E.color.ansi=Xr(),E.color.ansi256=Qr(),E.color.ansi16m=ei(),E.bgColor.ansi=Xr($t),E.bgColor.ansi256=Qr($t),E.bgColor.ansi16m=ei($t),Object.defineProperties(E,{rgbToAnsi256:{value(r,o,t){return r===o&&o===t?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(o/255*5)+Math.round(t/255*5)},enumerable:!1},hexToRgb:{value(r){const o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!o)return[0,0,0];let[t]=o;t.length===3&&(t=[...t].map(c=>c+c).join(""));const s=Number.parseInt(t,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:r=>E.rgbToAnsi256(...E.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let o,t,s;if(r>=232)o=((r-232)*10+8)/255,t=o,s=o;else{r-=16;const b=r%36;o=Math.floor(r/36)/5,t=Math.floor(b/6)/5,s=b%6/5}const c=Math.max(o,t,s)*2;if(c===0)return 30;let i=30+(Math.round(s)<<2|Math.round(t)<<1|Math.round(o));return c===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(r,o,t)=>E.ansi256ToAnsi(E.rgbToAnsi256(r,o,t)),enumerable:!1},hexToAnsi:{value:r=>E.ansi256ToAnsi(E.hexToAnsi256(r)),enumerable:!1}}),E}const V=Ts();function L(e,r=globalThis.Deno?globalThis.Deno.args:oe.argv){const o=e.startsWith("-")?"":e.length===1?"-":"--",t=r.indexOf(o+e),s=r.indexOf("--");return t!==-1&&(s===-1||t<s)}const{env:_}=oe;let se;L("no-color")||L("no-colors")||L("color=false")||L("color=never")?se=0:(L("color")||L("colors")||L("color=true")||L("color=always"))&&(se=1);function Ms(){if("FORCE_COLOR"in _)return _.FORCE_COLOR==="true"?1:_.FORCE_COLOR==="false"?0:_.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_.FORCE_COLOR,10),3)}function Os(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Rs(e,{streamIsTTY:r,sniffFlags:o=!0}={}){const t=Ms();t!==void 0&&(se=t);const s=o?se:t;if(s===0)return 0;if(o){if(L("color=16m")||L("color=full")||L("color=truecolor"))return 3;if(L("color=256"))return 2}if("TF_BUILD"in _&&"AGENT_NAME"in _)return 1;if(e&&!r&&s===void 0)return 0;const c=s||0;if(_.TERM==="dumb")return c;if(oe.platform==="win32"){const i=ci.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in _)return"GITHUB_ACTIONS"in _||"GITEA_ACTIONS"in _?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(i=>i in _)||_.CI_NAME==="codeship"?1:c;if("TEAMCITY_VERSION"in _)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_.TEAMCITY_VERSION)?1:0;if(_.COLORTERM==="truecolor"||_.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in _){const i=Number.parseInt((_.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_.TERM)||"COLORTERM"in _?1:c}function ti(e,r={}){const o=Rs(e,{streamIsTTY:e&&e.isTTY,...r});return Os(o)}const Ps={stdout:ti({isTTY:Et.isatty(1)}),stderr:ti({isTTY:Et.isatty(2)})};function Cs(e,r,o){let t=e.indexOf(r);if(t===-1)return e;const s=r.length;let c=0,i="";do i+=e.slice(c,t)+r+o,c=t+s,t=e.indexOf(r,c);while(t!==-1);return i+=e.slice(c),i}function Ds(e,r,o,t){let s=0,c="";do{const i=e[t-1]==="\r";c+=e.slice(s,i?t-1:t)+r+(i?`\r
97
+ `),this.close()}_(l,a){return l.toLowerCase()==="y"?(this.value=!0,this.submit()):l.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(c.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+c.to(0)+this.outputText))}}return bt=i,bt}var yt,Jr;function ps(){return Jr||(Jr=1,yt={TextPrompt:Zi(),SelectPrompt:Xi(),TogglePrompt:Qi(),DatePrompt:us(),NumberPrompt:as(),MultiselectPrompt:Vr(),AutocompletePrompt:cs(),AutocompleteMultiselectPrompt:ds(),ConfirmPrompt:fs()}),yt}var Wr;function ms(){return Wr||(Wr=1,function(e){const r=e,o=ps(),t=i=>i;function s(i,b,l={}){return new Promise((a,n)=>{const m=new o[i](b),f=l.onAbort||t,h=l.onSubmit||t,u=l.onExit||t;m.on("state",b.onState||t),m.on("submit",v=>a(h(v))),m.on("exit",v=>a(u(v))),m.on("abort",v=>n(f(v)))})}r.text=i=>s("TextPrompt",i),r.password=i=>(i.style="password",r.text(i)),r.invisible=i=>(i.style="invisible",r.text(i)),r.number=i=>s("NumberPrompt",i),r.date=i=>s("DatePrompt",i),r.confirm=i=>s("ConfirmPrompt",i),r.list=i=>{const b=i.separator||",";return s("TextPrompt",i,{onSubmit:l=>l.split(b).map(a=>a.trim())})},r.toggle=i=>s("TogglePrompt",i),r.select=i=>s("SelectPrompt",i),r.multiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("MultiselectPrompt",i,{onAbort:b,onSubmit:b})},r.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const b=l=>l.filter(a=>a.selected).map(a=>a.value);return s("AutocompleteMultiselectPrompt",i,{onAbort:b,onSubmit:b})};const c=(i,b)=>Promise.resolve(b.filter(l=>l.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));r.autocomplete=i=>(i.suggest=i.suggest||c,i.choices=[].concat(i.choices||[]),s("AutocompletePrompt",i))}(Be)),Be}var wt,zr;function gs(){if(zr)return wt;zr=1;const e=ms(),r=["suggest","format","onState","validate","onRender","type"],o=()=>{};async function t(b=[],{onSubmit:l=o,onCancel:a=o}={}){const n={},m=t._override||{};b=[].concat(b);let f,h,u,v,g,d;const p=async(y,w,x=!1)=>{if(!(!x&&y.validate&&y.validate(w)!==!0))return y.format?await y.format(w,n):w};for(h of b)if({name:v,type:g}=h,typeof g=="function"&&(g=await g(f,{...n},h),h.type=g),!!g){for(let y in h){if(r.includes(y))continue;let w=h[y];h[y]=typeof w=="function"?await w(f,{...n},d):w}if(d=h,typeof h.message!="string")throw new Error("prompt message is required");if({name:v,type:g}=h,e[g]===void 0)throw new Error(`prompt type (${g}) is not defined`);if(m[h.name]!==void 0&&(f=await p(h,m[h.name]),f!==void 0)){n[v]=f;continue}try{f=t._injected?s(t._injected,h.initial):await e[g](h),n[v]=f=await p(h,f,!0),u=await l(h,f,n)}catch{u=!await a(h,n)}if(u)return n}return n}function s(b,l){const a=b.shift();if(a instanceof Error)throw a;return a===void 0?l:a}function c(b){t._injected=(t._injected||[]).concat(b)}function i(b){t._override=Object.assign({},b)}return wt=Object.assign(t,{prompt:t,prompts:e,inject:c,override:i}),wt}var xt,Kr;function vs(){if(Kr)return xt;Kr=1;function e(r){r=(Array.isArray(r)?r:r.split(".")).map(Number);let o=0,t=process.versions.node.split(".").map(Number);for(;o<r.length;o++){if(t[o]>r[o])return!1;if(r[o]>t[o])return!0}return!1}return xt=e("8.6.0")?Hi():gs(),xt}var bs=vs(),ie=qt(bs),$t,Zr;function ys(){if(Zr)return $t;Zr=1;function e(t,s){var c=t;s.slice(0,-1).forEach(function(b){c=c[b]||{}});var i=s[s.length-1];return i in c}function r(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function o(t,s){return s==="constructor"&&typeof t[s]=="function"||s==="__proto__"}return $t=function(t,s){s||(s={});var c={bools:{},strings:{},unknownFn:null};typeof s.unknown=="function"&&(c.unknownFn=s.unknown),typeof s.boolean=="boolean"&&s.boolean?c.allBools=!0:[].concat(s.boolean).filter(Boolean).forEach(function(T){c.bools[T]=!0});var i={};function b(T){return i[T].some(function(O){return c.bools[O]})}Object.keys(s.alias||{}).forEach(function(T){i[T]=[].concat(s.alias[T]),i[T].forEach(function(O){i[O]=[T].concat(i[T].filter(function(M){return O!==M}))})}),[].concat(s.string).filter(Boolean).forEach(function(T){c.strings[T]=!0,i[T]&&[].concat(i[T]).forEach(function(O){c.strings[O]=!0})});var l=s.default||{},a={_:[]};function n(T,O){return c.allBools&&/^--[^=]+$/.test(O)||c.strings[T]||c.bools[T]||i[T]}function m(T,O,M){for(var $=T,R=0;R<O.length-1;R++){var D=O[R];if(o($,D))return;$[D]===void 0&&($[D]={}),($[D]===Object.prototype||$[D]===Number.prototype||$[D]===String.prototype)&&($[D]={}),$[D]===Array.prototype&&($[D]=[]),$=$[D]}var C=O[O.length-1];o($,C)||(($===Object.prototype||$===Number.prototype||$===String.prototype)&&($={}),$===Array.prototype&&($=[]),$[C]===void 0||c.bools[C]||typeof $[C]=="boolean"?$[C]=M:Array.isArray($[C])?$[C].push(M):$[C]=[$[C],M])}function f(T,O,M){if(!(M&&c.unknownFn&&!n(T,M)&&c.unknownFn(M)===!1)){var $=!c.strings[T]&&r(O)?Number(O):O;m(a,T.split("."),$),(i[T]||[]).forEach(function(R){m(a,R.split("."),$)})}}Object.keys(c.bools).forEach(function(T){f(T,l[T]===void 0?!1:l[T])});var h=[];t.indexOf("--")!==-1&&(h=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var u=0;u<t.length;u++){var v=t[u],g,d;if(/^--.+=/.test(v)){var p=v.match(/^--([^=]+)=([\s\S]*)$/);g=p[1];var y=p[2];c.bools[g]&&(y=y!=="false"),f(g,y,v)}else if(/^--no-.+/.test(v))g=v.match(/^--no-(.+)/)[1],f(g,!1,v);else if(/^--.+/.test(v))g=v.match(/^--(.+)/)[1],d=t[u+1],d!==void 0&&!/^(-|--)[^-]/.test(d)&&!c.bools[g]&&!c.allBools&&(!i[g]||!b(g))?(f(g,d,v),u+=1):/^(true|false)$/.test(d)?(f(g,d==="true",v),u+=1):f(g,c.strings[g]?"":!0,v);else if(/^-[^-]+/.test(v)){for(var w=v.slice(1,-1).split(""),x=!1,S=0;S<w.length;S++){if(d=v.slice(S+2),d==="-"){f(w[S],d,v);continue}if(/[A-Za-z]/.test(w[S])&&d[0]==="="){f(w[S],d.slice(1),v),x=!0;break}if(/[A-Za-z]/.test(w[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){f(w[S],d,v),x=!0;break}if(w[S+1]&&w[S+1].match(/\W/)){f(w[S],v.slice(S+2),v),x=!0;break}else f(w[S],c.strings[w[S]]?"":!0,v)}g=v.slice(-1)[0],!x&&g!=="-"&&(t[u+1]&&!/^(-|--)[^-]/.test(t[u+1])&&!c.bools[g]&&(!i[g]||!b(g))?(f(g,t[u+1],v),u+=1):t[u+1]&&/^(true|false)$/.test(t[u+1])?(f(g,t[u+1]==="true",v),u+=1):f(g,c.strings[g]?"":!0,v))}else if((!c.unknownFn||c.unknownFn(v)!==!1)&&a._.push(c.strings._||!r(v)?v:Number(v)),s.stopEarly){a._.push.apply(a._,t.slice(u+1));break}}return Object.keys(l).forEach(function(T){e(a,T.split("."))||(m(a,T.split("."),l[T]),(i[T]||[]).forEach(function(O){m(a,O.split("."),l[T])}))}),s["--"]?a["--"]=h.slice():h.forEach(function(T){a._.push(T)}),a},$t}var ws=ys(),xs=qt(ws);const St=10,Xr=(e=0)=>r=>`\x1B[${r+e}m`,Qr=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,ei=(e=0)=>(r,o,t)=>`\x1B[${38+e};2;${r};${o};${t}m`,E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(E.modifier);const $s=Object.keys(E.color),Ss=Object.keys(E.bgColor);[...$s,...Ss];function Ts(){const e=new Map;for(const[r,o]of Object.entries(E)){for(const[t,s]of Object.entries(o))E[t]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},o[t]=E[t],e.set(s[0],s[1]);Object.defineProperty(E,r,{value:o,enumerable:!1})}return Object.defineProperty(E,"codes",{value:e,enumerable:!1}),E.color.close="\x1B[39m",E.bgColor.close="\x1B[49m",E.color.ansi=Xr(),E.color.ansi256=Qr(),E.color.ansi16m=ei(),E.bgColor.ansi=Xr(St),E.bgColor.ansi256=Qr(St),E.bgColor.ansi16m=ei(St),Object.defineProperties(E,{rgbToAnsi256:{value(r,o,t){return r===o&&o===t?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(o/255*5)+Math.round(t/255*5)},enumerable:!1},hexToRgb:{value(r){const o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!o)return[0,0,0];let[t]=o;t.length===3&&(t=[...t].map(c=>c+c).join(""));const s=Number.parseInt(t,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:r=>E.rgbToAnsi256(...E.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let o,t,s;if(r>=232)o=((r-232)*10+8)/255,t=o,s=o;else{r-=16;const b=r%36;o=Math.floor(r/36)/5,t=Math.floor(b/6)/5,s=b%6/5}const c=Math.max(o,t,s)*2;if(c===0)return 30;let i=30+(Math.round(s)<<2|Math.round(t)<<1|Math.round(o));return c===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(r,o,t)=>E.ansi256ToAnsi(E.rgbToAnsi256(r,o,t)),enumerable:!1},hexToAnsi:{value:r=>E.ansi256ToAnsi(E.hexToAnsi256(r)),enumerable:!1}}),E}const H=Ts();function k(e,r=globalThis.Deno?globalThis.Deno.args:oe.argv){const o=e.startsWith("-")?"":e.length===1?"-":"--",t=r.indexOf(o+e),s=r.indexOf("--");return t!==-1&&(s===-1||t<s)}const{env:_}=oe;let se;k("no-color")||k("no-colors")||k("color=false")||k("color=never")?se=0:(k("color")||k("colors")||k("color=true")||k("color=always"))&&(se=1);function Ms(){if("FORCE_COLOR"in _)return _.FORCE_COLOR==="true"?1:_.FORCE_COLOR==="false"?0:_.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_.FORCE_COLOR,10),3)}function Os(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Rs(e,{streamIsTTY:r,sniffFlags:o=!0}={}){const t=Ms();t!==void 0&&(se=t);const s=o?se:t;if(s===0)return 0;if(o){if(k("color=16m")||k("color=full")||k("color=truecolor"))return 3;if(k("color=256"))return 2}if("TF_BUILD"in _&&"AGENT_NAME"in _)return 1;if(e&&!r&&s===void 0)return 0;const c=s||0;if(_.TERM==="dumb")return c;if(oe.platform==="win32"){const i=ci.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in _)return"GITHUB_ACTIONS"in _||"GITEA_ACTIONS"in _?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(i=>i in _)||_.CI_NAME==="codeship"?1:c;if("TEAMCITY_VERSION"in _)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_.TEAMCITY_VERSION)?1:0;if(_.COLORTERM==="truecolor"||_.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in _){const i=Number.parseInt((_.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_.TERM)||"COLORTERM"in _?1:c}function ti(e,r={}){const o=Rs(e,{streamIsTTY:e&&e.isTTY,...r});return Os(o)}const Ps={stdout:ti({isTTY:Et.isatty(1)}),stderr:ti({isTTY:Et.isatty(2)})};function Cs(e,r,o){let t=e.indexOf(r);if(t===-1)return e;const s=r.length;let c=0,i="";do i+=e.slice(c,t)+r+o,c=t+s,t=e.indexOf(r,c);while(t!==-1);return i+=e.slice(c),i}function Ds(e,r,o,t){let s=0,c="";do{const i=e[t-1]==="\r";c+=e.slice(s,i?t-1:t)+r+(i?`\r
98
98
  `:`
99
99
  `)+o,s=t+1,t=e.indexOf(`
100
- `,s)}while(t!==-1);return c+=e.slice(s),c}const{stdout:ri,stderr:ii}=Ps,Tt=Symbol("GENERATOR"),Q=Symbol("STYLER"),te=Symbol("IS_EMPTY"),si=["ansi","ansi","ansi256","ansi16m"],ee=Object.create(null),Es=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const o=ri?ri.level:0;e.level=r.level===void 0?o:r.level},_s=e=>{const r=(...o)=>o.join(" ");return Es(r,e),Object.setPrototypeOf(r,re.prototype),r};function re(e){return _s(e)}Object.setPrototypeOf(re.prototype,Function.prototype);for(const[e,r]of Object.entries(V))ee[e]={get(){const o=ne(this,Ot(r.open,r.close,this[Q]),this[te]);return Object.defineProperty(this,e,{value:o}),o}};ee.visible={get(){const e=ne(this,this[Q],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const Mt=(e,r,o,...t)=>e==="rgb"?r==="ansi16m"?V[o].ansi16m(...t):r==="ansi256"?V[o].ansi256(V.rgbToAnsi256(...t)):V[o].ansi(V.rgbToAnsi(...t)):e==="hex"?Mt("rgb",r,o,...V.hexToRgb(...t)):V[o][e](...t),qs=["rgb","hex","ansi256"];for(const e of qs){ee[e]={get(){const{level:o}=this;return function(...t){const s=Ot(Mt(e,si[o],"color",...t),V.color.close,this[Q]);return ne(this,s,this[te])}}};const r="bg"+e[0].toUpperCase()+e.slice(1);ee[r]={get(){const{level:o}=this;return function(...t){const s=Ot(Mt(e,si[o],"bgColor",...t),V.bgColor.close,this[Q]);return ne(this,s,this[te])}}}}const As=Object.defineProperties(()=>{},{...ee,level:{enumerable:!0,get(){return this[Tt].level},set(e){this[Tt].level=e}}}),Ot=(e,r,o)=>{let t,s;return o===void 0?(t=e,s=r):(t=o.openAll+e,s=r+o.closeAll),{open:e,close:r,openAll:t,closeAll:s,parent:o}},ne=(e,r,o)=>{const t=(...s)=>Is(t,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(t,As),t[Tt]=e,t[Q]=r,t[te]=o,t},Is=(e,r)=>{if(e.level<=0||!r)return e[te]?"":r;let o=e[Q];if(o===void 0)return r;const{openAll:t,closeAll:s}=o;if(r.includes("\x1B"))for(;o!==void 0;)r=Cs(r,o.close,o.open),o=o.parent;const c=r.indexOf(`
101
- `);return c!==-1&&(r=Ds(r,s,t,c)),t+r+s};Object.defineProperties(re.prototype,ee);const I=re();re({level:ii?ii.level:0});const P={backend:I.hex("#3677FF"),frontend:I.hex("#6DC6FE"),vanilla:I.hex("#EEC900"),react:I.hex("3B89E0"),typescript:I.hex("30B3ED"),ok:I.hex("30ED86"),error:I.hex("ED3066"),info:I.hex("42ECDE"),gray:I.hex("#686868"),vue:I.hex("54E6A5"),warn:I.hex("#EC9942"),webpack:I.hex("#75AFCC"),node:I.hex("#417E38"),rust:I.hex("#D34516"),experimental:I.hex("#FA2200")};function K(e){const r=22-e.length;return I.reset(P.gray(`${" ".repeat(r)}|${" ".repeat(2)}`))}function H(e){const r=e.split(" ");return e==="Frontend"?P.frontend(e):e==="Backend"?P.backend(e):e==="VanillaJS"?P.vanilla(e):e==="NodeJS"||r.includes("Node")?P.node(e):r.includes("JavaScript")?P.react(e):r.includes("TypeScript")?P.typescript(e):r.includes("React")?P.react(e):r.includes("TypeScript")?P.typescript(e):e}function Z(e){return I.reset(e)}const ni={Frontend:{VanillaJS:[{value:"vanilla-js",title:`${H("VanillaJS")}${K("VanillaJS")}${Z(P.error("Vanilla JS + Vite."))}`}],"React JavaScript":[{value:"react",title:`${H("React")}${K("React")}${Z(P.error("React + Vite."))}`},{value:"react-dev",title:`${H("React Dev")}${K("React Dev")}${Z(P.error("Tailwind + Linter + Tests"))}`},{value:"react-webpack",title:`${H("React Webpack")}${K("React Webpack")}${Z(P.error("React + Webpack."))}`},{value:"react-dev-webpack",title:`${H("React Dev Webpack")}${K("React Dev Webpack")}${Z(P.error("Tailwind + Linter + Tests"))}`}],"React TypeScript":[{value:"react-typescript",title:`${H("React TypeScript")}${K("React TypeScript")}${Z(P.error("React + Vite + TypeScript"))}`},{value:"react-dev-typescript",title:`${H("React Dev TypeScript")}${K("React Dev TypeScript")}${Z(P.error("Tailwind + Linter + Tests"))}`}]},Backend:{NodeJS:[{value:"node-express",title:`${H("Node Express")}${K("Node Express")}${Z(P.error("Express + Sequelize + Linter + Tests"))}`}]}},oi=(e,r)=>{mi(e).forEach(o=>{const t=J.join(e,o);let s=J.join(r,o);o==="_gitignore"&&(s=J.join(r,".gitignore")),gi(t).isDirectory()?(vi(s),oi(t,s)):bi(t,s)})},js=(e,r)=>{const o=J.join(e,"package.json");try{const t=di(o,"utf8"),s=JSON.parse(t);s.name=r,fi(o,JSON.stringify(s,null,2),"utf8")}catch(t){console.log(t.message)}};async function li(e,r,o){const t=_t(e),s=_t(r);t||console.log(P.error("Invalid Template")),s&&console.log(P.error("Target directory already exist!")),t&&!s&&(console.info(`\u{1F4C2} ${P.ok("Target directory doesn't exist")}`),console.info(`\u{1F6A7} ${P.ok("Creating directory")}`),pi(r,{recursive:!0}),console.info(`\u{1F4C1} ${P.ok("Finished creating directory")}`),oi(e,r),js(r,o),console.info(`\u{1F680} ${P.ok(`Finished generating your app ${P.error(o)}`)}`),console.info(`\u{1F3E0} ${P.info(`cd ${o}`)}`),console.info(`\u{1F9EA} ${P.info("npm install")}`))}const Fs=e=>e.toLowerCase().split(/[\s|_]/).join("-"),Ns=e=>e.match(/[^a-zA-Z0-9-\s]/g)?"App name should not contain special characters except hyphen (-)":!0,hi=`
100
+ `,s)}while(t!==-1);return c+=e.slice(s),c}const{stdout:ri,stderr:ii}=Ps,Tt=Symbol("GENERATOR"),Q=Symbol("STYLER"),te=Symbol("IS_EMPTY"),si=["ansi","ansi","ansi256","ansi16m"],ee=Object.create(null),Es=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const o=ri?ri.level:0;e.level=r.level===void 0?o:r.level},_s=e=>{const r=(...o)=>o.join(" ");return Es(r,e),Object.setPrototypeOf(r,re.prototype),r};function re(e){return _s(e)}Object.setPrototypeOf(re.prototype,Function.prototype);for(const[e,r]of Object.entries(H))ee[e]={get(){const o=ne(this,Ot(r.open,r.close,this[Q]),this[te]);return Object.defineProperty(this,e,{value:o}),o}};ee.visible={get(){const e=ne(this,this[Q],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const Mt=(e,r,o,...t)=>e==="rgb"?r==="ansi16m"?H[o].ansi16m(...t):r==="ansi256"?H[o].ansi256(H.rgbToAnsi256(...t)):H[o].ansi(H.rgbToAnsi(...t)):e==="hex"?Mt("rgb",r,o,...H.hexToRgb(...t)):H[o][e](...t),qs=["rgb","hex","ansi256"];for(const e of qs){ee[e]={get(){const{level:o}=this;return function(...t){const s=Ot(Mt(e,si[o],"color",...t),H.color.close,this[Q]);return ne(this,s,this[te])}}};const r="bg"+e[0].toUpperCase()+e.slice(1);ee[r]={get(){const{level:o}=this;return function(...t){const s=Ot(Mt(e,si[o],"bgColor",...t),H.bgColor.close,this[Q]);return ne(this,s,this[te])}}}}const As=Object.defineProperties(()=>{},{...ee,level:{enumerable:!0,get(){return this[Tt].level},set(e){this[Tt].level=e}}}),Ot=(e,r,o)=>{let t,s;return o===void 0?(t=e,s=r):(t=o.openAll+e,s=r+o.closeAll),{open:e,close:r,openAll:t,closeAll:s,parent:o}},ne=(e,r,o)=>{const t=(...s)=>Is(t,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(t,As),t[Tt]=e,t[Q]=r,t[te]=o,t},Is=(e,r)=>{if(e.level<=0||!r)return e[te]?"":r;let o=e[Q];if(o===void 0)return r;const{openAll:t,closeAll:s}=o;if(r.includes("\x1B"))for(;o!==void 0;)r=Cs(r,o.close,o.open),o=o.parent;const c=r.indexOf(`
101
+ `);return c!==-1&&(r=Ds(r,s,t,c)),t+r+s};Object.defineProperties(re.prototype,ee);const I=re();re({level:ii?ii.level:0});const P={backend:I.hex("#3677FF"),frontend:I.hex("#6DC6FE"),vanilla:I.hex("#EEC900"),react:I.hex("#3B89E0"),typescript:I.hex("#30B3ED"),ok:I.hex("#30ED86"),error:I.hex("#ED3066"),info:I.hex("#42ECDE"),gray:I.hex("#686868"),vue:I.hex("#54E6A5"),warn:I.hex("#EC9942"),webpack:I.hex("#75AFCC"),node:I.hex("#417E38"),rust:I.hex("#D34516"),experimental:I.hex("#FA2200")};function J(e){const r=22-e.length;return I.reset(P.gray(`${" ".repeat(r)}|${" ".repeat(2)}`))}function L(e){const r=e.split(" ");return e==="Frontend"?P.frontend(e):e==="Backend"?P.backend(e):e==="VanillaJS"?P.vanilla(e):e==="NodeJS"||r.includes("Node")?P.node(e):r.includes("JavaScript")?P.react(e):r.includes("Rspack")||r.includes("Rust")?P.rust(e):r.includes("TypeScript")||r.includes("TypeScript")?P.typescript(e):r.includes("React")?P.react(e):e}function W(e){return I.reset(e)}const ni={Frontend:{VanillaJS:[{value:"vanilla-js",title:`${L("VanillaJS")}${J("VanillaJS")}${W(P.error("Vanilla JS + Vite."))}`}],"React JavaScript":[{value:"react",title:`${L("React")}${J("React")}${W(P.error("React + Vite."))}`},{value:"react-dev",title:`${L("React Dev")}${J("React Dev")}${W(P.error("Tailwind + Linter + Tests"))}`},{value:"react-webpack",title:`${L("React Webpack")}${J("React Webpack")}${W(P.error("React + Webpack."))}`},{value:"react-dev-webpack",title:`${L("React Dev Webpack")}${J("React Dev Webpack")}${W(P.error("Tailwind + Linter + Tests"))}`}],"React TypeScript":[{value:"react-typescript",title:`${L("React TypeScript")}${J("React TypeScript")}${W(P.error("React + Vite + TypeScript"))}`},{value:"react-dev-typescript",title:`${L("React Dev TypeScript")}${J("React Dev TypeScript")}${W(P.error("Tailwind + Linter + Tests"))}`}],"React Rust":[{value:"react-rspack",title:`${L("React Rspack")}${J("React Rspack")}${W(P.error("React + Rspack"))}`}]},Backend:{NodeJS:[{value:"node-express",title:`${L("Node Express")}${J("Node Express")}${W(P.error("Express + Sequelize + Linter + Tests"))}`}]}},oi=(e,r)=>{mi(e).forEach(o=>{const t=z.join(e,o);let s=z.join(r,o);o==="_gitignore"&&(s=z.join(r,".gitignore")),gi(t).isDirectory()?(vi(s),oi(t,s)):bi(t,s)})},js=(e,r)=>{const o=z.join(e,"package.json");try{const t=di(o,"utf8"),s=JSON.parse(t);s.name=r,fi(o,JSON.stringify(s,null,2),"utf8")}catch(t){console.log(t.message)}};async function li(e,r,o){const t=_t(e),s=_t(r);t||console.log(P.error("Invalid Template")),s&&console.log(P.error("Target directory already exist!")),t&&!s&&(console.info(`\u{1F4C2} ${P.ok("Target directory doesn't exist")}`),console.info(`\u{1F6A7} ${P.ok("Creating directory")}`),pi(r,{recursive:!0}),console.info(`\u{1F4C1} ${P.ok("Finished creating directory")}`),oi(e,r),js(r,o),console.info(`\u{1F680} ${P.ok(`Finished generating your app ${P.error(o)}`)}`),console.info(`\u{1F3E0} ${P.info(`cd ${o}`)}`),console.info(`\u{1F9EA} ${P.info("npm install")}`))}const Fs=e=>e.toLowerCase().split(/[\s|_]/).join("-"),Ns=e=>e.match(/[^a-zA-Z0-9-\s]/g)?"App name should not contain special characters except hyphen (-)":!0,hi=`
102
102
  Usage: create-enchilada [OPTION]... [DIRECTORY]
103
103
 
104
104
  Create a new app. With no arguments,
@@ -119,5 +119,6 @@ Available templates:
119
119
  react-dev-webpack Tailwind + Linter + Tests
120
120
  react-typescript React + Vite + TypeScript
121
121
  react-dev-typescript Tailwind + Linter + Tests
122
+ react-rspack React + Rspack
122
123
  node-express Express + Sequelize + Linter + Tests
123
- `,Ls=xs(ai.slice(2)),ui=async e=>{const r=e.template||e.t,o=e._[0],{help:t,h:s}=e;if(t||s)return console.info(hi),hi;if(!r||!o)try{const c=await ie([{type:"select",name:"category",message:"Select the type of project:",choices:Object.keys(ni).map(v=>({title:H(v),value:v}))}]);c.category||process.exit(0);const i=ni[c.category],b=await ie({type:"select",name:"subcategory",message:`Select the technology for ${c.category}:`,choices:Object.keys(i).map(v=>({title:H(v),value:v}))});b.subcategory||process.exit(0);const l=i[b.subcategory],a=await ie({type:"select",name:"template",message:`Select the template for ${b.subcategory}:`,choices:l});a.template||process.exit(0);const n=await ie({type:"text",name:"appName",message:P.typescript("Enter your app name"),initial:"my-app",format:v=>Fs(v),validate:v=>Ns(v)});n.appName||process.exit(0);const{template:m}=a,{appName:f}=n,h=J.join(process.cwd(),f),u=J.resolve(Dt(import.meta.url),"../../templates",`${m}`);li(u,h,f)}catch(c){console.error(P.error(c.message))}else try{const c=r,i=o,b=J.join(process.cwd(),i),l=J.resolve(Dt(import.meta.url),"../../templates",`${c}`);li(l,b,i)}catch(c){console.error(P.error(c.message))}return 0};ui(Ls);export{ui as default};
124
+ `,ks=xs(ai.slice(2)),ui=async e=>{const r=e.template||e.t,o=e._[0],{help:t,h:s}=e;if(t||s)return console.info(hi),hi;if(!r||!o)try{const c=await ie([{type:"select",name:"category",message:"Select the type of project:",choices:Object.keys(ni).map(v=>({title:L(v),value:v}))}]);c.category||process.exit(0);const i=ni[c.category],b=await ie({type:"select",name:"subcategory",message:`Select the technology for ${c.category}:`,choices:Object.keys(i).map(v=>({title:L(v),value:v}))});b.subcategory||process.exit(0);const l=i[b.subcategory],a=await ie({type:"select",name:"template",message:`Select the template for ${b.subcategory}:`,choices:l});a.template||process.exit(0);const n=await ie({type:"text",name:"appName",message:P.typescript("Enter your app name"),initial:"my-app",format:v=>Fs(v),validate:v=>Ns(v)});n.appName||process.exit(0);const{template:m}=a,{appName:f}=n,h=z.join(process.cwd(),f),u=z.resolve(Dt(import.meta.url),"../../templates",`${m}`);li(u,h,f)}catch(c){console.error(P.error(c.message))}else try{const c=r,i=o,b=z.join(process.cwd(),i),l=z.resolve(Dt(import.meta.url),"../../templates",`${c}`);li(l,b,i)}catch(c){console.error(P.error(c.message))}return 0};ui(ks);export{ui as default};
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "create-enchilada",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "A quick way to start your web applications.",
6
6
  "main": "index.js",
7
7
  "scripts": {
8
8
  "lint": "eslint .",
9
9
  "build": "rollup --config",
10
+ "dev": "rollup --config --watch",
10
11
  "cov:clean": "rimraf .nyc_output && rimraf coverage",
11
12
  "cov:unit": "NODE_OPTIONS=--experimental-vm-modules jest --forceExit --colors --detectOpenHandles -c jest.config.unit.js",
12
13
  "test:unit": "npm-run-all cov:clean cov:unit",
@@ -0,0 +1,89 @@
1
+ # compiled output
2
+ /dist
3
+ /tmp
4
+ /out-tsc
5
+
6
+ # Runtime data
7
+ pids
8
+ *.pid
9
+ *.seed
10
+ *.pid.lock
11
+
12
+ # Directory for instrumented libs generated by jscoverage/JSCover
13
+ lib-cov
14
+
15
+ # Coverage directory used by tools like istanbul
16
+ coverage
17
+
18
+ # nyc test coverage
19
+ .nyc_output
20
+
21
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
22
+ .grunt
23
+
24
+ # Bower dependency directory (https://bower.io/)
25
+ bower_components
26
+
27
+ # node-waf configuration
28
+ .lock-wscript
29
+
30
+ # IDEs and editors
31
+ .idea
32
+ .project
33
+ .classpath
34
+ .c9/
35
+ *.launch
36
+ .settings/
37
+ *.sublime-workspace
38
+
39
+ # IDE - VSCode
40
+ .vscode/*
41
+ !.vscode/settings.json
42
+ !.vscode/tasks.json
43
+ !.vscode/launch.json
44
+ !.vscode/extensions.json
45
+
46
+ # misc
47
+ .sass-cache
48
+ connect.lock
49
+ typings
50
+
51
+ # Logs
52
+ logs
53
+ *.log
54
+ npm-debug.log*
55
+ yarn-debug.log*
56
+ yarn-error.log*
57
+
58
+
59
+ # Dependency directories
60
+ node_modules/
61
+ jspm_packages/
62
+
63
+ # Optional npm cache directory
64
+ .npm
65
+
66
+ # Optional eslint cache
67
+ .eslintcache
68
+
69
+ # Optional REPL history
70
+ .node_repl_history
71
+
72
+ # Output of 'npm pack'
73
+ *.tgz
74
+
75
+ # Yarn Integrity file
76
+ .yarn-integrity
77
+
78
+ # dotenv environment variables file
79
+ .env
80
+
81
+ # next.js build output
82
+ .next
83
+
84
+ # Lerna
85
+ lerna-debug.log
86
+
87
+ # System Files
88
+ .DS_Store
89
+ Thumbs.db
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
3
+ "assist": {
4
+ "actions": {
5
+ "source": {
6
+ "organizeImports": "on"
7
+ }
8
+ }
9
+ },
10
+ "vcs": {
11
+ "enabled": true,
12
+ "clientKind": "git",
13
+ "useIgnoreFile": true
14
+ },
15
+ "formatter": {
16
+ "indentStyle": "space"
17
+ },
18
+ "javascript": {
19
+ "formatter": {
20
+ "quoteStyle": "single"
21
+ }
22
+ },
23
+ "css": {
24
+ "parser": {
25
+ "cssModules": true
26
+ }
27
+ },
28
+ "linter": {
29
+ "enabled": true,
30
+ "rules": {
31
+ "recommended": true
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,11 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>React Rspack</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ </body>
11
+ </html>
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "react-rspack",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "build": "rspack build",
7
+ "check": "biome check --write",
8
+ "dev": "rspack dev",
9
+ "format": "biome format --write",
10
+ "preview": "rspack preview"
11
+ },
12
+ "dependencies": {
13
+ "react": "^19.1.0",
14
+ "react-dom": "^19.1.0"
15
+ },
16
+ "devDependencies": {
17
+ "@biomejs/biome": "2.0.0",
18
+ "@rspack/cli": "^1.4.1",
19
+ "@rspack/core": "^1.4.1",
20
+ "@rspack/plugin-react-refresh": "^1.4.3",
21
+ "@types/react": "^19.1.7",
22
+ "@types/react-dom": "^19.1.6",
23
+ "react-refresh": "^0.17.0"
24
+ }
25
+ }
@@ -0,0 +1,70 @@
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { defineConfig } from "@rspack/cli";
4
+ import { rspack } from "@rspack/core";
5
+ import { ReactRefreshRspackPlugin } from "@rspack/plugin-react-refresh";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const isDev = process.env.NODE_ENV === "development";
9
+
10
+ // Target browsers, see: https://github.com/browserslist/browserslist
11
+ const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];
12
+
13
+ export default defineConfig({
14
+ context: __dirname,
15
+ entry: {
16
+ main: "./src/main.jsx"
17
+ },
18
+ resolve: {
19
+ extensions: ["...", ".ts", ".tsx", ".jsx"]
20
+ },
21
+ module: {
22
+ rules: [
23
+ {
24
+ test: /\.svg$/,
25
+ type: "asset"
26
+ },
27
+ {
28
+ test: /\.(jsx?|tsx?)$/,
29
+ use: [
30
+ {
31
+ loader: "builtin:swc-loader",
32
+ options: {
33
+ jsc: {
34
+ parser: {
35
+ syntax: "typescript",
36
+ tsx: true
37
+ },
38
+ transform: {
39
+ react: {
40
+ runtime: "automatic",
41
+ development: isDev,
42
+ refresh: isDev
43
+ }
44
+ }
45
+ },
46
+ env: { targets }
47
+ }
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ },
53
+ plugins: [
54
+ new rspack.HtmlRspackPlugin({
55
+ template: "./index.html"
56
+ }),
57
+ isDev ? new ReactRefreshRspackPlugin() : null
58
+ ].filter(Boolean),
59
+ optimization: {
60
+ minimizer: [
61
+ new rspack.SwcJsMinimizerRspackPlugin(),
62
+ new rspack.LightningCssMinimizerRspackPlugin({
63
+ minimizerOptions: { targets }
64
+ })
65
+ ]
66
+ },
67
+ experiments: {
68
+ css: true
69
+ }
70
+ });
@@ -0,0 +1,6 @@
1
+ .container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ height: 100vh;
6
+ }
@@ -0,0 +1,19 @@
1
+ import { useState } from 'react'
2
+ import './App.css'
3
+
4
+ function App() {
5
+ const [count, setCount] = useState(0)
6
+
7
+ return (
8
+ <div className="container">
9
+ <img src="https://raw.githubusercontent.com/Sharmaz/enchilada/refs/heads/main/media/enchilada-js-logo.svg" width="250" alt="enchiladajs logo"/>
10
+ <div className="card">
11
+ <button onClick={() => setCount((count) => count + 1)}>
12
+ Enchiladas {count}
13
+ </button>
14
+ </div>
15
+ </div>
16
+ )
17
+ }
18
+
19
+ export default App
@@ -0,0 +1,52 @@
1
+ :root {
2
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 24px;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #262626;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+ body {
16
+ margin: 0;
17
+ display: flex;
18
+ justify-content: center;
19
+ place-items: center;
20
+ min-width: 320px;
21
+ min-height: 100vh;
22
+ }
23
+ h1 {
24
+ font-size: 3.2em;
25
+ line-height: 1.1;
26
+ text-align: center;
27
+ }
28
+ button {
29
+ border-radius: 8px;
30
+ border: 1px solid transparent;
31
+ padding: 8px 16px;
32
+ font-size: 1em;
33
+ font-weight: 400;
34
+ font-family: inherit;
35
+ background-color: #171717;
36
+ line-height: 24px;
37
+ cursor: pointer;
38
+ transition: border-color 0.25s;
39
+ width: 160px;
40
+ }
41
+ button:hover {
42
+ border-color: #FF9811;
43
+ }
44
+ button:focus,
45
+ button:focus-visible {
46
+ outline: 4px auto -webkit-focus-ring-color;
47
+ }
48
+ .card {
49
+ display: flex;
50
+ justify-content: center;
51
+ padding: 2em;
52
+ }
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import ReactDOM from "react-dom/client";
3
+ import App from "./App";
4
+ import "./index.css";
5
+
6
+ ReactDOM.createRoot(document.getElementById("root")).render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );