create-qwik 0.0.7 → 0.0.8

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.
Files changed (27) hide show
  1. package/index.js +64 -64
  2. package/package.json +1 -1
  3. package/starters/apps/starter/package.json +3 -4
  4. package/starters/apps/starter/rollup.config.js +14 -7
  5. package/starters/apps/starter/src/{index.server.qwik.tsx → index.server.tsx} +3 -3
  6. package/starters/apps/starter/src/{my-app.qwik.tsx → my-app.tsx} +0 -0
  7. package/starters/apps/starter-builder/package.json +5 -6
  8. package/starters/apps/starter-builder/rollup.config.js +14 -7
  9. package/starters/apps/starter-builder/src/{index.server.qwik.tsx → index.server.tsx} +3 -3
  10. package/starters/apps/starter-builder/src/{my-app.qwik.tsx → my-app.tsx} +0 -0
  11. package/starters/apps/starter-partytown/package.json +2 -3
  12. package/starters/apps/starter-partytown/rollup.config.js +14 -7
  13. package/starters/apps/starter-partytown/src/{index.server.qwik.tsx → index.server.tsx} +3 -3
  14. package/starters/apps/starter-partytown/src/{my-app.qwik.tsx → my-app.tsx} +0 -0
  15. package/starters/apps/todo/package.json +5 -5
  16. package/starters/apps/todo/rollup.config.js +16 -7
  17. package/starters/apps/todo/src/{components.qwik.tsx → components.tsx} +1 -1
  18. package/starters/apps/todo/src/{index.server.qwik.tsx → index.server.tsx} +6 -6
  19. package/starters/apps/todo/src/{state.qwik.ts → state.ts} +0 -0
  20. package/starters/apps/todo/tsconfig.json +1 -0
  21. package/starters/servers/cloudflare/package.json +19 -0
  22. package/starters/servers/cloudflare/rollup.config.server.js +29 -0
  23. package/starters/servers/cloudflare/src/index.cloudflare.tsx +82 -0
  24. package/starters/servers/cloudflare/workers-site/package.json +4 -0
  25. package/starters/servers/cloudflare/wrangler.toml +18 -0
  26. package/starters/servers/express/package.json +1 -1
  27. package/starters/servers/express/server/index.js +8 -15
package/index.js CHANGED
@@ -5,103 +5,103 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
7
7
  */
8
- var eo=Object.create;var ve=Object.defineProperty;var to=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames,wt=Object.getOwnPropertySymbols,so=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable;var St=(i,e,t)=>e in i?ve(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ne=(i,e)=>{for(var t in e||(e={}))xt.call(e,t)&&St(i,t,e[t]);if(wt)for(var t of wt(e))ro.call(e,t)&&St(i,t,e[t]);return i};var no=i=>ve(i,"__esModule",{value:!0});var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var oo=(i,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of io(e))!xt.call(i,s)&&s!=="default"&&ve(i,s,{get:()=>e[s],enumerable:!(t=to(e,s))||t.enumerable});return i},N=i=>oo(no(ve(i!=null?eo(so(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var m=u((Su,Et)=>{"use strict";var{FORCE_COLOR:ao,NODE_DISABLE_COLORS:co,TERM:fo}=process.env,d={enabled:!co&&fo!=="dumb"&&ao!=="0",reset:p(0,0),bold:p(1,22),dim:p(2,22),italic:p(3,23),underline:p(4,24),inverse:p(7,27),hidden:p(8,28),strikethrough:p(9,29),black:p(30,39),red:p(31,39),green:p(32,39),yellow:p(33,39),blue:p(34,39),magenta:p(35,39),cyan:p(36,39),white:p(37,39),gray:p(90,39),grey:p(90,39),bgBlack:p(40,49),bgRed:p(41,49),bgGreen:p(42,49),bgYellow:p(43,49),bgBlue:p(44,49),bgMagenta:p(45,49),bgCyan:p(46,49),bgWhite:p(47,49)};function jt(i,e){let t=0,s,r="",n="";for(;t<i.length;t++)s=i[t],r+=s.open,n+=s.close,e.includes(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return r+e+n}function po(i,e){let t={has:i,keys:e};return t.reset=d.reset.bind(t),t.bold=d.bold.bind(t),t.dim=d.dim.bind(t),t.italic=d.italic.bind(t),t.underline=d.underline.bind(t),t.inverse=d.inverse.bind(t),t.hidden=d.hidden.bind(t),t.strikethrough=d.strikethrough.bind(t),t.black=d.black.bind(t),t.red=d.red.bind(t),t.green=d.green.bind(t),t.yellow=d.yellow.bind(t),t.blue=d.blue.bind(t),t.magenta=d.magenta.bind(t),t.cyan=d.cyan.bind(t),t.white=d.white.bind(t),t.gray=d.gray.bind(t),t.grey=d.grey.bind(t),t.bgBlack=d.bgBlack.bind(t),t.bgRed=d.bgRed.bind(t),t.bgGreen=d.bgGreen.bind(t),t.bgYellow=d.bgYellow.bind(t),t.bgBlue=d.bgBlue.bind(t),t.bgMagenta=d.bgMagenta.bind(t),t.bgCyan=d.bgCyan.bind(t),t.bgWhite=d.bgWhite.bind(t),t}function p(i,e){let t={open:`[${i}m`,close:`[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(i)||(this.has.push(i),this.keys.push(t)),s===void 0?this:d.enabled?jt(this.keys,s+""):s+""):s===void 0?po([i],[t]):d.enabled?jt([t],s+""):s+""}}Et.exports=d});var Rt=u((Ou,At)=>{"use strict";At.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var Me=u((qu,Ft)=>{"use strict";Ft.exports=i=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var b=u((Mu,Yt)=>{"use strict";var Ve="",g=`${Ve}[`,mo="\x07",Je={to(i,e){return e?`${g}${e+1};${i+1}H`:`${g}${i+1}G`},move(i,e){let t="";return i<0?t+=`${g}${-i}D`:i>0&&(t+=`${g}${i}C`),e<0?t+=`${g}${-e}A`:e>0&&(t+=`${g}${e}B`),t},up:(i=1)=>`${g}${i}A`,down:(i=1)=>`${g}${i}B`,forward:(i=1)=>`${g}${i}C`,backward:(i=1)=>`${g}${i}D`,nextLine:(i=1)=>`${g}E`.repeat(i),prevLine:(i=1)=>`${g}F`.repeat(i),left:`${g}G`,hide:`${g}?25l`,show:`${g}?25h`,save:`${Ve}7`,restore:`${Ve}8`},go={up:(i=1)=>`${g}S`.repeat(i),down:(i=1)=>`${g}T`.repeat(i)},bo={screen:`${g}2J`,up:(i=1)=>`${g}1J`.repeat(i),down:(i=1)=>`${g}J`.repeat(i),line:`${g}2K`,lineEnd:`${g}K`,lineStart:`${g}1K`,lines(i){let e="";for(let t=0;t<i;t++)e+=this.line+(t<i-1?Je.up():"");return i&&(e+=Je.left),e}};Yt.exports={cursor:Je,scroll:go,erase:bo,beep:mo}});var Jt=u((Pu,Vt)=>{"use strict";function vo(i,e){var t=typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=yo(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,h=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw h}}}}function yo(i,e){if(!!i){if(typeof i=="string")return Ht(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ht(i,e)}}function Ht(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var wo=Me(),Nt=b(),Lt=Nt.erase,xo=Nt.cursor,So=i=>[...wo(i)].length;Vt.exports=function(i,e){if(!e)return Lt.line+xo.to(0);let t=0,s=i.split(/\r?\n/);var r=vo(s),n;try{for(r.s();!(n=r.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(So(o)-1,0)/e)}}catch(o){r.e(o)}finally{r.f()}return Lt.lines(t)}});var Ge=u((Tu,Gt)=>{"use strict";var se={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Oo={arrowUp:se.arrowUp,arrowDown:se.arrowDown,arrowLeft:se.arrowLeft,arrowRight:se.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},qo=process.platform==="win32"?Oo:se;Gt.exports=qo});var Bt=u(($u,Ut)=>{"use strict";var W=m(),B=Ge(),Ue=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),Mo=i=>Ue[i]||Ue.default,re=Object.freeze({aborted:W.red(B.cross),done:W.green(B.tick),exited:W.yellow(B.cross),default:W.cyan("?")}),Po=(i,e,t)=>e?re.aborted:t?re.exited:i?re.done:re.default,To=i=>W.gray(i?B.ellipsis:B.pointerSmall),$o=(i,e)=>W.gray(i?e?B.pointerSmall:"+":B.line);Ut.exports={styles:Ue,render:Mo,symbols:re,symbol:Po,delimiter:To,item:$o}});var Wt=u((Cu,zt)=>{"use strict";var Co=Me();zt.exports=function(i,e){let t=String(Co(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var Kt=u((Du,Zt)=>{"use strict";Zt.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=s||n[n.length-1].length+o.length+1<s?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
8
+ var to=Object.create;var ve=Object.defineProperty;var io=Object.getOwnPropertyDescriptor;var ro=Object.getOwnPropertyNames,wt=Object.getOwnPropertySymbols,so=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable;var St=(i,e,t)=>e in i?ve(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,He=(i,e)=>{for(var t in e||(e={}))xt.call(e,t)&&St(i,t,e[t]);if(wt)for(var t of wt(e))no.call(e,t)&&St(i,t,e[t]);return i};var oo=i=>ve(i,"__esModule",{value:!0});var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var lo=(i,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ro(e))!xt.call(i,r)&&r!=="default"&&ve(i,r,{get:()=>e[r],enumerable:!(t=io(e,r))||t.enumerable});return i},L=i=>lo(oo(ve(i!=null?to(so(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var g=u((Cu,Et)=>{"use strict";var{FORCE_COLOR:fo,NODE_DISABLE_COLORS:po,TERM:go}=process.env,d={enabled:!po&&go!=="dumb"&&fo!=="0",reset:p(0,0),bold:p(1,22),dim:p(2,22),italic:p(3,23),underline:p(4,24),inverse:p(7,27),hidden:p(8,28),strikethrough:p(9,29),black:p(30,39),red:p(31,39),green:p(32,39),yellow:p(33,39),blue:p(34,39),magenta:p(35,39),cyan:p(36,39),white:p(37,39),gray:p(90,39),grey:p(90,39),bgBlack:p(40,49),bgRed:p(41,49),bgGreen:p(42,49),bgYellow:p(43,49),bgBlue:p(44,49),bgMagenta:p(45,49),bgCyan:p(46,49),bgWhite:p(47,49)};function jt(i,e){let t=0,r,s="",n="";for(;t<i.length;t++)r=i[t],s+=r.open,n+=r.close,e.includes(r.close)&&(e=e.replace(r.rgx,r.close+r.open));return s+e+n}function mo(i,e){let t={has:i,keys:e};return t.reset=d.reset.bind(t),t.bold=d.bold.bind(t),t.dim=d.dim.bind(t),t.italic=d.italic.bind(t),t.underline=d.underline.bind(t),t.inverse=d.inverse.bind(t),t.hidden=d.hidden.bind(t),t.strikethrough=d.strikethrough.bind(t),t.black=d.black.bind(t),t.red=d.red.bind(t),t.green=d.green.bind(t),t.yellow=d.yellow.bind(t),t.blue=d.blue.bind(t),t.magenta=d.magenta.bind(t),t.cyan=d.cyan.bind(t),t.white=d.white.bind(t),t.gray=d.gray.bind(t),t.grey=d.grey.bind(t),t.bgBlack=d.bgBlack.bind(t),t.bgRed=d.bgRed.bind(t),t.bgGreen=d.bgGreen.bind(t),t.bgYellow=d.bgYellow.bind(t),t.bgBlue=d.bgBlue.bind(t),t.bgMagenta=d.bgMagenta.bind(t),t.bgCyan=d.bgCyan.bind(t),t.bgWhite=d.bgWhite.bind(t),t}function p(i,e){let t={open:`[${i}m`,close:`[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(this.has.includes(i)||(this.has.push(i),this.keys.push(t)),r===void 0?this:d.enabled?jt(this.keys,r+""):r+""):r===void 0?mo([i],[t]):d.enabled?jt([t],r+""):r+""}}Et.exports=d});var Ft=u((Tu,Rt)=>{"use strict";Rt.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var Pe=u(($u,Yt)=>{"use strict";Yt.exports=i=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var b=u((Iu,Nt)=>{"use strict";var Ve="",m=`${Ve}[`,bo="\x07",Je={to(i,e){return e?`${m}${e+1};${i+1}H`:`${m}${i+1}G`},move(i,e){let t="";return i<0?t+=`${m}${-i}D`:i>0&&(t+=`${m}${i}C`),e<0?t+=`${m}${-e}A`:e>0&&(t+=`${m}${e}B`),t},up:(i=1)=>`${m}${i}A`,down:(i=1)=>`${m}${i}B`,forward:(i=1)=>`${m}${i}C`,backward:(i=1)=>`${m}${i}D`,nextLine:(i=1)=>`${m}E`.repeat(i),prevLine:(i=1)=>`${m}F`.repeat(i),left:`${m}G`,hide:`${m}?25l`,show:`${m}?25h`,save:`${Ve}7`,restore:`${Ve}8`},vo={up:(i=1)=>`${m}S`.repeat(i),down:(i=1)=>`${m}T`.repeat(i)},yo={screen:`${m}2J`,up:(i=1)=>`${m}1J`.repeat(i),down:(i=1)=>`${m}J`.repeat(i),line:`${m}2K`,lineEnd:`${m}K`,lineStart:`${m}1K`,lines(i){let e="";for(let t=0;t<i;t++)e+=this.line+(t<i-1?Je.up():"");return i&&(e+=Je.left),e}};Nt.exports={cursor:Je,scroll:vo,erase:yo,beep:bo}});var Gt=u((Du,Jt)=>{"use strict";function wo(i,e){var t=typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=xo(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var r=0,s=function(){};return{s,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(a){throw a},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,l;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,l=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw l}}}}function xo(i,e){if(!!i){if(typeof i=="string")return Ht(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ht(i,e)}}function Ht(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var So=Pe(),Lt=b(),Vt=Lt.erase,Oo=Lt.cursor,qo=i=>[...So(i)].length;Jt.exports=function(i,e){if(!e)return Vt.line+Oo.to(0);let t=0,r=i.split(/\r?\n/);var s=wo(r),n;try{for(s.s();!(n=s.n()).done;){let o=n.value;t+=1+Math.floor(Math.max(qo(o)-1,0)/e)}}catch(o){s.e(o)}finally{s.f()}return Vt.lines(t)}});var Ge=u((_u,Ut)=>{"use strict";var re={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Po={arrowUp:re.arrowUp,arrowDown:re.arrowDown,arrowLeft:re.arrowLeft,arrowRight:re.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Mo=process.platform==="win32"?Po:re;Ut.exports=Mo});var zt=u((ku,Bt)=>{"use strict";var Z=g(),z=Ge(),Ue=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),Co=i=>Ue[i]||Ue.default,se=Object.freeze({aborted:Z.red(z.cross),done:Z.green(z.tick),exited:Z.yellow(z.cross),default:Z.cyan("?")}),To=(i,e,t)=>e?se.aborted:t?se.exited:i?se.done:se.default,$o=i=>Z.gray(i?z.ellipsis:z.pointerSmall),Io=(i,e)=>Z.gray(i?e?z.pointerSmall:"+":z.line);Bt.exports={styles:Ue,render:Co,symbols:se,symbol:To,delimiter:$o,item:Io}});var Zt=u((Au,Wt)=>{"use strict";var Do=Pe();Wt.exports=function(i,e){let t=String(Do(i)||"").split(/\r?\n/);return e?t.map(r=>Math.ceil(r.length/e)).reduce((r,s)=>r+s):t.length}});var Xt=u((ju,Kt)=>{"use strict";Kt.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",r=e.width;return(i||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=r||n[n.length-1].length+o.length+1<r?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
10
10
  `)).join(`
11
- `)}});var Qt=u((Iu,Xt)=>{"use strict";Xt.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var S=u((_u,ei)=>{"use strict";ei.exports={action:Rt(),clear:Jt(),style:Bt(),strip:Me(),figures:Ge(),lines:Wt(),wrap:Kt(),entriesToDisplay:Qt()}});var k=u((ku,ri)=>{"use strict";var ti=require("readline"),Do=S(),Io=Do.action,_o=require("events"),ii=b(),ko=ii.beep,jo=ii.cursor,Eo=m(),si=class extends _o{constructor(e={}){super();this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=ti.createInterface({input:this.in,escapeCodeTimeout:50});ti.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(n,o)=>{let h=Io(o,s);h===!1?this._&&this._(n,o):typeof this[h]=="function"?this[h](o):this.bell()};this.close=()=>{this.out.write(jo.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(ko)}render(){this.onRender(Eo),this.firstRender&&(this.firstRender=!1)}};ri.exports=si});var ai=u((ju,ui)=>{"use strict";function ni(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function oi(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){ni(n,s,r,o,h,"next",l)}function h(l){ni(n,s,r,o,h,"throw",l)}o(void 0)})}}var Pe=m(),Ao=k(),hi=b(),Ro=hi.erase,ne=hi.cursor,Te=S(),Be=Te.style,ze=Te.clear,Fo=Te.lines,Yo=Te.figures,li=class extends Ao{constructor(e={}){super(e);this.transform=Be.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=ze("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Pe.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
12
- `),this.close()}validate(){var e=this;return oi(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return oi(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
13
- `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ne.down(Fo(this.outputError,this.out.columns)-1)+ze(this.outputError,this.out.columns)),this.out.write(ze(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Be.symbol(this.done,this.aborted),Pe.bold(this.msg),Be.delimiter(this.done),this.red?Pe.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
14
- `).reduce((e,t,s)=>e+`
15
- ${s?" ":Yo.pointerSmall} ${Pe.red().italic(t)}`,"")),this.out.write(Ro.line+ne.to(0)+this.outputText+ne.save+this.outputError+ne.restore+ne.move(this.cursorOffset,0)))}};ui.exports=li});var mi=u((Eu,pi)=>{"use strict";var j=m(),Ho=k(),oe=S(),ci=oe.style,di=oe.clear,$e=oe.figures,No=oe.wrap,Lo=oe.entriesToDisplay,Vo=b(),Jo=Vo.cursor,fi=class extends Ho{constructor(e={}){super(e);this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=di("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
11
+ `)}});var ei=u((Eu,Qt)=>{"use strict";Qt.exports=(i,e,t)=>{t=t||e;let r=Math.min(e-t,i-Math.floor(t/2));r<0&&(r=0);let s=Math.min(r+t,e);return{startIndex:r,endIndex:s}}});var S=u((Ru,ti)=>{"use strict";ti.exports={action:Ft(),clear:Gt(),style:zt(),strip:Pe(),figures:Ge(),lines:Zt(),wrap:Xt(),entriesToDisplay:ei()}});var k=u((Fu,ni)=>{"use strict";var ii=require("readline"),_o=S(),ko=_o.action,Ao=require("events"),ri=b(),jo=ri.beep,Eo=ri.cursor,Ro=g(),si=class extends Ao{constructor(e={}){super();this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=ii.createInterface({input:this.in,escapeCodeTimeout:50});ii.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let r=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let l=ko(o,r);l===!1?this._&&this._(n,o):typeof this[l]=="function"?this[l](o):this.bell()};this.close=()=>{this.out.write(Eo.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(jo)}render(){this.onRender(Ro),this.firstRender&&(this.firstRender=!1)}};ni.exports=si});var ci=u((Yu,ai)=>{"use strict";function oi(i,e,t,r,s,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(r,s)}function li(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function o(h){oi(n,r,s,o,l,"next",h)}function l(h){oi(n,r,s,o,l,"throw",h)}o(void 0)})}}var Me=g(),Fo=k(),hi=b(),Yo=hi.erase,ne=hi.cursor,Ce=S(),Be=Ce.style,ze=Ce.clear,No=Ce.lines,Ho=Ce.figures,ui=class extends Fo{constructor(e={}){super(e);this.transform=Be.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=ze("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Me.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
12
+ `),this.close()}validate(){var e=this;return li(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return li(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
13
+ `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let r=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${r}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:r.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ne.down(No(this.outputError,this.out.columns)-1)+ze(this.outputError,this.out.columns)),this.out.write(ze(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Be.symbol(this.done,this.aborted),Me.bold(this.msg),Be.delimiter(this.done),this.red?Me.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
14
+ `).reduce((e,t,r)=>e+`
15
+ ${r?" ":Ho.pointerSmall} ${Me.red().italic(t)}`,"")),this.out.write(Yo.line+ne.to(0)+this.outputText+ne.save+this.outputError+ne.restore+ne.move(this.cursorOffset,0)))}};ai.exports=ui});var mi=u((Nu,gi)=>{"use strict";var A=g(),Lo=k(),oe=S(),di=oe.style,fi=oe.clear,Te=oe.figures,Vo=oe.wrap,Jo=oe.entriesToDisplay,Go=b(),Uo=Go.cursor,pi=class extends Lo{constructor(e={}){super(e);this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,r)=>(typeof t=="string"&&(t={title:t,value:r}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=fi("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
16
16
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
17
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Jo.hide):this.out.write(di(this.outputText,this.out.columns)),super.render();let e=Lo(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[ci.symbol(this.done,this.aborted),j.bold(this.msg),ci.delimiter(!1),this.done?this.selection.title:this.selection.disabled?j.yellow(this.warn):j.gray(this.hint)].join(" "),!this.done){this.outputText+=`
18
- `;for(let r=t;r<s;r++){let n,o,h="",l=this.choices[r];r===t&&t>0?o=$e.arrowUp:r===s-1&&s<this.choices.length?o=$e.arrowDown:o=" ",l.disabled?(n=this.cursor===r?j.gray().underline(l.title):j.strikethrough().gray(l.title),o=(this.cursor===r?j.bold().gray($e.pointer)+" ":" ")+o):(n=this.cursor===r?j.cyan().underline(l.title):l.title,o=(this.cursor===r?j.cyan($e.pointer)+" ":" ")+o,l.description&&this.cursor===r&&(h=` - ${l.description}`,(o.length+n.length+h.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(h=`
19
- `+No(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${j.gray(h)}
20
- `}}this.out.write(this.outputText)}};pi.exports=fi});var Si=u((Au,xi)=>{"use strict";var Ce=m(),Go=k(),gi=S(),bi=gi.style,Uo=gi.clear,vi=b(),yi=vi.cursor,Bo=vi.erase,wi=class extends Go{constructor(e={}){super(e);this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
17
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Uo.hide):this.out.write(fi(this.outputText,this.out.columns)),super.render();let e=Jo(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,r=e.endIndex;if(this.outputText=[di.symbol(this.done,this.aborted),A.bold(this.msg),di.delimiter(!1),this.done?this.selection.title:this.selection.disabled?A.yellow(this.warn):A.gray(this.hint)].join(" "),!this.done){this.outputText+=`
18
+ `;for(let s=t;s<r;s++){let n,o,l="",h=this.choices[s];s===t&&t>0?o=Te.arrowUp:s===r-1&&r<this.choices.length?o=Te.arrowDown:o=" ",h.disabled?(n=this.cursor===s?A.gray().underline(h.title):A.strikethrough().gray(h.title),o=(this.cursor===s?A.bold().gray(Te.pointer)+" ":" ")+o):(n=this.cursor===s?A.cyan().underline(h.title):h.title,o=(this.cursor===s?A.cyan(Te.pointer)+" ":" ")+o,h.description&&this.cursor===s&&(l=` - ${h.description}`,(o.length+n.length+l.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(l=`
19
+ `+Vo(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${A.gray(l)}
20
+ `}}this.out.write(this.outputText)}};gi.exports=pi});var Oi=u((Hu,Si)=>{"use strict";var $e=g(),Bo=k(),bi=S(),vi=bi.style,zo=bi.clear,yi=b(),wi=yi.cursor,Wo=yi.erase,xi=class extends Bo{constructor(e={}){super(e);this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
21
21
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
22
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(yi.hide):this.out.write(Uo(this.outputText,this.out.columns)),super.render(),this.outputText=[bi.symbol(this.done,this.aborted),Ce.bold(this.msg),bi.delimiter(this.done),this.value?this.inactive:Ce.cyan().underline(this.inactive),Ce.gray("/"),this.value?Ce.cyan().underline(this.active):this.active].join(" "),this.out.write(Bo.line+yi.to(0)+this.outputText))}};xi.exports=wi});var P=u((Ru,Oi)=>{"use strict";var he=class{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof he)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof he)}toString(){return String(this.date)}};Oi.exports=he});var Pi=u((Fu,Mi)=>{"use strict";var zo=P(),qi=class extends zo{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};Mi.exports=qi});var Ci=u((Yu,$i)=>{"use strict";var Wo=P(),Zo=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Ti=class extends Wo{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Zo(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};$i.exports=Ti});var _i=u((Hu,Ii)=>{"use strict";var Ko=P(),Di=class extends Ko{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Ii.exports=Di});var Ei=u((Nu,ji)=>{"use strict";var Xo=P(),ki=class extends Xo{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};ji.exports=ki});var Fi=u((Lu,Ri)=>{"use strict";var Qo=P(),Ai=class extends Qo{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Ri.exports=Ai});var Ni=u((Vu,Hi)=>{"use strict";var eh=P(),Yi=class extends eh{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Hi.exports=Yi});var Ji=u((Ju,Vi)=>{"use strict";var th=P(),Li=class extends th{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Vi.exports=Li});var Bi=u((Gu,Ui)=>{"use strict";var ih=P(),Gi=class extends ih{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Ui.exports=Gi});var Wi=u((Uu,zi)=>{"use strict";zi.exports={DatePart:P(),Meridiem:Pi(),Day:Ci(),Hours:_i(),Milliseconds:Ei(),Minutes:Fi(),Month:Ni(),Seconds:Ji(),Year:Bi()}});var os=u((Bu,ns)=>{"use strict";function Zi(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Ki(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){Zi(n,s,r,o,h,"next",l)}function h(l){Zi(n,s,r,o,h,"throw",l)}o(void 0)})}}var We=m(),sh=k(),Ze=S(),Xi=Ze.style,Qi=Ze.clear,rh=Ze.figures,es=b(),nh=es.erase,ts=es.cursor,E=Wi(),is=E.DatePart,oh=E.Meridiem,hh=E.Day,lh=E.Hours,uh=E.Milliseconds,ah=E.Minutes,ch=E.Month,dh=E.Seconds,fh=E.Year,ph=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,ss={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new hh(i),3:i=>new ch(i),4:i=>new fh(i),5:i=>new oh(i),6:i=>new lh(i),7:i=>new ah(i),8:i=>new dh(i),9:i=>new uh(i)},mh={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(",")},rs=class extends sh{constructor(e={}){super(e);this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(mh,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Qi("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=ph.exec(e);){let r=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in ss?ss[n]({token:t[n]||r,date:this.date,parts:this.parts,locales:this.locales}):t[n]||r)}let s=this.parts.reduce((r,n)=>(typeof n=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=n:r.push(n),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof is)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
23
- `),this.close()}validate(){var e=this;return Ki(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Ki(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
24
- `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof is)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(ts.hide):this.out.write(Qi(this.outputText,this.out.columns)),super.render(),this.outputText=[Xi.symbol(this.done,this.aborted),We.bold(this.msg),Xi.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?We.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
25
- `).reduce((e,t,s)=>e+`
26
- ${s?" ":rh.pointerSmall} ${We.red().italic(t)}`,"")),this.out.write(nh.line+ts.to(0)+this.outputText))}};ns.exports=rs});var ps=u((zu,fs)=>{"use strict";function hs(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function ls(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){hs(n,s,r,o,h,"next",l)}function h(l){hs(n,s,r,o,h,"throw",l)}o(void 0)})}}var De=m(),gh=k(),us=b(),Ie=us.cursor,bh=us.erase,_e=S(),Ke=_e.style,vh=_e.figures,as=_e.clear,yh=_e.lines,wh=/[0-9]/,Xe=i=>i!==void 0,cs=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},ds=class extends gh{constructor(e={}){super(e);this.transform=Ke.render(e.style),this.msg=e.message,this.initial=Xe(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Xe(e.min)?e.min:-1/0,this.max=Xe(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=De.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${cs(e,this.round)}`),this._value=cs(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||wh.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
27
- `),this.close()}validate(){var e=this;return ls(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ls(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let t=e.value;e.value=t!==""?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
28
- `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Ie.down(yh(this.outputError,this.out.columns)-1)+as(this.outputError,this.out.columns)),this.out.write(as(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ke.symbol(this.done,this.aborted),De.bold(this.msg),Ke.delimiter(this.done),!this.done||!this.done&&!this.placeholder?De[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
29
- `).reduce((e,t,s)=>e+`
30
- ${s?" ":vh.pointerSmall} ${De.red().italic(t)}`,"")),this.out.write(bh.line+Ie.to(0)+this.outputText+Ie.save+this.outputError+Ie.restore))}};fs.exports=ds});var Qe=u((Wu,vs)=>{"use strict";var T=m(),xh=b(),Sh=xh.cursor,Oh=k(),le=S(),ms=le.clear,L=le.figures,gs=le.style,qh=le.wrap,Mh=le.entriesToDisplay,bs=class extends Oh{constructor(e={}){super(e);this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=ms("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
22
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(wi.hide):this.out.write(zo(this.outputText,this.out.columns)),super.render(),this.outputText=[vi.symbol(this.done,this.aborted),$e.bold(this.msg),vi.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(Wo.line+wi.to(0)+this.outputText))}};Si.exports=xi});var M=u((Lu,qi)=>{"use strict";var le=class{constructor({token:e,date:t,parts:r,locales:s}){this.token=e,this.date=t||new Date,this.parts=r||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,r)=>r>e&&t instanceof le)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((r,s)=>s>t&&r instanceof le)}toString(){return String(this.date)}};qi.exports=le});var Ci=u((Vu,Mi)=>{"use strict";var Zo=M(),Pi=class extends Zo{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};Mi.exports=Pi});var Ii=u((Ju,$i)=>{"use strict";var Ko=M(),Xo=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Ti=class extends Ko{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Xo(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};$i.exports=Ti});var ki=u((Gu,_i)=>{"use strict";var Qo=M(),Di=class extends Qo{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};_i.exports=Di});var Ei=u((Uu,ji)=>{"use strict";var el=M(),Ai=class extends el{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};ji.exports=Ai});var Yi=u((Bu,Fi)=>{"use strict";var tl=M(),Ri=class extends tl{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Fi.exports=Ri});var Li=u((zu,Hi)=>{"use strict";var il=M(),Ni=class extends il{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Hi.exports=Ni});var Gi=u((Wu,Ji)=>{"use strict";var rl=M(),Vi=class extends rl{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ji.exports=Vi});var zi=u((Zu,Bi)=>{"use strict";var sl=M(),Ui=class extends sl{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Bi.exports=Ui});var Zi=u((Ku,Wi)=>{"use strict";Wi.exports={DatePart:M(),Meridiem:Ci(),Day:Ii(),Hours:ki(),Milliseconds:Ei(),Minutes:Yi(),Month:Li(),Seconds:Gi(),Year:zi()}});var lr=u((Xu,or)=>{"use strict";function Ki(i,e,t,r,s,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(r,s)}function Xi(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function o(h){Ki(n,r,s,o,l,"next",h)}function l(h){Ki(n,r,s,o,l,"throw",h)}o(void 0)})}}var We=g(),nl=k(),Ze=S(),Qi=Ze.style,er=Ze.clear,ol=Ze.figures,tr=b(),ll=tr.erase,ir=tr.cursor,j=Zi(),rr=j.DatePart,hl=j.Meridiem,ul=j.Day,al=j.Hours,cl=j.Milliseconds,dl=j.Minutes,fl=j.Month,pl=j.Seconds,gl=j.Year,ml=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,sr={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new ul(i),3:i=>new fl(i),4:i=>new gl(i),5:i=>new hl(i),6:i=>new al(i),7:i=>new dl(i),8:i=>new pl(i),9:i=>new cl(i)},bl={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(",")},nr=class extends nl{constructor(e={}){super(e);this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(bl,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=er("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=ml.exec(e);){let s=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in sr?sr[n]({token:t[n]||s,date:this.date,parts:this.parts,locales:this.locales}):t[n]||s)}let r=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...r),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof rr)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
23
+ `),this.close()}validate(){var e=this;return Xi(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Xi(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
24
+ `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof rr)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(ir.hide):this.out.write(er(this.outputText,this.out.columns)),super.render(),this.outputText=[Qi.symbol(this.done,this.aborted),We.bold(this.msg),Qi.delimiter(!1),this.parts.reduce((e,t,r)=>e.concat(r===this.cursor&&!this.done?We.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
25
+ `).reduce((e,t,r)=>e+`
26
+ ${r?" ":ol.pointerSmall} ${We.red().italic(t)}`,"")),this.out.write(ll.line+ir.to(0)+this.outputText))}};or.exports=nr});var gr=u((Qu,pr)=>{"use strict";function hr(i,e,t,r,s,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(r,s)}function ur(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function o(h){hr(n,r,s,o,l,"next",h)}function l(h){hr(n,r,s,o,l,"throw",h)}o(void 0)})}}var Ie=g(),vl=k(),ar=b(),De=ar.cursor,yl=ar.erase,_e=S(),Ke=_e.style,wl=_e.figures,cr=_e.clear,xl=_e.lines,Sl=/[0-9]/,Xe=i=>i!==void 0,dr=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},fr=class extends vl{constructor(e={}){super(e);this.transform=Ke.render(e.style),this.msg=e.message,this.initial=Xe(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Xe(e.min)?e.min:-1/0,this.max=Xe(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Ie.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${dr(e,this.round)}`),this._value=dr(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||Sl.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
27
+ `),this.close()}validate(){var e=this;return ur(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ur(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let t=e.value;e.value=t!==""?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
28
+ `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let r=Date.now();if(r-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=r,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(De.down(xl(this.outputError,this.out.columns)-1)+cr(this.outputError,this.out.columns)),this.out.write(cr(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ke.symbol(this.done,this.aborted),Ie.bold(this.msg),Ke.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Ie[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
29
+ `).reduce((e,t,r)=>e+`
30
+ ${r?" ":wl.pointerSmall} ${Ie.red().italic(t)}`,"")),this.out.write(yl.line+De.to(0)+this.outputText+De.save+this.outputError+De.restore))}};pr.exports=fr});var Qe=u((ea,yr)=>{"use strict";var C=g(),Ol=b(),ql=Ol.cursor,Pl=k(),he=S(),mr=he.clear,V=he.figures,br=he.style,Ml=he.wrap,Cl=he.entriesToDisplay,vr=class extends Pl{constructor(e={}){super(e);this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,r)=>(typeof t=="string"&&(t={title:t,value:r}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=mr("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
31
31
  `),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
32
32
  `),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(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
33
33
  Instructions:
34
- ${L.arrowUp}/${L.arrowDown}: Highlight option
35
- ${L.arrowLeft}/${L.arrowRight}/[space]: Toggle selection
34
+ ${V.arrowUp}/${V.arrowDown}: Highlight option
35
+ ${V.arrowLeft}/${V.arrowRight}/[space]: Toggle selection
36
36
  `+(this.maxChoices===void 0?` a: Toggle all
37
- `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let n=(t.selected?T.green(L.radioOn):L.radioOff)+" "+r+" ",o,h;return t.disabled?o=e===s?T.gray().underline(t.title):T.strikethrough().gray(t.title):(o=e===s?T.cyan().underline(t.title):t.title,e===s&&t.description&&(h=` - ${t.description}`,(n.length+o.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h=`
38
- `+qh(t.description,{margin:n.length,width:this.out.columns})))),n+o+T.gray(h||"")}paginateOptions(e){if(e.length===0)return T.red("No matches for this query.");let t=Mh(this.cursor,e.length,this.optionsPerPage),s=t.startIndex,r=t.endIndex,n,o=[];for(let h=s;h<r;h++)h===s&&s>0?n=L.arrowUp:h===r-1&&r<e.length?n=L.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[h],h,n));return`
37
+ `:"")+" enter/return: Complete answer":""}renderOption(e,t,r,s){let n=(t.selected?C.green(V.radioOn):V.radioOff)+" "+s+" ",o,l;return t.disabled?o=e===r?C.gray().underline(t.title):C.strikethrough().gray(t.title):(o=e===r?C.cyan().underline(t.title):t.title,e===r&&t.description&&(l=` - ${t.description}`,(n.length+o.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
38
+ `+Ml(t.description,{margin:n.length,width:this.out.columns})))),n+o+C.gray(l||"")}paginateOptions(e){if(e.length===0)return C.red("No matches for this query.");let t=Cl(this.cursor,e.length,this.optionsPerPage),r=t.startIndex,s=t.endIndex,n,o=[];for(let l=r;l<s;l++)l===r&&r>0?n=V.arrowUp:l===s-1&&s<e.length?n=V.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[l],l,n));return`
39
39
  `+o.join(`
40
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[T.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(T.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Sh.hide),super.render();let e=[gs.symbol(this.done,this.aborted),T.bold(this.msg),gs.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=T.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ms(e,this.out.columns)}};vs.exports=bs});var Ps=u((Zu,Ms)=>{"use strict";function ys(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Ph(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){ys(n,s,r,o,h,"next",l)}function h(l){ys(n,s,r,o,h,"throw",l)}o(void 0)})}}var ue=m(),Th=k(),ws=b(),$h=ws.erase,xs=ws.cursor,ae=S(),et=ae.style,Ss=ae.clear,tt=ae.figures,Ch=ae.wrap,Dh=ae.entriesToDisplay,Os=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),Ih=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),_h=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},qs=class extends Th{constructor(e={}){super(e);this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:_h(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=et.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Ss("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Os(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return Ph(function*(){let s=t.completing=t.suggest(t.input,t.choices),r=yield s;if(t.completing!==s)return;t.suggestions=r.map((o,h,l)=>({title:Ih(l,h),value:Os(l,h),description:o.description})),t.completing=!1;let n=Math.max(r.length-1,0);t.moveSelect(Math.min(n,t.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
40
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[C.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(C.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ql.hide),super.render();let e=[br.symbol(this.done,this.aborted),C.bold(this.msg),br.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=C.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=mr(e,this.out.columns)}};yr.exports=vr});var Cr=u((ta,Mr)=>{"use strict";function wr(i,e,t,r,s,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(r,s)}function Tl(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function o(h){wr(n,r,s,o,l,"next",h)}function l(h){wr(n,r,s,o,l,"throw",h)}o(void 0)})}}var ue=g(),$l=k(),xr=b(),Il=xr.erase,Sr=xr.cursor,ae=S(),et=ae.style,Or=ae.clear,tt=ae.figures,Dl=ae.wrap,_l=ae.entriesToDisplay,qr=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),kl=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),Al=(i,e)=>{let t=i.findIndex(r=>r.value===e||r.title===e);return t>-1?t:void 0},Pr=class extends $l{constructor(e={}){super(e);this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Al(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=et.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Or("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=qr(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return Tl(function*(){let r=t.completing=t.suggest(t.input,t.choices),s=yield r;if(t.completing!==r)return;t.suggestions=s.map((o,l,h)=>({title:kl(h,l),value:qr(h,l),description:o.description})),t.completing=!1;let n=Math.max(s.length-1,0);t.moveSelect(Math.min(n,t.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
41
41
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
42
42
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
43
- `),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${e}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,s,r){let n,o=s?tt.arrowUp:r?tt.arrowDown:" ",h=t?ue.cyan().underline(e.title):e.title;return o=(t?ue.cyan(tt.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+h.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
44
- `+Ch(e.description,{margin:3,width:this.out.columns}))),o+" "+h+ue.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(xs.hide):this.out.write(Ss(this.outputText,this.out.columns)),super.render();let e=Dh(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[et.symbol(this.done,this.aborted,this.exited),ue.bold(this.msg),et.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let r=this.suggestions.slice(t,s).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===s-1&&s<this.choices.length)).join(`
43
+ `),this.close()}_(e,t){let r=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${r}${e}${s}`,this.cursor=r.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,r,s){let n,o=r?tt.arrowUp:s?tt.arrowDown:" ",l=t?ue.cyan().underline(e.title):e.title;return o=(t?ue.cyan(tt.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+l.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
44
+ `+Dl(e.description,{margin:3,width:this.out.columns}))),o+" "+l+ue.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Sr.hide):this.out.write(Or(this.outputText,this.out.columns)),super.render();let e=_l(this.select,this.choices.length,this.limit),t=e.startIndex,r=e.endIndex;if(this.outputText=[et.symbol(this.done,this.aborted,this.exited),ue.bold(this.msg),et.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(t,r).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===r-1&&r<this.choices.length)).join(`
45
45
  `);this.outputText+=`
46
- `+(r||ue.gray(this.fallback.title))}this.out.write($h.line+xs.to(0)+this.outputText)}};Ms.exports=qs});var Is=u((Ku,Ds)=>{"use strict";var A=m(),kh=b(),jh=kh.cursor,Eh=Qe(),it=S(),Ts=it.clear,$s=it.style,Z=it.figures,Cs=class extends Eh{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Ts("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
46
+ `+(s||ue.gray(this.fallback.title))}this.out.write(Il.line+Sr.to(0)+this.outputText)}};Mr.exports=Pr});var _r=u((ia,Dr)=>{"use strict";var E=g(),jl=b(),El=jl.cursor,Rl=Qe(),it=S(),Tr=it.clear,$r=it.style,K=it.figures,Ir=class extends Rl{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Tr("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(r=>this.inputValue?!!(typeof r.title=="string"&&r.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof r.value=="string"&&r.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(r=>r===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
47
47
  Instructions:
48
- ${Z.arrowUp}/${Z.arrowDown}: Highlight option
49
- ${Z.arrowLeft}/${Z.arrowRight}/[space]: Toggle selection
48
+ ${K.arrowUp}/${K.arrowDown}: Highlight option
49
+ ${K.arrowLeft}/${K.arrowRight}/[space]: Toggle selection
50
50
  [a,b,c]/delete: Filter choices
51
51
  enter/return: Complete answer
52
52
  `:""}renderCurrentInput(){return`
53
- Filtered results for: ${this.inputValue?this.inputValue:A.gray("Enter something to filter")}
54
- `}renderOption(e,t,s){let r;return t.disabled?r=e===s?A.gray().underline(t.title):A.strikethrough().gray(t.title):r=e===s?A.cyan().underline(t.title):t.title,(t.selected?A.green(Z.radioOn):Z.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[A.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(A.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(jh.hide),super.render();let e=[$s.symbol(this.done,this.aborted),A.bold(this.msg),$s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=A.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Ts(e,this.out.columns)}};Ds.exports=Cs});var Ys=u((Xu,Fs)=>{"use strict";var _s=m(),Ah=k(),ks=S(),js=ks.style,Rh=ks.clear,Es=b(),Fh=Es.erase,As=Es.cursor,Rs=class extends Ah{constructor(e={}){super(e);this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
53
+ Filtered results for: ${this.inputValue?this.inputValue:E.gray("Enter something to filter")}
54
+ `}renderOption(e,t,r){let s;return t.disabled?s=e===r?E.gray().underline(t.title):E.strikethrough().gray(t.title):s=e===r?E.cyan().underline(t.title):t.title,(t.selected?E.green(K.radioOn):K.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[E.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(E.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(El.hide),super.render();let e=[$r.symbol(this.done,this.aborted),E.bold(this.msg),$r.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=E.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Tr(e,this.out.columns)}};Dr.exports=Ir});var Nr=u((ra,Yr)=>{"use strict";var kr=g(),Fl=k(),Ar=S(),jr=Ar.style,Yl=Ar.clear,Er=b(),Nl=Er.erase,Rr=Er.cursor,Fr=class extends Fl{constructor(e={}){super(e);this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
55
55
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
56
- `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(As.hide):this.out.write(Rh(this.outputText,this.out.columns)),super.render(),this.outputText=[js.symbol(this.done,this.aborted),_s.bold(this.msg),js.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:_s.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Fh.line+As.to(0)+this.outputText))}};Fs.exports=Rs});var Ns=u((Qu,Hs)=>{"use strict";Hs.exports={TextPrompt:ai(),SelectPrompt:mi(),TogglePrompt:Si(),DatePrompt:os(),NumberPrompt:ps(),MultiselectPrompt:Qe(),AutocompletePrompt:Ps(),AutocompleteMultiselectPrompt:Is(),ConfirmPrompt:Ys()}});var Vs=u(Ls=>{"use strict";var w=Ls,Yh=Ns(),ke=i=>i;function $(i,e,t={}){return new Promise((s,r)=>{let n=new Yh[i](e),o=t.onAbort||ke,h=t.onSubmit||ke,l=t.onExit||ke;n.on("state",e.onState||ke),n.on("submit",a=>s(h(a))),n.on("exit",a=>s(l(a))),n.on("abort",a=>r(o(a)))})}w.text=i=>$("TextPrompt",i);w.password=i=>(i.style="password",w.text(i));w.invisible=i=>(i.style="invisible",w.text(i));w.number=i=>$("NumberPrompt",i);w.date=i=>$("DatePrompt",i);w.confirm=i=>$("ConfirmPrompt",i);w.list=i=>{let e=i.separator||",";return $("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};w.toggle=i=>$("TogglePrompt",i);w.select=i=>$("SelectPrompt",i);w.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return $("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};w.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return $("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Hh=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));w.autocomplete=i=>(i.suggest=i.suggest||Hh,i.choices=[].concat(i.choices||[]),$("AutocompletePrompt",i))});var Ks=u((ta,Zs)=>{"use strict";function Js(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function Gs(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Js(Object(t),!0).forEach(function(s){Nh(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Js(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function Nh(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Lh(i,e){var t=typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Vh(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,h=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw h}}}}function Vh(i,e){if(!!i){if(typeof i=="string")return Us(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Us(i,e)}}function Us(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}function Bs(i,e,t,s,r,n,o){try{var h=i[n](o),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function zs(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function o(l){Bs(n,s,r,o,h,"next",l)}function h(l){Bs(n,s,r,o,h,"throw",l)}o(void 0)})}}var st=Vs(),Jh=["suggest","format","onState","validate","onRender","type"],Ws=()=>{};function V(){return rt.apply(this,arguments)}function rt(){return rt=zs(function*(i=[],{onSubmit:e=Ws,onCancel:t=Ws}={}){let s={},r=V._override||{};i=[].concat(i);let n,o,h,l,a,Q,ee=function(){var H=zs(function*(_,be,yt=!1){if(!(!yt&&_.validate&&_.validate(be)!==!0))return _.format?yield _.format(be,s):be});return function(be,yt){return H.apply(this,arguments)}}();var v=Lh(i),q;try{for(v.s();!(q=v.n()).done;){o=q.value;var ge=o;if(l=ge.name,a=ge.type,typeof a=="function"&&(a=yield a(n,Gs({},s),o),o.type=a),!!a){for(let H in o){if(Jh.includes(H))continue;let _=o[H];o[H]=typeof _=="function"?yield _(n,Gs({},s),Q):_}if(Q=o,typeof o.message!="string")throw new Error("prompt message is required");var vt=o;if(l=vt.name,a=vt.type,st[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[o.name]!==void 0&&(n=yield ee(o,r[o.name]),n!==void 0)){s[l]=n;continue}try{n=V._injected?Gh(V._injected,o.initial):yield st[a](o),s[l]=n=yield ee(o,n,!0),h=yield e(o,n,s)}catch(H){h=!(yield t(o,s))}if(h)return s}}}catch(H){v.e(H)}finally{v.f()}return s}),rt.apply(this,arguments)}function Gh(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function Uh(i){V._injected=(V._injected||[]).concat(i)}function Bh(i){V._override=Object.assign({},i)}Zs.exports=Object.assign(V,{prompt:V,prompts:st,inject:Uh,override:Bh})});var Qs=u((ia,Xs)=>{"use strict";Xs.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var je=u((sa,er)=>{"use strict";er.exports=i=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var sr=u((ra,ir)=>{"use strict";var zh=je(),{erase:tr,cursor:Wh}=b(),Zh=i=>[...zh(i)].length;ir.exports=function(i,e){if(!e)return tr.line+Wh.to(0);let t=0,s=i.split(/\r?\n/);for(let r of s)t+=1+Math.floor(Math.max(Zh(r)-1,0)/e);return tr.lines(t)}});var nt=u((na,rr)=>{"use strict";var ce={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Kh={arrowUp:ce.arrowUp,arrowDown:ce.arrowDown,arrowLeft:ce.arrowLeft,arrowRight:ce.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Xh=process.platform==="win32"?Kh:ce;rr.exports=Xh});var or=u((oa,nr)=>{"use strict";var K=m(),z=nt(),ot=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),Qh=i=>ot[i]||ot.default,de=Object.freeze({aborted:K.red(z.cross),done:K.green(z.tick),exited:K.yellow(z.cross),default:K.cyan("?")}),el=(i,e,t)=>e?de.aborted:t?de.exited:i?de.done:de.default,tl=i=>K.gray(i?z.ellipsis:z.pointerSmall),il=(i,e)=>K.gray(i?e?z.pointerSmall:"+":z.line);nr.exports={styles:ot,render:Qh,symbols:de,symbol:el,delimiter:tl,item:il}});var lr=u((ha,hr)=>{"use strict";var sl=je();hr.exports=function(i,e){let t=String(sl(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var ar=u((la,ur)=>{"use strict";ur.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=s||n[n.length-1].length+o.length+1<s?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
56
+ `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Rr.hide):this.out.write(Yl(this.outputText,this.out.columns)),super.render(),this.outputText=[jr.symbol(this.done,this.aborted),kr.bold(this.msg),jr.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:kr.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Nl.line+Rr.to(0)+this.outputText))}};Yr.exports=Fr});var Lr=u((sa,Hr)=>{"use strict";Hr.exports={TextPrompt:ci(),SelectPrompt:mi(),TogglePrompt:Oi(),DatePrompt:lr(),NumberPrompt:gr(),MultiselectPrompt:Qe(),AutocompletePrompt:Cr(),AutocompleteMultiselectPrompt:_r(),ConfirmPrompt:Nr()}});var Jr=u(Vr=>{"use strict";var w=Vr,Hl=Lr(),ke=i=>i;function T(i,e,t={}){return new Promise((r,s)=>{let n=new Hl[i](e),o=t.onAbort||ke,l=t.onSubmit||ke,h=t.onExit||ke;n.on("state",e.onState||ke),n.on("submit",a=>r(l(a))),n.on("exit",a=>r(h(a))),n.on("abort",a=>s(o(a)))})}w.text=i=>T("TextPrompt",i);w.password=i=>(i.style="password",w.text(i));w.invisible=i=>(i.style="invisible",w.text(i));w.number=i=>T("NumberPrompt",i);w.date=i=>T("DatePrompt",i);w.confirm=i=>T("ConfirmPrompt",i);w.list=i=>{let e=i.separator||",";return T("TextPrompt",i,{onSubmit:t=>t.split(e).map(r=>r.trim())})};w.toggle=i=>T("TogglePrompt",i);w.select=i=>T("SelectPrompt",i);w.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(r=>r.selected).map(r=>r.value);return T("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};w.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(r=>r.selected).map(r=>r.value);return T("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Ll=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));w.autocomplete=i=>(i.suggest=i.suggest||Ll,i.choices=[].concat(i.choices||[]),T("AutocompletePrompt",i))});var Xr=u((oa,Kr)=>{"use strict";function Gr(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,r)}return t}function Ur(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(t),!0).forEach(function(r){Vl(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function Vl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Jl(i,e){var t=typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Gl(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var r=0,s=function(){};return{s,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(a){throw a},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,l;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return n=a.done,a},e:function(a){o=!0,l=a},f:function(){try{!n&&t.return!=null&&t.return()}finally{if(o)throw l}}}}function Gl(i,e){if(!!i){if(typeof i=="string")return Br(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Br(i,e)}}function Br(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function zr(i,e,t,r,s,n,o){try{var l=i[n](o),h=l.value}catch(a){t(a);return}l.done?e(h):Promise.resolve(h).then(r,s)}function Wr(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function o(h){zr(n,r,s,o,l,"next",h)}function l(h){zr(n,r,s,o,l,"throw",h)}o(void 0)})}}var rt=Jr(),Ul=["suggest","format","onState","validate","onRender","type"],Zr=()=>{};function J(){return st.apply(this,arguments)}function st(){return st=Wr(function*(i=[],{onSubmit:e=Zr,onCancel:t=Zr}={}){let r={},s=J._override||{};i=[].concat(i);let n,o,l,h,a,N,ee=function(){var H=Wr(function*(_,be,yt=!1){if(!(!yt&&_.validate&&_.validate(be)!==!0))return _.format?yield _.format(be,r):be});return function(be,yt){return H.apply(this,arguments)}}();var y=Jl(i),q;try{for(y.s();!(q=y.n()).done;){o=q.value;var me=o;if(h=me.name,a=me.type,typeof a=="function"&&(a=yield a(n,Ur({},r),o),o.type=a),!!a){for(let H in o){if(Ul.includes(H))continue;let _=o[H];o[H]=typeof _=="function"?yield _(n,Ur({},r),N):_}if(N=o,typeof o.message!="string")throw new Error("prompt message is required");var vt=o;if(h=vt.name,a=vt.type,rt[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(s[o.name]!==void 0&&(n=yield ee(o,s[o.name]),n!==void 0)){r[h]=n;continue}try{n=J._injected?Bl(J._injected,o.initial):yield rt[a](o),r[h]=n=yield ee(o,n,!0),l=yield e(o,n,r)}catch(H){l=!(yield t(o,r))}if(l)return r}}}catch(H){y.e(H)}finally{y.f()}return r}),st.apply(this,arguments)}function Bl(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function zl(i){J._injected=(J._injected||[]).concat(i)}function Wl(i){J._override=Object.assign({},i)}Kr.exports=Object.assign(J,{prompt:J,prompts:rt,inject:zl,override:Wl})});var es=u((la,Qr)=>{"use strict";Qr.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var Ae=u((ha,ts)=>{"use strict";ts.exports=i=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var ss=u((ua,rs)=>{"use strict";var Zl=Ae(),{erase:is,cursor:Kl}=b(),Xl=i=>[...Zl(i)].length;rs.exports=function(i,e){if(!e)return is.line+Kl.to(0);let t=0,r=i.split(/\r?\n/);for(let s of r)t+=1+Math.floor(Math.max(Xl(s)-1,0)/e);return is.lines(t)}});var nt=u((aa,ns)=>{"use strict";var ce={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Ql={arrowUp:ce.arrowUp,arrowDown:ce.arrowDown,arrowLeft:ce.arrowLeft,arrowRight:ce.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},eh=process.platform==="win32"?Ql:ce;ns.exports=eh});var ls=u((ca,os)=>{"use strict";var X=g(),W=nt(),ot=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),th=i=>ot[i]||ot.default,de=Object.freeze({aborted:X.red(W.cross),done:X.green(W.tick),exited:X.yellow(W.cross),default:X.cyan("?")}),ih=(i,e,t)=>e?de.aborted:t?de.exited:i?de.done:de.default,rh=i=>X.gray(i?W.ellipsis:W.pointerSmall),sh=(i,e)=>X.gray(i?e?W.pointerSmall:"+":W.line);os.exports={styles:ot,render:th,symbols:de,symbol:ih,delimiter:rh,item:sh}});var us=u((da,hs)=>{"use strict";var nh=Ae();hs.exports=function(i,e){let t=String(nh(i)||"").split(/\r?\n/);return e?t.map(r=>Math.ceil(r.length/e)).reduce((r,s)=>r+s):t.length}});var cs=u((fa,as)=>{"use strict";as.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",r=e.width;return(i||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+t.length>=r||n[n.length-1].length+o.length+1<r?n[n.length-1]+=` ${o}`:n.push(`${t}${o}`),n),[t]).join(`
58
58
  `)).join(`
59
- `)}});var dr=u((ua,cr)=>{"use strict";cr.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var O=u((aa,fr)=>{"use strict";fr.exports={action:Qs(),clear:sr(),style:or(),strip:je(),figures:nt(),lines:lr(),wrap:ar(),entriesToDisplay:dr()}});var R=u((ca,gr)=>{"use strict";var pr=require("readline"),{action:rl}=O(),nl=require("events"),{beep:ol,cursor:hl}=b(),ll=m(),mr=class extends nl{constructor(e={}){super();this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=pr.createInterface({input:this.in,escapeCodeTimeout:50});pr.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(n,o)=>{let h=rl(o,s);h===!1?this._&&this._(n,o):typeof this[h]=="function"?this[h](o):this.bell()};this.close=()=>{this.out.write(hl.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(ol)}render(){this.onRender(ll),this.firstRender&&(this.firstRender=!1)}};gr.exports=mr});var yr=u((da,vr)=>{var Ee=m(),ul=R(),{erase:al,cursor:fe}=b(),{style:ht,clear:lt,lines:cl,figures:dl}=O(),br=class extends ul{constructor(e={}){super(e);this.transform=ht.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=lt("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Ee.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
59
+ `)}});var fs=u((pa,ds)=>{"use strict";ds.exports=(i,e,t)=>{t=t||e;let r=Math.min(e-t,i-Math.floor(t/2));r<0&&(r=0);let s=Math.min(r+t,e);return{startIndex:r,endIndex:s}}});var O=u((ga,ps)=>{"use strict";ps.exports={action:es(),clear:ss(),style:ls(),strip:Ae(),figures:nt(),lines:us(),wrap:cs(),entriesToDisplay:fs()}});var R=u((ma,bs)=>{"use strict";var gs=require("readline"),{action:oh}=O(),lh=require("events"),{beep:hh,cursor:uh}=b(),ah=g(),ms=class extends lh{constructor(e={}){super();this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=gs.createInterface({input:this.in,escapeCodeTimeout:50});gs.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let r=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let l=oh(o,r);l===!1?this._&&this._(n,o):typeof this[l]=="function"?this[l](o):this.bell()};this.close=()=>{this.out.write(uh.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(hh)}render(){this.onRender(ah),this.firstRender&&(this.firstRender=!1)}};bs.exports=ms});var ws=u((ba,ys)=>{var je=g(),ch=R(),{erase:dh,cursor:fe}=b(),{style:lt,clear:ht,lines:fh,figures:ph}=O(),vs=class extends ch{constructor(e={}){super(e);this.transform=lt.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=ht("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=je.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
60
60
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
61
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fe.down(cl(this.outputError,this.out.columns)-1)+lt(this.outputError,this.out.columns)),this.out.write(lt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ht.symbol(this.done,this.aborted),Ee.bold(this.msg),ht.delimiter(this.done),this.red?Ee.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
62
- `).reduce((e,t,s)=>e+`
63
- ${s?" ":dl.pointerSmall} ${Ee.red().italic(t)}`,"")),this.out.write(al.line+fe.to(0)+this.outputText+fe.save+this.outputError+fe.restore+fe.move(this.cursorOffset,0)))}};vr.exports=br});var qr=u((fa,Or)=>{"use strict";var F=m(),fl=R(),{style:wr,clear:xr,figures:Ae,wrap:pl,entriesToDisplay:ml}=O(),{cursor:gl}=b(),Sr=class extends fl{constructor(e={}){super(e);this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=xr("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
61
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let r=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${r}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:r.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fe.down(fh(this.outputError,this.out.columns)-1)+ht(this.outputError,this.out.columns)),this.out.write(ht(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[lt.symbol(this.done,this.aborted),je.bold(this.msg),lt.delimiter(this.done),this.red?je.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
62
+ `).reduce((e,t,r)=>e+`
63
+ ${r?" ":ph.pointerSmall} ${je.red().italic(t)}`,"")),this.out.write(dh.line+fe.to(0)+this.outputText+fe.save+this.outputError+fe.restore+fe.move(this.cursorOffset,0)))}};ys.exports=vs});var Ps=u((va,qs)=>{"use strict";var F=g(),gh=R(),{style:xs,clear:Ss,figures:Ee,wrap:mh,entriesToDisplay:bh}=O(),{cursor:vh}=b(),Os=class extends gh{constructor(e={}){super(e);this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,r)=>(typeof t=="string"&&(t={title:t,value:r}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Ss("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
64
64
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
65
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(gl.hide):this.out.write(xr(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=ml(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[wr.symbol(this.done,this.aborted),F.bold(this.msg),wr.delimiter(!1),this.done?this.selection.title:this.selection.disabled?F.yellow(this.warn):F.gray(this.hint)].join(" "),!this.done){this.outputText+=`
66
- `;for(let s=e;s<t;s++){let r,n,o="",h=this.choices[s];s===e&&e>0?n=Ae.arrowUp:s===t-1&&t<this.choices.length?n=Ae.arrowDown:n=" ",h.disabled?(r=this.cursor===s?F.gray().underline(h.title):F.strikethrough().gray(h.title),n=(this.cursor===s?F.bold().gray(Ae.pointer)+" ":" ")+n):(r=this.cursor===s?F.cyan().underline(h.title):h.title,n=(this.cursor===s?F.cyan(Ae.pointer)+" ":" ")+n,h.description&&this.cursor===s&&(o=` - ${h.description}`,(n.length+r.length+o.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(o=`
67
- `+pl(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${r}${F.gray(o)}
68
- `}}this.out.write(this.outputText)}};Or.exports=Sr});var Cr=u((pa,$r)=>{var Re=m(),bl=R(),{style:Mr,clear:vl}=O(),{cursor:Pr,erase:yl}=b(),Tr=class extends bl{constructor(e={}){super(e);this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
65
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(vh.hide):this.out.write(Ss(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=bh(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[xs.symbol(this.done,this.aborted),F.bold(this.msg),xs.delimiter(!1),this.done?this.selection.title:this.selection.disabled?F.yellow(this.warn):F.gray(this.hint)].join(" "),!this.done){this.outputText+=`
66
+ `;for(let r=e;r<t;r++){let s,n,o="",l=this.choices[r];r===e&&e>0?n=Ee.arrowUp:r===t-1&&t<this.choices.length?n=Ee.arrowDown:n=" ",l.disabled?(s=this.cursor===r?F.gray().underline(l.title):F.strikethrough().gray(l.title),n=(this.cursor===r?F.bold().gray(Ee.pointer)+" ":" ")+n):(s=this.cursor===r?F.cyan().underline(l.title):l.title,n=(this.cursor===r?F.cyan(Ee.pointer)+" ":" ")+n,l.description&&this.cursor===r&&(o=` - ${l.description}`,(n.length+s.length+o.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(o=`
67
+ `+mh(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${F.gray(o)}
68
+ `}}this.out.write(this.outputText)}};qs.exports=Os});var Is=u((ya,$s)=>{var Re=g(),yh=R(),{style:Ms,clear:wh}=O(),{cursor:Cs,erase:xh}=b(),Ts=class extends yh{constructor(e={}){super(e);this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
69
69
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
70
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Pr.hide):this.out.write(vl(this.outputText,this.out.columns)),super.render(),this.outputText=[Mr.symbol(this.done,this.aborted),Re.bold(this.msg),Mr.delimiter(this.done),this.value?this.inactive:Re.cyan().underline(this.inactive),Re.gray("/"),this.value?Re.cyan().underline(this.active):this.active].join(" "),this.out.write(yl.line+Pr.to(0)+this.outputText))}};$r.exports=Tr});var C=u((ma,Dr)=>{"use strict";var pe=class{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof pe)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof pe)}toString(){return String(this.date)}};Dr.exports=pe});var kr=u((ga,_r)=>{"use strict";var wl=C(),Ir=class extends wl{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};_r.exports=Ir});var Ar=u((ba,Er)=>{"use strict";var xl=C(),Sl=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),jr=class extends xl{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Sl(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Er.exports=jr});var Yr=u((va,Fr)=>{"use strict";var Ol=C(),Rr=class extends Ol{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Fr.exports=Rr});var Lr=u((ya,Nr)=>{"use strict";var ql=C(),Hr=class extends ql{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Nr.exports=Hr});var Gr=u((wa,Jr)=>{"use strict";var Ml=C(),Vr=class extends Ml{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Jr.exports=Vr});var zr=u((xa,Br)=>{"use strict";var Pl=C(),Ur=class extends Pl{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Br.exports=Ur});var Kr=u((Sa,Zr)=>{"use strict";var Tl=C(),Wr=class extends Tl{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Zr.exports=Wr});var en=u((Oa,Qr)=>{"use strict";var $l=C(),Xr=class extends $l{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Qr.exports=Xr});var sn=u((qa,tn)=>{"use strict";tn.exports={DatePart:C(),Meridiem:kr(),Day:Ar(),Hours:Yr(),Milliseconds:Lr(),Minutes:Gr(),Month:zr(),Seconds:Kr(),Year:en()}});var cn=u((Ma,an)=>{"use strict";var ut=m(),Cl=R(),{style:rn,clear:nn,figures:Dl}=O(),{erase:Il,cursor:on}=b(),{DatePart:hn,Meridiem:_l,Day:kl,Hours:jl,Milliseconds:El,Minutes:Al,Month:Rl,Seconds:Fl,Year:Yl}=sn(),Hl=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,ln={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new kl(i),3:i=>new Rl(i),4:i=>new Yl(i),5:i=>new _l(i),6:i=>new jl(i),7:i=>new Al(i),8:i=>new Fl(i),9:i=>new El(i)},Nl={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(",")},un=class extends Cl{constructor(e={}){super(e);this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Nl,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=nn("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=Hl.exec(e);){let r=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in ln?ln[n]({token:t[n]||r,date:this.date,parts:this.parts,locales:this.locales}):t[n]||r)}let s=this.parts.reduce((r,n)=>(typeof n=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=n:r.push(n),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof hn)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
70
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Cs.hide):this.out.write(wh(this.outputText,this.out.columns)),super.render(),this.outputText=[Ms.symbol(this.done,this.aborted),Re.bold(this.msg),Ms.delimiter(this.done),this.value?this.inactive:Re.cyan().underline(this.inactive),Re.gray("/"),this.value?Re.cyan().underline(this.active):this.active].join(" "),this.out.write(xh.line+Cs.to(0)+this.outputText))}};$s.exports=Ts});var $=u((wa,Ds)=>{"use strict";var pe=class{constructor({token:e,date:t,parts:r,locales:s}){this.token=e,this.date=t||new Date,this.parts=r||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,r)=>r>e&&t instanceof pe)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((r,s)=>s>t&&r instanceof pe)}toString(){return String(this.date)}};Ds.exports=pe});var As=u((xa,ks)=>{"use strict";var Sh=$(),_s=class extends Sh{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};ks.exports=_s});var Rs=u((Sa,Es)=>{"use strict";var Oh=$(),qh=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),js=class extends Oh{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+qh(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Es.exports=js});var Ns=u((Oa,Ys)=>{"use strict";var Ph=$(),Fs=class extends Ph{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Ys.exports=Fs});var Vs=u((qa,Ls)=>{"use strict";var Mh=$(),Hs=class extends Mh{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Ls.exports=Hs});var Us=u((Pa,Gs)=>{"use strict";var Ch=$(),Js=class extends Ch{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Gs.exports=Js});var Ws=u((Ma,zs)=>{"use strict";var Th=$(),Bs=class extends Th{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};zs.exports=Bs});var Xs=u((Ca,Ks)=>{"use strict";var $h=$(),Zs=class extends $h{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ks.exports=Zs});var tn=u((Ta,en)=>{"use strict";var Ih=$(),Qs=class extends Ih{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};en.exports=Qs});var sn=u(($a,rn)=>{"use strict";rn.exports={DatePart:$(),Meridiem:As(),Day:Rs(),Hours:Ns(),Milliseconds:Vs(),Minutes:Us(),Month:Ws(),Seconds:Xs(),Year:tn()}});var dn=u((Ia,cn)=>{"use strict";var ut=g(),Dh=R(),{style:nn,clear:on,figures:_h}=O(),{erase:kh,cursor:ln}=b(),{DatePart:hn,Meridiem:Ah,Day:jh,Hours:Eh,Milliseconds:Rh,Minutes:Fh,Month:Yh,Seconds:Nh,Year:Hh}=sn(),Lh=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,un={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new jh(i),3:i=>new Yh(i),4:i=>new Hh(i),5:i=>new Ah(i),6:i=>new Eh(i),7:i=>new Fh(i),8:i=>new Nh(i),9:i=>new Rh(i)},Vh={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(",")},an=class extends Dh{constructor(e={}){super(e);this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Vh,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=on("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=Lh.exec(e);){let s=t.shift(),n=t.findIndex(o=>o!=null);this.parts.push(n in un?un[n]({token:t[n]||s,date:this.date,parts:this.parts,locales:this.locales}):t[n]||s)}let r=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...r),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof hn)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
71
71
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
72
- `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof hn)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(on.hide):this.out.write(nn(this.outputText,this.out.columns)),super.render(),this.outputText=[rn.symbol(this.done,this.aborted),ut.bold(this.msg),rn.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?ut.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
73
- `).reduce((e,t,s)=>e+`
74
- ${s?" ":Dl.pointerSmall} ${ut.red().italic(t)}`,"")),this.out.write(Il.line+on.to(0)+this.outputText))}};an.exports=un});var gn=u((Pa,mn)=>{var Fe=m(),Ll=R(),{cursor:Ye,erase:Vl}=b(),{style:at,figures:Jl,clear:dn,lines:Gl}=O(),Ul=/[0-9]/,ct=i=>i!==void 0,fn=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},pn=class extends Ll{constructor(e={}){super(e);this.transform=at.render(e.style),this.msg=e.message,this.initial=ct(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ct(e.min)?e.min:-1/0,this.max=ct(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Fe.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${fn(e,this.round)}`),this._value=fn(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||Ul.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
72
+ `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof hn)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(ln.hide):this.out.write(on(this.outputText,this.out.columns)),super.render(),this.outputText=[nn.symbol(this.done,this.aborted),ut.bold(this.msg),nn.delimiter(!1),this.parts.reduce((e,t,r)=>e.concat(r===this.cursor&&!this.done?ut.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
73
+ `).reduce((e,t,r)=>e+`
74
+ ${r?" ":_h.pointerSmall} ${ut.red().italic(t)}`,"")),this.out.write(kh.line+ln.to(0)+this.outputText))}};cn.exports=an});var bn=u((Da,mn)=>{var Fe=g(),Jh=R(),{cursor:Ye,erase:Gh}=b(),{style:at,figures:Uh,clear:fn,lines:Bh}=O(),zh=/[0-9]/,ct=i=>i!==void 0,pn=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},gn=class extends Jh{constructor(e={}){super(e);this.transform=at.render(e.style),this.msg=e.message,this.initial=ct(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ct(e.min)?e.min:-1/0,this.max=ct(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Fe.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${pn(e,this.round)}`),this._value=pn(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||zh.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
75
75
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
76
- `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Ye.down(Gl(this.outputError,this.out.columns)-1)+dn(this.outputError,this.out.columns)),this.out.write(dn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[at.symbol(this.done,this.aborted),Fe.bold(this.msg),at.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Fe[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
77
- `).reduce((e,t,s)=>e+`
78
- ${s?" ":Jl.pointerSmall} ${Fe.red().italic(t)}`,"")),this.out.write(Vl.line+Ye.to(0)+this.outputText+Ye.save+this.outputError+Ye.restore))}};mn.exports=pn});var dt=u((Ta,wn)=>{"use strict";var D=m(),{cursor:Bl}=b(),zl=R(),{clear:bn,figures:J,style:vn,wrap:Wl,entriesToDisplay:Zl}=O(),yn=class extends zl{constructor(e={}){super(e);this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=bn("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
76
+ `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();let r=Date.now();if(r-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=r,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Ye.down(Bh(this.outputError,this.out.columns)-1)+fn(this.outputError,this.out.columns)),this.out.write(fn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[at.symbol(this.done,this.aborted),Fe.bold(this.msg),at.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Fe[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
77
+ `).reduce((e,t,r)=>e+`
78
+ ${r?" ":Uh.pointerSmall} ${Fe.red().italic(t)}`,"")),this.out.write(Gh.line+Ye.to(0)+this.outputText+Ye.save+this.outputError+Ye.restore))}};mn.exports=gn});var dt=u((_a,xn)=>{"use strict";var I=g(),{cursor:Wh}=b(),Zh=R(),{clear:vn,figures:G,style:yn,wrap:Kh,entriesToDisplay:Xh}=O(),wn=class extends Zh{constructor(e={}){super(e);this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,r)=>(typeof t=="string"&&(t={title:t,value:r}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=vn("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
79
79
  `),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
80
80
  `),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(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
81
81
  Instructions:
82
- ${J.arrowUp}/${J.arrowDown}: Highlight option
83
- ${J.arrowLeft}/${J.arrowRight}/[space]: Toggle selection
82
+ ${G.arrowUp}/${G.arrowDown}: Highlight option
83
+ ${G.arrowLeft}/${G.arrowRight}/[space]: Toggle selection
84
84
  `+(this.maxChoices===void 0?` a: Toggle all
85
- `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let n=(t.selected?D.green(J.radioOn):J.radioOff)+" "+r+" ",o,h;return t.disabled?o=e===s?D.gray().underline(t.title):D.strikethrough().gray(t.title):(o=e===s?D.cyan().underline(t.title):t.title,e===s&&t.description&&(h=` - ${t.description}`,(n.length+o.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h=`
86
- `+Wl(t.description,{margin:n.length,width:this.out.columns})))),n+o+D.gray(h||"")}paginateOptions(e){if(e.length===0)return D.red("No matches for this query.");let{startIndex:t,endIndex:s}=Zl(this.cursor,e.length,this.optionsPerPage),r,n=[];for(let o=t;o<s;o++)o===t&&t>0?r=J.arrowUp:o===s-1&&s<e.length?r=J.arrowDown:r=" ",n.push(this.renderOption(this.cursor,e[o],o,r));return`
85
+ `:"")+" enter/return: Complete answer":""}renderOption(e,t,r,s){let n=(t.selected?I.green(G.radioOn):G.radioOff)+" "+s+" ",o,l;return t.disabled?o=e===r?I.gray().underline(t.title):I.strikethrough().gray(t.title):(o=e===r?I.cyan().underline(t.title):t.title,e===r&&t.description&&(l=` - ${t.description}`,(n.length+o.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(l=`
86
+ `+Kh(t.description,{margin:n.length,width:this.out.columns})))),n+o+I.gray(l||"")}paginateOptions(e){if(e.length===0)return I.red("No matches for this query.");let{startIndex:t,endIndex:r}=Xh(this.cursor,e.length,this.optionsPerPage),s,n=[];for(let o=t;o<r;o++)o===t&&t>0?s=G.arrowUp:o===r-1&&r<e.length?s=G.arrowDown:s=" ",n.push(this.renderOption(this.cursor,e[o],o,s));return`
87
87
  `+n.join(`
88
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[D.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(D.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Bl.hide),super.render();let e=[vn.symbol(this.done,this.aborted),D.bold(this.msg),vn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=D.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=bn(e,this.out.columns)}};wn.exports=yn});var Pn=u(($a,Mn)=>{"use strict";var me=m(),Kl=R(),{erase:Xl,cursor:xn}=b(),{style:ft,clear:Sn,figures:pt,wrap:Ql,entriesToDisplay:eu}=O(),On=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),tu=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),iu=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},qn=class extends Kl{constructor(e={}){super(e);this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:iu(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=ft.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Sn("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=On(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),s=await t;if(this.completing!==t)return;this.suggestions=s.map((n,o,h)=>({title:tu(h,o),value:On(h,o),description:n.description})),this.completing=!1;let r=Math.max(s.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
88
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[I.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(I.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Wh.hide),super.render();let e=[yn.symbol(this.done,this.aborted),I.bold(this.msg),yn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=I.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=vn(e,this.out.columns)}};xn.exports=wn});var Cn=u((ka,Mn)=>{"use strict";var ge=g(),Qh=R(),{erase:eu,cursor:Sn}=b(),{style:ft,clear:On,figures:pt,wrap:tu,entriesToDisplay:iu}=O(),qn=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),ru=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),su=(i,e)=>{let t=i.findIndex(r=>r.value===e||r.title===e);return t>-1?t:void 0},Pn=class extends Qh{constructor(e={}){super(e);this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:su(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=ft.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=On("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=qn(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),r=await t;if(this.completing!==t)return;this.suggestions=r.map((n,o,l)=>({title:ru(l,o),value:qn(l,o),description:n.description})),this.completing=!1;let s=Math.max(r.length-1,0);this.moveSelect(Math.min(s,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
89
89
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
90
90
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
91
- `),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${e}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,s,r){let n,o=s?pt.arrowUp:r?pt.arrowDown:" ",h=t?me.cyan().underline(e.title):e.title;return o=(t?me.cyan(pt.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+h.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
92
- `+Ql(e.description,{margin:3,width:this.out.columns}))),o+" "+h+me.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(xn.hide):this.out.write(Sn(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=eu(this.select,this.choices.length,this.limit);if(this.outputText=[ft.symbol(this.done,this.aborted,this.exited),me.bold(this.msg),ft.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(e,t).map((r,n)=>this.renderOption(r,this.select===n+e,n===0&&e>0,n+e===t-1&&t<this.choices.length)).join(`
91
+ `),this.close()}_(e,t){let r=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${r}${e}${s}`,this.cursor=r.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,t,r,s){let n,o=r?pt.arrowUp:s?pt.arrowDown:" ",l=t?ge.cyan().underline(e.title):e.title;return o=(t?ge.cyan(pt.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+l.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
92
+ `+tu(e.description,{margin:3,width:this.out.columns}))),o+" "+l+ge.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Sn.hide):this.out.write(On(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=iu(this.select,this.choices.length,this.limit);if(this.outputText=[ft.symbol(this.done,this.aborted,this.exited),ge.bold(this.msg),ft.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let r=this.suggestions.slice(e,t).map((s,n)=>this.renderOption(s,this.select===n+e,n===0&&e>0,n+e===t-1&&t<this.choices.length)).join(`
93
93
  `);this.outputText+=`
94
- `+(s||me.gray(this.fallback.title))}this.out.write(Xl.line+xn.to(0)+this.outputText)}};Mn.exports=qn});var In=u((Ca,Dn)=>{"use strict";var Y=m(),{cursor:su}=b(),ru=dt(),{clear:Tn,style:$n,figures:X}=O(),Cn=class extends ru{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Tn("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
94
+ `+(r||ge.gray(this.fallback.title))}this.out.write(eu.line+Sn.to(0)+this.outputText)}};Mn.exports=Pn});var _n=u((Aa,Dn)=>{"use strict";var Y=g(),{cursor:nu}=b(),ou=dt(),{clear:Tn,style:$n,figures:Q}=O(),In=class extends ou{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Tn("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(r=>this.inputValue?!!(typeof r.title=="string"&&r.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof r.value=="string"&&r.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let t=this.filteredOptions.findIndex(r=>r===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
95
95
  Instructions:
96
- ${X.arrowUp}/${X.arrowDown}: Highlight option
97
- ${X.arrowLeft}/${X.arrowRight}/[space]: Toggle selection
96
+ ${Q.arrowUp}/${Q.arrowDown}: Highlight option
97
+ ${Q.arrowLeft}/${Q.arrowRight}/[space]: Toggle selection
98
98
  [a,b,c]/delete: Filter choices
99
99
  enter/return: Complete answer
100
100
  `:""}renderCurrentInput(){return`
101
101
  Filtered results for: ${this.inputValue?this.inputValue:Y.gray("Enter something to filter")}
102
- `}renderOption(e,t,s){let r;return t.disabled?r=e===s?Y.gray().underline(t.title):Y.strikethrough().gray(t.title):r=e===s?Y.cyan().underline(t.title):t.title,(t.selected?Y.green(X.radioOn):X.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[Y.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Y.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(su.hide),super.render();let e=[$n.symbol(this.done,this.aborted),Y.bold(this.msg),$n.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Y.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Tn(e,this.out.columns)}};Dn.exports=Cn});var Rn=u((Da,An)=>{var _n=m(),nu=R(),{style:kn,clear:ou}=O(),{erase:hu,cursor:jn}=b(),En=class extends nu{constructor(e={}){super(e);this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
102
+ `}renderOption(e,t,r){let s;return t.disabled?s=e===r?Y.gray().underline(t.title):Y.strikethrough().gray(t.title):s=e===r?Y.cyan().underline(t.title):t.title,(t.selected?Y.green(Q.radioOn):Q.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[Y.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Y.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(nu.hide),super.render();let e=[$n.symbol(this.done,this.aborted),Y.bold(this.msg),$n.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Y.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Tn(e,this.out.columns)}};Dn.exports=In});var Fn=u((ja,Rn)=>{var kn=g(),lu=R(),{style:An,clear:hu}=O(),{erase:uu,cursor:jn}=b(),En=class extends lu{constructor(e={}){super(e);this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
103
103
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
104
- `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(jn.hide):this.out.write(ou(this.outputText,this.out.columns)),super.render(),this.outputText=[kn.symbol(this.done,this.aborted),_n.bold(this.msg),kn.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:_n.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(hu.line+jn.to(0)+this.outputText))}};An.exports=En});var Yn=u((Ia,Fn)=>{"use strict";Fn.exports={TextPrompt:yr(),SelectPrompt:qr(),TogglePrompt:Cr(),DatePrompt:cn(),NumberPrompt:gn(),MultiselectPrompt:dt(),AutocompletePrompt:Pn(),AutocompleteMultiselectPrompt:In(),ConfirmPrompt:Rn()}});var Nn=u(Hn=>{"use strict";var x=Hn,lu=Yn(),He=i=>i;function I(i,e,t={}){return new Promise((s,r)=>{let n=new lu[i](e),o=t.onAbort||He,h=t.onSubmit||He,l=t.onExit||He;n.on("state",e.onState||He),n.on("submit",a=>s(h(a))),n.on("exit",a=>s(l(a))),n.on("abort",a=>r(o(a)))})}x.text=i=>I("TextPrompt",i);x.password=i=>(i.style="password",x.text(i));x.invisible=i=>(i.style="invisible",x.text(i));x.number=i=>I("NumberPrompt",i);x.date=i=>I("DatePrompt",i);x.confirm=i=>I("ConfirmPrompt",i);x.list=i=>{let e=i.separator||",";return I("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};x.toggle=i=>I("TogglePrompt",i);x.select=i=>I("SelectPrompt",i);x.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return I("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};x.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return I("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var uu=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));x.autocomplete=i=>(i.suggest=i.suggest||uu,i.choices=[].concat(i.choices||[]),I("AutocompletePrompt",i))});var Jn=u((ka,Vn)=>{"use strict";var mt=Nn(),au=["suggest","format","onState","validate","onRender","type"],Ln=()=>{};async function G(i=[],{onSubmit:e=Ln,onCancel:t=Ln}={}){let s={},r=G._override||{};i=[].concat(i);let n,o,h,l,a,Q,ee=async(v,q,ge=!1)=>{if(!(!ge&&v.validate&&v.validate(q)!==!0))return v.format?await v.format(q,s):q};for(o of i)if({name:l,type:a}=o,typeof a=="function"&&(a=await a(n,Ne({},s),o),o.type=a),!!a){for(let v in o){if(au.includes(v))continue;let q=o[v];o[v]=typeof q=="function"?await q(n,Ne({},s),Q):q}if(Q=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:l,type:a}=o,mt[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[o.name]!==void 0&&(n=await ee(o,r[o.name]),n!==void 0)){s[l]=n;continue}try{n=G._injected?cu(G._injected,o.initial):await mt[a](o),s[l]=n=await ee(o,n,!0),h=await e(o,n,s)}catch(v){h=!await t(o,s)}if(h)return s}return s}function cu(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function du(i){G._injected=(G._injected||[]).concat(i)}function fu(i){G._override=Object.assign({},i)}Vn.exports=Object.assign(G,{prompt:G,prompts:mt,inject:du,override:fu})});var Un=u((ja,Gn)=>{function pu(i){i=(Array.isArray(i)?i:i.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<i.length;e++){if(t[e]>i[e])return!1;if(i[e]>t[e])return!0}return!1}Gn.exports=pu("8.6.0")?Ks():Jn()});var Xn=N(require("path"));var It=N(require("fs"));"use strict";var Le,Ot,qt,Mt,Pt=!0;typeof process!="undefined"&&({FORCE_COLOR:Le,NODE_DISABLE_COLORS:Ot,NO_COLOR:qt,TERM:Mt}=process.env,Pt=process.stdout&&process.stdout.isTTY);var c={enabled:!Ot&&qt==null&&Mt!=="dumb"&&(Le!=null&&Le!=="0"||Pt),reset:f(0,0),bold:f(1,22),dim:f(2,22),italic:f(3,23),underline:f(4,24),inverse:f(7,27),hidden:f(8,28),strikethrough:f(9,29),black:f(30,39),red:f(31,39),green:f(32,39),yellow:f(33,39),blue:f(34,39),magenta:f(35,39),cyan:f(36,39),white:f(37,39),gray:f(90,39),grey:f(90,39),bgBlack:f(40,49),bgRed:f(41,49),bgGreen:f(42,49),bgYellow:f(43,49),bgBlue:f(44,49),bgMagenta:f(45,49),bgCyan:f(46,49),bgWhite:f(47,49)};function Tt(i,e){let t=0,s,r="",n="";for(;t<i.length;t++)s=i[t],r+=s.open,n+=s.close,~e.indexOf(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return r+e+n}function ho(i,e){let t={has:i,keys:e};return t.reset=c.reset.bind(t),t.bold=c.bold.bind(t),t.dim=c.dim.bind(t),t.italic=c.italic.bind(t),t.underline=c.underline.bind(t),t.inverse=c.inverse.bind(t),t.hidden=c.hidden.bind(t),t.strikethrough=c.strikethrough.bind(t),t.black=c.black.bind(t),t.red=c.red.bind(t),t.green=c.green.bind(t),t.yellow=c.yellow.bind(t),t.blue=c.blue.bind(t),t.magenta=c.magenta.bind(t),t.cyan=c.cyan.bind(t),t.white=c.white.bind(t),t.gray=c.gray.bind(t),t.grey=c.grey.bind(t),t.bgBlack=c.bgBlack.bind(t),t.bgRed=c.bgRed.bind(t),t.bgGreen=c.bgGreen.bind(t),t.bgYellow=c.bgYellow.bind(t),t.bgBlue=c.bgBlue.bind(t),t.bgMagenta=c.bgMagenta.bind(t),t.bgCyan=c.bgCyan.bind(t),t.bgWhite=c.bgWhite.bind(t),t}function f(i,e){let t={open:`[${i}m`,close:`[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(!!~this.has.indexOf(i)||(this.has.push(i),this.keys.push(t)),s===void 0?this:c.enabled?Tt(this.keys,s+""):s+""):s===void 0?ho([i],[t]):c.enabled?Tt([t],s+""):s+""}}var M=c;var _t=N(require("path"));var y=N(require("fs"));var U=N(require("path"));function te(i){console.error(`
105
- \u274C ${M.red(i)}
106
- `),process.exit(1)}function ye(i){(0,y.existsSync)(i)&&te(`Directory "${i}" already exists. Please either remove this directory, or choose another location.`)}function we(i){return i.toLocaleLowerCase().replace(/ /g,"-")}function xe(i){return(0,U.resolve)(process.cwd(),i)}function Se(i,e){let t=(0,y.readdirSync)(i);for(let s of t){let r=(0,U.join)(i,s),n=(0,U.join)(e,s),o=(0,y.statSync)(r);o.isDirectory()?((0,y.mkdirSync)(n),Se(r,n)):o.isFile()&&(0,y.copyFileSync)(r,n)}}function ie(i){let e=(0,U.join)(i,"package.json");return JSON.parse((0,y.readFileSync)(e,"utf-8"))}function $t(i,e){let t=(0,U.join)(i,"package.json");(0,y.writeFileSync)(t,JSON.stringify(e,null,2)+`
107
- `)}function Ct(i){return i.toLocaleLowerCase().split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Oe(i,e,t){if(e[t]){i[t]?Object.assign(i[t],e[t]):i[t]=e[t];let s={},r=Object.keys(i[t]).sort();for(let n of r)s[n]=i[t][n];i[t]=s}}function Dt(){return lo()}function lo(){try{return process.cwd().startsWith("/home/projects/")}catch(i){}return!1}function qe(i,e){kt(e.projectName)||te("Missing project name"),kt(e.appId)||te("Missing starter id");let t=we(e.projectName),s;Dt()?s=process.cwd():(s=xe(t),ye(s),(0,It.mkdirSync)(s,{recursive:!0}));let r=i.apps.find(o=>o.id===e.appId),n=i.servers.find(o=>o.id===e.serverId);r?uo(s,r,n):te(`Invalid starter id "${e.appId}".`)}function uo(i,e,t){Se(e.dir,i);let s=ie(e.dir);if(t){s.name+="-"+t.id,Se(t.dir,i);let o=ie(t.dir);Oe(s,o,"scripts"),Oe(s,o,"dependencies"),Oe(s,o,"devDependencies")}$t(i,s);let r=process.cwd()===i,n=(0,_t.relative)(process.cwd(),i);console.log(""),console.log(r?`\u2B50\uFE0F ${M.green("Success!")}`:`\u2B50\uFE0F ${M.green("Success! Project saved in")} ${M.yellow(n)} ${M.green("directory")}`),console.log(""),console.log(`\u{1F4DF} ${M.cyan("Next steps:")}`),r||console.log(` cd ${n}`),console.log(" npm install"),console.log(" npm start"),console.log("")}function kt(i){return typeof i=="string"&&i.trim().length>0}var Bn=N(Un());async function zn(i){console.clear(),console.log(`\u{1F4AB} ${M.cyan("Let's create a Qwik project")} \u{1F4AB}`),console.log("");let e=await(0,Bn.default)([{type:"text",name:"projectName",message:"Project name",initial:"qwik-app",validate:s=>{let r=we(s),n=xe(r);return ye(n),!0}},{type:"select",name:"appId",message:"Select a starter",choices:i.apps.map(s=>({title:s.name,value:s.id,description:s.description}))},{type:"select",name:"serverId",message:"Select a server",choices:[...i.servers.map(s=>({title:s.name,value:s.id,description:s.description})),{title:"Setup later",value:"no-hosting",description:"I'll setup my own hosting"}]}]),t={projectName:e.projectName,appId:e.appId,serverId:e.serverId};qe(i,t)}var Wn=N(require("fs")),gt=N(require("path"));function Zn(i){return{apps:Kn(i,"apps"),servers:Kn(i,"servers")}}function Kn(i,e){let t=(0,gt.join)(i,e);return(0,Wn.readdirSync)(t).map(r=>{let n=(0,gt.join)(t,r),o=ie(n);return{id:r,name:Ct(r),description:o.description,dir:n}}).sort((r,n)=>r.name<n.name?-1:r.name>n.name?1:0)}var bt=process.argv.slice(2),Qn=Zn((0,Xn.join)(__dirname,"starters"));if(bt.length>=2){let i={appId:bt[0],projectName:bt[1],serverId:"express"};qe(Qn,i)}else zn(Qn);
104
+ `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(jn.hide):this.out.write(hu(this.outputText,this.out.columns)),super.render(),this.outputText=[An.symbol(this.done,this.aborted),kn.bold(this.msg),An.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:kn.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(uu.line+jn.to(0)+this.outputText))}};Rn.exports=En});var Nn=u((Ea,Yn)=>{"use strict";Yn.exports={TextPrompt:ws(),SelectPrompt:Ps(),TogglePrompt:Is(),DatePrompt:dn(),NumberPrompt:bn(),MultiselectPrompt:dt(),AutocompletePrompt:Cn(),AutocompleteMultiselectPrompt:_n(),ConfirmPrompt:Fn()}});var Ln=u(Hn=>{"use strict";var x=Hn,au=Nn(),Ne=i=>i;function D(i,e,t={}){return new Promise((r,s)=>{let n=new au[i](e),o=t.onAbort||Ne,l=t.onSubmit||Ne,h=t.onExit||Ne;n.on("state",e.onState||Ne),n.on("submit",a=>r(l(a))),n.on("exit",a=>r(h(a))),n.on("abort",a=>s(o(a)))})}x.text=i=>D("TextPrompt",i);x.password=i=>(i.style="password",x.text(i));x.invisible=i=>(i.style="invisible",x.text(i));x.number=i=>D("NumberPrompt",i);x.date=i=>D("DatePrompt",i);x.confirm=i=>D("ConfirmPrompt",i);x.list=i=>{let e=i.separator||",";return D("TextPrompt",i,{onSubmit:t=>t.split(e).map(r=>r.trim())})};x.toggle=i=>D("TogglePrompt",i);x.select=i=>D("SelectPrompt",i);x.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(r=>r.selected).map(r=>r.value);return D("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};x.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(r=>r.selected).map(r=>r.value);return D("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var cu=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));x.autocomplete=i=>(i.suggest=i.suggest||cu,i.choices=[].concat(i.choices||[]),D("AutocompletePrompt",i))});var Gn=u((Fa,Jn)=>{"use strict";var gt=Ln(),du=["suggest","format","onState","validate","onRender","type"],Vn=()=>{};async function U(i=[],{onSubmit:e=Vn,onCancel:t=Vn}={}){let r={},s=U._override||{};i=[].concat(i);let n,o,l,h,a,N,ee=async(y,q,me=!1)=>{if(!(!me&&y.validate&&y.validate(q)!==!0))return y.format?await y.format(q,r):q};for(o of i)if({name:h,type:a}=o,typeof a=="function"&&(a=await a(n,He({},r),o),o.type=a),!!a){for(let y in o){if(du.includes(y))continue;let q=o[y];o[y]=typeof q=="function"?await q(n,He({},r),N):q}if(N=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:h,type:a}=o,gt[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(s[o.name]!==void 0&&(n=await ee(o,s[o.name]),n!==void 0)){r[h]=n;continue}try{n=U._injected?fu(U._injected,o.initial):await gt[a](o),r[h]=n=await ee(o,n,!0),l=await e(o,n,r)}catch(y){l=!await t(o,r)}if(l)return r}return r}function fu(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function pu(i){U._injected=(U._injected||[]).concat(i)}function gu(i){U._override=Object.assign({},i)}Jn.exports=Object.assign(U,{prompt:U,prompts:gt,inject:pu,override:gu})});var Bn=u((Ya,Un)=>{function mu(i){i=(Array.isArray(i)?i:i.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<i.length;e++){if(t[e]>i[e])return!1;if(i[e]>t[e])return!0}return!1}Un.exports=mu("8.6.0")?Xr():Gn()});var Qn=L(require("path"));var _t=L(require("fs"));"use strict";var Le,Ot,qt,Pt,Mt=!0;typeof process!="undefined"&&({FORCE_COLOR:Le,NODE_DISABLE_COLORS:Ot,NO_COLOR:qt,TERM:Pt}=process.env,Mt=process.stdout&&process.stdout.isTTY);var c={enabled:!Ot&&qt==null&&Pt!=="dumb"&&(Le!=null&&Le!=="0"||Mt),reset:f(0,0),bold:f(1,22),dim:f(2,22),italic:f(3,23),underline:f(4,24),inverse:f(7,27),hidden:f(8,28),strikethrough:f(9,29),black:f(30,39),red:f(31,39),green:f(32,39),yellow:f(33,39),blue:f(34,39),magenta:f(35,39),cyan:f(36,39),white:f(37,39),gray:f(90,39),grey:f(90,39),bgBlack:f(40,49),bgRed:f(41,49),bgGreen:f(42,49),bgYellow:f(43,49),bgBlue:f(44,49),bgMagenta:f(45,49),bgCyan:f(46,49),bgWhite:f(47,49)};function Ct(i,e){let t=0,r,s="",n="";for(;t<i.length;t++)r=i[t],s+=r.open,n+=r.close,~e.indexOf(r.close)&&(e=e.replace(r.rgx,r.close+r.open));return s+e+n}function ho(i,e){let t={has:i,keys:e};return t.reset=c.reset.bind(t),t.bold=c.bold.bind(t),t.dim=c.dim.bind(t),t.italic=c.italic.bind(t),t.underline=c.underline.bind(t),t.inverse=c.inverse.bind(t),t.hidden=c.hidden.bind(t),t.strikethrough=c.strikethrough.bind(t),t.black=c.black.bind(t),t.red=c.red.bind(t),t.green=c.green.bind(t),t.yellow=c.yellow.bind(t),t.blue=c.blue.bind(t),t.magenta=c.magenta.bind(t),t.cyan=c.cyan.bind(t),t.white=c.white.bind(t),t.gray=c.gray.bind(t),t.grey=c.grey.bind(t),t.bgBlack=c.bgBlack.bind(t),t.bgRed=c.bgRed.bind(t),t.bgGreen=c.bgGreen.bind(t),t.bgYellow=c.bgYellow.bind(t),t.bgBlue=c.bgBlue.bind(t),t.bgMagenta=c.bgMagenta.bind(t),t.bgCyan=c.bgCyan.bind(t),t.bgWhite=c.bgWhite.bind(t),t}function f(i,e){let t={open:`[${i}m`,close:`[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(!!~this.has.indexOf(i)||(this.has.push(i),this.keys.push(t)),r===void 0?this:c.enabled?Ct(this.keys,r+""):r+""):r===void 0?ho([i],[t]):c.enabled?Ct([t],r+""):r+""}}var P=c;var kt=L(require("path"));var v=L(require("fs"));var B=L(require("path"));function uo(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}var Tt=function(e){uo(e);let t=-1,r=0,s=-1,n=!0,o=0;for(let l=e.length-1;l>=0;--l){let h=e.charCodeAt(l);if(h===47){if(!n){r=l+1;break}continue}s===-1&&(n=!1,s=l+1),h===46?t===-1?t=l:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||s===-1||o===0||o===1&&t===s-1&&t===r+1?"":e.slice(t,s)};function te(i){console.error(`
105
+ \u274C ${P.red(i)}
106
+ `),process.exit(1)}function ye(i){(0,v.existsSync)(i)&&te(`Directory "${i}" already exists. Please either remove this directory, or choose another location.`)}function we(i){return i.toLocaleLowerCase().replace(/ /g,"-")}function xe(i){return(0,B.resolve)(process.cwd(),i)}function Se(i,e,t){let r=(0,v.readdirSync)(i);for(let s of r){let n=(0,B.join)(i,s),o=(0,B.join)(e,s),l=(0,v.statSync)(n);if(l.isDirectory())(0,v.mkdirSync)(o,{recursive:!0}),Se(n,o,t);else if(l.isFile())if(t.length>0&&[".json",".toml",".md",".html"].includes(Tt(n))){let a=(0,v.readFileSync)(n,"utf8");for(let N of t)a=a.replace(N[0],N[1]);(0,v.writeFileSync)(o,a)}else(0,v.copyFileSync)(n,o)}}function ie(i){let e=(0,B.join)(i,"package.json");return JSON.parse((0,v.readFileSync)(e,"utf-8"))}function $t(i,e){let t=(0,B.join)(i,"package.json");(0,v.writeFileSync)(t,JSON.stringify(e,null,2)+`
107
+ `)}function It(i){return i.toLocaleLowerCase().split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Oe(i,e,t){if(e[t]){i[t]?Object.assign(i[t],e[t]):i[t]=e[t];let r={},s=Object.keys(i[t]).sort();for(let n of s)r[n]=i[t][n];i[t]=r}}function Dt(){return ao()}function ao(){try{return process.cwd().startsWith("/home/projects/")}catch(i){}return!1}function qe(i,e){At(e.projectName)||te("Missing project name"),At(e.appId)||te("Missing starter id");let t=we(e.projectName),r;Dt()?r=process.cwd():(r=xe(t),ye(r),(0,_t.mkdirSync)(r,{recursive:!0}));let s=i.apps.find(o=>o.id===e.appId),n=i.servers.find(o=>o.id===e.serverId);s?co(r,s,n,e.projectName):te(`Invalid starter id "${e.appId}".`)}function co(i,e,t,r){let s=[[/\bqwik-project-name\b/g,r]];Se(e.dir,i,s);let n=ie(e.dir);if(t){n.name=r,Se(t.dir,i,s);let h=ie(t.dir);Oe(n,h,"scripts"),Oe(n,h,"dependencies"),Oe(n,h,"devDependencies")}delete n.priority,$t(i,n);let o=process.cwd()===i,l=(0,kt.relative)(process.cwd(),i);console.log(""),console.log(o?`\u2B50\uFE0F ${P.green("Success!")}`:`\u2B50\uFE0F ${P.green("Success! Project saved in")} ${P.yellow(l)} ${P.green("directory")}`),console.log(""),console.log(`\u{1F4DF} ${P.cyan("Next steps:")}`),o||console.log(` cd ${l}`),console.log(" npm install"),console.log(" npm start"),console.log("")}function At(i){return typeof i=="string"&&i.trim().length>0}var zn=L(Bn());async function Wn(i){console.clear(),console.log(`\u{1F4AB} ${P.cyan("Let's create a Qwik project")} \u{1F4AB}`),console.log("");let e=await(0,zn.default)([{type:"text",name:"projectName",message:"Project name",initial:"qwik-app",validate:r=>{let s=we(r),n=xe(s);return ye(n),!0}},{type:"select",name:"appId",message:"Select a starter",choices:i.apps.map(r=>({title:r.name,value:r.id,description:r.description}))},{type:"select",name:"serverId",message:"Select a server",choices:[...i.servers.map(r=>({title:r.name,value:r.id,description:r.description})),{title:"Setup later",value:"no-hosting",description:"I'll setup my own hosting"}]}]),t={projectName:e.projectName,appId:e.appId,serverId:e.serverId};qe(i,t)}var Zn=L(require("fs")),mt=L(require("path"));function Kn(i){return{apps:Xn(i,"apps"),servers:Xn(i,"servers")}}function Xn(i,e){let t=(0,mt.join)(i,e);return(0,Zn.readdirSync)(t).map(s=>{var h,a;let n=(0,mt.join)(t,s),o=ie(n);return{id:s,name:It(s),description:(h=o.description)!=null?h:"",dir:n,priority:(a=o.priority)!=null?a:0}}).sort((s,n)=>s.priority>n.priority?-1:s.priority<n.priority?1:s.name<n.name?-1:s.name>n.name?1:0)}var bt=process.argv.slice(2),eo=Kn((0,Qn.join)(__dirname,"starters"));if(bt.length>=2){let i={appId:bt[0],projectName:bt[1],serverId:"express"};qe(eo,i)}else Wn(eo);